------- Comment #1 from rguenth at gcc dot gnu dot org 2009-10-30 22:23 ------- signed overflow invokes undefined behavior. You can use -fwrapv to make it wrapping. Or you can use unsigned types for the comparison, like
if ((unsigned)x != -(unsigned)x) -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41882