blob: 56d9baf7e7a67aa21147bcea796b6745929370cf [file] [log] [blame]
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
* (Ultimate_Overlaid_Entity): New routine.
* sem_util.adb (Report_Unused_Body_States): Ignore overlays.
(Ultimate_Overlaid_Entity): New routine.
2021-07-05 Claire Dross <>
* libgnat/, libgnat/a-cfdlli.adb
libgnat/, libgnat/a-cfinve.adb,
libgnat/, libgnat/a-cofove.adb,
libgnat/, libgnat/a-coboho.adb (Constant_Reference):
Get a read-only access to an element of the container.
(At_End): Ghost functions used to express pledges in the
postcondition of Reference.
(Reference): Get a read-write access to an element of the
* libgnat/, libgnat/a-cfhama.adb,
libgnat/, libgnat/a-cforma.adb: The full view of the
Map type is no longer a tagged type, but a wrapper over this
tagged type. This is to avoid issues with dispatching result in
At_End functions.
(Constant_Reference): Get a read-only access to an element of
the container.
(At_End): Ghost functions used to express pledges in the
postcondition of Reference.
(Reference): Get a read-write access to an element of the
* libgnat/, libgnat/a-cfhase.adb,
libgnat/, libgnat/a-cforse.adb: The full view of the
Map type is no longer a tagged type, but a wrapper over this
tagged type.
(Constant_Reference): Get a read-only access to an element of
the container.
* libgnat/, libgnat/ (Copy_Element):
Expression function used to cause SPARK to make sure
Element_Type is copiable.
* libgnat/ (Copy_Key): Expression function used to
cause SPARK to make sure Key_Type is copiable.
(Copy_Element): Expression function used to cause SPARK to make
sure Element_Type is copiable.
2021-07-05 Yannick Moy <>
* sem_prag.adb (Analyze_Global_Item): Adapt to update SPARK RM
2021-07-05 Arnaud Charlet <>
* Add -f switch to ensure cp will never fail.
2021-07-05 Steve Baird <>
* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): When
building the assignment statement corresponding to the default
expression for a component, we make a copy of the expression.
When making that copy (and if we have seen a component that
requires late initialization), pass a Map parameter into the
call to New_Copy_Tree to redirect references to the type to
instead refer to the _Init formal parameter of the init proc.
This includes hoisting the declaration of Has_Late_Init_Comp out
one level so that it becomes available to Build_Assignment.
(Find_Current_Instance): Return True for other kinds of current
instance references, instead of just access-valued attribute
references such as T'Access.
* sem_util.adb (Is_Aliased_View): Return True for the _Init
formal parameter of an init procedure. The changes in
exp_ch3.adb can have the effect of replacing a "T'Access"
attribute reference in an init procedure with an "_Init'Access"
attribute reference. We want such an attribute reference to be
legal. However, we do not simply mark the formal parameter as
being aliased because that might impact callers.
(Is_Object_Image): Return True if Is_Current_Instance returns
True for the prefix of an Image (or related attribute) attribute
2021-07-05 Piotr Trojanek <>
* exp_ch3.adb (Stream_Operation_OK): Reuse
* sem_ch3.adb (Analyze_Interface_Declaration,
Build_Derived_Record_Type): Likewise.
* sem_ch6.adb (Check_Limited_Return): Likewise.
* sem_util.adb (Is_Concurrent_Interface): Don't call
Is_Interface because each of the Is_Protected_Interface,
Is_Synchronized_Interface and Is_Task_Interface calls it anyway.
2021-07-05 Ghjuvan Lacambre <>
* sem_ch6.adb (Check_Limited_Return): Replace Comes_From_Source
with Comes_From_Extended_Return_Statement.
2021-07-05 Steve Baird <>
* libgnat/a-stobbu.adb, libgnat/,
libgnat/a-stobfi.adb, libgnat/,
libgnat/a-stoubu.adb, libgnat/,
libgnat/a-stoufi.adb, libgnat/,
libgnat/a-stoufo.adb, libgnat/,
libgnat/a-stouut.adb, libgnat/,
libgnat/ Delete files.
* Makefile.rtl, impunit.adb: Remove references to deleted files.
2021-07-05 Piotr Trojanek <>
* sem_util.adb (Has_Compatible_Alignment_Internal): If the
prefix of the Address expression is an entire object with a
known alignment, then skip checks related to its size.
2021-07-05 Doug Rupp <>
* libgnat/ Import OS_Time comparison ops as
* libgnat/s-os_lib.adb: Remove OS_TIme comparison ops
2021-07-05 Doug Rupp <>
* libgnat/ Add some comments about time_t.
* libgnat/s-os_lib.adb (GM_Split/To_GM_Time): Rename formal to
(GM_Time_Of/To_OS_Time): Likewise.
2021-07-05 Ghjuvan Lacambre <>
* sem_res.adb (Resolve): Insert minus sign if needed.
2021-07-05 Steve Baird <>
* exp_put_image.adb:
(Enable_Put_Image, Preload_Root_Buffer_Type): Revert to querying
the -gnatd_z switch, as opposed to testing whether Ada_Version >= Ada_2022.
2021-07-05 Justin Squirek <>
* checks.adb (Accessibility_Checks_Suppressed): Add check
against restriction No_Dynamic_Accessibility_Checks.
(Apply_Accessibility_Check): Add assertion to check restriction
No_Dynamic_Accessibility_Checks is not active.
* debug.adb: Add documentation for new debugging switch to
control which accessibility model gets employed under
restriction No_Dynamic_Accessibility_Checks.
* exp_attr.adb (Expand_N_Attribute_Reference): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
* exp_ch4.adb (Apply_Accessibility_Check): Skip check generation
when restriction No_Dynamic_Accessibility_Checks is active.
(Expand_N_Allocator): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_In): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_Type_Conversion): Disable dynamic accessibility checks
when No_Dynamic_Accessibility_Checks is active.
* exp_ch5.adb (Expand_N_Assignment_Statement): Disable
alternative accessibility model calculations when computing a
dynamic level for a SAOAAT.
* exp_ch6.adb (Add_Call_By_Copy_Code): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
(Expand_Branch): Disable alternative accessibility model
(Expand_Call_Helper): Disable alternative accessibility model
* restrict.adb, Add new restriction
(No_Dynamic_Accessibility_Checks_Enabled): Created to test when
experimental features (which are generally incompatible with
standard Ada) can be enabled.
* sem_attr.adb (Safe_Value_Conversions): Add handling of new
accessibility model under the restriction
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Disallow new restriction No_Dynamic_Accessibility_Checks from
being exclusively specified within a body or subunit without
being present in a specification.
* sem_res.adb (Check_Fully_Declared_Prefix): Minor comment
(Valid_Conversion): Omit implicit conversion checks on anonymous
access types and perform static checking instead when
No_Dynamic_Accessibility_Checks is active.
* sem_util.adb, (Accessibility_Level): Add special
handling of anonymous access objects, formal parameters,
anonymous access components, and function return objects.
(Deepest_Type_Access_Level): When
No_Dynamic_Accessibility_Checks is active employ an alternative
model. Add paramter Allow_Alt_Model to override the new behavior
in certain cases.
(Type_Access_Level): When No_Dynamic_Accessibility_Checks is
active employ an alternative model. Add parameter
Allow_Alt_Model to override the new behavior in certain cases.
(Typ_Access_Level): Created within Accessibility_Level for
* libgnat/, Add handing for
2021-07-05 Doug Rupp <>
* adaint.h (__gnat_set_file_time_name): Use OS_Time.
* adaint.c (__gnat_set_file_time_name): Likewise.
2021-07-05 Doug Rupp <>
* adaint.h (OS_Time): typedef as long long.
* osint.adb (Underlying_OS_Time): Declare as 64-bit signed type.
* libgnat/s-os_lib.adb ("<"): Compare OS_Time as
("<="): Likewise.
(">"): Likewise.
(">="): Likewise.
* libgnat/ (OS_Time): Declare as 64-bit signed type.
2021-07-05 Ghjuvan Lacambre <>
* sem_ch3.adb (Check_Abstract_Overriding): Post error message on
renaming node.
2021-07-05 Yannick Moy <>
* libgnat/ Add Depends/Post to
* sem_ch4.adb (Analyze_Allocator): Remove checking of allocator
* sem_res.adb (Flag_Object): Same.
2021-07-05 Ghjuvan Lacambre <>
* Add GNAT_Annotate aspect.
* gnat1drv.adb (Adjust_Global_Switches): Stop defining
Name_Gnat_Annotate as an alias of Name_Annotate.
* Define Gnat_Annotate.
* par-prag.adb, Add Pragma_Gnat_Annotate to list
of pragmas.
* lib-writ.adb, sem_ch13.adb, sem_prag.adb: Handle Gnat_Annotate
like Aspect_Annotate.
2021-07-05 Piotr Trojanek <>
* (Target_Strict_Alignment): Fix comment.
2021-07-05 Piotr Trojanek <>
* sem_util.adb (Has_Compatible_Alignment_Internal): Fix
indentation of ELSIF comments; remove explicit calls to
UI_To_Int; remove extra parens around the MOD operand.
2021-07-05 Ed Schonberg <>
* sem_aggr.adb (Resolve_Record_Aggregate, Step_5): Do not check
for the need to use an extension aggregate for a given component
when within an instance and the type of the component hss a
private ancestor: the instantiation is legal if the generic
compiles, and spurious errors may be generated otherwise.
2021-07-05 Ghjuvan Lacambre <>
* errout.adb (Output_JSON_Message): Recursively call
Output_JSON_Message for continuation messages instead of
appending their content to the initial message.
2021-07-05 Steve Baird <>
* debug.adb: Remove comments about -gnatd_z switch.
* exp_ch3.adb (Make_Predefined_Primitive_Specs): A one-line fix
for a subtle bug that took some effort to debug. Append a new
Put_Image procedure for a type extension even if it seems to
already have one, just as is done for (for example) the
streaming-related Read procedure.
* exp_put_image.adb:
(Build_Record_Put_Image_Procedure.Make_Component_Attributes): Do
not treat _Parent component like just another component, for two
reasons. 1. If the _parent component's type has a
user-specified Put_Image procedure, then we want to generate a
call to that procedure and then generate extension aggregate
syntax. 2. Otherwise, we still don't want to see any mention of
"_parent" in the generated image text.
(Build_Record_Put_Image_Procedure.Make_Component_Name): Add
assertion that we are not generating a reference to an "_parent"
(Build_Record_Put_Image_Procedure): Add special treatment for
null records. Add call to Duplicate_Subexpr for image attribute
prefix in order to help with expansion needed in the class-wide
case (where the prefix is also referenced in the call to
Wide_Wide_Expanded_Name) if evaluation of the prefix has side
effects. Add new local helper function, Put_String_Exp. Add
support for case where prefix type is class-wide.
(Enable_Put_Image, Preload_Root_Buffer_Type): Query Ada_Version
> Ada_2022 instead of (indirectly) querying -gnatd_z switch.
* freeze.adb (In_Expanded_Body): A one-line change to add
TSS_Put_Image to the list of subprograms that have
expander-created bodies.
* Add support for accessing
*, sem_ch3.adb: Delete Is_Null_Extension function,
as part of moving it to Sem_Util.
* sem_ch13.adb
(Analyze_Put_Image_TSS_Definition.Has_Good_Profile): Improve
diagnostic messages in cases where the result is going to be
False and the Report parameter is True. Relax overly-restrictive
checks in order to implement mode conformance.
(Analyze_Stream_TSS_Definition.Has_Good_Profile): Add similar
relaxation of parameter subtype checking for the Stream
parameter of user-defined streaming subprograms.
* sem_disp.adb (Check_Dispatching_Operation): A one-line
change (and an accompanying comment change) to add TSS_Put_Image
to the list of compiler-generated dispatching primitive
*, sem_util.adb: Add Ignore_Privacy Boolean
parameter to Is_Null_Record_Type function (typically the
parameter will be False when the function is being used in the
implementation of static semantics and True for dynamic
semantics; the parameter might make a difference in the case of,
for example, a private type that is implemented as a null record
type). Add related new routines Is_Null_Extension (formerly
declared in Sem_Ch3), Is_Null_Extension_Of, and
2021-07-05 Justin Squirek <>
* freeze.adb (Freeze_Profile): Use N's Sloc, F_type's chars.
2021-07-05 Bob Duff <>
* checks.adb, exp_aggr.adb, exp_ch5.adb, freeze.adb,
sem_util.adb, Change L and H to be First and Last,
to match the attributes in the RM. Change calls from procedure
to function where appropriate.
2021-07-05 Bob Duff <>
*, sem_util.adb (Compute_Returns_By_Ref): New
procedure to compute Returns_By_Ref, to avoid some code
duplication. This will likely change soon, so it's good to have
the code in one place.
(CW_Or_Has_Controlled_Part): Move here from Exp_Ch7, because
it's called by Compute_Returns_By_Ref, and this is a better
place for it anyway.
(Needs_Finalization): Fix comment to be vague instead of wrong.
* exp_ch6.adb (Expand_N_Subprogram_Body, Freeze_Subprogram):
Call Compute_Returns_By_Ref.
* sem_ch6.adb (Check_Delayed_Subprogram): Call
*, exp_ch7.adb (CW_Or_Has_Controlled_Part): Move to
(Has_New_Controlled_Component): Remove unused function.
2021-07-05 Ghjuvan Lacambre <>
* sem_ch3.adb (Check_Abstract_Overriding): Check for renamings.
2021-07-05 Boris Yakobowski <>
* exp_ch4.adb (Expand_N_Op_Rem): Remove special case for rem -1
in CodePeer_Mode.
2021-07-01 Eric Botcazou <>
PR ada/101094
* exp_attr.adb (Get_Integer_Type): Return an integer type with the
same signedness as the input type.
2021-06-29 Richard Kenner <>
* sem_util.adb (Visit_Node): Add handling for N_Block_Statement
with declarations.
2021-06-29 Piotr Trojanek <>
* einfo-utils.adb
(Unknown_Alignment): Simply negate the Known_ counterpart.
(Unknown_Component_Bit_Offset): Likewise.
(Unknown_Esize): Likewise.
(Unknown_Normalized_First_Bit): Likewise.
(Unknown_Normalized_Position): Likewise.
(Unknown_Normalized_Position_Max): Likewise.
(Unknown_RM_Size): Likewise.
2021-06-29 Boris Yakobowski <>
* exp_ch4.adb (Expand_N_Op_Mod): Remove special case for mod -1
in CodePeer_Mode.
2021-06-29 Aleksandra Pasek <>
* libgnat/s-objrea.adb (EM_AARCH64): New Constant.
(Initialize): Handle EM_AARCH64 case.
(Read_Address): Handle AARCH64 case.
* libgnat/ (Object_Arch): Add AARCH64 record
2021-06-29 Bob Duff <>
* sem_ch13.adb (Analyze_Record_Representation_Clause): Call
Set_Entity_With_Checks instead of Set_Entity, so we perform the
check for correct casing.
* style.adb (Check_Identifier): Minor comment improvement.
Cleanup overly complicated code.
2021-06-29 Ed Schonberg <>
* exp_aggr.adb (Convert_Aggr_In_Object_Decl): After expansion of
the aggregate, the expression can be removed from the
declaration, except if the object is class-wide, in which case
the aggregate provides the actual type. In other cases the
presence of the expression may lead to spurious freezing issue.
* exp_ch3.adb (Expand_N_Object_Declaration): If the expression
in the declaration is an aggregate with delayed expansion (as is
the case for objects of a limited type, or a subsequent address
specification) the aggregate must be resolved at this point.
This resolution must not include expansion, because the
expansion of the enclosing declaration will construct the
necessary aggregate expansion.
2021-06-29 Piotr Trojanek <>
* (Adjust_Name_Case): Remove obsolete and now unused
* errout.adb (Adjust_Name_Case): Likewise; fix variant that uses
a custom buffer to also use it for names in Standard_Location.
2021-06-29 Eric Botcazou <>
* sem_ch12.adb (Freeze_Subprogram_Body): Add missing "freeze".
(Install_Body): Likewise.
2021-06-29 Piotr Trojanek <>
* adaint.c (__gnat_portable_spawn): Revert change that
introduced setting of __gnat_in_child_after_fork.
2021-06-29 Patrick Bernardi <>
* libgnarl/ (Known_Tasks): Add Atomic_Components
2021-06-29 Doug Rupp <>
* Makefile.rtl (x86_64-vx7r2) [EXTRA_GNATRTL_TASKING_OBJS]: Move
i-vxinco.o out of RTP runtime.
2021-06-29 Claire Dross <>
* libgnat/ Use pragma Assertion_Policy to disable
pre and postconditions.
* libgnat/ Likewise.
* libgnat/ Likewise.
* libgnat/ Likewise.
* libgnat/ Likewise.
* libgnat/ Likewise.
* libgnat/ Likewise.
2021-06-29 Piotr Trojanek <>
* (Get_Fullest_View): Refill comment; remove extra
extra after period.
* sem_util.adb (Get_Fullest_View): Fix style.
2021-06-29 Piotr Trojanek <>
* sem_ch3.adb (Analyze_Declarations): Remove explicit check for
missing, because a subsequent call to Is_Empty_List will detect
them anyway.
2021-06-29 Piotr Trojanek <>
* freeze.adb (Freeze_All): Simplify by reusing
* sem_ch11.adb (Analyze_Handled_Statement): Likewise.
2021-06-29 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Prevent cascaded
errors once for the subprogram call, not for every pair of
actual parameters.
2021-06-29 Piotr Trojanek <>
* sem_ch3.adb (Is_Local_Type): Simplify by reusing Scope_Within.
2021-06-29 Gary Dismukes <>
* (Can_Override_Operator): Function declaration
moved from package body to package spec.
* sem_ch6.adb (Check_Overriding_Indicator): Now use test of
whether the subprogram's Chars is an operator name, to handle
cases of function instances whose entity is
N_Defining_Identifier rather than N_Defining_Operator_Symbol.
(Can_Override_Operator): Function declaration moved to package
spec. Now use test of whether the subprogram's Chars is an
operator name, to handle cases of function instances whose
entity is N_Defining_Identifier rather than
* sem_ch8.adb (Analyze_Renamed_Subprogram): Check for
possibility of an overridden predefined operator, and suppress
the "not overriding" message in that case.
2021-06-29 Doug Rupp <>
* Makefile.rtl: Add a new ifeq for vx7r2 shared gnatlib.
2021-06-29 Piotr Trojanek <>
* exp_attr.adb (Build_Array_VS_Func): Restore uses of
(Build_Record_VS_Func): Likewise.
(Expand_N_Attribute_Reference): Likewise.
* sem_util.adb (Validated_View): Behave as an identity function
for arrays and scalars.
2021-06-29 Bob Duff <>
* atree.adb, (Parent, Set_Parent): Assert node is
(Copy_Parent, Parent_Kind): New helper routines.
* gen_il-gen.adb: Add with clause.
* nlists.adb (Parent): Assert Parent of list is Present.
* aspects.adb, checks.adb, exp_aggr.adb, exp_ch6.adb,
exp_util.adb, lib-xref-spark_specific.adb,,
sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch6.adb,
sem_dim.adb, sem_prag.adb, sem_res.adb, sem_util.adb,
treepr.adb: Do not call Parent and Set_Parent on the Empty node.
* libgnat/a-stwiun__shared.adb, libgnat/a-stzunb__shared.adb:
Minor: Fix typos in comments.
* Minor comment update.
*, sinfo-utils.adb (Parent_Kind, Copy_Parent):
New functions.
2021-06-29 Eric Botcazou <>
* repinfo-input.adb (Read_JSON_Stream): Fix typo.
2021-06-29 Eric Botcazou <>
* (RE_Id): Change RE_Valid_Enumeration_Value_NN into
(RE_Unit_Table): Adjust to above renaming.
* exp_imgv.adb (Expand_Valid_Value_Attribute): Likewise.
* libgnat/ (Invalid): Remove.
(Value_Enumeration_Pos): Move to...
* libgnat/s-valuen.adb (Value_Enumeration_Pos):
Return -1 instead of Invalid.
(Value_Enumeration): Compare against 0 instead of Invalid.
(Valid_Enumeration_Value): Likewise. Rename to...
(Valid_Value_Enumeration): ...this.
* libgnat/ (Valid_Enumeration_Value_8): Rename into...
(Valid_Value_Enumeration_8): ...this.
* libgnat/ (Valid_Enumeration_Value_16): Rename into...
(Valid_Value_Enumeration_16): ...this.
* libgnat/ (Valid_Enumeration_Value_32): Rename into...
(Valid_Value_Enumeration_32): ...this.
2021-06-29 Bob Duff <>
* (Component_Bit_Offset, Component_Size): Update
documentation: Repinfo is the package where these negative
values are documented.
* einfo-utils.adb (Known_Component_Size,
Known_Static_Component_Size, Unknown_Component_Size): Remove
calls to Implementation_Base_Type, because Component_Size is an
Impl_Base_Type_Only field (see Gen_Entities).
*, sem_ch13.adb (Check_Size): Do not set Esize and
RM_Size. This is unnecessary in the case of Size. For
Component_Size, it is wrong, because we would be setting the
Esize and RM_Size of the component type.
2021-06-29 Pascal Obry <>
* s-oscons-tmplt.c: Add some OS constants.
2021-06-29 Piotr Trojanek <>
* (Validated_View): Fix style in comment.
* sem_util.adb (Validated_View): Rewrite in recursive style.
2021-06-29 Eric Botcazou <>
* (ada/stamp-gen_il): Ignore errors from
running gen_il-main.
2021-06-29 Richard Kenner <>
* gen_il-gen-gen_entities.adb (Record_Field_Kind,
Allocatable_Kind): Add new abstract kinds.
(Constant_Or_Variable_Kind): Likewise.
(E_Constant, E_Variable, E_Loop_Parameter): Use them.
(E_Discriminant, E_Component): Likewise.
* (type Opt_Type_Enum): Add them.
2021-06-29 Bob Duff <>
* gen_il-gen.adb (Put_C_Type_And_Subtypes): Put the correct
*, gen_il-internals.adb: (Pos): Remove this
function. It was assuming that the order of the enumeration
literals in Type_Enum is the same as the order of the generated
types Node_Kind and Entity_Kind, which is not true.
2021-06-29 Piotr Trojanek <>
* exp_attr.adb (Expand_N_Attribute_Reference): Explicitly use
Validated_View for record objects.
2021-06-28 Martin Sebor <>
* gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
Replace TREE_NO_WARNING with suppress_warning.
(gnat_gimplify_expr): Same.
* gcc-interface/utils.c (gnat_pushdecl): Same.
2021-06-21 Gary Dismukes <>
* checks.adb (Selected_Range_Checks): In the case of a
qualified_expression where the qualifying subtype is an
unconstrained array subtype with fixed lower bounds for some of
its indexes, generate tests to check that those bounds are equal
to the corresponding lower bounds of the qualified array object.
2021-06-21 Bob Duff <>
* libgnat/ (Value_Enumeration,
Valid_Enumeration_Value): Inline.
(Value_Enumeration_Pos): Add Pure_Function.
2021-06-21 Justin Squirek <>
* doc/gnat_rm/implementation_defined_pragmas.rst: Document new
feature under pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
* errout.adb, (Error_Msg_GNAT_Extension): Created to
issue errors when parsing extension only constructs.
* exp_ch11.adb, (Expand_N_Raise_When_Statement):
Created to expand raise ... when constucts.
* exp_ch5.adb, (Expand_N_Goto_When_Statement):
Created to expand goto ... when constructs.
* exp_ch6.adb, (Expand_N_Return_When_Statement):
Created to expand return ... when constructs.
* expander.adb (Expand): Add case entries for "when" constructs.
* gen_il-gen-gen_nodes.adb, Add entries for
"when" constructs.
* par-ch11.adb (P_Raise_Statement): Add processing for raise ...
* par-ch5.adb (Missing_Semicolon_On_Exit): Renamed to
Missing_Semicolon_On_When and moved to par-util.adb.
* par-ch6.adb (Get_Return_Kind): Renamed from Is_Simple and
processing added for "return ... when" return kind.
(Is_Simple): Renamed to Get_Return_Kind.
(P_Return_Statement): Add case for return ... when variant of
return statement.
* par-util.adb, par.adb (Missing_Semicolon_On_When): Added to
centeralize parsing of "when" keywords in the context of "when"
* sem.adb (Analyze): Add case for "when" constructs.
* sem_ch11.adb, (Analyze_Raise_When_Statement):
Created to analyze raise ... when constructs.
* sem_ch5.adb, (Analyzed_Goto_When_Statement):
Created to analyze goto ... when constructs.
* sem_ch6.adb, (Analyze_Return_When_Statement):
Created to analyze return ... when constructs.
* sprint.adb (Sprint_Node_Actual): Add entries for new "when"
2021-06-21 Steve Baird <>
* (GEN_IL_FLAGS): Keep only GNAT flags.
(ada/stamp-gen_il): Remove dependencies on libgnat/ sources. Do not
copy libgnat/ sources locally and tidy up.
* Makefile.rtl: Include object files for new Text_Buffer units
*, exp_put_image.adb: Update Rtsfind calls to
match new specs. For example, calls to RE_Sink are replaced with
calls to RE_Root_Buffer_Type. Update comments and change
subprogram names accordingly (e.g., Preload_Sink is changed to
* impunit.adb: Add 6 new predefined units (Text_Buffers and 5
child units thereof).
*, rtsfind.adb: Add interfaces for accessing the
Ada.Strings.Text_Buffers package and declarations
therein (including the Unbounded child unit). Do not (yet)
delete interfaces for accessing the old Text_Output package.
* sem_attr.adb (Check_Put_Image_Attribute): Replace RE_Sink uses
with RE_Root_Buffer_Type and update comments accordingly.
* sem_ch10.adb (Analyze_Compilation_Unit): Update call to
reflect name change of callee (that is, the former Preload_Sink
is now Preload_Root_Buffer_Type).
* sem_ch13.adb (Has_Good_Profile): Replace RE_Sink use with
(Build_Spec): Update comment describing a parameter type.
* Remove clauses for the old Text_Output package and
add them for Ada.Streams.Stream_IO.
(Sink): Declare.
(Create_File): Likewise.
(Increase_Indent): Likewise.
(Decrease_Indent): Likewise.
(Put): Likewise.
(LF): Likewise.
* gen_il.adb: Add clauses for Ada.Streams.Stream_IO.
(Create_File): New procedure.
(Increase_Indent): Likewise.
(Decrease_Indent): Likewise.
(Put): New procedures.
* gen_il-gen.adb: Add clauses for Ada.Text_IO. Replace
Sink'Class with Sink throughout. Use string concatenation and
LF marker instead of formatted strings and "\n" marker. Update
Indent/Outdent calls to use new Increase_Indent/Decrease_Indent
(Put_Membership_Query_Decl): Remove.
* Replace Sink'Class with Sink throughout.
(Ptypes): Remove.
(Pfields): Likewise.
* gen_il-internals.adb: Remove clauses for GNAT.OS_Lib and
Ada.Strings.Text_Buffers.Files. Replace Sink'Class with Sink
throughout. Use string concatenation and LF marker instead of
formatted strings and "\n" marker.
(Stdout): Remove.
(Ptypes): Likewise.
(Pfields): Likewise.
* libgnarl/ Modify context clause, update
declaration of subtype Sink to refer to
Text_Buffers.Root_Buffer_Type instead of the old
Text_Output.Sink type.
* libgnarl/s-putaim.adb: Modify context clause and add use
clause to refer to Text_Buffers package.
* libgnat/, libgnat/a-cbdlli.adb,
libgnat/, libgnat/a-cbhama.adb,
libgnat/, libgnat/a-cbhase.adb,
libgnat/, libgnat/a-cbmutr.adb,
libgnat/, libgnat/a-cborma.adb,
libgnat/, libgnat/a-cborse.adb,
libgnat/, libgnat/a-cdlili.adb,
libgnat/, libgnat/a-cidlli.adb,
libgnat/, libgnat/a-cihama.adb,
libgnat/, libgnat/a-cihase.adb,
libgnat/, libgnat/a-cimutr.adb,
libgnat/, libgnat/a-ciorma.adb,
libgnat/, libgnat/a-ciormu.adb,
libgnat/, libgnat/a-ciorse.adb,
libgnat/, libgnat/a-coboho.adb,
libgnat/, libgnat/a-cobove.adb,
libgnat/, libgnat/a-cohama.adb,
libgnat/, libgnat/a-cohase.adb,
libgnat/, libgnat/a-coinho.adb,
libgnat/, libgnat/a-coinho__shared.adb,
libgnat/, libgnat/a-coinve.adb,
libgnat/, libgnat/a-comutr.adb,
libgnat/, libgnat/a-convec.adb,
libgnat/, libgnat/a-coorma.adb,
libgnat/, libgnat/a-coormu.adb,
libgnat/, libgnat/a-coorse.adb,
libgnat/, libgnat/a-nbnbin.adb,
libgnat/a-nbnbin__gmp.adb, libgnat/,
libgnat/a-nbnbre.adb, libgnat/,
libgnat/a-strunb.adb, libgnat/,
libgnat/a-strunb__shared.adb, libgnat/,
libgnat/s-rannum.adb: Modify Put_Image procedure used in
Put_Image aspect specification to conform to Ada profile
rules (in particular, the first parameter shall be of type
* libgnat/, libgnat/a-sttebu.adb,
libgnat/, libgnat/a-stbubo.adb,
libgnat/, libgnat/a-stbufi.adb,
libgnat/, libgnat/a-stbufo.adb,
libgnat/, libgnat/a-stbuun.adb,
libgnat/, libgnat/a-stbuut.adb: A new predefined
unit, Ada.Strings.Text_Buffers, and five child units. Two of
the five are RM-defined: Bounded and Unbounded. The remaining
three are GNAT-defined: Files, Utils, and Formatting. The buffer
type corresponding to an output file, type Files.File_Buffer, is
simpler (and perhaps therefore slower) than its predecessor.
Caching similar to what was being done before could be added
later if that seems appropriate.
* libgnat/ Modify context clause, update
declaration of subtype Sink to refer to
Text_Buffers.Root_Buffer_Type instead of the old
Text_Output.Sink type.
* libgnat/s-putima.adb: Modify context clause. Update
Indent/Outdent calls to use new Increase_Indent/Decrease_Indent
names; ditto for "Put_String => Put" name change.
* libgnat/ Delete.
2021-06-21 Eric Botcazou <>
* exp_ch5.adb (Expand_Assign_Array_Bitfield_Fast): If big-endian
ordering is in effect for the operands and they are small,
adjust the unchecked conversions done around them.
2021-06-21 Richard Kenner <>
* (Return_Statement): Add documentation.
* exp_ch6.adb (Expand_N_Extended_Return_Statement): Set it.
* Add it.
* gen_il-gen-gen_entities.adb: Add it.
2021-06-21 Bob Duff <>
*, libgnat/, libgnat/s-bituti.adb,
libgnat/ (Fast_Copy_Bitfield): New run-time library
function to copy bit fields faster than Copy_Bitfield. Cannot be
called with zero-size bit fields. Remove obsolete ??? comments
from s-bituti.adb; we already do "avoid calling this if
Forwards_OK is False".
* exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield,
Expand_Assign_Array_Bitfield_Fast): Generate calls to
Fast_Copy_Bitfield when appropriate.
* sem_util.adb, (Get_Index_Bounds): Two new
functions for getting the index bounds. These are more
convenient than the procedure of the same name, because they can
be used to initialize constants.
2021-06-21 Ed Schonberg <>
* Add Default_Subtype_Mark to enumeration
type for fields.
* gen_il-gen-gen_nodes.adb: Add call to create new field for
Formal_Type_Declaration node.
* par-ch12.adb (P_Formal_Type_Declaration): in Ada_2022 mode,
recognize new syntax for default: "or use subtype_mark".
(P_Formal_Type_Definition): Ditto for the case of a formal
incomplete type.
* Add field Default_Subtype_Mark to
* sem_ch12.adb (Validate_Formal_Type_Default): New procedure, to
apply legality rules to default subtypes in formal type
declarations. Some legality rules apply to all defaults, such as
the requirement that the default for a formal type that depends
on previous formal entities must itself be a previously declared
formal of the same unit. Other checks are kind- specific.
(Analyze_Associations): Use specified default if there is no
actual provided for a formal type in an instance.
(Analyze_Formal_Type_Declaration): Call
Validate_Formal_Type_Default when default subtype is present.
2021-06-21 Bob Duff <>
* libgnat/, libgnat/s-valuen.adb
(Value_Enumeration_Pos): New function to compute the 'Pos of the
enumeration literal for a given String. Return a special value
instead of raising an exception on invalid input. Called by both
Valid_Enumeration_Image and Value_Enumeration.
(Valid_Enumeration_Image): Return a Boolean indicating whether
the String is a valid Image for the given enumeration type.
(Value_Enumeration): Implement in terms of
* libgnat/, libgnat/,
libgnat/ Rename Valid_Enumeration_Image from the
* libgnat/ Correct documentation (it was not true
for the null string).
* libgnat/s-valuti.adb (Normalize_String): Do not raise
Constraint_Error for the null string, nor strings containing
nothing but blanks, so that Valid_Enumeration_Image can return
False in these cases, rather than raising an exception.
* (RE_Value_Enumeration_8, RE_Value_Enumeration_16,
RE_Value_Enumeration_32): New functions.
(RTE_Available): Improve comment (E doesn't have to be a
subprogram, although that's the usual case).
* sem_attr.adb (nalid_Value): Semantic analysis for new
* exp_attr.adb: Call Expand_Valid_Value_Attribute for new
*, exp_imgv.adb (Expand_Valid_Value_Attribute): New
procedure to expand Valid_Value into a call to
(Expand_Value_Attribute): Misc code cleanups. Remove two ???
mark comments. RTE_Available won't work here. For one thing,
RTE_Available (X) shouldn't be called until the compiler has
decided to make use of X (see comments on RTE_Available), and in
this case we're trying to AVOID calling something.
* New attribute name.
* doc/gnat_rm/implementation_defined_attributes.rst: Document
new attribute.
* gnat_rm.texi: Regenerate.
2021-06-21 Eric Botcazou <>
* fe.h (Assume_No_Invalid_Values): Declare.
* (Assume_No_Invalid_Values): Add warning comment.
2021-06-21 Bob Duff <>
* libgnat/ (Small_Size): Do not include 0 in this
* libgnat/s-bituti.adb (Copy_Bitfield): Do nothing for 0-bit
2021-06-21 Ghjuvan Lacambre <>
* exp_ch9.adb (Build_Simple_Entry_Call): Add comment.
* libgnat/s-rannum.adb (Random): Update comment.
* libgnat/ (Generator): Update comment.
2021-06-21 Piotr Trojanek <>
* doc/gnat_rm/representation_clauses_and_pragmas.rst (Address
Clauses): Fix unbalanced parens.
* gnat_rm.texi: Regenerate.
2021-06-21 Ghjuvan Lacambre <>
* errout.adb (Handle_Serious_Error): Capitalize comment.
* exp_dbug.adb (Set_Entity_Name): Capitalize sentence.
* exp_dist.adb (Expand_All_Calls_Remote_Subprogram_Call): Fix
* sem_ch3.adb (Modular_Type_Declaration): Add space after comma.
2021-06-21 Ghjuvan Lacambre <>
* debug.adb: Document -gnatd_U as taken.
* (Warning_Doc_Switch): Set to True.
* (Errout): Update documentation.
* gnat1drv.adb (Adjust_Global_Switches): React to -gnatd_U.
* (Tag_Errors): Set to True.
* (Unique_Error_Tag): Document -gnatd_U.
2021-06-21 Eric Botcazou <>
* (UR_Write_To_JSON): Declare.
* urealp.adb (Decimal_Exponent_Hi): Treat numbers in base 10
specially and rewrite handling of numbers in other bases.
(Decimal_Exponent_Lo): Likewise.
(Normalize): Minor tweak.
(UR_Write_To_JSON): New wrapper procedure around UR_Write.
* repinfo.adb (List_Type_Info): When the output is to JSON, call
UR_Write_To_JSON instead of UR_Write.
2021-06-21 Piotr Trojanek <>
* sem_util.adb (Indexed_Component_Bit_Offset): Return an unknown
offset for components within multidimensional arrays; remove
redundant parens.
2021-06-21 Piotr Trojanek <>
* sem_util.adb (Find_Overlaid_Entity): Ignore references to
components and discriminants.
2021-06-21 Doug Rupp <>
* Makefile.rtl (aarch64-linux) [LIBGNAT_TARGET_PAIRS]: Add
2021-06-21 Gary Dismukes <>
* exp_util.adb (Expand_Sliding_Conversion): Only perform
expansion when Expander_Active is True. Add a comment about this
and refine existing comment regarding string literals.
2021-06-21 Piotr Trojanek <>
* sem_util.adb (Denotes_Same_Object): Simplify handling of
2021-06-21 Piotr Trojanek <>
* sem_util.adb (Is_Object_Renaming): Rename from Is_Renaming;
simplify; adapt callers.
2021-06-21 Frederic Konrad <>
* Makefile.rtl: Compiles both static and dynamic libgnat for
2021-06-18 Gary Dismukes <>
* sem_ch3.adb (Constrain_Array): Add error checking for
fixed-lower-bound and constrained index ranges applied
inappropriately on subtypes of unconstrained and
fixed-lower-bound array types.
(Constrain_Index): Correct and refine comment related to
fixed-lower-bound index ranges.
2021-06-18 Bob Duff <>
* gen_il-gen.adb: Improve comments.
* (Convention_Id): Remove "-- Plenty of space
for expansion", because that's irrelevant now that we are no
longer laying out node fields by hand.
2021-06-18 Piotr Trojanek <>
* sem_util.adb (Denotes_Same_Object): Handle character literals
just like integer literals.
2021-06-18 Piotr Trojanek <>
* sem_util.adb (Denotes_Same_Object): Explicitly test for node
kinds being the same; deal with renamings one-by-one; adjust
numbers in references to the Ada RM.
2021-06-18 Bob Duff <>
* sprint.adb (Write_Source_Line): Check for EOF in
Line_Terminator loop. Note that when a source file is read in,
an EOF character is added to the end.
2021-06-18 Piotr Trojanek <>
* sem_aux.adb (Package_Specification): Add assertions to confirm
the kind of the of parameter and returned node.
* sem_ch12.adb (Remove_Parent): Reorder conditions; this change
appears to be semantically neutral, but is enough to avoid the
problematic call to Package_Specification.
* sem_util.adb (Is_Incomplete_Or_Private_Type): Replace loop
with a call to Package_Specification.
2021-06-18 Bob Duff <>
* sem_attr.adb (Eval_Attribute): For Enum_Lit'Size, use
2021-06-18 Olivier Hainque <>
* (__aarch64__): Sync
In CFI_COMMON_REGS, leave r18 alone, VxWorks private.
2021-06-18 Javier Miranda <>
* contracts.adb (Process_Spec_Postconditions): Add missing
support for aliased subprograms and handle wrappers of
class-wide pre/post conditions.
(Process_Inherited_Preconditions): Add missing support for
aliased subprograms and handle wrappers of class-wide pre/post
* (Class_Wide_Clone): Fix typo.
(Is_Class_Wide_Clone): Removed since it is not referenced.
(Is_Wrapper): Documenting new flag.
(LSP_Subprogram): Documenting new attribute.
* exp_ch3.adb (Make_Controlling_Function_Wrappers): Decorate
wrapper as Is_Wrapper and adjust call to
* freeze.adb (Build_Inherited_Condition_Pragmas): Fix typo in
(Check_Inherited_Conditions): Handle LSP wrappers; ensure
correct decoration of LSP wrappers.
* (Is_Class_Wide_Clone): Removed.
(Is_Wrapper): Added.
(LSP_Subprogram): Added.
* gen_il-gen-gen_entities.adb (Is_Class_Wide_Clone): Removed.
(Is_Wrapper): Added.
(LSP_Subprogram): Added.
* gen_il-internals.adb (Image): Adding uppercase image of
* sem_ch6.adb (New_Overloaded_Entity): Fix decoration of LSP
* (Override_Dispatching_Operation): Remove
parameter Is_Wrapper; no longer needed.
* sem_disp.adb (Check_Dispatching_Operation): Adjust assertion.
(Override_Dispatching_Operation): Remove parameter Is_Wrapper;
no longer needed.
* treepr.adb (Image): Adding uppercase image of LSP_Subprogram.
2021-06-18 Arnaud Charlet <>
* exp_ch4.adb (Expand_N_Quantified_Expression): Ensure the type
of the name of a "for of" loop is frozen.
* exp_disp.adb (Check_Premature_Freezing): Complete condition to
take into account a private type completed by another private
type now that the freezing rule are better implemented.
* freeze.adb (Freeze_Entity.Freeze_Profile): Do not perform an
early freeze on types if not in the proper scope. Special case
expression functions that requires access to the dispatch table.
(Should_Freeze_Type): New.
* sem_ch13.adb (Resolve_Aspect_Expressions): Prevent assert
failure in case of an invalid tree (previous errors detected).
* sem_res.adb (Resolve): Remove kludge related to entities
causing incorrect premature freezing.
* sem_util.adb (Ensure_Minimum_Decoration): Add protection
against non base types.
2021-06-18 Gary Dismukes <>
* sem_ch3.adb (Constrain_Index): Set the High_Bound of a
fixed-lower-bound subtype's range to T (the subtype of the FLB
index being constrained) rather than Base_Type (T).
2021-06-18 Bob Duff <>
* ada_get_targ.adb,, checks.adb, cstand.adb,, exp_attr.adb, freeze.adb, get_targ.adb,
libgnat/, libgnat/,
libgnat/s-scaval__128.adb, libgnat/s-scaval.adb, make.adb,, par-prag.adb, sem_ch13.adb, sem_prag.adb,, set_targ.adb,,,, Remove AAMP-specific code.
* Minor reformatting.
*, gen_il-gen.adb,
gen_il-gen-gen_entities.adb,, einfo-utils.adb, Package Types now contains "type Float_Rep_Kind
is (IEEE_Binary);", which used to also have an enumeral AAMP.
Gen_IL can't handle fields of this type, which would be zero
sized. Therefore, we move the Float_Rep field into Einfo.Utils
as a synthesized attribute. (We do not delete the field
altogether, in case we want new floating-point representations
in the future.)
* doc/gnat_rm/implementation_defined_pragmas.rst,
doc/gnat_ugn/the_gnat_compilation_model.rst: Remove
AAMP-specific documentation.
* gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-06-18 Gary Dismukes <>
* exp_util.adb (Expand_Sliding_Conversion): Move test of
Is_Fixed_Lower_Bound_Subtype to an assertion. Exclude string
literals from sliding expansion.
2021-06-18 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Cleanup conditions
related to Ada_Version.
2021-06-18 Piotr Trojanek <>
* sem_util.adb (Address_Value): Simplify.
2021-06-18 Bob Duff <>
* sem_attr.adb (Check_Array_Or_Scalar_Type): Use Expr_Value
instead of Intval, because the latter only exists in literals.
Remove Set_Etype on E1; setting the type is done elsewhere.
2021-06-18 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Examine types of
both formal parameters; refactor a complex detection of
by-reference types.
2021-06-18 Arnaud Charlet <>
* gnatcmd.adb: Fix handling of check and test commands.
2021-06-18 Gary Dismukes <>
* doc/gnat_rm/implementation_defined_pragmas.rst: Add
documentation for the array fixed-lower-bound feature.
* gnat_rm.texi: Regenerate.
2021-06-18 Bob Duff <>
* debug.adb: Document switch.
* exp_aggr.adb: If -gnatd_g was given, then do not bump the
limit to 500_000.
2021-06-18 Bob Duff <>
*, sem_util.adb (Has_Access_Values): Remove
Include_Internal parameter that was added in previous change.
* sem_warn.adb (Warnings_Off_E1): Back out E_Out_Parameter ==>
Formal_Kind change made previously. Check Is_Private_Type to
avoid warnings on private types. Misc cleanup.
* sem_attr.adb (Attribute_Has_Access_Values): Remove
Include_Internal parameter.
2021-06-18 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove dead branch
for overlapping actuals in prefix notation.
2021-06-18 Eric Botcazou <>
* sem_prag.adb (Process_Import_Or_Interface): Do not
artificially record a possible modification for a constant.
2021-06-18 Arnaud Charlet <>
* exp_ch6.adb (Expand_Call_Helper): Code cleanups.
2021-06-18 Arnaud Charlet <>
* exp_aggr.adb, exp_dist.adb, exp_unst.adb,,
sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_eval.adb,
sem_util.adb,, Update comments.
2021-06-18 Ghjuvan Lacambre <>
* back_end.adb (Scan_Back_End_Switches): Set Opt.JSON_Output to
True if -fdiagnostics-format=json option is found.
* (Scan_Compiler_Arguments): Mention
* errout.adb (Output_JSON_Message): New procedure.
(Output_Messages): If Opt.JSON_Output is True, print messages
with new Output_JSON_Message procedure.
* Declare JSON_Output variable.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Mention new -fdiagnostics-format option.
* gnat_ugn.texi: Regenerate.
2021-06-18 Arnaud Charlet <>
* sem_ch6.adb (Null_Exclusions_Match): Relax null exclusion
mismatch check when Relaxed_RM_Semantics is set.
2021-06-18 Arnaud Charlet <>
* fe.h, opt.adb,, par-prag.adb, sem_prag.adb,
switch-c.adb (Extensions_Allowed): Replace by a function.
(Ada_Version_Type): Add new value Ada_With_Extensions, to
replace setting of Extensions_Allowed. Update setting of
2021-06-18 Arnaud Charlet <>
* bindgen.adb (Gen_Output_File_Ada): Generate a new constant
* libgnat/g-comver.adb (GNAT_Version_Address): New;
(GNAT_Version): Use GNAT_Version_Address to disable LTO warning.
2021-06-18 Javier Miranda <>
* (Is_Ada_2022_Only): Adding documentation.
* (Is_Ada_2022_Only): New flag.
* gen_il-gen-gen_entities.adb (Is_Ada_2022_Only): New flag.
* itypes.adb (Create_Null_Excluding_Itype): Inherit
* sem_ch3.adb (Check_Abstract_Overriding): Skip reporting error
on Ada 2022 only subprograms that require overriding if we are
not in Ada 2022 mode.
(Derive_Subprogram): Inherit Is_Ada_2022_Only.
* sem_ch6.adb (Check_Overriding_Indicator): Inherit
(New_Overloaded_Entity): Inherit Is_Ada_2022_Only.
* sem_ch7.adb (Declare_Inherited_Private_Subprograms): Inherit
(Preserve_Full_Attributes): Inherit Is_Ada_2022_Only.
* sem_disp.adb (Find_Hidden_Overridden_Primitive): Inherit
(Override_Dispatching_Operation): Inherit Is_Ada_2022_Only.
* sem_prag.adb (Analyze_Pragma): Allow form with argument for
Ada 2022.
* sem_type.adb: (Disambiguate): Deal with Is_Ada_2022_Only
* lib-xref.adb (Generate_Reference): Error on static and
dispatching calls to Ada 2022 subprograms that require
overriding if we are not in Ada 2022 mode; warn on other
references to Ada 2022 entities when not in Ada 2022 mode.
* sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Inherit
* libgnat/ (Empty): Adding pragma Ada_2022.
* libgnat/ (Empty): Adding pragma Ada_2022.
* libgnat/ (Empty): Adding pragma Ada_2022.
* libgnat/ (Empty): Adding pragma Ada_2022.
* libgnat/ (Empty): Adding pragma Ada_2022.
(New_Vector): Adding pragma Ada_2022.
(Insert_Vector): Adding pragma Ada_2022.
(Prepend_Vector): Adding pragma Ada_2022.
(Append_Vector): Adding pragma Ada_2022.
2021-06-17 Arnaud Charlet <>
* sem_ch3.adb (Check_Ops_From_Incomplete_Type): Protect against
no Primitive_Operations.
2021-06-17 Vadim Godunko <>
* libgnat/ (Allocate): Additional parameter
to provide additional amount of space to be allocated.
* libgnat/a-strunb__shared.adb (Aligned_Max_Length): Limit
length to Natural'Last when requested length is larger than it.
(Allocate): Merge two slightly different implementations into
2021-06-17 Gary Dismukes <>
* checks.adb (Discrete_Range_Cond): For an index subtype that
has a fixed lower bound, require that the range's lower bound
match that of the subtype.
(Selected_Range_Checks): Warn about the case where a static
lower bound does not equal an index subtype's fixed lower bound.
* (Is_Fixed_Lower_Bound_Array_Subtype,
Is_Fixed_Lower_Bound_Index_Subtype): Document new entity flag.
* exp_ch4.adb (Expand_N_Type_Conversion): If the operand is of
an unconstrained array subtype with fixed lower bound, then
Expand_Sliding_Conversion is applied to the operand.
* exp_ch6.adb (Expand_Simple_Function_Return): If the result
subtype is an unconstrained array subtype with fixed lower
bound, then Expand_Sliding_Conversion is applied to the return
* (Expand_Sliding_Conversion): New procedure for
applying a sliding subtype conversion to an array object of a
fixed-lower-bound subtype when needed.
* exp_util.adb: Add with_clause for Freeze.
(Expand_Sliding_Conversion): New procedure for applying a
sliding subtype conversion to an array object of a
fixed-lower-bound subtype when needed. It traverses the indexes
of the unconstrained array type/subtype to create a target
constrained subtype and rewrites the array object to be a
conversion to that subtype, when there's at least one index
whose lower bound does not statically match the fixed-lower
bound of the target subtype.
* (type Opt_Field_Enum): Add literals
Is_Fixed_Lower_Bound_Array_Subtype and
Is_Fixed_Lower_Bound_Index_Subtype for new flags on type
* gen_il-gen-gen_entities.adb: Add calls to
Create_Semantic_Field for the new fixed-lower-bound flags on
type entities.
* par-ch3.adb (P_Array_Type_Definition): Add handling for
parsing of fixed-lower-bound index ranges in unconstrained array
types. Report an error if such an index is encountered and GNAT
language extensions are not enabled.
(P_Index_Subtype_Def_With_Fixed_Lower_Bound): Support procedure
for parsing unconstrained index ranges.
(P_Index_Or_Discriminant_Constraint): Add handling for parsing
of index constraints that specify ranges with fixed lower
bounds. Report an error if such an index is encountered and GNAT
language extensions are not enabled.
* sem_ch3.adb (Analyze_Object_Declaration): If the object's
nominal subtype is an array subtype with fixed lower bound, then
Expand_Sliding_Conversion is applied to the object.
(Array_Type_Declaration): Mark the array type and the subtypes
of any indexes that specify a fixed lower bound as being
fixed-lower-bound subtypes, and set the High_bound of the range
of such an index to the upper bound of the named subtype.
(Constrain_Array): For an array subtype with one or more index
ranges specifying a fixed lower bound, set Is_Constrained to
False and set the array subtype's
Is_Fixed_Lower_Bound_Array_Subtype flag to True.
(Constrain_Index): Mark the subtypes of an index that specifies
a fixed lower bound as being a fixed-lower-bound index subtype,
and set the High_bound of the range of such an index to the
upper bound of the base type of the array type's corresponding
* sem_res.adb (Resolve_Actuals): If a formal is of an
unconstrained array subtype with fixed lower bound, then
Expand_Sliding_Conversion is applied to the actual.
* sem_util.adb (Build_Actual_Subtype): If the actual subtype
corresponds to an unconstrained array subtype having any indexes
with fixed lower bounds, then set the lower bounds of any such
indexes of the actual subtype to the appropriate fixed lower
bound of the formal subtype (rather than taking it from the
formal itself).
* sprint.adb (Sprint_Node_Actual, case N_Range): If a range's
Etype has a fixed lower bound, then print "<>" rather than the
High_Bound of the range.
2021-06-17 Bob Duff <>
* sem_util.adb, (Has_Access_Values): New formal
Include_Internal to indicate whether internal types should be
* sem_warn.adb (Check_References): Change E_Out_Parameter to
Formal_Kind, to match the comment about Spec_Entity. Pass
Include_Internal => False to Has_Access_Values, so that we warn
on types with access values that happen to be in internal types,
such as Unbounded_String.
* sem_attr.adb (Attribute_Has_Access_Values): Pass
Include_Internal => True to Has_Access_Values, to preserve
existing behavior.
* libgnat/g-rewdat.adb (Do_Output): Change B from 'in out' to
'in', to avoid warning enabled by the change to sem_warn.adb.
* libgnat/s-objrea.adb (Check_Read_Offset): Change S from 'in
out' to 'in', to avoid warning enabled by the change to
2021-06-17 Steve Baird <>
* exp_ch5.adb
(Expand_N_Case_Statement.Expand_General_Case_Statement): New
(Expand_N_Case_Statement): If extensions are allowed and the
case selector is not of a discrete type, then call
Expand_General_Case_Statement to generate expansion instead of
flagging the non-discrete selector as an error.
* (Is_Case_Choice_Pattern): New Boolean-valued
function for testing whether a given expression occurs as part
of a case choice pattern.
* sem_case.adb (Composite_Case_Ops): New package providing
support routines for the new form of case statements. This
includes a nested package, Composite_Case_Ops.Value_Sets, which
encapsulates the "representative values" implementation of
composite value sets.
(Check_Choices.Check_Case_Pattern_Choices): New procedure for
semantic checking of non-discrete case choices. This includes
the checks pertaining to coverage and overlapping.
(Check_Choices.Check_Composite_Case_Selector): New procedure for
semantic checking of non-discrete case selectors.
(Check_Choices): If extensions are allowed then a non-discrete
selector type no longer implies that an error must have been
flagged earlier. Instead of simply returning, call
Check_Composite_Case_Selector and Check_Case_Pattern_Choices.
(Is_Case_Choice_Pattern): Body of new function declared in .
* sem_ch5.adb (Analyze_Case_Statement): If extensions are
allowed, then we can't use RM 5.4's "The selecting_expression is
expected to be of any discrete type" name resolution rule.
Handle the case where the type of the selecting expression is
not discrete, as well as the new ambiguous-name-resolution error
cases made possible by this change.
* sem_res.adb (Resolve_Entity_Name): It is ok to treat the name
of a type or subtype as an expression if it is part of a case
choice pattern, as in "(Field1 => Positive, Field2 => <>)".
* exp_aggr.adb (Expand_Record_Aggregate): Do not expand case
choice aggregates.
* Define two new node attributes,
Binding_Chars and Multidefined_Bindings.
* gen_il-gen-gen_nodes.adb: The new Multidefined_Bindings
attribute is Boolean-valued and may be set on
N_Case_Statement_Alternative nodes. The new Binding_Chars
attribute is Name_Id-valued and may be set on
N_Component_Association nodes.
* par-ch4.adb (P_Record_Or_Array_Component_Association): When
parsing a component association, check for both new syntax forms
used to specify a bound value in a case-choice aggregate. In
the case of a box value, an identifier may occur within the box,
as in "Foo => <Abc>" instead of "Foo => <>". In the more general
case, an expression (or a box) may be followed by "is
<identifier>", as in
"Foo => Bar is Abc" instead of just "Foo => Bar".
* sem_aggr.adb (Resolve_Record_Aggregate): Do not transform box
component values in a case-choice aggregate.
* Provide comments for the new attributes added in
* doc/gnat_rm/implementation_defined_pragmas.rst: Describe this
new feature in documentation for pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
2021-06-17 Arnaud Charlet <>
* exp_ch4.adb (Expand_N_Expression_With_Actions.Process_Action):
Do not abandon processing on a nested N_Expression_With_Actions
or N_Loop_Statement, otherwise we may miss some transient
2021-06-17 Arnaud Charlet <>
* exp_util.adb (Find_Hook_Context): Do not stop on an aggregate
2021-06-17 Piotr Trojanek <>
* sem_util.adb (Is_Valid_Renaming): Check not only indexed
components, but slices too.
2021-06-17 Piotr Trojanek <>
* sem_ch3.adb (Analyze_Private_Extension_Declaration): Check
No_Wide_Characters restriction after rejecting illegal parent
(Derived_Type_Declaration): Likewise.
(Find_Type_Of_Subtype_Indic): Remove check for
No_Wide_Characters restriction, which was done too early.
2021-06-17 Piotr Trojanek <>
* sem_util.adb (Is_Valid_Renaming): Body moved from its nested
2021-06-17 Gary Dismukes <>
* sem_ch12.adb (Instantiate_Type): If the actual type for an
incomplete formal type is also incomplete, but has a Full_View,
use the Full_View of the actual type rather than the incomplete
2021-06-17 Piotr Trojanek <>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(-gnatw.I): Remove double period at the end of sentence.
* gnat_ugn.texi: Regenerate.
2021-06-17 Piotr Trojanek <>
* sem_util.adb (Denotes_Same_Object): Call Get_Index_Bounds with
the range of a slice object, not its type.
2021-06-17 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Fix style;
refactor repeated calls to Nkind; remove early RETURN.
2021-06-17 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Ignore formal of
generic types, but keep examining other parameters.
2021-06-17 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove dead code.
2021-06-17 Piotr Trojanek <>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove repeated
2021-06-17 Piotr Trojanek <>
* checks.adb (Overlap_Check): Replace Set_Casing with
Adjust_Name_Case and adapt surrounding code as needed.
2021-06-17 Arnaud Charlet <>
* libgnat/, libgnat/s-putaim.adb: Move...
* libgnarl/, libgnarl/s-putaim.adb: ... here.
2021-06-17 Arnaud Charlet <>
*, uintp.adb (UI_To_Unsigned_64): New.
2021-06-17 Piotr Trojanek <>
* sem_prag.adb (Get_Overflow_Mode): Reword error message.
* switch-c.adb (Get_Overflow_Mode): Likewise.
2021-06-17 Richard Kenner <>
* exp_util.adb (Expand_Static_Predicates_In_Choices): Handle
Others_Discrete_Choices in N_Others_Choice.
2021-06-17 Arnaud Charlet <>
* atree.adb: Remove redundant comment with spec.
* sem_warn.adb: Fix typo in comment.
2021-06-17 Arnaud Charlet <>
* atree.adb: Do not suppress checks.
2021-06-17 Justin Squirek <>
* exp_ch3.adb (Check_Missing_Others): Add comment.
(Build_Initialization_Call): Remove inaccurate accessibility
* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Remove
test for Ada2012.
(Analyze_Package_Instantiation): Remove speculative comment.
(Inline_Instance_Body): Add comments for loops.
(Build_Subprogram_Renaming): Remove comment about fix being
partial and "ugly."
(Instantiate_Subprogram_Body): Remove comment referencing DEC
related internal issue.
(Subtypes_Match): Add comment and simplify anonymous access
(Is_Global): Add test for when E is an expanded name, and
calculate the scope accordingly.
* sem_ch6.adb (Analyze_Function_Return): Update comment
regarding accessibility, and add check for
(Mask_Type_Refs): Add comments.
(Analyze_Subprogram_Declaration): Remove mysterious suppression
of elaboration checks.
* sem_ch7.adb (Preserve_Full_Attributes): Preserve Is_Atomic
* sem_ch8.adb (Most_Descendant_Use_Clause): Remove comment.
(Note_Redundant_Use): Fix calls to Find_First_Use to be
(Get_Object_Name): Modify error message to be more descriptive.
(Known_But_Visible): Remove mysterious special case for
(Find_First_Use): Removed.
(Find_Most_Prev): Renamed from Find_First_Use.
* sem_prag.adb (Check_Static_Constraint): Add comments to
2021-06-17 Bob Duff <>
* treepr.adb (Print_Node): Display the Entity or Associated_Node
fields if appropriate.
* (F_Associated_Node, F_Entity): Remove. These
are no longer needed.
2021-06-17 Piotr Trojanek <>
* checks.adb (Apply_Parameter_Aliasing_Checks): Replace calls to
Is_Object_Reference with calls to Is_Name_Reference; remove
asymmetric condition that only detected an aggregate as the
first actual (aggregate objects were just a special case of an
object reference that was not a name).
2021-06-17 Bob Duff <>
* gen_il-gen.adb, Generate field
enumeration literals with "F_" prefix. Update all generated
references accordingly.
* atree.adb, einfo-utils.adb, sem_ch3.adb, sem_ch5.adb,
sem_ch6.adb, sem_ch8.adb, sinfo-cn.adb, sinfo-utils.adb,, treepr.adb: Add "F_" prefix to all uses of the
field enumeration literals.
2021-06-17 Arnaud Charlet <>
* libgnat/, libgnat/,
libgnat/ bool renamed C_bool.
2021-06-17 Piotr Trojanek <>
* sem_ch4.adb (Analyze_Allocator): Reject allocators in
restricted contexts.
2021-06-17 Arnaud Charlet <>
* gcc-interface/ Use if libgnat.a cannot
be found.
2021-06-16 Piotr Trojanek <>
* sem_util.adb (Is_Volatile_Function): Follow the exact wording
of SPARK (regarding volatile functions) and Ada (regarding
protected functions).
2021-06-16 Piotr Trojanek <>
* sem_util.adb (Is_OK_Volatile_Context): All references to
volatile objects are legal in preanalysis.
(Within_Volatile_Function): Previously it was wrongly called on
Empty entities; now it is only called on E_Return_Statement,
which allow the body to be greatly simplified.
2021-06-16 Yannick Moy <>
* sem_res.adb (Set_Slice_Subtype): Revert special-case
introduced previously, which is not needed as Itypes created for
slices are precisely always used.
2021-06-16 Eric Botcazou <>
* urealp.adb (Scale): Change first paramter to Uint and adjust.
(Equivalent_Decimal_Exponent): Pass U.Den directly to Scale.
* libgnat/s-exponr.adb (Negative): Rename to...
(Safe_Negative): ...this and change its lower bound.
(Exponr): Adjust to above renaming and deal with Integer'First.
2021-06-16 Piotr Trojanek <>
* sem_res.adb (Flag_Effectively_Volatile_Objects): Detect also
allocators within restricted contexts and not just entity names.
(Resolve_Actuals): Remove duplicated code for detecting
restricted contexts; it is now exclusively done in
(Resolve_Entity_Name): Adapt to new parameter of
*, sem_util.adb (Is_OK_Volatile_Context): Adapt to
handle contexts both inside and outside of subprogram call
actual parameters.
(Within_Subprogram_Call): Remove; now handled by
Is_OK_Volatile_Context itself and its parameter.
2021-06-16 Piotr Trojanek <>
* sinput.adb (Sloc_Range): Refactor several repeated calls to
Sloc and two comparisons with No_Location.
2021-06-16 Piotr Trojanek <>
* checks.adb (Apply_Scalar_Range_Check): Fix handling of check depending
on the parameter passing mechanism. Grammar adjustment ("has"
=> "have").
(Parameter_Passing_Mechanism_Specified): Add a hyphen in a comment.
2021-06-16 Piotr Trojanek <>
* exp_ch3.adb (Build_Slice_Assignment): Remove unused
2021-06-16 Piotr Trojanek <>
* restrict.adb, sem_attr.adb, Fix typos in
"occuring"; refill comment as necessary.
2021-06-16 Piotr Trojanek <>
* (Is_Actual_Parameter): Update comment.
* sem_util.adb (Is_Actual_Parameter): Also detect entry parameters.
2021-06-16 Arnaud Charlet <>
*, libgnarl/, exp_ch3.adb, exp_ch4.adb,
exp_ch6.adb, exp_ch9.adb, sem_ch6.adb: Move master related
entities to the expander directly.
2021-06-16 Piotr Trojanek <>
* sem_res.adb (Is_Assignment_Or_Object_Expression): Whitespace
(Is_Attribute_Expression): Prevent AST climbing from going to
the root of the compilation unit.
2021-06-16 Steve Baird <>
* doc/gnat_rm/implementation_advice.rst: Add a section for RM
A.18 .
* gnat_rm.texi: Regenerate.
2021-06-16 Justin Squirek <>
* sem_ch13.adb (Analyze_Enumeration_Representation_Clause): Add
check for the mixing of entries.
2021-06-16 Justin Squirek <>
* sem_ch13.adb (Make_Aitem_Pragma): Check for static expressions
in Priority aspect arguments for restriction Static_Priorities.
2021-06-16 Justin Squirek <>
* sem_util.adb (Accessibility_Level): Take into account
renamings of loop parameters.
2021-06-16 Matthieu Eyraud <>
* par_sco.adb (Set_Statement_Entry): Change sloc for dominance
(Traverse_One): Fix typo.
(Output_Header): Fix comment.
2021-06-16 Richard Kenner <>
* exp_unst.adb (Register_Subprogram): Don't look for aliases for
subprograms that are generic. Reorder tests for efficiency.
2021-06-16 Eric Botcazou <>
* sem_util.adb (Incomplete_Or_Partial_View): Retrieve the scope of
the parameter and use it to find its incomplete view, if any.
2021-06-16 Eric Botcazou <>
* freeze.adb (Check_No_Parts_Violations): Return earlier if the
type is elementary or does not come from source.
2021-06-16 Bob Duff <>
* ghost.adb: Add another special case where full analysis is
needed. This bug is due to quirks in the way
Mark_And_Set_Ghost_Assignment works (it happens very early,
before name resolution is done).
2021-06-16 Eric Botcazou <>
* sem_util.adb (Current_Entity_In_Scope): Reimplement.
2021-06-16 Piotr Trojanek <>
* sem_ch8.adb (End_Scope): Remove extra parens.
2021-06-16 Javier Miranda <>
* exp_disp.adb (Build_Class_Wide_Check): Ensure that evaluation
of actuals is side effects free (since the check duplicates
2021-06-16 Ed Schonberg <>
* sem_res.adb (Resolve_Raise_Expression): Apply Ada_2020 rules
concerning the need for parentheses around Raise_Expressions in
various contexts.
2021-06-16 Piotr Trojanek <>
* sem_ch13.adb (Validate_Unchecked_Conversion): Move detection
of generic types before switching to their private views; fix
style in using AND THEN.
2021-06-16 Arnaud Charlet <>
* sem_ch3.adb (Analyze_Component_Declaration): Do not special
case raise expressions.
2021-06-16 Sergey Rybin <>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Instead of referring to the formatting of the Ada examples in
Ada RM add use the list of checks that are actually performed.
* gnat_ugn.texi: Regenerate.
2021-06-16 Eric Botcazou <>
* initialize.c: Do not include vxWorks.h and fcntl.h from here.
(__gnat_initialize) [__MINGW32__]: Remove #ifdef and attribute
(__gnat_initialize) [init_float]: Delete.
(__gnat_initialize) [VxWorks]: Likewise.
(__gnat_initialize) [PA-RISC HP-UX 10]: Likewise.
* runtime.h: Add comment about vxWorks.h include.
2021-06-16 Eric Botcazou <>
* libgnat/ (ZCX_By_Default): Delete.
(Require_Body): Likewise.
* libgnat/s-except.adb: Replace body with pragma No_Body.
2021-06-15 Steve Baird <>
* exp_util.adb (Kill_Dead_Code): Generalize the existing
handling of if statements to handle case statements similarly.
2021-06-15 Eric Botcazou <>
* raise.h (_gnat_builtin_longjmp): Delete.
(set_gnat_exit_status): Likewise.
2021-06-15 Piotr Trojanek <>
* exp_util.adb (Possible_Side_Effect_In_SPARK): Handle component
declaration just like full type and subtype declarations.
2021-06-15 Yannick Moy <>
* errout.adb (First_And_Last_Node): Also apply to arbitrary late
declarations, not only subprogram specs.
2021-06-15 Bob Duff <>
* sem_ch3.adb (Make_Class_Wide_Type): Make sure all the calls to
Reinit_Field_To_Zero are for the correct Ekinds.
2021-06-15 Bob Duff <>
* (No_Task_Parts): New aspect.
* Add the aspect name.
* exp_ch6.adb (Might_Have_Tasks): Return False if this is a
class-wide type whose specific type has No_Task_Parts.
* freeze.adb (Check_No_Parts_Violations): This is an adaptation
of the procedure formerly known as
Check_No_Controlled_Parts_Violations, which now supports both
No_Controlled_Parts and No_Task_Parts. It takes a parameter
indicating which aspect is being checked.
(Freeze_Entity): Call Check_No_Parts_Violations for both
* sem_ch13.adb (Analyze_Aspect_Specifications): The code for
Aspect_No_Controlled_Parts already works as is with
* libgnat/ Add No_Task_Parts aspect to the two
iterator iterfaces.
* doc/gnat_rm/implementation_defined_aspects.rst: Add
documentation for the No_Task_Parts aspect.
* gnat_rm.texi: Regenerate.
2021-06-15 Arnaud Charlet <>
* exp_unst.adb (Unnest_Subprogram.Build_Table.Visit_Node): Fix
handling of scopes for subprogram calls.
2021-06-15 Piotr Trojanek <>
* sem_prag.adb: Fix typos in comments related to access types.
* sem_util.adb (Is_Access_Variable): Stronger condition.
2021-06-15 Arnaud Charlet <>
* Add rule to copy runtime files needed
during stage1.
* raise.c: Remove obsolete symbols used during bootstrap.
* gcc-interface/ Do not use libgnat sources during
(GNAT_ADA_OBJS, GNATBIND_OBJS): Split in two parts, the common
part and the part only used outside of stage1.
(ADA_GENERATED_FILES): Add runtime files needed during bootstrap
when recent APIs are needed.
(ada/b_gnatb.adb): Remove prerequisite.
* gcc-interface/ Remove obsolete entries.
2021-06-15 Eric Botcazou <>
* raise-gcc.c (__gnat_personality_seh0): Use PERSONALITY_FUNCTION.
2021-06-15 Ed Schonberg <>
* sem_util.adb (Is_Confirming): Separate the handling of
Implicit_Dereference, for which no pragma is generated but which
is already checked for legality in Sem_Ch13, including renamed
discriminants in a derived type.
(Is_Confirming, Same_Name): For expanded names, only check
matching of selector, because prefix may correspond to original
and derived types with different names and/or scopes. Semantic
checks on aspect expression have already verified its legality.
Add comments regarding possible gaps in RM description of the
2021-06-15 Gary Dismukes <>
* freeze.adb (Freeze_Subprogram): Don't propagate conventions
Intrinsic or Entry to anonymous access-to-subprogram types
associated with subprograms having those conventions. Update
related comment.
* sem_attr.adb (Resolve_Attribute, Attribute_*Access): Remove
special-case warning code for cases where a called subprogram
has convention Intrinsic as well as its formal's type (the
expected type for the Access attribute), since this case can no
longer occur.
2021-06-15 Piotr Trojanek <>
* exp_imgv.adb (Expand_User_Defined_Enumeration_Image): Fix
2021-06-15 Bob Duff <>
* einfo-utils.adb (Known_Component_Size,
Known_Static_Component_Size, Unknown_Component_Size): Use
Implementation_Base_Type instead of Base_Type.
2021-06-15 Bob Duff <>
* gen_il-gen-gen_entities.adb (E_Loop_Parameter): Add
Interface_Name field.
2021-06-15 Bob Duff <>
* sem_cat.adb (Check_Non_Static_Default_Expr): Allow nonstatic
expression in predefined unit with pragma Preelaborate.
2021-06-15 Yannick Moy <>
* doc/gnat_rm/intrinsic_subprograms.rst: More details on shift
operations for signed types. Also add the missing Import and
Convention on the example.
* gnat_rm.texi: Regenerate.
2021-06-15 Eric Botcazou <>
* raise-gcc.c: Include <cstdarg> instead of <stdarg.h> in C++.
Include <stdbool.h> and unconditionally <stdlib.h> in C.
2021-06-15 Piotr Trojanek <>
* (Find_Overlaid_Entity): Simplify comment for
* sem_util.adb (Find_Overlaid_Entity): Remove defensive code
from body.
2021-06-15 Eric Botcazou <>
* argv.c: Add include of <stdlib.h> for the runtime.
(gnat_argv): Change type to char ** and initialize to NULL.
(gnat_envp): Likewise.
* argv-lynxos178-raven-cert.c: Add include of <stdlib.h>.
(gnat_argv): Change type to char ** and initialize to NULL.
(gnat_envp): Likewise.
2021-06-15 Bob Duff <>
* gen_il-gen.adb (Setter_Needs_Parent): Add missing
Then_Actions. Fix self-contradictory comment.
* exp_util.adb (Insert_Actions): Minor comment improvments.
2021-06-15 Arnaud Charlet <>
* sem_eval.adb (Eval_Logical_Op, Test_Expression_Is_Foldable):
Add support for folding more "and"/"or" expressions.
* exp_util.adb (Side_Effect_Free): Fix handling of membership
2021-06-15 Piotr Trojanek <>
* sem_res.adb (Resolve_Actual): Replace repeated calls to
"Etype (F)" with references to "F_Typ", which keeps the results
of exactly that call.
2021-06-15 Bob Duff <>
* gen_il-gen.adb (To_Bit_Offset): Use 'Base to avoid overflow in
computations in Last_Bit when Offset = 'Last.
(Choose_Offset): Give a better error message when we run out of
fields. In particular, point out that
Gen_IL.Internals.Bit_Offset'Last needs to be increased.
2021-06-15 Bob Duff <>
*,, einfo-utils.adb, fe.h, gen_il.adb,, gen_il-gen-gen_entities.adb,
gen_il-gen-gen_nodes.adb, sem_ch12.adb, sem_ch3.adb,
sem_util.adb,, treepr.adb, Clean up
??? comments and other comments.
* atree.adb: Clean up ??? comments and other comments.
(Validate_Node): Fix bug: "Off_0 (N) < Off_L (N)"
should be "Off_0 (N) <= Off_L (N)".
* gen_il-gen.adb, Clean up ???
comments and other comments. Add support for getter-specific
and setter-specific preconditions. Detect the error of putting
a field in the wrong subrange. Misc cleanup.
(Node_Field vs. Entity_Field): Clean up Nmake. Improve
* Misc cleanup. Move...
* ... here.
* gen_il-utils.adb: Misc cleanup. Move...
* gen_il-internals.adb: ... here.
* Move Was_Default_Init_Box_Association,
which was in the wrong subrange. Add comments. Misc cleanup.
* Add Named_Access_Kind.
* sinfo-cn.adb: Clean up ??? comments and other comments.
Remove redundant assertions.
*, Clean up ??? comments and other
comments. Remove all the comments indicating field offsets.
These are obsolete now that Gen_IL computes the offsets
2021-06-15 Arnaud Charlet <>
*, errout.adb,, exp_aggr.adb, exp_ch5.adb,
exp_ch6.adb, exp_ch8.adb, exp_ch9.adb, exp_imgv.adb,
exp_put_image.adb, fe.h, impunit.adb,,
libgnat/, libgnat/,,
par-ch12.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb,
par-ch6.adb, par-prag.adb, par-util.adb,, scng.adb,
sem_aggr.adb, sem_attr.adb, sem_ch10.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
sem_ch8.adb, sem_elab.adb, sem_eval.adb, sem_prag.adb,
sem_res.adb, sem_type.adb, sem_util.adb,,,, sprint.adb, switch-c.adb, usage.adb,
gcc-interface/trans.c: Update all references to Ada 2020 to Ada
2022. Rename pragma Ada_2020 to Ada_2022. Update documentation
* gnat_ugn.texi, gnat_rm.texi: Regenerate.
2021-06-15 Steve Baird <>
* sem_util.adb (Gather_Components): Factor the test that was