Commit 2caa0ddf by Jeffrey A Law Committed by Jeff Law

pa.md (return_internal): Add a USE of the PIC register to ensure it is restored after each call.

        * pa.md (return_internal): Add a USE of the PIC register to ensure
        it is restored after each call.
        (return expander): Corresponding changes.

From-SVN: r39193
parent 15235317
Mon Jan 22 20:53:47 2001 Jeffrey A Law (law@cygnus.com)
* pa.md (return_internal): Add a USE of the PIC register to ensure
it is restored after each call.
(return expander): Corresponding changes.
2001-01-22 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> 2001-01-22 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* rs6000.h (INIT_EXPANDERS): Delete. * rs6000.h (INIT_EXPANDERS): Delete.
......
...@@ -5466,6 +5466,8 @@ ...@@ -5466,6 +5466,8 @@
;; Unconditional and other jump instructions. ;; Unconditional and other jump instructions.
;; This can only be used in a leaf function, so we do
;; not need to use the PIC register.
(define_insn "return" (define_insn "return"
[(return) [(return)
(use (reg:SI 2)) (use (reg:SI 2))
...@@ -5482,11 +5484,16 @@ ...@@ -5482,11 +5484,16 @@
;; Use a different pattern for functions which have non-trivial ;; Use a different pattern for functions which have non-trivial
;; epilogues so as not to confuse jump and reorg. ;; epilogues so as not to confuse jump and reorg.
;;
;; We use the PIC register to ensure it's restored after a
;; call in PIC mode. This can be non-optimal for non-PIC
;; code but the real world cost should be unmeasurable.
(define_insn "return_internal" (define_insn "return_internal"
[(return) [(return)
(use (match_operand:SI 0 "register_operand" "r"))
(use (reg:SI 2)) (use (reg:SI 2))
(const_int 1)] (const_int 1)]
"" "true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM"
"* "*
{ {
if (TARGET_PA_20) if (TARGET_PA_20)
...@@ -5521,8 +5528,12 @@ ...@@ -5521,8 +5528,12 @@
emit_jump_insn (gen_return ()); emit_jump_insn (gen_return ());
else else
{ {
rtx x;
hppa_expand_epilogue (); hppa_expand_epilogue ();
emit_jump_insn (gen_return_internal ()); x = gen_return_internal (gen_rtx_REG (word_mode,
PIC_OFFSET_TABLE_REGNUM));
emit_jump_insn (x);
} }
DONE; DONE;
}") }")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment