public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] make assign_hard_reg's saved_nregs conditional to unbreak ARM bootstrap (PR50146)
@ 2011-08-22  8:05 Mikael Pettersson
  2011-08-22  9:55 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2011-08-22  8:05 UTC (permalink / raw)
  To: gcc-patches

As described in PR50146, a recent change to ira-color.c caused trunk to
fail to bootstrap on ARM.  The issue is that a new variable saved_nregs
is declared unconditionally but used #ifndef HONOR_REG_ALLOC_ORDER.  Since
the ARM backend defines HONOR_REG_ALLOC_ORDER, an 'unused variable' warning
results, which becomes a hard error in stage 2.

Fixed by moving the declaration to the #ifndef HONOR_REG_ALLOC_ORDER block
of variable declarations.  With this in place bootstrap succeeds on
armv5tel-linux-gnueabi.

Patch was pre-approved by Vladimir Makarov in the PR trail, but I don't
have svn write access so I'll need help to commit it.

/Mikael

gcc/

2011-08-22  Mikael Pettersson  <mikpe@it.uu.se>

	PR bootstrap/50146
	* ira-color.c (assign_hard_reg): Move saved_nregs declaration
	to #ifndef HONOR_REG_ALLOC_ORDER block.

--- gcc-4.7-20110820/gcc/ira-color.c.~1~	2011-08-18 16:56:36.000000000 +0200
+++ gcc-4.7-20110820/gcc/ira-color.c	2011-08-21 19:11:00.000000000 +0200
@@ -1567,13 +1567,14 @@ static bool
 assign_hard_reg (ira_allocno_t a, bool retry_p)
 {
   HARD_REG_SET conflicting_regs[2], profitable_hard_regs[2];
-  int i, j, hard_regno, best_hard_regno, class_size, saved_nregs;
+  int i, j, hard_regno, best_hard_regno, class_size;
   int cost, mem_cost, min_cost, full_cost, min_full_cost, nwords, word;
   int *a_costs;
   enum reg_class aclass;
   enum machine_mode mode;
   static int costs[FIRST_PSEUDO_REGISTER], full_costs[FIRST_PSEUDO_REGISTER];
 #ifndef HONOR_REG_ALLOC_ORDER
+  int saved_nregs;
   enum reg_class rclass;
   int add_cost;
 #endif

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] make assign_hard_reg's saved_nregs conditional to unbreak ARM bootstrap (PR50146)
  2011-08-22  8:05 [PATCH] make assign_hard_reg's saved_nregs conditional to unbreak ARM bootstrap (PR50146) Mikael Pettersson
@ 2011-08-22  9:55 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2011-08-22  9:55 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: gcc-patches

On Mon, Aug 22, 2011 at 09:46:17AM +0200, Mikael Pettersson wrote:
> Patch was pre-approved by Vladimir Makarov in the PR trail, but I don't
> have svn write access so I'll need help to commit it.

Committed, thanks.

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-22  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22  8:05 [PATCH] make assign_hard_reg's saved_nregs conditional to unbreak ARM bootstrap (PR50146) Mikael Pettersson
2011-08-22  9:55 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).