Commit f5bdba44 by Richard Henderson Committed by Richard Henderson

ia64.c (ia64_compute_frame_size): Allow inline asm to clobber ar.pfs and ar.unat.

        * config/ia64/ia64.c (ia64_compute_frame_size): Allow inline asm
        to clobber ar.pfs and ar.unat.
        (ia64_expand_prologue): Force alloc instruction if ar.pfs saved;
        fix test for spilling ar.pfs to the stack.

From-SVN: r66074
parent 8f4e6caf
2003-04-25 Richard Henderson <rth@redhat.com> 2003-04-25 Richard Henderson <rth@redhat.com>
* config/ia64/ia64.c (ia64_compute_frame_size): Allow inline asm
to clobber ar.pfs and ar.unat.
(ia64_expand_prologue): Force alloc instruction if ar.pfs saved;
fix test for spilling ar.pfs to the stack.
2003-04-25 Richard Henderson <rth@redhat.com>
PR opt/10315 PR opt/10315
* config/rs6000/rs6000.c (rs6000_emit_move): Only elide proper * config/rs6000/rs6000.c (rs6000_emit_move): Only elide proper
......
...@@ -1878,6 +1878,17 @@ ia64_compute_frame_size (size) ...@@ -1878,6 +1878,17 @@ ia64_compute_frame_size (size)
spill_size += 8; spill_size += 8;
n_spilled += 1; n_spilled += 1;
} }
if (regs_ever_live[AR_PFS_REGNUM])
{
SET_HARD_REG_BIT (mask, AR_PFS_REGNUM);
current_frame_info.reg_save_ar_pfs = find_gr_spill (1);
if (current_frame_info.reg_save_ar_pfs == 0)
{
extra_spill_size += 8;
n_spilled += 1;
}
}
} }
/* Unwind descriptor hackery: things are most efficient if we allocate /* Unwind descriptor hackery: things are most efficient if we allocate
...@@ -1916,8 +1927,10 @@ ia64_compute_frame_size (size) ...@@ -1916,8 +1927,10 @@ ia64_compute_frame_size (size)
} }
/* If we're forced to use st8.spill, we're forced to save and restore /* If we're forced to use st8.spill, we're forced to save and restore
ar.unat as well. */ ar.unat as well. The check for existing liveness allows inline asm
if (spilled_gr_p || cfun->machine->n_varargs) to touch ar.unat. */
if (spilled_gr_p || cfun->machine->n_varargs
|| regs_ever_live[AR_UNAT_REGNUM])
{ {
regs_ever_live[AR_UNAT_REGNUM] = 1; regs_ever_live[AR_UNAT_REGNUM] = 1;
SET_HARD_REG_BIT (mask, AR_UNAT_REGNUM); SET_HARD_REG_BIT (mask, AR_UNAT_REGNUM);
...@@ -2378,7 +2391,8 @@ ia64_expand_prologue () ...@@ -2378,7 +2391,8 @@ ia64_expand_prologue ()
/* We don't need an alloc instruction if we've used no outputs or locals. */ /* We don't need an alloc instruction if we've used no outputs or locals. */
if (current_frame_info.n_local_regs == 0 if (current_frame_info.n_local_regs == 0
&& current_frame_info.n_output_regs == 0 && current_frame_info.n_output_regs == 0
&& current_frame_info.n_input_regs <= current_function_args_info.int_regs) && current_frame_info.n_input_regs <= current_function_args_info.int_regs
&& !TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
{ {
/* If there is no alloc, but there are input registers used, then we /* If there is no alloc, but there are input registers used, then we
need a .regstk directive. */ need a .regstk directive. */
...@@ -2540,8 +2554,8 @@ ia64_expand_prologue () ...@@ -2540,8 +2554,8 @@ ia64_expand_prologue ()
/* The alloc insn already copied ar.pfs into a general register. The /* The alloc insn already copied ar.pfs into a general register. The
only thing we have to do now is copy that register to a stack slot only thing we have to do now is copy that register to a stack slot
if we'd not allocated a local register for the job. */ if we'd not allocated a local register for the job. */
if (current_frame_info.reg_save_ar_pfs == 0 if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM)
&& ! current_function_is_leaf) && current_frame_info.reg_save_ar_pfs == 0)
{ {
reg = gen_rtx_REG (DImode, AR_PFS_REGNUM); reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
do_spill (gen_movdi_x, ar_pfs_save_reg, cfa_off, reg); do_spill (gen_movdi_x, ar_pfs_save_reg, cfa_off, reg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment