summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-02 22:32:27 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-02 22:32:27 +0000
commite3e026e82e7b2e8c9a1324bb859a2d6fb39120cd (patch)
tree4a224f62d0f48c8459cf8809eaf8a6da465f0ca9
parentfac7a62f9d393eb44398ec04d2181f309028c551 (diff)
downloadgcc-e3e026e82e7b2e8c9a1324bb859a2d6fb39120cd.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78789 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/builtins.c6
-rw-r--r--gcc/doc/tm.texi8
-rw-r--r--gcc/system.h2
-rw-r--r--gcc/target-def.h3
-rw-r--r--gcc/target.h4
-rw-r--r--gcc/targhooks.c8
-rw-r--r--gcc/targhooks.h1
8 files changed, 38 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a1782ba302f..eed83b2628b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+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
diff --git a/gcc/builtins.c b/gcc/builtins.c
index aa8b090f357..291e605fcb9 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 1658c27b232..3d253a1a28f 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 599435429d9..8d91547fe98 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 0b35bc1855a..9b04c303216 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 67cf25da0f6..858c82ad31a 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 03735a64eda..c93a1a8ec66 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 f755b0f19b5..f90d6b3612c 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 *);