[mid-end] [obvious] Cast to avoid -Wsign-compare warning from r279124
authorMatthew Malcomson <matthew.malcomson@arm.com>
Mon, 9 Dec 2019 13:16:07 +0000 (13:16 +0000)
committerMatthew Malcomson <matmal01@gcc.gnu.org>
Mon, 9 Dec 2019 13:16:07 +0000 (13:16 +0000)
The previous revision adds a comparison that triggers a warning.
Here we simply cast the unsigned integer to a signed one before the
comparison.

gcc/ChangeLog:

2019-12-09  Matthew Malcomson  <matthew.malcomson@arm.com>

* regstat.c (regstat_bb_compute_calls_crossed): Add a cast to
avoid a warning.

From-SVN: r279126

gcc/ChangeLog
gcc/regstat.c

index 43e838cd9bb3515a8204da7bc4afd71d66a78a40..b499992dad7efb23f09a205a90dc05a7bb70754b 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-09  Matthew Malcomson  <matthew.malcomson@arm.com>
+
+       * regstat.c (regstat_bb_compute_calls_crossed): Add a cast to
+       avoid a warning.
+
 2019-12-09  Matthew Malcomson  <matthew.malcomson@arm.com>
 
        PR middle-end/92410
index c6cefb117d7330cc1b9787c37083e05e2acda2d2..bf95ecc1273062eb8b6e575a1810cd99f33d9c75 100644 (file)
@@ -324,7 +324,7 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live)
 
   FOR_BB_INSNS_REVERSE (bb, insn)
     {
-      gcc_assert (INSN_UID (insn) < DF_INSN_SIZE ());
+      gcc_assert (INSN_UID (insn) < (int) DF_INSN_SIZE ());
       struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
       unsigned int regno;