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

            Bug ID: 104252
           Summary: OpenMP array reduction support issue
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

Created attachment 52299
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52299&action=edit
Source for test case.

For the attached test case source file:

> gfortran -fopenmp array-reduction-test.F90 
array-reduction-test.F90:26:37:

   26 |      !$omp parallel do reduction(+:a(i))
      |                                     1
Error: Syntax error in OpenMP variable list at (1)
array-reduction-test.F90:30:26:

   30 |      !$omp end parallel do
      |                          1
Error: Unexpected !$OMP END PARALLEL DO statement at (1)


> gfortran -fopenmp -DARRAY_SECTION array-reduction-test.F90 
array-reduction-test.F90:18:37:

   18 |      !$omp parallel do reduction(+:a(i:1))
      |                                     1
Error: Syntax error in OpenMP variable list at (1)
array-reduction-test.F90:22:26:

   22 |      !$omp end parallel do
      |                          1
Error: Unexpected !$OMP END PARALLEL DO statement at (1)

> gfortran -fopenmp -DFULL_ARRAY array-reduction-test.F90 

> gfortran --version
GNU Fortran (GCC) 11.2.0 20210728 (Cray Inc.)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Gfortran seems to be OK with a whole array in an OpenMP reduction clause, but
not with an array element or an array section.  Other compilers (ifort, for
example) accept all 3 forms.

Reply via email to