This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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++)
            {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]