http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55885
--- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2013-01-07 15:34:34 UTC --- INT_MIN % -1 and INT_MIN / -1 *should* be made defined by -fwrapv; that's bug 30484. Without -fwrapv, C11 made explicit the intent that the modulo operation is undefined in the cases where division is undefined ("If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a; otherwise, the behavior of both a/b and a%b is undefined."); I don't know about C++.