https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
--- Comment #2 from Eran Kornblau <eran.kornblau at kaltura dot com> --- Thanks Andreas, I understand there's an overflow here, but isn't it a bug that it affects the second part of the condition? I mean, any value is legit for the first part of the condition, if the behavior is undefined... but the second part of the condition is well defined. I personally find it a bit troubling that - 1. The result of the condition depends on the order of the operands (while they don't have any side-effects...), and - 2. The optimizations change the behavior of the code in this case Btw, the reason I chose this order is that the first part of the condition is false in 99% of the time, while the second part is true 99% of the time. So, in my case there is a tiny optimization in keeping the order as is. Thank you, Eran