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

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

https://gcc.gnu.org/g:19b33d2388a7a3df194297e7941f02baafcc6777

commit r15-10745-g19b33d2388a7a3df194297e7941f02baafcc6777
Author: Eric Botcazou <[email protected]>
Date:   Wed Jan 28 23:31:49 2026 +0100

    Ada: Fix stack corruption with concatenation and 'Image of composite type

    The issue is that the expansion of 'Image for composite types is
heavyweight
    and involves a mix of Expression_With_Actions and controlled object that
    does not work properly when it is the argument of a call to a subprogram,
    so this replaces it by the canonical scheme used for controlled
temporaries.

    gcc/ada/
            PR ada/123832
            * exp_imgv.adb: Add with and use clauses for Exp_Ch7.
            (Expand_Image_Attribute): Establish a transient scope before
            rewriting the attribute as a call to Put_Image.
            (Expand_Wide_Image_Attribute): Likewise.
            (Expand_Wide_Wide_Image_Attribute): Likewise.
            * exp_put_image.ads (Build_Image_Call): Add note about the
            need for a transient scope when the function is invoked.
            * exp_put_image.adb (Build_Image_Call): Call Insert_Actions
            to immediately insert the actions instead of wrapping them
            in an Expression_With_Actions node.

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

Reply via email to