]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c, [...]: Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 18 Nov 2013 14:52:03 +0000 (14:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 18 Nov 2013 14:52:03 +0000 (14:52 +0000)
gcc/c-family/
* c-common.c, c-format.c, c-omp.c, c-pretty-print.c: Replace
tree_low_cst (..., 0) with tree_to_shwi throughout.

gcc/c/
* c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
throughout.

gcc/cp/
* class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c:
Replace tree_low_cst (..., 0) with tree_to_shwi throughout.

gcc/go/
* gofrontend/expressions.cc: Replace tree_low_cst (..., 0) with
tree_to_shwi throughout.

gcc/java/
* class.c, expr.c: Replace tree_low_cst (..., 0) with tree_to_shwi
throughout.

gcc/objc/
* objc-next-runtime-abi-02.c: Replace tree_low_cst (..., 0) with
tree_to_shwi throughout.

gcc/
* builtins.c, cilk-common.c, config/aarch64/aarch64.c,
config/alpha/alpha.c, config/arm/arm.c, config/c6x/predicates.md,
config/i386/i386.c, config/ia64/predicates.md, config/s390/s390.c,
coverage.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c, expr.h,
fold-const.c, gimple-fold.c, godump.c, ipa-prop.c, omp-low.c,
predict.c, rtlanal.c, sdbout.c, stmt.c, stor-layout.c, targhooks.c,
tree-cfg.c, tree-data-ref.c, tree-inline.c, tree-ssa-forwprop.c,
tree-ssa-loop-prefetch.c, tree-ssa-phiopt.c, tree-ssa-sccvn.c,
tree-ssa-strlen.c, tree-stdarg.c, tree-vect-data-refs.c,
tree-vect-patterns.c, tree.c, tree.h, var-tracking.c, varasm.c:
Replace tree_low_cst (..., 0) with tree_to_shwi throughout.

From-SVN: r204959

65 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-format.c
gcc/c-family/c-omp.c
gcc/c-family/c-pretty-print.c
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cilk-common.c
gcc/config/aarch64/aarch64.c
gcc/config/alpha/alpha.c
gcc/config/arm/arm.c
gcc/config/c6x/predicates.md
gcc/config/i386/i386.c
gcc/config/ia64/predicates.md
gcc/config/s390/s390.c
gcc/coverage.c
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/dump.c
gcc/cp/error.c
gcc/cp/init.c
gcc/cp/method.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/dbxout.c
gcc/dwarf2out.c
gcc/except.c
gcc/explow.c
gcc/expr.c
gcc/expr.h
gcc/fold-const.c
gcc/gimple-fold.c
gcc/go/ChangeLog
gcc/go/gofrontend/expressions.cc
gcc/godump.c
gcc/ipa-prop.c
gcc/java/ChangeLog
gcc/java/class.c
gcc/java/expr.c
gcc/objc/ChangeLog
gcc/objc/objc-next-runtime-abi-02.c
gcc/omp-low.c
gcc/predict.c
gcc/rtlanal.c
gcc/sdbout.c
gcc/stmt.c
gcc/stor-layout.c
gcc/targhooks.c
gcc/tree-cfg.c
gcc/tree-data-ref.c
gcc/tree-inline.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-loop-prefetch.c
gcc/tree-ssa-phiopt.c
gcc/tree-ssa-sccvn.c
gcc/tree-ssa-strlen.c
gcc/tree-stdarg.c
gcc/tree-vect-data-refs.c
gcc/tree-vect-patterns.c
gcc/tree.c
gcc/tree.h
gcc/var-tracking.c
gcc/varasm.c

index 276c1cbe66bf20b22a7769bad691e6e6090f814b..3ee623c70fea6f0ee549cb1e3c6ce4983a6cb20e 100644 (file)
@@ -1,3 +1,17 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * builtins.c, cilk-common.c, config/aarch64/aarch64.c,
+       config/alpha/alpha.c, config/arm/arm.c, config/c6x/predicates.md,
+       config/i386/i386.c, config/ia64/predicates.md, config/s390/s390.c,
+       coverage.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c, expr.h,
+       fold-const.c, gimple-fold.c, godump.c, ipa-prop.c, omp-low.c,
+       predict.c, rtlanal.c, sdbout.c, stmt.c, stor-layout.c, targhooks.c,
+       tree-cfg.c, tree-data-ref.c, tree-inline.c, tree-ssa-forwprop.c,
+       tree-ssa-loop-prefetch.c, tree-ssa-phiopt.c, tree-ssa-sccvn.c,
+       tree-ssa-strlen.c, tree-stdarg.c, tree-vect-data-refs.c,
+       tree-vect-patterns.c, tree.c, tree.h, var-tracking.c, varasm.c:
+       Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * tree.h (tree_to_shwi, tree_to_uhwi): Declare, with inline expansions.
index 32812002502fb90da721b956f2bde91e4eff7ada..a50cfc6ddff7a43aa059474129846a4ec6021bcc 100644 (file)
@@ -620,7 +620,7 @@ c_strlen (tree src, int only_value)
   else if (! tree_fits_shwi_p (offset_node))
     offset = -1;
   else
-    offset = tree_low_cst (offset_node, 0);
+    offset = tree_to_shwi (offset_node);
 
   /* If the offset is known to be out of bounds, warn, and call strlen at
      runtime.  */
@@ -5288,7 +5288,7 @@ expand_builtin_atomic_compare_exchange (enum machine_mode mode, tree exp,
 
   weak = CALL_EXPR_ARG (exp, 3);
   is_weak = false;
-  if (tree_fits_shwi_p (weak) && tree_low_cst (weak, 0) != 0)
+  if (tree_fits_shwi_p (weak) && tree_to_shwi (weak) != 0)
     is_weak = true;
 
   oldval = expect;
@@ -9855,7 +9855,7 @@ fold_builtin_load_exponent (location_t loc, tree arg0, tree arg1,
                 - REAL_MODE_FORMAT (TYPE_MODE (type))->emin);
 
          /* Get the user-requested adjustment.  */
-         const HOST_WIDE_INT req_exp_adj = tree_low_cst (arg1, 0);
+         const HOST_WIDE_INT req_exp_adj = tree_to_shwi (arg1);
 
          /* The requested adjustment must be inside this range.  This
             is a preliminary cap to avoid things like overflow, we
@@ -12366,7 +12366,7 @@ expand_builtin_object_size (tree exp)
       return const0_rtx;
     }
 
-  object_size_type = tree_low_cst (ost, 0);
+  object_size_type = tree_to_shwi (ost);
 
   return object_size_type < 2 ? constm1_rtx : const0_rtx;
 }
@@ -12660,7 +12660,7 @@ fold_builtin_object_size (tree ptr, tree ost)
       || compare_tree_int (ost, 3) > 0)
     return NULL_TREE;
 
-  object_size_type = tree_low_cst (ost, 0);
+  object_size_type = tree_to_shwi (ost);
 
   /* __builtin_object_size doesn't evaluate side-effects in its arguments;
      if there are any side-effects, it returns (size_t) -1 for types 0 and 1
@@ -13844,7 +13844,7 @@ do_mpfr_bessel_n (tree arg1, tree arg2, tree type,
       && tree_fits_shwi_p (arg1)
       && TREE_CODE (arg2) == REAL_CST && !TREE_OVERFLOW (arg2))
     {
-      const HOST_WIDE_INT n = tree_low_cst (arg1, 0);
+      const HOST_WIDE_INT n = tree_to_shwi (arg1);
       const REAL_VALUE_TYPE *const ra = &TREE_REAL_CST (arg2);
 
       if (n == (long)n
index 2f7d02f52b9a0d6a26080dbf47f284f62ec8d41c..6a5c401461b13f1dbd0c02444308ed84a508b46c 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * c-common.c, c-format.c, c-omp.c, c-pretty-print.c: Replace
+       tree_low_cst (..., 0) with tree_to_shwi throughout.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * c-ada-spec.c, c-common.c, c-pretty-print.c: Replace
index 3ffefec9a2acf896b9d56460ad5255285f534455..b3995bef7b590c16b6701f6d7904f93a3c43cec6 100644 (file)
@@ -7003,7 +7003,7 @@ get_priority (tree args, bool is_destructor)
       || !INTEGRAL_TYPE_P (TREE_TYPE (arg)))
     goto invalid;
 
-  pri = tree_low_cst (arg, /*pos=*/0);
+  pri = tree_to_shwi (arg);
   if (pri < 0 || pri > MAX_INIT_PRIORITY)
     goto invalid;
 
@@ -11254,13 +11254,13 @@ warn_for_sign_compare (location_t location,
             {
               primop = op1;
               unsignedp = unsignedp1;
-              constant = tree_low_cst (op0, 0);
+              constant = tree_to_shwi (op0);
             }
           else
             {
               primop = op0;
               unsignedp = unsignedp0;
-              constant = tree_low_cst (op1, 0);
+              constant = tree_to_shwi (op1);
             }
 
           bits = TYPE_PRECISION (TREE_TYPE (primop));
index d0c07e4135421e2839b4c97894a53554e38d0d24..b3e1e399353262c137471217170216728dd9e5e3 100644 (file)
@@ -1460,7 +1460,7 @@ check_format_arg (void *ctx, tree format_tree,
          return;
        }
       if (!tree_fits_shwi_p (arg1)
-         || (offset = tree_low_cst (arg1, 0)) < 0)
+         || (offset = tree_to_shwi (arg1)) < 0)
        {
          res->number_non_literal++;
          return;
@@ -1507,7 +1507,7 @@ check_format_arg (void *ctx, tree format_tree,
     }
   if (TREE_CODE (format_tree) == ARRAY_REF
       && tree_fits_shwi_p (TREE_OPERAND (format_tree, 1))
-      && (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0)
+      && (offset += tree_to_shwi (TREE_OPERAND (format_tree, 1))) >= 0)
     format_tree = TREE_OPERAND (format_tree, 0);
   if (TREE_CODE (format_tree) == VAR_DECL
       && TREE_CODE (TREE_TYPE (format_tree)) == ARRAY_TYPE
index 921b40628c364fb153936357f4a35b50e74e8518..3ccf8f915215c0b6c87c3cf2d1bf949aae5a81bc 100644 (file)
@@ -921,8 +921,8 @@ c_omp_declare_simd_clause_cmp (const void *p, const void *q)
       && OMP_CLAUSE_CODE (a) != OMP_CLAUSE_INBRANCH
       && OMP_CLAUSE_CODE (a) != OMP_CLAUSE_NOTINBRANCH)
     {
-      int c = tree_low_cst (OMP_CLAUSE_DECL (a), 0);
-      int d = tree_low_cst (OMP_CLAUSE_DECL (b), 0);
+      int c = tree_to_shwi (OMP_CLAUSE_DECL (a));
+      int d = tree_to_shwi (OMP_CLAUSE_DECL (b));
       if (c < d)
        return 1;
       if (c > d)
@@ -987,7 +987,7 @@ c_omp_declare_simd_clauses_to_decls (tree fndecl, tree clauses)
        && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_INBRANCH
        && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_NOTINBRANCH)
       {
-       int idx = tree_low_cst (OMP_CLAUSE_DECL (c), 0), i;
+       int idx = tree_to_shwi (OMP_CLAUSE_DECL (c)), i;
        tree arg;
        for (arg = DECL_ARGUMENTS (fndecl), i = 0; arg;
             arg = TREE_CHAIN (arg), i++)
index 5f538c559f901d189d972431e4e4f6657484f738..7898f13172c9c8eee4390adf627f6e465fde8cd3 100644 (file)
@@ -587,7 +587,7 @@ c_pretty_printer::direct_abstract_declarator (tree t)
          tree type = TREE_TYPE (maxval);
 
          if (tree_fits_shwi_p (maxval))
-           pp_wide_integer (this, tree_low_cst (maxval, 0) + 1);
+           pp_wide_integer (this, tree_to_shwi (maxval) + 1);
          else
            expression (fold_build2 (PLUS_EXPR, type, maxval,
                                      build_int_cst (type, 1)));
@@ -1599,8 +1599,8 @@ c_pretty_printer::postfix_expression (tree e)
        if (type
            && tree_int_cst_equal (TYPE_SIZE (type), TREE_OPERAND (e, 1)))
          {
-           HOST_WIDE_INT bitpos = tree_low_cst (TREE_OPERAND (e, 2), 0);
-           HOST_WIDE_INT size = tree_low_cst (TYPE_SIZE (type), 0);
+           HOST_WIDE_INT bitpos = tree_to_shwi (TREE_OPERAND (e, 2));
+           HOST_WIDE_INT size = tree_to_shwi (TYPE_SIZE (type));
            if ((bitpos % size) == 0)
              {
                pp_c_left_paren (this);
index b2035dfb4746172c8a47c7e875258f69d3ef62ca..dd01c639f7f913482cc05456d1f7fd70845ee55a 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
+       throughout.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
index 58b2ffc0a52bc455f0cc10909fdbaacb566c46e7..74eb13a3f7e0e15b9c64bc7afecfe6437ec1de78 100644 (file)
@@ -9737,7 +9737,7 @@ c_parser_omp_clause_collapse (c_parser *parser, tree list)
   num = c_fully_fold (num, false, NULL);
   if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
       || !tree_fits_shwi_p (num)
-      || (n = tree_low_cst (num, 0)) <= 0
+      || (n = tree_to_shwi (num)) <= 0
       || (int) n != n)
     {
       error_at (loc,
@@ -11463,7 +11463,7 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code,
 
   for (cl = clauses; cl; cl = OMP_CLAUSE_CHAIN (cl))
     if (OMP_CLAUSE_CODE (cl) == OMP_CLAUSE_COLLAPSE)
-      collapse = tree_low_cst (OMP_CLAUSE_COLLAPSE_EXPR (cl), 0);
+      collapse = tree_to_shwi (OMP_CLAUSE_COLLAPSE_EXPR (cl));
 
   gcc_assert (collapse >= 1);
 
index 8e070a3a32dd18fbc6579eea7b2e324d984c653e..98b85988764eb7a2dc6d9389a6040ddc60343a65 100644 (file)
@@ -340,8 +340,8 @@ expand_builtin_cilk_detach (tree exp)
      WORKER.TAIL <- TMP   */
 
   HOST_WIDE_INT worker_tail_offset =
-    tree_low_cst (DECL_FIELD_OFFSET (cilk_trees[CILK_TI_WORKER_TAIL]), 0) +
-    tree_low_cst (DECL_FIELD_BIT_OFFSET (cilk_trees[CILK_TI_WORKER_TAIL]), 0) /
+    tree_to_shwi (DECL_FIELD_OFFSET (cilk_trees[CILK_TI_WORKER_TAIL])) +
+    tree_to_shwi (DECL_FIELD_BIT_OFFSET (cilk_trees[CILK_TI_WORKER_TAIL])) /
     BITS_PER_UNIT;
   rtx tmem0 = gen_rtx_MEM (Pmode,
                           plus_constant (Pmode, wreg, worker_tail_offset));
index 290ed6c851a292a89b23624e9b29a1eb3686ac90..6116986e8254b33f908ce2f883d3ce9099bcd287 100644 (file)
@@ -6863,7 +6863,7 @@ aarch64_simd_attr_length_move (rtx insn)
 static HOST_WIDE_INT
 aarch64_simd_vector_alignment (const_tree type)
 {
-  HOST_WIDE_INT align = tree_low_cst (TYPE_SIZE (type), 0);
+  HOST_WIDE_INT align = tree_to_shwi (TYPE_SIZE (type));
   return MIN (align, 128);
 }
 
index 855be32d1035f22b79a24c6ff611a87db25231d4..e710b0c3717221c17ee0a6bd35f439585837a0a1 100644 (file)
@@ -5989,7 +5989,7 @@ alpha_stdarg_optimize_hook (struct stdarg_info *si, const_gimple stmt)
          if (!tree_fits_shwi_p (gimple_assign_rhs2 (arg2_stmt)))
            goto escapes;
 
-         sub = tree_low_cst (gimple_assign_rhs2 (arg2_stmt), 0);
+         sub = tree_to_shwi (gimple_assign_rhs2 (arg2_stmt));
          if (code2 == MINUS_EXPR)
            sub = -sub;
          if (sub < -48 || sub > -32)
index 4d8a39f2e0760ce9021058dd260b78806c11cbf4..6e9faedd8f00c1c70acd96c03946e65bcc979183 100644 (file)
@@ -28807,7 +28807,7 @@ arm_builtin_vectorized_function (tree fndecl, tree type_out, tree type_in)
 static HOST_WIDE_INT
 arm_vector_alignment (const_tree type)
 {
-  HOST_WIDE_INT align = tree_low_cst (TYPE_SIZE (type), 0);
+  HOST_WIDE_INT align = tree_to_shwi (TYPE_SIZE (type));
 
   if (TARGET_AAPCS_BASED)
     align = MIN (align, 64);
index 94d9389de53f4b82b037b44266bc48b054a4d234..fbcbdd02457f8857669cd4b896565c4ffb05a6d2 100644 (file)
        t = TYPE_SIZE_UNIT (TREE_TYPE (t));
       if (t && tree_fits_shwi_p (t))
        {
-         size = tree_low_cst (t, 0);
+         size = tree_to_shwi (t);
          if (size < 0)
            size = 0;
        }
index 96cf77025fa0be67213a105bf3c89fb5fc27f9ea..4937b35b6936b0b538b214df593fc457f86dd0e2 100644 (file)
@@ -6270,7 +6270,7 @@ classify_argument (enum machine_mode mode, const_tree type,
                      for (i = (int_bit_position (field)
                                + (bit_offset % 64)) / 8 / 8;
                           i < ((int_bit_position (field) + (bit_offset % 64))
-                               + tree_low_cst (DECL_SIZE (field), 0)
+                               + tree_to_shwi (DECL_SIZE (field))
                                + 63) / 8 / 8; i++)
                        classes[i] =
                          merge_classes (X86_64_INTEGER_CLASS,
index 476e06df796de2b4a5a5359a5b34b67ae9edfaf0..31530be906d0e9dc2b88226f2e3d7ec8750601b6 100644 (file)
@@ -74,7 +74,7 @@
            t = TYPE_SIZE_UNIT (TREE_TYPE (t));
          if (t && tree_fits_shwi_p (t))
            {
-             size = tree_low_cst (t, 0);
+             size = tree_to_shwi (t);
              if (size < 0)
                size = 0;
            }
index 58fab9e5ca9e59c36db71d0f668adaa1e7e408c2..39453038fe7d430d0ec15635760632d1fc69ef58 100644 (file)
@@ -10195,7 +10195,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
          || !DECL_ALIGN (decl)
          || !tree_fits_shwi_p (DECL_SIZE (decl))
          || (DECL_ALIGN (decl) <= 64
-             && DECL_ALIGN (decl) != tree_low_cst (DECL_SIZE (decl), 0)))
+             && DECL_ALIGN (decl) != tree_to_shwi (DECL_SIZE (decl))))
        SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
     }
 
index 9b0fc8b3d1437c81d76bfaa5422a70d3196ea1bc..43f9c0cb6f13fa11022b10292ca6e85bfd149061 100644 (file)
@@ -830,7 +830,7 @@ build_fn_info (const struct coverage_data *data, tree type, tree key)
 
        if (var)
          count
-           = tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (var))), 0)
+           = tree_to_shwi (TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (var))))
            + 1;
 
        CONSTRUCTOR_APPEND_ELT (ctr, TYPE_FIELDS (ctr_type),
index e7a2014a9f9ab0bb3e4fe2ca95415a9f251badb8..c15f42ce10ecb5c571bfa561a548c6b13448d498 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c:
+       Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
index 1df16d4ef8c6c436fc813425beae0febebeaffc5..4fc65da2e3bcf60ceed147cc3f433edd65095904 100644 (file)
@@ -8041,7 +8041,7 @@ dump_class_hierarchy_r (FILE *stream,
   igo = TREE_CHAIN (binfo);
 
   fprintf (stream, HOST_WIDE_INT_PRINT_DEC,
-          tree_low_cst (BINFO_OFFSET (binfo), 0));
+          tree_to_shwi (BINFO_OFFSET (binfo)));
   if (is_empty_class (BINFO_TYPE (binfo)))
     fprintf (stream, " empty");
   else if (CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (binfo)))
