diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2004-04-14 14:29:35 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2004-04-14 14:29:35 +0000 |
commit | a69934e07eb54b76012e32a6aee54fe6af1faaa9 (patch) | |
tree | 1099c5b0ee54972c5f4fe6788abcafa2379973c7 /gcc/builtins.c | |
parent | 74b9f2d5c81c1799cc8bf2a1b41c5fbad88a0127 (diff) | |
download | gcc-a69934e07eb54b76012e32a6aee54fe6af1faaa9.tar.gz |
builtins.c (fold_builtin_cabs, [...]): Use `mathfn_built_in' to determine the new builtin.
* builtins.c (fold_builtin_cabs, fold_builtin): Use
`mathfn_built_in' to determine the new builtin.
* fold-const.c (fold): Likewise.
From-SVN: r80680
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 25 |
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) { |