From 596d942b73a55b02107de9872d50ac417c1f1326 Mon Sep 17 00:00:00 2001 From: vmakarov Date: Thu, 25 Jun 2015 15:03:33 +0000 Subject: [PATCH] 2015-06-25 Zhouyi Zhou Vladimir Makarov * ira-color.c (assign_hard_reg): Remove unecessary bitmap check. Add assert. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224944 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/ira-color.c | 25 ++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 604b7635b06..157c23e8866 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-06-25 Zhouyi Zhou + Vladimir Makarov + + * ira-color.c (assign_hard_reg): Remove unecessary bitmap check. + Add assert. + 2015-06-25 Richard Biener * fold-const.c (fold_binary_loc): Move simplification of diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 6c535072793..860547c191d 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -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]); -- 2.11.4.GIT