diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-03-24 01:18:04 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-03-24 01:18:04 +0000 |
commit | 64ff0ff2f983edf7cbe3611e91dc432bd28d4165 (patch) | |
tree | 2b8093135eccd70afe32761679d8b301c152e609 /gcc/regclass.c | |
parent | 3fe3c50ea85c071a9462da37a523b46410f22071 (diff) | |
download | gcc-64ff0ff2f983edf7cbe3611e91dc432bd28d4165.tar.gz |
record_reg_classes): When an alternative requires a match, but we do
it with a copy into a register, that alternative wins.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3862 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r-- | gcc/regclass.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c index 7c5a25676d1..50672109208 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -957,18 +957,12 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) if (rtx_equal_p (ops[j], op)) ; - /* If we can't put the other operand into a register, this - alternative can't be used. */ - - else if (classes[j] == NO_REGS) - alt_fail = 1; + /* If we can put the other operand into a register, add to + the cost of this alternative the cost to copy this + operand to the register used for the other operand. */ - /* Otherwise, add to the cost of this alternative the cost - to copy this operand to the register used for the other - operand. */ - - else - alt_cost += copy_cost (op, mode, classes[j], 1); + if (classes[j] != NO_REGS) + alt_cost += copy_cost (op, mode, classes[j], 1), win = 1; } else if (GET_CODE (ops[j]) != REG || REGNO (ops[j]) < FIRST_PSEUDO_REGISTER) |