builtins.c (fold_builtin): Call the new omonymous target hook for machine-dependent built-ins.

2004-09-20  Paolo Bonzini  <bonzini@gnu.org>

	* builtins.c (fold_builtin): Call the new omonymous
	target hook for machine-dependent built-ins.
	* target-def.h (TARGET_FOLD_BUILTIN): New.
	* target.h (struct gcc_target): Add the fold_builtin hook.
	* targhooks.c (default_fold_builtin): New.
	* targhooks.h (default_fold_builtin): Declare it.

From-SVN: r87756
This commit is contained in:
Paolo Bonzini 2004-09-20 14:47:20 +00:00 committed by Paolo Bonzini
parent bb9be5eb9c
commit c2dda19b3b
6 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2004-09-20 Paolo Bonzini <bonzini@gnu.org>
* builtins.c (fold_builtin): Call the new omonymous
target hook for machine-dependent built-ins.
* target-def.h (TARGET_FOLD_BUILTIN): New.
* target.h (struct gcc_target): Add the fold_builtin hook.
* targhooks.c (default_fold_builtin): New.
* targhooks.h (default_fold_builtin): Declare it.
2004-09-20 Kazu Hirata <kazu@cs.umass.edu>
* cfg.c, tree-ssa-threadupdate.c, tree-vectorizer.c: Fix

View File

@ -8206,7 +8206,7 @@ fold_builtin_1 (tree exp, bool ignore)
tree type = TREE_TYPE (TREE_TYPE (fndecl));
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
return 0;
return targetm.fold_builtin (exp, ignore);
switch (DECL_FUNCTION_CODE (fndecl))
{

View File

@ -287,6 +287,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 default_fold_builtin
/* In varasm.c. */
#ifndef TARGET_SECTION_TYPE_FLAGS
@ -477,6 +478,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ALIGN_ANON_BITFIELD, \
TARGET_INIT_BUILTINS, \
TARGET_EXPAND_BUILTIN, \
TARGET_FOLD_BUILTIN, \
TARGET_MANGLE_FUNDAMENTAL_TYPE, \
TARGET_INIT_LIBFUNCS, \
TARGET_SECTION_TYPE_FLAGS, \

View File

@ -324,6 +324,9 @@ struct gcc_target
rtx (* expand_builtin) (tree exp, rtx target, rtx subtarget,
enum machine_mode mode, int ignore);
/* Fold a target-specific builtin. */
tree (* fold_builtin) (tree exp, bool ignore);
/* For a vendor-specific fundamental TYPE, return a pointer to
a statically-allocated string containing the C++ mangling for
TYPE. In all other cases, return NULL. */

View File

@ -97,6 +97,12 @@ default_expand_builtin_saveregs (void)
return const0_rtx;
}
tree
default_fold_builtin (tree t ATTRIBUTE_UNUSED, bool ignore ATTRIBUTE_UNUSED)
{
return NULL_TREE;
}
void
default_setup_incoming_varargs (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED,

View File

@ -29,6 +29,7 @@ extern rtx default_expand_builtin_saveregs (void);
extern void default_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
extern rtx default_builtin_setjmp_frame_value (void);
extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
extern tree default_fold_builtin (tree t, bool ignore);
extern enum machine_mode default_eh_return_filter_mode (void);
extern unsigned HOST_WIDE_INT default_shift_truncation_mask