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.

Reply via email to