From b8fca551dbabd7a3e9ae32d01f3000885cb2e19e Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 8 Jan 2007 23:07:44 +0000 Subject: tree.h (force_fit_type_double): Export. 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. From-SVN: r120597 --- gcc/convert.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gcc/convert.c') diff --git a/gcc/convert.c b/gcc/convert.c index 0a9743a..11d8492 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -44,14 +44,10 @@ convert_to_pointer (tree type, tree expr) if (TREE_TYPE (expr) == type) return expr; + /* Propagate overflow to the NULL pointer. */ if (integer_zerop (expr)) - { - tree t = build_int_cst (type, 0); - if (TREE_OVERFLOW (expr) || TREE_CONSTANT_OVERFLOW (expr)) - t = force_fit_type (t, 0, TREE_OVERFLOW (expr), - TREE_CONSTANT_OVERFLOW (expr)); - return t; - } + return force_fit_type_double (type, 0, 0, 0, TREE_OVERFLOW (expr), + TREE_CONSTANT_OVERFLOW (expr)); switch (TREE_CODE (TREE_TYPE (expr))) { -- cgit v1.1