This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: pa.md bugfix



  In message <200101230549.AAA11143@hiauly1.hia.nrc.ca>you write:
  > This may not be correct.  The ABI indicates that the PIC register must
  > be correctly set when the function returns.
Right.

  > This enables a correct return via a stub from a shared library. 
Correct.


  > If +O3 is used, rename registers may use the PIC register if we don't
  > have a use in the return.
No, the PIC register is fixed.  What we recently removed was the _copy_ of
the PIC  register we had stuffed away in a fixed call-saved register.

Also remember that "return" is only used in a leaf function -- ie, no
calls and thus nothing clobbers %r19.



  > > + ;; 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"
  > 
  > Suggest two insns: pic_return_internal and return_internal.  We only
  > need the extra use in pic_return_internal.
Already considered it.  It's not worth the time/effort.

FWIW, there *is* a minor bug in the patch.  It breaks PA64 because of the
mode on the use of the PIC register.  I'll fix that in a minute.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]