aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-09-20 12:13:31 +0200
committerTobias Burnus <tobias@codesourcery.com>2021-09-20 12:13:31 +0200
commit0de4184baca19cdd4ebc2d8aa2d538330cae51ee (patch)
treeecc54fa767818f38c668f288e38bfaf62fa1c5c5 /gcc/fortran/trans-openmp.c
parent24f99147b9264f8f7d9cfb2fa6bd431edfa252d2 (diff)
downloadgcc-0de4184baca19cdd4ebc2d8aa2d538330cae51ee.zip
gcc-0de4184baca19cdd4ebc2d8aa2d538330cae51ee.tar.gz
gcc-0de4184baca19cdd4ebc2d8aa2d538330cae51ee.tar.bz2
Fortran/OpenMP: unconstrained/reproducible ordered modifier
gcc/fortran/ChangeLog: * gfortran.h (gfc_omp_clauses): Add order_unconstrained. * dump-parse-tree.c (show_omp_clauses): Dump it. * openmp.c (gfc_match_omp_clauses): Match unconstrained/reproducible modifiers to ordered(concurrent). (OMP_DISTRIBUTE_CLAUSES): Accept ordered clause. (resolve_omp_clauses): Reject ordered + order on same directive. * trans-openmp.c (gfc_trans_omp_clauses, gfc_split_omp_clauses): Pass on unconstrained modifier of ordered(concurrent). gcc/testsuite/ChangeLog: * gfortran.dg/gomp/order-5.f90: New test. * gfortran.dg/gomp/order-6.f90: New test. * gfortran.dg/gomp/order-7.f90: New test. * gfortran.dg/gomp/order-8.f90: New test. * gfortran.dg/gomp/order-9.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index e55e0c8..4ca2c3f 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -3803,6 +3803,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
if (clauses->order_concurrent)
{
c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ORDER);
+ OMP_CLAUSE_ORDER_UNCONSTRAINED (c) = clauses->order_unconstrained;
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
}
@@ -5892,6 +5893,8 @@ gfc_split_omp_clauses (gfc_code *code,
= code->ext.omp_clauses->collapse;
clausesa[GFC_OMP_SPLIT_DISTRIBUTE].order_concurrent
= code->ext.omp_clauses->order_concurrent;
+ clausesa[GFC_OMP_SPLIT_DISTRIBUTE].order_unconstrained
+ = code->ext.omp_clauses->order_unconstrained;
}
if (mask & GFC_OMP_MASK_PARALLEL)
{
@@ -5946,6 +5949,8 @@ gfc_split_omp_clauses (gfc_code *code,
= code->ext.omp_clauses->collapse;
clausesa[GFC_OMP_SPLIT_DO].order_concurrent
= code->ext.omp_clauses->order_concurrent;
+ clausesa[GFC_OMP_SPLIT_DO].order_unconstrained
+ = code->ext.omp_clauses->order_unconstrained;
}
if (mask & GFC_OMP_MASK_SIMD)
{
@@ -5962,6 +5967,8 @@ gfc_split_omp_clauses (gfc_code *code,
= code->ext.omp_clauses->if_exprs[OMP_IF_SIMD];
clausesa[GFC_OMP_SPLIT_SIMD].order_concurrent
= code->ext.omp_clauses->order_concurrent;
+ clausesa[GFC_OMP_SPLIT_SIMD].order_unconstrained
+ = code->ext.omp_clauses->order_unconstrained;
/* And this is copied to all. */
clausesa[GFC_OMP_SPLIT_SIMD].if_expr
= code->ext.omp_clauses->if_expr;