revert: calls.c (precompute_arguments): Check promoted_for_signed_and_unsigned_p...
authorKugan Vivekanandarajah <kuganv@linaro.org>
Wed, 10 Sep 2014 00:19:23 +0000 (00:19 +0000)
committerKugan Vivekanandarajah <kugan@gcc.gnu.org>
Wed, 10 Sep 2014 00:19:23 +0000 (00:19 +0000)
gcc/ChangeLog:

2014-09-10  Kugan Vivekanandarajah  <kuganv@linaro.org>

Revert r213751:
* calls.c (precompute_arguments): Check
 promoted_for_signed_and_unsigned_p and set the promoted mode.
(promoted_for_signed_and_unsigned_p): New function.
(expand_expr_real_1): Check promoted_for_signed_and_unsigned_p
and set the promoted mode.
* expr.h (promoted_for_signed_and_unsigned_p): New function definition.
* cfgexpand.c (expand_gimple_stmt_1): Call emit_move_insn if
SUBREG is promoted with SRP_SIGNED_AND_UNSIGNED.

From-SVN: r215100

gcc/ChangeLog
gcc/calls.c
gcc/cfgexpand.c
gcc/expr.c
gcc/expr.h

index f7a5401b7e2ea25810b36b7650db300f7da56cfd..24667358ef3429d57fae64ee96943b0ebf93c2b5 100644 (file)
@@ -1,3 +1,15 @@
+2014-09-10  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+       Revert r213751:
+       * calls.c (precompute_arguments): Check
+        promoted_for_signed_and_unsigned_p and set the promoted mode.
+       (promoted_for_signed_and_unsigned_p): New function.
+       (expand_expr_real_1): Check promoted_for_signed_and_unsigned_p
+       and set the promoted mode.
+       * expr.h (promoted_for_signed_and_unsigned_p): New function definition.
+       * cfgexpand.c (expand_gimple_stmt_1): Call emit_move_insn if
+       SUBREG is promoted with SRP_SIGNED_AND_UNSIGNED.
+
 2014-09-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        * opth-gen.awk: Generate mapping from cpp message reasons to the
index 03ed9c8e303a6337cf49d3ce575de109216bd45e..345331fa6db2f3b04d61fe26ad984d2c4f0547b2 100644 (file)
@@ -1486,10 +1486,7 @@ precompute_arguments (int num_actuals, struct arg_data *args)
              args[i].initial_value
                = gen_lowpart_SUBREG (mode, args[i].value);
              SUBREG_PROMOTED_VAR_P (args[i].initial_value) = 1;
-             if (promoted_for_signed_and_unsigned_p (args[i].tree_value, mode))
-               SUBREG_PROMOTED_SET (args[i].initial_value, SRP_SIGNED_AND_UNSIGNED);
-             else
-               SUBREG_PROMOTED_SET (args[i].initial_value, args[i].unsignedp);
+             SUBREG_PROMOTED_SET (args[i].initial_value, args[i].unsignedp);
            }
        }
     }
index db7689767b901cc33462d007efd0663fbce9f5c6..891630536c85f0498d87c5cadca728e514920458 100644 (file)
@@ -3325,13 +3325,7 @@ expand_gimple_stmt_1 (gimple stmt)
                                          GET_MODE (target), temp, unsignedp);
                  }
 
-               if ((SUBREG_PROMOTED_GET (target) == SRP_SIGNED_AND_UNSIGNED)
-                   && (GET_CODE (temp) == SUBREG)
-                   && (GET_MODE (target) == GET_MODE (temp))
-                   && (GET_MODE (SUBREG_REG (target)) == GET_MODE (SUBREG_REG (temp))))
-                 emit_move_insn (SUBREG_REG (target), SUBREG_REG (temp));
-               else
-                 convert_move (SUBREG_REG (target), temp, unsignedp);
+               convert_move (SUBREG_REG (target), temp, unsignedp);
              }
            else if (nontemporal && emit_storent_insn (target, temp))
              ;
index 0a0ac80bb6cce26fd70b11ccc3841da10660fb38..a6233f33d28280d081a311313f120dd0a2687467 100644 (file)
@@ -68,7 +68,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-address.h"
 #include "cfgexpand.h"
 #include "builtins.h"
-#include "tree-ssa.h"
 
 #ifndef STACK_PUSH_CODE
 #ifdef STACK_GROWS_DOWNWARD
@@ -9250,35 +9249,6 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
 }
 #undef REDUCE_BIT_FIELD
 
-/* Return TRUE if value in SSA is zero and sign extended for wider mode MODE
-   using value range information stored.  Return FALSE otherwise.
-
-   This is used to check if SUBREG is zero and sign extended and to set
-   promoted mode SRP_SIGNED_AND_UNSIGNED to SUBREG.  */
-
-bool
-promoted_for_signed_and_unsigned_p (tree ssa, enum machine_mode mode)
-{
-  wide_int min, max;
-
-  if (ssa == NULL_TREE
-      || TREE_CODE (ssa) != SSA_NAME
-      || !INTEGRAL_TYPE_P (TREE_TYPE (ssa))
-      || (TYPE_PRECISION (TREE_TYPE (ssa)) != GET_MODE_PRECISION (mode)))
-    return false;
-
-  /* Return FALSE if value_range is not recorded for SSA.  */
-  if (get_range_info (ssa, &min, &max) != VR_RANGE)
-    return false;
-
-  /* Return true (to set SRP_SIGNED_AND_UNSIGNED to SUBREG) if MSB of the
-     smaller mode is not set (i.e.  MSB of ssa is not set).  */
-  if (!wi::neg_p (min, SIGNED) && !wi::neg_p(max, SIGNED))
-    return true;
-  else
-    return false;
-
-}
 
 /* Return TRUE if expression STMT is suitable for replacement.  
    Never consider memory loads as replaceable, because those don't ever lead 
@@ -9582,10 +9552,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
 
          temp = gen_lowpart_SUBREG (mode, decl_rtl);
          SUBREG_PROMOTED_VAR_P (temp) = 1;
-         if (promoted_for_signed_and_unsigned_p (ssa_name, mode))
-           SUBREG_PROMOTED_SET (temp, SRP_SIGNED_AND_UNSIGNED);
-         else
-           SUBREG_PROMOTED_SET (temp, unsignedp);
+         SUBREG_PROMOTED_SET (temp, unsignedp);
          return temp;
        }
 
index 756c89488d526a1ad802f76bfd42159e9ff16a73..2e66329091089a9049af50a06b31b87357ede51e 100644 (file)
@@ -440,7 +440,6 @@ extern rtx expand_expr_real_1 (tree, rtx, enum machine_mode,
                               enum expand_modifier, rtx *, bool);
 extern rtx expand_expr_real_2 (sepops, rtx, enum machine_mode,
                               enum expand_modifier);
-extern bool promoted_for_signed_and_unsigned_p (tree, enum machine_mode);
 
 /* Generate code for computing expression EXP.
    An rtx for the computed value is returned.  The value is never null.