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 r12-1433] C/C++: Fix unused set var warning with omp_clause_affinity [PR100913]
Date: Mon, 14 Jun 2021 14:50:02 +0000 (GMT)	[thread overview]
Message-ID: <20210614145002.989BF393C033@sourceware.org> (raw)

https://gcc.gnu.org/g:12d13cf50fe68c898ee65d71d1ba9cdb3ea07996

commit r12-1433-g12d13cf50fe68c898ee65d71d1ba9cdb3ea07996
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Jun 14 16:49:24 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.

Diff:
---
 gcc/c/c-parser.c | 4 +---
 gcc/cp/parser.c  | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index add33532a60..b90710cba2f 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -15596,9 +15596,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/parser.c b/gcc/cp/parser.c
index b5af3877e48..d57ddc4560d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -37928,9 +37928,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-14 14:50 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=20210614145002.989BF393C033@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).