[Bug rtl-optimization/17236] inefficient code for long long multiply on x86
bonzini at gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Dec 19 09:49:00 GMT 2007
------- Comment #17 from bonzini at gnu dot org 2007-12-19 09:49 -------
With this patch, GCC gets the preferences right, but it does not affect code
generation.
Index: regclass.c
===================================================================
--- regclass.c (revision 130928)
+++ regclass.c (working copy)
@@ -1651,9 +1651,15 @@ record_reg_classes (int n_alts, int n_op
[(unsigned char) reg_pref[REGNO (op)].prefclass]
[(int) classes[i]]);
- if (REGNO (ops[i]) != REGNO (ops[j])
- && ! find_reg_note (insn, REG_DEAD, op))
- alt_cost += 2;
+ if (REGNO (ops[i]) != REGNO (ops[j]))
+ {
+ /* If the pseudo dies, tying it to the duplicate
+ operand can be advantageous. */
+ if (find_reg_note (insn, REG_DEAD, op))
+ pp->cost[classes[j]]--;
+ else
+ alt_cost += 2;
+ }
/* This is in place of ordinary cost computation
for this operand, so skip to the end of the
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236
More information about the Gcc-bugs
mailing list