This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/70701] incomplete value numbering when memcpy-ing from array


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.

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