OSDN Git Service

* except.c (expand_start_all_catch): If the machine needs to
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 May 1997 01:00:58 +0000 (01:00 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 May 1997 01:00:58 +0000 (01:00 +0000)
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

gcc/config/alpha/alpha.md
gcc/config/pa/pa.md

index 61e0738..7b7cb09 100644 (file)
     }
 }")
 
+(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)))
index 3bb9794..3ac0bec 100644 (file)
 ;; 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;
+}")
+