summaryrefslogtreecommitdiff
path: root/gcc/lra-spills.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-04 17:57:29 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-04 17:57:29 +0000
commit48ff1d417d4c49525c09b013395e38dda8bd50fe (patch)
treeffb4ea05f14bc936b5dd3681e19b2aa3cee8c3bf /gcc/lra-spills.c
parent144409bbbdb293946cea105115e0e329f633d333 (diff)
downloadgcc-48ff1d417d4c49525c09b013395e38dda8bd50fe.tar.gz
2014-01-04 Basile Starynkevitch <basile@starynkevitch.net>
{{merge using svnmerge.py with trunk GCC 4.9 svn rev206333 now in stage 3; very unstable, xtramelt-ana-base don't compile anymore...}} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@206336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-spills.c')
-rw-r--r--gcc/lra-spills.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c
index 4ab10c25b98..50f63fc3a1b 100644
--- a/gcc/lra-spills.c
+++ b/gcc/lra-spills.c
@@ -1,5 +1,5 @@
/* Change pseudos by memory.
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
Contributed by Vladimir Makarov <vmakarov@redhat.com>.
This file is part of GCC.
@@ -163,7 +163,6 @@ assign_mem_slot (int i)
x = assign_stack_local (mode, total_size,
min_align > inherent_align
|| total_size > inherent_size ? -1 : 0);
- x = lra_eliminate_regs_1 (x, GET_MODE (x), false, false, true);
stack_slot = x;
/* Cancel the big-endian correction done in assign_stack_local.
Get the address of the beginning of the slot. This is so we
@@ -281,7 +280,7 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
add_to_hard_reg_set (&reserved_hard_regs[p],
lra_reg_info[i].biggest_mode, hard_regno);
bitmap_initialize (&ok_insn_bitmap, &reg_obstack);
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
FOR_BB_INSNS (bb, insn)
if (DEBUG_INSN_P (insn)
|| ((set = single_set (insn)) != NULL_RTX
@@ -430,8 +429,15 @@ remove_pseudos (rtx *loc, rtx insn)
into scratches back. */
&& ! lra_former_scratch_p (i))
{
- hard_reg = spill_hard_reg[i];
- *loc = copy_rtx (hard_reg != NULL_RTX ? hard_reg : pseudo_slots[i].mem);
+ if ((hard_reg = spill_hard_reg[i]) != NULL_RTX)
+ *loc = copy_rtx (hard_reg);
+ else
+ {
+ rtx x = lra_eliminate_regs_1 (insn, pseudo_slots[i].mem,
+ GET_MODE (pseudo_slots[i].mem),
+ false, false, true);
+ *loc = x != pseudo_slots[i].mem ? x : copy_rtx (x);
+ }
return;
}
@@ -472,14 +478,35 @@ spill_pseudos (void)
bitmap_ior_into (&changed_insns, &lra_reg_info[i].insn_bitmap);
}
}
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
{
FOR_BB_INSNS (bb, insn)
if (bitmap_bit_p (&changed_insns, INSN_UID (insn)))
{
+ rtx *link_loc, link;
remove_pseudos (&PATTERN (insn), insn);
if (CALL_P (insn))
remove_pseudos (&CALL_INSN_FUNCTION_USAGE (insn), insn);
+ for (link_loc = &REG_NOTES (insn);
+ (link = *link_loc) != NULL_RTX;
+ link_loc = &XEXP (link, 1))
+ {
+ switch (REG_NOTE_KIND (link))
+ {
+ case REG_FRAME_RELATED_EXPR:
+ case REG_CFA_DEF_CFA:
+ case REG_CFA_ADJUST_CFA:
+ case REG_CFA_OFFSET:
+ case REG_CFA_REGISTER:
+ case REG_CFA_EXPRESSION:
+ case REG_CFA_RESTORE:
+ case REG_CFA_SET_VDRAP:
+ remove_pseudos (&XEXP (link, 0), insn);
+ break;
+ default:
+ break;
+ }
+ }
if (lra_dump_file != NULL)
fprintf (lra_dump_file,
"Changing spilled pseudos to memory in insn #%u\n",
@@ -659,7 +686,7 @@ lra_final_code_change (void)
if (lra_reg_info[i].nrefs != 0
&& (hard_regno = lra_get_regno_hard_regno (i)) >= 0)
SET_REGNO (regno_reg_rtx[i], hard_regno);
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
FOR_BB_INSNS_SAFE (bb, insn, curr)
if (INSN_P (insn))
{