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: internal compiler error: FlagConstant op should never make it to codegen #45359

ALTree opened this issue Apr 2, 2021 · 3 comments


Copy link

@ALTree ALTree commented Apr 2, 2021

$ gotip version
go version devel +254948a50e Fri Apr 2 17:58:59 2021 +0000 linux/amd64
package p

func f() {
	var i, j int
	var b bool
	i = -(i &^ i)
	for 1>>uint(i) == 0 {
		_ = func() {
			i, b = 0, true
		i %= j
$ GOARCH=arm64 gotip tool compile crash.go

crash.go:7:7: internal compiler error: 'f': FlagConstant op should never make it to codegen v62 = FlagConstant <flags>[N=true,Z=false,C=false,V=false]

goroutine 35 [running]:
runtime/debug.Stack(0xf9cf60, 0xc000126008, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0x9f
cmd/compile/internal/base.FatalfAt(0x707000000002, 0xc000178540, 0x38, 0xc000468020, 0x2, 0x2)
	/home/alberto/go/src/cmd/compile/internal/base/print.go:227 +0x1ea
cmd/compile/internal/ssagen.(*ssafn).Fatalf(0xc000409170, 0x707000000002, 0xe71564, 0x32, 0xc00010b190, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssagen/ssa.go:7356 +0x1f8
cmd/compile/internal/arm64.ssaGenValue(0xc00015fc70, 0xc000481b20)
	/home/alberto/go/src/cmd/compile/internal/arm64/ssa.go:1101 +0x2072
cmd/compile/internal/ssagen.genssa(0xc0003d56c0, 0xc00015fc00)
	/home/alberto/go/src/cmd/compile/internal/ssagen/ssa.go:6636 +0x2bde
cmd/compile/internal/ssagen.Compile(0xc00016a2c0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/ssagen/pgen.go:161 +0x298
cmd/compile/internal/gc.compileFunctions.func2.1(0xc000378310, 0xc00016a2c0, 0xc000126560, 0xc000124f40)
	/home/alberto/go/src/cmd/compile/internal/gc/compile.go:130 +0x65
created by cmd/compile/internal/gc.compileFunctions.func2
	/home/alberto/go/src/cmd/compile/internal/gc/compile.go:128 +0x8e
Copy link
Member Author

@ALTree ALTree commented Apr 2, 2021

Bisected to f5e6d3e.

cc @zhangfannie @randall77


Copy link

@erifan erifan commented Apr 6, 2021

Fannie is on vacation, I will look at this issue.


@erifan erifan self-assigned this Apr 6, 2021
Copy link

@gopherbot gopherbot commented Apr 6, 2021

Change mentions this issue: cmd/compile: fix bug of conditional instructions on arm64


@gopherbot gopherbot closed this in 8d77e45 Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants