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>, egcs at egcs dot cygnus dot com
- Subject: Re: missed optimization, would be very helpful
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 31 Dec 1998 16:26:33 +875200
- References: <199812312032.PAA05614@rabi.phys.columbia.edu>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Thu, Dec 31, 1998 at 03:32:06PM -0500, Zack Weinberg wrote:
> In a loop of the form
void foo(int *int_ptr, int x, int y)
{
while (x < y) (*int_ptr)++, x++;
}
> This is egcs-1.1.1; it might've been fixed more recently but I can't test
> that since the Dec 24 CVS is unreliable on my system.
It has been, thanks to Mark Mitchell. We now get this:
ldl $2,0($16)
.align 4
$L5:
addq $2,1,$3
addl $17,1,$17
bis $3,$3,$2
cmplt $17,$18,$1
bne $1,$L5
stl $3,0($16)
Which, now that I look at it, isn't quite ideal, but the bits that
normally fix up this kind of thing -- cse or cprop -- run before
this gets created.
Still, it's a lot better than a load/store pair in the loop.
r~