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

            Bug ID: 104917
           Summary: No runtime alias test required for dependent
                    reductions
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

The testcase from PR87561 shows a case where we have two in-memory reductions
that are possibly dependent but the runtime alias check isn't needed since
we only possibly re-order the summations in the reduction.  Small C testcase:

void foo (double *x, double *y, double * __restrict a, double * __restrict b)
{
  for (int i = 0; i < 1024; ++i)
    {
      x[i] += a[i];
      y[i] += b[i];
    }
}

here x[] and y[] are dependent but we can vectorize this just fine with
-fassociative-math, eliding the runtime alias check.

Reply via email to