https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126150
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:1d91a0b0ec53863c8754e04142b1ee6f37b20751 commit r16-9274-g1d91a0b0ec53863c8754e04142b1ee6f37b20751 Author: Richard Biener <[email protected]> Date: Wed Jul 8 13:57:17 2026 +0200 tree-optimization/126150 - ICE with replace_uses_by replace_uses_by triggers eventual BB removal from inside a FOR_EACH_IMM_USE_STMT iteration. That's a no-go since we might eliminate uses in the list we are currently processing. The fix is to defer EH edge purging. PR tree-optimization/126150 * tree-cfg.cc (replace_uses_by): Delay purging of EH edges until after FOR_EACH_IMM_USE_STMT finished. * g++.dg/pr126150.C: New testcase. (cherry picked from commit 210b4eca880c88e7f7ec970b68a93a2a28bad1be)
