https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123417
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks like the issue is gimple_make_forwarder_block won't know if it is going
to be the same until after flushing the edges.
Maybe it is better not remove the forwarder block for loop latches if there was
a phi.
So this:
```
/* If bb doesn't have a single predecessor we'd make this
loop have multiple latches. Don't do that if that
would in turn require disambiguating them. */
if (!single_pred_p (bb)
&& !loops_state_satisfies_p
(LOOPS_MAY_HAVE_MULTIPLE_LATCHES))
return false;
```
Needs `&& !has_phi` just like the loop preheader too.
I wonder if that would improve other code.