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) ...@@ -1651,7 +1651,8 @@ reload (first, global, dumpfile)
{ {
int j = potential_reload_regs[i]; int j = potential_reload_regs[i];
int k; 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])) && HARD_REGNO_MODE_OK (j, group_mode[class]))
{ {
/* Check each reg in the sequence. */ /* Check each reg in the sequence. */
...@@ -1671,18 +1672,10 @@ reload (first, global, dumpfile) ...@@ -1671,18 +1672,10 @@ reload (first, global, dumpfile)
for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++) for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++)
if (potential_reload_regs[idx] == j + k) if (potential_reload_regs[idx] == j + k)
break; break;
if (i >= FIRST_PSEUDO_REGISTER) something_changed
{ |= new_spill_reg (idx, class,
/* There are no groups left. */ max_needs, NULL_PTR,
spill_failure (max_groups_insn[class]); global, dumpfile);
failure = 1;
goto failed;
}
else
something_changed
|= new_spill_reg (idx, class,
max_needs, NULL_PTR,
global, dumpfile);
} }
/* We have found one that will complete a group, /* We have found one that will complete a group,
...@@ -1697,9 +1690,14 @@ reload (first, global, dumpfile) ...@@ -1697,9 +1690,14 @@ reload (first, global, dumpfile)
} }
} }
/* We couldn't find any registers for this reload. /* We couldn't find any registers for this reload.
Abort to avoid going into an infinite loop. */ Avoid going into an infinite loop. */
if (i == FIRST_PSEUDO_REGISTER) if (i >= FIRST_PSEUDO_REGISTER)
abort (); {
/* 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