]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix minor fallout of previous changes to aggregate expansion
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 7 Nov 2024 17:50:49 +0000 (18:50 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 18 Nov 2024 14:06:55 +0000 (15:06 +0100)
commit3716d9887c9e4d8533b1a2346ac2025508f76ea4
treedb079c27c6751201be786521cf3b487dedc05ad9
parent6a7849592d442563a799cff35f3b43fd4b828681
ada: Fix minor fallout of previous changes to aggregate expansion

The problem occurs for an anonymous array object declared with an aspect and
when pragma {Initialize,Normalize}_Scalars is in effect: in this case, the
synthesized aggregate is attached to the Initialization_Statements field by
Convert_Aggr_In_Object_Decl, but Explode_Initialization_Compound_Statement
puts it back at the point of declaration instead of the freeze point, thus
voiding the effects of the mechanism.

This was previously hidden because of a bypass in Freeze_Entity which drops
the freeze node on the floor in this case, so the change fixes the issue and
removes the bypass in the process.

gcc/ada/ChangeLog:

* freeze.ads (Explode_Initialization_Compound_Statement): Adjust the
description.
* freeze.adb (Explode_Initialization_Compound_Statement): If the
entity has its freezing delayed, append the initialization actions
to its freeze actions.
(Freeze_Object_Declaration): Remove commented out code.
(Freeze_Entity): Remove bypass for object of anonymous array type.
gcc/ada/freeze.adb
gcc/ada/freeze.ads