(expand_builtin_setjmp_setup): Use
targetm.builtin_setjmp_frame_value instead of
BUILTIN_SETJMP_FRAME_VALUE.
* system.h (BUILTIN_SETJMP_FRAME_VALUE): Poison.
* target-def.h (TARGET_BUILTIN_SETJMP_FRAME_VALUE): New.
(TARGET_INITIALIZER): Add TARGET_BUILTIN_SETJMP_FRAME_VALUE.
* target.h (gcc_target): Add builtin_setjmp_frame_value.
* targhooks.c (default_builtin_setjmp_frame_value): New.
* targhooks.h: Add a prototype for
default_builtin_setjmp_frame_value.
* doc/tm.texi (BUILTIN_SETJMP_FRAME_VALUE): Change to
TARGET_BUILTIN_SETJMP_FRAME_VALUE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78789
138bc75d-0d04-0410-961f-
82ee72b054a4
+2004-03-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtins.c (BUILTIN_SETJMP_FRAME_VALUE): Remove.
+ (expand_builtin_setjmp_setup): Use
+ targetm.builtin_setjmp_frame_value instead of
+ BUILTIN_SETJMP_FRAME_VALUE.
+ * system.h (BUILTIN_SETJMP_FRAME_VALUE): Poison.
+ * target-def.h (TARGET_BUILTIN_SETJMP_FRAME_VALUE): New.
+ (TARGET_INITIALIZER): Add TARGET_BUILTIN_SETJMP_FRAME_VALUE.
+ * target.h (gcc_target): Add builtin_setjmp_frame_value.
+ * targhooks.c (default_builtin_setjmp_frame_value): New.
+ * targhooks.h: Add a prototype for
+ default_builtin_setjmp_frame_value.
+ * doc/tm.texi (BUILTIN_SETJMP_FRAME_VALUE): Change to
+ TARGET_BUILTIN_SETJMP_FRAME_VALUE.
+
2004-03-02 Stephane Carrez <stcarrez@nerim.fr>
* config/m68hc11/m68hc11.md (move peephole2): New peepholes to optimize
the buffer and use the rest of it for the stack save area, which
is machine-dependent. */
-#ifndef BUILTIN_SETJMP_FRAME_VALUE
-#define BUILTIN_SETJMP_FRAME_VALUE virtual_stack_vars_rtx
-#endif
-
mem = gen_rtx_MEM (Pmode, buf_addr);
set_mem_alias_set (mem, setjmp_alias_set);
- emit_move_insn (mem, BUILTIN_SETJMP_FRAME_VALUE);
+ emit_move_insn (mem, targetm.builtin_setjmp_frame_value ());
mem = gen_rtx_MEM (Pmode, plus_constant (buf_addr, GET_MODE_SIZE (Pmode))),
set_mem_alias_set (mem, setjmp_alias_set);
define this macro.
@end defmac
-@defmac BUILTIN_SETJMP_FRAME_VALUE
-If defined, a C expression that contains an rtx that is used to store
+@deftypefn {Target Hook} bool TARGET_BUILTIN_SETJMP_FRAME_VALUE ()
+This target hook should return an rtx that is used to store
the address of the current frame into the built in @code{setjmp} buffer.
The default value, @code{virtual_stack_vars_rtx}, is correct for most
-machines. One reason you may need to define this macro is if
+machines. One reason you may need to define this target hook is if
@code{hard_frame_pointer_rtx} is the appropriate value on your machine.
-@end defmac
+@end deftypefn
@defmac RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
A C expression whose value is RTL representing the value of the return
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
+ DBX_OUTPUT_STANDARD_TYPES BUILTIN_SETJMP_FRAME_VALUE
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
#define TARGET_DEFAULT_SHORT_ENUMS hook_bool_void_false
+#define TARGET_BUILTIN_SETJMP_FRAME_VALUE default_builtin_setjmp_frame_value
+
#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_GET_PCH_VALIDITY, \
TARGET_PCH_VALID_P, \
TARGET_DEFAULT_SHORT_ENUMS, \
+ TARGET_BUILTIN_SETJMP_FRAME_VALUE, \
TARGET_HAVE_NAMED_SECTIONS, \
TARGET_HAVE_CTORS_DTORS, \
TARGET_HAVE_TLS, \
that type. */
bool (* default_short_enums) (void);
+ /* This target hook returns an rtx that is used to store the address
+ of the current frame into the built in @code{setjmp} buffer. */
+ rtx (* builtin_setjmp_frame_value) (void);
+
/* Leave the boolean fields at the end. */
/* True if arbitrary sections are supported. */
{
}
+/* The default implementation of TARGET_BUILTIN_SETJMP_FRAME_VALUE. */
+
+rtx
+default_builtin_setjmp_frame_value (void)
+{
+ return virtual_stack_vars_rtx;
+}
+
/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */
bool
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 hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *);
extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);