]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET instead of SUBREG_PROMOTE...
authorKugan Vivekanandarajah <kuganv@linaro.org>
Fri, 8 Aug 2014 05:24:12 +0000 (05:24 +0000)
committerKugan Vivekanandarajah <kugan@gcc.gnu.org>
Fri, 8 Aug 2014 05:24:12 +0000 (05:24 +0000)
gcc/
2014-08-08  Kugan Vivekanandarajah  <kuganv@linaro.org>

* calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET
instead of SUBREG_PROMOTED_UNSIGNED_SET.
(expand_call): Likewise.
* cfgexpand.c (expand_gimple_stmt_1): Use SUBREG_PROMOTED_SIGN
to get promoted mode.
* combine.c (record_promoted_value): Skip > 0 comparison with
SUBREG_PROMOTED_UNSIGNED_P as it now returns only 0 or 1.
* expr.c (convert_move): Use SUBREG_CHECK_PROMOTED_SIGN instead
of SUBREG_PROMOTED_UNSIGNED_P.
(convert_modes): Likewise.
(store_expr): Use SUBREG_PROMOTED_SIGN to get promoted mode.
Use SUBREG_CHECK_PROMOTED_SIGN instead of SUBREG_PROMOTED_UNSIGNED_P.
(expand_expr_real_1): Use new SUBREG_PROMOTED_SET instead of
SUBREG_PROMOTED_UNSIGNED_SET.
* function.c (assign_parm_setup_reg): Use new SUBREG_PROMOTED_SET
instead of SUBREG_PROMOTED_UNSIGNED_SET.
* ifcvt.c (noce_emit_cmove): Updated to use SUBREG_PROMOTED_GET and
SUBREG_PROMOTED_SET.
* internal-fn.c (ubsan_expand_si_overflow_mul_check): Use
SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET.
* optabs.c (widen_operand): Use SUBREG_CHECK_PROMOTED_SIGN instead
of SUBREG_PROMOTED_UNSIGNED_P.
* rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): Remove.
(SUBREG_PROMOTED_SET): New define.
(SUBREG_PROMOTED_GET): Likewise.
(SUBREG_PROMOTED_SIGN): Likewise.
(SUBREG_PROMOTED_SIGNED_P): Likewise.
(SUBREG_CHECK_PROMOTED_SIGN): Likewise.
(SUBREG_PROMOTED_UNSIGNED_P): Updated.
* rtlanal.c (unsigned_reg_p): Use new SUBREG_PROMOTED_GET
instead of SUBREG_PROMOTED_UNSIGNED_GET.
(nonzero_bits1): Skip > 0 comparison with the results as
SUBREG_PROMOTED_UNSIGNED_P now returns only 0 or 1.
(num_sign_bit_copies1): Use SUBREG_PROMOTED_SIGNED_P instead
of !SUBREG_PROMOTED_UNSIGNED_P.
* simplify-rtx.c (simplify_unary_operation_1): Use new
SUBREG_PROMOTED_SIGNED_P instead of !SUBREG_PROMOTED_UNSIGNED_P.
(simplify_subreg): Use new SUBREG_PROMOTED_SIGNED_P,
SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_SET instead of
SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_UNSIGNED_SET.

From-SVN: r213749

12 files changed:
gcc/ChangeLog
gcc/calls.c
gcc/cfgexpand.c
gcc/combine.c
gcc/expr.c
gcc/function.c
gcc/ifcvt.c
gcc/internal-fn.c
gcc/optabs.c
gcc/rtl.h
gcc/rtlanal.c
gcc/simplify-rtx.c

