This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: First scheduling pass
- From: "Sanjiv Kumar Gupta, Noida" <sanjivg at noida dot hcltech dot com>
- To: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- Cc: gcc at gcc dot gnu dot org, vmakarov at redhat dot com, joern dot rennecke at superh dot com
- Date: Thu, 27 Mar 2003 16:40:35 +0530
- Subject: RE: First scheduling pass
>> Given the following piece of code
>>
>> void func(int *a, int *b)
>> {
>> a[0] = b[0];
>> a[1] = b[1];
>> a[2] = b[2];
>> ...
>> }
>>
>> Here, I can't get the scheduler to move the loads to the top of the
>> basic block.
>It seems to me that doing so would simply not be correct, because a and b
>might alias. Does it do what you want when you qualify the pointers with
>__redtrict?
It doesn't work even when a and b do not alias, e.g use __restrict
qualifier, or
-fno-argument-alias with above code, or use the following code
void func (int *a)
{
int b[5];
a[0] = b[0];
a[1] = b[1];
a[2] = b[2];
...
}
--Sanjiv