When feeding non-SSA names to range_on_edge we degrade to a
non-contextual query.  The following uses the argument added in
the previous patch to indicate the edge as the location of the
range query.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

        * gimple-range.cc (gimple_ranger::range_on_edge): Pass
        the edge as 'edge' to get_tree_range.
        (dom_ranger::range_on_edge): Likewise.
---
 gcc/gimple-range.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index e91eeb455f1..ced574d72f3 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -252,7 +252,7 @@ gimple_ranger::range_on_edge (vrange &r, edge e, tree name)
 
   bool res = true;
   if (!gimple_range_ssa_p (name))
-    res = get_tree_range (r, name, NULL);
+    res = get_tree_range (r, name, NULL, NULL, NULL, e);
   else
     {
       range_on_exit (r, e->src, name);
@@ -783,7 +783,7 @@ bool
 dom_ranger::range_on_edge (vrange &r, edge e, tree expr)
 {
   if (!gimple_range_ssa_p (expr))
-    return get_tree_range (r, expr, NULL);
+    return get_tree_range (r, expr, NULL, NULL, NULL, e);
 
   basic_block bb = e->src;
   unsigned idx;
-- 
2.51.0

Reply via email to