http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52833
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-02 10:12:34 UTC --- (In reply to comment #0) > following code is based on artihmetic overflow assumption (after overflow we > gen <0 number on x86 and x86_64): Bad assumption, overflow is undefined behaviour. The bug submission form asys to read http://gcc.gnu.org/bugs/ before reporting bugs, which says if your code works as you expect with -fwrapv then it's not a bug in the compiler, it's a bug in your code.