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

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

https://gcc.gnu.org/g:22dc1d1b10712141447e0b422bfbe8b52c834e44

commit r17-3600-g22dc1d1b10712141447e0b422bfbe8b52c834e44
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