From d6da68b9d4dec53bfd5d0ac6b80847cbc65eb806 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 2 Mar 2004 22:32:27 +0000 Subject: builtins.c (BUILTIN_SETJMP_FRAME_VALUE): Remove. * 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. From-SVN: r78789 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/builtins.c | 6 +----- gcc/doc/tm.texi | 8 ++++---- gcc/system.h | 2 +- gcc/target-def.h | 3 +++ gcc/target.h | 4 ++++ gcc/targhooks.c | 8 ++++++++ gcc/targhooks.h | 1 + 8 files changed, 38 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1782ba3..eed83b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2004-03-02 Kazu Hirata + + * 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 * config/m68hc11/m68hc11.md (move peephole2): New peepholes to optimize diff --git a/gcc/builtins.c b/gcc/builtins.c index aa8b090..291e605f 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -490,13 +490,9 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label) 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); diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 1658c27..3d253a1 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -2853,13 +2853,13 @@ before we can access arbitrary stack frames. You will seldom need to 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 diff --git a/gcc/system.h b/gcc/system.h index 5994354..8d91547 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -640,7 +640,7 @@ typedef char _Bool; 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 \ diff --git a/gcc/target-def.h b/gcc/target-def.h index 0b35bc1..9b04c30 100644 --- a/gcc/target-def.h +++ b/gcc/target-def.h @@ -331,6 +331,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #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 @@ -397,6 +399,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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, \ diff --git a/gcc/target.h b/gcc/target.h index 67cf25d..858c82a 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -421,6 +421,10 @@ struct gcc_target 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. */ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 03735a6..c93a1a8 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -105,6 +105,14 @@ default_setup_incoming_varargs (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED, { } +/* 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 diff --git a/gcc/targhooks.h b/gcc/targhooks.h index f755b0f..f90d6b3 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -27,6 +27,7 @@ extern bool default_return_in_memory (tree, tree); 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 *); -- cgit v1.1