This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/30475] assert(int+100 > int) optimized away



------- Comment #49 from ian at airs dot com  2007-01-22 20:16 -------
In the C language standard "undefined behaviour" meants that the compiler can
do anything at all.  It means that the program is specifically undefined.

When you say that the compiler should not eliminate the test because the value
does turn out to be negative, you appear to be assuming that signed overflow is
actually "implementation defined behaviour."  That would have the property that
you are after.

When you say that -fwrapv makes the code faster, I don't know which benchmarks
you are relying on.  Other people have demonstrated that -fwrapv slows down the
well-known SPEC benchmark.

I've written some comments in the appropriate place: the gcc mailing list:
http://gcc.gnu.org/ml/gcc/2007-01/msg00885.html


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]