From f3ce088645e5305d932380c7520809181b2d2eb9 Mon Sep 17 00:00:00 2001 From: "Vladimir N. Makarov" Date: Fri, 28 Feb 2020 11:27:30 -0500 Subject: [PATCH] One more patch for PR93564: Prefer smaller hard regno when we do not honor reg alloc order. 2020-02-28 Vladimir Makarov PR rtl-optimization/93564 * ira-color.c (assign_hard_reg): Prefer smaller hard regno when we do not honor reg alloc order. --- gcc/ChangeLog | 6 ++++++ gcc/ira-color.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6a9ae2375e..1451807f7d9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-02-28 Vladimir Makarov + + 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 PR target/87612 diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 0ffdd192020..a2bf108c38e 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -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; -- 2.30.2