public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5517] Introduce REG_SET_EMPTY_P
Date: Thu, 25 Nov 2021 13:24:20 +0000 (GMT)	[thread overview]
Message-ID: <20211125132420.DF3A63858403@sourceware.org> (raw)

https://gcc.gnu.org/g:555b8cc39062d1e02ed9117883229c75e17a8871

commit r12-5517-g555b8cc39062d1e02ed9117883229c75e17a8871
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Nov 24 15:57:03 2021 +0100

    Introduce REG_SET_EMPTY_P
    
    This avoids a -Wunreachable-code diagnostic with EXECUTE_IF_*
    in case the first iteration will exit the loop.  For the case
    in thread_jump using bitmap_empty_p looks preferable so this
    adds REG_SET_EMPTY_P to make that available for register sets.
    
    2021-11-25  Richard Biener  <rguenther@suse.de>
    
            * regset.h (REG_SET_EMPTY_P): New macro.
            * cfgcleanup.c (thread_jump): Use REG_SET_EMPTY_P.

Diff:
---
 gcc/cfgcleanup.c | 3 +--
 gcc/regset.h     | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 82fc505ff50..67ae0597cee 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -256,7 +256,6 @@ thread_jump (edge e, basic_block b)
   unsigned i;
   regset nonequal;
   bool failed = false;
-  reg_set_iterator rsi;
 
   /* Jump threading may cause fixup_partitions to introduce new crossing edges,
      which is not allowed after reload.  */
@@ -379,7 +378,7 @@ thread_jump (edge e, basic_block b)
       goto failed_exit;
     }
 
-  EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, rsi)
+  if (!REG_SET_EMPTY_P (nonequal))
     goto failed_exit;
 
   BITMAP_FREE (nonequal);
diff --git a/gcc/regset.h b/gcc/regset.h
index aee6d6f974f..997b4d2d827 100644
--- a/gcc/regset.h
+++ b/gcc/regset.h
@@ -49,6 +49,9 @@ typedef bitmap regset;
 /* Clear a register set by freeing up the linked list.  */
 #define CLEAR_REG_SET(HEAD) bitmap_clear (HEAD)
 
+/* True if the register set is empty.  */
+#define REG_SET_EMPTY_P(HEAD) bitmap_empty_p (HEAD)
+
 /* Copy a register set to another register set.  */
 #define COPY_REG_SET(TO, FROM) bitmap_copy (TO, FROM)


                 reply	other threads:[~2021-11-25 13:24 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=20211125132420.DF3A63858403@sourceware.org \
    --to=rguenth@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).