builtins.c (fold_builtin): Constant fold expressions as x*0.5 instead of x/2.0.
authorRoger Sayle <roger@eyesopen.com>
Tue, 8 Apr 2003 23:24:38 +0000 (23:24 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 8 Apr 2003 23:24:38 +0000 (23:24 +0000)
commit531878a68e636392d594f22d0fc6e1444e82d940
tree57e664d9c1807ff9f4b3bd4f3e4ddbb0c32619d0
parentc583e7c354b04607db93798fc92e040f11a60a54
builtins.c (fold_builtin): Constant fold expressions as x*0.5 instead of x/2.0.

* builtins.c (fold_builtin):  Constant fold expressions as x*0.5
instead of x/2.0.  Optimize sqrt(pow(x,y)) as pow(x,y*0.5),
log(pow(x,y)) as y*log(x), pow(exp(x),y) as exp(x*y),
pow(sqrt(x),y) as pow(x,y*0.5) and pow(pow(x,y),z) as pow(x,y*z).
Delete function scope "fcode" variable to avoid shadowing.

* gcc.dg/builtins-9.c: New test case.
* gcc.dg/builtins-10.c: New test case.

From-SVN: r65386
gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-10.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtins-9.c [new file with mode: 0644]