-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: Export of FOR (and FORUNTIL) assumes ExprOrNil for OFOR.Right, but it is StmtOrNil #25222
Comments
This shouldn't be too hard; the current code simply makes a wrong assumption for OFOR. @dr2chase Do you have a complete reproducible example for me so I can test this? |
Requires a slightly tweaked compiler so it will attempt to inline OFOR, will put together that CL. I'll just reconnect all the inlining knobs, and add one for OFOR, we'll need this anyway to work on heuristics. |
Change https://golang.org/cl/118996 mentions this issue: |
There you go, a new CL for inlining knobs, plus a reproducer (except this one complains about a different node, 26):
With this set of flags, it fails with the original error (node 20) somewhere compiling runtime
|
Change https://golang.org/cl/119595 mentions this issue: |
What version of Go are you using (
go version
)?1.11dev
What did you do?
I enabled inlining for OFOR nodes, which caused the export of an OFOR node, which failed.
Root cause is
because n.Right is the increment of the for loop:
i.e., n.Right is a statement, not an expression, and may be nil.
The text was updated successfully, but these errors were encountered: