From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id 9999C398A840; Tue, 15 Jun 2021 09:32:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9999C398A840 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-11] C/C++: Fix unused set var warning with omp_clause_affinity [PR100913] X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/devel/omp/gcc-11 X-Git-Oldrev: 89f4f339130c39afab7c4a9aad5fec8a48f0c95d X-Git-Newrev: 66cb57df88c42ea007d36663bb0f1c7991653b7c Message-Id: <20210615093225.9999C398A840@sourceware.org> Date: Tue, 15 Jun 2021 09:32:25 +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: Tue, 15 Jun 2021 09:32:25 -0000 https://gcc.gnu.org/g:66cb57df88c42ea007d36663bb0f1c7991653b7c commit 66cb57df88c42ea007d36663bb0f1c7991653b7c Author: Tobias Burnus Date: Tue Jun 15 10:45:52 2021 +0200 C/C++: Fix unused set var warning with omp_clause_affinity [PR100913] PR c/100913 gcc/c/ChangeLog: * c-parser.c (c_parser_omp_clause_affinity): No need to set iterator var in the error case. gcc/cp/ChangeLog: * parser.c (cp_parser_omp_clause_affinity): No need to set iterator var in the error case. (cherry picked from commit 12d13cf50fe68c898ee65d71d1ba9cdb3ea07996) Diff: --- gcc/c/ChangeLog.omp | 9 +++++++++ gcc/c/c-parser.c | 4 +--- gcc/cp/ChangeLog.omp | 9 +++++++++ gcc/cp/parser.c | 4 +--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gcc/c/ChangeLog.omp b/gcc/c/ChangeLog.omp index 2f9d98bca6f..35b6f746ccb 100644 --- a/gcc/c/ChangeLog.omp +++ b/gcc/c/ChangeLog.omp @@ -1,3 +1,12 @@ +2021-06-15 Tobias Burnus + + Backported from master: + 2021-06-14 Tobias Burnus + + PR c/100913 + * c-parser.c (c_parser_omp_clause_affinity): No need to set iterator + var in the error case. + 2021-06-04 Tobias Burnus Backported from master: diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 286d45e4ace..dd2553cd35d 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -15619,9 +15619,7 @@ c_parser_omp_clause_affinity (c_parser *parser, tree list) if (iterators) { tree block = pop_scope (); - if (iterators == error_mark_node) - iterators = NULL_TREE; - else + if (iterators != error_mark_node) { TREE_VEC_ELT (iterators, 5) = block; for (tree c = nl; c != list; c = OMP_CLAUSE_CHAIN (c)) diff --git a/gcc/cp/ChangeLog.omp b/gcc/cp/ChangeLog.omp index 87f22832c30..64a006c01f7 100644 --- a/gcc/cp/ChangeLog.omp +++ b/gcc/cp/ChangeLog.omp @@ -1,3 +1,12 @@ +2021-06-15 Tobias Burnus + + Backported from master: + 2021-06-14 Tobias Burnus + + PR c/100913 + * parser.c (cp_parser_omp_clause_affinity): No need to set iterator + var in the error case. + 2021-06-04 Tobias Burnus Backported from master: diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 89eed507880..a46327843b4 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -37822,9 +37822,7 @@ cp_parser_omp_clause_affinity (cp_parser *parser, tree list) if (iterators) { tree block = poplevel (1, 1, 0); - if (iterators == error_mark_node) - iterators = NULL_TREE; - else + if (iterators != error_mark_node) { TREE_VEC_ELT (iterators, 5) = block; for (c = nlist; c != list; c = OMP_CLAUSE_CHAIN (c))