Andrew Pinski <[EMAIL PROTECTED]> writes: > > Yes, this is a compiler bug in the expansion of memcpy, please file a > > bug report. The solution is for the compiler to notice the memory > > alignment of the destination and `do-the-right-thing' when it isn't > > aligned. > > No it is not, once you take the address (which should be rejected), it > is of type "unsigned int *" and not unaligned variable, passing it to > memcpy assumes the type alignment is the natural alignment.
That argument doesn't make sense to me. memcpy takes a void* argument, which has no presumed alignment. The builtin should work the same way. That is, there is an implicit cast to void* in the argument to memcpy. The compiler can certainly take advantage of any knowledge it has about the alignment, but it can't assume anything about the alignment that it doesn't already know. Ian