index beee78f21afe058ebaac513a29ef1f9e6edf2104..e9cdcc04b465f3b0286d3a96e9dd873b557eb808 100644 (file)
@@ -1,3 +1,46 @@
+2014-08-08  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+       * calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET
+       instead of SUBREG_PROMOTED_UNSIGNED_SET.
+       (expand_call): Likewise.
+       * cfgexpand.c (expand_gimple_stmt_1): Use SUBREG_PROMOTED_SIGN
+       to get promoted mode.
+       * combine.c (record_promoted_value): Skip > 0 comparison with
+       SUBREG_PROMOTED_UNSIGNED_P as it now returns only 0 or 1.
+       * expr.c (convert_move): Use SUBREG_CHECK_PROMOTED_SIGN instead
+       of SUBREG_PROMOTED_UNSIGNED_P.
+       (convert_modes): Likewise.
+       (store_expr): Use SUBREG_PROMOTED_SIGN to get promoted mode.
+       Use SUBREG_CHECK_PROMOTED_SIGN instead of SUBREG_PROMOTED_UNSIGNED_P.
+       (expand_expr_real_1): Use new SUBREG_PROMOTED_SET instead of
+       SUBREG_PROMOTED_UNSIGNED_SET.
+       * function.c (assign_parm_setup_reg): Use new SUBREG_PROMOTED_SET
+       instead of SUBREG_PROMOTED_UNSIGNED_SET.
+       * ifcvt.c (noce_emit_cmove): Updated to use SUBREG_PROMOTED_GET and
+       SUBREG_PROMOTED_SET.
+       * internal-fn.c (ubsan_expand_si_overflow_mul_check): Use
+       SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET.
+       * optabs.c (widen_operand): Use SUBREG_CHECK_PROMOTED_SIGN instead
+       of SUBREG_PROMOTED_UNSIGNED_P.
+       * rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): Remove.
+       (SUBREG_PROMOTED_SET): New define.
+       (SUBREG_PROMOTED_GET): Likewise.
+       (SUBREG_PROMOTED_SIGN): Likewise.
+       (SUBREG_PROMOTED_SIGNED_P): Likewise.
+       (SUBREG_CHECK_PROMOTED_SIGN): Likewise.
+       (SUBREG_PROMOTED_UNSIGNED_P): Updated.
+       * rtlanal.c (unsigned_reg_p): Use new SUBREG_PROMOTED_GET
+       instead of SUBREG_PROMOTED_UNSIGNED_GET.
+       (nonzero_bits1): Skip > 0 comparison with the results as
+       SUBREG_PROMOTED_UNSIGNED_P now returns only 0 or 1.
+       (num_sign_bit_copies1): Use SUBREG_PROMOTED_SIGNED_P instead
+       of !SUBREG_PROMOTED_UNSIGNED_P.
+       * simplify-rtx.c (simplify_unary_operation_1): Use new
+       SUBREG_PROMOTED_SIGNED_P instead of !SUBREG_PROMOTED_UNSIGNED_P.
+       (simplify_subreg): Use new SUBREG_PROMOTED_SIGNED_P,
+       SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_SET instead of
+       SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_UNSIGNED_SET.
+
 2014-08-07  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-devirt.c: Include gimple-pretty-print.h
index e8456528a59e1c6065bc69a2db4d1e37f132bc6f..00c502858298dc68f6befbc6374a6a9f774ea6b9 100644 (file)
@@ -1484,8 +1484,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;
-             SUBREG_PROMOTED_UNSIGNED_SET (args[i].initial_value,
-                                           args[i].unsignedp);
+             SUBREG_PROMOTED_SET (args[i].initial_value, args[i].unsignedp);
            }
        }
     }
@@ -3365,7 +3364,7 @@ expand_call (tree exp, rtx target, int ignore)
 
          target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset);
          SUBREG_PROMOTED_VAR_P (target) = 1;
-         SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp);
+         SUBREG_PROMOTED_SET (target, unsignedp);
        }
 
       /* If size of args is variable or this was a constructor call for a stack
index ea53d2a3bdf0291a66b0a67132c3bccc3406ca5f..0e9410e0cc85a8065fd08646727abf698d847129 100644 (file)
@@ -3308,7 +3308,7 @@ expand_gimple_stmt_1 (gimple stmt)
              ;
            else if (promoted)
              {
-               int unsignedp = SUBREG_PROMOTED_UNSIGNED_P (target);
+               int unsignedp = SUBREG_PROMOTED_SIGN (target);
                /* If TEMP is a VOIDmode constant, use convert_modes to make
                   sure that we properly convert it.  */
                if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode)
