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: make.bash with GOAMD64=v3 broken by CL 354670 #49061

Closed
mvdan opened this issue Oct 19, 2021 · 11 comments
Closed

cmd/compile: make.bash with GOAMD64=v3 broken by CL 354670 #49061

mvdan opened this issue Oct 19, 2021 · 11 comments
Labels

Comments

@mvdan
Copy link
Member

@mvdan mvdan commented Oct 19, 2021

$ git checkout 3e5cc4d6f6befb284d7b2a5142a8b576bf5970ea
$ cd src
$ GOAMD64=v3 ./make.bash
Building Go cmd/dist using /usr/lib/go. (go1.17.1 linux/amd64)
Building Go toolchain1 using /usr/lib/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
# math/big
/home/mvdan/tip/src/math/big/float.go:815:10: cannot use math.MaxInt64 (untyped int constant 18446744069414584320) as int64 value in return statement (overflows)
/home/mvdan/tip/src/math/big/float.go:824:10: cannot use math.MaxInt64 (untyped int constant 18446744069414584320) as int64 value in return statement (overflows)
# internal/xcoff
<autogenerated>:1: internal compiler error: 18446744069414584320 out of range for int64

goroutine 5 [running]:
runtime/debug.Stack()
	/home/mvdan/tip/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0xe3e190, 0x0}, {0xced98c, 0x16}, {0xc000c26668, 0x2, 0x2})
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/ir.IntVal(0xc000478000, {0xe3e190, 0xc0000d5180})
	/home/mvdan/tip/src/cmd/compile/internal/ir/val.go:55 +0xf1
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc00091e000, {0xe3fd78, 0xc0000efd10}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2590 +0xd90
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc00091e000, {0xe3fe40, 0xc0000f6c00}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2862 +0x114b
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc00091e000, {0xe3fe40, 0xc0000f6ba0}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2736 +0x2ba5
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).condBranch(0xc00091e000, {0xe3fe40, 0xc0000f6ba0}, 0xc000b51ea0, 0xc000b51fd0, 0x0)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:3452 +0x37b
cmd/compile/internal/ssagen.(*state).stmt(0xc00091e000, {0xe40d18, 0xc0000f42a0})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1674 +0x2d49
cmd/compile/internal/ssagen.(*state).stmtList(0xc00091e000, {0xc00019a000, 0x8e, 0xe3a840})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1374 +0x5d
cmd/compile/internal/ssagen.buildssa(0xc000547340, 0x2)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:567 +0x1d13
cmd/compile/internal/ssagen.Compile(0xc000547340, 0xc000061f90)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/pgen.go:183 +0x4c
cmd/compile/internal/gc.compileFunctions.func4.1(0x0)
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:153 +0x3a
cmd/compile/internal/gc.compileFunctions.func3.1()
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:140 +0x4d
created by cmd/compile/internal/gc.compileFunctions.func3
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:138 +0x78

# debug/pe
<autogenerated>:1: internal compiler error: 18446744069414584320 out of range for int64

goroutine 38 [running]:
runtime/debug.Stack()
	/home/mvdan/tip/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0xe3e190, 0x0}, {0xced98c, 0x16}, {0xc0007ba668, 0x2, 0x2})
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/ir.IntVal(0xc0003e4000, {0xe3e190, 0xc000080180})
	/home/mvdan/tip/src/cmd/compile/internal/ir/val.go:55 +0xf1
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc0004f6000, {0xe3fd78, 0xc0005925a0}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2590 +0xd90
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc0004f6000, {0xe3fe40, 0xc00055d4a0}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2862 +0x114b
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc0004f6000, {0xe3fe40, 0xc00055d440}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2736 +0x2ba5
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).condBranch(0xc0004f6000, {0xe3fe40, 0xc00055d440}, 0xc0009b6e90, 0xc0009b6fc0, 0x0)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:3452 +0x37b
cmd/compile/internal/ssagen.(*state).stmt(0xc0004f6000, {0xe40d18, 0xc0004eb650})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1674 +0x2d49
cmd/compile/internal/ssagen.(*state).stmtList(0xc0004f6000, {0xc000139000, 0x74, 0xe3a840})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1374 +0x5d
cmd/compile/internal/ssagen.buildssa(0xc0004a6160, 0x0)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:567 +0x1d13
cmd/compile/internal/ssagen.Compile(0xc0004a6160, 0xc000484f90)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/pgen.go:183 +0x4c
cmd/compile/internal/gc.compileFunctions.func4.1(0x0)
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:153 +0x3a
cmd/compile/internal/gc.compileFunctions.func3.1()
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:140 +0x4d
created by cmd/compile/internal/gc.compileFunctions.func3
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:138 +0x78

