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 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 (void) { *i; *j; memcpy (i, j, 10); }
>> 
>> That doesn't make any difference; I still get alignment 1.
>> 
> 
>  That sounds like a missed optimisation opportunity to me, but maybe there's
> some reason the compiler can't infer a larger alignment.  (Or maybe the reads
> got discarded, you might need volatile to avoid that?)

No, they weren't discarded, I can see them in the output assembler code.  Actually, I wrote *i = 20; *j = 10; 

	paul



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