Skip to content

cmd/compile: ICE 'order.stmt recover' building func with nested closures #59638

@thanm

Description

@thanm

What version of Go are you using (go version)?

$ go version
go version devel go1.21-e7b04a3e16 Thu Apr 13 23:15:09 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

No, only on tip.

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Build this code with "-gcflags=-l=4":

https://go.dev/play/p/G8xA8HfU2EH

Note that this has to be from a version of master just prior to 8854be4 (the revert of "cmd/compile: allow more inlining of functions that construct closures").

What did you expect to see?

Clean compile.

What did you see instead?

/usr/local/google/home/thanm/issue59404.go:28:28: internal compiler error: order.stmt recover

goroutine 1 [running]:
runtime/debug.Stack()
	/ssd2/go.master/src/runtime/debug/stack.go:24 +0x5e
cmd/compile/internal/base.FatalfAt({0xe9ffc0?, 0x0?}, {0xd4c298, 0xd}, {0xc0004995e8, 0x1, 0x1})
	/ssd2/go.master/src/cmd/compile/internal/base/print.go:234 +0x1d7
cmd/compile/internal/base.Fatalf(...)
	/ssd2/go.master/src/cmd/compile/internal/base/print.go:203
cmd/compile/internal/walk.(*orderState).stmt(0xc0004b5940, {0xe9ffc0?, 0xc0004a5d60?})
	/ssd2/go.master/src/cmd/compile/internal/walk/order.go:598 +0x1c1b
cmd/compile/internal/walk.(*orderState).stmtList(0xe9ffc0?, {0xc0004a6970, 0x1, 0x1})
	/ssd2/go.master/src/cmd/compile/internal/walk/order.go:366 +0x7a
cmd/compile/internal/walk.orderBlock(0xc0004abe50, 0xc0004bdb30)
	/ssd2/go.master/src/cmd/compile/internal/walk/order.go:455 +0x90
cmd/compile/internal/walk.order(0xc0004abe40)

Note that the code in question is a modified version of the test case for issue #59404.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions