With the "rework indirect struct handling" patch later in this series,
some parts of this earlier patch (by Chung-Lin) become unnecessary.
This patch reverts those bits.

2021-05-11  Julian Brown  <jul...@codesourcery.com>

gcc/
        * gimplify.c (gimplify_scan_omp_clauses): Don't strip nops in indir_p
        case. Don't add map(*pointer_to_struct) mappings to struct_deref_set.
---
 gcc/gimplify.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index ad192b27208..0674d882861 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -9574,7 +9574,6 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq 
*pre_p,
                        {
                          indir_p = true;
                          decl = TREE_OPERAND (decl, 0);
-                         STRIP_NOPS (decl);
                        }
                      if (TREE_CODE (decl) == INDIRECT_REF
                          && DECL_P (TREE_OPERAND (decl, 0))
@@ -9747,24 +9746,6 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq 
*pre_p,
                  break;
                }
 
-             /* If this was of the form map(*pointer_to_struct), then the
-                'pointer_to_struct' DECL should be considered deref'ed.  */
-             if ((OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ALLOC
-                  || GOMP_MAP_COPY_TO_P (OMP_CLAUSE_MAP_KIND (c))
-                  || GOMP_MAP_COPY_FROM_P (OMP_CLAUSE_MAP_KIND (c)))
-                 && INDIRECT_REF_P (orig_decl)
-                 && DECL_P (TREE_OPERAND (orig_decl, 0))
-                 && TREE_CODE (TREE_TYPE (orig_decl)) == RECORD_TYPE)
-               {
-                 tree ptr = TREE_OPERAND (orig_decl, 0);
-                 if (!struct_deref_set || !struct_deref_set->contains (ptr))
-                   {
-                     if (!struct_deref_set)
-                       struct_deref_set = new hash_set<tree> ();
-                     struct_deref_set->add (ptr);
-                   }
-               }
-
              if (!remove
                  && OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_ALWAYS_POINTER
                  && OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_ATTACH_DETACH
-- 
2.29.2

Reply via email to