From 07d8ca2d9295b124556561d96571e6062d86d610 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 7 Sep 1992 05:56:52 +0000 Subject: (record_reg_class): For matching operands... (record_reg_class): For matching operands, handle case where the earlier one is not a pseudo like the case where the later one is not a pseudo. From-SVN: r2067 --- gcc/regclass.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc/regclass.c') diff --git a/gcc/regclass.c b/gcc/regclass.c index cb88cf835fb..343d30393ef 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -939,7 +939,24 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) else alt_cost += copy_cost (op, mode, classes[j], 1); } + else if (GET_CODE (ops[j]) != REG + || REGNO (ops[j]) < FIRST_PSEUDO_REGISTER) + { + /* This op is a pseudo but the one it matches is not. */ + + /* If we can't put the other operand into a register, this + alternative can't be used. */ + + if (classes[j] == NO_REGS) + alt_fail = 1; + /* Otherwise, add to the cost of this alternative the cost + to copy the other operand to the register used for this + operand. */ + + else + alt_cost += copy_cost (ops[j], mode, classes[j], 1); + } else { /* The costs of this operand are the same as that of the -- cgit v1.2.1