]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cuintp.c (UI_From_gnu): Use tree_to_shwi rather than tree_low_cst.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 18 Nov 2013 14:52:29 +0000 (14:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 18 Nov 2013 14:52:29 +0000 (14:52 +0000)
gcc/ada/
* gcc-interface/cuintp.c (UI_From_gnu): Use tree_to_shwi rather than
tree_low_cst.

gcc/c-family/
* c-common.c (fold_offsetof_1): Use tree_to_uhwi rather than
tree_low_cst.
(complete_array_type): Update comment to refer to tree_to_[su]hwi
rather than tree_low_cst.

gcc/c/
* c-decl.c (grokdeclarator): Update comment to refer to
tree_to_[su]hwi rather than tree_low_cst.

gcc/cp/
* decl.c (reshape_init_array_1): Use tree_to_uhwi rather than
tree_low_cst.
(grokdeclarator): Update comment to refer to tree_to_[su]hwi rather
than tree_low_cst.

gcc/
* expr.h: Update comments to refer to tree_to_[su]hwi rather
than tree_low_cst.
* fold-const.c (fold_binary_loc): Likewise.
* expr.c (store_constructor): Use tree_to_uhwi rather than
tree_low_cst.
* ipa-utils.h (possible_polymorphic_call_target_p): Likewise.
* stmt.c (emit_case_dispatch_table): Likewise.
* tree-switch-conversion.c (emit_case_bit_tests): Likewise.

From-SVN: r204962

15 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/cuintp.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/expr.c
gcc/expr.h
gcc/fold-const.c
gcc/ipa-utils.h
gcc/stmt.c
gcc/tree-switch-conversion.c

index e9350e4c9732bb76bd75a17fe5a540e35a8291c6..2c404891053accec2ba7a5c4ff0c9711f6c1d79e 100644 (file)
@@ -1,3 +1,14 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * expr.h: Update comments to refer to tree_to_[su]hwi rather
+       than tree_low_cst.
+       * fold-const.c (fold_binary_loc): Likewise.
+       * expr.c (store_constructor): Use tree_to_uhwi rather than
+       tree_low_cst.
+       * ipa-utils.h (possible_polymorphic_call_target_p): Likewise.
+       * stmt.c (emit_case_dispatch_table): Likewise.
+       * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c,
index 3f1bcfb43e19a5a94fa083e4272a5084bcce7ce7..a9fd65b16cd749a30ad0d8de022fcbbaf5f3e130 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * gcc-interface/cuintp.c (UI_From_gnu): Use tree_to_shwi rather than
+       tree_low_cst.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c:
index dee53164442958e0f96b4761d37aacc55a365f43..473140daa2b4d449bcb29d3ab227fd12e1ffa060 100644 (file)
@@ -176,9 +176,9 @@ UI_From_gnu (tree Input)
 
   for (i = Max_For_Dint - 1; i >= 0; i--)
     {
-      v[i] = tree_low_cst (fold_build1 (ABS_EXPR, gnu_type,
+      v[i] = tree_to_shwi (fold_build1 (ABS_EXPR, gnu_type,
                                        fold_build2 (TRUNC_MOD_EXPR, gnu_type,
-                                                    gnu_temp, gnu_base)), 0);
+                                                    gnu_temp, gnu_base)));
       gnu_temp = fold_build2 (TRUNC_DIV_EXPR, gnu_type, gnu_temp, gnu_base);
     }
 