@@ -8117,10 +8117,10 @@ dump_class_hierarchy_1 (FILE *stream, int flags, tree t)
 {
   fprintf (stream, "Class %s\n", type_as_string (t, TFF_PLAIN_IDENTIFIER));
   fprintf (stream, "   size=%lu align=%lu\n",
-          (unsigned long)(tree_low_cst (TYPE_SIZE (t), 0) / BITS_PER_UNIT),
+          (unsigned long)(tree_to_shwi (TYPE_SIZE (t)) / BITS_PER_UNIT),
           (unsigned long)(TYPE_ALIGN (t) / BITS_PER_UNIT));
   fprintf (stream, "   base size=%lu base align=%lu\n",
-          (unsigned long)(tree_low_cst (TYPE_SIZE (CLASSTYPE_AS_BASE (t)), 0)
+          (unsigned long)(tree_to_shwi (TYPE_SIZE (CLASSTYPE_AS_BASE (t)))
                           / BITS_PER_UNIT),
           (unsigned long)(TYPE_ALIGN (CLASSTYPE_AS_BASE (t))
                           / BITS_PER_UNIT));
@@ -8157,7 +8157,7 @@ dump_array (FILE * stream, tree decl)
   HOST_WIDE_INT elt;
   tree size = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (decl)));
 
