From: Richard Kenner Date: Fri, 18 Nov 1994 23:23:49 +0000 (-0500) Subject: (record_reg_classes): When handling case of single SET between a hard register alone... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4841ba4b1d6d93eb360f046d908643d26f0b042c;p=gcc.git (record_reg_classes): When handling case of single SET between a hard register alone in a class and a pseudo... (record_reg_classes): When handling case of single SET between a hard register alone in a class and a pseudo, make sure the register is the only member of the class. From-SVN: r8511 --- diff --git a/gcc/regclass.c b/gcc/regclass.c index 129fbaf1131..5e758549e8a 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -1364,6 +1364,7 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) int regno = REGNO (ops[!i]); enum machine_mode mode = GET_MODE (ops[!i]); int class; + int nr; if (regno >= FIRST_PSEUDO_REGISTER && prefclass != 0 && (reg_class_size[prefclass[regno]] @@ -1373,7 +1374,21 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) for (class = 0; class < N_REG_CLASSES; class++) if (TEST_HARD_REG_BIT (reg_class_contents[class], regno) && reg_class_size[class] == CLASS_MAX_NREGS (class, mode)) - op_costs[i].cost[class] = -1; + { + if (reg_class_size[class] == 1) + op_costs[i].cost[class] = -1; + else + { + for (nr = 0; nr < HARD_REGNO_NREGS(regno, mode); nr++) + { + if (!TEST_HARD_REG_BIT (reg_class_contents[class], regno + nr)) + break; + } + + if (nr == HARD_REGNO_NREGS(regno,mode)) + op_costs[i].cost[class] = -1; + } + } } }