]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove some wide_int constructor calls. Make more use of wi::.
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Nov 2013 10:12:12 +0000 (10:12 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Nov 2013 10:12:12 +0000 (10:12 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204628 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/builtins.c
gcc/c-family/c-common.c
gcc/cp/decl.c
gcc/dwarf2out.c
gcc/godump.c
gcc/simplify-rtx.c
gcc/tree-dump.c
gcc/tree-ssa-address.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-forwprop.c
gcc/tree-vrp.c

index fee90a0c950cc7b370cca4a753029f2bed398ef0..c05a3896b5bf2f22f3490efd6881192aab8f1497 100644 (file)
@@ -12512,7 +12512,6 @@ fold_builtin_object_size (tree ptr, tree ost)
 {
   unsigned HOST_WIDE_INT bytes;
   int object_size_type;
-  int precision = TYPE_PRECISION (TREE_TYPE (ptr));
 
   if (!validate_arg (ptr, POINTER_TYPE)
       || !validate_arg (ost, INTEGER_TYPE))
@@ -12535,11 +12534,9 @@ fold_builtin_object_size (tree ptr, tree ost)
 
   if (TREE_CODE (ptr) == ADDR_EXPR)
     {
-      wide_int wbytes 
-       = wi::uhwi (compute_builtin_object_size (ptr, object_size_type),
-                   precision);
-      if (wi::fits_to_tree_p (wbytes, size_type_node))
-       return wide_int_to_tree (size_type_node, wbytes);
+      bytes = compute_builtin_object_size (ptr, object_size_type);
+      if (wi::fits_to_tree_p (bytes, size_type_node))
+       return build_int_cstu (size_type_node, bytes);
     }
   else if (TREE_CODE (ptr) == SSA_NAME)
     {
@@ -12547,10 +12544,9 @@ fold_builtin_object_size (tree ptr, tree ost)
        later.  Maybe subsequent passes will help determining
        it.  */
       bytes = compute_builtin_object_size (ptr, object_size_type);
-      wide_int wbytes = wi::uhwi (bytes, precision);
       if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2 ? -1 : 0)
-          && wi::fits_to_tree_p (wbytes, size_type_node))
-       return wide_int_to_tree (size_type_node, wbytes);
+          && wi::fits_to_tree_p (bytes, size_type_node))
+       return build_int_cstu (size_type_node, bytes);
     }
 
   return NULL_TREE;
index 10d83b30870f946d636a632bb9875e5fbff309cb..d83d971c87ff564a3d5b93a0699c022c53da2cf6 100644 (file)
@@ -7979,11 +7979,10 @@ handle_alloc_size_attribute (tree *node, tree ARG_UNUSED (name), tree args,
   for (; args; args = TREE_CHAIN (args))
     {
       tree position = TREE_VALUE (args);
-      wide_int p;
 
       if (TREE_CODE (position) != INTEGER_CST
-         || wi::ltu_p (p = wide_int (position), 1)
-         || wi::gtu_p (p, arg_count))
+         || wi::ltu_p (position, 1)
+         || wi::gtu_p (position, arg_count))
        {
          warning (OPT_Wattributes,
                   "alloc_size parameter outside range");
index 27eda06cc7fb3a67c5879d3151fabd12a5fb6a89..2040f8df2ca650043c5a676833d547f0a86ac276 100644 (file)
@@ -4805,8 +4805,7 @@ check_array_designated_initializer (constructor_elt *ce,
       if (TREE_CODE (ce->index) == INTEGER_CST)
        {
          /* A C99 designator is OK if it matches the current index.  */
-         if (tree_fits_uhwi_p (ce->index) 
-             && tree_to_uhwi (ce->index) == index)
+         if (wi::eq_p (ce->index, index))
            return true;
          else
            sorry ("non-trivial designated initializers not supported");
index 9c42217519b30c7f0c8fbe962e1dff08e5d7d732..acee2000eaf5101456b096d958fda1251739cc6d 100644 (file)
@@ -16345,7 +16345,7 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
                 || (cst_fits_uhwi_p (bound) && wi::ges_p (bound, 0)))
          add_AT_unsigned (subrange_die, bound_attr, tree_to_hwi (bound));
        else
-         add_AT_wide (subrange_die, bound_attr, wide_int (bound));
+         add_AT_wide (subrange_die, bound_attr, bound);
       }
       break;
 
@@ -17501,7 +17501,7 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
          else
            /* Enumeration constants may be wider than HOST_WIDE_INT.  Handle
               that here.  */
-           add_AT_wide (enum_die, DW_AT_const_value, wide_int (value));
+           add_AT_wide (enum_die, DW_AT_const_value, value);
        }
 
       add_gnat_descriptive_type_attribute (type_die, type, context_die);
index 4a088f9465870fa6432cae9123af8fb522c44077..668a0bab6818d22f1aaba31d25336fff8c4977c1 100644 (file)
@@ -990,7 +990,7 @@ go_output_typedef (struct godump_container *container, tree decl)
                     ((unsigned HOST_WIDE_INT)
                      tree_to_uhwi (TREE_VALUE (element))));
          else
