This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: movmemm pattern
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Paul Koning <Paul_Koning at dell dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 25 Oct 2010 15:44:53 -0400
- Subject: Re: movmemm pattern
- References: <0525BE73-237F-4CD1-9169-599462DFA17C@dell.com>
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).
Richard.
> If I have
>
> extern int i[10], j[10];
>
> then I do get larger alignment as expected.
>
> ? ? ? ?paul
>
>