aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-11-10 00:39:17 +0000
committerRichard Stallman <rms@gnu.org>1993-11-10 00:39:17 +0000
commit92b0556de3f14fcc8c10fde3b66f8dac95258b8e (patch)
tree81c8f235b942e9c25b7545b7ff497322e3bfea7e
parent43a674af6f5e38f72c8b90640415ca467981e8ba (diff)
downloadgcc-92b0556de3f14fcc8c10fde3b66f8dac95258b8e.zip
gcc-92b0556de3f14fcc8c10fde3b66f8dac95258b8e.tar.gz
gcc-92b0556de3f14fcc8c10fde3b66f8dac95258b8e.tar.bz2
(reload) [SMALL_REGISTER_CLASSES]: Try, at least,
to avoid 2-groups whose second register is explicitly used. From-SVN: r6047
-rw-r--r--gcc/reload1.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 33f118b..542c9d7 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1695,6 +1695,34 @@ reload (first, global, dumpfile)
}
}
/* We can't complete a group, so start one. */
+#ifdef SMALL_REGISTER_CLASSES
+ /* Look for a pair neither of which is explicitly used. */
+ if (i == FIRST_PSEUDO_REGISTER)
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int k;
+ j = potential_reload_regs[i];
+ /* Verify that J+1 is a potential reload reg. */
+ for (k = 0; k < FIRST_PSEUDO_REGISTER; k++)
+ if (potential_reload_regs[k] == j + 1)
+ break;
+ if (j >= 0 && j + 1 < FIRST_PSEUDO_REGISTER
+ && k < FIRST_PSEUDO_REGISTER
+ && spill_reg_order[j] < 0 && spill_reg_order[j + 1] < 0
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j + 1)
+ && HARD_REGNO_MODE_OK (j, group_mode[class])
+ && ! TEST_HARD_REG_BIT (counted_for_nongroups,
+ j + 1)
+ && ! TEST_HARD_REG_BIT (bad_spill_regs, j + 1)
+ /* Reject J at this stage
+ if J+1 was explicitly used. */
+ && ! regs_explicitly_used[j + 1])
+ break;
+ }
+#endif
+ /* Now try any group at all
+ whose registers are not in bad_spill_regs. */
if (i == FIRST_PSEUDO_REGISTER)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{