From af432130ae43aa872d977e6bda6a9fbe8c83b149 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Tue, 18 Oct 1994 19:33:35 -0400 Subject: [PATCH] (reload): Correctly compute group additional needs when the return register cannot be used as a spill register. From-SVN: r8308 --- gcc/reload1.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/reload1.c b/gcc/reload1.c index 0a2ee20155c..ae9afb1f2cd 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1350,19 +1350,14 @@ reload (first, global, dumpfile) } /* Now count extra regs if there might be a conflict with - the return value register. + the return value register. */ - ??? This is not quite correct because we don't properly - handle the case of groups, but if we end up doing - something wrong, it either will end up not mattering or - we will abort elsewhere. */ - for (r = regno; r < regno + nregs; r++) if (spill_reg_order[r] >= 0) for (i = 0; i < N_REG_CLASSES; i++) if (TEST_HARD_REG_BIT (reg_class_contents[i], r)) { - if (basic_needs[i] > 0 || basic_groups[i] > 0) + if (basic_needs[i] > 0) { enum reg_class *p; @@ -1371,6 +1366,15 @@ reload (first, global, dumpfile) while (*p != LIM_REG_CLASSES) insn_needs.other.regs[0][(int) *p++]++; } + if (basic_groups[i] > 0) + { + enum reg_class *p; + + insn_needs.other.groups[i]++; + p = reg_class_superclasses[i]; + while (*p != LIM_REG_CLASSES) + insn_needs.other.groups[(int) *p++]++; + } } } #endif /* SMALL_REGISTER_CLASSES */ -- 2.30.2