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]
Other format: [Raw text]

Re: RFA: Add an FPIC set of multilibs to the MN10300 port


Nick Clifton <nickc@redhat.com> writes:
> Hi Jeff,
>
>  > Something doesn't make sense here.   a2 is call-saved and thus a
>  > function can reasonably expect its value to be preserved across calls
>  > -- which ought to apply to PIC code as well.
>  >
>  > So ISTM that if comp is modifying a2 in a way which is visible to
>  > qsort, then the problem would be that a2 isn't being saved/restored
>  > within comp.
>  >
>  > At least that's the way it seems to me and how things work on other
>  > ports.
>
> A fair point.  In which case please may I offer an alternative solution?
>
> The problem it seems to me is that when a register is marked as fixed it 
> also has to be marked as call-used.  So for the mn103000 marking the a2 
> register as fixed in pic mode is wrong because it changes it from 
> call-saved to call-used.

Have you tried using CALL_REALLY_USED_REGISTERS?  I.e. define
CALL_REALLY_USED_REGISTERS to be the same as CALL_USED_REGISTERS,
except that the former marks a2 as call-saved.

Richard


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