aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-01-08 18:29:18 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-01-08 18:29:18 +0000
commit7fb41a42a9490e41b03fe1bcfe0d3903fd8c0372 (patch)
tree39d3113999a59bc49ff73a06408842ee861973fd /gcc/tree.c
parent738a52d3e27cc81e337c3f57e845adc0dd666eaa (diff)
downloadgcc-7fb41a42a9490e41b03fe1bcfe0d3903fd8c0372.zip
gcc-7fb41a42a9490e41b03fe1bcfe0d3903fd8c0372.tar.gz
gcc-7fb41a42a9490e41b03fe1bcfe0d3903fd8c0372.tar.bz2
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
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 71d221e..e3eb4be 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -752,6 +752,10 @@ copy_list (tree list)
tree
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);
}
@@ -864,8 +868,7 @@ build_int_cst_wide (tree type, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
int ix = -1;
int limit = 0;
- if (!type)
- type = integer_type_node;
+ gcc_assert (type);
switch (TREE_CODE (type))
{