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

Reply via email to