diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-02-06 13:07:01 -0500 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-02-10 09:46:33 -0500 |
commit | 99f3ad2e5b117ee79a6dcf97288261e2fa32ab4c (patch) | |
tree | 831646b70330811f9ed4355be0e3316c7eab73fd /gcc/gimple-range-infer.cc | |
parent | edfc4402504fd512ba469219e2ed637f2921a1c2 (diff) | |
download | gcc-99f3ad2e5b117ee79a6dcf97288261e2fa32ab4c.zip gcc-99f3ad2e5b117ee79a6dcf97288261e2fa32ab4c.tar.gz gcc-99f3ad2e5b117ee79a6dcf97288261e2fa32ab4c.tar.bz2 |
Add function context for querying global ranges.
When processing arguments for assume functions, call get_global_range
directly and utilize a function context pointer to avoid any assumptions
about using cfun.
PR tree-optimization/108520
gcc/
* gimple-range-infer.cc (check_assume_func): Invoke
gimple_range_global directly instead using global_range_query.
* value-query.cc (get_range_global): Add function context and
avoid calling nonnull_arg_p if not cfun.
(gimple_range_global): Add function context pointer.
* value-query.h (imple_range_global): Add function context.
gcc/testsuite/
* g++.dg/pr108520.C: New.
Diffstat (limited to 'gcc/gimple-range-infer.cc')
-rw-r--r-- | gcc/gimple-range-infer.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimple-range-infer.cc b/gcc/gimple-range-infer.cc index 4677ae2..c765e07 100644 --- a/gcc/gimple-range-infer.cc +++ b/gcc/gimple-range-infer.cc @@ -84,7 +84,7 @@ gimple_infer_range::check_assume_func (gcall *call) continue; // Query the global range of the default def in the assume function. Value_Range assume_range (type); - global_ranges.range_of_expr (assume_range, default_def); + gimple_range_global (assume_range, default_def, fun); // If there is a non-varying result, add it as an inferred range. if (!assume_range.varying_p ()) { |