summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-12-04 13:22:31 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-12-04 13:22:31 +0000
commit7b48bf2011b4020c4a5a2d5d4149b03983f72cc2 (patch)
treeb07a064ee6bddbe6ddf73a98a9c131b5ab6a0f5f /gcc/lra-constraints.c
parent8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1 (diff)
downloadgcc-tarball-7b48bf2011b4020c4a5a2d5d4149b03983f72cc2.tar.gz
gcc-5.3.0gcc-5.3.0
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 4f2480e57e..c79a51565e 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1340,7 +1340,7 @@ process_addr_reg (rtx *loc, bool check_only_p, rtx_insn **before, rtx_insn **aft
if (after != NULL)
{
start_sequence ();
- lra_emit_move (reg, new_reg);
+ lra_emit_move (before_p ? copy_rtx (reg) : reg, new_reg);
emit_insn (*after);
*after = get_insns ();
end_sequence ();
@@ -3738,7 +3738,8 @@ curr_insn_transform (bool check_only_p)
assigment pass and the scratch pseudo will be
spilled. Spilled scratch pseudos are transformed
back to scratches at the LRA end. */
- && lra_former_scratch_operand_p (curr_insn, i))
+ && lra_former_scratch_operand_p (curr_insn, i)
+ && lra_former_scratch_p (REGNO (op)))
{
int regno = REGNO (op);
lra_change_class (regno, NO_REGS, " Change to", true);
@@ -3747,6 +3748,8 @@ curr_insn_transform (bool check_only_p)
spilled pseudo as there is only one such insn, the
current one. */
reg_renumber[regno] = -1;
+ lra_assert (bitmap_single_bit_set_p
+ (&lra_reg_info[REGNO (op)].insn_bitmap));
}
/* We can do an optional reload. If the pseudo got a hard
reg, we might improve the code through inheritance. If
@@ -4729,7 +4732,7 @@ inherit_reload_reg (bool def_p, int original_regno,
}
return false;
}
- lra_substitute_pseudo_within_insn (insn, original_regno, new_reg);
+ lra_substitute_pseudo_within_insn (insn, original_regno, new_reg, false);
lra_update_insn_regno_info (insn);
if (! def_p)
/* We now have a new usage insn for original regno. */
@@ -4761,7 +4764,7 @@ inherit_reload_reg (bool def_p, int original_regno,
lra_assert (DEBUG_INSN_P (usage_insn));
next_usage_insns = XEXP (next_usage_insns, 1);
}
- lra_substitute_pseudo (&usage_insn, original_regno, new_reg);
+ lra_substitute_pseudo (&usage_insn, original_regno, new_reg, false);
lra_update_insn_regno_info (as_a <rtx_insn *> (usage_insn));
if (lra_dump_file != NULL)
{
@@ -5023,7 +5026,7 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
usage_insn = XEXP (next_usage_insns, 0);
lra_assert (DEBUG_INSN_P (usage_insn));
next_usage_insns = XEXP (next_usage_insns, 1);
- lra_substitute_pseudo (&usage_insn, original_regno, new_reg);
+ lra_substitute_pseudo (&usage_insn, original_regno, new_reg, false);
lra_update_insn_regno_info (as_a <rtx_insn *> (usage_insn));
if (lra_dump_file != NULL)
{
@@ -5955,8 +5958,9 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
{
if (change_p && bitmap_bit_p (remove_pseudos, regno))
{
- lra_substitute_pseudo_within_insn (
- curr_insn, regno, regno_reg_rtx[restore_regno]);
+ lra_substitute_pseudo_within_insn
+ (curr_insn, regno, regno_reg_rtx[restore_regno],
+ false);
restored_regs_p = true;
}
else
@@ -6079,9 +6083,9 @@ undo_optional_reloads (void)
we remove the inheritance pseudo and the optional
reload. */
}
- lra_substitute_pseudo_within_insn (
- insn, regno,
- regno_reg_rtx[lra_reg_info[regno].restore_regno]);
+ lra_substitute_pseudo_within_insn
+ (insn, regno, regno_reg_rtx[lra_reg_info[regno].restore_regno],
+ false);
lra_update_insn_regno_info (insn);
if (lra_dump_file != NULL)
{