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: expected branch at write barrier block #25516

Closed
ALTree opened this issue May 23, 2018 · 2 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented May 23, 2018

$ gotip version
go version devel +1174ad3a8f Wed May 23 09:44:27 2018 +0000 linux/amd64

The following program:

package p

func f() {
	var I0 int
	var AB0 []bool
	var S0 string
	var AS1 []string
	for true {
		if AB0[I0] {
			var AS2 []string
			S0 = AS2[len(S0)]
			I0 = 0
		}
		AS1 = []string{"hi"}
	}
	_ = AS1
}

crashes the tip compiler with the following error:

$ gotip build test.go
# command-line-arguments
./test.go:8:2: internal compiler error: expected branch at write barrier block b4

goroutine 5 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xcba1fd, 0x29, 0xc0004fc1c0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc0004ec000, 0x802100000002, 0xcba1fd, 0x29, 0xc0004fc1c0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5537 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0004ee000, 0xcba1fd, 0x29, 0xc0004fc1c0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:562 +0x73
cmd/compile/internal/gc.(*Liveness).markUnsafePoints(0xc0004ee840)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:703 +0x6f1
cmd/compile/internal/gc.newliveness(0xc00037a000, 0xc0004ee000, 0x0, 0x0, 0x0, 0xc0004ec9c0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:565 +0x9eb
cmd/compile/internal/gc.liveness(0xc0004ec000, 0xc0004ee000, 0x0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1696 +0x95
cmd/compile/internal/gc.genssa(0xc0004ee000, 0xc000510700)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:4774 +0xbe
cmd/compile/internal/gc.compileSSA(0xc00037a000, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:267 +0x179
cmd/compile/internal/gc.compileFunctions.func2(0xc000052b40, 0xc0000162f0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:309 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:307 +0x11a

It compiles fine on go1.10.1

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels May 23, 2018
@ALTree ALTree added this to the Go1.11 milestone May 23, 2018
@ianlancetaylor
Copy link
Contributor

CC @randall77

@aclements aclements self-assigned this May 29, 2018
@gopherbot
Copy link

Change https://golang.org/cl/115037 mentions this issue: cmd/compile: update WBLoads during deadcode

@golang golang locked and limited conversation to collaborators May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants