aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1994-08-13 11:51:15 -0600
committerJeff Law <law@gcc.gnu.org>1994-08-13 11:51:15 -0600
commitcf19d2a9d80c2e2b71f23b962dd4b871667c39df (patch)
treed97a853cd9a5947e97b482afb727aa161d269598
parent336d6f0a7e2a25d3a50b7afe1d43b3a40e89e22e (diff)
downloadgcc-cf19d2a9d80c2e2b71f23b962dd4b871667c39df.zip
gcc-cf19d2a9d80c2e2b71f23b962dd4b871667c39df.tar.gz
gcc-cf19d2a9d80c2e2b71f23b962dd4b871667c39df.tar.bz2
reload1.c (emit_reload_insns): Handle a secondary input reload which needs to use secondary memory too.
* reload1.c (emit_reload_insns): Handle a secondary input reload which needs to use secondary memory too. From-SVN: r7912
-rw-r--r--gcc/reload1.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 1ae4116..2891bd3 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -6001,8 +6001,50 @@ emit_reload_insns (insn)
{
if (icode != CODE_FOR_nothing)
{
- emit_insn (GEN_FCN (icode) (reloadreg, real_oldequiv,
- second_reload_reg));
+ rtx pat;
+#ifdef SECONDARY_MEMORY_NEEDED
+ /* If we need a memory location to do the move, do
+ it that way. */
+ if (GET_CODE (real_oldequiv) == REG
+ && REGNO (real_oldequiv) < FIRST_PSEUDO_REGISTER
+ && SECONDARY_MEMORY_NEEDED
+ (REGNO_REG_CLASS (REGNO (real_oldequiv)),
+ REGNO_REG_CLASS (REGNO (second_reload_reg)),
+ GET_MODE (second_reload_reg)))
+ {
+ /* Get the memory to use and rewrite both
+ registers to its mode. */
+ rtx loc
+ = get_secondary_mem (real_oldequiv,
+ GET_MODE (second_reload_reg),
+ reload_opnum[j],
+ reload_when_needed[j]);
+ rtx tmp_reloadreg;
+
+ if (GET_MODE (loc)
+ != GET_MODE (second_reload_reg))
+ second_reload_reg
+ = gen_rtx (REG,
+ GET_MODE (loc),
+ REGNO (second_reload_reg));
+
+ if (GET_MODE (loc) != GET_MODE (real_oldequiv))
+ tmp_reloadreg = gen_rtx (REG, GET_MODE (loc),
+ REGNO (real_oldequiv));
+ else
+ tmp_reloadreg = real_oldequiv;
+
+ emit_move_insn (loc, tmp_reloadreg);
+ emit_move_insn (second_reload_reg, loc);
+ pat = gen_move_insn (reloadreg, second_reload_reg);
+
+ }
+ else
+#endif
+ pat = GEN_FCN (icode) (reloadreg,
+ real_oldequiv,
+ second_reload_reg);
+ emit_insn (pat);
special = 1;
}
else