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]

[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


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