path solver: Default to global range if nothing found.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 15 Nov 2021 08:56:48 +0000 (09:56 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 15 Nov 2021 12:16:56 +0000 (13:16 +0100)
This has been a long time coming, but we weren't able to make the
change because of some unrelated regressions.

Tested on x86-64 & ppc64le Linux.

gcc/ChangeLog:

* gimple-range-path.cc (path_range_query::internal_range_of_expr):
Default to global range if nothing found.

gcc/testsuite/ChangeLog:

* g++.dg/tree-ssa/pr31146-2.C: Add -fno-thread-jumps.

gcc/gimple-range-path.cc
gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C

index 9957ac9..f6e3199 100644 (file)
@@ -212,7 +212,7 @@ path_range_query::internal_range_of_expr (irange &r, tree name, gimple *stmt)
       return true;
     }
 
-  r.set_varying (TREE_TYPE (name));
+  r = gimple_range_global (name);
   return true;
 }
 
index 9fb5dc1..fc26857 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fcheck-new -fno-tree-vrp -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fcheck-new -fno-tree-vrp -fdump-tree-forwprop1 -fno-thread-jumps" } */
 
 #include <new>