blob: ab7c0f587bb145bb0655c3f2a3a08fa7f402fd87 [file] [log] [blame]
2021-10-25 Arnaud Charlet <>
* gcc-interface/, gcc-interface/ Remove
gnatfind and gnatxref.
2021-10-25 Ed Schonberg <>
* sem_ch4.adb (Has_Possible_Literal_Aspects): If analysis of an
operator node fails to find a possible interpretation, and one
of its operands is a literal or a named number, assign to the
node the corresponding class type (Any_Integer, Any_String,
(Operator_Check): Call it before emitting a type error.
* sem_res.adb (Has_Applicable_User_Defined_Literal): Given a
literal and a type, determine whether the type has a
user_defined aspect that can apply to the literal, and rewrite
the node as call to the corresponding function. Most of the code
was previously in procedure Resolve.
(Try_User_Defined_Literal): Check operands of a predefined
operator that fails to resolve, and apply
Has_Applicable_User_Defined_Literal to literal operands if any,
to find if a conversion will allow the operator to resolve
(Resolve): Call the above when a literal or an operator with a
literal operand fails to resolve.
2021-10-25 Bob Duff <>
* freeze.adb (Freeze_Fixed_Point_Type): Remove
previously-inserted test for Uint_0; no longer needed.
* Improve comments.
* repinfo.adb (Rep_Value): Use Ubool type for B.
* (Node_Ref): Use Unegative type.
(Node_Ref_Or_Val): Document that values of this type can be
* exp_disp.adb (Make_Disp_Requeue_Body): Minor comment fix.
* sem_ch3.adb: Likewise.
* sem_ch8.adb: Likewise.
* sinfo-utils.adb (End_Location): End_Span can never be No_Uint,
so remove the "if No (L)" test.
* uintp.adb (Image_String): Use "for ... of" loop.
* (Unegative): New type for negative integers. We
give it a long name (unlike Unat and Upos) because it is rarely
2021-10-25 Etienne Servais <>
* errout.adb (Skip_Msg_Insertion_Warning): Adapt and format as
(Warn_Insertion): Adapt to new format.
* Update documentation.
* erroutc.adb (Get_Warning_Tag): Adapt to new format.
(Prescan_Message): Introduce Parse_Message_Class function.
(Validate_Specific_Warnings): Update ?W? to ?.w?.
* Update type and documentation.
* checks.adb (Validity_Check_Range): Update ?X? to ?.x?.
* exp_ch11.adb (Possible_Local_Raise): Update ?X? to ?.x?.
(Warn_If_No_Local_Raise): Likewise.
(Warn_If_No_Propagation): Likewise.
(Warn_No_Exception_Propagation_Active): Likewise.
* exp_ch4.adb (Expand_N_Allocator): Attach warning message to
* exp_prag.adb (Expand_Pragma_Check): Update ?A? to ?.a?.
* exp_util.adb (Activate_Atomic_Synchronization): Update ?N? to
(Add_Invariant_Check): Update ?L? to ?.l?.
* freeze.adb (Check_Suspicious_Modulus): Update ?M? to ?.m?.
(Freeze_Entity): Update ?T? to ?.t?, ?Z? to ?.z?.
* par-util.adb (Warn_If_Standard_Redefinition): Update ?K? to
* sem_attr.adb (Min_Max): Update ?U? to ?.u?.
* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Update ?V?
to ?.v?.
(Adjust_Record_For_Reverse_Bit_Order_Ada_95): Update ?V? to ?.v?.
(Component_Size_Case): Update ?S? to ?.s?.
(Analyze_Record_Representation_Clause): Update ?S? to ?.s? and
?C? to ?.c?.
(Add_Call): Update ?L? to ?.l?.
(Component_Order_Check): Attach warning message to -gnatw_r.
(Check_Component_List): Update ?H? to ?.h?.
(Set_Biased): Update ?B? to ?.b?.
* sem_ch3.adb (Modular_Type_Declaration): Update ?M? to ?.m?.
* sem_ch4.adb (Analyze_Mod): Update ?M? to ?.m?.
(Analyze_Quantified_Expression): Update ?T? to ?.t?.
* sem_ch6.adb (Check_Conformance): Attach warning message to
(List_Inherited_Pre_Post_Aspects): Update ?L? to ?.l?.
* sem_ch7.adb (Unit_Requires_Body_Info): Update ?Y? to ?.y?.
* sem_ch8.adb (Analyze_Object_Renaming): Update ?R? to ?.r?.
* sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Attach
warning message to -gnatw_c.
* sem_res.adb (Check_Argument_Order): Update ?P? to ?.p?.
(Resolve_Comparison_Op): Update ?U? to ?.u?.
(Resolve_Range): Update ?U? to ?.u?.
(Resolve_Short_Circuit): Update ?A? to ?.a?.
(Resolve_Unary_Op): Update ?M? to ?.m?.
* sem_util.adb (Check_Result_And_Post_State): Update ?T? to ?.t?.
* sem_warn.adb (Output_Unused_Warnings_Off_Warnings): Update ?W?
to ?.w?.
* Update documentation for -gnatw_c.
2021-10-25 Bob Duff <>
* inline.adb (Establish_Actual_Mapping_For_Inlined_Call): Fix
2021-10-25 Bob Duff <>
* gen_il-gen.adb (Put_Seinfo): Generate type
Seinfo.Type_Only_Enum based on type
Gen_IL.Internals.Type_Only_Enum. Automatically generating a copy
of the type will help keep them in sync. (Note that there are
no Ada compiler packages imported into Gen_IL.) Add a Type_Only
field to Field_Descriptor, so this information is available in
the Ada compiler (as opposed to just in the Gen_IL "compiler").
(One_Comp): Add initialization of the Type_Only field of
* (Image): Image function for
* (Node_To_Fetch_From): New function to compute which
node to fetch from, based on the Type_Only aspect.
* atree.adb (Get_Field_Value): Call Node_To_Fetch_From.
* treepr.adb (Print_Entity_Field): Call Node_To_Fetch_From.
(Print_Node_Field): Assert.
* sinfo-utils.adb (Walk_Sinfo_Fields,
Walk_Sinfo_Fields_Pairwise): Asserts.
2021-10-25 Piotr Trojanek <>
* exp_ch4.adb (Expand_Composite_Equality): Fix style.
(Element_To_Compare): Simplify loop.
(Expand_Record_Equality): Adapt calls to Element_To_Compare.
2021-10-25 Steve Baird <>
* sem_case.adb (Composite_Case_Ops.Box_Value_Required): A new
function which takes a component type and returns a Boolean.
Returns True for the cases which were formerly forbidden as
components (these checks were formerly performed in the
now-deleted procedure
(Composite_Case_Ops.Normalized_Case_Expr_Type): Hoist this
function out of the Array_Case_Ops package because it has been
generalized to also do the analogous thing in the case of a
discriminated type.
(Composite_Case_Ops.Scalar_Part_Count): Return 0 if
Box_Value_Required returns True for the given type/subtype.
Traverse_Discrete_Parts): Return without doing anything if
Box_Value_Required returns True for the given type/subtype.
If Box_Value_Required yields True for a given component type,
then check that the value of that component in a choice
expression is indeed a box (in which case the component is
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
* gnat_rm.texi: Regenerate.
2021-10-25 Piotr Trojanek <>
* libgnat/a-nbnbin__gmp.adb (From_String): Fix predicate
mismatch between subprogram declaration and body.
2021-10-25 Bob Duff <>
* einfo-utils.adb (Declaration_Node): Avoid returning the
following node kinds: N_Assignment_Statement, N_Integer_Literal,
N_Procedure_Call_Statement, N_Subtype_Indication, and
N_Type_Conversion. Assert that the result is in N_Is_Decl or
* gen_il-gen-gen_nodes.adb (N_Is_Decl): Modify to match the
things that Declaration_Node can return.
2021-10-25 Piotr Trojanek <>
* libgnat/ (Super_Length, Super_Element,
Super_Slice): Add Global contracts.
2021-10-25 Piotr Trojanek <>
* exp_ch3.adb (Predefined_Primitive_Bodies): Simplify detection
of existing equality operator.
2021-10-25 Piotr Trojanek <>
* exp_ch3.adb (Predefined_Primitive_Bodies): Remove redundant
conditions related to interface types.
2021-10-25 Piotr Trojanek <>
* adaint.c (__gnat_portable_spawn): Do not expect execv to
return 0.
(__gnat_portable_no_block_spawn): Likewise.
2021-10-25 Ghjuvan Lacambre <>
* sem_ch8.adb (Analyze_Subprogram_Renaming): Set New_S to Empty.
2021-10-25 Piotr Trojanek <>
* libgnat/ (Unbounded_String): Reference is never
* libgnat/a-strunb.adb (Finalize): Copy reference while it needs
to be deallocated.
2021-10-25 Piotr Trojanek <>
* lib-xref.adb (Get_Through_Renamings): Exit loop when an
enumeration literal is found.
2021-10-25 Arnaud Charlet <>
* libgnat/s-widthu.adb: Add pragma Annotate.
2021-10-25 Javier Miranda <>
* sem_ch8.adb (Build_Class_Wide_Wrapper): Previous version split
in two subprograms to factorize its functionality:
Find_Suitable_Candidate, and Build_Class_Wide_Wrapper. These
routines are also placed in the new subprogram
(Handle_Instance_With_Class_Wide_Type): New subprogram that
encapsulates all the code that handles instantiations with
class-wide types.
(Analyze_Subprogram_Renaming): Adjust code to invoke the new
nested subprogram Handle_Instance_With_Class_Wide_Type; adjust
2021-10-25 Bob Duff <>
*, einfo-utils.adb (Alias, Set_Alias,
Renamed_Entity, Set_Renamed_Entity, Renamed_Object,
Set_Renamed_Object): Add assertions that reflect how these are
supposed to be used and what they are supposed to return.
(Renamed_Entity_Or_Object): New getter.
(Set_Renamed_Object_Of_Possibly_Void): Setter that allows N to
be E_Void.
* checks.adb (Ensure_Valid): Use Renamed_Entity_Or_Object
because this is called for both cases.
* exp_dbug.adb (Debug_Renaming_Declaration): Use
Renamed_Entity_Or_Object because this is called for both cases.
Add assertions.
* exp_util.adb (Possible_Bit_Aligned_Component): Likewise.
* freeze.adb (Freeze_All_Ent): Likewise.
* sem_ch5.adb (Within_Function): Likewise.
* exp_attr.adb (Calculate_Header_Size): Call Renamed_Entity
instead of Renamed_Object.
* exp_ch11.adb (Expand_N_Raise_Statement): Likewise.
* repinfo.adb (Find_Declaration): Likewise.
* sem_ch10.adb (Same_Unit, Process_Spec_Clauses,
Analyze_With_Clause, Install_Parents): Likewise.
* sem_ch12.adb (Build_Local_Package, Needs_Body_Instantiated,
Build_Subprogram_Renaming, Check_Formal_Package_Instance,
Check_Generic_Actuals, In_Enclosing_Instance,
Denotes_Formal_Package, Process_Nested_Formal,
Check_Initialized_Types, Map_Formal_Package_Entities,
Restore_Nested_Formal): Likewise.
* sem_ch6.adb (Report_Conflict): Likewise.
* sem_ch8.adb (Analyze_Exception_Renaming,
Analyze_Generic_Renaming, Analyze_Package_Renaming,
Is_Primitive_Operator_In_Use, Declared_In_Actual,
Note_Redundant_Use): Likewise.
* sem_warn.adb (Find_Package_Renaming): Likewise.
* sem_elab.adb (Ultimate_Variable): Call Renamed_Object instead
of Renamed_Entity.
* exp_ch6.adb (Get_Function_Id): Call
Set_Renamed_Object_Of_Possibly_Void, because the defining
identifer is still E_Void at this point.
* sem_util.adb (Function_Call_Or_Allocator_Level): Likewise.
Remove redundant (unreachable) code.
(Is_Object_Renaming, Is_Valid_Renaming): Call Renamed_Object
instead of Renamed_Entity.
(Get_Fullest_View): Call Renamed_Entity instead of
(Copy_Node_With_Replacement): Call
Set_Renamed_Object_Of_Possibly_Void because the defining entity
is sometimes E_Void.
* exp_ch5.adb (Expand_N_Assignment_Statement): Protect a call to
Renamed_Object with Is_Object to avoid assertion failure.
* Minor comment fixes.
* inline.adb: Minor comment fixes.
* Minor comment fixes.
2021-10-25 Arnaud Charlet <>
* sem_ch13.adb (Build_Discrete_Static_Predicate): Remove use of
exception propagation since this code is exercised during the
2021-10-25 Yannick Moy <>
* sem_ch13.adb (Freeze_Entity_Checks): Perform same check on
predicate expression inside pragma as inside aspect.
* sem_util.adb (Is_Current_Instance): Recognize possible
occurrence of subtype as current instance inside the pragma
2021-10-25 Ghjuvan Lacambre <>
* erroutc.adb (Count_Compile_Time_Pragma_Warnings): Don't count
deleted warnings.
2021-10-22 Eric Gallager <>
PR other/102663
* gcc-interface/ Allow dvi-formatted
documentation to be installed.
2021-10-20 Bob Duff <>
* gcc-interface/decl.c (gnat_to_gnu_entity): Remove unnecessary
call to No_Uint_To_0.
2021-10-20 Richard Kenner <>
* exp_unst.adb (Visit_Node, when N_Subprogram_Call): Never treat
instrinsic subprograms as nested.
2021-10-20 Yannick Moy <>
* libgnat/ Mark in SPARK.
* libgnat/ Likewise.
* libgnat/ Likewise.
* libgnat/s-widthu.adb: Add ghost code and a
2021-10-20 Yannick Moy <>
* libgnat/a-nbnbin__ghost.adb (Signed_Conversions,
Unsigned_Conversions): Mark subprograms as not imported.
* libgnat/ Provide a dummy body.
2021-10-20 Eric Botcazou <>
* sem_eval.adb (Eval_Type_Conversion): If the target subtype is
a static floating-point subtype and the result is a real literal,
consider its machine-rounded value to raise Constraint_Error.
(Test_In_Range): Turn local variables into constants.
2021-10-20 Doug Rupp <>
* libgnat/g-io-put__vxworks.adb: Remove (unused)
* libgnat/ Likewise.
* libgnat/ Likewise.
* libgnat/s-thread__ae653.adb: Likewise.
2021-10-20 Eric Botcazou <>
* (Machine_Number): New inline function.
* sem_eval.adb (Machine_Number): New function body implementing
the machine rounding operation specified by RM 4.9(38/2).
(Check_Non_Static_Context): Call Machine_Number and set the
Is_Machine_Number flag consistently on the resulting node.
* sem_attr.adb (Eval_Attribute) <Attribute_Machine>: Likewise.
* checks.adb (Apply_Float_Conversion_Check): Call Machine_Number.
(Round_Machine): Likewise.
2021-10-20 Johannes Kliemann <>
* vxworks7-cert-rtp-link.spec: Add the definition of
2021-10-20 Piotr Trojanek <>
* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject boxes in
record delta aggregates.
2021-10-20 Justin Squirek <>
* sem_ch6.adb (Check_Return_Construct_Accessibility): Modify
generation of accessibility checks to be more consolidated and
get triggered properly in required cases.
* sem_util.adb (Accessibility_Level): Add extra check within
condition to handle aliased formals properly in more cases.
2021-10-20 Justin Squirek <>
* exp_ch7.adb (Make_Final_Call): Detect expanded protected types
and use original protected type in order to calculate
appropriate finalization routine.
2021-10-20 Johannes Kliemann <>
* libgnat/ Add ghost package.
2021-10-20 Piotr Trojanek <>
* sem_aggr.adb (Variant_Depth): Refine type from Integer to
2021-10-20 Bob Duff <>
* Comment improvements. How is a "completely new
node" different from a "new node"? Document default values
corresponding to field types.
* exp_ch7.adb (Process_Tagged_Type_Declaration): Use
higher-level Scope_Depth instead of Scope_Depth_Value. Remove
confusing comment: not clear what a "true" library level package
* uintp.adb (Image_Out): Print No_Uint in a more readable way.
* gen_il-gen.adb, gen_il-gen-gen_entities.adb,
gen_il-gen-gen_nodes.adb, Tighten up the
subtypes of fields whose type is Uint, where possible; use
more-constrained subtypes such as Unat.
* einfo-utils.adb,, exp_attr.adb,
exp_ch3.adb, exp_intr.adb, exp_unst.adb, exp_util.adb,
freeze.adb, repinfo.adb, sem.adb, sem_ch12.adb, sem_ch13.adb,
sem_ch3.adb, sem_ch8.adb, sem_util.adb, sprint.adb, treepr.adb:
No longer use Uint_0 to indicate "unknown" or "not yet known"
for various fields whose type is Uint. Use No_Uint for that,
except in a small number of legacy cases that cause test
failures. Protect many queries of such fields with calls to
Known_... functions. Improve comments.
* exp_aggr.adb: Likewise.
(Is_OK_Aggregate): Check whether Csiz is present.
(Aggr_Assignment_OK_For_Backend): Ensure we do not access an
uninitialized size.
* exp_strm.adb (Build_Elementary_Input_Call,
Build_Elementary_Write_Call): Check whether P_Size is present.
* cstand.adb: Leave Component_Size of Any_Composite unknown.
Similar for RM_Size of Standard_Exception_Type. These should
not be used.
* Comment improvements.
* Minor.
*, gen_il-internals.adb: Minor.
* sinfo-utils.adb: Take advantage of full-coverage rules.
* types.h: Minor.
2021-10-20 Gary Dismukes <>
* sem_ch6.adb: Add with and use of Warnsw.
(Check_Conformance): Report a warning when subtypes or
designated subtypes of formal parameters or result subtypes
denote different declarations between the spec and body of the
(Subprogram_Subtypes_Have_Same_Declaration): New function nested
within Check_Conformance that determines whether two subtype
entities referenced in a subprogram come from the same
declaration. Returns True immediately if the subprogram is in a
generic instantiation, or the subprogram is marked Is_Internal
or is declared in an internal (GNAT library) unit, or GNAT_Mode
is enabled, otherwise compares the nonlimited views of the
entities (or their designated subtypes' nonlimited views in the
anonymous access cases).
(Nonlimited_View_Of_Subtype): New function nested within
function Subprogram_Subtypes_Have_Same_Declaration that returns
Non_Limited_View of a type or subtype that is an incomplete or
class-wide type that comes from a limited of a
package (From_Limited_With is True for the entity), or returns
Full_View when the nonlimited view is an incomplete type.
Otherwise returns the entity passed in.
* (Warn_On_Pedantic_Checks): New warning flag.
(type Warning_Record): New component Warn_On_Pedantic_Checks.
* warnsw.adb (All_Warnings): Set Warn_On_Pedantic_Checks from
parameter Setting.
(Restore_Warnings): Restore the value of the
Warn_On_Pedantic_Checks flag.
(Save_Warnings): Save the value of the Warn_On_Pedantic_Checks
(Set_Underscore_Warning_Switch): Add settings of the
Warn_On_Pedantic flag according to the switch ("-gnatw_p" vs.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
documentation of new switches -gnatw_p and -gnatw_P (warnings
for pedantic checks).
* gnat_ugn.texi: Regenerate.
* usage.adb: Add Warn_On_Pedantic_Checks.
2021-10-20 Piotr Trojanek <>
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Guard
against equality of an uninitialized RM_Size field.
2021-10-20 Eric Botcazou <>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Also propagate an
interface name on an intrinsic subprogram. Remove obsolete comment.
* libgnat/ (Atomic_Load): New generic intrinsic function
(Atomic_Load_8): Rewrite into instantiation.
(Atomic_Load_16): Likewise.
(Atomic_Load_32): Likewise.
(Atomic_Load_64): Likewise.
(Sync_Compare_And_Swap): New generic intrinsic function.
(Sync_Compare_And_Swap_8): Rewrite into instantiation.
(Sync_Compare_And_Swap_16): Likewise.
(Sync_Compare_And_Swap_32): Likewise.
(Sync_Compare_And_Swap_64): Likewise.
(Lock_Free_Read): New generic inline function.
(Lock_Free_Read_8): Rewrite into instantiation.
(Lock_Free_Read_16): Likewise.
(Lock_Free_Read_32): Likewise.
(Lock_Free_Read_64): Likewise.
(Lock_Free_Try_Write): New generic inline function.
(Lock_Free_Try_Write_8): Rewrite into instantiation.
(Lock_Free_Try_Write_16): Likewise.
(Lock_Free_Try_Write_32): Likewise.
(Lock_Free_Try_Write_64): Likewise.
* libgnat/s-atopri.adb (Lock_Free_Read): New function body.
(Lock_Free_Read_8): Delete.
(Lock_Free_Read_16): Likewise.
(Lock_Free_Read_32): Likewise.
(Lock_Free_Read_64): Likewise.
(Lock_Free_Try_Write): New function body.
(Lock_Free_Try_Write_8): Delete.
(Lock_Free_Try_Write_16): Likewise.
(Lock_Free_Try_Write_32): Likewise.
(Lock_Free_Try_Write_64): Likewise.
* libgnat/s-aoinar.adb (Atomic_Fetch_And_Add): Use type-generic GCC
atomic builtin and tidy up implementation.
(Atomic_Fetch_And_Subtract): Likewise.
* libgnat/s-aomoar.adb (Atomic_Fetch_And_Add): Likewise.
(Atomic_Fetch_And_Subtract): Likewise.
* libgnat/s-atopex.adb (Atomic_Exchange): Likewise.
(Atomic_Compare_And_Exchange): Likewise.
2021-10-20 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>:
Replace test on Convention_Intrinsic with Is_Intrinsic_Subprogram.
(gnat_to_gnu_param): Likewise.
(gnat_to_gnu_subprog_type): Likewise.
* gcc-interface/trans.c (elaborate_all_entities_for_package): Ditto.
2021-10-20 Eric Botcazou <>
* (Check_Non_Static_Context): Update documentation.
* sem_eval.adb (In_Any_Integer_Context): Change parameter type,
adjust accordingly and remove unreachable case.
(Eval_Integer_Literal): Consider the node kind throughout and
trim down verbose condition.
2021-10-20 Doug Rupp <>
* Makefile.rtl: Remove references to
* libgnat/ Remove.
* libgnat/ Likewise.
* libgnat/ Likewise.
2021-10-20 Yannick Moy <>
* sem_ch4.adb (Analyze_QUantified_Expression): Issue warning on
conjunct/disjunct sub-expression of the full expression inside a
quantified expression, when it does not reference the quantified
2021-10-20 Marc Poulhiès <>
* checks.adb (Insert_Valid_Check): in case of checked type
conversion, update Typ to match Exp's type and add call to
2021-10-20 Arnaud Charlet <>
PR ada/100486
* sem_prag.adb (Check_Valid_Library_Unit_Pragma): Do not raise an
exception as part of the bootstrap.
2021-10-15 Richard Biener <>
* gcc-interface/misc.c (gnat_post_options): Do not warn
about DBX_DEBUG use here.
2021-10-14 Alexandre Oliva <>
* par-ch10.adb (P_Compilation_Unit): Reenable ada83 library
unit renaming test and error.
2021-10-11 Eric Botcazou <>
* gcc-interface/gigi.h (resolve_atomic_size): Declare.
(list_third): New inline function.
* gcc-interface/decl.c (type_for_atomic_builtin_p): New function.
(resolve_atomic_builtin): Likewise.
(gnat_to_gnu_subprog_type): Perform type resolution for most of
type-generic GCC atomic builtins and give an error for the rest.
* gcc-interface/utils2.c (resolve_atomic_size): Make public.
2021-10-11 Eric Botcazou <>
* gcc-interface/trans.c (gnat_to_gnu) <N_Pop_Constraint_Error_Label>:
Given the warning only if No_Exception_Propagation is active.
<N_Pop_Storage_Error_Label>: Likewise.
<N_Pop_Program_Error_Label>: Likewise.
2021-10-11 Eric Botcazou <>
* gcc-interface/decl.c (promote_object_alignment): Add GNU_SIZE
parameter and use it for the size of the object if not null.
(gnat_to_gnu_entity) <E_Variable>: Perform the automatic alignment
promotion for objects whose nominal subtype is of variable size.
(gnat_to_gnu_field): Adjust call to promote_object_alignment.
2021-10-11 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_param): Strip padding types
only if the size does not change in the process. Rename local
variable and add bypass for initialization procedures.
2021-10-11 Doug Rupp <>
* libgnat/ Fix comments. Remove unused package
(Thread_Body_Exception_Exit): Remove Exception_Occurrence
(ATSD): Declare type locally.
* libgnat/s-thread__ae653.adb: Fix comments. Remove unused
package imports. Remove package references to Stack_Limit
(Install_Handler): Remove.
(Set_Sec_Stack): Likewise.
(Thread_Body_Enter): Remove calls to Install_Handler and
Stack_Limit checking.
(Thread_Body_Exception_Exit): Remove Exception_Occurrence
(Init_RTS): Call local Get_Sec_Stack. Remove call to
Install_Handler. Remove references to accessors for
Get_Sec_Stack and Set_Sec_Stack. Remove OS check.
(Set_Sec_Stack): Remove.
2021-10-11 Piotr Trojanek <>
* exp_ch3.adb (Make_Predefined_Primitive_Specs,
Predefined_Primitive_Bodies): Remove guard with restriction
2021-10-11 Steve Baird <>
* sem_attr.adb (Analyze_Attribute_Old_Result): Permit an
attribute reference inside a compiler-generated _Postconditions
procedure. In this case, Subp_Decl is assigned the declaration
of the enclosing subprogram.
* exp_util.adb (Insert_Actions): When climbing up the tree
looking for an insertion point, do not climb past an
N_Iterated_Component/Element_Association, since this could
result in inserting a reference to a loop parameter at a
location outside of the scope of that loop parameter. On the
other hand, be careful to preserve existing behavior in the case
of an N_Component_Association node.
2021-10-11 Steve Baird <>
* exp_ch6.adb (Can_Fold_Predicate_Call): Do not attempt folding
if there is more than one predicate involved. Recall that
predicate aspect specification are additive, not overriding, and
that there are three different predicate
aspects (Dynamic_Predicate, Static_Predicate, and the
GNAT-defined Predicate aspect). These various ways of
introducing multiple predicates are all checked for. A new
nested function, Augments_Other_Dynamic_Predicate, is
* sem_ch4.adb
(Analyze_Indexed_Component_Form.Process_Function_Call): When
determining whether a name like "X (Some_Discrete_Type)" might
be interpreted as a slice, the answer should be "no" if the
type/subtype name denotes the current instance of type/subtype.
2021-10-11 Patrick Bernardi <>
* libgnarl/ Change sigset_t to an unsigned
2021-10-11 Patrick Bernardi <>
* libgnat/s-parame__rtems.adb: use
_POSIX_Threads_Minimum_stack_size instead of
2021-10-11 Eric Botcazou <>
* fe.h (No_Exception_Propagation_Active): Declare.
* (No_Exception_Propagation_Active): Add WARNING line.
2021-10-11 Piotr Trojanek <>
* sem_ch13.adb (Validate_Unchecked_Conversion): Simplify code
for detecting conversions with Ada.Calendar.Time type and extend
it to similar types in the Ada.Real_Time package.
2021-10-11 Piotr Trojanek <>
* sem_ch10.adb, sem_prag.adb, sem_util.adb: Use
N_Generic_Declaration in membership tests.
2021-10-11 Etienne Servais <>
* ali.adb (Get_Name): Ignore_Spaces is always False.
* bindo-graphs.adb (Set_Is_Existing_Source_Target_Relation): Val
is always True.
* cstand.adb (New_Standard_Entity): New_Node_Kind is always
* exp_ch3.adb (Predef_Stream_Attr_Spec): For_Body is always
* exp_dist.adb (Add_Parameter_To_NVList): RACW_Ctrl is always
* gnatls.adb (Add_Directories): Prepend is always False.
* sem_ch10.adb, (Load_Needed_Body): Do_Analyze is
always True.
* sem_ch3.adb, (Process_Range_Expr_In_Decl):
R_Check_Off is always False.
* sem_elab.adb: (Info_Variable_Reference): Info_Msg is always
False, In_SPARK is always True.
(Set_Is_Traversed_Body, Set_Is_Saved_Construct,
Set_Is_Saved_Relation): Val is always True.
* treepr.adb (Visit_Descendant): No_Indent is always False.
(Print_Node): Fmt does not need such a big scope.
2021-10-11 Etienne Servais <>
* sem_ch4.adb (Analyze_Membership_Op): Finds interpretation for
the case of a membership test with a singleton value in case of
2021-10-11 Patrick Bernardi <>
* Makefile.rtl (VxWorks): Rename s-inmaop__vxworks.adb to
(RTEMS): Use s-inmaop__hwint.adb, s-intman__rtems.adb/s,
* libgnarl/ Remove signals definitions and
replace with Hardware_Interrupts.
* libgnarl/s-inmaop__vxworks.adb: Rename as...
* libgnarl/s-inmaop__hwint.adb: ... this.
* libgnarl/s-interr__hwint.adb: Remove unnecessary comments.
* libgnarl/, libgnarl/s-intman__rtems.adb:
New files.
* libgnarl/s-osinte__rtems.adb: Add RTEMS API bindings.
(Binary_Semaphore_Create, Binary_Semaphore_Delete,
Binary_Semaphore_Obtain, Binary_Semaphore_Release,
Binary_Semaphore_Flush, Interrupt_Connect,
Interrupt_Number_To_Vector): New functions.
* libgnarl/ (Num_HW_Interrupts, Signal):
(NSIG, Interrupt_Range): New.
(Binary_Semaphore_Create, Binary_Semaphore_Delete,
Binary_Semaphore_Obtain, Binary_Semaphore_Release,
Binary_Semaphore_Flush, Interrupt_Connect,
Interrupt_Number_To_Vector): Remove Import pragma.
* libgnarl/s-taprop__rtems.adb: New file.
2021-10-11 Eric Botcazou <>
* exp_fixd.adb (Get_Size_For_Value): New function returning a size
suitable for a non-negative integer value.
(Get_Type_For_Size): New function returning a standard type suitable
for a size.
(Build_Divide): Call both functions to compute the result type, but
make sure to pass a non-negative value to the first.
(Build_Multiply): Likewise.
(Do_Multiply_Fixed_Universal): Minor consistency tweak.
(Integer_Literal): Call both functions to compute the type.
2021-10-11 Etienne Servais <>
* sem_ch4.adb (Analyze_Membership_Op): Reorder subprogram spec
and bodies in alphabetical order.
2021-10-11 Piotr Trojanek <>
* exp_util.adb (Build_Class_Wide_Expression): Replace entities
of both simple and extended names.
2021-10-11 Ghjuvan Lacambre <>
* libgnarl/s-intman__android.adb, libgnarl/s-intman__lynxos.adb,
libgnarl/s-intman__posix.adb, libgnarl/s-intman__qnx.adb,
libgnarl/s-intman__solaris.adb, libgnarl/s-intman__susv3.adb,
libgnarl/s-taprob.adb, libgnarl/s-taprop__hpux-dce.adb,
libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb,
libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb,
libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb,
libgnarl/s-taskin.adb, libgnarl/s-tasque.adb,
libgnarl/s-tpoben.adb, libgnat/a-calend.adb,
libgnat/a-excach.adb, libgnat/a-except.adb, libgnat/a-tags.adb,
libgnat/a-textio.adb, libgnat/a-witeio.adb,
libgnat/a-ztexio.adb, libgnat/g-binenv.adb,
libgnat/s-parame.adb, libgnat/s-parame__vxworks.adb,
libgnat/s-stratt.adb, libgnat/s-trasym__dwarf.adb: Mark imported
binder globals as constant.
2021-10-11 Piotr Trojanek <>
* exp_aggr.adb (Initialize_Record_Component): Add assertion
about one of the parameters, so that illegal attempts to
initialize record components with Empty node are detected early
(Build_Record_Aggr_Code): Handle boxes in aggregate component
associations just the components with no initialization in
* sem_aggr.adb (Resolve_Record_Aggregate): For components that
require simple initialization carry boxes from resolution to
* sem_util.adb (Needs_Simple_Initialization): Remove redundant
2021-10-11 Piotr Trojanek <>
* exp_ch3.adb (Build_Init_Statements): Simplify detection of
concurrent record types.
2021-10-11 Piotr Trojanek <>
* exp_aggr.adb (Is_Delayed_Aggregate): Simplify.
2021-10-11 Piotr Trojanek <>
* exp_aggr.adb (Has_Default_Init_Comps): Simplify.
2021-10-11 Piotr Trojanek <>
* exp_aggr.adb (Component_OK_For_Backend): Remove redundant
2021-10-11 Patrick Bernardi <>
* Makefile.rtl (RTEMS): Add s-stchop.o to
EXTRA_GNATRTL_NONTASKING_OBJS, remove s-stchop__rtems.adb.
* libgnat/s-stchop__rtems.adb: Removed.
2021-10-11 Marc Poulhiès <>
* expander.adb (Expand): Skip clearing of Analyzed flag if
already set for N_Real_Literal.
2021-10-11 Piotr Trojanek <>
* sem_util.adb (Compile_Time_Constraint_Error): Simplify getting
the type of the first formal parameter.
2021-10-11 Piotr Trojanek <>
* exp_util.adb (Inside_Init_Proc): Simplify.
* sem_aggr.adb (Resolve_Record_Aggregate): Fix style.
* sem_util.adb (Compile_Time_Constraint_Error): Guard against
calling Corresponding_Concurrent_Type with an array type entity.
2021-10-11 Doug Rupp <>
* libgnat/ (time_t_bits): Change to
Long_Long_Integer'Size. Add some comments to explain.
2021-10-08 Martin Liska <>
* gcc-interface/misc.c (gnat_post_options): Use new macro
(gnat_init_gcc_eh): Likewise.
(gnat_init_gcc_fp): Likewise.
2021-10-05 Eric Botcazou <>
* gcc-interface/trans.c (gnat_to_gnu): Do not wrap boolean values
referenced in pragmas.
2021-10-05 Eric Botcazou <>
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Do not set the
DECL_DISREGARD_INLINE_LIMITS flag if -gnatd.8 is specified.
2021-10-05 Bob Duff <>
* gcc-interface/trans.c (set_end_locus_from_node): Check that
Handled_Statement_Sequence is not Empty before calling
End_Label, because the Empty node has no End_Label, and
depending on the exact node layout chosen by gen_il, calling
End_Label might crash, or might work OK by accident.
2021-10-05 Eric Botcazou <>
* gcc-interface/cuintp.c: Adjust placement of include directive.
* gcc-interface/targtyps.c: Likewise.
2021-10-05 Alexandre Oliva <>
* doc/gnat_rm.rst: Add...
* doc/gnat_rm/security_hardening_features.rst: New.
* doc/gnat_rm/about_this_guide.rst: Link to new chapter.
* gnat_rm.texi: Regenerate.
* gcc-interface/utils.c (handle_strub_attribute): New.
(gnat_internal_attribute_table): Add strub.
* libgnat/a-except.adb: Make Rcheck_CE_* strub-callable.
* libgnat/ (Raise_Exception): Likewise.
(Raise_Exception_Always): Likewise.
* libgnat/ (Multiply_With_Ovflo_Check128):
* libgnat/ (Multiply_With_Ovflo_Check64):
* libgnat/ (SS_Allocate, SS_Mark, SS_Release):
2021-10-05 Eric Botcazou <>
* exp_ch9.adb (Install_Private_Data_Declarations): Copy the Sloc of
components for the local renamings as well as the Comes_From_Source
flag, and also set Warnings_Off on them. Use Nam local variable.
2021-10-05 Arnaud Charlet <>
* libgnarl/ (Set_Initialization_Handler): Update
2021-10-05 Corentin Gay <>
* init.c (QNX): Add #include errno.h.
2021-10-05 Eric Botcazou <>
* exp_attr.adb (Expand_Fpt_Attribute): Likewise.
* (Name_Unaligned_Valid): Delete.
2021-10-05 Etienne Servais <>
* sem_prag.adb (Analyze_Pragma): Forbid use of
Compile_Time_(Error|Warning) as configuration pragma.
* doc/gnat_ugn/the_gnat_compilation_model.rst:
Compile_Time_(Error|Warning) and Compiler_Unit(_Warning) are not
configuration pragmas and shall not be listed as such. The
following pragmas are either obsolete or undocumented:
No_Run_Time, Propagate_Exceptions, Rational, Ravenscar,
Restricted_Run_Time, Short_Descriptors, Universal_Data. Fix
some typos (notably on Restriction_Warnings).
* doc/gnat_rm/implementation_defined_pragmas.rst: Move
Rename_Pragma documentation to alphabetical order.
* gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-10-05 Corentin Gay <>
* adaint.c (QNX): Add #include for sys/time.h.
2021-10-05 Pascal Obry <>
* libgnat/g-forstr.adb (Next_Format): When there is no more
format specifier found issue a proper error message instead of
raising a contraint error.
2021-10-05 Pascal Obry <>
* libgnat/g-forstr.adb (Get_Formatted): Fix computation of the
number of zero to use in the formatted string. This was a wrong
2021-10-05 Pascal Obry <>
* libgnat/g-forstr.adb (Get_Formatted): Minor code clean-up.
2021-10-05 Etienne Servais <>
* libgnat/, libgnat/a-zchhan.adb
(Character_Set_Version, Is_Basic, To_Basic): New.
* libgnat/, libgnat/a-zchuni.adb (Is_Basic,
To_Basic): New.
2021-10-05 Yannick Moy <>
* sem_aggr.adb (Resolve_Array_Aggregate): Improve error message.
2021-10-05 Gary Dismukes <>
* (type Aspect_Id): Add
Aspect_Designated_Storage_Model and Aspect_Storage_Model_Type.
(Aspect_Argument): Add associations for the above new aspects.
(Is_Representation_Aspect): Likewise.
(Aspect_Names, Aspect_Delay): Likewise.
* exp_ch4.adb (Expand_N_Allocator): Call Find_Storage_Op rather
than Find_Prim_Op.
* exp_intr.adb (Expand_Unc_Deallocation): Likewise.
* (Find_Storage_Op): New function that locates
either a primitive operation of a storage pool or an operation
of a storage-model type specified in its Storage_Model_Type
* exp_util.adb (Find_Storage_Op): New function that calls either
Find_Prim_Op or Get_Storage_Model_Type_Entity to locate a
storage-related operation that is associated with a type.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Analyzes,
resolves, and validates the arguments of aspect
(Analyze_Aspect_Specifications): Sets delay-related flags on
storage-model aspects when Delay_Required. Checks that aspect
Designated_Storage_Model is only specified for an access type
and that aspect Storage_Model_Type is only specified on an
immutably limited type. Also records such aspects for their
associated types.
(Check_Aspect_At_Freeze_Point): Resolve each of the argument
associations given for a Storage_Model_Type aspect.
(Resolve_Storage_Model_Type_Argument): New procedure that
resolves an argument given in the association for a given entity
name associated with a type with aspect Storage_Model_Type,
ensuring that it has the proper kind or profile.
(Validate_Storage_Model_Type_Aspect): New procedure that checks
the legality and completeness of the entity associations given
in a Storage_Model_Type aspect.
* (package Storage_Model_Support): New nested
package that encapsulates a set of convenient utility functions
for retrieving entities, etc. associated with
storage-model-related types and objects.
(Get_Storage_Model_Type_Entity): New function to return a
specified entity associated with a type that has aspect
(Has_Designated_Storage_Model_Aspect): New function that returns
whether a type has aspect Designated_Storage_Model.
(Has_Storage_Model_Type_Aspect): New function that returns
whether a type has aspect Storage_Model_Type.
(Storage_Model_Object): New function that returns the object
Entity_Id associated with a type's Designated_Storage_Model
(Storage_Model_Type): New function that returns the type
associated with a storage-model object (when the object's type
specifies Storage_Model_Type).
(Storage_Model_Address_Type): New function that returns the
Address_Type associated with a type that has aspect
(Storage_Model_Null_Address): New function that returns the
Null_Address constant associated with a type that has aspect
(Storage_Model_Allocate): New function that returns the Allocate
procedure associated with a type that has aspect
(Storage_Model_Deallocate): New function that returns the
Deallocate procedure associated with a type that has aspect
(Storage_Model_Copy_From): New function that returns the
Copy_From procedure associated with a type that has aspect
(Storage_Model_Copy_To): New function that returns the Copy_To
procedure associated with a type that has aspect
(Storage_Model_Storage_Size): New function that returns the
Storage_Size function associated with a type that has aspect
* sem_util.adb (package Storage_Model_Support): Body of new
nested package that contains the implementations the utility
functions declared in the spec of this package.
* Add new names Name_Designated_Storage_Pool,
Name_Storage_Model, Name_Storage_Model_Type, Name_Address_Type,
Name_Copy_From, Name_Copy_To, and Name_Null_Address for the new
aspects and associated aspect arguments.
2021-10-05 Richard Kenner <>
* debug.adb: Add documentation for -gnatd_t.
2021-10-05 Corentin Gay <>
* sysdep.c (__gnat_is_file_not_found_error): Add else if case.
2021-10-05 Piotr Trojanek <>
* exp_util.adb (Build_Class_Wide_Expression): Replace entities
of both identifiers and operator symbols.
2021-10-05 Piotr Trojanek <>
* sem_ch3.adb (Derive_Subprogram): Copy ghost status from parent
to derived subprogram.
2021-10-05 Joffrey Huguet <>
* libgnat/, libgnat/ Add
Default_Initial_Condition to Unbounded_String.
2021-10-05 Claire Dross <>
* libgnat/ Use pragma Assertion_Policy to disable
contract cases at execution.
* libgnat/ Idem.
* libgnat/ Idem.
* libgnat/ Idem.
* libgnat/ Idem.
* libgnat/ Idem.
* libgnat/ Idem.
2021-10-05 Bob Duff <>
* par-ch4.adb (P_Iterated_Component_Association): Parse these
features the same way in all language versions. Move the call
to Error_Msg_Ada_2022_Feature into semantic analysis.
* sem_aggr.adb (Resolve_Iterated_Component_Association,
Resolve_Iterated_Association): Move the call to
Error_Msg_Ada_2022_Feature here from par-ch4.adb.
2021-10-05 Yannick Moy <>
* sem_res.adb (Resolve): Recognize specially that case.
2021-10-05 Yannick Moy <>
* libgnat/a-strmap.adb: Add ghost code for proof.
(To_Range): This is the most involved proof, as it requires
creating the result of the call to To_Domain as a ghost
variable, and show the unicity of this result in order to prove
the postcondition.
* libgnat/ (SPARK_Proof_Sorted_Character_Sequence):
New ghost function.
(To_Domain): Add postcondition regarding sorting of result.
(To_Range): Fix postcondition that should compare Length instead
of Last for the results of To_Domain and To_Range, as the value
of Last for an empty result is not specified in the Ada RM.
2021-10-05 Yannick Moy <>
* libgnat/a-chahan.adb: Add loop invariants as needed to prove
subprograms. Also use extended return statements where
appropriate and not done already. Mark data with
Relaxed_Initialization where needed for initialization by parts.
Convert regular functions to expression functions where needed
for proof.
* libgnat/ Add postconditions.
* libgnat/ (Model): New ghost function to create a
publicly visible model of the private data Character_Mapping,
needed in order to prove subprograms in Ada.Characters.Handling.
2021-10-04 Justin Squirek <>
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
Add new entry for No_Dynamic_Accessibility_Checks documenting
* gnat_rm.texi: Regenerate.
* exp_ch4.adb (Expand_N_In): Perform special expansion for
membership tests when No_Dynamic_Accessibility_Checks is active.
* sem_attr.adb (Resolve_Attribute): Skip static accessibility
check on actuals for anonymous access type formal parameters,
and add constants for readability.
* sem_util.adb (Function_Call_Or_Allocator_Level): Use the
innermost master for determining the level for function calls
within the alternative accessibility model.
(Type_Access_Level): Properly get the level for anonymous access
function result types.
2021-10-04 Piotr Trojanek <>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(gnateA): This switch no longer looks at the formal parameter
type being composite (as originally mandated by SPARK), but in
the parameter passing mechanism being not specified (as
currently mandated by Ada).
* gnat_ugn.texi: Regenerate.
2021-10-04 Ed Schonberg <>
* sem_ch6.adb (Analyze_Operator_Symbol): Recognize strings as
operator names when they are the value of one of the Ada2022
aspects for User_Defined_Literals.
* sem_ch13.adb (Analyze_One_Aspect): Handle an aspect value
given by an Operator_Name.
(Validate_Literal_Aspect): Call Analyze_Operator_Symbol when
2021-10-04 Piotr Trojanek <>
* gen_il-gen.adb (Put_Make_Spec): Don't emit the LF character in
the middle of a string, because the Put routine won't indent it
2021-10-04 Ghjuvan Lacambre <>
* gnat_cuda.adb (Remove_CUDA_Device_Entities): New function.
(Expand_CUDA_Package): Call Remove_CUDA_Device_Entities.
* (Expand_CUDA_Package): Expand documentation.
* sem_prag.adb (Analyze_Pragma): Remove warning about
CUDA_Device not being implemented.
2021-10-04 Gary Dismukes <>
* sem_ch7.adb (Analyze_Package_Specification): For types marked
as Must_Have_Preelab_Init, we now check for the presence of a
Preelaborable_Initialization aspect on the type, and pass the
aspect's expression (if any) on the call to
Has_Preelaborable_Initialization (or pass Empty if the type has
no such aspect or the aspect has no associated expression).
* (Has_Preelaborable_Initialization): Change
Boolean formal parameter Formal_Types_Have_Preelab_Init to
instead be a formal of type Node_Id (named Preelab_Init_Expr),
to allow passing an expression that may be a conjunction of
Preelaborable_Initialization aspects. Revise spec comment
accordingly (and remove ??? comment).
* sem_util.adb (Type_Named_In_Preelab_Init_Expression): New
nested function with a result indicating whether a given type is
named as the prefix of a Preelaborable_Initialization attribute
in the expression of a corresponding P_I aspect.
(Has_Preelaborable_Initialization): For generic formal derived
and private types, test whether the type is named in the
expression Preelab_Init_Expr (by calling
Type_Named_In_Preelab_Init_Expression), and if so, treat the
formal type as having preelaborable initialization (returning
* libgnat/ (Vector): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as Element_Type'Preelaborable_Initialization.
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (List): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as Element_Type'Preelaborable_Initialization.
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (Map): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as (Element_Type'Preelaborable_Initialization and
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (Map): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as (Element_Type'Preelaborable_Initialization and
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (Set): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as Element_Type'Preelaborable_Initialization.
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (Set): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as Element_Type'Preelaborable_Initialization.
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (Tree): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as Element_Type'Preelaborable_Initialization.
(Cursor): Replace pragma P_I with the aspect (defaulting to
* libgnat/ (Holder): Replace pragma
Preelaborable_Initialization with the aspect, specifying its
value as Element_Type'Preelaborable_Initialization.
(Cursor): Replace pragma P_I with the aspect (defaulting to
2021-10-04 Yannick Moy <>
* libgnat/a-textio.adb: Mark body out of SPARK.
* libgnat/ Mark spec in SPARK and private part out
* sem.adb (Semantics.Do_Analyze): Similar to ghost code
attributes, save and restore value of
2021-10-04 Bob Duff <>
* libgnat/ Change Data_First to Data'First. Change
"still" to "always". Similar changes for Data_Last.
2021-10-04 Piotr Trojanek <>
* sprint.adb (Sprint_Node_Actual): Refactor code for generic
package and subprogram declarations.
2021-10-04 Piotr Trojanek <>
* sem_res.adb (Resolve_Indexed_Component, Resolve_Slice): Rename
the local constant Name to Pref; remove repeated calls to
2021-10-04 Matthieu Eyraud <>
* Extend the documentation.
* par_sco.adb (Process_Decisions): Emit specific SCOs for
quantified expressions.
2021-10-04 Piotr Trojanek <>
* checks.adb (Selected_Range_Checks): Fix style.
* exp_ch4.adb (Expand_N_Slice): Fix style and comment.
* sem_res.adb (Resolve_Indexed_Component): Fix style.
2021-10-04 Yannick Moy <>
* libgnat/ Add comments.
2021-10-04 Piotr Trojanek <>
* sem_attr.adb (Eval_Attribute): Evaluation of attribute
Leading_Part with illegal second parameter is now similar to
evaluation of Remainder with its second parameter being zero.
2021-10-04 Ed Schonberg <>
* sem_res.adb (Resolve_Declare_Expression): Use tree traversals
to perform name capture of local entities in the expression of
the construct.
* exp_util.adb (Possible_Side_Effects_In_SPARK): Do not apply to
the prefix of an attribute reference Reduce when that prefix is
an aggregate, because it will be expanded into a loop, and has
no identifiable type.
2021-10-04 Javier Miranda <>
* sem_ch8.adb (Build_Class_Wide_Wrapper): Fix handling of
class-wide subtypes; required to handle chains of
instantiations. Adding also code to identify these wrappers and
properly resolve instantiations where the wrapper and a tagged
type primitive are visible.
* (Is_Class_Wide_Wrapper): Adding documentation.
* (Opt_Field_Enum): Adding
* gen_il-gen-gen_entities.adb (Root_Entity_Type): Adding
semantic flag Is_Class_Wide_Wrapper.
2021-10-04 Bob Duff <>
* (Declaration_Node): Document that Declaration_Node
for Itypes.
* einfo-utils.adb (Declaration_Node): Make it return Empty for
Itypes, or a proper type or subtype declaration.
* gen_il-gen.adb: Minor comment improvement.
2021-10-04 Piotr Trojanek <>
* sem_res.adb (Resolve_Slice): Fix application of range checks
to slice range given as a subtype name.
2021-10-04 Piotr Trojanek <>
* sem_res.adb (Resolve_Slice): Handle range given as a subtype
2021-10-04 Piotr Trojanek <>
* sem_res.adb (Resolve_Slice): Add custom handling of attribute
Image and similar in CodePeer mode. This complements the
existing custom handling of these attributes in
2021-10-04 Justin Squirek <>
* sem_util.adb (Is_Variable): Add check for implicitly
dereferenced access types
(Is_Dependent_Component_Of_Mutable_Object): Set Prefix_Type when
not specified.
2021-10-04 Eric Botcazou <>
* doc/gnat_ugn/the_gnat_compilation_model.rst (Binding generation):
Document specific behavior for /include/-ending paths and update.
* gnat_ugn.texi: Regenerate.
2021-10-04 Arnaud Charlet <>
PR ada/102073
* socket.c (__gnat_gethostbyaddr, __gnat_inet_pton): Add missing
return statements.
2021-10-04 Justin Squirek <>
* sem_util.adb (Function_Or_Allocator_Level): Properly handle
direct function calls in the default alternative accessibility
checking mode.
2021-10-04 Javier Miranda <>
* sem_util.adb (Is_Library_Level_Entity): Return False for
entities defined in E_Loop scopes. This change is not required
by the frontend; it is required by tools that depend on the
frontend sources.
* einfo-utils.adb (Is_Dynamic_Scope): Code cleanup.
2021-10-04 Justin Squirek <>
* sem_util.adb (Accessibility_Level): Add a case to handle
renamed subprograms in addition to renamed objects.
2021-10-04 Doug Rupp <>
* libgnarl/ (tlsKeyCreate): Return int.
* libgnarl/s-tpopsp__vxworks-rtp.adb (ERROR): Declare from
(Initialize): Declare IERR. Assert it.
* libgnarl/s-tpopsp__vxworks.adb (ERROR): Declare from
(Is_Valid_Task): Declare IERR. Test return.
* libgnarl/s-vxwext__kernel.adb (semDelete): Return STATUS.
2021-10-04 Eric Botcazou <>
* exp_disp.adb (Make_DT): Copy the Needs_Debug_Info flag from the
type onto the TSD object.
2021-10-04 Steve Baird <>
* sem_util.adb (Is_Repeatedly_Evaluated): Handle the case of an
Old attribute reference that occurs within what was originally a
quantified expression but which expansion has transformed into
an Expression_With_Actions.
2021-10-04 Steve Baird <>
* exp_ch4.adb (Expand_N_Indexed_Component): The two improvements
described above.
2021-10-01 Bob Duff <>
* exp_ch6.adb (Expand_Call_Helper): Do not call
Check_Subprogram_Variant if the subprogram is an ignored ghost
entity. Otherwise the compiler crashes (in debug builds) or
gives strange error messages (in production builds).
2021-10-01 Ghjuvan Lacambre <>
* gnat_cuda.adb (Empty_CUDA_Global_Subprograms): New procedure.
(Expand_CUDA_Package): Call Empty_CUDA_Global_Subprograms.
2021-10-01 Steve Baird <>
* Define a type Dimension_Set. Add an out-mode
parameter of this new type to Generate_Index_Checks so that
callers can know for which dimensions a check was generated. Add
an in-mode parameter of this new type to
Apply_Subscript_Validity_Checks so that callers can indicate
that no check is needed for certain dimensions.
* checks.adb (Generate_Index_Checks): Implement new
Checks_Generated parameter.
(Apply_Subscript_Validity_Checks): Implement new No_Check_Needed
* exp_ch4.adb (Expand_N_Indexed_Component): Call
Apply_Subscript_Validity_Checks in more cases than before. This
includes declaring two new local functions,
Type_Requires_Subscript_Validity_Checks_For_Reads): To help in
deciding whether to call Apply_Subscript_Validity_Checks.
Adjust to parameter profile changes in Generate_Index_Checks and
2021-10-01 Eric Botcazou <>
* doc/gnat_rm/implementation_defined_characteristics.rst: Document
the rounding mode assumed for dynamic computations as per 3.5.7(16).
* gnat_rm.texi: Regenerate.
2021-10-01 Bob Duff <>
* (Table_Type): Remove "aliased"; no longer needed by
Atree. Besides it contradicted the comment a few lines above,
"-- Note: We do not make the table components aliased...".
* Move type Slot to Atree.
* Move type Slot fromt Types to here. Move type
Node_Header from Seinfo to here.
* atree.adb: Avoid the need for aliased components of the Slots
table. Instead of 'Access, use a getter and setter. Misc
(Print_Statistics): Print statistics about node and entity kind
frequencies. Give 3 digit fractions instead of percentages.
* (Get_Original_Node_Count, Set_Original_Node_Count): Statistics
for calls to Original_Node and Set_Original_Node.
(Original_Node, Set_Original_Node): Gather statistics by calling
the above.
(Print_Field_Statistics): Print Original_Node statistics.
(Update_Kind_Statistics): Remove, and put all statistics
gathering under "if Atree_Statistics_Enabled", which is a flag
generated in Seinfo by Gen_IL.
* gen_il-gen.adb (Compute_Field_Offsets): Choose offsets of
Nkind, Ekind, and Homonym first. This causes a slight efficiency
improvement. Misc cleanups. Do not generate Node_Header; it is
now hand-written in Atree. When choosing the order in which to
assign offsets, weight by the frequency of the node type, so the
more common nodes get their field offsets assigned earlier. Add
more special cases.
(Compute_Type_Sizes): Remove this and related things.
There was a comment: "At some point we can instrument Atree to
print out accurate size statistics, and remove this code." We
have Atree statistics, so we now remove this code.
(Put_Seinfo): Generate Atree_Statistics_Enabled, which is equal
to Statistics_Enabled. This allows Atree to say "if
Atree_Statistics_Enabled then <gather statistics>" for
efficiency. When Atree_Statistics_Enabled is False, the "if ..."
will be optimized away.
* (Type_Frequency): New table of kind
* gen_il-internals.adb: Minor comment improvement.
* Remove unused subtypes. Suppress style
checks in the Type_Frequency table. If we regenerate this
table (see -gnatd.A) we don't want to have to fiddle with
* impunit.adb: Minor.
* sinfo-utils.adb: Minor.
* debug.adb: Minor comment improvement.
2021-10-01 Eric Botcazou <>
* sem_type.adb (Specific_Type): Check that the type is tagged
before calling Interface_Present_In_Ancestor on it.
2021-10-01 Eric Botcazou <>
* debug.adb (d.8): Document usage.
* fe.h (Debug_Flag_Dot_8): Declare.
2021-10-01 Gary Dismukes <>
* sem_util.adb (Enter_Name): Suppress hiding warning when in an
2021-10-01 Ed Schonberg <>
* sem_attr.adb (Analyze_Attribute, case Type_Key): Attribute can
be applied to a formal type.
* sem_ch5.adb (Analyze_Case_Statement): If Extensions_Allowed is
not enabled, verify that the type of the expression is discrete.
2021-10-01 Justin Squirek <>
* exp_dbug.adb (Debug_Renaming_Declaration): Add check for
Entity present for Ren to prevent looking at unanalyzed nodes
2021-10-01 Ghjuvan Lacambre <>
* atree.adb (Print_Statistics): Help CodePeer see Total as
greater than zero.
* gen_il-gen.adb (One_Comp): Annotate Field_Table as Modified.
2021-10-01 Richard Kenner <>
* gen_il-gen-gen_entities.adb (Evaluable_Kind,
Global_Name_Kind): Add.
* (Evaluable_Kind, Global_Name_Kind): Likewise.
2021-10-01 Ghjuvan Lacambre <>
* Add CUDA_Device aspect.
* (Add_CUDA_Device_Entity): New subprogram.
* gnat_cuda.adb:
(Add_CUDA_Device_Entity): New subprogram.
(CUDA_Device_Entities_Table): New hashmap for CUDA_Device
(Get_CUDA_Device_Entities): New internal subprogram.
(Set_CUDA_Device_Entities): New internal subprogram.
* par-prag.adb (Prag): Handle pragma id Pragma_CUDA_Device.
* (Aspect_Specifying_Pragma): Mark CUDA_Device as
being both aspect and pragma.
* sem_prag.adb (Analyze_Pragma): Add CUDA_Device entities to
list of CUDA_Entities belonging to package N.
(Sig_Flags): Signal CUDA_Device entities as referenced.
* Create CUDA_Device names and pragmas.
2021-10-01 Gary Dismukes <>
* exp_util.adb (Build_DIC_Procedure_Body): Remove inappropriate
Assert pragma. Remove unneeded and dead code related to derived
private types.
2021-10-01 Richard Kenner <>
* gen_il-gen-gen_nodes.adb (N_Alternative, N_Is_Case_Choice):
(N_Is_Exception_Choice, N_Is_Range): Likewise.
* Add above names.
* gen_il-gen.adb (Put_Union_Membership): Write both declarations
and definitions of union functions.
2021-10-01 Ed Schonberg <>
* exp_aggr.adb (Expand_Array_Aggregate,
Two_Pass_Aggregate_Expansion): Increment index for element
insertion within the loop, only if upper bound has not been
2021-10-01 Javier Miranda <>
* (Make_Class_Precondition_Subps): New subprogram.
(Merge_Class_Conditions): New subprogram.
(Process_Class_Conditions_At_Freeze_Point): New subprogram.
* contracts.adb (Check_Class_Condition): New subprogram.
(Set_Class_Condition): New subprogram.
(Analyze_Contracts): Remove code analyzing class-wide-clone
subprogram since it is no longer built.
(Process_Spec_Postconditions): Avoid processing twice seen
(Process_Preconditions): Simplify its functionality to
non-class-wide preconditions.
(Process_Preconditions_For): No action needed for wrappers and
(Make_Class_Precondition_Subps): New subprogram.
(Process_Class_Conditions_At_Freeze_Point): New subprogram.
(Merge_Class_Conditions): New subprogram.
* (Install_Class_Preconditions_Check): New
* exp_ch6.adb (Expand_Call_Helper): Install class-wide
preconditions check on dispatching primitives that have or
inherit class-wide preconditions.
(Freeze_Subprogram): Remove code for null procedures with
(Install_Class_Preconditions_Check): New subprogram.
* (Build_Class_Wide_Expression): Lower the
complexity of this subprogram; out-mode formal Needs_Wrapper
since this functionality is now provided by a new subprogram.
(Get_Mapped_Entity): New subprogram.
(Map_Formals): New subprogram.
* exp_util.adb (Build_Class_Wide_Expression): Lower the
complexity of this subprogram. Its previous functionality is now
provided by subprograms Needs_Wrapper and Check_Class_Condition.
(Add_Parent_DICs): Map the overridden primitive to the
overriding one.
(Get_Mapped_Entity): New subprogram.
(Map_Formals): New subprogram.
(Update_Primitives_Mapping): Adding assertion.
* (Check_Inherited_Conditions): Subprogram made
public with added formal to support late overriding.
* freeze.adb (Check_Inherited_Conditions): New implementation;
builds the dispatch table wrapper required for class-wide
pre/postconditions; added support for late overriding.
(Needs_Wrapper): New subprogram.
* (Inside_Class_Condition_Preanalysis): New global
* (Covered_Interface_Primitives): New subprogram.
* sem_disp.adb (Covered_Interface_Primitives): New subprogram.
(Check_Dispatching_Context): Skip checking context of
dispatching calls during preanalysis of class-wide conditions
since at that stage the expression is not installed yet on its
definite context.
(Check_Dispatching_Call): Skip checking 6.1.1(18.2/5) by
AI12-0412 on helpers and wrappers internally built for
supporting class-wide conditions; for late-overriding
subprograms call Check_Inherited_Conditions to build the
dispatch-table wrapper (if required).
(Propagate_Tag): Adding call to
* (Build_Class_Wide_Clone_Body): Removed.
(Build_Class_Wide_Clone_Call): Removed.
(Build_Class_Wide_Clone_Decl): Removed.
(Class_Condition): New subprogram.
(Nearest_Class_Condition_Subprogram): New subprogram.
* sem_util.adb (Build_Class_Wide_Clone_Body): Removed.
(Build_Class_Wide_Clone_Call): Removed.
(Build_Class_Wide_Clone_Decl): Removed.
(Class_Condition): New subprogram.
(Nearest_Class_Condition_Subprogram): New subprogram.
(Eligible_For_Conditional_Evaluation): No need to evaluate
class-wide conditions during preanalysis since the expression is
not installed on its definite context.
* (Class_Wide_Clone): Removed.
(Class_Postconditions): New attribute.
(Class_Preconditions): New attribute.
(Class_Preconditions_Subprogram): New attribute.
(Dynamic_Call_Helper): New attribute.
(Ignored_Class_Postconditions): New attribute.
(Ignored_Class_Preconditions): New attribute.
(Indirect_Call_Wrapper): New attribute.
(Is_Dispatch_Table_Wrapper): New attribute.
(Static_Call_Helper): New attribute.
* exp_attr.adb (Expand_N_Attribute_Reference): When the prefix
is of an access-to-subprogram type that has class-wide
preconditions and an indirect-call wrapper of such subprogram is
available, replace the prefix by the wrapper.
* exp_ch3.adb (Build_Class_Condition_Subprograms): New
(Register_Dispatch_Table_Wrappers): New subprogram.
* exp_disp.adb (Build_Class_Wide_Check): Removed; class-wide
precondition checks now rely on internally built helpers.
* sem_ch13.adb (Analyze_Aspect_Specifications): Set initial
value of attributes Class_Preconditions, Class_Postconditions,
Ignored_Class_Preconditions and Ignored_Class_Postconditions.
These values are later updated with the full pre/postcondition
by Merge_Class_Conditions.
(Freeze_Entity_Checks): Call
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Remove code
building the body of the class-wide clone subprogram since it is
no longer required.
(Install_Entity): Adding assertion.
* sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part): Remove
code building and analyzing the class-wide clone subprogram; no
longer required.
(Build_Pragma_Check_Equivalent): Adjust call to
Build_Class_Wide_Expression since the formal named Needs_Wrapper
has been removed.
* sem_attr.adb (Analyze_Attribute_Old_Result): Skip processing
these attributes during preanalysis of class-wide conditions
since at that stage the expression is not installed yet on its
definite context.
* sem_res.adb (Resolve_Actuals): Skip applying RM 3.9.2(9/1) and
SPARK RM 6.1.7(3) on actuals of internal helpers and wrappers
built to support class-wide preconditions.
* sem_ch5.adb (Process_Bounds): Do not generate a constant
declaration for the bounds when we are preanalyzing a class-wide
(Analyze_Loop_Parameter_Specification): Handle preanalysis of
quantified expression placed in the outermost expression of a
class-wide condition.
* ghost.adb (Check_Ghost_Context): No check required during
preanalysis of class-wide conditions.
* (Opt_Field_Enum): Adding
Class_Postconditions, Class_Preconditions,
Class_Preconditions_Subprogram, Dynamic_Call_Helper,
Ignored_Class_Postconditions, Ignored_Class_Preconditions,
Indirect_Call_Wrapper, Is_Dispatch_Table_Wrapper,
* gen_il-gen-gen_entities.adb (Is_Dispatch_Table_Wrapper):
Adding semantic flag Is_Dispatch_Table_Wrapper; removing
semantic field Class_Wide_Clone; adding semantic fields for
Class_Postconditions, Class_Preconditions,
Class_Preconditions_Subprogram, Dynamic_Call_Helper,
Ignored_Class_Postconditions, Indirect_Call_Wrapper,
Ignored_Class_Preconditions, and Static_Call_Helper.
2021-10-01 Piotr Trojanek <>
* comperr.adb (Delete_SCIL_Files): Handle generic subprogram
declarations and renaming just like generic package declarations
and renamings, respectively; handle
2021-10-01 Steve Baird <>
* bcheck.adb (Check_Versions): Add support for the case where
the .ali file contains both a primary and a secondary version
number, as in "GNAT Lib v22.20210809".
2021-10-01 Steve Baird <>
* sem_res.adb (Resolve): Two separate fixes. In the case where
Find_Aspect for a literal aspect returns the aspect for a
different (ancestor) type, call Corresponding_Primitive_Op to
get the right callee. In the case where a downward tagged type
conversion appears to be needed, generate a null extension
aggregate instead, as per Ada RM 3.4(27).
*, sem_util.adb: Add new Corresponding_Primitive_Op
function. It maps a primitive op of a tagged type and a
descendant type of that tagged type to the corresponding
primitive op of the descendant type. The body of this function
was written by Javier Miranda.
2021-10-01 Bob Duff <>
* atree.adb: Gather and print statistics about frequency of
getter and setter calls.
* (Print_Statistics): New procedure for printing
* debug.adb: Document -gnatd.A switch.
* gen_il-gen.adb: Generate code for statistics gathering.
Choose the offset of Homonym early. Misc cleanup. Put more
comments in the generated code.
* (Unknown_Offset): New value to indicate
that the offset has not yet been chosen.
* gnat1drv.adb: Call Print_Statistics.
* libgnat/ Minor comment fix.
* (Write_Int_64): New procedure to write a 64-bit
value. Needed for new statistics, and could come in handy
* output.adb (Write_Int_64): Likewise.
* Remove obsolete comment. The xtreeprs program no
longer exists.
* New 64-bit types needed for new statistics.
2021-10-01 Dmitriy Anisimkov <>
* libgnat/memtrack.adb (Putc): New routine wrapped around fputc
with error check.
(Write): New routine wrapped around fwrite with error check.
Remove bound functions fopen, fwrite, fputs, fclose, OS_Exit.
Use the similar routines from System.CRTL and System.OS_Lib.
2021-10-01 Ed Schonberg <>
* exp_aggr.adb (Must_Slide): If the aggregate only contains an
others_clause no sliding id involved. Otherwise sliding is
required if any bound of the aggregate or the context subtype is
2021-10-01 Richard Kenner <>
* gen_il-gen-gen_nodes.adb (N_Is_Decl): Add.
* (N_Is_Decl): Likewise.
2021-10-01 Richard Kenner <>
* gen_il-gen-gen_nodes.adb (N_Entity_Name): Add.
* (N_Entity_Name): Likewise.
2021-10-01 Steve Baird <>
* bcheck.adb (Check_Versions): In the case of an ali file
version mismatch, if distinct integer values can be extracted
from the two version strings then include those values in the
generated error message.
2021-10-01 Steve Baird <>
* sem_elab.adb (Is_Safe_Call): Return True in the case of a
(possibly rewritten) call to an expression function.
2021-10-01 Ghjuvan Lacambre <>
* sem_aggr.adb (Resolve_Iterated_Component_Association):
Initialize Id_Typ to Any_Type by default.
2021-10-01 Eric Botcazou <>
* doc/gnat_ugn/gnat_and_program_execution.rst (gnatmem): Document
that it works only with fixed-position executables.
2021-10-01 Doug Rupp <>
* libgnat/ (time_t_bits): Change to
2021-09-23 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity): Fix comment.
2021-09-23 Richard Kenner <>
* gen_il-gen-gen_entities.adb (Subprogram_Body_Or_Type): Add.
* (Subprogram_Body_Or_Type): Likewise.
2021-09-23 Richard Kenner <>
* einfo-utils.adb (Next_Index): Verify input and output are
* gen_il-gen-gen_nodes.adb (N_Has_Bounds, N_Is_Index): Add.
* (N_Has_Bounds, N_Is_Index): Likewise.
* sem_ch3.adb (Array_Type_Declaration): Use Next, not
* sem_ch12.adb (Formal_Dimensions): Likewise.
* sem_util.adb (Is_Valid_Renaming): Likewise.
2021-09-23 Eric Botcazou <>
* doc/gnat_ugn/gnat_utility_programs.rst (gnatsymbolize):
Document new --load option and -g1 as minimal compilation
2021-09-23 Piotr Trojanek <>
* sem_aggr.adb (Resolve_Array_Aggregate): Only keep the bounds
for internally generated attributes; otherwise, compute them
2021-09-23 Javier Miranda <>
* sem_ch3.adb (Build_Access_Subprogram_Wrapper): Decorate the
wrapper with attribute Is_Wrapper, and move its declaration to
the freezing actions of its type declaration; done to facilitate
identifying it at later stages to avoid handling it as a
primitive operation of a tagged type; otherwise it may be
handled as a dispatching operation and erroneously registered in
a dispatch table.
(Make_Index): Add missing decoration of field Parent.
* sem_disp.adb (Check_Dispatching_Operation): Complete
decoration of late-overriding dispatching primitives.
(Is_Access_To_Subprogram_Wrapper): New subprogram.
(Inherited_Subprograms): Prevent cascaded errors; adding missing
support for private types.
* sem_type.adb (Add_One_Interp): Add missing support for the
first interpretation of a primitive of an inmediate ancestor
* sem_util.adb (Check_Result_And_Post_State_In_Pragma): Do not
report missing reference in postcondition placed in internally
built wrappers.
* exp_disp.adb (Expand_Dispatching_Call): Adding assertion.
2021-09-23 Ed Schonberg <>
* sem_aggr.adb (Resolve_Array_Aggregate): Check the validity of
an array aggregate all of whose components are iterated
component associations.
* exp_aggr.adb (Expand_Array_Aggregate,
Two_Pass_Aggregate_Expansion): implement two-pass algorithm and
replace original aggregate with resulting temporary, to ensure
that a proper length check is performed if context is
constrained. Use attributes Pos and Val to handle index types of
any discrete type.
2021-09-23 Bob Duff <>
* gen_il-gen.adb: Set the number of concrete nodes that have the
Homonym field to a higher number than any other field. This
isn't true, but it forces Homonym's offset to be chosen first,
so it will be at offset zero and hence slot zero.
2021-09-23 Richard Kenner <>
* atree.adb (Relocate_Node): If relocating a subprgram call and
we're doing unnesting, make a new Parameter_Associations, if
2021-09-23 Piotr Trojanek <>
* libgnat/ (Generic_Bounded_Length): Remove explicit
Initializes contract.
2021-09-23 Bob Duff <>
* gen_il-gen.adb: Generate getters and setters with much of the
code inlined. Generate code for storing a few fields in the node
header, to avoid the extra level of indirection for those
fields. We generate the header type, so we don't have to
duplicate hand-written Ada and C code to depend on the number of
header fields. Declare constants for slot size. Use short names
because these are used all over. Remove
Put_Low_Level_Accessor_Instantiations, Put_Low_Level_C_Getter,
which are no longer needed. Rename
*, atree.adb: Take into account the header slots.
Take into account the single Node_Or_Entity_Field type. Remove
"pragma Assertion_Policy (Ignore);", because the routines in
this package are no longer efficiency critical.
* atree.h: Remove low-level getters, which are no longer used by
sinfo.h and einfo.h.
* einfo-utils.adb: Avoid crash in Known_Alignment.
* live.adb, sem_eval.adb: Remove code that prevents Node_Id from
having a predicate. We don't actually add a predicate to
Node_Id, but we want to be able to for temporary debugging.
* sinfo-utils.adb: Remove code that prevents Node_Id from having
a predicate. Take into account the single Node_Or_Entity_Field
* Minor.
* (Table_Type): Make the components aliased, because
low-level setters in Atree need to take 'Access.
* treepr.adb: Take into account the single Node_Or_Entity_Field
type. Make some code more robust, so we can print out
half-baked nodes.
* Move types here for visibility purposes.
* gcc-interface/gigi.h, gcc-interface/trans.c: Take into account
the Node_Header change in the GNAT front end.
* gcc-interface/cuintp.c, gcc-interface/targtyps.c: Add because
gigi.h now refers to type Node_Header, which is in sinfo.h.
2021-09-23 Yannick Moy <>
* libgnat/a-strfix.adb (Delete, Insert, Overwrite,
Replace_Slice): Remove SPARK_Mode Off.
* libgnat/ (Insert, Overwrite, Replace_Slice):
Strengthen precondition.
2021-09-23 Piotr Trojanek <>
* libgnat/ (Generic_Bounded_Length): Remove non-null
Global contracts.
2021-09-23 Steve Baird <>
* doc/gnat_rm/implementation_defined_characteristics.rst: Update
this section to reflect the current version of Ada RM M.2.
* gnat_rm.texi: Regenerate.
2021-09-22 Yannick Moy <>
* libgnat/ (Trim): Simplify contracts.
* libgnat/a-strfix.adb (Trim): Remove white space.
2021-09-22 Piotr Trojanek <>
* exp_ch4.adb (Expand_N_Op_Eq): Reuse Is_Attribute_Result.
* exp_prag.adb (Expand_Attributes): Reuse Is_Attribute_Old.
2021-09-22 Yannick Moy <>
* sem_ch3.adb (Analyze_Object_Declaration): Do not insert a
predicate check after a deferred constant declaration.
2021-09-22 Bob Duff <>
* contracts.adb, einfo-utils.adb,, exp_ch7.adb,
exp_ch9.adb, exp_disp.adb, exp_prag.adb, exp_smem.adb,
exp_util.adb, freeze.adb, sem_aggr.adb, sem_attr.adb,
sem_ch8.adb,, sem_util.adb, Fix
conformance errors.
* errout.adb, erroutc.adb: Remove pragmas Suppress.
* Initialize variables that were previously being
read uninitialized.
2021-09-22 Yannick Moy <>
* libgnat/ Mark package in SPARK with private part
not in SPARK.
(Free): Mark not in SPARK.
2021-09-22 Arnaud Charlet <>
* Update status of some attributes.
2021-09-22 Doug Rupp <>
* libgnarl/s-interr__vxworks.adb (Interfaces.C): Remove as
(System.VxWorks.Ext): Import.
(System.VxWorks.Ext.STATUS): use type.
(STATUS): New subtype.
(OK): New constant.
(Interrupt_Connector): Return STATUS type vice int.
(Interrupt_Connect, Notify_Interrupt, Unbind_Handler,
Interrupt_Server_Task): Rename Status to Result. Assert Result =
* libgnarl/s-osinte__vxworks.adb (To_Clock_Ticks): Define constant
IERR, and return it vice ERROR.
(Binary_Semaphore_Delete): Return STATUS type vice int.
(Binary_Semaphore_Obtain): Likewise.
(Binary_Semaphore_Release): Likewise.
(Binary_Semaphore_Flush): Likewise.
* libgnarl/ (SVE): Renaming of
(STATUS): Use SVE in declaration of subtype.
(BOOL): Likewise.
(vx_freq_t): Likewise.
(t_id): Likewise.
(gitpid): Use SVE in renaming of subprogram
(Task_Stop): Likewise.
(Task_Cont): Likewise.
(Int_Lock): Likewise.
(Int_Unlock): Likewise.
(Set_Time_Slice): Likewise.
(semDelete): Likewise.
(taskCpuAffinitySet): Likewise.
(taskMaskAffinitySet): Likewise.
(sigset_t): Use SVE in declaration of type.
(OK): Remove as unused.
(ERROR): Likewise.
(taskOptionsGet): return STATUS vice int.
(taskSuspend): Likewise.
(taskResume): Likewise.
(taskDelay): Likewise.
(taskVarAdd): Likewise.
(taskVarDelete): Likewise.
(taskVarSet): Likewise.
(tlkKeyCreate): Likewise.
(taskPrioritySet): Likewise.
(semGive): Likewise.
(semTake): Likewise.
(Binary_Semaphore_Delete): Likewise.
(Binary_Semaphore_Obtain): Likewise.
(Binary_Semaphore_Release): Likewise.
(Binary_Semaphore_Flush): Likewise.
(Interrupt_Connect): Likewise.
* libgnarl/s-taprop__vxworks.adb
(System.VxWorks.Ext.STATUS): use type.
(int): Syntactically align subtype.
(STATUS): New subtype.
(OK): New constant.
(Finalize_Lock): Check STATUS vice int. Assert OK.
(Finalize_Lock): Likewise.
(Write_Lock): Likewise.
(Write_Lock): Likewise.
(Write_Lock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Sleep): Likewise.
(Sleep): Likewise.
(Sleep): Likewise.
(Timed_Sleep): Likewise and test Result.
(Timed_Delay): Likewise and test Result.
(Wakeup): Likewise.
(Yield): Likewise.
(Finalize_TCB): Likewise.
(Suspend_Until_True): Check OK.
(Stop_All_Tasks): Declare Dummy STATUS vice in. Check OK.
(Is_Task_Context): Use OSI renaming.
(Initialize): Use STATUS vice int.
* libgnarl/s-vxwext.adb
(IERR): Renamed from ERROR.
(taskCpuAffinitySet): Return IERR (int).
(taskMaskAffinitySet): Likewise.
* libgnarl/
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
* libgnarl/s-vxwext__kernel-smp.adb
(IERR): Renamed from ERROR.
(Int_Lock): Return IERR.
(semDelete): Return STATUS.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
* libgnarl/s-vxwext__kernel.adb
(IERR): Renamed from ERROR.
(semDelete): Return STATUS.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(taskCpuAffinitySet): Return IERR (int)
(taskMaskAffinitySet): Likewise.
* libgnarl/
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
(Interrupt_Connect): Return STATUS
(semDelete): Likewise.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(Set_Time_Slice): Likewise.
* libgnarl/s-vxwext__rtp-smp.adb
(IERR): Renamed from ERROR.
(Int_Lock): return IERR constant vice ERROR.
(Interrupt_Connect): Return STATUS.
(semDelete): Likewise.
(Set_Time_Slice): Likewise.
* libgnarl/s-vxwext__rtp.adb
(IERR): Renamed from ERROR.
(Int_Lock): return IERR constant vice ERROR.
(Int_Unlock): Return STATUS.
(semDelete): Likewise.
(Set_Time_Slice): Likewise.
(taskCpuAffinitySet): Return IERR (int)
(taskMaskAffinitySet): Likewise.
* libgnarl/
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
(Interrupt_Connect): Return STATUS
(semDelete): Likewise.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(Set_Time_Slice): Likewise.
2021-09-22 Arnaud Charlet <>
* prep.adb (Preprocess): Allow for more flexibility when
Relaxed_RM_Semantics is set.
2021-09-22 Pierre-Alexandre Bazin <>
* libgnat/a-strbou.adb: Turn SPARK_Mode on.
* libgnat/ Write contracts.
* libgnat/ (Index): Fix grammar error in a comment.
* libgnat/ (Index): Likewise.
* libgnat/a-strsup.adb: Rewrite the body to take into account
the new definition of Super_String using Relaxed_Initialization
and a predicate.
(Super_Replicate, Super_Translate, Times): Added loop
invariants, and ghost lemmas for Super_Replicate and Times.
(Super_Trim): Rewrite the body using search functions to
determine the cutting points.
(Super_Element, Super_Length, Super_Slice, Super_To_String):
Remove (now written as expression functions in
* libgnat/ Added contracts.
(Super_Element, Super_Length, Super_Slice, Super_To_String):
Rewrite as expression functions.
2021-09-22 Yannick Moy <>
* sem_ch13.adb (Build_Predicate_Functions): Add guard.
2021-09-22 Doug Rupp <>
* libgnarl/ (BOOL): New int type.
(Interrupt_Context): Change return type to BOOL.
* libgnarl/ Likewise.
* libgnarl/s-vxwext__rtp-smp.adb: Likewise.
* libgnarl/s-vxwext__rtp.adb: Likewise.
* libgnarl/ Likewise.
* libgnarl/s-osinte__vxworks.adb (Interrupt_Context): Change
return type to BOOL.
* libgnarl/ (BOOL) New subtype.
(taskIsSuspended): Change return type to BOOL.
(Interrupt_Context): Change return type to BOOL. Adjust comments
* libgnarl/s-taprop__vxworks.adb (System.VxWorks.Ext.BOOL):
use type.
(Is_Task_Context): Test Interrupt_Context against 0.
* libgnat/ (BOOL): New int.
(intContext): Change return type to BOOL. Adjust comments.
* libgnat/ Likewise.
2021-09-22 Piotr Trojanek <>
* sem_aux.adb, (Package_Body): Moved from GNATprove.
* sem_elab.adb (Spec_And_Body_From_Entity): Refine type of parameter.
2021-09-22 Arnaud Charlet <>
* doc/gnat_ugn/platform_specific_information.rst: Improve doc
on permission and containers.
* gnat_ugn.texi: Regenerate.
2021-09-22 Yannick Moy <>
* atree.adb (Rewrite): Fix parent node of shared aspects.
* (Rewrite): Add ??? comment on incorrect
* einfo-utils.adb (Known_Esize): Fix logic.
* sem_ch13.adb (Alignment_Check_For_Size_Change,
Analyze_Attribute_Definition_Clause): Protect against unset
2021-09-22 Yannick Moy <>
* freeze.adb (Build_Renamed_Body): Special case for GNATprove.
* sem_ch6.adb (Analyze_Expression_Function): Remove useless test
for a node to come from source, which becomes harmful otherwise.
2021-09-22 Justin Squirek <>
* ali.adb, (Scan_ALI): Remove use of deprecated
parameter Ignore_ED, and all specification for Lower in call to
* ali-util.adb (Read_Withed_ALIs): Modify call to Scan_ALI.
* clean.adb (Clean_Executables): Likewise.
* gnatbind.adb (Add_Artificial_ALI_File, Executable section):
* gnatlink.adb (Executable section): Likewise.
* gnatls.adb (Executable section): Likewise.
* make.adb (Check, Wait_For_Available_Slot): Likewise.
* Add Aspect_No_Controlled_Parts to
* Remove function pointers used as a workaround for
* osint-c.adb (Executable section): Remove setting of function
pointer workarounds needed for ASIS.
* osint.adb (Read_Default_Search_Dirs): Correct behavior to
detect EOL characters.
* par_sco.adb (Output_Header): Remove comment regarding use of
(Traverse_Sync_Definition): Renamed to
* pprint.adb (Interal_List_Name): Add description about purpose,
and refactor conditional statement.
(Prepend): Removed.
* repinfo.adb (List_Rep_Info, Write_Info_Line): Remove use of
subprogram pointer.
* scng.adb (Scan): Remove CODEFIX question, and minor comment
* sem_attr.adb (Analyze_Image_Attribute): Remove special
processing for 'Img.
* sem_ch6.adb (Check_Untagged_Equality): Add RM reference.
(FCE): Add comment describing behavior.
(Is_Non_Overriding_Operation): Minor comment formatting change.
* sem_type.adb (Is_Actual_Subprogram): Add comment about
Comes_From_Source test.
(Matching_Types): Describe non-matching cases.
* sem_util.adb (Is_Confirming): Add stub case for
2021-09-22 Yannick Moy <>
* sem_ch13.adb (Build_Predicate_Functions): Access
Predicated_Parent only on subtypes.
2021-09-22 Arnaud Charlet <>
* sem_prag.adb (Process_Import_Or_Interface): Relax error when
2021-09-22 Steve Baird <>
* libgnat/s-regpat.adb (Match): Handle the case where Self.First
is not NUL (so we know the first character we are looking for),
but case-insensitive matching has
been specified.
(Optimize): In the case of an EXACTF Op, set Self.First as is
done in the EXACT case, except with the addition of a call to
2021-09-22 Eric Botcazou <>
* libgnat/, libgnat/s-imenne.adb: Delete.
* gcc-interface/ (GNAT_ADA_OBJS): Remove s-imenne.o.
(GNATBIND_OBJS): Likewise.
2021-09-22 Yannick Moy <>
* Fix comments.
* exp_aggr.adb: Fix variable name.
* exp_util.adb: Fix comments.
* sem_ch13.adb: Fix comments.
* sem_ch3.adb: Fix comments and variable name.
2021-09-22 Doug Rupp <>
* libgnarl/ Make procedure vice function.
* libgnarl/ Likewise.
* libgnarl/s-vxwext__kernel-smp.adb: Likewise.
* libgnarl/s-vxwext__kernel.adb: Likewise.
* libgnarl/ Likewise.
* libgnarl/s-vxwext__rtp-smp.adb: Likewise.
* libgnarl/s-vxwext__rtp.adb: Likewise.
* libgnarl/ Likewise.
* libgnarl/s-taprop__vxworks.adb (Stop_All_Tasks): Call
Int_Unlock as a procedure.
2021-09-22 Doug Rupp <>
* libgnarl/ (SVE): New package renaming
(vx_freq_t): New subtype.
(sysClkRateGet): Return vx_freq_t.
* libgnarl/ (vx_freq_t): New type.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
2021-09-22 Ghjuvan Lacambre <>
* sem_case.adb (Composite_Case_Ops): Replace 'Image with
2021-09-22 Eric Botcazou <>
* exp_ch4.adb (Expand_N_If_Expression): Generate an intermediate
temporary when the expression is a condition in an outer decision
and control-flow optimizations are suppressed.
2021-09-22 Steve Baird <>
* exp_ch5.adb (Expand_General_Case_Statement.Pattern_Match): Add
new function Indexed_Element to handle array element
comparisons. Handle case choices that are array aggregates,
string literals, or names denoting constants.
* sem_case.adb (Composite_Case_Ops.Array_Case_Ops): New package
providing utilities needed for casing on arrays.
(Composite_Case_Ops.Choice_Analysis): If necessary, include
array length as a "component" (like a discriminant) when
traversing components. We do not (yet) partition choice analysis
to deal with unequal length choices separately. Instead, we
embed everything in the minimum-dimensionality Cartesian product
space needed to handle all choices properly; this is determined
by the length of the longest choice pattern.
Include length as a "component" in the traversal if necessary.
Add support for case choices that are string literals or names
denoting constants.
(Composite_Case_Ops.Choice_Analysis): Include length as a
"component" in the analysis if necessary.
Improve error message when capacity exceeded.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation to reflect current implementation status.
* gnat_rm.texi: Regenerate.
2021-09-22 Eric Botcazou <>
* freeze.adb (Check_Component_Storage_Order): Give a specific error
message for non-byte-aligned component in the packed case. Replace
"composite" with "record" in both cases.
2021-09-22 Arnaud Charlet <>
* libgnarl/, libgnarl/a-tasini.adb: Make compatible
with No_Elaboration_Code_All.
* libgnarl/, libgnarl/s-tassta.adb: Adjust
2021-09-22 Arnaud Charlet <>
* sem_ch6.adb (Check_Returns): Change message on missing return.
2021-09-22 Arnaud Charlet <>
* gnatfind.adb, gnatxref.adb: Mark these tools as obsolete
before removing them completely.
2021-09-22 Eric Botcazou <>
* gcc-interface/decl.c (range_cannot_be_superflat): Tweak comments.
2021-09-21 Doug Rupp <>
* init.c (__gnat_error_handler) [LynxOS]: Add a comment about
missing optional args.
2021-09-21 Yannick Moy <>
* gen_il-gen.adb (Put_Opt_Subtype): Add suffix.
2021-09-21 Justin Squirek <>
* sem_util.adb (Accessibility_Level): Remove spurious special
case for protected type components.
* exp_ch4.adb (Generate_Accessibility_Check): Use general
Accessibility_Level instead of the low-level function
2021-09-21 Eric Botcazou <>
* gnat_ugn.texi: Regenerate.
2021-09-21 Matthieu Eyraud <>
* par_sco.adb (Traverse_One): Add support for pragma Invariant /
2021-09-21 Bob Duff <>
* gen_il-gen.adb (Put_Opt_Subtype): Print out subtypes of the
subtype Opt_N_Declaration is
Node_Id with Predicate =>
Opt_N_Declaration = Empty or else
Opt_N_Declaration in N_Declaration_Id;
One for each node or entity type, with the predicate allowing
* atree.adb (Parent, Set_Parent): Remove unnecessary "Atree.".
2021-09-21 Patrick Bernardi <>
* bindgen.adb (Gen_Adainit): For targets that suppress the
standard library: set the default stack size global variable if
a value is provided via the -d switch, and generate a call to
__gnat_initialize_stack_limit if stack checking using stack
limits is enabled.
2021-09-21 Bob Duff <>
* sem_ch13.adb (Stream_Size): Print message about allowed stream
sizes even if other error were already found. This avoids
falling into the 'else', which prints "Stream_Size cannot be
given for...", which is misleading -- the Size COULD be given if
it were correct.
2021-09-21 Daniel Mercier <>
* exp_util.adb (Build_Temporary): In case of an external DISCR
symbol, set the related expression for CodePeer so that a more
comprehensible message can be emitted to the user.
2021-09-21 Eric Botcazou <>
* libgnat/s-dwalin.adb (Parse_Header): Tweak comments.
(Read_Entry_Format_Array): Tweak exception message.
(Symbolic_Address.Set_Result): Likewise.
2021-09-21 Ed Schonberg <>
* exp_ch7.adb (Make_Init_Call): Add guard to protect against a
missing initialization procedure for a type.
2021-09-21 Doug Rupp <>
* Makefile.rtl: Remove unused VxWorks sections.
* libgnarl/s-vxwext__noints.adb: Remove.
* libgnarl/ Remove.
* libgnat/a-elchha__vxworks-ppc-full.adb: Remove.
* libgnat/s-osprim__vxworks.adb: Remove.
* libgnat/ Remove.
* libgnat/ Remove.
* libgnat/ Remove.
* libgnat/ Remove.
2021-09-21 Bob Duff <>
*, uintp.adb (UI_Is_In_Int_Range): Change the type of
the formal parameter to Valid_Uint. Remove code that preserved
the previous behavior, and replace it with an assertion. The
previous behavior is no longer needed given the recent change to
(No, Present): Add comment.
2021-09-21 Bob Duff <>
* sem_eval.adb (Fold_Shift): Replace an if_expression with an
2021-09-21 Bob Duff <>
*, uintp.adb: Add assertions.
(Ubool, Opt_Ubool): New "boolean" subtypes.
(UI_Is_In_Int_Range): The parameter should probably be
Valid_Uint, but we don't change that for now, because it causes
failures in gigi.
*, sem_util.adb (Is_True, Is_False,
Static_Boolean): Use Opt_Ubool subtype. Document the fact that
Is_True (No_Uint) = True. Implement Is_False in terms of
Is_True. We considered changing Static_Boolean to return Uint_1
in case of error, but that doesn't fit in well with
(Has_Compatible_Alignment_Internal): Deal with cases where Offs
is No_Uint. Change one "and" to "and then" to ensure we don't
pass No_Uint to ">", which would violate the new assertions.
* exp_util.adb, freeze.adb, sem_ch13.adb: Avoid violating new
assertions in Uintp.
2021-09-21 Eric Botcazou <>
* libgnat/s-dwalin.adb (To_File_Name): Fetch only the last string
from the .debug_line_str section.
(Symbolic_Address.Set_Result): Likewise.
2021-09-21 Eric Botcazou <>
* libgnat/s-dwalin.adb (Skip_Form): Fix cases of DW_FORM_addrx
and DW_FORM_implicit_const. Replace Constraint_Error with
2021-09-21 Ghjuvan Lacambre <>
* exp_pakd.adb (Expand_Packed_Not): Replace expression with
2021-09-21 Ghjuvan Lacambre <>
* sem_eval.adb (Is_Static_Subtype): Take predicates created
through "predicate" pragma into account.
2021-09-21 Frederic Konrad <>
* Makefile.rtl (aarch64-rtems*): Add GNATRTL_128BIT_PAIRS to
2021-09-21 Gary Dismukes <>
* sem_ch4.adb (Remove_Abstract_Operations): Add condition to
test for an E_Operator as part of criteria for setting
Abstract_Op on interpretations involving predefined operators.
2021-09-21 Javier Miranda <>
* exp_ch6.adb (Expand_Simple_Function_Return): For explicit
dereference of type conversion, enable code that ensures that
the tag of the result is that of the result type.
2021-09-21 Bob Duff <>
* einfo-utils.adb: Add support (currently disabled) for using
"initial zero" instead of "Uint_0" to represent "unknown". Call
Known_ functions, instead of evilly duplicating their code
* fe.h (No_Uint_To_0): New function to convert No_Uint to
Uint_0, in order to preserve existing behavior.
(Copy_Esize, Copy_RM_Size): New imports from Einfo.Utils.
* cstand.adb: Set size fields of Standard_Debug_Renaming_Type
and Standard_Exception_Type.
* checks.adb, exp_attr.adb, exp_ch3.adb, exp_ch5.adb,
exp_ch6.adb, exp_pakd.adb, exp_util.adb, freeze.adb, itypes.adb,
layout.adb, repinfo.adb, sem_attr.adb, sem_ch12.adb,
sem_ch13.adb,, sem_ch3.adb, sem_ch7.adb,
sem_util.adb: Protect calls with Known_..., use Copy_... Remove
assumption that Uint_0 represents "unknown".
* (Nonzero_Int): New subtype.
* gcc-interface/decl.c, gcc-interface/trans.c: Protect calls
with Known_... and use Copy_... as appropriate, to avoid
blowing up in unknown cases. Similarly, call No_Uint_To_0 to
preserve existing behavior.
2021-09-21 Steve Baird <>
* sem_ch13.adb (Analyze_Aspect_Specifications): Add a new nested
function, Directly_Specified, and then use it in the
implementation of the required check.
2021-09-21 Steve Baird <>
* libgnat/, libgnat/a-costso.adb: A new library
unit, Ada.Containers.Stable_Sorting, which exports a pair of
generics (one within the other) which are instantiated by each
of the 5 doubly-linked list container generics to implement
their respective Sort procedures. We use a pair of generics,
rather than a single generic, in order to further reduce code
duplication. The outer generic takes a formal private Node_Ref
type representing a reference to a linked list element. For some
instances, the corresponding actual parameter will be an access
type; for others, it will be the index type for an array.
* Makefile.rtl: Include new Ada.Containers.Stable_Sorting unit.
* libgnat/a-cbdlli.adb, libgnat/a-cdlili.adb,
libgnat/a-cfdlli.adb, libgnat/a-cidlli.adb, libgnat/a-crdlli.adb
(Sort): Replace existing Sort implementation with a call to an
instance of
Ada.Containers.Stable_Sorting.Doubly_Linked_List_Sort. Declare
the (trivial) actual parameters needed to declare that instance.
* libgnat/ Fix a bug encountered during testing in
the postcondition for M_Elements_Sorted. With a partial
ordering, it is possible for all three of (X < Y), (Y < X),
and (X = Y) to be simultaneously false, so that case needs to
handled correctly.
2021-09-21 Piotr Trojanek <>
* errout.adb (Error_Msg_Internal): Fix references to Sptr and
Optr in comment; fix grammar of "low-level" where it is used as
an adjective.
2021-09-21 Piotr Trojanek <>
* errout.adb (Write_Source_Code_Lines): Use Cur_Loc before
incrementing it, so that we don't need to decrement it.
2021-09-21 Yannick Moy <>
* errout.adb (Get_Line_End): Do not allow the result to go past
the end of the buffer.
2021-09-21 Ed Schonberg <>
* sem_ch3.adb (Process_Discriminant_Expressions): If the
constraint is for a Component_Definition that appears in a
Component_Declaration, the entity to be used to create the
potentially global symbol is the Defining_Identifier of the
2021-09-21 Bob Duff <>
* libgnat/, libgnat/a-stbufi.adb: Change all
occurrences of GNAT.OS_Lib to System.OS_Lib.
2021-09-20 Piotr Trojanek <>
* inline.adb (Has_Excluded_Declaration): Remove redundant guard;
the guarded code will call First on a No_List, which is
well-defined and gives Empty.
2021-09-20 Piotr Trojanek <>
* inline.adb (Has_Excluded_Declaration): Rename and reduce scope
of a local variable.
2021-09-20 Bob Duff <>
*, uintp.adb (Present, No): New functions for
comparing with No_Uint.
* checks.adb, einfo-utils.adb, exp_aggr.adb, exp_attr.adb,
exp_ch3.adb, exp_ch4.adb, exp_dbug.adb, exp_disp.adb,
exp_util.adb, repinfo.adb, repinfo-input.adb, scn.adb,
sem_attr.adb, sem_ch13.adb, sem_eval.adb, sem_util.adb,
sinfo-utils.adb, treepr.adb: Use Present (...) instead of "...
/= No_Uint", and No (...) instead of "... = No_Uint".
2021-09-20 Claire Dross <>
* libgnat/ The entire package has a SPARK_Mode =>
Off aspect.
2021-09-20 Doug Rupp <>
* libgnat/a-calend.adb: Remove time_t, replace with OS_Time.
* libgnat/ Fix comments regarding time_t conversion
functions to reflect the use of To_Ada in in Ada.Calendar
package body.
* sysdep.c (__gnat_localtime_tzoff): Use OS_Time instead of
2021-09-20 Piotr Trojanek <>
* sem_res.adb (Resolve_Actual): Remove
2021-09-20 Bob Duff <>
*, einfo-utils.adb, fe.h,, Remove unused and no-longer-used routines.
Move related routines together. Rewrite incorrect
documentation, and documentation that will be incorrect when
e.g. Esize-related routines are fixed. Remove unused field
* cstand.adb, exp_pakd.adb, freeze.adb,
gen_il-gen-gen_entities.adb, itypes.adb, layout.adb,
sem_ch10.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb,
sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_prag.adb,
sem_util.adb, Update calls to routines removed from
or renamed in Einfo.Utils.
* (Upos): Fix this subtype, which was unintentionally
declared to include Uint_0.
2021-09-20 Piotr Trojanek <>
* exp_ch7.adb (Expand_N_Package_Declaration): Fix wording in
* exp_disp.adb (Mark_DT): Remove unnecessary initialization of
2021-09-20 Piotr Trojanek <>
* contracts.adb (Add_Contract_Item): Accept volatile-related
properties on constants.
(Analyze_Object_Contract): Check external properties on
constants; accept volatile constants.
(Check_Type_Or_Object_External_Properties): Replace "variable"
with "object" in error messages; replace Decl_Kind with a local
* sem_prag.adb (Analyze_Pragma): Accept volatile-related
properties on constants.
2021-09-20 Pierre-Alexandre Bazin <>
* libgnat/a-strfix.adb ("*"): Added loop invariants and lemmas
for proof.
(Delete): Added assertions for proof, and conditions to avoid
(Head): Added loop invariant.
(Insert): Same as Delete.
(Move): Declared with SPARK_Mode Off.
(Overwrite): Added assertions for proof, and conditions to avoid
(Replace_Slice): Added assertions for proof, and conditions to
avoid overflow.
(Tail): Added loop invariant and avoided overflows.
(Translate): Added loop invariants.
(Trim): Ensured empty strings returned start at 1.
* libgnat/ (Index): Rewrote contract cases for
easier proof.
(Index_Non_Blank): Separated the null string case.
(Count): Specified Mapping shouldn't be null.
(Find_Token): Specified Source'First should be Positive when no
From is given.
(Translate): Specified Mapping shouldn't be null.
("*"): Rewrote postcondition for easier proof.
* libgnat/a-strsea.adb (Belongs): Added postcondition.
(Count): Rewrote loops and added loop invariants to avoid
(Find_Token): Added loop invariants.
(Index): Rewrote loops to avoid overflows and added loop
invariants for proof.
(Index_Non_Blank): Added loop invariants.
(Is_Identity): New function isolated without SPARK_Mode.
* libgnat/ Fix starting comment as package is no
longer private.
(Match): Declared ghost expression function Match.
(Is_Identity): Described identity in the postcondition.
(Index, Index_Non_Blank, Count, Find_Token): Added contract from
2021-09-20 Piotr Trojanek <>
* sem_ch13.adb (Resolve_Aspect_Aggregate): Move comments after
specs; fix typo in header box; cleanup whitespace.
2021-09-20 Eric Botcazou <>
* libgnat/s-objrea.adb (Get_Load_Address): Return 0 for ELF.
2021-09-20 Eric Botcazou <>
* adaint.c (__gnat_get_executable_load_address): Add Win32 support.
* libgnat/ (Get_Xcode_Bounds): Fix typo in comment.
(Object_File): Minor reformatting.
(ELF_Object_File): Uncomment predicate.
(PECOFF_Object_File): Likewise.
(XCOFF32_Object_File): Likewise.
* libgnat/s-objrea.adb: Minor reformatting throughout.
(Get_Load_Address): Implement for PE-COFF.
* libgnat/ Remove clause for System.Storage_Elements
and use consistent wording in comments.
(Dwarf_Context): Set type of Low, High and Load_Address to Address.
* libgnat/s-dwalin.adb (Get_Load_Displacement): New function.
(Is_Inside): Call Get_Load_Displacement.
(Low_Address): Likewise.
(Open): Adjust to type change.
(Aranges_Lookup): Change type of Addr to Address.
(Read_Aranges_Entry): Likewise for Start and adjust.
(Enable_Cach): Adjust to type change.
(Symbolic_Address): Change type of Addr to Address.
(Symbolic_Traceback): Call Get_Load_Displacement.
2021-09-20 Piotr Trojanek <>
* exp_disp.adb (Make_DT): Move call to Set_Has_Dispatch_Table,
so it is executed regardless of the Generate_SCIL mode.
2021-09-20 Ed Schonberg <>
* (Force_Evaluation): Add formal parameter
Discr_Number, to indicate discriminant expression for which an
external name must be created.
(Remove_Side_Effects): Ditto.
* exp_util.adb (Force_Evaluation): Call Remove_Side_Effects with
added parameter.
(Remove_Side_Effects, Build_Temporary): If Discr_Number is
positive, create an external name with suffix DISCR and the
given discriminant number, analogous to what is done for
temporaries for array type bounds.
* sem_ch3.adb (Process_Discriminant_Expressions): If the
constraint is for an object or component declaration and the
corresponding entity may be visible in another unit, invoke
Force_Evaluation with the new parameter.
2021-09-20 Arnaud Charlet <>
* (Invalid_Val): Remove, unused and
generates warnings.
2021-09-20 Piotr Trojanek <>
* exp_aggr.adb, exp_ch4.adb, exp_ch5.adb, sprint.adb: Refine
types of local constants.
2021-09-20 Gary Dismukes <>
* exp_attr.adb (Expand_N_Attribute_Reference): Fold
Preelaborable_Initialization attribute in cases where it hasn't
been folded by the analyzer.
* exp_disp.adb (Original_View_In_Visible_Part): This function is
removed and moved to sem_util.adb.
* sem_attr.adb (Attribute_22): Add
Attribute_Preelaborable_Initialization as an Ada 2022 attribute.
(Analyze_Attribute, Attribute_Preelaborable_Initialization):
Check that the prefix of the attribute is either a formal
private or derived type, or a composite type declared within the
visible part of a package or generic package.
(Eval_Attribute): Perform folding of
Preelaborable_Initialization attribute based on
Has_Preelaborable_Initialization applied to the prefix type.
* sem_ch3.adb (Resolve_Aspects): Add specialized code for
Preelaborable_Initialization used at the end of a package
visible part for setting Known_To_Have_Preelab_Init on types
that are specified with True or that have a conjunction of one
or more P_I attributes applied to formal types.
* sem_ch7.adb (Analyze_Package_Specification): On call to
Has_Preelaborable_Initialization, pass True for new formal
Formal_Types_Have_Preelab_Init, so that error checking treats
subcomponents that are declared within types in generics as
having preelaborable initialization when the subcomponents are
of formal types.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add test for
P_I to prevent calling Make_Pragma_From_Boolean_Aspect, since
this aspect is handled specially and the
Known_To_Have_Preelab_Init flag will get set on types that have
the aspect by other means.
(Analyze_Aspect_Specifications.Analyze_One_Aspect): Add test for
Aspect_Preelaborable_Initialization for allowing the aspect to
be specified on formal type declarations.
(Is_Operational_Item): Treat Attribute_Put_Image as an
operational attribute. The need for this was encountered while
working on these changes.
* (Has_Preelaborable_Initialization): Add
Formal_Types_Have_Preelab_Init as a new formal parameter that
defaults to False.
(Is_Conjunction_Of_Formal_Preelab_Init_Attributes): New
(Original_View_In_Visible_Part): Moved here from exp_disp.adb,
so it can be called by Analyze_Attribute.
* sem_util.adb (Has_Preelaborable_Initialization): Return True
for formal private and derived types when new formal
Formal_Types_Have_Preelab_Init is True, and pass along the
Formal_Types_Have_Preelab_Init flag in the array component case.
(Check_Components): Pass along Formal_Types_Have_Preelab_Init
flag on call to Has_Preelaborable_Initialization.
(Is_Conjunction_Of_Formal_Preelab_Init_Attributes): New function
that returns True when passed an expression that includes one or
more attributes for Preelaborable_Initialization applied to
prefixes that denote formal types.
(Is_Formal_Preelab_Init_Attribute): New utility function nested
within Is_Conjunction_Of_Formal_Preelab_Init_Attributes that
determines whether a node is a P_I attribute applied to a
generic formal type.
(Original_View_In_Visible_Part): Moved here from exp_util.adb,
so it can be called by Analyze_Attribute.
* Add note near the start of spec giving
details about what needs to be done when adding a name that
corresponds to both an attribute and a pragma. Delete existing
occurrence of Name_Preelaborable_Initialization, and add a note
comment in the list of Name_* constants at that place,
indicating that it's included in type Pragma_Id, etc., echoing
other such comments for names that are both an attribute and a
pragma. Insert Name_Preelaborable_Initialization in the
alphabetized set of Name_* constants corresponding to
attributes (between First_Attribute_Name and
(type Attribute_Id): Add new literal
(type Pragma_Id): Move Pragma_Preelaborable_Initialization from
its current position to the end of the type, in the special set
of pragma literals that have corresponding atttributes. Add to
accompanying comment, indicating that functions Get_Pragma_Id
and Is_Pragma_Name need to be updated when adding a pragma
literal to the special set.
* snames.adb-tmpl (Get_Pragma_Id): Add case alternative for
(Is_Pragma_Name): Add test for
2021-09-20 Ghjuvan Lacambre <>
* sem_ch4.adb (Finc_Non_Universal_Interpretations): Fix check.
2021-09-20 Piotr Trojanek <>
* sem_ch3.adb (Build_Discriminant_Constraints): Exit once a
first discriminant is found and the Discrim_Present flag is set.
2021-09-20 Bob Duff <>
* gnat1drv.adb (Gnat1drv): Avoid calling List_Rep_Info in
Generate_SCIL and GNATprove_Mode.
* repinfo.adb (List_Common_Type_Info): Fix comment.
2021-09-20 Eric Botcazou <>
* libgnat/ Remove clause for Ada.Exceptions.Traceback,
add clause for System.Traceback_Entries and alphabetize.
(AET): Delete.
(STE): New package renaming.
(Symbolic_Traceback): Adjust.
* libgnat/s-dwalin.adb: Remove clauses for Ada.Exceptions.Traceback
and System.Traceback_Entries.
(Symbolic_Traceback): Adjust.
2021-09-20 Ghjuvan Lacambre <>
* sem_ch4.adb (Find_Non_Universal_Interpretations): Check if
types are compatible before adding interpretation.
2021-09-20 Justin Squirek <>
* exp_ch4.adb (Expand_N_Type_Conversion): Add guard to protect
against calculating accessibility levels against internal
compiler-generated types.
2021-09-20 Ghjuvan Lacambre <>
* sem_dim.adb (Dimensions_Msg_Of): Capitalize comment.
2021-09-20 Ghjuvan Lacambre <>
* adabkend.adb (Scan_Back_End_Switches): Replace switch-scanning
logic with call to Backend_Utils.Scan_Common_Back_End_Switches.
* back_end.adb (Scan_Back_End_Switches): Replace switch-scanning
logic with call to Backend_Utils.Scan_Common_Back_End_Switches.
* backend_utils.adb: New file.
* New file.
* gcc-interface/ Add ada/backend_utils.o.
2021-09-20 Ghjuvan Lacambre <>
* atree.adb (Get_32_Bit_Field): Declare result before returning.
2021-09-20 Ghjuvan Lacambre <>
* exp_ch7.adb (Expand_N_Package_Body): Replace
Build_And_Insert_Cuda_Initialization with Expand_CUDA_Package.
* gnat_cuda.adb (Expand_CUDA_Package): New procedure.
(Build_And_Insert_Cuda_Initialization): Make internal.
* (Expand_CUDA_Package): New procedure.
(Build_And_Insert_Cuda_Initialization): Remove from spec.
2021-09-20 Ghjuvan Lacambre <>
* usage.adb (Usage): Update -gnatw.c messages.
2021-09-20 Eric Botcazou <>
* sem_aux.adb (Is_By_Reference_Type): Do not test Error_Posted.
2021-09-15 Alexandre Oliva <>
* gcc-interface/utils.c: Include opts.h.
(handle_zero_call_used_regs_attribute): New.
(gnat_internal_attribute_table): Add zero_call_used_regs.
2021-09-14 Eric Botcazou <>
PR ada/101970
* exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Enum_Rep>:
Use an unchecked conversion instead of a regular conversion in the
enumeration case and remove Conversion_OK flag in the integer case.
<Attribute_Pos>: Remove superfluous test.
2021-09-14 Eric Botcazou <>
* gcc-interface/decl.c (validate_size): Do not issue an error if the
old size has overflowed.
2021-09-14 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity): For vector types, make
the representative array the debug type.
2021-09-14 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): Turn variable
into constant. Capitalize GCC in warning message.
(intrin_arglists_compatible_p): Change parameter to pointer-to-const
Adjust warning messages. Turn warning into error for vector types.
(intrin_return_compatible_p): Likewise.
(intrin_profiles_compatible_p): Change parameter to pointer-to-const
2021-09-14 Eric Botcazou <>
* libgnat/ (bool): Delete.
(Atomic_Test_And_Set): Replace bool with Boolean.
(Atomic_Always_Lock_Free): Likewise.
* libgnat/s-aoinar.adb (Is_Lock_Free): Adjust.
* libgnat/s-aomoar.adb (Is_Lock_Free): Likewise.
* libgnat/s-aotase.adb (Atomic_Test_And_Set): Likewise.
* libgnat/s-atopex.adb (Atomic_Compare_And_Exchange): Likewise.
* gcc-interface/decl.c: Include gimple-expr.h.
(intrin_types_incompatible_p): Delete.
(intrin_arglists_compatible_p): Call types_compatible_p.
(intrin_return_compatible_p): Likewise.
2021-09-14 Eric Botcazou <>
* gcc-interface/utils.c (update_pointer_to): Set TYPE_CANONICAL on
pointer and reference types.
2021-09-14 Eric Botcazou <>
PR ada/101385
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(-Wall): Minor fixes.
(-w): Likewise.
(-Werror): Document that it also sets -gnatwe by default.
* gcc-interface/lang-specs.h (ada): Expand -gnatwe if -Werror is
passed and move expansion of -gnatw switches to before -gnatez.
2021-09-14 Eric Botcazou <>
* gcc-interface/utils.c (can_materialize_object_renaming_p): Do not
call UI_Is_In_Int_Range on the result of Normalized_First_Bit.
2021-09-14 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity) <is_type>: Declare new
constant. Adjust error message issued by validate_size in the case
of by-reference types.
(validate_size): Always use the error strings passed by the caller.
2021-09-08 liuhongt <>
* gcc-interface/misc.c (gnat_post_options): Issue an error for
2021-08-19 Arnaud Charlet <>
PR ada/101924
* gcc-interface/ (STAGE1_LIBS): Define on hpux.
2021-08-18 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Fix
thinko in latest change.
2021-08-11 Bernd Edlinger <>
PR debug/101598
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the
2021-07-25 Arnaud Charlet <>
* libgnat/s-osprim__x32.adb: Add missing with clause.
2021-07-12 Pierre-Marie de Rodat <>
* adaint.c (__gnat_number_of_cpus): Replace "#ifdef" by "#if
2021-07-12 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Add a
parallel type only when -fgnat-encodings=all is specified.
<E_Array_Type>: Use the PAT name and special suffixes only when
-fgnat-encodings=all is specified.
<E_Array_Subtype>: Build a special type for debugging purposes only
when -fgnat-encodings=all is specified. Add a parallel type or use
the PAT name only when -fgnat-encodings=all is specified.
<E_Record_Type>: Generate debug info for the inner record types only
when -fgnat-encodings=all is specified.
<E_Record_Subtype>: Use a debug type for an artificial subtype only
except when -fgnat-encodings=all is specified.
(elaborate_expression_1): Reset need_for_debug when possible only
except when -fgnat-encodings=all is specified.
(components_to_record): Use XV encodings for variable size only
when -fgnat-encodings=all is specified.
(associate_original_type_to_packed_array): Add a parallel type only
when -fgnat-encodings=all is specified.
* gcc-interface/misc.c (gnat_get_array_descr_info): Do not return
full information only when -fgnat-encodings=all is specified.
* gcc-interface/utils.c (make_packable_type): Add a parallel type
only when -fgnat-encodings=all is specified.
(maybe_pad_type): Make the inner type a debug type only except when
-fgnat-encodings=all is specified. Create an XVS type for variable
size only when -fgnat-encodings=all is specified.
(rest_of_record_type_compilation): Add a parallel type only when
-fgnat-encodings=all is specified.
2021-07-12 Eric Botcazou <>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Use a
fixed lower bound if the index subtype is marked so, as well as a
more efficient formula for the upper bound if the array cannot be
(flb_cannot_be_superflat): New predicate.
(cannot_be_superflat): Rename into...
(range_cannot_be_superfla): ...this. Minor tweak.
2021-07-12 Bob Duff <>
*, types.h: New subtypes of Uint: Valid_Uint, Unat,
Upos, Nonzero_Uint with predicates. These correspond to new
field types in Gen_IL.
* (Valid_Uint, Unat, Upos, Nonzero_Uint): New
field types.
*, einfo-utils.adb, fe.h (Known_Alignment,
Init_Alignment): Use the initial zero value to represent
"unknown". This will ensure that if Alignment is called before
Set_Alignment, the compiler will blow up (if assertions are
*, atree.adb, atree.h, gen_il-gen.adb
(Get_Valid_32_Bit_Field): New generic low-level getter for
subtypes of Uint.
(Copy_Alignment): New procedure to copy Alignment field even
when Unknown.
(Init_Object_Size_Align, Init_Size_Align): Do not bypass the
Init_ procedures.
* exp_pakd.adb, freeze.adb, layout.adb, repinfo.adb,
sem_util.adb: Protect calls to Alignment with Known_Alignment.
Use Copy_Alignment when it might be unknown.
* gen_il-gen-gen_entities.adb (Alignment,
String_Literal_Length): Use type Unat instead of Uint, to ensure
that the field is always Set_ before we get it, and that it is
set to a nonnegative value.
(Enumeration_Pos): Unat.
(Enumeration_Rep): Valid_Uint. Can be negative, but must be
valid before fetching.
(Discriminant_Number): Upos.
(Renaming_Map): Remove.
* gen_il-gen-gen_nodes.adb (Char_Literal_Value, Reason): Unat.
(Intval, Corresponding_Integer_Value): Valid_Uint.
* New functions for dealing with special
defaults and new subtypes of Uint.
* Correct comments.
* scn.adb (Post_Scan): Do not set Intval to No_Uint; that is no
longer allowed.
* sem_ch13.adb (Analyze_Enumeration_Representation_Clause): Do
not set Enumeration_Rep to No_Uint; that is no longer allowed.
(Offset_Value): Protect calls to Alignment with Known_Alignment.
* sem_prag.adb (Set_Atomic_VFA): Do not use Uint_0 to mean
"unknown"; call Init_Alignment instead.
* Minor comment fix.
* treepr.adb: Deal with printing of new field types.
*, (Renaming_Map): Remove.
* gcc-interface/decl.c (gnat_to_gnu_entity): Use Known_Alignment
before calling Alignment. This preserve some probably buggy
behavior: if the alignment is not set, it previously defaulted
to Uint_0; we now make that explicit. Use Copy_Alignment,
because "Set_Alignment (Y, Alignment (X));" no longer works when
the Alignment of X has not yet been set.
* gcc-interface/trans.c (process_freeze_entity): Use
2021-07-12 Eric Botcazou <>
* libgnat/ Adjust a few comments left and right.
(Line_Info_Register): Comment out unused components.
(Line_Info_Header): Add DWARF 5 support.
(Dwarf_Context): Likewise. Rename "prologue" into "header".
* libgnat/s-dwalin.adb: Alphabetize "with" clauses.
(DWARF constants): Add DWARF 5 support and reorder.
(For_Each_Row): Adjust.
(Initialize_Pass): Likewise.
(Initialize_State_Machine): Likewise and fix typo.
(Open): Add DWARF 5 support.
(Parse_Prologue): Rename into...
(Parse_Header): ...this and add DWARF 5 support.
(Read_And_Execute_Isn): Rename into...
(Read_And_Execute_Insn): ...this and adjust.
(To_File_Name): Change parameter name and add DWARF 5 support.
(Read_Entry_Format_Array): New procedure.
(Skip_Form): Add DWARF 5 support and reorder.
(Seek_Abbrev): Do not count entries and add DWARF 5 support.
(Debug_Info_Lookup): Add DWARF 5 support.
(Symbolic_Address.Set_Result): Likewise.
(Symbolic_Address): Adjust.
2021-07-12 Bob Duff <>
* sem_ch13.adb (Duplicate_Clause): Add a helper routine
Check_One_Attr, with a parameter for the attribute_designator we
are looking for, and one for the attribute_designator of the
current node (which are usually the same). For Size and
Value_Size, call it twice, once for each.
* Fix a typo.
2021-07-12 Piotr Trojanek <>
* exp_imgv.adb (Expand_Image_Attribute): Move rewriting to
attribute Put_Image to the beginning of expansion of attribute
2021-07-09 Eric Botcazou <>
* gcc-interface/utils.c (finish_subprog_decl): Remove obsolete line.
2021-07-09 Piotr Trojanek <>
* exp_put_image.adb (Make_Put_Image_Name): Fix style.
(Image_Should_Call_Put_Image): Likewise.
(Build_Image_Call): Likewise.
2021-07-09 Ghjuvan Lacambre <>
* par-ch6.adb (Contains_Import_Aspect): New function.
(P_Subprogram): Acknowledge `Import` aspects.
2021-07-09 Bob Duff <>
* exp_put_image.adb (Make_Component_Attributes): Use
Implementation_Base_Type to get the parent type. Otherwise,
Parent_Type_Decl is actually an internally generated subtype
declaration, so we blow up on
Type_Definition (Parent_Type_Decl).
2021-07-09 Dmitriy Anisimkov <>
* gsocket.h: Include net/if.h to get IF_NAMESIZE constant.
* s-oscons-tmplt.c: Define IPV6_FLOWINFO for Linux.
2021-07-09 Steve Baird <>
* libgnat/a-cdlili.adb: Reimplement
Ada.Containers.Doubly_Linked_Lists.Generic_Sorting.Sort using
Mergesort instead of the previous Quicksort variant.
2021-07-09 Justin Squirek <>
* exp_ch6.adb (Is_Build_In_Place_Function_Call): Add check to
verify the Selector_Name of Exp_Node has been analyzed before
obtaining its entity.
2021-07-09 Gary Dismukes <>
* libgnarl/ Fix typo ("release" =>
"releases") plus comment reformatting.
* libgnat/ In a comment, fix typo ("indended" =>
"intended"), add a hyphen and semicolon, plus reformatting. In
comment for subtype time_t, fix typo ("effect" => "affect"), add
hyphens, plus reformatting.
* libgnat/, libgnat/,
libgnat/ Remove period from one-line comment.
2021-07-09 Steve Baird <>
* exp_ch5.adb (Expand_General_Case_Statement): Add new function
Else_Statements to handle the case of invalid data analogously
to how it is handled when casing on a discrete value.
* sem_case.adb (Has_Static_Discriminant_Constraint): A new
Boolean-valued function.
(Composite_Case_Ops.Scalar_Part_Count): Include discriminants
when traversing components.
Include discriminants when traversing components; the component
range for a constrained discriminant is a single value.
(Composite_Case_Ops.Choice_Analysis.Parse_Choice): Eliminate
Done variable and modify how Next_Part is computed so that it is
always correct (as opposed to being incorrect when Done is
True). This includes changes in Update_Result (a local
procedure). Add new local procedure
Update_Result_For_Box_Component and call it not just for box
components but also for "missing" components (components
associated with an inactive variant).
Instead of disallowing all discriminated component types, allow
those that are unconstrained or statically constrained. Check
discriminant subtypes along with other component subtypes.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation to reflect current implementation status.
* gnat_rm.texi: Regenerate.
2021-07-09 Justin Squirek <>
* sem_ch6.adb (Check_Pragma_Inline): Correctly use
Corresponding_Spec_Of_Stub when dealing subprogram body stubs.
2021-07-09 Doug Rupp <>
* Makefile.rtl: Add translations for
* libgnarl/ Import System.Parameters.
(time_t): Declare using System.Parameters.time_t_bits.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnarl/ Likewise.
* libgnat/ Likewise.
* libgnat/s-osprim__darwin.adb: Likewise.
* libgnat/s-osprim__posix.adb: Likewise.
* libgnat/s-osprim__posix2008.adb: Likewise.
* libgnat/s-osprim__rtems.adb: Likewise.
* libgnat/s-osprim__x32.adb: Likewise.
* libgnarl/ use type System.Linux.time_t.
* libgnat/ (time_t): Declare as subtype of
* libgnat/ (time_t_bits): New constant.
* libgnat/ (time_t_bits): Likewise.
* libgnat/ (time_t_bits): Likewise.
* libgnat/ (time_t_bits): Likewise.
* libgnat/ New file for 64 bit time_t.
2021-07-09 Bob Duff <>
* comperr.adb (Compiler_Abort): Print source file name.
2021-07-09 Joffrey Huguet <>
* libgnat/, libgnat/ Fix layout
in contracts.
2021-07-09 Eric Botcazou <>
* (JSON output format): Document adjusted key name.
* repinfo.adb (List_Record_Layout): Use Original_Record_Component
if the normalized position of the component is not known.
(List_Structural_Record_Layout): Rename Outer_Ent parameter into
Ext_End and add Ext_Level parameter. In an extension, if the parent
subtype has static discriminants, call List_Record_Layout on it.
Output "parent_" prefixes before "variant" according to Ext_Level.
Adjust recursive calls throughout the procedure.
2021-07-09 Piotr Trojanek <>
* (Map_Types): Fix typo.
2021-07-09 Fedor Rybin <>
* krunch.adb: Add safeguards against index range violations.
2021-07-09 Arnaud Charlet <>
* libgnat/a-strfix.adb: Take advantage of extended returns.
2021-07-09 Eric Botcazou <>
* doc/gnat_rm/implementation_defined_attributes.rst
(Scalar_Storage_Order): Add paragraph about representation
* gnat_rm.texi: Regenerate.
2021-07-09 Frederic Konrad <>
* Makefile.rtl (LIBGNAT_TARGET_PAIRS) <aarch64*-*-rtems*>: Use
the wraplf variant of Aux_Long_Long_Float.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Initialize Orig_N
and Typ variables.
2021-07-09 Arnaud Charlet <>
* sem_ch13.adb (Resolve_Aspect_Expressions): Use the same
processing for Predicate, Static_Predicate and
Dynamic_Predicate. Do not build the predicate function spec.
Update comments.
(Resolve_Name): Only reset Entity when necessary to avoid
spurious visibility errors.
(Check_Aspect_At_End_Of_Declarations): Handle consistently all
Predicate aspects.
* sem_ch3.adb (Analyze_Subtype_Declaration): Fix handling of
private types with predicates.
2021-07-09 Justin Squirek <>
* (Type_Access_Level): Add new optional parameter
* sem_util.adb (Accessibility_Level): Treat access discriminants
the same as components when the restriction
No_Dynamic_Accessibility_Checks is enabled.
(Deepest_Type_Access_Level): Remove exception for
Debug_Flag_Underscore_B when returning the result of
Type_Access_Level in the case where
No_Dynamic_Accessibility_Checks is active.
(Function_Call_Or_Allocator_Level): Correctly calculate the
level of Expr based on its containing subprogram instead of
using Current_Subprogram.
* sem_res.adb (Valid_Conversion): Add actual for new parameter
Assoc_Ent in call to Type_Access_Level, and add test of
No_Dynamic_Accessibility_Checks_Enabled to ensure that static
accessibility checks are performed for all anonymous access type
2021-07-09 Eric Botcazou <>
* Update documentation of various items.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Reorder code.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Reorder code.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Add variable to
avoid repeated calls to Etype.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Fix comment.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Use Orig_N variable
instead of repeated calls to Original_Node.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): Change types local
variables from Entity_Id to Node_Id.
2021-07-09 Piotr Trojanek <>
* sem_ch6.adb (Analyze_Expression_Function): A local Expr
constant was shadowing a global constant with the same name and
the same value.
2021-07-09 Piotr Trojanek <>
* sem_res.adb (Preanalyze_And_Resolve): Only call
Set_Must_Not_Freeze when it is necessary to restore the previous
2021-07-08 Piotr Trojanek <>
* sem_ch5.adb (Analyze_Assignment): Clear Current_Assignment at
(Analyze_Target_Name): Prevent AST climbing from going too far.
2021-07-08 Ed Schonberg <>
* sem_ch5.adb (Analyze_Target_Name): Properly reject a
Target_Name when it appears outside of an assignment statement,
or within the left-hand side of one.
2021-07-08 Bob Duff <>
*, einfo-utils.adb (Unknown_Alignment,
Unknown_Component_Bit_Offset, Unknown_Component_Size,
Unknown_Esize, Unknown_Normalized_First_Bit,
Unknown_Normalized_Position, Unknown_Normalized_Position_Max,
Unknown_RM_Size): Remove these functions.
* exp_pakd.adb, exp_util.adb, fe.h, freeze.adb, layout.adb,
repinfo.adb, sem_ch13.adb, sem_ch3.adb, sem_util.adb: Remove
calls to these functions; do "not Known_..." instead.
* gcc-interface/decl.c, gcc-interface/trans.c
(Unknown_Alignment, Unknown_Component_Size, Unknown_Esize,
Unknown_RM_Size): Remove calls to these functions; do
"!Known_..." instead.
2021-07-08 Eric Botcazou <>
* exp_dbug.adb (Get_Encoded_Name): Do not encode names of discrete
types with custom bounds, except with -fgnat-encodings=all.
* exp_pakd.adb (Create_Packed_Array_Impl_Type): Adjust comment.
2021-07-08 Bob Duff <>
* comperr.adb (Compiler_Abort): Call Sinput.Unlock, because if
this is called late, then Source_Dump would crash otherwise.
* debug.adb: Correct documentation of the -gnatd.9 switch.
* exp_ch4.adb (Expand_Allocator_Expression): Add a comment.
* exp_ch6.adb: Minor comment fixes. Add assertion.
* (Is_Build_In_Place_Result_Type): Correct comment.
* exp_ch7.adb, Minor comment fixes.
2021-07-08 Doug Rupp <>
* Rename to...
* sigtramp-vxworks-target.h: ... this.
* sigtramp-vxworks.c, Makefile.rtl: Likewise.
2021-07-08 Ghjuvan Lacambre <>
* Mention SCOs dependency as reason for duplicates.
* (Units): Update documentation to mention duplicated
2021-07-08 Ed Schonberg <>
* style.adb (Missing_Overriding): Do not emit message when
parent of subprogram is a full type declaration.
2021-07-08 Arnaud Charlet <>
* par-ch5.adb (P_Iterator_Specification): Add support for access
definition in loop parameter.
* sem_ch5.adb (Check_Subtype_Indication): Renamed...
(Check_Subtype_Definition): ... into this and check for conformance
on access definitions, and improve error messages.
(Analyze_Iterator_Specification): Add support for access definition
in loop parameter.
2021-07-08 Arnaud Charlet <>
*, sem_util.adb
(Apply_Compile_Time_Constraint_Error): New parameter
* sem_ch4.adb (Analyze_Selected_Component): Disable warning
within an instance.
2021-07-08 Eric Botcazou <>
* exp_imgv.adb: Add with and use clause for Restrict and Rident.
(Build_Enumeration_Image_Tables): Do not generate the hash function
if the No_Implicit_Loops restriction is active.
2021-07-08 Piotr Trojanek <>
* sem_ch12.adb, sem_ch6.adb, sem_ch9.adb, sprint.adb: Simplify
checks for non-empty lists.
2021-07-08 Piotr Trojanek <>
* par-ch10.adb (Unit_Display): Remove redundant condition; fix
2021-07-08 Piotr Trojanek <>
* lib-load.adb (Load): Replace early return with goto to properly
restore context on failure.
2021-07-08 Piotr Trojanek <>
* lib-writ.adb (Ensure_System_Dependency): Simplify condition.
2021-07-08 Piotr Trojanek <>
* lib-load.adb (Load_Unit): Fix style in comment.
* par-load.adb (Load): Likewise.
* scng.adb (Initialize_Scanner): Fix whitespace.
2021-07-08 Piotr Trojanek <>
* par-load.adb (Load): Don't remove unit, but flag it as
erroneous and return.
2021-07-08 Ghjuvan Lacambre <>
* exp_prag.adb (Expand_Pragma_Inspection_Point): Fix error
2021-07-08 Yannick Moy <>
* layout.adb (Layout_Type): Do not call Number_Dimensions if the
type does not have First_Index set.
2021-07-08 Ghjuvan Lacambre <>
* exp_prag.adb (Expand_Pragma_Inspection_Point): After expansion
of the Inspection_Point pragma, check if referenced entities
that have a freeze node are already frozen. If they aren't, emit
a warning and turn the pragma into a no-op.
2021-07-08 Yannick Moy <>
* layout.adb (Layout_Type): Add guard before calling Expr_Value.
2021-07-08 Yannick Moy <>
* layout.adb (Layout_Type): Special case when RM_Size and Esize
can be computed for packed arrays.
2021-07-08 Steve Baird <>
*, rtsfind.adb: Add support for finding the packages
System.Atomic_Operations and
System.Atomic_Operations.Test_And_Set and the declarations
within that latter package of the type Test_And_Set_Flag and the
function Atomic_Test_And_Set.
* exp_ch11.adb (Expand_N_Exception_Declaration): If an exception
is declared other than at library level, then we need to call
Register_Exception the first time (and only the first time) the
declaration is elaborated. In order to decide whether to
perform this call for a given elaboration of the declaration, we
used to unconditionally use a (library-level) Boolean variable.
Now we instead use a variable of type
System.Atomic_Operations.Test_And_Set.Test_And_Set_Flag unless
either that type is unavailable or a No_Tasking restriction is
in effect (in which case we use a Boolean variable as before).
2021-07-08 Arnaud Charlet <>
* gcc-interface/ Add No_Tasking restriction.
2021-07-08 Ed Schonberg <>
* libgnat/ Introduce an equality operator over
* libgnat/ Ditto.
* libgnat/a-cohama.adb: Add body for "=" over cursors.
(Insert): Do not set the Position component of the cursor that
denotes the inserted element.
* libgnat/a-cohase.adb: Ditto.
2021-07-08 Arnaud Charlet <>
* libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb,
libgnat/a-cborma.adb, libgnat/a-cborse.adb,
libgnat/a-cobove.adb, libgnat/a-textio.adb,
libgnat/a-witeio.adb, libgnat/a-ztexio.adb: Make code compatible
with No_Dynamic_Accessibility_Checks restriction.
2021-07-08 Arnaud Charlet <>
* debug.adb, sem_util.adb: Revert meaning of -gnatd_b.
* sem_res.adb: Minor reformatting.
2021-07-08 Arnaud Charlet <>
* make.adb, osint.adb: Make code compatible with
No_Dynamic_Accessibility_Checks restriction.
2021-07-08 Piotr Trojanek <>
* lib-writ.adb (Ensure_System_Dependency): Replace search in
Lib.Units with a search in Lib.Unit_Names.
2021-07-08 Piotr Trojanek <>
* sinput-l.adb (Load_File): Simplify foreword manipulation with
concatenation; similar for filename with preprocessed output.
2021-07-07 Dmitriy Anisimkov <>
* s-oscons-tmplt.c (MSG_WAITALL): Remove wrong #ifdef
2021-07-07 Gary Dismukes <>
* einfo-utils.adb (Primitive_Operations): Default to returning
Direct_Primitive_Operations in the case of concurrent types
(when Corresponding_Record_Type not present).
* sem_ch9.adb (Analyze_Protected_Type_Declaration): Initialize
Direct_Primitive_Operations to an empty element list.
(Analyze_Task_Type_Declaration): Initialize
Direct_Primitive_Operations to an empty element list.
2021-07-07 Piotr Trojanek <>
* sem_eval.adb (Set_Checking_Potentially_Static_Expression):
Stronger assertion.
2021-07-07 Arnaud Charlet <>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Mark Anon_Id
intrinsic before calling Analyze_Instance_And_Renamings because
this flag may be propagated to other nodes.
2021-07-07 Dmitriy Anisimkov <>
Hardcode on Windows if undefined.
2021-07-07 Bob Duff <>
* checks.adb (Install_Primitive_Elaboration_Check): Do not
generate elaboration checks for primitives if pragma Pure or
Preelaborate is present. Misc comment fixes, including
referring to the correct kind of check (elaboration, not
*, restrict.adb,, Minor
reformatting and comment fixes.
2021-07-07 Piotr Trojanek <>
* sem_prag.adb (Analyze_Pragma): Simplify processing of pragma
2021-07-07 Arnaud Charlet <>
* libgnat/g-debpoo.adb (Code_Address_For_Allocate_End): Default
2021-07-07 Arnaud Charlet <>
* libgnat/, libgnat/s-atocou__builtin.adb: Code
2021-07-07 Gary Dismukes <>
* freeze.adb (Check_Inherited_Conditions): Setting of Ekind,
LSP_Subprogram, and Is_Wrapper needs to happen for null
procedures as well as other wrapper cases, so the code is moved
from the else part in front of the if statement. (Fixes a
latent bug encountered while working on this set of changes.)
* sem_attr.adb (Resolve_Attribute): Report an error for the case
of an Access attribute applied to a primitive of an abstract
type when the primitive has any nonstatic Pre'Class or
Post'Class expressions.
* sem_ch8.adb (Analyze_Subprogram_Renaming): Report an error for
the case of a actual subprogram associated with a nonabstract
formal subprogram when the actual is a primitive of an abstract
type and the primitive has any nonstatic Pre'Class or Post'Class
* sem_disp.adb (Check_Dispatching_Context): Remove special
testing for null procedures, and replace it with a relaxed test
that avoids getting an error about illegal calls to abstract
subprograms in cases where RM 6.1.1(7/5) applies in
Pre/Post'Class aspects. Also, remove special test for
Postcondition, which seems to be unnecessary, update associated
comments, and fix a typo in one comment.
(Check_Dispatching_Call): Remove an unneeded return statement,
and report an error for the case of a nondispatching call to a
nonabstract subprogram of an abstract type where the subprogram
has nonstatic Pre/Post'Class aspects.
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function.
(In_Pre_Post_Condition): Add a flag formal Class_Wide_Only,
defaulted to False, for indicating whether the function should
only test for the node being within class-wide pre- and
* sem_util.adb
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function
to determine whether a subprogram is a primitive of an abstract
type where the primitive has class-wide Pre/Post'Class aspects
specified with nonstatic expressions.
(In_Pre_Post_Condition): Extend testing to account for the new
formal Class_Wide_Only.
2021-07-07 Piotr Trojanek <>
* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Errors
emitted via Check_Volatility_Compatibility are now emitted at
Actual, just like other errors emitted by
2021-07-07 Piotr Trojanek <>
* uname.adb (Get_Unit_Name): Simplify with a bounded string
buffer; also, this addresses a ??? comment about the max length
being exceeded.
2021-07-07 Piotr Trojanek <>
* uname.adb (Get_Body_Name, Get_Parent_Body_Name,
Get_Parent_Spec_Name, Get_Spec_Name, Is_Child_Name,
Is_Body_Name, Is_Spec_Name, Name_To_Unit_Name): Use a local
instead of the global buffer.
2021-07-07 Bob Duff <>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Combine
processing of Size and Value_Size clauses. Ensure that
Value_Size is treated the same as Size, in the cases where both
are allowed (i.e. the prefix denotes a first subtype). Misc
* einfo-utils.adb (Init_Size): Add assertions.
(Size_Clause): Return a Value_Size clause if present, instead of
just looking for a Size clause.
* (Has_Size_Clause, Size_Clause): Change documentation
to include Value_Size.
*,, layout.adb: Comment modifications.
2021-07-07 Steve Baird <>
* exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies): Add
TSS_Put_Image to list of predefined primitives that need special
(Build_General_Calling_Stubs, Build_Subprogram_Receiving_Stubs):
Remove previous hack for dealing with TSS_Put_Image procedures.
2021-07-07 Dmitriy Anisimkov <>
* libgnat/g-socket.adb (Get_Socket_Option): Add 500ms only when
Minus_500ms_Windows_Timeout is True.
(Set_Socket_Option): Use "* 1000" instead of "/ 0.001" to
convert to milliseconds.
2021-07-07 Bob Duff <>
* tbuild.adb (Unchecked_Convert_To): Set the Parent of the new
node to the Parent of the old node.
* (Unchecked_Convert_To): Document differences
between Convert_To and Unchecked_Convert_To. The previous
documentation claimed they are identical except for the
uncheckedness of the conversion.
2021-07-07 Yannick Moy <>
* checks.adb (Apply_Scalar_Range_Check): Remove special case for
GNATprove mode.
* sem_res.adb (Resolve_Arithmetic_Op): Same.
* sem_util.adb (Apply_Compile_Time_Constraint_Error): Same.
2021-07-07 Piotr Trojanek <>
* sem_ch6.adb (Check_For_Primitive_Subprogram): Move
declarations of local variables after nested subprogram bodies.
2021-07-07 Piotr Trojanek <>
* exp_disp.adb (CPP_Num_Prims): Reuse List_Length.
2021-07-07 Piotr Trojanek <>
* exp_ch3.adb, exp_ch6.adb, sem_ch6.adb: Replace Ekind
membership test in Private_Kind with a call to Is_Private_Type.
2021-07-07 Bob Duff <>
* gen_il-gen-gen_entities.adb: Remove Linker_Section_Pragma
field from Record_Field_Kind. Minor comment improvement.
2021-07-07 Yannick Moy <>
* libgnat/ (Cot): Fix precondition.
2021-07-07 Piotr Trojanek <>
* par.adb (Par): A local Name variable is now a renaming of a
constant slice.
2021-07-07 Piotr Trojanek <>
* gnat1drv.adb (Gnat1drv): Remove flagging of main unit and its
corresponding spec as requiring code generation; now the flags
are set much earlier.
* lib-load.adb (Load_Main_Source): Set Generate_Code flag on the
main unit source.
(Make_Instance_Unit): Copy Generate_Code flag from the main unit
to instance units.
* lib-writ.adb (Write_ALI): Remove redundant condition;
Generate_Code flag is always set for the main unit.
* par-load.adb (Load): Set Generate_Code flag on the main unit's
corresponding spec, if any.
2021-07-07 Dmitriy Anisimkov <>
* libgnat/ (Option_Name): Add Keep_Alive_Count,
Keep_Alive_Idle, and Keep_Alive_Interval items to enumeration.
(Option_Type): Add Keep_Alive_Count, Keep_Alive_Idle, and
Keep_Alive_Interval alternatives to the case of discriminated
* libgnat/g-socket.adb (Options): Add Keep_Alive_Count,
Keep_Alive_Idle, and Keep_Alive_Interval to items enumerator to
OS constant converter.
(Set_Socket_Option): Process Keep_Alive_Count, Keep_Alive_Idle,
and Keep_Alive_Interval socket options.
(Get_Socket_Option): Idem.
2021-07-07 Piotr Trojanek <>
* lib-writ.adb (Write_ALI): Exit from loop after seeing first
unit that violates No_Elaboration_Code restriction.
2021-07-07 Piotr Trojanek <>
* inline.adb (Instantiate_Bodies): Fix white in declaration.
(Remove_Dead_Instance): Change iteration from WHILE to FOR.
2021-07-07 Bob Duff <>
* checks.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb,
exp_ch9.adb, exp_disp.adb, exp_util.adb, inline.adb,
sem_res.adb: Change all calls to Make_Unchecked_Type_Conversion
to call Unchecked_Convert_To instead. This involves removing
New_Occurrence_Of on the first parameter, because
Unchecked_Convert_To expects a type entity, rather than the name
of one. Also, removed calls to Relocate_Node, because
Unchecked_Convert_To takes care of that.
* Change comment to be worded more firmly.
2021-07-07 Steve Baird <>
* libgnarl/s-tassta.adb (Free_Task): Acquire the Task_Lock
before, rather than after, querying the task's Terminated flag.
Add a corresponding Task_Unlock call.
2021-07-06 Bob Duff <>
* (Current_Error_Node): Initialize to Empty.
2021-07-06 Steve Baird <>
* exp_put_image.adb: Eliminate references to
Debug_Flag_Underscore_Z. Change the meaning of the function
Enable_Put_Image. Previously, a result of False for a tagged
type would mean that the type does not get a Put_Image (PI)
routine at all. Now, it means that the type gets a PI routine
with very abbreviated functionality (just a call to
Unknown_Put_Image). This resolves problems in mixing code
compiled with and without the -gnat2022 switch.
* exp_ch3.adb: Enable_Put_Image no longer participates in
determining whether a tagged type gets a Put_Image procedure. A
tagged type does not get a Put_Image procedure if the type
Root_Buffer_Type is unavailable. This is needed to support cross
targets where tagged types are supported but the type
Root_Buffer_Type is not available.
* exp_dist.adb: Add workarounds for some problems that arise
when using the (obsolete?) Garlic implementation of the
distributed systems annex with Ada 2022 constructs.
* libgnat/ Workaround a bootstrapping problem.
Older compilers do not support raise expressions, so revise the
the Pre'Class condition to meet this requirement without
changing the condition's behavior at run time.
2021-07-06 Eric Botcazou <>
* repinfo-input.adb (JSON_Entity_Kind, Read_Variant_Part): Fix
typo in comment.
2021-07-06 Steve Baird <>
* sem_ch5.adb (Analyze_Assignment): Add new nested function,
Omit_Range_Check_For_Streaming, and make call to
Apply_Scalar_Range_Check conditional on the result of this new
* exp_attr.adb (Compile_Stream_Body_In_Scope): Eliminate Check
parameter, update callers. The new
Omit_Range_Check_For_Streaming parameter takes the place of the
old use of calling Insert_Action with Suppress => All_Checks,
which was insufficiently precise (it did not allow suppressing
checks for one component but not for another).
(Expand_N_Attribute_Reference): Eliminate another "Suppress =>
All_Checks" from an Insert_Action call, this one in generating
the expansion of a T'Read attribute reference for a composite
type T.
2021-07-06 Ghjuvan Lacambre <>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Check for
empty loops caused by constraints.
2021-07-06 Nicolas Roche <>
* rtinit.c (skip_quoted_string): Handle malformed command line
with no closing double quote.
(skip_argument): Handle case in which a null character is
encountered by skip_quote_string.
2021-07-06 Piotr Trojanek <>
* uname.adb (Add_Node_Name): Replace local constant whose
initial expression was evaluated even when unnecessary with just
that expression that is evaluated at most once and only when
2021-07-06 Piotr Trojanek <>
* lib.adb (Remove_Unit): Replace defensive code with an
* par-load.adb (Load): Address a question mark in the comment.
2021-07-06 Piotr Trojanek <>
* sem_util.adb (Enclosing_Comp_Unit_Node): When the loop exits
the Current_Node is either an N_Compilation_Unit node or Empty,
so simply return it without redundant checks.
2021-07-06 Piotr Trojanek <>
* lib-load.adb (Load_Unit): Remove excessive whitespace.
* lib.adb (Is_Internal_Unit, Is_Predefined_Unit): Likewise.
* par-ch10.adb (P_Compilation_Unit): Simplify with membership
* par-load.adb (Load): Likewise.
* uname.adb (Get_Unit_Name): Likewise.
2021-07-06 Piotr Trojanek <>
* lib-writ.adb (Ensure_System_Dependency): Simplify by reusing a
constant name.
2021-07-06 Steve Baird <>
* exp_ch5.adb
When generating an equality test for a statically known discrete
value, only generate the numeric value if the discrete type is
not an enumeration type. If it is an enumeration type, then
call Get_Enum_Lit_From_Pos instead.
2021-07-06 Justin Squirek <>
* par-ch6.adb (Get_Return_Kind): Removed.
(Is_Extended): Created to identify simple and "when" return
statements from extended return statements.
(P_Return_Statement): Merged simple and "when" return statement
2021-07-06 Gary Dismukes <>
* sem_ch4.adb (Try_One_Prefix_Interpretation): Augment test of
"not Extensions_Allowed" with test for absence of Obj_Type's
primitive operations Elist, as an additional condition for early
return from this procedure.
2021-07-06 Gary Dismukes <>
* exp_ch4.adb (Process_Transient_In_Expression): In one comment,
fix two typos and reorder wording of one sentence, plus minor
2021-07-06 Justin Squirek <>
* exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove
legacy expansion of element iterators, and use expansion form
used by unconstrained element types in the general case.
2021-07-06 Ed Schonberg <>
* exp_ch4.adb (Process_Transient_In_Expression): Ensure that
Fin_Context, used to insert finalization code for the
expression, is a list member: the value returned by
Find_Hook_Context may be an expression node when the transient
is part of a larger expression and it has a non-boolean type.
2021-07-06 Yannick Moy <>
* sem_case.adb: Fix error message.
2021-07-06 Bob Duff <>
* tbuild.adb (Convert_To): Add assert, along with a comment.
(Make_DT_Access): Remove this function, which is not used. It
was incorrect anyway (the call to New_Occurrence_Of should not
be there).
(Unchecked_Convert_To): Add assert. The previous version's test
for unchecked conversion to the same type was redundant and
could never be true, because the previous 'if' already checked
for ANY expression of the same type. Remove that, and replace
with a test for unchecked conversion to a related type.
Otherwise, we somethings get things like
"finalize(some_type!(some_type!(x)))" in the generated code,
where x is already of type some_type, but we're converting it to
the private type and then to the full type or vice versa (so the
types aren't equal, so the previous 'if' doesn't catch it).
Avoid updating the Parent. This is not necessary; the Parent
will be updated if/when the node is attached to the tree.
* Fix comments. No need to say "this is safe" when
we just explained that a few lines earlier. Remove
* Add comments.
* exp_ch7.adb (Make_Finalize_Address_Stmts): Minor comment fix.
* gen_il-gen.adb,, gen_il-gen-gen_nodes.adb, Implement a feature where you can put:
Nmake_Assert => "expr" where expr is a boolean expression in a
call to Create_Concrete_Node_Type. It is added in a pragma
Assert in the Nmake.Make_... function for that type.
2021-07-06 Gary Dismukes <>
* checks.adb: Remove calls of Set_Do_Tag_Check (N, False).
* Remove hanging unneeded ??? comment ("this real description
was clobbered").
* (Insert_Actions_After): Remove ??? from spec comment.
* (Opt_Field_Enum): Remove literals
Do_Accessibility_Check and Do_Tag_Check.
* gen_il-gen-gen_nodes.adb: Remove all calls to Sm for
Do_Accessibility_Check and Do_Tag_Check.
* (Is_Subtype_Of): Remove obsolete ???
comment (function is not limited to scalar subtypes).
* (Is_Local_Variable_Reference): Revise comment to
mention out-mode parameters as well, and remove ???.
(Propagate_Concurrent_Flags): Minor reformatting.
(Propagate_Invariant_Attributes): Typo fix.
(Propagate_Predicate_Attributes): Indicate what is propagated
and remove ??? comment.
* sem_util.adb (Cannot_Raise_Constraint_Error): Remove unneeded
test of Do_Tag_Check.
(Is_Local_Variable_Reference): Extend function to testing for
formals of mode out as well.
* Remove ??? comment about flag
Convert_To_Return_False indicating that the flag is obsolete (in
fact it's used). Remove references to Do_Accessibility_Check and
Do_Tag_Check (and the two associated ??? comments), as these
flags are unneeded.
* sinfo-cn.adb (Change_Conversion_To_Unchecked): Remove call of
Set_Do_Tag_Check (N, False).
* (Support_Atomic_Primitives_On_Target): Remove ???
comment, plus minor reformatting.
2021-07-06 Justin Squirek <>
* par-ch6.adb (Get_Return_Kind): Properly handle the case of a
"return when" statement in the procedure case.
2021-07-06 Bob Duff <>
* (Node_To_Be_Wrapped): Minor comment fix.
* exp_ch7.adb (Establish_Transient_Scope): Misc cleanups and
comment improvements.
(Set_Node_To_Be_Wrapped): Remove -- not worth putting this code
in a separate procedure, called only once.
* sem_util.adb (Requires_Transient_Scope): Assert that our
parameter has the right Kind. It probably shouldn't be E_Void,
but that is passed in in some cases.
(Ensure_Minimum_Decoration): Move the call later, so we know Typ
is Present, and remove "if Present (Typ)" from this procedure.
* exp_aggr.adb (Convert_To_Assignments): Use membership test,
and avoid the "if False" idiom.
(Expand_Array_Aggregate): Remove a ??? comment.
* sem_ch8.adb (Push_Scope): Take advantage of the full coverage
rules for aggregates.
* sem_res.adb (Resolve_Declare_Expression): Remove test for
Is_Type -- that's all it can be. Use named notation in call to
* libgnat/a-cdlili.adb (Adjust): Remove redundant code.
(Clear): Remove "pragma Warnings (Off);", which wasn't actually
suppressing any warnings.
2021-07-06 Bob Duff <>
* gen_il-gen-gen_nodes.adb: Change the parent of
N_Exception_Declaration to be N_Declaration. Minor comment fix.
2021-07-06 Ed Schonberg <>
* exp_ch4.adb (Expand_N_Type_Conversion): If the conversion is
the name of an assignment operation do not apply predicate check
to it prior to the assignment.
2021-07-06 Bob Duff <>
* libgnat/a-conhel.adb: Assert that tampering counts remain
between 0 and 2**31-1. This makes debugging of
finalization-related bugs easier.
2021-07-06 Doug Rupp <>
* Makefile.rtl (LIBGNAT_TARGET_PAIRS): Use s-osprim__posix.adb
vice s-osprim__vxworks.adb for all vxworks7r2 targets.
2021-07-06 Richard Kenner <>
* (Void_Or_Type_Kind,
Exception_Or_Object_Kind): Declare.
* gen_il-gen-gen_entities.adb: Likewise.
2021-07-06 Gary Dismukes <>
* doc/gnat_rm/implementation_defined_pragmas.rst: Add a
description of the feature of prefixed-view calls for untagged
types to the section on pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
* Update specification for
Direct_Primitive_Operations to reflect its use for untagged
types when Extensions_Allowed is True.
* gen_il-gen-gen_entities.adb: Allow Direct_Primitive_Operations
as a field of untagged classes of types by removing the "Pre"
test of "Is_Tagged_Type (N)", and making that field generally
available for all types and subtypes by defining it for
Type_Kind and removing its specification for individual classes
of types.
* sem_ch3.adb (Analyze_Full_Type_Declaration): Initialize the
Direct_Primitive_Operations list when not already set for the
new (sub)type and its base type (except when Ekind of the type
is E_Void, which can happen due to errors in cases where
Derived_Type_Declaration is called and perhaps in other
(Analyze_Subtype_Declaration): Inherit
Direct_Primitive_Operations list from the base type, for record
and private cases.
(Build_Derived_Record_Type): Initialize the
Direct_Primitive_Operations list for derived record and private
(Build_Derived_Type): Initialize the Direct_Primitive_Operations
list for derived types (and also for their associated base types
when needed).
(Process_Full_View): For full types that are untagged record and
private types, copy the primitive operations of the partial view
to the primitives list of the full view.
* sem_ch4.adb (Analyze_Selected_Component): Allow prefixed
notation for subprogram calls in the case of untagged
types (when Extensions_Allowed is True). In the case where
Is_Private_Type (Prefix_Type) is True, call Try_Object_Operation
when a discriminant selector wasn't found. Also call
Try_Object_Operation in other type kind cases (when
Extensions_Allowed is True).
(Try_Object_Operation.Try_One_Prefixed_Interpretation): Prevent
early return in the untagged case (when Extensions_Allowed is
True). Condition main call to Try_Primitive_Operation on the
type having primitives, and after that, if Prim_Result is False,
test for case where the prefix type is a named access type with
primitive operations and in that case call
Try_Primitive_Operation after temporarily resetting Obj_Type to
denote the access type (and restore it to the designated type
after the call)
(Try_Object_Operation.Valid_First_Argument_Of): Do matching type
comparison by testing Base_Type (Obj_Type) against
Base_Type (Typ), rather than against just Typ, to properly
handle cases where the object prefix has a constrained
subtype. (Fixes a bug discovered while working on this
* sem_ch6.adb
(New_Overloaded_Entity.Check_For_Primitive_Subprogram): Add a
primitive of an untagged type to the type's list of primitive
operations, for both explicit and implicit (derived, so
Comes_From_Source is False) subprogram declarations. In the case
where the new primitive overrides an inherited subprogram,
locate the primitives Elist that references the overridden
subprogram, and replace that element of the list with the new
subprogram (done by calling the new procedure
Add_Or_Replace_Untagged_Primitive on the result type and each
formal atype).
New nested procedure to either add or replace an untagged
primitive subprogram in a given type's list of primitive
operations (replacement happens in case where the new subprogram
overrides a primitive of the type).
* sem_ch7.adb (New_Private_Type): When Extensions_Allowed is
True, initialize the Direct_Primitive_Operations list of a
private type to New_Elmt_List in the case of untagged types.
* sem_ch8.adb (Find_Selected_Component): In the case where the
prefix is an entity name, relax condition that tests
Has_Components so that Analyze_Selected_Component will also be
called when Extensions_Allowed is True and the prefix type is
any type.
2021-07-06 Ed Schonberg <>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not perform
conformance check when the subprogram body has been created for
an expression function that is not a completion of a previous
specification, because the profile of the constructed body is
copied from the expression function itself.
2021-07-06 Steve Baird <>
* doc/gnat_rm/implementation_of_specific_ada_features.rst: Add a
warning indicating that the details of the default (i.e.,
selected by the compiler) implementation of T'Put_Image for a
nonscalar type T are subject to change.
* gnat_rm.texi: Regenerate.
2021-07-05 Pierre-Marie de Rodat <>
* gnat-style.texi, gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-07-05 Piotr Trojanek <>
* sem_prag.adb (Analyze_Depends_In_Decl_Part): Reject overlays
in Depends and Refined_Depends contracts.
(Analyze_Global_In_Decl_Part): Likewise for Global and
(Analyze_Initializes_In_Decl_Part): Likewise for Initializes
(when appearing both as a single item and as a initialization