diff options
author | Marc Poulhiès <poulhies@adacore.com> | 2022-06-02 09:52:21 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-06 13:29:48 +0000 |
commit | 3202e9f88fd286a8fc4814abeaa2238d70f4d585 (patch) | |
tree | bd5a0f263e62a5019093bc0d0911062ab4b66cc5 /gcc/tree-streamer.cc | |
parent | b65a875a7c1a728ddb5d58fb97777394a6f773e2 (diff) | |
download | gcc-3202e9f88fd286a8fc4814abeaa2238d70f4d585.zip gcc-3202e9f88fd286a8fc4814abeaa2238d70f4d585.tar.gz gcc-3202e9f88fd286a8fc4814abeaa2238d70f4d585.tar.bz2 |
[Ada] Handle secondary stack memory allocations alignment
To accomodate cases where objects allocated on the secondary stack
needed a more constrained alignement than Standard'Maximum_Alignement,
the alignment for all allocations in the full runtime were forced on to
be aligned on Standard'Maximum_Alignement*2. This changes removes this
workaround and correctly handles the over-alignment in all runtimes.
This change modifies the SS_Allocate procedure to accept a new Alignment
parameter and to dynamically realign the pointer returned by the memory
allocation (Allocate_* functions or dedicated stack allocations for
zfp/cert).
It also simplifies the 0-sized allocations by not allocating any memory
if pointer is already correctly aligned (already the case in cert and
zfp runtimes).
gcc/ada/
* libgnat/s-secsta.ads (SS_Allocate): Add new Alignment
parameter.
(Memory_Alignment): Remove.
* libgnat/s-secsta.adb (Align_Addr): New.
(SS_Allocate): Add new Alignment parameter. Realign pointer if
needed. Don't allocate anything for 0-sized allocations.
* gcc-interface/utils2.cc (build_call_alloc_dealloc_proc): Add
allocated object's alignment as last parameter to allocation
invocation.
Diffstat (limited to 'gcc/tree-streamer.cc')
0 files changed, 0 insertions, 0 deletions