One more patch for PR93564: Prefer smaller hard regno when we do not honor reg alloc...
authorVladimir N. Makarov <vmakarov@redhat.com>
Fri, 28 Feb 2020 16:27:30 +0000 (11:27 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Fri, 28 Feb 2020 16:27:30 +0000 (11:27 -0500)
2020-02-28  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/93564
* ira-color.c (assign_hard_reg): Prefer smaller hard regno when we
do not honor reg alloc order.

gcc/ChangeLog
gcc/ira-color.c

index f6a9ae2375ef5ce301eb88df574752be02ce63bd..1451807f7d90cd02e42097c58ca8fb586efd42d3 100644 (file)
@@ -1,3 +1,9 @@
+2020-02-28  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/93564
+       * ira-color.c (assign_hard_reg): Prefer smaller hard regno when we
+       do not honor reg alloc order.
+
 2020-02-27  Joel Hutton  <Joel.Hutton@arm.com>
 
        PR target/87612
index 0ffdd1920204ce6bc4c41497a5bb25a4040ecb21..a2bf108c38eec2c456509f0dfdd9b0db60bd970a 100644 (file)
@@ -1925,7 +1925,9 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
        }
       if (min_cost > cost)
        min_cost = cost;
-      if (min_full_cost > full_cost)
+      if (min_full_cost > full_cost
+         || (!HONOR_REG_ALLOC_ORDER && min_full_cost == full_cost
+             && best_hard_regno > hard_regno))
        {
          min_full_cost = full_cost;
          best_hard_regno = hard_regno;