[Ada] Additional fixes for Default_Initial_Condition
Pierre-Marie de Rodat
derodat@adacore.com
Mon Dec 14 15:56:03 GMT 2020
After the recent implementation work for the Default_Initial_Condition
aspect there were still some cases where DIC checks weren't performed
properly with respect to calls to Initialize in the case of array and
record components of controlled types. That is now corrected. There was
also an issue of Output_Verification_Call getting called on partial DIC
procedures, when it should only be applied to the main DIC procedure
of a type, which could result in extraneous warnings, and that is also
corrected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_aggr.adb (Build_Array_Aggr_Code.Gen_Assign): Move
generation of the call for DIC check past the optional
generation of calls to controlled Initialize procedures.
* exp_ch3.adb
(Build_Array_Init_Proc.Init_One_Dimension.Possible_DIC_Call):
Suppress generation of a DIC call when the array component type
is controlled. The call will now be generated later inside the
array's DI (Deep_Initialize) procedure.
* exp_ch7.adb
(Make_Deep_Array_Body.Build_Initialize_Statements): Generate a
DIC call (when needed by the array component type) after any
call to the component type's controlled Initialize procedure, or
generate the DIC call by itself if there's no Initialize to
call.
* sem_aggr.adb (Resolve_Record_Aggregate.Add_Association):
Simplify condition to only test Is_Box_Init_By_Default (previous
condition was overkill, as well as incorrect in some cases).
* sem_elab.adb (Active_Scenarios.Output_Call): For
Default_Initial_Condition, suppress call to
Output_Verification_Call when the subprogram is a partial DIC
procedure.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 7321 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201214/ae80dac8/attachment-0001.bin>
More information about the Gcc-patches
mailing list