aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-04-21 18:45:38 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-04-21 18:45:38 -0400
commit56f58d3a43c2adf16c117bfcaf94e11324b09184 (patch)
tree020fe35e52670fa572abaccf34cd855ed50e4046
parentc448a43e24ae85ee584aac5113081e4e360c1d81 (diff)
downloadgcc-56f58d3a43c2adf16c117bfcaf94e11324b09184.zip
gcc-56f58d3a43c2adf16c117bfcaf94e11324b09184.tar.gz
gcc-56f58d3a43c2adf16c117bfcaf94e11324b09184.tar.bz2
(reload): Clear forbidden_regs earlier.
(new_spill_reg): Mention in error message that asm clauses can also cause the compiler to run out of spill regs. (scan_paradoxical_regs): If SMALL_REGISTER_CLASSES, forbid hard regs used in explicit user variables. From-SVN: r7132
-rw-r--r--gcc/reload1.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index db1cd489..98b5b40 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -526,9 +526,14 @@ reload (first, global, dumpfile)
cannot_omit_stores = (char *) alloca (max_regno);
bzero (cannot_omit_stores, max_regno);
+#ifdef SMALL_REGISTER_CLASSES
+ CLEAR_HARD_REG_SET (forbidden_regs);
+#endif
+
/* Look for REG_EQUIV notes; record what each pseudo is equivalent to.
- Also find all paradoxical subregs
- and find largest such for each pseudo. */
+ Also find all paradoxical subregs and find largest such for each pseudo.
+ On machines with small register classes, record hard registers that
+ are used for user variables. These can never be used for spills. */
for (insn = first; insn; insn = NEXT_INSN (insn))
{
@@ -690,9 +695,7 @@ reload (first, global, dumpfile)
rtl as a spill register. But on some, we have to. Those will have
taken care to keep the life of hard regs as short as possible. */
-#ifdef SMALL_REGISTER_CLASSES
- CLEAR_HARD_REG_SET (forbidden_regs);
-#else
+#ifndef SMALL_REGISTER_CLASSES
COPY_HARD_REG_SET (forbidden_regs, bad_spill_regs);
#endif
@@ -2168,7 +2171,8 @@ new_spill_reg (i, class, max_needs, max_nongroups, global, dumpfile)
if (fixed_regs[regno] || TEST_HARD_REG_BIT (forbidden_regs, regno))
fatal ("fixed or forbidden register was spilled.\n\
-This may be due to a compiler bug or to impossible asm statements.");
+This may be due to a compiler bug or to impossible asm\n\
+statements or clauses.");
/* Make reg REGNO an additional reload reg. */
@@ -3406,7 +3410,9 @@ spill_hard_reg (regno, global, dumpfile, cant_eliminate)
return something_changed;
}
-/* Find all paradoxical subregs within X and update reg_max_ref_width. */
+/* Find all paradoxical subregs within X and update reg_max_ref_width.
+ Also mark any hard registers used to store user variables as
+ forbidden from being used for spill registers. */
static void
scan_paradoxical_subregs (x)
@@ -3418,6 +3424,13 @@ scan_paradoxical_subregs (x)
switch (code)
{
+ case REG:
+#ifdef SMALL_REGISTER_CLASSES
+ if (REGNO (x) < FIRST_PSEUDO_REGISTER && REG_USERVAR_P (x))
+ SET_HARD_REG_BIT (forbidden_regs, REGNO (x));
+#endif
+ return;
+
case CONST_INT:
case CONST:
case SYMBOL_REF:
@@ -3425,7 +3438,6 @@ scan_paradoxical_subregs (x)
case CONST_DOUBLE:
case CC0:
case PC:
- case REG:
case USE:
case CLOBBER:
return;