re PR middle-end/29335 (transcendental functions with constant arguments should be...
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 29 Oct 2006 02:02:10 +0000 (02:02 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 29 Oct 2006 02:02:10 +0000 (02:02 +0000)
commit4413d881d03be475aab1891d66081ed54e042b73
treecab82ea78089af1aeb39e45b02ea963d4f45a7e8
parent5c9ab0a6eec9628575740a3640cf3d12e0d70132
re PR middle-end/29335 (transcendental functions with constant arguments should be resolved at compile-time)

PR middle-end/29335
* builtins.c (do_mpfr_arg2, fold_builtin_hypot): New.
(fold_builtin_pow): Evaluate constant arguments at compile-time
using MPFR.
(fold_builtin_1): Handle BUILT_IN_ATAN2 and BUILT_IN_HYPOT.
(do_mpfr_ckconv): New helper function.
(do_mpfr_arg1): Use do_mpfr_ckconv.
(do_mpfr_arg2): New.

testsuite:
* gcc.dg/builtins-20.c: Add tests for hypot.
* gcc.dg/torture/builtin-math-2.c (TESTIT2): New.  Add tests for
two-argument builtins.
* gcc.dg/torture/builtin-math-3.c (TESTIT_R): Renamed from
TESTIT2.  Update all callers.
(TESTIT2, TESTIT2_R): New helper macros.
Add testcases for pow, hypot and atan2.

From-SVN: r118129
gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-20.c
gcc/testsuite/gcc.dg/torture/builtin-math-2.c
gcc/testsuite/gcc.dg/torture/builtin-math-3.c