https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123225

--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm testing a patch.  With PGO we'll still vectorize the following.

short * __attribute__((noipa))
foo (short *arr)
{
  unsigned int pos = 0;
  while(1)
    {
      arr++;
      if (*arr == 0)
   break;      
    }
  return arr;  
}

int main()
{
  short *p = __builtin_malloc (1024*1024*2);
  __builtin_memset (p, -1, 1024*1024*2 - 2);
  p[1024*1024 - 1] = 0;
  if (foo (p) != p + 1024*1024 - 1)
    __builtin_abort ();
  return 0;
}

Reply via email to