This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19401] New: Trivial loop not unrolled
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jan 2005 16:08:01 -0000
- Subject: [Bug tree-optimization/19401] New: Trivial loop not unrolled
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
We do not unroll the loop in
double foo(double __x)
{
unsigned int __n = 2;
double __y = __n % 2 ? __x : 1;
while (__n >>= 1)
{
__x = __x * __x;
if (__n % 2)
__y = __y * __x;
}
return __y;
}
with -O2 which causes us to emit gratiously worse code
for std::pow(x, 2) than for std::pow(x, 2.0).
We should definitely get this right without -funroll-loops
and all its side-effects.
--
Summary: Trivial loop not unrolled
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19401