gnu /
gcc /
6ffbc711afbda9446df51fd2b542ecd61853283d gimple: sccopy: Prune removed statements from SCCs [PR117919]
While writing the sccopy pass I didn't realize that 'replace_uses_by ()' can
remove portions of the CFG. This happens when replacing arguments of some
statement results in the removal of an EH edge. Because of this sccopy can
then work with GIMPLE statements that aren't part of the IR anymore. In
PR117919 this triggered an assertion within the pass which assumes that
statements the pass works with are reachable.
This patch tells the pass to notice when a statement isn't in the IR anymore
and remove it from it's worklist.
PR tree-optimization/117919
gcc/ChangeLog:
* gimple-ssa-sccopy.cc (scc_copy_prop::propagate): Prune
statements that 'replace_uses_by ()' removed.
gcc/testsuite/ChangeLog:
* g++.dg/pr117919.C: New test.
Signed-off-by: Filip Kastl <fkastl@suse.cz>
(cherry picked from commit 5349aa2accdf34a7bf9cabd1447878aaadfc0e87)
2 files changed