https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93199
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- As for the patch, I wonder if internal resx doesn't occur also without the clobbers to move or in places where sink_clobbers would give up. So, perhaps add a dry_run bool to sink_clobbers and in the first loop, if we haven't yet determined we need the second one, run sink_clobbers with dry_run=true which would perform the first half of the function and only if it found clobbers in a bb with EH preds and single successor would tell the caller it should set the bool to trigger the second loop.