This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix nit on ira_reuse_stack_slot


Hi,

ira_reuse_stack_slot prints the wrong slot number in the dump when it needs to 
search for a reusable stack slot because it doesn't reset slot_num.

Bootstrapped/regtested on x86_64-suse-linux, OK for mainline?


2008-09-07  Eric Botcazou  <ebotcazou@adacore.com>

	* ira-color.c (ira_reuse_stack_slot): Set slot_num on success at the
	end of the search.


-- 
Eric Botcazou
Index: ira-color.c
===================================================================
--- ira-color.c	(revision 140088)
+++ ira-color.c	(working copy)
@@ -2728,10 +2728,11 @@ ira_reuse_stack_slot (int regno, unsigne
 	}
       if (best_cost >= 0)
 	{
-	  slot = &ira_spilled_reg_stack_slots[best_slot_num];
+	  slot_num = best_slot_num;
+	  slot = &ira_spilled_reg_stack_slots[slot_num];
 	  SET_REGNO_REG_SET (&slot->spilled_regs, regno);
 	  x = slot->mem;
-	  ALLOCNO_HARD_REGNO (allocno) = -best_slot_num - 2;
+	  ALLOCNO_HARD_REGNO (allocno) = -slot_num - 2;
 	}
     }
   if (x != NULL_RTX)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]