This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
optimization for GCC on PPC
- From: Joakim Tjernlund <joakim dot tjernlund at lumentis dot se>
- To: gcc at gnu dot org
- Date: Tue, 28 Jan 2003 10:29:25 +0100
- Subject: optimization for GCC on PPC
- Reply-to: joakim dot tjernlund at lumentis dot se
GCC(version 3.2.1) will generate better code inside the while loop if the code
is modified as below. Perhaps this optimization could be done automatically by gcc?
Jocke
orginal loop:
while(len--)
*a++ = *b++;
}
modified loop:
a--;b--;
while(len--)
*++a = *++b;
}
a++;b++; /* can be omitted if a and/or b is unused after the while loop */