[Bug middle-end/50865] Invalid code generation for INT64_MIN % 1 on x86_64

mikpelinux at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 23 17:50:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50865

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #12 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Created attachment 34323
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34323&action=edit
patch restricting the X % -Y -> X % Y transformation to when it's safe

This proposed patch restricts the X % -Y -> X % Y transformation to cases when
we can be certain that it doesn't result in undefined behaviour, i.e. when Y !=
1 or X != INT_MIN.  Passes bootstrap and testsuite on x86_64-linux so far.



More information about the Gcc-bugs mailing list