(call expanders): Reload the PIC register from the fixed callee saved register.
(call expanders): Reload the PIC register from the fixed callee saved register. Don't try to save the PIC register before the call. From-SVN: r10089
This commit is contained in:
parent
853e4dfd6b
commit
1078699763
@ -3497,24 +3497,6 @@
|
||||
else
|
||||
op = XEXP (operands[0], 0);
|
||||
|
||||
if (flag_pic)
|
||||
{
|
||||
if (!hppa_save_pic_table_rtx)
|
||||
hppa_save_pic_table_rtx = gen_reg_rtx (Pmode);
|
||||
|
||||
/* We must save and restore the PIC register around every call
|
||||
since we don't have flow information to determine if this save
|
||||
is redundant with a previous save. The old code assumed once
|
||||
the register was saved it never needs to be saved again, but
|
||||
the save could have been on a path which doesn't always
|
||||
execute; a call site physically later in the program would
|
||||
then attempt a restore from an uninitialized register! */
|
||||
emit_insn (gen_rtx (SET, VOIDmode,
|
||||
hppa_save_pic_table_rtx,
|
||||
pic_offset_table_rtx));
|
||||
|
||||
}
|
||||
|
||||
/* Use two different patterns for calls to explicitly named functions
|
||||
and calls through function pointers. This is necessary as these two
|
||||
types of calls use different calling conventions, and CSE might try
|
||||
@ -3530,8 +3512,14 @@
|
||||
{
|
||||
use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
|
||||
|
||||
emit_insn (gen_rtx (SET, VOIDmode, pic_offset_table_rtx,
|
||||
hppa_save_pic_table_rtx));
|
||||
/* After each call we must restore the PIC register, even if it
|
||||
doesn't appear to be used.
|
||||
|
||||
This will set regs_ever_live for the callee saved register we
|
||||
stored the PIC register in. */
|
||||
emit_move_insn (pic_offset_table_rtx,
|
||||
gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
|
||||
emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
|
||||
}
|
||||
DONE;
|
||||
}")
|
||||
@ -3599,24 +3587,6 @@
|
||||
else
|
||||
op = XEXP (operands[1], 0);
|
||||
|
||||
if (flag_pic)
|
||||
{
|
||||
if (!hppa_save_pic_table_rtx)
|
||||
hppa_save_pic_table_rtx = gen_reg_rtx (Pmode);
|
||||
|
||||
/* We must save and restore the PIC register around every call
|
||||
since we don't have flow information to determine if this save
|
||||
is redundant with a previous save. The old code assumed once
|
||||
the register was saved it never needs to be saved again, but
|
||||
the save could have been on a path which doesn't always
|
||||
execute; a call site physically later in the program would
|
||||
then attempt a restore from an uninitialized register! */
|
||||
emit_insn (gen_rtx (SET, VOIDmode,
|
||||
hppa_save_pic_table_rtx,
|
||||
pic_offset_table_rtx));
|
||||
|
||||
}
|
||||
|
||||
/* Use two different patterns for calls to explicitly named functions
|
||||
and calls through function pointers. This is necessary as these two
|
||||
types of calls use different calling conventions, and CSE might try
|
||||
@ -3635,8 +3605,14 @@
|
||||
{
|
||||
use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
|
||||
|
||||
emit_insn (gen_rtx (SET, VOIDmode, pic_offset_table_rtx,
|
||||
hppa_save_pic_table_rtx));
|
||||
/* After each call we must restore the PIC register, even if it
|
||||
doesn't appear to be used.
|
||||
|
||||
This will set regs_ever_live for the callee saved register we
|
||||
stored the PIC register in. */
|
||||
emit_move_insn (pic_offset_table_rtx,
|
||||
gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
|
||||
emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
|
||||
}
|
||||
DONE;
|
||||
}")
|
||||
|
Loading…
Reference in New Issue
Block a user