From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1880) id BD7F93858D1E; Tue, 29 Nov 2022 03:42:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD7F93858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669693328; bh=w2EhIInzrOZrCIMkB/v6AjXsmMHVyw1Xq8vk1/sJ8ec=; h=From:To:Subject:Date:From; b=mNDL3+wswGKnoO88VVBTfBd+8d/+31JfuhylJTpdQzFuqWZO5nKmSnAC6UrfKxM5C beVWkfzLwW+3IuOZ7RHtHocuEm+i9n02w1onVaKVuj0kQwdqjUbOCFOp4wC+HzjJbW JQJMfAaLcEoGLvcay31BMVh/9j4N7a3evPsmYRdk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Max Filippov To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-8947] gcc: fix PR rtl-optimization/107482 X-Act-Checkin: gcc X-Git-Author: Max Filippov X-Git-Refname: refs/heads/releases/gcc-12 X-Git-Oldrev: 9c1621e8736c3fcd17d3a36f09f394aa2c74da47 X-Git-Newrev: 1fb5287dfcf3bef8adea98a4bded441c95e43914 Message-Id: <20221129034208.BD7F93858D1E@sourceware.org> Date: Tue, 29 Nov 2022 03:42:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1fb5287dfcf3bef8adea98a4bded441c95e43914 commit r12-8947-g1fb5287dfcf3bef8adea98a4bded441c95e43914 Author: Max Filippov Date: Mon Nov 7 13:58:49 2022 -0800 gcc: fix PR rtl-optimization/107482 gcc/ PR rtl-optimization/107482 * ira-color.cc (assign_hard_reg): Only call update_costs_from_copies when retry_p is false. (cherry picked from commit e581490f0cfa80c58d2b648d71a44a597fbe3008) Diff: --- gcc/ira-color.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc index 4a1a325e8e3..ffe73b61c45 100644 --- a/gcc/ira-color.cc +++ b/gcc/ira-color.cc @@ -2209,8 +2209,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);