https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106422
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:4894ba078692a780a461d2f358b5dfaa25719859 commit r13-1889-g4894ba078692a780a461d2f358b5dfaa25719859 Author: Richard Biener <rguent...@suse.de> Date: Fri Jul 29 08:24:52 2022 +0200 tree-optimization/106422 - verify block copying in forward threading The forward threader failed to check whether it can actually duplicate blocks. The following adds this in a similar place the backwards threader performs this check. PR tree-optimization/106422 * tree-ssa-threadupdate.cc (fwd_jt_path_registry::update_cfg): Check whether we can copy thread blocks and cancel the thread if not. * gcc.dg/torture/pr106422.c: New testcase.