This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize pow(x,0.0) = pow(1.0,y) = 1.0
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at www dot eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 21 Feb 2003 15:28:19 -0800
- Subject: Re: [PATCH] Optimize pow(x,0.0) = pow(1.0,y) = 1.0
- References: <Pine.LNX.4.44.0302202055390.24397-100000@www.eyesopen.com>
On Thu, Feb 20, 2003 at 09:10:14PM -0700, Roger Sayle wrote:
> * fold-const.c (omit_one_operand): No longer static.
> * tree.h (omit_one_operand): Prototype here.
> (div_and_round_double): Keep fold-const.c prototypes together.
> * builtins.c (builtin_mathfn_code): Handle binary built-in
> funtions, such as "pow" and "atan2".
> (fold_builtin): Optimize both pow(x,0.0) and pow(1.0,y) to 1.0.
> Simplify optimizations using "type" the builtin's return type.
>
> * gcc.dg/builtins-5.c: New test case.
Ok.
r~