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 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 implies it is properly 
aligned for that type.

Actually using that information could be risky - glibc headers assume that 
they can use unaligned accesses on non-strict-alignment targets, for 
example (it's possible some of that is in macros that are only used for 
old GCC versions, but that would need checking) which runs into problems 
if GCC uses the alignment information to decide to use vector 
instructions which really do have strict alignment requirements.

-- 
Joseph S. Myers
joseph@codesourcery.com


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