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

cmd/compile: panic: too many fields in an SSAable struct #19696

Closed
ALTree opened this issue Mar 24, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@ALTree
Copy link
Member

commented Mar 24, 2017

go version devel +e95989c1c1 Thu Mar 23 17:57:25 2017 +0000 linux/amd64

The following program:

package p

type s struct {
	a, b, c, d, e int
}

func Crash() {
	var i int
	arr := [0]s{}
	arr[i].a++
}

crashes the 1.8 and tip compilers.

panic: too many fields in an SSAable struct

goroutine 1 [running]:
cmd/compile/internal/ssa.StructMakeOp(0x5, 0x5)
	/home/alberto/go/src/cmd/compile/internal/ssa/decompose.go:353 +0x65
cmd/compile/internal/gc.(*state).assign(0xc4200f60e0, 0xc4202faea0, 0xc42030e708, 0x410000)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:2321 +0x159
cmd/compile/internal/gc.(*state).stmt(0xc4200f60e0, 0xc4202fae10)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:718 +0x246
cmd/compile/internal/gc.(*state).stmtList(0xc4200f60e0, 0xc4203083a0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:498 +0x5e
cmd/compile/internal/gc.buildssa(0xc4200b2140, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:172 +0x878
cmd/compile/internal/gc.compile(0xc4200b2140)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:302 +0x119
cmd/compile/internal/gc.funccompile(0xc4200b2140)
	/home/alberto/go/src/cmd/compile/internal/gc/dcl.go:1172 +0xb7
cmd/compile/internal/gc.Main(0xada2d8)
	/home/alberto/go/src/cmd/compile/internal/gc/main.go:511 +0x230c
main.main()
	/home/alberto/go/src/cmd/compile/main.go:49 +0x95

This was introduced in 7414450 (cmd/compile: make [0]T and [1]T SSAable types), and it's possibly related to #19671.

@ALTree ALTree changed the title cmd/compile: too many fields in an SSAable struct cmd/compile: panic: too many fields in an SSAable struct Mar 24, 2017

@ALTree ALTree added this to the Go1.9 milestone Mar 24, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Mar 24, 2017

CL https://golang.org/cl/38599 mentions this issue.

@gopherbot gopherbot closed this in 7202341 Mar 24, 2017

@golang golang locked and limited conversation to collaborators Mar 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.