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
jos...@codesourcery.com

Reply via email to