diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-09-05 00:19:25 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-10-08 10:37:12 +0200 |
commit | 45131b851522180c532bebb3521865e488025af0 (patch) | |
tree | 3f4da2b0c854cef05d10a69d843f70c8a48d3c1f /libcpp | |
parent | b4629ccf3c15b7eafe73beb8b4393419b9968e82 (diff) | |
download | gcc-45131b851522180c532bebb3521865e488025af0.zip gcc-45131b851522180c532bebb3521865e488025af0.tar.gz gcc-45131b851522180c532bebb3521865e488025af0.tar.bz2 |
ada: Fix wrong finalization of anonymous array aggregate
The issue arises when the aggregate consists only of iterated associations
because, in this case, its expansion uses a 2-pass mechanism which creates
a temporary that needs a fully-fledged initialization, thus running afoul
of the optimization that avoids building the initialization procedure in
the anonymous array case.
gcc/ada/ChangeLog:
* exp_aggr.ads (Is_Two_Pass_Aggregate): New function declaration.
* exp_aggr.adb (Is_Two_Pass_Aggregate): New function body.
(Expand_Array_Aggregate): Call Is_Two_Pass_Aggregate to detect the
aggregates that need the 2-pass expansion.
* exp_ch3.adb (Expand_Freeze_Array_Type): In the anonymous array
case, build the initialization procedure if the initial value in
the object declaration is a 2-pass aggregate.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions