* hooks.c (hook_tree_tree_identity): New.
* hooks.h: Add a prototype for hook_tree_tree_identity.
* stmt.c (expand_asm_operands): Use targetm.md_asm_clobbers
instead of MD_ASM_CLOBBERS.
* system.h (MD_ASM_CLOBBERS): Poison.
* target-def.h (TARGET_MD_ASM_CLOBBERS): New.
(TARGET_INITIALIZER): Add TARGET_MD_ASM_CLOBBERS.
* target.h (gcc_target): Add md_asm_clobbers.
* config/i386/i386.c (TARGET_MD_ASM_CLOBBERS): New.
(ix86_md_asm_clobbers): New.
* config/i386/i386.h (MD_ASM_CLOBBERS): Remove.
* doc/tm.texi (MD_ASM_CLOBBERS): Change to
TARGET_MD_ASM_CLOBBERS.
From-SVN: r78868
+2004-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * hooks.c (hook_tree_tree_identity): New.
+ * hooks.h: Add a prototype for hook_tree_tree_identity.
+ * stmt.c (expand_asm_operands): Use targetm.md_asm_clobbers
+ instead of MD_ASM_CLOBBERS.
+ * system.h (MD_ASM_CLOBBERS): Poison.
+ * target-def.h (TARGET_MD_ASM_CLOBBERS): New.
+ (TARGET_INITIALIZER): Add TARGET_MD_ASM_CLOBBERS.
+ * target.h (gcc_target): Add md_asm_clobbers.
+ * config/i386/i386.c (TARGET_MD_ASM_CLOBBERS): New.
+ (ix86_md_asm_clobbers): New.
+ * config/i386/i386.h (MD_ASM_CLOBBERS): Remove.
+ * doc/tm.texi (MD_ASM_CLOBBERS): Change to
+ TARGET_MD_ASM_CLOBBERS.
+
2004-03-03 Stuart Hastings <stuart@apple.com>
+
* gcc/config.gcc: Arrange for Darwin/x86 to build libgcc_eh.a.
2004-03-03 Eric Botcazou <ebotcazou@libertysurf.fr>
static int extended_reg_mentioned_1 (rtx *, void *);
static bool ix86_rtx_costs (rtx, int, int, int *);
static int min_insn_size (rtx);
+static tree ix86_md_asm_clobbers (tree clobbers);
#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION)
static void ix86_svr3_asm_out_constructor (rtx, int);
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list
+#undef TARGET_MD_ASM_CLOBBERS
+#define TARGET_MD_ASM_CLOBBERS ix86_md_asm_clobbers
+
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
}
}
+/* Worker function for TARGET_MD_ASM_CLOBBERS.
+
+ We do this in the new i386 backend to maintain source compatibility
+ with the old cc0-based compiler. */
+
+static tree
+ix86_md_asm_clobbers (tree clobbers)
+{
+ clobbers = tree_cons (NULL_TREE, build_string (5, "flags"),
+ clobbers);
+ clobbers = tree_cons (NULL_TREE, build_string (4, "fpsr"),
+ clobbers);
+ clobbers = tree_cons (NULL_TREE, build_string (7, "dirflag"),
+ clobbers);
+ return clobbers;
+}
+
#include "gt-i386.h"
|| MAYBE_MMX_CLASS_P (CLASS) \
: GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
-
-/* A C statement that adds to CLOBBERS any hard regs the port wishes
- to automatically clobber for all asms.
-
- We do this in the new i386 backend to maintain source compatibility
- with the old cc0-based compiler. */
-
-#define MD_ASM_CLOBBERS(CLOBBERS) \
- do { \
- (CLOBBERS) = tree_cons (NULL_TREE, build_string (5, "flags"), \
- (CLOBBERS)); \
- (CLOBBERS) = tree_cons (NULL_TREE, build_string (4, "fpsr"), \
- (CLOBBERS)); \
- (CLOBBERS) = tree_cons (NULL_TREE, build_string (7, "dirflag"), \
- (CLOBBERS)); \
- } while (0)
\f
/* Stack layout; function entry, exit and calling. */
symbols must be explicitly imported from shared libraries (DLLs).
@end defmac
-@defmac MD_ASM_CLOBBERS (@var{clobbers})
-A C statement that adds to @var{clobbers} @code{STRING_CST} trees for
+@deftypefn {Target Hook} tree TARGET_MD_ASM_CLOBBERS (tree @var{clobbers})
+This target hook should add to @var{clobbers} @code{STRING_CST} trees for
any hard regs the port wishes to automatically clobber for all asms.
-@end defmac
+It should return the result of the last @code{tree_cons} used to add a
+clobber.
+@end deftypefn
@defmac MATH_LIBRARY
Define this macro as a C string constant for the linker argument to link
{
return false;
}
+
+/* Generic hook that takes a tree and returns it as is. */
+tree
+hook_tree_tree_identity (tree a)
+{
+ return a;
+}
extern rtx hook_rtx_tree_int_null (tree, int);
extern void * hook_voidp_size_t_null (size_t);
extern bool hook_bool_voidp_size_t_false (void *, size_t);
+extern tree hook_tree_tree_identity (tree a);
#endif
for (t = inputs; t ; t = TREE_CHAIN (t), i++)
constraints[i] = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
-#ifdef MD_ASM_CLOBBERS
/* Sometimes we wish to automatically clobber registers across an asm.
Case in point is when the i386 backend moved from cc0 to a hard reg --
maintaining source-level compatibility means automatically clobbering
the flags register. */
- MD_ASM_CLOBBERS (clobbers);
-#endif
+ clobbers = targetm.md_asm_clobbers (clobbers);
/* Count the number of meaningful clobbered registers, ignoring what
we would ignore later. */
MAX_WCHAR_TYPE_SIZE GCOV_TYPE_SIZE SHARED_SECTION_ASM_OP \
FINAL_REG_PARM_STACK_SPACE MAYBE_REG_PARM_STACK_SPACE \
TRADITIONAL_PIPELINE_INTERFACE DFA_PIPELINE_INTERFACE \
- DBX_OUTPUT_STANDARD_TYPES BUILTIN_SETJMP_FRAME_VALUE
+ DBX_OUTPUT_STANDARD_TYPES BUILTIN_SETJMP_FRAME_VALUE \
+ MD_ASM_CLOBBERS
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
#define TARGET_BUILTIN_SETJMP_FRAME_VALUE default_builtin_setjmp_frame_value
+#define TARGET_MD_ASM_CLOBBERS hook_tree_tree_identity
+
#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_false
#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_false
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_false
TARGET_PCH_VALID_P, \
TARGET_DEFAULT_SHORT_ENUMS, \
TARGET_BUILTIN_SETJMP_FRAME_VALUE, \
+ TARGET_MD_ASM_CLOBBERS, \
TARGET_HAVE_NAMED_SECTIONS, \
TARGET_HAVE_CTORS_DTORS, \
TARGET_HAVE_TLS, \
of the current frame into the built-in setjmp buffer. */
rtx (* builtin_setjmp_frame_value) (void);
+ /* This target hook should add STRING_CST trees for any hard regs
+ the port wishes to automatically clobber for all asms. */
+ tree (* md_asm_clobbers) (tree);
+
/* Leave the boolean fields at the end. */
/* True if arbitrary sections are supported. */