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

--- Comment #22 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:b9c4b9e9f968585a0d6e9dda4e54ef21085797eb

commit r16-7697-gb9c4b9e9f968585a0d6e9dda4e54ef21085797eb
Author: Andrew Pinski <[email protected]>
Date:   Sat Feb 21 16:43:53 2026 -0800

    fn-split: Move clobbers from the old exit bb to new call block after the
call [PR110091]

    After outlinining the bbs for function splitting, we move the clobbers that
were in the
    last bb to be after the newly calling function.
    This allows for stack location sharing and more when the non split out part
is inlined
    into another function.

    This also fixes some of the warnings about dangling-pointers because
    the clobbers are now correctly handled while function splitting.
    The testcases test for the cases where the dangling-pointers pointer
    warnings would show up too.

    Note only end of storage clobbers in this case.

    Changes since v1:
     * v2: Add comments and add a call to unlink_stmt_vdef/release_ssa_name.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/110091

    gcc/ChangeLog:

            * ipa-split.cc (split_function): Find the bb
            which is used for return in the outlined function.
            Move the clobbers that are at the end of that bb
            to be after the new call.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/pr110091-3.c: New test.
            * gcc.dg/tree-ssa/pr110091-4.c: New test.

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

Reply via email to