http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50975

--- Comment #2 from Jeremy <gcc.hall at gmail dot com> 2011-11-03 12:37:41 UTC 
---
(In reply to comment #1)
> But ... you can't tell the difference.  So this is a valid optimization.

You can tell the difference in execution time.

And why is this an "optimization"?  In this case, I cant see how it can improve
the code other than to lose any input from the programmer, who knows when the
data is biased.  I guess it might help in a more complex expression.

I think this is different from the controversy over the handling of signed
integer overflow.  There is no undefined behavior here.  The language standard
from K&R to the present day explicitly states the evaluation order is
guaranteed left to right with these operators.

Reply via email to