index 53ac1d6cca05d15daae7a534d2817a6b42296a36..c3f0ae767ab89d019b3d64da9e46a9555e301211 100644 (file)
@@ -12458,7 +12458,7 @@ record_promoted_value (rtx insn, rtx subreg)
       rsp = &reg_stat[regno];
       if (rsp->last_set == insn)
        {
-         if (SUBREG_PROMOTED_UNSIGNED_P (subreg) > 0)
+         if (SUBREG_PROMOTED_UNSIGNED_P (subreg))
            rsp->last_set_nonzero_bits &= GET_MODE_MASK (mode);
        }
 
index d8328eebfbf62e676420115ba6c3d110895e5615..12420314fa09574428853a604bf8ec8bbe2ca4e9 100644 (file)
@@ -329,7 +329,7 @@ convert_move (rtx to, rtx from, int unsignedp)
   if (GET_CODE (from) == SUBREG && SUBREG_PROMOTED_VAR_P (from)
       && (GET_MODE_PRECISION (GET_MODE (SUBREG_REG (from)))
          >= GET_MODE_PRECISION (to_mode))
-      && SUBREG_PROMOTED_UNSIGNED_P (from) == unsignedp)
+      && SUBREG_CHECK_PROMOTED_SIGN (from, unsignedp))
     from = gen_lowpart (to_mode, from), from_mode = to_mode;
 
   gcc_assert (GET_CODE (to) != SUBREG || !SUBREG_PROMOTED_VAR_P (to));
@@ -703,7 +703,7 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns
 
   if (GET_CODE (x) == SUBREG && SUBREG_PROMOTED_VAR_P (x)
       && GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) >= GET_MODE_SIZE (mode)
-      && SUBREG_PROMOTED_UNSIGNED_P (x) == unsignedp)
+      && SUBREG_CHECK_PROMOTED_SIGN (x, unsignedp))
     x = gen_lowpart (mode, SUBREG_REG (x));
 
   if (GET_MODE (x) != VOIDmode)
@@ -5202,25 +5202,25 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
          && GET_MODE_PRECISION (GET_MODE (target))
             == TYPE_PRECISION (TREE_TYPE (exp)))
        {
-         if (TYPE_UNSIGNED (TREE_TYPE (exp))
-             != SUBREG_PROMOTED_UNSIGNED_P (target))
+         if (!SUBREG_CHECK_PROMOTED_SIGN (target,
+                                         TYPE_UNSIGNED (TREE_TYPE (exp))))
            {
              /* Some types, e.g. Fortran's logical*4, won't have a signed
                 version, so use the mode instead.  */
              tree ntype
                = (signed_or_unsigned_type_for
-                  (SUBREG_PROMOTED_UNSIGNED_P (target), TREE_TYPE (exp)));
+                  (SUBREG_PROMOTED_SIGN (target), TREE_TYPE (exp)));
              if (ntype == NULL)
                ntype = lang_hooks.types.type_for_mode
                  (TYPE_MODE (TREE_TYPE (exp)),
-                  SUBREG_PROMOTED_UNSIGNED_P (target));
+                  SUBREG_PROMOTED_SIGN (target));
 
              exp = fold_convert_loc (loc, ntype, exp);
            }
 
          exp = fold_convert_loc (loc, lang_hooks.types.type_for_mode
                                  (GET_MODE (SUBREG_REG (target)),
-                                  SUBREG_PROMOTED_UNSIGNED_P (target)),
+                                  SUBREG_PROMOTED_SIGN (target)),
                                  exp);
 
          inner_target = SUBREG_REG (target);
@@ -5234,14 +5234,14 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
       if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode)
        {
          temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
-                               temp, SUBREG_PROMOTED_UNSIGNED_P (target));
+                               temp, SUBREG_PROMOTED_SIGN (target));
          temp = convert_modes (GET_MODE (SUBREG_REG (target)),
                                GET_MODE (target), temp,
-                               SUBREG_PROMOTED_UNSIGNED_P (target));
+                               SUBREG_PROMOTED_SIGN (target));
        }
 
       convert_move (SUBREG_REG (target), temp,
-                   SUBREG_PROMOTED_UNSIGNED_P (target));
+                   SUBREG_PROMOTED_SIGN (target));
 
       return NULL_RTX;
     }
