aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2022-01-14 21:58:34 +0800
committerChung-Lin Tang <cltang@codesourcery.com>2022-01-14 21:58:34 +0800
commitcd7484d05cd4b7a9d741fe8bf6c4525406ed7620 (patch)
tree8d96741268638619e714f5d62017838f0a77fc9d /gcc/c
parent5d7de2bf3b7c5ed1c929098243832b59648bcc67 (diff)
downloadgcc-cd7484d05cd4b7a9d741fe8bf6c4525406ed7620.zip
gcc-cd7484d05cd4b7a9d741fe8bf6c4525406ed7620.tar.gz
gcc-cd7484d05cd4b7a9d741fe8bf6c4525406ed7620.tar.bz2
openmp: Fix ICE in [PR103705]
Fix ICE for cases like: #pragma omp target update from(s[0].a[0:1]) where multiple ARRAY_REF nodes exist and require more than one peeling during [c_]finish_omp_clauses. PR c++/103705 gcc/c/ChangeLog: * c-typeck.c (c_finish_omp_clauses): Also continue peeling off of outer node for ARRAY_REFs. gcc/cp/ChangeLog: * semantics.c (finish_omp_clauses): Also continue peeling off of outer node for ARRAY_REFs. gcc/testsuite/ChangeLog: * c-c++-common/gomp/pr103705.c: New test.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-typeck.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 8b492cf..ac6618e 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -14929,7 +14929,8 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
t = TREE_OPERAND (t, 0);
}
}
- while (TREE_CODE (t) == COMPONENT_REF);
+ while (TREE_CODE (t) == COMPONENT_REF
+ || TREE_CODE (t) == ARRAY_REF);
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
&& OMP_CLAUSE_MAP_IMPLICIT (c)