This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix PR43964 ARM bootstrap failure
- From: Mikael Pettersson <mikpe at it dot uu dot se>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 May 2010 02:54:02 +0200
- Subject: [PATCH] fix PR43964 ARM bootstrap failure
This fixes PR bootstrap/43964, a 4.6 bootstrap failure on ARM
and a regression from the PR target/42895 fix in r158911.
The problem is that r158911 wrapped a block of code in ira-color.c
with an #ifndef HONOR_REG_ALLOC_ORDER, causing two local variables
to become unused in the HONOR_REG_ALLOC_ORDER case. Stage 2 compiles
with -Wall -Werror by default, causing a compile failure on ira-color.c
in stage 2.
Fixed by moving the declarations of these local variables inside
a similar #ifndef HONOR_REG_ALLOC_ORDER. I considered sinking
the declarations into the block using them instead, but most of
ira-color.c is not written in that style.
Bootstrapped successfully on armv5tel-unknown-linux-gnueabi and
i686-pc-linux-gnu; the first target defines HONOR_REG_ALLOC_ORDER
and the second one does not.
Ok for trunk? (I don't have svn write access.)
gcc/
2010-05-04 Mikael Pettersson <mikpe@it.uu.se>
PR bootstrap/43964
* ira-color.c (assign_hard_reg): Declare rclass and add_cost
only if HONOR_REG_ALLOC_ORDER is not defined.
--- gcc-4.6-20100501/gcc/ira-color.c.~1~ 2010-04-29 23:37:01.000000000 +0200
+++ gcc-4.6-20100501/gcc/ira-color.c 2010-05-03 11:43:18.000000000 +0200
@@ -441,14 +441,18 @@ assign_hard_reg (ira_allocno_t allocno,
{
HARD_REG_SET conflicting_regs;
int i, j, k, hard_regno, best_hard_regno, class_size;
- int cost, mem_cost, min_cost, full_cost, min_full_cost, add_cost;
+ int cost, mem_cost, min_cost, full_cost, min_full_cost;
int *a_costs;
int *conflict_costs;
- enum reg_class cover_class, rclass, conflict_cover_class;
+ enum reg_class cover_class, conflict_cover_class;
enum machine_mode mode;
ira_allocno_t a, conflict_allocno;
ira_allocno_conflict_iterator aci;
static int costs[FIRST_PSEUDO_REGISTER], full_costs[FIRST_PSEUDO_REGISTER];
+#ifndef HONOR_REG_ALLOC_ORDER
+ enum reg_class rclass;
+ int add_cost;
+#endif
#ifdef STACK_REGS
bool no_stack_reg_p;
#endif