* builtins.c (fold_builtin): Constant fold expressions as x*0.5
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Apr 2003 23:24:38 +0000 (23:24 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Apr 2003 23:24:38 +0000 (23:24 +0000)
commit2643011aed8692ce128b0bc8f78ad03d1a5661d3
tree57e664d9c1807ff9f4b3bd4f3e4ddbb0c32619d0
parent38c416603c656090e4f9a69b0a1450728aa247b8
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65386 138bc75d-0d04-0410-961f-82ee72b054a4
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]