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 tree-optimization/50865] Invalid code generation for INT64_MIN % 1 on x86_64


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

--- Comment #7 from Jaak Ristioja <jaak at ristioja dot ee> 2011-10-25 16:08:19 UTC ---
(In reply to comment #6)
>       /* X % -Y is the same as X % Y.  */
> (fold-const.c:fold_binary_loc) would probably be what's wrong here.

On the other hand
https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow#INT32-C.Ensurethatoperationsonsignedintegersdonotresultinoverflow-Modulo
also refers to C99, saying that X % Y and X % -Y are equivalent.


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