aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-cache.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2023-04-11 17:29:03 -0400
committerAndrew MacLeod <amacleod@redhat.com>2023-04-12 09:07:20 -0400
commit24af552876eff707f75d30d3f0f0e7a5d62dd857 (patch)
tree4539e782839b1fb4302ff3854e36fc2ec0d60477 /gcc/gimple-range-cache.cc
parent9f10b4957ca6058d1a801c5e4bfe11bf159da809 (diff)
downloadgcc-24af552876eff707f75d30d3f0f0e7a5d62dd857.zip
gcc-24af552876eff707f75d30d3f0f0e7a5d62dd857.tar.gz
gcc-24af552876eff707f75d30d3f0f0e7a5d62dd857.tar.bz2
Don't use ANY PHI equivalences in range-on-entry.
PR 108139 dissallows PHI equivalencies in the on-entry calculator, but it was only checking if the equivlaence was a PHI. In this case, NAME itself is a PHI with an equivlaence caused by an undefined value, so we also need to check that case. Unfortunately this un-fixes 101912. PR tree-optimization/109462 gcc/ * gimple-range-cache.cc (ranger_cache::fill_block_cache): Don't check for equivalences if NAME is a phi node. gcc/testsuite/ * gcc.dg/uninit-pr101912.c: XFAIL the warning.
Diffstat (limited to 'gcc/gimple-range-cache.cc')
-rw-r--r--gcc/gimple-range-cache.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index 6a098d8..3b52f1e 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -1218,7 +1218,9 @@ ranger_cache::fill_block_cache (tree name, basic_block bb, basic_block def_bb)
fprintf (dump_file, "\n");
}
// See if any equivalences can refine it.
- if (m_oracle)
+ // PR 109462, like 108139 below, a one way equivalence introduced
+ // by a PHI node can also be through the definition side. Disallow it.
+ if (m_oracle && !is_a<gphi *> (SSA_NAME_DEF_STMT (name)))
{
tree equiv_name;
relation_kind rel;