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: tip cannot bootstrap go 1.6 #19084

Closed
mwhudson opened this issue Feb 14, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@mwhudson
Copy link
Contributor

commented Feb 14, 2017

What version of Go are you using (go version)?

go version devel +a610957 Tue Feb 14 04:41:36 2017 +0000 linux/amd64

But the bug was introduced by a833485

What did you do?

I tried to bootstrap go 1.6 with go tip.

What did you expect to see?

Success.

What did you see instead?

(release-branch.go1.6)mwhudson@aeglos:/opt/opensource/go1.6/src$ GOROOT_BOOTSTRAP=/opt/opensource/go ./make.bash
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /opt/opensource/go.
bootstrap/internal/obj
bootstrap/asm/internal/flags
bootstrap/compile/internal/big
bootstrap/internal/gcprog
bootstrap/internal/obj/arm
bootstrap/internal/obj/arm64
bootstrap/internal/obj/mips
bootstrap/internal/obj/ppc64
bootstrap/internal/obj/x86
bootstrap/asm/internal/lex
bootstrap/link/internal/ld
bootstrap/compile/internal/gc
bootstrap/asm/internal/arch
bootstrap/asm/internal/asm
bootstrap/asm
bootstrap/link/internal/amd64
bootstrap/link/internal/arm
bootstrap/link/internal/arm64
bootstrap/link/internal/mips64
bootstrap/link/internal/ppc64
bootstrap/link/internal/x86
bootstrap/link
bootstrap/compile/internal/amd64
bootstrap/compile/internal/arm
bootstrap/compile/internal/arm64
bootstrap/compile/internal/mips64
# bootstrap/compile/internal/arm
/opt/opensource/go1.6/src/cmd/compile/internal/arm/peep.go:575[/opt/opensource/go1.6/pkg/bootstrap/src/bootstrap/compile/internal/arm/peep.go:3]: internal compiler error: unhandled addr STRUCTLIT

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/opt/opensource/go/src/runtime/debug/stack.go:24 +0x79
cmd/compile/internal/gc.Fatalf(0xab6b01, 0x11, 0xc4206a4100, 0x1, 0x1)
	/opt/opensource/go/src/cmd/compile/internal/gc/subr.go:175 +0x230
cmd/compile/internal/gc.(*ssaExport).Fatalf(0xdbe2d5, 0x2420300000006, 0xab6b01, 0x11, 0xc4206a4100, 0x1, 0x1)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:4939 +0x67
cmd/compile/internal/ssa.(*Config).Fatalf(0xc420dde000, 0x2420300000006, 0xab6b01, 0x11, 0xc4206a4100, 0x1, 0x1)
	/opt/opensource/go/src/cmd/compile/internal/ssa/config.go:345 +0x76
cmd/compile/internal/gc.(*state).Fatalf(0xc421294e00, 0xab6b01, 0x11, 0xc4206a4100, 0x1, 0x1)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:287 +0x8e
cmd/compile/internal/gc.(*state).addr(0xc421294e00, 0xc420aae460, 0xd2f900, 0xc4200c79d0, 0x0)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:3178 +0xc48
cmd/compile/internal/gc.(*state).addr(0xc421294e00, 0xc420aae3c0, 0xc421294e00, 0x620e10000, 0x24103)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:3164 +0xe47
cmd/compile/internal/gc.(*state).stmt(0xc421294e00, 0xc420aae500)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:713 +0x542
cmd/compile/internal/gc.(*state).stmtList(0xc421294e00, 0xc420651ea0)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:492 +0x5a
cmd/compile/internal/gc.buildssa(0xc4209fd680, 0x0)
	/opt/opensource/go/src/cmd/compile/internal/gc/ssa.go:140 +0xd55
cmd/compile/internal/gc.compile(0xc4209fd680)
	/opt/opensource/go/src/cmd/compile/internal/gc/pgen.go:366 +0x2d3
cmd/compile/internal/gc.funccompile(0xc4209fd680)
	/opt/opensource/go/src/cmd/compile/internal/gc/dcl.go:1226 +0xdc
cmd/compile/internal/gc.Main()
	/opt/opensource/go/src/cmd/compile/internal/gc/main.go:473 +0x203c
main.main()
	/opt/opensource/go/src/cmd/compile/main.go:50 +0xfe

bootstrap/compile/internal/ppc64
bootstrap/compile/internal/x86
go tool dist: FAILED: /opt/opensource/go/bin/go install -v bootstrap/...: exit status 2

This looks very much like #18994 but the fix for that did not fix this.

@odeke-em

This comment has been minimized.

Copy link
Member

commented Feb 14, 2017

@mwhudson interestingly, I use go1.5.4 to bootstrap it and I am still able to build it
and my latest go after building at tip ef30a1c

$ go version
go version devel +ef30a1c Tue Feb 14 02:09:48 2017 +0000 darwin/amd64
@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Feb 14, 2017

I can reproduce it on tip with

type T struct {
        a, b, c, d, e, f, g, h int // big, not SSA-able
}

func f() {
        a := T(T{}) // it works if this is a := T{}
        g(&a)
}

//go:noinline
func g(*T) {}

The problem is

.   AS u(100) l(8) colas(true) tc(1)
.   .   IND u(100) l(8) tc(1) p.T
.   .   .   NAME-p.&a u(1) a(true) l(7) x(0) class(PAUTO) esc(N) tc(1) assigned nonnil used(true) PTR64-*T
.   .   CONVNOP u(2) l(8) tc(1) p.T
.   .   .   STRUCTLIT u(2) l(8) tc(1) p.T
.   .   .   .   TYPE p.T u(1) a(true) l(3) x(0) class(PEXTERN) tc(1) type=p.T p.T p.T

Possibly due to https://go-review.googlesource.com/c/35261/

@cherrymui cherrymui self-assigned this Feb 14, 2017

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Feb 14, 2017

Probably we want to undo the change in walk.go in CL https://go-review.googlesource.com/c/35261/, because the use of literals for zeroing is handled in CL https://go-review.googlesource.com/c/34566/ at a different place. Other use of zero-valued struct literals are very rare.
Alternatively, we'll need to special-case OCONVNOP in a few places in ssa.go.
cc @mdempsky

@gopherbot

This comment has been minimized.

Copy link

commented Feb 14, 2017

CL https://golang.org/cl/36955 mentions this issue.

@gopherbot gopherbot closed this in 7820079 Feb 14, 2017

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