From 9d1a4667d88d24c9af71984e73be5eb99529a6dc Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 3 Oct 1992 00:38:02 +0000 Subject: [PATCH] (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 --- gcc/reload1.c | 30 ++++++++++++++---------------- 1 file 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; + } } } -- 2.7.4