This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] builtins.c: Change fold_builtin_classify 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 23:12:12 -0500 (EST)
- Subject: [patch] builtins.c: Change fold_builtin_classify to takedecomposed arguments.
Hi,
Attached is a patch to change fold_builtin_classify 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_classify version of Roger's patch above.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2005-03-13 Kazu Hirata <kazu@cs.umass.edu>
* builtins.c (fold_builtin_classify): Take decomposed
arguments of CALL_EXPR.
(fold_builtin_1): Update a call to fold_builtin_classify.
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.432
diff -u -d -p -r1.432 builtins.c
--- builtins.c 12 Mar 2005 16:14:42 -0000 1.432
+++ builtins.c 12 Mar 2005 16:29:44 -0000
@@ -7750,10 +7750,8 @@ fold_builtin_abs (tree arglist, tree typ
EXP is the CALL_EXPR for the call. */
static tree
-fold_builtin_classify (tree exp, int builtin_index)
+fold_builtin_classify (tree fndecl, tree arglist, int builtin_index)
{
- tree fndecl = get_callee_fndecl (exp);
- tree arglist = TREE_OPERAND (exp, 1);
tree type = TREE_TYPE (TREE_TYPE (fndecl));
tree arg;
REAL_VALUE_TYPE r;
@@ -8264,17 +8262,17 @@ fold_builtin_1 (tree exp, bool ignore)
case BUILT_IN_FINITE:
case BUILT_IN_FINITEF:
case BUILT_IN_FINITEL:
- return fold_builtin_classify (exp, BUILT_IN_FINITE);
+ return fold_builtin_classify (fndecl, arglist, BUILT_IN_FINITE);
case BUILT_IN_ISINF:
case BUILT_IN_ISINFF:
case BUILT_IN_ISINFL:
- return fold_builtin_classify (exp, BUILT_IN_ISINF);
+ return fold_builtin_classify (fndecl, arglist, BUILT_IN_ISINF);
case BUILT_IN_ISNAN:
case BUILT_IN_ISNANF:
case BUILT_IN_ISNANL:
- return fold_builtin_classify (exp, BUILT_IN_ISNAN);
+ return fold_builtin_classify (fndecl, arglist, BUILT_IN_ISNAN);
case BUILT_IN_ISGREATER:
return fold_builtin_unordered_cmp (fndecl, arglist, UNLE_EXPR, LE_EXPR);