# debug/macho
<autogenerated>:1: internal compiler error: 18446744069414584320 out of range for int64

goroutine 68 [running]:
runtime/debug.Stack()
	/home/mvdan/tip/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0xe3e190, 0x0}, {0xced98c, 0x16}, {0xc0004e4668, 0x2, 0x2})
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/ir.IntVal(0xc0003ec000, {0xe3e190, 0xc0007759c0})
	/home/mvdan/tip/src/cmd/compile/internal/ir/val.go:55 +0xf1
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc0004be000, {0xe3fd78, 0xc000b5e050}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2590 +0xd90
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc0004be000, {0xe3fe40, 0xc000b55ce0}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2862 +0x114b
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc0004be000, {0xe3fe40, 0xc000b55c80}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2736 +0x2ba5
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).condBranch(0xc0004be000, {0xe3fe40, 0xc000b55c80}, 0xc000a36e90, 0xc000a36fc0, 0x0)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:3452 +0x37b
cmd/compile/internal/ssagen.(*state).stmt(0xc0004be000, {0xe40d18, 0xc000b41960})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1674 +0x2d49
cmd/compile/internal/ssagen.(*state).stmtList(0xc0004be000, {0xc000376b00, 0xf, 0xe3a840})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1374 +0x5d
cmd/compile/internal/ssagen.buildssa(0xc0009442c0, 0x0)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:567 +0x1d13
cmd/compile/internal/ssagen.Compile(0xc0009442c0, 0xc000d0ff90)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/pgen.go:183 +0x4c
cmd/compile/internal/gc.compileFunctions.func4.1(0x0)
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:153 +0x3a
cmd/compile/internal/gc.compileFunctions.func3.1()
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:140 +0x4d
created by cmd/compile/internal/gc.compileFunctions.func3
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:138 +0x78

# debug/elf
<autogenerated>:1: internal compiler error: 18446744069414584320 out of range for int64

goroutine 63 [running]:
runtime/debug.Stack()
	/home/mvdan/tip/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0xe3e190, 0x0}, {0xced98c, 0x16}, {0xc001488668, 0x2, 0x2})
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
	/home/mvdan/tip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/ir.IntVal(0xc000364000, {0xe3e190, 0xc00086d120})
	/home/mvdan/tip/src/cmd/compile/internal/ir/val.go:55 +0xf1
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc001451400, {0xe3fd78, 0xc000895f90}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2590 +0xd90
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc001451400, {0xe3fe40, 0xc000de5260}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2862 +0x114b
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).exprCheckPtr(0xc001451400, {0xe3fe40, 0xc000de51a0}, 0x1)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2736 +0x2ba5
cmd/compile/internal/ssagen.(*state).expr(...)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:2528
cmd/compile/internal/ssagen.(*state).condBranch(0xc001451400, {0xe3fe40, 0xc000de51a0}, 0xc001251ea0, 0xc001251fd0, 0x0)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:3452 +0x37b
cmd/compile/internal/ssagen.(*state).stmt(0xc001451400, {0xe40d18, 0xc000898cb0})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1674 +0x2d49
cmd/compile/internal/ssagen.(*state).stmtList(0xc001451400, {0xc0000eb700, 0xf, 0xe3a840})
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:1374 +0x5d
cmd/compile/internal/ssagen.buildssa(0xc000dd22c0, 0x2)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/ssa.go:567 +0x1d13
cmd/compile/internal/ssagen.Compile(0xc000dd22c0, 0xc001407790)
	/home/mvdan/tip/src/cmd/compile/internal/ssagen/pgen.go:183 +0x4c
