From a05a80fc7ce5743e8bd6b2a312f169509c444af8 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 20 Mar 2005 15:54:41 +0000 Subject: builtins.c (fold_builtin_1): Update a call to targetm.fold_builtin. * builtins.c (fold_builtin_1): Update a call to targetm.fold_builtin. * hooks.c (hook_tree_tree_bool_null): Rename to hook_tree_tree_tree_bool_null. Take one more argument of type tree. * hooks.h: Update the prototype of hook_tree_tree_bool_null. * target-def.h (TARGET_FOLD_BUILTIN): Define it as hook_tree_tree_tree_bool_null. * target.h (gcc_target): Update the prototype of fold_builtin. * config/alpha/alpha.c (alpha_fold_builtin): Take decomposed arguments of CALL_EXPR. * doc/tm.texi (TARGET_FOLD_BUILTIN): Update. Mention the new prototype. From-SVN: r96762 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/builtins.c | 2 +- gcc/config/alpha/alpha.c | 5 ++--- gcc/doc/tm.texi | 15 ++++++++------- gcc/hooks.c | 3 ++- gcc/hooks.h | 2 +- gcc/target-def.h | 2 +- gcc/target.h | 2 +- 8 files changed, 32 insertions(+), 15 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 379ac7f..7efd318 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2005-03-20 Kazu Hirata + + * builtins.c (fold_builtin_1): Update a call to + targetm.fold_builtin. + * hooks.c (hook_tree_tree_bool_null): Rename to + hook_tree_tree_tree_bool_null. Take one more argument of type + tree. + * hooks.h: Update the prototype of hook_tree_tree_bool_null. + * target-def.h (TARGET_FOLD_BUILTIN): Define it as + hook_tree_tree_tree_bool_null. + * target.h (gcc_target): Update the prototype of fold_builtin. + * config/alpha/alpha.c (alpha_fold_builtin): Take decomposed + arguments of CALL_EXPR. + * doc/tm.texi (TARGET_FOLD_BUILTIN): Update. Mention the + new prototype. + 2005-03-20 Jan Hubicka * cgraph.h (cgraph_node): Add prev_clone pointer. diff --git a/gcc/builtins.c b/gcc/builtins.c index 0f39ec3..a2b08f6 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7947,7 +7947,7 @@ fold_builtin_1 (tree exp, bool ignore) enum built_in_function fcode; if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) - return targetm.fold_builtin (exp, ignore); + return targetm.fold_builtin (fndecl, arglist, ignore); fcode = DECL_FUNCTION_CODE (fndecl); switch (fcode) diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 102f568..67575e6 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -6499,14 +6499,13 @@ alpha_fold_builtin_ctpop (unsigned HOST_WIDE_INT opint[], long op_const) /* Fold one of our builtin functions. */ static tree -alpha_fold_builtin (tree exp, bool ignore ATTRIBUTE_UNUSED) +alpha_fold_builtin (tree fndecl, tree arglist, bool ignore ATTRIBUTE_UNUSED) { - tree fndecl = get_callee_fndecl (exp); tree op[MAX_ARGS], t; unsigned HOST_WIDE_INT opint[MAX_ARGS]; long op_const = 0, arity = 0; - for (t = TREE_OPERAND (exp, 1); t ; t = TREE_CHAIN (t), ++arity) + for (t = arglist; t ; t = TREE_CHAIN (t), ++arity) { tree arg = TREE_VALUE (t); if (arg == error_mark_node) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index aa5c929..799a0f8 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -9446,13 +9446,14 @@ ignored. This function should return the result of the call to the built-in function. @end deftypefn -@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{exp}, bool @var{ignore}) - -Expand a call to a machine specific built-in function that was set up by -@samp{TARGET_INIT_BUILTINS}. @var{exp} is the expression for the -function call; the result is another tree containing a simplified -expression for the call's result. If @var{ignore} is true the -value will be ignored. +@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{fndecl}, tree @var{arglist}, bool @var{ignore}) + +Fold a call to a machine specific built-in function that was set up by +@samp{TARGET_INIT_BUILTINS}. @var{fndecl} is the declaration of the +built-in function. @var{arglist} is the list of arguments passed to +the built-in function. The result is another tree containing a +simplified expression for the call's result. If @var{ignore} is true +the value will be ignored. @end deftypefn @defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2}) diff --git a/gcc/hooks.c b/gcc/hooks.c index 471901f..274d427a 100644 --- a/gcc/hooks.c +++ b/gcc/hooks.c @@ -243,7 +243,8 @@ hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED) } tree -hook_tree_tree_bool_null (tree t ATTRIBUTE_UNUSED, bool ignore ATTRIBUTE_UNUSED) +hook_tree_tree_tree_bool_null (tree t0 ATTRIBUTE_UNUSED, tree t1 ATTRIBUTE_UNUSED, + bool ignore ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/hooks.h b/gcc/hooks.h index 5642b56..133ea2a 100644 --- a/gcc/hooks.h +++ b/gcc/hooks.h @@ -64,5 +64,5 @@ extern rtx hook_rtx_rtx_null (rtx); extern rtx hook_rtx_tree_int_null (tree, int); extern tree hook_tree_tree_identity (tree a); extern const char *hook_constcharptr_tree_null (tree); -extern tree hook_tree_tree_bool_null (tree, bool); +extern tree hook_tree_tree_tree_bool_null (tree, tree, bool); #endif diff --git a/gcc/target-def.h b/gcc/target-def.h index e4e2b36..bb989f9 100644 --- a/gcc/target-def.h +++ b/gcc/target-def.h @@ -296,7 +296,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* In builtins.c. */ #define TARGET_INIT_BUILTINS hook_void_void #define TARGET_EXPAND_BUILTIN default_expand_builtin -#define TARGET_FOLD_BUILTIN hook_tree_tree_bool_null +#define TARGET_FOLD_BUILTIN hook_tree_tree_tree_bool_null /* In varasm.c. */ #ifndef TARGET_SECTION_TYPE_FLAGS diff --git a/gcc/target.h b/gcc/target.h index 3513550..152cb7d 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -344,7 +344,7 @@ struct gcc_target enum machine_mode mode, int ignore); /* Fold a target-specific builtin. */ - tree (* fold_builtin) (tree exp, bool ignore); + tree (* fold_builtin) (tree fndecl, tree arglist, bool ignore); /* For a vendor-specific fundamental TYPE, return a pointer to a statically-allocated string containing the C++ mangling for -- cgit v1.1