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: autotmp_17 recorded as live on entry #26105

Closed
ALTree opened this issue Jun 28, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@ALTree
Copy link
Member

commented Jun 28, 2018

$ gotip version
go version devel +257d6c48e0 Thu Jun 28 03:12:01 2018 +0000 linux/amd64

The following program (reduced from a gosmith-generated one):

package p

var S interface{}

func F(n int) {
	f := 1
	fun := func(chan int) int {
		S = f
		return n
	}
	i := fun(([]chan int{})[n])

	var fc [2]chan int
	_ = <-(([...][2]chan int{fc})[i][i])
}

crashes the tip compiler with the following error:

$ gotip build crash.go 
# command-line-arguments
<autogenerated>:1: internal compiler error: internal error: F .autotmp_17 (type [1][2]chan int) recorded as live on entry

goroutine 8 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xcc628d, 0x2f, 0xc00053b968, 0x2, 0x2)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*Liveness).epilogue(0xc0004e4160)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1159 +0x1642
cmd/compile/internal/gc.liveness(0xc0004dc000, 0xc0004e0000, 0x0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1690 +0xc4
cmd/compile/internal/gc.genssa(0xc0004e0000, 0xc00050e150)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:4820 +0xbe
cmd/compile/internal/gc.compileSSA(0xc00035c000, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:269 +0x1bc
cmd/compile/internal/gc.compileFunctions.func2(0xc00036b740, 0xc000016730, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:323 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:321 +0x11a

It compiles fine on go1.10.

@ALTree

This comment has been minimized.

Copy link
Member Author

commented Jun 28, 2018

git bisect points to 5c40210 (cmd/compile: in prove, add transitive closure of relations) as the first bad commit.

cc @rasky @dr2chase @aclements

@dr2chase dr2chase self-assigned this Jun 28, 2018

@dr2chase

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2018

Glorious 🙄. Thanks, will look.

@gopherbot

This comment has been minimized.

Copy link

commented Jun 28, 2018

Change https://golang.org/cl/121436 mentions this issue: cmd/compile: make OpAddr depend on VarDef in storeOrder

@gopherbot gopherbot closed this in 1a27f04 Jun 29, 2018

@josharian josharian reopened this Jun 29, 2018

@josharian

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2018

Fix was reverted.

@gopherbot

This comment has been minimized.

Copy link

commented Jul 10, 2018

Change https://golang.org/cl/123015 mentions this issue: cmd/compile: add mem operand to OpAddr

@gopherbot

This comment has been minimized.

Copy link

commented Jul 10, 2018

Change https://golang.org/cl/122483 mentions this issue: cmd/compile: add LocalAddr that takes SP,mem operands

@gopherbot gopherbot closed this in 0029cd4 Jul 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.