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 #36 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
#c33 testcase was not tested since I have some doubts about it. Note
that original problem was
#pragma omp simd
  for (int i=0; i<S_n; i++)
    {
      float w1 = C2[S_n + i] * w;
      v1.v_i[i] += (int)w1;
      C1[S_n + i] += w1;
    }

and we must hoist S_n out of loop to vectorize it.

2016-07-04 19:40 GMT+03:00 jakub at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70729
>
> --- Comment #35 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Doesn't it still miscompile the #c33 testcase?
> Say with __attribute__((noinline, noclone)) on baz and
> int v[2048];
>
> int
> main ()
> {
>   v[1023] = 5;
>   baz (v, v + 1023, v + 1024, v + 1023);
>   int i;
>   for (i = 0; i < 1024; i++)
>     if (v[i] != 5 * 6 || v[1024 + i] != (i == 1023 ? 5 * 6 : 5) * 9)
>       __builtin_abort ();
>   return 0;
> }
> (untested)?
>
> --
> You are receiving this mail because:
> You reported the bug.

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