]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert "Fix regression of array members in OpenMP map clauses."
authorChung-Lin Tang <cltang@codesourcery.com>
Wed, 26 May 2021 11:12:01 +0000 (19:12 +0800)
committerChung-Lin Tang <cltang@codesourcery.com>
Sat, 29 May 2021 20:55:24 +0000 (04:55 +0800)
This reverts commit 1d47d0c67e1fc2ee2ef6b85d6b0b659970552d57.

gcc/cp/semantics.c

index 6a71338fde9efe649370f11f68a5c068a3d4513c..cc049f5e8decbd643428f97268c5beb5aee93a87 100644 (file)
@@ -5576,8 +5576,6 @@ handle_omp_array_sections (tree c, enum c_omp_region_type ort)
            }
          OMP_CLAUSE_DECL (c) = first;
          OMP_CLAUSE_SIZE (c) = size;
-         if (TREE_CODE (t) == FIELD_DECL)
-           t = finish_non_static_data_member (t, NULL_TREE, NULL_TREE);
          if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_MAP
              || (TREE_CODE (t) == COMPONENT_REF
                  && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE))
@@ -5606,6 +5604,8 @@ handle_omp_array_sections (tree c, enum c_omp_region_type ort)
              }
          tree c2 = build_omp_clause (OMP_CLAUSE_LOCATION (c),
                                      OMP_CLAUSE_MAP);
+         if (TREE_CODE (t) == FIELD_DECL)
+           t = finish_non_static_data_member (t, NULL_TREE, NULL_TREE);
          if ((ort & C_ORT_OMP_DECLARE_SIMD) != C_ORT_OMP && ort != C_ORT_ACC)
            OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_POINTER);
          else if (TREE_CODE (t) == COMPONENT_REF)