tree-optimization/106922 - extend same-val clobber FRE
The following extends the skipping of same valued stores to
handle an arbitrary number of them as long as they are from the
same value (which we now record). That's an obvious extension
which allows to optimize the m_engaged member of std::optional
more reliably.
PR tree-optimization/106922
* tree-ssa-sccvn.cc (vn_reference_lookup_3): Allow
an arbitrary number of same valued skipped stores.
* g++.dg/torture/pr106922.C: New testcase.
(cherry picked from commit
af611afe5fcc908a6678b5b205fb5af7d64fbcb2)