Commit 9d1a4667 by Richard Stallman

(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
parent 139e5e08
......@@ -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,14 +1672,6 @@ 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,
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment