set latest crate of the year link
Before yesterdayChange logs
ada: TSS finalize address subprogram generation for constrained... ...subtypes of unconstrained synchronized private extensions should take care to designate the corresponding record of the underlying concurrent type. When generating TSS finalize address subprograms for class-wide types of constrained root types, it follows the parent chain looking for the first "non-constrained" type. It is possible that such a type is a private extension with the “synchronized” keyword, in which case the underlying type is a concurrent type. When that happens, the designated type of the finalize address subprogram should be the corresponding record’s class-wide-type. gcc/ada/ChangeLog: * exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Expanded comments explaining why TSS Finalize_Address is not generated for concurrent class-wide types. * exp_ch7.adb (Make_Finalize_Address_Stmts): Handle cases where the underlying non-constrained parent type is a concurrent type, and adjust the designated type to be the corresponding record’s class-wide type. gcc/testsuite/ChangeLog: * gnat.dg/sync_tag_finalize.adb: New test. Signed-off-by: Richard Wai <[email protected]>
ada: Refine upper array bound for bit packed array When using bit-packed arrays, the compiler creates new array subtypes of 1-bit component indexed by integers. The existing routine checks the index subtype to find the min/max values. Bit-packed arrays being indexed by integers, the routines gives up as returning the maximum possible integer carries no useful information. This change adds a simple max_value routine that can evaluate very simple expressions by substituting variables by their min/max value. Bit-packed array subtypes are currently declared as: subtype bp_array is packed_bytes1 (0 .. integer((1 * Var + 7) / 8 - 1)); The simple max_value evaluator handles the bare minimum for this expression pattern. gcc/ada/ChangeLog: * gcc-interface/utils.cc (max_value): New. * gcc-interface/gigi.h (max_value): New. * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Subtype>: When computing gnu_min/gnu_max, try to use max_value if there is an initial expression.
ada: Private extensions with the keyword "synchronized" are always limited. GNAT was relying on synchronized private type extensions deriving from a concurrent interface to determine its limitedness. This does not cover the case where such an extension derives a limited interface. RM-7.6(6/2) makes is clear that "synchronized" in a private extension implies the derived type is limited. GNAT should explicitly check for the presence of "synchronized" in a private extension declaration, and it should have the same effect as the presence of “limited”. gcc/ada/ChangeLog: * sem_ch3.adb (Build_Derived_Record_Type): Treat presence of keyword "synchronized" the same as "limited" when determining if a private extension is limited. gcc/testsuite/ChangeLog: * gnat.dg/sync_tag_discriminals.adb: New test. * gnat.dg/sync_tag_limited.adb: New test. Signed-off-by: Richard Wai <[email protected]>
ada: Explicitly analyze and expand null array aggregates Null array aggregates have present but empty lists of expressions and component associations. This confuses the previous code for ordinary array aggregates, which assumes that if a list of either expressions or component associations is present, then it is non-empty. This patch adds explicit handling for null array aggregates to avoid assertion failures in code for ordinary array aggregates. gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code): Don't build aggregate code for null array aggregates. * sem_aggr.adb (Resolve_Array_Aggregate): Don't examine formatting of a null array aggregate.
ada: Fix wrong optimization of extended return for discriminated record type This happens when the discriminants of the record type have default values. gcc/ada/ChangeLog: * inline.adb (Expand_Inlined_Call): In the case of a function call that returns an unconstrained type and initializes an object, set the No_Initialization flag on the new declaration of the object.
ada: Fix internal error on misaligned component with variable nominal size The back-end cannot handle this kind of components even when they are small. gcc/ada/ * exp_util.adb (Component_May_Be_Bit_Aligned): Do not return false for a small component of a record type with a variant part.
ada: Remove GNAT Pro details regarding mold gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove extended discussion regarding mold run-time dependencies; packaging changes in GNAT Pro have made them obsolete.
ada: Fix internal error on aggregate nested in container aggregate This handles the case where a component association is present. gcc/ada/ * exp_aggr.adb (Convert_To_Assignments): In the case of a component association, call Is_Container_Aggregate on the parent's parent. (Expand_Array_Aggregate): Likewise.
ada: Clean up scope depth and related code (tech debt) The main point of this patch is to remove the special case for Atree.F_Scope_Depth_Value in the Assert that Field_Present in Get_Field_Value. Pulling on that thread leads to lots of related cleanup. gcc/ada/ChangeLog: * atree.adb (Node_Kind_Table): Specify parameter explicitly in GNAT.Table instantiations. Use fully qualified references instead of relying on use clauses. (Get_Field_Value): Remove special case for F_Scope_Depth_Value. That is, enable the Field_Present check in that case. (It was already enabled for all other fields.) Violations of this check were already fixed. (Print_Node_Statistics): Sort the output in decreasing order of frequencies. (Print_Field_Statistics): Likewise (sort). * accessibility.adb (Accessibility_Level): Pass Allow_Alt_Model in recursive calls. Apparently, an oversight. (Innermost_Master_Scope_Depth): Need to special-case the 'Old attribute and allocators. * einfo-utils.ads (Scope_Depth): Use Scope_Kind_Id to get predicate checks. (Scope_Depth_Set): Likewise. (Scope_Depth_Default_0): Likewise. * einfo-utils.adb: As for spec. * frontend.adb (Frontend): Remove unnecessary "return;". * gen_il-types.ads (Scope_Kind): New union type. * gen_il-gen-gen_entities.adb (Scope_Kind): New union type. * sem.ads: Move "with Einfo.Entities;" from body to spec. (Scope_Stack_Entry): Declare Entity to be of Scope_Kind_Id to get predicate checks. We had previously been putting non-scopes on the scope stack; this prevents such anomalies. * sem.adb: Move "with Einfo.Entities;" from body to spec. * sem_ch8.ads: Move "with Einfo.Entities;" from body to spec. Add "with Types;". (Push_Scope): Use Scope_Kind_Id to get predicate checks. * sem_ch8.adb: Move "with Einfo.Entities;" from body to spec. Add "with Types;". (Push_Scope): Use Scope_Kind_Id to get predicate checks. (Pop_Scope): Use Scope_Kind_Id on popped entity to get predicate checks. This prevents anomalies where a scope pushed onto the stack is later mutated to a nonscope before being popped. * sem_util.ads (Find_Enclosing_Scope): Add postcondition to ensure that the enclosing scope of a node N is not the same node N. Clearly, N does not enclose itself. * sem_util.adb (Find_Enclosing_Scope): There were several bugs where Find_Enclosing_Scope(N) = N. For example, if N is an entity, then we would typically go up to its declaration, and then back down to the Defining_Entity of the declaration, which is N itself. There were other cases where Find_Enclosing_Scope of an entity disagreed with Scope. Clearly, Find_Enclosing_Scope and Scope should agree (when both are defined). Such bugs caused latent bugs in accessibility.adb related to 'Old, and fixing bugs here caused such bugs to be revealed. These are fixed by calling Scope when N is an entity. Co-authored-by: Ronan Desplanques <[email protected]>
- [DBH] gcc/ada/accessibility.adb
- [DBH] gcc/ada/atree.adb
- [DBH] gcc/ada/einfo-utils.adb
- [DBH] gcc/ada/einfo-utils.ads
- [DBH] gcc/ada/frontend.adb
- [DBH] gcc/ada/gen_il-gen-gen_entities.adb
- [DBH] gcc/ada/gen_il-types.ads
- [DBH] gcc/ada/sem.adb
- [DBH] gcc/ada/sem.ads
- [DBH] gcc/ada/sem_ch8.adb
- [DBH] gcc/ada/sem_ch8.ads
- [DBH] gcc/ada/sem_util.adb
- [DBH] gcc/ada/sem_util.ads
ada: Fix internal error on expression function with Refined_Post aspect This occurs when the expression function calls a protected function and the -gnata switch is specified, because the compiler wrongly freezes the called function when analyzing the expression function, a fallout of the wrapping scheme used for the Post and Refined_Post aspects. gcc/ada/ * sem_res.adb (Resolve_Call): When the target is an entity, do not freeze it if the current scope is the inner wrapper function built for an expression function with a Post or Refined_Post aspect.
ada: Crash on creation of extra formals on type extension Revert previous patch and fix the pending issue. gcc/ada/ * accessibility.ads (Needs_Result_Accessibility_Extra_Formal): Removed. * accessibility.adb (Needs_Result_Accessibility_Level_Param): Removed. (Needs_Result_Accessibility_Extra_Formal): Removed. (Needs_Result_Accessibility_Level): Revert previous patch. * sem_ch6.adb (Parent_Subprogram): Handle function overriding an enumeration literal. (Create_Extra_Formals): Ensure that the parent subprogram has all its extra formals.
ada: Generate runtime restrictions list when the standard library is suppressed With the introduction of Jorvik support into the light-tasking runtime comes the requirement to detect voliations of runtime restrictions (for example Max_Entry_Queue_Length) where previously they could be hard coded in the runtime. This means we now need the binder to populate System.System.Restrictions.Run_Time_Restrictions when the standard library is suppressed. gcc/ada/ * bindgen.adb (Gen_Adainit): Generate restrictions when standard library is suppressed. (Gen_Output_File_Ada): Ditto. (Gen_Restrictions): Ditto.
ada: Do not perform local-exception-to-goto optimization on barrier functions The local-exception-to-goto optimization is no longer applied to entry barrier functions as entry barriers cannot contain exception handlers and this optimization interferes with another optimization that occurs for simple barrier functions. In particular, the simple barrier optimization removes the push error label statements generated by the local-exception-to-goto optimization. This causes a Storage_Error in GIGI when the restriction No_Exception_Propagation is active and a protected object contains more than one simple entry barrier. gcc/ada/ * exp_ch6.adb (Expand_N_Subprogram_Body): Do not perform local-exception-to- goto optimization on barrier functions. * exp_ch9.adb (Expand_Entry_Barrier): Simplify the if statement around the simple barrier optimization and remove an old, no longer relevant comment.