https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109524
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Perhaps add to substitute_and_fold another callback before the dead eh edges etc. are removed and perform this m_unreachable.remove_and_update_globals in there rather than after substitute_and_fold returns?