-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Compiler hangs during jump elimination #89931
Comments
The following code hangs during compilation on 3.11 and 3.10:
Our peepholer gets stuck in a loop, repeatedly "optimizing" instruction 4 (POP_JUMP_IF_TRUE -> JUMP_ABSOLUTE): 1 0 JUMP_ABSOLUTE 0 (to 0) After optimizing jumps to jumps like these, we always back up and attempt to optimize the same instruction again (which makes it possible to optimize three or more chained jumps on the same line). The issue is that this particular optimization doesn't actually change the instruction, since both jumps target the same exact block. Since nothing changes, we loop forever. The fix is really simple: just skip the optimization if instr->i_target == target->i_target. We already do this for several other types of jumps; it just looks like POP_JUMP_IF_TRUE and POP_JUMP_IF_FALSE might have been missed. I'll have a PR up soon. |
My fix for this seems to have erroneously added two invalid new jump threads: POP_JUMP_IF_FALSE(a) to JUMP_IF_FALSE_OR_POP(b) is folded into POP_JUMP_IF_FALSE(b) The good news is that I can't get the compiler to actually emit these particular jump sequences. It still needs to be fixed ASAP, though. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: