This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: missed optimization, would be very helpful
- To: Zack Weinberg <zack at rabi dot columbia dot edu>
- Subject: Re: missed optimization, would be very helpful
- From: Horst von Brand <vonbrand at inf dot utfsm dot cl>
- Date: Mon, 04 Jan 1999 09:36:17 -0300
- cc: Philipp Rumpf <prumpf at jcsbs dot lanobis dot de>, egcs at egcs dot cygnus dot com
Zack Weinberg <zack@rabi.columbia.edu> said:
> On Fri, 1 Jan 1999 04:24:36 +0100, 043633786-0001@t-online.de wrote:
> >On Thu, Dec 31, 1998 at 11:03:25PM -0400, Horst von Brand wrote:
> >> f(char *p, int *ip)
> >> {
> >> while(*p++)
> >> (*ip)++;
> >> }
> >
> >Do you want this to become something like
> >
> > movl (%ecx),%esi (well, take anything for %esi)
> >.L5:
> > incl %esi
> > movb (%edx),%al
> > incl %edx
> > testb %al,%al
> > jne .L5
> > movl %esi,(%ecx)
> >
> >?
> That's the right general idea.
And for a similar case (a global whose address I put into a local int *ip)
it does something like the above, after somebody poined out that the
acceses through parameter ip could cause side effects. Sorry, my machine +
testcase are at home.
--
Dr. Horst H. von Brand mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513