From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 3FA943938C3F; Thu, 6 Oct 2022 13:16:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FA943938C3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665062218; bh=b7uYox+Ad31xXW66KIp9VW7VYPSKvq7P+kir5fwF8kc=; h=From:To:Subject:Date:From; b=Om7Fp1yXlbCZaGpZVcHXAx5vuWCwI7Lfihe9YZoTmpHaftogavfJNk9QCOCkHb/Mk m9S9BTbdkDt8QPZGQ78NdN3W8Vbz6EE3w5szDG210EVU8NEy0xNX3llYuJpA1w3/LO Altdd+OybRW/JElR6/mPIMixGjcJMSIOqQsX1Lv8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3132] Minor cleanup in DF code X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 0af8d957d5911fc7659b4174cfc2213289bbed23 X-Git-Newrev: b9d04e915fe0f4cdcca40e6de65ae384ba82a429 Message-Id: <20221006131658.3FA943938C3F@sourceware.org> Date: Thu, 6 Oct 2022 13:16:58 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b9d04e915fe0f4cdcca40e6de65ae384ba82a429 commit r13-3132-gb9d04e915fe0f4cdcca40e6de65ae384ba82a429 Author: Eric Botcazou Date: Thu Oct 6 15:12:53 2022 +0200 Minor cleanup in DF code No functional changes. gcc/ * df-scan.cc (df_ref_create_structure): Minor cleanup. Diff: --- gcc/df-scan.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gcc/df-scan.cc b/gcc/df-scan.cc index 9b2375d561b..1a41e6d3e1c 100644 --- a/gcc/df-scan.cc +++ b/gcc/df-scan.cc @@ -2475,10 +2475,11 @@ df_ref_create_structure (enum df_ref_class cl, enum df_ref_type ref_type, int ref_flags) { - df_ref this_ref = NULL; - unsigned int regno = REGNO (GET_CODE (reg) == SUBREG ? SUBREG_REG (reg) : reg); + const unsigned int regno + = REGNO (GET_CODE (reg) == SUBREG ? SUBREG_REG (reg) : reg); struct df_scan_problem_data *problem_data = (struct df_scan_problem_data *) df_scan->problem_data; + df_ref this_ref; switch (cl) { @@ -2498,12 +2499,15 @@ df_ref_create_structure (enum df_ref_class cl, this_ref->regular_ref.loc = loc; gcc_checking_assert (loc); break; + + default: + gcc_unreachable (); } DF_REF_CLASS (this_ref) = cl; DF_REF_ID (this_ref) = -1; DF_REF_REG (this_ref) = reg; - DF_REF_REGNO (this_ref) = regno; + DF_REF_REGNO (this_ref) = regno; DF_REF_TYPE (this_ref) = ref_type; DF_REF_INSN_INFO (this_ref) = info; DF_REF_CHAIN (this_ref) = NULL; @@ -2512,17 +2516,17 @@ df_ref_create_structure (enum df_ref_class cl, DF_REF_PREV_REG (this_ref) = NULL; DF_REF_ORDER (this_ref) = df->ref_order++; - /* We need to clear this bit because fwprop, and in the future - possibly other optimizations sometimes create new refs using ond - refs as the model. */ + /* We need to clear the DF_HARD_REG_LIVE bit because fwprop, and in the + future possibly other optimizations, sometimes create new refs using + live refs as the model. */ DF_REF_FLAGS_CLEAR (this_ref, DF_HARD_REG_LIVE); - /* See if this ref needs to have DF_HARD_REG_LIVE bit set. */ + /* Now see if this ref really needs to have the bit set. */ if (regno < FIRST_PSEUDO_REGISTER - && !DF_REF_IS_ARTIFICIAL (this_ref) - && !DEBUG_INSN_P (DF_REF_INSN (this_ref))) + && cl != DF_REF_ARTIFICIAL + && !DEBUG_INSN_P (info->insn)) { - if (DF_REF_REG_DEF_P (this_ref)) + if (ref_type == DF_REF_REG_DEF) { if (!DF_REF_FLAGS_IS_SET (this_ref, DF_REF_MAY_CLOBBER)) DF_REF_FLAGS_SET (this_ref, DF_HARD_REG_LIVE);