Commit 632c9d9e by Mike Stump

flow.c (life_analysis): Preserve registers used by the epilogue.

	* flow.c (life_analysis): Preserve registers used by the epilogue.
	(mark_used_regs): Likewise.
	* reorg.c (fill_simple_delay_slots): Likewise.
	(dbr_schedule): Likewise.
Fixes eh49.C for sparc.

From-SVN: r12666
parent cc5aa58b
...@@ -1087,12 +1087,17 @@ life_analysis (f, nregs) ...@@ -1087,12 +1087,17 @@ life_analysis (f, nregs)
#endif #endif
} }
/* Mark all global registers as being live at the end of the function /* Mark all global registers and all registers used by the epilogue
since they may be referenced by our caller. */ as being live at the end of the function since they may be
referenced by our caller. */
if (n_basic_blocks > 0) if (n_basic_blocks > 0)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i]) if (global_regs[i]
#ifdef EPILOGUE_USES
|| EPILOGUE_USES (i)
#endif
)
{ {
basic_block_live_at_end[n_basic_blocks - 1] basic_block_live_at_end[n_basic_blocks - 1]
[i / REGSET_ELT_BITS] [i / REGSET_ELT_BITS]
...@@ -2665,7 +2670,7 @@ mark_used_regs (needed, live, x, final, insn) ...@@ -2665,7 +2670,7 @@ mark_used_regs (needed, live, x, final, insn)
case RETURN: case RETURN:
/* If exiting needs the right stack value, consider this insn as /* If exiting needs the right stack value, consider this insn as
using the stack pointer. In any event, consider it as using using the stack pointer. In any event, consider it as using
all global registers. */ all global registers and all registers used by return. */
#ifdef EXIT_IGNORE_STACK #ifdef EXIT_IGNORE_STACK
if (! EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK
...@@ -2675,7 +2680,11 @@ mark_used_regs (needed, live, x, final, insn) ...@@ -2675,7 +2680,11 @@ mark_used_regs (needed, live, x, final, insn)
|= (REGSET_ELT_TYPE) 1 << (STACK_POINTER_REGNUM % REGSET_ELT_BITS); |= (REGSET_ELT_TYPE) 1 << (STACK_POINTER_REGNUM % REGSET_ELT_BITS);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i]) if (global_regs[i]
#ifdef EPILOGUE_USES
|| EPILOGUE_USES (i)
#endif
)
live[i / REGSET_ELT_BITS] live[i / REGSET_ELT_BITS]
|= (REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS); |= (REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS);
break; break;
......
...@@ -3344,6 +3344,14 @@ fill_simple_delay_slots (first, non_jumps_p) ...@@ -3344,6 +3344,14 @@ fill_simple_delay_slots (first, non_jumps_p)
else else
SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM); SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM);
#ifdef EPILOGUE_USES
for (i = 0; i <FIRST_PSEUDO_REGISTER; i++)
{
if (EPILOGUE_USES (i))
SET_HARD_REG_BIT (needed.regs, i);
}
#endif
for (trial = get_last_insn (); ! stop_search_p (trial, 1); for (trial = get_last_insn (); ! stop_search_p (trial, 1);
trial = PREV_INSN (trial)) trial = PREV_INSN (trial))
{ {
...@@ -4450,7 +4458,11 @@ dbr_schedule (first, file) ...@@ -4450,7 +4458,11 @@ dbr_schedule (first, file)
&end_of_function_needs, 1); &end_of_function_needs, 1);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i]) if (global_regs[i]
#ifdef EPILOGUE_USES
|| EPILOGUE_USES (i)
#endif
)
SET_HARD_REG_BIT (end_of_function_needs.regs, i); SET_HARD_REG_BIT (end_of_function_needs.regs, i);
/* The registers required to be live at the end of the function are /* The registers required to be live at the end of the function are
......
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