builtins.c (dconstpi, dconste): New mathematical constants.
authorRoger Sayle <roger@eyesopen.com>
Wed, 4 Jun 2003 12:20:40 +0000 (12:20 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Wed, 4 Jun 2003 12:20:40 +0000 (12:20 +0000)
commit385a9348eb92bdbee1052c83f62fd7db8887916d
tree0fff82636598319f282b94c466d49daa131c721d
parent8c6a82695b85f8ed74cdc67f2cf74c5a62d0d91d
builtins.c (dconstpi, dconste): New mathematical constants.

* builtins.c (dconstpi, dconste): New mathematical constants.
(init_builtin_dconsts): New function to initialize dconstpi
and dconste.
(fold_builtin): Optimize exp(1.0) = e.  Evaluate exp(x) at
compile time with -ffast-math when x is an integer constant.
Optimize tan(0.0) = 0.0.  Optimize atan(0.0) = 0.0,
atan(1.0) = pi/4 and tan(atan(x)) = x with -ffast-math.

* gcc.dg/builtins-2.c: Add tests for tan(atan(x)).
* gcc.dg/builtins-3.c: Add tests for tan(0.0) and atan(0.0).
* gcc.dg/builtins-7.c: Add tests for tan(atan(x)) == x.
* gcc.dg/builtins-17.c: New test case.
* gcc.dg/i386-387-4.c: New test case.
* gcc.c-torture/execute/ieee/mzero4.c: New test case.

From-SVN: r67438
gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/ieee/mzero4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtins-17.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtins-2.c
gcc/testsuite/gcc.dg/builtins-3.c
gcc/testsuite/gcc.dg/builtins-7.c
gcc/testsuite/gcc.dg/i386-387-4.c [new file with mode: 0644]