This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization for GCC on PPC


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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]