]> gcc.gnu.org Git - gcc.git/commitdiff
Introduce REG_SET_EMPTY_P
authorRichard Biener <rguenther@suse.de>
Wed, 24 Nov 2021 14:57:03 +0000 (15:57 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 25 Nov 2021 13:23:44 +0000 (14:23 +0100)
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.

gcc/cfgcleanup.c
gcc/regset.h

index 82fc505ff502d3eabd2492fa76d59e228a9f80f5..67ae0597cee44cc98fdc33577863e2b7f779f127 100644 (file)
@@ -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);
index aee6d6f974fbfb51f037ac17529fd0bfb80706ba..997b4d2d8275ea94740e750b5499bff787bb16c1 100644 (file)
@@ -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)
 
This page took 0.062286 seconds and 5 git commands to generate.