This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] builtins.c: Change fold_builtin_exponent to takedecomposed arguments.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Mar 2005 08:59:43 -0500 (EST)
- Subject: [patch] builtins.c: Change fold_builtin_exponent to takedecomposed arguments.
Hi,
Attached is a patch to change fold_builtin_exponent to take decomposed
arguments.
For a patch description, see:
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg00916.html
This patch is a fold_builtin_exponent version of Roger's patch above.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2005-03-12 Kazu Hirata <kazu@cs.umass.edu>
* builtins.c (fold_builtin_exponent): Take decomposed
arguments of CALL_EXPR.
(fold_builtin_1): Update a call to fold_builtin_exponent.
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.429
diff -u -d -p -r1.429 builtins.c
--- builtins.c 10 Mar 2005 21:38:54 -0000 1.429
+++ builtins.c 11 Mar 2005 18:51:16 -0000
@@ -7084,13 +7084,11 @@ fold_builtin_powi (tree fndecl ATTRIBUTE
VALUE is the value which will be raised to a power. */
static tree
-fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value)
+fold_builtin_exponent (tree fndecl, tree arglist,
+ const REAL_VALUE_TYPE *value)
{
- tree arglist = TREE_OPERAND (exp, 1);
-
if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
{
- tree fndecl = get_callee_fndecl (exp);
tree type = TREE_TYPE (TREE_TYPE (fndecl));
tree arg = TREE_VALUE (arglist);
@@ -8101,12 +8099,12 @@ fold_builtin_1 (tree exp, bool ignore)
case BUILT_IN_EXP:
case BUILT_IN_EXPF:
case BUILT_IN_EXPL:
- return fold_builtin_exponent (exp, &dconste);
+ return fold_builtin_exponent (fndecl, arglist, &dconste);
case BUILT_IN_EXP2:
case BUILT_IN_EXP2F:
case BUILT_IN_EXP2L:
- return fold_builtin_exponent (exp, &dconst2);
+ return fold_builtin_exponent (fndecl, arglist, &dconst2);
case BUILT_IN_EXP10:
case BUILT_IN_EXP10F:
@@ -8114,7 +8112,7 @@ fold_builtin_1 (tree exp, bool ignore)
case BUILT_IN_POW10:
case BUILT_IN_POW10F:
case BUILT_IN_POW10L:
- return fold_builtin_exponent (exp, &dconst10);
+ return fold_builtin_exponent (fndecl, arglist, &dconst10);
case BUILT_IN_LOG:
case BUILT_IN_LOGF: