1 2019-09-17 Eric Botcazou <ebotcazou@adacore.com>
3 * exp_attr.adb (Expand_Size_Attribute): Chain the special cases
4 on the back-end path and rewrite the attribute appled to slices
5 of bit-packed arrays into the product of the Length and the
6 Compoent_Size attributes of the slices.
7 * exp_ch5.adb (Expand_Assign_Array_Bitfield): Use Size attribute
8 directly to compute the bitfield's size.
10 2019-09-17 Bob Duff <duff@adacore.com>
12 * exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Add tests
13 for potential volatile or independent components.
14 * libgnat/s-bituti.adb (Copy_Small_Bitfield,
15 Copy_Large_Bitfield): Move declarations to more appropriate
18 2019-09-13 Maciej W. Rozycki <macro@wdc.com>
20 * make.adb (Scan_Make_Arg): Also accept `--sysroot=' for the
21 compiler and the linker.
23 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
25 * gcc-interface/decl.c (maybe_saturate_size): New function.
26 (gnat_to_gnu_entity): Invoke it on the Esize of types before sending
27 it for back-annotations.
28 * gcc-interface/trans.c: Fix typo.
30 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
32 * gcc-interface/ada-tree.h (DECL_FORCED_BY_REF_P): New macro.
33 * gcc-interface/decl.c (gnat_to_gnu_param): Set it on parameters
34 whose mechanism was forced to by-reference.
35 * gcc-interface/trans.c (Call_to_gnu): Do not issue a warning about a
36 misaligned actual parameter if it is based on a CONSTRUCTOR. Remove
37 obsolete warning for users of Starlet. Issue a warning if a temporary
38 is make around the call for a parameter with DECL_FORCED_BY_REF_P set.
39 (addressable_p): Return true for REAL_CST and ADDR_EXPR.
41 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
43 * gcc-interface/trans.c (gnat_to_gnu): Do not set the location on an
44 expression used for a tag.
46 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
48 * gcc-interface/gigi.h (aggregate_type_contains_array_p): Declare.
49 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: For an
50 extension, test Has_Record_Rep_Clause instead of Has_Specified_Layout.
51 (adjust_packed): Return 0 if the type of the field is an aggregate
52 type that contains (or is) a self-referential array.
53 (type_has_variable_size): Delete.
54 * gcc-interface/utils.c (inish_record_type): Constify a variable.
55 (aggregate_type_contains_array_p): Add parameter SELF_REFERENTIAL.
56 <RECORD_TYPE>: Pass it in the recursive call.
57 <ARRAY_TYPE>: If it is true, return true only if the array type is
59 (create_field_decl): Streamline the setting of the alignment on the
60 field. Pass false to aggregate_type_contains_array_p.
62 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
64 * gcc-interface/trans.c (lvalue_required_p) <N_Slice>: Adjust GNU_TYPE
65 in the recursive call.
66 <N_Selected_Component>: Likewise.
68 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
70 * gcc-interface/utils.c (build_template): Deal with parameters
71 passed by pointer to component of multi-dimensional arrays.
73 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
75 * gcc-interface/decl.c (annotate_value) <CALL_EXPR>: Inline the call
76 also if List_Representation_Info is greater than 3.
78 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
80 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Add assertion.
82 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
84 * gcc-interface/gigi.h (gigi_checking_assert): New macro.
85 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>:
86 Remove redundant test and adjust comments. Minor tweaks.
87 * gcc-interface/trans.c (Call_to_gnu): Do not generate range checks,
88 instead assert that the Do_Range_Check flag is not set. Adjust call
89 to convert_with_check.
90 (gnat_to_gnu): Likewise.
91 (assoc_to_constructor): Likewise.
92 (pos_to_constructor): Likewise. Remove GNAT_COMPONENT_TYPE parameter.
93 (emit_range_check): Delete.
94 (convert_with_check): Remove RANGE_P parameter and adjust. Do a single
95 overflow check for modular types.
97 2019-08-23 Jakub Jelinek <jakub@redhat.com>
100 * gcc-interface/misc.c (gnat_post_options): Set flag_excess_precision
101 instead of flag_excess_precision_cmdline.
103 2019-08-21 Vadim Godunko <godunko@adacore.com>
105 * libgnat/g-expect.adb (Expect_Internal): Attempt to read
106 several times when 'read' returns non-positive.
108 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
110 * einfo.adb (Is_Discriminal): Remove extra parens.
111 (Is_Constant_Object): Simplify by reusing Ekind_In.
112 (Is_Prival): Remove extra parens.
113 * checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor
116 2019-08-21 Claire Dross <dross@adacore.com>
118 * libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow
120 (Iter_First, Iter_Next): Primitives used for iteration.
122 2019-08-21 Yannick Moy <moy@adacore.com>
124 * sem_ch3.adb (Analyze_Subtype_Declaration): Inherit RM_Size
125 field for formal type parameters in generic instantiations.
127 2019-08-21 Yannick Moy <moy@adacore.com>
129 * sem_spark.adb: Update references to the SPARK RM.
131 2019-08-21 Eric Botcazou <ebotcazou@adacore.com>
133 * repinfo.adb (List_Array_Info): In -gnatR4 mode, set the
134 relevant flag on the component type here instead of...
135 (List_Object_Info): Likewise for the object type.
136 (List_Entities): ...here. In -gnatR4 mode, recurse into
137 entities local to a record type.
138 (List_Component_Layout): In -gnatR4 mode, mark the type as
141 2019-08-21 Bob Duff <duff@adacore.com>
143 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-bitutil.o and
145 * exp_ch5.adb (Expand_Assign_Array_Bitfield): New function to
146 generate a call to Copy_Bitfield. This is disabled for now.
147 (Expand_Assign_Array_Loop_Or_Bitfield): New function to decide
148 whether to call Expand_Assign_Array_Bitfield.
149 (Expand_Assign_Array): Call Expand_Assign_Array_Loop_Or_Bitfield
150 instead of Expand_Assign_Array_Loop.
151 * libgnat/s-bitfie.ads, libgnat/s-bituti.adb,
152 libgnat/s-bituti.ads: New units.
153 * rtsfind.ads: Add enum literals for accessing Copy_Bitfield.
155 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
157 * bindo-graphs.ads (Iterate_Edges_To_Successors): Fix typo in
159 * bindo-graphs.adb (Delete_Edge): Fix layout in parameter list.
161 2019-08-21 Gary Dismukes <dismukes@adacore.com>
163 * exp_ch3.adb (Build_Master): Suppress call to
164 Build_Class_Wide_Master in the case where the
165 access-to-limited-class-wide type was created for a component in
166 an entry's formal parameter
167 block (Is_Parameter_Block_Component_Type), to prevent a master
168 from being created for such access types generated by the front
169 end in a task spec for entry formals in a parameter block. Add
170 a ??? about whether this suppression should be done more
171 generally (such as by using Comes_From_Source).
173 2019-08-21 Eric Botcazou <ebotcazou@adacore.com>
175 * exp_ch6.adb (Expand_N_Extended_Return_Statement): In the case
176 of a built-in-place function that doesn't need a BIP_Alloc_Form
177 parameter but returns unconstrained, build the return
178 consistently using the function's result subtype. Remove bypass
179 added in previous change.
181 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
183 * sem_prag.adb (Max_Entry_Queue_Length): Do not substitute
184 expression of the pragma argument with its value during
186 * sem_util.adb (Get_Max_Queue_Length): Compute value of the
187 pragma argument when needed.
189 2019-08-21 Yannick Moy <moy@adacore.com>
191 * checks.adb (Install_Null_Excluding_Check): Do not install
192 check in GNATprove mode.
194 2019-08-21 Yannick Moy <moy@adacore.com>
196 * sem_spark.adb (Process_Path): Do nothing on address of
199 2019-08-21 Eric Botcazou <ebotcazou@adacore.com>
201 * exp_util.adb (Finalize_Address): Deal consistently with
202 subtypes of private protected types.
204 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
206 * exp_util.adb (Corresponding_Runtime_Package): Use high-level
208 * sem_ch8.adb (Analyze_Renamed_Entry): Likewise.
209 * sem_ch9.adb (Analyze_Requeue): Likewise.
211 2019-08-21 Javier Miranda <miranda@adacore.com>
213 * sem_util.adb (Update_Named_Associations): Update
214 First_Named_Actual when the subprogram call has a single named
217 2019-08-21 Joel Brobecker <brobecker@adacore.com>
219 * doc/Makefile (mk_empty_dirs): New (PHONY) rule.
220 (%.html, %.pdf, %.txt, %.info, %.texinfo): Add dependencies on
223 2019-08-21 Justin Squirek <squirek@adacore.com>
225 * doc/gnat_rm/implementation_defined_pragmas.rst: Modify
226 documentation to reflect expected behavior.
227 * gnat_rm.texi: Regenerate.
228 * sem_prag.adb (Analyze_Pragma): Modify handling of pragma
229 Max_Entry_Queue_Length to not reject integer values of negative
231 * sem_util.adb (Get_Max_Queue_Length): Add processing for values
232 of negative one to fit within the current scheme.
234 2019-08-20 Arnaud Charlet <charlet@adacore.com>
236 * exp_unst.adb (Unnest_Subprograms, Unnest_Subprogram): Take
237 inlining (-gnatn) into account.
239 2019-08-20 Ed Schonberg <schonberg@adacore.com>
241 * exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case
242 Storage_Size): If the expression for Storage_Size is not static
243 it may depend on characterstics of another type that may bot be
244 frozen yet, so the elaboration of the expression for the aspect
245 must be attached directly to the freeze actions of the type to
248 2019-08-20 Piotr Trojanek <trojanek@adacore.com>
250 * exp_util.adb (Build_DIC_Procedure_Declaration): Set the last
251 entity of the generated Default_Initial_Condition procedure in
252 order to construct a proper entity chain.
254 2019-08-20 Yannick Moy <moy@adacore.com>
256 * exp_spark.adb (Expand_SPARK_N_Slice_Or_Indexed_Component):
257 Renaming of function to apply to slices as well.
258 (Expand_SPARK): Expand prefix of slices of access type.
260 2019-08-20 Bob Duff <duff@adacore.com>
262 * exp_aggr.adb (Expand_Array_Aggregate): Use build-in-place in
263 the nonlimited case in STEP 4. This improves the efficiency of
264 things like (1 .. 1000 => <>). We still generate some code for
265 that, unfortunately, but it is much improved.
266 (Aggr_Assignment_OK_For_Backend): Return false if <> components
269 2019-08-20 Bob Duff <duff@adacore.com>
271 * exp_ch6.adb (Needs_BIP_Alloc_Form): Call
272 Requires_Transient_Scope rather than checking constrainedness
273 and so forth. We have previously improved
274 Requires_Transient_Scope to return False in various cases,
275 notably a limited record with an access discriminant. This
276 change takes advantage of that to avoid using the secondary
277 stack for functions returning such types.
278 (Make_Build_In_Place_Call_In_Allocator): Be consistent by
279 calling Needs_BIP_Alloc_Form rather than Is_Constrained and so
281 * sem_ch4.adb (Analyze_Allocator): The above change causes the
282 compiler to generate code that is not legal Ada, in particular
283 an uninitialized allocator for indefinite subtype. This is
284 harmless, so we suppress the error message in this case.
286 2019-08-20 Gary Dismukes <dismukes@adacore.com>
288 * ali.adb, ali.ads, aspects.adb, checks.ads, checks.adb,
289 doc/gnat_rm/implementation_defined_pragmas.rst,
290 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
291 einfo.ads, exp_aggr.adb, exp_ch11.adb, exp_ch3.ads, exp_ch4.adb,
292 exp_disp.adb, inline.adb, libgnat/a-locale.ads,
293 libgnat/s-soflin.ads, par_sco.adb, repinfo.adb, sem_ch5.adb,
294 sem_disp.adb, sem_elab.adb, sem_eval.adb, sem_spark.adb,
295 sem_spark.ads, sinfo.ads: Minor reformattings, typo fixes and
298 2019-08-20 Dmitriy Anisimkov <anisimko@adacore.com>
300 * adaint.c (__gnat_to_gm_time): On _WIN32, don't round time up
303 2019-08-20 Ed Schonberg <schonberg@adacore.com>
305 * sem_ch3.adb (Analyze_Object_Declaration): If actual type is
306 private and distinct from nominal type in declaration, propagate
307 flags Is_Constr_Subt_For_U_Nominal and _UN_Aliased to full view
310 2019-08-20 Ed Schonberg <schonberg@adacore.com>
312 * exp_attr.adb (Expand_Loop_Entry_Attribute): When expanding a
313 loop entry attribute for a while_loop we construct a function
314 that incorporates the expanded condition of the loop. The itypes
315 that may be generated in that expansion must carry the scope of
316 the constructed function for proper handling in gigi.
318 2019-08-20 Ed Schonberg <schonberg@adacore.com>
320 * exp_disp.adb (Build_Class_Wide_Check, Replace_Formals): When a
321 dispatching call tp a subprogram with a class-wide precondition
322 occurrs in the same declarative part as the ancestor subprogram
323 being called, the`expression for the precondition has not been
324 analyzed yet. Such a call may appear, e.g. in an expression
325 function. In that case, the replacement of formals by actuals in
326 the call cannot use the formal entities of the subprogram being
327 called, and the occurrence of the formals in the expression must
328 be located by name (Chars fields) as would be done at a later
329 freeze point, when the expression is resolved in the context of
330 the subprogram itself.
332 2019-08-20 Bob Duff <duff@adacore.com>
334 * sem_prag.adb (Persistent_BSS): If an initialization is present
335 because of Initialize_Scalars or Normalize_Scalars, generate an
336 implicit pragma Suppress_Initialization to remove that, because
337 initialization is not allowed for these variables. Other
338 initializations remain illegal.
340 2019-08-20 Gary Dismukes <dismukes@adacore.com>
342 * sem_ch3.adb (OK_For_Limited_Init_In_05): In the case of type
343 conversions, apply the recursive call to the Original_Node of
344 the expression Exp rather than the Expression of the
345 Original_Node, in the case where Exp has been rewritten;
346 otherwise, when Original_Node is the same as Exp, apply the
347 recursive call to the Expression.
348 (Check_Initialization): Revise condition for special check on
349 type conversions of limited function calls to test Original_Node
350 (avoiding spurious errors on expanded unchecked conversions
351 applied to build-in-place dispatching calls).
353 2019-08-20 Patrick Bernardi <bernardi@adacore.com>
355 * exp_aggr.adb (Expand_Record_Aggregate): Always convert a
356 record Aggregate to assignment statements if the option
357 Aggregate_Individually_Assign is set.
358 * opt.ads (Aggregate_Individually_Assign): New option.
359 * par-prag.adb (Prag): Add Pragma_Aggregate_Individually_Assign.
360 * sem_prag.adb (Analyze_Pragma): Likewise.
361 * snames.ads-tmpl: Add Pragma_Aggregate_Individually_Assign and
362 Name_Aggregate_Individually_Assign.
363 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
364 pragma Aggregate_Individually_Assign.
365 * gnat_rm.texi: Regenerate.
367 2019-08-20 Bob Duff <duff@adacore.com>
369 * par-ch4.adb: Minor wording change in error messages.
370 * sem_aggr.adb (Resolve_Delta_Aggregate): Emit an error for Ada
371 versions prior to Ada 2020.
373 2019-08-20 Bob Duff <duff@adacore.com>
375 * freeze.adb (Is_Atomic_VFA_Aggregate): Make the temp for
376 initialization of the atomic variable be constant. This is
377 cleaner, and might improve efficiency.
379 2019-08-20 Eric Botcazou <ebotcazou@adacore.com>
381 * repinfo.adb (List_Record_Info): In -gnatR4 mode, set the
382 relevant flag on the implicit base type of a record subtype.
384 2019-08-20 Bob Duff <duff@adacore.com>
386 * sem_eval.adb (Expr_Value): Implement the case of an unchecked
387 conversion of a static expression.
389 2019-08-20 Bob Duff <duff@adacore.com>
391 * sem_ch13.adb (Is_Null_Array): New function, used to detect the
392 null array case; used to warn about uncheckedly converting to a
393 zero-sized array. It is unfortunate that we can't just check
394 the size, and warn on all cases of converting from a
395 nonzero-sized type to a zero-sized one. That's because "0" means
396 two different things: "size is zero" and "size is unknown".
397 Until we fix that design flaw, we need this more targeted fix.
399 2019-08-20 Bob Duff <duff@adacore.com>
401 * libgnat/a-cborma.adb, libgnat/a-cborse.adb (Clear): Repeatedly
402 call Delete. This avoids clearing the free list, which
403 substantially speeds up future Delete operations.
405 2019-08-20 Bob Duff <duff@adacore.com>
407 * sem_ch13.adb (Component_Order_Check): New procedure to check
408 for out-of-order clauses.
409 * warnsw.ads, warnsw.adb: New -gnatw_r switch.
410 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
412 * gnat_ugn.texi: Regenerate.
414 2019-08-20 Bob Duff <duff@adacore.com>
416 * sem_ch13.adb (Object_Size): Give an error for zero. It really
417 rubs me the wrong way that we don't honor "for T'Object_Size use
418 0;", but it's not important enough to fix. In any case, if we're
419 not going to obey the clause, we should give an error.
421 2019-08-20 Bob Duff <duff@adacore.com>
423 * errout.adb (Error_Msg_Internal): Set Warn_Err in case of
425 * erroutc.adb (Output_Msg_Text): Do Warnings_Treated_As_Errors
426 processing and [warning-as-error] modification for style
427 messages. Clean up code, simplify, remove unnecessary block
428 statement, add renaming of table entry.
429 * erroutc.ads (Warning_Treated_As_Error): Fix comment: no such
430 thing as Set_Warning_As_Error.
431 * opt.ads: Clean up comments and move related declarations near
433 * par-prag.adb: Process Warning_As_Error. This is necessary
434 because many style warning happen during parsing.
435 * sem_prag.adb: Use new Acquire_Warning_Match_String.
436 * sem_util.ads, sem_util.adb (Acquire_Warning_Match_String): New
437 function shared by par-prag.adb and sem_prag.adb. Replaces the
438 procedure in sem_prag.adb. Avoid use of global variables.
439 * stringt.ads, stringt.adb (To_String): New function to convert
441 * doc/gnat_rm/implementation_defined_pragmas.rst: Document the
443 * gnat_rm.texi: Regenerate.
445 2019-08-20 Eric Botcazou <ebotcazou@adacore.com>
447 * lib.ads: Add with clause for GNAT.HTable.
448 Add pragma Inline for Is_Loaded and alphabetize the list.
449 (Unit_Name_Table_Size): New constant.
450 (Unit_Name_Header_Num): New subtype.
451 (Unit_Name_Hash): New function declaration.
452 (Unit_Names): New simple hash table.
453 (Init_Unit_Name): New procedure declaration.
454 * lib.adb (Set_Unit_Name): Unregister the old name in the table,
455 if any, and then register the new name.
456 (Init_Unit_Name): New procedure.
457 (Is_Loaded): Reimplement using a lookup in the names table.
458 (Remove_Unit): Unregister the name.
459 (Unit_Name_Hash): New function.
460 * lib-load.adb (Create_Dummy_Package_Unit): Call Init_Unit_Name.
461 (Load_Unit): Use a lookup in the names table to find out whether
462 the unit has already been loaded. Call Init_Unit_Name and then
463 Remove_Unit if the loading has failed.
464 (Make_Child_Decl_Unit): Call Init_Unit_Name.
465 (Make_Instance_Unit): Likewise.
466 * lib-writ.adb (Ensure_System_Dependency): Likewise.
468 2019-08-20 Bob Duff <duff@adacore.com>
470 * sem_ch13.adb (Record_Hole_Check): Initialize After_Last.
472 2019-08-20 Piotr Trojanek <trojanek@adacore.com>
474 * impunit.adb (Get_Kind_Of_Unit): Revert change for adapting
475 this routine for gnatprove.
477 2019-08-20 Arnaud Charlet <charlet@adacore.com>
479 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
480 requirements for Pragma Lock_Free.
481 * gnat_rm.texi: Regenerate.
483 2019-08-20 Philippe Gil <gil@adacore.com>
485 * bindgen.adb (Gen_Main): Set gnat_argc/gnat_argv to argc/argv
486 only when still uninitialized.
488 2019-08-20 Bob Duff <duff@adacore.com>
490 * libgnat/g-comlin.ads (Exit_From_Command_Line): Fix
491 documentation for GNAT.Command_Line.
493 2019-08-20 Pierre-Marie de Rodat <derodat@adacore.com>
496 * gcc-interface/lang.opt (-fdump-scos): Add missing dot at the
497 end of the documentation.
499 2019-08-20 Richard Sandiford <richard.sandiford@arm.com>
501 * gcc-interface/misc.c (default_pass_by_ref): Update call to
504 2019-08-19 Bob Duff <duff@adacore.com>
506 * doc/gnat_rm/implementation_advice.rst: Fix documentation for
507 stream oriented attributes.
508 * gnat_rm.texi: Regenerate.
510 2019-08-19 Gary Dismukes <dismukes@adacore.com>
512 * einfo.ads (E_Function, E_Procedure): Update comments to
513 reflect that Renamed_Entity is also used for nongeneric
516 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
518 * sem_prag.adb (Is_Before_First_Decl): Deal with rewritten
521 2019-08-19 Bob Duff <duff@adacore.com>
523 * sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning
524 on formal parameters of dispatching operations.
526 2019-08-19 Ed Schonberg <schonberg@adacore.com>
528 * sem_res.adb (Resolve_Call): A call to an expression function
529 freezes when expander is active, unless the call appears within
530 the body of another expression function,
532 2019-08-19 Dmitriy Anisimkov <anisimko@adacore.com>
534 * libgnat/s-os_lib.ads, libgnat/s-os_lib.adb (To_Ada, To_C): New
537 2019-08-19 Bob Duff <duff@adacore.com>
539 * exp_attr.adb (Attribute_Valid): Correct the handling of
540 private types where the full type is modular. System.Address is
541 an example. Otherwise, we convert uncheckedly to a signed type,
542 so we get an incorrect range 0 .. -1, for which all values will
543 fail. The 'Valid attribute is illegal for such types, but we
544 generate such illegal attribute_references for 'Valid_Scalars,
545 and we generate 'Valid_Scalars when the -gnateV switch is used.
546 Rename Btyp --> PBtyp to avoid hiding the outer Btyp, which was
548 * libgnat/a-except.adb: Set the Exception_Raised component.
549 Otherwise, we have incorrect reads of invalid data.
551 2019-08-19 Pierre-Marie de Rodat <derodat@adacore.com>
553 * libgnat/a-cgaaso.ads, libgnat/a-cgarso.ads,
554 libgnat/a-cogeso.ads, libgnat/a-contai.ads,
555 libgnat/a-locale.ads: Import documentation from the RM.
557 2019-08-19 Jerome Guitton <guitton@adacore.com>
559 * Makefile.rtl (system.o): New target to add generation of
561 * gcc-interface/Makefile.in (install-gnatlib): Install
562 ada_target_properties.
564 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
566 * inline.adb (Add_Inlined_Body): Do not special-case instances
567 that are compilation units.
568 (Add_Pending_Instantiation): Likewise.
569 (Instantiate_Body): Skip instantiations that are compilation
570 units and have already been performed.
571 * sem_ch12.adb (Needs_Body_Instantiated): Do not special-case
572 instances that are compilation units.
573 (Load_Parent_Of_Generic): Be prepared for parent that is a
574 compilation unit but whose instantiation node has not been
577 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
579 * inline.adb (Initialize, Lock): Deal with
580 Called_Pending_Instantiations.
582 2019-08-19 Ed Schonberg <schonberg@adacore.com>
584 * sem_ch6.adb (Check_Synchronized_Overriding): Complete
585 predicate that applies legality check in 9.4 (11.9/2): if an
586 inherited subprogram is implemented by a protected procedure or
587 entry, its first paarameter must be out, in_out or
590 2019-08-19 Javier Miranda <miranda@adacore.com>
593 * exp_atag.ads, exp_atag.adb (Build_Inherit_Predefined_Prims):
594 Adding formal to specify how many predefined primitives are
595 inherited from the parent type.
596 * exp_disp.adb (Number_Of_Predefined_Prims): New subprogram.
597 (Make_Secondary_DT): Compute the number of predefined primitives
598 of all tagged types (including tagged types not defined at
599 library level). Previously we unconditionally relied on the
600 Max_Predef_Prims constant value when building the dispatch
601 tables of tagged types not defined at library level (thus
602 consuming more memory for their dispatch tables than required).
603 (Make_DT): Compute the number of predefined primitives that must
604 be inherited from their parent type when building the dispatch
605 tables of tagged types not defined at library level. Previously
606 we unconditionally relied on the Max_Predef_Prims constant value
607 when building the dispatch tables of tagged types not defined at
608 library level (thus copying more data than required from the
611 2019-08-19 Bob Duff <duff@adacore.com>
613 * sem_ch13.adb (Record_Hole_Check): Procedure to check for holes
614 that incudes processing type extensions. A type extension is
615 processed by first calling Record_Hole_Check recursively on the
616 parent type to compute the bit number after the last component
619 2019-08-19 Gary Dismukes <dismukes@adacore.com>
621 * checks.adb (Length_Mismatch_Info_Message): New function in
622 Selected_Length_Checks to return a message indicating the
623 element counts for the mismatched lengths for a failed
624 compile-time length check.
625 (Plural_Or_Singular_Ending): Support function in
626 Length_Mismatch_Info_Message to return either "" or "s", for
627 concatenating to the end of words.
628 (Selected_Length_Checks): Pass the result of
629 Length_Mismatch_Info_Message as an extra warning message to
630 Compile_Time_Constraint_Error to indicate the mismatched lengths
631 for a failed compile-time length check.
632 * sem_util.ads (Compile_Time_Constraint_Error): Add an optional
633 message formal (Extra_Msg), defaulted to the empty string.
634 * sem_util.adb (Compile_Time_Constraint_Error): Output an extra
635 message following the main warning message (when Extra_Msg is
636 not the empty string).
638 2019-08-19 Patrick Bernardi <bernardi@adacore.com>
640 * socket.c: Removed the redefinition of getaddrinfo, getnameinfo
641 and freeaddrinfo to internal VxWorks kernel calls because they
642 are, well, internal kernel calls and cannot be called from RTPs.
643 VxWorks provides the necessary components to call these routines
646 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
648 * exp_dist.adb (Is_Generic_Actual_Subtype): New predicate.
649 (Build_From_Any_Call, Build_To_Any_Call, Build_TypeCode_Call):
650 Use it instead of Is_Generic_Actual_Type flag to detect subtypes
651 representing generic actual types.
653 2019-08-19 Ed Schonberg <schonberg@adacore.com>
655 * sem_warn.adb (Check_References, Generic_Body_Formal): When a
656 formal parameter of a generic subprogram is not referenced in
657 the body, place the corresponding warning on the corresponding
658 entity in the specification of the generic body, as is done for
659 non-generic subprograms.
661 2019-08-19 Bob Duff <duff@adacore.com>
663 * errout.ads (Size_Too_Small_Message): New constant.
664 * errout.adb, freeze.adb, sem_ch13.adb: Use it.
666 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
668 * exp_dist.adb (Build_Package_Stubs): Do not specifically visit
669 the declarations of an N_Subprogram_Instantiation node.
671 2019-08-19 Bob Duff <duff@adacore.com>
673 * doc/gnat_ugn/gnat_utility_programs.rst: Document missing
676 2019-08-19 Piotr Trojanek <trojanek@adacore.com>
678 * sem_ch12.adb (Get_Unit_Instantiation_Node): Simplify Nkind_In
680 * sem.adb (Depends_On_Main): Whitespace cleanup; only assign a
681 local variable if needed.
683 2019-08-19 Claire Dross <dross@adacore.com>
685 * sem_spark.ads, sem_spark.adb (Is_Pledge_Function): New
686 parameter of the generic. Function used to decide whether a
687 function is a pledge function.
688 (Check_Not_Borrowed): Disable check inside the second parameter
689 of a pledge function for the path borrowed by the first
690 parameter. Also disable checks for entities inside a Global
693 2019-08-19 Joffrey Huguet <huguet@adacore.com>
695 * libgnat/a-cfdlli.ads, libgnat/a-cfhama.ads,
696 libgnat/a-cfinve.ads, libgnat/a-cforma.ads,
697 libgnat/a-cofove.ads, libgnat/a-cofuma.ads,
698 libgnat/a-cofuve.ads: Add formal function parameter "=" (L, R :
699 Element_Type) to the generic packages.
701 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
703 * opt.ads: Clean up left-overs of earlier implementation in
706 2019-08-19 Ed Schonberg <schonberg@adacore.com>
708 * sem_ch3.adb (Derived_Enumeration_Type): Do no freeze anonymous
709 base type if the bounds in the derived type declaration are
710 literals of the type.
712 2019-08-19 Yannick Moy <moy@adacore.com>
714 * sem_res.adb (Resolve_Call): Check non-aliasing rules before
717 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
719 * inline.adb (Add_Inlined_Body): Do not add pending
721 * sem_ch12.adb (Needs_Body_Instantiated): New predicate.
722 (Analyze_Package_Instantiation): Use it to decide whether to add
723 a pending instantiation for the body of the package.
725 2019-08-19 Olivier Hainque <hainque@adacore.com>
727 * gcc-interface/trans.c (Acc_Loop_to_gnu): Return the openacc
728 BIND_EXPR node we have constructed on purpose. Remove unused
731 2019-08-19 Pierre-Marie de Rodat <derodat@adacore.com>
733 * gcc-interface/lang.opt (fdump-scos): Define.
734 * gcc-interface/misc.c (gnat_handle_option): Handle
737 2019-08-14 Joffrey Huguet <huguet@adacore.com>
739 * libgnat/a-cofuba.ads: Add a Length attribute to type
740 Container. Add a type Array_Base which replaces the previous
741 Elements attribute of Container.
742 (Content_Init): New subprogram. It is used to initialize the
743 Base attribute of Container.
744 * libgnat/a-cofuba.adb (Resize): New subprogram. It is used to
745 resize the underlying array of a container if necessary.
746 (=, <=, Find, Get, Intersection, Length, Num_Overlaps, Set,
747 Union): Update to match changes in type declarations.
748 (Add): Modify body to damp the time and space cost in a specific
750 (Content_Init): New subprogram. It is used to initialize the
751 Base attribute of Container.
752 (Remove): Modify body to damp the time and space cost in a
755 2019-08-14 Bob Duff <duff@adacore.com>
757 * sem_ch13.adb (Get_Alignment_Value): Return 1 for Alignment 0,
758 and do not give an error.
759 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Update the
760 corresponding documentation.
761 * gnat_rm.texi: Regenerate.
763 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
765 * inline.adb (Add_Pending_Instantiation): Fix off-by-one error
766 in the comparison against the maximum number of instantiations.
768 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
770 * inline.adb (Add_Pending_Instantiation): Use greater-or-equal
771 in the comparison against the maximum number of instantiations.
773 2019-08-14 Ed Schonberg <schonberg@adacore.com>
775 * sem_aux.adb (Next_Rep_Item): If a node in the rep chain
776 involves a Ghost aspect it may have been replaced by a null
777 statement; use the original node to find next Rep_Item.
778 * repinfo.adb (List_Entities): Do not list an Ignored
779 Ghost_Entity, for which information may have been deleted.
781 2019-08-14 Bob Duff <duff@adacore.com>
783 * sem_prag.ads, sem_prag.adb
784 (Process_Compile_Time_Warning_Or_Error): In parameterless
785 version, improve detection of whether we are in a generic unit
786 to cover the case of an instance within a generic unit.
787 (Process_Compile_Time_Warning_Or_Error): Rename the
788 two-parameter version to be
789 Validate_Compile_Time_Warning_Or_Error, and do not export it.
790 Issue a warning if the condition is not known at compile time.
791 The key point is that the warning must be given only for pragmas
792 deferred to the back end, because the back end discovers
793 additional values that are known at compile time. Previous
794 changes in this ticket have enabled this by deferring to the
795 back end without checking for special cases such as 'Size.
796 (Validate_Compile_Time_Warning_Or_Error): Rename to be
797 Defer_Compile_Time_Warning_Error_To_BE.
798 * warnsw.ads, warnsw.adb (Warn_On_Unknown_Compile_Time_Warning):
799 Add new switches -gnatw_c and -gnatw_C to control the above
801 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
802 Document new switches.
803 * gnat_ugn.texi: Regenerate.
805 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
807 * sem_ch12.adb (Might_Inline_Subp): Rework comment and restrict
808 the shortcut based on Is_Inlined to the back-end inlining case.
810 2019-08-14 Bob Duff <duff@adacore.com>
812 * inline.adb (Check_And_Split_Unconstrained_Function): Ignore
813 protected functions to get rid of spurious error. The
814 transformation done by this procedure triggers legality errors
815 in the generated code in this case.
817 2019-08-14 Bob Duff <duff@adacore.com>
819 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Defer
820 processing to the back end in all cases where the pragma's
821 condition is not known at compile time during the front end
822 (except in generics), as opposed to detecting 'Size attributes
823 and the like. This ensures that we take advantage of whatever
824 can be compile-time known after running the back end, as opposed
825 to having the front end guess what the back end can do. Remove
826 a little duplicated code at the call site.
827 * gnat1drv.adb (Post_Compilation_Validation_Checks): Unlock the
828 Elists while in Validate_Compile_Time_Warning_Errors, because it
829 does analysis and name resolution, which sometimes involves
832 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
834 * einfo.ads (Is_Called): Document new usage on E_Package
836 * einfo.adb (Is_Called): Accept E_Package entities.
837 (Set_Is_Called): Likewise.
838 * exp_ch6.adb (Expand_Call_Helper): Move code dealing with
839 instances for back-end inlining to Add_Inlined_Body.
840 * inline.ads: Remove with clauses for Alloc and Table.
841 (Pending_Instantiations): Move to...
842 * inline.adb: Add with clauses for Alloc, Uintp, Table and
844 (Backend_Instances): New variable.
845 (Pending_Instantiations): ...here.
846 (Called_Pending_Instantiations): New table.
847 (Node_Table_Size): New constant.
848 (Node_Header_Num): New subtype.
849 (Node_Hash): New function.
850 (To_Pending_Instantiations): New hash table.
851 (Add_Inlined_Body): Bail out early for subprograms in the main
852 unit or subunit. Likewise if the Is_Called flag is set. If the
853 subprogram is an instance, invoke Add_Inlined_Instance. Call
854 Set_Is_Called earlier. If the subrogram is within an instance,
855 invoke Add_Inlined_Instance. Also deal with the case where the
856 call itself is within an instance.
857 (Add_Inlined_Instance): New procedure.
858 (Add_Inlined_Subprogram): Remove conditions always fulfilled.
859 (Add_Pending_Instantiation): Move the defence against ludicruous
860 number of instantiations to here. When back-end inlining is
861 enabled, associate an instantiation with its index in table and
862 mark a few selected kinds of instantiations as always needed.
863 (Initialize): Set Backend_Instances to No_Elist.
864 (Instantiate_Body): New procedure doing the work extracted
866 (Instantiate_Bodies): ...here. When back-end inlining is
867 enabled, loop over Called_Pending_Instantiations instead of
868 Pending_Instantiations.
869 (Is_Nested): Minor tweak.
870 (List_Inlining_Info): Also list the contents of
872 * sem_ch12.adb (Might_Inline_Subp): Return early if Is_Inlined
873 is set and otherwise set it before returning true.
874 (Analyze_Package_Instantiation): Remove the defence against
875 ludicruous number of instantiations. Invoke
876 Remove_Dead_Instance instead of doing the removal manually if
877 there is a guaranteed ABE.
879 2019-08-14 Gary Dismukes <dismukes@adacore.com>
881 * exp_ch3.adb (Predef_Spec_Or_Body): For an equality operation
882 of an interface type, create an expression function (that
883 returns False) rather than declaring an abstract function.
884 * freeze.adb (Check_Inherited_Conditions): Set Needs_Wrapper to
885 False unconditionally at the start of the loop creating wrappers
886 for inherited operations.
888 2019-08-14 Bob Duff <duff@adacore.com>
890 * table.adb: Assert that the table is not locked when increasing
891 Last, even if it doesn't cause reallocation. In other words,
892 assert that on operations that MIGHT cause reallocation.
893 * table.ads: Fix comment accordingly.
895 2019-08-14 Arnaud Charlet <charlet@adacore.com>
897 * doc/gnat_ugn/gnat_and_program_execution.rst: Remove
898 documentation of gnatelim.
900 2019-08-14 Bob Duff <duff@adacore.com>
902 * sem_prag.adb (Validate_Compile_Time_Warning_Error): Attach the
903 warning to the Sloc of the first pragma argument, rather than to
904 the pragma itself. This is to make pragmas processed after the
905 back end use the same Sloc as pragmas processed earlier, in the
906 front end. There's no reason for this discrepancy, and it
907 hinders further work on this ticket.
909 2019-08-14 Bob Duff <duff@adacore.com>
911 * sem.ads (Inside_A_Generic): Remove the ??? comment.
913 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
915 * inline.ads (Pending_Descriptor): Delete.
916 * inline.adb (Initialize): Do not initialize it.
917 * sem_ch12.adb (Delay_Descriptors): Delete.
918 (Analyze_Package_Instantiation): Call
919 Set_Delay_Subprogram_Descriptors instead of Delay_Descriptors
922 2019-08-14 Bob Duff <duff@adacore.com>
924 * exp_aggr.adb (Init_Hidden_Discriminants): Avoid processing the
925 wrong discriminant, which could be of the wrong type.
927 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
929 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
930 the Is_Generic_Instance flag previously set on the package
931 generated for the instantiation of a generic subprogram.
933 2019-08-14 Ed Schonberg <schonberg@adacore.com>
935 * exp_ch4.adb (Expand_N_Quantified_Expression): Freeze
936 explicitly the type of the loop parameter.
938 2019-08-14 Javier Miranda <miranda@adacore.com>
940 * sem_util.adb (New_Copy_Tree.Copy_Node_With_Replacement):
941 Update the Chars attribute of identifiers.
943 2019-08-14 Yannick Moy <moy@adacore.com>
945 * sem_spark.adb, sem_spark.ads (Is_Legal): New function exposed
946 for use in GNATprove, to test legality rules not related to
948 (Check_Declaration_Legality): Extract the part of
949 Check_Declaration that checks rules not related to permissions.
950 (Check_Declaration): Call the new Check_Declaration_Legality.
951 (Check_Type_Legality): Rename of Check_Type. Introduce
952 parameters to force or not checking, and update a flag detecting
954 (Check_Node): Ignore attribute references in statement position.
956 2019-08-14 Yannick Moy <moy@adacore.com>
958 * sem_spark.adb (Check_Old_Loop_Entry): New procedure to check
959 correct use of Old and Loop_Entry.
960 (Check_Node): Check subprogram contracts.
961 (Check_Pragma): Check Loop_Variant.
962 (Check_Safe_Pointers): Apply checking to library-level
963 subprogram declarations as well, in order to check their
966 2019-08-14 Yannick Moy <moy@adacore.com>
968 * sem_spark.adb (Is_Subpath_Expression): Take into account
969 conversion and qualification.
971 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
973 * sem_ch7.adb (Install_Private_Declarations)
974 <Swap_Private_Dependents>: Do not rely solely on the
975 Is_Child_Unit flag on the unit to recurse.
976 (Uninstall_Declarations) <Swap_Private_Dependents>: New
977 function. Use it to recurse on the private dependent entities
980 2019-08-14 Javier Miranda <miranda@adacore.com>
982 * exp_aggr.adb (Is_CCG_Supported_Aggregate): Return False for
983 arrays with bounds not known at compile time.
985 2019-08-14 Ed Schonberg <schonberg@adacore.com>
987 * sem_util.adb (New_Copy_Tree, Visit_Entity): A quantified
988 expression includes the implicit declaration of the loop
989 parameter. When a quantified expression is copied during
990 expansion, for example when building the precondition code from
991 the generated pragma, a new loop parameter must be created for
992 the new tree, to prevent duplicate declarations for the same
995 2019-08-14 Yannick Moy <moy@adacore.com>
997 * sem_disp.adb (Check_Dispatching_Operation): Update assertion
998 for the separate declarations created in GNATprove mode.
999 * sem_disp.ads (Is_Overriding_Subprogram): Update comment.
1000 * sem_elab.adb (SPARK_Processor): Fix test for checking of
1001 overriding primitives.
1003 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1005 * inline.adb (Add_Inlined_Body): Tweak comments.
1006 (List_Inlining_Info): Also list information about non-main
1009 2019-08-14 Gary Dismukes <dismukes@adacore.com>
1011 * sem_ch4.adb (Analyze_Selected_Component): In the case where
1012 the prefix is of a concurrent type, and the selected entity
1013 matching the selector is the first private declaration of the
1014 type (such as the first local variable in a task's body), set
1017 2019-08-14 Piotr Trojanek <trojanek@adacore.com>
1019 * einfo.adb (Is_Generic_Actual_Subprogram): Replace repeated
1020 calls to Ekind with Ekind_In.
1022 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1025 * gcc-interface/trans.c (gigi): Call set_decl_buillt_in_function.
1026 (Call_to_gnu): Use DECL_FE_FUNCTION_CODE instead of DECL_FUNCTION_CODE.
1028 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1030 * ali.ads (Linker_Option_Record): Remove Original_Pos component.
1031 * ali.adb (Scan_ALI): Do not set it.
1033 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1035 * sem_ch3.adb (Build_Derived_Concurrent_Type): Add a couple of
1036 local variables and use them. When the derived type fully
1037 constrains the parent type, rewrite it as a subtype of an
1038 implicit (unconstrained) derived type instead of the other way
1040 (Copy_And_Build): Deal with concurrent types and use predicates.
1041 (Build_Derived_Private_Type): Build the full derivation if
1042 needed for concurrent types too.
1043 (Build_Derived_Record_Type): Add marker comment.
1044 (Complete_Private_Subtype): Use predicates.
1046 2019-08-13 Ed Schonberg <schonberg@adacore.com>
1048 * sem_ch3.adb (Check_Generic_Ancestor): New subprogram,
1049 aubsidiary to Build_Derived_Record_Type. to enforce the rule
1050 that a type extension declared in a generic body cznnot have an
1051 ancestor that is a generic formal (RM 3.9.1 (4/2)). The rule
1052 applies to all ancestors of the type, including interface
1055 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1057 * sem_ch3.adb (Build_Underlying_Full_View): Delete.
1058 (Complete_Private_Subtype): Do not set the full view on the
1059 private subtype here. If the full base is itself derived from
1060 private, do not re-derive the parent type but instead constrain
1061 an existing underlying full view.
1062 (Prepare_Private_Subtype_Completion): Do not get to the
1063 underlying full view, if any. Set the full view on the private
1065 (Process_Full_View): Likewise.
1066 * sem_ch12.adb (Check_Generic_Actuals): Also set
1067 Is_Generic_Actual_Type on the full view if the type of the
1069 (Restore_Private_Views): Also reset Is_Generic_Actual_Type on
1070 the full view if the type of the actual is private.
1071 * sem_eval.adb (Subtypes_Statically_Match): Remove bypass for
1072 generic actual types.
1074 2019-08-13 Javier Miranda <miranda@adacore.com>
1076 * sem_res.adb (Resolve_Selected_Component): When the type of the
1077 component is an access to a class-wide type and the type of the
1078 context is an access to a tagged type the relevant type is that
1079 of the component (since in such case we may need to generate
1080 implicit type conversions or dispatching calls).
1082 2019-08-13 Ed Schonberg <schonberg@adacore.com>
1084 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Preanalyze
1085 expression, rather do a full analysis, to prevent unwanted
1086 removal of side effects which mask the intent of the expression.
1088 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1090 * impunit.adb (Non_Imp_File_Names_95): Add
1091 GNAT.Branch_Prediction.
1093 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1095 * exp_ch6.adb: Remove with and use clauses for Sem_Ch12.
1096 (Expand_Call_Helper): Swap the back-end inlining case and the
1097 special front-end expansion case. In back-end inlining mode, do
1098 not invoke Add_Inlined_Body unless the call may be inlined.
1099 * inline.ads (Add_Pending_Instantiation): New function moved
1101 * inline.adb (Add_Inlined_Body): Simplify comment. Turn test on
1102 the enclosing unit into assertion.
1103 (Add_Pending_Instantiation): New function moved from...
1104 * sem_ch12.ads (Add_Pending_Instantiation): ...here.
1105 * sem_ch12.adb (Add_Pending_Instantiation): ...here.
1107 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1109 * sem.adb (Do_Analyze): Recompute Style_Check_Max_Line_Length
1110 after restoring Style_Max_Line_Length.
1112 2019-08-13 Arnaud Charlet <charlet@adacore.com>
1114 * sem_ch13.adb (Check_Iterator_Functions): Protect against
1117 2019-08-13 Ed Schonberg <schonberg@adacore.com>
1119 * sem_ch8.adb (Analyze_Subprogram_Renaming): Do no suppress mode
1120 conformance checks on child unit instance that is a compilation
1123 2019-08-13 Gary Dismukes <dismukes@adacore.com>
1125 * exp_dbug.adb (Fully_Qualify_Name): Add full name qualification
1126 for the E_Exception case.
1128 2019-08-13 Gary Dismukes <dismukes@adacore.com>
1130 * exp_aggr.adb (Aggr_Size_OK): Compute the aggregate size using
1131 universal arithmetic, to avoid situations where the size
1132 computation overflows.
1134 2019-08-13 Justin Squirek <squirek@adacore.com>
1136 * repinfo.adb (List_Scalar_Storage_Order): Modify conditionals
1137 for displaying ordering to always be triggered when -gnatR4 is
1140 2019-08-13 Justin Squirek <squirek@adacore.com>
1142 * aspects.adb, aspects.ads: Register new aspect.
1143 * par-prag.adb (Prag): Register new pragma
1144 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing
1145 for new aspect similar to Aspect_Max_Entry_Queue_Length.
1146 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new
1147 pragma and set it to use the same processing as
1148 Pragma_Max_Queue_Length.
1149 * snames.ads-tmpl: Move definition of
1150 Name_Max_Entry_Queue_Length so that it can be processed as a
1151 pragma in addition to a restriction and add an entry for the
1154 2019-08-13 Yannick Moy <moy@adacore.com>
1156 * sem_ch4.adb (Analyze_Allocator): Do not insert subtype
1157 declaration for allocator inside a spec expression.
1159 2019-08-13 Yannick Moy <moy@adacore.com>
1161 * sem_res.adb (Resolve_Call): Do not inline calls inside record
1164 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1166 * sem_ch4.adb (Analyze_One_Call): Remove bypass for type
1167 mismatch in nested instantiations.
1168 * sem_ch8.adb (Find_Nearer_Entity): New function.
1169 (Find_Renamed_Entity): Use it to disambiguate the candidates for
1170 the renaming generated for an instantiation when it is
1173 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1175 * gnat1drv.adb (Adjust_Global_Switches): Do not set
1176 Back_End_Inlining in ASIS mode either.
1178 2019-08-13 Olivier Hainque <hainque@adacore.com>
1180 * libgnat/s-win32.ads: Define size_t and fix the MapViewOfFile
1181 binding to use it instead of DWORD for the dwNumberOfBytesToMap
1183 * libgnat/g-sercom__mingw.adb (Read): State which definition of
1184 size_t to fetch in call to Last_Index.
1186 2019-08-13 Arnaud Charlet <charlet@adacore.com>
1188 * gcc-interface/Make-lang.in: Remove unused TRACE variable. Pass
1189 LN_S to relevant gnatlib targets.
1190 * gcc-interface/Makefile.in: Systematically pass LN_S to
1191 relevant gnatlib targets.
1193 2019-08-13 Yannick Moy <moy@adacore.com>
1195 * sem_dim.adb (Analyze_Dimension,
1196 Analyze_Dimension_Array_Aggregate, Analyze_Dimension_Call,
1197 Analyze_Dimension_Extension_Or_Record_Aggregate): Return
1198 immediately when inside an inlined body.
1199 * sem_res.adb (Resolve_Call): Remove special checking now done
1200 inside Analyze_Dimension_Call.
1202 2019-08-13 Justin Squirek <squirek@adacore.com>
1204 * exp_ch4.adb (Expand_N_Allocator): Add condition to detect
1205 library-level object declarations
1207 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1209 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
1210 (-gnateT): Document Double_Float_Alignment parameter and fix
1211 description of Double_Scalar_Alignment parameter.
1212 * gnat_ugn.texi: Regenerate.
1214 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1216 * exp_ch6.adb (Expand_Call_Helper): If back-end inlining is
1217 enabled, also instantiate the body of a generic unit containing
1218 a subprogram subject to aspect/pragma Inline_Always at
1219 optimization level zero.
1220 * sem_ch12.adb (Might_Inline_Subp): Minor tweak.
1221 (Analyze_Package_Instantiation): Do not instantiate the package
1222 body because of inlining considerations if the instantiation is
1223 done in a generic unit. Move around similar condition involving
1224 the main unit. Add test on Back_End_Inlining to processing for
1227 2019-08-13 Javier Miranda <miranda@adacore.com>
1229 * exp_disp.adb (Make_Secondary_DT): Handle record type
1230 derivations that have interface components located at fixed
1231 positions and interface components located at variable offset.
1232 The offset of components located at fixed positions is computed
1233 using the dummy object (similar to the case where all the
1234 interface components are located at fixed positions).
1235 (Make_DT): Build the dummy object for all tagged types that
1236 implement interface types (that is, build it also for types with
1237 variable size components), and use the dummy object to compute
1238 the offset of all tag components located at fixed positions when
1239 initializing the Interface_Table object.
1241 2019-08-13 Justin Squirek <squirek@adacore.com>
1243 * gnatcmd.adb (GNATCmd): Add constant for new compiler switch
1244 --help-ada, and include usage subprogram. Add line to usage help
1245 explaining the new flag.
1246 (GNATCmd_Usage): Rename from locally declared Usage so as not to
1247 confuse with the newly imported version. Add new argument case
1248 for --help-ada and add bug report email to implicit display of
1249 help without the --help flag so as to unify output between the
1252 2019-08-13 Dmitriy Anisimkov <anisimko@adacore.com>
1254 * libgnat/g-comlin.adb (Getopt): Quote unrecognized switch in
1255 Invalid_Switch exception message.
1257 2019-08-13 Yannick Moy <moy@adacore.com>
1259 * sem_util.adb (Traverse_More_Func): Take into account
1260 Loop_Actions inside N_Iterated_Component_Association nodes.
1261 * sinfo.ads: Document correctly Loop_Actions as a field of nodes
1262 of kind N_Iterated_Component_Association.
1264 2019-08-13 Claire Dross <dross@adacore.com>
1266 * libgnat/a-cfinve.adb, libgnat/a-cofove.adb (Find_Index,
1267 Reverse_Find_Index): Use bigger type to avoid range check
1268 failure at the last loop iteration.
1270 2019-08-12 Dmitriy Anisimkov <anisimko@adacore.com>
1272 * libgnat/g-socket.adb (Is_IPv6_Address): Check that no less
1273 then 2 colons in IPv6 numeric address.
1275 2019-08-12 Dmitriy Anisimkov <anisimko@adacore.com>
1277 * libgnat/g-comlin.ads, libgnat/g-comlin.adb (Getopt): Add
1278 parameter Quiet. Need to do not output error messages to
1279 console. Invalid_Switch exception generation surrounded by an
1282 2019-08-12 Ed Schonberg <schonberg@adacore.com>
1284 * exp_ch6.adb (Expand_Actuals. Add_Call_By_Copy_Code): Add code
1285 to generate proper checks when an actual for an in-out or out
1286 parameter has a non-null access type. No constraints are
1287 applied to an inbound access parameter, but on exit a not-null
1288 check must be performed if the type of the actual requires it.
1290 2019-08-12 Ed Schonberg <schonberg@adacore.com>
1292 * sem_util.adb (Is_Expaned_Priority_Attribute): Check whether
1293 call comes from a rewritten attribute before comparing name with
1294 Get_Ceiling run-time subprogram.
1296 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1298 * exp_util.ads (Component_May_Be_Bit_Aligned): Small comment
1300 (Possible_Bit_Aligned_Component): Likewise.
1301 (Type_May_Have_Bit_Aligned_Components): Likewise.
1302 * exp_util.adb (Component_May_Be_Bit_Aligned): Likewise.
1303 (Possible_Bit_Aligned_Component): Likewise.
1304 (Type_May_Have_Bit_Aligned_Components): Likewise.
1306 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1308 * exp_ch4.adb (Expand_N_Op_Eq): Expand the array equality if
1309 either operand is a possibly unaligned slice.
1310 * exp_ch6.adb (Expand_Simple_Function_Return): Do not generate a
1311 copy for a possibly unaligned object if it is represented as a
1313 * exp_util.adb (Is_Possibly_Unaligned_Slice): Do not always
1314 return false if the target doesn't have strict alignment.
1316 2019-08-12 Bob Duff <duff@adacore.com>
1318 * sem_ch12.adb (Instantiate_Package_Body): Remove suppression of
1319 checks in instances of internal units.
1320 * sem_ch6.adb (Analyze_Function_Return): Do not generate a
1321 constraint check on an extended_return_statement if the subtype
1322 of the return object in the statement is identical to the return
1323 subtype of the function.
1325 2019-08-12 Bob Duff <duff@adacore.com>
1327 * libgnat/a-cbmutr.adb (Is_Reachable): Declare Idx to be of the
1328 base subtype. Clearly it makes no sense to loop "while Idx >=
1329 0", if Idx is of a nonnegative subtype.
1331 2019-08-12 Bob Duff <duff@adacore.com>
1333 * libgnat/a-tifiio.adb (Put_Scaled): Prevent AA from being
1334 negative, since Field is range 0 .. something.
1336 2019-08-12 Bob Duff <duff@adacore.com>
1338 * doc/gnat_ugn/gnat_utility_programs.rst (gnatmetric, gnatpp,
1339 gnatstub): Remove documentation for Ada language version
1340 switches, and note that they are no longer needed.
1342 2019-08-12 Gary Dismukes <dismukes@adacore.com>
1344 * sem_ch5.adb (Prepare_Param_Spec_Loop): Set the parents of the
1345 copied low and high bounds in the case where the loop range is
1346 given by a discrete_subtype_indication, to prevent hanging (or
1347 Assert_Failure) in Insert_Actions.
1349 2019-08-12 Ed Schonberg <schonberg@adacore.com>
1351 * sem_ch6.adb (heck_Untagged_Equality): Verify that user-defined
1352 equality has the same profile as the predefined equality before
1353 applying legality rule in RM 4.5.2 (9.8).
1355 2019-08-12 Bob Duff <duff@adacore.com>
1357 * libgnat/a-except.ads: Update obsolete comment, still making
1358 clear that this is a variant. Add explicit default for Id
1359 component of Exception_Occurrence, because that value is used.
1360 Define Null_Occurrence less redundantly.
1361 * libgnat/a-einuoc.adb: Minor simplification of code.
1363 2019-08-12 Justin Squirek <squirek@adacore.com>
1365 * libgnat/a-dhfina.adb, libgnat/a-dhfina.ads (Is_Simple_Name,
1366 Is_Root_Directory, Is_Parent_Directory,
1367 Is_Current_Directory_Name, Is_Relative_Name, Initial_Directory,
1368 Relative_Name, Compose): Add implementation and documentation.
1369 * libgnat/a-direct.adb (Containing_Directory): Modify routine to
1370 use routines from Ada.Directories.Hierarchical_File_Names and
1371 remove incorrect special case for parent directories.
1372 (Fetch_Next_Entry): Add check for current directory and parent
1373 directory and ignore them under certain circumstances.
1374 (Simple_Nmae): Add check for null result from
1375 Simple_Name_Internal and raise Name_Error.
1376 (Simple_Name_Internal): Add explicit check for root directories,
1377 sanitize trailing directory separators, and modify behavior so
1378 that current and parent directories are considered valid
1380 * Makefile.rtl: Add entry to GNATRTL_NONTASKING_OBJS.
1382 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1384 * freeze.adb (Freeze_Entity): Give the same error for an
1385 Object_Size clause on a variable-sized type as for a Size
1388 2019-08-12 Gary Dismukes <dismukes@adacore.com>
1390 * sem_prag.adb (Analyze_Pragma, Pragma_Suppress_Initialization):
1391 For private types, set the Suppress_Initialization flag on the
1392 Full_View of the entity rather than the entity's base type.
1394 2019-08-12 Yannick Moy <moy@adacore.com>
1396 * aspects.adb, aspects.ads (Aspect_No_Caching): New aspect.
1397 * contracts.adb, contracts.ads (Add_Contract_Item): Add handling
1399 (Analyze_Object_Contract): Add handling of No_Caching.
1400 * einfo.adb, einfo.ads
1401 (Get_Pragma): Add handling of No_Caching.
1402 * doc/gnat_rm/implementation_defined_aspects.rst,
1403 doc/gnat_rm/implementation_defined_pragmas.rst: Document new
1405 * gnat_rm.texi: Regenerate.
1406 * par-prag.adb (Prag): New pragma Pragma_No_Caching.
1407 * sem_ch13.adb (Analyze_Aspect_Specifications,
1408 Check_Aspect_At_Freeze_Point): Add handling of No_Caching.
1409 * sem_prag.adb (Analyze_Pragma): Deal with pragma No_Caching.
1410 * sem_prag.ads (Analyze_External_Property_In_Decl_Part): Now
1411 applies to No_Caching.
1412 * sem_util.adb, sem_util.ads (Is_Effectively_Volatile): Add
1413 handling of No_Caching.
1414 (No_Caching_Enabled): New query function.
1415 * snames.ads-tmpl: New names for pragma.
1417 2019-08-12 Yannick Moy <moy@adacore.com>
1419 * sem_util.adb, sem_util.ads (Traverse_More_Func,
1420 Traverse_More_Proc): Add formal parameter for Itypes traversal.
1422 2019-08-12 Yannick Moy <moy@adacore.com>
1424 * exp_attr.adb, exp_attr.ads (Expand_Size_Attribute): New
1425 procedure to share part of the attribute expansion with
1427 (Expand_N_Attribute_Reference): Extract part of the
1428 Size/Object_Size expansion in the new procedure
1429 Expand_Size_Attribute.
1430 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Expand
1431 Size/Object_Size attributes using the new procedure
1432 Expand_Size_Attribute.
1434 2019-08-12 Yannick Moy <moy@adacore.com>
1436 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Only
1437 expand Enum_Rep attribute when its parameter is a literal.
1439 2019-08-12 Justin Squirek <squirek@adacore.com>
1441 * sem_eval.adb (Check_Non_Static_Context): Add a condition to
1442 determine if a range violation constitues a warning or an error.
1443 (Out_Of_Range): Add a condition to determine if a range
1444 violation constitues a warning or an error.
1446 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1448 * exp_ch4.adb (Real_Range_Check): Do not rewrite the conversion
1449 node but its expression instead, after having fetched its
1450 current value. Clear the Do_Range_Check flag on entry. Return
1451 early for a rewritten float-to-float conversion. Remove
1452 redundant local variable. Suppress all checks when inserting
1453 the temporary and do not reanalyze the node.
1455 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1457 * sprint.ads: Minor comment tweak.
1459 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1461 * checks.adb (Insert_Valid_Check): Do not retrieve the
1462 Do_Range_Check flag from the Original_Node but from the
1463 Validated_Object. Remove useless bypass for floating-point
1466 2019-08-12 Yannick Moy <moy@adacore.com>
1468 * sem_util.adb, sem_util.ads (Traverse_More_Func,
1469 Traverse_More_Proc): New traversal subprograms.
1471 2019-08-12 Jerome Lambourg <lambourg@adacore.com>
1473 * libgnarl/s-taprop__vxworks.adb (Abort_Handler): Only call
1474 s-tpopsp.Self when actually needed.
1476 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1478 * exp_ch4.adb (Discrete_Range_Check): Return if checks are
1481 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1483 * sem_res.adb: Add with & use clause for Sem_Mech and
1485 (Resolve_Actuals): Do not apply a scalar range check for the
1486 source of a conversion whose result is passed by reference to a
1489 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1491 * checks.adb (Insert_Valid_Check): Reset the Do_Range_Check flag
1492 on the validated object.
1493 * exp_ch6.adb (Add_Call_By_Copy_Code): Reset the Do_Range_Check
1494 flag on the actual here, as well as on the Expression if the
1495 actual is a N_Type_Conversion node.
1496 (Add_Validation_Call_By_Copy_Code): Generate the incoming range
1497 check if needed and reset the Do_Range_Check flag on the
1498 Expression if the actual is a N_Type_Conversion node.
1499 (Expand_Actuals): Do not reset the Do_Range_Check flag here.
1500 Generate the incoming range check for In parameters here instead
1502 (Expand_Call_Helper): ...here. Remove redudant condition.
1503 * sem_res.adb (Resolve_Actuals): Use local variable A_Typ and
1504 remove obsolete comments.
1505 (Resolve_Type_Conversion): Do not force the Do_Range_Check flag
1506 on the operand if range checks are suppressed.
1508 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
1510 * checks.adb (Activate_Range_Check): Remove redundant argument.
1511 (Generate_Range_Check): Likewise.
1512 (Apply_Float_Conversion_Check): Reset the Do_Range_Check flag on
1513 entry and remove redundant condition.
1515 2019-08-02 Alexandre Oliva <oliva@adacore.com>
1517 * libgnat/a-exexpr.adb (Begin_Handler_v1, End_Handler_v1): New.
1518 (Claimed_Cleanup): New.
1519 (Begin_Handler, End_Handler): Document.
1520 * gcc-interface/trans.c (gigi): Switch to exception handler
1522 (Exception_Handler_to_gnu_gcc): Save the original cleanup
1523 returned by begin handler, pass it to end handler, and use
1524 EH_ELSE_EXPR to pass a propagating exception to end handler.
1525 (gnat_to_gnu): Leave the exception pointer alone for reraise.
1526 (add_cleanup): Handle EH_ELSE_EXPR, require it by itself.
1528 2019-07-23 Ed Schonberg <schonberg@adacore.com>
1530 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations,
1531 Freeze_Entity_Checks): Include Aspect_CPU with other aspects
1532 whose expresssion may depend on a discriminant, and thus require
1533 that components of the type be made visible.
1535 2019-07-23 Eric Botcazou <ebotcazou@adacore.com>
1537 * checks.adb (Convert_And_Check_Range): Add Suppress parameter
1538 and pass it in the call to Insert_Actions. Rename local
1540 (Generate_Range_Check): Minor comment fixes. Pass Range_Check
1541 in the first call to Convert_And_Check_Range and All_Checks in
1543 * exp_ch4.adb (Expand_N_Type_Conversion): Reset the
1544 Do_Overflow_Check flag in the float-to-float case too if there
1545 is also a range check.
1547 2019-07-23 Eric Botcazou <ebotcazou@adacore.com>
1549 * checks.adb (Activate_Overflow_Check): Remove redundant
1551 * exp_ch4.adb (Discrete_Range_Check): Reset the overflow flag.
1552 (Expand_N_Type_Conversion): Do not reset it here.
1554 2019-07-23 Eric Botcazou <ebotcazou@adacore.com>
1556 * repinfo.adb (List_Component_Layout): Pass Decimal to UI_Write.
1557 (Write_Val): Likewise.
1559 2019-07-23 Ed Schonberg <schonberg@adacore.com>
1561 * aspects.ads: New table Operational_Aspect, used to distinguish
1562 between aspects that are view-specific, such as those related to
1563 iterators, and representation aspects that apply to all views of
1565 * aspects.adb (Find_Aspect): If the aspect being sought is
1566 operational, do not ecamine the full view of a private type to
1568 * sem_ch5.adb (Analyze_Iterator_Specification): Improve error
1569 message when the intended domain of iteration does not implement
1570 the required iterator aspects.
1572 2019-07-23 Yannick Moy <moy@adacore.com>
1574 * sem_spark.ads (Is_Local_Context): New function.
1575 * sem_spark.adb (Check_Declaration): Issue errors on violations
1577 (Process_Path): Do not issue error on borrow/observe during
1578 elaboration, as these are caught by the new rule.
1580 2019-07-23 Yannick Moy <moy@adacore.com>
1582 * exp_ch7.adb (Create_Finalizer): Force finalizer not to be
1584 * exp_dbug.adb (Get_External_Name): Explain special case of
1587 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1589 * repinfo.adb (List_Entities): Also list compiled-generated
1590 types present as Etype of objects.
1592 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1594 * sinfo.ads: Update the documentation about the
1595 Do_Division_Check, Do_Overflow_Check and Do_Range_Check flags.
1597 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1599 * exp_ch4.adb (Expand_N_Type_Conversion): Beef up comment.
1600 (Fixup_Universal_Fixed_Operation): Set the base type instead of
1601 the type of the enclosing type conversion on the operation.
1603 2019-07-22 Ed Schonberg <schonberg@adacore.com>
1605 * exp_ch4.adb (Expand_N_In): Do not suggest the use of attribute
1606 'Valid as a replacement for a range check on a discrete type
1607 when the bounds of the range are given by type conversions,
1608 because in such a case there are distinct types involved and the
1609 subbested attribute replacement would be misplaced.
1611 2019-07-22 Yannick Moy <moy@adacore.com>
1613 * sem_spark.adb (Get_Root_Object, Is_Path_Expression,
1614 Is_Subpath_Expression): Add parameter Is_Traversal to adapt
1615 these functions to the case of paths returned from a traversal
1617 (Read_Indexes): Handle the case of an if-expression or
1619 (Check_Statement): Check Emit_Messages only when issuing an
1620 error message. This is important as Emit_Messages may store the
1621 information that an error was detected.
1623 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1625 * checks.adb (Apply_Type_Conversion_Checks): Do not set
1626 Do_Range_Check flag on conversions from fixed-point types
1628 * exp_attr.adb: Add use and with clause for Expander.
1629 (Expand_N_Attribute_Reference) <Fixed_Value, Integer_Value>: Set
1630 the Conversion_OK flag and do not generate overflow/range checks
1632 * exp_ch4.adb (Expand_N_Qualified_Expression): Remove
1633 superfluous clearing of Do_Range_Check flag.
1634 (Discrete_Range_Check): New procedure to generate a range check
1636 (Real_Range_Check): Remove redundant local variable and adjust.
1637 Remove useless shortcut. Clear Do_Range_Check flag on all
1639 (Expand_N_Type_Conversion): Remove redundant test on
1640 Conversion_OK. Call Discrete_Range_Check to generate range
1641 checks on discrete types. Remove obsolete code for
1642 float-to-integer conversions. Add code to generate range checks
1643 for conversions involving fixed-point types.
1645 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1647 * sprint.ads: Fix pasto in comment.
1649 2019-07-22 Javier Miranda <miranda@adacore.com>
1651 * sem_res.adb (Resolve_Actuals): Replace code that displaces the
1652 pointer to an allocated object to reference its secondary
1653 dispatch table by a type conversion (which takes care of
1654 handling all cases).
1656 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1658 * sprint.adb (Sprint_Node_Actual)
1659 <N_Decimal_Fixed_Point_Definition>: Swap a couple of spaces.
1660 (Write_Itype): Minor consistency fixes throughout. Add support
1661 for printing ordinary and decimal fixed-point types and
1664 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1666 * exp_attr.adb (Expand_Loop_Entry_Attribute): Beef up comment.
1668 2019-07-22 Ed Schonberg <schonberg@adacore.com>
1670 * libgnat/s-valboo.ads, libgnat/s-valcha.ads,
1671 libgnat/s-valdec.ads, libgnat/s-valenu.ads,
1672 libgnat/s-valint.ads, libgnat/s-vallld.ads,
1673 libgnat/s-vallli.ads, libgnat/s-valllu.ads,
1674 libgnat/s-valrea.ads, libgnat/s-valuns.ads,
1675 libgnat/s-valwch.ads: Change categorization of packages that
1676 implement attribute 'Value from Pure to Preelaborate, to prevent
1677 undesirable optimizations when the evaluation of the attribute
1678 raises Constraint_Error, but subsequent use of the result of
1679 this evsaluation is removed by a subsequent optimization.
1681 2019-07-22 Ed Schonberg <schonberg@adacore.com>
1683 * sem_warn.adb (Check_References): Do not emit s warning on a
1684 referenced entity with no explicit assignment if the type of the
1685 entity has Preelaborable_Initialixation, such as
1686 Exception_Occurrence.
1688 2019-07-22 Javier Miranda <miranda@adacore.com>
1690 * exp_ch4.adb (Size_In_Storage_Elements): Improve the expansion
1691 to handle array indexes that are modular type.
1692 (Expand_N_Allocator): For 32-bit targets improve the generation
1693 of the runtime check associated with large arrays supporting
1694 arrays initialized with a qualified expression.
1695 * libgnat/s-imenne.adb (Image_Enumeration_8,
1696 Image_Enumeration_16, Image_Enumeration_32): Define the index of
1697 Index_Table with range Natural'First .. Names'Length since in
1698 the worst case all the literals of the enumeration type would be
1699 single letter literals and the Table built by the frontend would
1700 have as many components as the length of the names string. As a
1701 result of this enhancement, the internal tables declared using
1702 Index_Table have a length closer to the real needs, thus
1703 avoiding the declaration of large arrays on 32-bit CCG targets.
1705 2019-07-22 Yannick Moy <moy@adacore.com>
1707 * sem_ch3.adb (Constrain_Access): Issue a message about ignored
1710 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1712 * sem_ch8.adb (End_Use_Type): Reset the In_Use flag on the
1713 class-wide type if the type is tagged.
1714 (Use_One_Type): Add commentary on the handling of the class-wide
1717 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1719 * einfo.ads (Is_For_Access_Subtype): Delete.
1720 (Set_Is_For_Access_Subtype): Likewise.
1721 * einfo.adb (Is_For_Access_Subtype): Likewise.
1722 (Set_Is_For_Access_Subtype): Likewise.
1723 (Write_Entity_Flags): Do not write Is_For_Access_Subtype.
1724 * exp_ch4.adb (Expand_N_Selected_Component): Do not deal with
1726 * exp_spark.adb (Expand_SPARK_N_Selected_Component): Likewise.
1727 * sem_ch4.adb (Analyze_Explicit_Dereference): Likewise.
1728 * sem_ch3.adb (Build_Discriminated_Subtype): Do not build a
1729 special private subtype for access-to-record subtypes.
1731 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1733 * sem_ch3.adb (Complete_Private_Subtype): Rework the setting of
1734 the Etype of the full view for full base types that cannot
1735 contain any discriminant. Remove code and comment about it in
1738 2019-07-22 Ed Schonberg <schonberg@adacore.com>
1740 * sem_ch3.adb (Convert_Bound): Subsidiary of
1741 Floating_Point_Type_Declaration, to handle properly range
1742 specifications with bounds that may include static constants of
1743 a given type rather than real literals.
1745 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1747 * sem_aggr.adb (Rewrite_Bound): Be prepared for discriminals
1749 (Rewrite_Range;): Minor tweak.
1750 (Resolve_Record_Aggregate): For a component with default
1751 initialization whose expression is an array aggregate, also
1752 rewrite the bounds of the component associations, if any.
1754 2019-07-22 Gary Dismukes <dismukes@adacore.com>
1756 * exp_ch5.adb (Expand_N_Case_Statement): In the case where a
1757 case statement is rewritten as an equivalent if statement,
1758 inherit the From_Condition_Expression flag from the case
1761 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1763 * sem_ch8.adb (Check_Constrained_Object): Further extend the
1764 special optimization to all limited types.
1766 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1768 * exp_attr.adb (Expand_N_Attribute_Reference)
1769 <Attribute_Enum_Val>: Set No_Truncation on the
1770 N_Unchecked_Type_Conversion built around the argument passed to
1773 2019-07-22 Nicolas Roche <roche@adacore.com>
1775 * libgnat/s-valrea.adb (Scan_Real): Ignore non significative
1776 digits to avoid converging to infinity in some cases.
1778 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1780 * libgnat/g-encstr.adb (Encode_Wide_String): Fix oversight.
1781 (Encode_Wide_Wide_String): Likewise.
1783 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1785 * sem_warn.adb (Find_Var): Bail out for a function call with an
1786 Out or In/Out parameter.
1788 2019-07-22 Nicolas Roche <roche@adacore.com>
1790 * terminals.c (__gnat_tty_waitpid): Support both blocking and
1792 * libgnat/g-exptty.ads (Is_Process_Running): New function.
1793 * libgnat/g-exptty.adb (Close): Don't try to interrupt/terminate
1794 a process if it is already dead.
1796 2019-07-22 Ed Schonberg <schonberg@adacore.com>
1798 * freeze.adb (Freeze_Fixed_Point_Type): When freezing a
1799 fixed-point subtype, check whether the parent type declarastion
1800 includes an aspect specification for the 'Small type attribute,
1801 and inherit the specified value.
1803 2019-07-22 Javier Miranda <miranda@adacore.com>
1805 * freeze.adb (Freeze_Subprogram): Check that C++ constructors
1806 must have external or link name.
1808 2019-07-22 Ed Schonberg <schonberg@adacore.com>
1810 * sem_res.adb (Resolve_Selected_Component): If the prefix has a
1811 deferred reference, generate the correct reference now, to
1812 indicate that the previous assignment is used. This prevents
1813 spurious warnings on useless assignments when compiling with all
1814 warnings enabled. when there is a subsequent call in the same
1815 stqtement list, in which the prefix of the selected component is
1816 the actual for an out parameter.
1818 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
1820 * exp_attr.adb (Expand_Loop_Entry_Attribute): Copy the condition
1821 of a while loop instead of simply relocating it.
1823 2019-07-18 Arnaud Charlet <charlet@adacore.com>
1825 * Makefile.rtl, expect.c, env.c, aux-io.c, mkdir.c, initialize.c,
1826 cstreams.c, raise.c, tracebak.c, adadecode.c, init.c, raise-gcc.c,
1827 argv.c, adaint.c, adaint.h, ctrl_c.c, sysdep.c, rtinit.c, cio.c,
1828 seh_init.c, exit.c, targext.c: Introduce a "STANDALONE" mode where C
1829 runtime files do not have any dependency on GCC include files.
1830 Remove unnecessary includes.
1831 Remove remaining references to VMS in runtime C file.
1832 * runtime.h: new File.
1834 2019-07-13 Andreas Schwab <schwab@linux-m68k.org>
1836 * Makefile.rtl: Use g-sercom__linux.adb for all linuxes.
1838 2019-07-11 Piotr Trojanek <trojanek@adacore.com>
1840 * lib-writ.adb (Ensure_System_Dependency,
1841 Up_To_Date_ALI_File_Exists, Write_ALI): Replace low-level access
1842 to table with a high-level query.
1844 2019-07-11 Piotr Trojanek <trojanek@adacore.com>
1846 * checks.adb: Fix typo in comment.
1847 * sem.adb (Semantics): Avoid repeated calls to
1848 In_Extended_Main_Source_Unit by reusing an already-cached
1850 * sem_util.adb (First_Global): Fix style.
1852 2019-07-11 Yannick Moy <moy@adacore.com>
1854 * sem_res.adb (Resolve_Call): Do not perform dimensionality
1855 checking on inlined bodies.
1857 2019-07-11 Yannick Moy <moy@adacore.com>
1859 * debug.adb: Flip meaning of debug switch -gnatdF.
1861 2019-07-11 Yannick Moy <moy@adacore.com>
1863 * sem_eval.adb (Is_Same_Value): Add special case for rewritten
1864 Loop_Entry attribute.
1866 2019-07-11 Claire Dross <dross@adacore.com>
1868 * gnat1drv.adb: SPARK checking rules for pointer aliasing are
1869 moved to GNATprove backend.
1870 * sem_spark.ads, sem_spark.adb (Sem_SPARK): Is now a generic
1871 unit. Takes as parameters:
1872 - Retysp which is used to query the most underlying type
1873 visible in SPARK. We do not introduce aliasing checks for
1874 types which are not visibly deep.
1875 - Component_Is_Visible_In_SPARK is used to avoid doing pointer
1876 aliasing checks on components which are not visible in SPARK.
1877 - Emit_Messages returns True in the second phase of SPARK
1878 analysis. Error messages for failed aliasing checks are only
1879 output in this case.
1880 Additionally, errors on constructs not supported in SPARK are
1881 removed as duplicates of marking errors. Components are stored
1882 in the permission map using their original component to avoid
1883 inconsistencies between components of different views of the
1885 (Check_Expression): Handle delta constraints.
1886 (Is_Deep): Exported so that we can check for SPARK restrictions
1887 on deep types inside SPARK semantic checkings.
1888 (Is_Traversal_Function): Exported so that we can check for SPARK
1889 restrictions on traversal functions inside SPARK semantic
1891 (Check_Call_Statement, Read_Indexes): Check wether we are
1892 dealing with a subprogram pointer type before querying called
1894 (Is_Subpath_Expression): Image attribute can appear inside a
1896 (Check_Loop_Statement): Correct order of statements in the loop.
1897 (Check_Node): Ignore raise nodes.
1898 (Check_Statement): Use Last_Non_Pragma to get the object
1899 declaration in an extended return statement.
1901 2019-07-11 Patrick Bernardi <bernardi@adacore.com>
1903 * bindgen.adb (Gen_Main): Do not generate a reference to
1904 Ada_Main_Program_Name when the Minimal_Binder flag is set.
1905 (Gen_Output_File_Ada): Do not output GNAT_Version and
1906 Ada_Main_Program_Name info if Minimal_Binder flag is set.
1907 * bindusg.adb: Add documentation for new -minimal switch.
1908 * gnatbind.adb (Scan_Bind_Arg): Scan -minimal switch.
1909 * opt.ads: Add new global flag Minimal_Binder to indicate if the
1910 binder should not produce global variables.
1911 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1912 Update documentation with new binder -minimal switch.
1913 * gnat_ugn.texi: Regenerate.
1915 2019-07-11 Eric Botcazou <ebotcazou@adacore.com>
1917 * Makefile.rtl: Add warning note about compilation flags and
1920 2019-07-11 Ed Schonberg <schonberg@adacore.com>
1922 * exp_ch9.adb (Expand_N_Protected_Type_Declaaration): New
1923 subsidiary routine Replace_Access_Definition, to handle properly
1924 a protected type PT one of whose private components is of type
1927 2019-07-11 Dmitriy Anisimkov <anisimko@adacore.com>
1929 * libgnat/g-socket.ads (Level_Type): Add enumerators for
1930 IP_Protocol_For_ICMP, IP_Protocol_For_IGMP,
1931 IP_Protocol_For_RAW_Level.
1932 * libgnat/g-socket.adb (Levels): Handle them.
1933 * s-oscons-tmplt.c: Import socket protocols defined in
1936 2019-07-11 Claire Dross <dross@adacore.com>
1938 * libgnat/a-cfhama.adb, libgnat/a-cfhase.adb (Free): Do not
1939 reset the Has_Element flag if no element is freed.
1941 2019-07-11 Arnaud Charlet <charlet@adacore.com>
1943 * errno.c: Remove obsolete support for MaRTE OS.
1945 2019-07-11 Ed Schonberg <schonberg@adacore.com>
1947 * exp_ch4.adb (Expand_N_Type_Conversion): If a predicate check
1948 is generated, analyze it with range check suppressed, because
1949 that check has been previously applied.
1950 * exp_ch5.adb (Expand_N_Assignment_Statement): If the RHS is a
1951 type conversion to the type of the LHS, do not apply a predicate
1952 check to the RHS because it will have been generated already
1953 during its expansion.
1954 * exp_ch6.adb (Can_Fold_Predicate_Call): Extend processing to
1955 handle a predicate check on a constant entity whose value is
1958 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
1960 * bindo.adb: Remove the documentation of switch -d_N because it
1961 is no longer in use.
1962 * bindo-graphs.ads, bindo-graphs.adb (Is_Spec_Before_Body_Edge):
1964 * bindo-writers.adb (Write_Dependency_Edge): Add the missing
1965 case of a spec-before-body edge.
1967 2019-07-11 Dmitriy Anisimkov <anisimko@adacore.com>
1969 * libgnat/g-socket.ads (Mode_Type): Add a Socket_Raw enumerator.
1970 * libgnat/g-socket.adb (Modes): Handle Socket_Raw.
1972 2019-07-11 Justin Squirek <squirek@adacore.com>
1974 * exp_ch9.adb (Build_Private_Protected_Declaration): Add
1975 exception for the moving of pragmas to internally generated
1976 specs for pragma Unreferenced.
1978 2019-07-11 Bob Duff <duff@adacore.com>
1980 * doc/gnat_ugn/gnat_utility_programs.rst: Fix inconsistent
1981 documentation for gnatmetric.
1982 * gnat_ugn.texi: Regenerate.
1984 2019-07-11 Bob Duff <duff@adacore.com>
1986 * doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's
1987 --spaces-only switch.
1989 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
1991 * sem_util.adb (Null_Status): Assume that an erroneous construct
1992 has an undefined null status.
1994 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
1996 * checks.adb, exp_ch6.adb, gnat1drv.adb, sem_aux.adb,
1997 sem_ch2.adb, sem_ch8.adb, sem_res.adb: Minor reformatting.
1999 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2001 * sem_ch8.adb (Analyze_Object_Renaming): Obtain the object being
2002 renamed using routine Get_Object_Name which takes care of
2004 (Get_Object_Name): New routine.
2006 2019-07-11 Ed Schonberg <schonberg@adacore.com>
2008 * exp_ch6.adb (Can_Fold_Predicate_Call): New function,
2009 subsidiary of Expand_Call_Helper, to compute statically a
2010 predicate check when the argument is a static integer.
2012 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2014 * sem_res.adb (Resolve_Op_Not): Do not rewrite an equality
2015 operator into a function call when the operator is intrinsic.
2017 2019-07-11 Thomas Quinot <quinot@adacore.com>
2019 * sem_prag.adb (Analyze_Pragma, case pragma Check): Do not call
2020 Set_SCO_Pragma_Enabled for the dynamic predicate case.
2022 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2024 * exp_util.ads, exp_util.adb (Needs_Finalization): Move to
2026 * sem_ch9.adb (Analyze_Protected_Definition): Code cleanup. Mark
2027 the protected type as having controlled components when it
2028 contains at least one such component.
2029 * sem_util.ads, sem_util.adb (Needs_Finalization): New
2032 2019-07-11 Eric Botcazou <ebotcazou@adacore.com>
2034 * alloc.ads (Rep_JSON_Table_Initial): New constant.
2035 (Rep_JSON_Table_Increment): Likewise.
2036 * debug.adb: Document -gnatd_j switch.
2037 * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add
2039 * gnat1drv.adb: Add with clause for Repinfo.Input.
2040 Add with and use clauses for Sinput.
2041 (Read_JSON_Files_For_Repinfo): New procedure.
2042 (Gnat1drv1): Deal with -gnatd_j switch.
2043 * repinfo-input.ad[sb]: New unit.
2044 * snames.ads-tmpl (Name_Discriminant): New constant.
2045 (Name_Operands): Likewise.
2047 2019-07-11 Justin Squirek <squirek@adacore.com>
2049 * checks.adb (Apply_Accessibility_Check): Add check for constant
2050 folded conditions on accessibility checks.
2052 2019-07-11 Arnaud Charlet <charlet@adacore.com>
2054 * libgnarl/g-thread.ads, libgnarl/g-thread.adb (Get_Thread):
2055 Update comments. Add new version taking a Task_Id.
2057 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2059 * bindo.adb: Update the section of switches and debugging
2061 * bindo.ads: Add type Elaboration_Phase.
2062 * bindo-augmentors.adb: Add use clause for
2063 Bindo.Writers.Phase_Writers.
2064 (Augment_Library_Graph): Signal the start and end of the
2066 * bindo-builders.adb: Add with and use clause for Bindo.Writers.
2067 Add use clause for Bindo.Writers.Phase_Writers.
2068 (Build_Invocation_Graph): Signal the start and end of the
2069 invocation graph construction phase.
2070 (Build_Library_Graph): Signal the start and end of the library
2071 graph construction phase.
2072 * bindo-diagnostics.adb: Add use clause for
2073 Bindo.Writers.Phase_Writers.
2074 (Diagnose_Cycle): Signal the start and end of the cycle
2076 * bindo-elaborators.adb: Add use clause for
2077 Bindo.Writers.Phase_Writers.
2078 (Elaborate_Units): Signal the start and end of the unit
2080 * bindo-graphs.adb: Add use clause for
2081 Bindo.Writers.Phase_Writers.
2082 (Find_Components): Signal the start and end of the component
2084 (Find_Cycles): Signal the start and end of the cycle discovery
2086 * bindo-units.adb: Add with and use clause for Bindo.Writers.
2087 Add use clause for Bindo.Writers.Phase_Writers.
2088 (Collect_Elaborable_Units): Signal the start and end of the unit
2090 * bindo-validators.adb: Add with and use clause for
2091 Bindo.Writers. Add use clause for Bindo.Writers.Phase_Writers.
2092 (Validate_Cycles, Validate_Elaboration_Order,
2093 Validate_Invocation_Graph, Validate_Library_Graph): Signal the
2094 start and end of the libray graph validation phase.
2095 * bindo-writers.ads, bindo-writers.adb: Add new nested package
2097 * debug.adb: Update the documentation of switch d_S.
2099 2019-07-11 Yannick Moy <moy@adacore.com>
2101 * sem_res.adb (Check_Argument_Order): Special case calls to
2104 2019-07-10 Dmitriy Anisimkov <anisimko@adacore.com>
2106 * libgnat/s-ststop.adb: Remove System.Strings.Stream_Ops
2107 dependence on System.Streams.Stream_IO.
2109 2019-07-10 Ed Schonberg <schonberg@adacore.com>
2111 * sem_ch2.adb (Analyze_Integer_Literal): Preserve the type of
2112 the literal if prior analysis determined that its type is a
2113 modular integer type.
2115 2019-07-10 Doug Rupp <rupp@adacore.com>
2117 * init.c: Do not attempt to re-arm guard page on x86_64-vx7(r2).
2119 2019-07-10 Ed Schonberg <schonberg@adacore.com>
2121 * sem_ch8.adb (Check_Constrained_Object): A record that is
2122 limited because of the presence of a limited component is
2123 constrained, and no subtype indiciation needs to be created for
2124 it, just as is the case for declared limited records.
2126 2019-07-10 Yannick Moy <moy@adacore.com>
2128 * sem_aux.adb, sem_aux.ads (Is_Protected_Operation): New
2129 function to determine if a subprogram is protected.
2130 * sem_spark.adb (Setup_Protected_Components): New procedure to
2131 add protected components to the environment.
2132 (Check_Callable_Body): Call the new Setup_Protected_Components.
2133 (Check_Package_Spec): Merge local environment with enclosing one
2136 2019-07-10 Claire Dross <dross@adacore.com>
2138 * sem_spark.adb (Check_Expression): Allow digits constraints as
2140 (Illegal_Global_Usage): Pass in the entity.
2141 (Is_Subpath_Expression): New function to allow different nodes
2142 as inner parts of a path expression.
2143 (Read_Indexes): Allow concatenation and aggregates with box
2144 expressions. Allow attributes Update and Loop_Entry.
2145 (Check_Expression): Allow richer membership test.
2146 (Check_Node): Ignore bodies of generics.
2147 (Get_Root_Object): Allow concatenation and attributes.
2149 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2151 * sem_ch6.adb (Check_Discriminant_Conformance): Use Find_Type to
2152 discover the type of a full view discriminant.
2154 2019-07-10 Arnaud Charlet <charlet@adacore.com>
2156 * doc/gnat_ugn/gnat_and_program_execution.rst: Improve gnatmem's
2157 doc for the depth switch.
2159 2019-07-10 Bob Duff <duff@adacore.com>
2161 * doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's
2162 --source-line-breaks switch.
2164 2019-07-10 Justin Squirek <squirek@adacore.com>
2166 * doc/gnat_rm/implementation_defined_attributes.rst: Add mention
2167 of 'Image attribute with 'Img's entry to mention additional
2168 added 2012 usage of Obj'Image.
2169 * doc/gnat_rm/implementation_defined_pragmas.rst: Correct
2170 mispelling of Async_Writers.
2171 * gnat_rm.texi: Regenerate.
2172 * sem_prag.adb (Analyze_Pragma): Correct mispelling of
2174 * sem_util.adb (State_Has_Enabled_Property): Correct mispelling
2177 2019-07-10 Simon Buist <buist@adacore.com>
2179 * sem_util.ads (Child_Prefix): New constant.
2180 * sem_util.adb (Unique_Name): Add a special prefix to child
2181 units that have a nested subprogram or package.
2183 2019-07-10 Arnaud Charlet <charlet@adacore.com>
2185 * sfn_scan.adb (Scan_SFN_Pragmas): Add pragma Assert.
2187 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2189 * sem_ch3.adb (Check_Nonoverridable_Aspects): Correct the
2190 spelling in certain error messages.
2191 (Check_Pragma_Implemented): Correct the spelling in certain
2194 2019-07-10 Eric Botcazou <ebotcazou@adacore.com>
2196 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-brapre.
2197 * libgnat/g-brapre.ads: New package specification.
2198 * doc/gnat_rm/the_gnat_library.rst: Document it.
2199 * gnat_rm.texi: Regenerate.
2201 2019-07-10 Yannick Moy <moy@adacore.com>
2203 * osint-c.adb (Set_File_Name): Always add extension for multiple
2204 units per file mode.
2206 2019-07-10 Corentin Gay <gay@adacore.com>
2208 * sysdep.c: Put include directive for 'vxWorks.h' before any
2209 other VxWorks headers.
2211 2019-07-10 Eric Botcazou <ebotcazou@adacore.com>
2213 * doc/gnat_rm/implementation_defined_attributes.rst
2214 (Scalar_Storage_Order): Minor tweaks. Add note about debuggers.
2215 * gnat_rm.texi: Regenerate.
2217 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2219 * exp_ch4.adb (Expand_N_Case_Expression): Mark the generated
2220 assignments to the temporary result as being OK because the
2221 expansion of case expressions is correct by construction.
2222 (Is_Copy_Type): Update the predicate to match the comment
2225 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2227 * bindo-graphs.adb, bindo.adb, debug.adb, exp_ch6.adb,
2228 sem_ch10.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb,
2229 sem_ch6.adb, sem_ch7.adb, sem_res.adb, sem_spark.adb,
2230 sem_util.adb, warnsw.ads: Minor reformatting.
2232 2019-07-10 Joffrey Huguet <huguet@adacore.com>
2234 * libgnat/a-strbou.ads, libgnat/a-strfix.ads,
2235 libgnat/a-strunb.ads, libgnat/a-strunb__shared.ads: Add global
2236 contracts, contract cases, preconditions and postconditions to
2237 procedures and functions.
2239 2019-07-10 Doug Rupp <rupp@adacore.com>
2241 * sysdep.c (__gnat_is_file_not_found_error): Reformulate to also
2242 work for vxworks7r2 SR0610.
2244 2019-07-10 Doug Rupp <rupp@adacore.com>
2246 * env.c (__gnat_environ): Reformulate to also work for
2249 2019-07-10 Patrick Bernardi <bernardi@adacore.com>
2251 * Makefile.rtl: Handle vxworks7r2 ppc target
2253 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2255 * bindo.adb: Update the section on switches.
2257 (Add_Cycle, Add_Vertex_And_Complement): Remove.
2258 (Create): The graph no longer needs a set of recorded cycles
2259 because the cycles are not rediscovered in permuted forms.
2260 (Cycle_End_Vertices): New routine.
2261 (Destroy): The graph no longer needs a set of recorded cycles
2262 because the cycles are not rediscovered in permuted forms.
2263 (Destroy_Library_Graph_Vertex): Move to the library level.
2264 (Find_All_Cycles_Through_Vertex, Find_All_Cycles_With_Edge):
2266 (Find_Cycles_From_Successor, Find_Cycles_From_Vertex,
2267 Find_Cycles_In_Component, Has_Elaborate_All_Edge): New routines.
2268 (Insert_And_Sort): Remove.
2269 (Is_Elaborate_Body_Edge): Use predicate
2270 Is_Vertex_With_Elaborate_Body.
2271 (Is_Recorded_Cycle): Remove.
2272 (Is_Vertex_With_Elaborate_Body): New routine.
2273 (Normalize_And_Add_Cycle): Remove.
2274 (Precedence): Rename to xxx_Precedence, where xxx relates to the
2275 input. These versions better reflect the desired input
2277 (Record_Cycle): New routine.
2278 (Remove_Vertex_And_Complement, Set_Is_Recorded_Cycle): Remove.
2279 (Trace_xxx): Update all versions to use debug switch -d_t.
2280 (Trace_Component): New routine.
2281 (Trace_Eol): Removed.
2282 (Trace_Vertex): Do not output the component as this information
2283 is already available when the component is traced.
2284 (Unvisit, Visit): New routine.
2285 * bindo-graphs.ads: Add new instance LGV_Lists. Remove instance
2286 RC_Sets. Update the structure of type Library_Graph_Attributes
2287 to remove the set of recorded cycles.
2288 (Destroy_Library_Graph_Vertex): Move to the library level.
2289 * bindo-writers.adb (Write_Component_Vertices): Output
2290 information about the number of vertices.
2291 * debug.adb: Document the use of binder switch -d_t. Update the
2292 use of binder switch -d_T.
2294 2019-07-10 Yannick Moy <moy@adacore.com>
2296 * sem_spark.adb (Get_Root_Object): Replace precondition by error
2298 (Read_Indexes): Replace precondition by error message.
2299 (Check_Callable_Body): Check only traversal function returns an
2300 anonymous access type.
2301 (Check_Expression): Issue error on unexpected expression as
2303 * sem_util.adb (First_Global): Fix access to global on
2306 2019-07-10 Javier Miranda <miranda@adacore.com>
2308 * exp_ch6.adb (Is_Class_Wide_Interface_Type): New subprogram.
2309 (Expand_Call_Helper): Handle non-limited views when we check if
2310 any formal is a class-wide interface type.
2311 * exp_disp.adb (Expand_Interface_Actuals): Handle non-limited
2312 views when we look for interface type formals to force "this"
2315 2019-07-10 Ed Schonberg <schonberg@adacore.com>
2317 * sem_res.adb (Resolve_Equality_Op): Do not replace the resolved
2318 operator by its alias if expander is not active, because the
2319 operand type may not be frozen yet and its inherited operations
2320 have not yet been created.
2322 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2324 * bindo-elaborators.adb (Elaborate_Units): Set attribute
2325 Elab_Position of all elaborated units.
2326 (Set_Unit_Elaboration_Positions): New routine.
2328 2019-07-10 Gary Dismukes <dismukes@adacore.com>
2330 * exp_util.adb: Reformatting and a typo fix.
2332 2019-07-10 Yannick Moy <moy@adacore.com>
2334 * exp_util.adb (Remove_Side_Effects): Prefer renamings for
2335 objects of possible owning type in GNATprove mode.
2337 2019-07-09 Ed Schonberg <schonberg@adacore.com>
2339 * sem_ch3.adb (Analyze_Object_Declaration): If the object type
2340 is a composite type that has a dynamic predicate and, the
2341 expression in the declaration is an aggregate, the generated
2342 predicate check must appear after the expanded code for the
2343 aggregate, which will appear after the rewritten object
2346 2019-07-09 Justin Squirek <squirek@adacore.com>
2348 * sem_eval.adb (Expr_Value_E): Add conditional to correctly
2349 handle constant enumerated character types.
2351 2019-07-09 Eric Botcazou <ebotcazou@adacore.com>
2353 * libgnarl/s-osinte__mingw.ads (CRITICAL_SECTION): Use proper
2354 type for SpinCount component.
2356 2019-07-09 Justin Squirek <squirek@adacore.com>
2358 * exp_ch4.adb (Expand_N_Allocator): Add conditional to detect
2359 the presence of anoymous access type allocators and issue a
2360 warning if the appropriate warning flag is enabled.
2361 * warnsw.ads: Add new warning flag for anonymous allocators
2362 * warnsw.adb (All_Warnings, Restore_Warnings, Save_Warnings,
2363 Set_Underscore_Warning_Switch): Register new flags.
2364 (WA_Warnings): Register new flag as an "all warnings" switch
2366 doc/gnat_ugn/building_executable_programs_with_gnat.rst:
2367 Document new warning switches -gnatw_a and -gnatw_A.
2368 * gnat_ugn.texi: Regenerate.
2370 2019-07-09 Ed Schonberg <schonberg@adacore.com>
2372 * sem_ch4.adb (Diagnose_Call): Improve error recovery when a
2373 local subprogram name hides a possible candidate name declared
2374 in a child package in the context of the current unit.
2375 * sem_ch6.adb (Process_Formals): Protect against malformed
2376 formal types when the parameter type does not denote an entity.
2378 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
2380 * bindo-augmentors.adb (Visit_Elaboration_Root): Do not start a
2381 DFS from an elaboration root whose corresponding unit lacks
2382 elaboration code. This behavior mimics that of the old
2383 elaboration order mechanism.
2384 * bindo-graphs.adb (Find_All_Cycles_Through_Vertex): Move the
2385 vertex tracing within the functional branches of the routine.
2386 This prevents spurious trace output.
2387 (Has_No_Elaboration_Code): New routine.
2388 (Trace_Cycle, Trace_Edge): Update the various Ids to use the
2389 "standard" trace format.
2390 * bindo-graphs.ads (Has_No_Elaboration_Code): New routine.
2391 * bindo-units.ads, bindo-units.adb (Has_No_Elaboration_Code):
2394 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
2396 * ali.ads, bindo-graphs.adb, bindo-validators.adb, clean.adb,
2397 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst, einfo.ads,
2398 exp_aggr.adb, exp_ch13.adb, exp_ch4.adb, exp_ch5.adb,
2399 exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_pakd.adb,
2400 fname-uf.ads, gnatlink.adb, inline.adb, lib.ads, make.adb,
2401 namet.ads, opt.ads, par-ch4.adb, par-ch6.adb, par-labl.adb,
2402 prep.adb, sem_aggr.adb, sem_ch13.adb, sem_ch4.adb, sem_ch5.adb,
2403 sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch8.adb, sem_dim.adb,
2404 sem_disp.adb, sem_prag.adb, sem_res.adb, sem_warn.adb,
2405 sinfo.ads: Replace ". " with ". ". Minor reformatting and typo
2407 * gnat_ugn.texi: Generate.
2409 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
2411 * bindo.ads: Move type Precedence_Kind from the private to the
2412 visible part of the unit.
2413 * bindo-augmentors.adb: Remove the use of global data as it is
2415 (Augment_Library_Graph): Update the parameter profile.
2416 (Is_Visited, Set_Is_Visited): Remove.
2417 (Visit_Elaboration_Root, Visit_Elaboration_Roots): Update the
2418 parameter profile and comment on usage.
2419 (Visit_Vertex): Likewise. Also keep track of which invocation
2420 edge activates a task.
2421 * bindo-augmentors.ads (Augment_Library_Graph): Update the
2422 parameter profile and comment on usage.
2423 * bindo-builders.adb (Create_Forced_Edge,
2424 Create_Spec_And_Body_Edge, Create_With_Edge): Update the call to
2426 * bindo-diagnostics.adb: Add with end use clauses for Restrict
2428 (Output_Dynamic_Model_Suggestions): Remove.
2429 (Output_Invocation_Related_Suggestions): New routine.
2430 (Output_Suggestions): Output all invocation-related suggestions
2432 * bindo-elaborators.adb: Remove types Comparator_Ptr and
2434 (Find_Best_Vertex): Update the parameter profile.
2435 * bindo-graphs.adb (Activates_Task): New routine.
2436 (Add_Body_Before_Spec_Edge): Update the call to
2437 Add_Edge_With_Return.
2438 (Add_Edge): Update the parameter profile and the call to
2439 Add_Edge_With_Return.
2440 (Add_Edge_With_Return): Update the parameter profile and comment
2442 (At_Least_One_Edge_Satisfies): New routine.
2443 (Contains_Elaborate_All_Edge): Reimplement.
2444 (Contains_Static_Successor_Edge, Contains_Task_Activation): New
2446 (Contains_Weak_Static_Successor): Remove.
2447 (Is_Static_Successor_Edge): New routine.
2448 * bindo-graphs.ads: Add types LGE_Predicate_Ptr,
2449 LGV_Comparator_Ptr, and LGV_Predicate_Ptr. Update type
2450 Library_Graph_Edge_Attributes to capture whether an invocation
2451 edge activates a task. Update the value of
2452 No_Library_Graph_Edge_Attributes.
2453 (Activates_Task): Update the parameter profile and comment on
2455 (Contains_Static_Successor_Edge, Contains_Task_Activation): New
2457 (Contains_Weak_Static_Successor): Remove.
2458 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst:
2459 Update the documentation to reflect the new task-related advice.
2460 * gnat_ugn.texi: Regenerate.
2462 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
2464 * exp_util.adb (Containing_Package_With_Ext_Axioms): Replace
2465 low-level Ekind test with a high-level wrapper.
2467 2019-07-09 Arnaud Charlet <charlet@adacore.com>
2469 * libgnat/s-memory.adb: Disable calls to Abort defer/undefer
2470 when ZCX_By_Default.
2472 2019-07-09 Javier Miranda <miranda@adacore.com>
2474 * sem_ch13.adb (Rep_Item_Too_Early): Representation clauses are
2475 not allowed for a derivation of a generic type. Extend the
2476 current test to check that none of the parents is a generic
2479 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
2481 * exp_ch9.adb, exp_util.adb, repinfo.adb, sem_ch12.adb,
2482 sem_prag.adb, sem_res.adb, sem_spark.adb, sem_util.adb: Minor
2485 2019-07-09 Ed Schonberg <schonberg@adacore.com>
2487 * sem_res.adb (Resolve_Equality_Op): If the node was overloaded,
2488 set properly the entity to which the node has been resolved. The
2489 original entity is the first one found during analysis, and is
2490 not necessarily the resolved one.
2491 (Resolve_Op_Not): If the argument of negation is an overloaded
2492 equality operation, call its resolution directly given that the
2493 context type does not participate in overload resolution.
2495 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
2497 * bindo.adb: Remove with and use clauses for Debug. Add with
2498 and use clauses for Opt.
2499 (Find_Elaboration_Order): Enable the v4.0 elaboration order. The
2500 v3.0 mechanism is now available under binder switch -H.
2501 * bindusg.adb (Display): Enable switch -H.
2502 * debug.adb: Free compiler switch -gnatd_G. Free binder switch
2504 * sem_elab.adb: Update the section on switches to remove
2506 (Invocation_Graph_Recording_OK): The invocation graph is now
2507 unconditionally recorded in ALI files.
2508 * switch-b.adb (Scan_Binder_Switches): Scan switch -H.
2509 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
2510 Update the documentation on compiler switches related to
2511 elaboration. Update the documentation on binder switches to
2513 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update
2514 the documentation on elaboration order handling in GNAT.
2515 * gnat_ugn.texi: Regenerate.
2517 2019-07-09 Eric Botcazou <ebotcazou@adacore.com>
2519 * repinfo.adb (List_Entities): Disregard formals altogether.
2520 (List_Name): Properly escape the double quote in the JSON
2523 2019-07-09 Javier Miranda <miranda@adacore.com>
2525 * exp_util.adb (Remove_Side_Effects): Preserve the
2526 Do_Range_Check flag.
2528 2019-07-09 Yannick Moy <moy@adacore.com>
2530 * sinfo.ads: Refine comment for Do_Range_Check.
2532 2019-07-09 Yannick Moy <moy@adacore.com>
2534 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Expand
2535 attribute reference on Enum_Rep.
2537 2019-07-09 Ed Schonberg <schonberg@adacore.com>
2539 * sem_ch12.adb (Instantiate_Formal_Package): Handle properly the
2540 case where the actual for a formal package in an instance is the
2541 current instance of an enclosing generic package.
2542 (Check_Formal_Packages): If the formal package declaration is
2543 box-initialized or lacks associations altogether, no internal
2544 instance was created to verify conformance, and there is no
2545 validating package to remove from tree.
2547 2019-07-09 Yannick Moy <moy@adacore.com>
2549 * freeze.adb (Build_Renamed_Body): Do not set body to inline in
2552 2019-07-09 Yannick Moy <moy@adacore.com>
2554 * exp_util.adb (Expand_Subtype_From_Expr): Still expand the type
2555 of static expressions in GNATprove_Mode.
2556 * sem_ch3.adb (Analyze_Object_Declaration): Remove obsolete
2557 special case for GNATprove_Mode.
2559 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
2561 * doc/gnat_rm/the_gnat_library.rst,
2562 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
2563 erroutc.adb, libgnat/g-comlin.adb, libgnat/g-comlin.ads,
2564 libgnat/g-regexp.ads, libgnat/g-regpat.ads,
2565 libgnat/g-spipat.ads, libgnat/s-os_lib.ads,
2566 libgnat/s-regexp.ads: Reword "wild card" to "wildcard".
2567 * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2569 2019-07-09 Yannick Moy <moy@adacore.com>
2571 * sem_spark.adb (Check_Expression): Handle correctly implicit
2572 assignments as part of allocators and (extension) aggregates.
2573 (Get_Root_Object): Adapt for new path expressions.
2574 (Is_Path_Expression): Return True for (extension) aggregate.
2576 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
2578 * einfo.ads: Fix a typo.
2580 2019-07-09 Ed Schonberg <schonberg@adacore.com>
2582 * sem_util.adb (Scope_Within_Or_Same): Handle properly task
2583 bodies and protected bodies, so that local variables within have
2584 their proper scopes after these constructs have been rewritten
2585 during expansion. This patch resembles but is not identical to
2586 the code in Scope_Within.
2588 2019-07-09 Arnaud Charlet <charlet@adacore.com>
2590 * gnat1drv.adb (Adjust_Global_Switches): Set
2591 Dynamic_Elaboration_Checks to True in CodePeer mode.
2593 2019-07-09 Yannick Moy <moy@adacore.com>
2595 * sem_spark.adb (Get_Perm_Or_Tree): Issue an error when
2596 encountering unknown global variable.
2598 2019-07-09 Yannick Moy <moy@adacore.com>
2600 * sem_spark.adb (Check_Expression): Change signature to take an
2601 Extended_Checking_Mode, for handling read permission checking of
2602 sub-expressions in an assignment.
2603 (Check_Parameter_Or_Global): Adapt to new behavior of
2604 Check_Expression for mode Assign.
2605 (Check_Safe_Pointers): Do not analyze generic bodies.
2606 (Check_Assignment): Separate checking of the target of an
2609 2019-07-09 Eric Botcazou <ebotcazou@adacore.com>
2611 * repinfo.ads (JSON format): Adjust.
2612 * repinfo.adb (Need_Blank_Line): Rename to...
2613 (Need_Separator): ...this.
2614 (Blank_Line): Rename to...
2615 (Write_Separator): ...this and add JSON specific handling.
2616 (List_Array_Info): Adjust to above renaming.
2617 (List_Object_Info): Likewise.
2618 (List_Record_Info): Likewise.
2619 (List_Subprogram_Info): Likewise.
2620 (List_Type_Info): Likewise.
2621 (List_Entities): Do not set Need_Blank_Line.
2622 (List_Rep_Info): Set Need_Separator and add JSON specific
2623 handling. Output a single JSON stream in the normal case.
2625 2019-07-09 Arnaud Charlet <charlet@adacore.com>
2627 * doc/gnat_ugn/the_gnat_compilation_model.rst: Update doc on
2628 -fdump-ada-spec now that we generate Ada 2012.
2629 * gnat_ugn.texi: Regenerate.
2631 2019-07-08 Eric Botcazou <ebotcazou@adacore.com>
2633 * repinfo.adb (List_Common_Type_Info): New procedure extracted
2635 (List_Type_Info): ...here. Call it for the common information,
2636 start with a blank line and output the linker section at the
2638 (List_Mechanisms): Rename to...
2639 (List_Subprogram_Info): ...this.
2640 (List_Array_Info): Call List_Common_Type_Info.
2641 (List_Entities): Adjust to above change and renaming.
2642 (List_Record_Info): Call List_Common_Type_Info.
2644 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
2646 * libgnat/g-sercom.ads
2647 (Serial_Port_Descriptor): New type.
2648 (Serial_Port): Add a comment, make it hold a
2649 Serial_Port_Descriptor.
2650 (To_Ada, To_C): New procedures.
2651 (Port_Data, Port_Data_Access): Remove types.
2652 * libgnat/g-sercom.adb (To_Ada): New stub.
2653 * libgnat/g-sercom__linux.adb, libgnat/g-sercom__mingw.adb:
2654 Update implementations accordingly.
2655 * s-oscons-tmplt.c: Bind Serial_Port_Descriptor to
2656 System.Win32.HANDLE on Windows, and to Interfaces.C.int on
2657 Linux. Add "Interfaces.C." prefix for other basic integer type
2659 * xoscons.adb (Output_Info): Remove the "Interfaces.C." prefix
2660 for subtypes generation.
2662 2019-07-08 Arnaud Charlet <charlet@adacore.com>
2664 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
2665 Update documentation on No_Exceptions restriction.
2666 * gnat_rm.texi: Regenerate.
2668 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
2670 * libgnat/s-os_lib.adb: Do not call __gnat_kill for Invalid_Pid.
2672 2019-07-08 Piotr Trojanek <trojanek@adacore.com>
2674 * sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect
2675 package and subprogram bodies.
2677 2019-07-08 Bob Duff <duff@adacore.com>
2679 * doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation
2680 of ignored GNATpp switch.
2682 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
2684 * doc/gnat_rm/implementation_defined_pragmas.rst:
2685 Update the documentation of pragma Initialize_Scalars.
2686 * gnat_rm.texi: Regenerate.
2688 2019-07-08 Javier Miranda <miranda@adacore.com>
2690 * exp_ch4.adb (Tagged_Membership): Fix regression silently
2691 introduced in r260738 that erroneouslusy causes the evaluation
2692 to True of the membership test when the left operand of the
2693 membership test is a class-wide interface object and the right
2694 operand is a type that implements such interface type.
2696 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
2698 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
2699 register an address clause when its prefix denotes a generic
2702 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
2704 * bindo-diagnostics.adb (Diagnose_Cycle): Capture the presence
2705 of an Elaborate_All edge before iterating over the edges of the
2707 (Output_Elaborate_Body_Transition): Update the parameter profile
2708 and the comment on usage. Add a missing case where the edge is
2709 within the context of an Elaborate_All.
2710 (Output_Transition): Update the call to
2711 Output_Elaborate_Body_Transition.
2712 * bindo-graphs.ads, bindo-graphs.adb
2713 (Contains_Elaborate_All_Edge): New routine.
2715 2019-07-08 Piotr Trojanek <trojanek@adacore.com>
2717 * lib-xref-spark_specific.adb (Create_Heap): Set dummy Etype for
2718 the fake __HEAP entity.
2720 2019-07-08 Daniel Mercier <mercier@adacore.com>
2722 * gnat1drv.adb: Suppress warnings on memory representation in
2723 CodePeer compiler mode.
2725 2019-07-08 Nicolas Roche <roche@adacore.com>
2727 * rtinit.c (__gnat_runtime_initialize): Remove dependency on
2730 2019-07-08 Doug Rupp <rupp@adacore.com>
2732 * Makefile.rtl: Handle vxworks7r2 in x86_64 and x86 vxworks7.
2734 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
2736 * Makefile.rtl: Use g-sercom__linux.adb for all linuxes.
2738 2019-07-08 Yannick Moy <moy@adacore.com>
2740 * expander.adb (Expand): Do not reset Analyzed flag always.
2741 * sem_eval.adb (Fold_Ureal): Mark node as analyzed.
2743 2019-07-08 Ed Schonberg <schonberg@adacore.com>
2745 * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not insert twice
2746 the assignment statement that computes the delay value, to
2747 prevent improper tree sharing when the value is a type
2748 conversion and Float_Overflow checks are enabled.
2750 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
2752 * bindo.adb: Update the section on terminology to include new
2753 concepts. Update the section on switches to include new
2755 * bindo.ads: Add type Precedence_Kind.
2756 * bindo-builders.adb: Add with and use clauses for Debug and
2757 Bindo.Validators. Add use clauses for
2758 Bindo.Validators.Invocation_Graph_Validators and
2759 Bindo.Validators.Library_Graph_Validators.
2760 (Build_Invocation_Graph): Validate the graph immediately after
2762 (Build_Library_Graph): Update the parameter profile. The
2763 creation of the graph is now elaboration model-agnostic.
2764 Validate the graph immediately after it was built.
2765 (Create_With_Edge): Create regular with edges for Elaborate and
2766 Elaborate_All edges when the appropriate debug switches are in
2768 * bindo-builders.ads (Build_Library_Graph): Update the parameter
2770 * bindo-diagnostics.adb (Diagnose_Cycle): Track the presence of
2771 an Elaborate_All edge throughout the inspection of the cycle's
2773 (Output_Dynamic_Model_Suggestions): Output the suggestion only
2774 when the cycle contains at least one weak edge where the
2775 successor was statically elaborated.
2776 (Output_Elaborate_Body_Transition, Output_Forced_Transition,
2777 Output_With_Transition): Update the assertions.
2778 * bindo-elaborators.adb: Remove use clauses for
2779 Bindo.Validators.Invocation_Graph_Validators and
2780 Bindo.Validators.Library_Graph_Validators. Remove strings
2781 Add_To_All_Candidates_Msg and Add_To_Comp_Candidates_Msg.
2782 Remove type String_Ptr.
2783 (Add_Vertex, Add_Vertex_If_Elaborable, Create_All_Candidates_Set
2784 Create_Component_Candidates_Set): Remove.
2785 (Create_Component_Vertex_Sets, Create_Vertex_Sets): New routine.
2786 (Elaborate_Component): Update the parameter profile and the
2787 comment on usage. Reimplement the elaboration of a component.
2788 The algorithm will now attempt to elaborate as many vertices
2789 possible. If this is not possible, and a weakly elaborable
2790 vertex is available use unit was compiled using the dynamic
2791 model, the algorithm will elaborate it.
2792 (Elaborate_Library_Graph): Reimplement the elaboration of the
2793 graph. The algorithm will now attempt to elaborate as many
2794 vertices along with their components as possible. If this is not
2795 possible, and a weakly elaborable vertex is available use unit
2796 was compiled using the dynamic model, the algorithm will
2797 elaborate it along with its component.
2798 (Elaborate_Units): Merge with the functionality of
2799 Elaborate_Units_Common.
2800 (Elaborate_Units_Common, Elaborate_Units_Dynamic,
2801 Elaborate_Units_Static): Remove.
2802 (Elaborate_Vertex): Update the parameter profile and the comment
2803 on usage. Reimplemented.
2804 (Find_Best_Candidate): Remove.
2805 (Find_Best_Elaborable_Vertex, Find_Best_Vertex,
2806 Find_Best_Weakly_Elaborable_Vertex, Has_Elaborable_Body,
2807 Insert_Elaborable_Successor, Insert_Vertex): New routines.
2808 (Is_Better_Candidate): Remove.
2809 (Is_Better_Elaborable_Vertex,
2810 Is_Better_Weakly_Elaborable_Vertex,
2811 Is_Suitable_Elaborable_Vertex,
2812 Is_Suitable_Weakly_Elaborable_Vertex): New routines.
2813 (Trace_Candidate_Vertices): Remove.
2814 (Trace_Component): Output the number of strong and weak
2816 (Trace_Unelaborated_Vertices): Remove.
2817 (Trace_Vertex): Output the number of strong and weak
2819 (Trace_Vertices): New routine.
2820 (Update_Successor, Update_Successors): Update the parameter
2821 profile and the comment on usage.
2822 * bindo-graphs.adb: Remove type Precedence_Kind.
2823 (Add_Edge_With_Return): Update the increment of pending
2825 (Add_Vertex): Provide default values for strong and weak
2827 (Complementary_Vertex): Move the initial declaration to the
2828 spec. Update the parameter profile and the comment on usage.
2829 (Contains_Weak_Static_Successor): New routine.
2830 (Create): Update the parameter profile. The creation of the
2831 graph is now elaboration model-agnostic.
2832 (Decrement_Pending_Predecessors): Update the parameter profile
2833 and the comment on usage. Reimplemented.
2834 (Delete_Edge): Update the decrement of pending predecesors.
2835 (Has_Elaborate_Body): Do not treat a vertex as being subject to
2836 Elaborate_Body when a debug switch is in effect.
2837 (Increment_Pending_Predecessors): Update the parameter profile
2838 and the comment on usage. Reimplemented.
2839 (Is_Elaborable_Component): Reimplemented.
2840 (Is_Elaborable_Vertex): Move the initial declaration to the
2841 spec. Reimplemented.
2842 (Is_Elaborate_Body_Pair): New routine.
2843 (Is_Dynamically_Elaborated): Update the parameter profile.
2845 (Is_Weakly_Elaborable_Vertex): New routine.
2846 (Pending_Predecessors): Removed.
2847 (Pending_Predecessors_For_Elaboration,
2848 Pending_Strong_Predecessors, Pending_Weak_Predecessors,
2849 Update_Pending_Predecessors): New routines.
2850 (Update_Pending_Predecessors_Of_Components): Update the
2851 increment of pending predecessors.
2852 * bindo-graphs.ads: Update the components of type
2853 Component_Attributes. Update the components of type
2854 Library_Graph_Attributes. Update the components of type
2855 Library_Graph_Vertex_Attributes. Update the initialization of
2856 No_Component_Attributes. Update the initialization of
2857 No_Library_Graph_Vertex_Attributes.
2858 (Complementary_Vertex, Contains_Weak_Static_Successor): New
2860 (Create): Update the parameter profile and the comment on usage.
2861 (Decrement_Pending_Predecessors, Is_Dynamically_Elaborated):
2862 Update the parameter profile and the comment on usage.
2863 (Is_Elaborate_Body_Pair, Is_Weakly_Elaborable_Vertex): New
2865 (Pending_Predecessors): Removed.
2866 (Pending_Predecessors_For_Elaboration,
2867 Pending_Strong_Predecessors, Pending_Weak_Predecessors): New
2869 * bindo-writers.adb (Write_Components): Moved from the spec.
2870 (Write_Component): Output the strong and weak predecessors.
2871 (Write_Library_Graph): Output the components as part of the
2873 (Write_Library_Graph_Vertex): Output the strong and weak
2875 * bindo-writers.ads (Write_Components): Moved to the body.
2876 * debug.adb: Add and document new GNATbind switches -d_a, -d_b,
2878 * bindo-validators.adb: Minor reformattings.
2880 2019-07-08 Bob Duff <duff@adacore.com>
2882 * libgnat/g-sercom.ads, libgnat/g-sercom__linux.adb (Data_Rate):
2883 Support additional data rates.
2885 2019-07-08 Olivier Hainque <hainque@adacore.com>
2887 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Don't request
2888 DECL_ARTIFICIAL_P on elab proc declarations.
2890 2019-07-08 Eric Botcazou <ebotcazou@adacore.com>
2892 * repinfo.adb (List_Record_Info): Declare Incomplete_Layout and
2893 Not_In_Extended_Main local exceptions.
2894 (List_Structural_Record_Layout): For an extension, raise the
2895 former if the parent subtype has not been built and the latter
2896 if it is not declared in the main source unit. Fall back to the
2897 flat layout if either exception has been raised.
2899 2019-07-08 Ed Schonberg <schonberg@adacore.com>
2901 * libgnat/a-strfix.adb (Delete): The RM describes the semantics
2902 of Delete as equivalent to that of Replace_String with a null
2903 argument. As a result, deleting a null string that starts past
2904 the end of its argument is a noop and must not raise
2907 2019-07-08 Javier Miranda <miranda@adacore.com>
2909 * exp_disp.adb (Register_Primitive): When registering a
2910 primitive in the secondary dispatch table, handle primitive
2911 inherited through several levels of type derivation (required to
2912 properly handle inherited 'null' primitive).
2914 2019-07-08 Bob Duff <duff@adacore.com>
2916 * doc/gnat_ugn/gnat_utility_programs.rst: Document handling of
2917 preprocessor directives in GNATpp.
2919 2019-07-08 Javier Miranda <miranda@adacore.com>
2921 * gnat1drv.adb (Post_Compilation_Validation_Checks:
2922 Validate_Compile_Time_Warning_Errors is now located in sem_prag
2923 (instead of sem_ch13).
2924 * sem_ch13.ads (Validate_Compile_Time_Warning_Error,
2925 Validate_Compile_Time_Warning_Errors): Move to sem_prag.
2927 (Compile_Time_Warnings_Errors): Move to sem_prag.
2928 (Initialize): Remove initialization of table
2929 Compile_Time_Warning_Errors.
2930 (Validate_Compile_Time_Warning_Error,
2931 Validate_Compile_Time_Warning_Errors): Move to sem_prag.
2932 * sem_prag.ads (Validate_Compile_Time_Warning_Errors): New
2934 * sem_prag.adb (Initialize): Initialize table
2935 Compile_Time_Warning_Errors.
2937 2019-07-08 Ed Schonberg <schonberg@adacore.com>
2939 * sem_ch13.adb (Analyze_Aspect_Specifications): For a
2940 pre/postcondition of a generic subprogram declaration, do not
2941 use Relocate_Node on the aspect expression to construct the
2942 corresponding attribute specification, to prevent tree anomalies
2943 when the expression is a call with named actual parameters.
2945 2019-07-08 Javier Miranda <miranda@adacore.com>
2947 * sem_attr.adb (Analyze_Attribute [Attribute_Size]): For pragmas
2948 used to report user defined compile time warning or errors
2949 handle 'Size for types with known static RM size.
2951 2019-07-08 Justin Squirek <squirek@adacore.com>
2953 * exp_imgv.adb (Build_Enumeration_Image_Tables): Default SSO for
2954 the building of image tables.
2955 (Expand_Image_Attribute): Minor cleanup.
2957 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
2959 * libgnat/g-socket.ads, libgnat/g-socket.adb: Improve
2961 (Get_Socket_Option, Set_Socket_Option): Remove default value for
2964 2019-07-08 Ed Schonberg <schonberg@adacore.com>
2966 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): For an
2967 unanalized aspect in a generic context that has not been
2968 analyzed yet, if the aspect applies to a type, place the type on
2969 the scope stack to make its components visible, before checking
2970 conformance with the version of the expression analyzed at the
2973 2019-07-05 Justin Squirek <squirek@adacore.com>
2975 * checks.adb (Apply_Accessibility_Check): Add logic to fetch the
2976 function result accessibility level if one is required within
2977 the generated check.
2978 * exp_ch6.adb (Needs_Result_Accessibility_Level): Modify
2979 controlling elsif block to handle more cases such as anonymous
2980 access results and disable checking for coextensions.
2982 2019-07-05 Ed Schonberg <schonberg@adacore.com>
2984 * sem_ch9.adb (Analyze_Accept_Statement): If this is an illegal
2985 accept statement for an enclosing entry abandon analysis to
2986 prevent scope mismatches and potential infinite loops in
2989 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
2991 * ali.adb (For_Each_Invocation_Construct,
2992 For_Each_Invocation_Relation): New version.
2993 (Scan_ALI): Initialize field Invocation_Graph_Encoding.
2994 (Set_Invocation_Graph_Encoding): Update the setting of the
2995 invocation graph encoding.
2996 * ali.ads: Move field Invocation_Graph_Encoding from Unit_Record
2997 to ALI_Record because the encoding applies to the whole ALI,
2998 rather than one of the units (spec or body) for which the ALI
3000 (For_Each_Invocation_Construct, For_Each_Invocation_Relation):
3002 * bindo.adb: Update the section on switches. Complete the
3003 section of debugging elaboration order issues.
3004 (Find_Elaboration_Order): Prepare the routine for the switch
3005 from the old to the new elaboration order mechanism.
3006 * bindo-diagnostics.adb (Find_And_Output_Invocation_Paths):
3007 Manage a visited set used by Visit_Vertex.
3008 (Output_All_Cycles_Suggestions,
3009 Output_Dynamic_Model_Suggestions): Clarify the nature of the
3011 (Output_Elaborate_Body_Transition): Update the diagnostic to
3012 emit a better message.
3013 (Output_Forced_Suggestions, Output_Full_Encoding_Suggestions):
3014 Clarify the nature of the suggested switch.
3015 (Visit_Vertex): Update the parameter profile to add a set of
3016 invokers visited during the transition. This set prevents
3017 infinite exploration of the graph in case the invocations are
3019 * bindo-elaborators.adb: Add a use clause for
3020 Bindo.Writers.Dependency_Writers.
3021 (Elaborate_Units_Common): Output the library graph after it has
3022 been augmented with invocation edges. Output just the components
3023 instead of outputting the whole library graph again.
3024 (Elaborate_Units_Dynamic, Elaborate_Units_Static): Output the
3025 dependencies as expressed in the library graph.
3026 * bindo-units.adb (Invocation_Graph_Encoding): Update the
3027 extraction of the invocation graph encoding.
3028 * bindo-writers.adb: Add with and use clauses for Binderr and
3030 (palgc, plgc): New debug routine.
3031 (Write_Components): Moved to the spec. Add a header for the
3033 (Write_Dependencies, Write_Dependencies_Of_Vertex,
3034 Write_Dependency_Edge): New routine.
3035 (Write_Elaboration_Order): Update the logic to follow the format
3036 of Binde's order output.
3037 (Write_Library_Graph): Do not output the components every time
3038 the graph is written.
3039 (Write_Unit): Output the invocation graph encoding of the unit.
3040 Output the invocation constructs and relations for the unit
3042 * bindo-writers.ads (Write_Components): Moved from the body.
3043 (Write_Dependencies): New routine.
3044 * bindusg.adb: Prepare the routine for the switch from the old
3045 to the new elaboration order mechanism.
3046 * debug.adb: Binder switch -d_O is now not associated with any
3048 * einfo.adb (Is_Elaboration_Target): The attribute applies to
3049 packages, as specified by the comment on the attribute usage.
3050 * opt.ads: Add a global flag which controls the choice between
3051 the new and the legacy elaboration order mechanism.
3052 * sem_elab.adb: Add Package_Target to type Target_Kind.
3053 (Build_Elaborate_Body_Procedure, Build_Elaborate_Procedure,
3054 Build_Elaborate_Spec_Procedure, Check_Elaboration_Scenarios,
3055 Check_SPARK_Model_In_Effect): Use Main_Unit_Entity to obtain the
3056 entity of the main unit.
3057 (Create_Package_Rep): New routine.
3058 (Create_Target_Rep): Add processing for packages.
3059 (Declaration_Placement_Of_Node, Has_Prior_Elaboration): Use
3060 Main_Unit_Entity to obtain the entity of the main
3062 (Invocation_Graph_Recording_OK): Prepare the routine for the
3063 switch from the old to the new elaboration order mechanism.
3064 (Main_Unit_Entity): New routine.
3065 (Meet_Elaboration_Requirement,
3066 Process_Conditional_ABE_Variable_Reference): Use
3067 Main_Unit_Entity to obtain the entity of the main unit.
3068 (Process_Invocation_Instantiation): New routine.
3069 (Process_Invocation_Scenario): Add processing for
3071 * switch-b.adb (Scan_Binder_Switches): Prepare the routine for
3072 the switch from the old to the new elaboration order mechanism.
3074 2019-07-05 Joffrey Huguet <huguet@adacore.com>
3076 * libgnat/a-textio.adb: Add abstract state refinment.
3077 * libgnat/a-textio.ads: Add File_System abstract state. Add
3078 global contracts, contract cases, preconditions and
3079 postconditions to procedures and functions.
3080 (Set_Input, Set_Output, Set_Error, Standard_Input,
3081 Standard_Output, Standard_Error, Current_Input, Current_Output,
3082 Current_Error): Turn SPARK_Mode off.
3083 (Get_Line): Turn SPARK_Mode off on Get_Line functions.
3084 * libgnat/a-tideio.ads, libgnat/a-tienio.ads,
3085 libgnat/a-tifiio.ads, libgnat/a-tiflio.ads,
3086 libgnat/a-tiinio.ads, libgnat/a-timoio.ads: Add global
3087 contracts, contract cases, preconditions and postconditions to
3088 procedures and functions.
3090 2019-07-05 Arnaud Charlet <charlet@adacore.com>
3092 * doc/gnat_ugn/platform_specific_information.rst: Refresh doc on
3093 installing from the command line on Windows. Remove obsolete
3095 * gnat_ugn.texi: Regenerate.
3097 2019-07-05 Vasiliy Fofanov <fofanov@adacore.com>
3099 * libgnat/a-wichha.ads (Is_Alphanumeric): Replace comment with
3100 the correct one. Also capitalize references to False
3103 2019-07-05 Eric Botcazou <ebotcazou@adacore.com>
3105 * exp_ch4.adb (Expand_N_Indexed_Component): Do not expand actual
3106 parameters of function calls here either.
3108 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3110 * bindo-units.adb, checks.adb, exp_attr.adb, exp_ch3.adb,
3111 exp_ch4.adb, exp_pakd.adb, lib-writ.adb, libgnat/g-traceb.adb,
3112 libgnat/g-traceb.ads, libgnat/s-stratt.ads, sem_aux.ads,
3113 sem_util.adb: Minor reformatting.
3115 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3117 * sem_ch13.adb (Build_Predicate_Functions): If a subtype that
3118 carries a static predicate aspect is frozen immediately after
3119 its declaration, ensure that the generated function body created
3120 for predicate checking is inserted after the corresponding
3121 subprogram declaration, which is created at the point the
3122 declaration is elaborated.
3124 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3126 * exp_ch7.adb (Cleanup_Record): Use the underlying type when
3127 checking for components with tasks.
3129 2019-07-05 Arnaud Charlet <charlet@adacore.com>
3131 * libgnarl/s-osinte__linux.ads: Link with -lrt before -lpthread.
3133 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3135 * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Add explicit
3136 range checks when the index type of the bit-packed array is an
3137 enumeration type with a non-standard representation,
3139 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3141 * sem_res.adb (Is_Control_Flow_Statement): Delay statements
3142 contain an expression, which in turn may have side effects and
3143 affect the infinite recursion. As a result, delay statements
3144 should not be treated specially.
3146 2019-07-05 Arnaud Charlet <charlet@adacore.com>
3148 * libgnarl/s-linux.ads, libgnarl/s-linux__alpha.ads,
3149 libgnarl/s-linux__android.ads, libgnarl/s-linux__hppa.ads,
3150 libgnarl/s-linux__mips.ads, libgnarl/s-linux__riscv.ads,
3151 libgnarl/s-linux__sparc.ads: Fix typos in comments.
3153 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3155 * sem_res.adb (Check_Infinite_Recursion): Reimplemented.
3156 (Enclosing_Declaration_Or_Statement,
3157 Invoked_With_Different_Arguments, Is_Conditional_Statement,
3158 Is_Control_Flow_Statement, Is_Immediately_Within_Body,
3159 Is_Raise_Idiom, Is_Raise_Statement, Is_Sole_Statement,
3160 Preceded_By_Control_Flow_Statement,
3161 Within_Conditional_Statement): New routines.
3163 2019-07-05 Javier Miranda <miranda@adacore.com>
3165 * exp_ch4.adb (Expand_N_Type_Conversion): Do not apply an
3166 accessibility check when the conversion is an access to
3167 class-wide interface type and it is an actual parameter.
3168 * exp_ch6.adb (Expand_Call_Helper): Add documentation on the
3169 accessibility level of an anonymous allocator defining the value
3170 of an access parameter.
3171 * sem_util.ads, sem_util.adb (Dynamic_Accessibility_Level): Add
3172 support for an anonymous allocator whose type is that of a
3173 stand-alone object of an anonymous access to object type.
3175 2019-07-05 Piotr Trojanek <trojanek@adacore.com>
3177 * einfo.ads, sem_res.adb: Typo fixes in comments.
3179 2019-07-05 Bob Duff <duff@adacore.com>
3181 * exp_ch6.adb (Is_Build_In_Place_Function): Narrow the check for
3182 Has_Foreign_Convention to the imported case only. If a
3183 build-in-place function is exported, and called from Ada code,
3184 build-in-place protocols should be used.
3186 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3188 * sem_util.adb (Encloing_Subprogram): If Enclosing_Dynamic_Scope
3189 is a loop, continue climbing the scope stack to find the
3190 enclosing subprogram.
3191 (Gather_Components): Handle properly a choice in a record
3192 aggregate that is given by a subtype with a static predicate.
3194 2019-07-05 Javier Miranda <miranda@adacore.com>
3196 * debug.adb (-gnatd.K): Leave available this switch.
3197 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
3199 * scil_ll.ads, scil_ll.adb (Contract_Only_Body_Flag,
3200 Contract_Only_Body_Nodes, Get_Contract_Only_Body,
3201 Is_Contract_Only_Body, Set_Contract_Only_Body): Remove.
3203 2019-07-05 Pierre-Marie de Rodat <derodat@adacore.com>
3205 * libgnat/a-strunb.ads: Import documentation from the RM
3207 2019-07-05 Pierre-Marie de Rodat <derodat@adacore.com>
3209 * libgnat/a-strfix.ads: Import documentation from the RM
3211 2019-07-05 Yannick Moy <moy@adacore.com>
3213 * adabkend.adb (Scan_Back_End_Switches): Accept -Og and -Ofast
3216 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3218 * ali.adb: Relocate types Invocation_Construct_Record,
3219 Invocation_Relation_Record, and Invocation_Signature_Record to
3220 the body of ALI. Relocate tables Invocation_Constructs,
3221 Invocation_Relations, and Invocation_Signatures to the body of
3222 ALI. Remove type Body_Placement_Codes. Add new types
3223 Declaration_Placement_Codes, and
3224 Invocation_Graph_Encoding_Codes. Update the literals of type
3225 Invocation_Graph_Line_Codes.
3226 (Add_Invocation_Construct): Update the parameter profile. Add an
3227 invocation construct built from all attributes provided.
3228 (Add_Invocation_Relation): Update the parameter profile. Add an
3229 invocation relation built from all attributes provided.
3230 (Body_Placement): New routine.
3231 (Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind):
3233 (Code_To_Declaration_Placement_Kind,
3234 Code_To_Invocation_Graph_Encoding_Kind, Column,
3235 Declaration_Placement_Kind_To_Code, Extra,
3236 For_Each_Invocation_Construct, For_Each_Invocation_Relation,
3237 Invocation_Graph_Encoding,
3238 Invocation_Graph_Encoding_Kind_To_Code, Invoker, Kind, Line,
3239 Locations, Name): New routine.
3240 (Scan_Invocation_Construct_Line): Reimplement the scanning
3242 (Scan_Invocation_Graph_Attributes_Line): New routine.
3243 (Scan_Invocation_Graph_Line): Use a case statement to dispatch.
3244 (Scan_Invocation_Relation_Line): Reimplement the scanning
3246 (Scope): New routine.
3247 (Set_Invocation_Graph_Encoding, Signature, Spec_Placement,
3248 Target): New routine.
3249 * ali.ads: Add new type Invocation_Graph_Encoding_Kind. Add
3250 component Invocation_Graph_Encoding to type Unit_Record.
3251 Relocate various types and data structures to the body of ALI.
3252 (Add_Invocation_Construct, Add_Invocation_Relation): Update the
3254 (Body_Placement): New routine.
3255 (Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind):
3257 (Code_To_Declaration_Placement_Kind,
3258 Code_To_Invocation_Graph_Encoding_Kind, Column,
3259 Declaration_Placement_Kind_To_Code, Extra,
3260 For_Each_Invocation_Construct, For_Each_Invocation_Relation,
3261 Invocation_Graph_Encoding,
3262 Invocation_Graph_Encoding_Kind_To_Code, Invoker, Kind, Line,
3263 Locations, Name, Scope, Set_Invocation_Graph_Encoding,
3264 Signature, Spec_Placement, Target): New routine.
3265 * bindo.adb: Add with clause for Binde. Add with and use
3266 clauses for Debug. Update the documentation. Add new switches.
3267 (Find_Elaboration_Order): Dispatch to the proper elaboration
3269 * bindo-augmentors.adb:
3270 Remove with and use clauses for GNAT and GNAT.Sets. Remove
3271 membership set VS. Update the parameter profiles of most
3272 routines to use better parameter names. Update the
3273 implementation of most routine to use the new parameter names.
3274 Remove various redundant assertions.
3275 * bindo-builders.adb: Use better names for instantiated data
3276 structures. Update all references to these names. Update the
3277 parameter profiles of most routines to use better parameter
3278 names. Update the implementation of most routine to use the new
3280 (Build_Library_Graph): Update the parameter profile. Update the
3282 (Create_Vertex): Reimplemented.
3283 (Declaration_Placement_Vertex): New routine.
3284 * bindo-builders.ads (Build_Library_Graph): Update the parameter
3285 profile and comment on usage.
3286 * bindo-diagnostics.adb: Almost a new unit.
3287 * bindo-diagnostics.ads: Add a use clause for
3288 Bindo.Graphs.Invocation_Graphs. Remove package
3290 (Diagnose_Circularities): New routine.
3291 * bindo-elaborators.adb: Remove the with and use clauses for
3292 Binderr and GNAT.Sets. Remove the use clause for
3293 Bindo.Diagnostics.Cycle_Diagnostics. Remove membership set VS.
3294 Update the parameter profiles of most routines to use better
3295 parameter names. Update the implementation of most routine to
3296 use the new parameter names. (Elaborate_Units_Common): Update
3297 the parameter profile. Pass an infication to the library graph
3298 builder whether the dynamic model is in effect.
3299 (Elaborate_Units_Dynamic, Elaborate_Units_Static): Use
3300 Diagnose_Circularities to provide diagnostics.
3301 (Update_Successor): Use routine In_Same_Component to determine
3302 whether the predecessor and successor reside in different
3304 * bindo-graphs.adb: Add with and use clauses for Butil, Debug,
3305 Output, and Bindo.Writers. Remove with and use clauses for
3306 GNAT.Lists. Update the parameter profiles of most routines to
3307 use better parameter names. Update the implementation of most
3308 routine to use the new parameter names. Remove various
3309 redundant assertions. Remove doubly linked list EL. Add new
3310 type Precedence_Kind.
3311 (Add_Cycle): New routine.
3312 (Add_Vertex): Update the parameter profile. Update the creation
3313 of vertex attributes.
3314 (Add_Vertex_And_Complement, Body_Vertex, Column,
3315 Complementary_Vertex, Copy_Cycle_Path, Cycle_Kind_Of): New
3317 (Destroy_Invocation_Graph_Edge, Destroy_Library_Graph_Cycle,
3318 Destroy_Library_Graph_Edge, Extra, File_Name,
3319 Find_All_Cycles_Through_Vertex, Find_All_Cycles_With_Edge,
3320 Find_Cycles, Find_First_Lower_Precedence_Cycle,
3321 Get_LGC_Attributes, Has_Next, Hash_Library_Graph_Cycle,
3322 Hash_Library_Graph_Cycle_Attributes, Highest_Precedence_Cycle,
3323 Highest_Precedence_Edge, In_Same_Component, Insert_And_Sort,
3324 Invocation_Edge_Count, Invocation_Graph_Encoding,
3325 Is_Cycle_Initiating_Edge, Is_Cyclic_Edge,
3326 Is_Cyclic_Elaborate_All_Edge, Is_Cyclic_Elaborate_Body_Edge,
3327 Is_Cyclic_Elaborate_Edge, Is_Cyclic_Forced_Edge,
3328 Is_Cyclic_Invocation_Edge, Is_Cyclic_With_Edge,
3329 Is_Dynamically_Elaborated, Is_Elaborate_All_Edge,
3330 Is_Elaborate_Body_Edge, Is_Elaborate_Edge: New routines.
3331 (Is_Existing_Predecessor_Successor_Relation): Removed.
3332 (Is_Forced_Edge, Is_Invocation_Edge, Is_Recorded_Cycle,
3333 Is_Recorded_Edge, Is_With_Edge, Iterate_Edges_Of_Cycle, Kind,
3334 Length): New routine.
3335 (Lib_Vertex): Removed.
3336 (Line, Links_Vertices_In_Same_Component,
3337 Maximum_Invocation_Edge_Count, Next, Normalize_And_Add_Cycle,
3338 Normalize_Cycle_Path, Number_Of_Cycles, Path, Precedence,
3339 Remove_Vertex_And_Complement, Sequence_Next_Cycle): New routines.
3340 (Sequence_Next_IGE_Id): Renamed to Sequence_Next_Edge.
3341 (Sequence_Next_IGV_Id): Renamed to Sequence_Next_Vertex.
3342 (Sequence_Next_LGE_Id): Renamed to Sequence_Next_Edge.
3343 (Sequence_Next_LGV_Id): Renamed to Sequence_Next_Vertex.
3344 (Set_Is_Existing_Predecessor_Successor_Relation): Removed.
3345 (Set_Is_Recorded_Cycle, Set_Is_Recorded_Edge,
3346 Set_LGC_Attributes, Spec_Vertex, Trace_Cycle, Trace_Edge,
3347 Trace_Eol, Trace_Vertex): New routines.
3348 * bindo-graphs.ads: Add with and use clauses for Types and
3349 GNAT.Lists. Update the parameter profiles of most routines to
3350 use better parameter names. Update the implementation of most
3351 routine to use the new parameter names. Add the new
3352 instantiated data structures IGE_Lists, IGV_Sets, LGC_Lists,
3353 LGE_Lists, LGE_Sets, LGV_Sets, and RC_Sets. Add new type
3354 Library_Graph_Cycle_Id along with an empty and initial value.
3355 Remove component Lib_Vertex and add new components Body_Vertex
3356 and Spec_Vertex to type Invocation_Graph_Vertex_Attributes. Add
3357 new type Library_Graph_Cycle_Kind. Add new iterators
3358 All_Cycle_Iterator and Edges_Of_Cycle_Iterator. Add new type
3359 Library_Graph_Cycle_Attributes. Add new components
3360 Cycle_Attributes, Cycles, and Dynamically_Elaborated to type
3361 Library_Graph_Attributes.
3362 (Body_Vertex, Column, Destroy_Invocation_Graph_Edge,
3363 Destroy_Library_Graph_Cycle_Attributes,
3364 Destroy_Library_Graph_Edge, Extra, File_Name, Find_Cycles,
3365 Has_Elaborate_All_Cycle, Has_Next, Hash_Library_Graph_Cycle,
3366 Hash_Library_Graph_Cycle_Attributes, Highest_Precedence_Cycle,
3367 In_Same_Component, Invocation_Edge_Count,
3368 Invocation_Graph_Encoding, Is_Dynamically_Elaborated,
3369 Is_Elaborate_All_Edge, Is_Elaborate_Body_Edge,
3370 Is_Elaborate_Edge, Is_Forced_Edge, Is_Invocation_Edge,
3371 Is_With_Edge, Iterate_All_Cycles, Iterate_Edges_Of_Cycle, Kind):
3373 (Length, Lib_Vertex, (Line, Next, Number_Of_Cycles, Present,
3374 Same_Library_Graph_Cycle_Attributes, Spec_Vertex): New routines.
3375 * bindo-units.adb (File_Name, Invocation_Graph_Encoding): New
3377 * bindo-units.ads: Add new instantiated data structure
3379 (File_Name, Invocation_Graph_Encoding): New routine.
3380 * bindo-validators.adb: Remove with and use clauses for GNAT and
3381 GNAT.Sets. Remove membership set US. Update the parameter
3382 profiles of most routines to use better parameter names. Update
3383 the implementation of most routine to use the new parameter
3385 (Validate_Cycle, Validate_Cycle_Path, Validate_Cycles,
3386 Validate_Invocation_Graph_Vertex): Remove the validation of
3387 component Lib_Vertex. Add the validation of components
3388 Body_Vertex and Spec_Vertex.
3389 (Write_Error): New routine.
3390 * bindo-validators.ads (Validate_Cycles): New routine.
3391 * bindo-writers.adb: Update the parameter profiles of most
3392 routines to use better parameter names. Update the
3393 implementation of most routine to use the new parameter names.
3394 (Write_Cycle, Write_Cyclic_Edge, Write_Cycles): New routines.
3395 (Write_Invocation_Graph_Vertex): Remove the output of component
3396 Lib_Vertex. Add the output of components Body_Vertex and
3398 * bindo-writers.ads (Write_Cycles): New routine.
3399 * debug.adb: Use binder switches -d_C and -d_P, add
3400 documentation on their usage.
3401 * gnatbind.adb: Remove with and use clauses for Binde. Delegate
3402 the choice of elaboration mechanism to Bindo.
3403 * lib-writ.adb (Column, Extra, Invoker, Kind, Line, Locations,
3404 Name, Placement, Scope, Signature, Target): Removed.
3405 (Write_Invocation_Graph): Moved at the top level.
3406 (Write_Invocation_Graph_Attributes): New routine.
3407 (Write_Invocation_Relation, Write_Invocation_Signature): Moved
3409 * lib-writ.ads: Add a documentation section on invocation graph
3411 * sem_elab.adb (Body_Placement_Of): New routine.
3412 (Declare_Invocation_Construct): Update the call to
3413 Add_Invocation_Construct.
3414 (Declaration_Placement_Of_Node): New routine.
3415 (Get_Invocation_Attributes): Correct the retrieval of the
3416 enclosing subprogram where the postcondition procedure lives.
3417 (Placement_Of, Placement_Of_Node): Removed.
3418 (Record_Invocation_Graph): Record the encoding format used.
3419 (Record_Invocation_Graph_Encoding): New routine.
3420 (Record_Invocation_Relation): Update the call to
3421 Add_Invocation_Relation.
3422 (Spec_Placement_Of): Removed.
3423 * libgnat/g-lists.ads, libgnat/g-lists.adb (Equal): New routine.
3425 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3427 * checks.adb (Apply_Predicate_Check): Except within the
3428 subprogram body that defines the formal, do not apply predicate
3429 check on a formal IN parameter: such a check is redundant and
3430 its expansion can lead to out-of-scope references when it is
3431 originates in a function call in a precondition,
3433 2019-07-05 Yannick Moy <moy@adacore.com>
3435 * sem_res.adb (Resolve_Call): Cannot inline in quantified
3437 * sem_util.adb, sem_util.ads (In_Quantified_Expression): New
3440 2019-07-05 Bob Duff <duff@adacore.com>
3442 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
3444 * gnat_rm.texi: Regenerate.
3446 2019-07-05 Bob Duff <duff@adacore.com>
3448 * exp_attr.adb (Input): Take the No_Stream_Optimizations
3449 restriction into account.
3451 2019-07-05 Claire Dross <dross@adacore.com>
3453 * libgnat/a-cofove.ads, libgnat/a-cofove.adb: Definite formal
3454 vectors are now always bounded so that they do not need to be
3457 2019-07-05 Dmitriy Anisimkov <anisimko@adacore.com>
3459 * libgnat/g-traceb.ads, libgnat/g-traceb.adb (Call_Chain): New
3462 2019-07-04 James Clarke <jrtc27@debian.org>
3464 * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
3466 (CLOCK_REALTIME): Make value public.
3468 2019-07-04 Javier Miranda <miranda@adacore.com>
3470 * exp_tss.adb (Init_Proc): Adding missing support for access to
3471 subprograms and access to protected subprograms of non-default
3474 2019-07-04 Eric Botcazou <ebotcazou@adacore.com>
3476 * gnat1drv.adb (Adjust_Global_Switches): Use proper interface to
3477 set the validity settings in CodePeer mode.
3478 * par-load.adb (Load): Remove all code dealing with validity
3480 * validsw.ads (Validity_Check_Copies): Alphabetize.
3481 * validsw.adb (Reset_Validity_Check_Options): Set all options to
3483 (Save_Validity_Check_Options): Save all options.
3485 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
3487 * exp_ch3.adb, exp_ch4.adb, exp_ch4.ads, exp_ch5.adb,
3488 exp_ch7.adb, exp_ch9.adb, exp_ch11.adb, exp_unst.adb,
3489 rtsfind.ads, sem_attr.adb, sem_ch10.adb, sem_ch12.adb,
3490 sem_ch13.adb, sem_dim.adb, sem_disp.adb, xref_lib.adb: Minor
3493 2019-07-04 Joffrey Huguet <huguet@adacore.com>
3495 * libgnarl/a-taside.ads: Add assertion policy to ignore
3497 (Abort_Task, Is_Terminated, Is_Callable): Add preconditions.
3499 2019-07-04 Eric Botcazou <ebotcazou@adacore.com>
3501 * doc/gnat_rm/implementation_defined_pragmas.rst: Fix
3502 capitalization and parenthesis glitches.
3503 * gnat_rm.texi: Regenerate.
3505 2019-07-04 Ed Schonberg <schonberg@adacore.com>
3507 * sem_ch10.adb (Remove_Context_Clauses): Handle properly the
3508 removal of a limited_with_clause which appears in the library
3509 unit oF the main unit, when some other unit in the context has a
3510 regular with_clause on the same unit, to prevent spurious
3511 visibility errors in the subsequent analysis of pending instance
3514 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
3516 * sem_elab.adb: Add new type Elaboration_Phase_Status along with
3517 a global to keep track of the elaboration phase status.
3518 Initialize all internal data structures to Nil for services
3519 Elaborated_Units, Internal_Representation, and Scenario_Storage.
3520 (Build_Call_Marker): Do not create a call marker when the
3521 elaboration phase is not active.
3522 (Build_Variable_Reference_Marker): Do not create a call marker
3523 when the elaboration phase is not active.
3524 (Check_Elaboration_Scenarios): Destroy all internal structures
3525 when the elaboration phase does not have to run. Do not execute
3526 when the elaboration phase is not active.
3527 (Elaboration_Phase_Active): New routine.
3528 (Finalize_All_Data_Structures): New routine.
3529 (Initialize): Initialize all internal data structures and signal
3530 that the elaboration phase has started.
3531 (Initialize_All_Data_Structures): New routine.
3532 (Initialize_Elaborated_Units): Initialize all internal data
3534 (Initialize_Internal_Representation): Initialize all internal
3536 (Initialize_Scenario_Storage): Initialize all internal data
3538 (Kill_Elaboration_Scenario): Do not execute when the elaboration
3539 phase is not active.
3540 (Set_Elaboration_Phase): New routine.
3541 (Update_Elaboration_Scenario): Do not execute when the
3542 elaboration phase is not active.
3544 2019-07-04 Gary Dismukes <dismukes@adacore.com>
3546 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): The special
3547 treatment of calling Mask_Unfrozen_Types must also be done in
3548 the case of an Ignored_Ghost_Entity, because Expander_Active is
3551 2019-07-04 Yannick Moy <moy@adacore.com>
3553 * sem_prag.adb (Check_Library_Level_Entity): Update for new rule
3556 2019-07-04 Justin Squirek <squirek@adacore.com>
3558 * sem_disp.adb (Check_Controlling_Formals): Obtain the full view
3559 before type comparison.
3561 2019-07-04 Ed Schonberg <schonberg@adacore.com>
3563 * exp_ch4.ads, exp_ch4.adb (Build_Eq_Call): New visible
3564 subprogram, extracted from Expand_Composite_Equality, to handle
3565 properly the composition of equality for variant record types.
3566 * exp_ch3.adb (MAke_Eq_If): Use Build_Eq_Call for each
3567 component, to handle properly the case of a component with a
3568 user-defined equality. Revert to predefined equality if the
3569 user-defined operation is abstract, to maintain compatibility
3570 with older versions,
3572 2019-07-04 Justin Squirek <squirek@adacore.com>
3574 * exp_ch3.adb (Build_Initialization_Call): Fixup
3575 *_skip_null_excluding_check argument to handle new default.
3576 (Init_Formals): Make *_skip_null_excluding_check formal default
3578 * exp_ch4.adb (Expand_N_Allocator): Add comment to note heavy
3581 2019-07-04 Bob Duff <duff@adacore.com>
3583 * sem_ch3.adb (Access_Definition): Do not create a master unless
3584 Tasking_Allowed. Otherwise, this fails on restricted runtimes.
3586 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
3588 * sem_util.adb (Propagate_DIC_Attributes): Do not propagate the
3589 Default_Initial_Condition attributes to an incomplete type.
3591 2019-07-04 Ed Schonberg <schonberg@adacore.com>
3593 * sem_attr.adb (Check_Array_Type): An array type attribute such
3594 as 'First can be applied to an unconstrained array tyope when
3595 the attribute reference appears within an aspect specification
3596 and the prefix is a current instance, given that the prefix of
3597 the attribute will become a formal of the subprogram that
3598 implements the aspect (typically a predicate check).
3600 2019-07-04 Piotr Trojanek <trojanek@adacore.com>
3602 * sem_util.adb (Yields_Synchronized_Object): Fix typos in
3605 2019-07-04 Yannick Moy <moy@adacore.com>
3607 * sem_util.adb (Yields_Synchronized_Object): Adapt to new SPARK
3610 2019-07-04 Yannick Moy <moy@adacore.com>
3612 * sem_spark.adb (Check_Statement): Only check permission of
3613 object in extended return when it is of a deep type.
3615 2019-07-04 Justin Squirek <squirek@adacore.com>
3617 * sem_ch12.adb (Perform_Appropriate_Analysis): Added for
3618 selecting which type of analysis based on wheither the
3619 instantiation is a generic at the library-level. In which case
3620 expansion during analysis.
3621 (Preanalyze_Actuals): Modify calls to Analyze to use the new
3624 2019-07-04 Ed Schonberg <schonberg@adacore.com>
3626 * exp_unst.adb: Handle conditional expressions.
3628 2019-07-04 Yannick Moy <moy@adacore.com>
3630 * sem_spark.adb (Check_Package_Spec, Check_Package_Body): Only
3631 analyze parts of the code marked in SPARK.
3633 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
3635 * erroutc.adb, exp_aggr.adb, inline.adb, opt.adb, sem_ch3.adb:
3638 2019-07-04 Yannick Moy <moy@adacore.com>
3640 * sem_spark.adb (Explanation, Get_Expl): New functions to get
3641 the explanation for a permission mismatch.
3642 (Perm_Error, Perm_Mismatch, Perm_Error_Loop_Exit): Take
3643 explanation into account for issuing a more precise error
3645 (Set_Perm_Prefixes, Set_Perm_Extensions,
3646 Set_Perm_Extensions_Move): Pass suitable argument for the
3649 2019-07-04 Arnaud Charlet <charlet@adacore.com>
3651 * exp_aggr.adb (In_Place_Assign_OK): Moved to top level and add
3652 support for record aggregates.
3653 (Component_Check): Use Is_CCG_Supported_Aggregate instead of a
3654 similar local predicate.
3655 (Convert_To_Assignments): Take advantage of In_Place_Assign_OK
3656 predicate when possible.
3657 (Is_CCG_Supported_Aggregate): Return False for records with
3658 representation clauses and fix the logic for dealing with nested
3661 2019-07-04 Piotr Trojanek <trojanek@adacore.com>
3663 * opt.adb (Set_Config_Switches): Keep assertions policy as
3664 enabled when analysing internal units in GNATprove mode.
3666 2019-07-04 Arnaud Charlet <charlet@adacore.com>
3668 * exp_ch4.adb (Expand_Short_Circuit_Operator): Strip
3669 N_Variable_Reference_Marker when checking for the presence of
3672 2019-07-04 Arnaud Charlet <charlet@adacore.com>
3674 * exp_aggr.adb (Check_Component): Take into account type
3677 2019-07-04 Dmitriy Anisimkov <anisimko@adacore.com>
3679 * doc/gnat_ugn/platform_specific_information.rst: Document
3680 Windows socket timeout particularity.
3681 * gnat_ugn.texi: Regenerate.
3682 * gsocket.h: Include versionhelpers.h.
3683 * socket.c (__gnat_minus_500ms): New function.
3684 * libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): New
3686 * libgnat/g-socket.adb (Set_Socket_Option): Refactor to remove
3687 500ms from the requested timeout only on old Windows version.
3689 2019-07-04 Thomas Quinot <quinot@adacore.com>
3691 * get_scos.adb: Remove bogus, dead code.
3693 2019-07-04 Ed Schonberg <schonberg@adacore.com>
3695 * sem_dim.adb (Analyze_Dimension_Array_Aggregate): If the
3696 component is an entity name, its dimensions are those of its
3699 2019-07-03 Bob Duff <duff@adacore.com>
3701 * doc/gnat_ugn/gnat_utility_programs.rst: Document new flags in
3704 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
3706 * binde.adb: Remove with clause for System.OS_Lib.
3707 (Force_Elab_Order): Refactor the majority of the code in Butil.
3708 Use the new forced units iterator to obtain unit names.
3709 * bindo-builders.adb: Add with and use clauses for Binderr,
3710 Butil, Opt, Output, Types, GNAT, and GNAT.Dynamic_HTables. Add
3711 a hash table which maps units to line number in the forced
3712 elaboration order file.
3713 (Add_Unit): New routine.
3714 (Build_Library_Graph): Create forced edges between pairs of
3715 units listed in the forced elaboration order file.
3716 (Create_Forced_Edge, Create_Forced_Edges, Destroy_Line_Number,
3717 Duplicate_Unit_Error, Hash_Unit, Internal_Unit_Info,
3718 Is_Duplicate_Unit, Missing_Unit_Info): New routines.
3719 * bindo-graphs.adb (Is_Internal_Unit, Is_Predefined_Unit):
3720 Refactor some of the behavior to Bindo-Units.
3721 * bindo-graphs.ads: Enable the enumeration literal for forced
3723 * bindo-units.adb, bindo-units.ads (Is_Internal_Unit,
3724 Is_Predefined_Unit): New routines.
3725 * butil.adb: Add with and use clauses for Opt, GNAT, and
3726 System.OS_Lib. Add with clause for Unchecked_Deallocation.
3727 (Has_Next, Iterate_Forced_Units, Next, Parse_Next_Unit_Name,
3728 Read_Forced_Elab_Order_File): New routines.
3729 * butil.ads: Add with and use clauses for Types. Add new
3730 iterator over the units listed in the forced elaboration order
3732 (Has_Next, Iterate_Forced_Units, Next): New routine.
3733 * namet.adb, namet.ads (Present): New routine.
3735 2019-07-03 Bob Duff <duff@adacore.com>
3737 * sem_ch3.adb (Access_Definition): The code was creating a
3738 master in the case where the designated type is a class-wide
3739 interface type. Create a master in the noninterface case as
3740 well. That is, create a master for all limited class-wide types.
3742 2019-07-03 Yannick Moy <moy@adacore.com>
3744 * erroutc.adb (Sloc_In_Range): New function to determine whether
3745 the range of a pragma Warnings covers a location, taking
3746 instantiations into account.
3748 2019-07-03 Johannes Kanig <kanig@adacore.com>
3750 * osint.ads, osint.adb (Get_First_Main_File_Name): New routine
3751 to access the first file provided on the command line.
3753 2019-07-03 Ed Schonberg <schonberg@adacore.com>
3755 * inline.adb (Process_Formals_In_Aspects): New procedure within
3756 Expand_Inlined_Call, to perform a replacement of references to
3757 formals that appear in aspect specifications within the body
3760 2019-07-03 Justin Squirek <squirek@adacore.com>
3762 * sem_ch8.adb (Analyze_Object_Renaming): Add call to search for
3763 the appropriate actual subtype of the object renaming being
3765 (Check_Constrained_Object): Minor cleanup.
3767 2019-07-03 Yannick Moy <moy@adacore.com>
3769 * sem_spark.adb (Get_Observed_Or_Borrowed_Expr): New function to
3770 return go through traversal function call.
3771 (Check_Type): Consistently use underlying type.
3772 (Get_Perm): Adapt for case of elaboration code where variables
3773 are not declared in the environment. Remove incorrect handling
3774 of borrow and observe.
3776 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
3778 * inline.adb (Build_Return_Object_Formal): New routine.
3779 (Can_Split_Unconstrained_Function): Code clean up.
3780 (Copy_Formals,Copy_Return_Object): New routines.
3781 (Split_Unconstrained_Function): Code clean up and refactoring.
3783 2019-07-03 Gary Dismukes <dismukes@adacore.com>
3785 * bindo-augmentors.adb, bindo-augmentors.ads,
3786 bindo-builders.ads, bindo-elaborators.adb, sem_ch12.adb,
3787 sem_ch13.adb, sem_spark.adb, sinfo.ads: Minor editorial
3788 corrections and reformatting.
3790 2019-07-03 Bob Duff <duff@adacore.com>
3792 * sem_warn.adb (Check_Infinite_Loop_Warning): Avoid the warning
3793 if an Iterator_Specification is present.
3795 2019-07-03 Bob Duff <duff@adacore.com>
3797 * doc/gnat_ugn/gnat_utility_programs.rst: Document default
3800 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
3802 * ali.adb: Add with and use clauses for GNAT,
3803 GNAT.Dynamic_HTables, and Snames. Add a map from invocation
3804 signature records to invocation signature ids. Add various
3805 encodings of invocation-related attributes. Sort and update
3806 table Known_ALI_Lines.
3807 (Add_Invocation_Construct, Add_Invocation_Relation,
3808 Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
3809 Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
3810 Code_To_Invocation_Graph_Line_Kind, Destroy, Hash): New
3812 (Initialize_ALI): Sort the initialization sequence. Add
3813 initialization for all invocation-related tables.
3814 (Invocation_Construct_Kind_To_Code,
3815 Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
3816 Invocation_Signature_Of, Present): New routines.
3817 (Scan_ALI): Add the default values for invocation-related ids.
3818 Scan invocation graph lines.
3819 (Scan_Invocation_Graph_Line): New routine.
3820 * ali.ads: Add with clause for GNAT.Dynamic_Tables. Add types
3821 for invocation constructs, relations, and signatures. Add
3822 tables for invocation constructs, relations, and signatures.
3823 Update Unit_Record to capture invocation-related ids. Relocate
3824 table Unit_Id_Tables and subtypes Unit_Id_Table, Unit_Id_Array
3826 (Add_Invocation_Construct, Add_Invocation_Relation,
3827 Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
3828 Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
3829 Code_To_Invocation_Graph_Line_Kind,
3830 Invocation_Construct_Kind_To_Code,
3831 Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
3832 Invocation_Signature_Of, Present): New routines.
3833 * binde.adb: Add with and use clause for Types. Add use clause
3834 for ALI.Unit_Id_Tables;
3835 * binde.ads: Relocate table Unit_Id_Tables and subtypes
3836 Unit_Id_Table, Unit_Id_Array to ALI.
3837 * bindgen.adb: Remove with and use clause for ALI.
3838 * bindgen.ads: Remove with and use clause for Binde. Add with
3839 and use clause for ALI.
3840 * bindo.adb, bindo.ads, bindo-augmentors.adb,
3841 bindo-augmentors.ads, bindo-builders.adb, bindo-builders.ads,
3842 bindo-diagnostics.adb, bindo-diagnostics.ads,
3843 bindo-elaborators.adb, bindo-elaborators.ads, bindo-graphs.adb,
3844 bindo-graphs.ads, bindo-units.adb, bindo-units.ads,
3845 bindo-validators.adb, bindo-validators.ads, bindo-writers.adb,
3846 bindo-writers.ads: New units.
3847 * debug.adb: Use and describe GNAT debug switches -gnatd_F and
3848 -gnatd_G. Add GNATbind debug switches in the ranges dA .. dZ,
3849 d.a .. d.z, d.A .. d.Z, d.1 .. d.9, d_a .. d_z, d_A .. d_Z, and
3850 d_1 .. d_9. Use and describe GNATbind debug switches -d_A,
3851 -d_I, -d_L, -d_N, -d_O, -d_T, and -d_V.
3852 * exp_util.adb, exp_util.ads (Exceptions_OK): Relocate to
3854 * gnatbind.adb: Add with and use clause for Bindo. Use the new
3855 Bindo elaboration order only when -d_N is in effect.
3857 (Column, Extra, Invoker, Kind, Line, Locations, Name, Placement,
3858 Scope, Signature, Target): New routines.
3859 (Write_ALI): Output all invocation-related data.
3860 (Write_Invocation_Graph): New routine.
3861 * lib-writ.ads: Document the invocation graph ALI line.
3862 * namet.adb, namet.ads (Present): New routines.
3863 * sem_ch8.adb (Find_Direct_Name): Capture the status of
3864 elaboration checks and warnings of an identifier.
3865 (Find_Expanded_Name): Capture the status of elaboration checks
3866 and warnings of an expanded name.
3867 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Ensure
3868 that invocation graph-related data within the body of the main
3869 unit is encoded in the ALI file.
3870 (Analyze_Generic_Subprogram_Declaration): Ensure that invocation
3871 graph-related data within the body of the main unit is encoded
3873 (Analyze_Package_Instantiation): Perform minimal decoration of
3874 the instance entity.
3875 (Analyze_Subprogram_Instantiation): Perform minimal decoration
3876 of the instance entity.
3877 * sem_elab.adb: Perform heavy refactoring of all code. The unit
3878 is now split into "services" which specialize in one area of ABE
3879 checks. Add processing in order to capture invocation-graph
3880 related attributes of the main unit, and encode them in the ALI
3881 file. The Processing phase can now operate in multiple modes,
3882 all described by type Processing_Kind. Scenarios and targets
3883 are now distinct at the higher level, and carry their own
3884 representations. This eliminates the need to constantly
3885 recompute their attributes, and offers the various processors a
3886 uniform interface. The various initial states of the Processing
3887 phase are now encoded using type Processing_In_State, and
3888 xxx_State constants.
3889 * sem_elab.ads: Update the literals of type
3890 Enclosing_Level_Kind. Add Inline pragmas on several routines.
3891 * sem_prag.adb (Process_Inline): Ensure that invocation
3892 graph-related data within the body of the main unit is encoded
3894 * sem_util.adb (Enclosing_Generic_Body, Enclosing_Generic_Unit):
3896 (Exceptions_OK): Relocated from Sem_Util.
3897 (Mark_Save_Invocation_Graph_Of_Body): New routine.
3898 * sem_util.ads (Exceptions_OK): Relocated from Sem_Util.
3899 (Mark_Save_Invocation_Graph_Of_Body): New routine.
3900 * sinfo.adb (Is_Elaboration_Checks_OK_Node): Now applicable to
3901 N_Variable_Reference_Marker.
3902 (Is_Elaboration_Warnings_OK_Node): Now applicable to
3903 N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
3904 (Is_Read): Use Flag4.
3905 (Is_SPARK_Mode_On_Node): New applicable to
3906 N_Variable_Reference_Marker.
3907 (Is_Write): Use Flag5.
3908 (Save_Invocation_Graph_Of_Body): New routine.
3909 (Set_Is_Elaboration_Checks_OK_Node): Now applicable to
3910 N_Variable_Reference_Marker.
3911 (Set_Is_Elaboration_Warnings_OK_Node): Now applicable to
3912 N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
3913 (Set_Is_SPARK_Mode_On_Node): New applicable to
3914 N_Variable_Reference_Marker.
3915 (Set_Save_Invocation_Graph_Of_Body): New routine.
3916 * sinfo.ads: Update the documentation of attributes
3917 Is_Elaboration_Checks_OK_Node, Is_Elaboration_Warnings_OK_Node,
3918 Is_SPARK_Mode_On_Node. Update the flag usage of attributes
3919 Is_Read, Is_Write. Add attribute Save_Invocation_Graph_Of_Body
3920 and update its occurrence in nodes.
3921 (Save_Invocation_Graph_Of_Body): New routine along with pragma
3923 (Set_Save_Invocation_Graph_Of_Body): New routine along with
3925 * switch-b.adb (Scan_Binder_Switches): Refactor the scanning of
3927 (Scan_Debug_Switches): New routine.
3928 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads (Contains): New routine.
3929 * libgnat/g-graphs.adb (Associate_Vertices): Update the use of
3930 Component_Vertex_Iterator.
3931 (Contains_Component, Contains_Edge, Contains_Vertex, Has_Next):
3933 (Iterate_Component_Vertices): New routine.
3934 (Iterate_Vertices): Removed.
3935 (Next): Update the parameter profile.
3936 (Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
3938 * libgnat/g-graphs.ads: Update the initialization of
3939 No_Component. Add type Component_Vertex_Iterator. Remove type
3941 (Has_Next): Add new versions and remove old ones.
3942 (Iterate_Component_Vertices): New routine.
3943 (Iterate_Vertices): Removed.
3944 (Next): Add new versions and remove old ones.
3945 (Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
3947 * libgnat/g-sets.adb (Contains): Reimplemented.
3948 * gcc-interface/Make-lang.in (GNATBIND_OBJS): Add
3949 GNAT.Dynamic_HTables, GNAT.Graphs and Bindo units.
3950 * rtsfind.ads: Remove extra space.
3952 2019-07-03 Yannick Moy <moy@adacore.com>
3954 * sem_spark.adb: Add support for locally borrowing and observing
3956 (Get_Root_Object): Add parameter Through_Traversal to denote
3957 when we are interesting in getting to the traversed parameter.
3958 (Is_Prefix_Or_Almost): New function to support detection of
3959 illegal access to borrowed or observed paths.
3960 (Check_Pragma): Add analysis of assertion pragmas.
3962 2019-07-03 Ed Schonberg <schonberg@adacore.com>
3964 * sem_ch13.adb (Build_Predicate_Functions): In a generic context
3965 we do not build the bodies of predicate fuctions, but the
3966 expression in a static predicate must be elaborated to allow
3967 case coverage checking within the generic unit.
3968 (Build_Discrete_Static_Predicate): In a generic context, return
3969 without building function body once the
3970 Static_Discrete_Predicate expression for the type has been
3973 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
3975 * bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
3976 sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
3978 2019-07-03 Bob Duff <duff@adacore.com>
3980 * par-ch3.adb (P_Defining_Identifier): Call
3981 Check_Defining_Identifier_Casing.
3982 * style.ads, styleg.ads, styleg.adb
3983 (Check_Defining_Identifier_Casing): New procedure to check for
3984 mixed-case defining identifiers.
3985 * stylesw.ads, stylesw.adb (Style_Check_Mixed_Case_Decls): New
3986 flag for checking for mixed-case defining identifiers.
3987 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
3988 Document new feature.
3989 * gnat_ugn.texi: Regenerate.
3991 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
3993 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
3994 (Warning message control): Document that -gnatw.z/Z apply to
3996 * freeze.adb (Freeze_Entity): Give -gnatw.z warning for array
3997 types as well, but not if the specified alignment is the minimum
3999 * gnat_ugn.texi: Regenerate.
4001 2019-07-03 Bob Duff <duff@adacore.com>
4003 * einfo.ads, exp_util.adb, layout.ads, sinfo.ads: Spell "laid"
4006 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4008 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): No error
4009 message on attribute applied to a renaming when the renamed
4010 object is an aggregate (from code reading).
4011 (Check_Aspect_At_End_Of_Declarations): In a generic context
4012 where freeze nodes are not generated, the original expression
4013 for an aspect may need to be analyzed to precent spurious
4014 conformance errors when compared with the expression that is
4015 anakyzed at the end of the current declarative list.
4017 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
4019 * layout.adb (Layout_Type): Do not set the component size of an
4020 array with a scalar component if the component type is
4023 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4025 * inline.adb (Make_Loop_Labels_Unique): New procedure to modify
4026 the source code of subprograms that are inlined by the
4027 front-end, to prevent accidental duplication between loop labels
4028 in the inlined code and the code surrounding the inlined call.
4030 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
4032 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update
4033 the section on resolving elaboration circularities to eliminate
4034 certain combinations of switches which together do not produce
4035 the desired effect and confuse users.
4036 * gnat_ugn.texi: Regenerate.
4038 2019-07-03 Arnaud Charlet <charlet@adacore.com>
4040 * bindgen.adb (Gen_Main): Disable generation of reference to
4041 Ada_Main_Program_Name for CCG.
4042 * bindusg.adb (Display): Add -G to the command-line usage for
4044 * opt.ads (Generate_C_Code): Update comment.
4045 * switch-b.adb (Scan_Binder_Switches): Add handling for -G.
4047 2019-07-03 Arnaud Charlet <charlet@adacore.com>
4049 * sem_ch7.adb (Has_Referencer): Do not consider inlined
4050 subprograms when generating C code, which allows us to generate
4051 static inline subprograms.
4053 2019-07-03 Justin Squirek <squirek@adacore.com>
4055 * sem_ch6.adb (Check_Conformance): Add expression checking for
4056 constant modifiers in anonymous access types (in addition to
4057 "non-null" types) so that they are considered "matching" for
4058 subsequent conformance tests.
4060 2019-07-03 Arnaud Charlet <charlet@adacore.com>
4062 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
4063 Clarify wording on No_Multiple_Elaboration.
4064 * gnat_rm.texi: Regenerate.
4066 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4068 * sem_ch8.adb (Find_Selected_Component): If the prefix is the
4069 current instance of a type or subtype, complete the resolution
4070 of the name by finding the component of the type denoted by the
4073 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
4075 * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C):
4076 Document that boolean types with convention C now map to C99 bool.
4077 * gnat_rm.texi: Regenerate.
4079 2019-07-03 Javier Miranda <miranda@adacore.com>
4081 * exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup:
4082 removing code that it is now never executed in the CCG compiler
4085 2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
4087 * libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
4090 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4092 * sem_ch12.adb (Is_Defaulted): New predicate in
4093 Check_Formal_Package_Intance, to skip the conformance of checks
4094 on parameters of a formal package that are defaulted,
4096 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4098 * checks.adb, exp_ch9.adb, exp_unst.adb, sem_ch4.adb,
4099 sem_prag.adb, sem_spark.adb: Minor reformatting.
4101 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4103 * sem_attr.adb (Analyze_Attribute, case Enum_Rep): Allow prefix
4104 of attribute to be an attribute reference of a discrete type.
4106 2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
4108 * sem_ch12.adb (Analyze_Subprogram_Instantiation): Move up
4109 handling of Has_Pragma_Inline_Always and deal with
4110 Has_Pragma_No_Inline.
4112 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4114 * sem_ch3.adb (Build_Derived_Record_Type): If the parent type is
4115 declared as a subtype of a private type with an inherited
4116 discriminant constraint, its generated full base appears as a
4117 record subtype, so we need to retrieve its oen base type so that
4118 the inherited constraint can be applied to it.
4120 2019-07-01 Yannick Moy <moy@adacore.com>
4122 * sem_spark.adb: Completely rework the algorithm for ownership
4123 checking, as the rules in SPARK RM have changed a lot.
4124 * sem_spark.ads: Update comments.
4126 2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
4128 * gsocket.h (Has_Sockaddr_Len): Use the offset of sin_family offset in
4129 the sockaddr_in structure to determine the existence of length field
4130 before the sin_family.
4132 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4134 * sem_prag.adb (Analyze_Pragma, case Weak_External): Pragma only
4135 applies to entities with run-time addresses, not to types.
4137 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4139 * einfo.adb, sem_ch7.adb, sem_prag.adb, sem_util.adb: Update
4140 references to the SPARK RM after the removal of Rule 7.1.4(5).
4142 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4144 * sysdep.c: Cleanup references to LynuxWorks in docs and
4147 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4149 * checks.adb (Insert_Valid_Check): Do not apply validity check
4150 to variable declared within a protected object that uses the
4151 Lock_Free implementation, to prevent unwarranted constant
4152 folding, because entities within such an object msut be treated
4155 2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
4157 * exp_ch9.adb (Check_Inlining): Deal with Has_Pragma_No_Inline.
4159 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4161 * exp_unst.adb (Visit_Node, Check_Static_Type): Improve the
4162 handling of private and incomplete types whose full view is an
4163 access type, to detect additional uplevel references in dynamic
4164 bounds. This is relevant to N_Free_Statement among others that
4165 manipulate types whose full viww may be an access type.
4167 2019-07-01 Pat Rogers <rogers@adacore.com>
4169 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Correct
4170 size indicated for R as a component of an array.
4171 * gnat_rm.texi: Regenerate.
4173 2019-07-01 Justin Squirek <squirek@adacore.com>
4175 * libgnat/s-win32.ads: Add definition for ULONG, modify
4176 OVERLAPPED type, and add appropriate pragmas.
4178 2019-07-01 Bob Duff <duff@adacore.com>
4180 * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is
4183 2019-07-01 Yannick Moy <moy@adacore.com>
4185 * sem_ch4.adb (Operator_Check): Refine error message.
4187 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4189 * libgnat/a-calend.ads: Revert "Global => null" contracts on
4192 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4194 * exp_attr.adb, libgnat/g-graphs.ads: Fix typos in comments:
4195 componant -> component.
4197 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4199 * libgnat/g-graphs.adb: Use type Directed_Graph rather than
4200 Instance in various routines.
4201 * libgnat/g-graphs.ads: Change type Instance to Directed_Graph.
4202 Update various routines that mention the type.
4204 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4206 * libgnat/g-sets.adb: Use type Membership_Set rathern than
4207 Instance in various routines.
4208 * libgnat/g-sets.ads: Change type Instance to Membership_Set.
4209 Update various routines that mention the type.
4211 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4213 * libgnat/g-lists.adb: Use type Doubly_Linked_List rather than
4214 Instance in various routines.
4215 * libgnat/g-lists.ads: Change type Instance to
4216 Doubly_Linked_List. Update various routines that mention the
4219 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4221 * libgnat/g-dynhta.adb: Use type Dynamic_Hash_Table rather than
4222 Instance in various routines.
4223 * libgnat/g-dynhta.ads: Change type Instance to
4224 Dynamic_Hash_Table. Update various routines that mention the
4227 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4229 * exp_attr.adb, exp_ch7.adb, exp_unst.adb, sem_ch3.adb,
4230 sem_util.adb, uintp.adb, uintp.ads: Minor reformatting.
4232 2019-07-01 Javier Miranda <miranda@adacore.com>
4234 * exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of
4235 'Min/'Max on integer, enumeration, fixed point and floating
4236 point types since the CCG backend now provides in file
4237 standard.h routines to support it.
4239 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4241 * impunit.adb: Add GNAT.Graphs to list Non_Imp_File_Names_95.
4242 * Makefile.rtl, gcc-interface/Make-lang.in: Register unit
4244 * libgnat/g-dynhta.adb: Various minor cleanups (use Present
4245 rather than direct comparisons).
4246 (Delete): Reimplement to use Delete_Node.
4247 (Delete_Node): New routine.
4248 (Destroy_Bucket): Invoke the provided destructor.
4249 (Present): New routines.
4250 * libgnat/g-dynhta.ads: Add new generic formal Destroy_Value.
4251 Use better names for the components of iterators.
4252 * libgnat/g-graphs.adb, libgnat/g-graphs.ads: New unit.
4253 * libgnat/g-lists.adb: Various minor cleanups (use Present
4254 rather than direct comparisons).
4255 (Delete_Node): Invoke the provided destructor.
4256 (Present): New routine.
4257 * libgnat/g-lists.ads: Add new generic formal Destroy_Element.
4258 Use better names for the components of iterators.
4259 (Present): New routine.
4260 * libgnat/g-sets.adb, libgnat/g-sets.ads (Destroy, Preset,
4261 Reset): New routines.
4263 2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
4265 * libgnat/g-sothco.adb (Get_Address): Fix the case when AF_INET6
4268 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4270 * exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value):
4271 Resolve result of call to Get_Simple_Init_Val, which may be a
4272 conversion of a literal.
4274 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4276 * freeze.adb (Freeze_Expression): Remove the horrible useless
4277 name hiding of N. Insert the freeze nodes generated by the
4278 expression prior to the expression when the nearest enclosing
4281 2019-07-01 Pierre-Marie de Rodat <derodat@adacore.com>
4283 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix
4284 formatting issues in the -gnatR section.
4285 * gnat_ugn.texi: Regenerate.
4287 2019-06-30 Iain Sandoe <iain@sandoe.co.uk>
4289 * gnatlink.adb (Link_Step): Remove duplicate -static-libgcc switches.
4290 Push -shared-libgcc explicitly, when it is the target default (unless
4291 overidden by the static flag).
4292 When the user has put an instance of shared/static-libgcc do not push
4293 a duplicate of this.
4295 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4297 * gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED,
4298 and tweak comment on the assertion about the scopes of Itypes. Do not
4299 skip the regular processing for Itypes that are E_Record_Subtype with
4300 a Cloned_Subtype. Get the Cloned_Subtype for every E_Record_Subtype
4301 if the type is dummy and hasn't got its own freeze node.
4302 <E_Record_Subtype>: Save again the DECL of the Cloned_Subtype, if any.
4303 <E_Access_Subtype>: Save again the DECL of the equivalent type.
4304 (Gigi_Equivalent_Type) <E_Access_Subtype>: New case.
4306 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4308 * gcc-interface/utils.c (unchecked_convert): Tweak comment. Only skip
4309 dereferences when padding to have the same size on both sides. Do it
4310 for destination types with self-referential size too.
4312 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4314 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: If the
4315 type requires strict alignment, then set the RM size to the type size.
4316 Rework handling of alignment and sizes of tagged types in ASIS mode.
4317 (validate_size): Rename local variable and remove special handling for
4318 strict-alignment types.
4319 * gcc-interface/utils.c (finish_record_type): Constify local variables
4320 and use properly typed constants.
4322 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4324 * gcc-interface/decl.c (gnat_to_gnu_field): Rework error messages for
4325 fields requiring strict alignment, add explicit test on Storage_Unit
4326 for position and size, and mention type alignment for position.
4328 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4330 * gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
4331 the main variant of a type, if any.
4333 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4335 * gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
4336 missing guard for the presence of TYPE_CANONICAL.
4337 (set_reverse_storage_order_on_array_type): Likewise.
4339 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
4341 * gcc-interface/gigi.h (make_packable_type): Remove default value.
4342 (value_factor_p): Tweak prototype.
4343 * gcc-interface/decl.c (gnat_to_gnu_entity): Add comment.
4344 (gnat_to_gnu_component_type): Likewise.
4345 (gnat_to_gnu_field): Likewise. Fetch the position of the field earlier
4346 and simplify the condition under which the type is packed. Declare
4347 local variable is_bitfield. Pass 1 as max_align to make_packable_type
4348 if it is set to true.
4349 (copy_and_substitute_in_layout): Pass 0 to make_packable_type.
4350 * gcc-interface/utils.c (make_packable_array_type): New function.
4351 (make_packable_type): Use it to rewrite the type of array field.
4352 (maybe_pad_type): Pass align parameter to make_packable_type.
4353 (create_field_decl): Minor tweaks.
4354 (value_factor_p): Assert that FACTOR is a power of 2 and replace the
4355 modulo computation by a masking operation.
4357 2019-06-25 Eric Botcazou <ebotcazou@adacore.com>
4359 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove superfluous test
4361 * gcc-interface/gigi.h (maybe_character_type): Fix formatting.
4362 (maybe_character_value): Likewise.
4364 2019-06-24 Jan Hubicka <jh@suse.cz>
4366 * gcc-interface/decl.c (gnat_to_gnu_entity): Check that
4367 type is array or integer prior checking string flag.
4368 * gcc-interface/gigi.h (maybe_character_type): Likewise.
4369 (maybe_character_value): Likewise.
4371 2019-06-24 Martin Sebor <msebor@redhat.com>
4373 * gcc-interface/utils.c (handle_nonnull_attribute): Quote attribute
4376 2019-06-18 Arnaud Charlet <charlet@adacore.com>
4379 * sem_ch5.adb (Analyze_Loop_Statement): Avoid exception propagation
4380 during normal processing.
4382 2019-06-17 Arnaud Charlet <charlet@adacore.com>
4385 * exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two
4386 conditions to avoid a unnecessary exception propagation in the default
4389 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4391 * gcc-interface/utils.c (handle_stack_protect_attribute): Move around.
4393 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4395 * doc/gnat_rm/implementation_defined_pragmas.rst (Machine_Attribute):
4396 Document additional optional parameters.
4397 * sem_prag.adb (Analyze_Pragma) <Pragma_Machine_Attribute>: Accept
4398 more than one optional parameter.
4399 * gcc-interface/decl.c (prepend_one_attribute_pragma): Alphabetize
4400 the list of supported pragmas. Simplify the handling of parameters
4401 and add support for more than one optional parameter.
4402 * gcc-interface/utils.c (attr_cold_hot_exclusions): New constant.
4403 (gnat_internal_attribute_table): Add entry for no_icf, noipa, flatten,
4404 used, cold, hot, target and target_clones.
4405 (begin_subprog_body): Do not create the RTL for the subprogram here.
4406 (handle_noicf_attribute): New static function.
4407 (handle_noipa_attribute): Likewise.
4408 (handle_flatten_attribute): Likewise.
4409 (handle_used_attribute): Likewise.
4410 (handle_cold_attribute): Likewise.
4411 (handle_hot_attribute): Likewise.
4412 (handle_target_attribute): Likewise.
4413 (handle_target_clones_attribute): Likewise.
4415 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4417 * gcc-interface/trans.c (lvalue_required_for_attribute_p): Return 0
4419 (Identifier_to_gnu): Use the actual subtype for a reference to a
4420 packed array in a return statement.
4421 (Attribute_to_gnu) <Attr_Size>: Do not strip VIEW_CONVERT_EXPRs from
4422 the prefix in every case.
4424 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4426 * gcc-interface/trans.c (gnat_to_gnu): Remove superfluous tests on
4427 Backend_Overflow_Checks_On_Target and rework comments.
4429 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4431 * gcc-interface/trans.c (walk_nesting_tree): New static function.
4432 (finalize_nrv): Use it to walk the entire nesting tree.
4434 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4436 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Remove
4437 obsolete test on Is_For_Access_Subtype.
4439 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4441 * gcc-interface/decl.c (components_to_record): Set a name on the type
4442 created for the REP part, if any.
4443 * gcc-interface/utils.c (finish_record_type): Only take the maximum
4444 when merging sizes for a variant part at offset 0.
4445 (merge_sizes): Rename has_rep parameter into max.
4447 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4449 * gcc-interface/utils.c (gnat_internal_attribute_table): Add support
4450 for stack_protect attribute.
4451 (handle_stack_protect_attribute): New static function.
4453 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
4455 * gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return
4456 false if the internal builtin uses a variable list.
4458 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4460 * gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary
4461 created out of addressability concerns if it's for the _Init parameter
4462 of an initialization procedure.
4464 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4466 * gcc-interface/ada-builtin-types.def: New file.
4467 * gcc-interface/ada-builtins.def: Likewise.
4468 * gcc-interface/ada-tree.h (BUILT_IN_LIKELY): New macro.
4469 (BUILT_IN_UNLIKELY): Likewise.
4470 * gcc-interface/trans.c (independent_iterations_p): Initialize the
4471 auto-vector to 16 elements.
4472 (Call_to_gnu): Remove local variable and change the vector of actual
4473 parameters to an auto-vector. Do not convert actual parameters to
4474 the argument type for front-end built-in functions. Add support for
4475 front-end built-in functions.
4476 (build_noreturn_cond): Use internal instead of built-in function.
4477 * gcc-interface/utils.c (c_builtin_type): Include ada-builtin-types.def
4478 (install_builtin_function_types): Likewise.
4479 (install_builtin_functions): Include ada-builtins.def first.
4481 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4483 * gcc-interface/utils.c (maybe_pad_type): Issue the warning for the
4484 specific case of component types preferably.
4486 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4488 * gcc-interface/trans.c (Identifier_to_gnu): Minor tweaks.
4489 (gnat_to_gnu): Do not convert the result if it is a reference to an
4490 unconstrained array used as the prefix of an attribute reference that
4493 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4495 * gcc-interface/trans.c (Gigi_Types_Compatible): New predicate.
4496 (Identifier_to_gnu): Use it to assert that the type of the identifier
4497 and that of its entity are compatible for gigi. Rename a couple of
4498 local variables and separate the processing of the result type.
4500 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4502 * gcc-interface/trans.c (Call_to_gnu): Use the unpadded type when
4503 putting back an intermediate conversion the type of the actuals.
4505 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
4507 * gcc-interface/trans.c (gnat_to_gnu) <Shift operations>: Convert the
4508 count to the unsigned version of its base type before proceeding.
4510 2019-05-16 Martin Sebor <msebor@redhat.com>
4512 * gcc-interface/trans.c (check_inlining_for_nested_subprog): Quote
4515 2019-05-08 Arnaud Charlet <charlet@adacore.com>
4517 * standard.ads.h: New file.
4519 2019-05-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4521 * gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
4524 2019-04-29 Michael K. Darling <darlingm@gmail.com>
4526 * gnatvsn.ads: Bump Library_Version to 10.
4528 2019-04-24 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
4529 Bernd Edlinger <bernd.edlinger@hotmail.de>
4530 Jakub Jelinek <jakub@redhat.com>
4533 * raise-gcc.c (TARGET_ATTRIBUTE): Define.
4534 (continue_unwind, personality_body, PERSONALITY_FUNCTION): Add
4537 2019-04-07 Eric Botcazou <ebotcazou@adacore.com>
4539 * libgnat/i-cexten.ads (CFloat_128): New type.
4541 2019-03-22 Dmitriy Anisimkov <anisimko@adacore.com>
4544 * libgnat/g-socket.adb (Bind_Socket, Connect_Socket,
4545 Send_Socket): Fix the computation of structure lengths passed to
4547 (Is_IPv6_Address): Fix the number of expected colons.
4549 2019-03-11 Martin Liska <mliska@suse.cz>
4551 * gcc-interface/misc.c (gnat_post_options): Wrap option name in string
4552 format message and fix GNU coding style.
4554 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
4556 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Minor tweak.
4557 * gcc-interface/utils.c (convert): Do not pad when doing an unchecked
4558 conversion here. Use TREE_CONSTANT throughout the function.
4559 (unchecked_convert): Also pad if the source is a CONSTRUCTOR and the
4560 destination is a more aligned array type or a larger aggregate type,
4561 but not between original and packable versions of a type.
4563 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
4565 * gcc-interface/utils.c (max_size) <tcc_unary>: Be prepared for an
4566 operand with VOID_TYPE.
4568 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
4570 * gcc-interface/trans.c (elaborate_all_entities): Do not elaborate the
4571 entities of a package renaming another one.
4573 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
4575 * gcc-interface/trans.c (Regular_Loop_to_gnu): Replace tests on
4576 individual flag_unswitch_loops and flag_tree_loop_vectorize switches
4577 with test on global optimize switch.
4578 (Raise_Error_to_gnu): Likewise.
4580 2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
4582 * libgnarl/s-linux__sparc.ads (ETIMEDOUT): Set to correct value.
4584 2019-02-06 Arnaud Charlet <charlet@adacore.com>
4586 * libgnarl/s-linux__x32.ads: Resync list of signals with s-linux.ads
4588 2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
4590 * repinfo.adb (List_Component_Layout): Remove superfluous space for
4592 * gcc-interface/ada-tree.h (TYPE_IS_EXTRA_SUBTYPE_P): New macro.
4593 * gcc-interface/gigi.h (create_extra_subtype): Declare.
4594 * gcc-interface/decl.c (TYPE_ARRAY_SIZE_LIMIT): Likewise.
4595 (update_n_elem): New function.
4596 (gnat_to_gnu_entity): Use create_extra_subtype to create extra subtypes
4597 instead of doing it manually.
4598 <E_Array_Type>: Use update_n_elem to compute the maximum size. Use the
4599 index type instead of base type for the bounds. Set TYPE_ARRAY_MAX_SIZE
4600 of the array to the maximum size.
4601 <E_Array_Subtype>: Create an extra subtype using the index type of the
4602 base array type for self-referential bounds. Use update_n_elem to
4603 compute the maximum size. Set TYPE_ARRAY_MAX_SIZE of the array to the
4605 (gnat_to_gnu_field): Clear DECL_NONADDRESSABLE_P on discriminants.
4606 * gcc-interface/misc.c (gnat_get_alias_set): Return the alias set of
4607 the base type for an extra subtype.
4608 (gnat_type_max_size): Remove obsolete code.
4609 * gcc-interface/trans.c (Attribute_to_gnu): Minor tweak.
4610 (can_be_lower_p): Deal with pathological types.
4611 * gcc-interface/utils.c (create_extra_subtype): New function.
4612 (create_field_decl): Minor tweak.
4613 (max_size) <tcc_reference>: Compute a better value by using the extra
4614 subtypes on the self-referential bounds.
4615 <tcc_binary>: Rewrite. Deal with "negative value" in unsigned types.
4616 <tcc_expression>: Likewise.
4617 * gcc-interface/utils2.c (compare_arrays): Retrieve the original bounds
4618 of the arrays upfront. Swap only if the second length is not constant.
4619 Use comparisons on the original bounds consistently for the null tests.
4620 (build_binary_op): Use TYPE_IS_EXTRA_SUBTYPE_P macro.
4621 (build_allocator): Minor tweak.
4623 2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
4625 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
4626 the same value for every dimension of a multidimensional array type.
4628 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
4630 * gcc-interface/trans.c (Regular_Loop_to_gnu): Use the SLOC of the
4631 iteration scheme, if present, throughout the translation.
4633 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
4635 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
4636 DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned
4637 by a call to memset if the LHS is a DECL.
4639 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
4641 * gcc-interface/trans.c (struct loop_info_d): Remove artificial field.
4642 (Loop_Statement_to_gnu): Do not set it.
4644 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
4646 * gcc-interface/trans.c (Iterate_Acc_Clause_Arg): Fix formatting.
4647 (Acc_gnat_to_gnu): Likewise.
4648 (Acc_Data_to_gnu): Likewise.
4649 (Acc_Var_to_gnu): Likewise.
4650 (Acc_Reduc_to_gnu): Likewise.
4651 (Acc_Size_List_to_gnu): Likewise.
4652 (Pragma_to_gnu) <Pragma_Acc_Loop>: Likewise.
4653 <Pragma_Acc_Data>): Likewise.
4654 (find_loop_for): Remove default value for parameters.
4655 * gcc-interface/trans.c (gnat_to_gnu) <N_Op_And>: Merge into...
4656 <N_Op_Eq>): ...this.
4658 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
4660 * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Use test on
4661 the sign bit instead of on the sign of the value.
4662 <PLUS_EXPR>: Turn addition of negative constant into subtraction.
4663 <MULT_EXPR>: Add test for degenerate case.
4664 <BIT_AND_EXPR>: Simplify.
4666 2019-01-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
4668 * s-oscons-tmplt.c (AF_INET6): Do not undefine for RTEMS.
4670 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
4673 * exp_ch11.adb: Change "can not" to "cannot".
4674 * sem_ch4.adb: Likewise.
4676 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
4679 * exp_ch9.adb: Mechanically replace "can not" with "cannot".
4680 * libgnat/s-regpat.ads: Likewise.
4681 * par-ch4.adb: Likewise.
4682 * set_targ.adb: Likewise.
4683 * types.ads: Likewise.
4685 2019-01-08 Justin Squirek <squirek@adacore.com>
4688 2018-07-31 Justin Squirek <squirek@adacore.com>
4690 * lib-writ.adb (Write_With_Lines): Modfiy the generation
4691 of dependencies within ali files so that source unit
4692 bodies are properly listed even if said bodies are
4693 missing. Perform legacy behavior in GNATprove mode.
4694 * lib-writ.ads: Modify documentation to reflect current
4698 2018-09-26 Justin Squirek <squirek@adacore.com>
4700 * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
4701 documentation and an extra conditional check for RCI
4702 units so that generated ali files will list the spec
4703 only instead of a body when a body is not found.
4705 2019-01-04 Eric Botcazou <ebotcazou@adacore.com>
4707 * gnatvsn.ads: Bump copyright year.
4709 2019-01-01 Jakub Jelinek <jakub@redhat.com>
4711 Update copyright years.
4713 * gnat_ugn.texi: Bump @copying's copyright year.
4714 * gnat_rm.texi: Likewise.
4716 Copyright (C) 2019 Free Software Foundation, Inc.
4718 Copying and distribution of this file, with or without modification,
4719 are permitted in any medium without royalty provided the copyright
4720 notice and this notice are preserved.