expmed.c (expand_mult_const): Expand shift into temporary.
authorUros Bizjak <ubizjak@gmail.com>
Thu, 5 Aug 2010 12:03:36 +0000 (14:03 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 5 Aug 2010 12:03:36 +0000 (14:03 +0200)
* expmed.c (expand_mult_const) <case alg_shift>: Expand shift into
temporary. Emit move from temporary to accum, so REG_EQUAL note will
be attached to this insn in correct mode.

From-SVN: r162910

gcc/ChangeLog
gcc/expmed.c

index 3456501c8f91450dab745e1ee3a32956554eaceb..0b0d41810576d70b2c5bf8d7e40fca55ddccdd4b 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-05  Uros Bizjak  <ubizjak@gmail.com>
+
+       * expmed.c (expand_mult_const) <case alg_shift>: Expand shift into
+       temporary. Emit move from temporary to accum, so REG_EQUAL note will
+       be attached to this insn in correct mode.
+
 2010-08-05  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.c (ix86_decompose_address): Check for SI_REG
index ddace9f2e3929c2ae392dc35e5c2932397408176..9aa5ff617c570eb6b56a4dc93a0c65b3839f1ebe 100644 (file)
@@ -2904,9 +2904,11 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val,
       switch (alg->op[opno])
        {
        case alg_shift:
-         accum = expand_shift (LSHIFT_EXPR, mode, accum,
-                               build_int_cst (NULL_TREE, log),
-                               NULL_RTX, 0);
+         tem = expand_shift (LSHIFT_EXPR, mode, accum,
+                             build_int_cst (NULL_TREE, log),
+                             NULL_RTX, 0);
+         /* REG_EQUAL note will be attached to the following insn.  */
+         emit_move_insn (accum, tem);
          val_so_far <<= log;
          break;