diff options
author | Richard Biener <rguenther@suse.de> | 2023-12-05 09:21:35 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-12-06 08:24:35 +0100 |
commit | 52f8092f54cf338c19d44e06b35612d15c96faf4 (patch) | |
tree | 9d7be0809e908876708006a24b2f545d23157f2f /gcc/gimple-range.cc | |
parent | 8a5ef148bbab3b5397e293cbc28f6d6ebc5bb596 (diff) | |
download | gcc-52f8092f54cf338c19d44e06b35612d15c96faf4.zip gcc-52f8092f54cf338c19d44e06b35612d15c96faf4.tar.gz gcc-52f8092f54cf338c19d44e06b35612d15c96faf4.tar.bz2 |
tree-optimization/112843 - update_stmt doing wrong things
The following removes range_query::update_stmt and its single
invocation from update_stmt_operands. That function is not
supposed to look beyond the raw stmt contents of the passed
stmt since there's no guarantee about the rest of the IL.
PR tree-optimization/112843
* tree-ssa-operands.cc (update_stmt_operands): Do not call
update_stmt from ranger.
* value-query.h (range_query::update_stmt): Remove.
* gimple-range.h (gimple_ranger::update_stmt): Likewise.
* gimple-range.cc (gimple_ranger::update_stmt): Likewise.
Diffstat (limited to 'gcc/gimple-range.cc')
-rw-r--r-- | gcc/gimple-range.cc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index 5e9bb39..84d2c75 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -544,40 +544,6 @@ gimple_ranger::register_transitive_inferred_ranges (basic_block bb) } } -// When a statement S has changed since the result was cached, re-evaluate -// and update the global cache. - -void -gimple_ranger::update_stmt (gimple *s) -{ - tree lhs = gimple_get_lhs (s); - if (!lhs || !gimple_range_ssa_p (lhs)) - return; - Value_Range r (TREE_TYPE (lhs)); - // Only update if it already had a value. - if (m_cache.get_global_range (r, lhs)) - { - // Re-calculate a new value using just cache values. - Value_Range tmp (TREE_TYPE (lhs)); - fold_using_range f; - fur_stmt src (s, &m_cache); - f.fold_stmt (tmp, s, src, lhs); - - // Combine the new value with the old value to check for a change. - if (r.intersect (tmp)) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - { - print_generic_expr (dump_file, lhs, TDF_SLIM); - fprintf (dump_file, " : global value re-evaluated to "); - r.dump (dump_file); - fputc ('\n', dump_file); - } - m_cache.set_global_range (lhs, r); - } - } -} - // This routine will export whatever global ranges are known to GCC // SSA_RANGE_NAME_INFO and SSA_NAME_PTR_INFO fields. |