[Bug c/40189] gcc 4.4.0 incorrectly folds add-as-comparison

2009-05-18 Thread mat at lcs dot mit dot edu
--- Comment #3 from mat at lcs dot mit dot edu 2009-05-18 20:53 --- Fair enough, thanks (this came up running a compiler test suite that checks even undefined edge cases). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40189

[Bug c/40189] gcc 4.4.0 incorrectly folds add-as-comparison

2009-05-18 Thread pinskia at gcc dot gnu dot org
--- Comment #2 from pinskia at gcc dot gnu dot org 2009-05-18 19:48 --- INT_MIN + any number is never going to be zero because INT_MIN = - INT_MAX -1. Also signed integer overflow is undefined which gives that the above. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40189

[Bug c/40189] gcc 4.4.0 incorrectly folds add-as-comparison

2009-05-18 Thread schwab at linux-m68k dot org
--- Comment #1 from schwab at linux-m68k dot org 2009-05-18 19:47 --- Not a bug. If arg0 is negative you get undefined behavior due to overflow. Use -fwrapv to get wrapping semantics. -- schwab at linux-m68k dot org changed: What|Removed |Added -