From c77c97664f9f3739a5d2ec78042aaad769b4bdeb Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 11 Feb 1994 17:39:23 -0500 Subject: (gen_input_reload): If reg-reg add is not valid, try copying reg-reg and adding reg-int. From-SVN: r6530 --- gcc/reload1.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gcc') 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 -- cgit v1.1