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: arm64 ssacheck failure #24014

Closed
josharian opened this issue Feb 21, 2018 · 3 comments
Closed

cmd/compile: arm64 ssacheck failure #24014

josharian opened this issue Feb 21, 2018 · 3 comments

Comments

@josharian
Copy link
Contributor

$ go version
go version devel +ea8d7a370d Wed Feb 21 20:32:36 2018 +0000 darwin/amd64
$ GOOS=linux GOARCH=arm64 go build -a -v -gcflags="all=-d=ssa/check/on=1" std cmd
errors
internal/race
unicode/utf8
runtime/internal/sys
runtime/internal/atomic
sync/atomic
unicode
math/bits
internal/cpu
math
container/list
# unicode/utf8
unicode/utf8/utf8.go:247:12: internal compiler error: likeliness prediction 1 for block b20 with 0 successors

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/Users/josh/go/tip/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0x183ea3e, 0x38, 0xc000353e60, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/subr.go:182 +0x1fc
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc000353620, 0xf70c00000002, 0x183ea3e, 0x38, 0xc000353e60, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/ssa.go:5357 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0004ac500, 0x183ea3e, 0x38, 0xc000353e60, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/func.go:498 +0x73
cmd/compile/internal/ssa.checkFunc(0xc0004ac500)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/check.go:106 +0x22d4
cmd/compile/internal/ssa.Compile(0xc0004ac500)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/compile.go:110 +0x36a
cmd/compile/internal/gc.buildssa(0xc000078c00, 0x0, 0x0)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/ssa.go:222 +0xb2f
cmd/compile/internal/gc.compileSSA(0xc000078c00, 0x0)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/pgen.go:238 +0x39
cmd/compile/internal/gc.compile(0xc000078c00)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/pgen.go:217 +0x1ef
cmd/compile/internal/gc.funccompile(0xc000078c00)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/dcl.go:1040 +0xad
cmd/compile/internal/gc.Main(0x1843048)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/main.go:617 +0x270e
main.main()
	/Users/josh/go/tip/src/cmd/compile/main.go:49 +0x95

container/ring
internal/testlog
crypto/subtle
# math/bits
math/bits/bits.go:295:10: internal compiler error: likeliness prediction 1 for block b3 with 0 successors

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/Users/josh/go/tip/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0x183ea3e, 0x38, 0xc0002ed5c0, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/subr.go:182 +0x1fc
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc0002ece70, 0x1270a00000002, 0x183ea3e, 0x38, 0xc0002ed5c0, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/ssa.go:5357 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc00000f400, 0x183ea3e, 0x38, 0xc0002ed5c0, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/func.go:498 +0x73
cmd/compile/internal/ssa.checkFunc(0xc00000f400)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/check.go:106 +0x22d4
cmd/compile/internal/ssa.Compile(0xc00000f400)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/compile.go:110 +0x36a
cmd/compile/internal/gc.buildssa(0xc0003b6300, 0x0, 0x0)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/ssa.go:222 +0xb2f
cmd/compile/internal/gc.compileSSA(0xc0003b6300, 0x0)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/pgen.go:238 +0x39
cmd/compile/internal/gc.compile(0xc0003b6300)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/pgen.go:217 +0x1ef
cmd/compile/internal/gc.funccompile(0xc0003b6300)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/dcl.go:1040 +0xad
cmd/compile/internal/gc.Main(0x1843048)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/main.go:617 +0x270e
main.main()
	/Users/josh/go/tip/src/cmd/compile/main.go:49 +0x95

crypto/internal/cipherhw
vendor/golang_org/x/crypto/cryptobyte/asn1
internal/nettrace
encoding
runtime
unicode/utf16
image/color
internal/syscall/windows
internal/syscall/windows/registry
internal/syscall/windows/sysdll
plugin
runtime/race
vendor/golang_org/x/text/secure
vendor/golang_org/x/text/unicode
cmd/compile/internal/test
cmd/vendor/github.com/google/pprof/third_party/d3
cmd/vendor/github.com/google/pprof/third_party/d3tip
cmd/vendor/github.com/google/pprof/third_party/d3flamegraph
cmd/vendor/github.com/google/pprof/third_party/svgpan
cmd/vet/internal/whitelist
image/color/palette
math/cmplx
# runtime
runtime/env_posix.go:31:17: internal compiler error: likeliness prediction 1 for block b5 with 0 successors

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/Users/josh/go/tip/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0x183ea3e, 0x38, 0xc000b4b8f0, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/subr.go:182 +0x1fc
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc000b4b200, 0x1f1100000018, 0x183ea3e, 0x38, 0xc000b4b8f0, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/ssa.go:5357 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0029b6000, 0x183ea3e, 0x38, 0xc000b4b8f0, 0x3, 0x3)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/func.go:498 +0x73
cmd/compile/internal/ssa.checkFunc(0xc0029b6000)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/check.go:106 +0x22d4
cmd/compile/internal/ssa.Compile(0xc0029b6000)
	/Users/josh/go/tip/src/cmd/compile/internal/ssa/compile.go:110 +0x36a
cmd/compile/internal/gc.buildssa(0xc000db9200, 0x0, 0x0)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/ssa.go:222 +0xb2f
cmd/compile/internal/gc.compileSSA(0xc000db9200, 0x0)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/pgen.go:238 +0x39
cmd/compile/internal/gc.compile(0xc000db9200)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/pgen.go:217 +0x1ef
cmd/compile/internal/gc.funccompile(0xc000db9200)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/dcl.go:1040 +0xad
cmd/compile/internal/gc.Main(0x1843048)
	/Users/josh/go/tip/src/cmd/compile/internal/gc/main.go:617 +0x270e
main.main()
	/Users/josh/go/tip/src/cmd/compile/main.go:49 +0x95

Probably due to https://go-review.googlesource.com/c/go/+/55670, but I haven't checked.

cc @philhofer

@philhofer
Copy link
Contributor

Seems likely. Investigating.

@philhofer
Copy link
Contributor

philhofer commented Feb 21, 2018

Yeah, the fix is simple:

diff --git a/src/cmd/compile/internal/ssa/branchelim.go b/src/cmd/compile/internal/ssa/branchelim.go
index a37b8f06e1..54508985b3 100644
--- a/src/cmd/compile/internal/ssa/branchelim.go
+++ b/src/cmd/compile/internal/ssa/branchelim.go
@@ -139,6 +139,7 @@ func clobberBlock(b *Block) {
        b.Succs = nil
        b.Aux = nil
        b.SetControl(nil)
+       b.Likely = BranchUnknown
        b.Kind = BlockInvalid
 }

ssacheck is looking at an unreachable block, which the branchelim pass doesn't clobber effectively enough

I'll send a CL

@gopherbot
Copy link

Change https://golang.org/cl/96075 mentions this issue: cmd/compile/internal/ssa: clear branch likeliness in clobberBlock

@golang golang locked and limited conversation to collaborators Feb 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants