This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/17236] inefficient code for long long multiply on x86
- From: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Dec 2007 09:49:25 -0000
- Subject: [Bug rtl-optimization/17236] inefficient code for long long multiply on x86
- References: <bug-17236-1008@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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