]> gcc.gnu.org Git - gcc.git/commitdiff
pa.md (return_internal): Add a USE of the PIC register to ensure it is restored after...
authorJeffrey A Law <law@cygnus.com>
Tue, 23 Jan 2001 03:52:54 +0000 (03:52 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 23 Jan 2001 03:52:54 +0000 (20:52 -0700)
        * 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

gcc/ChangeLog
gcc/config/pa/pa.md

index 26d488d35186f565e579ae29df3d3716af229c47..7ab2abcf79e5e8bd74b57baca2e9ad221e293c03 100644 (file)
@@ -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.
index 7179c01a1e412974fa13c8ffa19b2559a37248f3..2d71c7f76b13e896a3ec6bdb3527a5d39bfde701 100644 (file)
 \f
 ;; 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))
 
 ;; 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)
    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;
 }")
This page took 0.076709 seconds and 5 git commands to generate.