-  elt = (tree_low_cst (TYPE_SIZE (TREE_TYPE (TREE_TYPE (decl))), 0)
+  elt = (tree_to_shwi (TYPE_SIZE (TREE_TYPE (TREE_TYPE (decl))))
         / BITS_PER_UNIT);
   fprintf (stream, "%s:", decl_as_string (decl, TFF_PLAIN_IDENTIFIER));
   fprintf (stream, " %s entries",
@@ -8246,10 +8246,10 @@ dump_thunk (FILE *stream, int indent, tree thunk)
        /*NOP*/;
       else if (DECL_THIS_THUNK_P (thunk))
        fprintf (stream, " vcall="  HOST_WIDE_INT_PRINT_DEC,
-                tree_low_cst (virtual_adjust, 0));
+                tree_to_shwi (virtual_adjust));
       else
        fprintf (stream, " vbase=" HOST_WIDE_INT_PRINT_DEC "(%s)",
-                tree_low_cst (BINFO_VPTR_FIELD (virtual_adjust), 0),
+                tree_to_shwi (BINFO_VPTR_FIELD (virtual_adjust)),
                 type_as_string (BINFO_TYPE (virtual_adjust), TFF_SCOPE));
       if (THUNK_ALIAS (thunk))
        fprintf (stream, " alias to %p", (void *)THUNK_ALIAS (thunk));
index 4aa3935a7d2958446ea5e0f4bcd798c15c15c5fb..cc888339af94c10cd8129cfed05cb78fb4fb6d5a 100644 (file)
@@ -346,7 +346,7 @@ cp_dump_tree (void* dump_info, tree t)
            }
          dump_int (di, "fixd", THUNK_FIXED_OFFSET (t));
          if (virt)
-           dump_int (di, "virt", tree_low_cst (virt, 0));
+           dump_int (di, "virt", tree_to_shwi (virt));
          dump_child ("fn", DECL_INITIAL (t));
        }
       break;
index 7f8607710c84cb7e0c4eb4defa41d8f5d9dcd3e8..d5b42e7d013bc7a2f81d6f0ac503aab324eba77e 100644 (file)
@@ -852,7 +852,7 @@ dump_type_suffix (cxx_pretty_printer *pp, tree t, int flags)
          if (integer_all_onesp (max))
            pp_character (pp, '0');
          else if (tree_fits_shwi_p (max))
-           pp_wide_integer (pp, tree_low_cst (max, 0) + 1);
+           pp_wide_integer (pp, tree_to_shwi (max) + 1);
          else
            {
              STRIP_NOPS (max);
@@ -2294,7 +2294,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
              t = TYPE_METHOD_BASETYPE (t);
              virtuals = BINFO_VIRTUALS (TYPE_BINFO (TYPE_MAIN_VARIANT (t)));
 
-             n = tree_low_cst (idx, 0);
+             n = tree_to_shwi (idx);
 
              /* Map vtable index back one, to allow for the null pointer to
                 member.  */
index c37423c4c5d2cdcaf50af3def91ec193d20a771b..7eac6f52d095cf3ba4b968e7cc2c55836614d701 100644 (file)
@@ -3664,7 +3664,7 @@ build_vec_init (tree base, tree maxindex, tree init,
       || ((type_build_ctor_call (type) || init || explicit_value_init_p)
          && ! (tree_fits_shwi_p (maxindex)
                && (num_initialized_elts
-                   == tree_low_cst (maxindex, 0) + 1))))
+                   == tree_to_shwi (maxindex) + 1))))
     {
       /* If the ITERATOR is equal to -1, then we don't have to loop;
         we've already initialized all the elements.  */
index 272ef42217f2317a26b20a1f05ca0eed13e5816c..d15d0a4d6f6d35f0d70a0a5a3ace325d9208a41e 100644 (file)
@@ -95,7 +95,7 @@ make_thunk (tree function, bool this_adjusting,
                    convert (ssizetype,
                             TYPE_SIZE_UNIT (vtable_entry_type)));
 
-  d = tree_low_cst (fixed_offset, 0);
+  d = tree_to_shwi (fixed_offset);
 
   /* See if we already have the thunk in question.  For this_adjusting
      thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it
@@ -323,7 +323,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
     {
       if (!this_adjusting)
        virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
-      virtual_value = tree_low_cst (virtual_offset, /*pos=*/0);
+      virtual_value = tree_to_shwi (virtual_offset);
       gcc_assert (virtual_value);
     }
   else
