diff options
author | Richard Guenther <rguenther@suse.de> | 2007-01-08 22:17:43 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-01-08 22:17:43 +0000 |
commit | 2b60792f2b31e4b305033502a6717a76308dff50 (patch) | |
tree | 97a13c6eafb874c8f14484040aaf7da2c160f41f /gcc/builtins.c | |
parent | 61fcaeefb219b791d9161525fb2fd83066693898 (diff) | |
download | gcc-2b60792f2b31e4b305033502a6717a76308dff50.zip gcc-2b60792f2b31e4b305033502a6717a76308dff50.tar.gz gcc-2b60792f2b31e4b305033502a6717a76308dff50.tar.bz2 |
builtins.c (fold_builtin_int_roundingfn): Use fit_double_type.
2007-01-08 Richard Guenther <rguenther@suse.de>
* builtins.c (fold_builtin_int_roundingfn): Use fit_double_type.
* tree.c (build_int_cst_type): Likewise.
(size_in_bytes): Don't call force_fit_type on the result.
(int_fits_type_p): Use fit_double_type.
* fold-const.c (fit_double_type): New function.
(force_fit_type): Use it.
* tree.h (fit_double_type): Export.
From-SVN: r120593
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index e97e3bb..a39a4c1 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7576,7 +7576,8 @@ fold_builtin_int_roundingfn (tree fndecl, tree arglist) if (! REAL_VALUE_ISNAN (x) && ! REAL_VALUE_ISINF (x)) { tree itype = TREE_TYPE (TREE_TYPE (fndecl)); - tree ftype = TREE_TYPE (arg), result; + tree ftype = TREE_TYPE (arg); + unsigned HOST_WIDE_INT lo2; HOST_WIDE_INT hi, lo; REAL_VALUE_TYPE r; @@ -7602,11 +7603,8 @@ fold_builtin_int_roundingfn (tree fndecl, tree arglist) } REAL_VALUE_TO_INT (&lo, &hi, r); - result = build_int_cst_wide (itype, lo, hi); - result = force_fit_type (result, 0, false, false); - if (TREE_INT_CST_LOW (result) == lo - && TREE_INT_CST_HIGH (result) == hi) - return result; + if (!fit_double_type (lo, hi, &lo2, &hi, itype)) + return build_int_cst_wide (itype, lo2, hi); } } |