aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa/pa.md
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2001-05-07 19:22:28 +0000
committerJohn David Anglin <dave@hiauly1.hia.nrc.ca>2001-05-07 19:22:28 +0000
commit5c7f9e62c14cbf6ef4f48771c10499926958bde4 (patch)
treee654e4b7d5605860277f7280f0a03e75c87761dd /gcc/config/pa/pa.md
parent17a7ec1d46e19b25f74b23798647a812db148c51 (diff)
* pa.md (interspace_jump): Revise comment.
(builtin_longjmp): Block initial setup insns from delay slot of interspace branch. (builtin_setjmp_receiver): New expander to save and restore PIC register. * som.h (NM_FLAGS): Remove `-n' sort option. Revise comment. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@41902 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa/pa.md')
-rw-r--r--gcc/config/pa/pa.md24
1 files changed, 22 insertions, 2 deletions
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index abb4eab236e..ab587b391b6 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -6212,8 +6212,7 @@
;;; EH does longjmp's from and within the data section. Thus,
;;; an interspace branch is required for the longjmp implementation.
-;;; Registers r1 and r2 are not saved in the jmpbuf environment.
-;;; Thus, they can be used as scratch registers for the jump.
+;;; Registers r1 and r2 are used as scratch registers for the jump.
(define_expand "interspace_jump"
[(parallel
[(set (pc) (match_operand 0 "pmode_register_operand" "a"))
@@ -6263,10 +6262,16 @@
where to look for it when we get back to setjmp's function for
restoring the gp. */
emit_move_insn (pv, lab);
+
+ /* Prevent the insns above from being scheduled into the delay slot
+ of the interspace jump because the space register could change. */
+ emit_insn (gen_blockage ());
+
emit_jump_insn (gen_interspace_jump (pv));
emit_barrier ();
DONE;
}")
+
;;; Hope this is only within a function...
(define_insn "indirect_jump"
[(set (pc) (match_operand 0 "register_operand" "r"))]
@@ -7124,3 +7129,18 @@
emit_insn (gen_blockage ());
DONE;
}")
+
+(define_expand "builtin_setjmp_receiver"
+ [(label_ref (match_operand 0 "" ""))]
+ "flag_pic"
+ "
+{
+ if (PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX)
+ hppa_init_pic_save ();
+
+ /* Restore the PIC register. Hopefully, this will always be from
+ a stack slot. The only registers that are valid after a
+ builtin_longjmp are the stack and frame pointers. */
+ emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX);
+ DONE;
+}")