From: Kwok Cheung Yeung Date: Thu, 17 Mar 2022 16:00:52 +0000 (+0000) Subject: Fix ICE when cache-3-1.c testcase is run X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00e6d2d70c212728f9bd3c1517bbef93376eee4a;p=thirdparty%2Fgcc.git 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 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. --- diff --git a/gcc/c/ChangeLog.omp b/gcc/c/ChangeLog.omp index 219087795965..0724d190a61d 100644 --- a/gcc/c/ChangeLog.omp +++ b/gcc/c/ChangeLog.omp @@ -1,3 +1,8 @@ +2022-03-17 Kwok Cheung Yeung + + * c-typeck.cc (handle_omp_array_sections_1): Add check to ensure + that clause is a map. + 2022-05-12 Jakub Jelinek Backport from mainline: diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index bfbaf0feadc2..6c42716f1051 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 &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 01ffe06efcf0..275bed34cf2e 100644 --- a/gcc/cp/ChangeLog.omp +++ b/gcc/cp/ChangeLog.omp @@ -1,3 +1,8 @@ +2022-03-17 Kwok Cheung Yeung + + * semantics.cc (handle_omp_array_sections_1): Add check to ensure + that clause is a map. + 2022-05-12 Jakub Jelinek Backport from mainline: diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index c2f9d3bd4162..8a79def9be7e 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 &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);