diff options
author | Jeffrey A Law <law@cygnus.com> | 2001-01-23 03:52:54 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2001-01-22 20:52:54 -0700 |
commit | 2caa0ddfc92ef326520e9e2467297435ecdf99e5 (patch) | |
tree | b0d0613cf68b8d6029558ad39c21fc1d01dcd1fc | |
parent | 152353171a4a5d3cd21f375f372fcbbfcfaa06e6 (diff) | |
download | gcc-2caa0ddfc92ef326520e9e2467297435ecdf99e5.zip gcc-2caa0ddfc92ef326520e9e2467297435ecdf99e5.tar.gz gcc-2caa0ddfc92ef326520e9e2467297435ecdf99e5.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 15 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26d488d..7ab2abc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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> * rs6000.h (INIT_EXPANDERS): Delete. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 7179c01..2d71c7f 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5466,6 +5466,8 @@ ;; 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" [(return) (use (reg:SI 2)) @@ -5482,11 +5484,16 @@ ;; Use a different pattern for functions which have non-trivial ;; 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" [(return) + (use (match_operand:SI 0 "register_operand" "r")) (use (reg:SI 2)) (const_int 1)] - "" + "true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM" "* { if (TARGET_PA_20) @@ -5521,8 +5528,12 @@ emit_jump_insn (gen_return ()); else { + rtx x; + 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; }") |