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: memcpy to an unaligned address


On Aug 2, 2005, at 1:45 PM, Ian Lance Taylor wrote:
That argument doesn't make sense to me.  memcpy takes a void*
argument, which has no presumed alignment.

The memcpy builtin uses the static type of the actual argument (before conversion to void*), to gain hints about the alignments of the data coming in. This is so that we can producing nice fast code for 1-16 bytes objects. This is actually good. The real problem is formation of the address of the member doesn't produce a pointer to unaligned type, but rather a pointer to aligned type, this is the part that is wrong. We'd have to add pointers to unaligned data to our type system to fix it. That should be done, but is a hard/big job, and no one has stepped forward to do it.



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