http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50079
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |WAITING Target Milestone|--- |4.7.0 Known to fail| |3.4.0 --- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-15 10:40:58 UTC --- As I said, please re-check after 2011-08-12 Richard Guenther <rguent...@suse.de> * call.c (build_over_call): Instead of memcpy use an assignment of two MEM_REFs. Please also verify if the C testcase extern void abort(); extern void * memcpy(void *dest, void *src, __SIZE_TYPE__ n) { if (dest == src) abort(); else { __SIZE_TYPE__ i; for (i = 0; i < n; i++) ((char *)dest)[i] = ((const char*)src)[i]; } } struct A { double d[10]; }; struct B { struct A a; char bc; }; struct B b; void f(struct B *a1, struct B* a2) { *a1 = *a2; } int main() { f(&b,&b); } fails the same way (it would then even before the patch exposing the C++ testsuite failure). I believe the testcase is broken, in that GCCs behavior of using memcpy for block-moves dates back to date 1. C testcase that also abort()s on x86_64 since at least 3.4.0: extern void abort(); extern void * memcpy(void *dest, void *src, __SIZE_TYPE__ n) { if (dest == src) abort(); else { __SIZE_TYPE__ i; for (i = 0; i < n; i++) ((char *)dest)[i] = ((const char*)src)[i]; } } struct A { double d[1024]; }; struct B { struct A a; char bc; } __attribute__((packed)); struct B b; void f(struct B *a1, struct B* a2) { *a1 = *a2; } int main() { f(&b,&b); }