From: Richard Kenner Date: Wed, 28 Oct 1992 22:05:59 +0000 (-0500) Subject: (gen_input_reload): In PLUS, if OP0 and OP1 are the same, use X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39b56c2ac762c1f0516315dee6e79cd69527378d;p=gcc.git (gen_input_reload): In PLUS, if OP0 and OP1 are the same, use RELOADREG when generating the addition. From-SVN: r2643 --- diff --git a/gcc/reload1.c b/gcc/reload1.c index 88c5e6dd2e3..f1933d730f2 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5753,6 +5753,14 @@ gen_input_reload (reloadreg, in, before_insn) tem = op0, op0 = op1, op1 = tem; emit_insn_before (gen_move_insn (reloadreg, op0), before_insn); + + /* If OP0 and OP1 are the same, we can use RELOADREG for OP1. + This fixes a problem on the 32K where the stack pointer cannot + be used as an operand of an add insn. */ + + if (rtx_equal_p (op0, op1)) + op1 = reloadreg; + emit_insn_before (gen_add2_insn (reloadreg, op1), before_insn); }