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


On Oct 25, 2010, at 3:44 PM, Richard Guenther wrote:

> On Mon, Oct 25, 2010 at 11:26 AM, Paul Koning <Paul_Koning@dell.com> wrote:
>> Question on movmemm:
>> 
>> Given
>> 
>> extern int *i, *j;
>> void foo (void) { memcpy (i, j, 10); }
>> 
>> I would expect to see argument 4 (the shared alignment) to be sizeof(int) since both argument are pointers to int.  What I get instead is 1.  Why is that?
> 
> Because the int * could point to unaligned data and there is no access
> that would prove otherwise (memcpy accepts any alignment).

Ok, but if I do a load on an int*, I get an aligned load, not an unaligned load, so in all those other cases there *is* an assumption that an int* contains a properly aligned address.  

	paul


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