[combine] Only restrict pure simplification in mult-extend subst case, allow other...
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Nov 2015 13:07:29 +0000 (13:07 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Nov 2015 13:07:29 +0000 (13:07 +0000)
* combine.c (subst): Do not return clobber of zero in widening mult
case.  Just return x unchanged if it is a no-op substitution.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230946 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c

index 55c8820..5ca6cc7 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-26  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * combine.c (subst): Do not return clobber of zero in widening mult
+       case.  Just return x unchanged if it is a no-op substitution.
+
 2015-11-26  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR target/68416
index 4958d3b..71b1656 100644 (file)
@@ -5285,7 +5285,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
              || GET_CODE (SET_DEST (x)) == PC))
        fmt = "ie";
 
-      /* Substituting into the operands of a widening MULT is not likely
+      /* Trying to simplify the operands of a widening MULT is not likely
         to create RTL matching a machine insn.  */
       if (code == MULT
          && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
@@ -5293,13 +5293,10 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
          && (GET_CODE (XEXP (x, 1)) == ZERO_EXTEND
              || GET_CODE (XEXP (x, 1)) == SIGN_EXTEND)
          && REG_P (XEXP (XEXP (x, 0), 0))
-         && REG_P (XEXP (XEXP (x, 1), 0)))
-       {
-         if (from == to)
-           return x;
-         else
-           return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
-       }
+         && REG_P (XEXP (XEXP (x, 1), 0))
+         && from == to)
+       return x;
+
 
       /* Get the mode of operand 0 in case X is now a SIGN_EXTEND of a
         constant.  */