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: PATCH: PIC_OFFSET_TABLE_REGNUM_SAVED should be call used when


On Sun, 14 Jan 2001, John David Anglin wrote:

> > >   > 	* pa32-regs.h (CONDITIONAL_REGISTER_USAGE): When generating pic code,
> > >   > 	PIC_OFFSET_TABLE_REGNUM_SAVED is a call_used register.
> > >   > 	* pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Likewise.
> > > Well, this patch is obviously correct, so I installed it.
> > 
> > Oops, there is a problem.  The PIC_OFFSET_TABLE_REGNUM_SAVED register
> > must be call used under all conditions since non PIC code has to be able
> > to call PIC code.
> 
> On further thought, the PIC_OFFSET_TABLE_REGNUM_SAVED can't be a call used
> register since this will break the run-time ABI.  I think this means that
> it can't be a fixed register as well.  Need a different solution.

Why will that break the ABI?  New code will just assume that r4 isn't
preserved over calls, but it's no problem if in fact r4 is preserved.  It
would only be a problem if you were trying to make r4 call preserved when
before it was call used.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.



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