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

            Bug ID: 63922
           Summary: Compiler error with OpenMP, default(none) and an
                    integer parameter array
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: john.donners at surfsara dot nl

the following test code produces a compiler error:

$ cat test.f90
program  omp
implicit none
integer i,region

integer,parameter::l=4
integer,parameter::a(l)=(/1,2,3,4/)

!$OMP PARALLEL  &
!$OMP default(none) &
!$OMP shared(region) &
!$OMP & private(i)
!$OMP DO
do region=1,l
      if(a(region).eq.1) then
        i=1
      endif
enddo
!$OMP END DO
!$OMP END PARALLEL

end program omp
$ gfortran -v -fopenmp test.f90
...
GNU Fortran (Ubuntu 4.8.2-19ubuntu1) version 4.8.2 (x86_64-linux-gnu)
    compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version 3.1.2-p3,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
test.f90: In function ‘omp’:
test.f90:15:0: error: ‘a’ not specified in enclosing parallel
       if(a(region).eq.1) then
 ^
test.f90:12:0: error: enclosing parallel
 !$OMP & private(i)
 ^

However, since the array a is a parameter, it shouldn't need to be specified in
the enclosing parallel. 

The same problem occurs in version 5.0.0 20140917 (experimental).

Reply via email to