Skip to content

cmd/compile: internal compiler error: panic during lower (part 2) #30257

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel +65c2069a9f Fri Feb 15 17:32:07 2019 +0000 linux/amd64

The following program:

package p

func f() {
	var i int
	var s string

	if true {
		s = "a"
	}

	if f := 0.0; -f < 0 {
		i = len(s[:4])
	}

	_ = s[i-1:0] != "bb" && true
}

Crashes the tip and the 1.12rc1 compilers, when built for GOARCH=arm64, as follows:

$ GOARCH=arm64 gotip tool compile crash.go 

crash.go:11:20: internal compiler error: 'f': panic during lower while compiling f:

runtime error: index out of range

goroutine 1 [running]:
cmd/compile/internal/ssa.Compile.func1(0xc0003c0908, 0xc0000ca580)
	/home/alberto/go/src/cmd/compile/internal/ssa/compile.go:45 +0xa5
panic(0xd64720, 0x1568110)
	/home/alberto/go/src/runtime/panic.go:522 +0x1b5
cmd/compile/internal/ssa.read8(...)

[...]

The crash appears to be the related to the one previously reported as #29215.

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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions