------- Comment #11 from vincent at vinc17 dot org  2010-02-19 13:08 -------
(In reply to comment #10)
> This issue was discussed on the WG14 reflector in October 2008, and the 
> general
> view was that the standard should not make INT_MIN % -1 well defined (as this
> would impose a significant performance cost on many programs to benefit very
> few) and probably didn't intend to.

My opinion is that introducing an undefined behavior on a particular case like
that is a bad idea: If this case can occur in some application, then the
programmer would have to do a test anyway (and this would even be more costly
as the test would be needed for all implementations, instead of being generated
by the compiler only when needed) or the software could behave erratically
(which is worse). If this case cannot occur, then the programmer should have a
way to tell that to the compiler.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30484

Reply via email to