possible gcse failure: not able to eliminate redundant loads

Sanjiv Kumar Gupta, Noida sanjivg@noida.hcltech.com
Wed Dec 11 03:30:00 GMT 2002


>void func (double *a, double *b, int i)
>{
>        b[2] = a[1];
>
>        for (i ; i < 3; i = i + 8)
>        {
>                a[4] = a[1];
>
>        }
>}

>for -O2 -fno-argument-alias, I am getting multiple loads for a[1].

Oooops! I realized it just now. Basically GCC is assuming that
a[4] and a[1] may alias, hence reloading a[1] in each loop iteration.
sorry for the inconvenience caused.

regards
--Sanjiv



More information about the Gcc mailing list