This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] builtins.c: Change fold_builtin_signbit to take decomposedarguments.


Hi,

Attached is a patch to change fold_builtin_signbit 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_signbit 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_signbit): Take decomposed arguments
	of CALL_EXPR.
	(fold_builtin_1): Update a call to fold_builtin_signbit.

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:46:11 -0000
@@ -169,7 +169,7 @@ static tree fold_builtin_strchr (tree, t
 static tree fold_builtin_memcmp (tree);
 static tree fold_builtin_strcmp (tree);
 static tree fold_builtin_strncmp (tree);
-static tree fold_builtin_signbit (tree);
+static tree fold_builtin_signbit (tree, tree);
 static tree fold_builtin_copysign (tree, tree, tree);
 static tree fold_builtin_isascii (tree);
 static tree fold_builtin_toascii (tree);
@@ -7559,10 +7559,8 @@ fold_builtin_strncmp (tree arglist)
    NULL_TREE if no simplification can be made.  */
 
 static tree
-fold_builtin_signbit (tree exp)
+fold_builtin_signbit (tree fndecl, tree arglist)
 {
-  tree fndecl = get_callee_fndecl (exp);
-  tree arglist = TREE_OPERAND (exp, 1);
   tree type = TREE_TYPE (TREE_TYPE (fndecl));
   tree arg, temp;
 
@@ -8250,7 +8248,7 @@ fold_builtin_1 (tree exp, bool ignore)
     case BUILT_IN_SIGNBIT:
     case BUILT_IN_SIGNBITF:
     case BUILT_IN_SIGNBITL:
-      return fold_builtin_signbit (exp);
+      return fold_builtin_signbit (fndecl, arglist);
 
     case BUILT_IN_ISASCII:
       return fold_builtin_isascii (arglist);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]