-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: ICE 'order.stmt recover' building func with nested closures #59638
Comments
With the test case in question, at the point where we start back end processing (order, walk, ssa, etc) here is the state of the world for the functions in the testcase in question. In the blurb below, functions are shown with their nesting relationships, with the following additional flags: "HIDDEN" is set for funcs where fn.IsHiddenClosure() returns true
The problem functions here are the ones marked as The other problem with the orphans is that because escape analysis works by calling I think at this point it might be better to change the inliner to do what amounts to a garbage collection after the dust settles, to pick out the orphans above and mark them as dead (as opposed to trying to do walks while the inlining process is happening). |
But the function that trigger the ICE is |
True, not marked dead, but should be. It is nested (indirectly) inside |
Change https://go.dev/cl/484859 mentions this issue: |
The CL was reverted. |
I spent a little while analyzing this. There is a bug in my original CL: I placed the call to It took me forever to find this-- when I looked at the "-m=3 -W=3" debug output I could see that closure functions were being marked as dead, but there was no debugging trace output to that effect. This was because that second call to I'll revive the CL with a better fix (move the |
Test case that will reproduce the problem (assuming CL rolled forward): https://go.dev/play/p/UAn0udzWLTM |
I filed a separate issue #59680 for this, I'll use that for the testcase and to track the fix. |
Change https://go.dev/cl/486377 mentions this issue: |
Closing out this issue, since we rolled forward with a revised fix in https://go.dev/cl/486377 |
What version of Go are you using (
go version
)?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?
Note that the code in question is a modified version of the test case for issue #59404.
The text was updated successfully, but these errors were encountered: