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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase without headers in C:
typedef __SIZE_TYPE__ size_t;

__attribute__((noinline, noclone)) void
foo (size_t x, int *y)
{
  if (x % 8)
    {
      int l[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }, i;
      for (i = 0; i < x % 8; ++i)
        l[i] = -1;
      __builtin_memcpy (y, l, sizeof (int) * 8);
    }
}

int
main ()
{
  int v[8], i;
  foo (7, v);
  for (i = 0; i < 7; i++)
    if (v[i] != -1)
      __builtin_abort ();
  if (v[i])
    __builtin_abort ();  
  return 0;
}

Reply via email to