diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-11-08 09:32:42 -0500 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-11-08 12:48:57 -0500 |
commit | 0cd653bd2559701da9cc4c9bf51f22bdd68623b5 (patch) | |
tree | b36c9cdffb096752d1755baa7f56ad6d4c00db41 /gcc/gimple-range.cc | |
parent | 33a7a63275c959f97b25064cfbe3e7f0dc7f7e9c (diff) | |
download | gcc-0cd653bd2559701da9cc4c9bf51f22bdd68623b5.zip gcc-0cd653bd2559701da9cc4c9bf51f22bdd68623b5.tar.gz gcc-0cd653bd2559701da9cc4c9bf51f22bdd68623b5.tar.bz2 |
Don't calculate new values when using the private context callback.
When using rangers private callback mechanism to provide context
to fold_stmt calls, we are only suppose to be using the cache in read
only mode, never calculate new values.
gcc/
PR tree-optimization/103122
* gimple-range.cc (gimple_ranger::range_of_expr): Request the cache
entry with "calulate new values" set to false.
gcc/testsuite/
* g++.dg/pr103122.C: New.
Diffstat (limited to 'gcc/gimple-range.cc')
-rw-r--r-- | gcc/gimple-range.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index e1177b1..87dba6e 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -88,8 +88,8 @@ gimple_ranger::range_of_expr (irange &r, tree expr, gimple *stmt) if (!m_cache.get_global_range (r, expr)) r = gimple_range_global (expr); // Pick up implied context information from the on-entry cache - // if current_bb is set. - if (current_bb && m_cache.block_range (tmp, current_bb, expr)) + // if current_bb is set. Do not attempt any new calculations. + if (current_bb && m_cache.block_range (tmp, current_bb, expr, false)) { r.intersect (tmp); char str[80]; |