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

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

https://gcc.gnu.org/g:96d5e25082f4178f043e001613b2759e4e3cda9e

commit r16-9585-g96d5e25082f4178f043e001613b2759e4e3cda9e
Author: Eric Botcazou <[email protected]>
Date:   Mon Aug 24 16:38:40 2026 +0200

    Ada: Fix missing sliding for assignment of aggregate to unconstrained
formal

    This is a recent regression present on the mainline, 16 and 15 branches.
    The compiler fails to implement the needed sliding when an array aggregate
    with specified bounds is assigned to an unconstrained formal parameter,
    because the Must_Slide predicate considers only the case of an object
    declaration when the object subtype is unconstrained.

    gcc/ada/
            PR ada/127026
            * exp_aggr.adb (Must_Slide): Reorder parameters, rename Obj_Type to
            Ob_Typ and add Assign boolean parameter.  Return Assign's value in
            the case where Obj_Typ is unconstrained.
            (Build_Array_Aggr_Code): Adjust call to Must_Slide.
            (In_Place_Assign_OK): Likewise.
            (Expand_Array_Aggregate): Likewise.

    gcc/testsuite/
            * gnat.dg/array43.adb: New test.

Reply via email to