[Bug c++/56652] Wrong code in O2 - if in inline function
markus at trippelsdorf dot de
gcc-bugzilla@gcc.gnu.org
Mon Mar 18 12:34:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56652
--- Comment #5 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2013-03-18 12:33:50 UTC ---
(In reply to comment #4)
> (In reply to comment #2)
> > Quick check with clang -fsanitize=undefined shows:
> > ...
> > numeric.cc:47:30: fatal error: negation of -2147483648 cannot be represented in
> > type 'int'; cast to an unsigned type to negate this value to itself
> >
> > Thus invalid.
>
> Thank you. OK, works if I change type of count and size to unsigned.
> So INT_MIN has wrong value?
-INT_MIN is an integer overflow and is undefined behavior in C.
http://www.google.com/search?hl=en&q=+INT_MIN
More information about the Gcc-bugs
mailing list