index 72fbd0243934c9b2eb5be4187890aca66c7a5fea..d37924851ed92fdec93e29eb7f81403aa5c53ee5 100644 (file)
@@ -26963,7 +26963,7 @@ cp_parser_omp_clause_collapse (cp_parser *parser, tree list, location_t location
   num = fold_non_dependent_expr (num);
   if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
       || !tree_fits_shwi_p (num)
-      || (n = tree_low_cst (num, 0)) <= 0
+      || (n = tree_to_shwi (num)) <= 0
       || (int) n != n)
     {
       error_at (loc, "collapse argument needs positive constant integer expression");
@@ -28929,7 +28929,7 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
 
   for (cl = clauses; cl; cl = OMP_CLAUSE_CHAIN (cl))
     if (OMP_CLAUSE_CODE (cl) == OMP_CLAUSE_COLLAPSE)
-      collapse = tree_low_cst (OMP_CLAUSE_COLLAPSE_EXPR (cl), 0);
+      collapse = tree_to_shwi (OMP_CLAUSE_COLLAPSE_EXPR (cl));
 
   gcc_assert (collapse >= 1);
 
index 781d37386c36ed041c0f7d3cb6fd2c86863715f7..dce2b3749fccd2dc8e5dff8f9d76fd972ec1391e 100644 (file)
@@ -8611,7 +8611,7 @@ cxx_eval_array_reference (const constexpr_call *call, tree t,
       *non_constant_p = true;
       return t;
     }
-  i = tree_low_cst (index, 0);
+  i = tree_to_shwi (index);
   if (TREE_CODE (ary) == CONSTRUCTOR)
     return (*CONSTRUCTOR_ELTS (ary))[i].value;
   else if (elem_nchars == 1)
@@ -8726,8 +8726,8 @@ cxx_eval_bit_field_ref (const constexpr_call *call, tree t,
                         TREE_OPERAND (t, 1), TREE_OPERAND (t, 2));
 
   start = TREE_OPERAND (t, 2);
-  istart = tree_low_cst (start, 0);
-  isize = tree_low_cst (TREE_OPERAND (t, 1), 0);
+  istart = tree_to_shwi (start);
+  isize = tree_to_shwi (TREE_OPERAND (t, 1));
   utype = TREE_TYPE (t);
   if (!TYPE_UNSIGNED (utype))
     utype = build_nonstandard_integer_type (TYPE_PRECISION (utype), 1);
@@ -8742,8 +8742,8 @@ cxx_eval_bit_field_ref (const constexpr_call *call, tree t,
          && tree_fits_shwi_p (bitpos)
          && tree_fits_shwi_p (DECL_SIZE (field)))
        {
-         HOST_WIDE_INT bit = tree_low_cst (bitpos, 0);
-         HOST_WIDE_INT sz = tree_low_cst (DECL_SIZE (field), 0);
+         HOST_WIDE_INT bit = tree_to_shwi (bitpos);
+         HOST_WIDE_INT sz = tree_to_shwi (DECL_SIZE (field));
          HOST_WIDE_INT shift;
          if (bit >= istart && bit + sz <= istart + isize)
            {
@@ -8900,7 +8900,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
                     bool *non_constant_p, bool *overflow_p)
 {
   tree elttype = TREE_TYPE (atype);
-  int max = tree_low_cst (array_type_nelts (atype), 0);
+  int max = tree_to_shwi (array_type_nelts (atype));
   vec<constructor_elt, va_gc> *n;
   vec_alloc (n, max + 1);
   bool pre_init = false;
@@ -9119,9 +9119,9 @@ cxx_fold_indirect_ref (location_t loc, tree type, tree op0, bool *empty_base)
              && (same_type_ignoring_top_level_qualifiers_p
                  (type, TREE_TYPE (op00type))))
            {
-             HOST_WIDE_INT offset = tree_low_cst (op01, 0);
+             HOST_WIDE_INT offset = tree_to_shwi (op01);
              tree part_width = TYPE_SIZE (type);
-             unsigned HOST_WIDE_INT part_widthi = tree_low_cst (part_width, 0)/BITS_PER_UNIT;
+             unsigned HOST_WIDE_INT part_widthi = tree_to_shwi (part_width)/BITS_PER_UNIT;
              unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
              tree index = bitsize_int (indexi);
 
index ddeb87bf5061acac725d970621ab5537627fbd71..b56a4689463139493c7c53a129e25f1873b783c1 100644 (file)
@@ -1612,7 +1612,7 @@ dbxout_type_method_1 (tree decl)
 
   if (DECL_VINDEX (decl) && tree_fits_shwi_p (DECL_VINDEX (decl)))
     {
-      stabstr_D (tree_low_cst (DECL_VINDEX (decl), 0));
+      stabstr_D (tree_to_shwi (DECL_VINDEX (decl)));
       stabstr_C (';');
       dbxout_type (DECL_CONTEXT (decl), 0);
       stabstr_C (';');
@@ -1723,7 +1723,7 @@ dbxout_range_type (tree type, tree low, tree high)
       if (print_int_cst_bounds_in_octal_p (type, low, high))
         stabstr_O (low);
       else
-        stabstr_D (tree_low_cst (low, 0));
+        stabstr_D (tree_to_shwi (low));
     }
   else
     stabstr_C ('0');
@@ -1734,7 +1734,7 @@ dbxout_range_type (tree type, tree low, tree high)
       if (print_int_cst_bounds_in_octal_p (type, low, high))
         stabstr_O (high);
       else
-        stabstr_D (tree_low_cst (high, 0));
+        stabstr_D (tree_to_shwi (high));
       stabstr_C (';');
     }
   else
@@ -2210,10 +2210,10 @@ dbxout_type (tree type, int full)
                         offset within the vtable where we must look
                         to find the necessary adjustment.  */
                      stabstr_D
-                       (tree_low_cst (BINFO_VPTR_FIELD (child), 0)
+                       (tree_to_shwi (BINFO_VPTR_FIELD (child))
                         * BITS_PER_UNIT);
                    else
-                     stabstr_D (tree_low_cst (BINFO_OFFSET (child), 0)
+                     stabstr_D (tree_to_shwi (BINFO_OFFSET (child))
                                       * BITS_PER_UNIT);
                    stabstr_C (',');
                    dbxout_type (BINFO_TYPE (child), 0);
@@ -2228,11 +2228,11 @@ dbxout_type (tree type, int full)
                    stabstr_C (':');
                    dbxout_type (BINFO_TYPE (child), full);
                    stabstr_C (',');
-                   stabstr_D (tree_low_cst (BINFO_OFFSET (child), 0)
+                   stabstr_D (tree_to_shwi (BINFO_OFFSET (child))
                                     * BITS_PER_UNIT);
                    stabstr_C (',');
                    stabstr_D
-                     (tree_low_cst (TYPE_SIZE (BINFO_TYPE (child)), 0)
+                     (tree_to_shwi (TYPE_SIZE (BINFO_TYPE (child)))
                       * BITS_PER_UNIT);
                    stabstr_C (';');
                  }
@@ -2518,7 +2518,7 @@ dbxout_expand_expr (tree expr)
          {
            if (!tree_fits_shwi_p (offset))
              return NULL;
-           x = adjust_address_nv (x, mode, tree_low_cst (offset, 0));
+           x = adjust_address_nv (x, mode, tree_to_shwi (offset));
          }
        if (bitpos != 0)
          x = adjust_address_nv (x, mode, bitpos / BITS_PER_UNIT);
index 73b44ada3efd09024d7ac1b87923e985331692bf..f313b2ded1a38513bf1ed7234d8822f7386e593c 100644 (file)
@@ -14253,10 +14253,10 @@ loc_list_from_tree (tree loc, int want_address)
               && tree_fits_shwi_p (loc)
               && (ret = address_of_int_loc_descriptor
                           (int_size_in_bytes (TREE_TYPE (loc)),
-                           tree_low_cst (loc, 0))))
+                           tree_to_shwi (loc))))
        have_address = 1;
       else if (tree_fits_shwi_p (loc))
-       ret = int_loc_descriptor (tree_low_cst (loc, 0));
+       ret = int_loc_descriptor (tree_to_shwi (loc));
       else
        {
          expansion_failed (loc, NULL_RTX,
@@ -14351,7 +14351,7 @@ loc_list_from_tree (tree loc, int want_address)
          if (list_ret == 0)
            return 0;
 
-         loc_list_plus_const (list_ret, tree_low_cst (TREE_OPERAND (loc, 1), 0));
+         loc_list_plus_const (list_ret, tree_to_shwi (TREE_OPERAND (loc, 1)));
          break;
        }
 
@@ -14855,7 +14855,7 @@ add_data_member_location_attribute (dw_die_ref die, tree decl)
          add_loc_descr (&loc_descr, tmp);
 
          /* Calculate the address of the offset.  */
-         offset = tree_low_cst (BINFO_VPTR_FIELD (decl), 0);
+         offset = tree_to_shwi (BINFO_VPTR_FIELD (decl));
          gcc_assert (offset < 0);
 
          tmp = int_loc_descriptor (-offset);
@@ -14872,7 +14872,7 @@ add_data_member_location_attribute (dw_die_ref die, tree decl)
          add_loc_descr (&loc_descr, tmp);
        }
       else
-       offset = tree_low_cst (BINFO_OFFSET (decl), 0);
+       offset = tree_to_shwi (BINFO_OFFSET (decl));
     }
   else
     offset = field_byte_offset (decl);
@@ -15528,7 +15528,7 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
     {
       if (!tree_fits_shwi_p (offset))
        return NULL_TREE;
-      *value = tree_low_cst (offset, 0);
+      *value = tree_to_shwi (offset);
     }
   if (bitpos != 0)
     *value += bitpos / BITS_PER_UNIT;
@@ -15701,7 +15701,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
          if (fieldsize <= 0)
            return false;
 
