aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2021-02-26 20:13:29 +0800
committerChung-Lin Tang <cltang@codesourcery.com>2021-02-26 20:13:29 +0800
commitda047f63c601118ad875d13929453094acc6c6c9 (patch)
tree00ab33e7aeae6f7560e3fddf3040587bd25227f8
parent66f919a0c3b7103df91ce58dbea1c916426c2e73 (diff)
downloadgcc-da047f63c601118ad875d13929453094acc6c6c9.zip
gcc-da047f63c601118ad875d13929453094acc6c6c9.tar.gz
gcc-da047f63c601118ad875d13929453094acc6c6c9.tar.bz2
Fix regression of array members in OpenMP map clauses.
Fixed a regression of array members not working in OpenMP map clauses after commit bf8605f14ec33ea31233a3567f3184fee667b695. This patch itself probably should be considered a fix for commit aadfc9843. 2021-02-26 Chung-Lin Tang <cltang@codesourcery.com> gcc/cp/ChangeLog: * semantics.c (handle_omp_array_sections): Adjust position of making COMPONENT_REF from FIELD_DECL to earlier position.
-rw-r--r--gcc/cp/semantics.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 370d583..55a5983 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5386,6 +5386,8 @@ 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))
@@ -5414,8 +5416,6 @@ 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)