]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove shadowed oracle field.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 1 Oct 2021 10:27:55 +0000 (12:27 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 1 Oct 2021 12:43:54 +0000 (14:43 +0200)
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
gcc/gimple-range-path.h

index a29d5318ca9b7568b62b509f8149b817e7aa505e..422abfddb8f4199959035f451304cb6cbac4edd2 100644 (file)
@@ -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);
     }
 
index cf49c6dc086337e15c7a4a2ac86f6fe851f0222b..5f4e73a594938ff1b84aadb8839569d09d03592b 100644 (file)
@@ -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;