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

            Bug ID: 96459
           Summary: OpenMP host teams reductions ignored
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

#include <stdlib.h>

int
main ()
{
  int niters = 0, i, j, k;
  #pragma omp teams reduction(+:niters)
  {
    #pragma omp distribute collapse(3)
    for (i = 0; i < 3; i++)
      for (j = 0; j < 8; j += 2)
        for (k = 0; k < 25; k += 3)
          niters++;
  }
  if (niters != 96)
    abort ();
  return 0;
}

is miscompiled, nothing performs the reduction on niters.

Reply via email to