diff --git a/gcc/gimple-ssa-evrp.c b/gcc/gimple-ssa-evrp.c
index 829fdcdaef2..bd4c7634b3e 100644
--- a/gcc/gimple-ssa-evrp.c
+++ b/gcc/gimple-ssa-evrp.c
@@ -117,34 +117,33 @@ class rvrp_folder : public substitute_and_fold_engine
 public:
 
   rvrp_folder () : substitute_and_fold_engine (), m_simplifier ()
-  { 
-    if (param_evrp_mode & EVRP_MODE_TRACE)
-      m_ranger = new trace_ranger ();
-    else
-      m_ranger = new gimple_ranger ();
-    m_simplifier.set_range_query (m_ranger);
+  {
+    enable_ranger ();
+
+    m_simplifier.set_range_query (RANGE_QUERY (cfun));
   }
       
   ~rvrp_folder ()
   {
     if (dump_file && (dump_flags & TDF_DETAILS))
-      m_ranger->dump (dump_file);
-    delete m_ranger;
+      RANGE_QUERY (cfun)->dump (dump_file);
+
+    disable_ranger ();
   }
 
   tree value_of_expr (tree name, gimple *s = NULL) OVERRIDE
   {
-    return m_ranger->value_of_expr (name, s);
+    return RANGE_QUERY (cfun)->value_of_expr (name, s);
   }
 
   tree value_on_edge (edge e, tree name) OVERRIDE
   {
-    return m_ranger->value_on_edge (e, name);
+    return RANGE_QUERY (cfun)->value_on_edge (e, name);
   }
 
   tree value_of_stmt (gimple *s, tree name = NULL) OVERRIDE
   {
-    return m_ranger->value_of_stmt (s, name);
+    return RANGE_QUERY (cfun)->value_of_stmt (s, name);
   }
 
   bool fold_stmt (gimple_stmt_iterator *gsi) OVERRIDE
@@ -154,7 +153,6 @@ public:
 
 private:
   DISABLE_COPY_AND_ASSIGN (rvrp_folder);
-  gimple_ranger *m_ranger;
   simplify_using_ranges m_simplifier;
 };
 
@@ -175,19 +173,16 @@ class hybrid_folder : public evrp_folder
 public:
   hybrid_folder (bool evrp_first)
   {
-    if (param_evrp_mode & EVRP_MODE_TRACE)
-      m_ranger = new trace_ranger ();
-    else
-      m_ranger = new gimple_ranger ();
+    enable_ranger ();
 
     if (evrp_first)
       {
 	first = &m_range_analyzer;
-	second = m_ranger;
+	second = RANGE_QUERY (cfun);
       }
      else
       {
-	first = m_ranger;
+	first = RANGE_QUERY (cfun);
 	second = &m_range_analyzer;
       }
   }
@@ -195,8 +190,9 @@ public:
   ~hybrid_folder ()
   {
     if (dump_file && (dump_flags & TDF_DETAILS))
-      m_ranger->dump (dump_file);
-    delete m_ranger;
+      RANGE_QUERY (cfun)->dump (dump_file);
+
+    disable_ranger ();
   }
 
   bool fold_stmt (gimple_stmt_iterator *gsi) OVERRIDE
@@ -221,7 +217,6 @@ public:
 
 private:
   DISABLE_COPY_AND_ASSIGN (hybrid_folder);
-  gimple_ranger *m_ranger;
   range_query *first;
   range_query *second;
   tree choose_value (tree evrp_val, tree ranger_val);
@@ -232,7 +227,7 @@ tree
 hybrid_folder::value_of_expr (tree op, gimple *stmt)
 {
   tree evrp_ret = evrp_folder::value_of_expr (op, stmt);
-  tree ranger_ret = m_ranger->value_of_expr (op, stmt);
+  tree ranger_ret = RANGE_QUERY (cfun)->value_of_expr (op, stmt);
   return choose_value (evrp_ret, ranger_ret);
 }
 
