Commit 89d56d79 by Vladimir Makarov Committed by Vladimir Makarov

re PR target/55433 ([LRA] ICE on excessive reloads)

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.

From-SVN: r195322
parent d76b6ea4
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.
2013-01-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2013-01-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* config/pa/pa.md (atomic_loaddi, atomic_loaddi_1, atomic_storedi, * config/pa/pa.md (atomic_loaddi, atomic_loaddi_1, atomic_storedi,
......
...@@ -2791,7 +2791,7 @@ curr_insn_transform (void) ...@@ -2791,7 +2791,7 @@ curr_insn_transform (void)
if (use_sec_mem_p) 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; enum machine_mode sec_mode, rld_mode;
lra_assert (sec_mem_p); lra_assert (sec_mem_p);
...@@ -2811,17 +2811,28 @@ curr_insn_transform (void) ...@@ -2811,17 +2811,28 @@ curr_insn_transform (void)
NO_REGS, "secondary"); NO_REGS, "secondary");
/* If the mode is changed, it should be wider. */ /* If the mode is changed, it should be wider. */
lra_assert (GET_MODE_SIZE (sec_mode) >= GET_MODE_SIZE (rld_mode)); 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 (sec_mode != rld_mode)
if (dest == rld) {
{ /* If the target says specifically to use another mode for
*curr_id->operand_loc[0] = rld_subst; 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); after = emit_spill_move (false, new_reg, dest);
lra_process_new_insns (curr_insn, NULL_RTX, after, lra_process_new_insns (curr_insn, NULL_RTX, after,
"Inserting the sec. move"); "Inserting the sec. move");
} }
else else
{ {
*curr_id->operand_loc[1] = rld_subst; *curr_id->operand_loc[1] = new_reg;
before = emit_spill_move (true, new_reg, src); before = emit_spill_move (true, new_reg, src);
lra_process_new_insns (curr_insn, before, NULL_RTX, lra_process_new_insns (curr_insn, before, NULL_RTX,
"Inserting the sec. move"); "Inserting the sec. move");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment