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 <vmaka...@redhat.com>
* 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);