https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106421
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:0a5fb0ee337b824224a2c13b76fd682b62e6d314 commit r12-9480-g0a5fb0ee337b824224a2c13b76fd682b62e6d314 Author: Roger Sayle <ro...@nextmovesoftware.com> Date: Tue Jan 10 14:05:46 2023 +0000 PR rtl-optimization/106421: ICE in bypass_block from non-local goto. This patch fixes PR rtl-optimization/106421, an ICE-on-valid (but undefined) regression. The fix, as proposed by Richard Biener, is to defend against BLOCK_FOR_INSN returning NULL in cprop's bypass_block. 2023-01-10 Roger Sayle <ro...@nextmovesoftware.com> gcc/ChangeLog PR rtl-optimization/106421 * cprop.cc (bypass_block): Check that DEST is local to this function (non-NULL) before calling find_edge. gcc/testsuite/ChangeLog PR rtl-optimization/106421 * gcc.dg/pr106421.c: New test case. (cherry picked from commit 851e1ba03f9de699a754dd8648fc151c3e26d697)