]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc: fix PR rtl-optimization/107482
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 7 Nov 2022 21:58:49 +0000 (13:58 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 29 Nov 2022 03:47:02 +0000 (19:47 -0800)
gcc/
PR rtl-optimization/107482
* ira-color.c (assign_hard_reg): Only call
update_costs_from_copies when retry_p is false.

(cherry picked from commit e581490f0cfa80c58d2b648d71a44a597fbe3008)

gcc/ira-color.c

index b0fc159a84933f1b8afdd969fab4539a0e35664c..c02af1f7181857e7bfea4cd3cc23365db4b9cb7b 100644 (file)
@@ -1956,8 +1956,8 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
     restore_costs_from_copies (a);
   ALLOCNO_HARD_REGNO (a) = best_hard_regno;
   ALLOCNO_ASSIGNED_P (a) = true;
-  if (best_hard_regno >= 0)
-    update_costs_from_copies (a, true, ! retry_p);
+  if (best_hard_regno >= 0 && !retry_p)
+    update_costs_from_copies (a, true, true);
   ira_assert (ALLOCNO_CLASS (a) == aclass);
   /* We don't need updated costs anymore.  */
   ira_free_allocno_updated_costs (a);