openmp: Fortran strictly-structured blocks support
authorChung-Lin Tang <cltang@codesourcery.com>
Thu, 21 Oct 2021 06:56:20 +0000 (14:56 +0800)
committerChung-Lin Tang <cltang@codesourcery.com>
Thu, 21 Oct 2021 06:57:25 +0000 (14:57 +0800)
commit2e4659199e814b7ee0f6bd925fd2c0a7610da856
tree476464a5472b16f0039b949a5e6102bb85bea92f
parent1af78e731feb9327a17c99ebaa19a4cca1125caf
openmp: Fortran strictly-structured blocks support

This implements strictly-structured blocks support for Fortran, as specified in
OpenMP 5.2. This now allows using a Fortran BLOCK construct as the body of most
OpenMP constructs, with a "!$omp end ..." ending directive optional for that
form.

gcc/fortran/ChangeLog:

* decl.c (gfc_match_end): Add COMP_OMP_STRICTLY_STRUCTURED_BLOCK case
together with COMP_BLOCK.
* parse.c (parse_omp_structured_block): Change return type to
'gfc_statement', add handling for strictly-structured block case, adjust
recursive calls to parse_omp_structured_block.
(parse_executable): Adjust calls to parse_omp_structured_block.
* parse.h (enum gfc_compile_state): Add
COMP_OMP_STRICTLY_STRUCTURED_BLOCK.
* trans-openmp.c (gfc_trans_omp_workshare): Add EXEC_BLOCK case
handling.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/cancel-1.f90: Adjust testcase.
* gfortran.dg/gomp/nesting-3.f90: Adjust testcase.
* gfortran.dg/gomp/strictly-structured-block-1.f90: New test.
* gfortran.dg/gomp/strictly-structured-block-2.f90: New test.
* gfortran.dg/gomp/strictly-structured-block-3.f90: New test.

libgomp/ChangeLog:

* libgomp.texi (Support of strictly structured blocks in Fortran):
Adjust to 'Y'.
* testsuite/libgomp.fortran/task-reduction-16.f90: Adjust testcase.
gcc/fortran/decl.c
gcc/fortran/parse.c
gcc/fortran/parse.h
gcc/fortran/trans-openmp.c
gcc/testsuite/gfortran.dg/gomp/cancel-1.f90
gcc/testsuite/gfortran.dg/gomp/nesting-3.f90
gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-3.f90 [new file with mode: 0644]
libgomp/libgomp.texi
libgomp/testsuite/libgomp.fortran/task-reduction-16.f90