From 6e6a07d29955e808fccd63ee2ca34ec217e19b5c Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 7 May 1997 22:50:11 +0000 Subject: 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 --- gcc/except.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'gcc/except.c') 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. */ -- cgit v1.1