optabs.c (expand_binop): For double-word integer multiplies...
authorJeff Law <law@redhat.com>
Wed, 22 May 2002 01:54:40 +0000 (19:54 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 22 May 2002 01:54:40 +0000 (19:54 -0600)
       * optabs.c (expand_binop): For double-word integer multiplies,
        do not compute intermediate results into something that is
        not a register (such as a SUBREG or MEM).

From-SVN: r53718

gcc/ChangeLog
gcc/optabs.c

index dbdb2f4670c6b9464d07523b65f95617eb9e855b..dcb685d466dbb44737dd636a9deef613225ed2e3 100644 (file)
 
 2002-05-21  Jeffrey A Law  <law@redhat.com>
 
+       * optabs.c (expand_binop): For double-word integer multiplies,
+       do not compute intermediate results into something that is
+       not a register (such as a SUBREG or MEM).
+
        * i386.c (ix86_sched_reorder_ppro): Fix typo/thinko.
        (ix86_sched_reorder): Make sure to initialize scheduling
        data even when there's only one insn in the ready queue.
index 46b86c534dad6fd47ecec5fbd95fd77923af66c2..da43dd18417cc98849973c093f9f832c65846d4d 100644 (file)
@@ -1461,6 +1461,9 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
          rtx temp = expand_binop (word_mode, binoptab, op0_low, op1_xhigh,
                                   NULL_RTX, 0, OPTAB_DIRECT);
 
+         if (!REG_P (product_high))
+           product_high = force_reg (word_mode, product_high);
+
          if (temp != 0)
            temp = expand_binop (word_mode, add_optab, temp, product_high,
                                 product_high, 0, next_methods);
@@ -1480,6 +1483,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
          if (temp != 0 && temp != product_high)
            emit_move_insn (product_high, temp);
 
+         emit_move_insn (operand_subword (product, high, 1, mode), product_high);
+
          if (temp != 0)
            {
              if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)