Closed
Description
$ 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.