]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix alignment violation for mix of aligned and misaligned composite types
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 26 May 2025 07:25:57 +0000 (09:25 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Jul 2025 09:49:59 +0000 (11:49 +0200)
commit22b8806a627d83ccd65dd84668098c954d1f9597
tree488798a24f42692b22a3a9a1e59dbfbca614e9e5
parentaa622ab8239cd5b957c1dd0ad777dcef13387252
ada: Fix alignment violation for mix of aligned and misaligned composite types

This happens when the chain of initialization procedures is called on the
subcomponents and causes the creation of temporaries along the way out of
alignment considerations.  Now these temporaries are not necessary in the
context and were not created until recently, so this gets rid of them.

gcc/ada/ChangeLog:

* gcc-interface/trans.cc (addressable_p): Add COMPG third parameter.
<COMPONENT_REF>: Do not return true out of alignment considerations
for non-strict-alignment targets if COMPG is set.
(Call_to_gnu): Pass true as COMPG in the call to the addressable_p
predicate if the called subprogram is an initialization procedure.
gcc/ada/gcc-interface/trans.cc