This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/50865] Invalid code generation for INT64_MIN % 1 on x86_64
- From: "jaak at ristioja dot ee" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Oct 2011 16:37:48 +0000
- Subject: [Bug tree-optimization/50865] Invalid code generation for INT64_MIN % 1 on x86_64
- Auto-submitted: auto-generated
- References: <bug-50865-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50865
--- Comment #9 from Jaak Ristioja <jaak at ristioja dot ee> 2011-10-25 16:37:48 UTC ---
(In reply to comment #8)
> Well, they are equivalent where they are both defined, or if you apply C99
> rules to infinite-precision integers. The problem here is that INT_MIN %
> -1 is undefined (explicitly in C1X) and so a transformation of INT_MIN % 1
> into INT_MIN % -1 is unsafe (the other way round, transforming undefined
> behavior to defined, is fine at least in the absence of -ftrapv).
But INT_MIN % 1 is still defined to be zero?