summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index fbc1a0023d2..184711bbc4b 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5973,18 +5973,7 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type)
if (flag_unsafe_math_optimizations)
{
- enum built_in_function fcode;
- tree sqrtfn;
-
- fcode = DECL_FUNCTION_CODE (fndecl);
- if (fcode == BUILT_IN_CABS)
- sqrtfn = implicit_built_in_decls[BUILT_IN_SQRT];
- else if (fcode == BUILT_IN_CABSF)
- sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTF];
- else if (fcode == BUILT_IN_CABSL)
- sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTL];
- else
- sqrtfn = NULL_TREE;
+ tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT);
if (sqrtfn != NULL_TREE)
{
@@ -7097,17 +7086,7 @@ fold_builtin (tree exp)
if (flag_unsafe_math_optimizations
&& REAL_VALUES_EQUAL (c, dconsthalf))
{
- tree sqrtfn;
-
- fcode = DECL_FUNCTION_CODE (fndecl);
- if (fcode == BUILT_IN_POW)
- sqrtfn = implicit_built_in_decls[BUILT_IN_SQRT];
- else if (fcode == BUILT_IN_POWF)
- sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTF];
- else if (fcode == BUILT_IN_POWL)
- sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTL];
- else
- sqrtfn = NULL_TREE;
+ tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT);
if (sqrtfn != NULL_TREE)
{