ira-color.c (assign_hard_reg): Remove unecessary bitmap check.
authorZhouyi Zhou <yizhouzhou@ict.ac.cn>
Thu, 25 Jun 2015 15:03:33 +0000 (15:03 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Thu, 25 Jun 2015 15:03:33 +0000 (15:03 +0000)
2015-06-25  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
    Vladimir Makarov  <vmakarov@redhat.com>

* ira-color.c (assign_hard_reg): Remove unecessary bitmap check.
Add assert.

Co-Authored-By: Vladimir Makarov <vmakarov@redhat.com>
From-SVN: r224944

gcc/ChangeLog
gcc/ira-color.c

index 604b7635b061be7fa88e7c188a719794199ee95b..157c23e88661d700cb8b35d27b06abe4f1c90894 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-25  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
+           Vladimir Makarov  <vmakarov@redhat.com>
+
+       * ira-color.c (assign_hard_reg): Remove unecessary bitmap check.
+       Add assert.
+
 2015-06-25  Richard Biener  <rguenther@suse.de>
 
        * fold-const.c (fold_binary_loc): Move simplification of
index 6c535072793bb8c321390e0713c1704af9d5a91a..860547c191d3a91a12837ee7f4fc8bddf03dc6ed 100644 (file)
@@ -1733,15 +1733,22 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
          /* Reload can give another class so we need to check all
             allocnos.  */
          if (!retry_p
-             && (!bitmap_bit_p (consideration_allocno_bitmap,
-                                ALLOCNO_NUM (conflict_a))
-                 || ((!ALLOCNO_ASSIGNED_P (conflict_a)
-                      || ALLOCNO_HARD_REGNO (conflict_a) < 0)
-                     && !(hard_reg_set_intersect_p
-                          (profitable_hard_regs,
-                           ALLOCNO_COLOR_DATA
-                           (conflict_a)->profitable_hard_regs)))))
-           continue;
+             && ((!ALLOCNO_ASSIGNED_P (conflict_a)
+                  || ALLOCNO_HARD_REGNO (conflict_a) < 0)
+                 && !(hard_reg_set_intersect_p
+                      (profitable_hard_regs,
+                       ALLOCNO_COLOR_DATA
+                       (conflict_a)->profitable_hard_regs))))
+           {
+             /* All conflict allocnos are in consideration bitmap
+                when retry_p is false.  It might change in future and
+                if it happens the assert will be broken.  It means
+                the code should be modified for the new
+                assumptions.  */
+             ira_assert (bitmap_bit_p (consideration_allocno_bitmap,
+                                       ALLOCNO_NUM (conflict_a)));
+             continue;
+           }
          conflict_aclass = ALLOCNO_CLASS (conflict_a);
          ira_assert (ira_reg_classes_intersect_p
                      [aclass][conflict_aclass]);