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

--- Comment #8 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:018b668dd3e888632495edf39406cb043f069a0d

commit r16-9426-g018b668dd3e888632495edf39406cb043f069a0d
Author: Kyrylo Tkachov <[email protected]>
Date:   Sun Jul 26 05:58:25 2026 -0700

    out-of-SSA: Split partitions of parameters and results too [PR126405]

    split_overlapping_partition_decls left PARM_DECLs and RESULT_DECLs alone,
on
    the grounds that they need a single partition holding the canonical RTL. 
That
    partition is the one of the default definition, which the rule already in
place
    keeps, so the exclusion was wider than it needed to be.

    A parameter that stays live across a redefinition of itself needs two
    partitions, and an oversized vector parameter puts both of them in memory:
the
    incoming argument slot and a local slot.  Every name of both partitions has
the
    PARM_DECL as its base, so both slots are given it as their MEM_EXPR:

      (mem/c:V2DI (reg/v/f:DI 126) [1 p+0 S16 A128])
      (mem/c:V2DI (plus:DI (reg/f:DI 96 virtual-stack-vars)
                           (const_int -128)) [1 p+0 S16 A128])

    Two addresses claiming to be p+0 let the load/store pair-fusion pass fuse
    accesses that belong to different slots, which miscompiles the new test on
    aarch64 at -Os.

    Drop the exclusion.  SSA_NAME_VAR is a VAR_DECL, a PARM_DECL or a
RESULT_DECL
    and set_rtl attaches any of them, so all three need the same treatment. 
The
    rename leaves default definitions alone, so the partition holding one still
    owns the canonical RTL.

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

    gcc/ChangeLog:

            PR middle-end/126405
            * tree-outof-ssa.cc (split_overlapping_partition_decls): Also split
            partitions of PARM_DECLs and RESULT_DECLs.

    gcc/testsuite/ChangeLog:

            PR middle-end/126405
            * gcc.c-torture/execute/pr126405-3.c: New test.

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

Reply via email to