aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-02-21 21:48:13 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-16 10:49:29 +0200
commit48068753771507b4e95f746eaf8b0d0135e6c8ef (patch)
treecc0e44eba638bdae6ae3f8073d095009a42fdcbf /gcc/tree-vectorizer.h
parentb98e256652c336160afa47bf8735eb4aa3529135 (diff)
downloadgcc-48068753771507b4e95f746eaf8b0d0135e6c8ef.zip
gcc-48068753771507b4e95f746eaf8b0d0135e6c8ef.tar.gz
gcc-48068753771507b4e95f746eaf8b0d0135e6c8ef.tar.bz2
ada: Fix latent alignment issue for dynamically-allocated controlled objects
Dynamically-allocated controlled objects are attached to a finalization collection by means of a hidden header placed right before the object, which means that the size effectively allocated must naturally account for the size of this header. But the allocation must also account for the alignment of this header in order to have it properly aligned. gcc/ada/ * libgnat/s-finpri.ads (Header_Alignment): New function. (Header_Size): Adjust description. (Master_Node): Put Finalize_Address as first component. (Collection_Node): Likewise. * libgnat/s-finpri.adb (Header_Alignment): New function. (Header_Size): Return the object size in storage units. * libgnat/s-stposu.ads (Adjust_Controlled_Dereference): Replace collection node with header in description. * libgnat/s-stposu.adb (Adjust_Controlled_Dereference): Likewise. (Allocate_Any_Controlled): Likewise. Pass the maximum of the specified alignment and that of the header to the allocator. (Deallocate_Any_Controlled): Likewise to the deallocator.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions