From 14e9cde599d97f5aa8151b316d053540296543f0 Mon Sep 17 00:00:00 2001 From: wilson Date: Tue, 8 Oct 1996 00:35:03 +0000 Subject: [PATCH] (schedule_block): Before scheduling, add code to make all call used regs that are not fixed or global live when we see a CALL_INSN. During scheduling, change existing code to use same test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12913 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/sched.c | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/gcc/sched.c b/gcc/sched.c index c186cfc0699..71cf52ff615 100644 --- a/gcc/sched.c +++ b/gcc/sched.c @@ -3514,6 +3514,26 @@ schedule_block (b, file) sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0); } + /* Each call clobbers (makes live) all call-clobbered regs + that are not global or fixed. Note that the function-value + reg is a call_clobbered reg. */ + + if (GET_CODE (insn) == CALL_INSN) + { + int j; + for (j = 0; j < FIRST_PSEUDO_REGISTER; j++) + if (call_used_regs[j] && ! global_regs[j] + && ! fixed_regs[j]) + { + register int offset = j / REGSET_ELT_BITS; + register REGSET_ELT_TYPE bit + = (REGSET_ELT_TYPE) 1 << (j % REGSET_ELT_BITS); + + bb_live_regs[offset] |= bit; + bb_dead_regs[offset] &= ~bit; + } + } + for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) { if ((REG_NOTE_KIND (link) == REG_DEAD @@ -3615,6 +3635,26 @@ schedule_block (b, file) sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0); } + /* Each call clobbers (makes live) all call-clobbered regs that are + not global or fixed. Note that the function-value reg is a + call_clobbered reg. */ + + if (GET_CODE (insn) == CALL_INSN) + { + int j; + for (j = 0; j < FIRST_PSEUDO_REGISTER; j++) + if (call_used_regs[j] && ! global_regs[j] + && ! fixed_regs[j]) + { + register int offset = j / REGSET_ELT_BITS; + register REGSET_ELT_TYPE bit + = (REGSET_ELT_TYPE) 1 << (j % REGSET_ELT_BITS); + + bb_live_regs[offset] |= bit; + bb_dead_regs[offset] &= ~bit; + } + } + /* Need to know what registers this insn kills. */ for (prev = 0, link = REG_NOTES (insn); link; link = next) { @@ -3854,12 +3894,12 @@ schedule_block (b, file) { register struct sometimes *p; - /* A call kills all call used and global registers, except - for those mentioned in the call pattern which will be - made live again later. */ + /* A call kills all call used registers that are not + global or fixed, except for those mentioned in the call + pattern which will be made live again later. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if ((call_used_regs[i] && ! fixed_regs[i]) - || global_regs[i]) + if (call_used_regs[i] && ! global_regs[i] + && ! fixed_regs[i]) { register int offset = i / REGSET_ELT_BITS; register REGSET_ELT_TYPE bit -- 2.11.0