[01/16] Rewrite GOMP_MAP_ATTACH_DETACH mappings unconditionally

Message ID 20211125140720.108885-2-julian@codesourcery.com
State New
Headers show
Series
  • OpenMP: lvalues in "map" clauses and struct handling rework
Related show

Commit Message

Julian Brown Nov. 25, 2021, 2:07 p.m.
It never makes sense for a GOMP_MAP_ATTACH_DETACH mapping to survive
beyond gimplify.c, so this patch rewrites such mappings to GOMP_MAP_ATTACH
or GOMP_MAP_DETACH unconditionally (rather than checking for a list
of types of OpenACC or OpenMP constructs), in cases where it hasn't
otherwise been done already in the preceding code.

Previously posted here:

  https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570399.html
  https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571711.html (og11)

OK?

Thanks,

Julian

2021-06-02  Julian Brown  <julian@codesourcery.com>

gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Simplify condition
	for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH or
	GOMP_MAP_DETACH.
---
 gcc/gimplify.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
2.29.2

Patch

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 4cd62270a10..8d8735ae4c1 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -9965,15 +9965,7 @@  gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
 		skip_map_struct:
 		  ;
 		}
-	      else if ((code == OACC_ENTER_DATA
-			|| code == OACC_EXIT_DATA
-			|| code == OACC_DATA
-			|| code == OACC_PARALLEL
-			|| code == OACC_KERNELS
-			|| code == OACC_SERIAL
-			|| code == OMP_TARGET_ENTER_DATA
-			|| code == OMP_TARGET_EXIT_DATA)
-		       && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH)
+	      else if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH)
 		{
 		  gomp_map_kind k = ((code == OACC_EXIT_DATA
 				      || code == OMP_TARGET_EXIT_DATA)