tree-optimization/109331 - make sure to clean up the CFG after forwprop
authorRichard Biener <rguenther@suse.de>
Wed, 29 Mar 2023 09:59:16 +0000 (11:59 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 29 Mar 2023 11:55:47 +0000 (13:55 +0200)
commit86efc490ab86bfa00720479b4714da23cd7df797
tree6c2f1d51e1efaf67f8db6ce855fe989921ccc2e5
parentad32fcb8e91ba85cb4676c6249b6adc4b0daf9df
tree-optimization/109331 - make sure to clean up the CFG after forwprop

When forwprop discovers unreachable code or makes decisions based
on unreachable edges make sure to cleanup the CFG since otherwise
SSA form can become invalid.

PR tree-optimization/109331
* tree-ssa-forwprop.cc (pass_forwprop::execute): When we
discover a taken edge make sure to cleanup the CFG.

* gcc.dg/torture/pr109331.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr109331.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.cc