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

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

https://gcc.gnu.org/g:7dc00168e69d1654c0f8dbb605a5ce2f72be8c24

commit r17-1171-g7dc00168e69d1654c0f8dbb605a5ce2f72be8c24
Author: Eric Botcazou <[email protected]>
Date:   Tue Mar 31 11:48:11 2026 +0200

    ada: Implement AI12-0331 Binding Interpretation

    The Binding Interpretation defines the order of the four steps that occur
    during the finalization of subpools. The order was previously unspecified
    but the AI mentions that there was no real leeway, i.e. that there was a
    unique possible order; however it turns out that GNAT implements another
    order, which therefore needs to be changed.

    Moreover GNAT's implementation is unnecessarily convoluted: 1) it uses a
    circular doubly-linked list with a fake head to implement the subpools,
    but the subpools have a pointer to the owner of the list, so a simple
    doubly-linked list is sufficient and 2) it allocates special nodes on
    the heap to chain the subpools onto the list, which is a bit awkward.

    gcc/ada/ChangeLog:

            PR ada/124143
            * libgnat/s-spsufi.ads (Finalize_And_Deallocate): Adjust comment.
            * libgnat/s-spsufi.adb: Remove clause for
Ada.Unchecked_Deallocation
            (Finalize_And_Deallocate): Adjust and implement AI12-0331.
            * libgnat/s-stposu.ads (Allocate_From_Subpool): Remove ??? comment.
            (Deallocate_Subpool): Likewise.
            (SP_Node): Delete.
            (SP_Node_Ptr): Likewise.
            (Root_Storage_Pool_With_Subpools): Adjust type of Subpools
component
            (Root_Subpool): Remove Node, add Prev and Next components.
            (Detach): Adjust signature.
            (Initialize): Delete.
            (Initialize_Pool): Likewise.
            * libgnat/s-stposu.adb (Allocate_Any_Controlled): Adjust.
            (Attach): Reimplement.
            (Detach): Likewise.
            (Finalize_Pool): Loop over a simple doubly linked list.
            (Initialize): Delete.
            (Initialize_Pool): Likewise.
            (Print_Pool): Adjust.
            (Print_Subpool): Likewise.
            (Set_Pool_Of_Subpool): Remove obsolete code.
  • [Bug ada/124143] implement AI12... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to