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


There is one issue and one potential optimisation that I can see with respect
to this patch.

> + ;; This can only be used in a leaf function, so we do
> + ;; not need to use the PIC register.
>   (define_insn "return"

This may not be correct.  The ABI indicates that the PIC register must
be correctly set when the function returns.  This enables a correct return
via a stub from a shared library.  If +O3 is used, rename registers may
use the PIC register if we don't have a use in the return.  Remember,
the PIC register is not a fixed register any more.

> + ;; 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.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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