cmd/compile/internal/gc.compileFunctions.func4.1(0x0)
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:153 +0x3a
cmd/compile/internal/gc.compileFunctions.func3.1()
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:140 +0x4d
created by cmd/compile/internal/gc.compileFunctions.func3
	/home/mvdan/tip/src/cmd/compile/internal/gc/compile.go:138 +0x78

# cmd/internal/obj/arm64
/home/mvdan/tip/src/cmd/internal/obj/arm64/list7.go:60:47: cannot use obj.RegListARM64Hi (untyped int constant 18446744069414584320) as int64 value in argument to obj.RegisterRegisterList (overflows)
# cmd/internal/obj/x86
/home/mvdan/tip/src/cmd/internal/obj/x86/list6.go:245:45: cannot use obj.RegListX86Hi (untyped int constant 18446744069414584320) as int64 value in argument to obj.RegisterRegisterList (overflows)
go tool dist: FAILED: /home/mvdan/tip/pkg/tool/linux_amd64/go_bootstrap install -gcflags=all= -ldflags=all= -a -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2

I ran into this make.bash crash when pulling master and rebuilding. I bisected the 20 or so commits and ended up with this culprit, which looks like it's the cause.

The build works without setting GOAMD64, i.e. with v1. I will start a revert of that CL to unblock master.

@mvdan mvdan added the NeedsFix label Oct 19, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 19, 2021

Change https://golang.org/cl/356790 mentions this issue: Revert "cmd/compile: use MOVBE instruction for GOAMD64>=v3"

Loading

@zchee
Copy link
Contributor

@zchee zchee commented Oct 19, 2021

@mvdan FYI, revert 3e5cc4d but still can't compile with the same error.
ref:

Loading

@mvdan
Copy link
Member Author

@mvdan mvdan commented Oct 19, 2021

Are you sure? I just built with it without a problem.

Loading

@zchee
Copy link
Contributor

@zchee zchee commented Oct 19, 2021

Hmm, I'll try again soon.

Loading

@mvdan
Copy link
Member Author

@mvdan mvdan commented Oct 19, 2021

$ go version
go version devel go1.18-6faf52aa2f Tue Oct 19 10:30:35 2021 +0100 linux/amd64
$ git log -1 6faf52aa2f
commit 6faf52aa2fe0dd4b13b467e165a668ee6ea3837a (HEAD -> master)
Author: Daniel Martí <mvdan@mvdan.cc>
Date:   Tue Oct 19 09:09:55 2021 +0000

    Revert "cmd/compile: use MOVBE instruction for GOAMD64>=v3"
    
    This reverts CL 354670.
    
    Reason for revert: broke make.bash with GOAMD64=v3.
    
    Fixes #49061.
    
    Change-Id: I7f2ed99b7c10100c4e0c1462ea91c4c9d8c609b2
$ go env GOAMD64
v3

Loading

@zchee
Copy link
Contributor

@zchee zchee commented Oct 19, 2021

ah, gotcha. If no GOEXPERIMENT, can compile. but

GOROOT_BOOTSTRAP=~/sdk/go1.17.2 GOEXPERIMENT='staticlockranking' GOAMD64=v3 ./make.bash
or
GOROOT_BOOTSTRAP=~/sdk/gotip GOEXPERIMENT='unified' GOAMD64=v3 ./make.bash

are still fail. (at least darwin GOOS)

Loading

@mvdan
Copy link
Member Author

@mvdan mvdan commented Oct 19, 2021

I imagine that should be a separate bug report; I don't think we have any builder continuously testing with GOEXPERIMENT and GOAMD64.

Loading

@gopherbot gopherbot closed this in b0351bf Oct 19, 2021
@zchee
Copy link
Contributor

@zchee zchee commented Oct 19, 2021

I see, I'll report separately.

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Oct 19, 2021

Loading

@zchee
Copy link
Contributor

@zchee zchee commented Oct 19, 2021

@cuonglm Thanks for info. so I don't report my issue.

BTW, what blocker of that CL?

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Oct 19, 2021

@cuonglm Thanks for info. so I don't report my issue.

BTW, what blocker of that CL?

I don't know, maybe you should try pinging participants there.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants