This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36758] New: address addition moved out of the loop
- 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: 7 Jul 2008 21:34:43 -0000
- Subject: [Bug middle-end/36758] New: address addition moved out of the loop
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following testcase:
extern int f0(int *);
void
f1()
{
int x;
while (f0(&x));
}
-- CUT ---
Currently GCC produces:
addi 31,1,112
.p2align 3,,7
.L2:
mr 3,31
bl f0
nop
cmpdi 7,3,0
bne 7,.L2
Notice how there is mr 3, 31 inside the loop. At least on the Cell, the mr and
addi both have the same cycle count so we should not be moving the addition
outside of the loop. This will save at least one volatile register which
should reduce code size. This is a definite win for code size.
--
Summary: address addition moved out of the loop
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc*-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36758