------- Comment #2 from burnus at gcc dot gnu dot org  2007-09-11 14:59 -------
Isn't this what http://gcc.gnu.org/ml/gcc/2007-09/msg00087.html (plus/minus a
few emails in the thread) is about?

Using -fno-strict-overflow they pass. I think we can simply add this option to
the test case; or do you think -fstrict-overflow is an over-optimization for
-O2?

-fstrict-overflow
Allow the compiler to assume strict signed overflow rules, depending on the
language being compiled. For C (and C++) this means that overflow when doing
arithmetic with signed numbers is undefined, which means that the compiler may
assume that it will not happen.  This permits various optimizations. For
example, the compiler will assume that an expression like "i + 10 > i" will
always be true for signed "i".  This assumption is only valid if signed
overflow is undefined, as the expression is false if "i + 10" overflows when
using twos complement arithmetic.  When this option is in effect any attempt to
determine whether an operation on signed numbers will overflow must be written
carefully to not actually involve overflow.

The -fstrict-overflow option is enabled at levels -O2, -O3, -Os.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
            Summary|[4.3 regression]            |[4.3 regression]
                   |gfortran.df/do_3.F90 fails  |gfortran.dg/do_3.F90 fails
                   |at -O2                      |at -O2


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

Reply via email to