aboutsummaryrefslogtreecommitdiff
path: root/gcc/convert.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-01-08 23:07:44 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-01-08 23:07:44 +0000
commitb8fca551dbabd7a3e9ae32d01f3000885cb2e19e (patch)
treeb906bda57fe5b087786f0082a6716e47d14d48b7 /gcc/convert.c
parent2ac7cbb53296e6006d7c113d81175dd455fd570b (diff)
downloadgcc-b8fca551dbabd7a3e9ae32d01f3000885cb2e19e.zip
gcc-b8fca551dbabd7a3e9ae32d01f3000885cb2e19e.tar.gz
gcc-b8fca551dbabd7a3e9ae32d01f3000885cb2e19e.tar.bz2
tree.h (force_fit_type_double): Export.
2007-01-08 Richard Guenther <rguenther@suse.de> * 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
Diffstat (limited to 'gcc/convert.c')
-rw-r--r--gcc/convert.c10
1 files changed, 3 insertions, 7 deletions
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)))
{