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: ssacheck failure on GOARCH=arm building runtime #22499

Closed
rsc opened this issue Oct 31, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@rsc
Copy link
Contributor

commented Oct 31, 2017

Discovered by accident. I can provoke an ssacheck failure on arm reliably with:

$ VM=$(gomote create linux-arm)
$ gomote push $VM
$ gomote run $VM go/src/make.bash
$ gomote run $VM go/bin/go build -a -gcflags=-d=ssa/check/on -v runtme
runtime/internal/sys
runtime/internal/atomic
runtime
# runtime
../src/runtime/malloc.go:892:14: internal compiler error: bad int32 AuxInt value for v54

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/tmp/workdir/go/src/runtime/debug/stack.go:24 +0x80
cmd/compile/internal/gc.Fatalf(0x6dc821, 0x1d, 0x121ba4d0, 0x1, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/gc/subr.go:182 +0x1c0
cmd/compile/internal/gc.(*ssafn).Fatalf(0x113ef140, 0x26, 0x37c0e, 0x6dc821, 0x1d, 0x121ba4d0, 0x1, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/gc/ssa.go:5176 +0x54
cmd/compile/internal/ssa.(*Func).Fatalf(0x12ffe1e0, 0x6dc821, 0x1d, 0x121ba4d0, 0x1, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/ssa/func.go:497 +0x64
cmd/compile/internal/ssa.checkFunc(0x12ffe1e0)
	/tmp/workdir/go/src/cmd/compile/internal/ssa/check.go:140 +0x1508
cmd/compile/internal/ssa.Compile(0x12ffe1e0)
	/tmp/workdir/go/src/cmd/compile/internal/ssa/compile.go:110 +0x31c
cmd/compile/internal/gc.buildssa(0x1161f520, 0x0, 0x0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/ssa.go:216 +0xb28
cmd/compile/internal/gc.compileSSA(0x1161f520, 0x0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/pgen.go:238 +0x24
cmd/compile/internal/gc.compile(0x1161f520)
	/tmp/workdir/go/src/cmd/compile/internal/gc/pgen.go:217 +0x208
cmd/compile/internal/gc.funccompile(0x1161f520)
	/tmp/workdir/go/src/cmd/compile/internal/gc/dcl.go:1036 +0xa4
cmd/compile/internal/gc.Main(0x6eb0a0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/main.go:618 +0x25c8
main.main()
	/tmp/workdir/go/src/cmd/compile/main.go:49 +0x7c

Error running run: exit status 2
$ 

I thought maybe the problem was 32-bit-specific, but it does not happen if I build with GOARCH=386 ./make.bash on my Mac, so maybe it is only arm-specific.

I don't know what this means, really, but I thought you'd want to see it.

/cc @randall77 @dr2chase @cherrymui

@rsc rsc added this to the Go1.10 milestone Oct 31, 2017

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2017

It is ARM specific. ssacheck complains a BICconst's AuxInt does not fit into int32. It fits into uint32 so the generated code is not affected. I'll have a CL soon.

@cherrymui cherrymui self-assigned this Oct 31, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Oct 31, 2017

Change https://golang.org/cl/74770 mentions this issue: cmd/compile: on ARM, make sure *const's AuxInt fit into int32

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2017

Seems this also happens with Go 1.9. Are we going to fix Go 1.9?

@randall77

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2017

If the generated code is correct, and this only affects the ssacheck builder, I don't see a reason to backport to 1.9.

@gopherbot gopherbot closed this in bc723cf Oct 31, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Nov 6, 2017

Change https://golang.org/cl/76024 mentions this issue: cmd/compile: enable ssacheck for tests in ssa_test.go

gopherbot pushed a commit that referenced this issue Nov 6, 2017

cmd/compile: enable ssacheck for tests in ssa_test.go
I thought SSA check was enabled for those tests, but in fact it
was not. Enable it. So we have SSA check on for at least some
tests on all architectures.

Updates #22499.

Change-Id: I51fcdda3af7faab5aeb33bf46c6db309285ce42c
Reviewed-on: https://go-review.googlesource.com/76024
Reviewed-by: Keith Randall <khr@golang.org>

@golang golang locked and limited conversation to collaborators Nov 6, 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.