* ira-color.c (ira_reuse_stack_slot): Set slot_num on success at the
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Sep 2008 21:21:10 +0000 (21:21 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Sep 2008 21:21:10 +0000 (21:21 +0000)
end of the search.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140121 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ira-color.c

index abf03fd..2242afc 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-08  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * ira-color.c (ira_reuse_stack_slot): Set slot_num on success at the
+       end of the search.
+
 2008-09-08  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
 
        * crx/crx.h (IRA_COVER_CLASSES): Define.
index 833048e..a161c08 100644 (file)
@@ -2728,10 +2728,11 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size,
        }
       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)