https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61607
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
The bogus loop cancelling is fixed as well as the equivalence recording. Still
DOM does
Registering jump thread: (3, 4) incoming edge; (4, 5) joiner; (5, 6)
normal;
Registering jump thread: (5, 7) incoming edge; (7, 9) normal;
Registering jump thread: (2, 4) incoming edge; (4, 5) joiner; (5, 7)
normal;
Cancelling jump thread: (2, 4) incoming edge; (4, 5) joiner; (5, 7) normal;
Threaded jump 5 --> 7 to 10
with result
<bb 5>:
# inter_I_lsm.3_24 = PHI <inter_I_lsm.3_10(4)>
# inter_I_lsm.4_25 = PHI <inter_I_lsm.4_11(4)>
# inter_I_lsm.5_26 = PHI <inter_I_lsm.5_12(4)>
# inter_I_lsm.6_27 = PHI <inter_I_lsm.4_11(4)>
if (inter_I_lsm.4_25 != 0)
goto <bb 6>;
else
goto <bb 10>;
<bb 6>:
inter[0] = inter_I_lsm.3_24;
<bb 7>:
if (inter_I_lsm.4_25 != 0)
goto <bb 8>;
else
goto <bb 9>;
<bb 8>:
inter[1] = inter_I_lsm.5_26;
<bb 9>:
foo (&inter);
inter ={v} {CLOBBER};
return;
<bb 10>:
goto <bb 9>;
but no attempt at threading of
(5, 6) incoming edge -> (6->7) joiner -> (7 -> 8) normal
VRP simplfies the conditional to true afterwards - so maybe this is just
a missed simplification-after-threading in DOM? Without VRP the
redundant conditional stays. It still looks like a trivial missing thing to
adjust the jump we thread through ...?