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

ALTree opened this issue May 23, 2018 · 2 comments


None yet
4 participants
Copy link

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
	/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


This comment has been minimized.

Copy link

commented May 24, 2018

@aclements aclements self-assigned this May 29, 2018


This comment has been minimized.

Copy link

commented May 29, 2018

Change mentions this issue: cmd/compile: update WBLoads during deadcode

@gopherbot gopherbot closed this in db9341a May 29, 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.