This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa]: GIMPLE lowering array references too early?
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc at gcc dot gnu dot org
- Cc: jason at redhat dot com, dnovillo at redhat dot com
- Date: Tue, 29 Jul 2003 12:28:41 -0400 (EDT)
- Subject: [tree-ssa]: GIMPLE lowering array references too early?
We used to keep array references around (instead of transforming into
address arithmetic), the thinking being that loop opts want them.
Somehow, this isn't happening anymore, and i don't remember discussion of
changing it (which i, and others, would have opposed, since loop opts
do need them). I think you switched it to always lower at some point,
Jason.
Watch:
int foo (int *a, int *b)
{
int i,c = 0;
for (i = 0; i < N; i++) {
c += a[i] * b[i];
}
}
becomes
i.1 = (unsigned int)i;
T.2 = i.1 * 4;
T.3 = (int *)T.2;
T.4 = a + T.3;
T.5 = *T.4;
etc
rather than keeping the a[i] reference.
Jason, was this a deliberate decision on your part, or an accident.
It would really be nice to have the array references back.
--Dan