Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: crash on implicit duplicate array/slice index #28186

Closed
go101 opened this issue Oct 13, 2018 · 3 comments
Closed

gccgo: crash on implicit duplicate array/slice index #28186

go101 opened this issue Oct 13, 2018 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@go101
Copy link

go101 commented Oct 13, 2018

What version of Go are you using (go version)?

$ gccgo --version
gccgo (Debian 8.2.0-7) 8.2.0

Does this issue reproduce with the latest release?

maybe

What did you do?

package main

var f = [...]bool{3: false, 2: true, true} // the implicit index for the third element is 3

func main() {
}

What did you expect to see?

report error without crashing

What did you see instead?

crash

$ go run -compiler=gccgo aa.go
# command-line-arguments
go1: internal compiler error: in output_constructor_regular_field, at varasm.c:5142
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
@gopherbot gopherbot added this to the Gccgo milestone Oct 13, 2018
@mdcnz
Copy link

mdcnz commented Oct 15, 2018

Playground reports the error: prog.go:3:38: duplicate index in array literal: 3
https://play.golang.org/p/_fVK5DNyb2G

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 15, 2018
@benshi001
Copy link
Member

gccgo does crash with "gccgo aa.go", but doesn't with "gccgo aa.go -O2"

@gopherbot
Copy link

Change https://golang.org/cl/160832 mentions this issue: compiler: check duplicate implict indexes in slices/arrays

kraj pushed a commit to kraj/gcc that referenced this issue Feb 5, 2019
    
    Fixes golang/go#28186.
    
    Reviewed-on: https://go-review.googlesource.com/c/160832


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268554 138bc75d-0d04-0410-961f-82ee72b054a4
@golang golang locked and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants