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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kyrylo Tkachov <[email protected]>:

https://gcc.gnu.org/g:9aab80ddc5b2fa0eef80008e718067ab45f42c50

commit r17-2386-g9aab80ddc5b2fa0eef80008e718067ab45f42c50
Author: Kyrylo Tkachov <[email protected]>
Date:   Tue Jul 7 03:24:44 2026 -0700

    out-of-SSA: use the spill predicate for partition decls [PR123625,
PR121957]

    Changes in v2:
    - Match the exact expansion spill predicate instead of using BLKmode.
    - Add a non-BLKmode -ffloat-store regression.

    Out-of-SSA can leave several partitions sharing one base VAR_DECL when its
    SSA versions have overlapping live ranges.  If those partitions are
spilled,
    set_mem_attributes gives every stack slot the same MEM_EXPR at offset zero.
    MEM_EXPR-based disambiguation can then combine accesses from distinct
slots.

    Split the overlapping partitions after TER, using the same
    use_register_for_decl predicate as expansion rather than approximating the
    memory decision with BLKmode.  Keep the default-definition partition tied
to
    the original decl and give the other partitions artificial decls with debug
    expressions referring back to it.

    Bootstrapped and tested on aarch64-none-linux-gnu and x86_64-linux.

    gcc/ChangeLog:

            PR target/123625
            PR target/121957
            * tree-outof-ssa.cc (split_overlapping_partition_decls): New
function.
            Use use_register_for_decl to identify memory partitions.
            (remove_ssa_form): Call split_overlapping_partition_decls.

    gcc/testsuite/ChangeLog:

            PR target/123625
            PR target/121957
            * gcc.c-torture/execute/pr121957.c: New test.
            * gcc.c-torture/execute/pr123625.c: New test.
            * gcc.c-torture/execute/pr123625-2.c: New test.
            * gcc.c-torture/execute/pr123625-3.c: New test.
            * gcc.dg/pr123625-1.c: New test.

    Signed-off-by: Kyrylo Tkachov <[email protected]>

Reply via email to