aboutsummaryrefslogtreecommitdiff
path: root/gcc/sched.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-10-07 17:35:03 -0700
committerJim Wilson <wilson@gcc.gnu.org>1996-10-07 17:35:03 -0700
commit7c9df1c69c8f78e55a3b389f2ff145f10036108c (patch)
tree6bc34ddbdb6f3f487be9bd550d34d4fb4ca2f9bc /gcc/sched.c
parentda2c54476f5026b213048fabad026040170c05e1 (diff)
downloadgcc-7c9df1c69c8f78e55a3b389f2ff145f10036108c.zip
gcc-7c9df1c69c8f78e55a3b389f2ff145f10036108c.tar.gz
gcc-7c9df1c69c8f78e55a3b389f2ff145f10036108c.tar.bz2
(schedule_block): Before scheduling...
(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. From-SVN: r12913
Diffstat (limited to 'gcc/sched.c')
-rw-r--r--gcc/sched.c50
1 files changed, 45 insertions, 5 deletions
diff --git a/gcc/sched.c b/gcc/sched.c
index c186cfc..71cf52f 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