[patch] builtins.c: Change fold_builtin_bitop to take decomposed arguments.

Kazu Hirata kazu@cs.umass.edu
Thu Mar 17 21:17:00 GMT 2005


Hi,

Attached is a patch to change fold_builtin_bitop 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_bitop version of Roger's patch above.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2005-03-17  Kazu Hirata  <kazu@cs.umass.edu>

	* builtins.c (fold_builtin_bitop): Take decomposed arguments
	of CALL_EXPR.
	(fold_builtin_1): Update a call to fold_builtin_bitop.

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.437
diff -u -d -p -r1.437 builtins.c
--- builtins.c	16 Mar 2005 14:45:09 -0000	1.437
+++ builtins.c	16 Mar 2005 14:45:58 -0000
@@ -161,7 +161,7 @@ static tree fold_builtin_trunc (tree);
 static tree fold_builtin_floor (tree);
 static tree fold_builtin_ceil (tree);
 static tree fold_builtin_round (tree);
-static tree fold_builtin_bitop (tree);
+static tree fold_builtin_bitop (tree, tree);
 static tree fold_builtin_memcpy (tree);
 static tree fold_builtin_mempcpy (tree, tree, int);
 static tree fold_builtin_memmove (tree, tree);
@@ -6668,10 +6668,8 @@ fold_builtin_lround (tree exp)
    Return NULL_TREE if no simplification can be made.  */
 
 static tree
-fold_builtin_bitop (tree exp)
+fold_builtin_bitop (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree arg;
 
   if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE))
@@ -8236,7 +8234,7 @@ fold_builtin_1 (tree exp, bool ignore)
     case BUILT_IN_PARITY:
     case BUILT_IN_PARITYL:
     case BUILT_IN_PARITYLL:
-      return fold_builtin_bitop (exp);
+      return fold_builtin_bitop (fndecl, arglist);
 
     case BUILT_IN_MEMCPY:
       return fold_builtin_memcpy (exp);



More information about the Gcc-patches mailing list