index 3900b4de47bf8350f46d95dd652d39748cc20a71..8aac23c700a718ed93d256242cafdbd79467da39 100644 (file)
@@ -1,3 +1,10 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * c-common.c (fold_offsetof_1): Use tree_to_uhwi rather than
+       tree_low_cst.
+       (complete_array_type): Update comment to refer to tree_to_[su]hwi
+       rather than tree_low_cst.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with
index 7761494cbaac27ac4bf63b307d7aabb0f9f2d9e1..fb8295dfdc539ede331adc4bc0c0f2544bfe717e 100644 (file)
@@ -9721,8 +9721,7 @@ fold_offsetof_1 (tree expr)
          return error_mark_node;
        }
       off = size_binop_loc (input_location, PLUS_EXPR, DECL_FIELD_OFFSET (t),
-                           size_int (tree_low_cst (DECL_FIELD_BIT_OFFSET (t),
-                                                   1)
+                           size_int (tree_to_uhwi (DECL_FIELD_BIT_OFFSET (t))
                                      / BITS_PER_UNIT));
       break;
 
@@ -10091,7 +10090,7 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
     {
       error ("size of array is too large");
       /* If we proceed with the array type as it is, we'll eventually
-        crash in tree_low_cst().  */
+        crash in tree_to_[su]hwi().  */
       type = error_mark_node;
     }
 
index 65b40eec5ef1e759f29114d0abcced9d8bba4018..e8a5365592d2f0893efff6a8f2cfb4fe4f74c3c6 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * c-decl.c (grokdeclarator): Update comment to refer to
+       tree_to_[su]hwi rather than tree_low_cst.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
index 1f9c286708c6ebacc09c63dabaa2a3e9cd30a3c8..10933e80d1a13463ddc1fe63c4d4b157287d7444 100644 (file)
@@ -5912,7 +5912,7 @@ grokdeclarator (const struct c_declarator *declarator,
       else
        error_at (loc, "size of unnamed array is too large");
       /* If we proceed with the array type as it is, we'll eventually
-        crash in tree_low_cst().  */
+        crash in tree_to_[su]hwi().  */
       type = error_mark_node;
     }
 
index e2705f9108e979d72ecd6e8c02009b2a8c4124ff..2906ed7a63ac9bc1e8743081e6e55a00ed8c0d93 100644 (file)
@@ -1,3 +1,10 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * decl.c (reshape_init_array_1): Use tree_to_uhwi rather than
+       tree_low_cst.
+       (grokdeclarator): Update comment to refer to tree_to_[su]hwi rather
+       than tree_low_cst.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with
index 1a1581e24c927e627a3a96c6472e3b37dab8562b..e2aad9d54b35d4ce28fe493db78136d6df685b48 100644 (file)
@@ -5097,8 +5097,7 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d,
        max_index_cst = tree_to_uhwi (max_index);
       /* sizetype is sign extended, not zero extended.  */
       else
-       max_index_cst = tree_low_cst (fold_convert (size_type_node, max_index),
-                                     1);
+       max_index_cst = tree_to_uhwi (fold_convert (size_type_node, max_index));
     }
 
   /* Loop until there are no more initializers.  */
@@ -10033,7 +10032,7 @@ grokdeclarator (const cp_declarator *declarator,
     {
       error ("size of array %qs is too large", name);
       /* If we proceed with the array type as it is, we'll eventually
-        crash in tree_low_cst().  */
+        crash in tree_to_[su]hwi().  */
       type = error_mark_node;
     }
 
index 4ce87119c2d2950e9978ed47f6b134f63c839bda..f4d03ab80267ee666ff8f2a370f7e78efc2b06b2 100644 (file)
@@ -6302,10 +6302,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
 
            FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)
              {
-               int n_elts_here = tree_low_cst
+               int n_elts_here = tree_to_uhwi
                  (int_const_binop (TRUNC_DIV_EXPR,
                                    TYPE_SIZE (TREE_TYPE (value)),
-                                   TYPE_SIZE (elttype)), 1);
+                                   TYPE_SIZE (elttype)));
 
                count += n_elts_here;
                if (mostly_zeros_p (value))
index fd7a1d48dec619e46839f966dd586de58edba168..8230fd54bb13346795dbe63ff47d4e5035c339a7 100644 (file)
@@ -26,8 +26,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "rtl.h"
 /* For optimize_size */
 #include "flags.h"
