summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-20 19:09:58 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-20 19:09:58 +0000
commite0420317dc2c7e6d8f4e4aa28e4b37d3e2067c3d (patch)
tree24f3380d074ddd93ec8a83d05a5e346e89be540d /gcc/lra-constraints.c
parentc7b2ff9a291bfe558fd7e4907b0482dde2dc1a97 (diff)
downloadgcc-e0420317dc2c7e6d8f4e4aa28e4b37d3e2067c3d.tar.gz
2013-01-20 Vladimir Makarov <vmakarov@redhat.com>
PR target/55433 * lra-constraints.c (curr_insn_transform): Don't reuse original insn for secondary memory move when memory mode should be different. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index f13f37233b4..01c8cf143cf 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -2791,7 +2791,7 @@ curr_insn_transform (void)
if (use_sec_mem_p)
{
- rtx new_reg, src, dest, rld, rld_subst;
+ rtx new_reg, src, dest, rld;
enum machine_mode sec_mode, rld_mode;
lra_assert (sec_mem_p);
@@ -2811,17 +2811,28 @@ curr_insn_transform (void)
NO_REGS, "secondary");
/* If the mode is changed, it should be wider. */
lra_assert (GET_MODE_SIZE (sec_mode) >= GET_MODE_SIZE (rld_mode));
- rld_subst = (sec_mode == rld_mode ? new_reg : gen_lowpart_SUBREG (rld_mode, new_reg));
- if (dest == rld)
- {
- *curr_id->operand_loc[0] = rld_subst;
+ if (sec_mode != rld_mode)
+ {
+ /* If the target says specifically to use another mode for
+ secondary memory moves we can not reuse the original
+ insn. */
+ after = emit_spill_move (false, new_reg, dest);
+ lra_process_new_insns (curr_insn, NULL_RTX, after,
+ "Inserting the sec. move");
+ before = emit_spill_move (true, new_reg, src);
+ lra_process_new_insns (curr_insn, before, NULL_RTX, "Changing on");
+ lra_set_insn_deleted (curr_insn);
+ }
+ else if (dest == rld)
+ {
+ *curr_id->operand_loc[0] = new_reg;
after = emit_spill_move (false, new_reg, dest);
lra_process_new_insns (curr_insn, NULL_RTX, after,
"Inserting the sec. move");
}
else
{
- *curr_id->operand_loc[1] = rld_subst;
+ *curr_id->operand_loc[1] = new_reg;
before = emit_spill_move (true, new_reg, src);
lra_process_new_insns (curr_insn, before, NULL_RTX,
"Inserting the sec. move");