3 ms·
> This bug is a misfiring attempt at detecting undefined behavior to allow for optimizations. It's closer to a conditional constant propagation that was accide
by jcranmer 7y ago
> This bug is a misfiring attempt at detecting undefined behavior to allow for optimizations.
It's closer to a conditional constant propagation that was accidentally applied unconditionally. The code was guarded by an if statement that asserted that a variable did not have a particular value, which lets the compiler delete further checks that the variable does or does not have the value. No UB behavior in play, unless you're complaining about the UB of "variables can't be changed unless the programmer changes them directly or indirectly."
If you pay attention to the change that introduced the bug--it was a change in the constant propagator that caused the bug.