Re: movmemm pattern

2010-10-26 Thread Joseph S. Myers
On Mon, 25 Oct 2010, Richard Guenther wrote: Because the int * could point to unaligned data and there is no access that would prove otherwise (memcpy accepts any alignment). As previously discussed, in ISO C storing a pointer in a particular pointer type or converting to / through that type

Re: movmemm pattern

2010-10-26 Thread Paul Koning
On Oct 25, 2010, at 9:28 PM, Dave Korn wrote: On 26/10/2010 01:53, Paul Koning wrote: On Oct 25, 2010, at 3:44 PM, Richard Guenther wrote: On Mon, Oct 25, 2010 at 11:26 AM, Paul Koning paul_kon...@dell.com wrote: Question on movmemm: Given extern int *i, *j; void foo (void) { memcpy

Re: movmemm pattern

2010-10-26 Thread Dave Korn
On 26/10/2010 17:16, Paul Koning wrote: On Oct 25, 2010, at 9:28 PM, Dave Korn wrote: On 26/10/2010 01:53, Paul Koning wrote: On Oct 25, 2010, at 3:44 PM, Richard Guenther wrote: On Mon, Oct 25, 2010 at 11:26 AM, Paul Koning paul_kon...@dell.com wrote: Question on movmemm: Given

Re: movmemm pattern

2010-10-26 Thread Paul Koning
On Oct 26, 2010, at 1:27 PM, Dave Korn wrote: On 26/10/2010 17:16, Paul Koning wrote: On Oct 25, 2010, at 9:28 PM, Dave Korn wrote: ... What happens if you dereference i and j before the memcpy in foo? Do you then get int-sized shared alignment in movmemM? extern int *i, *j; void foo

Re: movmemm pattern

2010-10-26 Thread Richard Guenther
On Tue, Oct 26, 2010 at 1:12 PM, Paul Koning paul_kon...@dell.com wrote: On Oct 26, 2010, at 1:27 PM, Dave Korn wrote: On 26/10/2010 17:16, Paul Koning wrote: On Oct 25, 2010, at 9:28 PM, Dave Korn wrote: ... What happens if you dereference i and j before the memcpy in foo?  Do you then

movmemm pattern

2010-10-25 Thread Paul Koning
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? If I have extern int i[10], j[10]; then I do get

Re: movmemm pattern

2010-10-25 Thread Richard Guenther
On Mon, Oct 25, 2010 at 11:26 AM, Paul Koning paul_kon...@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

Re: movmemm pattern

2010-10-25 Thread Paul Koning
On Oct 25, 2010, at 3:44 PM, Richard Guenther wrote: On Mon, Oct 25, 2010 at 11:26 AM, Paul Koning paul_kon...@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

Re: movmemm pattern

2010-10-25 Thread Dave Korn
On 26/10/2010 01:53, Paul Koning wrote: On Oct 25, 2010, at 3:44 PM, Richard Guenther wrote: On Mon, Oct 25, 2010 at 11:26 AM, Paul Koning paul_kon...@dell.com wrote: Question on movmemm: Given extern int *i, *j; void foo (void) { memcpy (i, j, 10); } I would expect to see argument