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 <vmaka...@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++)
{