On Fri, 20 Apr 2012, Ian Lance Taylor wrote: > In Go, a division overflow is supposed to wrap. On x86 processors it > would raise a SIGFPE signal leading to a panic. This patch fixes that > problem as well.
It's a pity that this change is Go-specific. For -fwrapv, INT_MIN / -1 and INT_MIN % -1 should both have defined modulo semantics for C and C++ (similarly of course for all signed integer types, not just int). Ideally of course the semantics for this would be encoded properly in GENERIC / GIMPLE, but until then it would make sense to have a global flag, set by both -fwrapv and the Go front end, to enable those checks in the language-independent compiler. See bug 30484. -- Joseph S. Myers jos...@codesourcery.com