-         min_index = tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0);
+         min_index = tree_to_shwi (TYPE_MIN_VALUE (TYPE_DOMAIN (type)));
          memset (array, '\0', size);
          FOR_EACH_VEC_SAFE_ELT (CONSTRUCTOR_ELTS (init), cnt, ce)
            {
@@ -15709,10 +15709,10 @@ native_encode_initializer (tree init, unsigned char *array, int size)
              tree index = ce->index;
              int pos = curpos;
              if (index && TREE_CODE (index) == RANGE_EXPR)
-               pos = (tree_low_cst (TREE_OPERAND (index, 0), 0) - min_index)
+               pos = (tree_to_shwi (TREE_OPERAND (index, 0)) - min_index)
                      * fieldsize;
              else if (index)
-               pos = (tree_low_cst (index, 0) - min_index) * fieldsize;
+               pos = (tree_to_shwi (index) - min_index) * fieldsize;
 
              if (val)
                {
@@ -15723,8 +15723,8 @@ native_encode_initializer (tree init, unsigned char *array, int size)
              curpos = pos + fieldsize;
              if (index && TREE_CODE (index) == RANGE_EXPR)
                {
-                 int count = tree_low_cst (TREE_OPERAND (index, 1), 0)
-                             - tree_low_cst (TREE_OPERAND (index, 0), 0);
+                 int count = tree_to_shwi (TREE_OPERAND (index, 1))
+                             - tree_to_shwi (TREE_OPERAND (index, 0));
                  while (count-- > 0)
                    {
                      if (val)
@@ -15770,7 +15770,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
              else if (DECL_SIZE_UNIT (field) == NULL_TREE
                       || !tree_fits_shwi_p (DECL_SIZE_UNIT (field)))
                return false;
-             fieldsize = tree_low_cst (DECL_SIZE_UNIT (field), 0);
+             fieldsize = tree_to_shwi (DECL_SIZE_UNIT (field));
              pos = int_byte_position (field);
              gcc_assert (pos + fieldsize <= size);
              if (val
@@ -16162,7 +16162,7 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
        if (bound_attr == DW_AT_lower_bound
            && tree_fits_shwi_p (bound)
            && (dflt = lower_bound_default ()) != -1
-           && tree_low_cst (bound, 0) == dflt)
+           && tree_to_shwi (bound) == dflt)
          ;
 
        /* Otherwise represent the bound as an unsigned value with the
@@ -16410,7 +16410,7 @@ add_bit_offset_attribute (dw_die_ref die, tree decl)
 
   if (! BYTES_BIG_ENDIAN)
     {
-      highest_order_field_bit_offset += tree_low_cst (DECL_SIZE (decl), 0);
+      highest_order_field_bit_offset += tree_to_shwi (DECL_SIZE (decl));
       highest_order_object_bit_offset += simple_type_size_in_bits (type);
     }
 
@@ -16508,7 +16508,7 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl)
       if (tree_fits_shwi_p (DECL_VINDEX (func_decl)))
        add_AT_loc (die, DW_AT_vtable_elem_location,
                    new_loc_descr (DW_OP_constu,
-                                  tree_low_cst (DECL_VINDEX (func_decl), 0),
+                                  tree_to_shwi (DECL_VINDEX (func_decl)),
                                   0));
 
       /* GNU extension: Record what type this method came from originally.  */
@@ -17056,7 +17056,7 @@ descr_info_loc (tree val, tree base_decl)
       return loc_descriptor_from_tree (val, 0);
     case INTEGER_CST:
       if (tree_fits_shwi_p (val))
-       return int_loc_descriptor (tree_low_cst (val, 0));
+       return int_loc_descriptor (tree_to_shwi (val));
       break;
     case INDIRECT_REF:
       size = int_size_in_bytes (TREE_TYPE (val));
@@ -17079,7 +17079,7 @@ descr_info_loc (tree val, tree base_decl)
          loc = descr_info_loc (TREE_OPERAND (val, 0), base_decl);
          if (!loc)
            break;
-         loc_descr_plus_const (&loc, tree_low_cst (TREE_OPERAND (val, 1), 0));
+         loc_descr_plus_const (&loc, tree_to_shwi (TREE_OPERAND (val, 1)));
        }
       else
        {
@@ -17121,7 +17121,7 @@ add_descr_info_field (dw_die_ref die, enum dwarf_attribute attr,
 
   if (tree_fits_shwi_p (val))
     {
-      add_AT_unsigned (die, attr, tree_low_cst (val, 0));
+      add_AT_unsigned (die, attr, tree_to_shwi (val));
       return;
     }
 
@@ -17174,7 +17174,7 @@ gen_descr_array_type_die (tree type, struct array_descr_info *info,
 
          if (tree_fits_shwi_p (info->dimen[dim].lower_bound)
              && (dflt = lower_bound_default ()) != -1
-             && tree_low_cst (info->dimen[dim].lower_bound, 0) == dflt)
+             && tree_to_shwi (info->dimen[dim].lower_bound) == dflt)
            ;
          else
            add_descr_info_field (subrange_die, DW_AT_lower_bound,
@@ -23114,7 +23114,7 @@ optimize_location_into_implicit_ptr (dw_die_ref die, tree decl)
   if (TREE_CODE (init) == POINTER_PLUS_EXPR
       && tree_fits_shwi_p (TREE_OPERAND (init, 1)))
     {
-      offset = tree_low_cst (TREE_OPERAND (init, 1), 0);
+      offset = tree_to_shwi (TREE_OPERAND (init, 1));
       init = TREE_OPERAND (init, 0);
       STRIP_NOPS (init);
     }
index 63d4024b793dd7778bd2ad6ed7ec62f78af52e6c..a4481d60e6a4258105cfc0e24a11fcfcd3936468 100644 (file)
@@ -2051,7 +2051,7 @@ expand_builtin_eh_common (tree region_nr_t)
   eh_region region;
 
   gcc_assert (tree_fits_shwi_p (region_nr_t));
-  region_nr = tree_low_cst (region_nr_t, 0);
+  region_nr = tree_to_shwi (region_nr_t);
 
   region = (*cfun->eh->region_array)[region_nr];
 
index a9457690c5a7cbfb88bfde0cd591ae5ee8d91ddc..3a78a6513607100ff9d7dfe223e7a01924b095e8 100644 (file)
@@ -285,7 +285,7 @@ int_expr_size (tree exp)
   if (size == 0 || !tree_fits_shwi_p (size))
     return -1;
 
-  return tree_low_cst (size, 0);
+  return tree_to_shwi (size);
 }
 \f
 /* Return a copy of X in which all memory references
index da5c05ea051d7336c20447d464a7686258d1f228..422030b4a0f2cf31202fc4f7afafd2c23554f8b6 100644 (file)
@@ -5925,7 +5925,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
                offset = 0;
              }
            else
-             bitpos = tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0);
+             bitpos = tree_to_shwi (DECL_FIELD_BIT_OFFSET (field));
 
            if (offset)
              {
@@ -6014,8 +6014,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
        /* If we have constant bounds for the range of the type, get them.  */
        if (const_bounds_p)
          {
-           minelt = tree_low_cst (TYPE_MIN_VALUE (domain), 0);
-           maxelt = tree_low_cst (TYPE_MAX_VALUE (domain), 0);
+           minelt = tree_to_shwi (TYPE_MIN_VALUE (domain));
+           maxelt = tree_to_shwi (TYPE_MAX_VALUE (domain));
          }
 
        /* If the constructor has fewer elements than the array, clear
@@ -6120,8 +6120,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
                if (const_bounds_p
                    && tree_fits_shwi_p (lo_index)
                    && tree_fits_shwi_p (hi_index)
-                   && (lo = tree_low_cst (lo_index, 0),
-                       hi = tree_low_cst (hi_index, 0),
+                   && (lo = tree_to_shwi (lo_index),
+                       hi = tree_to_shwi (hi_index),
                        count = hi - lo + 1,
                        (!MEM_P (target)
                         || count <= 2
@@ -6132,7 +6132,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
                    lo -= minelt;  hi -= minelt;
                    for (; lo <= hi; lo++)
                      {
-                       bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
+                       bitpos = lo * tree_to_shwi (TYPE_SIZE (elttype));
 
                        if (MEM_P (target)
                            && !MEM_KEEP_ALIAS_SET_P (target)
@@ -6235,7 +6235,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
            else
              {
                if (index != 0)
-                 bitpos = ((tree_low_cst (index, 0) - minelt)
+                 bitpos = ((tree_to_shwi (index) - minelt)
                            * tree_low_cst (TYPE_SIZE (elttype), 1));
                else
                  bitpos = (i * tree_low_cst (TYPE_SIZE (elttype), 1));
@@ -8551,7 +8551,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
            op0 = copy_to_mode_reg (mode, op0);
 
          return REDUCE_BIT_FIELD (gen_rtx_MULT (mode, op0,
-                              gen_int_mode (tree_low_cst (exp1, 0),
+                              gen_int_mode (tree_to_shwi (exp1),
                                             TYPE_MODE (TREE_TYPE (exp1)))));
        }
 
index a0221f7e894bb0ab188520cdded6cf843b4a15c0..fd7a1d48dec619e46839f966dd586de58edba168 100644 (file)
@@ -95,7 +95,7 @@ struct locate_and_pad_arg_data
 do {                                                           \
   tree inc = (INC);                                            \
   if (tree_fits_shwi_p (inc))                                  \
-    (TO).constant += tree_low_cst (inc, 0);                    \
+    (TO).constant += tree_to_shwi (inc);                       \
   else if ((TO).var == 0)                                      \
     (TO).var = fold_convert (ssizetype, inc);                  \
   else                                                         \
@@ -107,7 +107,7 @@ do {                                                                \
 do {                                                           \
   tree dec = (DEC);                                            \
   if (tree_fits_shwi_p (dec))                                  \
-    (TO).constant -= tree_low_cst (dec, 0);                    \
+    (TO).constant -= tree_to_shwi (dec);                       \
   else if ((TO).var == 0)                                      \
     (TO).var = size_binop (MINUS_EXPR, ssize_int (0),          \
                           fold_convert (ssizetype, dec));      \
index e51b2f99b9906bf2988cb371913d67faecd4b958..46c66d369488d2c6901fffdbee3da21a95792f62 100644 (file)
@@ -3421,7 +3421,7 @@ make_bit_field_ref (location_t loc, tree inner, tree type,
       if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
           || POINTER_TYPE_P (TREE_TYPE (inner)))
          && tree_fits_shwi_p (size)
-         && tree_low_cst (size, 0) == bitsize)
+         && tree_to_shwi (size) == bitsize)
        return fold_convert_loc (loc, type, inner);
     }
 
@@ -7490,7 +7490,7 @@ native_encode_string (const_tree expr, unsigned char *ptr, int len)
       || GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) != BITS_PER_UNIT
       || !tree_fits_shwi_p (TYPE_SIZE_UNIT (type)))
     return 0;
-  total_bytes = tree_low_cst (TYPE_SIZE_UNIT (type), 0);
+  total_bytes = tree_to_shwi (TYPE_SIZE_UNIT (type));
   if (total_bytes > len)
     return 0;
   if (TREE_STRING_LENGTH (expr) < total_bytes)
@@ -16706,9 +16706,9 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0)
          if (TREE_CODE (op00type) == VECTOR_TYPE
              && type == TREE_TYPE (op00type))
            {
-             HOST_WIDE_INT offset = tree_low_cst (op01, 0);
+             HOST_WIDE_INT offset = tree_to_shwi (op01);
              tree part_width = TYPE_SIZE (type);
-             unsigned HOST_WIDE_INT part_widthi = tree_low_cst (part_width, 0)/BITS_PER_UNIT;
+             unsigned HOST_WIDE_INT part_widthi = tree_to_shwi (part_width)/BITS_PER_UNIT;
              unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
              tree index = bitsize_int (indexi);
 
index c842dec5d1ee612c4c92c4ce7558304bcf7493a4..a28be3333acb837c4bd1592d610ad6d8fadb2bac 100644 (file)
@@ -3406,7 +3406,7 @@ gimple_fold_indirect_ref (tree t)
           unsigned HOST_WIDE_INT offset = tree_low_cst (off, 1);
           tree part_width = TYPE_SIZE (type);
           unsigned HOST_WIDE_INT part_widthi
-            = tree_low_cst (part_width, 0) / BITS_PER_UNIT;
+            = tree_to_shwi (part_width) / BITS_PER_UNIT;
           unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
           tree index = bitsize_int (indexi);
           if (offset / part_widthi
index 6346004306780871dab2ae547c83ecd38980f6bc..6f6b53e58a060055f349403b0d51e9cbb673f49c 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * gofrontend/expressions.cc: Replace tree_low_cst (..., 0) with
+       tree_to_shwi throughout.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gofrontend/expressions.cc: Replace host_integerp (..., 0) with
index ca1bb98f9ffb6c71f91d6f1b85af94b7e11e183c..823c5e1a4c8c85f95fb8c9dcd2135c119fac7e25 100644 (file)
@@ -3345,7 +3345,7 @@ Type_conversion_expression::do_get_tree(Translate_context* context)
       expr_tree = fold_convert(int_type_tree, expr_tree);
       if (tree_fits_shwi_p (expr_tree))
        {
-         HOST_WIDE_INT intval = tree_low_cst(expr_tree, 0);
+         HOST_WIDE_INT intval = tree_to_shwi (expr_tree);
          std::string s;
          Lex::append_char(intval, true, &s, this->location());
          Expression* se = Expression::make_string(s, this->location());
index 9699559c15131b21d5aac4356c37cd3222cf90eb..4f2d82a4e1da23a8ca1d3088ddfe22e1fe322b83 100644 (file)
@@ -733,7 +733,7 @@ go_format_type (struct godump_container *container, tree type,
          char buf[100];
 
          snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC "+1",
-                   tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0));
+                   tree_to_shwi (TYPE_MAX_VALUE (TYPE_DOMAIN (type))));
          obstack_grow (ob, buf, strlen (buf));
        }
       obstack_1grow (ob, ']');
@@ -983,7 +983,7 @@ go_output_typedef (struct godump_container *container, tree decl)
 
          if (tree_fits_shwi_p (TREE_VALUE (element)))
            snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC,
-                    tree_low_cst (TREE_VALUE (element), 0));
+                    tree_to_shwi (TREE_VALUE (element)));
          else if (tree_fits_uhwi_p (TREE_VALUE (element)))
            snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_UNSIGNED,
                     ((unsigned HOST_WIDE_INT)
index 5857f1a3f0f90c850d9807907a9bf57580dd1f2b..f065370c881428fe15088fd51b762bc44483c8d9 100644 (file)
@@ -4610,7 +4610,7 @@ ipcp_transform_function (struct cgraph_node *node)
            break;
        if (!v
            || v->by_ref != by_ref
-           || tree_low_cst (TYPE_SIZE (TREE_TYPE (v->value)), 0) != size)
+           || tree_to_shwi (TYPE_SIZE (TREE_TYPE (v->value))) != size)
          continue;
 
        gcc_checking_assert (is_gimple_ip_invariant (v->value));
index 01d50f2c111a698ff2895f627655fe7bd8fbce9f..3ffa76da8c298f95332c049d1b4311b312239c73 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * class.c, expr.c: Replace tree_low_cst (..., 0) with tree_to_shwi
+       throughout.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * class.c, expr.c: Replace host_integerp (..., 0) with
index 5eb245e5376c92349a6f6f394e11e45e63fe4a77..251873e08110314343c910842be7271a605d1104 100644 (file)
@@ -1576,14 +1576,14 @@ get_dispatch_vector (tree type)
       HOST_WIDE_INT i;
       tree method;
       tree super = CLASSTYPE_SUPER (type);
-      HOST_WIDE_INT nvirtuals = tree_low_cst (TYPE_NVIRTUALS (type), 0);
+      HOST_WIDE_INT nvirtuals = tree_to_shwi (TYPE_NVIRTUALS (type));
       vtable = make_tree_vec (nvirtuals);
       TYPE_VTABLE (type) = vtable;
       if (super != NULL_TREE)
        {
          tree super_vtable = get_dispatch_vector (super);
 
-         for (i = tree_low_cst (TYPE_NVIRTUALS (super), 0); --i >= 0; )
+         for (i = tree_to_shwi (TYPE_NVIRTUALS (super)); --i >= 0; )
            TREE_VEC_ELT (vtable, i) = TREE_VEC_ELT (super_vtable, i);
        }
 
@@ -1593,7 +1593,7 @@ get_dispatch_vector (tree type)
          tree method_index = get_method_index (method);
          if (method_index != NULL_TREE
              && tree_fits_shwi_p (method_index))
-           TREE_VEC_ELT (vtable, tree_low_cst (method_index, 0)) = method;
+           TREE_VEC_ELT (vtable, tree_to_shwi (method_index)) = method;
        }
     }
 
index 0720065717cf1da24f10f9df1fe8fc18c5220a82..6dc00c6fc5d38113799830869c4e641e66369662 100644 (file)
@@ -1050,7 +1050,7 @@ build_newarray (int atype_value, tree length)
   tree type
     = build_java_array_type (prim_type,
                             tree_fits_shwi_p (length) == INTEGER_CST
-                            ? tree_low_cst (length, 0) : -1);
+                            ? tree_to_shwi (length) : -1);
 
   /* Pass a reference to the primitive type class and save the runtime
      some work.  */
@@ -1070,7 +1070,7 @@ build_anewarray (tree class_type, tree length)
   tree type
     = build_java_array_type (class_type,
                             tree_fits_shwi_p (length)
-                            ? tree_low_cst (length, 0) : -1);
+                            ? tree_to_shwi (length) : -1);
 
   return build_call_nary (promote_type (type),
                          build_address_of (soft_anewarray_node),
index 8777efba1521e8e38a75889191892acf9c0feabf..42a4600f5190b62594d1dddd0871625dbac6ab10 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * objc-next-runtime-abi-02.c: Replace tree_low_cst (..., 0) with
+       tree_to_shwi throughout.
+
 2013-11-14  Andrew MacLeod  <amacleod@redhat.com>
 
        * objc-act.c: Include only gimplify.h and gimple.h as needed.
index 09600068ca6e7a50c2188245d484a64b68567a92..885047705d48d3c2268f963bfff65cf5a7ec3732 100644 (file)
@@ -3267,7 +3267,7 @@ generate_v2_class_structs (struct imp_entry *impent)
 
   if (field && TREE_CODE (field) == FIELD_DECL)
     instanceSize = int_byte_position (field) * BITS_PER_UNIT
-                  + tree_low_cst (DECL_SIZE (field), 0);
+                  + tree_to_shwi (DECL_SIZE (field));
   else
     instanceSize = 0;
   instanceSize /= BITS_PER_UNIT;
index 9bb5b0b13bdd36c67f43d97a4fc70923db3a9874..e18f9ff772dcd379f172c8ce404362744c7ecd1c 100644 (file)
@@ -2291,7 +2291,7 @@ check_omp_nesting_restrictions (gimple stmt, omp_context *ctx)
              return false;
            }
          switch (tree_fits_shwi_p (gimple_call_arg (stmt, 0))
-                 ? tree_low_cst (gimple_call_arg (stmt, 0), 0)
+                 ? tree_to_shwi (gimple_call_arg (stmt, 0))
                  : 0)
            {
            case 1:
@@ -2954,7 +2954,7 @@ lower_rec_simd_input_clauses (tree new_var, omp_context *ctx, int &max_vf,
                                    OMP_CLAUSE_SAFELEN);
          if (c
              && compare_tree_int (OMP_CLAUSE_SAFELEN_EXPR (c), max_vf) == -1)
-           max_vf = tree_low_cst (OMP_CLAUSE_SAFELEN_EXPR (c), 0);
+           max_vf = tree_to_shwi (OMP_CLAUSE_SAFELEN_EXPR (c));
        }
       if (max_vf > 1)
        {
index 251faa872923774c134f384c461bbb8d3576e837..95d3774d6977f32b2e4fe723eafba0b7b05999ef 100644 (file)
@@ -1054,14 +1054,14 @@ strips_small_constant (tree t1, tree t2)
   else if (TREE_CODE (t1) == SSA_NAME)
     ret = t1;
   else if (tree_fits_shwi_p (t1))
-    value = tree_low_cst (t1, 0);
+    value = tree_to_shwi (t1);
   else
     return NULL;
 
   if (!t2)
     return ret;
   else if (tree_fits_shwi_p (t2))
-    value = tree_low_cst (t2, 0);
+    value = tree_to_shwi (t2);
   else if (TREE_CODE (t2) == SSA_NAME)
     {
       if (ret)
@@ -1674,7 +1674,7 @@ predict_loops (void)
          if (loop_bound_var)
            predict_iv_comparison (loop, bb, loop_bound_var, loop_iv_base,
                                   loop_bound_code,
-                                  tree_low_cst (loop_bound_step, 0));
+                                  tree_to_shwi (loop_bound_step));
        }
 
       /* Free basic blocks from get_loop_body.  */
index 4f1e4ee58260cc23775129102dd0445a7d193fce..0cd0c7e1a74be6d16d676d3496343d008270b092 100644 (file)
@@ -280,7 +280,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size,
            decl_size = -1;
          else if (DECL_P (decl) && DECL_SIZE_UNIT (decl))
            decl_size = (tree_fits_shwi_p (DECL_SIZE_UNIT (decl))
-                        ? tree_low_cst (DECL_SIZE_UNIT (decl), 0)
+                        ? tree_to_shwi (DECL_SIZE_UNIT (decl))
                         : -1);
          else if (TREE_CODE (decl) == STRING_CST)
            decl_size = TREE_STRING_LENGTH (decl);
index 26ed6aa974e7f0dafb4c484cedb26379ee0d1119..6706789331f406a07d29edc7c671aeeff1ce3cea 100644 (file)
@@ -537,8 +537,8 @@ plain_type_1 (tree type, int level)
               && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != 0
               && tree_fits_shwi_p (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
               && tree_fits_shwi_p (TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
-              ? (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
-                 - tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0) + 1)
+              ? (tree_to_shwi (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
+                 - tree_to_shwi (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1)
               : 0);
 
        return PUSH_DERIVED_LEVEL (DT_ARY, m);
@@ -1134,7 +1134,7 @@ sdbout_one_type (tree type)
                  continue;
 
                PUT_SDB_DEF (IDENTIFIER_POINTER (child_type_name));
-               PUT_SDB_INT_VAL (tree_low_cst (BINFO_OFFSET (child), 0));
+               PUT_SDB_INT_VAL (tree_to_shwi (BINFO_OFFSET (child)));
                PUT_SDB_SCL (member_scl);
                sdbout_type (BINFO_TYPE (child));
                PUT_SDB_ENDEF;
@@ -1155,7 +1155,7 @@ sdbout_one_type (tree type)
                if (tree_fits_shwi_p (value))
                  {
                    PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
-                   PUT_SDB_INT_VAL (tree_low_cst (value, 0));
+                   PUT_SDB_INT_VAL (tree_to_shwi (value));
                    PUT_SDB_SCL (C_MOE);
                    PUT_SDB_TYPE (T_MOE);
                    PUT_SDB_ENDEF;
index ef4791b446d2393e23018271ab2369b5f2daf55b..04d9586697b5970bf6a543fb1f436a8d61e56930 100644 (file)
@@ -776,8 +776,8 @@ dump_case_nodes (FILE *f, struct case_node *root,
 
   dump_case_nodes (f, root->left, indent_step, indent_level);
 
-  low = tree_low_cst (root->low, 0);
-  high = tree_low_cst (root->high, 0);
+  low = tree_to_shwi (root->low);
+  high = tree_to_shwi (root->high);
 
   fputs (";; ", f);
   if (high == low)
@@ -1019,7 +1019,7 @@ emit_case_dispatch_table (tree index_expr, tree index_type,
 
   /* Get table of labels to jump to, in order of case index.  */
 
-  ncases = tree_low_cst (range, 0) + 1;
+  ncases = tree_to_shwi (range) + 1;
   labelvec = XALLOCAVEC (rtx, ncases);
   memset (labelvec, 0, ncases * sizeof (rtx));
 
index 44a5f2bf8e1db0151ea7234e20bd35ef4f4e91b7..48c6c783a142a671f15fc099887add96d1625c04 100644 (file)
@@ -1201,8 +1201,8 @@ place_field (record_layout_info rli, tree field)
       unsigned int type_align = TYPE_ALIGN (type);
       tree dsize = DECL_SIZE (field);
       HOST_WIDE_INT field_size = tree_low_cst (dsize, 1);
-      HOST_WIDE_INT offset = tree_low_cst (rli->offset, 0);
-      HOST_WIDE_INT bit_offset = tree_low_cst (rli->bitpos, 0);
+      HOST_WIDE_INT offset = tree_to_shwi (rli->offset);
+      HOST_WIDE_INT bit_offset = tree_to_shwi (rli->bitpos);
 
 #ifdef ADJUST_FIELD_ALIGN
       if (! TYPE_USER_ALIGN (type))
@@ -1245,8 +1245,8 @@ place_field (record_layout_info rli, tree field)
       unsigned int type_align = TYPE_ALIGN (type);
       tree dsize = DECL_SIZE (field);
       HOST_WIDE_INT field_size = tree_low_cst (dsize, 1);
-      HOST_WIDE_INT offset = tree_low_cst (rli->offset, 0);
-      HOST_WIDE_INT bit_offset = tree_low_cst (rli->bitpos, 0);
+      HOST_WIDE_INT offset = tree_to_shwi (rli->offset);
+      HOST_WIDE_INT bit_offset = tree_to_shwi (rli->bitpos);
 
 #ifdef ADJUST_FIELD_ALIGN
       if (! TYPE_USER_ALIGN (type))
index 55ab7d07b6704ecfa6fdaceb0422102a9c13a5f7..cddc439546f0a63b38f91049a8d6584102b66202 100644 (file)
@@ -994,7 +994,7 @@ tree default_mangle_decl_assembler_name (tree decl ATTRIBUTE_UNUSED,
 HOST_WIDE_INT
 default_vector_alignment (const_tree type)
 {
-  return tree_low_cst (TYPE_SIZE (type), 0);
+  return tree_to_shwi (TYPE_SIZE (type));
 }
 
 bool
index e8a06ccea67152d7eab97509e9a8691357c2a565..dbcf20ca2b8f987c0c97fd8e98d322bbd52c9208 100644 (file)
@@ -282,7 +282,7 @@ replace_loop_annotate ()
          if (!gimple_call_internal_p (stmt)
                  || gimple_call_internal_fn (stmt) != IFN_ANNOTATE)
            continue;
-         if ((annot_expr_kind) tree_low_cst (gimple_call_arg (stmt, 1), 0)
+         if ((annot_expr_kind) tree_to_shwi (gimple_call_arg (stmt, 1))
              != annot_expr_ivdep_kind)
            continue;
          stmt = gimple_build_assign (gimple_call_lhs (stmt),
@@ -307,7 +307,7 @@ replace_loop_annotate ()
       if (!gimple_call_internal_p (stmt)
          || gimple_call_internal_fn (stmt) != IFN_ANNOTATE)
        continue;
-      if ((annot_expr_kind) tree_low_cst (gimple_call_arg (stmt, 1), 0)
+      if ((annot_expr_kind) tree_to_shwi (gimple_call_arg (stmt, 1))
          != annot_expr_ivdep_kind)
        continue;
       warning_at (gimple_location (stmt), 0, "ignoring %<GCC ivdep%> "
@@ -6273,7 +6273,7 @@ move_stmt_eh_region_tree_nr (tree old_t_nr, struct move_stmt_d *p)
 {
   int old_nr, new_nr;
 
-  old_nr = tree_low_cst (old_t_nr, 0);
+  old_nr = tree_to_shwi (old_t_nr);
   new_nr = move_stmt_eh_region_nr (old_nr, p);
 
   return build_int_cst (integer_type_node, new_nr);
index c0ee654561c9f1424188db510ac4870c52a1e5e0..dde08bb47eb8bd940aca267865dfcf748613a9bc 100644 (file)
@@ -2840,14 +2840,14 @@ gcd_of_steps_may_divide_p (const_tree chrec, const_tree cst)
 
   if (!tree_fits_shwi_p (cst))
     return true;
-  val = tree_low_cst (cst, 0);
+  val = tree_to_shwi (cst);
 
   while (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
     {
       step = CHREC_RIGHT (chrec);
       if (!tree_fits_shwi_p (step))
        return true;
-      cd = gcd (cd, tree_low_cst (step, 0));
+      cd = gcd (cd, tree_to_shwi (step));
       chrec = CHREC_LEFT (chrec);
     }
 
index 918a25c1c3bece293f93acd2bd398e630099b1b6..caecbf27ee71e91f2a518fbc1fe2af1bc2cfc83b 100644 (file)
@@ -1221,7 +1221,7 @@ remap_eh_region_tree_nr (tree old_t_nr, copy_body_data *id)
 {
   int old_nr, new_nr;
 
-  old_nr = tree_low_cst (old_t_nr, 0);
+  old_nr = tree_to_shwi (old_t_nr);
   new_nr = remap_eh_region_nr (old_nr, id);
 
   return build_int_cst (integer_type_node, new_nr);
index e8b4f73ee62e6d0109c18b3c78b1a9395457a56b..af84ad86cd05f5f7a57db9521edf59870d002cb3 100644 (file)
@@ -1631,9 +1631,9 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
                    TREE_STRING_POINTER (str1) + tree_low_cst (off1, 1),
                    tree_low_cst (len1, 1));
          else
-           src_buf[0] = tree_low_cst (src1, 0);
+           src_buf[0] = tree_to_shwi (src1);
          memset (src_buf + tree_low_cst (diff, 1),
-                 tree_low_cst (val2, 0), tree_low_cst (len2, 1));
+                 tree_to_shwi (val2), tree_low_cst (len2, 1));
          src_buf[src_len] = '\0';
          /* Neither builtin_strncpy_read_str nor builtin_memcpy_read_str
             handle embedded '\0's.  */
@@ -2355,7 +2355,7 @@ simplify_rotate (gimple_stmt_iterator *gsi)
           with optional casts.  */
        if (cdef_code[i] == MINUS_EXPR
            && tree_fits_shwi_p (cdef_arg1[i])
-           && tree_low_cst (cdef_arg1[i], 0) == TYPE_PRECISION (rtype)
+           && tree_to_shwi (cdef_arg1[i]) == TYPE_PRECISION (rtype)
            && TREE_CODE (cdef_arg2[i]) == SSA_NAME)
          {
            tree tem;
@@ -2387,7 +2387,7 @@ simplify_rotate (gimple_stmt_iterator *gsi)
           One shift count is Y and the other (-Y) & (B - 1).  */
        else if (cdef_code[i] == BIT_AND_EXPR
                 && tree_fits_shwi_p (cdef_arg2[i])
-                && tree_low_cst (cdef_arg2[i], 0)
+                && tree_to_shwi (cdef_arg2[i])
                    == TYPE_PRECISION (rtype) - 1
                 && TREE_CODE (cdef_arg1[i]) == SSA_NAME
                 && gimple_assign_rhs_code (stmt) == BIT_IOR_EXPR)
index 426f4bcb4e7e543af9185a02b3e609a16d0f5b6e..94e17e53437d7bf312458a0863d8c5995a36eafb 100644 (file)
@@ -1459,7 +1459,7 @@ add_subscript_strides (tree access_fn, unsigned stride,
        continue;
 
       if (tree_fits_shwi_p (step))
-       astep = tree_low_cst (step, 0);
+       astep = tree_to_shwi (step);
       else
        astep = L1_CACHE_LINE_SIZE;
 
index 666a9155e26ab31b812e8bc52d7d8bda3c2f4e9a..dd0ebc170eabbae27d58f5d6bf70a6c954ed4580 100644 (file)
@@ -1375,7 +1375,7 @@ add_or_mark_expr (basic_block bb, tree exp,
       map.phase = 0;
       map.bb = 0;
       map.store = store;
-      map.offset = tree_low_cst (TREE_OPERAND (exp, 1), 0);
+      map.offset = tree_to_shwi (TREE_OPERAND (exp, 1));
       map.size = size;
 
       slot = seen_ssa_names.find_slot (&map, INSERT);
index a49a282a69f6e2a427c952509fd96f9db85d88ab..8742e267ddb4c7cd056c76aa13e122176a33a1ac 100644 (file)
@@ -995,7 +995,7 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
 
        /* And now the usual component-reference style ops.  */
        case BIT_FIELD_REF:
-         offset += tree_low_cst (op->op1, 0);
+         offset += tree_to_shwi (op->op1);
          break;
 
        case COMPONENT_REF:
index bacc59fd0e776233db6cc0cd868ce203b2547b69..842db122d772169a87ad6af84723fe436b7e826f 100644 (file)
@@ -218,7 +218,7 @@ get_stridx (tree exp)
       && (o == NULL_TREE || tree_fits_shwi_p (o))
       && TREE_STRING_LENGTH (s) > 0)
     {
-      HOST_WIDE_INT offset = o ? tree_low_cst (o, 0) : 0;
+      HOST_WIDE_INT offset = o ? tree_to_shwi (o) : 0;
       const char *p = TREE_STRING_POINTER (s);
       int max = TREE_STRING_LENGTH (s) - 1;
 
index e39734730c4c07bd8158ef45a64a8a68d026187e..66655d818f265a7f754e8af07d8d414890e80ad3 100644 (file)
@@ -596,7 +596,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
                      tree access_size = TYPE_SIZE_UNIT (TREE_TYPE (rhs));
 
                      gpr_size = si->offsets[SSA_NAME_VERSION (use)]
-                                + tree_low_cst (TREE_OPERAND (rhs, 1), 0)
+                                + tree_to_shwi (TREE_OPERAND (rhs, 1))
                                 + tree_low_cst (access_size, 1);
                      if (gpr_size >= VA_LIST_MAX_GPR_SIZE)
                        cfun->va_list_gpr_size = VA_LIST_MAX_GPR_SIZE;
index c4246079a259146ce060547591c5971f37f0e7d0..83d1f4546bdbfd09aca6bee636c6913217bba6a1 100644 (file)
@@ -3071,7 +3071,7 @@ vect_check_gather (gimple stmt, loop_vec_info loop_vinfo, tree *basep,
        case MULT_EXPR:
          if (scale == 1 && tree_fits_shwi_p (op1))
            {
-             scale = tree_low_cst (op1, 0);
+             scale = tree_to_shwi (op1);
              off = op0;
              continue;
            }
index a0d366ad211f80d226307dd488f1feb453ae9de7..17411cd5ff79d83469e7d20ce0e804c53e2597f5 100644 (file)
@@ -784,7 +784,7 @@ vect_recog_pow_pattern (vec<gimple> *stmts, tree *type_in,
 
   /* Catch squaring.  */
   if ((tree_fits_shwi_p (exp)
-       && tree_low_cst (exp, 0) == 2)
+       && tree_to_shwi (exp) == 2)
       || (TREE_CODE (exp) == REAL_CST
           && REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2)))
     {
index 124e5312e3136d15893c00da04193fb623f9bf78..4fc92e848a9b176c0669966a19238b88026e3a32 100644 (file)
@@ -2709,7 +2709,7 @@ bit_position (const_tree field)
 HOST_WIDE_INT
 int_bit_position (const_tree field)
 {
-  return tree_low_cst (bit_position (field), 0);
+  return tree_to_shwi (bit_position (field));
 }
 \f
 /* Return the byte position of FIELD, in bytes from the start of the record.
@@ -2729,7 +2729,7 @@ byte_position (const_tree field)
 HOST_WIDE_INT
 int_byte_position (const_tree field)
 {
-  return tree_low_cst (byte_position (field), 0);
+  return tree_to_shwi (byte_position (field));
 }
 \f
 /* Return the strictest alignment, in bits, that T is known to have.  */
index ae30deafbba74fbef780891b6ea0e6225948017f..e61f6d403f78bb1a6b14a54e5b8b88bbe2547421 100644 (file)
@@ -604,7 +604,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define SET_PREDICT_EXPR_OUTCOME(NODE, OUTCOME) \
   (PREDICT_EXPR_CHECK (NODE)->base.addressable_flag = (int) OUTCOME)
 #define PREDICT_EXPR_PREDICTOR(NODE) \
-  ((enum br_predictor)tree_low_cst (TREE_OPERAND (PREDICT_EXPR_CHECK (NODE), 0), 0))
+  ((enum br_predictor)tree_to_shwi (TREE_OPERAND (PREDICT_EXPR_CHECK (NODE), 0)))
 
 /* In a VAR_DECL, nonzero means allocate static storage.
    In a FUNCTION_DECL, nonzero if function has been defined.
index e07cbe6b55a478c80be69e5ca7a40ade652aad54..edffd8b024cd25a5b926aac7920a8ea2580112c6 100644 (file)
@@ -6292,7 +6292,7 @@ prepare_call_arguments (basic_block bb, rtx insn)
                          initial = DECL_INITIAL (SYMBOL_REF_DECL (l->loc));
                          if (tree_fits_shwi_p (initial))
                            {
-                             item = GEN_INT (tree_low_cst (initial, 0));
+                             item = GEN_INT (tree_to_shwi (initial));
                              item = gen_rtx_CONCAT (indmode, mem, item);
                              call_arguments
                                = gen_rtx_EXPR_LIST (VOIDmode, item,
@@ -6371,7 +6371,7 @@ prepare_call_arguments (basic_block bb, rtx insn)
        = TYPE_MODE (TREE_TYPE (OBJ_TYPE_REF_EXPR (obj_type_ref)));
       rtx clobbered = gen_rtx_MEM (mode, this_arg);
       HOST_WIDE_INT token
-       = tree_low_cst (OBJ_TYPE_REF_TOKEN (obj_type_ref), 0);
+       = tree_to_shwi (OBJ_TYPE_REF_TOKEN (obj_type_ref));
       if (token)
        clobbered = plus_constant (mode, clobbered,
                                   token * GET_MODE_SIZE (mode));
index d7930631f88b6c837aba7a852c64cbec3f051e5a..fc519f34d950f75cbda1f1179307f082298c80db 100644 (file)
@@ -2718,7 +2718,7 @@ decode_addr_const (tree exp, struct addr_const *value)
               || TREE_CODE (target) == ARRAY_RANGE_REF)
        {
          offset += (tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (target)), 1)
-                    * tree_low_cst (TREE_OPERAND (target, 1), 0));
+                    * tree_to_shwi (TREE_OPERAND (target, 1)));
          target = TREE_OPERAND (target, 0);
        }
       else if (TREE_CODE (target) == MEM_REF
@@ -4664,7 +4664,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
   if (TREE_CODE (exp) == FDESC_EXPR)
     {
 #ifdef ASM_OUTPUT_FDESC
-      HOST_WIDE_INT part = tree_low_cst (TREE_OPERAND (exp, 1), 0);
+      HOST_WIDE_INT part = tree_to_shwi (TREE_OPERAND (exp, 1));
       tree decl = TREE_OPERAND (exp, 0);
       ASM_OUTPUT_FDESC (asm_out_file, decl, part);
 #else
@@ -4833,9 +4833,9 @@ output_constructor_array_range (oc_local_state *local)
     = int_size_in_bytes (TREE_TYPE (local->type));
 
   HOST_WIDE_INT lo_index
-    = tree_low_cst (TREE_OPERAND (local->index, 0), 0);
+    = tree_to_shwi (TREE_OPERAND (local->index, 0));
   HOST_WIDE_INT hi_index
-    = tree_low_cst (TREE_OPERAND (local->index, 1), 0);
+    = tree_to_shwi (TREE_OPERAND (local->index, 1));
   HOST_WIDE_INT index;
 
   unsigned int align2
@@ -4958,8 +4958,8 @@ output_constructor_bitfield (oc_local_state *local, unsigned int bit_offset)
   HOST_WIDE_INT relative_index
     = (!local->field
        ? (local->index
-         ? (tree_low_cst (local->index, 0)
-            - tree_low_cst (local->min_index, 0))
+         ? (tree_to_shwi (local->index)
+            - tree_to_shwi (local->min_index))
          : local->last_relative_index + 1)
        : 0);