This patch removes force_fit_type in favor of force_fit_type_double that takes a double-int and a type argument. This reduces intermediate types created and cleans up the source as all uses left of force_fit_type are of the form t = build_int_cst_wide (type, low, high); t = force_fit_type (t, -1, overflow | TREE_OVERFLOW (arg1), TREE_CONSTANT_OVERFLOW (arg1)); which first creates a shared integer node (of possibly uncanonicalized form) and then truncates it properly and propagates overflow flags. Combining this two steps also allows to adjust int_const_binop to produce less garbage on overflow. Bootstrapped and tested on i686-pc-linux-gnu, another on on x86_64-unknown-linux-gnu for all languages still running. Is the new name ok or should I re-use the old one, force_fit_type? I also thought of build_and_force_fit_and_propagate_overflow_int_wide (), but that's ugly ;) Suggestions? Thanks, Richard. 2007-01-08 Richard Guenther * tree.h (force_fit_type_double): Export. (force_fit_type): Remove. * fold-const.c (force_fit_type_double): New function. (force_fit_type): Remove. (int_const_binop): Use it. (fold_convert_const_int_from_int): Likewise. (fold_convert_const_int_from_real): Likewise. (fold_div_compare): Likewise. (fold_sign_changed_comparison): Likewise. (fold_unary): Likewise. (fold_negate_const): Likewise. (fold_abs_const): Likewise. (fold_not_const): Likewise. * c-common.c (shorten_compare): Use force_fit_type_double. * convert.c (convert_to_pointer): Likewise.