[Bug tree-optimization/70729] Loop marked with omp simd pragma is not vectorized

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 4 14:54:00 GMT 2016


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

--- Comment #30 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Another thing to think of, e.g.
void
baz (int *p, int *q)
{
  #pragma omp simd safelen(2)
  for (int i = 0; i < 1024; i++)
    p[4 * i] += q[0];
}
for aliasing p[4 * 1022] I think still applies that if (&q[0] == &p[4 * 1022])
then p[4 * 1022] == 0 upon entry to the loop, because while the penultimate
iteration could be executed in the SIMD chunk, it could as well be executed
before the last iteration and thus if it changes its value, it would mean
undefined behavior.


More information about the Gcc-bugs mailing list