diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2006-10-30 20:21:59 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2006-10-30 20:21:59 +0000 |
commit | 61fb309f70ef6a4f034145bc3e274911e93a92e1 (patch) | |
tree | a54e7be62c04933fea70fa36cb64e800264525af /gcc/builtins.c | |
parent | ff81aa23e51c3d3c1fb52449c583bafeca04ca3f (diff) | |
download | gcc-61fb309f70ef6a4f034145bc3e274911e93a92e1.zip gcc-61fb309f70ef6a4f034145bc3e274911e93a92e1.tar.gz gcc-61fb309f70ef6a4f034145bc3e274911e93a92e1.tar.bz2 |
re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)
PR middle-end/29335
* builtins.c (fold_builtin_1): Evaluate tgamma using MPFR.
testsuite:
* gcc.dg/torture/builtin-math-2.c: Add tgamma tests.
* gcc.dg/torture/builtin-math-3.c: Likewise.
From-SVN: r118200
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 3a71e04..2184c71 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -9121,6 +9121,12 @@ fold_builtin_1 (tree fndecl, tree arglist, bool ignore) NULL, NULL, 0); break; + CASE_FLT_FN (BUILT_IN_TGAMMA): + if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return do_mpfr_arg1 (TREE_VALUE (arglist), type, mpfr_gamma, + NULL, NULL, 0); + break; + CASE_FLT_FN (BUILT_IN_EXP): return fold_builtin_exponent (fndecl, arglist, mpfr_exp); |