summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/config/alpha/alpha.c5
-rw-r--r--gcc/doc/tm.texi15
-rw-r--r--gcc/hooks.c3
-rw-r--r--gcc/hooks.h2
-rw-r--r--gcc/target-def.h2
-rw-r--r--gcc/target.h2
8 files changed, 32 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 379ac7fdee9..7efd3180139 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2005-03-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * 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 <jh@suse.cz>
* cgraph.h (cgraph_node): Add prev_clone pointer.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 0f39ec36edb..a2b08f6d749 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 102f568e2a4..67575e62dac 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 aa5c929f048..799a0f854d3 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 471901f303d..274d427a931 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 5642b560939..133ea2a1b80 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 e4e2b36a3d0..bb989f94345 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 35135501b16..152cb7d3584 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
OpenPOWER on IntegriCloud