cmd/compile: internal compiler error: 'f': value .autotmp_1 (nil) incorrectly live at entry
ALTree opened this issue · 4 comments
$ go version
go version go1.21rc4 linux/amd64
$ gotip version
go version devel go1.22-a09ea59 Wed Aug 2 15:25:43 2023 +0000 linux/amd64
package p
func f(s []byte) {
switch "" {
case string(append(s, 'a')):
}
}
$ gotip build crash.go
# command-line-arguments
./crash.go:3:6: internal compiler error: 'f': value .autotmp_1 (nil) incorrectly live at entry
goroutine 9 [running]:
runtime/debug.Stack()
./desktop/gotip/src/runtime/debug/stack.go:24 +0x5e
cmd/compile/internal/base.FatalfAt({0x137ee0?, 0xc0?}, {0xc00002c9c0, 0x2d}, {0xc00040f050, 0x3, 0x3})
./desktop/gotip/src/cmd/compile/internal/base/print.go:230 +0x1d7
cmd/compile/internal/base.Fatalf(...)
./desktop/gotip/src/cmd/compile/internal/base/print.go:199
cmd/compile/internal/ssagen.(*ssafn).Fatalf(0x20?, {0x7ca8b108?, 0x7f0c?}, {0xd8a3e5, 0x27}, {0xc000039b40, 0x2, 0xc000137f70?})
./desktop/gotip/src/cmd/compile/internal/ssagen/ssa.go:8018 +0x16a
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0003fed00, {0xd8a3e5, 0x27}, {0xc000039b40, 0x2, 0x2})
./desktop/gotip/src/cmd/compile/internal/ssa/func.go:716 +0x279
cmd/compile/internal/ssagen.(*state).variable(0xc000022500, {0xeccbd8, 0xc000410bb0}, 0xec7a80?)
./desktop/gotip/src/cmd/compile/internal/ssagen/ssa.go:6674 +0x145
...
Doesn't crash on 1.20.7
cc @golang/compiler
Change https://go.dev/cl/516375 mentions this issue: cmd/compile: fix missing init nodes for len(string([]byte)) optimization
@gopherbot please backport this to go1.21
The ICE introduced in CL 497276, where an optimization for len(string([]byte)) was added.
Backport issue(s) opened: #61781 (for 1.21).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
Moving to Go1.22 milestone, since by now the main branch represents Go 1.22 development, so even though gopherbot marked this as closed, it's not resolved in Go 1.21. Issue #61781 that tracks its backport to release-branch.go1.21 was automatically added to the Go 1.21.1 milestone. (FYI @golang/release, @mknyszek.)