public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3132] Minor cleanup in DF code Date: Thu, 6 Oct 2022 13:16:58 +0000 (GMT) [thread overview] Message-ID: <20221006131658.3FA943938C3F@sourceware.org> (raw) https://gcc.gnu.org/g:b9d04e915fe0f4cdcca40e6de65ae384ba82a429 commit r13-3132-gb9d04e915fe0f4cdcca40e6de65ae384ba82a429 Author: Eric Botcazou <ebotcazou@adacore.com> 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);
reply other threads:[~2022-10-06 13:16 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221006131658.3FA943938C3F@sourceware.org \ --to=ebotcazou@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).