@@ -9527,7 +9527,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;
-         SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
+         SUBREG_PROMOTED_SET (temp, unsignedp);
          return temp;
        }
 
index 84d6a107c703be70b2217e3da7e3e931f93ea44e..a9153142d35f21b2db7f62851445c5f2a5edd292 100644 (file)
@@ -3094,7 +3094,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
          /* The argument is already sign/zero extended, so note it
             into the subreg.  */
          SUBREG_PROMOTED_VAR_P (tempreg) = 1;
-         SUBREG_PROMOTED_UNSIGNED_SET (tempreg, unsignedp);
+         SUBREG_PROMOTED_SET (tempreg, unsignedp);
        }
 
       /* TREE_USED gets set erroneously during expand_assignment.  */
index 754a707cd3501f30a331bbd992f7c351e2f42cdb..e44c1dcd197e2200a5edfb2259d8f87985ce98bd 100644 (file)
@@ -1447,8 +1447,8 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
          || byte_vtrue != byte_vfalse
          || (SUBREG_PROMOTED_VAR_P (vtrue)
              != SUBREG_PROMOTED_VAR_P (vfalse))
-         || (SUBREG_PROMOTED_UNSIGNED_P (vtrue)
-             != SUBREG_PROMOTED_UNSIGNED_P (vfalse)))
+         || (SUBREG_PROMOTED_GET (vtrue)
+             != SUBREG_PROMOTED_GET (vfalse)))
        return NULL_RTX;
 
       promoted_target = gen_reg_rtx (GET_MODE (reg_vtrue));
@@ -1462,7 +1462,7 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
 
       target = gen_rtx_SUBREG (GET_MODE (vtrue), promoted_target, byte_vtrue);
       SUBREG_PROMOTED_VAR_P (target) = SUBREG_PROMOTED_VAR_P (vtrue);
-      SUBREG_PROMOTED_UNSIGNED_SET (target, SUBREG_PROMOTED_UNSIGNED_P (vtrue));
+      SUBREG_PROMOTED_SET (target, SUBREG_PROMOTED_GET (vtrue));
       emit_move_insn (x, target);
       return x;
     }
index 78f59d6a7b737cf9fa18e5ed3776214410be61a3..4e0b964cfd17c6af9057760c3e0f1f773224f075 100644 (file)
@@ -584,12 +584,12 @@ ubsan_expand_si_overflow_mul_check (gimple stmt)
          if (GET_CODE (lopart0) == SUBREG)
            {
              SUBREG_PROMOTED_VAR_P (lopart0) = 1;
-             SUBREG_PROMOTED_UNSIGNED_SET (lopart0, 0);
+             SUBREG_PROMOTED_SET (lopart0, 0);
            }
          if (GET_CODE (lopart1) == SUBREG)
            {
              SUBREG_PROMOTED_VAR_P (lopart1) = 1;
-             SUBREG_PROMOTED_UNSIGNED_SET (lopart1, 0);
+             SUBREG_PROMOTED_SET (lopart1, 0);
            }
          tree halfstype = build_nonstandard_integer_type (hprec, 0);
          ops.op0 = make_tree (halfstype, lopart0);
