]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't process lookups for debug statements in Ranger.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 8 Jun 2021 13:43:17 +0000 (09:43 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Wed, 14 Jul 2021 19:14:20 +0000 (15:14 -0400)
Although PR 100781 is not an issue in GCC11, its possible that a similar
situation may arise.  The identical fix cannot be easily introduced.
With EVRP always running in hybrid mode, there is no need for ranger to
spawn a lookup for a debug statement in this release.

* gimple-range.cc (gimple_ranger::range_of_expr): Treat debug statments
as contextless queries to avoid additional lookups.

gcc/gimple-range.cc

index 6158a754dd663148e73a8612a49c5bcc8588fa0a..fd7fa5e3dbbf7d08b046e8dea36ad2338d77fd62 100644 (file)
@@ -945,7 +945,7 @@ gimple_ranger::range_of_expr (irange &r, tree expr, gimple *stmt)
     return get_tree_range (r, expr);
 
   // If there is no statement, just get the global value.
-  if (!stmt)
+  if (!stmt || is_gimple_debug (stmt))
     {
       if (!m_cache.get_global_range (r, expr))
         r = gimple_range_global (expr);