(hppa_init_pic_save): Emit the pic offset table reg save after last_parm_insn.
* (hppa_init_pic_save): Emit the pic offset table reg save after last_parm_insn. * pa.c (hppa_init_pic_save): New function. * pa.h (hppa_init_pic_save): Declare. * pa.md (call, call_value, sibcall, sibcall_value): Use the above instead of duplicated code. From-SVN: r39386
This commit is contained in:
parent
10d17cb7bd
commit
824e760597
|
@ -1,5 +1,12 @@
|
|||
2001-01-31 Alan Modra <alan@linuxcare.com.au>
|
||||
|
||||
* (hppa_init_pic_save): Emit the pic offset table
|
||||
reg save after last_parm_insn.
|
||||
* pa.c (hppa_init_pic_save): New function.
|
||||
* pa.h (hppa_init_pic_save): Declare.
|
||||
* pa.md (call, call_value, sibcall, sibcall_value): Use
|
||||
the above instead of duplicated code.
|
||||
|
||||
* pa.c (hppa_encode_label): Correct size of alloca buffer
|
||||
so we don't overrun it. Correct leading `*' case.
|
||||
* pa.h (STRIP_NAME_ENCODING): Simplify now that we don't
|
||||
|
|
|
@ -3371,6 +3371,21 @@ hppa_expand_epilogue ()
|
|||
- actual_fsize);
|
||||
}
|
||||
|
||||
/* Set up a callee saved register for the pic offset table register. */
|
||||
void hppa_init_pic_save ()
|
||||
{
|
||||
rtx insn, picreg;
|
||||
|
||||
picreg = gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM);
|
||||
PIC_OFFSET_TABLE_SAVE_RTX = gen_reg_rtx (Pmode);
|
||||
insn = gen_rtx_SET (VOIDmode, PIC_OFFSET_TABLE_SAVE_RTX, picreg);
|
||||
|
||||
/* Emit the insn at the beginning of the function after the prologue. */
|
||||
push_topmost_sequence ();
|
||||
emit_insn_after (insn, last_parm_insn ? last_parm_insn : get_insns ());
|
||||
pop_topmost_sequence ();
|
||||
}
|
||||
|
||||
/* Fetch the return address for the frame COUNT steps up from
|
||||
the current frame, after the prologue. FRAMEADDR is the
|
||||
frame pointer of the COUNT frame.
|
||||
|
|
|
@ -503,6 +503,7 @@ extern int target_flags;
|
|||
/* Register into which we save the PIC_OFFSET_TABLE_REGNUM so that it
|
||||
can be restored across function calls. */
|
||||
#define PIC_OFFSET_TABLE_SAVE_RTX (cfun->machine->pic_offset_table_save_rtx)
|
||||
extern void hppa_init_pic_save PARAMS ((void));
|
||||
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 0
|
||||
|
||||
|
|
|
@ -5738,18 +5738,7 @@
|
|||
GEN_INT (64)));
|
||||
|
||||
if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
PIC_OFFSET_TABLE_SAVE_RTX = gen_reg_rtx (Pmode);
|
||||
insn = gen_rtx_SET (VOIDmode, PIC_OFFSET_TABLE_SAVE_RTX,
|
||||
gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM));
|
||||
|
||||
/* Emit the insn at the beginning of the function after the prologue. */
|
||||
push_topmost_sequence ();
|
||||
emit_insn_after (insn, get_insns ());
|
||||
pop_topmost_sequence ();
|
||||
}
|
||||
hppa_init_pic_save ();
|
||||
|
||||
/* Use two different patterns for calls to explicitly named functions
|
||||
and calls through function pointers. This is necessary as these two
|
||||
|
@ -5922,18 +5911,7 @@
|
|||
GEN_INT (64)));
|
||||
|
||||
if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
PIC_OFFSET_TABLE_SAVE_RTX = gen_reg_rtx (Pmode);
|
||||
insn = gen_rtx_SET (VOIDmode, PIC_OFFSET_TABLE_SAVE_RTX,
|
||||
gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM));
|
||||
|
||||
/* Emit the insn at the beginning of the function after the prologue. */
|
||||
push_topmost_sequence ();
|
||||
emit_insn_after (insn, get_insns ());
|
||||
pop_topmost_sequence ();
|
||||
}
|
||||
hppa_init_pic_save ();
|
||||
|
||||
/* Use two different patterns for calls to explicitly named functions
|
||||
and calls through function pointers. This is necessary as these two
|
||||
|
@ -6132,18 +6110,7 @@
|
|||
op = XEXP (operands[0], 0);
|
||||
|
||||
if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
PIC_OFFSET_TABLE_SAVE_RTX = gen_reg_rtx (Pmode);
|
||||
insn = gen_rtx_SET (VOIDmode, PIC_OFFSET_TABLE_SAVE_RTX,
|
||||
gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM));
|
||||
|
||||
/* Emit the insn at the beginning of the function after the prologue. */
|
||||
push_topmost_sequence ();
|
||||
emit_insn_after (insn, get_insns ());
|
||||
pop_topmost_sequence ();
|
||||
}
|
||||
hppa_init_pic_save ();
|
||||
|
||||
/* We do not allow indirect sibling calls. */
|
||||
call_insn = emit_call_insn (gen_sibcall_internal_symref (op, operands[1]));
|
||||
|
@ -6201,18 +6168,7 @@
|
|||
op = XEXP (operands[1], 0);
|
||||
|
||||
if (flag_pic && PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
PIC_OFFSET_TABLE_SAVE_RTX = gen_reg_rtx (Pmode);
|
||||
insn = gen_rtx_SET (VOIDmode, PIC_OFFSET_TABLE_SAVE_RTX,
|
||||
gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM));
|
||||
|
||||
/* Emit the insn at the beginning of the function after the prologue. */
|
||||
push_topmost_sequence ();
|
||||
emit_insn_after (insn, get_insns ());
|
||||
pop_topmost_sequence ();
|
||||
}
|
||||
hppa_init_pic_save ();
|
||||
|
||||
/* We do not allow indirect sibling calls. */
|
||||
call_insn = emit_call_insn (gen_sibcall_value_internal_symref (operands[0],
|
||||
|
|
Loading…
Reference in New Issue