aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-03 00:38:02 +0000
committerRichard Stallman <rms@gnu.org>1992-10-03 00:38:02 +0000
commit9d1a4667d88d24c9af71984e73be5eb99529a6dc (patch)
tree03b6f5e6c4aab3d9ce90e07fe6aa14478dae3929
parent139e5e08924a01bb85498a6eab33436c519ef78f (diff)
downloadgcc-9d1a4667d88d24c9af71984e73be5eb99529a6dc.zip
gcc-9d1a4667d88d24c9af71984e73be5eb99529a6dc.tar.gz
gcc-9d1a4667d88d24c9af71984e73be5eb99529a6dc.tar.bz2
(reload): Move test for failure to find any group to after the loop over i.
(reload): Move test for failure to find any group to after the loop over i. Also check that all the regnos fit below FIRST_PSEUDO_REGISTER. From-SVN: r2306
-rw-r--r--gcc/reload1.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 31b1dfa..4374d1f 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1651,7 +1651,8 @@ reload (first, global, dumpfile)
{
int j = potential_reload_regs[i];
int k;
- if (j >= 0 && j + 1 < FIRST_PSEUDO_REGISTER
+ if (j >= 0
+ && j + group_size[class] <= FIRST_PSEUDO_REGISTER
&& HARD_REGNO_MODE_OK (j, group_mode[class]))
{
/* Check each reg in the sequence. */
@@ -1671,18 +1672,10 @@ reload (first, global, dumpfile)
for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++)
if (potential_reload_regs[idx] == j + k)
break;
- if (i >= FIRST_PSEUDO_REGISTER)
- {
- /* There are no groups left. */
- spill_failure (max_groups_insn[class]);
- failure = 1;
- goto failed;
- }
- else
- something_changed
- |= new_spill_reg (idx, class,
- max_needs, NULL_PTR,
- global, dumpfile);
+ something_changed
+ |= new_spill_reg (idx, class,
+ max_needs, NULL_PTR,
+ global, dumpfile);
}
/* We have found one that will complete a group,
@@ -1697,9 +1690,14 @@ reload (first, global, dumpfile)
}
}
/* We couldn't find any registers for this reload.
- Abort to avoid going into an infinite loop. */
- if (i == FIRST_PSEUDO_REGISTER)
- abort ();
+ Avoid going into an infinite loop. */
+ if (i >= FIRST_PSEUDO_REGISTER)
+ {
+ /* There are no groups left. */
+ spill_failure (max_groups_insn[class]);
+ failure = 1;
+ goto failed;
+ }
}
}