This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 18316 (updated)
Hello,
> >>>3) ivopts do not handle induction variables with nonconstant step,
> >>> whereas the old loop optimizer does (PR 18316, patch
> >>> http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00142.html needs
> >>> updating).
> >>
> >>Likewise.
> >
> >here is the updated version of the patch, bootstrapped & regtested on
> >i686.
>
> Does this fix PR 19126 also? PR 19126 shows up in a large number of
> fortran code.
yes, with the patch we get the following code in the .final_cleanup
dump:
<L6>:;
ivtmp.9 = (float *) ((unsigned int) incy * 4);
ivtmp.15 = dy;
ivtmp.14 = (float *) ((unsigned int) incx * 4);
ivtmp.11 = dx;
i = 0;
<L0>:;
D.1312 = (float *) ivtmp.15;
*D.1312 = *D.1312 + *(float *) ivtmp.11;
i = i + 1;
ivtmp.15 = ivtmp.9 + ivtmp.15;
ivtmp.11 = ivtmp.11 + ivtmp.14;
if (n != i) goto <L0>; else goto <L2>;
<L2>:;
return;
and assembler
.L4:
lfs 0,0(6)
lfs 13,0(4)
fadds 0,0,13
stfs 0,0(6)
add 6,6,7
add 4,4,5
bdnz .L4
Zdenek