This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch to add one more criterium for choosing alternatives in LRA
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 02 May 2013 14:56:41 -0400
- Subject: patch to add one more criterium for choosing alternatives in LRA
The following patch fixes two GCC testsuite failures on i686 after
submitting patch to fix PR57091.
The first alternative is always preferable then subsequent ones when all
costs are the same. That is how reload works. This checks needs when we
have commutative operator in an insn.
Committed as rev. 198558.
2013-05-02 Vladimir Makarov <vmakarov@redhat.com>
* lra-constraints.c (process_alt_operands): Add checking alt
number to choose the best alternative.
Index: lra-constraints.c
===================================================================
--- lra-constraints.c (revision 198503)
+++ lra-constraints.c (working copy)
@@ -2197,7 +2197,9 @@ process_alt_operands (int only_alternati
number of reload regs. */
&& (reload_nregs < best_reload_nregs
|| (reload_nregs == best_reload_nregs
- && best_reload_sum < reload_sum))))))
+ && (best_reload_sum < reload_sum
+ || (best_reload_sum == reload_sum
+ && nalt < goal_alt_number))))))))
{
for (nop = 0; nop < n_operands; nop++)
{