[Bug target/53016] memcpy optimization can cause unaligned access on ARM
jquesnelle at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Apr 17 17:09:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53016
--- Comment #6 from Jeffrey Quesnelle <jquesnelle at gmail dot com> 2012-04-17 17:08:22 UTC ---
Hmm, even explicit casts to new void*/char* types doesn't fix it:
const child_t * child3 = (const child_t*)( (const char*)(parentptr) + 4 + size
+ size);
const void* src = (const void*)child3;
void* dest = (void*)&parent.children[2];
memcpy(dest,src,size);
const child_t * child3 = (const child_t*)( (const char*)(parentptr) + 4 + size
+ size);
const unsigned char* src = (const unsigned char*)child3;
unsigned char* dest = (unsigned char*)&parent.children[2];
memcpy(dest,src,size);
Both of these still cause the alignment fault.
More information about the Gcc-bugs
mailing list