This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: possible gcse failure: not able to eliminate redundant loads
- From: "Sanjiv Kumar Gupta, Noida" <sanjivg at noida dot hcltech dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>, Richard Henderson <rth at redhat dot com>, Daniel Berlin <dberlin at dberlin dot org>, Dale Johannesen <dalej at apple dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 13 Dec 2002 11:26:34 +0530
- Subject: 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