diff options
author | Richard Henderson <rth@redhat.com> | 2001-09-21 13:26:44 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-09-21 13:26:44 -0700 |
commit | 9defc9b7ac96fd51c70aff0e452c753d1f6159b3 (patch) | |
tree | 5e65f35e37a55bf10f429b4ed3add9916578e469 /gcc | |
parent | 1853547e03a18cc73a2ba3e204408919e326831a (diff) | |
download | gcc-9defc9b7ac96fd51c70aff0e452c753d1f6159b3.zip gcc-9defc9b7ac96fd51c70aff0e452c753d1f6159b3.tar.gz gcc-9defc9b7ac96fd51c70aff0e452c753d1f6159b3.tar.bz2 |
rtl.h (LCT_RETURNS_TWICE): New.
* rtl.h (LCT_RETURNS_TWICE): New.
* calls.c (emit_call_1): Set current_function_calls_setjmp for
ECF_RETURNS_TWICE.
(emit_library_call_value_1): Map LCT_RETURNS_TWICE
to ECF_RETURNS_TWICE.
* except.c (sjlj_emit_function_enter): Use LCT_RETURNS_TWICE for
call to setjmp.
* unwind-sjlj.c: Invent the setjmp.h declarations if inhibit_libc.
* config/stormy16/stormy16.h (DONT_USE_BUILTIN_SETJMP): New.
(JMP_BUF_SIZE): New.
From-SVN: r45736
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/calls.c | 10 | ||||
-rw-r--r-- | gcc/config/stormy16/stormy16.h | 4 | ||||
-rw-r--r-- | gcc/except.c | 2 | ||||
-rw-r--r-- | gcc/rtl.h | 3 | ||||
-rw-r--r-- | gcc/unwind-sjlj.c | 5 |
6 files changed, 35 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 99fff49..414effb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,20 @@ 2001-09-21 Richard Henderson <rth@redhat.com> + * rtl.h (LCT_RETURNS_TWICE): New. + * calls.c (emit_call_1): Set current_function_calls_setjmp for + ECF_RETURNS_TWICE. + (emit_library_call_value_1): Map LCT_RETURNS_TWICE + to ECF_RETURNS_TWICE. + * except.c (sjlj_emit_function_enter): Use LCT_RETURNS_TWICE for + call to setjmp. + + * unwind-sjlj.c: Invent the setjmp.h declarations if inhibit_libc. + + * config/stormy16/stormy16.h (DONT_USE_BUILTIN_SETJMP): New. + (JMP_BUF_SIZE): New. + +2001-09-21 Richard Henderson <rth@redhat.com> + * config/stormy16/stormy16.h (REG_CLASS_FROM_LETTER): Map 'd' to R8_REGS. diff --git a/gcc/calls.c b/gcc/calls.c index f21160f..f2b1bdb 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -613,8 +613,11 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size, REG_NOTES (call_insn)); if (ecf_flags & ECF_RETURNS_TWICE) - REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx, - REG_NOTES (call_insn)); + { + REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx, + REG_NOTES (call_insn)); + current_function_calls_setjmp = 1; + } SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0); @@ -3531,6 +3534,9 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) case LCT_ALWAYS_RETURN: flags = ECF_ALWAYS_RETURN; break; + case LCT_RETURNS_TWICE: + flags = ECF_RETURNS_TWICE; + break; } fun = orgfun; diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h index 9a62b36..b2e85fa 100644 --- a/gcc/config/stormy16/stormy16.h +++ b/gcc/config/stormy16/stormy16.h @@ -4537,6 +4537,10 @@ do { \ instead of inline unwinders and __unwind_function in the non-setjmp case. */ #define DWARF2_UNWIND_INFO 0 +/* Don't use __builtin_setjmp for unwinding, since it's tricky to get + at the high 16 bits of an address. */ +#define DONT_USE_BUILTIN_SETJMP +#define JMP_BUF_SIZE 8 /* Assembler Commands for Alignment. */ diff --git a/gcc/except.c b/gcc/except.c index 0f0b662..4448610 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2144,7 +2144,7 @@ sjlj_emit_function_enter (dispatch_label) #ifdef DONT_USE_BUILTIN_SETJMP { rtx x, note; - x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_NORMAL, + x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_RETURNS_TWICE, TYPE_MODE (integer_type_node), 1, plus_constant (XEXP (fc, 0), sjlj_fc_jbuf_ofs), Pmode); @@ -1952,7 +1952,8 @@ enum libcall_type LCT_PURE_MAKE_BLOCK = 4, LCT_NORETURN = 5, LCT_THROW = 6, - LCT_ALWAYS_RETURN = 7 + LCT_ALWAYS_RETURN = 7, + LCT_RETURNS_TWICE = 8 }; extern void emit_library_call PARAMS ((rtx, enum libcall_type, diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c index 0f1d8ba..46f30ae 100644 --- a/gcc/unwind-sjlj.c +++ b/gcc/unwind-sjlj.c @@ -26,8 +26,13 @@ #if USING_SJLJ_EXCEPTIONS #ifdef DONT_USE_BUILTIN_SETJMP +#ifndef inhibit_libc #include <setjmp.h> #else +typedef void *jmp_buf[JMP_BUF_SIZE]; +extern void longjmp(jmp_buf, int) __attribute__((noreturn)); +#endif +#else #define setjmp __builtin_setjmp #define longjmp __builtin_longjmp #endif |