aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2020-07-27 06:29:02 -0700
committerJulian Brown <julian@codesourcery.com>2020-08-03 12:06:49 -0700
commitf2f4212e20c5dc4422aea355abe9a3bf0e05db71 (patch)
tree23c95d451bd4ea81c4113b6cefc9cf2f30eeb98f /gcc/gimplify.c
parent105fe3e0b896998b4a1b5a79ad6526959c2e2e7a (diff)
downloadgcc-f2f4212e20c5dc4422aea355abe9a3bf0e05db71.zip
gcc-f2f4212e20c5dc4422aea355abe9a3bf0e05db71.tar.gz
gcc-f2f4212e20c5dc4422aea355abe9a3bf0e05db71.tar.bz2
openacc: No attach/detach present/release mappings for array descriptors
Standalone attach and detach clauses should not create present/release mappings for Fortran array descriptors (e.g. used when we have a pointer to an array), both because it is unnecessary and because those mappings will be incorrectly subject to reference counting. Simply omitting the mappings means we just use GOMP_MAP_TO_PSET and GOMP_MAP_{ATTACH,DETACH} mappings for array descriptors. That requires a tweak in gimplify.c, since we may now see GOMP_MAP_TO_PSET without a preceding data-movement mapping. 2020-08-03 Julian Brown <julian@codesourcery.com> Thomas Schwinge <thomas@codesourcery.com> gcc/fortran/ * trans-openmp.c (gfc_trans_omp_clauses): Don't create present/release mappings for array descriptors. gcc/ * gimplify.c (gimplify_omp_target_update): Allow GOMP_MAP_TO_PSET without a preceding data-movement mapping. gcc/testsuite/ * gfortran.dg/goacc/attach-descriptor.f90: Update pattern output. Add scanning of gimplify dump. libgomp/ * testsuite/libgomp.oacc-fortran/attach-descriptor-1.f90: Don't run for shared-memory devices. Extend with further checking. Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 15dfee9..6a5349c 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -13013,8 +13013,13 @@ gimplify_omp_target_update (tree *expr_p, gimple_seq *pre_p)
OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_DELETE);
have_clause = true;
break;
- case GOMP_MAP_POINTER:
case GOMP_MAP_TO_PSET:
+ /* Fortran arrays with descriptors must map that descriptor when
+ doing standalone "attach" operations (in OpenACC). In that
+ case GOMP_MAP_TO_PSET appears by itself with no preceding
+ clause (see trans-openmp.c:gfc_trans_omp_clauses). */
+ break;
+ case GOMP_MAP_POINTER:
/* TODO PR92929: we may see these here, but they'll always follow
one of the clauses above, and will be handled by libgomp as
one group, so no handling required here. */