This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch

--- Comment #13 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
(In reply to Mikael Pettersson from comment #12)
> Created attachment 34323 [details]
> 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.

Shouldn't disabling this be language dependent ? I.e. in Fortran this
transformation is always valid (as integers in conforming programs are always
in the symmetric range).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]