From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1729) id 1414C3850841; Wed, 29 Jun 2022 14:48:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1414C3850841 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Kwok Yeung To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-12] Fix ICE when cache-3-1.c testcase is run X-Act-Checkin: gcc X-Git-Author: Kwok Cheung Yeung X-Git-Refname: refs/heads/devel/omp/gcc-12 X-Git-Oldrev: e99ae0c02546e395f7dff7cdeb97cebea8296a0c X-Git-Newrev: 00e6d2d70c212728f9bd3c1517bbef93376eee4a Message-Id: <20220629144828.1414C3850841@sourceware.org> Date: Wed, 29 Jun 2022 14:48:28 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 14:48:28 -0000 https://gcc.gnu.org/g:00e6d2d70c212728f9bd3c1517bbef93376eee4a commit 00e6d2d70c212728f9bd3c1517bbef93376eee4a Author: Kwok Cheung Yeung Date: Thu Mar 17 16:00:52 2022 +0000 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: --- gcc/c/ChangeLog.omp | 5 +++++ gcc/c/c-typeck.cc | 3 ++- gcc/cp/ChangeLog.omp | 5 +++++ gcc/cp/semantics.cc | 3 ++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/c/ChangeLog.omp b/gcc/c/ChangeLog.omp index 21908779596..0724d190a61 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 bfbaf0feadc..6c42716f105 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 01ffe06efcf..275bed34cf2 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 c2f9d3bd416..8a79def9be7 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);