snames.adb-tmpl
20.5 KB
-
[Ada] Aspect/pragma Secondary_Stack_Size can evaluate non-literals as zero · a40d9947
This patch fixes the problem of aspect/pragma Secondary_Stack_Size expressions with non-literals evaluating as zero in static secondary stacks allocations. The aspect Secondary_Stack_Size is now converted to a pragma instead of an attribute as the attribute does not have visibility on the discriminant. Additionally, the discriminant of the corresponding record type is now referenced if the pragma expression contains a discriminant. No simple test available as the problem only impacts programs when System.Parameters.Sec_Stack_Dynamic = False 2018-01-11 Patrick Bernardi <bernardi@adacore.com> gcc/ada/ * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified Secondary_Stack_Size handling as a pragma is now generated for the corresponding aspect instead of an attribute. Pragma expression is relocated instead of evaluated. Discriminant of the corresponding record type is referenced rather than the type discriminant. (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update Secondary_Stack_Size rep item checks to only look for the pragma rep. * sem_ch13.adb (Analyze_One_Aspect): Transform Aspect_Secondary_Stack_Size into a pragma instead of an attribute because the attribute does not have visibility on a task type's discriminants when the type's definition is expanded. (Analyze_Attribute_Definition_Clause): Remove handling of Attribute_Secondary_Stack_Size. * snames.adb-tmpl, snames.ads-tmpl: Remove Attribute_Secondary_Stack_Size, no longer used. From-SVN: r256488
Patrick Bernardi committed