]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Do not compute Has_Controlled_Component twice during freezing
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 14 May 2024 20:06:17 +0000 (22:06 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 20 Jun 2024 08:50:51 +0000 (10:50 +0200)
commit2e28085cc3ec07dbf897c9b9f5c64a68cddd3d14
tree190e44be30d62ce0dd9ddfb04c587976febec5da
parentcfd7b02a0ca102e12bc7233a45834683b0b247e6
ada: Do not compute Has_Controlled_Component twice during freezing

The Has_Controlled_Component flag is computed twice during freezing when
expansion is enabled: in Freeze_Array_Type and Expand_Freeze_Array_Type
for array types, and in Freeze_Record_Type and Expand_Freeze_Record_Type
for record types.

This removes the latter computation in both cases, as well as moves the
computation of concurrent flags from the latter to the former places, which
happens to plug a loophole in the detection of errors when the No_Task_Parts
aspect is specified on peculiar types.

gcc/ada/

* exp_ch3.adb (Expand_Freeze_Array_Type): Do not propagate the
concurrent flags and the Has_Controlled_Component flag here.
(Expand_Freeze_Record_Type): Likewise.
* freeze.adb (Freeze_Array_Type): Propagate the concurrent flags.
(Freeze_Record_Type): Likewise.
* sem_util.adb (Has_Some_Controlled_Component): Adjust comment.
gcc/ada/exp_ch3.adb
gcc/ada/freeze.adb
gcc/ada/sem_util.adb