]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/116850 - corrupt post-dom info
authorRichard Biener <rguenther@suse.de>
Thu, 26 Sep 2024 13:41:59 +0000 (15:41 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Sep 2024 05:41:04 +0000 (07:41 +0200)
commit64163657ba7e70347087a63bb2b32d83b52ea7d9
tree01a08ad7fa497d712b322a005a181af7cd94f978
parent3f8b1b21f377427adbdfa4cbfc21b979eb49c9d3
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.
gcc/gimple-ssa-isolate-paths.cc
gcc/testsuite/gcc.dg/pr116850.c [new file with mode: 0644]