-           print_hex (wide_int (element), buf);
+           print_hex (element, buf);
 
          mhval->value = xstrdup (buf);
          *slot = mhval;
index 8ab4454138ccb3ecd5749115e461dadd712c5fb1..fb1a27eefc899f688df739142b00e87cf753dff9 100644 (file)
@@ -2223,7 +2223,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
          else if (GET_CODE (rhs) == MULT
                   && CONST_INT_P (XEXP (rhs, 1)))
            {
-             negcoeff1 = -wide_int (std::make_pair (XEXP (rhs, 1), mode));
+             negcoeff1 = wi::neg (std::make_pair (XEXP (rhs, 1), mode));
              rhs = XEXP (rhs, 0);
            }
          else if (GET_CODE (rhs) == ASHIFT
index 08245d1982f0af05012b2bc196fe892ccd575664..0926452a825dbf1f168041bc8bf7fba5e7251976 100644 (file)
@@ -564,7 +564,7 @@ dequeue_and_dump (dump_info_p di)
 
     case INTEGER_CST:
       fprintf (di->stream, "int: ");
-      print_decs (wide_int (t), di->stream);
+      print_decs (t, di->stream);
       break;
 
     case STRING_CST:
index cf210ccd933841fa1116cca003db97b9d44baa91..a6b32b8b8d61f5c7ea5a6405ca9a867f03ef1f1e 100644 (file)
@@ -200,7 +200,7 @@ addr_for_mem_ref (struct mem_address *addr, addr_space_t as,
   struct mem_addr_template *templ;
 
   if (addr->step && !integer_onep (addr->step))
-    st = immed_wide_int_const (wide_int (addr->step), pointer_mode);
+    st = immed_wide_int_const (addr->step, pointer_mode);
   else
     st = NULL_RTX;
 
index 3c6a233ed6b6291910067900828459a776c58c0a..247e83a5dcabec32721aefcb0054611efa3d390a 100644 (file)
@@ -890,8 +890,7 @@ ccp_finalize (void)
        }
       else
        {
-         widest_int nonzero_bits = val->mask;
-         nonzero_bits = nonzero_bits | wi::to_widest (val->value);
+         widest_int nonzero_bits = val->mask | wi::to_widest (val->value);
          nonzero_bits &= get_nonzero_bits (name);
          set_nonzero_bits (name, nonzero_bits);
        }
index 5721861331a6a5e9251b87bef787f71cf0ce897b..48b096cb27770ba7770f4d4f3de4671d1341ba2d 100644 (file)
@@ -2785,7 +2785,7 @@ associate_pointerplus (gimple_stmt_iterator *gsi)
   if (gimple_assign_rhs1 (def_stmt) != ptr)
     return false;
 
-  algn = wide_int_to_tree (TREE_TYPE (ptr), ~wide_int (algn));
+  algn = wide_int_to_tree (TREE_TYPE (ptr), wi::bit_not (algn));
   gimple_assign_set_rhs_with_ops (gsi, BIT_AND_EXPR, ptr, algn);
   fold_stmt_inplace (gsi);
   update_stmt (stmt);
index 3454140f67c641b101706ae6418cf2d92bb231f3..e66970b510394d32288fc7837733f7048e6d1004 100644 (file)
@@ -2028,16 +2028,12 @@ ranges_from_anti_range (value_range_t *ar,
     {
       vr0->type = VR_RANGE;
       vr0->min = vrp_val_min (type);
-      vr0->max
-       = wide_int_to_tree (type,
-                           wide_int (ar->min) - 1);
+      vr0->max = wide_int_to_tree (type, wi::sub (ar->min, 1));
     }
   if (!vrp_val_is_max (ar->max))
     {
       vr1->type = VR_RANGE;
-      vr1->min
-       = wide_int_to_tree (type,
-                           wide_int (ar->max) + 1);
+      vr1->min = wide_int_to_tree (type, wi::add (ar->max, 1));
       vr1->max = vrp_val_max (type);
     }
   if (vr0->type == VR_UNDEFINED)
@@ -2411,9 +2407,9 @@ extract_range_from_binary_expr_1 (value_range_t *vr,
          if (!TYPE_OVERFLOW_WRAPS (expr_type))
            {
              if (vrp_val_min (expr_type))
-               type_min = wide_int (vrp_val_min (expr_type));
+               type_min = vrp_val_min (expr_type);
              if (vrp_val_max (expr_type))
-               type_max = wide_int (vrp_val_max (expr_type));
+               type_max = vrp_val_max (expr_type);
            }
 
          /* Check for type overflow.  */
@@ -4977,14 +4973,14 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
              wide_int minval
                = wi::min_value (prec, TYPE_SIGN (TREE_TYPE (val)));
              new_val = val2;
-             if (minval == wide_int (new_val))
+             if (minval == new_val)
                new_val = NULL_TREE;
            }
          else
            {
              wide_int maxval
                = wi::max_value (prec, TYPE_SIGN (TREE_TYPE (val)));
-             mask |= wide_int (val2);
+             mask |= val2;
              if (mask == maxval)
                new_val = NULL_TREE;
              else