https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99101
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
So
@@ -1661,6 +1662,7 @@ perform_tree_ssa_dce (bool aggressive)
if (aggressive)
{
/* Compute control dependence. */
+ connect_infinite_loops_to_exit ();
calculate_dominance_info (CDI_POST_DOMINATORS);
cd = new control_dependences ();
"fixes" it (plus related changes), but
@@ -1661,6 +1662,7 @@ perform_tree_ssa_dce (bool aggressive)
if (aggressive)
{
/* Compute control dependence. */
+ add_noreturn_fake_exit_edges ();
+ connect_infinite_loops_to_exit ();
calculate_dominance_info (CDI_POST_DOMINATORS);
cd = new control_dependences ();
breaks it again. Similar to perturbing block numbering in a way so that
connect_infinite_loops_to_exit would first visit the noreturn block.