Fortran: OpenMP 5.0 (in_,task_)reduction clause extensions
authorTobias Burnus <tobias@codesourcery.com>
Tue, 10 Nov 2020 17:28:18 +0000 (18:28 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Tue, 10 Nov 2020 17:28:18 +0000 (18:28 +0100)
commite929ef532ad52cde873dfc0849907b020ffc5afd
tree095a8e137a565634c9bfe46eb4542a857a21c539
parent2cca9751700946f1398fc3bcb96d529bb2964f0f
Fortran: OpenMP 5.0 (in_,task_)reduction clause extensions

gcc/fortran/ChangeLog:

* dump-parse-tree.c (show_omp_clauses): Handle new reduction enums.
* gfortran.h (OMP_LIST_REDUCTION_INSCAN, OMP_LIST_REDUCTION_TASK,
OMP_LIST_IN_REDUCTION, OMP_LIST_TASK_REDUCTION): Add enums.
* openmp.c (enum omp_mask1): Add OMP_CLAUSE_IN_REDUCTION
and OMP_CLAUSE_TASK_REDUCTION.
(gfc_match_omp_clause_reduction): Extend reduction handling;
moved from ...
(gfc_match_omp_clauses): ... here. Add calls to it.
(OMP_TASK_CLAUSES, OMP_TARGET_CLAUSES, OMP_TASKLOOP_CLAUSES):
Add OMP_CLAUSE_IN_REDUCTION.
(gfc_match_omp_taskgroup): Add task_reduction matching.
(resolve_omp_clauses): Update for new reduction clause changes;
remove removed nonmonotonic-schedule restrictions.
(gfc_resolve_omp_parallel_blocks): Add new enums to switch.
* trans-openmp.c (gfc_omp_clause_default_ctor,
gfc_trans_omp_reduction_list, gfc_trans_omp_clauses,
gfc_split_omp_clauses): Handle updated reduction clause.

gcc/ChangeLog:

* gimplify.c (gimplify_scan_omp_clauses, gimplify_omp_loop): Use 'do'
instead of 'for' in error messages for Fortran.
* omp-low.c (check_omp_nesting_restrictions): Likewise

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/schedule-modifiers-2.f90: Remove some dg-error.
* gfortran.dg/gomp/reduction4.f90: New test.
* gfortran.dg/gomp/reduction5.f90: New test.
* gfortran.dg/gomp/workshare-reduction-1.f90: New test.
* gfortran.dg/gomp/workshare-reduction-2.f90: New test.
* gfortran.dg/gomp/workshare-reduction-3.f90: New test.
* gfortran.dg/gomp/workshare-reduction-4.f90: New test.
* gfortran.dg/gomp/workshare-reduction-5.f90: New test.
* gfortran.dg/gomp/workshare-reduction-6.f90: New test.
* gfortran.dg/gomp/workshare-reduction-7.f90: New test.
* gfortran.dg/gomp/workshare-reduction-8.f90: New test.
* gfortran.dg/gomp/workshare-reduction-9.f90: New test.
* gfortran.dg/gomp/workshare-reduction-10.f90: New test.
* gfortran.dg/gomp/workshare-reduction-11.f90: New test.
* gfortran.dg/gomp/workshare-reduction-12.f90: New test.
* gfortran.dg/gomp/workshare-reduction-13.f90: New test.
* gfortran.dg/gomp/workshare-reduction-14.f90: New test.
* gfortran.dg/gomp/workshare-reduction-15.f90: New test.
* gfortran.dg/gomp/workshare-reduction-16.f90: New test.
* gfortran.dg/gomp/workshare-reduction-17.f90: New test.
* gfortran.dg/gomp/workshare-reduction-18.f90: New test.
* gfortran.dg/gomp/workshare-reduction-19.f90: New test.
* gfortran.dg/gomp/workshare-reduction-20.f90: New test.
* gfortran.dg/gomp/workshare-reduction-21.f90: New test.
* gfortran.dg/gomp/workshare-reduction-22.f90: New test.
* gfortran.dg/gomp/workshare-reduction-23.f90: New test.
* gfortran.dg/gomp/workshare-reduction-24.f90: New test.
* gfortran.dg/gomp/workshare-reduction-25.f90: New test.
* gfortran.dg/gomp/workshare-reduction-26.f90: New test.
* gfortran.dg/gomp/workshare-reduction-27.f90: New test.
* gfortran.dg/gomp/workshare-reduction-28.f90: New test.
* gfortran.dg/gomp/workshare-reduction-29.f90: New test.
* gfortran.dg/gomp/workshare-reduction-30.f90: New test.
* gfortran.dg/gomp/workshare-reduction-31.f90: New test.
* gfortran.dg/gomp/workshare-reduction-32.f90: New test.
* gfortran.dg/gomp/workshare-reduction-33.f90: New test.
* gfortran.dg/gomp/workshare-reduction-34.f90: New test.
* gfortran.dg/gomp/workshare-reduction-35.f90: New test.
* gfortran.dg/gomp/workshare-reduction-36.f90: New test.
* gfortran.dg/gomp/workshare-reduction-37.f90: New test.
* gfortran.dg/gomp/workshare-reduction-38.f90: New test.
* gfortran.dg/gomp/workshare-reduction-39.f90: New test.
* gfortran.dg/gomp/workshare-reduction-40.f90: New test.
* gfortran.dg/gomp/workshare-reduction-41.f90: New test.
* gfortran.dg/gomp/workshare-reduction-42.f90: New test.
* gfortran.dg/gomp/workshare-reduction-43.f90: New test.
* gfortran.dg/gomp/workshare-reduction-44.f90: New test.
* gfortran.dg/gomp/workshare-reduction-45.f90: New test.
* gfortran.dg/gomp/workshare-reduction-46.f90: New test.
* gfortran.dg/gomp/workshare-reduction-47.f90: New test.
* gfortran.dg/gomp/workshare-reduction-48.f90: New test.
* gfortran.dg/gomp/workshare-reduction-49.f90: New test.
* gfortran.dg/gomp/workshare-reduction-50.f90: New test.
* gfortran.dg/gomp/workshare-reduction-51.f90: New test.
* gfortran.dg/gomp/workshare-reduction-52.f90: New test.
* gfortran.dg/gomp/workshare-reduction-53.f90: New test.
* gfortran.dg/gomp/workshare-reduction-54.f90: New test.
* gfortran.dg/gomp/workshare-reduction-55.f90: New test.
* gfortran.dg/gomp/workshare-reduction-56.f90: New test.
* gfortran.dg/gomp/workshare-reduction-57.f90: New test.
* gfortran.dg/gomp/workshare-reduction-58.f90: New test.
67 files changed:
gcc/fortran/dump-parse-tree.c
gcc/fortran/gfortran.h
gcc/fortran/openmp.c
gcc/fortran/trans-openmp.c
gcc/gimplify.c
gcc/omp-low.c
gcc/testsuite/gfortran.dg/gomp/reduction4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/reduction5.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/schedule-modifiers-2.f90
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-11.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-12.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-13.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-14.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-15.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-17.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-18.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-19.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-20.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-21.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-22.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-23.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-24.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-25.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-26.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-27.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-28.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-29.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-30.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-31.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-32.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-33.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-34.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-35.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-36.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-37.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-38.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-39.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-40.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-41.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-42.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-43.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-44.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-45.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-46.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-47.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-48.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-49.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-5.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-50.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-51.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-52.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-53.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-54.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-55.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-56.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-57.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-58.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-6.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-7.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-8.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-9.f90 [new file with mode: 0644]