summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 14:51:10 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 14:51:10 +0000
commit35ec552a6349f5b8ef21996454de61a0649ae59a (patch)
treeafc65126a85ed1aadac8e274f889137dc1baed2a
parent031a4cb6d2dc2e69d3723413323d228fac4bc0d2 (diff)
downloadgcc-35ec552a6349f5b8ef21996454de61a0649ae59a.tar.gz
gcc/ada/
* gcc-interface/cuintp.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/c-family/ * c-ada-spec.c, c-common.c, c-format.c, c-pretty-print.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/c/ * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/cp/ * error.c, init.c, parser.c, semantics.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/go/ * gofrontend/expressions.cc: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/java/ * class.c, expr.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/ * builtins.c, config/alpha/alpha.c, config/c6x/predicates.md, config/ia64/predicates.md, config/iq2000/iq2000.c, config/mips/mips.c, config/s390/s390.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c, expr.h, fold-const.c, gimple-fold.c, gimple-ssa-strength-reduction.c, gimple.c, godump.c, graphite-scop-detection.c, graphite-sese-to-poly.c, omp-low.c, predict.c, rtlanal.c, sdbout.c, simplify-rtx.c, stor-layout.c, tree-data-ref.c, tree-dfa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-alias.c, tree-ssa-forwprop.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-phiopt.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-vect-data-refs.c, tree-vect-patterns.c, tree-vectorizer.h, tree.c, var-tracking.c, varasm.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204955 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/cuintp.c4
-rw-r--r--gcc/builtins.c12
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-ada-spec.c4
-rw-r--r--gcc/c-family/c-common.c6
-rw-r--r--gcc/c-family/c-format.c6
-rw-r--r--gcc/c-family/c-pretty-print.c4
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-parser.c2
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/c6x/predicates.md2
-rw-r--r--gcc/config/ia64/predicates.md2
-rw-r--r--gcc/config/iq2000/iq2000.c2
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/s390/s390.c2
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/error.c4
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/semantics.c4
-rw-r--r--gcc/dbxout.c12
-rw-r--r--gcc/dwarf2out.c30
-rw-r--r--gcc/except.c2
-rw-r--r--gcc/explow.c2
-rw-r--r--gcc/expr.c16
-rw-r--r--gcc/expr.h4
-rw-r--r--gcc/fold-const.c16
-rw-r--r--gcc/gimple-fold.c2
-rw-r--r--gcc/gimple-ssa-strength-reduction.c2
-rw-r--r--gcc/gimple.c4
-rw-r--r--gcc/go/ChangeLog5
-rw-r--r--gcc/go/gofrontend/expressions.cc2
-rw-r--r--gcc/godump.c4
-rw-r--r--gcc/graphite-scop-detection.c4
-rw-r--r--gcc/graphite-sese-to-poly.c4
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/class.c2
-rw-r--r--gcc/java/expr.c4
-rw-r--r--gcc/omp-low.c6
-rw-r--r--gcc/predict.c14
-rw-r--r--gcc/rtlanal.c2
-rw-r--r--gcc/sdbout.c10
-rw-r--r--gcc/simplify-rtx.c2
-rw-r--r--gcc/stor-layout.c4
-rw-r--r--gcc/tree-data-ref.c4
-rw-r--r--gcc/tree-dfa.c4
-rw-r--r--gcc/tree-pretty-print.c2
-rw-r--r--gcc/tree-sra.c4
-rw-r--r--gcc/tree-ssa-alias.c4
-rw-r--r--gcc/tree-ssa-forwprop.c8
-rw-r--r--gcc/tree-ssa-loop-ivopts.c4
-rw-r--r--gcc/tree-ssa-loop-prefetch.c2
-rw-r--r--gcc/tree-ssa-math-opts.c2
-rw-r--r--gcc/tree-ssa-phiopt.c2
-rw-r--r--gcc/tree-ssa-reassoc.c2
-rw-r--r--gcc/tree-ssa-sccvn.c12
-rw-r--r--gcc/tree-ssa-strlen.c2
-rw-r--r--gcc/tree-ssa-structalias.c4
-rw-r--r--gcc/tree-vect-data-refs.c10
-rw-r--r--gcc/tree-vect-patterns.c2
-rw-r--r--gcc/tree-vectorizer.h2
-rw-r--r--gcc/tree.c2
-rw-r--r--gcc/var-tracking.c2
-rw-r--r--gcc/varasm.c2
66 files changed, 190 insertions, 143 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ae3a6faf7f..48c0d01f8cb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,22 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+ * builtins.c, config/alpha/alpha.c, config/c6x/predicates.md,
+ config/ia64/predicates.md, config/iq2000/iq2000.c, config/mips/mips.c,
+ config/s390/s390.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c,
+ expr.h, fold-const.c, gimple-fold.c, gimple-ssa-strength-reduction.c,
+ gimple.c, godump.c, graphite-scop-detection.c, graphite-sese-to-poly.c,
+ omp-low.c, predict.c, rtlanal.c, sdbout.c, simplify-rtx.c,
+ stor-layout.c, tree-data-ref.c, tree-dfa.c, tree-pretty-print.c,
+ tree-sra.c, tree-ssa-alias.c, tree-ssa-forwprop.c,
+ tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c,
+ tree-ssa-phiopt.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c,
+ tree-ssa-strlen.c, tree-ssa-structalias.c, tree-vect-data-refs.c,
+ tree-vect-patterns.c, tree-vectorizer.h, tree.c, var-tracking.c,
+ varasm.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
+ throughout.
+
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Declare.
* tree.c (tree_fits_shwi_p, tree_fits_uhwi_p): Define.
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f6137caeca6..facd5d61ef8 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc-interface/cuintp.c: Replace host_integerp (..., 0) with
+ tree_fits_shwi_p throughout.
+
2013-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (TARGET_ABI_OPEN_VMS): Delete as redundant.
diff --git a/gcc/ada/gcc-interface/cuintp.c b/gcc/ada/gcc-interface/cuintp.c
index 9b58b0ecc64..d3c19aed0e4 100644
--- a/gcc/ada/gcc-interface/cuintp.c
+++ b/gcc/ada/gcc-interface/cuintp.c
@@ -153,7 +153,7 @@ UI_From_gnu (tree Input)
/* On 64-bit hosts, host_integerp tells whether the input fits in a
signed 64-bit integer. Then a truncation tells whether it fits
in a signed 32-bit integer. */
- if (host_integerp (Input, 0))
+ if (tree_fits_shwi_p (Input))
{
HOST_WIDE_INT hw_input = TREE_INT_CST_LOW (Input);
if (hw_input == (int) hw_input)
@@ -165,7 +165,7 @@ UI_From_gnu (tree Input)
/* On 32-bit hosts, host_integerp tells whether the input fits in a
signed 32-bit integer. Then a sign test tells whether it fits
in a signed 64-bit integer. */
- if (host_integerp (Input, 0))
+ if (tree_fits_shwi_p (Input))
return UI_From_Int (TREE_INT_CST_LOW (Input));
else if (TREE_INT_CST_HIGH (Input) < 0 && TYPE_UNSIGNED (gnu_type))
return No_Uint;
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 5c8577a8e82..7807b60e539 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -617,7 +617,7 @@ c_strlen (tree src, int only_value)
a null character if we can represent it as a single HOST_WIDE_INT. */
if (offset_node == 0)
offset = 0;
- else if (! host_integerp (offset_node, 0))
+ else if (! tree_fits_shwi_p (offset_node))
offset = -1;
else
offset = tree_low_cst (offset_node, 0);
@@ -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 (host_integerp (weak, 0) && tree_low_cst (weak, 0) != 0)
+ if (tree_fits_shwi_p (weak) && tree_low_cst (weak, 0) != 0)
is_weak = true;
oldval = expect;
@@ -8547,7 +8547,7 @@ fold_builtin_powi (location_t loc, tree fndecl ATTRIBUTE_UNUSED,
if (real_onep (arg0))
return omit_one_operand_loc (loc, type, build_real (type, dconst1), arg1);
- if (host_integerp (arg1, 0))
+ if (tree_fits_shwi_p (arg1))
{
HOST_WIDE_INT c = TREE_INT_CST_LOW (arg1);
@@ -8871,7 +8871,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
return NULL_TREE;
}
- if (!host_integerp (len, 0))
+ if (!tree_fits_shwi_p (len))
return NULL_TREE;
/* FIXME:
This logic lose for arguments like (type *)malloc (sizeof (type)),
@@ -9845,7 +9845,7 @@ fold_builtin_load_exponent (location_t loc, tree arg0, tree arg1,
/* If both arguments are constant, then try to evaluate it. */
if ((ldexp || REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2)
&& TREE_CODE (arg0) == REAL_CST && !TREE_OVERFLOW (arg0)
- && host_integerp (arg1, 0))
+ && tree_fits_shwi_p (arg1))
{
/* Bound the maximum adjustment to twice the range of the
mode's valid exponents. Use abs to ensure the range is
@@ -13841,7 +13841,7 @@ do_mpfr_bessel_n (tree arg1, tree arg2, tree type,
/* To proceed, MPFR must exactly represent the target floating point
format, which only happens when the target base equals two. */
if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
- && host_integerp (arg1, 0)
+ && tree_fits_shwi_p (arg1)
&& TREE_CODE (arg2) == REAL_CST && !TREE_OVERFLOW (arg2))
{
const HOST_WIDE_INT n = tree_low_cst (arg1, 0);
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 9f884b6c845..fde985328cd 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * c-ada-spec.c, c-common.c, c-format.c, c-pretty-print.c: Replace
+ host_integerp (..., 0) with tree_fits_shwi_p throughout.
+
2013-11-15 Aldy Hernandez <aldyh@redhat.com>
* c-cilkplus.c: New file.
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 3f325e77098..6a5826b0a76 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -1813,7 +1813,7 @@ is_simple_enum (tree node)
if (TREE_CODE (int_val) != INTEGER_CST)
int_val = DECL_INITIAL (int_val);
- if (!host_integerp (int_val, 0))
+ if (!tree_fits_shwi_p (int_val))
return false;
else if (TREE_INT_CST_LOW (int_val) != count)
return false;
@@ -2205,7 +2205,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc,
to generate the (0 .. -1) range for flexible array members. */
if (TREE_TYPE (node) == sizetype)
node = fold_convert (ssizetype, node);
- if (host_integerp (node, 0))
+ if (tree_fits_shwi_p (node))
pp_wide_integer (buffer, TREE_INT_CST_LOW (node));
else if (host_integerp (node, 1))
pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node));
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index d7d5cb20a17..d0fc1aafd6b 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -6999,7 +6999,7 @@ get_priority (tree args, bool is_destructor)
arg = TREE_VALUE (args);
arg = default_conversion (arg);
- if (!host_integerp (arg, /*pos=*/0)
+ if (!tree_fits_shwi_p (arg)
|| !INTEGRAL_TYPE_P (TREE_TYPE (arg)))
goto invalid;
@@ -11243,14 +11243,14 @@ warn_for_sign_compare (location_t location,
if (TREE_CODE (op1) == BIT_NOT_EXPR)
op1 = c_common_get_narrower (TREE_OPERAND (op1, 0), &unsignedp1);
- if (host_integerp (op0, 0) || host_integerp (op1, 0))
+ if (tree_fits_shwi_p (op0) || tree_fits_shwi_p (op1))
{
tree primop;
HOST_WIDE_INT constant, mask;
int unsignedp;
unsigned int bits;
- if (host_integerp (op0, 0))
+ if (tree_fits_shwi_p (op0))
{
primop = op1;
unsignedp = unsignedp1;
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 99cae172a5b..d0c07e41354 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -1459,7 +1459,7 @@ check_format_arg (void *ctx, tree format_tree,
res->number_non_literal++;
return;
}
- if (!host_integerp (arg1, 0)
+ if (!tree_fits_shwi_p (arg1)
|| (offset = tree_low_cst (arg1, 0)) < 0)
{
res->number_non_literal++;
@@ -1506,7 +1506,7 @@ check_format_arg (void *ctx, tree format_tree,
return;
}
if (TREE_CODE (format_tree) == ARRAY_REF
- && host_integerp (TREE_OPERAND (format_tree, 1), 0)
+ && tree_fits_shwi_p (TREE_OPERAND (format_tree, 1))
&& (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0)
format_tree = TREE_OPERAND (format_tree, 0);
if (TREE_CODE (format_tree) == VAR_DECL
@@ -1537,7 +1537,7 @@ check_format_arg (void *ctx, tree format_tree,
/* Variable length arrays can't be initialized. */
gcc_assert (TREE_CODE (array_size) == INTEGER_CST);
- if (host_integerp (array_size, 0))
+ if (tree_fits_shwi_p (array_size))
{
HOST_WIDE_INT array_size_value = TREE_INT_CST_LOW (array_size);
if (array_size_value > 0
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 54ed5512cd4..fd4b8579959 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -586,7 +586,7 @@ c_pretty_printer::direct_abstract_declarator (tree t)
tree maxval = TYPE_MAX_VALUE (TYPE_DOMAIN (t));
tree type = TREE_TYPE (maxval);
- if (host_integerp (maxval, 0))
+ if (tree_fits_shwi_p (maxval))
pp_wide_integer (this, tree_low_cst (maxval, 0) + 1);
else
expression (fold_build2 (PLUS_EXPR, type, maxval,
@@ -915,7 +915,7 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
? TYPE_CANONICAL (TREE_TYPE (i))
: TREE_TYPE (i);
- if (host_integerp (i, 0))
+ if (tree_fits_shwi_p (i))
pp_wide_integer (pp, TREE_INT_CST_LOW (i));
else if (host_integerp (i, 1))
pp_unsigned_wide_integer (pp, TREE_INT_CST_LOW (i));
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index f1b1a496185..b2035dfb474 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
+ throughout.
+
2013-11-15 Aldy Hernandez <aldyh@redhat.com>
* c-parser.c (c_parser_cilk_simd): New.
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 6f034029151..58b2ffc0a52 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -9736,7 +9736,7 @@ c_parser_omp_clause_collapse (c_parser *parser, tree list)
mark_exp_read (num);
num = c_fully_fold (num, false, NULL);
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
- || !host_integerp (num, 0)
+ || !tree_fits_shwi_p (num)
|| (n = tree_low_cst (num, 0)) <= 0
|| (int) n != n)
{
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index cc455e206f1..dbfcd01874c 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5986,7 +5986,7 @@ alpha_stdarg_optimize_hook (struct stdarg_info *si, const_gimple stmt)
else
goto escapes;
- if (!host_integerp (gimple_assign_rhs2 (arg2_stmt), 0))
+ if (!tree_fits_shwi_p (gimple_assign_rhs2 (arg2_stmt)))
goto escapes;
sub = tree_low_cst (gimple_assign_rhs2 (arg2_stmt), 0);
diff --git a/gcc/config/c6x/predicates.md b/gcc/config/c6x/predicates.md
index 1a2fe8f69f5..94d9389de53 100644
--- a/gcc/config/c6x/predicates.md
+++ b/gcc/config/c6x/predicates.md
@@ -210,7 +210,7 @@
t = DECL_SIZE_UNIT (t);
else
t = TYPE_SIZE_UNIT (TREE_TYPE (t));
- if (t && host_integerp (t, 0))
+ if (t && tree_fits_shwi_p (t))
{
size = tree_low_cst (t, 0);
if (size < 0)
diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md
index af7bc8ee4c2..476e06df796 100644
--- a/gcc/config/ia64/predicates.md
+++ b/gcc/config/ia64/predicates.md
@@ -72,7 +72,7 @@
t = DECL_SIZE_UNIT (t);
else
t = TYPE_SIZE_UNIT (TREE_TYPE (t));
- if (t && host_integerp (t, 0))
+ if (t && tree_fits_shwi_p (t))
{
size = tree_low_cst (t, 0);
if (size < 0)
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index da6f757d6f9..71987c61123 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -1289,7 +1289,7 @@ iq2000_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
if (TREE_CODE (field) == FIELD_DECL
&& TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
- && host_integerp (bit_position (field), 0)
+ && tree_fits_shwi_p (bit_position (field))
&& int_bit_position (field) % BITS_PER_WORD == 0)
break;
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index b2fd57bb5ff..055e36afa24 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -5158,7 +5158,7 @@ mips_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
if (TREE_CODE (field) == FIELD_DECL
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
- && host_integerp (bit_position (field), 0)
+ && tree_fits_shwi_p (bit_position (field))
&& int_bit_position (field) % BITS_PER_WORD == 0)
break;
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index ed8eefa31f7..58fab9e5ca9 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -10193,7 +10193,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
if (!DECL_SIZE (decl)
|| !DECL_ALIGN (decl)
- || !host_integerp (DECL_SIZE (decl), 0)
+ || !tree_fits_shwi_p (DECL_SIZE (decl))
|| (DECL_ALIGN (decl) <= 64
&& DECL_ALIGN (decl) != tree_low_cst (DECL_SIZE (decl), 0)))
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2729ec31f5d..a131d4b258b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * error.c, init.c, parser.c, semantics.c: Replace
+ host_integerp (..., 0) with tree_fits_shwi_p throughout.
+
2013-11-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59123
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 5f997c3ed29..7f8607710c8 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -851,7 +851,7 @@ dump_type_suffix (cxx_pretty_printer *pp, tree t, int flags)
tree max = TYPE_MAX_VALUE (dtype);
if (integer_all_onesp (max))
pp_character (pp, '0');
- else if (host_integerp (max, 0))
+ else if (tree_fits_shwi_p (max))
pp_wide_integer (pp, tree_low_cst (max, 0) + 1);
else
{
@@ -2285,7 +2285,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
pp_cxx_right_paren (pp);
break;
}
- else if (host_integerp (idx, 0))
+ else if (tree_fits_shwi_p (idx))
{
tree virtuals;
unsigned HOST_WIDE_INT n;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index fde2314e326..c37423c4c5d 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3662,7 +3662,7 @@ build_vec_init (tree base, tree maxindex, tree init,
if (from_array
|| ((type_build_ctor_call (type) || init || explicit_value_init_p)
- && ! (host_integerp (maxindex, 0)
+ && ! (tree_fits_shwi_p (maxindex)
&& (num_initialized_elts
== tree_low_cst (maxindex, 0) + 1))))
{
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 27f10543b82..72fbd024393 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -26962,7 +26962,7 @@ cp_parser_omp_clause_collapse (cp_parser *parser, tree list, location_t location
return list;
num = fold_non_dependent_expr (num);
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
- || !host_integerp (num, 0)
+ || !tree_fits_shwi_p (num)
|| (n = tree_low_cst (num, 0)) <= 0
|| (int) n != n)
{
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index f5506d010dc..781d37386c3 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -8739,8 +8739,8 @@ cxx_eval_bit_field_ref (const constexpr_call *call, tree t,
return value;
if (TREE_CODE (TREE_TYPE (field)) == INTEGER_TYPE
&& TREE_CODE (value) == INTEGER_CST
- && host_integerp (bitpos, 0)
- && host_integerp (DECL_SIZE (field), 0))
+ && 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);
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 84f765efe5e..c486a3d00d5 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -1519,7 +1519,7 @@ dbxout_type_fields (tree type)
/* Omit fields whose position or size are variable or too large to
represent. */
|| (TREE_CODE (tem) == FIELD_DECL
- && (! host_integerp (bit_position (tem), 0)
+ && (! tree_fits_shwi_p (bit_position (tem))
|| ! DECL_SIZE (tem)
|| ! host_integerp (DECL_SIZE (tem), 1))))
continue;
@@ -1610,7 +1610,7 @@ dbxout_type_method_1 (tree decl)
stabstr_C (c1);
stabstr_C (c2);
- if (DECL_VINDEX (decl) && host_integerp (DECL_VINDEX (decl), 0))
+ if (DECL_VINDEX (decl) && tree_fits_shwi_p (DECL_VINDEX (decl)))
{
stabstr_D (tree_low_cst (DECL_VINDEX (decl), 0));
stabstr_C (';');
@@ -1718,7 +1718,7 @@ dbxout_range_type (tree type, tree low, tree high)
}
stabstr_C (';');
- if (low && host_integerp (low, 0))
+ if (low && tree_fits_shwi_p (low))
{
if (print_int_cst_bounds_in_octal_p (type, low, high))
stabstr_O (low);
@@ -1729,7 +1729,7 @@ dbxout_range_type (tree type, tree low, tree high)
stabstr_C ('0');
stabstr_C (';');
- if (high && host_integerp (high, 0))
+ if (high && tree_fits_shwi_p (high))
{
if (print_int_cst_bounds_in_octal_p (type, low, high))
stabstr_O (high);
@@ -2516,7 +2516,7 @@ dbxout_expand_expr (tree expr)
return NULL;
if (offset != NULL)
{
- if (!host_integerp (offset, 0))
+ if (!tree_fits_shwi_p (offset))
return NULL;
x = adjust_address_nv (x, mode, tree_low_cst (offset, 0));
}
@@ -2912,7 +2912,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
??? Why do we skip emitting the type and location in this case? */
if (TREE_STATIC (decl) && TREE_READONLY (decl)
&& DECL_INITIAL (decl) != 0
- && host_integerp (DECL_INITIAL (decl), 0)
+ && tree_fits_shwi_p (DECL_INITIAL (decl))
&& ! TREE_ASM_WRITTEN (decl)
&& (DECL_FILE_SCOPE_P (decl)
|| TREE_CODE (DECL_CONTEXT (decl)) == BLOCK
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 24f405ec26a..bcfaddadae3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -14246,16 +14246,16 @@ loc_list_from_tree (tree loc, int want_address)
}
case INTEGER_CST:
- if ((want_address || !host_integerp (loc, 0))
+ if ((want_address || !tree_fits_shwi_p (loc))
&& (ret = cst_pool_loc_descr (loc)))
have_address = 1;
else if (want_address == 2
- && host_integerp (loc, 0)
+ && tree_fits_shwi_p (loc)
&& (ret = address_of_int_loc_descriptor
(int_size_in_bytes (TREE_TYPE (loc)),
tree_low_cst (loc, 0))))
have_address = 1;
- else if (host_integerp (loc, 0))
+ else if (tree_fits_shwi_p (loc))
ret = int_loc_descriptor (tree_low_cst (loc, 0));
else
{
@@ -14345,7 +14345,7 @@ loc_list_from_tree (tree loc, int want_address)
case POINTER_PLUS_EXPR:
case PLUS_EXPR:
- if (host_integerp (TREE_OPERAND (loc, 1), 0))
+ if (tree_fits_shwi_p (TREE_OPERAND (loc, 1)))
{
list_ret = loc_list_from_tree (TREE_OPERAND (loc, 0), 0);
if (list_ret == 0)
@@ -15526,7 +15526,7 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
*value = 0;
if (offset != NULL)
{
- if (!host_integerp (offset, 0))
+ if (!tree_fits_shwi_p (offset))
return NULL_TREE;
*value = tree_low_cst (offset, 0);
}
@@ -15694,7 +15694,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
constructor_elt *ce;
if (TYPE_DOMAIN (type) == NULL_TREE
- || !host_integerp (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0))
+ || !tree_fits_shwi_p (TYPE_MIN_VALUE (TYPE_DOMAIN (type))))
return false;
fieldsize = int_size_in_bytes (TREE_TYPE (type));
@@ -15768,7 +15768,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
&& ! TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (field))))
return false;
else if (DECL_SIZE_UNIT (field) == NULL_TREE
- || !host_integerp (DECL_SIZE_UNIT (field), 0))
+ || !tree_fits_shwi_p (DECL_SIZE_UNIT (field)))
return false;
fieldsize = tree_low_cst (DECL_SIZE_UNIT (field), 0);
pos = int_byte_position (field);
@@ -16160,7 +16160,7 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
/* Use the default if possible. */
if (bound_attr == DW_AT_lower_bound
- && host_integerp (bound, 0)
+ && tree_fits_shwi_p (bound)
&& (dflt = lower_bound_default ()) != -1
&& tree_low_cst (bound, 0) == dflt)
;
@@ -16394,7 +16394,7 @@ add_bit_offset_attribute (dw_die_ref die, tree decl)
/* We can't yet handle bit-fields whose offsets are variable, so if we
encounter such things, just return without generating any attribute
whatsoever. Likewise for variable or too large size. */
- if (! host_integerp (bit_position (decl), 0)
+ if (! tree_fits_shwi_p (bit_position (decl))
|| ! host_integerp (DECL_SIZE (decl), 1))
return;
@@ -16505,7 +16505,7 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl)
{
add_AT_unsigned (die, DW_AT_virtuality, DW_VIRTUALITY_virtual);
- if (host_integerp (DECL_VINDEX (func_decl), 0))
+ 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),
@@ -17055,7 +17055,7 @@ descr_info_loc (tree val, tree base_decl)
case VAR_DECL:
return loc_descriptor_from_tree (val, 0);
case INTEGER_CST:
- if (host_integerp (val, 0))
+ if (tree_fits_shwi_p (val))
return int_loc_descriptor (tree_low_cst (val, 0));
break;
case INDIRECT_REF:
@@ -17119,7 +17119,7 @@ add_descr_info_field (dw_die_ref die, enum dwarf_attribute attr,
{
dw_loc_descr_ref loc;
- if (host_integerp (val, 0))
+ if (tree_fits_shwi_p (val))
{
add_AT_unsigned (die, attr, tree_low_cst (val, 0));
return;
@@ -17172,7 +17172,7 @@ gen_descr_array_type_die (tree type, struct array_descr_info *info,
/* If it is the default value, omit it. */
int dflt;
- if (host_integerp (info->dimen[dim].lower_bound, 0)
+ 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)
;
@@ -17322,7 +17322,7 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
value = DECL_INITIAL (value);
if (simple_type_size_in_bits (TREE_TYPE (value))
- <= HOST_BITS_PER_WIDE_INT || host_integerp (value, 0))
+ <= HOST_BITS_PER_WIDE_INT || tree_fits_shwi_p (value))
/* DWARF2 does not provide a way of indicating whether or
not enumeration constants are signed or unsigned. GDB
always assumes the values are signed, so we output all
@@ -23112,7 +23112,7 @@ optimize_location_into_implicit_ptr (dw_die_ref die, tree decl)
we can add DW_OP_GNU_implicit_pointer. */
STRIP_NOPS (init);
if (TREE_CODE (init) == POINTER_PLUS_EXPR
- && host_integerp (TREE_OPERAND (init, 1), 0))
+ && tree_fits_shwi_p (TREE_OPERAND (init, 1)))
{
offset = tree_low_cst (TREE_OPERAND (init, 1), 0);
init = TREE_OPERAND (init, 0);
diff --git a/gcc/except.c b/gcc/except.c
index a52d317ddae..63d4024b793 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2050,7 +2050,7 @@ expand_builtin_eh_common (tree region_nr_t)
HOST_WIDE_INT region_nr;
eh_region region;
- gcc_assert (host_integerp (region_nr_t, 0));
+ gcc_assert (tree_fits_shwi_p (region_nr_t));
region_nr = tree_low_cst (region_nr_t, 0);
region = (*cfun->eh->region_array)[region_nr];
diff --git a/gcc/explow.c b/gcc/explow.c
index bf5742de896..a9457690c5a 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -282,7 +282,7 @@ int_expr_size (tree exp)
gcc_assert (size);
}
- if (size == 0 || !host_integerp (size, 0))
+ if (size == 0 || !tree_fits_shwi_p (size))
return -1;
return tree_low_cst (size, 0);
diff --git a/gcc/expr.c b/gcc/expr.c
index 23854ccf5c7..5fbba60706a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5918,8 +5918,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
mode = VOIDmode;
offset = DECL_FIELD_OFFSET (field);
- if (host_integerp (offset, 0)
- && host_integerp (bit_position (field), 0))
+ if (tree_fits_shwi_p (offset)
+ && tree_fits_shwi_p (bit_position (field)))
{
bitpos = int_bit_position (field);
offset = 0;
@@ -6008,8 +6008,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
domain = TYPE_DOMAIN (type);
const_bounds_p = (TYPE_MIN_VALUE (domain)
&& TYPE_MAX_VALUE (domain)
- && host_integerp (TYPE_MIN_VALUE (domain), 0)
- && host_integerp (TYPE_MAX_VALUE (domain), 0));
+ && tree_fits_shwi_p (TYPE_MIN_VALUE (domain))
+ && tree_fits_shwi_p (TYPE_MAX_VALUE (domain)));
/* If we have constant bounds for the range of the type, get them. */
if (const_bounds_p)
@@ -6118,8 +6118,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
/* If the range is constant and "small", unroll the loop. */
if (const_bounds_p
- && host_integerp (lo_index, 0)
- && host_integerp (hi_index, 0)
+ && 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),
count = hi - lo + 1,
@@ -6207,7 +6207,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
emit_label (loop_end);
}
}
- else if ((index != 0 && ! host_integerp (index, 0))
+ else if ((index != 0 && ! tree_fits_shwi_p (index))
|| ! host_integerp (TYPE_SIZE (elttype), 1))
{
tree position;
@@ -8538,7 +8538,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
indexed address, for machines that support that. */
if (modifier == EXPAND_SUM && mode == ptr_mode
- && host_integerp (treeop1, 0))
+ && tree_fits_shwi_p (treeop1))
{
tree exp1 = treeop1;
diff --git a/gcc/expr.h b/gcc/expr.h
index ae760915895..6dc71dce6ae 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -94,7 +94,7 @@ struct locate_and_pad_arg_data
#define ADD_PARM_SIZE(TO, INC) \
do { \
tree inc = (INC); \
- if (host_integerp (inc, 0)) \
+ if (tree_fits_shwi_p (inc)) \
(TO).constant += tree_low_cst (inc, 0); \
else if ((TO).var == 0) \
(TO).var = fold_convert (ssizetype, inc); \
@@ -106,7 +106,7 @@ do { \
#define SUB_PARM_SIZE(TO, DEC) \
do { \
tree dec = (DEC); \
- if (host_integerp (dec, 0)) \
+ if (tree_fits_shwi_p (dec)) \
(TO).constant -= tree_low_cst (dec, 0); \
else if ((TO).var == 0) \
(TO).var = size_binop (MINUS_EXPR, ssize_int (0), \
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 87cde0454a3..d6187bf4997 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3420,7 +3420,7 @@ make_bit_field_ref (location_t loc, tree inner, tree type,
tree size = TYPE_SIZE (TREE_TYPE (inner));
if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
|| POINTER_TYPE_P (TREE_TYPE (inner)))
- && host_integerp (size, 0)
+ && tree_fits_shwi_p (size)
&& tree_low_cst (size, 0) == bitsize)
return fold_convert_loc (loc, type, inner);
}
@@ -7255,8 +7255,8 @@ fold_plusminus_mult_expr (location_t loc, enum tree_code code, tree type,
/* No identical multiplicands; see if we can find a common
power-of-two factor in non-power-of-two multiplies. This
can help in multi-dimensional array access. */
- else if (host_integerp (arg01, 0)
- && host_integerp (arg11, 0))
+ else if (tree_fits_shwi_p (arg01)
+ && tree_fits_shwi_p (arg11))
{
HOST_WIDE_INT int01, int11, tmp;
bool swap = false;
@@ -7488,7 +7488,7 @@ native_encode_string (const_tree expr, unsigned char *ptr, int len)
if (TREE_CODE (type) != ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE
|| GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) != BITS_PER_UNIT
- || !host_integerp (TYPE_SIZE_UNIT (type), 0))
+ || !tree_fits_shwi_p (TYPE_SIZE_UNIT (type)))
return 0;
total_bytes = tree_low_cst (TYPE_SIZE_UNIT (type), 0);
if (total_bytes > len)
@@ -9089,7 +9089,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
indirect_base0 = true;
}
offset0 = TREE_OPERAND (arg0, 1);
- if (host_integerp (offset0, 0))
+ if (tree_fits_shwi_p (offset0))
{
HOST_WIDE_INT off = size_low_cst (offset0);
if ((HOST_WIDE_INT) (((unsigned HOST_WIDE_INT) off)
@@ -9123,7 +9123,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
indirect_base1 = true;
}
offset1 = TREE_OPERAND (arg1, 1);
- if (host_integerp (offset1, 0))
+ if (tree_fits_shwi_p (offset1))
{
HOST_WIDE_INT off = size_low_cst (offset1);
if ((HOST_WIDE_INT) (((unsigned HOST_WIDE_INT) off)
@@ -12676,9 +12676,9 @@ fold_binary_loc (location_t loc,
if (((code == LSHIFT_EXPR && TREE_CODE (arg0) == RSHIFT_EXPR)
|| (TYPE_UNSIGNED (type)
&& code == RSHIFT_EXPR && TREE_CODE (arg0) == LSHIFT_EXPR))
- && host_integerp (arg1, false)
+ && tree_fits_shwi_p (arg1)
&& TREE_INT_CST_LOW (arg1) < prec
- && host_integerp (TREE_OPERAND (arg0, 1), false)
+ && tree_fits_shwi_p (TREE_OPERAND (arg0, 1))
&& TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < prec)
{
HOST_WIDE_INT low0 = TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1));
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 62c55509359..88761bb42e1 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -2720,7 +2720,7 @@ get_base_constructor (tree base, HOST_WIDE_INT *bit_offset,
{
if (!integer_zerop (TREE_OPERAND (base, 1)))
{
- if (!host_integerp (TREE_OPERAND (base, 1), 0))
+ if (!tree_fits_shwi_p (TREE_OPERAND (base, 1)))
return NULL_TREE;
*bit_offset += (mem_ref_offset (base).low
* BITS_PER_UNIT);
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 6de20e39615..51bf7c7c01f 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -609,7 +609,7 @@ stmt_cost (gimple gs, bool speed)
case MULT_EXPR:
rhs2 = gimple_assign_rhs2 (gs);
- if (host_integerp (rhs2, 0))
+ if (tree_fits_shwi_p (rhs2))
return mult_by_coeff_cost (TREE_INT_CST_LOW (rhs2), lhs_mode, speed);
gcc_assert (TREE_CODE (rhs1) != INTEGER_CST);
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 2d642616ae3..10d7edc1a39 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2098,8 +2098,8 @@ gimple_compare_field_offset (tree f1, tree f2)
/* Fortran and C do not always agree on what DECL_OFFSET_ALIGN
should be, so handle differing ones specially by decomposing
the offset into a byte and bit offset manually. */
- if (host_integerp (DECL_FIELD_OFFSET (f1), 0)
- && host_integerp (DECL_FIELD_OFFSET (f2), 0))
+ if (tree_fits_shwi_p (DECL_FIELD_OFFSET (f1))
+ && tree_fits_shwi_p (DECL_FIELD_OFFSET (f2)))
{
unsigned HOST_WIDE_INT byte_offset1, byte_offset2;
unsigned HOST_WIDE_INT bit_offset1, bit_offset2;
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 54d9f3bf9b4..63460043067 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gofrontend/expressions.cc: Replace host_integerp (..., 0) with
+ tree_fits_shwi_p throughout.
+
2013-11-14 Andrew MacLeod <amacleod@redhat.com>
* go-lang.c: Include only gimplify.h and gimple.h as needed.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 4d2fbfd5a58..ca1bb98f9ff 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -3343,7 +3343,7 @@ Type_conversion_expression::do_get_tree(Translate_context* context)
tree int_type_tree = type_to_tree(int_type->get_backend(gogo));
expr_tree = fold_convert(int_type_tree, expr_tree);
- if (host_integerp(expr_tree, 0))
+ if (tree_fits_shwi_p (expr_tree))
{
HOST_WIDE_INT intval = tree_low_cst(expr_tree, 0);
std::string s;
diff --git a/gcc/godump.c b/gcc/godump.c
index 0303e4f0628..8ae38e5f124 100644
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -728,7 +728,7 @@ go_format_type (struct godump_container *container, tree type,
&& tree_int_cst_sgn (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) == 0
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != NULL_TREE
&& TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST
- && host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0))
+ && tree_fits_shwi_p (TYPE_MAX_VALUE (TYPE_DOMAIN (type))))
{
char buf[100];
@@ -981,7 +981,7 @@ go_output_typedef (struct godump_container *container, tree decl)
if (*slot != NULL)
macro_hash_del (*slot);
- if (host_integerp (TREE_VALUE (element), 0))
+ if (tree_fits_shwi_p (TREE_VALUE (element)))
snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC,
tree_low_cst (TREE_VALUE (element), 0));
else if (host_integerp (TREE_VALUE (element), 1))
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 8ac22db553e..7b0ae7ea74d 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -170,10 +170,10 @@ graphite_can_represent_init (tree e)
case MULT_EXPR:
if (chrec_contains_symbols (TREE_OPERAND (e, 0)))
return graphite_can_represent_init (TREE_OPERAND (e, 0))
- && host_integerp (TREE_OPERAND (e, 1), 0);
+ && tree_fits_shwi_p (TREE_OPERAND (e, 1));
else
return graphite_can_represent_init (TREE_OPERAND (e, 1))
- && host_integerp (TREE_OPERAND (e, 0), 0);
+ && tree_fits_shwi_p (TREE_OPERAND (e, 0));
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index a07e047832e..1b2cd998f2c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1508,9 +1508,9 @@ pdr_add_data_dimensions (isl_set *extent, scop_p scop, data_reference_p dr)
subscript - low >= 0 and high - subscript >= 0 in case one of
the two bounds isn't known. Do the same here? */
- if (host_integerp (low, 0)
+ if (tree_fits_shwi_p (low)
&& high
- && host_integerp (high, 0)
+ && tree_fits_shwi_p (high)
/* 1-element arrays at end of structures may extend over
their declared size. */
&& !(array_at_struct_end_p (ref)
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a474ccc0d7f..01d50f2c111 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * class.c, expr.c: Replace host_integerp (..., 0) with
+ tree_fits_shwi_p throughout.
+
2013-11-14 Andrew MacLeod <amacleod@redhat.com>
* java-gimplify.c: Include only gimplify.h and gimple.h as needed.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index cb6789643d3..5eb245e5376 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1592,7 +1592,7 @@ get_dispatch_vector (tree type)
{
tree method_index = get_method_index (method);
if (method_index != NULL_TREE
- && host_integerp (method_index, 0))
+ && tree_fits_shwi_p (method_index))
TREE_VEC_ELT (vtable, tree_low_cst (method_index, 0)) = method;
}
}
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index a434913d475..0720065717c 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1049,7 +1049,7 @@ build_newarray (int atype_value, tree length)
tree prim_type = decode_newarray_type (atype_value);
tree type
= build_java_array_type (prim_type,
- host_integerp (length, 0) == INTEGER_CST
+ tree_fits_shwi_p (length) == INTEGER_CST
? tree_low_cst (length, 0) : -1);
/* Pass a reference to the primitive type class and save the runtime
@@ -1069,7 +1069,7 @@ build_anewarray (tree class_type, tree length)
{
tree type
= build_java_array_type (class_type,
- host_integerp (length, 0)
+ tree_fits_shwi_p (length)
? tree_low_cst (length, 0) : -1);
return build_call_nary (promote_type (type),
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 8d5de21bd4b..f67494b47af 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -2290,7 +2290,7 @@ check_omp_nesting_restrictions (gimple stmt, omp_context *ctx)
: "#pragma omp cancellation point");
return false;
}
- switch (host_integerp (gimple_call_arg (stmt, 0), 0)
+ switch (tree_fits_shwi_p (gimple_call_arg (stmt, 0))
? tree_low_cst (gimple_call_arg (stmt, 0), 0)
: 0)
{
@@ -8832,7 +8832,7 @@ lower_omp_for_lastprivate (struct omp_for_data *fd, gimple_seq *body_p,
/* When possible, use a strict equality expression. This can let VRP
type optimizations deduce the value and remove a copy. */
- if (host_integerp (fd->loop.step, 0))
+ if (tree_fits_shwi_p (fd->loop.step))
{
HOST_WIDE_INT step = TREE_INT_CST_LOW (fd->loop.step);
if (step == 1 || step == -1)
@@ -8852,7 +8852,7 @@ lower_omp_for_lastprivate (struct omp_for_data *fd, gimple_seq *body_p,
/* Optimize: v = 0; is usually cheaper than v = some_other_constant. */
vinit = fd->loop.n1;
if (cond_code == EQ_EXPR
- && host_integerp (fd->loop.n2, 0)
+ && tree_fits_shwi_p (fd->loop.n2)
&& ! integer_zerop (fd->loop.n2))
vinit = build_int_cst (TREE_TYPE (fd->loop.v), 0);
else
diff --git a/gcc/predict.c b/gcc/predict.c
index 871fecc0f50..25367825ce9 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -1053,14 +1053,14 @@ strips_small_constant (tree t1, tree t2)
return NULL;
else if (TREE_CODE (t1) == SSA_NAME)
ret = t1;
- else if (host_integerp (t1, 0))
+ else if (tree_fits_shwi_p (t1))
value = tree_low_cst (t1, 0);
else
return NULL;
if (!t2)
return ret;
- else if (host_integerp (t2, 0))
+ else if (tree_fits_shwi_p (t2))
value = tree_low_cst (t2, 0);
else if (TREE_CODE (t2) == SSA_NAME)
{
@@ -1157,7 +1157,7 @@ is_comparison_with_loop_invariant_p (gimple stmt, struct loop *loop,
code = invert_tree_comparison (code, false);
bound = iv0.base;
base = iv1.base;
- if (host_integerp (iv1.step, 0))
+ if (tree_fits_shwi_p (iv1.step))
step = iv1.step;
else
return false;
@@ -1166,7 +1166,7 @@ is_comparison_with_loop_invariant_p (gimple stmt, struct loop *loop,
{
bound = iv1.base;
base = iv0.base;
- if (host_integerp (iv0.step, 0))
+ if (tree_fits_shwi_p (iv0.step))
step = iv0.step;
else
return false;
@@ -1300,9 +1300,9 @@ predict_iv_comparison (struct loop *loop, basic_block bb,
/* If loop bound, base and compare bound are all constants, we can
calculate the probability directly. */
- if (host_integerp (loop_bound_var, 0)
- && host_integerp (compare_var, 0)
- && host_integerp (compare_base, 0))
+ if (tree_fits_shwi_p (loop_bound_var)
+ && tree_fits_shwi_p (compare_var)
+ && tree_fits_shwi_p (compare_base))
{
int probability;
bool of, overflow = false;
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index b9f3e2b7925..4f1e4ee5826 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -279,7 +279,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size,
if (!decl)
decl_size = -1;
else if (DECL_P (decl) && DECL_SIZE_UNIT (decl))
- decl_size = (host_integerp (DECL_SIZE_UNIT (decl), 0)
+ decl_size = (tree_fits_shwi_p (DECL_SIZE_UNIT (decl))
? tree_low_cst (DECL_SIZE_UNIT (decl), 0)
: -1);
else if (TREE_CODE (decl) == STRING_CST)
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 1eedde3f520..66682a3c21e 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -535,8 +535,8 @@ plain_type_1 (tree type, int level)
= (TYPE_DOMAIN (type)
&& TYPE_MIN_VALUE (TYPE_DOMAIN (type)) != 0
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != 0
- && host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
- && host_integerp (TYPE_MIN_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)
: 0);
@@ -995,7 +995,7 @@ sdbout_field_types (tree type)
&& DECL_NAME (tail)
&& DECL_SIZE (tail)
&& host_integerp (DECL_SIZE (tail), 1)
- && host_integerp (bit_position (tail), 0))
+ && tree_fits_shwi_p (bit_position (tail)))
{
if (POINTER_TYPE_P (TREE_TYPE (tail)))
sdbout_one_type (TREE_TYPE (TREE_TYPE (tail)));
@@ -1152,7 +1152,7 @@ sdbout_one_type (tree type)
if (TREE_CODE (value) == CONST_DECL)
value = DECL_INITIAL (value);
- if (host_integerp (value, 0))
+ if (tree_fits_shwi_p (value))
{
PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
PUT_SDB_INT_VAL (tree_low_cst (value, 0));
@@ -1174,7 +1174,7 @@ sdbout_one_type (tree type)
&& DECL_NAME (tem)
&& DECL_SIZE (tem)
&& host_integerp (DECL_SIZE (tem), 1)
- && host_integerp (bit_position (tem), 0))
+ && tree_fits_shwi_p (bit_position (tem)))
{
const char *name;
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 432842ecf0b..6e174e5575c 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -298,7 +298,7 @@ delegitimize_mem_from_attrs (rtx x)
&mode, &unsignedp, &volatilep, false);
if (bitsize != GET_MODE_BITSIZE (mode)
|| (bitpos % BITS_PER_UNIT)
- || (toffset && !host_integerp (toffset, 0)))
+ || (toffset && !tree_fits_shwi_p (toffset)))
decl = NULL;
else
{
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 264c33e3a0b..d6a8687bdde 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1300,8 +1300,8 @@ place_field (record_layout_info rli, tree field)
if (DECL_BIT_FIELD_TYPE (field)
&& !integer_zerop (DECL_SIZE (field))
&& !integer_zerop (DECL_SIZE (rli->prev_field))
- && host_integerp (DECL_SIZE (rli->prev_field), 0)
- && host_integerp (TYPE_SIZE (type), 0)
+ && tree_fits_shwi_p (DECL_SIZE (rli->prev_field))
+ && tree_fits_shwi_p (TYPE_SIZE (type))
&& simple_cst_equal (TYPE_SIZE (type), TYPE_SIZE (prev_type)))
{
/* We're in the middle of a run of equal type size fields; make
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 2aa58363224..c0ee654561c 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -2838,14 +2838,14 @@ gcd_of_steps_may_divide_p (const_tree chrec, const_tree cst)
HOST_WIDE_INT cd = 0, val;
tree step;
- if (!host_integerp (cst, 0))
+ if (!tree_fits_shwi_p (cst))
return true;
val = tree_low_cst (cst, 0);
while (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
{
step = CHREC_RIGHT (chrec);
- if (!host_integerp (step, 0))
+ if (!tree_fits_shwi_p (step))
return true;
cd = gcd (cd, tree_low_cst (step, 0));
chrec = CHREC_LEFT (chrec);
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 91f8c0ef00d..83fe0d81100 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -455,8 +455,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
{
tree fsize = DECL_SIZE_UNIT (field);
tree ssize = TYPE_SIZE_UNIT (stype);
- if (host_integerp (fsize, 0)
- && host_integerp (ssize, 0)
+ if (tree_fits_shwi_p (fsize)
+ && tree_fits_shwi_p (ssize)
&& doffset.fits_shwi ())
maxsize += ((TREE_INT_CST_LOW (ssize)
- TREE_INT_CST_LOW (fsize))
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 7fe849d914f..6a1c678df36 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -272,7 +272,7 @@ dump_array_domain (pretty_printer *buffer, tree domain, int spc, int flags)
if (min && max
&& integer_zerop (min)
- && host_integerp (max, 0))
+ && tree_fits_shwi_p (max))
pp_wide_integer (buffer, TREE_INT_CST_LOW (max) + 1);
else
{
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index c3f6823c579..2ac9ba1f004 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -752,7 +752,7 @@ type_internals_preclude_sra_p (tree type, const char **msg)
*msg = "structure field size not fixed";
return true;
}
- if (!host_integerp (bit_position (fld), 0))
+ if (!tree_fits_shwi_p (bit_position (fld)))
{
*msg = "structure field size too big";
return true;
@@ -2119,7 +2119,7 @@ expr_with_var_bounded_array_refs_p (tree expr)
while (handled_component_p (expr))
{
if (TREE_CODE (expr) == ARRAY_REF
- && !host_integerp (array_ref_low_bound (expr), 0))
+ && !tree_fits_shwi_p (array_ref_low_bound (expr)))
return true;
expr = TREE_OPERAND (expr, 0);
}
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index a33b122d274..c1028fb7606 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -614,7 +614,7 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size)
}
ref->offset += extra_offset;
if (size
- && host_integerp (size, 0)
+ && tree_fits_shwi_p (size)
&& TREE_INT_CST_LOW (size) * BITS_PER_UNIT / BITS_PER_UNIT
== TREE_INT_CST_LOW (size))
ref->max_size = ref->size = TREE_INT_CST_LOW (size) * BITS_PER_UNIT;
@@ -2108,7 +2108,7 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref *ref)
{
tree dest = gimple_call_arg (stmt, 0);
tree len = gimple_call_arg (stmt, 2);
- if (!host_integerp (len, 0))
+ if (!tree_fits_shwi_p (len))
return false;
tree rbase = ref->base;
double_int roffset = double_int::from_shwi (ref->offset);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index ce9c0114f82..e793dbfe88c 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1527,7 +1527,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
char *src_buf;
use_operand_p use_p;
- if (!host_integerp (val2, 0)
+ if (!tree_fits_shwi_p (val2)
|| !host_integerp (len2, 1))
break;
if (is_gimple_call (stmt1))
@@ -1569,7 +1569,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
src1 = gimple_assign_rhs1 (stmt1);
if (TREE_CODE (ptr1) != MEM_REF
|| TYPE_MODE (TREE_TYPE (ptr1)) != TYPE_MODE (char_type_node)
- || !host_integerp (src1, 0))
+ || !tree_fits_shwi_p (src1))
break;
ptr1 = build_fold_addr_expr (ptr1);
callee1 = NULL_TREE;
@@ -2354,7 +2354,7 @@ simplify_rotate (gimple_stmt_iterator *gsi)
/* Check for one shift count being Y and the other B - Y,
with optional casts. */
if (cdef_code[i] == MINUS_EXPR
- && host_integerp (cdef_arg1[i], 0)
+ && tree_fits_shwi_p (cdef_arg1[i])
&& tree_low_cst (cdef_arg1[i], 0) == TYPE_PRECISION (rtype)
&& TREE_CODE (cdef_arg2[i]) == SSA_NAME)
{
@@ -2386,7 +2386,7 @@ simplify_rotate (gimple_stmt_iterator *gsi)
This alternative is safe even for rotation count of 0.
One shift count is Y and the other (-Y) & (B - 1). */
else if (cdef_code[i] == BIT_AND_EXPR
- && host_integerp (cdef_arg2[i], 0)
+ && tree_fits_shwi_p (cdef_arg2[i])
&& tree_low_cst (cdef_arg2[i], 0)
== TYPE_PRECISION (rtype) - 1
&& TREE_CODE (cdef_arg1[i]) == SSA_NAME
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 6d5eeb5de99..3207dae7c18 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -3970,7 +3970,7 @@ get_loop_invariant_expr_id (struct ivopts_data *data, tree ubase,
{
tree ind = TREE_OPERAND (usym, 1);
if (TREE_CODE (ind) == INTEGER_CST
- && host_integerp (ind, 0)
+ && tree_fits_shwi_p (ind)
&& TREE_INT_CST_LOW (ind) == 0)
usym = TREE_OPERAND (usym, 0);
}
@@ -3978,7 +3978,7 @@ get_loop_invariant_expr_id (struct ivopts_data *data, tree ubase,
{
tree ind = TREE_OPERAND (csym, 1);
if (TREE_CODE (ind) == INTEGER_CST
- && host_integerp (ind, 0)
+ && tree_fits_shwi_p (ind)
&& TREE_INT_CST_LOW (ind) == 0)
csym = TREE_OPERAND (csym, 0);
}
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 0939541746e..e00989527aa 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -1458,7 +1458,7 @@ add_subscript_strides (tree access_fn, unsigned stride,
if ((unsigned) loop_depth (aloop) <= min_depth)
continue;
- if (host_integerp (step, 0))
+ if (tree_fits_shwi_p (step))
astep = tree_low_cst (step, 0);
else
astep = L1_CACHE_LINE_SIZE;
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index ca3596c8a0e..fb4ce58378d 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1502,7 +1502,7 @@ execute_cse_sincos (void)
}
else
{
- if (!host_integerp (arg1, 0))
+ if (!tree_fits_shwi_p (arg1))
break;
n = TREE_INT_CST_LOW (arg1);
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 7f4a3fddb80..4fdaba26d0e 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -1360,7 +1360,7 @@ add_or_mark_expr (basic_block bb, tree exp,
if (TREE_CODE (exp) == MEM_REF
&& TREE_CODE (TREE_OPERAND (exp, 0)) == SSA_NAME
- && host_integerp (TREE_OPERAND (exp, 1), 0)
+ && tree_fits_shwi_p (TREE_OPERAND (exp, 1))
&& (size = int_size_in_bytes (TREE_TYPE (exp))) > 0)
{
tree name = TREE_OPERAND (exp, 0);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 4d0e5e4aa47..ec5ca02b5b4 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -3635,7 +3635,7 @@ acceptable_pow_call (gimple stmt, tree *base, HOST_WIDE_INT *exponent)
*base = gimple_call_arg (stmt, 0);
arg1 = gimple_call_arg (stmt, 1);
- if (!host_integerp (arg1, 0))
+ if (!tree_fits_shwi_p (arg1))
return false;
*exponent = TREE_INT_CST_LOW (arg1);
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 1be324e8d5d..fe01a4128dc 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -782,7 +782,7 @@ copy_reference_ops_from_ref (tree ref, vec<vn_reference_op_s> *result)
case MEM_REF:
/* The base address gets its own vn_reference_op_s structure. */
temp.op0 = TREE_OPERAND (ref, 1);
- if (host_integerp (TREE_OPERAND (ref, 1), 0))
+ if (tree_fits_shwi_p (TREE_OPERAND (ref, 1)))
temp.off = TREE_INT_CST_LOW (TREE_OPERAND (ref, 1));
break;
case BIT_FIELD_REF:
@@ -1020,9 +1020,9 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
case ARRAY_RANGE_REF:
case ARRAY_REF:
/* We recorded the lower bound and the element size. */
- if (!host_integerp (op->op0, 0)
- || !host_integerp (op->op1, 0)
- || !host_integerp (op->op2, 0))
+ if (!tree_fits_shwi_p (op->op0)
+ || !tree_fits_shwi_p (op->op1)
+ || !tree_fits_shwi_p (op->op2))
max_size = -1;
else
{
@@ -1156,7 +1156,7 @@ vn_reference_fold_indirect (vec<vn_reference_op_s> *ops,
off += double_int::from_shwi (addr_offset);
mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off);
op->op0 = build_fold_addr_expr (addr_base);
- if (host_integerp (mem_op->op0, 0))
+ if (tree_fits_shwi_p (mem_op->op0))
mem_op->off = TREE_INT_CST_LOW (mem_op->op0);
else
mem_op->off = -1;
@@ -1221,7 +1221,7 @@ vn_reference_maybe_forwprop_address (vec<vn_reference_op_s> *ops,
}
mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off);
- if (host_integerp (mem_op->op0, 0))
+ if (tree_fits_shwi_p (mem_op->op0))
mem_op->off = TREE_INT_CST_LOW (mem_op->op0);
else
mem_op->off = -1;
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index cfd7b00c6a8..0e66b67bb24 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -215,7 +215,7 @@ get_stridx (tree exp)
s = string_constant (exp, &o);
if (s != NULL_TREE
- && (o == NULL_TREE || host_integerp (o, 0))
+ && (o == NULL_TREE || tree_fits_shwi_p (o))
&& TREE_STRING_LENGTH (s) > 0)
{
HOST_WIDE_INT offset = o ? tree_low_cst (o, 0) : 0;
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index b478304b965..78693a32e89 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2994,8 +2994,8 @@ process_constraint (constraint_t t)
static HOST_WIDE_INT
bitpos_of_field (const tree fdecl)
{
- if (!host_integerp (DECL_FIELD_OFFSET (fdecl), 0)
- || !host_integerp (DECL_FIELD_BIT_OFFSET (fdecl), 0))
+ if (!tree_fits_shwi_p (DECL_FIELD_OFFSET (fdecl))
+ || !tree_fits_shwi_p (DECL_FIELD_BIT_OFFSET (fdecl)))
return -1;
return (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fdecl)) * BITS_PER_UNIT
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 2d0c3dc9e2d..380002161a2 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2547,8 +2547,8 @@ vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
if (!host_integerp (sza, 1)
|| !host_integerp (szb, 1)
|| !tree_int_cst_equal (sza, szb)
- || !host_integerp (DR_STEP (dra), 0)
- || !host_integerp (DR_STEP (drb), 0)
+ || !tree_fits_shwi_p (DR_STEP (dra))
+ || !tree_fits_shwi_p (DR_STEP (drb))
|| !tree_int_cst_equal (DR_STEP (dra), DR_STEP (drb)))
break;
@@ -2877,8 +2877,8 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
if (!operand_equal_p (DR_BASE_ADDRESS (dr_a1->dr),
DR_BASE_ADDRESS (dr_a2->dr),
0)
- || !host_integerp (dr_a1->offset, 0)
- || !host_integerp (dr_a2->offset, 0))
+ || !tree_fits_shwi_p (dr_a1->offset)
+ || !tree_fits_shwi_p (dr_a2->offset))
continue;
HOST_WIDE_INT diff = TREE_INT_CST_LOW (dr_a2->offset) -
@@ -3069,7 +3069,7 @@ vect_check_gather (gimple stmt, loop_vec_info loop_vinfo, tree *basep,
}
break;
case MULT_EXPR:
- if (scale == 1 && host_integerp (op1, 0))
+ if (scale == 1 && tree_fits_shwi_p (op1))
{
scale = tree_low_cst (op1, 0);
off = op0;
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index edf1e7eb2d9..ba0f4feea6e 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -783,7 +783,7 @@ vect_recog_pow_pattern (vec<gimple> *stmts, tree *type_in,
*type_out = NULL_TREE;
/* Catch squaring. */
- if ((host_integerp (exp, 0)
+ if ((tree_fits_shwi_p (exp)
&& tree_low_cst (exp, 0) == 2)
|| (TREE_CODE (exp) == REAL_CST
&& REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2)))
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 0ce78d9508d..a6c5b596e9b 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -388,7 +388,7 @@ typedef struct _loop_vec_info {
(L)->may_alias_ddrs.length () > 0
#define NITERS_KNOWN_P(n) \
-(host_integerp ((n),0) \
+(tree_fits_shwi_p ((n)) \
&& TREE_INT_CST_LOW ((n)) > 0)
#define LOOP_VINFO_NITERS_KNOWN_P(L) \
diff --git a/gcc/tree.c b/gcc/tree.c
index 374f560817e..59c5452a9a0 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5040,7 +5040,7 @@ free_lang_data_in_decl (tree decl)
DECL_VINDEX referring to itself into a vtable slot number as it
should. Happens with functions that are copied and then forgotten
about. Just clear it, it won't matter anymore. */
- if (DECL_VINDEX (decl) && !host_integerp (DECL_VINDEX (decl), 0))
+ if (DECL_VINDEX (decl) && !tree_fits_shwi_p (DECL_VINDEX (decl)))
DECL_VINDEX (decl) = NULL_TREE;
}
else if (TREE_CODE (decl) == VAR_DECL)
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 8b07f9fbf9f..e07cbe6b55a 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -6290,7 +6290,7 @@ prepare_call_arguments (basic_block bb, rtx insn)
&& DECL_INITIAL (SYMBOL_REF_DECL (l->loc)))
{
initial = DECL_INITIAL (SYMBOL_REF_DECL (l->loc));
- if (host_integerp (initial, 0))
+ if (tree_fits_shwi_p (initial))
{
item = GEN_INT (tree_low_cst (initial, 0));
item = gen_rtx_CONCAT (indmode, mem, item);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 22269122993..3420e220566 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2709,7 +2709,7 @@ decode_addr_const (tree exp, struct addr_const *value)
while (1)
{
if (TREE_CODE (target) == COMPONENT_REF
- && host_integerp (byte_position (TREE_OPERAND (target, 1)), 0))
+ && tree_fits_shwi_p (byte_position (TREE_OPERAND (target, 1))))
{
offset += int_byte_position (TREE_OPERAND (target, 1));
target = TREE_OPERAND (target, 0);