------- Comment #8 from ian at airs dot com  2007-06-12 18:25 -------
Undefined signed overflow is a language issue, not a processor issue.  When
signed overflow is undefined, the compiler can and does make certain
assumptions about the results of operations.  For example, it assumes that a +
1 > a is always true.

In this case gcc is trying to optimize by doing the computation in short rather
than int.  But since the language requires that the computation be done in int,
gcc has to make sure to get the same result.  If the computation were done in
short, and if later compilation passes could prove that the computation
overflowed in short, then the result would be different than if the computation
were done in int.


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com


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

Reply via email to