https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116850
--- Comment #5 from GCC 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:64163657ba7e70347087a63bb2b32d83b52ea7d9 commit r15-3955-g64163657ba7e70347087a63bb2b32d83b52ea7d9 Author: Richard Biener <rguent...@suse.de> Date: Thu Sep 26 15:41:59 2024 +0200 tree-optimization/116850 - corrupt post-dom info Path isolation computes post-dominators on demand but can end up splitting blocks after that, wrecking it. We can delay splitting of blocks until we no longer need the post-dom info which is what the following patch does to solve the issue. PR tree-optimization/116850 * gimple-ssa-isolate-paths.cc (bb_split_points): New global. (insert_trap): Delay BB splitting if post-doms are computed. (find_explicit_erroneous_behavior): Process delayed BB splitting after releasing post dominators. (gimple_ssa_isolate_erroneous_paths): Do not free post-dom info here. * gcc.dg/pr116850.c: New testcase.