Skip to content

cmd/compile: internal compiler error: expected successors of write barrier block to be plain #26024

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel +d6a27e8edc Sat Jun 23 00:16:14 2018 +0000 linux/amd64

The following program:

package p

func f() {
	var i int
	var s string
	for len(s) < len(s) {
		i++
		s = "a"
	}

	var b bool
	var sa []string
	for true {
		sa = []string{""}
		for b || i == 0 {
		}
		b = !b
		_ = sa
	}
}

Crashes the tip compiler with an expected successors of write barrier block to be plain error:

$ gotip build crash.go
# command-line-arguments
<unknown line number>: internal compiler error: expected successors of write barrier block b10 to be plain

goroutine 7 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xcc877e, 0x39, 0xc0004e2210, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc0004d6000, 0x0, 0xcc877e, 0x39, 0xc0004e2210, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5583 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0004d8000, 0xcc877e, 0x39, 0xc0004e2210, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:562 +0x73
cmd/compile/internal/gc.(*Liveness).markUnsafePoints(0xc0004d8160)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:696 +0x63b
cmd/compile/internal/gc.newliveness(0xc00035a000, 0xc0004d8000, 0x0, 0x0, 0x0, 0xc0004d6a20, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:554 +0x9eb
cmd/compile/internal/gc.liveness(0xc0004d6000, 0xc0004d8000, 0x0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1685 +0x95
cmd/compile/internal/gc.genssa(0xc0004d8000, 0xc0004ee230)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:4820 +0xbe
cmd/compile/internal/gc.compileSSA(0xc00035a000, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:269 +0x1bc
cmd/compile/internal/gc.compileFunctions.func2(0xc0004cc360, 0xc000016740, 0x0)
	/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

The program compiles fine on go1.10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions