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: 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


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