public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] Remove shadowed oracle field.
@ 2021-10-01 12:43 Aldy Hernandez
  2021-10-01 12:43 ` [PATCH] Pass relations down to range_operator::op[12]_range Aldy Hernandez
  2021-10-01 12:43 ` [PATCH] Handle EQ_EXPR relation for operator_lshift Aldy Hernandez
  0 siblings, 2 replies; 7+ messages in thread
From: Aldy Hernandez @ 2021-10-01 12:43 UTC (permalink / raw)
  To: GCC patches

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.
---
 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<basic_block> &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;
-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-02 20:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 12:43 [COMMITTED] Remove shadowed oracle field Aldy Hernandez
2021-10-01 12:43 ` [PATCH] Pass relations down to range_operator::op[12]_range Aldy Hernandez
2021-10-01 13:38   ` Andrew MacLeod
2021-10-01 12:43 ` [PATCH] Handle EQ_EXPR relation for operator_lshift Aldy Hernandez
2021-10-01 14:52   ` Aldy Hernandez
2021-10-02 19:50     ` Aldy Hernandez
2021-10-02 20:53       ` Jeff Law

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).