aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2009-03-27 21:55:20 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2009-03-27 21:55:20 +0000
commit7338ea632be2de59230b17140f5fbe98476ed2e5 (patch)
treefe0d910842c9e3e08fd60e240da762a1f0817bbd /gcc/builtins.c
parent346a77d1d814bc194c825ee48e75604646070bf6 (diff)
downloadgcc-7338ea632be2de59230b17140f5fbe98476ed2e5.zip
gcc-7338ea632be2de59230b17140f5fbe98476ed2e5.tar.gz
gcc-7338ea632be2de59230b17140f5fbe98476ed2e5.tar.bz2
builtins.c (real_dconstp): Delete.
* builtins.c (real_dconstp): Delete. (fold_builtin_logarithm): Remove inaccurate log(e) special case. testsuite: * gcc.dg/torture/builtin-explog-1.c: Remove tests that aren't true for low precision (i.e. float). From-SVN: r145130
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 83ce8eb..fab8a4c 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -8331,21 +8331,6 @@ fold_builtin_bswap (tree fndecl, tree arg)
return NULL_TREE;
}
-/* Return true if EXPR is the real constant contained in VALUE. */
-
-static bool
-real_dconstp (tree expr, const REAL_VALUE_TYPE *value)
-{
- STRIP_NOPS (expr);
-
- return ((TREE_CODE (expr) == REAL_CST
- && !TREE_OVERFLOW (expr)
- && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), *value))
- || (TREE_CODE (expr) == COMPLEX_CST
- && real_dconstp (TREE_REALPART (expr), value)
- && real_zerop (TREE_IMAGPART (expr))));
-}
-
/* A subroutine of fold_builtin to fold the various logarithmic
functions. Return NULL_TREE if no simplification can me made.
FUNC is the corresponding MPFR logarithm function. */
@@ -8360,17 +8345,6 @@ fold_builtin_logarithm (tree fndecl, tree arg,
tree res;
const enum built_in_function fcode = builtin_mathfn_code (arg);
- /* Optimize log(e) = 1.0. We're never passed an exact 'e',
- instead we'll look for 'e' truncated to MODE. So only do
- this if flag_unsafe_math_optimizations is set. */
- if (flag_unsafe_math_optimizations && func == mpfr_log)
- {
- const REAL_VALUE_TYPE e_truncated =
- real_value_truncate (TYPE_MODE (type), dconst_e ());
- if (real_dconstp (arg, &e_truncated))
- return build_real (type, dconst1);
- }
-
/* Calculate the result when the argument is a constant. */
if ((res = do_mpfr_arg1 (arg, type, func, &dconst0, NULL, false)))
return res;