diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-11 17:39:23 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-11 17:39:23 -0500 |
commit | c77c97664f9f3739a5d2ec78042aaad769b4bdeb (patch) | |
tree | f4a7b157bb52e1279ecaf1221c8c39ecda54da59 | |
parent | 98aad286690ddafff79198df072b22cc1f75782f (diff) | |
download | gcc-c77c97664f9f3739a5d2ec78042aaad769b4bdeb.zip gcc-c77c97664f9f3739a5d2ec78042aaad769b4bdeb.tar.gz gcc-c77c97664f9f3739a5d2ec78042aaad769b4bdeb.tar.bz2 |
(gen_input_reload): If reg-reg add is not valid, try copying reg-reg
and adding reg-int.
From-SVN: r6530
-rw-r--r-- | gcc/reload1.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index 3c15a7f..503ebe3 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -6544,7 +6544,27 @@ gen_input_reload (reloadreg, in, opnum, type) if (rtx_equal_p (op0, op1)) op1 = reloadreg; - emit_insn (gen_add2_insn (reloadreg, op1)); + insn = emit_insn (gen_add2_insn (reloadreg, op1)); + + /* If that failed, copy the address register to the reload register. + Then add the constant to the reload register. */ + + code = recog_memoized (insn); + + if (code >= 0) + { + insn_extract (insn); + /* We want constrain operands to treat this insn strictly in + its validity determination, i.e., the way it would after reload + has completed. */ + if (constrain_operands (code, 1)) + return insn; + } + + delete_insns_since (last); + + emit_insn (gen_move_insn (reloadreg, op1)); + emit_insn (gen_add2_insn (reloadreg, op0)); } #ifdef SECONDARY_MEMORY_NEEDED |