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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:6f777c34c9f221a50d0fc22b70b1cf7dd1fd9101

commit r16-7574-g6f777c34c9f221a50d0fc22b70b1cf7dd1fd9101
Author: Andrew Pinski <[email protected]>
Date:   Tue Feb 17 21:42:30 2026 -0800

    cprop_hardreg: Use delete_insn_and_edges instead of delete_insn [PR116053]

    So delete_insn_and_edges was added explicitly to solve the problem of
having
    to cleanup the dead eh edges when a load becomes dead (non-trapping in this
case).
    This moves the one call to delete_insn in cprop_hardreg over to use
delete_insn_and_edges
    to fix this case.
    Basically we copyprop the sp register into a memory load. This memory load
is normally
    dead way before but with non-call eh and -fno-delete-dead-exceptions, it is
alive until
    cprop_hardreg. After thie copy prop of the sp register into the memory
address of the load,
    the load becomes non-trapping and is allowed to be deleted. Except we don't
remove the eh edges
    because cprop_hardreg only called delete_insn. So this updates the call to
delete_insn_and_edges
    which removes the eh edges.

    Bootstrapped and tested on x86_64-linux-gnu with no regressions.

            PR rtl-optimization/116053

    gcc/ChangeLog:

            * regcprop.cc (copyprop_hardreg_forward_1): Use
delete_insn_and_edges
            instead of delete_insn.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr116053-1.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to