public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107005] New: gcc not exploiting undefined behavior to optimize away the result of division
@ 2022-09-21 21:41 hiraditya at msn dot com
  2022-09-21 21:46 ` [Bug tree-optimization/107005] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hiraditya at msn dot com @ 2022-09-21 21:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107005
           Summary: gcc not exploiting undefined behavior to optimize away
                    the result of division
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hiraditya at msn dot com
  Target Milestone: ---

#include <limits.h>
int main() { return INT_MIN / -1; }

gcc -O2

main:
        mov     eax, -2147483648
        ret


clang -O2

main:                                   # @main
        ret



https://godbolt.org/z/Tjxx3KGdK

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-22 20:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 21:41 [Bug tree-optimization/107005] New: gcc not exploiting undefined behavior to optimize away the result of division hiraditya at msn dot com
2022-09-21 21:46 ` [Bug tree-optimization/107005] " pinskia at gcc dot gnu.org
2022-09-21 21:47 ` pinskia at gcc dot gnu.org
2022-09-22  6:53 ` rguenth at gcc dot gnu.org
2022-09-22 20:04 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).