-/* For tree_fits_[su]hwi_p, tree_low_cst, fold_convert, size_binop, ssize_int,
-   TREE_CODE, TYPE_SIZE, int_size_in_bytes,    */
+/* For tree_fits_[su]hwi_p, tree_to_[su]hwi, fold_convert, size_binop,
+   ssize_int, TREE_CODE, TYPE_SIZE, int_size_in_bytes,    */
 #include "tree-core.h"
 /* For GET_MODE_BITSIZE, word_mode */
 #include "machmode.h"
index f4997ba8330f2c7db3ec34f3ffc1fc893cef809d..22f64b3e48f1ba1d43569572d7c2966c559838ca 100644 (file)
@@ -11904,7 +11904,7 @@ fold_binary_loc (location_t loc,
                    if (TREE_CODE (TREE_OPERAND (pmop[which], 1))
                        != INTEGER_CST)
                      break;
-                   /* tree_low_cst not used, because we don't care about
+                   /* tree_to_[su]hwi not used, because we don't care about
                       the upper bits.  */
                    cst0 = TREE_INT_CST_LOW (TREE_OPERAND (pmop[which], 1));
                    cst0 &= cst1;
index cc72619348e9d899c81285881754d9d77b316642..ca8b87290b5d58b2d61679003295905c9d0138fa 100644 (file)
@@ -117,8 +117,8 @@ possible_polymorphic_call_target_p (tree call,
                                    struct cgraph_node *n)
 {
   return possible_polymorphic_call_target_p (obj_type_ref_class (call),
-                                            tree_low_cst
-                                               (OBJ_TYPE_REF_TOKEN (call), 1),
+                                            tree_to_uhwi
+                                               (OBJ_TYPE_REF_TOKEN (call)),
                                             n);
 }
 #endif  /* GCC_IPA_UTILS_H  */
index 04d9586697b5970bf6a543fb1f436a8d61e56930..28fbf7a6bc11c5359bbecf5f2c1357359a45e4c8 100644 (file)
@@ -1029,11 +1029,11 @@ emit_case_dispatch_table (tree index_expr, tree index_type,
         value since that should fit in a HOST_WIDE_INT while the
         actual values may not.  */
       HOST_WIDE_INT i_low
-       = tree_low_cst (fold_build2 (MINUS_EXPR, index_type,
-                                    n->low, minval), 1);
+       = tree_to_uhwi (fold_build2 (MINUS_EXPR, index_type,
+                                    n->low, minval));
       HOST_WIDE_INT i_high
-       = tree_low_cst (fold_build2 (MINUS_EXPR, index_type,
-                                    n->high, minval), 1);
+       = tree_to_uhwi (fold_build2 (MINUS_EXPR, index_type,
+                                    n->high, minval));
       HOST_WIDE_INT i;
 
       for (i = i_low; i <= i_high; i ++)
index 40e50671a6d67b148d7b1c63de49db34f782cc8a..a4340a49a8b7f1eeb98b720db27f0017f9dbc2e0 100644 (file)
@@ -354,15 +354,13 @@ emit_case_bit_tests (gimple swtch, tree index_expr,
       else
         test[k].bits++;
 
-      lo = tree_low_cst (int_const_binop (MINUS_EXPR,
-                                         CASE_LOW (cs), minval),
-                        1);
+      lo = tree_to_uhwi (int_const_binop (MINUS_EXPR,
+                                         CASE_LOW (cs), minval));
       if (CASE_HIGH (cs) == NULL_TREE)
        hi = lo;
       else
-       hi = tree_low_cst (int_const_binop (MINUS_EXPR, 
-                                           CASE_HIGH (cs), minval),
-                          1);
+       hi = tree_to_uhwi (int_const_binop (MINUS_EXPR,
+                                           CASE_HIGH (cs), minval));
 
       for (j = lo; j <= hi; j++)
         if (j >= HOST_BITS_PER_WIDE_INT)