[Bug optimization/11710] New: loop optimizer cannot figure out # iterations for shift and / * "increments"
rguenth at tat dot physik dot uni-tuebingen dot de
gcc-bugzilla@gcc.gnu.org
Tue Jul 29 18:15:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11710
Summary: loop optimizer cannot figure out # iterations for shift
and / * "increments"
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de
CC: gcc-bugs at gcc dot gnu dot org
All loops in the following testcases run a small constant amout of iterations.
If compiled with -O2 -funroll-loops they dont get unrolled, though, probably due
to the lack of the loop optimizer finding out the constant number of iterations.
This hurts optimization of libstdc++ pow(T, int) implementation for constant
second argument.
int shift()
{
int n = 5, i = 0;
while (n <<= 2)
++i;
return i;
}
int divide()
{
int n = 5, i = 0;
while (n /= 2)
++i;
return i;
}
int multiply()
{
int n = 5, i = 0;
while (n *= 2 < 20)
++i;
return i;
}
More information about the Gcc-bugs
mailing list