(expand_binop): When trying to expand a multiple word add into multiple single word...
authorRichard Stallman <rms@gnu.org>
Fri, 6 Nov 1992 00:05:51 +0000 (00:05 +0000)
committerRichard Stallman <rms@gnu.org>
Fri, 6 Nov 1992 00:05:51 +0000 (00:05 +0000)
(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

gcc/optabs.c

index f054d5254763d21ffdf25dd0cd0cec0d6cf081ac..57da821a0eefda99bd8da7e50d98a9e63434650a 100644 (file)
@@ -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;
        }