diff options
author | John David Anglin <dave@hiauly1.hia.nrc.ca> | 2001-01-30 05:18:50 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2001-01-29 22:18:50 -0700 |
commit | 7ea9fcc6492c928a52d0ec8ffebf1342b1856aeb (patch) | |
tree | 38f5e1c46631d8b196c2fa6ae0db89313ace804e | |
parent | 05d9f8b08ccc9e7915c1002a6ea54587ed2f57f8 (diff) | |
download | gcc-7ea9fcc6492c928a52d0ec8ffebf1342b1856aeb.zip gcc-7ea9fcc6492c928a52d0ec8ffebf1342b1856aeb.tar.gz gcc-7ea9fcc6492c928a52d0ec8ffebf1342b1856aeb.tar.bz2 |
pa.md (return): Revise comment for trivial return.
* pa.md (return): Revise comment for trivial return.
(return_internal): Non-trivial return pattern for non-PIC code.
(return_internal_pic): Non-trivial return pattern for PIC code.
It uses the PIC register to ensure it is restored after
function calls.
(epilogue): Generate appropriate return for PIC and non-PIC code.
Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r39345
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 34 |
2 files changed, 34 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e3a829..ed0db67 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-01-29 John David Anglin <dave@hiauly1.hia.nrc.ca> + Jeff Law <law@redhat.com> + + * pa.md (return): Revise comment for trivial return. + (return_internal): Non-trivial return pattern for non-PIC code. + (return_internal_pic): Non-trivial return pattern for PIC code. + It uses the PIC register to ensure it is restored after + function calls. + (epilogue): Generate appropriate return for PIC and non-PIC code. + Mon Jan 29 23:53:14 2001 Christopher Faylor <cgf@cygnus.com> * config/i386/cygwin.h: Fix -mno-cygwin search path for link. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 01537d2..76857f4 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5467,7 +5467,7 @@ ;; Unconditional and other jump instructions. ;; This can only be used in a leaf function, so we do -;; not need to use the PIC register. +;; not need to use the PIC register when generating PIC code. (define_insn "return" [(return) (use (reg:SI 2)) @@ -5482,18 +5482,29 @@ [(set_attr "type" "branch") (set_attr "length" "4")]) -;; Use a different pattern for functions which have non-trivial +;; Emit 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 0 "register_operand" "r")) (use (reg:SI 2)) (const_int 1)] - "true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM" + "! flag_pic" + "* +{ + if (TARGET_PA_20) + return \"bve%* (%%r2)\"; + return \"bv%* %%r0(%%r2)\"; +}" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + +;; Use the PIC register to ensure it's restored after a +;; call in PIC mode. +(define_insn "return_internal_pic" + [(return) + (use (match_operand 0 "register_operand" "r")) + (use (reg:SI 2))] + "flag_pic && true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM" "* { if (TARGET_PA_20) @@ -5531,8 +5542,11 @@ rtx x; hppa_expand_epilogue (); - x = gen_return_internal (gen_rtx_REG (word_mode, - PIC_OFFSET_TABLE_REGNUM)); + if (flag_pic) + x = gen_return_internal_pic (gen_rtx_REG (word_mode, + PIC_OFFSET_TABLE_REGNUM)); + else + x = gen_return_internal (); emit_jump_insn (x); } DONE; |