https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123930
Bug ID: 123930
Summary: Two block constructs in a PARALLEL region cause
compilation error
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Consider the following code:
program test
implicit none
!$OMP PARALLEL
block
end block
block
end block
!$OMP END PARALLEL
end program
Intel fortran (ifort and ifx) and GFortran versions 8 - 11 compile the code
fine.
However, GFortran versions 14 and 15 yield:
gfortran -fopenmp test.f90
test.f90:12:18:
12 | !$OMP END PARALLEL
| 1
Error: Unexpected !$OMP END PARALLEL statement at (1)
This only happens when there are two blocks in the same PARALLEL region.
If one inserts a line before the first block like:
!$OMP PARALLEL
i=1
block
end block
block
end block
!$OMP END PARALLEL
then the code compiles.