Oust HPPA PIC_OFFSET_TABLE_REGNUM_SAVED
Jeffrey A Law
law@redhat.com
Mon, 15 Jan 2001 10:46:59 -0700
In message <Pine.LNX.4.21.0101151430350.21322-100000@front.linuxcare.com.au>y
ou write:
> This patch rids us of PIC_OFFSET_TABLE_REGNUM_SAVED, and the problems that
> go with it. Additionally, I reload the pic offset table register before
> calls to guard against asm trashing r27/r19. Hasn't bootstrapped yet, but
> looks promising. One possible fly in the ointment is whether any ABI
> requires that r4 always be used to save the pic offset table reg.
>
> * config/pa/pa.h (PIC_OFFSET_TABLE_REGNUM_SAVED): Remove.
> (machine_function): Define.
> (PIC_OFFSET_TABLE_SAVE_RTX) : Define.
> (INIT_EXPANDERS): Define.
> * config/pa/pa.c (pa_init_machine_status, pa_free_machine_status,
> pa_init_expanders): New functions.
> (hppa_expand_prologue): Use PIC_OFFSET_TABLE_SAVE_RTX instead of
> PIC_OFFSET_TABLE_REGNUM_SAVED.
> * config/pa/pa.md: Use PIC_OFFSET_TABLE_SAVE_RTX instead of
> PIC_OFFSET_TABLE_REGNUM_SAVED throughout. Restore pic offset
> table register before all calls as well as after.
> * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Remove
> references to PIC_OFFSET_TABLE_REGNUM_SAVED.
> * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Likewise.
First, if an ASM trashes a fixed register, then it is the ASM's responsibility
to restore it. So that part of this patch is wrong.
The rest of it looks pretty reasonable and can be installed.
jeff