diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-09-07 11:15:50 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-09-07 15:20:14 -0400 |
commit | cf2ae3fff4ee9bf884b122ee6cd83bffd791a16f (patch) | |
tree | 3946cea09793b0fe0f46a6fd547a2cc377af966d /gcc/gimple-range.cc | |
parent | ab4bdad49716eb1c60e22e0e617d5eb56b0bac6f (diff) | |
download | gcc-cf2ae3fff4ee9bf884b122ee6cd83bffd791a16f.zip gcc-cf2ae3fff4ee9bf884b122ee6cd83bffd791a16f.tar.gz gcc-cf2ae3fff4ee9bf884b122ee6cd83bffd791a16f.tar.bz2 |
Some ssa-names get incorrectly marked as always_current.
When range_of_stmt invokes prefill_name to evaluate unvisited dependencies
it should not mark already visited names as always_current.
PR tree-optimization/110875
gcc/
* gimple-range.cc (gimple_ranger::prefill_name): Only invoke
cache-prefilling routine when the ssa-name has no global value.
gcc/testsuite/
* gcc.dg/pr110875.c: New.
Diffstat (limited to 'gcc/gimple-range.cc')
-rw-r--r-- | gcc/gimple-range.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index 01173c5..13c3308 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -351,10 +351,14 @@ gimple_ranger::prefill_name (vrange &r, tree name) if (!gimple_range_op_handler::supported_p (stmt) && !is_a<gphi *> (stmt)) return; - bool current; // If this op has not been processed yet, then push it on the stack - if (!m_cache.get_global_range (r, name, current)) - m_stmt_list.safe_push (name); + if (!m_cache.get_global_range (r, name)) + { + bool current; + // Set the global cache value and mark as alway_current. + m_cache.get_global_range (r, name, current); + m_stmt_list.safe_push (name); + } } // This routine will seed the global cache with most of the dependencies of |