diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1996-08-21 23:03:07 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1996-08-21 23:03:07 +0000 |
commit | 632c9d9e7ec43f0a414454b1711acb572fad9759 (patch) | |
tree | d9a73667aa9869c0d5682d9af691bab0e5603958 | |
parent | cc5aa58ba9935e009caf9e0918fbdc68db72c2ba (diff) | |
download | gcc-632c9d9e7ec43f0a414454b1711acb572fad9759.zip gcc-632c9d9e7ec43f0a414454b1711acb572fad9759.tar.gz gcc-632c9d9e7ec43f0a414454b1711acb572fad9759.tar.bz2 |
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
-rw-r--r-- | gcc/flow.c | 19 | ||||
-rw-r--r-- | gcc/reorg.c | 14 |
2 files changed, 27 insertions, 6 deletions
@@ -1087,12 +1087,17 @@ life_analysis (f, nregs) #endif } - /* Mark all global registers as being live at the end of the function - since they may be referenced by our caller. */ + /* Mark all global registers and all registers used by the epilogue + as being live at the end of the function since they may be + referenced by our caller. */ if (n_basic_blocks > 0) 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] [i / REGSET_ELT_BITS] @@ -2665,7 +2670,7 @@ mark_used_regs (needed, live, x, final, insn) case RETURN: /* If exiting needs the right stack value, consider this insn as 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 if (! EXIT_IGNORE_STACK @@ -2675,7 +2680,11 @@ mark_used_regs (needed, live, x, final, insn) |= (REGSET_ELT_TYPE) 1 << (STACK_POINTER_REGNUM % REGSET_ELT_BITS); 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] |= (REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS); break; diff --git a/gcc/reorg.c b/gcc/reorg.c index 54ad938..beec168 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -3344,6 +3344,14 @@ fill_simple_delay_slots (first, non_jumps_p) else 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); trial = PREV_INSN (trial)) { @@ -4450,7 +4458,11 @@ dbr_schedule (first, file) &end_of_function_needs, 1); 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); /* The registers required to be live at the end of the function are |