+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
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))
{
/* 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
TARGET_ALIGN_ANON_BITFIELD, \
TARGET_INIT_BUILTINS, \
TARGET_EXPAND_BUILTIN, \
+ TARGET_FOLD_BUILTIN, \
TARGET_MANGLE_FUNDAMENTAL_TYPE, \
TARGET_INIT_LIBFUNCS, \
TARGET_SECTION_TYPE_FLAGS, \
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. */
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,
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