This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50865] Invalid code generation for INT64_MIN % 1 on x86_64
- From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Dec 2014 19:51:31 +0000
- Subject: [Bug middle-end/50865] Invalid code generation for INT64_MIN % 1 on x86_64
- Auto-submitted: auto-generated
- References: <bug-50865-4 at http dot gcc dot gnu dot org/bugzilla/>
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).