This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37451] New: Extra addition for doloop in some cases
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2008 22:03:13 -0000
- Subject: [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Simple testcase:
/* { dg-do compile } */
/* { dg-options "-O2" } */
int f(int l, int *a)
{
int i;
for(i = 0;i < l; i++)
a[i] = i;
return l;
}
/* We should be able to do this loop without adding -1 to the l
to get the number of iterations with this loop still doing a do-loop. */
/* The place where we were getting an extra -1 is when converting from 32bits
to 64bits as the ctr register is used as 64bits on powerpc64. */
/* { dg-final { scan-assembler-not "-1" } } */
/* { dg-final { scan-assembler "bdnz" } } */
/* { dg-final { scan-assembler-times "mtctr" 1 } } */
---- CUT ---
The issue is that we zero extend before correcting the count of the iterations.
--
Summary: Extra addition for doloop in some cases
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451