tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use type of offset to build the index.
2007-01-08 Richard Guenther <rguenther@suse.de> * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use type of offset to build the index. * tree-pretty-print.c (dump_generic_node): Don't build negated const just for printing. * c-pretty-print.c (pp_c_integer_constant): Likewise. * builtins.c (fold_builtin_int_roundingfn): Check if result fits the type by using force_fit_type and comparing the result. * predict.c (predict_loops): Use compare_tree_int for comparison. * tree.c (build_int_cst): Fall back to integer_type_node for NULL_TREE type. (build_int_cst_wide): Assert type is non-null. fortran/ * trans-io.c (transfer_array_desc): Use build_int_cst instead of build_int_cstu. From-SVN: r120586
This commit is contained in:
parent
738a52d3e2
commit
7fb41a42a9
|
@ -1,3 +1,17 @@
|
||||||
|
2007-01-08 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use type
|
||||||
|
of offset to build the index.
|
||||||
|
* tree-pretty-print.c (dump_generic_node): Don't build negated
|
||||||
|
const just for printing.
|
||||||
|
* c-pretty-print.c (pp_c_integer_constant): Likewise.
|
||||||
|
* builtins.c (fold_builtin_int_roundingfn): Check if result
|
||||||
|
fits the type by using force_fit_type and comparing the result.
|
||||||
|
* predict.c (predict_loops): Use compare_tree_int for comparison.
|
||||||
|
* tree.c (build_int_cst): Fall back to integer_type_node for
|
||||||
|
NULL_TREE type.
|
||||||
|
(build_int_cst_wide): Assert type is non-null.
|
||||||
|
|
||||||
2007-01-08 Roberto Costa <roberto.costa@st.com>
|
2007-01-08 Roberto Costa <roberto.costa@st.com>
|
||||||
|
|
||||||
* tree-vrp.c (extract_range_from_cond_expr): New.
|
* tree-vrp.c (extract_range_from_cond_expr): New.
|
||||||
|
|
|
@ -7602,9 +7602,11 @@ fold_builtin_int_roundingfn (tree fndecl, tree arglist)
|
||||||
}
|
}
|
||||||
|
|
||||||
REAL_VALUE_TO_INT (&lo, &hi, r);
|
REAL_VALUE_TO_INT (&lo, &hi, r);
|
||||||
result = build_int_cst_wide (NULL_TREE, lo, hi);
|
result = build_int_cst_wide (itype, lo, hi);
|
||||||
if (int_fits_type_p (result, itype))
|
result = force_fit_type (result, 0, false, false);
|
||||||
return fold_convert (itype, result);
|
if (TREE_INT_CST_LOW (result) == lo
|
||||||
|
&& TREE_INT_CST_HIGH (result) == hi)
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -810,17 +810,16 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
|
||||||
pp_wide_integer (pp, TREE_INT_CST_LOW (i));
|
pp_wide_integer (pp, TREE_INT_CST_LOW (i));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (i);
|
||||||
|
HOST_WIDE_INT high = TREE_INT_CST_HIGH (i);
|
||||||
if (tree_int_cst_sgn (i) < 0)
|
if (tree_int_cst_sgn (i) < 0)
|
||||||
{
|
{
|
||||||
pp_character (pp, '-');
|
pp_character (pp, '-');
|
||||||
i = build_int_cst_wide (NULL_TREE,
|
high = ~high + !low;
|
||||||
-TREE_INT_CST_LOW (i),
|
low = -low;
|
||||||
~TREE_INT_CST_HIGH (i)
|
|
||||||
+ !TREE_INT_CST_LOW (i));
|
|
||||||
}
|
}
|
||||||
sprintf (pp_buffer (pp)->digit_buffer,
|
sprintf (pp_buffer (pp)->digit_buffer,
|
||||||
HOST_WIDE_INT_PRINT_DOUBLE_HEX,
|
HOST_WIDE_INT_PRINT_DOUBLE_HEX, high, low);
|
||||||
TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i));
|
|
||||||
pp_string (pp, pp_buffer (pp)->digit_buffer);
|
pp_string (pp, pp_buffer (pp)->digit_buffer);
|
||||||
}
|
}
|
||||||
if (TYPE_UNSIGNED (type))
|
if (TYPE_UNSIGNED (type))
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2007-01-08 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
* trans-io.c (transfer_array_desc): Use build_int_cst instead
|
||||||
|
of build_int_cstu.
|
||||||
|
|
||||||
2007-01-08 Roger Sayle <roger@eyesopen.com>
|
2007-01-08 Roger Sayle <roger@eyesopen.com>
|
||||||
|
|
||||||
* trans-array.c (constant_array_constructor_p): New function to
|
* trans-array.c (constant_array_constructor_p): New function to
|
||||||
|
|
|
@ -1779,7 +1779,7 @@ transfer_array_desc (gfc_se * se, gfc_typespec * ts, tree addr_expr)
|
||||||
if (ts->type == BT_CHARACTER)
|
if (ts->type == BT_CHARACTER)
|
||||||
charlen_arg = se->string_length;
|
charlen_arg = se->string_length;
|
||||||
else
|
else
|
||||||
charlen_arg = build_int_cstu (NULL_TREE, 0);
|
charlen_arg = build_int_cst (NULL_TREE, 0);
|
||||||
|
|
||||||
kind_arg = build_int_cst (NULL_TREE, ts->kind);
|
kind_arg = build_int_cst (NULL_TREE, ts->kind);
|
||||||
|
|
||||||
|
|
|
@ -662,8 +662,7 @@ predict_loops (void)
|
||||||
int probability;
|
int probability;
|
||||||
int max = PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS);
|
int max = PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS);
|
||||||
if (host_integerp (niter, 1)
|
if (host_integerp (niter, 1)
|
||||||
&& tree_int_cst_lt (niter,
|
&& compare_tree_int (niter, max-1) == -1)
|
||||||
build_int_cstu (NULL_TREE, max - 1)))
|
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT nitercst = tree_low_cst (niter, 1) + 1;
|
HOST_WIDE_INT nitercst = tree_low_cst (niter, 1) + 1;
|
||||||
probability = ((REG_BR_PROB_BASE + nitercst / 2)
|
probability = ((REG_BR_PROB_BASE + nitercst / 2)
|
||||||
|
|
|
@ -748,24 +748,21 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
||||||
else if (! host_integerp (node, 0))
|
else if (! host_integerp (node, 0))
|
||||||
{
|
{
|
||||||
tree val = node;
|
tree val = node;
|
||||||
|
unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (val);
|
||||||
|
HOST_WIDE_INT high = TREE_INT_CST_HIGH (val);
|
||||||
|
|
||||||
if (tree_int_cst_sgn (val) < 0)
|
if (tree_int_cst_sgn (val) < 0)
|
||||||
{
|
{
|
||||||
pp_character (buffer, '-');
|
pp_character (buffer, '-');
|
||||||
val = build_int_cst_wide (NULL_TREE,
|
high = ~high + !low;
|
||||||
-TREE_INT_CST_LOW (val),
|
low = -low;
|
||||||
~TREE_INT_CST_HIGH (val)
|
|
||||||
+ !TREE_INT_CST_LOW (val));
|
|
||||||
}
|
}
|
||||||
/* Would "%x%0*x" or "%x%*0x" get zero-padding on all
|
/* Would "%x%0*x" or "%x%*0x" get zero-padding on all
|
||||||
systems? */
|
systems? */
|
||||||
{
|
sprintf (pp_buffer (buffer)->digit_buffer,
|
||||||
sprintf (pp_buffer (buffer)->digit_buffer, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
|
HOST_WIDE_INT_PRINT_DOUBLE_HEX, high, low);
|
||||||
TREE_INT_CST_HIGH (val),
|
|
||||||
TREE_INT_CST_LOW (val));
|
|
||||||
pp_string (buffer, pp_buffer (buffer)->digit_buffer);
|
pp_string (buffer, pp_buffer (buffer)->digit_buffer);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
pp_wide_integer (buffer, TREE_INT_CST_LOW (node));
|
pp_wide_integer (buffer, TREE_INT_CST_LOW (node));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1608,7 +1608,7 @@ maybe_fold_offset_to_array_ref (tree base, tree offset, tree orig_type)
|
||||||
|| lrem || hrem)
|
|| lrem || hrem)
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
|
||||||
idx = build_int_cst_wide (NULL_TREE, lquo, hquo);
|
idx = build_int_cst_wide (TREE_TYPE (offset), lquo, hquo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assume the low bound is zero. If there is a domain type, get the
|
/* Assume the low bound is zero. If there is a domain type, get the
|
||||||
|
|
|
@ -752,6 +752,10 @@ copy_list (tree list)
|
||||||
tree
|
tree
|
||||||
build_int_cst (tree type, HOST_WIDE_INT low)
|
build_int_cst (tree type, HOST_WIDE_INT low)
|
||||||
{
|
{
|
||||||
|
/* Support legacy code. */
|
||||||
|
if (!type)
|
||||||
|
type = integer_type_node;
|
||||||
|
|
||||||
return build_int_cst_wide (type, low, low < 0 ? -1 : 0);
|
return build_int_cst_wide (type, low, low < 0 ? -1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,8 +868,7 @@ build_int_cst_wide (tree type, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
|
||||||
int ix = -1;
|
int ix = -1;
|
||||||
int limit = 0;
|
int limit = 0;
|
||||||
|
|
||||||
if (!type)
|
gcc_assert (type);
|
||||||
type = integer_type_node;
|
|
||||||
|
|
||||||
switch (TREE_CODE (type))
|
switch (TREE_CODE (type))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue