Closed
Description
$ gotip version
go version devel go1.22-a3ced4a Wed Aug 9 03:13:11 2023 +0000 linux/amd64
package main
func main() {
for {
}
defer func() {}()
defer func() {}()
}
$ gotip build crash.go
# command-line-arguments
./crash.go:3:6: internal compiler error: unexpected frame offset for open-coded defer slot #1: have 1, want 8
goroutine 21 [running]:
runtime/debug.Stack()
./desktop/gotip/src/runtime/debug/stack.go:24 +0x5e
cmd/compile/internal/base.FatalfAt({0x0?, 0x0?}, {0xd9b303, 0x47}, {0xc000629748, 0x3, 0x3})
./desktop/gotip/src/cmd/compile/internal/base/print.go:230 +0x1d7
cmd/compile/internal/ssagen.(*state).emitOpenDeferInfo(0xc0000c6300)
./desktop/gotip/src/cmd/compile/internal/ssagen/ssa.go:294 +0x145
cmd/compile/internal/ssagen.buildssa(0xc0003bf760, 0x3)
./desktop/gotip/src/cmd/compile/internal/ssagen/ssa.go:575 +0x2b25
cmd/compile/internal/ssagen.Compile(0xc0003bf760, 0x0?)
./desktop/gotip/src/cmd/compile/internal/ssagen/pgen.go:208 +0x45
cmd/compile/internal/gc.compileFunctions.func5.1(0xc0003b3a00?)
./desktop/gotip/src/cmd/compile/internal/gc/compile.go:184 +0x34
cmd/compile/internal/gc.compileFunctions.func3.1()
./desktop/gotip/src/cmd/compile/internal/gc/compile.go:166 +0x30
created by cmd/compile/internal/gc.compileFunctions.func3 in goroutine 20
./desktop/gotip/src/cmd/compile/internal/gc/compile.go:165 +0x23a
Silly control flow but reporting anyway in case it's a symptom of a more serious issue.
Doesn't crash on go1.21.
cc @golang/compiler