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/70729] Loop marked with omp simd pragma is not vectorized


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

--- Comment #38 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Sorry, make that
__attribute__((noinline, noclone)) void
baz (int *p, int *q, int *r, int *s)
{
#pragma omp simd
  for (int i = 0; i < 1024; i++)
    {
      p[i] += q[0] * 6;
      r[i] += s[0] * 9;
    }
}

int v[2048];

int
main ()
{
  v[1023] = 5;
  baz (v, v + 1023, v + 1024, v + 1023);
  int i;
  for (i = 0; i < 1023; i++)
    if (v[i] != 5 * 6 || v[1024 + i] != 5 * 9)
      __builtin_abort ();
  if (v[i] != 5 * 6 + 5 || v[2047] != (5 * 6 + 5) * 9)
    __builtin_abort ();
  return 0;
}

This passes without -fopenmp/-fopenmp-simd.  Anyway, I've raised it on
omp-lang.

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