https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117919

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Filip Kastl <phe...@gcc.gnu.org>:

https://gcc.gnu.org/g:5349aa2accdf34a7bf9cabd1447878aaadfc0e87

commit r15-7779-g5349aa2accdf34a7bf9cabd1447878aaadfc0e87
Author: Filip Kastl <fka...@suse.cz>
Date:   Sun Mar 2 06:39:17 2025 +0100

    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 <fka...@suse.cz>

Reply via email to