index 65328a668ba024b10d0f9637f0a935539243abd9..d6412ec42d7c4908a74d098e80d7038e068ca557 100644 (file)
@@ -368,7 +368,7 @@ widen_operand (rtx op, enum machine_mode mode, enum machine_mode oldmode,
      a promoted object differs from our extension.  */
   if (! no_extend
       || (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op)
-         && SUBREG_PROMOTED_UNSIGNED_P (op) == unsignedp))
+         && SUBREG_CHECK_PROMOTED_SIGN (op, unsignedp)))
     return convert_modes (mode, oldmode, op, unsignedp);
 
   /* If MODE is no wider than a single word, we return a lowpart or paradoxical
index 2fb0c5c4f68f48e3d7ff59fce1d7f580f342e9fe..b6555ea97aab9e6a43172622e9d0bb8e1b6a9d26 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1585,29 +1585,75 @@ get_full_set_src_cost (rtx x, struct full_rtx_costs *c)
 #define SUBREG_PROMOTED_VAR_P(RTX)                                     \
   (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED", (RTX), SUBREG)->in_struct)
 
-#define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL)                         \
-do {                                                                   \
-  rtx const _rtx = RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_UNSIGNED_SET",    \
-                                   (RTX), SUBREG);                     \
-  if ((VAL) < 0)                                                       \
-    _rtx->volatil = 1;                                                 \
-  else {                                                               \
-    _rtx->volatil = 0;                                                 \
-    _rtx->unchanging = (VAL);                                          \
-  }                                                                    \
-} while (0)
-
 /* Valid for subregs which are SUBREG_PROMOTED_VAR_P().  In that case
    this gives the necessary extensions:
-   0  - signed
-   1  - normal unsigned
+   0  - signed (SPR_SIGNED)
+   1  - normal unsigned (SPR_UNSIGNED)
+   2  - value is both sign and unsign extended for mode
+       (SPR_SIGNED_AND_UNSIGNED).
    -1 - pointer unsigned, which most often can be handled like unsigned
         extension, except for generating instructions where we need to
-       emit special code (ptr_extend insns) on some architectures.  */
+       emit special code (ptr_extend insns) on some architectures
+       (SPR_POINTER). */
+
+const int SRP_POINTER = -1;
+const int SRP_SIGNED = 0;
+const int SRP_UNSIGNED = 1;
+const int SRP_SIGNED_AND_UNSIGNED = 2;
+
+/* Sets promoted mode for SUBREG_PROMOTED_VAR_P().  */
+#define SUBREG_PROMOTED_SET(RTX, VAL)                                  \
+do {                                                                   \
+  rtx const _rtx = RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_SET",             \
+                                    (RTX), SUBREG);                    \
+  switch (VAL)                                                         \
+  {                                                                    \
+    case SRP_POINTER:                                                  \
+      _rtx->volatil = 0;                                               \
+      _rtx->unchanging = 0;                                            \
+      break;                                                           \
+    case SRP_SIGNED:                                                   \
+      _rtx->volatil = 0;                                               \
+      _rtx->unchanging = 1;                                            \
+      break;                                                           \
+    case SRP_UNSIGNED:                                                 \
+      _rtx->volatil = 1;                                               \
+      _rtx->unchanging = 0;                                            \
+      break;                                                           \
+    case SRP_SIGNED_AND_UNSIGNED:                                      \
+      _rtx->volatil = 1;                                               \
+      _rtx->unchanging = 1;                                            \
+      break;                                                           \
+  }                                                                    \
+} while (0)
 
+/* Gets the value stored in promoted mode for SUBREG_PROMOTED_VAR_P(),
+   including SRP_SIGNED_AND_UNSIGNED if promoted for
+   both signed and unsigned.  */
+#define SUBREG_PROMOTED_GET(RTX)       \
+  (2 * (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_GET", (RTX), SUBREG)->volatil)\
+   + (RTX)->unchanging - 1)
+
+/* Returns sign of promoted mode for SUBREG_PROMOTED_VAR_P().  */
+#define SUBREG_PROMOTED_SIGN(RTX)      \
+  ((RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_SIGN", (RTX), SUBREG)->volatil) ? 1\
+   : (RTX)->unchanging - 1)
+
+/* Predicate to check if RTX of SUBREG_PROMOTED_VAR_P() is promoted
+   for SIGNED type.  */
+#define SUBREG_PROMOTED_SIGNED_P(RTX)  \
+  (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_SIGNED_P", (RTX), SUBREG)->unchanging)
+
+/* Predicate to check if RTX of SUBREG_PROMOTED_VAR_P() is promoted
+   for UNSIGNED type.  */
 #define SUBREG_PROMOTED_UNSIGNED_P(RTX)        \
-  ((RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil) \
-   ? -1 : (int) (RTX)->unchanging)
+  (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil)
+
+/* Checks if RTX of SUBREG_PROMOTED_VAR_P() is promoted for given SIGN.  */
+#define SUBREG_CHECK_PROMOTED_SIGN(RTX, SIGN)  \
+((SIGN) == SRP_POINTER ? SUBREG_PROMOTED_GET (RTX) == SRP_POINTER      \
+ : (SIGN) == SRP_SIGNED ? SUBREG_PROMOTED_SIGNED_P (RTX)               \
+ : SUBREG_PROMOTED_UNSIGNED_P (RTX))
 
 /* True if the subreg was generated by LRA for reload insns.  Such
    subregs are valid only during LRA.  */
index c513ec1a79611521ab7fa30a5d6bcd2328cc1e5e..3196e55f17f4e4a77f364793b53999daed6d4279 100644 (file)
@@ -670,7 +670,7 @@ unsigned_reg_p (rtx op)
     return true;
 
   if (GET_CODE (op) == SUBREG
-      && SUBREG_PROMOTED_UNSIGNED_P (op))
+      && SUBREG_PROMOTED_SIGN (op))
     return true;
 
   return false;
@@ -4309,7 +4309,7 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
         been zero-extended, we know that at least the high-order bits
         are zero, though others might be too.  */
 
-      if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x) > 0)
+      if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x))
        nonzero = GET_MODE_MASK (GET_MODE (x))
                  & cached_nonzero_bits (SUBREG_REG (x), GET_MODE (x),
                                         known_x, known_mode, known_ret);
@@ -4619,7 +4619,7 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
         and we are looking at it in a wider mode, we know that at least the
         high-order bits are known to be sign bit copies.  */
 
-      if (SUBREG_PROMOTED_VAR_P (x) && ! SUBREG_PROMOTED_UNSIGNED_P (x))
+      if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_SIGNED_P (x))
        {
          num0 = cached_num_sign_bit_copies (SUBREG_REG (x), mode,
                                             known_x, known_mode, known_ret);
index 9f6dbe119c67416f7fadfe533b5af646873b8c5e..4b4c00483a773a40b2c2a33f8878f59975c40aac 100644 (file)
@@ -1352,7 +1352,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
         target mode is the same as the variable's promotion.  */
       if (GET_CODE (op) == SUBREG
          && SUBREG_PROMOTED_VAR_P (op)
-         && ! SUBREG_PROMOTED_UNSIGNED_P (op)
+         && SUBREG_PROMOTED_SIGNED_P (op)
          && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (GET_MODE (XEXP (op, 0))))
        {
          temp = rtl_hooks.gen_lowpart_no_emit (mode, op);
@@ -1419,7 +1419,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
         target mode is the same as the variable's promotion.  */
       if (GET_CODE (op) == SUBREG
          && SUBREG_PROMOTED_VAR_P (op)
-         && SUBREG_PROMOTED_UNSIGNED_P (op) > 0
+         && SUBREG_PROMOTED_UNSIGNED_P (op)
          && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (GET_MODE (XEXP (op, 0))))
        {
          temp = rtl_hooks.gen_lowpart_no_emit (mode, op);
@@ -5633,7 +5633,7 @@ simplify_subreg (enum machine_mode outermode, rtx op,
        {
          newx = gen_rtx_SUBREG (outermode, SUBREG_REG (op), final_offset);
          if (SUBREG_PROMOTED_VAR_P (op)
-             && SUBREG_PROMOTED_UNSIGNED_P (op) >= 0
+             && SUBREG_PROMOTED_SIGN (op) >= 0
              && GET_MODE_CLASS (outermode) == MODE_INT
              && IN_RANGE (GET_MODE_SIZE (outermode),
                           GET_MODE_SIZE (innermode),
@@ -5641,8 +5641,7 @@ simplify_subreg (enum machine_mode outermode, rtx op,
              && subreg_lowpart_p (newx))
            {
              SUBREG_PROMOTED_VAR_P (newx) = 1;
-             SUBREG_PROMOTED_UNSIGNED_SET
-               (newx, SUBREG_PROMOTED_UNSIGNED_P (op));
+             SUBREG_PROMOTED_SET (newx, SUBREG_PROMOTED_GET (op));
            }
          return newx;
        }