From: mrs Date: Fri, 16 May 1997 01:00:58 +0000 (+0000) Subject: * except.c (expand_start_all_catch): If the machine needs to X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=30ee772286e64e0ad24d9b48a424fbeecf39d07a * except.c (expand_start_all_catch): If the machine needs to perform any actions at the start of an expcetion handler that hasn't already been done, use gen_exception_receiver to emit it. (expand_leftover_cleanups): Likewise. * alpha/alpha.md (exception_receiver): Use it. * pa/pa.h (exception_receiver): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14071 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 61e0738e054..7b7cb09c7f7 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -4382,6 +4382,11 @@ } }") +(define_insn "exception_receiver" + [(unspec_volatile [(const_int 0)] 2)] + "! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT" + ".long 0xc3a00000\;ldgp $29,0($29)") + (define_expand "nonlocal_goto_receiver" [(unspec_volatile [(const_int 0)] 1) (set (reg:DI 27) (mem:DI (reg:DI 29))) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 3bb9794a983..3ac0bece7db 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5155,4 +5155,24 @@ ;; Out of range and PIC (const_int 44)))]) +;; On the PA, the PIC register is call clobbered, so it must +;; be saved & restored around calls by the caller. If the call +;; doesn't return normally (nonlocal goto, or an exception is +;; thrown), then the code at the exception handler label must +;; restore the PIC register. +(define_expand "exception_receiver" + [(const_int 4)] + "!TARGET_PORTABLE_RUNTIME && flag_pic" + " +{ + /* Load the PIC register from the stack slot (in our caller's + frame). */ + emit_move_insn (pic_offset_table_rtx, + gen_rtx (MEM, SImode, + plus_constant (stack_pointer_rtx, -32))); + emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); + emit_insn (gen_blockage ()); + DONE; +}") +