aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>1997-05-07 22:50:11 +0000
committerMike Stump <mrs@gcc.gnu.org>1997-05-07 22:50:11 +0000
commit6e6a07d29955e808fccd63ee2ca34ec217e19b5c (patch)
treecb529c4d7f439546438820c79f061fa0ec0e5666 /gcc/except.c
parent24f2dbd6f70dd5ae6b3069f7587b3a6ba4e2211f (diff)
downloadgcc-6e6a07d29955e808fccd63ee2ca34ec217e19b5c.zip
gcc-6e6a07d29955e808fccd63ee2ca34ec217e19b5c.tar.gz
gcc-6e6a07d29955e808fccd63ee2ca34ec217e19b5c.tar.bz2
except.c (start_dynamic_handler): Fix so that we can use __builtin_setjmp...
* except.c (start_dynamic_handler): Fix so that we can use __builtin_setjmp, and default to using __builtin_setjmp instead of setjmp. * expr.c (expand_builtin_setjmp): New routine, split out from existing inline code from expand_builtin. (expand_builtin): Split out code into expand_builtin_setjmp. * expr.h (expand_builtin_setjmp): Add declaration. * libgcc2.c (__sjthrow): Default to using __builtin_setjmp instead of setjmp. (__sjpopnthrow): Likewise. * optabs.c (init_optabs): Likewise. From-SVN: r14045
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 71925a5..91afbc3 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -693,9 +693,9 @@ add_partial_entry (handler)
when there are no more elements in the dynamic handler chain, when
the value is &top_elt from libgcc2.c. Immediately after the
pointer, is an area suitable for setjmp/longjmp when
- USE_BUILTIN_SETJMP isn't defined, and an area suitable for
- __builtin_setjmp/__builtin_longjmp when USE_BUILTIN_SETJMP is
- defined.
+ DONT_USE_BUILTIN_SETJMP is defined, and an area suitable for
+ __builtin_setjmp/__builtin_longjmp when DONT_USE_BUILTIN_SETJMP
+ isn't defined.
This routine is here to facilitate the porting of this code to
systems with threads. One can either replace the routine we emit a
@@ -843,10 +843,10 @@ static void
start_dynamic_handler ()
{
rtx dhc, dcc;
- rtx x, arg;
+ rtx x, arg, buf;
int size;
-#ifdef USE_BUILTIN_SETJMP
+#ifndef DONT_USE_BUILTIN_SETJMP
/* The number of Pmode words for the setjmp buffer, when using the
builtin setjmp/longjmp, see expand_builtin, case
BUILT_IN_LONGJMP. */
@@ -882,10 +882,14 @@ start_dynamic_handler ()
emit_move_insn (dcc, const0_rtx);
/* The jmpbuf starts two words into the area allocated. */
+ buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2);
+#ifdef DONT_USE_BUILTIN_SETJMP
x = emit_library_call_value (setjmp_libfunc, NULL_RTX, 1, SImode, 1,
- plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2),
- Pmode);
+ buf, Pmode);
+#else
+ x = expand_builtin_setjmp (buf, NULL_RTX);
+#endif
/* If we come back here for a catch, transfer control to the
handler. */