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: __builtin_memcpy and alignment assumptions


> I think we only assume it if the pointer is actually dereferenced, otherwise
> it just breaks too much code in the wild.  And while memcpy dereferences,
> it dereferences it through a char * cast, and thus only the minimum
> alignment is assumed.

Yet the compiler was generating the expected code for Steve's testcase on 
strict-alignment architectures until very recently (GCC 4.5 IIUC) and this 
worked perfectly.

The irony of this very questionable change is that it was made to support some 
corner cases with SSE on x86 but of course the compiler generates the expected 
code for Steve's testcase on x86 because it is _not_ strict-alignment...

-- 
Eric Botcazou


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