https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81088
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|sanitizer |middle-end Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Testcase that goes wrong without -fsanitize=undefined: short s = 2; short y = 1; int i; int main() { i = -(s + (int)(~( y == 0 ? 1 : 0 , (unsigned)(0/y)))) + 0x7fffffff; return 0; } folded to: ;; Function main (null) ;; enabled by -tree-original { i = y == 0;, -2147483648(OVF) - (int) s;; return 0; }