Skip to content

cmd/compile: internal compiler error: bad live variable at entry of f #28445

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel +80b8377049 Sat Oct 27 22:12:17 2018 +0000 linux/amd64

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

package p

var fp = (**float64)(nil)

func f() {
	switch fp {
	case new(*float64):
		println()
	}
}

crashes the tip compiler with the following error:

# command-line-arguments
<autogenerated>:1: internal compiler error: bad live variable at entry of f: .autotmp_2 (type *float64)

goroutine 37 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xce2afe, 0x24, 0xc0004f1970, 0x2, 0x2)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1e7
cmd/compile/internal/gc.(*Liveness).epilogue(0xc000518000)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1005 +0xba8
cmd/compile/internal/gc.liveness(0xc0004c6060, 0xc0004d4160, 0x0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1548 +0xc4
cmd/compile/internal/gc.genssa(0xc0004d4160, 0xc0004b76c0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5048 +0x85
cmd/compile/internal/gc.compileSSA(0xc000358000, 0x3)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:288 +0x1bc
cmd/compile/internal/gc.compileFunctions.func2(0xc0004ba900, 0xc0004bc190, 0x3)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:342 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:340 +0x132

It compiles fine on go1.11.

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