diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-07-19 15:54:57 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-07-22 08:51:59 -0400 |
commit | d3fa77472b78c5ddada03a1052b229bea11cb76f (patch) | |
tree | 5d54b55a6f19824d72aecc50a54623b1260bef5c /gcc/value-relation.cc | |
parent | ea789238b2c24eedf70b56257235adf3d33c5a0a (diff) | |
download | gcc-d3fa77472b78c5ddada03a1052b229bea11cb76f.zip gcc-d3fa77472b78c5ddada03a1052b229bea11cb76f.tar.gz gcc-d3fa77472b78c5ddada03a1052b229bea11cb76f.tar.bz2 |
Allow non-symmetrical equivalences.
Don't trap if equivalences are processed out of DOM order, and aren't
completely symmetrical. We will eventually resolve this, but its OK for now.
gcc/
PR tree-optimization/101511
* value-relation.cc (relation_oracle::query_relation): Check if ssa1
is in ssa2's equiv set, and don't trap if so.
gcc/testsuite/
* g++.dg/pr101511.C: New.
Diffstat (limited to 'gcc/value-relation.cc')
-rw-r--r-- | gcc/value-relation.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 43fcab7..bcfe388 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -873,11 +873,15 @@ relation_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) if (kind != VREL_NONE) return kind; - // If one is not found, see if there is a relationship between equivalences. // If v2 isn't in v1s equiv set, then v1 shouldn't be in v2's set either. + // It is possible for out-of-order dominator processing to have an out of + // sync set of equivalences.. Down the road, when we do full updates, + // change this to an assert to ensure everything is in sync. const_bitmap equiv2 = equiv_set (ssa2, bb); - gcc_checking_assert (!equiv2 || !bitmap_bit_p (equiv2, v1)); + if (equiv2 && bitmap_bit_p (equiv2, v1)) + return EQ_EXPR; + // If not equal, see if there is a relationship between equivalences. if (!equiv1 && !equiv2) kind = VREL_NONE; else if (!equiv1) |