From 91ae0a46fd6bf4669fe251398c3f4f3ebaa7b2ff Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 30 Oct 2019 16:32:38 +0000 Subject: Fortran/OpenMP] Don't create "alloc:" for 'target exit data' gcc/ * gimplify.c (gimplify_scan_omp_clauses): Remove FE-generated GOMP_MAP_TO_PSET and GOMP_MAP_POINTER mapping for 'target update' and 'target exit data'. libgomp/ * testsuite/libgomp.fortran/target9.f90: New. From-SVN: r277631 --- gcc/gimplify.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index fdf6b69..12ed3f8 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -8590,6 +8590,17 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, default: break; } + /* For Fortran, not only the pointer to the data is mapped but also + the address of the pointer, the array descriptor etc.; for + 'exit data' - and in particular for 'delete:' - having an 'alloc:' + does not make sense. Likewise, for 'update' only transferring the + data itself is needed as the rest has been handled in previous + directives. */ + if ((code == OMP_TARGET_EXIT_DATA || code == OMP_TARGET_UPDATE) + && (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER + || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_TO_PSET)) + remove = true; + if (remove) break; if (DECL_P (decl) && outer_ctx && (region_type & ORT_ACC)) -- cgit v1.1