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: small program does not pass ssachecks on arm (internal compiler error: bad AuxInt value) #25993

Closed
ALTree opened this issue Jun 21, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@ALTree
Copy link
Member

commented Jun 21, 2018

$ gotip version
go version devel +578e066862 Wed Jun 20 16:04:33 2018 +0000 linux/amd64

The following program:

package p

func f() {
	var x int
	var B0 bool
	B0 = !B0 || B0
	if B0 && B0 {
		x = -1
	}
	var AI []int
	var AB []bool
	_ = AI[x] > 0 && AB[x]
}

does not pass the ssa checks when compiled for GOARCH=arm, triggers an internal compiler error:

$ GOARCH=arm gotip tool compile -d=ssa/check/on crash.go 
crash.go:12:8: internal compiler error: bad int32 AuxInt value for v23

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xcbb48c, 0x1d, 0xc000046cc0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc00000f9e0, 0xc08000000002, 0xcbb48c, 0x1d, 0xc000046cc0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5540 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0003442c0, 0xcbb48c, 0x1d, 0xc000046cc0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:562 +0x73
cmd/compile/internal/ssa.checkFunc(0xc0003442c0)
	/home/alberto/go/src/cmd/compile/internal/ssa/check.go:140 +0x1931
cmd/compile/internal/ssa.Compile(0xc0003442c0)
	/home/alberto/go/src/cmd/compile/internal/ssa/compile.go:110 +0x3c6
cmd/compile/internal/gc.buildssa(0xc000344000, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:210 +0xaa7
cmd/compile/internal/gc.compileSSA(0xc000344000, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:259 +0x39
cmd/compile/internal/gc.compile(0xc000344000)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:238 +0x1a0
cmd/compile/internal/gc.funccompile(0xc000344000)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:209 +0xbd
cmd/compile/internal/gc.Main(0xccc458)
	/home/alberto/go/src/cmd/compile/internal/gc/main.go:637 +0x261d
main.main()
	/home/alberto/go/src/cmd/compile/main.go:51 +0x96

This also happens in go1.10, so it's not a recent regression.

@gopherbot

This comment has been minimized.

Copy link

commented Jun 21, 2018

Change https://golang.org/cl/120335 mentions this issue: cmd/compile: convert uint32 to int32 in ARM constant folding rules

@gopherbot gopherbot closed this in 78a5793 Jun 22, 2018

@ALTree ALTree modified the milestones: Go1.12, Go1.11 Jun 22, 2018

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