public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tobias Burnus <burnus@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-11] C/C++: Fix unused set var warning with omp_clause_affinity [PR100913]
Date: Tue, 15 Jun 2021 09:32:25 +0000 (GMT)	[thread overview]
Message-ID: <20210615093225.9999C398A840@sourceware.org> (raw)

https://gcc.gnu.org/g:66cb57df88c42ea007d36663bb0f1c7991653b7c

commit 66cb57df88c42ea007d36663bb0f1c7991653b7c
Author: Tobias Burnus <tobias@codesourcery.com>
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  <tobias@codesourcery.com>
+
+	Backported from master:
+	2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
+
+	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  <tobias@codesourcery.com>
 
 	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  <tobias@codesourcery.com>
+
+	Backported from master:
+	2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
+
+	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  <tobias@codesourcery.com>
 
 	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))


                 reply	other threads:[~2021-06-15  9:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615093225.9999C398A840@sourceware.org \
    --to=burnus@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).