https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107011
Bug ID: 107011 Summary: instruction with undefined behavior not optimized away 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 -O3 main: mov eax, -2147483648 ret $ clang -O3 main: # @main ret https://godbolt.org/z/393EMqs1E PS: I reported this bug yesterday as well but for some reason it does not appear in bugzilla so I'm creating another one.