-
Notifications
You must be signed in to change notification settings - Fork 18k
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: inlining function that references function literals generates bad code #54632
Comments
It depends upon inlining |
Here's a reproducer with a smaller AST: https://go.dev/play/p/FGmrix8m3nh?v=gotip |
Thanks! There's something going on with the inliner and ir.reassigned. During inlining of But it seems like we're trying to recursively inline the resulting expanded body before it's been substituted into I think the nounified frontend avoids this inliner bug, because it doesn't set Defn on local variables constructed during inlining, so we'd never inline calls in this case anyway. Even further minimized repro: https://go.dev/play/p/jDtyqFOdFlB?v=gotip |
Variation of the bug that affects Go 1.19: https://go.dev/play/p/Orb0U2fXXhB |
Change https://go.dev/cl/425257 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, unless
GOEXPERIMENT=unified
is enabled. This is linked to unified IR.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran code calling two identical functions, one inlined, the other not
What did you expect to see?
Identical results (and all "PASS")
What did you see instead?
Different results (some "FAIL")
The text was updated successfully, but these errors were encountered: