diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2021-08-23 15:13:30 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2021-08-23 15:15:30 +0200 |
commit | d4de7e32eff0a6363defa50b052d7a30548b6552 (patch) | |
tree | bd5194a6695890713e7d8dcd2185c958029020ca /gcc/fortran/openmp.c | |
parent | 12dc8ab983db039a570e3798b468498e2230c7d9 (diff) | |
download | gcc-d4de7e32eff0a6363defa50b052d7a30548b6552.zip gcc-d4de7e32eff0a6363defa50b052d7a30548b6552.tar.gz gcc-d4de7e32eff0a6363defa50b052d7a30548b6552.tar.bz2 |
Fortran/OpenMP: strict modifier on grainsize/num_tasks
This patch adds support for the 'strict' modifier on grainsize/num_tasks
clauses, an OpenMP 5.1 feature supported in C/C++ since commit
r12-3066-g3bc75533d1f87f0617be6c1af98804f9127ec637
gcc/fortran/ChangeLog:
* dump-parse-tree.c (show_omp_clauses): Handle 'strict' modifier
on grainsize/num_tasks
* gfortran.h (gfc_omp_clauses): Add grainsize_strict
and num_tasks_strict.
* trans-openmp.c (gfc_trans_omp_clauses, gfc_split_omp_clauses):
Handle 'strict' modifier on grainsize/num_tasks.
* openmp.c (gfc_match_omp_clauses): Likewise.
libgomp/ChangeLog:
* testsuite/libgomp.fortran/taskloop-4-a.f90: New test.
* testsuite/libgomp.fortran/taskloop-4.f90: New test.
* testsuite/libgomp.fortran/taskloop-5-a.f90: New test.
* testsuite/libgomp.fortran/taskloop-5.f90: New test.
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 2380866..1aae35a 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -1839,8 +1839,14 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, } if ((mask & OMP_CLAUSE_GRAINSIZE) && c->grainsize == NULL - && gfc_match ("grainsize ( %e )", &c->grainsize) == MATCH_YES) - continue; + && gfc_match ("grainsize ( ") == MATCH_YES) + { + if (gfc_match ("strict : ") == MATCH_YES) + c->grainsize_strict = true; + if (gfc_match (" %e )", &c->grainsize) != MATCH_YES) + goto error; + continue; + } break; case 'h': if ((mask & OMP_CLAUSE_HINT) @@ -2148,8 +2154,14 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, continue; if ((mask & OMP_CLAUSE_NUM_TASKS) && c->num_tasks == NULL - && gfc_match ("num_tasks ( %e )", &c->num_tasks) == MATCH_YES) - continue; + && gfc_match ("num_tasks ( ") == MATCH_YES) + { + if (gfc_match ("strict : ") == MATCH_YES) + c->num_tasks_strict = true; + if (gfc_match (" %e )", &c->num_tasks) != MATCH_YES) + goto error; + continue; + } if ((mask & OMP_CLAUSE_NUM_TEAMS) && c->num_teams == NULL && gfc_match ("num_teams ( %e )", &c->num_teams) == MATCH_YES) |