[Bug tree-optimization/64130] vrp: handle non zero constant divided by range cannot be zero.
andi-gcc at firstfloor dot org
gcc-bugzilla@gcc.gnu.org
Sun Nov 30 20:57:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64130
--- Comment #3 from Andi Kleen <andi-gcc at firstfloor dot org> ---
You're right. I actually meant
x >= maxval(typeof(a)), x / a cannot be 0.
Corrected test case (assuming 64bit target):
#include <limits.h>
int fsigned(int a)
{
return 0x1fffffffL / a == 0;
}
int funsigned(unsigned a)
{
return 0x1fffffffL / a == 0;
}
>So this should be optimized to a > 100 instead.
Yes this would make sense too.
More information about the Gcc-bugs
mailing list