From patchwork Wed Mar 30 16:19:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: A small patch to fix an arm bootstrap failure Date: Wed, 30 Mar 2011 06:19:01 -0000 From: Vladimir Makarov X-Patchwork-Id: 88937 Message-Id: <4D9357F5.7080105@redhat.com> To: gcc-patches The following patch is to fix an arm bootstrap failure described in http://gcc.gnu.org/ml/gcc/2011-03/msg00499.html when variable mode is set but not used because it is used when macro HONOR_REG_ALLOC_ORDER is defined. I found that 2 variables mode in different scopes is defined in function assign_hard_reg. Using only one variable will guarantee usage of the variable. The patch has been committed as obvious after successful bootstrap on x86_64. 2011-03-30 Vladimir Makarov * ira-color.c (ira_assign_hard_reg): Use only one variable 'mode'. Index: ira-color.c =================================================================== --- ira-color.c (revision 171713) +++ ira-color.c (working copy) @@ -1622,10 +1622,11 @@ assign_hard_reg (ira_allocno_t a, bool r if (hard_regno >= 0 && ira_class_hard_reg_index[aclass][hard_regno] >= 0) { - enum machine_mode mode = ALLOCNO_MODE (conflict_a); - int conflict_nregs = hard_regno_nregs[hard_regno][mode]; int n_objects = ALLOCNO_NUM_OBJECTS (conflict_a); + int conflict_nregs; + mode = ALLOCNO_MODE (conflict_a); + conflict_nregs = hard_regno_nregs[hard_regno][mode]; if (conflict_nregs == n_objects && conflict_nregs > 1) { int num = OBJECT_SUBWORD (conflict_obj);