From 632c9d9e7ec43f0a414454b1711acb572fad9759 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 21 Aug 1996 23:03:07 +0000 Subject: [PATCH] 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 --- gcc/flow.c | 19 ++++++++++++++----- gcc/reorg.c | 14 +++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/gcc/flow.c b/gcc/flow.c index d38e56df64e..86d72286331 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -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 54ad9389aa0..beec1681cb4 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