cuintp.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout.
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. From-SVN: r204955
This commit is contained in:
parent
b04268a57f
commit
9541ffee8c
|
@ -1,3 +1,20 @@
|
||||||
|
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>
|
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Declare.
|
* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Declare.
|
||||||
|
|
|
@ -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>
|
2013-11-18 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* gcc-interface/trans.c (TARGET_ABI_OPEN_VMS): Delete as redundant.
|
* gcc-interface/trans.c (TARGET_ABI_OPEN_VMS): Delete as redundant.
|
||||||
|
|
|
@ -153,7 +153,7 @@ UI_From_gnu (tree Input)
|
||||||
/* On 64-bit hosts, host_integerp tells whether the input fits in a
|
/* On 64-bit hosts, host_integerp tells whether the input fits in a
|
||||||
signed 64-bit integer. Then a truncation tells whether it fits
|
signed 64-bit integer. Then a truncation tells whether it fits
|
||||||
in a signed 32-bit integer. */
|
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);
|
HOST_WIDE_INT hw_input = TREE_INT_CST_LOW (Input);
|
||||||
if (hw_input == (int) hw_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
|
/* 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
|
signed 32-bit integer. Then a sign test tells whether it fits
|
||||||
in a signed 64-bit integer. */
|
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));
|
return UI_From_Int (TREE_INT_CST_LOW (Input));
|
||||||
else if (TREE_INT_CST_HIGH (Input) < 0 && TYPE_UNSIGNED (gnu_type))
|
else if (TREE_INT_CST_HIGH (Input) < 0 && TYPE_UNSIGNED (gnu_type))
|
||||||
return No_Uint;
|
return No_Uint;
|
||||||
|
|
|
@ -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. */
|
a null character if we can represent it as a single HOST_WIDE_INT. */
|
||||||
if (offset_node == 0)
|
if (offset_node == 0)
|
||||||
offset = 0;
|
offset = 0;
|
||||||
else if (! host_integerp (offset_node, 0))
|
else if (! tree_fits_shwi_p (offset_node))
|
||||||
offset = -1;
|
offset = -1;
|
||||||
else
|
else
|
||||||
offset = tree_low_cst (offset_node, 0);
|
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);
|
weak = CALL_EXPR_ARG (exp, 3);
|
||||||
is_weak = false;
|
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;
|
is_weak = true;
|
||||||
|
|
||||||
oldval = expect;
|
oldval = expect;
|
||||||
|
@ -8547,7 +8547,7 @@ fold_builtin_powi (location_t loc, tree fndecl ATTRIBUTE_UNUSED,
|
||||||
if (real_onep (arg0))
|
if (real_onep (arg0))
|
||||||
return omit_one_operand_loc (loc, type, build_real (type, dconst1), arg1);
|
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);
|
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;
|
return NULL_TREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!host_integerp (len, 0))
|
if (!tree_fits_shwi_p (len))
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
/* FIXME:
|
/* FIXME:
|
||||||
This logic lose for arguments like (type *)malloc (sizeof (type)),
|
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 both arguments are constant, then try to evaluate it. */
|
||||||
if ((ldexp || REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2)
|
if ((ldexp || REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2)
|
||||||
&& TREE_CODE (arg0) == REAL_CST && !TREE_OVERFLOW (arg0)
|
&& 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
|
/* Bound the maximum adjustment to twice the range of the
|
||||||
mode's valid exponents. Use abs to ensure the range is
|
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
|
/* To proceed, MPFR must exactly represent the target floating point
|
||||||
format, which only happens when the target base equals two. */
|
format, which only happens when the target base equals two. */
|
||||||
if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
|
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))
|
&& TREE_CODE (arg2) == REAL_CST && !TREE_OVERFLOW (arg2))
|
||||||
{
|
{
|
||||||
const HOST_WIDE_INT n = tree_low_cst (arg1, 0);
|
const HOST_WIDE_INT n = tree_low_cst (arg1, 0);
|
||||||
|
|
|
@ -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>
|
2013-11-15 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
* c-cilkplus.c: New file.
|
* c-cilkplus.c: New file.
|
||||||
|
|
|
@ -1813,7 +1813,7 @@ is_simple_enum (tree node)
|
||||||
if (TREE_CODE (int_val) != INTEGER_CST)
|
if (TREE_CODE (int_val) != INTEGER_CST)
|
||||||
int_val = DECL_INITIAL (int_val);
|
int_val = DECL_INITIAL (int_val);
|
||||||
|
|
||||||
if (!host_integerp (int_val, 0))
|
if (!tree_fits_shwi_p (int_val))
|
||||||
return false;
|
return false;
|
||||||
else if (TREE_INT_CST_LOW (int_val) != count)
|
else if (TREE_INT_CST_LOW (int_val) != count)
|
||||||
return false;
|
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. */
|
to generate the (0 .. -1) range for flexible array members. */
|
||||||
if (TREE_TYPE (node) == sizetype)
|
if (TREE_TYPE (node) == sizetype)
|
||||||
node = fold_convert (ssizetype, node);
|
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));
|
pp_wide_integer (buffer, TREE_INT_CST_LOW (node));
|
||||||
else if (host_integerp (node, 1))
|
else if (host_integerp (node, 1))
|
||||||
pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node));
|
pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node));
|
||||||
|
|
|
@ -6999,7 +6999,7 @@ get_priority (tree args, bool is_destructor)
|
||||||
|
|
||||||
arg = TREE_VALUE (args);
|
arg = TREE_VALUE (args);
|
||||||
arg = default_conversion (arg);
|
arg = default_conversion (arg);
|
||||||
if (!host_integerp (arg, /*pos=*/0)
|
if (!tree_fits_shwi_p (arg)
|
||||||
|| !INTEGRAL_TYPE_P (TREE_TYPE (arg)))
|
|| !INTEGRAL_TYPE_P (TREE_TYPE (arg)))
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
|
@ -11243,14 +11243,14 @@ warn_for_sign_compare (location_t location,
|
||||||
if (TREE_CODE (op1) == BIT_NOT_EXPR)
|
if (TREE_CODE (op1) == BIT_NOT_EXPR)
|
||||||
op1 = c_common_get_narrower (TREE_OPERAND (op1, 0), &unsignedp1);
|
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;
|
tree primop;
|
||||||
HOST_WIDE_INT constant, mask;
|
HOST_WIDE_INT constant, mask;
|
||||||
int unsignedp;
|
int unsignedp;
|
||||||
unsigned int bits;
|
unsigned int bits;
|
||||||
|
|
||||||
if (host_integerp (op0, 0))
|
if (tree_fits_shwi_p (op0))
|
||||||
{
|
{
|
||||||
primop = op1;
|
primop = op1;
|
||||||
unsignedp = unsignedp1;
|
unsignedp = unsignedp1;
|
||||||
|
|
|
@ -1459,7 +1459,7 @@ check_format_arg (void *ctx, tree format_tree,
|
||||||
res->number_non_literal++;
|
res->number_non_literal++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!host_integerp (arg1, 0)
|
if (!tree_fits_shwi_p (arg1)
|
||||||
|| (offset = tree_low_cst (arg1, 0)) < 0)
|
|| (offset = tree_low_cst (arg1, 0)) < 0)
|
||||||
{
|
{
|
||||||
res->number_non_literal++;
|
res->number_non_literal++;
|
||||||
|
@ -1506,7 +1506,7 @@ check_format_arg (void *ctx, tree format_tree,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TREE_CODE (format_tree) == ARRAY_REF
|
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)
|
&& (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0)
|
||||||
format_tree = TREE_OPERAND (format_tree, 0);
|
format_tree = TREE_OPERAND (format_tree, 0);
|
||||||
if (TREE_CODE (format_tree) == VAR_DECL
|
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. */
|
/* Variable length arrays can't be initialized. */
|
||||||
gcc_assert (TREE_CODE (array_size) == INTEGER_CST);
|
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);
|
HOST_WIDE_INT array_size_value = TREE_INT_CST_LOW (array_size);
|
||||||
if (array_size_value > 0
|
if (array_size_value > 0
|
||||||
|
|
|
@ -586,7 +586,7 @@ c_pretty_printer::direct_abstract_declarator (tree t)
|
||||||
tree maxval = TYPE_MAX_VALUE (TYPE_DOMAIN (t));
|
tree maxval = TYPE_MAX_VALUE (TYPE_DOMAIN (t));
|
||||||
tree type = TREE_TYPE (maxval);
|
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);
|
pp_wide_integer (this, tree_low_cst (maxval, 0) + 1);
|
||||||
else
|
else
|
||||||
expression (fold_build2 (PLUS_EXPR, type, maxval,
|
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))
|
? TYPE_CANONICAL (TREE_TYPE (i))
|
||||||
: 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));
|
pp_wide_integer (pp, TREE_INT_CST_LOW (i));
|
||||||
else if (host_integerp (i, 1))
|
else if (host_integerp (i, 1))
|
||||||
pp_unsigned_wide_integer (pp, TREE_INT_CST_LOW (i));
|
pp_unsigned_wide_integer (pp, TREE_INT_CST_LOW (i));
|
||||||
|
|
|
@ -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>
|
2013-11-15 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
* c-parser.c (c_parser_cilk_simd): New.
|
* c-parser.c (c_parser_cilk_simd): New.
|
||||||
|
|
|
@ -9736,7 +9736,7 @@ c_parser_omp_clause_collapse (c_parser *parser, tree list)
|
||||||
mark_exp_read (num);
|
mark_exp_read (num);
|
||||||
num = c_fully_fold (num, false, NULL);
|
num = c_fully_fold (num, false, NULL);
|
||||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
|
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
|
||||||
|| !host_integerp (num, 0)
|
|| !tree_fits_shwi_p (num)
|
||||||
|| (n = tree_low_cst (num, 0)) <= 0
|
|| (n = tree_low_cst (num, 0)) <= 0
|
||||||
|| (int) n != n)
|
|| (int) n != n)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5986,7 +5986,7 @@ alpha_stdarg_optimize_hook (struct stdarg_info *si, const_gimple stmt)
|
||||||
else
|
else
|
||||||
goto escapes;
|
goto escapes;
|
||||||
|
|
||||||
if (!host_integerp (gimple_assign_rhs2 (arg2_stmt), 0))
|
if (!tree_fits_shwi_p (gimple_assign_rhs2 (arg2_stmt)))
|
||||||
goto escapes;
|
goto escapes;
|
||||||
|
|
||||||
sub = tree_low_cst (gimple_assign_rhs2 (arg2_stmt), 0);
|
sub = tree_low_cst (gimple_assign_rhs2 (arg2_stmt), 0);
|
||||||
|
|
|
@ -210,7 +210,7 @@
|
||||||
t = DECL_SIZE_UNIT (t);
|
t = DECL_SIZE_UNIT (t);
|
||||||
else
|
else
|
||||||
t = TYPE_SIZE_UNIT (TREE_TYPE (t));
|
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);
|
size = tree_low_cst (t, 0);
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
t = DECL_SIZE_UNIT (t);
|
t = DECL_SIZE_UNIT (t);
|
||||||
else
|
else
|
||||||
t = TYPE_SIZE_UNIT (TREE_TYPE (t));
|
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);
|
size = tree_low_cst (t, 0);
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
|
|
|
@ -1289,7 +1289,7 @@ iq2000_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
|
||||||
if (TREE_CODE (field) == FIELD_DECL
|
if (TREE_CODE (field) == FIELD_DECL
|
||||||
&& TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
|
&& TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
|
||||||
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
|
&& 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)
|
&& int_bit_position (field) % BITS_PER_WORD == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -5158,7 +5158,7 @@ mips_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
|
||||||
if (TREE_CODE (field) == FIELD_DECL
|
if (TREE_CODE (field) == FIELD_DECL
|
||||||
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
|
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
|
||||||
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
|
&& 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)
|
&& int_bit_position (field) % BITS_PER_WORD == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -10193,7 +10193,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
|
||||||
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
|
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
|
||||||
if (!DECL_SIZE (decl)
|
if (!DECL_SIZE (decl)
|
||||||
|| !DECL_ALIGN (decl)
|
|| !DECL_ALIGN (decl)
|
||||||
|| !host_integerp (DECL_SIZE (decl), 0)
|
|| !tree_fits_shwi_p (DECL_SIZE (decl))
|
||||||
|| (DECL_ALIGN (decl) <= 64
|
|| (DECL_ALIGN (decl) <= 64
|
||||||
&& DECL_ALIGN (decl) != tree_low_cst (DECL_SIZE (decl), 0)))
|
&& DECL_ALIGN (decl) != tree_low_cst (DECL_SIZE (decl), 0)))
|
||||||
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
|
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
|
||||||
|
|
|
@ -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>
|
2013-11-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
PR c++/59123
|
PR c++/59123
|
||||||
|
|
|
@ -851,7 +851,7 @@ dump_type_suffix (cxx_pretty_printer *pp, tree t, int flags)
|
||||||
tree max = TYPE_MAX_VALUE (dtype);
|
tree max = TYPE_MAX_VALUE (dtype);
|
||||||
if (integer_all_onesp (max))
|
if (integer_all_onesp (max))
|
||||||
pp_character (pp, '0');
|
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);
|
pp_wide_integer (pp, tree_low_cst (max, 0) + 1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2285,7 +2285,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
|
||||||
pp_cxx_right_paren (pp);
|
pp_cxx_right_paren (pp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (host_integerp (idx, 0))
|
else if (tree_fits_shwi_p (idx))
|
||||||
{
|
{
|
||||||
tree virtuals;
|
tree virtuals;
|
||||||
unsigned HOST_WIDE_INT n;
|
unsigned HOST_WIDE_INT n;
|
||||||
|
|
|
@ -3662,7 +3662,7 @@ build_vec_init (tree base, tree maxindex, tree init,
|
||||||
|
|
||||||
if (from_array
|
if (from_array
|
||||||
|| ((type_build_ctor_call (type) || init || explicit_value_init_p)
|
|| ((type_build_ctor_call (type) || init || explicit_value_init_p)
|
||||||
&& ! (host_integerp (maxindex, 0)
|
&& ! (tree_fits_shwi_p (maxindex)
|
||||||
&& (num_initialized_elts
|
&& (num_initialized_elts
|
||||||
== tree_low_cst (maxindex, 0) + 1))))
|
== tree_low_cst (maxindex, 0) + 1))))
|
||||||
{
|
{
|
||||||
|
|
|
@ -26962,7 +26962,7 @@ cp_parser_omp_clause_collapse (cp_parser *parser, tree list, location_t location
|
||||||
return list;
|
return list;
|
||||||
num = fold_non_dependent_expr (num);
|
num = fold_non_dependent_expr (num);
|
||||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
|
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
|
||||||
|| !host_integerp (num, 0)
|
|| !tree_fits_shwi_p (num)
|
||||||
|| (n = tree_low_cst (num, 0)) <= 0
|
|| (n = tree_low_cst (num, 0)) <= 0
|
||||||
|| (int) n != n)
|
|| (int) n != n)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8739,8 +8739,8 @@ cxx_eval_bit_field_ref (const constexpr_call *call, tree t,
|
||||||
return value;
|
return value;
|
||||||
if (TREE_CODE (TREE_TYPE (field)) == INTEGER_TYPE
|
if (TREE_CODE (TREE_TYPE (field)) == INTEGER_TYPE
|
||||||
&& TREE_CODE (value) == INTEGER_CST
|
&& TREE_CODE (value) == INTEGER_CST
|
||||||
&& host_integerp (bitpos, 0)
|
&& tree_fits_shwi_p (bitpos)
|
||||||
&& host_integerp (DECL_SIZE (field), 0))
|
&& tree_fits_shwi_p (DECL_SIZE (field)))
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT bit = tree_low_cst (bitpos, 0);
|
HOST_WIDE_INT bit = tree_low_cst (bitpos, 0);
|
||||||
HOST_WIDE_INT sz = tree_low_cst (DECL_SIZE (field), 0);
|
HOST_WIDE_INT sz = tree_low_cst (DECL_SIZE (field), 0);
|
||||||
|
|
12
gcc/dbxout.c
12
gcc/dbxout.c
|
@ -1519,7 +1519,7 @@ dbxout_type_fields (tree type)
|
||||||
/* Omit fields whose position or size are variable or too large to
|
/* Omit fields whose position or size are variable or too large to
|
||||||
represent. */
|
represent. */
|
||||||
|| (TREE_CODE (tem) == FIELD_DECL
|
|| (TREE_CODE (tem) == FIELD_DECL
|
||||||
&& (! host_integerp (bit_position (tem), 0)
|
&& (! tree_fits_shwi_p (bit_position (tem))
|
||||||
|| ! DECL_SIZE (tem)
|
|| ! DECL_SIZE (tem)
|
||||||
|| ! host_integerp (DECL_SIZE (tem), 1))))
|
|| ! host_integerp (DECL_SIZE (tem), 1))))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1610,7 +1610,7 @@ dbxout_type_method_1 (tree decl)
|
||||||
stabstr_C (c1);
|
stabstr_C (c1);
|
||||||
stabstr_C (c2);
|
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_D (tree_low_cst (DECL_VINDEX (decl), 0));
|
||||||
stabstr_C (';');
|
stabstr_C (';');
|
||||||
|
@ -1718,7 +1718,7 @@ dbxout_range_type (tree type, tree low, tree high)
|
||||||
}
|
}
|
||||||
|
|
||||||
stabstr_C (';');
|
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))
|
if (print_int_cst_bounds_in_octal_p (type, low, high))
|
||||||
stabstr_O (low);
|
stabstr_O (low);
|
||||||
|
@ -1729,7 +1729,7 @@ dbxout_range_type (tree type, tree low, tree high)
|
||||||
stabstr_C ('0');
|
stabstr_C ('0');
|
||||||
|
|
||||||
stabstr_C (';');
|
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))
|
if (print_int_cst_bounds_in_octal_p (type, low, high))
|
||||||
stabstr_O (high);
|
stabstr_O (high);
|
||||||
|
@ -2516,7 +2516,7 @@ dbxout_expand_expr (tree expr)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (offset != NULL)
|
if (offset != NULL)
|
||||||
{
|
{
|
||||||
if (!host_integerp (offset, 0))
|
if (!tree_fits_shwi_p (offset))
|
||||||
return NULL;
|
return NULL;
|
||||||
x = adjust_address_nv (x, mode, tree_low_cst (offset, 0));
|
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? */
|
??? Why do we skip emitting the type and location in this case? */
|
||||||
if (TREE_STATIC (decl) && TREE_READONLY (decl)
|
if (TREE_STATIC (decl) && TREE_READONLY (decl)
|
||||||
&& DECL_INITIAL (decl) != 0
|
&& DECL_INITIAL (decl) != 0
|
||||||
&& host_integerp (DECL_INITIAL (decl), 0)
|
&& tree_fits_shwi_p (DECL_INITIAL (decl))
|
||||||
&& ! TREE_ASM_WRITTEN (decl)
|
&& ! TREE_ASM_WRITTEN (decl)
|
||||||
&& (DECL_FILE_SCOPE_P (decl)
|
&& (DECL_FILE_SCOPE_P (decl)
|
||||||
|| TREE_CODE (DECL_CONTEXT (decl)) == BLOCK
|
|| TREE_CODE (DECL_CONTEXT (decl)) == BLOCK
|
||||||
|
|
|
@ -14246,16 +14246,16 @@ loc_list_from_tree (tree loc, int want_address)
|
||||||
}
|
}
|
||||||
|
|
||||||
case INTEGER_CST:
|
case INTEGER_CST:
|
||||||
if ((want_address || !host_integerp (loc, 0))
|
if ((want_address || !tree_fits_shwi_p (loc))
|
||||||
&& (ret = cst_pool_loc_descr (loc)))
|
&& (ret = cst_pool_loc_descr (loc)))
|
||||||
have_address = 1;
|
have_address = 1;
|
||||||
else if (want_address == 2
|
else if (want_address == 2
|
||||||
&& host_integerp (loc, 0)
|
&& tree_fits_shwi_p (loc)
|
||||||
&& (ret = address_of_int_loc_descriptor
|
&& (ret = address_of_int_loc_descriptor
|
||||||
(int_size_in_bytes (TREE_TYPE (loc)),
|
(int_size_in_bytes (TREE_TYPE (loc)),
|
||||||
tree_low_cst (loc, 0))))
|
tree_low_cst (loc, 0))))
|
||||||
have_address = 1;
|
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));
|
ret = int_loc_descriptor (tree_low_cst (loc, 0));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -14345,7 +14345,7 @@ loc_list_from_tree (tree loc, int want_address)
|
||||||
|
|
||||||
case POINTER_PLUS_EXPR:
|
case POINTER_PLUS_EXPR:
|
||||||
case 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);
|
list_ret = loc_list_from_tree (TREE_OPERAND (loc, 0), 0);
|
||||||
if (list_ret == 0)
|
if (list_ret == 0)
|
||||||
|
@ -15526,7 +15526,7 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
|
||||||
*value = 0;
|
*value = 0;
|
||||||
if (offset != NULL)
|
if (offset != NULL)
|
||||||
{
|
{
|
||||||
if (!host_integerp (offset, 0))
|
if (!tree_fits_shwi_p (offset))
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
*value = tree_low_cst (offset, 0);
|
*value = tree_low_cst (offset, 0);
|
||||||
}
|
}
|
||||||
|
@ -15694,7 +15694,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
|
||||||
constructor_elt *ce;
|
constructor_elt *ce;
|
||||||
|
|
||||||
if (TYPE_DOMAIN (type) == NULL_TREE
|
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;
|
return false;
|
||||||
|
|
||||||
fieldsize = int_size_in_bytes (TREE_TYPE (type));
|
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))))
|
&& ! TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (field))))
|
||||||
return false;
|
return false;
|
||||||
else if (DECL_SIZE_UNIT (field) == NULL_TREE
|
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;
|
return false;
|
||||||
fieldsize = tree_low_cst (DECL_SIZE_UNIT (field), 0);
|
fieldsize = tree_low_cst (DECL_SIZE_UNIT (field), 0);
|
||||||
pos = int_byte_position (field);
|
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. */
|
/* Use the default if possible. */
|
||||||
if (bound_attr == DW_AT_lower_bound
|
if (bound_attr == DW_AT_lower_bound
|
||||||
&& host_integerp (bound, 0)
|
&& tree_fits_shwi_p (bound)
|
||||||
&& (dflt = lower_bound_default ()) != -1
|
&& (dflt = lower_bound_default ()) != -1
|
||||||
&& tree_low_cst (bound, 0) == dflt)
|
&& 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
|
/* We can't yet handle bit-fields whose offsets are variable, so if we
|
||||||
encounter such things, just return without generating any attribute
|
encounter such things, just return without generating any attribute
|
||||||
whatsoever. Likewise for variable or too large size. */
|
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))
|
|| ! host_integerp (DECL_SIZE (decl), 1))
|
||||||
return;
|
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);
|
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,
|
add_AT_loc (die, DW_AT_vtable_elem_location,
|
||||||
new_loc_descr (DW_OP_constu,
|
new_loc_descr (DW_OP_constu,
|
||||||
tree_low_cst (DECL_VINDEX (func_decl), 0),
|
tree_low_cst (DECL_VINDEX (func_decl), 0),
|
||||||
|
@ -17055,7 +17055,7 @@ descr_info_loc (tree val, tree base_decl)
|
||||||
case VAR_DECL:
|
case VAR_DECL:
|
||||||
return loc_descriptor_from_tree (val, 0);
|
return loc_descriptor_from_tree (val, 0);
|
||||||
case INTEGER_CST:
|
case INTEGER_CST:
|
||||||
if (host_integerp (val, 0))
|
if (tree_fits_shwi_p (val))
|
||||||
return int_loc_descriptor (tree_low_cst (val, 0));
|
return int_loc_descriptor (tree_low_cst (val, 0));
|
||||||
break;
|
break;
|
||||||
case INDIRECT_REF:
|
case INDIRECT_REF:
|
||||||
|
@ -17119,7 +17119,7 @@ add_descr_info_field (dw_die_ref die, enum dwarf_attribute attr,
|
||||||
{
|
{
|
||||||
dw_loc_descr_ref loc;
|
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));
|
add_AT_unsigned (die, attr, tree_low_cst (val, 0));
|
||||||
return;
|
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. */
|
/* If it is the default value, omit it. */
|
||||||
int dflt;
|
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
|
&& (dflt = lower_bound_default ()) != -1
|
||||||
&& tree_low_cst (info->dimen[dim].lower_bound, 0) == dflt)
|
&& 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);
|
value = DECL_INITIAL (value);
|
||||||
|
|
||||||
if (simple_type_size_in_bits (TREE_TYPE (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
|
/* DWARF2 does not provide a way of indicating whether or
|
||||||
not enumeration constants are signed or unsigned. GDB
|
not enumeration constants are signed or unsigned. GDB
|
||||||
always assumes the values are signed, so we output all
|
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. */
|
we can add DW_OP_GNU_implicit_pointer. */
|
||||||
STRIP_NOPS (init);
|
STRIP_NOPS (init);
|
||||||
if (TREE_CODE (init) == POINTER_PLUS_EXPR
|
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);
|
offset = tree_low_cst (TREE_OPERAND (init, 1), 0);
|
||||||
init = TREE_OPERAND (init, 0);
|
init = TREE_OPERAND (init, 0);
|
||||||
|
|
|
@ -2050,7 +2050,7 @@ expand_builtin_eh_common (tree region_nr_t)
|
||||||
HOST_WIDE_INT region_nr;
|
HOST_WIDE_INT region_nr;
|
||||||
eh_region region;
|
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_nr = tree_low_cst (region_nr_t, 0);
|
||||||
|
|
||||||
region = (*cfun->eh->region_array)[region_nr];
|
region = (*cfun->eh->region_array)[region_nr];
|
||||||
|
|
|
@ -282,7 +282,7 @@ int_expr_size (tree exp)
|
||||||
gcc_assert (size);
|
gcc_assert (size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 0 || !host_integerp (size, 0))
|
if (size == 0 || !tree_fits_shwi_p (size))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return tree_low_cst (size, 0);
|
return tree_low_cst (size, 0);
|
||||||
|
|
16
gcc/expr.c
16
gcc/expr.c
|
@ -5918,8 +5918,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
|
||||||
mode = VOIDmode;
|
mode = VOIDmode;
|
||||||
|
|
||||||
offset = DECL_FIELD_OFFSET (field);
|
offset = DECL_FIELD_OFFSET (field);
|
||||||
if (host_integerp (offset, 0)
|
if (tree_fits_shwi_p (offset)
|
||||||
&& host_integerp (bit_position (field), 0))
|
&& tree_fits_shwi_p (bit_position (field)))
|
||||||
{
|
{
|
||||||
bitpos = int_bit_position (field);
|
bitpos = int_bit_position (field);
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
@ -6008,8 +6008,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
|
||||||
domain = TYPE_DOMAIN (type);
|
domain = TYPE_DOMAIN (type);
|
||||||
const_bounds_p = (TYPE_MIN_VALUE (domain)
|
const_bounds_p = (TYPE_MIN_VALUE (domain)
|
||||||
&& TYPE_MAX_VALUE (domain)
|
&& TYPE_MAX_VALUE (domain)
|
||||||
&& host_integerp (TYPE_MIN_VALUE (domain), 0)
|
&& tree_fits_shwi_p (TYPE_MIN_VALUE (domain))
|
||||||
&& host_integerp (TYPE_MAX_VALUE (domain), 0));
|
&& tree_fits_shwi_p (TYPE_MAX_VALUE (domain)));
|
||||||
|
|
||||||
/* If we have constant bounds for the range of the type, get them. */
|
/* If we have constant bounds for the range of the type, get them. */
|
||||||
if (const_bounds_p)
|
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 the range is constant and "small", unroll the loop. */
|
||||||
if (const_bounds_p
|
if (const_bounds_p
|
||||||
&& host_integerp (lo_index, 0)
|
&& tree_fits_shwi_p (lo_index)
|
||||||
&& host_integerp (hi_index, 0)
|
&& tree_fits_shwi_p (hi_index)
|
||||||
&& (lo = tree_low_cst (lo_index, 0),
|
&& (lo = tree_low_cst (lo_index, 0),
|
||||||
hi = tree_low_cst (hi_index, 0),
|
hi = tree_low_cst (hi_index, 0),
|
||||||
count = hi - lo + 1,
|
count = hi - lo + 1,
|
||||||
|
@ -6207,7 +6207,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
|
||||||
emit_label (loop_end);
|
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))
|
|| ! host_integerp (TYPE_SIZE (elttype), 1))
|
||||||
{
|
{
|
||||||
tree position;
|
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. */
|
indexed address, for machines that support that. */
|
||||||
|
|
||||||
if (modifier == EXPAND_SUM && mode == ptr_mode
|
if (modifier == EXPAND_SUM && mode == ptr_mode
|
||||||
&& host_integerp (treeop1, 0))
|
&& tree_fits_shwi_p (treeop1))
|
||||||
{
|
{
|
||||||
tree exp1 = treeop1;
|
tree exp1 = treeop1;
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct locate_and_pad_arg_data
|
||||||
#define ADD_PARM_SIZE(TO, INC) \
|
#define ADD_PARM_SIZE(TO, INC) \
|
||||||
do { \
|
do { \
|
||||||
tree inc = (INC); \
|
tree inc = (INC); \
|
||||||
if (host_integerp (inc, 0)) \
|
if (tree_fits_shwi_p (inc)) \
|
||||||
(TO).constant += tree_low_cst (inc, 0); \
|
(TO).constant += tree_low_cst (inc, 0); \
|
||||||
else if ((TO).var == 0) \
|
else if ((TO).var == 0) \
|
||||||
(TO).var = fold_convert (ssizetype, inc); \
|
(TO).var = fold_convert (ssizetype, inc); \
|
||||||
|
@ -106,7 +106,7 @@ do { \
|
||||||
#define SUB_PARM_SIZE(TO, DEC) \
|
#define SUB_PARM_SIZE(TO, DEC) \
|
||||||
do { \
|
do { \
|
||||||
tree dec = (DEC); \
|
tree dec = (DEC); \
|
||||||
if (host_integerp (dec, 0)) \
|
if (tree_fits_shwi_p (dec)) \
|
||||||
(TO).constant -= tree_low_cst (dec, 0); \
|
(TO).constant -= tree_low_cst (dec, 0); \
|
||||||
else if ((TO).var == 0) \
|
else if ((TO).var == 0) \
|
||||||
(TO).var = size_binop (MINUS_EXPR, ssize_int (0), \
|
(TO).var = size_binop (MINUS_EXPR, ssize_int (0), \
|
||||||
|
|
|
@ -3420,7 +3420,7 @@ make_bit_field_ref (location_t loc, tree inner, tree type,
|
||||||
tree size = TYPE_SIZE (TREE_TYPE (inner));
|
tree size = TYPE_SIZE (TREE_TYPE (inner));
|
||||||
if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
|
if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
|
||||||
|| POINTER_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)
|
&& tree_low_cst (size, 0) == bitsize)
|
||||||
return fold_convert_loc (loc, type, inner);
|
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
|
/* No identical multiplicands; see if we can find a common
|
||||||
power-of-two factor in non-power-of-two multiplies. This
|
power-of-two factor in non-power-of-two multiplies. This
|
||||||
can help in multi-dimensional array access. */
|
can help in multi-dimensional array access. */
|
||||||
else if (host_integerp (arg01, 0)
|
else if (tree_fits_shwi_p (arg01)
|
||||||
&& host_integerp (arg11, 0))
|
&& tree_fits_shwi_p (arg11))
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT int01, int11, tmp;
|
HOST_WIDE_INT int01, int11, tmp;
|
||||||
bool swap = false;
|
bool swap = false;
|
||||||
|
@ -7488,7 +7488,7 @@ native_encode_string (const_tree expr, unsigned char *ptr, int len)
|
||||||
if (TREE_CODE (type) != ARRAY_TYPE
|
if (TREE_CODE (type) != ARRAY_TYPE
|
||||||
|| TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE
|
|| TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE
|
||||||
|| GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) != BITS_PER_UNIT
|
|| 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;
|
return 0;
|
||||||
total_bytes = tree_low_cst (TYPE_SIZE_UNIT (type), 0);
|
total_bytes = tree_low_cst (TYPE_SIZE_UNIT (type), 0);
|
||||||
if (total_bytes > len)
|
if (total_bytes > len)
|
||||||
|
@ -9089,7 +9089,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
|
||||||
indirect_base0 = true;
|
indirect_base0 = true;
|
||||||
}
|
}
|
||||||
offset0 = TREE_OPERAND (arg0, 1);
|
offset0 = TREE_OPERAND (arg0, 1);
|
||||||
if (host_integerp (offset0, 0))
|
if (tree_fits_shwi_p (offset0))
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT off = size_low_cst (offset0);
|
HOST_WIDE_INT off = size_low_cst (offset0);
|
||||||
if ((HOST_WIDE_INT) (((unsigned HOST_WIDE_INT) off)
|
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;
|
indirect_base1 = true;
|
||||||
}
|
}
|
||||||
offset1 = TREE_OPERAND (arg1, 1);
|
offset1 = TREE_OPERAND (arg1, 1);
|
||||||
if (host_integerp (offset1, 0))
|
if (tree_fits_shwi_p (offset1))
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT off = size_low_cst (offset1);
|
HOST_WIDE_INT off = size_low_cst (offset1);
|
||||||
if ((HOST_WIDE_INT) (((unsigned HOST_WIDE_INT) off)
|
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)
|
if (((code == LSHIFT_EXPR && TREE_CODE (arg0) == RSHIFT_EXPR)
|
||||||
|| (TYPE_UNSIGNED (type)
|
|| (TYPE_UNSIGNED (type)
|
||||||
&& code == RSHIFT_EXPR && TREE_CODE (arg0) == LSHIFT_EXPR))
|
&& code == RSHIFT_EXPR && TREE_CODE (arg0) == LSHIFT_EXPR))
|
||||||
&& host_integerp (arg1, false)
|
&& tree_fits_shwi_p (arg1)
|
||||||
&& TREE_INT_CST_LOW (arg1) < prec
|
&& 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)
|
&& TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < prec)
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT low0 = TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1));
|
HOST_WIDE_INT low0 = TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1));
|
||||||
|
|
|
@ -2720,7 +2720,7 @@ get_base_constructor (tree base, HOST_WIDE_INT *bit_offset,
|
||||||
{
|
{
|
||||||
if (!integer_zerop (TREE_OPERAND (base, 1)))
|
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;
|
return NULL_TREE;
|
||||||
*bit_offset += (mem_ref_offset (base).low
|
*bit_offset += (mem_ref_offset (base).low
|
||||||
* BITS_PER_UNIT);
|
* BITS_PER_UNIT);
|
||||||
|
|
|
@ -609,7 +609,7 @@ stmt_cost (gimple gs, bool speed)
|
||||||
case MULT_EXPR:
|
case MULT_EXPR:
|
||||||
rhs2 = gimple_assign_rhs2 (gs);
|
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);
|
return mult_by_coeff_cost (TREE_INT_CST_LOW (rhs2), lhs_mode, speed);
|
||||||
|
|
||||||
gcc_assert (TREE_CODE (rhs1) != INTEGER_CST);
|
gcc_assert (TREE_CODE (rhs1) != INTEGER_CST);
|
||||||
|
|
|
@ -2098,8 +2098,8 @@ gimple_compare_field_offset (tree f1, tree f2)
|
||||||
/* Fortran and C do not always agree on what DECL_OFFSET_ALIGN
|
/* Fortran and C do not always agree on what DECL_OFFSET_ALIGN
|
||||||
should be, so handle differing ones specially by decomposing
|
should be, so handle differing ones specially by decomposing
|
||||||
the offset into a byte and bit offset manually. */
|
the offset into a byte and bit offset manually. */
|
||||||
if (host_integerp (DECL_FIELD_OFFSET (f1), 0)
|
if (tree_fits_shwi_p (DECL_FIELD_OFFSET (f1))
|
||||||
&& host_integerp (DECL_FIELD_OFFSET (f2), 0))
|
&& tree_fits_shwi_p (DECL_FIELD_OFFSET (f2)))
|
||||||
{
|
{
|
||||||
unsigned HOST_WIDE_INT byte_offset1, byte_offset2;
|
unsigned HOST_WIDE_INT byte_offset1, byte_offset2;
|
||||||
unsigned HOST_WIDE_INT bit_offset1, bit_offset2;
|
unsigned HOST_WIDE_INT bit_offset1, bit_offset2;
|
||||||
|
|
|
@ -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>
|
2013-11-14 Andrew MacLeod <amacleod@redhat.com>
|
||||||
|
|
||||||
* go-lang.c: Include only gimplify.h and gimple.h as needed.
|
* go-lang.c: Include only gimplify.h and gimple.h as needed.
|
||||||
|
|
|
@ -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));
|
tree int_type_tree = type_to_tree(int_type->get_backend(gogo));
|
||||||
|
|
||||||
expr_tree = fold_convert(int_type_tree, expr_tree);
|
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);
|
HOST_WIDE_INT intval = tree_low_cst(expr_tree, 0);
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
|
@ -728,7 +728,7 @@ go_format_type (struct godump_container *container, tree type,
|
||||||
&& tree_int_cst_sgn (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) == 0
|
&& tree_int_cst_sgn (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) == 0
|
||||||
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != NULL_TREE
|
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != NULL_TREE
|
||||||
&& TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST
|
&& 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];
|
char buf[100];
|
||||||
|
|
||||||
|
@ -981,7 +981,7 @@ go_output_typedef (struct godump_container *container, tree decl)
|
||||||
if (*slot != NULL)
|
if (*slot != NULL)
|
||||||
macro_hash_del (*slot);
|
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,
|
snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC,
|
||||||
tree_low_cst (TREE_VALUE (element), 0));
|
tree_low_cst (TREE_VALUE (element), 0));
|
||||||
else if (host_integerp (TREE_VALUE (element), 1))
|
else if (host_integerp (TREE_VALUE (element), 1))
|
||||||
|
|
|
@ -170,10 +170,10 @@ graphite_can_represent_init (tree e)
|
||||||
case MULT_EXPR:
|
case MULT_EXPR:
|
||||||
if (chrec_contains_symbols (TREE_OPERAND (e, 0)))
|
if (chrec_contains_symbols (TREE_OPERAND (e, 0)))
|
||||||
return graphite_can_represent_init (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
|
else
|
||||||
return graphite_can_represent_init (TREE_OPERAND (e, 1))
|
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 PLUS_EXPR:
|
||||||
case POINTER_PLUS_EXPR:
|
case POINTER_PLUS_EXPR:
|
||||||
|
|
|
@ -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
|
subscript - low >= 0 and high - subscript >= 0 in case one of
|
||||||
the two bounds isn't known. Do the same here? */
|
the two bounds isn't known. Do the same here? */
|
||||||
|
|
||||||
if (host_integerp (low, 0)
|
if (tree_fits_shwi_p (low)
|
||||||
&& high
|
&& high
|
||||||
&& host_integerp (high, 0)
|
&& tree_fits_shwi_p (high)
|
||||||
/* 1-element arrays at end of structures may extend over
|
/* 1-element arrays at end of structures may extend over
|
||||||
their declared size. */
|
their declared size. */
|
||||||
&& !(array_at_struct_end_p (ref)
|
&& !(array_at_struct_end_p (ref)
|
||||||
|
|
|
@ -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>
|
2013-11-14 Andrew MacLeod <amacleod@redhat.com>
|
||||||
|
|
||||||
* java-gimplify.c: Include only gimplify.h and gimple.h as needed.
|
* java-gimplify.c: Include only gimplify.h and gimple.h as needed.
|
||||||
|
|
|
@ -1592,7 +1592,7 @@ get_dispatch_vector (tree type)
|
||||||
{
|
{
|
||||||
tree method_index = get_method_index (method);
|
tree method_index = get_method_index (method);
|
||||||
if (method_index != NULL_TREE
|
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;
|
TREE_VEC_ELT (vtable, tree_low_cst (method_index, 0)) = method;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1049,7 +1049,7 @@ build_newarray (int atype_value, tree length)
|
||||||
tree prim_type = decode_newarray_type (atype_value);
|
tree prim_type = decode_newarray_type (atype_value);
|
||||||
tree type
|
tree type
|
||||||
= build_java_array_type (prim_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);
|
? tree_low_cst (length, 0) : -1);
|
||||||
|
|
||||||
/* Pass a reference to the primitive type class and save the runtime
|
/* 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
|
tree type
|
||||||
= build_java_array_type (class_type,
|
= build_java_array_type (class_type,
|
||||||
host_integerp (length, 0)
|
tree_fits_shwi_p (length)
|
||||||
? tree_low_cst (length, 0) : -1);
|
? tree_low_cst (length, 0) : -1);
|
||||||
|
|
||||||
return build_call_nary (promote_type (type),
|
return build_call_nary (promote_type (type),
|
||||||
|
|
|
@ -2290,7 +2290,7 @@ check_omp_nesting_restrictions (gimple stmt, omp_context *ctx)
|
||||||
: "#pragma omp cancellation point");
|
: "#pragma omp cancellation point");
|
||||||
return false;
|
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)
|
? tree_low_cst (gimple_call_arg (stmt, 0), 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
|
/* When possible, use a strict equality expression. This can let VRP
|
||||||
type optimizations deduce the value and remove a copy. */
|
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);
|
HOST_WIDE_INT step = TREE_INT_CST_LOW (fd->loop.step);
|
||||||
if (step == 1 || step == -1)
|
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. */
|
/* Optimize: v = 0; is usually cheaper than v = some_other_constant. */
|
||||||
vinit = fd->loop.n1;
|
vinit = fd->loop.n1;
|
||||||
if (cond_code == EQ_EXPR
|
if (cond_code == EQ_EXPR
|
||||||
&& host_integerp (fd->loop.n2, 0)
|
&& tree_fits_shwi_p (fd->loop.n2)
|
||||||
&& ! integer_zerop (fd->loop.n2))
|
&& ! integer_zerop (fd->loop.n2))
|
||||||
vinit = build_int_cst (TREE_TYPE (fd->loop.v), 0);
|
vinit = build_int_cst (TREE_TYPE (fd->loop.v), 0);
|
||||||
else
|
else
|
||||||
|
|
|
@ -1053,14 +1053,14 @@ strips_small_constant (tree t1, tree t2)
|
||||||
return NULL;
|
return NULL;
|
||||||
else if (TREE_CODE (t1) == SSA_NAME)
|
else if (TREE_CODE (t1) == SSA_NAME)
|
||||||
ret = t1;
|
ret = t1;
|
||||||
else if (host_integerp (t1, 0))
|
else if (tree_fits_shwi_p (t1))
|
||||||
value = tree_low_cst (t1, 0);
|
value = tree_low_cst (t1, 0);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!t2)
|
if (!t2)
|
||||||
return ret;
|
return ret;
|
||||||
else if (host_integerp (t2, 0))
|
else if (tree_fits_shwi_p (t2))
|
||||||
value = tree_low_cst (t2, 0);
|
value = tree_low_cst (t2, 0);
|
||||||
else if (TREE_CODE (t2) == SSA_NAME)
|
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);
|
code = invert_tree_comparison (code, false);
|
||||||
bound = iv0.base;
|
bound = iv0.base;
|
||||||
base = iv1.base;
|
base = iv1.base;
|
||||||
if (host_integerp (iv1.step, 0))
|
if (tree_fits_shwi_p (iv1.step))
|
||||||
step = iv1.step;
|
step = iv1.step;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
@ -1166,7 +1166,7 @@ is_comparison_with_loop_invariant_p (gimple stmt, struct loop *loop,
|
||||||
{
|
{
|
||||||
bound = iv1.base;
|
bound = iv1.base;
|
||||||
base = iv0.base;
|
base = iv0.base;
|
||||||
if (host_integerp (iv0.step, 0))
|
if (tree_fits_shwi_p (iv0.step))
|
||||||
step = iv0.step;
|
step = iv0.step;
|
||||||
else
|
else
|
||||||
return false;
|
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
|
/* If loop bound, base and compare bound are all constants, we can
|
||||||
calculate the probability directly. */
|
calculate the probability directly. */
|
||||||
if (host_integerp (loop_bound_var, 0)
|
if (tree_fits_shwi_p (loop_bound_var)
|
||||||
&& host_integerp (compare_var, 0)
|
&& tree_fits_shwi_p (compare_var)
|
||||||
&& host_integerp (compare_base, 0))
|
&& tree_fits_shwi_p (compare_base))
|
||||||
{
|
{
|
||||||
int probability;
|
int probability;
|
||||||
bool of, overflow = false;
|
bool of, overflow = false;
|
||||||
|
|
|
@ -279,7 +279,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size,
|
||||||
if (!decl)
|
if (!decl)
|
||||||
decl_size = -1;
|
decl_size = -1;
|
||||||
else if (DECL_P (decl) && DECL_SIZE_UNIT (decl))
|
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)
|
? tree_low_cst (DECL_SIZE_UNIT (decl), 0)
|
||||||
: -1);
|
: -1);
|
||||||
else if (TREE_CODE (decl) == STRING_CST)
|
else if (TREE_CODE (decl) == STRING_CST)
|
||||||
|
|
10
gcc/sdbout.c
10
gcc/sdbout.c
|
@ -535,8 +535,8 @@ plain_type_1 (tree type, int level)
|
||||||
= (TYPE_DOMAIN (type)
|
= (TYPE_DOMAIN (type)
|
||||||
&& TYPE_MIN_VALUE (TYPE_DOMAIN (type)) != 0
|
&& TYPE_MIN_VALUE (TYPE_DOMAIN (type)) != 0
|
||||||
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != 0
|
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != 0
|
||||||
&& host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
|
&& tree_fits_shwi_p (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
|
||||||
&& host_integerp (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0)
|
&& tree_fits_shwi_p (TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
|
||||||
? (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
|
? (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
|
||||||
- tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0) + 1)
|
- tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0) + 1)
|
||||||
: 0);
|
: 0);
|
||||||
|
@ -995,7 +995,7 @@ sdbout_field_types (tree type)
|
||||||
&& DECL_NAME (tail)
|
&& DECL_NAME (tail)
|
||||||
&& DECL_SIZE (tail)
|
&& DECL_SIZE (tail)
|
||||||
&& host_integerp (DECL_SIZE (tail), 1)
|
&& 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)))
|
if (POINTER_TYPE_P (TREE_TYPE (tail)))
|
||||||
sdbout_one_type (TREE_TYPE (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)
|
if (TREE_CODE (value) == CONST_DECL)
|
||||||
value = DECL_INITIAL (value);
|
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_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
|
||||||
PUT_SDB_INT_VAL (tree_low_cst (value, 0));
|
PUT_SDB_INT_VAL (tree_low_cst (value, 0));
|
||||||
|
@ -1174,7 +1174,7 @@ sdbout_one_type (tree type)
|
||||||
&& DECL_NAME (tem)
|
&& DECL_NAME (tem)
|
||||||
&& DECL_SIZE (tem)
|
&& DECL_SIZE (tem)
|
||||||
&& host_integerp (DECL_SIZE (tem), 1)
|
&& host_integerp (DECL_SIZE (tem), 1)
|
||||||
&& host_integerp (bit_position (tem), 0))
|
&& tree_fits_shwi_p (bit_position (tem)))
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,7 @@ delegitimize_mem_from_attrs (rtx x)
|
||||||
&mode, &unsignedp, &volatilep, false);
|
&mode, &unsignedp, &volatilep, false);
|
||||||
if (bitsize != GET_MODE_BITSIZE (mode)
|
if (bitsize != GET_MODE_BITSIZE (mode)
|
||||||
|| (bitpos % BITS_PER_UNIT)
|
|| (bitpos % BITS_PER_UNIT)
|
||||||
|| (toffset && !host_integerp (toffset, 0)))
|
|| (toffset && !tree_fits_shwi_p (toffset)))
|
||||||
decl = NULL;
|
decl = NULL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1300,8 +1300,8 @@ place_field (record_layout_info rli, tree field)
|
||||||
if (DECL_BIT_FIELD_TYPE (field)
|
if (DECL_BIT_FIELD_TYPE (field)
|
||||||
&& !integer_zerop (DECL_SIZE (field))
|
&& !integer_zerop (DECL_SIZE (field))
|
||||||
&& !integer_zerop (DECL_SIZE (rli->prev_field))
|
&& !integer_zerop (DECL_SIZE (rli->prev_field))
|
||||||
&& host_integerp (DECL_SIZE (rli->prev_field), 0)
|
&& tree_fits_shwi_p (DECL_SIZE (rli->prev_field))
|
||||||
&& host_integerp (TYPE_SIZE (type), 0)
|
&& tree_fits_shwi_p (TYPE_SIZE (type))
|
||||||
&& simple_cst_equal (TYPE_SIZE (type), TYPE_SIZE (prev_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
|
/* We're in the middle of a run of equal type size fields; make
|
||||||
|
|
|
@ -2838,14 +2838,14 @@ gcd_of_steps_may_divide_p (const_tree chrec, const_tree cst)
|
||||||
HOST_WIDE_INT cd = 0, val;
|
HOST_WIDE_INT cd = 0, val;
|
||||||
tree step;
|
tree step;
|
||||||
|
|
||||||
if (!host_integerp (cst, 0))
|
if (!tree_fits_shwi_p (cst))
|
||||||
return true;
|
return true;
|
||||||
val = tree_low_cst (cst, 0);
|
val = tree_low_cst (cst, 0);
|
||||||
|
|
||||||
while (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
|
while (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
|
||||||
{
|
{
|
||||||
step = CHREC_RIGHT (chrec);
|
step = CHREC_RIGHT (chrec);
|
||||||
if (!host_integerp (step, 0))
|
if (!tree_fits_shwi_p (step))
|
||||||
return true;
|
return true;
|
||||||
cd = gcd (cd, tree_low_cst (step, 0));
|
cd = gcd (cd, tree_low_cst (step, 0));
|
||||||
chrec = CHREC_LEFT (chrec);
|
chrec = CHREC_LEFT (chrec);
|
||||||
|
|
|
@ -455,8 +455,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
|
||||||
{
|
{
|
||||||
tree fsize = DECL_SIZE_UNIT (field);
|
tree fsize = DECL_SIZE_UNIT (field);
|
||||||
tree ssize = TYPE_SIZE_UNIT (stype);
|
tree ssize = TYPE_SIZE_UNIT (stype);
|
||||||
if (host_integerp (fsize, 0)
|
if (tree_fits_shwi_p (fsize)
|
||||||
&& host_integerp (ssize, 0)
|
&& tree_fits_shwi_p (ssize)
|
||||||
&& doffset.fits_shwi ())
|
&& doffset.fits_shwi ())
|
||||||
maxsize += ((TREE_INT_CST_LOW (ssize)
|
maxsize += ((TREE_INT_CST_LOW (ssize)
|
||||||
- TREE_INT_CST_LOW (fsize))
|
- TREE_INT_CST_LOW (fsize))
|
||||||
|
|
|
@ -272,7 +272,7 @@ dump_array_domain (pretty_printer *buffer, tree domain, int spc, int flags)
|
||||||
|
|
||||||
if (min && max
|
if (min && max
|
||||||
&& integer_zerop (min)
|
&& integer_zerop (min)
|
||||||
&& host_integerp (max, 0))
|
&& tree_fits_shwi_p (max))
|
||||||
pp_wide_integer (buffer, TREE_INT_CST_LOW (max) + 1);
|
pp_wide_integer (buffer, TREE_INT_CST_LOW (max) + 1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -752,7 +752,7 @@ type_internals_preclude_sra_p (tree type, const char **msg)
|
||||||
*msg = "structure field size not fixed";
|
*msg = "structure field size not fixed";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!host_integerp (bit_position (fld), 0))
|
if (!tree_fits_shwi_p (bit_position (fld)))
|
||||||
{
|
{
|
||||||
*msg = "structure field size too big";
|
*msg = "structure field size too big";
|
||||||
return true;
|
return true;
|
||||||
|
@ -2119,7 +2119,7 @@ expr_with_var_bounded_array_refs_p (tree expr)
|
||||||
while (handled_component_p (expr))
|
while (handled_component_p (expr))
|
||||||
{
|
{
|
||||||
if (TREE_CODE (expr) == ARRAY_REF
|
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;
|
return true;
|
||||||
expr = TREE_OPERAND (expr, 0);
|
expr = TREE_OPERAND (expr, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -614,7 +614,7 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size)
|
||||||
}
|
}
|
||||||
ref->offset += extra_offset;
|
ref->offset += extra_offset;
|
||||||
if (size
|
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) * BITS_PER_UNIT / BITS_PER_UNIT
|
||||||
== TREE_INT_CST_LOW (size))
|
== TREE_INT_CST_LOW (size))
|
||||||
ref->max_size = ref->size = TREE_INT_CST_LOW (size) * BITS_PER_UNIT;
|
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 dest = gimple_call_arg (stmt, 0);
|
||||||
tree len = gimple_call_arg (stmt, 2);
|
tree len = gimple_call_arg (stmt, 2);
|
||||||
if (!host_integerp (len, 0))
|
if (!tree_fits_shwi_p (len))
|
||||||
return false;
|
return false;
|
||||||
tree rbase = ref->base;
|
tree rbase = ref->base;
|
||||||
double_int roffset = double_int::from_shwi (ref->offset);
|
double_int roffset = double_int::from_shwi (ref->offset);
|
||||||
|
|
|
@ -1527,7 +1527,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
|
||||||
char *src_buf;
|
char *src_buf;
|
||||||
use_operand_p use_p;
|
use_operand_p use_p;
|
||||||
|
|
||||||
if (!host_integerp (val2, 0)
|
if (!tree_fits_shwi_p (val2)
|
||||||
|| !host_integerp (len2, 1))
|
|| !host_integerp (len2, 1))
|
||||||
break;
|
break;
|
||||||
if (is_gimple_call (stmt1))
|
if (is_gimple_call (stmt1))
|
||||||
|
@ -1569,7 +1569,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
|
||||||
src1 = gimple_assign_rhs1 (stmt1);
|
src1 = gimple_assign_rhs1 (stmt1);
|
||||||
if (TREE_CODE (ptr1) != MEM_REF
|
if (TREE_CODE (ptr1) != MEM_REF
|
||||||
|| TYPE_MODE (TREE_TYPE (ptr1)) != TYPE_MODE (char_type_node)
|
|| TYPE_MODE (TREE_TYPE (ptr1)) != TYPE_MODE (char_type_node)
|
||||||
|| !host_integerp (src1, 0))
|
|| !tree_fits_shwi_p (src1))
|
||||||
break;
|
break;
|
||||||
ptr1 = build_fold_addr_expr (ptr1);
|
ptr1 = build_fold_addr_expr (ptr1);
|
||||||
callee1 = NULL_TREE;
|
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,
|
/* Check for one shift count being Y and the other B - Y,
|
||||||
with optional casts. */
|
with optional casts. */
|
||||||
if (cdef_code[i] == MINUS_EXPR
|
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_low_cst (cdef_arg1[i], 0) == TYPE_PRECISION (rtype)
|
||||||
&& TREE_CODE (cdef_arg2[i]) == SSA_NAME)
|
&& 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.
|
This alternative is safe even for rotation count of 0.
|
||||||
One shift count is Y and the other (-Y) & (B - 1). */
|
One shift count is Y and the other (-Y) & (B - 1). */
|
||||||
else if (cdef_code[i] == BIT_AND_EXPR
|
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)
|
&& tree_low_cst (cdef_arg2[i], 0)
|
||||||
== TYPE_PRECISION (rtype) - 1
|
== TYPE_PRECISION (rtype) - 1
|
||||||
&& TREE_CODE (cdef_arg1[i]) == SSA_NAME
|
&& TREE_CODE (cdef_arg1[i]) == SSA_NAME
|
||||||
|
|
|
@ -3970,7 +3970,7 @@ get_loop_invariant_expr_id (struct ivopts_data *data, tree ubase,
|
||||||
{
|
{
|
||||||
tree ind = TREE_OPERAND (usym, 1);
|
tree ind = TREE_OPERAND (usym, 1);
|
||||||
if (TREE_CODE (ind) == INTEGER_CST
|
if (TREE_CODE (ind) == INTEGER_CST
|
||||||
&& host_integerp (ind, 0)
|
&& tree_fits_shwi_p (ind)
|
||||||
&& TREE_INT_CST_LOW (ind) == 0)
|
&& TREE_INT_CST_LOW (ind) == 0)
|
||||||
usym = TREE_OPERAND (usym, 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);
|
tree ind = TREE_OPERAND (csym, 1);
|
||||||
if (TREE_CODE (ind) == INTEGER_CST
|
if (TREE_CODE (ind) == INTEGER_CST
|
||||||
&& host_integerp (ind, 0)
|
&& tree_fits_shwi_p (ind)
|
||||||
&& TREE_INT_CST_LOW (ind) == 0)
|
&& TREE_INT_CST_LOW (ind) == 0)
|
||||||
csym = TREE_OPERAND (csym, 0);
|
csym = TREE_OPERAND (csym, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1458,7 +1458,7 @@ add_subscript_strides (tree access_fn, unsigned stride,
|
||||||
if ((unsigned) loop_depth (aloop) <= min_depth)
|
if ((unsigned) loop_depth (aloop) <= min_depth)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (host_integerp (step, 0))
|
if (tree_fits_shwi_p (step))
|
||||||
astep = tree_low_cst (step, 0);
|
astep = tree_low_cst (step, 0);
|
||||||
else
|
else
|
||||||
astep = L1_CACHE_LINE_SIZE;
|
astep = L1_CACHE_LINE_SIZE;
|
||||||
|
|
|
@ -1502,7 +1502,7 @@ execute_cse_sincos (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!host_integerp (arg1, 0))
|
if (!tree_fits_shwi_p (arg1))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
n = TREE_INT_CST_LOW (arg1);
|
n = TREE_INT_CST_LOW (arg1);
|
||||||
|
|
|
@ -1360,7 +1360,7 @@ add_or_mark_expr (basic_block bb, tree exp,
|
||||||
|
|
||||||
if (TREE_CODE (exp) == MEM_REF
|
if (TREE_CODE (exp) == MEM_REF
|
||||||
&& TREE_CODE (TREE_OPERAND (exp, 0)) == SSA_NAME
|
&& 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)
|
&& (size = int_size_in_bytes (TREE_TYPE (exp))) > 0)
|
||||||
{
|
{
|
||||||
tree name = TREE_OPERAND (exp, 0);
|
tree name = TREE_OPERAND (exp, 0);
|
||||||
|
|
|
@ -3635,7 +3635,7 @@ acceptable_pow_call (gimple stmt, tree *base, HOST_WIDE_INT *exponent)
|
||||||
*base = gimple_call_arg (stmt, 0);
|
*base = gimple_call_arg (stmt, 0);
|
||||||
arg1 = gimple_call_arg (stmt, 1);
|
arg1 = gimple_call_arg (stmt, 1);
|
||||||
|
|
||||||
if (!host_integerp (arg1, 0))
|
if (!tree_fits_shwi_p (arg1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*exponent = TREE_INT_CST_LOW (arg1);
|
*exponent = TREE_INT_CST_LOW (arg1);
|
||||||
|
|
|
@ -782,7 +782,7 @@ copy_reference_ops_from_ref (tree ref, vec<vn_reference_op_s> *result)
|
||||||
case MEM_REF:
|
case MEM_REF:
|
||||||
/* The base address gets its own vn_reference_op_s structure. */
|
/* The base address gets its own vn_reference_op_s structure. */
|
||||||
temp.op0 = TREE_OPERAND (ref, 1);
|
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));
|
temp.off = TREE_INT_CST_LOW (TREE_OPERAND (ref, 1));
|
||||||
break;
|
break;
|
||||||
case BIT_FIELD_REF:
|
case BIT_FIELD_REF:
|
||||||
|
@ -1020,9 +1020,9 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
|
||||||
case ARRAY_RANGE_REF:
|
case ARRAY_RANGE_REF:
|
||||||
case ARRAY_REF:
|
case ARRAY_REF:
|
||||||
/* We recorded the lower bound and the element size. */
|
/* We recorded the lower bound and the element size. */
|
||||||
if (!host_integerp (op->op0, 0)
|
if (!tree_fits_shwi_p (op->op0)
|
||||||
|| !host_integerp (op->op1, 0)
|
|| !tree_fits_shwi_p (op->op1)
|
||||||
|| !host_integerp (op->op2, 0))
|
|| !tree_fits_shwi_p (op->op2))
|
||||||
max_size = -1;
|
max_size = -1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1156,7 +1156,7 @@ vn_reference_fold_indirect (vec<vn_reference_op_s> *ops,
|
||||||
off += double_int::from_shwi (addr_offset);
|
off += double_int::from_shwi (addr_offset);
|
||||||
mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off);
|
mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off);
|
||||||
op->op0 = build_fold_addr_expr (addr_base);
|
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);
|
mem_op->off = TREE_INT_CST_LOW (mem_op->op0);
|
||||||
else
|
else
|
||||||
mem_op->off = -1;
|
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);
|
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);
|
mem_op->off = TREE_INT_CST_LOW (mem_op->op0);
|
||||||
else
|
else
|
||||||
mem_op->off = -1;
|
mem_op->off = -1;
|
||||||
|
|
|
@ -215,7 +215,7 @@ get_stridx (tree exp)
|
||||||
|
|
||||||
s = string_constant (exp, &o);
|
s = string_constant (exp, &o);
|
||||||
if (s != NULL_TREE
|
if (s != NULL_TREE
|
||||||
&& (o == NULL_TREE || host_integerp (o, 0))
|
&& (o == NULL_TREE || tree_fits_shwi_p (o))
|
||||||
&& TREE_STRING_LENGTH (s) > 0)
|
&& TREE_STRING_LENGTH (s) > 0)
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT offset = o ? tree_low_cst (o, 0) : 0;
|
HOST_WIDE_INT offset = o ? tree_low_cst (o, 0) : 0;
|
||||||
|
|
|
@ -2994,8 +2994,8 @@ process_constraint (constraint_t t)
|
||||||
static HOST_WIDE_INT
|
static HOST_WIDE_INT
|
||||||
bitpos_of_field (const tree fdecl)
|
bitpos_of_field (const tree fdecl)
|
||||||
{
|
{
|
||||||
if (!host_integerp (DECL_FIELD_OFFSET (fdecl), 0)
|
if (!tree_fits_shwi_p (DECL_FIELD_OFFSET (fdecl))
|
||||||
|| !host_integerp (DECL_FIELD_BIT_OFFSET (fdecl), 0))
|
|| !tree_fits_shwi_p (DECL_FIELD_BIT_OFFSET (fdecl)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fdecl)) * BITS_PER_UNIT
|
return (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fdecl)) * BITS_PER_UNIT
|
||||||
|
|
|
@ -2547,8 +2547,8 @@ vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
|
||||||
if (!host_integerp (sza, 1)
|
if (!host_integerp (sza, 1)
|
||||||
|| !host_integerp (szb, 1)
|
|| !host_integerp (szb, 1)
|
||||||
|| !tree_int_cst_equal (sza, szb)
|
|| !tree_int_cst_equal (sza, szb)
|
||||||
|| !host_integerp (DR_STEP (dra), 0)
|
|| !tree_fits_shwi_p (DR_STEP (dra))
|
||||||
|| !host_integerp (DR_STEP (drb), 0)
|
|| !tree_fits_shwi_p (DR_STEP (drb))
|
||||||
|| !tree_int_cst_equal (DR_STEP (dra), DR_STEP (drb)))
|
|| !tree_int_cst_equal (DR_STEP (dra), DR_STEP (drb)))
|
||||||
break;
|
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),
|
if (!operand_equal_p (DR_BASE_ADDRESS (dr_a1->dr),
|
||||||
DR_BASE_ADDRESS (dr_a2->dr),
|
DR_BASE_ADDRESS (dr_a2->dr),
|
||||||
0)
|
0)
|
||||||
|| !host_integerp (dr_a1->offset, 0)
|
|| !tree_fits_shwi_p (dr_a1->offset)
|
||||||
|| !host_integerp (dr_a2->offset, 0))
|
|| !tree_fits_shwi_p (dr_a2->offset))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
HOST_WIDE_INT diff = TREE_INT_CST_LOW (dr_a2->offset) -
|
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;
|
break;
|
||||||
case MULT_EXPR:
|
case MULT_EXPR:
|
||||||
if (scale == 1 && host_integerp (op1, 0))
|
if (scale == 1 && tree_fits_shwi_p (op1))
|
||||||
{
|
{
|
||||||
scale = tree_low_cst (op1, 0);
|
scale = tree_low_cst (op1, 0);
|
||||||
off = op0;
|
off = op0;
|
||||||
|
|
|
@ -783,7 +783,7 @@ vect_recog_pow_pattern (vec<gimple> *stmts, tree *type_in,
|
||||||
*type_out = NULL_TREE;
|
*type_out = NULL_TREE;
|
||||||
|
|
||||||
/* Catch squaring. */
|
/* Catch squaring. */
|
||||||
if ((host_integerp (exp, 0)
|
if ((tree_fits_shwi_p (exp)
|
||||||
&& tree_low_cst (exp, 0) == 2)
|
&& tree_low_cst (exp, 0) == 2)
|
||||||
|| (TREE_CODE (exp) == REAL_CST
|
|| (TREE_CODE (exp) == REAL_CST
|
||||||
&& REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2)))
|
&& REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2)))
|
||||||
|
|
|
@ -388,7 +388,7 @@ typedef struct _loop_vec_info {
|
||||||
(L)->may_alias_ddrs.length () > 0
|
(L)->may_alias_ddrs.length () > 0
|
||||||
|
|
||||||
#define NITERS_KNOWN_P(n) \
|
#define NITERS_KNOWN_P(n) \
|
||||||
(host_integerp ((n),0) \
|
(tree_fits_shwi_p ((n)) \
|
||||||
&& TREE_INT_CST_LOW ((n)) > 0)
|
&& TREE_INT_CST_LOW ((n)) > 0)
|
||||||
|
|
||||||
#define LOOP_VINFO_NITERS_KNOWN_P(L) \
|
#define LOOP_VINFO_NITERS_KNOWN_P(L) \
|
||||||
|
|
|
@ -5040,7 +5040,7 @@ free_lang_data_in_decl (tree decl)
|
||||||
DECL_VINDEX referring to itself into a vtable slot number as it
|
DECL_VINDEX referring to itself into a vtable slot number as it
|
||||||
should. Happens with functions that are copied and then forgotten
|
should. Happens with functions that are copied and then forgotten
|
||||||
about. Just clear it, it won't matter anymore. */
|
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;
|
DECL_VINDEX (decl) = NULL_TREE;
|
||||||
}
|
}
|
||||||
else if (TREE_CODE (decl) == VAR_DECL)
|
else if (TREE_CODE (decl) == VAR_DECL)
|
||||||
|
|
|
@ -6290,7 +6290,7 @@ prepare_call_arguments (basic_block bb, rtx insn)
|
||||||
&& DECL_INITIAL (SYMBOL_REF_DECL (l->loc)))
|
&& DECL_INITIAL (SYMBOL_REF_DECL (l->loc)))
|
||||||
{
|
{
|
||||||
initial = 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_INT (tree_low_cst (initial, 0));
|
||||||
item = gen_rtx_CONCAT (indmode, mem, item);
|
item = gen_rtx_CONCAT (indmode, mem, item);
|
||||||
|
|
|
@ -2709,7 +2709,7 @@ decode_addr_const (tree exp, struct addr_const *value)
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (TREE_CODE (target) == COMPONENT_REF
|
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));
|
offset += int_byte_position (TREE_OPERAND (target, 1));
|
||||||
target = TREE_OPERAND (target, 0);
|
target = TREE_OPERAND (target, 0);
|
||||||
|
|
Loading…
Reference in New Issue