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: [tree-ssa]: GIMPLE lowering array references too early?



On Tue, 29 Jul 2003, Daniel Berlin wrote:

> 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.
Sigh.

This seems to be the fault of the c front end, not the gimplifier.
It only builds array_refs in certain cases.


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