diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-07-01 17:52:03 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2022-07-01 17:52:03 +0200 |
commit | 9a668532fb19e7c57aa595a26ce3f0d95f9cbb1b (patch) | |
tree | b127b7654ff9265f677a85bfc921e47aaf605c78 /gcc/fortran/openmp.cc | |
parent | f843bea4ca5613cb713f8b9313daa3938f254a05 (diff) | |
download | gcc-9a668532fb19e7c57aa595a26ce3f0d95f9cbb1b.zip gcc-9a668532fb19e7c57aa595a26ce3f0d95f9cbb1b.tar.gz gcc-9a668532fb19e7c57aa595a26ce3f0d95f9cbb1b.tar.bz2 |
OpenMP: Handle tofrom with target enter/exit data
In 5.2, a map clause can be map-entering or map-exiting,
either containing 'tofrom'. The main reason for this is
permit 'map(x)' with 'omp target enter/exit data',
avoiding to specify 'to:/from:' explicitly. (OpenMP
defaults to 'tofrom'.)
gcc/c/ChangeLog:
* c-parser.cc (c_parser_omp_target_enter_data,
c_parser_omp_target_exit_data): Accept tofrom
map-type modifier but use 'to' / 'from' internally.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_omp_target_enter_data,
cp_parser_omp_target_exit_data): Accept tofrom
map-type modifier but use 'to' / 'from' internally.
gcc/fortran/ChangeLog:
* dump-parse-tree.cc (show_omp_namelist): For the map-type,
also handle the always modifer and release/delete.
* openmp.cc (resolve_omp_clauses): Accept tofrom
map-type modifier for target enter/exit data,
but use 'to' / 'from' internally.
libgomp/ChangeLog:
* libgomp.texi (OpenMP 5.2): Mark target enter/exit data
with fromto as implemented.
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/target-data-2.c: New test.
* c-c++-common/gomp/target-data-3.c: New test.
* gfortran.dg/gomp/target-data-1.f90: New test.
* gfortran.dg/gomp/target-data-2.f90: New test.
Diffstat (limited to 'gcc/fortran/openmp.cc')
-rw-r--r-- | gcc/fortran/openmp.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index aeb8a43..93e40f2 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -7153,10 +7153,16 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, case OMP_MAP_ALWAYS_TO: case OMP_MAP_ALLOC: break; + case OMP_MAP_TOFROM: + n->u.map_op = OMP_MAP_TO; + break; + case OMP_MAP_ALWAYS_TOFROM: + n->u.map_op = OMP_MAP_ALWAYS_TO; + break; default: gfc_error ("TARGET ENTER DATA with map-type other " - "than TO, or ALLOC on MAP clause at %L", - &n->where); + "than TO, TOFROM or ALLOC on MAP clause " + "at %L", &n->where); break; } break; @@ -7168,10 +7174,16 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, case OMP_MAP_RELEASE: case OMP_MAP_DELETE: break; + case OMP_MAP_TOFROM: + n->u.map_op = OMP_MAP_FROM; + break; + case OMP_MAP_ALWAYS_TOFROM: + n->u.map_op = OMP_MAP_ALWAYS_FROM; + break; default: gfc_error ("TARGET EXIT DATA with map-type other " - "than FROM, RELEASE, or DELETE on MAP " - "clause at %L", &n->where); + "than FROM, TOFROM, RELEASE, or DELETE on " + "MAP clause at %L", &n->where); break; } break; |