tree-optimization/109342 - wrong code with edge equivalences in VN
The following testcase shows a problem in how we query valitity for
equivalences on edges when the edge is a backedge and thus refering
to a block thats later in the iteration order we use for VN. That
causes the dominated_by_p_w_unex helper to look at edge executable
state that's not yet computed and thus still at optimistic not
executable state.
The following makes sure to use a plain dominance check in these cases.
PR tree-optimization/109342
* tree-ssa-sccvn.cc (vn_nary_op_get_predicated_value): New
overload for edge. When that edge is a backedge use
dominated_by_p directly.
* g++.dg/torture/pr109342.C: New testcase.