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

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

https://gcc.gnu.org/g:06f9f3e43ce19f5882e180a3e5c1373a016d29e4

commit r16-9386-g06f9f3e43ce19f5882e180a3e5c1373a016d29e4
Author: Kyrylo Tkachov <[email protected]>
Date:   Tue Jul 21 02:44:06 2026 -0700

    out-of-SSA: Preserve storage for split partition decls [PR126341]

    create_tmp_var_raw marks a replacement declaration as ignored.  At -O0,
    this can change use_register_for_decl from memory for the original user
    declaration to a pseudo for the replacement.  A partition can already own
    memory from a parameter default definition, which then makes set_rtl reject
    that memory for another name in the partition.

    If the replacement would use a register, copy DECL_IGNORED_P so it keeps
the
    storage choice made during coalescing.  Keep declarations that already use
    memory unchanged.  Add a checking assertion for the memory invariant.

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

    gcc/ChangeLog:

            PR middle-end/126341
            * tree-outof-ssa.cc (split_overlapping_partition_decls): Preserve
            DECL_IGNORED_P.  Check that the replacement uses memory.

    gcc/testsuite/ChangeLog:

            PR middle-end/126341
            * gcc.dg/pr126341.c: New test.

    Signed-off-by: Kyrylo Tkachov <[email protected]>
    (cherry picked from commit 7459f9136500bfb881902834d56fb110b77909f2)

Reply via email to