]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use the current cache when creating inferred ranges.
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 31 Mar 2025 15:18:22 +0000 (11:18 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Mon, 28 Apr 2025 21:17:30 +0000 (17:17 -0400)
Infer range processing was adjusted to allow a query to be specified,
but during VRP folding, ranger was not providing a query.  This results
in contextual ranges being missed.   Pass the cache in as the query
which provide a read-only query of the current state.

* gimple-range-cache.cc (ranger_cache::apply_inferred_ranges): Pass
'this' as the range-query to the inferred range constructor.

gcc/gimple-range-cache.cc

index 818b801468a0f2827ae8c04f33b23bb654f6c1d6..ecf03319cd4e8853a3cf119e8301663aee980018 100644 (file)
@@ -1861,7 +1861,7 @@ ranger_cache::apply_inferred_ranges (gimple *s)
   bool update = true;
 
   basic_block bb = gimple_bb (s);
-  gimple_infer_range infer(s);
+  gimple_infer_range infer(s, this);
   if (infer.num () == 0)
     return;