This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/70701] incomplete value numbering when memcpy-ing from array
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 17 Apr 2016 19:54:30 +0000
- Subject: [Bug tree-optimization/70701] incomplete value numbering when memcpy-ing from array
- Auto-submitted: auto-generated
- References: <bug-70701-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70701
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Er, sorry, a "const" disappeared when I posted.
const int a[]={1,2,3};
int f(){
int*b=__builtin_malloc(12);
__builtin_memcpy(b,a,12);
return b[0];
}
this fails to optimize (without forwprop).
int a[]={1,2,3};
int f(){
a[0]=42;
int*b=__builtin_malloc(12);
__builtin_memcpy(b,a,12);
return b[0];
}
this is optimized.