@@ -242,7 +237,7 @@ hybrid_folder::value_on_edge (edge e, tree op)
   // Call evrp::value_of_expr directly.  Otherwise another dual call is made
   // via hybrid_folder::value_of_expr, but without an edge.
   tree evrp_ret = evrp_folder::value_of_expr (op, NULL);
-  tree ranger_ret = m_ranger->value_on_edge (e, op);
+  tree ranger_ret = RANGE_QUERY (cfun)->value_on_edge (e, op);
   return choose_value (evrp_ret, ranger_ret);
 }
 
@@ -257,7 +252,7 @@ hybrid_folder::value_of_stmt (gimple *stmt, tree op)
   else
     evrp_ret = NULL_TREE;
 
-  tree ranger_ret = m_ranger->value_of_stmt (stmt, op);
+  tree ranger_ret = RANGE_QUERY (cfun)->value_of_stmt (stmt, op);
   return choose_value (evrp_ret, ranger_ret);
 }
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-55.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-55.c
index 25f5b82d9be..8df5cb629ae 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-55.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-55.c
@@ -66,7 +66,7 @@ void warn_ptrdiff_anti_range_add (ptrdiff_t i)
 {
   i |= 1;
 
-  char ca5[5];              // { dg-message "at offset \\\[1, 5]" "pr?????" { xfail *-*-* } }
+  char ca5[5];              // { dg-message "at offset \\\[1, 5]" "pr?????" }
   char *p0 = ca5;           // offset
   char *p1 = p0 + i;        //  1-5
   char *p2 = p1 + i;        //  2-5
@@ -74,7 +74,7 @@ void warn_ptrdiff_anti_range_add (ptrdiff_t i)
   char *p4 = p3 + i;        //  4-5
   char *p5 = p4 + i;        //   5
 
-  memset (p5, 0, 5);        // { dg-warning "writing 5 bytes into a region of size 0" "pr?????" { xfail *-*-* } }
+  memset (p5, 0, 5);        // { dg-warning "writing 5 bytes into a region of size" "pr?????" }
 
   sink (p0, p1, p2, p3, p4, p5);
 }
@@ -83,7 +83,7 @@ void warn_int_anti_range (int i)
 {
   i |= 1;
 
-  char ca5[5];              // { dg-message "at offset \\\[1, 5]" "pr?????" { xfail *-*-* } }
+  char ca5[5];              // { dg-message "at offset \\\[1, 5]" "pr?????" }
   char *p0 = ca5;           // offset
   char *p1 = p0 + i;        //  1-5
   char *p2 = p1 + i;        //  2-5
@@ -91,7 +91,7 @@ void warn_int_anti_range (int i)
   char *p4 = p3 + i;        //  4-5
   char *p5 = p4 + i;        //   5
 
-  memset (p5, 0, 5);        // { dg-warning "writing 5 bytes into a region of size 0" "pr?????" { xfail *-*-* } }
+  memset (p5, 0, 5);        // { dg-warning "writing 5 bytes into a region of size" "pr?????" }
 
   sink (p0, p1, p2, p3, p4, p5);
 }
diff --git a/gcc/testsuite/gcc.dg/pr80776-1.c b/gcc/testsuite/gcc.dg/pr80776-1.c
index af41c0c2ffa..f3a120b6744 100644
--- a/gcc/testsuite/gcc.dg/pr80776-1.c
+++ b/gcc/testsuite/gcc.dg/pr80776-1.c
@@ -17,7 +17,5 @@ Foo (void)
     __builtin_unreachable ();
   if (! (0 <= i && i <= 999999))
     __builtin_unreachable ();
-  /* The correctness bits for [E]VRP cannot handle chained conditionals
-     when deciding to ignore a unreachable branch for setting SSA range info. */
-  sprintf (number, "%d", i); /* { dg-bogus "writing" "" { xfail *-*-* } } */
+  sprintf (number, "%d", i); /* { dg-bogus "writing" "" } */
 }
