https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123930
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is an OpenMP 5.0 (and earlier) vs. OpenMP 5.1 (and later) difference.
Recent versions of GCC implement the 5.1 requirements.
In OpenMP 5.0, a structured block for Fortran was:
"structured block:
For Fortran, a block of executable statements with a single entry at the top
and a
single exit at the bottom, or an OpenMP construct."
with various restrictions.
In OpenMP 5.1,
"structured block:
For Fortran, a strictly structured block, or a loosely structured block."
strictly structured block:
A single Fortran BLOCK construct, with a single entry at the top and a single
exit at
the bottom.
loosely structured block:
A block of executable constructs, where the first executable construct is not a
Fortran
BLOCK construct, with a single entry at the top and a single exit at the
bottom, or an
OpenMP construct."
plus various restrictions like before.
So,
!$omp parallel
block
end block
block
end block
!$omp end parallel
was valid in OpenMP 5.0, but is not in 5.1, where !$omp parallel is either
followed by
a loosely structured block (not the case here) and then the !$omp end parallel
directive is required, or by a strictly structured block, this case, then !$omp
end parallel is optional, so the parallel has only the first block as body, and
then you have another block and then !$omp end parallel directly that doesn't
have a matching !$omp parallel.
If you want a program to be valid OpenMP 5.0 and 5.1 at the same time, you need
to use a single block as the body, even if it is an extra one and wraps the two
blocks and !$omp end parallel after it, or the first stmt after !$omp parallel
directive should not be block.