It appears it's because an optimizer cannot solve the halting problem. So it cannot be expected to prove loop termination, but it can prove the absence of any side effects, and simply assumes termination.
Ultimately there is no value in a pure spin loop that doesn't check for an exit hatch of some kind. So the semantics you lose are likely a bug anyway
View all comments
Show parent comment
1
u/Cruuncher Oct 19 '26
Yeah it's surprising.
It appears it's because an optimizer cannot solve the halting problem. So it cannot be expected to prove loop termination, but it can prove the absence of any side effects, and simply assumes termination.
Ultimately there is no value in a pure spin loop that doesn't check for an exit hatch of some kind. So the semantics you lose are likely a bug anyway