https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87126
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- So when we disentangle the irreducible region we expose a disconnect between the current execution flow and the RPO iteration. This means we insert the load d.2_4 = d; with the VDEF of the later processed store d = e_10; which then triggers the assert. We do run into the DEF in vn_reference_lookup_3 but that doesn't handle this simple case given we expect it to be handled by visiting the def before the use ... This shows the assert triggers on missed optimizations which means we can as well remove it. Better strategies for irreducible regions would include re-computing RPO order on-the fly when necessary.