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

            Bug ID: 94672
           Summary: gfortran/OpenMP chokes on PRESENT(array) despite of
                    SHARED(array): Error: ‘array’ not specified in
                    enclosing ‘parallel’
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at abeckmann dot de
  Target Milestone: ---

Created attachment 48314
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48314&action=edit
failing testcase

This is a regression in gfortran-10 (reproduced in GNU Fortran (GCC) 10.0.1
20200420 (experimental) built from git master):

gfortran-master -Wall -fopenmp -c gf10bug.f90
gf10bug.f90:10:0:

   10 |        IF (PRESENT(array)) THEN
      | 
Error: ‘array’ not specified in enclosing ‘parallel’
gf10bug.f90:10:0: Error: enclosing ‘parallel’

But 'array' *is* 'shared':
    !$OMP PARALLEL DO DEFAULT(none) SHARED(array,n) PRIVATE(i)
    DO i = 1,n
       IF (PRESENT(array)) THEN

That code is accepted by gfortran <= 9, Flang, Intel, PGI.

Reply via email to