From: John David Anglin Date: Tue, 30 Jan 2001 05:18:50 +0000 (+0000) Subject: pa.md (return): Revise comment for trivial return. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7ea9fcc6492c928a52d0ec8ffebf1342b1856aeb;p=gcc.git 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 From-SVN: r39345 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e3a829850b..ed0db6753c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-01-29 John David Anglin + Jeff Law + + * 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 * 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 01537d21a1b..76857f4eff4 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;