aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKwok Cheung Yeung <kcy@codesourcery.com>2022-03-17 16:00:52 +0000
committerKwok Cheung Yeung <kcy@codesourcery.com>2022-06-28 13:55:30 -0700
commit00e6d2d70c212728f9bd3c1517bbef93376eee4a (patch)
tree9d613c94c62189557cd96512e8daed0153675719 /gcc
parente99ae0c02546e395f7dff7cdeb97cebea8296a0c (diff)
downloadgcc-00e6d2d70c212728f9bd3c1517bbef93376eee4a.zip
gcc-00e6d2d70c212728f9bd3c1517bbef93376eee4a.tar.gz
gcc-00e6d2d70c212728f9bd3c1517bbef93376eee4a.tar.bz2
Fix ICE when cache-3-1.c testcase is run
A change that was present in the OG11 version of 'openmp: in_reduction clause support on target construct' but not in the mainline version resulted in non-contiguous arrays being accepted in cache clauses, only to ICE later. 2022-03-17 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/c/ * c-typeck.cc (handle_omp_array_sections_1): Add check to ensure that clause is a map. gcc/cp/ * semantics.cc (handle_omp_array_sections_1): Add check to ensure that clause is a map.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c/ChangeLog.omp5
-rw-r--r--gcc/c/c-typeck.cc3
-rw-r--r--gcc/cp/ChangeLog.omp5
-rw-r--r--gcc/cp/semantics.cc3
4 files changed, 14 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog.omp b/gcc/c/ChangeLog.omp
index 2190877..0724d19 100644
--- a/gcc/c/ChangeLog.omp
+++ b/gcc/c/ChangeLog.omp
@@ -1,3 +1,8 @@
+2022-03-17 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * c-typeck.cc (handle_omp_array_sections_1): Add check to ensure
+ that clause is a map.
+
2022-05-12 Jakub Jelinek <jakub@redhat.com>
Backport from mainline:
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index bfbaf0f..6c42716 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -13575,7 +13575,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
tree d_length = TREE_VALUE (d);
if (d_length == NULL_TREE || !integer_onep (d_length))
{
- if (ort == C_ORT_ACC)
+ if (ort == C_ORT_ACC
+ && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP)
{
while (TREE_CODE (d) == TREE_LIST)
d = TREE_CHAIN (d);
diff --git a/gcc/cp/ChangeLog.omp b/gcc/cp/ChangeLog.omp
index 01ffe06..275bed3 100644
--- a/gcc/cp/ChangeLog.omp
+++ b/gcc/cp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2022-03-17 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * semantics.cc (handle_omp_array_sections_1): Add check to ensure
+ that clause is a map.
+
2022-05-12 Jakub Jelinek <jakub@redhat.com>
Backport from mainline:
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index c2f9d3b..8a79def 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -5409,7 +5409,8 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
tree d_length = TREE_VALUE (d);
if (d_length == NULL_TREE || !integer_onep (d_length))
{
- if (ort == C_ORT_ACC)
+ if (ort == C_ORT_ACC
+ && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP)
{
while (TREE_CODE (d) == TREE_LIST)
d = TREE_CHAIN (d);