]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fix merge on wide-int branch
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Sep 2013 21:23:39 +0000 (21:23 +0000)
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Sep 2013 21:23:39 +0000 (21:23 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202845 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fold-const.c
gcc/genpreds.c
gcc/gimple-ssa-strength-reduction.c
gcc/postreload.c
gcc/ubsan.c

index ab94704631e133645eb54b402b63eb89015be63a..18bd4a03f5bd36bdbf63fc070e1aa4198dffb373 100644 (file)
@@ -9897,17 +9897,15 @@ exact_inverse (tree type, tree cst)
 
 /*  Mask out the tz least significant bits of X of type TYPE where
     tz is the number of trailing zeroes in Y.  */
-static double_int
-mask_with_tz (tree type, double_int x, double_int y)
+static wide_int
+mask_with_tz (tree type, wide_int x, wide_int y)
 {
-  int tz = y.trailing_zeros ();
-
+  int tz = wi::ctz (y);
   if (tz > 0)
     {
-      double_int mask;
+      wide_int mask;
 
-      mask = ~double_int::mask (tz);
-      mask = mask.ext (TYPE_PRECISION (type), TYPE_UNSIGNED (type));
+      mask = wi::mask (tz, true, TYPE_PRECISION (type));
       return mask & x;
     }
   return x;
@@ -11276,7 +11274,7 @@ fold_binary_loc (location_t loc,
                            == INTEGER_CST)
          {
            tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1);
-           double_int masked = mask_with_tz (type, c3, tree_to_double_int (t));
+           wide_int masked = mask_with_tz (type, c3, t);
 
            try_simplify = (masked != c1);
          }
@@ -11670,32 +11668,14 @@ fold_binary_loc (location_t loc,
          && TREE_CODE (arg0) == MULT_EXPR
          && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
        {
-<<<<<<< .working
-         int arg1tz = wi::ctz (TREE_OPERAND (arg0, 1));
-         if (arg1tz > 0)
-           {
-             wide_int arg1mask, masked;
-             arg1mask = wi::mask (arg1tz, true, TYPE_PRECISION (type));
-             masked = arg1mask & arg1;
-             if (masked == 0)
-               return omit_two_operands_loc (loc, type, build_zero_cst (type),
-                                             arg0, arg1);
-             else if (masked != arg1)
-               return fold_build2_loc (loc, code, type, op0,
-                                       wide_int_to_tree (type, masked));
-           }
-=======
-         double_int masked
-           = mask_with_tz (type, tree_to_double_int (arg1),
-                           tree_to_double_int (TREE_OPERAND (arg0, 1)));
+         wide_int masked = mask_with_tz (type, arg1, TREE_OPERAND (arg0, 1));
 
-         if (masked.is_zero ())
+         if (masked == 0)
            return omit_two_operands_loc (loc, type, build_zero_cst (type),
                                          arg0, arg1);
-         else if (masked != tree_to_double_int (arg1))
+         else if (masked != arg1)
            return fold_build2_loc (loc, code, type, op0,
-                                   double_int_to_tree (type, masked));
->>>>>>> .merge-right.r202797
+                                   wide_int_to_tree (type, masked));
        }
 
       /* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
index 29fafbe79ef8e46f6932ce55044c1176d00a960a..a130ace3d9185708698e1fff957f504a1e9ebdcc 100644 (file)
@@ -809,11 +809,7 @@ add_constraint (const char *name, const char *regclass,
   if (is_const_int || is_const_dbl)
     {
       enum rtx_code appropriate_code
-#if TARGET_SUPPORTS_WIDE_INT
-       = is_const_int ? CONST_INT : CONST_WIDE_INT;
-#else
        = is_const_int ? CONST_INT : CONST_DOUBLE;
-#endif
       /* Consider relaxing this requirement in the future.  */
       if (regclass
          || GET_CODE (exp) != AND
index 7a089cd0d39d5177a391bd554af52ddd73afaefe..505b7d46fde50c6e897889abb7501312493a5076 100644 (file)
@@ -763,7 +763,7 @@ slsr_process_phi (gimple phi, bool speed)
    int (i * S).
    Otherwise, just return double int zero.  */
 
-static double_int
+static max_wide_int
 backtrace_base_for_ref (tree *pbase)
 {
   tree base_in = *pbase;
@@ -771,19 +771,19 @@ backtrace_base_for_ref (tree *pbase)
 
   STRIP_NOPS (base_in);
   if (TREE_CODE (base_in) != SSA_NAME)
-    return tree_to_double_int (integer_zero_node);
+    return 0;
 
   base_cand = base_cand_from_table (base_in);
 
   while (base_cand && base_cand->kind != CAND_PHI)
     {
       if (base_cand->kind == CAND_ADD
-         && base_cand->index.is_one ()
+         && base_cand->index == 1
          && TREE_CODE (base_cand->stride) == INTEGER_CST)
        {
          /* X = B + (1 * S), S is integer constant.  */
          *pbase = base_cand->base_expr;
-         return tree_to_double_int (base_cand->stride);
+         return base_cand->stride;
        }
       else if (base_cand->kind == CAND_ADD
               && TREE_CODE (base_cand->stride) == INTEGER_CST
@@ -800,7 +800,7 @@ backtrace_base_for_ref (tree *pbase)
        base_cand = NULL;
     }
 
-  return tree_to_double_int (integer_zero_node);
+  return 0;
 }
 
 /* Look for the following pattern:
index 6ac5bb32a806a0b6c7eacd7306a6fb2252a7eb9d..b562d1fc1a48f665a178d8edb18d395fadd13208 100644 (file)
@@ -305,7 +305,7 @@ reload_cse_simplify_set (rtx set, rtx insn)
                case ZERO_EXTEND:
                  result = wide_int (std::make_pair (this_rtx, GET_MODE (src)));
                  if (GET_MODE_PRECISION (GET_MODE (src)) > GET_MODE_PRECISION (word_mode))
-                   result = result.zext (GET_MODE_PRECISION (word_mode));
+                   result = wi::zext (result, GET_MODE_PRECISION (word_mode));
                  break;
                case SIGN_EXTEND:
                  result = wide_int (std::make_pair (this_rtx, GET_MODE (src)));
index 6c6fea80afd3e0fb7f036a7b12e467c337acea45..e0e6b5bf3438c90abe5a1d739eb19f3f84ba7548 100644 (file)
@@ -233,8 +233,8 @@ ubsan_source_location (location_t loc)
 static unsigned short
 get_ubsan_type_info_for_type (tree type)
 {
-  gcc_assert (TYPE_SIZE (type) && host_integerp (TYPE_SIZE (type), 1));
-  int prec = exact_log2 (tree_low_cst (TYPE_SIZE (type), 1));
+  gcc_assert (TYPE_SIZE (type) && tree_fits_uhwi_p (TYPE_SIZE (type)));
+  int prec = exact_log2 (tree_to_uhwi (TYPE_SIZE (type)));
   gcc_assert (prec != -1);
   return (prec << 1) | !TYPE_UNSIGNED (type);
 }