This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: memcpy to an unaligned address
- From: Mike Stump <mrs at apple dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: dave dot korn at artimi dot com (Dave Korn), pkoning at equallogic dot com (Paul Koning), gcc at sources dot redhat dot com, sjackman at gmail dot com (Shaun Jackman)
- Date: Tue, 2 Aug 2005 14:04:16 -0700
- Subject: Re: memcpy to an unaligned address
- References: <200508022037.j72Kbr4T012558@earth.phy.uc.edu>
On Aug 2, 2005, at 1:37 PM, Andrew Pinski wrote:
No it is not,
:-) Ah, yes, the old, we don't have pointers to unaligned types
problem... anyway, we can at least agree that this is a gapping hole
people can drive trucks though in the type system, but I'm still
claiming it isn't a feature on theoretic grounds.
:-(
Shaun, want to do up an entry in the manual describing this? We have
known about this for years and years, but, we don't do a good job
communicating it to users. Essentially, & doesn't work as one would
expect on unaligned data, as it produces a pointer to an aligned
object instead of a pointer to unaligned object. Essentially, we
don't have a type system that contains pointer to unaligned types.
The compiler then goes on to make codegen choices based upon the fact
that the data are known to be aligned, and bad things happen.