[Bug middle-end/78115] Missed optimization for "int modulo 2^31"
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 27 12:30:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78115
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-10-27
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC is pessimized by its own IL (with undefined overflow). Optimized we have:
<bb 2>:
if (num_3(D) < 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
_1 = num_3(D) + 1;
num_4 = _1 + 2147483647;
<bb 4>:
# num_2 = PHI <num_3(D)(2), num_4(3)>
return num_2;
not sure what exactly clang matches here.
More information about the Gcc-bugs
mailing list