summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-02-03 20:49:51 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-02-03 20:49:51 +0000
commitb86a760aed87957b7f57a39aeef25ac8ab8ecaa9 (patch)
tree3c924698e0bed7d0bb13a6fbd463def170b9bb50 /gcc/builtins.c
parent3a610de8791728417247258df99cf16c14c09822 (diff)
downloadgcc-b86a760aed87957b7f57a39aeef25ac8ab8ecaa9.tar.gz
emit-rtl.c (dconstpi): Delete.
* emit-rtl.c (dconstpi): Delete. (dconstsqrt2): New. (init_emit_once): Delete dconstpi and init dconstsqrt2. * real.h (dconstpi): Delete. (dconstsqrt2): New. * builtins.c (fold_builtin_cabs): Use dconstsqrt2. (fold_builtin_hypot): Likewise. From-SVN: r121550
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index b7ce1e4c5d8..b7ff78203f8 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -7158,13 +7158,12 @@ fold_builtin_cabs (tree arglist, tree type, tree fndecl)
if (flag_unsafe_math_optimizations
&& operand_equal_p (real, imag, OEP_PURE_SAME))
{
- REAL_VALUE_TYPE sqrt2;
-
- real_sqrt (&sqrt2, TYPE_MODE (type), &dconst2);
+ const REAL_VALUE_TYPE sqrt2_trunc
+ = real_value_truncate (TYPE_MODE (type), dconstsqrt2);
STRIP_NOPS (real);
return fold_build2 (MULT_EXPR, type,
fold_build1 (ABS_EXPR, type, real),
- build_real (type, sqrt2));
+ build_real (type, sqrt2_trunc));
}
}
@@ -8059,12 +8058,11 @@ fold_builtin_hypot (tree fndecl, tree arglist, tree type)
if (flag_unsafe_math_optimizations
&& operand_equal_p (arg0, arg1, OEP_PURE_SAME))
{
- REAL_VALUE_TYPE sqrt2;
-
- real_sqrt (&sqrt2, TYPE_MODE (type), &dconst2);
+ const REAL_VALUE_TYPE sqrt2_trunc
+ = real_value_truncate (TYPE_MODE (type), dconstsqrt2);
return fold_build2 (MULT_EXPR, type,
fold_build1 (ABS_EXPR, type, arg0),
- build_real (type, sqrt2));
+ build_real (type, sqrt2_trunc));
}
return NULL_TREE;