aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-11-06 00:05:51 +0000
committerRichard Stallman <rms@gnu.org>1992-11-06 00:05:51 +0000
commitcee850230f38b79a66b416b3f530a6524638e9ac (patch)
treec83ad80b2559ce551fb3cf7f3746a7a6eecc2967
parent432a2edec07bfa2311541b194071b32d4b9890ec (diff)
downloadgcc-cee850230f38b79a66b416b3f530a6524638e9ac.zip
gcc-cee850230f38b79a66b416b3f530a6524638e9ac.tar.gz
gcc-cee850230f38b79a66b416b3f530a6524638e9ac.tar.bz2
(expand_binop): When trying to expand a multiple word add into multiple single word adds...
(expand_binop): When trying to expand a multiple word add into multiple single word adds, don't overwrite OP0 and OP1 in case we must backtrack. We use instead new variables XOP0 and XOP1. From-SVN: r2696
-rw-r--r--gcc/optabs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index f054d52..57da821 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -558,6 +558,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
optab otheroptab = binoptab == add_optab ? sub_optab : add_optab;
int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
rtx carry_in, carry_out;
+ rtx xop0, xop1;
/* We can handle either a 1 or -1 value for the carry. If STORE_FLAG
value is one of those, use it. Otherwise, use 1 since it is the
@@ -569,11 +570,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
#endif
/* Prepare the operands. */
- op0 = force_reg (mode, op0);
- op1 = force_reg (mode, op1);
+ xop0 = force_reg (mode, op0);
+ xop1 = force_reg (mode, op1);
if (target == 0 || GET_CODE (target) != REG
- || target == op0 || target == op1)
+ || target == xop0 || target == xop1)
target = gen_reg_rtx (mode);
/* Do the actual arithmetic. */
@@ -581,8 +582,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{
int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i);
rtx target_piece = operand_subword (target, index, 1, mode);
- rtx op0_piece = operand_subword_force (op0, index, mode);
- rtx op1_piece = operand_subword_force (op1, index, mode);
+ rtx op0_piece = operand_subword_force (xop0, index, mode);
+ rtx op1_piece = operand_subword_force (xop1, index, mode);
rtx x;
/* Main add/subtract of the input operands. */
@@ -641,7 +642,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
temp = emit_move_insn (target, target);
REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (binoptab->code, mode, op0, op1),
+ gen_rtx (binoptab->code, mode, xop0, xop1),
REG_NOTES (temp));
return target;
}