From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id 7A9843857C75; Fri, 1 Oct 2021 12:44:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A9843857C75 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-4043] Remove shadowed oracle field. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: 9c1a633d96926357155d4702b66f8a0ec856a81f X-Git-Newrev: 75d053df7271cc0f841d3790196a14c896214bb4 Message-Id: <20211001124401.7A9843857C75@sourceware.org> Date: Fri, 1 Oct 2021 12:44:01 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 12:44:01 -0000 https://gcc.gnu.org/g:75d053df7271cc0f841d3790196a14c896214bb4 commit r12-4043-g75d053df7271cc0f841d3790196a14c896214bb4 Author: Aldy Hernandez Date: Fri Oct 1 12:27:55 2021 +0200 Remove shadowed oracle field. The m_oracle field in the path solver was shadowing the base class. This was causing subtle problems while calculating outgoing edges between blocks, because the query object being passed did not have an oracle set. This should further improve our solving ability. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::compute_ranges): Use get_path_oracle. * gimple-range-path.h (class path_range_query): Remove shadowed m_oracle field. (path_range_query::get_path_oracle): New. Diff: --- gcc/gimple-range-path.cc | 2 +- gcc/gimple-range-path.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index a29d5318ca9..422abfddb8f 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -480,7 +480,7 @@ path_range_query::compute_ranges (const vec &path, if (m_resolve) { add_copies_to_imports (); - m_oracle->reset_path (); + get_path_oracle ()->reset_path (); compute_relations (path); } diff --git a/gcc/gimple-range-path.h b/gcc/gimple-range-path.h index cf49c6dc086..5f4e73a5949 100644 --- a/gcc/gimple-range-path.h +++ b/gcc/gimple-range-path.h @@ -38,7 +38,6 @@ public: bool range_of_expr (irange &r, tree name, gimple * = NULL) override; bool range_of_stmt (irange &r, gimple *, tree name = NULL) override; bool unreachable_path_p (); - path_oracle *oracle () { return m_oracle; } void dump (FILE *) override; void debug (); @@ -46,6 +45,7 @@ private: bool internal_range_of_expr (irange &r, tree name, gimple *); bool defined_outside_path (tree name); void range_on_path_entry (irange &r, tree name); + path_oracle *get_path_oracle () { return (path_oracle *)m_oracle; } // Cache manipulation. void set_cache (const irange &r, tree name); @@ -85,7 +85,6 @@ private: auto_bitmap m_imports; gimple_ranger &m_ranger; non_null_ref m_non_null; - path_oracle *m_oracle; // Current path position. unsigned m_pos;