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]

RE: possible gcse failure: not able to eliminate redundant loads


>  It is not hoisting some stores
>which it should.  The cases I have seen have not been due to aliasing.

>David

I have an example where gcse fails despite the success of aliasing.
consider,

void func (double *a, double *b, int i)
{
        int j;
 
        b[2] = a[1];
 
        for (j = 0; j < i; j++)
        {
               if (i)
                   b[3] = a[1];
        }
}

GCC -ml -m4 -O2 -fno-argument-alias  generates
_func:
        mov.l   r14,@-r15
        mov     r15,r14
        mov     r5,r1
        add     #16,r1
        add     #8,r4
        fmov.s  @r4+,fr3		--> loading a[1]
        fmov.s  @r4,fr2
        add     #-4,r4
        add     #4,r1
        fmov.s  fr2,@r1
        mov     #0,r2
        cmp/ge  r6,r2
        bt/s    .L10
        fmov.s  fr3,@-r1
        mov     r5,r1
        add     #24,r1
        mov     r6,r2
        tst     r6,r6
.L11:
        bt      .L4
        fmov.s  @r4+,fr3		--> loading a[1] again ??
        fmov.s  @r4,fr2
        add     #-4,r4
        add     #4,r1
        fmov.s  fr2,@r1
        fmov.s  fr3,@-r1
.L4:
        dt      r2
        bf/s    .L11
        tst     r6,r6

--Sanjiv


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