1 2019-10-01 Maciej W. Rozycki <macro@wdc.com>
3 * gcc-interface/Make-lang.in (ada.install-common): Split into...
4 (gnat-install-tools, gnat-install-lib): ... these.
6 2019-09-26 Alexandre Oliva <oliva@adacore.com>
8 * gcc-interface/decl.c (components_to_record): Set
9 DECL_SIZE_UNIT for zero-sized fields.
11 2019-09-26 Arnaud Charlet <charlet@adacore.com>
13 * osint.adb (OS_Time_To_GNAT_Time): Remove dependency on To_C/To_Ada
15 2019-09-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
17 * libgnarl/s-osinte__solaris.ads (sysconf): Declare.
18 (SC_NPROCESSORS_ONLN): Define.
19 * libgnarl/s-tasinf__solaris.ads (Number_Of_Processors): Declare.
20 * libgnarl/s-tasinf__solaris.adb (N_CPU): New variable.
21 (Number_Of_Processors): New function.
23 2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
25 * gcc-interface/trans.c (Regular_Loop_to_gnu): Do not rotate the loop
27 (build_return_expr): Do not perform NRV if -Og is enabled.
28 (Subprogram_Body_to_gnu): Likewise.
29 (gnat_to_gnu) <N_Simple_Return_Statement>: Likewise.
30 (Handled_Sequence_Of_Statements_to_gnu): Do not inline finalizers if
32 * gcc-interface/utils.c (convert_to_index_type): Return early if -Og
35 2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
37 * gcc-interface/trans.c (gnat_compile_time_expr_list): New variable.
38 (Pragma_to_gnu): Rename local variable. Save the (first) expression
39 of pragma Compile_Time_{Error|Warning} for later processing.
40 (Compilation_Unit_to_gnu): Process the expressions saved above.
42 2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
44 * gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
45 on the underlying type of the node.
46 (Call_to_gnu): Likewise with the type of the prefix.
48 2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
50 * gcc-interface/decl.c (components_to_record): Do not reorder fields
51 in packed record types if they contain fixed-size fields that cannot
52 be laid out in a packed manner.
54 2019-09-19 Tom Tromey <tromey@adacore.com>
56 * gcc-interface/misc.c (gnat_get_type_bias): Return the bias
57 when -fgnat-encodings=gdb.
59 2019-09-19 Steve Baird <baird@adacore.com>
61 * sem_prag.adb (Preferred_String_Type): A new function. Given an
62 expression, determines whether the preference rules defined for
63 the third-and-later arguments of pragma Annotate suffice to
64 determine the type of the expression. If so, then the preferred
65 type is returned; if not then Empty is returned. Handles
67 (Analyze_Pragma): Replace previous code, which dealt only with
68 string literals, with calls to the new Preferred_String_Type
69 function, which also handles concatenations.
70 * doc/gnat_rm/implementation_defined_pragmas.rst: Update
71 documentation for pragma Annotate.
72 * gnat_rm.texi: Regenerate.
74 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
76 * exp_util.adb (Is_Possibly_Unaligned_Slice): Do not return true
77 on pure alignment considerations if the target does not require
78 the strict alignment of memory accesses.
80 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
82 * sem_ch12.adb (Check_Private_View): Add a comment to indicate
85 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
87 * exp_aggr.adb (Has_Mutable_Components): Look at the underlying
88 type of components to find out whether they are mutable.
90 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
92 * sem_ch12.adb (Instantiate_Package_Body): Check that the body
93 has not already been instantiated when the body of the parent
96 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
98 * sem_util.adb (In_Instance): Test whether the current unit has
99 been analyzed instead of being on the scope stack to detect the
100 case of actuals of an instantiation of a generic child unit done
101 as a compilation unit.
103 2019-09-19 Dmitriy Anisimkov <anisimko@adacore.com>
105 * libgnat/g-socket.ads, libgnat/g-socket.adb
106 (Create_Socket_Pair): New routine.
107 * libgnat/g-socthi.ads (OS_Has_Socketpair): Boolean constant.
108 (C_Socketpair): New imported routine.
109 * libgnat/g-socthi__mingw.ads, libgnat/g-socthi__vxworks.ads
110 (Default_Socket_Pair_Family): New constant.
111 (C_Socketpair): New routine.
112 * libgnat/g-socthi__mingw.adb, libgnat/g-socthi__vxworks.adb
113 (C_Socketpair): Is separated in anouther file.
114 * libgnat/g-sthcso.adb (C_Socketpair): Non UNIX implementation.
115 * libgnat/g-stsifd__sockets.adb: Reuse C_Socketpair.
117 2019-09-19 Yannick Moy <moy@adacore.com>
119 * sem_prag.adb (Analyze_Depends_In_Decl_Part): Simplify previous
122 2019-09-19 Ed Schonberg <schonberg@adacore.com>
124 * sem_ch7.adb (Install_Parent_Private_Declarations): If a
125 generic child unit is instantiated within a sibling child unit,
126 the analysis of its private part requires that the private part
127 of the ancestor be available, as is done when the context
128 includes an instance of the ancestor.
130 2019-09-19 Yannick Moy <moy@adacore.com>
132 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add special
133 case for traversal functions.
135 2019-09-19 Yannick Moy <moy@adacore.com>
137 * sem_prag.adb (Analyze_Global_In_Decl_Part): Do not issue an
138 error when a constant of an access type is used as output in a
140 (Analyze_Depends_In_Decl_Part): Do not issue an error when a
141 constant of an access type is used as output in a Depends
144 2019-09-19 Arnaud Charlet <charlet@adacore.com>
146 * exp_attr.adb: Remove obsolete comment.
148 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
150 * sem_ch3.adb (Build_Derived_Access_Type): If this is an access-
151 to-subprogram type, copy Can_Use_Internal_Rep from the parent.
153 2019-09-19 Yannick Moy <moy@adacore.com>
155 * gcc-interface/Make-lang.in: Remove references to sem_spark.
156 * sem_spark.adb, sem_spark.ads: Remove unit.
158 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
160 * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Treat
161 Machine_Rounding as an alias for Rounding.
162 * sem_res.adb (Simplify_Type_Conversion): Likewise.
164 2019-09-19 Gary Dismukes <dismukes@adacore.com>
166 * exp_unst.adb (Unnest_Subprogram): Bypass the transformation of
167 up-level references unless Opt.Generate_C_Code is enabled.
169 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
171 * exp_ch4.adb (Expand_Array_Equality): If optimization is
172 enabled, generate a simple conjunction of comparisons for the
173 specific case of constrained 1-dimensional 2-element arrays.
176 2019-09-19 Piotr Trojanek <trojanek@adacore.com>
178 * exp_dbug.ads, exp_dbug.adb (Get_Homonym_Number): Remove.
179 (Append_Homonym_Number): Use Homonym_Number instead of
181 * exp_util.ads, exp_util.adb (Homonym_Number): Mirror style of
182 the removed Get_Homonym_Number routine, i.e. initialize local
183 objects at declaration and refine the type of result.
184 * sem_util.adb (Add_Homonym_Suffix): Use Homonym_Number instead
185 of Get_Homonym_Number.
187 2019-09-19 Ed Schonberg <schonberg@adacore.com>
189 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Simplify
190 handling of expressions in predicates when the context is a
193 2019-09-19 Bob Duff <duff@adacore.com>
195 * sem_attr.adb (Resolve_Attribute): Make sure the secondary
196 stack is properly managed in the case of a 'Range attribute in a
199 2019-09-19 Raphael Amiard <amiard@adacore.com>
201 * libgnat/a-cfhase.ads (Set): Add comments to public primitives.
203 2019-09-19 Raphael Amiard <amiard@adacore.com>
205 * libgnat/a-cbhama.ads, libgnat/a-cbhase.ads,
206 libgnat/a-chtgop.ads (Clear): Refine comments
208 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
210 * sem_ch12.adb (Restore_Private_Views): Comment out new code
211 that clear the Is_Generic_Actual_Type also on the full view.
213 2019-09-19 Bob Duff <duff@adacore.com>
215 * exp_ch3.adb (Rewrite_As_Renaming): Return False if there are
216 any aspect specifications, because otherwise Insert_Actions
219 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
221 * exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Add
222 Bit_Packed_Array parameter and documet it. Always insert a copy
224 (Expand_Actuals): Adjust the calls to
225 Add_Simple_Call_By_Copy_Code.
227 2019-09-19 Bob Duff <duff@adacore.com>
229 * xref_lib.adb (Get_Symbol_Name): If we reach EOF in the first
230 loop without finding the symbol, return "???". Otherwise, it's
232 (Parse_EOL): Assert that we're not already at EOF. Remove
233 processing of LF/CR -- there are no operating systems that use
236 2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
238 * exp_ch6.adb (Is_Legal_Copy): Also return false for an aliased
239 formal and a formal passed by reference in convention Ada. Add
240 missing guard to the existing test on Is_Valued_Procedure.
242 2019-09-19 Bob Duff <duff@adacore.com>
244 * rtsfind.ads (RTE_Available): Improve comment.
246 2019-09-18 Bob Duff <duff@adacore.com>
248 * exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Move call
249 to RTE_Available later, so it doesn't disturb the elab order.
250 The RE_Copy_Bitfield entity is defined in package
251 System.Bitfields which has a dependency on package
252 System.Bitfield_Utils, which has it its spec:
253 pragma Elaborate_Body;
254 The query on RTE_Available forces loading and analyzing
255 System.Bitfields and all its withed units.
257 2019-09-18 Eric Botcazou <ebotcazou@adacore.com>
259 * checks.ads (Alignment_Warnings_Record): Add P component.
260 * checks.adb (Apply_Address_Clause_Check): Be prepared to kill
261 the warning also if the clause is of the form X'Address.
262 (Validate_Alignment_Check_Warning): Kill the warning if the
263 clause is of the form X'Address and the alignment of X is
266 2019-09-18 Ed Schonberg <schonberg@adacore.com>
268 * sem_res.adb (Set_Mixed_Node_Expression): If a conditional
269 expression has universal_real alternaitves and the context is
270 Universal_Fixed, as when it is an operand in a fixed-point
271 multiplication or division, resolve the expression with a
272 visible fixed-point type, which must be unique.
274 2019-09-18 Ed Schonberg <schonberg@adacore.com>
276 * sem_ch3.adb (Constrain_Component_Type): For a discriminated
277 type, handle the case of a constraint given by a conversion of a
278 discriminant of the enclosing type. Necessary when compiling a
279 discriminated task for a restricted run-time, when the generated
280 Secondary_Stack component may be set by means of an aspect on
283 2019-09-18 Ed Schonberg <schonberg@adacore.com>
285 * exp_aggr.adb (Expand_Record_Aggregate, Rewrite_Discriminant):
286 After rewriting a reference to an outer discriminant as a
287 selected component of the enclosing object, analyze the selected
288 component to ensure that the entity of the selector name is
289 properly set. This is necessary when the aggregate appears
290 within an expression that may have been analyzed already.
292 2019-09-18 Justin Squirek <squirek@adacore.com>
294 * sem_ch8.adb (Use_One_Type): Add guard to prevent warning on a
295 reundant use package clause where there is no previous
296 use_clause in the chain.
298 2019-09-18 Justin Squirek <squirek@adacore.com>
300 * exp_ch4.adb (Expand_N_Type_Conversion): Add calculation of an
301 alternative operand for the purposes of generating accessibility
304 2019-09-18 Eric Botcazou <ebotcazou@adacore.com>
306 * exp_aggr.adb (Build_Array_Aggr_Code): In STEP 1 (c), duplicate
307 the expression and reset the Loop_Actions for each loop
308 generated for an others choice.
310 2019-09-18 Justin Squirek <squirek@adacore.com>
312 * einfo.adb, einfo.ads (Minimum_Accessibility): Added new field.
313 (Set_Minimum_Accessibility): Added to set new field.
314 (Minimum_Accessibility): Added to fetch new field.
315 * exp_ch6.adb (Expand_Subprogram_Call): Modify calls to fetch
316 accessibility levels to the new subprogram Get_Accessibility
317 which handles cases where minimum accessibility might be needed.
318 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Add section to
319 generate a Minimum_Accessibility object within relevant
321 * sem_util.adb, sem_util.ads (Dynamic_Accessibility_Level):
322 Additional documentation added and modify section to use new
323 function Get_Accessibility.
324 (Get_Accessibility): Added to centralize processing of
325 accessibility levels.
327 2019-09-18 Steve Baird <baird@adacore.com>
329 * sem_util.ads (Interval_Lists): A new visible package. This
330 package is visible because it is also intended for eventual use
331 in Sem_Eval.Subtypes_Statically_Compatible when that function is
332 someday upgraded to handle static predicates correctly. This
333 new package doesn't really need to be visible for now, but it
334 still seems like a good idea.
335 * sem_util.adb (Gather_Components): Implement AI12-0086 via the
336 following strategy. The existing code knows how to take a static
337 discriminant value and identify the corresponding variant; in
338 the newly-permitted case of a non-static value of a static
339 subtype, we arbitrarily select a value of the subtype and find
340 the corresponding variant using the existing code. Subsequently,
341 we check that every other value of the discriminant's subtype
342 corresponds to the same variant; this is done using the newly
343 introduced Interval_Lists package.
344 (Interval_Lists): Provide a body for the new package.
346 2019-09-18 Javier Miranda <miranda@adacore.com>
348 * exp_ch4.adb (Expand_N_Op_Eq): The frontend assumes that we can
349 do a bit-for-bit comparison of two access to protected
350 subprogram pointers. However, there are two reasons why we may
351 not be able to do that: (1) there may be padding bits for
352 alignment before the access to subprogram, and (2) the access to
353 subprogram itself may not be compared bit-for- bit because the
354 activation record part is undefined: two pointers are equal iff
355 the subprogram addresses are equal. This patch fixes it by
356 forcing a field-by-field comparison.
357 * bindgen.adb (Gen_Adainit): The type No_Param_Proc is defined
358 in the library as having Favor_Top_Level, but when we create an
359 object of that type in the binder file we don't have that
360 pragma, so the types are different. This patch fixes this issue.
361 * libgnarl/s-interr.adb, libgnarl/s-interr__hwint.adb,
362 libgnarl/s-interr__sigaction.adb, libgnarl/s-interr__vxworks.adb
363 (Is_Registered): This routine erroneously assumes that the
364 access to protected subprogram is two addresses. We need to
365 create the same record that the compiler makes to ensure that
366 any padding is the same. Then we have to look at just the first
367 word of the access to subprogram. This patch fixes this issue.
369 2019-09-18 Bob Duff <duff@adacore.com>
371 * exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): The call
372 to Copy_Bitfield is now enabled.
373 (Expand_Assign_Array_Bitfield): Multiply 'Length times
374 'Component_Size "by hand" instead of using 'Size.
376 2019-09-18 Vasiliy Fofanov <fofanov@adacore.com>
378 * doc/gnat_rm/implementation_defined_pragmas.rst: Fix minor
381 2019-09-18 Javier Miranda <miranda@adacore.com>
383 * exp_disp.adb (Make_DT, Make_Secondary_DT): Remove generation
384 of alignment representation clause for the following tables:
385 Predef_Prims, Iface_DT, TSD, ITable, DT.
387 2019-09-18 Steve Baird <baird@adacore.com>
389 * sem_eval.adb (Expr_Value): Do not fail "the type of a null
390 literal must be an access type" assertion if errors have already
391 been posted on the given node.
393 2019-09-18 Piotr Trojanek <trojanek@adacore.com>
395 * exp_dbug.ads, exp_dbug.adb (Get_Homonym_Number): Refine type
397 * sem_util.adb (Add_Homonym_Suffix): Refine type of a local
400 2019-09-18 Yannick Moy <moy@adacore.com>
402 * exp_dbug.adb (Append_Homonym_Number): Use new function
404 (Get_Homonym_Number): New function to return the homonym number.
405 (Qualify_Entity_Name): Remove special case for GNATprove.
406 * exp_dbug.ads (Get_Homonym_Number): Make the new function
407 public for use in GNATprove.
408 * frontend.adb (Frontend): Do not qualify names in GNATprove
410 * sem_util.adb (Unique_Name): Append homonym suffix where needed
411 for entities which have local homonyms in the same scope.
413 2019-09-18 Nicolas Roche <roche@adacore.com>
415 * libgnat/s-valrea.adb (Scan_Integral_Digits): New procedure.
416 (Scan_Decimal_Digits): New procedure.
417 (As_Digit): New function.
418 (Scan_Real): Use Scan_Integral_Digits and Scan_Decimal_Digits.
420 2019-09-18 Claire Dross <dross@adacore.com>
422 * exp_attr.adb (Expand_N_Attribute_Reference): Call routine from
423 Exp_Util to know the value of the Constrained attribute in the
425 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Make
426 implicit dereferences inside the Constrained attribute explicit.
427 * exp_util.ads, exp_util.adb
428 (Attribute_Constrained_Static_Value): New routine to compute the
429 value of a statically known reference to the Constrained
432 2019-09-18 Vadim Godunko <godunko@adacore.com>
434 * libgnat/g-expect.adb (Expect_Internal): Don't include invalid
435 file descriptors into the set of file descriptors for Poll.
436 Raise Process_Died exception when computed set of file
437 descriptors to monitor is empty.
439 2019-09-18 Frederic Konrad <konrad@adacore.com>
441 * adaint.c: Include dosFsLib.h and vwModNum.h for VxWorks 6.
442 (__gnat_rename): Map S_dosFsLib_FILE_NOT_FOUND to ENOENT.
444 2019-09-18 Steve Baird <baird@adacore.com>
446 * freeze.adb (Freeze_Object_Declaration): Do not call
447 Check_Large_Modular_Array when the object declaration being
448 frozen is an ignored ghost entity.
450 2019-09-18 Tom Tromey <tromey@adacore.com>
452 * make.adb (Initialize): Fix typo.
454 2019-09-18 Olivier Hainque <hainque@adacore.com>
456 * libgnat/s-win32.ads (DWORD_PTR): New type, pointer size
458 (SYSTEM_INFO): Use it for dwActiveProcessorMask.
460 2019-09-18 Arnaud Charlet <charlet@adacore.com>
462 * doc/gnat_rm/implementation_defined_pragmas.rst: Improve doc on
464 * gnat_rm.texi: Regenerate.
466 2019-09-18 Arnaud Charlet <charlet@adacore.com>
468 * doc/gnat_rm/implementation_defined_characteristics.rst,
469 doc/gnat_rm/implementation_defined_pragmas.rst,
470 doc/gnat_rm/implementation_of_specific_ada_features.rst: Remove
471 remaining references to VMS support
472 * gnat_rm.texi: Regenerate.
474 2019-09-18 Arnaud Charlet <charlet@adacore.com>
476 * libgnat/s-stausa.adb: Fix a typo
478 2019-09-18 Bob Duff <duff@adacore.com>
480 * libgnat/a-cbhama.adb, libgnat/a-cbhase.adb,
481 libgnat/a-cbmutr.adb, libgnat/a-cborma.adb,
482 libgnat/a-cborse.adb, libgnat/a-cobove.adb (Copy): Avoid reading
483 the uninitialized variable C in the Checks = False case. Change
484 variable to be a constant.
486 2019-09-18 Claire Dross <dross@adacore.com>
488 * libgnat/a-cofuma.adb (Remove, Elements_Equal_Except,
489 Keys_Included, Keys_Included_Except): Rename loop indexes and
490 global constants from I to J.
492 2019-09-18 Arnaud Charlet <charlet@adacore.com>
494 * exp_unst.adb (Unnest_Subprograms): Refine previous change.
496 2019-09-17 Claire Dross <dross@adacore.com>
498 * libgnat/a-cofuma.ads, libgnat/a-cofuma.adb (Remove): New
499 function which returns a copy of the input container without a
502 2019-09-17 Yannick Moy <moy@adacore.com>
504 * libgnat/s-arit64.adb (Double_Divide): Correctly handle the
505 special case when rounding.
507 2019-09-17 Javier Miranda <miranda@adacore.com>
509 * sem_ch3.adb (Complete_Private_Subtype): Propagate attributes
510 Has_Attributes and Predicate_Function to the cloned subtype.
512 2019-09-17 Eric Botcazou <ebotcazou@adacore.com>
514 * sem.adb (Do_Analyze): Save Style_Check_Max_Line_Length on
515 entry and restore it on exit instead of recomputing it.
517 2019-09-17 Tom Tromey <tromey@adacore.com>
519 * exp_dbug.ads: Update character type comment.
521 2019-09-17 Yannick Moy <moy@adacore.com>
523 * libgnat/s-arit64.adb (Double_Divide): Simplify needlessly
524 complex computation. Fix comments.
525 (Scaled_Divide): Fix comments. Explain why implementation does
526 not suffer from bugs in Algorithm D from 2nd Edition of TAOCP.
528 2019-09-17 Yannick Moy <moy@adacore.com>
530 * libgnat/s-arit64.adb (Scaled_Divide): Add protection against
531 undesirable wrap-around.
533 2019-09-17 Yannick Moy <moy@adacore.com>
535 * libgnat/s-arit64.adb (Double_Divide): Fix two possible
538 2019-09-17 Dmitriy Anisimkov <anisimko@adacore.com>
540 * make_util.ads (On_Windows): Move...
541 * osint.ads (On_Windows): There.
542 * osint.adb (OS_Time_To_GNAT_Time): If odd incremented on
543 Windows before conversion to Time_Stamp_Type.
545 2019-09-17 Yannick Moy <moy@adacore.com>
547 * sem_spark.adb (Check_Declaration): Do not check the assignment
548 from an illegal declaration.
550 2019-09-17 Bob Duff <duff@adacore.com>
552 * doc/gnat_ugn/gnat_and_program_execution.rst: Clarify
554 * gnat_ugn.texi: Regenerate.
555 * libgnat/s-stausa.ads: Clarify comments.
557 2019-09-17 Steve Baird <baird@adacore.com>
559 * sem_util.adb (Wrong_Type): In deciding to suppress a message,
560 it is not enough for In_Instance to be True; in addition,
561 In_Generic_Actual (Expr) must be False.
562 * sem_type.adb (In_Generic_Actual): Fix bug where traversal of
563 parents skips every other node.
565 2019-09-17 Claire Dross <dross@adacore.com>
567 * sem_spark.adb (Get_Observed_Or_Borrowed_Expr): If the
568 definition of a local borrower contains calls to traversal
569 functions, the borrowed expression is the first parameter of the
570 first traversal function call in the definition.
572 2019-09-17 Ed Falis <falis@adacore.com>
574 * doc/gnat_rm/implementation_defined_pragmas.rst: Remove
576 * gnat_rm.texi, gnat_ugn.texi: Regenerate.
578 2019-09-17 Vadim Godunko <godunko@adacore.com>
580 * libgnat/g-exptty.ads (Close_Input): New subprogram.
581 * libgnat/g-exptty.adb (Close_Input): New subprogram.
582 (Close): Move close of TTY to Close_Input.
583 * terminals.c (__gnat_close_tty): Set file descriptors to
584 invalid value after close.
586 2019-09-17 Vadim Godunko <godunko@adacore.com>
588 * libgnat/g-expect.adb (Expect_Internal): Try to call 'poll' few
591 2019-09-17 Vadim Godunko <godunko@adacore.com>
593 * libgnat/g-expect.ads, libgnat/g-expect.adb (Close_Input): New
595 (Get_Command_Output): Call Close_Input to close input stream.
596 (Expect_Internal): Likewise.
598 * libgnat/g-exptty.adb (Close): Likewise.
600 2019-09-17 Piotr Trojanek <trojanek@adacore.com>
602 * sem_util.ads, sem_util.adb (Is_Attribute_Old): New utility
605 2019-09-17 Yannick Moy <moy@adacore.com>
607 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add handling
608 for dispatching operations.
610 2019-09-17 Ed Schonberg <schonberg@adacore.com>
612 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): In a
613 generic context, for a Predicate aspect, use
614 Preanalyze_Spec_Expression to verify conformance.
616 2019-09-17 Javier Miranda <miranda@adacore.com>
618 * sem_ch3.adb (Constrain_Corresponding_Record): Propagate
619 attribute Is_Tagged_Type.
621 2019-09-17 Javier Miranda <miranda@adacore.com>
623 * exp_ch3.adb (Build_Record_Init_Proc): Do not generate code to
624 adjust the tag component when the record is initialized with a
626 * sem_aggr.adb (Valid_Limited_Ancestor): Return True for
627 N_Raise_Expression nodes.
628 (Valid_Ancestor_Type): Return True for raise expressions.
629 * sem_ch3.adb (Analyze_Component_Declaration): Do not report an
630 error when a component is initialized with a raise expression.
631 * sem_ch4.adb (Analyze_Qualified_Expression): Do not report an
632 error when the aggregate has a raise expression.
634 2019-09-17 Piotr Trojanek <trojanek@adacore.com>
636 * ali.ads: Fix casing in comment.
637 * ali-util.ads, ali-util.adb (Read_Withed_ALIs): Remove
638 Ignore_Errors parameter; it was only set to non-default value of
639 True when running in GNATprove_Mode and wrongly reset to False
640 when calling this routine recursively. Now in GNATprove mode we
641 want it to be always True, so in fact it is equivalent to
642 GNATProve_Mode flag itself (which was already used in this
645 2019-09-17 Arnaud Charlet <charlet@adacore.com>
647 * adaint.c (_REENTRANT, _THREAD_SAFE): Only define if needed.
649 2019-09-17 Arnaud Charlet <charlet@adacore.com>
651 * libgnat/s-bitfie.ads (Val_Bits, Val_Bytes): Define from
652 Long_Long_Integer'Size.
654 2019-09-17 Javier Miranda <miranda@adacore.com>
656 * exp_ch6.ads (Needs_BIP_Task_Actuals): New subprogram.
657 * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Code
659 (Check_Number_Of_Actuals): New subprogram.
660 (Make_Build_In_Place_Call_In_Allocator): Adding assertion.
661 (Make_Build_In_Place_Call_In_Anonymous_Context): Adding
663 (Make_Build_In_Place_Call_In_Assignment): Adding assertion.
664 (Make_Build_In_Place_Call_In_Object_Declaration): Code cleanup
665 plus assertion addition.
666 (Needs_BIP_Task_Actuals): New subprogram.
667 * sem_ch6.adb (Create_Extra_Formals): Rely on
668 Needs_BIP_Task_Actuals() to check if the master of the tasks to
669 be created, and the caller's activation chain formals are
672 2019-09-17 Bob Duff <duff@adacore.com>
674 * libgnat/s-bituti.adb (Get_Val_2, Set_Val_2): Use new routines
675 for getting and setting a Val_2, avoiding touching the second
676 half when that half might not exist.
677 * exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Correct
678 tests for potential volatile or independent components. In
679 particular, do not call Prefix unless we know it's a slice.
681 2019-09-17 Dmitriy Anisimkov <anisimko@adacore.com>
683 * gsocket.h: Include sys/un.h.
684 * s-oscons-tmplt.c (AF_UNIX): New constant generation.
685 (SIZEOF_sockaddr_un): Idem.
686 * libgnat/g-socket.ads (Family_Type): New value Family_Unix
688 (Family_Inet_4_6): New subtype only for network families.
689 (Sock_Addr_Type): Add Unbounded_String field for Family_Unix
691 (Unix_Socket_Address): Create Sock_Addr_Type from socket
693 (Network_Socket_Address): Create Sock_Addr_Type from
694 Inet_Addr_Type and Port_Type parameters.
695 * libgnat/g-socket.adb: Support local unix address in socket
697 (Get_Address_Info): Disable warning about Result may be
698 referenced before it has a value. Remove duplicated code to exit
699 from Look_For_Supported.
700 * libgnat/g-sothco.ads (Unix_Name_Length): New constant defining
701 maximum number of characters in local socket address path.
702 (Sockaddr): Add variant for Family_Unix address family. Move
703 Sin_Port and Sin_Family to Family_Inet section. Add Sin6_Port
704 and Sin6_Family to Family_Inet6 section.
705 (Set_Address): Add out parameter Length to return valuable
706 Sockaddr data length.
707 (Get_Address): Add input parameter Length to set valuable
708 Sockaddr data length.
709 * libgnat/g-sothco.adb: Support local unix address in socket
712 2019-09-17 Eric Botcazou <ebotcazou@adacore.com>
714 * exp_attr.adb (Expand_Size_Attribute): Chain the special cases
715 on the back-end path and rewrite the attribute appled to slices
716 of bit-packed arrays into the product of the Length and the
717 Compoent_Size attributes of the slices.
718 * exp_ch5.adb (Expand_Assign_Array_Bitfield): Use Size attribute
719 directly to compute the bitfield's size.
721 2019-09-17 Bob Duff <duff@adacore.com>
723 * exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Add tests
724 for potential volatile or independent components.
725 * libgnat/s-bituti.adb (Copy_Small_Bitfield,
726 Copy_Large_Bitfield): Move declarations to more appropriate
729 2019-09-13 Maciej W. Rozycki <macro@wdc.com>
731 * make.adb (Scan_Make_Arg): Also accept `--sysroot=' for the
732 compiler and the linker.
734 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
736 * gcc-interface/decl.c (maybe_saturate_size): New function.
737 (gnat_to_gnu_entity): Invoke it on the Esize of types before sending
738 it for back-annotations.
739 * gcc-interface/trans.c: Fix typo.
741 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
743 * gcc-interface/ada-tree.h (DECL_FORCED_BY_REF_P): New macro.
744 * gcc-interface/decl.c (gnat_to_gnu_param): Set it on parameters
745 whose mechanism was forced to by-reference.
746 * gcc-interface/trans.c (Call_to_gnu): Do not issue a warning about a
747 misaligned actual parameter if it is based on a CONSTRUCTOR. Remove
748 obsolete warning for users of Starlet. Issue a warning if a temporary
749 is make around the call for a parameter with DECL_FORCED_BY_REF_P set.
750 (addressable_p): Return true for REAL_CST and ADDR_EXPR.
752 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
754 * gcc-interface/trans.c (gnat_to_gnu): Do not set the location on an
755 expression used for a tag.
757 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
759 * gcc-interface/gigi.h (aggregate_type_contains_array_p): Declare.
760 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: For an
761 extension, test Has_Record_Rep_Clause instead of Has_Specified_Layout.
762 (adjust_packed): Return 0 if the type of the field is an aggregate
763 type that contains (or is) a self-referential array.
764 (type_has_variable_size): Delete.
765 * gcc-interface/utils.c (inish_record_type): Constify a variable.
766 (aggregate_type_contains_array_p): Add parameter SELF_REFERENTIAL.
767 <RECORD_TYPE>: Pass it in the recursive call.
768 <ARRAY_TYPE>: If it is true, return true only if the array type is
770 (create_field_decl): Streamline the setting of the alignment on the
771 field. Pass false to aggregate_type_contains_array_p.
773 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
775 * gcc-interface/trans.c (lvalue_required_p) <N_Slice>: Adjust GNU_TYPE
776 in the recursive call.
777 <N_Selected_Component>: Likewise.
779 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
781 * gcc-interface/utils.c (build_template): Deal with parameters
782 passed by pointer to component of multi-dimensional arrays.
784 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
786 * gcc-interface/decl.c (annotate_value) <CALL_EXPR>: Inline the call
787 also if List_Representation_Info is greater than 3.
789 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
791 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Add assertion.
793 2019-08-30 Eric Botcazou <ebotcazou@adacore.com>
795 * gcc-interface/gigi.h (gigi_checking_assert): New macro.
796 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>:
797 Remove redundant test and adjust comments. Minor tweaks.
798 * gcc-interface/trans.c (Call_to_gnu): Do not generate range checks,
799 instead assert that the Do_Range_Check flag is not set. Adjust call
800 to convert_with_check.
801 (gnat_to_gnu): Likewise.
802 (assoc_to_constructor): Likewise.
803 (pos_to_constructor): Likewise. Remove GNAT_COMPONENT_TYPE parameter.
804 (emit_range_check): Delete.
805 (convert_with_check): Remove RANGE_P parameter and adjust. Do a single
806 overflow check for modular types.
808 2019-08-23 Jakub Jelinek <jakub@redhat.com>
811 * gcc-interface/misc.c (gnat_post_options): Set flag_excess_precision
812 instead of flag_excess_precision_cmdline.
814 2019-08-21 Vadim Godunko <godunko@adacore.com>
816 * libgnat/g-expect.adb (Expect_Internal): Attempt to read
817 several times when 'read' returns non-positive.
819 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
821 * einfo.adb (Is_Discriminal): Remove extra parens.
822 (Is_Constant_Object): Simplify by reusing Ekind_In.
823 (Is_Prival): Remove extra parens.
824 * checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor
827 2019-08-21 Claire Dross <dross@adacore.com>
829 * libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow
831 (Iter_First, Iter_Next): Primitives used for iteration.
833 2019-08-21 Yannick Moy <moy@adacore.com>
835 * sem_ch3.adb (Analyze_Subtype_Declaration): Inherit RM_Size
836 field for formal type parameters in generic instantiations.
838 2019-08-21 Yannick Moy <moy@adacore.com>
840 * sem_spark.adb: Update references to the SPARK RM.
842 2019-08-21 Eric Botcazou <ebotcazou@adacore.com>
844 * repinfo.adb (List_Array_Info): In -gnatR4 mode, set the
845 relevant flag on the component type here instead of...
846 (List_Object_Info): Likewise for the object type.
847 (List_Entities): ...here. In -gnatR4 mode, recurse into
848 entities local to a record type.
849 (List_Component_Layout): In -gnatR4 mode, mark the type as
852 2019-08-21 Bob Duff <duff@adacore.com>
854 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-bitutil.o and
856 * exp_ch5.adb (Expand_Assign_Array_Bitfield): New function to
857 generate a call to Copy_Bitfield. This is disabled for now.
858 (Expand_Assign_Array_Loop_Or_Bitfield): New function to decide
859 whether to call Expand_Assign_Array_Bitfield.
860 (Expand_Assign_Array): Call Expand_Assign_Array_Loop_Or_Bitfield
861 instead of Expand_Assign_Array_Loop.
862 * libgnat/s-bitfie.ads, libgnat/s-bituti.adb,
863 libgnat/s-bituti.ads: New units.
864 * rtsfind.ads: Add enum literals for accessing Copy_Bitfield.
866 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
868 * bindo-graphs.ads (Iterate_Edges_To_Successors): Fix typo in
870 * bindo-graphs.adb (Delete_Edge): Fix layout in parameter list.
872 2019-08-21 Gary Dismukes <dismukes@adacore.com>
874 * exp_ch3.adb (Build_Master): Suppress call to
875 Build_Class_Wide_Master in the case where the
876 access-to-limited-class-wide type was created for a component in
877 an entry's formal parameter
878 block (Is_Parameter_Block_Component_Type), to prevent a master
879 from being created for such access types generated by the front
880 end in a task spec for entry formals in a parameter block. Add
881 a ??? about whether this suppression should be done more
882 generally (such as by using Comes_From_Source).
884 2019-08-21 Eric Botcazou <ebotcazou@adacore.com>
886 * exp_ch6.adb (Expand_N_Extended_Return_Statement): In the case
887 of a built-in-place function that doesn't need a BIP_Alloc_Form
888 parameter but returns unconstrained, build the return
889 consistently using the function's result subtype. Remove bypass
890 added in previous change.
892 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
894 * sem_prag.adb (Max_Entry_Queue_Length): Do not substitute
895 expression of the pragma argument with its value during
897 * sem_util.adb (Get_Max_Queue_Length): Compute value of the
898 pragma argument when needed.
900 2019-08-21 Yannick Moy <moy@adacore.com>
902 * checks.adb (Install_Null_Excluding_Check): Do not install
903 check in GNATprove mode.
905 2019-08-21 Yannick Moy <moy@adacore.com>
907 * sem_spark.adb (Process_Path): Do nothing on address of
910 2019-08-21 Eric Botcazou <ebotcazou@adacore.com>
912 * exp_util.adb (Finalize_Address): Deal consistently with
913 subtypes of private protected types.
915 2019-08-21 Piotr Trojanek <trojanek@adacore.com>
917 * exp_util.adb (Corresponding_Runtime_Package): Use high-level
919 * sem_ch8.adb (Analyze_Renamed_Entry): Likewise.
920 * sem_ch9.adb (Analyze_Requeue): Likewise.
922 2019-08-21 Javier Miranda <miranda@adacore.com>
924 * sem_util.adb (Update_Named_Associations): Update
925 First_Named_Actual when the subprogram call has a single named
928 2019-08-21 Joel Brobecker <brobecker@adacore.com>
930 * doc/Makefile (mk_empty_dirs): New (PHONY) rule.
931 (%.html, %.pdf, %.txt, %.info, %.texinfo): Add dependencies on
934 2019-08-21 Justin Squirek <squirek@adacore.com>
936 * doc/gnat_rm/implementation_defined_pragmas.rst: Modify
937 documentation to reflect expected behavior.
938 * gnat_rm.texi: Regenerate.
939 * sem_prag.adb (Analyze_Pragma): Modify handling of pragma
940 Max_Entry_Queue_Length to not reject integer values of negative
942 * sem_util.adb (Get_Max_Queue_Length): Add processing for values
943 of negative one to fit within the current scheme.
945 2019-08-20 Arnaud Charlet <charlet@adacore.com>
947 * exp_unst.adb (Unnest_Subprograms, Unnest_Subprogram): Take
948 inlining (-gnatn) into account.
950 2019-08-20 Ed Schonberg <schonberg@adacore.com>
952 * exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case
953 Storage_Size): If the expression for Storage_Size is not static
954 it may depend on characterstics of another type that may bot be
955 frozen yet, so the elaboration of the expression for the aspect
956 must be attached directly to the freeze actions of the type to
959 2019-08-20 Piotr Trojanek <trojanek@adacore.com>
961 * exp_util.adb (Build_DIC_Procedure_Declaration): Set the last
962 entity of the generated Default_Initial_Condition procedure in
963 order to construct a proper entity chain.
965 2019-08-20 Yannick Moy <moy@adacore.com>
967 * exp_spark.adb (Expand_SPARK_N_Slice_Or_Indexed_Component):
968 Renaming of function to apply to slices as well.
969 (Expand_SPARK): Expand prefix of slices of access type.
971 2019-08-20 Bob Duff <duff@adacore.com>
973 * exp_aggr.adb (Expand_Array_Aggregate): Use build-in-place in
974 the nonlimited case in STEP 4. This improves the efficiency of
975 things like (1 .. 1000 => <>). We still generate some code for
976 that, unfortunately, but it is much improved.
977 (Aggr_Assignment_OK_For_Backend): Return false if <> components
980 2019-08-20 Bob Duff <duff@adacore.com>
982 * exp_ch6.adb (Needs_BIP_Alloc_Form): Call
983 Requires_Transient_Scope rather than checking constrainedness
984 and so forth. We have previously improved
985 Requires_Transient_Scope to return False in various cases,
986 notably a limited record with an access discriminant. This
987 change takes advantage of that to avoid using the secondary
988 stack for functions returning such types.
989 (Make_Build_In_Place_Call_In_Allocator): Be consistent by
990 calling Needs_BIP_Alloc_Form rather than Is_Constrained and so
992 * sem_ch4.adb (Analyze_Allocator): The above change causes the
993 compiler to generate code that is not legal Ada, in particular
994 an uninitialized allocator for indefinite subtype. This is
995 harmless, so we suppress the error message in this case.
997 2019-08-20 Gary Dismukes <dismukes@adacore.com>
999 * ali.adb, ali.ads, aspects.adb, checks.ads, checks.adb,
1000 doc/gnat_rm/implementation_defined_pragmas.rst,
1001 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1002 einfo.ads, exp_aggr.adb, exp_ch11.adb, exp_ch3.ads, exp_ch4.adb,
1003 exp_disp.adb, inline.adb, libgnat/a-locale.ads,
1004 libgnat/s-soflin.ads, par_sco.adb, repinfo.adb, sem_ch5.adb,
1005 sem_disp.adb, sem_elab.adb, sem_eval.adb, sem_spark.adb,
1006 sem_spark.ads, sinfo.ads: Minor reformattings, typo fixes and
1009 2019-08-20 Dmitriy Anisimkov <anisimko@adacore.com>
1011 * adaint.c (__gnat_to_gm_time): On _WIN32, don't round time up
1014 2019-08-20 Ed Schonberg <schonberg@adacore.com>
1016 * sem_ch3.adb (Analyze_Object_Declaration): If actual type is
1017 private and distinct from nominal type in declaration, propagate
1018 flags Is_Constr_Subt_For_U_Nominal and _UN_Aliased to full view
1021 2019-08-20 Ed Schonberg <schonberg@adacore.com>
1023 * exp_attr.adb (Expand_Loop_Entry_Attribute): When expanding a
1024 loop entry attribute for a while_loop we construct a function
1025 that incorporates the expanded condition of the loop. The itypes
1026 that may be generated in that expansion must carry the scope of
1027 the constructed function for proper handling in gigi.
1029 2019-08-20 Ed Schonberg <schonberg@adacore.com>
1031 * exp_disp.adb (Build_Class_Wide_Check, Replace_Formals): When a
1032 dispatching call tp a subprogram with a class-wide precondition
1033 occurrs in the same declarative part as the ancestor subprogram
1034 being called, the`expression for the precondition has not been
1035 analyzed yet. Such a call may appear, e.g. in an expression
1036 function. In that case, the replacement of formals by actuals in
1037 the call cannot use the formal entities of the subprogram being
1038 called, and the occurrence of the formals in the expression must
1039 be located by name (Chars fields) as would be done at a later
1040 freeze point, when the expression is resolved in the context of
1041 the subprogram itself.
1043 2019-08-20 Bob Duff <duff@adacore.com>
1045 * sem_prag.adb (Persistent_BSS): If an initialization is present
1046 because of Initialize_Scalars or Normalize_Scalars, generate an
1047 implicit pragma Suppress_Initialization to remove that, because
1048 initialization is not allowed for these variables. Other
1049 initializations remain illegal.
1051 2019-08-20 Gary Dismukes <dismukes@adacore.com>
1053 * sem_ch3.adb (OK_For_Limited_Init_In_05): In the case of type
1054 conversions, apply the recursive call to the Original_Node of
1055 the expression Exp rather than the Expression of the
1056 Original_Node, in the case where Exp has been rewritten;
1057 otherwise, when Original_Node is the same as Exp, apply the
1058 recursive call to the Expression.
1059 (Check_Initialization): Revise condition for special check on
1060 type conversions of limited function calls to test Original_Node
1061 (avoiding spurious errors on expanded unchecked conversions
1062 applied to build-in-place dispatching calls).
1064 2019-08-20 Patrick Bernardi <bernardi@adacore.com>
1066 * exp_aggr.adb (Expand_Record_Aggregate): Always convert a
1067 record Aggregate to assignment statements if the option
1068 Aggregate_Individually_Assign is set.
1069 * opt.ads (Aggregate_Individually_Assign): New option.
1070 * par-prag.adb (Prag): Add Pragma_Aggregate_Individually_Assign.
1071 * sem_prag.adb (Analyze_Pragma): Likewise.
1072 * snames.ads-tmpl: Add Pragma_Aggregate_Individually_Assign and
1073 Name_Aggregate_Individually_Assign.
1074 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
1075 pragma Aggregate_Individually_Assign.
1076 * gnat_rm.texi: Regenerate.
1078 2019-08-20 Bob Duff <duff@adacore.com>
1080 * par-ch4.adb: Minor wording change in error messages.
1081 * sem_aggr.adb (Resolve_Delta_Aggregate): Emit an error for Ada
1082 versions prior to Ada 2020.
1084 2019-08-20 Bob Duff <duff@adacore.com>
1086 * freeze.adb (Is_Atomic_VFA_Aggregate): Make the temp for
1087 initialization of the atomic variable be constant. This is
1088 cleaner, and might improve efficiency.
1090 2019-08-20 Eric Botcazou <ebotcazou@adacore.com>
1092 * repinfo.adb (List_Record_Info): In -gnatR4 mode, set the
1093 relevant flag on the implicit base type of a record subtype.
1095 2019-08-20 Bob Duff <duff@adacore.com>
1097 * sem_eval.adb (Expr_Value): Implement the case of an unchecked
1098 conversion of a static expression.
1100 2019-08-20 Bob Duff <duff@adacore.com>
1102 * sem_ch13.adb (Is_Null_Array): New function, used to detect the
1103 null array case; used to warn about uncheckedly converting to a
1104 zero-sized array. It is unfortunate that we can't just check
1105 the size, and warn on all cases of converting from a
1106 nonzero-sized type to a zero-sized one. That's because "0" means
1107 two different things: "size is zero" and "size is unknown".
1108 Until we fix that design flaw, we need this more targeted fix.
1110 2019-08-20 Bob Duff <duff@adacore.com>
1112 * libgnat/a-cborma.adb, libgnat/a-cborse.adb (Clear): Repeatedly
1113 call Delete. This avoids clearing the free list, which
1114 substantially speeds up future Delete operations.
1116 2019-08-20 Bob Duff <duff@adacore.com>
1118 * sem_ch13.adb (Component_Order_Check): New procedure to check
1119 for out-of-order clauses.
1120 * warnsw.ads, warnsw.adb: New -gnatw_r switch.
1121 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1122 Document new switch.
1123 * gnat_ugn.texi: Regenerate.
1125 2019-08-20 Bob Duff <duff@adacore.com>
1127 * sem_ch13.adb (Object_Size): Give an error for zero. It really
1128 rubs me the wrong way that we don't honor "for T'Object_Size use
1129 0;", but it's not important enough to fix. In any case, if we're
1130 not going to obey the clause, we should give an error.
1132 2019-08-20 Bob Duff <duff@adacore.com>
1134 * errout.adb (Error_Msg_Internal): Set Warn_Err in case of
1136 * erroutc.adb (Output_Msg_Text): Do Warnings_Treated_As_Errors
1137 processing and [warning-as-error] modification for style
1138 messages. Clean up code, simplify, remove unnecessary block
1139 statement, add renaming of table entry.
1140 * erroutc.ads (Warning_Treated_As_Error): Fix comment: no such
1141 thing as Set_Warning_As_Error.
1142 * opt.ads: Clean up comments and move related declarations near
1144 * par-prag.adb: Process Warning_As_Error. This is necessary
1145 because many style warning happen during parsing.
1146 * sem_prag.adb: Use new Acquire_Warning_Match_String.
1147 * sem_util.ads, sem_util.adb (Acquire_Warning_Match_String): New
1148 function shared by par-prag.adb and sem_prag.adb. Replaces the
1149 procedure in sem_prag.adb. Avoid use of global variables.
1150 * stringt.ads, stringt.adb (To_String): New function to convert
1151 String_Id to String.
1152 * doc/gnat_rm/implementation_defined_pragmas.rst: Document the
1154 * gnat_rm.texi: Regenerate.
1156 2019-08-20 Eric Botcazou <ebotcazou@adacore.com>
1158 * lib.ads: Add with clause for GNAT.HTable.
1159 Add pragma Inline for Is_Loaded and alphabetize the list.
1160 (Unit_Name_Table_Size): New constant.
1161 (Unit_Name_Header_Num): New subtype.
1162 (Unit_Name_Hash): New function declaration.
1163 (Unit_Names): New simple hash table.
1164 (Init_Unit_Name): New procedure declaration.
1165 * lib.adb (Set_Unit_Name): Unregister the old name in the table,
1166 if any, and then register the new name.
1167 (Init_Unit_Name): New procedure.
1168 (Is_Loaded): Reimplement using a lookup in the names table.
1169 (Remove_Unit): Unregister the name.
1170 (Unit_Name_Hash): New function.
1171 * lib-load.adb (Create_Dummy_Package_Unit): Call Init_Unit_Name.
1172 (Load_Unit): Use a lookup in the names table to find out whether
1173 the unit has already been loaded. Call Init_Unit_Name and then
1174 Remove_Unit if the loading has failed.
1175 (Make_Child_Decl_Unit): Call Init_Unit_Name.
1176 (Make_Instance_Unit): Likewise.
1177 * lib-writ.adb (Ensure_System_Dependency): Likewise.
1179 2019-08-20 Bob Duff <duff@adacore.com>
1181 * sem_ch13.adb (Record_Hole_Check): Initialize After_Last.
1183 2019-08-20 Piotr Trojanek <trojanek@adacore.com>
1185 * impunit.adb (Get_Kind_Of_Unit): Revert change for adapting
1186 this routine for gnatprove.
1188 2019-08-20 Arnaud Charlet <charlet@adacore.com>
1190 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
1191 requirements for Pragma Lock_Free.
1192 * gnat_rm.texi: Regenerate.
1194 2019-08-20 Philippe Gil <gil@adacore.com>
1196 * bindgen.adb (Gen_Main): Set gnat_argc/gnat_argv to argc/argv
1197 only when still uninitialized.
1199 2019-08-20 Bob Duff <duff@adacore.com>
1201 * libgnat/g-comlin.ads (Exit_From_Command_Line): Fix
1202 documentation for GNAT.Command_Line.
1204 2019-08-20 Pierre-Marie de Rodat <derodat@adacore.com>
1207 * gcc-interface/lang.opt (-fdump-scos): Add missing dot at the
1208 end of the documentation.
1210 2019-08-20 Richard Sandiford <richard.sandiford@arm.com>
1212 * gcc-interface/misc.c (default_pass_by_ref): Update call to
1215 2019-08-19 Bob Duff <duff@adacore.com>
1217 * doc/gnat_rm/implementation_advice.rst: Fix documentation for
1218 stream oriented attributes.
1219 * gnat_rm.texi: Regenerate.
1221 2019-08-19 Gary Dismukes <dismukes@adacore.com>
1223 * einfo.ads (E_Function, E_Procedure): Update comments to
1224 reflect that Renamed_Entity is also used for nongeneric
1227 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1229 * sem_prag.adb (Is_Before_First_Decl): Deal with rewritten
1232 2019-08-19 Bob Duff <duff@adacore.com>
1234 * sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning
1235 on formal parameters of dispatching operations.
1237 2019-08-19 Ed Schonberg <schonberg@adacore.com>
1239 * sem_res.adb (Resolve_Call): A call to an expression function
1240 freezes when expander is active, unless the call appears within
1241 the body of another expression function,
1243 2019-08-19 Dmitriy Anisimkov <anisimko@adacore.com>
1245 * libgnat/s-os_lib.ads, libgnat/s-os_lib.adb (To_Ada, To_C): New
1248 2019-08-19 Bob Duff <duff@adacore.com>
1250 * exp_attr.adb (Attribute_Valid): Correct the handling of
1251 private types where the full type is modular. System.Address is
1252 an example. Otherwise, we convert uncheckedly to a signed type,
1253 so we get an incorrect range 0 .. -1, for which all values will
1254 fail. The 'Valid attribute is illegal for such types, but we
1255 generate such illegal attribute_references for 'Valid_Scalars,
1256 and we generate 'Valid_Scalars when the -gnateV switch is used.
1257 Rename Btyp --> PBtyp to avoid hiding the outer Btyp, which was
1259 * libgnat/a-except.adb: Set the Exception_Raised component.
1260 Otherwise, we have incorrect reads of invalid data.
1262 2019-08-19 Pierre-Marie de Rodat <derodat@adacore.com>
1264 * libgnat/a-cgaaso.ads, libgnat/a-cgarso.ads,
1265 libgnat/a-cogeso.ads, libgnat/a-contai.ads,
1266 libgnat/a-locale.ads: Import documentation from the RM.
1268 2019-08-19 Jerome Guitton <guitton@adacore.com>
1270 * Makefile.rtl (system.o): New target to add generation of
1272 * gcc-interface/Makefile.in (install-gnatlib): Install
1273 ada_target_properties.
1275 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1277 * inline.adb (Add_Inlined_Body): Do not special-case instances
1278 that are compilation units.
1279 (Add_Pending_Instantiation): Likewise.
1280 (Instantiate_Body): Skip instantiations that are compilation
1281 units and have already been performed.
1282 * sem_ch12.adb (Needs_Body_Instantiated): Do not special-case
1283 instances that are compilation units.
1284 (Load_Parent_Of_Generic): Be prepared for parent that is a
1285 compilation unit but whose instantiation node has not been
1288 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1290 * inline.adb (Initialize, Lock): Deal with
1291 Called_Pending_Instantiations.
1293 2019-08-19 Ed Schonberg <schonberg@adacore.com>
1295 * sem_ch6.adb (Check_Synchronized_Overriding): Complete
1296 predicate that applies legality check in 9.4 (11.9/2): if an
1297 inherited subprogram is implemented by a protected procedure or
1298 entry, its first paarameter must be out, in_out or
1301 2019-08-19 Javier Miranda <miranda@adacore.com>
1304 * exp_atag.ads, exp_atag.adb (Build_Inherit_Predefined_Prims):
1305 Adding formal to specify how many predefined primitives are
1306 inherited from the parent type.
1307 * exp_disp.adb (Number_Of_Predefined_Prims): New subprogram.
1308 (Make_Secondary_DT): Compute the number of predefined primitives
1309 of all tagged types (including tagged types not defined at
1310 library level). Previously we unconditionally relied on the
1311 Max_Predef_Prims constant value when building the dispatch
1312 tables of tagged types not defined at library level (thus
1313 consuming more memory for their dispatch tables than required).
1314 (Make_DT): Compute the number of predefined primitives that must
1315 be inherited from their parent type when building the dispatch
1316 tables of tagged types not defined at library level. Previously
1317 we unconditionally relied on the Max_Predef_Prims constant value
1318 when building the dispatch tables of tagged types not defined at
1319 library level (thus copying more data than required from the
1322 2019-08-19 Bob Duff <duff@adacore.com>
1324 * sem_ch13.adb (Record_Hole_Check): Procedure to check for holes
1325 that incudes processing type extensions. A type extension is
1326 processed by first calling Record_Hole_Check recursively on the
1327 parent type to compute the bit number after the last component
1330 2019-08-19 Gary Dismukes <dismukes@adacore.com>
1332 * checks.adb (Length_Mismatch_Info_Message): New function in
1333 Selected_Length_Checks to return a message indicating the
1334 element counts for the mismatched lengths for a failed
1335 compile-time length check.
1336 (Plural_Or_Singular_Ending): Support function in
1337 Length_Mismatch_Info_Message to return either "" or "s", for
1338 concatenating to the end of words.
1339 (Selected_Length_Checks): Pass the result of
1340 Length_Mismatch_Info_Message as an extra warning message to
1341 Compile_Time_Constraint_Error to indicate the mismatched lengths
1342 for a failed compile-time length check.
1343 * sem_util.ads (Compile_Time_Constraint_Error): Add an optional
1344 message formal (Extra_Msg), defaulted to the empty string.
1345 * sem_util.adb (Compile_Time_Constraint_Error): Output an extra
1346 message following the main warning message (when Extra_Msg is
1347 not the empty string).
1349 2019-08-19 Patrick Bernardi <bernardi@adacore.com>
1351 * socket.c: Removed the redefinition of getaddrinfo, getnameinfo
1352 and freeaddrinfo to internal VxWorks kernel calls because they
1353 are, well, internal kernel calls and cannot be called from RTPs.
1354 VxWorks provides the necessary components to call these routines
1357 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1359 * exp_dist.adb (Is_Generic_Actual_Subtype): New predicate.
1360 (Build_From_Any_Call, Build_To_Any_Call, Build_TypeCode_Call):
1361 Use it instead of Is_Generic_Actual_Type flag to detect subtypes
1362 representing generic actual types.
1364 2019-08-19 Ed Schonberg <schonberg@adacore.com>
1366 * sem_warn.adb (Check_References, Generic_Body_Formal): When a
1367 formal parameter of a generic subprogram is not referenced in
1368 the body, place the corresponding warning on the corresponding
1369 entity in the specification of the generic body, as is done for
1370 non-generic subprograms.
1372 2019-08-19 Bob Duff <duff@adacore.com>
1374 * errout.ads (Size_Too_Small_Message): New constant.
1375 * errout.adb, freeze.adb, sem_ch13.adb: Use it.
1377 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1379 * exp_dist.adb (Build_Package_Stubs): Do not specifically visit
1380 the declarations of an N_Subprogram_Instantiation node.
1382 2019-08-19 Bob Duff <duff@adacore.com>
1384 * doc/gnat_ugn/gnat_utility_programs.rst: Document missing
1387 2019-08-19 Piotr Trojanek <trojanek@adacore.com>
1389 * sem_ch12.adb (Get_Unit_Instantiation_Node): Simplify Nkind_In
1391 * sem.adb (Depends_On_Main): Whitespace cleanup; only assign a
1392 local variable if needed.
1394 2019-08-19 Claire Dross <dross@adacore.com>
1396 * sem_spark.ads, sem_spark.adb (Is_Pledge_Function): New
1397 parameter of the generic. Function used to decide whether a
1398 function is a pledge function.
1399 (Check_Not_Borrowed): Disable check inside the second parameter
1400 of a pledge function for the path borrowed by the first
1401 parameter. Also disable checks for entities inside a Global
1404 2019-08-19 Joffrey Huguet <huguet@adacore.com>
1406 * libgnat/a-cfdlli.ads, libgnat/a-cfhama.ads,
1407 libgnat/a-cfinve.ads, libgnat/a-cforma.ads,
1408 libgnat/a-cofove.ads, libgnat/a-cofuma.ads,
1409 libgnat/a-cofuve.ads: Add formal function parameter "=" (L, R :
1410 Element_Type) to the generic packages.
1412 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1414 * opt.ads: Clean up left-overs of earlier implementation in
1417 2019-08-19 Ed Schonberg <schonberg@adacore.com>
1419 * sem_ch3.adb (Derived_Enumeration_Type): Do no freeze anonymous
1420 base type if the bounds in the derived type declaration are
1421 literals of the type.
1423 2019-08-19 Yannick Moy <moy@adacore.com>
1425 * sem_res.adb (Resolve_Call): Check non-aliasing rules before
1428 2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
1430 * inline.adb (Add_Inlined_Body): Do not add pending
1432 * sem_ch12.adb (Needs_Body_Instantiated): New predicate.
1433 (Analyze_Package_Instantiation): Use it to decide whether to add
1434 a pending instantiation for the body of the package.
1436 2019-08-19 Olivier Hainque <hainque@adacore.com>
1438 * gcc-interface/trans.c (Acc_Loop_to_gnu): Return the openacc
1439 BIND_EXPR node we have constructed on purpose. Remove unused
1442 2019-08-19 Pierre-Marie de Rodat <derodat@adacore.com>
1444 * gcc-interface/lang.opt (fdump-scos): Define.
1445 * gcc-interface/misc.c (gnat_handle_option): Handle
1448 2019-08-14 Joffrey Huguet <huguet@adacore.com>
1450 * libgnat/a-cofuba.ads: Add a Length attribute to type
1451 Container. Add a type Array_Base which replaces the previous
1452 Elements attribute of Container.
1453 (Content_Init): New subprogram. It is used to initialize the
1454 Base attribute of Container.
1455 * libgnat/a-cofuba.adb (Resize): New subprogram. It is used to
1456 resize the underlying array of a container if necessary.
1457 (=, <=, Find, Get, Intersection, Length, Num_Overlaps, Set,
1458 Union): Update to match changes in type declarations.
1459 (Add): Modify body to damp the time and space cost in a specific
1461 (Content_Init): New subprogram. It is used to initialize the
1462 Base attribute of Container.
1463 (Remove): Modify body to damp the time and space cost in a
1466 2019-08-14 Bob Duff <duff@adacore.com>
1468 * sem_ch13.adb (Get_Alignment_Value): Return 1 for Alignment 0,
1469 and do not give an error.
1470 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Update the
1471 corresponding documentation.
1472 * gnat_rm.texi: Regenerate.
1474 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1476 * inline.adb (Add_Pending_Instantiation): Fix off-by-one error
1477 in the comparison against the maximum number of instantiations.
1479 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1481 * inline.adb (Add_Pending_Instantiation): Use greater-or-equal
1482 in the comparison against the maximum number of instantiations.
1484 2019-08-14 Ed Schonberg <schonberg@adacore.com>
1486 * sem_aux.adb (Next_Rep_Item): If a node in the rep chain
1487 involves a Ghost aspect it may have been replaced by a null
1488 statement; use the original node to find next Rep_Item.
1489 * repinfo.adb (List_Entities): Do not list an Ignored
1490 Ghost_Entity, for which information may have been deleted.
1492 2019-08-14 Bob Duff <duff@adacore.com>
1494 * sem_prag.ads, sem_prag.adb
1495 (Process_Compile_Time_Warning_Or_Error): In parameterless
1496 version, improve detection of whether we are in a generic unit
1497 to cover the case of an instance within a generic unit.
1498 (Process_Compile_Time_Warning_Or_Error): Rename the
1499 two-parameter version to be
1500 Validate_Compile_Time_Warning_Or_Error, and do not export it.
1501 Issue a warning if the condition is not known at compile time.
1502 The key point is that the warning must be given only for pragmas
1503 deferred to the back end, because the back end discovers
1504 additional values that are known at compile time. Previous
1505 changes in this ticket have enabled this by deferring to the
1506 back end without checking for special cases such as 'Size.
1507 (Validate_Compile_Time_Warning_Or_Error): Rename to be
1508 Defer_Compile_Time_Warning_Error_To_BE.
1509 * warnsw.ads, warnsw.adb (Warn_On_Unknown_Compile_Time_Warning):
1510 Add new switches -gnatw_c and -gnatw_C to control the above
1512 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1513 Document new switches.
1514 * gnat_ugn.texi: Regenerate.
1516 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1518 * sem_ch12.adb (Might_Inline_Subp): Rework comment and restrict
1519 the shortcut based on Is_Inlined to the back-end inlining case.
1521 2019-08-14 Bob Duff <duff@adacore.com>
1523 * inline.adb (Check_And_Split_Unconstrained_Function): Ignore
1524 protected functions to get rid of spurious error. The
1525 transformation done by this procedure triggers legality errors
1526 in the generated code in this case.
1528 2019-08-14 Bob Duff <duff@adacore.com>
1530 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Defer
1531 processing to the back end in all cases where the pragma's
1532 condition is not known at compile time during the front end
1533 (except in generics), as opposed to detecting 'Size attributes
1534 and the like. This ensures that we take advantage of whatever
1535 can be compile-time known after running the back end, as opposed
1536 to having the front end guess what the back end can do. Remove
1537 a little duplicated code at the call site.
1538 * gnat1drv.adb (Post_Compilation_Validation_Checks): Unlock the
1539 Elists while in Validate_Compile_Time_Warning_Errors, because it
1540 does analysis and name resolution, which sometimes involves
1543 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1545 * einfo.ads (Is_Called): Document new usage on E_Package
1547 * einfo.adb (Is_Called): Accept E_Package entities.
1548 (Set_Is_Called): Likewise.
1549 * exp_ch6.adb (Expand_Call_Helper): Move code dealing with
1550 instances for back-end inlining to Add_Inlined_Body.
1551 * inline.ads: Remove with clauses for Alloc and Table.
1552 (Pending_Instantiations): Move to...
1553 * inline.adb: Add with clauses for Alloc, Uintp, Table and
1555 (Backend_Instances): New variable.
1556 (Pending_Instantiations): ...here.
1557 (Called_Pending_Instantiations): New table.
1558 (Node_Table_Size): New constant.
1559 (Node_Header_Num): New subtype.
1560 (Node_Hash): New function.
1561 (To_Pending_Instantiations): New hash table.
1562 (Add_Inlined_Body): Bail out early for subprograms in the main
1563 unit or subunit. Likewise if the Is_Called flag is set. If the
1564 subprogram is an instance, invoke Add_Inlined_Instance. Call
1565 Set_Is_Called earlier. If the subrogram is within an instance,
1566 invoke Add_Inlined_Instance. Also deal with the case where the
1567 call itself is within an instance.
1568 (Add_Inlined_Instance): New procedure.
1569 (Add_Inlined_Subprogram): Remove conditions always fulfilled.
1570 (Add_Pending_Instantiation): Move the defence against ludicruous
1571 number of instantiations to here. When back-end inlining is
1572 enabled, associate an instantiation with its index in table and
1573 mark a few selected kinds of instantiations as always needed.
1574 (Initialize): Set Backend_Instances to No_Elist.
1575 (Instantiate_Body): New procedure doing the work extracted
1577 (Instantiate_Bodies): ...here. When back-end inlining is
1578 enabled, loop over Called_Pending_Instantiations instead of
1579 Pending_Instantiations.
1580 (Is_Nested): Minor tweak.
1581 (List_Inlining_Info): Also list the contents of
1583 * sem_ch12.adb (Might_Inline_Subp): Return early if Is_Inlined
1584 is set and otherwise set it before returning true.
1585 (Analyze_Package_Instantiation): Remove the defence against
1586 ludicruous number of instantiations. Invoke
1587 Remove_Dead_Instance instead of doing the removal manually if
1588 there is a guaranteed ABE.
1590 2019-08-14 Gary Dismukes <dismukes@adacore.com>
1592 * exp_ch3.adb (Predef_Spec_Or_Body): For an equality operation
1593 of an interface type, create an expression function (that
1594 returns False) rather than declaring an abstract function.
1595 * freeze.adb (Check_Inherited_Conditions): Set Needs_Wrapper to
1596 False unconditionally at the start of the loop creating wrappers
1597 for inherited operations.
1599 2019-08-14 Bob Duff <duff@adacore.com>
1601 * table.adb: Assert that the table is not locked when increasing
1602 Last, even if it doesn't cause reallocation. In other words,
1603 assert that on operations that MIGHT cause reallocation.
1604 * table.ads: Fix comment accordingly.
1606 2019-08-14 Arnaud Charlet <charlet@adacore.com>
1608 * doc/gnat_ugn/gnat_and_program_execution.rst: Remove
1609 documentation of gnatelim.
1611 2019-08-14 Bob Duff <duff@adacore.com>
1613 * sem_prag.adb (Validate_Compile_Time_Warning_Error): Attach the
1614 warning to the Sloc of the first pragma argument, rather than to
1615 the pragma itself. This is to make pragmas processed after the
1616 back end use the same Sloc as pragmas processed earlier, in the
1617 front end. There's no reason for this discrepancy, and it
1618 hinders further work on this ticket.
1620 2019-08-14 Bob Duff <duff@adacore.com>
1622 * sem.ads (Inside_A_Generic): Remove the ??? comment.
1624 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1626 * inline.ads (Pending_Descriptor): Delete.
1627 * inline.adb (Initialize): Do not initialize it.
1628 * sem_ch12.adb (Delay_Descriptors): Delete.
1629 (Analyze_Package_Instantiation): Call
1630 Set_Delay_Subprogram_Descriptors instead of Delay_Descriptors
1633 2019-08-14 Bob Duff <duff@adacore.com>
1635 * exp_aggr.adb (Init_Hidden_Discriminants): Avoid processing the
1636 wrong discriminant, which could be of the wrong type.
1638 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1640 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
1641 the Is_Generic_Instance flag previously set on the package
1642 generated for the instantiation of a generic subprogram.
1644 2019-08-14 Ed Schonberg <schonberg@adacore.com>
1646 * exp_ch4.adb (Expand_N_Quantified_Expression): Freeze
1647 explicitly the type of the loop parameter.
1649 2019-08-14 Javier Miranda <miranda@adacore.com>
1651 * sem_util.adb (New_Copy_Tree.Copy_Node_With_Replacement):
1652 Update the Chars attribute of identifiers.
1654 2019-08-14 Yannick Moy <moy@adacore.com>
1656 * sem_spark.adb, sem_spark.ads (Is_Legal): New function exposed
1657 for use in GNATprove, to test legality rules not related to
1659 (Check_Declaration_Legality): Extract the part of
1660 Check_Declaration that checks rules not related to permissions.
1661 (Check_Declaration): Call the new Check_Declaration_Legality.
1662 (Check_Type_Legality): Rename of Check_Type. Introduce
1663 parameters to force or not checking, and update a flag detecting
1665 (Check_Node): Ignore attribute references in statement position.
1667 2019-08-14 Yannick Moy <moy@adacore.com>
1669 * sem_spark.adb (Check_Old_Loop_Entry): New procedure to check
1670 correct use of Old and Loop_Entry.
1671 (Check_Node): Check subprogram contracts.
1672 (Check_Pragma): Check Loop_Variant.
1673 (Check_Safe_Pointers): Apply checking to library-level
1674 subprogram declarations as well, in order to check their
1677 2019-08-14 Yannick Moy <moy@adacore.com>
1679 * sem_spark.adb (Is_Subpath_Expression): Take into account
1680 conversion and qualification.
1682 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1684 * sem_ch7.adb (Install_Private_Declarations)
1685 <Swap_Private_Dependents>: Do not rely solely on the
1686 Is_Child_Unit flag on the unit to recurse.
1687 (Uninstall_Declarations) <Swap_Private_Dependents>: New
1688 function. Use it to recurse on the private dependent entities
1691 2019-08-14 Javier Miranda <miranda@adacore.com>
1693 * exp_aggr.adb (Is_CCG_Supported_Aggregate): Return False for
1694 arrays with bounds not known at compile time.
1696 2019-08-14 Ed Schonberg <schonberg@adacore.com>
1698 * sem_util.adb (New_Copy_Tree, Visit_Entity): A quantified
1699 expression includes the implicit declaration of the loop
1700 parameter. When a quantified expression is copied during
1701 expansion, for example when building the precondition code from
1702 the generated pragma, a new loop parameter must be created for
1703 the new tree, to prevent duplicate declarations for the same
1706 2019-08-14 Yannick Moy <moy@adacore.com>
1708 * sem_disp.adb (Check_Dispatching_Operation): Update assertion
1709 for the separate declarations created in GNATprove mode.
1710 * sem_disp.ads (Is_Overriding_Subprogram): Update comment.
1711 * sem_elab.adb (SPARK_Processor): Fix test for checking of
1712 overriding primitives.
1714 2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
1716 * inline.adb (Add_Inlined_Body): Tweak comments.
1717 (List_Inlining_Info): Also list information about non-main
1720 2019-08-14 Gary Dismukes <dismukes@adacore.com>
1722 * sem_ch4.adb (Analyze_Selected_Component): In the case where
1723 the prefix is of a concurrent type, and the selected entity
1724 matching the selector is the first private declaration of the
1725 type (such as the first local variable in a task's body), set
1728 2019-08-14 Piotr Trojanek <trojanek@adacore.com>
1730 * einfo.adb (Is_Generic_Actual_Subprogram): Replace repeated
1731 calls to Ekind with Ekind_In.
1733 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1736 * gcc-interface/trans.c (gigi): Call set_decl_buillt_in_function.
1737 (Call_to_gnu): Use DECL_FE_FUNCTION_CODE instead of DECL_FUNCTION_CODE.
1739 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1741 * ali.ads (Linker_Option_Record): Remove Original_Pos component.
1742 * ali.adb (Scan_ALI): Do not set it.
1744 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1746 * sem_ch3.adb (Build_Derived_Concurrent_Type): Add a couple of
1747 local variables and use them. When the derived type fully
1748 constrains the parent type, rewrite it as a subtype of an
1749 implicit (unconstrained) derived type instead of the other way
1751 (Copy_And_Build): Deal with concurrent types and use predicates.
1752 (Build_Derived_Private_Type): Build the full derivation if
1753 needed for concurrent types too.
1754 (Build_Derived_Record_Type): Add marker comment.
1755 (Complete_Private_Subtype): Use predicates.
1757 2019-08-13 Ed Schonberg <schonberg@adacore.com>
1759 * sem_ch3.adb (Check_Generic_Ancestor): New subprogram,
1760 aubsidiary to Build_Derived_Record_Type. to enforce the rule
1761 that a type extension declared in a generic body cznnot have an
1762 ancestor that is a generic formal (RM 3.9.1 (4/2)). The rule
1763 applies to all ancestors of the type, including interface
1766 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1768 * sem_ch3.adb (Build_Underlying_Full_View): Delete.
1769 (Complete_Private_Subtype): Do not set the full view on the
1770 private subtype here. If the full base is itself derived from
1771 private, do not re-derive the parent type but instead constrain
1772 an existing underlying full view.
1773 (Prepare_Private_Subtype_Completion): Do not get to the
1774 underlying full view, if any. Set the full view on the private
1776 (Process_Full_View): Likewise.
1777 * sem_ch12.adb (Check_Generic_Actuals): Also set
1778 Is_Generic_Actual_Type on the full view if the type of the
1780 (Restore_Private_Views): Also reset Is_Generic_Actual_Type on
1781 the full view if the type of the actual is private.
1782 * sem_eval.adb (Subtypes_Statically_Match): Remove bypass for
1783 generic actual types.
1785 2019-08-13 Javier Miranda <miranda@adacore.com>
1787 * sem_res.adb (Resolve_Selected_Component): When the type of the
1788 component is an access to a class-wide type and the type of the
1789 context is an access to a tagged type the relevant type is that
1790 of the component (since in such case we may need to generate
1791 implicit type conversions or dispatching calls).
1793 2019-08-13 Ed Schonberg <schonberg@adacore.com>
1795 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Preanalyze
1796 expression, rather do a full analysis, to prevent unwanted
1797 removal of side effects which mask the intent of the expression.
1799 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1801 * impunit.adb (Non_Imp_File_Names_95): Add
1802 GNAT.Branch_Prediction.
1804 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1806 * exp_ch6.adb: Remove with and use clauses for Sem_Ch12.
1807 (Expand_Call_Helper): Swap the back-end inlining case and the
1808 special front-end expansion case. In back-end inlining mode, do
1809 not invoke Add_Inlined_Body unless the call may be inlined.
1810 * inline.ads (Add_Pending_Instantiation): New function moved
1812 * inline.adb (Add_Inlined_Body): Simplify comment. Turn test on
1813 the enclosing unit into assertion.
1814 (Add_Pending_Instantiation): New function moved from...
1815 * sem_ch12.ads (Add_Pending_Instantiation): ...here.
1816 * sem_ch12.adb (Add_Pending_Instantiation): ...here.
1818 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1820 * sem.adb (Do_Analyze): Recompute Style_Check_Max_Line_Length
1821 after restoring Style_Max_Line_Length.
1823 2019-08-13 Arnaud Charlet <charlet@adacore.com>
1825 * sem_ch13.adb (Check_Iterator_Functions): Protect against
1828 2019-08-13 Ed Schonberg <schonberg@adacore.com>
1830 * sem_ch8.adb (Analyze_Subprogram_Renaming): Do no suppress mode
1831 conformance checks on child unit instance that is a compilation
1834 2019-08-13 Gary Dismukes <dismukes@adacore.com>
1836 * exp_dbug.adb (Fully_Qualify_Name): Add full name qualification
1837 for the E_Exception case.
1839 2019-08-13 Gary Dismukes <dismukes@adacore.com>
1841 * exp_aggr.adb (Aggr_Size_OK): Compute the aggregate size using
1842 universal arithmetic, to avoid situations where the size
1843 computation overflows.
1845 2019-08-13 Justin Squirek <squirek@adacore.com>
1847 * repinfo.adb (List_Scalar_Storage_Order): Modify conditionals
1848 for displaying ordering to always be triggered when -gnatR4 is
1851 2019-08-13 Justin Squirek <squirek@adacore.com>
1853 * aspects.adb, aspects.ads: Register new aspect.
1854 * par-prag.adb (Prag): Register new pragma
1855 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing
1856 for new aspect similar to Aspect_Max_Entry_Queue_Length.
1857 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new
1858 pragma and set it to use the same processing as
1859 Pragma_Max_Queue_Length.
1860 * snames.ads-tmpl: Move definition of
1861 Name_Max_Entry_Queue_Length so that it can be processed as a
1862 pragma in addition to a restriction and add an entry for the
1865 2019-08-13 Yannick Moy <moy@adacore.com>
1867 * sem_ch4.adb (Analyze_Allocator): Do not insert subtype
1868 declaration for allocator inside a spec expression.
1870 2019-08-13 Yannick Moy <moy@adacore.com>
1872 * sem_res.adb (Resolve_Call): Do not inline calls inside record
1875 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1877 * sem_ch4.adb (Analyze_One_Call): Remove bypass for type
1878 mismatch in nested instantiations.
1879 * sem_ch8.adb (Find_Nearer_Entity): New function.
1880 (Find_Renamed_Entity): Use it to disambiguate the candidates for
1881 the renaming generated for an instantiation when it is
1884 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1886 * gnat1drv.adb (Adjust_Global_Switches): Do not set
1887 Back_End_Inlining in ASIS mode either.
1889 2019-08-13 Olivier Hainque <hainque@adacore.com>
1891 * libgnat/s-win32.ads: Define size_t and fix the MapViewOfFile
1892 binding to use it instead of DWORD for the dwNumberOfBytesToMap
1894 * libgnat/g-sercom__mingw.adb (Read): State which definition of
1895 size_t to fetch in call to Last_Index.
1897 2019-08-13 Arnaud Charlet <charlet@adacore.com>
1899 * gcc-interface/Make-lang.in: Remove unused TRACE variable. Pass
1900 LN_S to relevant gnatlib targets.
1901 * gcc-interface/Makefile.in: Systematically pass LN_S to
1902 relevant gnatlib targets.
1904 2019-08-13 Yannick Moy <moy@adacore.com>
1906 * sem_dim.adb (Analyze_Dimension,
1907 Analyze_Dimension_Array_Aggregate, Analyze_Dimension_Call,
1908 Analyze_Dimension_Extension_Or_Record_Aggregate): Return
1909 immediately when inside an inlined body.
1910 * sem_res.adb (Resolve_Call): Remove special checking now done
1911 inside Analyze_Dimension_Call.
1913 2019-08-13 Justin Squirek <squirek@adacore.com>
1915 * exp_ch4.adb (Expand_N_Allocator): Add condition to detect
1916 library-level object declarations
1918 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1920 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
1921 (-gnateT): Document Double_Float_Alignment parameter and fix
1922 description of Double_Scalar_Alignment parameter.
1923 * gnat_ugn.texi: Regenerate.
1925 2019-08-13 Eric Botcazou <ebotcazou@adacore.com>
1927 * exp_ch6.adb (Expand_Call_Helper): If back-end inlining is
1928 enabled, also instantiate the body of a generic unit containing
1929 a subprogram subject to aspect/pragma Inline_Always at
1930 optimization level zero.
1931 * sem_ch12.adb (Might_Inline_Subp): Minor tweak.
1932 (Analyze_Package_Instantiation): Do not instantiate the package
1933 body because of inlining considerations if the instantiation is
1934 done in a generic unit. Move around similar condition involving
1935 the main unit. Add test on Back_End_Inlining to processing for
1938 2019-08-13 Javier Miranda <miranda@adacore.com>
1940 * exp_disp.adb (Make_Secondary_DT): Handle record type
1941 derivations that have interface components located at fixed
1942 positions and interface components located at variable offset.
1943 The offset of components located at fixed positions is computed
1944 using the dummy object (similar to the case where all the
1945 interface components are located at fixed positions).
1946 (Make_DT): Build the dummy object for all tagged types that
1947 implement interface types (that is, build it also for types with
1948 variable size components), and use the dummy object to compute
1949 the offset of all tag components located at fixed positions when
1950 initializing the Interface_Table object.
1952 2019-08-13 Justin Squirek <squirek@adacore.com>
1954 * gnatcmd.adb (GNATCmd): Add constant for new compiler switch
1955 --help-ada, and include usage subprogram. Add line to usage help
1956 explaining the new flag.
1957 (GNATCmd_Usage): Rename from locally declared Usage so as not to
1958 confuse with the newly imported version. Add new argument case
1959 for --help-ada and add bug report email to implicit display of
1960 help without the --help flag so as to unify output between the
1963 2019-08-13 Dmitriy Anisimkov <anisimko@adacore.com>
1965 * libgnat/g-comlin.adb (Getopt): Quote unrecognized switch in
1966 Invalid_Switch exception message.
1968 2019-08-13 Yannick Moy <moy@adacore.com>
1970 * sem_util.adb (Traverse_More_Func): Take into account
1971 Loop_Actions inside N_Iterated_Component_Association nodes.
1972 * sinfo.ads: Document correctly Loop_Actions as a field of nodes
1973 of kind N_Iterated_Component_Association.
1975 2019-08-13 Claire Dross <dross@adacore.com>
1977 * libgnat/a-cfinve.adb, libgnat/a-cofove.adb (Find_Index,
1978 Reverse_Find_Index): Use bigger type to avoid range check
1979 failure at the last loop iteration.
1981 2019-08-12 Dmitriy Anisimkov <anisimko@adacore.com>
1983 * libgnat/g-socket.adb (Is_IPv6_Address): Check that no less
1984 then 2 colons in IPv6 numeric address.
1986 2019-08-12 Dmitriy Anisimkov <anisimko@adacore.com>
1988 * libgnat/g-comlin.ads, libgnat/g-comlin.adb (Getopt): Add
1989 parameter Quiet. Need to do not output error messages to
1990 console. Invalid_Switch exception generation surrounded by an
1993 2019-08-12 Ed Schonberg <schonberg@adacore.com>
1995 * exp_ch6.adb (Expand_Actuals. Add_Call_By_Copy_Code): Add code
1996 to generate proper checks when an actual for an in-out or out
1997 parameter has a non-null access type. No constraints are
1998 applied to an inbound access parameter, but on exit a not-null
1999 check must be performed if the type of the actual requires it.
2001 2019-08-12 Ed Schonberg <schonberg@adacore.com>
2003 * sem_util.adb (Is_Expaned_Priority_Attribute): Check whether
2004 call comes from a rewritten attribute before comparing name with
2005 Get_Ceiling run-time subprogram.
2007 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2009 * exp_util.ads (Component_May_Be_Bit_Aligned): Small comment
2011 (Possible_Bit_Aligned_Component): Likewise.
2012 (Type_May_Have_Bit_Aligned_Components): Likewise.
2013 * exp_util.adb (Component_May_Be_Bit_Aligned): Likewise.
2014 (Possible_Bit_Aligned_Component): Likewise.
2015 (Type_May_Have_Bit_Aligned_Components): Likewise.
2017 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2019 * exp_ch4.adb (Expand_N_Op_Eq): Expand the array equality if
2020 either operand is a possibly unaligned slice.
2021 * exp_ch6.adb (Expand_Simple_Function_Return): Do not generate a
2022 copy for a possibly unaligned object if it is represented as a
2024 * exp_util.adb (Is_Possibly_Unaligned_Slice): Do not always
2025 return false if the target doesn't have strict alignment.
2027 2019-08-12 Bob Duff <duff@adacore.com>
2029 * sem_ch12.adb (Instantiate_Package_Body): Remove suppression of
2030 checks in instances of internal units.
2031 * sem_ch6.adb (Analyze_Function_Return): Do not generate a
2032 constraint check on an extended_return_statement if the subtype
2033 of the return object in the statement is identical to the return
2034 subtype of the function.
2036 2019-08-12 Bob Duff <duff@adacore.com>
2038 * libgnat/a-cbmutr.adb (Is_Reachable): Declare Idx to be of the
2039 base subtype. Clearly it makes no sense to loop "while Idx >=
2040 0", if Idx is of a nonnegative subtype.
2042 2019-08-12 Bob Duff <duff@adacore.com>
2044 * libgnat/a-tifiio.adb (Put_Scaled): Prevent AA from being
2045 negative, since Field is range 0 .. something.
2047 2019-08-12 Bob Duff <duff@adacore.com>
2049 * doc/gnat_ugn/gnat_utility_programs.rst (gnatmetric, gnatpp,
2050 gnatstub): Remove documentation for Ada language version
2051 switches, and note that they are no longer needed.
2053 2019-08-12 Gary Dismukes <dismukes@adacore.com>
2055 * sem_ch5.adb (Prepare_Param_Spec_Loop): Set the parents of the
2056 copied low and high bounds in the case where the loop range is
2057 given by a discrete_subtype_indication, to prevent hanging (or
2058 Assert_Failure) in Insert_Actions.
2060 2019-08-12 Ed Schonberg <schonberg@adacore.com>
2062 * sem_ch6.adb (heck_Untagged_Equality): Verify that user-defined
2063 equality has the same profile as the predefined equality before
2064 applying legality rule in RM 4.5.2 (9.8).
2066 2019-08-12 Bob Duff <duff@adacore.com>
2068 * libgnat/a-except.ads: Update obsolete comment, still making
2069 clear that this is a variant. Add explicit default for Id
2070 component of Exception_Occurrence, because that value is used.
2071 Define Null_Occurrence less redundantly.
2072 * libgnat/a-einuoc.adb: Minor simplification of code.
2074 2019-08-12 Justin Squirek <squirek@adacore.com>
2076 * libgnat/a-dhfina.adb, libgnat/a-dhfina.ads (Is_Simple_Name,
2077 Is_Root_Directory, Is_Parent_Directory,
2078 Is_Current_Directory_Name, Is_Relative_Name, Initial_Directory,
2079 Relative_Name, Compose): Add implementation and documentation.
2080 * libgnat/a-direct.adb (Containing_Directory): Modify routine to
2081 use routines from Ada.Directories.Hierarchical_File_Names and
2082 remove incorrect special case for parent directories.
2083 (Fetch_Next_Entry): Add check for current directory and parent
2084 directory and ignore them under certain circumstances.
2085 (Simple_Nmae): Add check for null result from
2086 Simple_Name_Internal and raise Name_Error.
2087 (Simple_Name_Internal): Add explicit check for root directories,
2088 sanitize trailing directory separators, and modify behavior so
2089 that current and parent directories are considered valid
2091 * Makefile.rtl: Add entry to GNATRTL_NONTASKING_OBJS.
2093 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2095 * freeze.adb (Freeze_Entity): Give the same error for an
2096 Object_Size clause on a variable-sized type as for a Size
2099 2019-08-12 Gary Dismukes <dismukes@adacore.com>
2101 * sem_prag.adb (Analyze_Pragma, Pragma_Suppress_Initialization):
2102 For private types, set the Suppress_Initialization flag on the
2103 Full_View of the entity rather than the entity's base type.
2105 2019-08-12 Yannick Moy <moy@adacore.com>
2107 * aspects.adb, aspects.ads (Aspect_No_Caching): New aspect.
2108 * contracts.adb, contracts.ads (Add_Contract_Item): Add handling
2110 (Analyze_Object_Contract): Add handling of No_Caching.
2111 * einfo.adb, einfo.ads
2112 (Get_Pragma): Add handling of No_Caching.
2113 * doc/gnat_rm/implementation_defined_aspects.rst,
2114 doc/gnat_rm/implementation_defined_pragmas.rst: Document new
2116 * gnat_rm.texi: Regenerate.
2117 * par-prag.adb (Prag): New pragma Pragma_No_Caching.
2118 * sem_ch13.adb (Analyze_Aspect_Specifications,
2119 Check_Aspect_At_Freeze_Point): Add handling of No_Caching.
2120 * sem_prag.adb (Analyze_Pragma): Deal with pragma No_Caching.
2121 * sem_prag.ads (Analyze_External_Property_In_Decl_Part): Now
2122 applies to No_Caching.
2123 * sem_util.adb, sem_util.ads (Is_Effectively_Volatile): Add
2124 handling of No_Caching.
2125 (No_Caching_Enabled): New query function.
2126 * snames.ads-tmpl: New names for pragma.
2128 2019-08-12 Yannick Moy <moy@adacore.com>
2130 * sem_util.adb, sem_util.ads (Traverse_More_Func,
2131 Traverse_More_Proc): Add formal parameter for Itypes traversal.
2133 2019-08-12 Yannick Moy <moy@adacore.com>
2135 * exp_attr.adb, exp_attr.ads (Expand_Size_Attribute): New
2136 procedure to share part of the attribute expansion with
2138 (Expand_N_Attribute_Reference): Extract part of the
2139 Size/Object_Size expansion in the new procedure
2140 Expand_Size_Attribute.
2141 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Expand
2142 Size/Object_Size attributes using the new procedure
2143 Expand_Size_Attribute.
2145 2019-08-12 Yannick Moy <moy@adacore.com>
2147 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Only
2148 expand Enum_Rep attribute when its parameter is a literal.
2150 2019-08-12 Justin Squirek <squirek@adacore.com>
2152 * sem_eval.adb (Check_Non_Static_Context): Add a condition to
2153 determine if a range violation constitues a warning or an error.
2154 (Out_Of_Range): Add a condition to determine if a range
2155 violation constitues a warning or an error.
2157 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2159 * exp_ch4.adb (Real_Range_Check): Do not rewrite the conversion
2160 node but its expression instead, after having fetched its
2161 current value. Clear the Do_Range_Check flag on entry. Return
2162 early for a rewritten float-to-float conversion. Remove
2163 redundant local variable. Suppress all checks when inserting
2164 the temporary and do not reanalyze the node.
2166 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2168 * sprint.ads: Minor comment tweak.
2170 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2172 * checks.adb (Insert_Valid_Check): Do not retrieve the
2173 Do_Range_Check flag from the Original_Node but from the
2174 Validated_Object. Remove useless bypass for floating-point
2177 2019-08-12 Yannick Moy <moy@adacore.com>
2179 * sem_util.adb, sem_util.ads (Traverse_More_Func,
2180 Traverse_More_Proc): New traversal subprograms.
2182 2019-08-12 Jerome Lambourg <lambourg@adacore.com>
2184 * libgnarl/s-taprop__vxworks.adb (Abort_Handler): Only call
2185 s-tpopsp.Self when actually needed.
2187 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2189 * exp_ch4.adb (Discrete_Range_Check): Return if checks are
2192 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2194 * sem_res.adb: Add with & use clause for Sem_Mech and
2196 (Resolve_Actuals): Do not apply a scalar range check for the
2197 source of a conversion whose result is passed by reference to a
2200 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2202 * checks.adb (Insert_Valid_Check): Reset the Do_Range_Check flag
2203 on the validated object.
2204 * exp_ch6.adb (Add_Call_By_Copy_Code): Reset the Do_Range_Check
2205 flag on the actual here, as well as on the Expression if the
2206 actual is a N_Type_Conversion node.
2207 (Add_Validation_Call_By_Copy_Code): Generate the incoming range
2208 check if needed and reset the Do_Range_Check flag on the
2209 Expression if the actual is a N_Type_Conversion node.
2210 (Expand_Actuals): Do not reset the Do_Range_Check flag here.
2211 Generate the incoming range check for In parameters here instead
2213 (Expand_Call_Helper): ...here. Remove redudant condition.
2214 * sem_res.adb (Resolve_Actuals): Use local variable A_Typ and
2215 remove obsolete comments.
2216 (Resolve_Type_Conversion): Do not force the Do_Range_Check flag
2217 on the operand if range checks are suppressed.
2219 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
2221 * checks.adb (Activate_Range_Check): Remove redundant argument.
2222 (Generate_Range_Check): Likewise.
2223 (Apply_Float_Conversion_Check): Reset the Do_Range_Check flag on
2224 entry and remove redundant condition.
2226 2019-08-02 Alexandre Oliva <oliva@adacore.com>
2228 * libgnat/a-exexpr.adb (Begin_Handler_v1, End_Handler_v1): New.
2229 (Claimed_Cleanup): New.
2230 (Begin_Handler, End_Handler): Document.
2231 * gcc-interface/trans.c (gigi): Switch to exception handler
2233 (Exception_Handler_to_gnu_gcc): Save the original cleanup
2234 returned by begin handler, pass it to end handler, and use
2235 EH_ELSE_EXPR to pass a propagating exception to end handler.
2236 (gnat_to_gnu): Leave the exception pointer alone for reraise.
2237 (add_cleanup): Handle EH_ELSE_EXPR, require it by itself.
2239 2019-07-23 Ed Schonberg <schonberg@adacore.com>
2241 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations,
2242 Freeze_Entity_Checks): Include Aspect_CPU with other aspects
2243 whose expresssion may depend on a discriminant, and thus require
2244 that components of the type be made visible.
2246 2019-07-23 Eric Botcazou <ebotcazou@adacore.com>
2248 * checks.adb (Convert_And_Check_Range): Add Suppress parameter
2249 and pass it in the call to Insert_Actions. Rename local
2251 (Generate_Range_Check): Minor comment fixes. Pass Range_Check
2252 in the first call to Convert_And_Check_Range and All_Checks in
2254 * exp_ch4.adb (Expand_N_Type_Conversion): Reset the
2255 Do_Overflow_Check flag in the float-to-float case too if there
2256 is also a range check.
2258 2019-07-23 Eric Botcazou <ebotcazou@adacore.com>
2260 * checks.adb (Activate_Overflow_Check): Remove redundant
2262 * exp_ch4.adb (Discrete_Range_Check): Reset the overflow flag.
2263 (Expand_N_Type_Conversion): Do not reset it here.
2265 2019-07-23 Eric Botcazou <ebotcazou@adacore.com>
2267 * repinfo.adb (List_Component_Layout): Pass Decimal to UI_Write.
2268 (Write_Val): Likewise.
2270 2019-07-23 Ed Schonberg <schonberg@adacore.com>
2272 * aspects.ads: New table Operational_Aspect, used to distinguish
2273 between aspects that are view-specific, such as those related to
2274 iterators, and representation aspects that apply to all views of
2276 * aspects.adb (Find_Aspect): If the aspect being sought is
2277 operational, do not ecamine the full view of a private type to
2279 * sem_ch5.adb (Analyze_Iterator_Specification): Improve error
2280 message when the intended domain of iteration does not implement
2281 the required iterator aspects.
2283 2019-07-23 Yannick Moy <moy@adacore.com>
2285 * sem_spark.ads (Is_Local_Context): New function.
2286 * sem_spark.adb (Check_Declaration): Issue errors on violations
2288 (Process_Path): Do not issue error on borrow/observe during
2289 elaboration, as these are caught by the new rule.
2291 2019-07-23 Yannick Moy <moy@adacore.com>
2293 * exp_ch7.adb (Create_Finalizer): Force finalizer not to be
2295 * exp_dbug.adb (Get_External_Name): Explain special case of
2298 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2300 * repinfo.adb (List_Entities): Also list compiled-generated
2301 types present as Etype of objects.
2303 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2305 * sinfo.ads: Update the documentation about the
2306 Do_Division_Check, Do_Overflow_Check and Do_Range_Check flags.
2308 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2310 * exp_ch4.adb (Expand_N_Type_Conversion): Beef up comment.
2311 (Fixup_Universal_Fixed_Operation): Set the base type instead of
2312 the type of the enclosing type conversion on the operation.
2314 2019-07-22 Ed Schonberg <schonberg@adacore.com>
2316 * exp_ch4.adb (Expand_N_In): Do not suggest the use of attribute
2317 'Valid as a replacement for a range check on a discrete type
2318 when the bounds of the range are given by type conversions,
2319 because in such a case there are distinct types involved and the
2320 subbested attribute replacement would be misplaced.
2322 2019-07-22 Yannick Moy <moy@adacore.com>
2324 * sem_spark.adb (Get_Root_Object, Is_Path_Expression,
2325 Is_Subpath_Expression): Add parameter Is_Traversal to adapt
2326 these functions to the case of paths returned from a traversal
2328 (Read_Indexes): Handle the case of an if-expression or
2330 (Check_Statement): Check Emit_Messages only when issuing an
2331 error message. This is important as Emit_Messages may store the
2332 information that an error was detected.
2334 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2336 * checks.adb (Apply_Type_Conversion_Checks): Do not set
2337 Do_Range_Check flag on conversions from fixed-point types
2339 * exp_attr.adb: Add use and with clause for Expander.
2340 (Expand_N_Attribute_Reference) <Fixed_Value, Integer_Value>: Set
2341 the Conversion_OK flag and do not generate overflow/range checks
2343 * exp_ch4.adb (Expand_N_Qualified_Expression): Remove
2344 superfluous clearing of Do_Range_Check flag.
2345 (Discrete_Range_Check): New procedure to generate a range check
2347 (Real_Range_Check): Remove redundant local variable and adjust.
2348 Remove useless shortcut. Clear Do_Range_Check flag on all
2350 (Expand_N_Type_Conversion): Remove redundant test on
2351 Conversion_OK. Call Discrete_Range_Check to generate range
2352 checks on discrete types. Remove obsolete code for
2353 float-to-integer conversions. Add code to generate range checks
2354 for conversions involving fixed-point types.
2356 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2358 * sprint.ads: Fix pasto in comment.
2360 2019-07-22 Javier Miranda <miranda@adacore.com>
2362 * sem_res.adb (Resolve_Actuals): Replace code that displaces the
2363 pointer to an allocated object to reference its secondary
2364 dispatch table by a type conversion (which takes care of
2365 handling all cases).
2367 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2369 * sprint.adb (Sprint_Node_Actual)
2370 <N_Decimal_Fixed_Point_Definition>: Swap a couple of spaces.
2371 (Write_Itype): Minor consistency fixes throughout. Add support
2372 for printing ordinary and decimal fixed-point types and
2375 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2377 * exp_attr.adb (Expand_Loop_Entry_Attribute): Beef up comment.
2379 2019-07-22 Ed Schonberg <schonberg@adacore.com>
2381 * libgnat/s-valboo.ads, libgnat/s-valcha.ads,
2382 libgnat/s-valdec.ads, libgnat/s-valenu.ads,
2383 libgnat/s-valint.ads, libgnat/s-vallld.ads,
2384 libgnat/s-vallli.ads, libgnat/s-valllu.ads,
2385 libgnat/s-valrea.ads, libgnat/s-valuns.ads,
2386 libgnat/s-valwch.ads: Change categorization of packages that
2387 implement attribute 'Value from Pure to Preelaborate, to prevent
2388 undesirable optimizations when the evaluation of the attribute
2389 raises Constraint_Error, but subsequent use of the result of
2390 this evsaluation is removed by a subsequent optimization.
2392 2019-07-22 Ed Schonberg <schonberg@adacore.com>
2394 * sem_warn.adb (Check_References): Do not emit s warning on a
2395 referenced entity with no explicit assignment if the type of the
2396 entity has Preelaborable_Initialixation, such as
2397 Exception_Occurrence.
2399 2019-07-22 Javier Miranda <miranda@adacore.com>
2401 * exp_ch4.adb (Size_In_Storage_Elements): Improve the expansion
2402 to handle array indexes that are modular type.
2403 (Expand_N_Allocator): For 32-bit targets improve the generation
2404 of the runtime check associated with large arrays supporting
2405 arrays initialized with a qualified expression.
2406 * libgnat/s-imenne.adb (Image_Enumeration_8,
2407 Image_Enumeration_16, Image_Enumeration_32): Define the index of
2408 Index_Table with range Natural'First .. Names'Length since in
2409 the worst case all the literals of the enumeration type would be
2410 single letter literals and the Table built by the frontend would
2411 have as many components as the length of the names string. As a
2412 result of this enhancement, the internal tables declared using
2413 Index_Table have a length closer to the real needs, thus
2414 avoiding the declaration of large arrays on 32-bit CCG targets.
2416 2019-07-22 Yannick Moy <moy@adacore.com>
2418 * sem_ch3.adb (Constrain_Access): Issue a message about ignored
2421 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2423 * sem_ch8.adb (End_Use_Type): Reset the In_Use flag on the
2424 class-wide type if the type is tagged.
2425 (Use_One_Type): Add commentary on the handling of the class-wide
2428 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2430 * einfo.ads (Is_For_Access_Subtype): Delete.
2431 (Set_Is_For_Access_Subtype): Likewise.
2432 * einfo.adb (Is_For_Access_Subtype): Likewise.
2433 (Set_Is_For_Access_Subtype): Likewise.
2434 (Write_Entity_Flags): Do not write Is_For_Access_Subtype.
2435 * exp_ch4.adb (Expand_N_Selected_Component): Do not deal with
2437 * exp_spark.adb (Expand_SPARK_N_Selected_Component): Likewise.
2438 * sem_ch4.adb (Analyze_Explicit_Dereference): Likewise.
2439 * sem_ch3.adb (Build_Discriminated_Subtype): Do not build a
2440 special private subtype for access-to-record subtypes.
2442 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2444 * sem_ch3.adb (Complete_Private_Subtype): Rework the setting of
2445 the Etype of the full view for full base types that cannot
2446 contain any discriminant. Remove code and comment about it in
2449 2019-07-22 Ed Schonberg <schonberg@adacore.com>
2451 * sem_ch3.adb (Convert_Bound): Subsidiary of
2452 Floating_Point_Type_Declaration, to handle properly range
2453 specifications with bounds that may include static constants of
2454 a given type rather than real literals.
2456 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2458 * sem_aggr.adb (Rewrite_Bound): Be prepared for discriminals
2460 (Rewrite_Range;): Minor tweak.
2461 (Resolve_Record_Aggregate): For a component with default
2462 initialization whose expression is an array aggregate, also
2463 rewrite the bounds of the component associations, if any.
2465 2019-07-22 Gary Dismukes <dismukes@adacore.com>
2467 * exp_ch5.adb (Expand_N_Case_Statement): In the case where a
2468 case statement is rewritten as an equivalent if statement,
2469 inherit the From_Condition_Expression flag from the case
2472 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2474 * sem_ch8.adb (Check_Constrained_Object): Further extend the
2475 special optimization to all limited types.
2477 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2479 * exp_attr.adb (Expand_N_Attribute_Reference)
2480 <Attribute_Enum_Val>: Set No_Truncation on the
2481 N_Unchecked_Type_Conversion built around the argument passed to
2484 2019-07-22 Nicolas Roche <roche@adacore.com>
2486 * libgnat/s-valrea.adb (Scan_Real): Ignore non significative
2487 digits to avoid converging to infinity in some cases.
2489 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2491 * libgnat/g-encstr.adb (Encode_Wide_String): Fix oversight.
2492 (Encode_Wide_Wide_String): Likewise.
2494 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2496 * sem_warn.adb (Find_Var): Bail out for a function call with an
2497 Out or In/Out parameter.
2499 2019-07-22 Nicolas Roche <roche@adacore.com>
2501 * terminals.c (__gnat_tty_waitpid): Support both blocking and
2503 * libgnat/g-exptty.ads (Is_Process_Running): New function.
2504 * libgnat/g-exptty.adb (Close): Don't try to interrupt/terminate
2505 a process if it is already dead.
2507 2019-07-22 Ed Schonberg <schonberg@adacore.com>
2509 * freeze.adb (Freeze_Fixed_Point_Type): When freezing a
2510 fixed-point subtype, check whether the parent type declarastion
2511 includes an aspect specification for the 'Small type attribute,
2512 and inherit the specified value.
2514 2019-07-22 Javier Miranda <miranda@adacore.com>
2516 * freeze.adb (Freeze_Subprogram): Check that C++ constructors
2517 must have external or link name.
2519 2019-07-22 Ed Schonberg <schonberg@adacore.com>
2521 * sem_res.adb (Resolve_Selected_Component): If the prefix has a
2522 deferred reference, generate the correct reference now, to
2523 indicate that the previous assignment is used. This prevents
2524 spurious warnings on useless assignments when compiling with all
2525 warnings enabled. when there is a subsequent call in the same
2526 stqtement list, in which the prefix of the selected component is
2527 the actual for an out parameter.
2529 2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
2531 * exp_attr.adb (Expand_Loop_Entry_Attribute): Copy the condition
2532 of a while loop instead of simply relocating it.
2534 2019-07-18 Arnaud Charlet <charlet@adacore.com>
2536 * Makefile.rtl, expect.c, env.c, aux-io.c, mkdir.c, initialize.c,
2537 cstreams.c, raise.c, tracebak.c, adadecode.c, init.c, raise-gcc.c,
2538 argv.c, adaint.c, adaint.h, ctrl_c.c, sysdep.c, rtinit.c, cio.c,
2539 seh_init.c, exit.c, targext.c: Introduce a "STANDALONE" mode where C
2540 runtime files do not have any dependency on GCC include files.
2541 Remove unnecessary includes.
2542 Remove remaining references to VMS in runtime C file.
2543 * runtime.h: new File.
2545 2019-07-13 Andreas Schwab <schwab@linux-m68k.org>
2547 * Makefile.rtl: Use g-sercom__linux.adb for all linuxes.
2549 2019-07-11 Piotr Trojanek <trojanek@adacore.com>
2551 * lib-writ.adb (Ensure_System_Dependency,
2552 Up_To_Date_ALI_File_Exists, Write_ALI): Replace low-level access
2553 to table with a high-level query.
2555 2019-07-11 Piotr Trojanek <trojanek@adacore.com>
2557 * checks.adb: Fix typo in comment.
2558 * sem.adb (Semantics): Avoid repeated calls to
2559 In_Extended_Main_Source_Unit by reusing an already-cached
2561 * sem_util.adb (First_Global): Fix style.
2563 2019-07-11 Yannick Moy <moy@adacore.com>
2565 * sem_res.adb (Resolve_Call): Do not perform dimensionality
2566 checking on inlined bodies.
2568 2019-07-11 Yannick Moy <moy@adacore.com>
2570 * debug.adb: Flip meaning of debug switch -gnatdF.
2572 2019-07-11 Yannick Moy <moy@adacore.com>
2574 * sem_eval.adb (Is_Same_Value): Add special case for rewritten
2575 Loop_Entry attribute.
2577 2019-07-11 Claire Dross <dross@adacore.com>
2579 * gnat1drv.adb: SPARK checking rules for pointer aliasing are
2580 moved to GNATprove backend.
2581 * sem_spark.ads, sem_spark.adb (Sem_SPARK): Is now a generic
2582 unit. Takes as parameters:
2583 - Retysp which is used to query the most underlying type
2584 visible in SPARK. We do not introduce aliasing checks for
2585 types which are not visibly deep.
2586 - Component_Is_Visible_In_SPARK is used to avoid doing pointer
2587 aliasing checks on components which are not visible in SPARK.
2588 - Emit_Messages returns True in the second phase of SPARK
2589 analysis. Error messages for failed aliasing checks are only
2590 output in this case.
2591 Additionally, errors on constructs not supported in SPARK are
2592 removed as duplicates of marking errors. Components are stored
2593 in the permission map using their original component to avoid
2594 inconsistencies between components of different views of the
2596 (Check_Expression): Handle delta constraints.
2597 (Is_Deep): Exported so that we can check for SPARK restrictions
2598 on deep types inside SPARK semantic checkings.
2599 (Is_Traversal_Function): Exported so that we can check for SPARK
2600 restrictions on traversal functions inside SPARK semantic
2602 (Check_Call_Statement, Read_Indexes): Check wether we are
2603 dealing with a subprogram pointer type before querying called
2605 (Is_Subpath_Expression): Image attribute can appear inside a
2607 (Check_Loop_Statement): Correct order of statements in the loop.
2608 (Check_Node): Ignore raise nodes.
2609 (Check_Statement): Use Last_Non_Pragma to get the object
2610 declaration in an extended return statement.
2612 2019-07-11 Patrick Bernardi <bernardi@adacore.com>
2614 * bindgen.adb (Gen_Main): Do not generate a reference to
2615 Ada_Main_Program_Name when the Minimal_Binder flag is set.
2616 (Gen_Output_File_Ada): Do not output GNAT_Version and
2617 Ada_Main_Program_Name info if Minimal_Binder flag is set.
2618 * bindusg.adb: Add documentation for new -minimal switch.
2619 * gnatbind.adb (Scan_Bind_Arg): Scan -minimal switch.
2620 * opt.ads: Add new global flag Minimal_Binder to indicate if the
2621 binder should not produce global variables.
2622 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
2623 Update documentation with new binder -minimal switch.
2624 * gnat_ugn.texi: Regenerate.
2626 2019-07-11 Eric Botcazou <ebotcazou@adacore.com>
2628 * Makefile.rtl: Add warning note about compilation flags and
2631 2019-07-11 Ed Schonberg <schonberg@adacore.com>
2633 * exp_ch9.adb (Expand_N_Protected_Type_Declaaration): New
2634 subsidiary routine Replace_Access_Definition, to handle properly
2635 a protected type PT one of whose private components is of type
2638 2019-07-11 Dmitriy Anisimkov <anisimko@adacore.com>
2640 * libgnat/g-socket.ads (Level_Type): Add enumerators for
2641 IP_Protocol_For_ICMP, IP_Protocol_For_IGMP,
2642 IP_Protocol_For_RAW_Level.
2643 * libgnat/g-socket.adb (Levels): Handle them.
2644 * s-oscons-tmplt.c: Import socket protocols defined in
2647 2019-07-11 Claire Dross <dross@adacore.com>
2649 * libgnat/a-cfhama.adb, libgnat/a-cfhase.adb (Free): Do not
2650 reset the Has_Element flag if no element is freed.
2652 2019-07-11 Arnaud Charlet <charlet@adacore.com>
2654 * errno.c: Remove obsolete support for MaRTE OS.
2656 2019-07-11 Ed Schonberg <schonberg@adacore.com>
2658 * exp_ch4.adb (Expand_N_Type_Conversion): If a predicate check
2659 is generated, analyze it with range check suppressed, because
2660 that check has been previously applied.
2661 * exp_ch5.adb (Expand_N_Assignment_Statement): If the RHS is a
2662 type conversion to the type of the LHS, do not apply a predicate
2663 check to the RHS because it will have been generated already
2664 during its expansion.
2665 * exp_ch6.adb (Can_Fold_Predicate_Call): Extend processing to
2666 handle a predicate check on a constant entity whose value is
2669 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2671 * bindo.adb: Remove the documentation of switch -d_N because it
2672 is no longer in use.
2673 * bindo-graphs.ads, bindo-graphs.adb (Is_Spec_Before_Body_Edge):
2675 * bindo-writers.adb (Write_Dependency_Edge): Add the missing
2676 case of a spec-before-body edge.
2678 2019-07-11 Dmitriy Anisimkov <anisimko@adacore.com>
2680 * libgnat/g-socket.ads (Mode_Type): Add a Socket_Raw enumerator.
2681 * libgnat/g-socket.adb (Modes): Handle Socket_Raw.
2683 2019-07-11 Justin Squirek <squirek@adacore.com>
2685 * exp_ch9.adb (Build_Private_Protected_Declaration): Add
2686 exception for the moving of pragmas to internally generated
2687 specs for pragma Unreferenced.
2689 2019-07-11 Bob Duff <duff@adacore.com>
2691 * doc/gnat_ugn/gnat_utility_programs.rst: Fix inconsistent
2692 documentation for gnatmetric.
2693 * gnat_ugn.texi: Regenerate.
2695 2019-07-11 Bob Duff <duff@adacore.com>
2697 * doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's
2698 --spaces-only switch.
2700 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2702 * sem_util.adb (Null_Status): Assume that an erroneous construct
2703 has an undefined null status.
2705 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2707 * checks.adb, exp_ch6.adb, gnat1drv.adb, sem_aux.adb,
2708 sem_ch2.adb, sem_ch8.adb, sem_res.adb: Minor reformatting.
2710 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2712 * sem_ch8.adb (Analyze_Object_Renaming): Obtain the object being
2713 renamed using routine Get_Object_Name which takes care of
2715 (Get_Object_Name): New routine.
2717 2019-07-11 Ed Schonberg <schonberg@adacore.com>
2719 * exp_ch6.adb (Can_Fold_Predicate_Call): New function,
2720 subsidiary of Expand_Call_Helper, to compute statically a
2721 predicate check when the argument is a static integer.
2723 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2725 * sem_res.adb (Resolve_Op_Not): Do not rewrite an equality
2726 operator into a function call when the operator is intrinsic.
2728 2019-07-11 Thomas Quinot <quinot@adacore.com>
2730 * sem_prag.adb (Analyze_Pragma, case pragma Check): Do not call
2731 Set_SCO_Pragma_Enabled for the dynamic predicate case.
2733 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2735 * exp_util.ads, exp_util.adb (Needs_Finalization): Move to
2737 * sem_ch9.adb (Analyze_Protected_Definition): Code cleanup. Mark
2738 the protected type as having controlled components when it
2739 contains at least one such component.
2740 * sem_util.ads, sem_util.adb (Needs_Finalization): New
2743 2019-07-11 Eric Botcazou <ebotcazou@adacore.com>
2745 * alloc.ads (Rep_JSON_Table_Initial): New constant.
2746 (Rep_JSON_Table_Increment): Likewise.
2747 * debug.adb: Document -gnatd_j switch.
2748 * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add
2750 * gnat1drv.adb: Add with clause for Repinfo.Input.
2751 Add with and use clauses for Sinput.
2752 (Read_JSON_Files_For_Repinfo): New procedure.
2753 (Gnat1drv1): Deal with -gnatd_j switch.
2754 * repinfo-input.ad[sb]: New unit.
2755 * snames.ads-tmpl (Name_Discriminant): New constant.
2756 (Name_Operands): Likewise.
2758 2019-07-11 Justin Squirek <squirek@adacore.com>
2760 * checks.adb (Apply_Accessibility_Check): Add check for constant
2761 folded conditions on accessibility checks.
2763 2019-07-11 Arnaud Charlet <charlet@adacore.com>
2765 * libgnarl/g-thread.ads, libgnarl/g-thread.adb (Get_Thread):
2766 Update comments. Add new version taking a Task_Id.
2768 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
2770 * bindo.adb: Update the section of switches and debugging
2772 * bindo.ads: Add type Elaboration_Phase.
2773 * bindo-augmentors.adb: Add use clause for
2774 Bindo.Writers.Phase_Writers.
2775 (Augment_Library_Graph): Signal the start and end of the
2777 * bindo-builders.adb: Add with and use clause for Bindo.Writers.
2778 Add use clause for Bindo.Writers.Phase_Writers.
2779 (Build_Invocation_Graph): Signal the start and end of the
2780 invocation graph construction phase.
2781 (Build_Library_Graph): Signal the start and end of the library
2782 graph construction phase.
2783 * bindo-diagnostics.adb: Add use clause for
2784 Bindo.Writers.Phase_Writers.
2785 (Diagnose_Cycle): Signal the start and end of the cycle
2787 * bindo-elaborators.adb: Add use clause for
2788 Bindo.Writers.Phase_Writers.
2789 (Elaborate_Units): Signal the start and end of the unit
2791 * bindo-graphs.adb: Add use clause for
2792 Bindo.Writers.Phase_Writers.
2793 (Find_Components): Signal the start and end of the component
2795 (Find_Cycles): Signal the start and end of the cycle discovery
2797 * bindo-units.adb: Add with and use clause for Bindo.Writers.
2798 Add use clause for Bindo.Writers.Phase_Writers.
2799 (Collect_Elaborable_Units): Signal the start and end of the unit
2801 * bindo-validators.adb: Add with and use clause for
2802 Bindo.Writers. Add use clause for Bindo.Writers.Phase_Writers.
2803 (Validate_Cycles, Validate_Elaboration_Order,
2804 Validate_Invocation_Graph, Validate_Library_Graph): Signal the
2805 start and end of the libray graph validation phase.
2806 * bindo-writers.ads, bindo-writers.adb: Add new nested package
2808 * debug.adb: Update the documentation of switch d_S.
2810 2019-07-11 Yannick Moy <moy@adacore.com>
2812 * sem_res.adb (Check_Argument_Order): Special case calls to
2815 2019-07-10 Dmitriy Anisimkov <anisimko@adacore.com>
2817 * libgnat/s-ststop.adb: Remove System.Strings.Stream_Ops
2818 dependence on System.Streams.Stream_IO.
2820 2019-07-10 Ed Schonberg <schonberg@adacore.com>
2822 * sem_ch2.adb (Analyze_Integer_Literal): Preserve the type of
2823 the literal if prior analysis determined that its type is a
2824 modular integer type.
2826 2019-07-10 Doug Rupp <rupp@adacore.com>
2828 * init.c: Do not attempt to re-arm guard page on x86_64-vx7(r2).
2830 2019-07-10 Ed Schonberg <schonberg@adacore.com>
2832 * sem_ch8.adb (Check_Constrained_Object): A record that is
2833 limited because of the presence of a limited component is
2834 constrained, and no subtype indiciation needs to be created for
2835 it, just as is the case for declared limited records.
2837 2019-07-10 Yannick Moy <moy@adacore.com>
2839 * sem_aux.adb, sem_aux.ads (Is_Protected_Operation): New
2840 function to determine if a subprogram is protected.
2841 * sem_spark.adb (Setup_Protected_Components): New procedure to
2842 add protected components to the environment.
2843 (Check_Callable_Body): Call the new Setup_Protected_Components.
2844 (Check_Package_Spec): Merge local environment with enclosing one
2847 2019-07-10 Claire Dross <dross@adacore.com>
2849 * sem_spark.adb (Check_Expression): Allow digits constraints as
2851 (Illegal_Global_Usage): Pass in the entity.
2852 (Is_Subpath_Expression): New function to allow different nodes
2853 as inner parts of a path expression.
2854 (Read_Indexes): Allow concatenation and aggregates with box
2855 expressions. Allow attributes Update and Loop_Entry.
2856 (Check_Expression): Allow richer membership test.
2857 (Check_Node): Ignore bodies of generics.
2858 (Get_Root_Object): Allow concatenation and attributes.
2860 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2862 * sem_ch6.adb (Check_Discriminant_Conformance): Use Find_Type to
2863 discover the type of a full view discriminant.
2865 2019-07-10 Arnaud Charlet <charlet@adacore.com>
2867 * doc/gnat_ugn/gnat_and_program_execution.rst: Improve gnatmem's
2868 doc for the depth switch.
2870 2019-07-10 Bob Duff <duff@adacore.com>
2872 * doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's
2873 --source-line-breaks switch.
2875 2019-07-10 Justin Squirek <squirek@adacore.com>
2877 * doc/gnat_rm/implementation_defined_attributes.rst: Add mention
2878 of 'Image attribute with 'Img's entry to mention additional
2879 added 2012 usage of Obj'Image.
2880 * doc/gnat_rm/implementation_defined_pragmas.rst: Correct
2881 mispelling of Async_Writers.
2882 * gnat_rm.texi: Regenerate.
2883 * sem_prag.adb (Analyze_Pragma): Correct mispelling of
2885 * sem_util.adb (State_Has_Enabled_Property): Correct mispelling
2888 2019-07-10 Simon Buist <buist@adacore.com>
2890 * sem_util.ads (Child_Prefix): New constant.
2891 * sem_util.adb (Unique_Name): Add a special prefix to child
2892 units that have a nested subprogram or package.
2894 2019-07-10 Arnaud Charlet <charlet@adacore.com>
2896 * sfn_scan.adb (Scan_SFN_Pragmas): Add pragma Assert.
2898 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2900 * sem_ch3.adb (Check_Nonoverridable_Aspects): Correct the
2901 spelling in certain error messages.
2902 (Check_Pragma_Implemented): Correct the spelling in certain
2905 2019-07-10 Eric Botcazou <ebotcazou@adacore.com>
2907 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-brapre.
2908 * libgnat/g-brapre.ads: New package specification.
2909 * doc/gnat_rm/the_gnat_library.rst: Document it.
2910 * gnat_rm.texi: Regenerate.
2912 2019-07-10 Yannick Moy <moy@adacore.com>
2914 * osint-c.adb (Set_File_Name): Always add extension for multiple
2915 units per file mode.
2917 2019-07-10 Corentin Gay <gay@adacore.com>
2919 * sysdep.c: Put include directive for 'vxWorks.h' before any
2920 other VxWorks headers.
2922 2019-07-10 Eric Botcazou <ebotcazou@adacore.com>
2924 * doc/gnat_rm/implementation_defined_attributes.rst
2925 (Scalar_Storage_Order): Minor tweaks. Add note about debuggers.
2926 * gnat_rm.texi: Regenerate.
2928 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2930 * exp_ch4.adb (Expand_N_Case_Expression): Mark the generated
2931 assignments to the temporary result as being OK because the
2932 expansion of case expressions is correct by construction.
2933 (Is_Copy_Type): Update the predicate to match the comment
2936 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2938 * bindo-graphs.adb, bindo.adb, debug.adb, exp_ch6.adb,
2939 sem_ch10.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb,
2940 sem_ch6.adb, sem_ch7.adb, sem_res.adb, sem_spark.adb,
2941 sem_util.adb, warnsw.ads: Minor reformatting.
2943 2019-07-10 Joffrey Huguet <huguet@adacore.com>
2945 * libgnat/a-strbou.ads, libgnat/a-strfix.ads,
2946 libgnat/a-strunb.ads, libgnat/a-strunb__shared.ads: Add global
2947 contracts, contract cases, preconditions and postconditions to
2948 procedures and functions.
2950 2019-07-10 Doug Rupp <rupp@adacore.com>
2952 * sysdep.c (__gnat_is_file_not_found_error): Reformulate to also
2953 work for vxworks7r2 SR0610.
2955 2019-07-10 Doug Rupp <rupp@adacore.com>
2957 * env.c (__gnat_environ): Reformulate to also work for
2960 2019-07-10 Patrick Bernardi <bernardi@adacore.com>
2962 * Makefile.rtl: Handle vxworks7r2 ppc target
2964 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
2966 * bindo.adb: Update the section on switches.
2968 (Add_Cycle, Add_Vertex_And_Complement): Remove.
2969 (Create): The graph no longer needs a set of recorded cycles
2970 because the cycles are not rediscovered in permuted forms.
2971 (Cycle_End_Vertices): New routine.
2972 (Destroy): The graph no longer needs a set of recorded cycles
2973 because the cycles are not rediscovered in permuted forms.
2974 (Destroy_Library_Graph_Vertex): Move to the library level.
2975 (Find_All_Cycles_Through_Vertex, Find_All_Cycles_With_Edge):
2977 (Find_Cycles_From_Successor, Find_Cycles_From_Vertex,
2978 Find_Cycles_In_Component, Has_Elaborate_All_Edge): New routines.
2979 (Insert_And_Sort): Remove.
2980 (Is_Elaborate_Body_Edge): Use predicate
2981 Is_Vertex_With_Elaborate_Body.
2982 (Is_Recorded_Cycle): Remove.
2983 (Is_Vertex_With_Elaborate_Body): New routine.
2984 (Normalize_And_Add_Cycle): Remove.
2985 (Precedence): Rename to xxx_Precedence, where xxx relates to the
2986 input. These versions better reflect the desired input
2988 (Record_Cycle): New routine.
2989 (Remove_Vertex_And_Complement, Set_Is_Recorded_Cycle): Remove.
2990 (Trace_xxx): Update all versions to use debug switch -d_t.
2991 (Trace_Component): New routine.
2992 (Trace_Eol): Removed.
2993 (Trace_Vertex): Do not output the component as this information
2994 is already available when the component is traced.
2995 (Unvisit, Visit): New routine.
2996 * bindo-graphs.ads: Add new instance LGV_Lists. Remove instance
2997 RC_Sets. Update the structure of type Library_Graph_Attributes
2998 to remove the set of recorded cycles.
2999 (Destroy_Library_Graph_Vertex): Move to the library level.
3000 * bindo-writers.adb (Write_Component_Vertices): Output
3001 information about the number of vertices.
3002 * debug.adb: Document the use of binder switch -d_t. Update the
3003 use of binder switch -d_T.
3005 2019-07-10 Yannick Moy <moy@adacore.com>
3007 * sem_spark.adb (Get_Root_Object): Replace precondition by error
3009 (Read_Indexes): Replace precondition by error message.
3010 (Check_Callable_Body): Check only traversal function returns an
3011 anonymous access type.
3012 (Check_Expression): Issue error on unexpected expression as
3014 * sem_util.adb (First_Global): Fix access to global on
3017 2019-07-10 Javier Miranda <miranda@adacore.com>
3019 * exp_ch6.adb (Is_Class_Wide_Interface_Type): New subprogram.
3020 (Expand_Call_Helper): Handle non-limited views when we check if
3021 any formal is a class-wide interface type.
3022 * exp_disp.adb (Expand_Interface_Actuals): Handle non-limited
3023 views when we look for interface type formals to force "this"
3026 2019-07-10 Ed Schonberg <schonberg@adacore.com>
3028 * sem_res.adb (Resolve_Equality_Op): Do not replace the resolved
3029 operator by its alias if expander is not active, because the
3030 operand type may not be frozen yet and its inherited operations
3031 have not yet been created.
3033 2019-07-10 Hristian Kirtchev <kirtchev@adacore.com>
3035 * bindo-elaborators.adb (Elaborate_Units): Set attribute
3036 Elab_Position of all elaborated units.
3037 (Set_Unit_Elaboration_Positions): New routine.
3039 2019-07-10 Gary Dismukes <dismukes@adacore.com>
3041 * exp_util.adb: Reformatting and a typo fix.
3043 2019-07-10 Yannick Moy <moy@adacore.com>
3045 * exp_util.adb (Remove_Side_Effects): Prefer renamings for
3046 objects of possible owning type in GNATprove mode.
3048 2019-07-09 Ed Schonberg <schonberg@adacore.com>
3050 * sem_ch3.adb (Analyze_Object_Declaration): If the object type
3051 is a composite type that has a dynamic predicate and, the
3052 expression in the declaration is an aggregate, the generated
3053 predicate check must appear after the expanded code for the
3054 aggregate, which will appear after the rewritten object
3057 2019-07-09 Justin Squirek <squirek@adacore.com>
3059 * sem_eval.adb (Expr_Value_E): Add conditional to correctly
3060 handle constant enumerated character types.
3062 2019-07-09 Eric Botcazou <ebotcazou@adacore.com>
3064 * libgnarl/s-osinte__mingw.ads (CRITICAL_SECTION): Use proper
3065 type for SpinCount component.
3067 2019-07-09 Justin Squirek <squirek@adacore.com>
3069 * exp_ch4.adb (Expand_N_Allocator): Add conditional to detect
3070 the presence of anoymous access type allocators and issue a
3071 warning if the appropriate warning flag is enabled.
3072 * warnsw.ads: Add new warning flag for anonymous allocators
3073 * warnsw.adb (All_Warnings, Restore_Warnings, Save_Warnings,
3074 Set_Underscore_Warning_Switch): Register new flags.
3075 (WA_Warnings): Register new flag as an "all warnings" switch
3077 doc/gnat_ugn/building_executable_programs_with_gnat.rst:
3078 Document new warning switches -gnatw_a and -gnatw_A.
3079 * gnat_ugn.texi: Regenerate.
3081 2019-07-09 Ed Schonberg <schonberg@adacore.com>
3083 * sem_ch4.adb (Diagnose_Call): Improve error recovery when a
3084 local subprogram name hides a possible candidate name declared
3085 in a child package in the context of the current unit.
3086 * sem_ch6.adb (Process_Formals): Protect against malformed
3087 formal types when the parameter type does not denote an entity.
3089 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
3091 * bindo-augmentors.adb (Visit_Elaboration_Root): Do not start a
3092 DFS from an elaboration root whose corresponding unit lacks
3093 elaboration code. This behavior mimics that of the old
3094 elaboration order mechanism.
3095 * bindo-graphs.adb (Find_All_Cycles_Through_Vertex): Move the
3096 vertex tracing within the functional branches of the routine.
3097 This prevents spurious trace output.
3098 (Has_No_Elaboration_Code): New routine.
3099 (Trace_Cycle, Trace_Edge): Update the various Ids to use the
3100 "standard" trace format.
3101 * bindo-graphs.ads (Has_No_Elaboration_Code): New routine.
3102 * bindo-units.ads, bindo-units.adb (Has_No_Elaboration_Code):
3105 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
3107 * ali.ads, bindo-graphs.adb, bindo-validators.adb, clean.adb,
3108 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst, einfo.ads,
3109 exp_aggr.adb, exp_ch13.adb, exp_ch4.adb, exp_ch5.adb,
3110 exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_pakd.adb,
3111 fname-uf.ads, gnatlink.adb, inline.adb, lib.ads, make.adb,
3112 namet.ads, opt.ads, par-ch4.adb, par-ch6.adb, par-labl.adb,
3113 prep.adb, sem_aggr.adb, sem_ch13.adb, sem_ch4.adb, sem_ch5.adb,
3114 sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch8.adb, sem_dim.adb,
3115 sem_disp.adb, sem_prag.adb, sem_res.adb, sem_warn.adb,
3116 sinfo.ads: Replace ". " with ". ". Minor reformatting and typo
3118 * gnat_ugn.texi: Generate.
3120 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
3122 * bindo.ads: Move type Precedence_Kind from the private to the
3123 visible part of the unit.
3124 * bindo-augmentors.adb: Remove the use of global data as it is
3126 (Augment_Library_Graph): Update the parameter profile.
3127 (Is_Visited, Set_Is_Visited): Remove.
3128 (Visit_Elaboration_Root, Visit_Elaboration_Roots): Update the
3129 parameter profile and comment on usage.
3130 (Visit_Vertex): Likewise. Also keep track of which invocation
3131 edge activates a task.
3132 * bindo-augmentors.ads (Augment_Library_Graph): Update the
3133 parameter profile and comment on usage.
3134 * bindo-builders.adb (Create_Forced_Edge,
3135 Create_Spec_And_Body_Edge, Create_With_Edge): Update the call to
3137 * bindo-diagnostics.adb: Add with end use clauses for Restrict
3139 (Output_Dynamic_Model_Suggestions): Remove.
3140 (Output_Invocation_Related_Suggestions): New routine.
3141 (Output_Suggestions): Output all invocation-related suggestions
3143 * bindo-elaborators.adb: Remove types Comparator_Ptr and
3145 (Find_Best_Vertex): Update the parameter profile.
3146 * bindo-graphs.adb (Activates_Task): New routine.
3147 (Add_Body_Before_Spec_Edge): Update the call to
3148 Add_Edge_With_Return.
3149 (Add_Edge): Update the parameter profile and the call to
3150 Add_Edge_With_Return.
3151 (Add_Edge_With_Return): Update the parameter profile and comment
3153 (At_Least_One_Edge_Satisfies): New routine.
3154 (Contains_Elaborate_All_Edge): Reimplement.
3155 (Contains_Static_Successor_Edge, Contains_Task_Activation): New
3157 (Contains_Weak_Static_Successor): Remove.
3158 (Is_Static_Successor_Edge): New routine.
3159 * bindo-graphs.ads: Add types LGE_Predicate_Ptr,
3160 LGV_Comparator_Ptr, and LGV_Predicate_Ptr. Update type
3161 Library_Graph_Edge_Attributes to capture whether an invocation
3162 edge activates a task. Update the value of
3163 No_Library_Graph_Edge_Attributes.
3164 (Activates_Task): Update the parameter profile and comment on
3166 (Contains_Static_Successor_Edge, Contains_Task_Activation): New
3168 (Contains_Weak_Static_Successor): Remove.
3169 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst:
3170 Update the documentation to reflect the new task-related advice.
3171 * gnat_ugn.texi: Regenerate.
3173 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
3175 * exp_util.adb (Containing_Package_With_Ext_Axioms): Replace
3176 low-level Ekind test with a high-level wrapper.
3178 2019-07-09 Arnaud Charlet <charlet@adacore.com>
3180 * libgnat/s-memory.adb: Disable calls to Abort defer/undefer
3181 when ZCX_By_Default.
3183 2019-07-09 Javier Miranda <miranda@adacore.com>
3185 * sem_ch13.adb (Rep_Item_Too_Early): Representation clauses are
3186 not allowed for a derivation of a generic type. Extend the
3187 current test to check that none of the parents is a generic
3190 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
3192 * exp_ch9.adb, exp_util.adb, repinfo.adb, sem_ch12.adb,
3193 sem_prag.adb, sem_res.adb, sem_spark.adb, sem_util.adb: Minor
3196 2019-07-09 Ed Schonberg <schonberg@adacore.com>
3198 * sem_res.adb (Resolve_Equality_Op): If the node was overloaded,
3199 set properly the entity to which the node has been resolved. The
3200 original entity is the first one found during analysis, and is
3201 not necessarily the resolved one.
3202 (Resolve_Op_Not): If the argument of negation is an overloaded
3203 equality operation, call its resolution directly given that the
3204 context type does not participate in overload resolution.
3206 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
3208 * bindo.adb: Remove with and use clauses for Debug. Add with
3209 and use clauses for Opt.
3210 (Find_Elaboration_Order): Enable the v4.0 elaboration order. The
3211 v3.0 mechanism is now available under binder switch -H.
3212 * bindusg.adb (Display): Enable switch -H.
3213 * debug.adb: Free compiler switch -gnatd_G. Free binder switch
3215 * sem_elab.adb: Update the section on switches to remove
3217 (Invocation_Graph_Recording_OK): The invocation graph is now
3218 unconditionally recorded in ALI files.
3219 * switch-b.adb (Scan_Binder_Switches): Scan switch -H.
3220 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
3221 Update the documentation on compiler switches related to
3222 elaboration. Update the documentation on binder switches to
3224 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update
3225 the documentation on elaboration order handling in GNAT.
3226 * gnat_ugn.texi: Regenerate.
3228 2019-07-09 Eric Botcazou <ebotcazou@adacore.com>
3230 * repinfo.adb (List_Entities): Disregard formals altogether.
3231 (List_Name): Properly escape the double quote in the JSON
3234 2019-07-09 Javier Miranda <miranda@adacore.com>
3236 * exp_util.adb (Remove_Side_Effects): Preserve the
3237 Do_Range_Check flag.
3239 2019-07-09 Yannick Moy <moy@adacore.com>
3241 * sinfo.ads: Refine comment for Do_Range_Check.
3243 2019-07-09 Yannick Moy <moy@adacore.com>
3245 * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Expand
3246 attribute reference on Enum_Rep.
3248 2019-07-09 Ed Schonberg <schonberg@adacore.com>
3250 * sem_ch12.adb (Instantiate_Formal_Package): Handle properly the
3251 case where the actual for a formal package in an instance is the
3252 current instance of an enclosing generic package.
3253 (Check_Formal_Packages): If the formal package declaration is
3254 box-initialized or lacks associations altogether, no internal
3255 instance was created to verify conformance, and there is no
3256 validating package to remove from tree.
3258 2019-07-09 Yannick Moy <moy@adacore.com>
3260 * freeze.adb (Build_Renamed_Body): Do not set body to inline in
3263 2019-07-09 Yannick Moy <moy@adacore.com>
3265 * exp_util.adb (Expand_Subtype_From_Expr): Still expand the type
3266 of static expressions in GNATprove_Mode.
3267 * sem_ch3.adb (Analyze_Object_Declaration): Remove obsolete
3268 special case for GNATprove_Mode.
3270 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
3272 * doc/gnat_rm/the_gnat_library.rst,
3273 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
3274 erroutc.adb, libgnat/g-comlin.adb, libgnat/g-comlin.ads,
3275 libgnat/g-regexp.ads, libgnat/g-regpat.ads,
3276 libgnat/g-spipat.ads, libgnat/s-os_lib.ads,
3277 libgnat/s-regexp.ads: Reword "wild card" to "wildcard".
3278 * gnat_rm.texi, gnat_ugn.texi: Regenerate.
3280 2019-07-09 Yannick Moy <moy@adacore.com>
3282 * sem_spark.adb (Check_Expression): Handle correctly implicit
3283 assignments as part of allocators and (extension) aggregates.
3284 (Get_Root_Object): Adapt for new path expressions.
3285 (Is_Path_Expression): Return True for (extension) aggregate.
3287 2019-07-09 Piotr Trojanek <trojanek@adacore.com>
3289 * einfo.ads: Fix a typo.
3291 2019-07-09 Ed Schonberg <schonberg@adacore.com>
3293 * sem_util.adb (Scope_Within_Or_Same): Handle properly task
3294 bodies and protected bodies, so that local variables within have
3295 their proper scopes after these constructs have been rewritten
3296 during expansion. This patch resembles but is not identical to
3297 the code in Scope_Within.
3299 2019-07-09 Arnaud Charlet <charlet@adacore.com>
3301 * gnat1drv.adb (Adjust_Global_Switches): Set
3302 Dynamic_Elaboration_Checks to True in CodePeer mode.
3304 2019-07-09 Yannick Moy <moy@adacore.com>
3306 * sem_spark.adb (Get_Perm_Or_Tree): Issue an error when
3307 encountering unknown global variable.
3309 2019-07-09 Yannick Moy <moy@adacore.com>
3311 * sem_spark.adb (Check_Expression): Change signature to take an
3312 Extended_Checking_Mode, for handling read permission checking of
3313 sub-expressions in an assignment.
3314 (Check_Parameter_Or_Global): Adapt to new behavior of
3315 Check_Expression for mode Assign.
3316 (Check_Safe_Pointers): Do not analyze generic bodies.
3317 (Check_Assignment): Separate checking of the target of an
3320 2019-07-09 Eric Botcazou <ebotcazou@adacore.com>
3322 * repinfo.ads (JSON format): Adjust.
3323 * repinfo.adb (Need_Blank_Line): Rename to...
3324 (Need_Separator): ...this.
3325 (Blank_Line): Rename to...
3326 (Write_Separator): ...this and add JSON specific handling.
3327 (List_Array_Info): Adjust to above renaming.
3328 (List_Object_Info): Likewise.
3329 (List_Record_Info): Likewise.
3330 (List_Subprogram_Info): Likewise.
3331 (List_Type_Info): Likewise.
3332 (List_Entities): Do not set Need_Blank_Line.
3333 (List_Rep_Info): Set Need_Separator and add JSON specific
3334 handling. Output a single JSON stream in the normal case.
3336 2019-07-09 Arnaud Charlet <charlet@adacore.com>
3338 * doc/gnat_ugn/the_gnat_compilation_model.rst: Update doc on
3339 -fdump-ada-spec now that we generate Ada 2012.
3340 * gnat_ugn.texi: Regenerate.
3342 2019-07-08 Eric Botcazou <ebotcazou@adacore.com>
3344 * repinfo.adb (List_Common_Type_Info): New procedure extracted
3346 (List_Type_Info): ...here. Call it for the common information,
3347 start with a blank line and output the linker section at the
3349 (List_Mechanisms): Rename to...
3350 (List_Subprogram_Info): ...this.
3351 (List_Array_Info): Call List_Common_Type_Info.
3352 (List_Entities): Adjust to above change and renaming.
3353 (List_Record_Info): Call List_Common_Type_Info.
3355 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
3357 * libgnat/g-sercom.ads
3358 (Serial_Port_Descriptor): New type.
3359 (Serial_Port): Add a comment, make it hold a
3360 Serial_Port_Descriptor.
3361 (To_Ada, To_C): New procedures.
3362 (Port_Data, Port_Data_Access): Remove types.
3363 * libgnat/g-sercom.adb (To_Ada): New stub.
3364 * libgnat/g-sercom__linux.adb, libgnat/g-sercom__mingw.adb:
3365 Update implementations accordingly.
3366 * s-oscons-tmplt.c: Bind Serial_Port_Descriptor to
3367 System.Win32.HANDLE on Windows, and to Interfaces.C.int on
3368 Linux. Add "Interfaces.C." prefix for other basic integer type
3370 * xoscons.adb (Output_Info): Remove the "Interfaces.C." prefix
3371 for subtypes generation.
3373 2019-07-08 Arnaud Charlet <charlet@adacore.com>
3375 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
3376 Update documentation on No_Exceptions restriction.
3377 * gnat_rm.texi: Regenerate.
3379 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
3381 * libgnat/s-os_lib.adb: Do not call __gnat_kill for Invalid_Pid.
3383 2019-07-08 Piotr Trojanek <trojanek@adacore.com>
3385 * sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect
3386 package and subprogram bodies.
3388 2019-07-08 Bob Duff <duff@adacore.com>
3390 * doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation
3391 of ignored GNATpp switch.
3393 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
3395 * doc/gnat_rm/implementation_defined_pragmas.rst:
3396 Update the documentation of pragma Initialize_Scalars.
3397 * gnat_rm.texi: Regenerate.
3399 2019-07-08 Javier Miranda <miranda@adacore.com>
3401 * exp_ch4.adb (Tagged_Membership): Fix regression silently
3402 introduced in r260738 that erroneouslusy causes the evaluation
3403 to True of the membership test when the left operand of the
3404 membership test is a class-wide interface object and the right
3405 operand is a type that implements such interface type.
3407 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
3409 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
3410 register an address clause when its prefix denotes a generic
3413 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
3415 * bindo-diagnostics.adb (Diagnose_Cycle): Capture the presence
3416 of an Elaborate_All edge before iterating over the edges of the
3418 (Output_Elaborate_Body_Transition): Update the parameter profile
3419 and the comment on usage. Add a missing case where the edge is
3420 within the context of an Elaborate_All.
3421 (Output_Transition): Update the call to
3422 Output_Elaborate_Body_Transition.
3423 * bindo-graphs.ads, bindo-graphs.adb
3424 (Contains_Elaborate_All_Edge): New routine.
3426 2019-07-08 Piotr Trojanek <trojanek@adacore.com>
3428 * lib-xref-spark_specific.adb (Create_Heap): Set dummy Etype for
3429 the fake __HEAP entity.
3431 2019-07-08 Daniel Mercier <mercier@adacore.com>
3433 * gnat1drv.adb: Suppress warnings on memory representation in
3434 CodePeer compiler mode.
3436 2019-07-08 Nicolas Roche <roche@adacore.com>
3438 * rtinit.c (__gnat_runtime_initialize): Remove dependency on
3441 2019-07-08 Doug Rupp <rupp@adacore.com>
3443 * Makefile.rtl: Handle vxworks7r2 in x86_64 and x86 vxworks7.
3445 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
3447 * Makefile.rtl: Use g-sercom__linux.adb for all linuxes.
3449 2019-07-08 Yannick Moy <moy@adacore.com>
3451 * expander.adb (Expand): Do not reset Analyzed flag always.
3452 * sem_eval.adb (Fold_Ureal): Mark node as analyzed.
3454 2019-07-08 Ed Schonberg <schonberg@adacore.com>
3456 * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not insert twice
3457 the assignment statement that computes the delay value, to
3458 prevent improper tree sharing when the value is a type
3459 conversion and Float_Overflow checks are enabled.
3461 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
3463 * bindo.adb: Update the section on terminology to include new
3464 concepts. Update the section on switches to include new
3466 * bindo.ads: Add type Precedence_Kind.
3467 * bindo-builders.adb: Add with and use clauses for Debug and
3468 Bindo.Validators. Add use clauses for
3469 Bindo.Validators.Invocation_Graph_Validators and
3470 Bindo.Validators.Library_Graph_Validators.
3471 (Build_Invocation_Graph): Validate the graph immediately after
3473 (Build_Library_Graph): Update the parameter profile. The
3474 creation of the graph is now elaboration model-agnostic.
3475 Validate the graph immediately after it was built.
3476 (Create_With_Edge): Create regular with edges for Elaborate and
3477 Elaborate_All edges when the appropriate debug switches are in
3479 * bindo-builders.ads (Build_Library_Graph): Update the parameter
3481 * bindo-diagnostics.adb (Diagnose_Cycle): Track the presence of
3482 an Elaborate_All edge throughout the inspection of the cycle's
3484 (Output_Dynamic_Model_Suggestions): Output the suggestion only
3485 when the cycle contains at least one weak edge where the
3486 successor was statically elaborated.
3487 (Output_Elaborate_Body_Transition, Output_Forced_Transition,
3488 Output_With_Transition): Update the assertions.
3489 * bindo-elaborators.adb: Remove use clauses for
3490 Bindo.Validators.Invocation_Graph_Validators and
3491 Bindo.Validators.Library_Graph_Validators. Remove strings
3492 Add_To_All_Candidates_Msg and Add_To_Comp_Candidates_Msg.
3493 Remove type String_Ptr.
3494 (Add_Vertex, Add_Vertex_If_Elaborable, Create_All_Candidates_Set
3495 Create_Component_Candidates_Set): Remove.
3496 (Create_Component_Vertex_Sets, Create_Vertex_Sets): New routine.
3497 (Elaborate_Component): Update the parameter profile and the
3498 comment on usage. Reimplement the elaboration of a component.
3499 The algorithm will now attempt to elaborate as many vertices
3500 possible. If this is not possible, and a weakly elaborable
3501 vertex is available use unit was compiled using the dynamic
3502 model, the algorithm will elaborate it.
3503 (Elaborate_Library_Graph): Reimplement the elaboration of the
3504 graph. The algorithm will now attempt to elaborate as many
3505 vertices along with their components as possible. If this is not
3506 possible, and a weakly elaborable vertex is available use unit
3507 was compiled using the dynamic model, the algorithm will
3508 elaborate it along with its component.
3509 (Elaborate_Units): Merge with the functionality of
3510 Elaborate_Units_Common.
3511 (Elaborate_Units_Common, Elaborate_Units_Dynamic,
3512 Elaborate_Units_Static): Remove.
3513 (Elaborate_Vertex): Update the parameter profile and the comment
3514 on usage. Reimplemented.
3515 (Find_Best_Candidate): Remove.
3516 (Find_Best_Elaborable_Vertex, Find_Best_Vertex,
3517 Find_Best_Weakly_Elaborable_Vertex, Has_Elaborable_Body,
3518 Insert_Elaborable_Successor, Insert_Vertex): New routines.
3519 (Is_Better_Candidate): Remove.
3520 (Is_Better_Elaborable_Vertex,
3521 Is_Better_Weakly_Elaborable_Vertex,
3522 Is_Suitable_Elaborable_Vertex,
3523 Is_Suitable_Weakly_Elaborable_Vertex): New routines.
3524 (Trace_Candidate_Vertices): Remove.
3525 (Trace_Component): Output the number of strong and weak
3527 (Trace_Unelaborated_Vertices): Remove.
3528 (Trace_Vertex): Output the number of strong and weak
3530 (Trace_Vertices): New routine.
3531 (Update_Successor, Update_Successors): Update the parameter
3532 profile and the comment on usage.
3533 * bindo-graphs.adb: Remove type Precedence_Kind.
3534 (Add_Edge_With_Return): Update the increment of pending
3536 (Add_Vertex): Provide default values for strong and weak
3538 (Complementary_Vertex): Move the initial declaration to the
3539 spec. Update the parameter profile and the comment on usage.
3540 (Contains_Weak_Static_Successor): New routine.
3541 (Create): Update the parameter profile. The creation of the
3542 graph is now elaboration model-agnostic.
3543 (Decrement_Pending_Predecessors): Update the parameter profile
3544 and the comment on usage. Reimplemented.
3545 (Delete_Edge): Update the decrement of pending predecesors.
3546 (Has_Elaborate_Body): Do not treat a vertex as being subject to
3547 Elaborate_Body when a debug switch is in effect.
3548 (Increment_Pending_Predecessors): Update the parameter profile
3549 and the comment on usage. Reimplemented.
3550 (Is_Elaborable_Component): Reimplemented.
3551 (Is_Elaborable_Vertex): Move the initial declaration to the
3552 spec. Reimplemented.
3553 (Is_Elaborate_Body_Pair): New routine.
3554 (Is_Dynamically_Elaborated): Update the parameter profile.
3556 (Is_Weakly_Elaborable_Vertex): New routine.
3557 (Pending_Predecessors): Removed.
3558 (Pending_Predecessors_For_Elaboration,
3559 Pending_Strong_Predecessors, Pending_Weak_Predecessors,
3560 Update_Pending_Predecessors): New routines.
3561 (Update_Pending_Predecessors_Of_Components): Update the
3562 increment of pending predecessors.
3563 * bindo-graphs.ads: Update the components of type
3564 Component_Attributes. Update the components of type
3565 Library_Graph_Attributes. Update the components of type
3566 Library_Graph_Vertex_Attributes. Update the initialization of
3567 No_Component_Attributes. Update the initialization of
3568 No_Library_Graph_Vertex_Attributes.
3569 (Complementary_Vertex, Contains_Weak_Static_Successor): New
3571 (Create): Update the parameter profile and the comment on usage.
3572 (Decrement_Pending_Predecessors, Is_Dynamically_Elaborated):
3573 Update the parameter profile and the comment on usage.
3574 (Is_Elaborate_Body_Pair, Is_Weakly_Elaborable_Vertex): New
3576 (Pending_Predecessors): Removed.
3577 (Pending_Predecessors_For_Elaboration,
3578 Pending_Strong_Predecessors, Pending_Weak_Predecessors): New
3580 * bindo-writers.adb (Write_Components): Moved from the spec.
3581 (Write_Component): Output the strong and weak predecessors.
3582 (Write_Library_Graph): Output the components as part of the
3584 (Write_Library_Graph_Vertex): Output the strong and weak
3586 * bindo-writers.ads (Write_Components): Moved to the body.
3587 * debug.adb: Add and document new GNATbind switches -d_a, -d_b,
3589 * bindo-validators.adb: Minor reformattings.
3591 2019-07-08 Bob Duff <duff@adacore.com>
3593 * libgnat/g-sercom.ads, libgnat/g-sercom__linux.adb (Data_Rate):
3594 Support additional data rates.
3596 2019-07-08 Olivier Hainque <hainque@adacore.com>
3598 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Don't request
3599 DECL_ARTIFICIAL_P on elab proc declarations.
3601 2019-07-08 Eric Botcazou <ebotcazou@adacore.com>
3603 * repinfo.adb (List_Record_Info): Declare Incomplete_Layout and
3604 Not_In_Extended_Main local exceptions.
3605 (List_Structural_Record_Layout): For an extension, raise the
3606 former if the parent subtype has not been built and the latter
3607 if it is not declared in the main source unit. Fall back to the
3608 flat layout if either exception has been raised.
3610 2019-07-08 Ed Schonberg <schonberg@adacore.com>
3612 * libgnat/a-strfix.adb (Delete): The RM describes the semantics
3613 of Delete as equivalent to that of Replace_String with a null
3614 argument. As a result, deleting a null string that starts past
3615 the end of its argument is a noop and must not raise
3618 2019-07-08 Javier Miranda <miranda@adacore.com>
3620 * exp_disp.adb (Register_Primitive): When registering a
3621 primitive in the secondary dispatch table, handle primitive
3622 inherited through several levels of type derivation (required to
3623 properly handle inherited 'null' primitive).
3625 2019-07-08 Bob Duff <duff@adacore.com>
3627 * doc/gnat_ugn/gnat_utility_programs.rst: Document handling of
3628 preprocessor directives in GNATpp.
3630 2019-07-08 Javier Miranda <miranda@adacore.com>
3632 * gnat1drv.adb (Post_Compilation_Validation_Checks:
3633 Validate_Compile_Time_Warning_Errors is now located in sem_prag
3634 (instead of sem_ch13).
3635 * sem_ch13.ads (Validate_Compile_Time_Warning_Error,
3636 Validate_Compile_Time_Warning_Errors): Move to sem_prag.
3638 (Compile_Time_Warnings_Errors): Move to sem_prag.
3639 (Initialize): Remove initialization of table
3640 Compile_Time_Warning_Errors.
3641 (Validate_Compile_Time_Warning_Error,
3642 Validate_Compile_Time_Warning_Errors): Move to sem_prag.
3643 * sem_prag.ads (Validate_Compile_Time_Warning_Errors): New
3645 * sem_prag.adb (Initialize): Initialize table
3646 Compile_Time_Warning_Errors.
3648 2019-07-08 Ed Schonberg <schonberg@adacore.com>
3650 * sem_ch13.adb (Analyze_Aspect_Specifications): For a
3651 pre/postcondition of a generic subprogram declaration, do not
3652 use Relocate_Node on the aspect expression to construct the
3653 corresponding attribute specification, to prevent tree anomalies
3654 when the expression is a call with named actual parameters.
3656 2019-07-08 Javier Miranda <miranda@adacore.com>
3658 * sem_attr.adb (Analyze_Attribute [Attribute_Size]): For pragmas
3659 used to report user defined compile time warning or errors
3660 handle 'Size for types with known static RM size.
3662 2019-07-08 Justin Squirek <squirek@adacore.com>
3664 * exp_imgv.adb (Build_Enumeration_Image_Tables): Default SSO for
3665 the building of image tables.
3666 (Expand_Image_Attribute): Minor cleanup.
3668 2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
3670 * libgnat/g-socket.ads, libgnat/g-socket.adb: Improve
3672 (Get_Socket_Option, Set_Socket_Option): Remove default value for
3675 2019-07-08 Ed Schonberg <schonberg@adacore.com>
3677 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): For an
3678 unanalized aspect in a generic context that has not been
3679 analyzed yet, if the aspect applies to a type, place the type on
3680 the scope stack to make its components visible, before checking
3681 conformance with the version of the expression analyzed at the
3684 2019-07-05 Justin Squirek <squirek@adacore.com>
3686 * checks.adb (Apply_Accessibility_Check): Add logic to fetch the
3687 function result accessibility level if one is required within
3688 the generated check.
3689 * exp_ch6.adb (Needs_Result_Accessibility_Level): Modify
3690 controlling elsif block to handle more cases such as anonymous
3691 access results and disable checking for coextensions.
3693 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3695 * sem_ch9.adb (Analyze_Accept_Statement): If this is an illegal
3696 accept statement for an enclosing entry abandon analysis to
3697 prevent scope mismatches and potential infinite loops in
3700 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3702 * ali.adb (For_Each_Invocation_Construct,
3703 For_Each_Invocation_Relation): New version.
3704 (Scan_ALI): Initialize field Invocation_Graph_Encoding.
3705 (Set_Invocation_Graph_Encoding): Update the setting of the
3706 invocation graph encoding.
3707 * ali.ads: Move field Invocation_Graph_Encoding from Unit_Record
3708 to ALI_Record because the encoding applies to the whole ALI,
3709 rather than one of the units (spec or body) for which the ALI
3711 (For_Each_Invocation_Construct, For_Each_Invocation_Relation):
3713 * bindo.adb: Update the section on switches. Complete the
3714 section of debugging elaboration order issues.
3715 (Find_Elaboration_Order): Prepare the routine for the switch
3716 from the old to the new elaboration order mechanism.
3717 * bindo-diagnostics.adb (Find_And_Output_Invocation_Paths):
3718 Manage a visited set used by Visit_Vertex.
3719 (Output_All_Cycles_Suggestions,
3720 Output_Dynamic_Model_Suggestions): Clarify the nature of the
3722 (Output_Elaborate_Body_Transition): Update the diagnostic to
3723 emit a better message.
3724 (Output_Forced_Suggestions, Output_Full_Encoding_Suggestions):
3725 Clarify the nature of the suggested switch.
3726 (Visit_Vertex): Update the parameter profile to add a set of
3727 invokers visited during the transition. This set prevents
3728 infinite exploration of the graph in case the invocations are
3730 * bindo-elaborators.adb: Add a use clause for
3731 Bindo.Writers.Dependency_Writers.
3732 (Elaborate_Units_Common): Output the library graph after it has
3733 been augmented with invocation edges. Output just the components
3734 instead of outputting the whole library graph again.
3735 (Elaborate_Units_Dynamic, Elaborate_Units_Static): Output the
3736 dependencies as expressed in the library graph.
3737 * bindo-units.adb (Invocation_Graph_Encoding): Update the
3738 extraction of the invocation graph encoding.
3739 * bindo-writers.adb: Add with and use clauses for Binderr and
3741 (palgc, plgc): New debug routine.
3742 (Write_Components): Moved to the spec. Add a header for the
3744 (Write_Dependencies, Write_Dependencies_Of_Vertex,
3745 Write_Dependency_Edge): New routine.
3746 (Write_Elaboration_Order): Update the logic to follow the format
3747 of Binde's order output.
3748 (Write_Library_Graph): Do not output the components every time
3749 the graph is written.
3750 (Write_Unit): Output the invocation graph encoding of the unit.
3751 Output the invocation constructs and relations for the unit
3753 * bindo-writers.ads (Write_Components): Moved from the body.
3754 (Write_Dependencies): New routine.
3755 * bindusg.adb: Prepare the routine for the switch from the old
3756 to the new elaboration order mechanism.
3757 * debug.adb: Binder switch -d_O is now not associated with any
3759 * einfo.adb (Is_Elaboration_Target): The attribute applies to
3760 packages, as specified by the comment on the attribute usage.
3761 * opt.ads: Add a global flag which controls the choice between
3762 the new and the legacy elaboration order mechanism.
3763 * sem_elab.adb: Add Package_Target to type Target_Kind.
3764 (Build_Elaborate_Body_Procedure, Build_Elaborate_Procedure,
3765 Build_Elaborate_Spec_Procedure, Check_Elaboration_Scenarios,
3766 Check_SPARK_Model_In_Effect): Use Main_Unit_Entity to obtain the
3767 entity of the main unit.
3768 (Create_Package_Rep): New routine.
3769 (Create_Target_Rep): Add processing for packages.
3770 (Declaration_Placement_Of_Node, Has_Prior_Elaboration): Use
3771 Main_Unit_Entity to obtain the entity of the main
3773 (Invocation_Graph_Recording_OK): Prepare the routine for the
3774 switch from the old to the new elaboration order mechanism.
3775 (Main_Unit_Entity): New routine.
3776 (Meet_Elaboration_Requirement,
3777 Process_Conditional_ABE_Variable_Reference): Use
3778 Main_Unit_Entity to obtain the entity of the main unit.
3779 (Process_Invocation_Instantiation): New routine.
3780 (Process_Invocation_Scenario): Add processing for
3782 * switch-b.adb (Scan_Binder_Switches): Prepare the routine for
3783 the switch from the old to the new elaboration order mechanism.
3785 2019-07-05 Joffrey Huguet <huguet@adacore.com>
3787 * libgnat/a-textio.adb: Add abstract state refinment.
3788 * libgnat/a-textio.ads: Add File_System abstract state. Add
3789 global contracts, contract cases, preconditions and
3790 postconditions to procedures and functions.
3791 (Set_Input, Set_Output, Set_Error, Standard_Input,
3792 Standard_Output, Standard_Error, Current_Input, Current_Output,
3793 Current_Error): Turn SPARK_Mode off.
3794 (Get_Line): Turn SPARK_Mode off on Get_Line functions.
3795 * libgnat/a-tideio.ads, libgnat/a-tienio.ads,
3796 libgnat/a-tifiio.ads, libgnat/a-tiflio.ads,
3797 libgnat/a-tiinio.ads, libgnat/a-timoio.ads: Add global
3798 contracts, contract cases, preconditions and postconditions to
3799 procedures and functions.
3801 2019-07-05 Arnaud Charlet <charlet@adacore.com>
3803 * doc/gnat_ugn/platform_specific_information.rst: Refresh doc on
3804 installing from the command line on Windows. Remove obsolete
3806 * gnat_ugn.texi: Regenerate.
3808 2019-07-05 Vasiliy Fofanov <fofanov@adacore.com>
3810 * libgnat/a-wichha.ads (Is_Alphanumeric): Replace comment with
3811 the correct one. Also capitalize references to False
3814 2019-07-05 Eric Botcazou <ebotcazou@adacore.com>
3816 * exp_ch4.adb (Expand_N_Indexed_Component): Do not expand actual
3817 parameters of function calls here either.
3819 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3821 * bindo-units.adb, checks.adb, exp_attr.adb, exp_ch3.adb,
3822 exp_ch4.adb, exp_pakd.adb, lib-writ.adb, libgnat/g-traceb.adb,
3823 libgnat/g-traceb.ads, libgnat/s-stratt.ads, sem_aux.ads,
3824 sem_util.adb: Minor reformatting.
3826 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3828 * sem_ch13.adb (Build_Predicate_Functions): If a subtype that
3829 carries a static predicate aspect is frozen immediately after
3830 its declaration, ensure that the generated function body created
3831 for predicate checking is inserted after the corresponding
3832 subprogram declaration, which is created at the point the
3833 declaration is elaborated.
3835 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3837 * exp_ch7.adb (Cleanup_Record): Use the underlying type when
3838 checking for components with tasks.
3840 2019-07-05 Arnaud Charlet <charlet@adacore.com>
3842 * libgnarl/s-osinte__linux.ads: Link with -lrt before -lpthread.
3844 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3846 * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Add explicit
3847 range checks when the index type of the bit-packed array is an
3848 enumeration type with a non-standard representation,
3850 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3852 * sem_res.adb (Is_Control_Flow_Statement): Delay statements
3853 contain an expression, which in turn may have side effects and
3854 affect the infinite recursion. As a result, delay statements
3855 should not be treated specially.
3857 2019-07-05 Arnaud Charlet <charlet@adacore.com>
3859 * libgnarl/s-linux.ads, libgnarl/s-linux__alpha.ads,
3860 libgnarl/s-linux__android.ads, libgnarl/s-linux__hppa.ads,
3861 libgnarl/s-linux__mips.ads, libgnarl/s-linux__riscv.ads,
3862 libgnarl/s-linux__sparc.ads: Fix typos in comments.
3864 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3866 * sem_res.adb (Check_Infinite_Recursion): Reimplemented.
3867 (Enclosing_Declaration_Or_Statement,
3868 Invoked_With_Different_Arguments, Is_Conditional_Statement,
3869 Is_Control_Flow_Statement, Is_Immediately_Within_Body,
3870 Is_Raise_Idiom, Is_Raise_Statement, Is_Sole_Statement,
3871 Preceded_By_Control_Flow_Statement,
3872 Within_Conditional_Statement): New routines.
3874 2019-07-05 Javier Miranda <miranda@adacore.com>
3876 * exp_ch4.adb (Expand_N_Type_Conversion): Do not apply an
3877 accessibility check when the conversion is an access to
3878 class-wide interface type and it is an actual parameter.
3879 * exp_ch6.adb (Expand_Call_Helper): Add documentation on the
3880 accessibility level of an anonymous allocator defining the value
3881 of an access parameter.
3882 * sem_util.ads, sem_util.adb (Dynamic_Accessibility_Level): Add
3883 support for an anonymous allocator whose type is that of a
3884 stand-alone object of an anonymous access to object type.
3886 2019-07-05 Piotr Trojanek <trojanek@adacore.com>
3888 * einfo.ads, sem_res.adb: Typo fixes in comments.
3890 2019-07-05 Bob Duff <duff@adacore.com>
3892 * exp_ch6.adb (Is_Build_In_Place_Function): Narrow the check for
3893 Has_Foreign_Convention to the imported case only. If a
3894 build-in-place function is exported, and called from Ada code,
3895 build-in-place protocols should be used.
3897 2019-07-05 Ed Schonberg <schonberg@adacore.com>
3899 * sem_util.adb (Encloing_Subprogram): If Enclosing_Dynamic_Scope
3900 is a loop, continue climbing the scope stack to find the
3901 enclosing subprogram.
3902 (Gather_Components): Handle properly a choice in a record
3903 aggregate that is given by a subtype with a static predicate.
3905 2019-07-05 Javier Miranda <miranda@adacore.com>
3907 * debug.adb (-gnatd.K): Leave available this switch.
3908 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
3910 * scil_ll.ads, scil_ll.adb (Contract_Only_Body_Flag,
3911 Contract_Only_Body_Nodes, Get_Contract_Only_Body,
3912 Is_Contract_Only_Body, Set_Contract_Only_Body): Remove.
3914 2019-07-05 Pierre-Marie de Rodat <derodat@adacore.com>
3916 * libgnat/a-strunb.ads: Import documentation from the RM
3918 2019-07-05 Pierre-Marie de Rodat <derodat@adacore.com>
3920 * libgnat/a-strfix.ads: Import documentation from the RM
3922 2019-07-05 Yannick Moy <moy@adacore.com>
3924 * adabkend.adb (Scan_Back_End_Switches): Accept -Og and -Ofast
3927 2019-07-05 Hristian Kirtchev <kirtchev@adacore.com>
3929 * ali.adb: Relocate types Invocation_Construct_Record,
3930 Invocation_Relation_Record, and Invocation_Signature_Record to
3931 the body of ALI. Relocate tables Invocation_Constructs,
3932 Invocation_Relations, and Invocation_Signatures to the body of
3933 ALI. Remove type Body_Placement_Codes. Add new types
3934 Declaration_Placement_Codes, and
3935 Invocation_Graph_Encoding_Codes. Update the literals of type
3936 Invocation_Graph_Line_Codes.
3937 (Add_Invocation_Construct): Update the parameter profile. Add an
3938 invocation construct built from all attributes provided.
3939 (Add_Invocation_Relation): Update the parameter profile. Add an
3940 invocation relation built from all attributes provided.
3941 (Body_Placement): New routine.
3942 (Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind):
3944 (Code_To_Declaration_Placement_Kind,
3945 Code_To_Invocation_Graph_Encoding_Kind, Column,
3946 Declaration_Placement_Kind_To_Code, Extra,
3947 For_Each_Invocation_Construct, For_Each_Invocation_Relation,
3948 Invocation_Graph_Encoding,
3949 Invocation_Graph_Encoding_Kind_To_Code, Invoker, Kind, Line,
3950 Locations, Name): New routine.
3951 (Scan_Invocation_Construct_Line): Reimplement the scanning
3953 (Scan_Invocation_Graph_Attributes_Line): New routine.
3954 (Scan_Invocation_Graph_Line): Use a case statement to dispatch.
3955 (Scan_Invocation_Relation_Line): Reimplement the scanning
3957 (Scope): New routine.
3958 (Set_Invocation_Graph_Encoding, Signature, Spec_Placement,
3959 Target): New routine.
3960 * ali.ads: Add new type Invocation_Graph_Encoding_Kind. Add
3961 component Invocation_Graph_Encoding to type Unit_Record.
3962 Relocate various types and data structures to the body of ALI.
3963 (Add_Invocation_Construct, Add_Invocation_Relation): Update the
3965 (Body_Placement): New routine.
3966 (Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind):
3968 (Code_To_Declaration_Placement_Kind,
3969 Code_To_Invocation_Graph_Encoding_Kind, Column,
3970 Declaration_Placement_Kind_To_Code, Extra,
3971 For_Each_Invocation_Construct, For_Each_Invocation_Relation,
3972 Invocation_Graph_Encoding,
3973 Invocation_Graph_Encoding_Kind_To_Code, Invoker, Kind, Line,
3974 Locations, Name, Scope, Set_Invocation_Graph_Encoding,
3975 Signature, Spec_Placement, Target): New routine.
3976 * bindo.adb: Add with clause for Binde. Add with and use
3977 clauses for Debug. Update the documentation. Add new switches.
3978 (Find_Elaboration_Order): Dispatch to the proper elaboration
3980 * bindo-augmentors.adb:
3981 Remove with and use clauses for GNAT and GNAT.Sets. Remove
3982 membership set VS. Update the parameter profiles of most
3983 routines to use better parameter names. Update the
3984 implementation of most routine to use the new parameter names.
3985 Remove various redundant assertions.
3986 * bindo-builders.adb: Use better names for instantiated data
3987 structures. Update all references to these names. Update the
3988 parameter profiles of most routines to use better parameter
3989 names. Update the implementation of most routine to use the new
3991 (Build_Library_Graph): Update the parameter profile. Update the
3993 (Create_Vertex): Reimplemented.
3994 (Declaration_Placement_Vertex): New routine.
3995 * bindo-builders.ads (Build_Library_Graph): Update the parameter
3996 profile and comment on usage.
3997 * bindo-diagnostics.adb: Almost a new unit.
3998 * bindo-diagnostics.ads: Add a use clause for
3999 Bindo.Graphs.Invocation_Graphs. Remove package
4001 (Diagnose_Circularities): New routine.
4002 * bindo-elaborators.adb: Remove the with and use clauses for
4003 Binderr and GNAT.Sets. Remove the use clause for
4004 Bindo.Diagnostics.Cycle_Diagnostics. Remove membership set VS.
4005 Update the parameter profiles of most routines to use better
4006 parameter names. Update the implementation of most routine to
4007 use the new parameter names. (Elaborate_Units_Common): Update
4008 the parameter profile. Pass an infication to the library graph
4009 builder whether the dynamic model is in effect.
4010 (Elaborate_Units_Dynamic, Elaborate_Units_Static): Use
4011 Diagnose_Circularities to provide diagnostics.
4012 (Update_Successor): Use routine In_Same_Component to determine
4013 whether the predecessor and successor reside in different
4015 * bindo-graphs.adb: Add with and use clauses for Butil, Debug,
4016 Output, and Bindo.Writers. Remove with and use clauses for
4017 GNAT.Lists. Update the parameter profiles of most routines to
4018 use better parameter names. Update the implementation of most
4019 routine to use the new parameter names. Remove various
4020 redundant assertions. Remove doubly linked list EL. Add new
4021 type Precedence_Kind.
4022 (Add_Cycle): New routine.
4023 (Add_Vertex): Update the parameter profile. Update the creation
4024 of vertex attributes.
4025 (Add_Vertex_And_Complement, Body_Vertex, Column,
4026 Complementary_Vertex, Copy_Cycle_Path, Cycle_Kind_Of): New
4028 (Destroy_Invocation_Graph_Edge, Destroy_Library_Graph_Cycle,
4029 Destroy_Library_Graph_Edge, Extra, File_Name,
4030 Find_All_Cycles_Through_Vertex, Find_All_Cycles_With_Edge,
4031 Find_Cycles, Find_First_Lower_Precedence_Cycle,
4032 Get_LGC_Attributes, Has_Next, Hash_Library_Graph_Cycle,
4033 Hash_Library_Graph_Cycle_Attributes, Highest_Precedence_Cycle,
4034 Highest_Precedence_Edge, In_Same_Component, Insert_And_Sort,
4035 Invocation_Edge_Count, Invocation_Graph_Encoding,
4036 Is_Cycle_Initiating_Edge, Is_Cyclic_Edge,
4037 Is_Cyclic_Elaborate_All_Edge, Is_Cyclic_Elaborate_Body_Edge,
4038 Is_Cyclic_Elaborate_Edge, Is_Cyclic_Forced_Edge,
4039 Is_Cyclic_Invocation_Edge, Is_Cyclic_With_Edge,
4040 Is_Dynamically_Elaborated, Is_Elaborate_All_Edge,
4041 Is_Elaborate_Body_Edge, Is_Elaborate_Edge: New routines.
4042 (Is_Existing_Predecessor_Successor_Relation): Removed.
4043 (Is_Forced_Edge, Is_Invocation_Edge, Is_Recorded_Cycle,
4044 Is_Recorded_Edge, Is_With_Edge, Iterate_Edges_Of_Cycle, Kind,
4045 Length): New routine.
4046 (Lib_Vertex): Removed.
4047 (Line, Links_Vertices_In_Same_Component,
4048 Maximum_Invocation_Edge_Count, Next, Normalize_And_Add_Cycle,
4049 Normalize_Cycle_Path, Number_Of_Cycles, Path, Precedence,
4050 Remove_Vertex_And_Complement, Sequence_Next_Cycle): New routines.
4051 (Sequence_Next_IGE_Id): Renamed to Sequence_Next_Edge.
4052 (Sequence_Next_IGV_Id): Renamed to Sequence_Next_Vertex.
4053 (Sequence_Next_LGE_Id): Renamed to Sequence_Next_Edge.
4054 (Sequence_Next_LGV_Id): Renamed to Sequence_Next_Vertex.
4055 (Set_Is_Existing_Predecessor_Successor_Relation): Removed.
4056 (Set_Is_Recorded_Cycle, Set_Is_Recorded_Edge,
4057 Set_LGC_Attributes, Spec_Vertex, Trace_Cycle, Trace_Edge,
4058 Trace_Eol, Trace_Vertex): New routines.
4059 * bindo-graphs.ads: Add with and use clauses for Types and
4060 GNAT.Lists. Update the parameter profiles of most routines to
4061 use better parameter names. Update the implementation of most
4062 routine to use the new parameter names. Add the new
4063 instantiated data structures IGE_Lists, IGV_Sets, LGC_Lists,
4064 LGE_Lists, LGE_Sets, LGV_Sets, and RC_Sets. Add new type
4065 Library_Graph_Cycle_Id along with an empty and initial value.
4066 Remove component Lib_Vertex and add new components Body_Vertex
4067 and Spec_Vertex to type Invocation_Graph_Vertex_Attributes. Add
4068 new type Library_Graph_Cycle_Kind. Add new iterators
4069 All_Cycle_Iterator and Edges_Of_Cycle_Iterator. Add new type
4070 Library_Graph_Cycle_Attributes. Add new components
4071 Cycle_Attributes, Cycles, and Dynamically_Elaborated to type
4072 Library_Graph_Attributes.
4073 (Body_Vertex, Column, Destroy_Invocation_Graph_Edge,
4074 Destroy_Library_Graph_Cycle_Attributes,
4075 Destroy_Library_Graph_Edge, Extra, File_Name, Find_Cycles,
4076 Has_Elaborate_All_Cycle, Has_Next, Hash_Library_Graph_Cycle,
4077 Hash_Library_Graph_Cycle_Attributes, Highest_Precedence_Cycle,
4078 In_Same_Component, Invocation_Edge_Count,
4079 Invocation_Graph_Encoding, Is_Dynamically_Elaborated,
4080 Is_Elaborate_All_Edge, Is_Elaborate_Body_Edge,
4081 Is_Elaborate_Edge, Is_Forced_Edge, Is_Invocation_Edge,
4082 Is_With_Edge, Iterate_All_Cycles, Iterate_Edges_Of_Cycle, Kind):
4084 (Length, Lib_Vertex, (Line, Next, Number_Of_Cycles, Present,
4085 Same_Library_Graph_Cycle_Attributes, Spec_Vertex): New routines.
4086 * bindo-units.adb (File_Name, Invocation_Graph_Encoding): New
4088 * bindo-units.ads: Add new instantiated data structure
4090 (File_Name, Invocation_Graph_Encoding): New routine.
4091 * bindo-validators.adb: Remove with and use clauses for GNAT and
4092 GNAT.Sets. Remove membership set US. Update the parameter
4093 profiles of most routines to use better parameter names. Update
4094 the implementation of most routine to use the new parameter
4096 (Validate_Cycle, Validate_Cycle_Path, Validate_Cycles,
4097 Validate_Invocation_Graph_Vertex): Remove the validation of
4098 component Lib_Vertex. Add the validation of components
4099 Body_Vertex and Spec_Vertex.
4100 (Write_Error): New routine.
4101 * bindo-validators.ads (Validate_Cycles): New routine.
4102 * bindo-writers.adb: Update the parameter profiles of most
4103 routines to use better parameter names. Update the
4104 implementation of most routine to use the new parameter names.
4105 (Write_Cycle, Write_Cyclic_Edge, Write_Cycles): New routines.
4106 (Write_Invocation_Graph_Vertex): Remove the output of component
4107 Lib_Vertex. Add the output of components Body_Vertex and
4109 * bindo-writers.ads (Write_Cycles): New routine.
4110 * debug.adb: Use binder switches -d_C and -d_P, add
4111 documentation on their usage.
4112 * gnatbind.adb: Remove with and use clauses for Binde. Delegate
4113 the choice of elaboration mechanism to Bindo.
4114 * lib-writ.adb (Column, Extra, Invoker, Kind, Line, Locations,
4115 Name, Placement, Scope, Signature, Target): Removed.
4116 (Write_Invocation_Graph): Moved at the top level.
4117 (Write_Invocation_Graph_Attributes): New routine.
4118 (Write_Invocation_Relation, Write_Invocation_Signature): Moved
4120 * lib-writ.ads: Add a documentation section on invocation graph
4122 * sem_elab.adb (Body_Placement_Of): New routine.
4123 (Declare_Invocation_Construct): Update the call to
4124 Add_Invocation_Construct.
4125 (Declaration_Placement_Of_Node): New routine.
4126 (Get_Invocation_Attributes): Correct the retrieval of the
4127 enclosing subprogram where the postcondition procedure lives.
4128 (Placement_Of, Placement_Of_Node): Removed.
4129 (Record_Invocation_Graph): Record the encoding format used.
4130 (Record_Invocation_Graph_Encoding): New routine.
4131 (Record_Invocation_Relation): Update the call to
4132 Add_Invocation_Relation.
4133 (Spec_Placement_Of): Removed.
4134 * libgnat/g-lists.ads, libgnat/g-lists.adb (Equal): New routine.
4136 2019-07-05 Ed Schonberg <schonberg@adacore.com>
4138 * checks.adb (Apply_Predicate_Check): Except within the
4139 subprogram body that defines the formal, do not apply predicate
4140 check on a formal IN parameter: such a check is redundant and
4141 its expansion can lead to out-of-scope references when it is
4142 originates in a function call in a precondition,
4144 2019-07-05 Yannick Moy <moy@adacore.com>
4146 * sem_res.adb (Resolve_Call): Cannot inline in quantified
4148 * sem_util.adb, sem_util.ads (In_Quantified_Expression): New
4151 2019-07-05 Bob Duff <duff@adacore.com>
4153 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
4155 * gnat_rm.texi: Regenerate.
4157 2019-07-05 Bob Duff <duff@adacore.com>
4159 * exp_attr.adb (Input): Take the No_Stream_Optimizations
4160 restriction into account.
4162 2019-07-05 Claire Dross <dross@adacore.com>
4164 * libgnat/a-cofove.ads, libgnat/a-cofove.adb: Definite formal
4165 vectors are now always bounded so that they do not need to be
4168 2019-07-05 Dmitriy Anisimkov <anisimko@adacore.com>
4170 * libgnat/g-traceb.ads, libgnat/g-traceb.adb (Call_Chain): New
4173 2019-07-04 James Clarke <jrtc27@debian.org>
4175 * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
4177 (CLOCK_REALTIME): Make value public.
4179 2019-07-04 Javier Miranda <miranda@adacore.com>
4181 * exp_tss.adb (Init_Proc): Adding missing support for access to
4182 subprograms and access to protected subprograms of non-default
4185 2019-07-04 Eric Botcazou <ebotcazou@adacore.com>
4187 * gnat1drv.adb (Adjust_Global_Switches): Use proper interface to
4188 set the validity settings in CodePeer mode.
4189 * par-load.adb (Load): Remove all code dealing with validity
4191 * validsw.ads (Validity_Check_Copies): Alphabetize.
4192 * validsw.adb (Reset_Validity_Check_Options): Set all options to
4194 (Save_Validity_Check_Options): Save all options.
4196 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
4198 * exp_ch3.adb, exp_ch4.adb, exp_ch4.ads, exp_ch5.adb,
4199 exp_ch7.adb, exp_ch9.adb, exp_ch11.adb, exp_unst.adb,
4200 rtsfind.ads, sem_attr.adb, sem_ch10.adb, sem_ch12.adb,
4201 sem_ch13.adb, sem_dim.adb, sem_disp.adb, xref_lib.adb: Minor
4204 2019-07-04 Joffrey Huguet <huguet@adacore.com>
4206 * libgnarl/a-taside.ads: Add assertion policy to ignore
4208 (Abort_Task, Is_Terminated, Is_Callable): Add preconditions.
4210 2019-07-04 Eric Botcazou <ebotcazou@adacore.com>
4212 * doc/gnat_rm/implementation_defined_pragmas.rst: Fix
4213 capitalization and parenthesis glitches.
4214 * gnat_rm.texi: Regenerate.
4216 2019-07-04 Ed Schonberg <schonberg@adacore.com>
4218 * sem_ch10.adb (Remove_Context_Clauses): Handle properly the
4219 removal of a limited_with_clause which appears in the library
4220 unit oF the main unit, when some other unit in the context has a
4221 regular with_clause on the same unit, to prevent spurious
4222 visibility errors in the subsequent analysis of pending instance
4225 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
4227 * sem_elab.adb: Add new type Elaboration_Phase_Status along with
4228 a global to keep track of the elaboration phase status.
4229 Initialize all internal data structures to Nil for services
4230 Elaborated_Units, Internal_Representation, and Scenario_Storage.
4231 (Build_Call_Marker): Do not create a call marker when the
4232 elaboration phase is not active.
4233 (Build_Variable_Reference_Marker): Do not create a call marker
4234 when the elaboration phase is not active.
4235 (Check_Elaboration_Scenarios): Destroy all internal structures
4236 when the elaboration phase does not have to run. Do not execute
4237 when the elaboration phase is not active.
4238 (Elaboration_Phase_Active): New routine.
4239 (Finalize_All_Data_Structures): New routine.
4240 (Initialize): Initialize all internal data structures and signal
4241 that the elaboration phase has started.
4242 (Initialize_All_Data_Structures): New routine.
4243 (Initialize_Elaborated_Units): Initialize all internal data
4245 (Initialize_Internal_Representation): Initialize all internal
4247 (Initialize_Scenario_Storage): Initialize all internal data
4249 (Kill_Elaboration_Scenario): Do not execute when the elaboration
4250 phase is not active.
4251 (Set_Elaboration_Phase): New routine.
4252 (Update_Elaboration_Scenario): Do not execute when the
4253 elaboration phase is not active.
4255 2019-07-04 Gary Dismukes <dismukes@adacore.com>
4257 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): The special
4258 treatment of calling Mask_Unfrozen_Types must also be done in
4259 the case of an Ignored_Ghost_Entity, because Expander_Active is
4262 2019-07-04 Yannick Moy <moy@adacore.com>
4264 * sem_prag.adb (Check_Library_Level_Entity): Update for new rule
4267 2019-07-04 Justin Squirek <squirek@adacore.com>
4269 * sem_disp.adb (Check_Controlling_Formals): Obtain the full view
4270 before type comparison.
4272 2019-07-04 Ed Schonberg <schonberg@adacore.com>
4274 * exp_ch4.ads, exp_ch4.adb (Build_Eq_Call): New visible
4275 subprogram, extracted from Expand_Composite_Equality, to handle
4276 properly the composition of equality for variant record types.
4277 * exp_ch3.adb (MAke_Eq_If): Use Build_Eq_Call for each
4278 component, to handle properly the case of a component with a
4279 user-defined equality. Revert to predefined equality if the
4280 user-defined operation is abstract, to maintain compatibility
4281 with older versions,
4283 2019-07-04 Justin Squirek <squirek@adacore.com>
4285 * exp_ch3.adb (Build_Initialization_Call): Fixup
4286 *_skip_null_excluding_check argument to handle new default.
4287 (Init_Formals): Make *_skip_null_excluding_check formal default
4289 * exp_ch4.adb (Expand_N_Allocator): Add comment to note heavy
4292 2019-07-04 Bob Duff <duff@adacore.com>
4294 * sem_ch3.adb (Access_Definition): Do not create a master unless
4295 Tasking_Allowed. Otherwise, this fails on restricted runtimes.
4297 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
4299 * sem_util.adb (Propagate_DIC_Attributes): Do not propagate the
4300 Default_Initial_Condition attributes to an incomplete type.
4302 2019-07-04 Ed Schonberg <schonberg@adacore.com>
4304 * sem_attr.adb (Check_Array_Type): An array type attribute such
4305 as 'First can be applied to an unconstrained array tyope when
4306 the attribute reference appears within an aspect specification
4307 and the prefix is a current instance, given that the prefix of
4308 the attribute will become a formal of the subprogram that
4309 implements the aspect (typically a predicate check).
4311 2019-07-04 Piotr Trojanek <trojanek@adacore.com>
4313 * sem_util.adb (Yields_Synchronized_Object): Fix typos in
4316 2019-07-04 Yannick Moy <moy@adacore.com>
4318 * sem_util.adb (Yields_Synchronized_Object): Adapt to new SPARK
4321 2019-07-04 Yannick Moy <moy@adacore.com>
4323 * sem_spark.adb (Check_Statement): Only check permission of
4324 object in extended return when it is of a deep type.
4326 2019-07-04 Justin Squirek <squirek@adacore.com>
4328 * sem_ch12.adb (Perform_Appropriate_Analysis): Added for
4329 selecting which type of analysis based on wheither the
4330 instantiation is a generic at the library-level. In which case
4331 expansion during analysis.
4332 (Preanalyze_Actuals): Modify calls to Analyze to use the new
4335 2019-07-04 Ed Schonberg <schonberg@adacore.com>
4337 * exp_unst.adb: Handle conditional expressions.
4339 2019-07-04 Yannick Moy <moy@adacore.com>
4341 * sem_spark.adb (Check_Package_Spec, Check_Package_Body): Only
4342 analyze parts of the code marked in SPARK.
4344 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
4346 * erroutc.adb, exp_aggr.adb, inline.adb, opt.adb, sem_ch3.adb:
4349 2019-07-04 Yannick Moy <moy@adacore.com>
4351 * sem_spark.adb (Explanation, Get_Expl): New functions to get
4352 the explanation for a permission mismatch.
4353 (Perm_Error, Perm_Mismatch, Perm_Error_Loop_Exit): Take
4354 explanation into account for issuing a more precise error
4356 (Set_Perm_Prefixes, Set_Perm_Extensions,
4357 Set_Perm_Extensions_Move): Pass suitable argument for the
4360 2019-07-04 Arnaud Charlet <charlet@adacore.com>
4362 * exp_aggr.adb (In_Place_Assign_OK): Moved to top level and add
4363 support for record aggregates.
4364 (Component_Check): Use Is_CCG_Supported_Aggregate instead of a
4365 similar local predicate.
4366 (Convert_To_Assignments): Take advantage of In_Place_Assign_OK
4367 predicate when possible.
4368 (Is_CCG_Supported_Aggregate): Return False for records with
4369 representation clauses and fix the logic for dealing with nested
4372 2019-07-04 Piotr Trojanek <trojanek@adacore.com>
4374 * opt.adb (Set_Config_Switches): Keep assertions policy as
4375 enabled when analysing internal units in GNATprove mode.
4377 2019-07-04 Arnaud Charlet <charlet@adacore.com>
4379 * exp_ch4.adb (Expand_Short_Circuit_Operator): Strip
4380 N_Variable_Reference_Marker when checking for the presence of
4383 2019-07-04 Arnaud Charlet <charlet@adacore.com>
4385 * exp_aggr.adb (Check_Component): Take into account type
4388 2019-07-04 Dmitriy Anisimkov <anisimko@adacore.com>
4390 * doc/gnat_ugn/platform_specific_information.rst: Document
4391 Windows socket timeout particularity.
4392 * gnat_ugn.texi: Regenerate.
4393 * gsocket.h: Include versionhelpers.h.
4394 * socket.c (__gnat_minus_500ms): New function.
4395 * libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): New
4397 * libgnat/g-socket.adb (Set_Socket_Option): Refactor to remove
4398 500ms from the requested timeout only on old Windows version.
4400 2019-07-04 Thomas Quinot <quinot@adacore.com>
4402 * get_scos.adb: Remove bogus, dead code.
4404 2019-07-04 Ed Schonberg <schonberg@adacore.com>
4406 * sem_dim.adb (Analyze_Dimension_Array_Aggregate): If the
4407 component is an entity name, its dimensions are those of its
4410 2019-07-03 Bob Duff <duff@adacore.com>
4412 * doc/gnat_ugn/gnat_utility_programs.rst: Document new flags in
4415 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
4417 * binde.adb: Remove with clause for System.OS_Lib.
4418 (Force_Elab_Order): Refactor the majority of the code in Butil.
4419 Use the new forced units iterator to obtain unit names.
4420 * bindo-builders.adb: Add with and use clauses for Binderr,
4421 Butil, Opt, Output, Types, GNAT, and GNAT.Dynamic_HTables. Add
4422 a hash table which maps units to line number in the forced
4423 elaboration order file.
4424 (Add_Unit): New routine.
4425 (Build_Library_Graph): Create forced edges between pairs of
4426 units listed in the forced elaboration order file.
4427 (Create_Forced_Edge, Create_Forced_Edges, Destroy_Line_Number,
4428 Duplicate_Unit_Error, Hash_Unit, Internal_Unit_Info,
4429 Is_Duplicate_Unit, Missing_Unit_Info): New routines.
4430 * bindo-graphs.adb (Is_Internal_Unit, Is_Predefined_Unit):
4431 Refactor some of the behavior to Bindo-Units.
4432 * bindo-graphs.ads: Enable the enumeration literal for forced
4434 * bindo-units.adb, bindo-units.ads (Is_Internal_Unit,
4435 Is_Predefined_Unit): New routines.
4436 * butil.adb: Add with and use clauses for Opt, GNAT, and
4437 System.OS_Lib. Add with clause for Unchecked_Deallocation.
4438 (Has_Next, Iterate_Forced_Units, Next, Parse_Next_Unit_Name,
4439 Read_Forced_Elab_Order_File): New routines.
4440 * butil.ads: Add with and use clauses for Types. Add new
4441 iterator over the units listed in the forced elaboration order
4443 (Has_Next, Iterate_Forced_Units, Next): New routine.
4444 * namet.adb, namet.ads (Present): New routine.
4446 2019-07-03 Bob Duff <duff@adacore.com>
4448 * sem_ch3.adb (Access_Definition): The code was creating a
4449 master in the case where the designated type is a class-wide
4450 interface type. Create a master in the noninterface case as
4451 well. That is, create a master for all limited class-wide types.
4453 2019-07-03 Yannick Moy <moy@adacore.com>
4455 * erroutc.adb (Sloc_In_Range): New function to determine whether
4456 the range of a pragma Warnings covers a location, taking
4457 instantiations into account.
4459 2019-07-03 Johannes Kanig <kanig@adacore.com>
4461 * osint.ads, osint.adb (Get_First_Main_File_Name): New routine
4462 to access the first file provided on the command line.
4464 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4466 * inline.adb (Process_Formals_In_Aspects): New procedure within
4467 Expand_Inlined_Call, to perform a replacement of references to
4468 formals that appear in aspect specifications within the body
4471 2019-07-03 Justin Squirek <squirek@adacore.com>
4473 * sem_ch8.adb (Analyze_Object_Renaming): Add call to search for
4474 the appropriate actual subtype of the object renaming being
4476 (Check_Constrained_Object): Minor cleanup.
4478 2019-07-03 Yannick Moy <moy@adacore.com>
4480 * sem_spark.adb (Get_Observed_Or_Borrowed_Expr): New function to
4481 return go through traversal function call.
4482 (Check_Type): Consistently use underlying type.
4483 (Get_Perm): Adapt for case of elaboration code where variables
4484 are not declared in the environment. Remove incorrect handling
4485 of borrow and observe.
4487 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
4489 * inline.adb (Build_Return_Object_Formal): New routine.
4490 (Can_Split_Unconstrained_Function): Code clean up.
4491 (Copy_Formals,Copy_Return_Object): New routines.
4492 (Split_Unconstrained_Function): Code clean up and refactoring.
4494 2019-07-03 Gary Dismukes <dismukes@adacore.com>
4496 * bindo-augmentors.adb, bindo-augmentors.ads,
4497 bindo-builders.ads, bindo-elaborators.adb, sem_ch12.adb,
4498 sem_ch13.adb, sem_spark.adb, sinfo.ads: Minor editorial
4499 corrections and reformatting.
4501 2019-07-03 Bob Duff <duff@adacore.com>
4503 * sem_warn.adb (Check_Infinite_Loop_Warning): Avoid the warning
4504 if an Iterator_Specification is present.
4506 2019-07-03 Bob Duff <duff@adacore.com>
4508 * doc/gnat_ugn/gnat_utility_programs.rst: Document default
4511 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
4513 * ali.adb: Add with and use clauses for GNAT,
4514 GNAT.Dynamic_HTables, and Snames. Add a map from invocation
4515 signature records to invocation signature ids. Add various
4516 encodings of invocation-related attributes. Sort and update
4517 table Known_ALI_Lines.
4518 (Add_Invocation_Construct, Add_Invocation_Relation,
4519 Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
4520 Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
4521 Code_To_Invocation_Graph_Line_Kind, Destroy, Hash): New
4523 (Initialize_ALI): Sort the initialization sequence. Add
4524 initialization for all invocation-related tables.
4525 (Invocation_Construct_Kind_To_Code,
4526 Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
4527 Invocation_Signature_Of, Present): New routines.
4528 (Scan_ALI): Add the default values for invocation-related ids.
4529 Scan invocation graph lines.
4530 (Scan_Invocation_Graph_Line): New routine.
4531 * ali.ads: Add with clause for GNAT.Dynamic_Tables. Add types
4532 for invocation constructs, relations, and signatures. Add
4533 tables for invocation constructs, relations, and signatures.
4534 Update Unit_Record to capture invocation-related ids. Relocate
4535 table Unit_Id_Tables and subtypes Unit_Id_Table, Unit_Id_Array
4537 (Add_Invocation_Construct, Add_Invocation_Relation,
4538 Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
4539 Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
4540 Code_To_Invocation_Graph_Line_Kind,
4541 Invocation_Construct_Kind_To_Code,
4542 Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
4543 Invocation_Signature_Of, Present): New routines.
4544 * binde.adb: Add with and use clause for Types. Add use clause
4545 for ALI.Unit_Id_Tables;
4546 * binde.ads: Relocate table Unit_Id_Tables and subtypes
4547 Unit_Id_Table, Unit_Id_Array to ALI.
4548 * bindgen.adb: Remove with and use clause for ALI.
4549 * bindgen.ads: Remove with and use clause for Binde. Add with
4550 and use clause for ALI.
4551 * bindo.adb, bindo.ads, bindo-augmentors.adb,
4552 bindo-augmentors.ads, bindo-builders.adb, bindo-builders.ads,
4553 bindo-diagnostics.adb, bindo-diagnostics.ads,
4554 bindo-elaborators.adb, bindo-elaborators.ads, bindo-graphs.adb,
4555 bindo-graphs.ads, bindo-units.adb, bindo-units.ads,
4556 bindo-validators.adb, bindo-validators.ads, bindo-writers.adb,
4557 bindo-writers.ads: New units.
4558 * debug.adb: Use and describe GNAT debug switches -gnatd_F and
4559 -gnatd_G. Add GNATbind debug switches in the ranges dA .. dZ,
4560 d.a .. d.z, d.A .. d.Z, d.1 .. d.9, d_a .. d_z, d_A .. d_Z, and
4561 d_1 .. d_9. Use and describe GNATbind debug switches -d_A,
4562 -d_I, -d_L, -d_N, -d_O, -d_T, and -d_V.
4563 * exp_util.adb, exp_util.ads (Exceptions_OK): Relocate to
4565 * gnatbind.adb: Add with and use clause for Bindo. Use the new
4566 Bindo elaboration order only when -d_N is in effect.
4568 (Column, Extra, Invoker, Kind, Line, Locations, Name, Placement,
4569 Scope, Signature, Target): New routines.
4570 (Write_ALI): Output all invocation-related data.
4571 (Write_Invocation_Graph): New routine.
4572 * lib-writ.ads: Document the invocation graph ALI line.
4573 * namet.adb, namet.ads (Present): New routines.
4574 * sem_ch8.adb (Find_Direct_Name): Capture the status of
4575 elaboration checks and warnings of an identifier.
4576 (Find_Expanded_Name): Capture the status of elaboration checks
4577 and warnings of an expanded name.
4578 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Ensure
4579 that invocation graph-related data within the body of the main
4580 unit is encoded in the ALI file.
4581 (Analyze_Generic_Subprogram_Declaration): Ensure that invocation
4582 graph-related data within the body of the main unit is encoded
4584 (Analyze_Package_Instantiation): Perform minimal decoration of
4585 the instance entity.
4586 (Analyze_Subprogram_Instantiation): Perform minimal decoration
4587 of the instance entity.
4588 * sem_elab.adb: Perform heavy refactoring of all code. The unit
4589 is now split into "services" which specialize in one area of ABE
4590 checks. Add processing in order to capture invocation-graph
4591 related attributes of the main unit, and encode them in the ALI
4592 file. The Processing phase can now operate in multiple modes,
4593 all described by type Processing_Kind. Scenarios and targets
4594 are now distinct at the higher level, and carry their own
4595 representations. This eliminates the need to constantly
4596 recompute their attributes, and offers the various processors a
4597 uniform interface. The various initial states of the Processing
4598 phase are now encoded using type Processing_In_State, and
4599 xxx_State constants.
4600 * sem_elab.ads: Update the literals of type
4601 Enclosing_Level_Kind. Add Inline pragmas on several routines.
4602 * sem_prag.adb (Process_Inline): Ensure that invocation
4603 graph-related data within the body of the main unit is encoded
4605 * sem_util.adb (Enclosing_Generic_Body, Enclosing_Generic_Unit):
4607 (Exceptions_OK): Relocated from Sem_Util.
4608 (Mark_Save_Invocation_Graph_Of_Body): New routine.
4609 * sem_util.ads (Exceptions_OK): Relocated from Sem_Util.
4610 (Mark_Save_Invocation_Graph_Of_Body): New routine.
4611 * sinfo.adb (Is_Elaboration_Checks_OK_Node): Now applicable to
4612 N_Variable_Reference_Marker.
4613 (Is_Elaboration_Warnings_OK_Node): Now applicable to
4614 N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
4615 (Is_Read): Use Flag4.
4616 (Is_SPARK_Mode_On_Node): New applicable to
4617 N_Variable_Reference_Marker.
4618 (Is_Write): Use Flag5.
4619 (Save_Invocation_Graph_Of_Body): New routine.
4620 (Set_Is_Elaboration_Checks_OK_Node): Now applicable to
4621 N_Variable_Reference_Marker.
4622 (Set_Is_Elaboration_Warnings_OK_Node): Now applicable to
4623 N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
4624 (Set_Is_SPARK_Mode_On_Node): New applicable to
4625 N_Variable_Reference_Marker.
4626 (Set_Save_Invocation_Graph_Of_Body): New routine.
4627 * sinfo.ads: Update the documentation of attributes
4628 Is_Elaboration_Checks_OK_Node, Is_Elaboration_Warnings_OK_Node,
4629 Is_SPARK_Mode_On_Node. Update the flag usage of attributes
4630 Is_Read, Is_Write. Add attribute Save_Invocation_Graph_Of_Body
4631 and update its occurrence in nodes.
4632 (Save_Invocation_Graph_Of_Body): New routine along with pragma
4634 (Set_Save_Invocation_Graph_Of_Body): New routine along with
4636 * switch-b.adb (Scan_Binder_Switches): Refactor the scanning of
4638 (Scan_Debug_Switches): New routine.
4639 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads (Contains): New routine.
4640 * libgnat/g-graphs.adb (Associate_Vertices): Update the use of
4641 Component_Vertex_Iterator.
4642 (Contains_Component, Contains_Edge, Contains_Vertex, Has_Next):
4644 (Iterate_Component_Vertices): New routine.
4645 (Iterate_Vertices): Removed.
4646 (Next): Update the parameter profile.
4647 (Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
4649 * libgnat/g-graphs.ads: Update the initialization of
4650 No_Component. Add type Component_Vertex_Iterator. Remove type
4652 (Has_Next): Add new versions and remove old ones.
4653 (Iterate_Component_Vertices): New routine.
4654 (Iterate_Vertices): Removed.
4655 (Next): Add new versions and remove old ones.
4656 (Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
4658 * libgnat/g-sets.adb (Contains): Reimplemented.
4659 * gcc-interface/Make-lang.in (GNATBIND_OBJS): Add
4660 GNAT.Dynamic_HTables, GNAT.Graphs and Bindo units.
4661 * rtsfind.ads: Remove extra space.
4663 2019-07-03 Yannick Moy <moy@adacore.com>
4665 * sem_spark.adb: Add support for locally borrowing and observing
4667 (Get_Root_Object): Add parameter Through_Traversal to denote
4668 when we are interesting in getting to the traversed parameter.
4669 (Is_Prefix_Or_Almost): New function to support detection of
4670 illegal access to borrowed or observed paths.
4671 (Check_Pragma): Add analysis of assertion pragmas.
4673 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4675 * sem_ch13.adb (Build_Predicate_Functions): In a generic context
4676 we do not build the bodies of predicate fuctions, but the
4677 expression in a static predicate must be elaborated to allow
4678 case coverage checking within the generic unit.
4679 (Build_Discrete_Static_Predicate): In a generic context, return
4680 without building function body once the
4681 Static_Discrete_Predicate expression for the type has been
4684 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
4686 * bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
4687 sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
4689 2019-07-03 Bob Duff <duff@adacore.com>
4691 * par-ch3.adb (P_Defining_Identifier): Call
4692 Check_Defining_Identifier_Casing.
4693 * style.ads, styleg.ads, styleg.adb
4694 (Check_Defining_Identifier_Casing): New procedure to check for
4695 mixed-case defining identifiers.
4696 * stylesw.ads, stylesw.adb (Style_Check_Mixed_Case_Decls): New
4697 flag for checking for mixed-case defining identifiers.
4698 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
4699 Document new feature.
4700 * gnat_ugn.texi: Regenerate.
4702 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
4704 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
4705 (Warning message control): Document that -gnatw.z/Z apply to
4707 * freeze.adb (Freeze_Entity): Give -gnatw.z warning for array
4708 types as well, but not if the specified alignment is the minimum
4710 * gnat_ugn.texi: Regenerate.
4712 2019-07-03 Bob Duff <duff@adacore.com>
4714 * einfo.ads, exp_util.adb, layout.ads, sinfo.ads: Spell "laid"
4717 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4719 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): No error
4720 message on attribute applied to a renaming when the renamed
4721 object is an aggregate (from code reading).
4722 (Check_Aspect_At_End_Of_Declarations): In a generic context
4723 where freeze nodes are not generated, the original expression
4724 for an aspect may need to be analyzed to precent spurious
4725 conformance errors when compared with the expression that is
4726 anakyzed at the end of the current declarative list.
4728 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
4730 * layout.adb (Layout_Type): Do not set the component size of an
4731 array with a scalar component if the component type is
4734 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4736 * inline.adb (Make_Loop_Labels_Unique): New procedure to modify
4737 the source code of subprograms that are inlined by the
4738 front-end, to prevent accidental duplication between loop labels
4739 in the inlined code and the code surrounding the inlined call.
4741 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
4743 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update
4744 the section on resolving elaboration circularities to eliminate
4745 certain combinations of switches which together do not produce
4746 the desired effect and confuse users.
4747 * gnat_ugn.texi: Regenerate.
4749 2019-07-03 Arnaud Charlet <charlet@adacore.com>
4751 * bindgen.adb (Gen_Main): Disable generation of reference to
4752 Ada_Main_Program_Name for CCG.
4753 * bindusg.adb (Display): Add -G to the command-line usage for
4755 * opt.ads (Generate_C_Code): Update comment.
4756 * switch-b.adb (Scan_Binder_Switches): Add handling for -G.
4758 2019-07-03 Arnaud Charlet <charlet@adacore.com>
4760 * sem_ch7.adb (Has_Referencer): Do not consider inlined
4761 subprograms when generating C code, which allows us to generate
4762 static inline subprograms.
4764 2019-07-03 Justin Squirek <squirek@adacore.com>
4766 * sem_ch6.adb (Check_Conformance): Add expression checking for
4767 constant modifiers in anonymous access types (in addition to
4768 "non-null" types) so that they are considered "matching" for
4769 subsequent conformance tests.
4771 2019-07-03 Arnaud Charlet <charlet@adacore.com>
4773 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
4774 Clarify wording on No_Multiple_Elaboration.
4775 * gnat_rm.texi: Regenerate.
4777 2019-07-03 Ed Schonberg <schonberg@adacore.com>
4779 * sem_ch8.adb (Find_Selected_Component): If the prefix is the
4780 current instance of a type or subtype, complete the resolution
4781 of the name by finding the component of the type denoted by the
4784 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
4786 * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C):
4787 Document that boolean types with convention C now map to C99 bool.
4788 * gnat_rm.texi: Regenerate.
4790 2019-07-03 Javier Miranda <miranda@adacore.com>
4792 * exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup:
4793 removing code that it is now never executed in the CCG compiler
4796 2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
4798 * libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
4801 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4803 * sem_ch12.adb (Is_Defaulted): New predicate in
4804 Check_Formal_Package_Intance, to skip the conformance of checks
4805 on parameters of a formal package that are defaulted,
4807 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4809 * checks.adb, exp_ch9.adb, exp_unst.adb, sem_ch4.adb,
4810 sem_prag.adb, sem_spark.adb: Minor reformatting.
4812 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4814 * sem_attr.adb (Analyze_Attribute, case Enum_Rep): Allow prefix
4815 of attribute to be an attribute reference of a discrete type.
4817 2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
4819 * sem_ch12.adb (Analyze_Subprogram_Instantiation): Move up
4820 handling of Has_Pragma_Inline_Always and deal with
4821 Has_Pragma_No_Inline.
4823 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4825 * sem_ch3.adb (Build_Derived_Record_Type): If the parent type is
4826 declared as a subtype of a private type with an inherited
4827 discriminant constraint, its generated full base appears as a
4828 record subtype, so we need to retrieve its oen base type so that
4829 the inherited constraint can be applied to it.
4831 2019-07-01 Yannick Moy <moy@adacore.com>
4833 * sem_spark.adb: Completely rework the algorithm for ownership
4834 checking, as the rules in SPARK RM have changed a lot.
4835 * sem_spark.ads: Update comments.
4837 2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
4839 * gsocket.h (Has_Sockaddr_Len): Use the offset of sin_family offset in
4840 the sockaddr_in structure to determine the existence of length field
4841 before the sin_family.
4843 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4845 * sem_prag.adb (Analyze_Pragma, case Weak_External): Pragma only
4846 applies to entities with run-time addresses, not to types.
4848 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4850 * einfo.adb, sem_ch7.adb, sem_prag.adb, sem_util.adb: Update
4851 references to the SPARK RM after the removal of Rule 7.1.4(5).
4853 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4855 * sysdep.c: Cleanup references to LynuxWorks in docs and
4858 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4860 * checks.adb (Insert_Valid_Check): Do not apply validity check
4861 to variable declared within a protected object that uses the
4862 Lock_Free implementation, to prevent unwarranted constant
4863 folding, because entities within such an object msut be treated
4866 2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
4868 * exp_ch9.adb (Check_Inlining): Deal with Has_Pragma_No_Inline.
4870 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4872 * exp_unst.adb (Visit_Node, Check_Static_Type): Improve the
4873 handling of private and incomplete types whose full view is an
4874 access type, to detect additional uplevel references in dynamic
4875 bounds. This is relevant to N_Free_Statement among others that
4876 manipulate types whose full viww may be an access type.
4878 2019-07-01 Pat Rogers <rogers@adacore.com>
4880 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Correct
4881 size indicated for R as a component of an array.
4882 * gnat_rm.texi: Regenerate.
4884 2019-07-01 Justin Squirek <squirek@adacore.com>
4886 * libgnat/s-win32.ads: Add definition for ULONG, modify
4887 OVERLAPPED type, and add appropriate pragmas.
4889 2019-07-01 Bob Duff <duff@adacore.com>
4891 * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is
4894 2019-07-01 Yannick Moy <moy@adacore.com>
4896 * sem_ch4.adb (Operator_Check): Refine error message.
4898 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4900 * libgnat/a-calend.ads: Revert "Global => null" contracts on
4903 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
4905 * exp_attr.adb, libgnat/g-graphs.ads: Fix typos in comments:
4906 componant -> component.
4908 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4910 * libgnat/g-graphs.adb: Use type Directed_Graph rather than
4911 Instance in various routines.
4912 * libgnat/g-graphs.ads: Change type Instance to Directed_Graph.
4913 Update various routines that mention the type.
4915 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4917 * libgnat/g-sets.adb: Use type Membership_Set rathern than
4918 Instance in various routines.
4919 * libgnat/g-sets.ads: Change type Instance to Membership_Set.
4920 Update various routines that mention the type.
4922 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4924 * libgnat/g-lists.adb: Use type Doubly_Linked_List rather than
4925 Instance in various routines.
4926 * libgnat/g-lists.ads: Change type Instance to
4927 Doubly_Linked_List. Update various routines that mention the
4930 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4932 * libgnat/g-dynhta.adb: Use type Dynamic_Hash_Table rather than
4933 Instance in various routines.
4934 * libgnat/g-dynhta.ads: Change type Instance to
4935 Dynamic_Hash_Table. Update various routines that mention the
4938 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4940 * exp_attr.adb, exp_ch7.adb, exp_unst.adb, sem_ch3.adb,
4941 sem_util.adb, uintp.adb, uintp.ads: Minor reformatting.
4943 2019-07-01 Javier Miranda <miranda@adacore.com>
4945 * exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of
4946 'Min/'Max on integer, enumeration, fixed point and floating
4947 point types since the CCG backend now provides in file
4948 standard.h routines to support it.
4950 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4952 * impunit.adb: Add GNAT.Graphs to list Non_Imp_File_Names_95.
4953 * Makefile.rtl, gcc-interface/Make-lang.in: Register unit
4955 * libgnat/g-dynhta.adb: Various minor cleanups (use Present
4956 rather than direct comparisons).
4957 (Delete): Reimplement to use Delete_Node.
4958 (Delete_Node): New routine.
4959 (Destroy_Bucket): Invoke the provided destructor.
4960 (Present): New routines.
4961 * libgnat/g-dynhta.ads: Add new generic formal Destroy_Value.
4962 Use better names for the components of iterators.
4963 * libgnat/g-graphs.adb, libgnat/g-graphs.ads: New unit.
4964 * libgnat/g-lists.adb: Various minor cleanups (use Present
4965 rather than direct comparisons).
4966 (Delete_Node): Invoke the provided destructor.
4967 (Present): New routine.
4968 * libgnat/g-lists.ads: Add new generic formal Destroy_Element.
4969 Use better names for the components of iterators.
4970 (Present): New routine.
4971 * libgnat/g-sets.adb, libgnat/g-sets.ads (Destroy, Preset,
4972 Reset): New routines.
4974 2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
4976 * libgnat/g-sothco.adb (Get_Address): Fix the case when AF_INET6
4979 2019-07-01 Ed Schonberg <schonberg@adacore.com>
4981 * exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value):
4982 Resolve result of call to Get_Simple_Init_Val, which may be a
4983 conversion of a literal.
4985 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
4987 * freeze.adb (Freeze_Expression): Remove the horrible useless
4988 name hiding of N. Insert the freeze nodes generated by the
4989 expression prior to the expression when the nearest enclosing
4992 2019-07-01 Pierre-Marie de Rodat <derodat@adacore.com>
4994 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix
4995 formatting issues in the -gnatR section.
4996 * gnat_ugn.texi: Regenerate.
4998 2019-06-30 Iain Sandoe <iain@sandoe.co.uk>
5000 * gnatlink.adb (Link_Step): Remove duplicate -static-libgcc switches.
5001 Push -shared-libgcc explicitly, when it is the target default (unless
5002 overidden by the static flag).
5003 When the user has put an instance of shared/static-libgcc do not push
5004 a duplicate of this.
5006 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5008 * gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED,
5009 and tweak comment on the assertion about the scopes of Itypes. Do not
5010 skip the regular processing for Itypes that are E_Record_Subtype with
5011 a Cloned_Subtype. Get the Cloned_Subtype for every E_Record_Subtype
5012 if the type is dummy and hasn't got its own freeze node.
5013 <E_Record_Subtype>: Save again the DECL of the Cloned_Subtype, if any.
5014 <E_Access_Subtype>: Save again the DECL of the equivalent type.
5015 (Gigi_Equivalent_Type) <E_Access_Subtype>: New case.
5017 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5019 * gcc-interface/utils.c (unchecked_convert): Tweak comment. Only skip
5020 dereferences when padding to have the same size on both sides. Do it
5021 for destination types with self-referential size too.
5023 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5025 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: If the
5026 type requires strict alignment, then set the RM size to the type size.
5027 Rework handling of alignment and sizes of tagged types in ASIS mode.
5028 (validate_size): Rename local variable and remove special handling for
5029 strict-alignment types.
5030 * gcc-interface/utils.c (finish_record_type): Constify local variables
5031 and use properly typed constants.
5033 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5035 * gcc-interface/decl.c (gnat_to_gnu_field): Rework error messages for
5036 fields requiring strict alignment, add explicit test on Storage_Unit
5037 for position and size, and mention type alignment for position.
5039 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5041 * gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
5042 the main variant of a type, if any.
5044 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5046 * gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
5047 missing guard for the presence of TYPE_CANONICAL.
5048 (set_reverse_storage_order_on_array_type): Likewise.
5050 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
5052 * gcc-interface/gigi.h (make_packable_type): Remove default value.
5053 (value_factor_p): Tweak prototype.
5054 * gcc-interface/decl.c (gnat_to_gnu_entity): Add comment.
5055 (gnat_to_gnu_component_type): Likewise.
5056 (gnat_to_gnu_field): Likewise. Fetch the position of the field earlier
5057 and simplify the condition under which the type is packed. Declare
5058 local variable is_bitfield. Pass 1 as max_align to make_packable_type
5059 if it is set to true.
5060 (copy_and_substitute_in_layout): Pass 0 to make_packable_type.
5061 * gcc-interface/utils.c (make_packable_array_type): New function.
5062 (make_packable_type): Use it to rewrite the type of array field.
5063 (maybe_pad_type): Pass align parameter to make_packable_type.
5064 (create_field_decl): Minor tweaks.
5065 (value_factor_p): Assert that FACTOR is a power of 2 and replace the
5066 modulo computation by a masking operation.
5068 2019-06-25 Eric Botcazou <ebotcazou@adacore.com>
5070 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove superfluous test
5072 * gcc-interface/gigi.h (maybe_character_type): Fix formatting.
5073 (maybe_character_value): Likewise.
5075 2019-06-24 Jan Hubicka <jh@suse.cz>
5077 * gcc-interface/decl.c (gnat_to_gnu_entity): Check that
5078 type is array or integer prior checking string flag.
5079 * gcc-interface/gigi.h (maybe_character_type): Likewise.
5080 (maybe_character_value): Likewise.
5082 2019-06-24 Martin Sebor <msebor@redhat.com>
5084 * gcc-interface/utils.c (handle_nonnull_attribute): Quote attribute
5087 2019-06-18 Arnaud Charlet <charlet@adacore.com>
5090 * sem_ch5.adb (Analyze_Loop_Statement): Avoid exception propagation
5091 during normal processing.
5093 2019-06-17 Arnaud Charlet <charlet@adacore.com>
5096 * exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two
5097 conditions to avoid a unnecessary exception propagation in the default
5100 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5102 * gcc-interface/utils.c (handle_stack_protect_attribute): Move around.
5104 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5106 * doc/gnat_rm/implementation_defined_pragmas.rst (Machine_Attribute):
5107 Document additional optional parameters.
5108 * sem_prag.adb (Analyze_Pragma) <Pragma_Machine_Attribute>: Accept
5109 more than one optional parameter.
5110 * gcc-interface/decl.c (prepend_one_attribute_pragma): Alphabetize
5111 the list of supported pragmas. Simplify the handling of parameters
5112 and add support for more than one optional parameter.
5113 * gcc-interface/utils.c (attr_cold_hot_exclusions): New constant.
5114 (gnat_internal_attribute_table): Add entry for no_icf, noipa, flatten,
5115 used, cold, hot, target and target_clones.
5116 (begin_subprog_body): Do not create the RTL for the subprogram here.
5117 (handle_noicf_attribute): New static function.
5118 (handle_noipa_attribute): Likewise.
5119 (handle_flatten_attribute): Likewise.
5120 (handle_used_attribute): Likewise.
5121 (handle_cold_attribute): Likewise.
5122 (handle_hot_attribute): Likewise.
5123 (handle_target_attribute): Likewise.
5124 (handle_target_clones_attribute): Likewise.
5126 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5128 * gcc-interface/trans.c (lvalue_required_for_attribute_p): Return 0
5130 (Identifier_to_gnu): Use the actual subtype for a reference to a
5131 packed array in a return statement.
5132 (Attribute_to_gnu) <Attr_Size>: Do not strip VIEW_CONVERT_EXPRs from
5133 the prefix in every case.
5135 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5137 * gcc-interface/trans.c (gnat_to_gnu): Remove superfluous tests on
5138 Backend_Overflow_Checks_On_Target and rework comments.
5140 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5142 * gcc-interface/trans.c (walk_nesting_tree): New static function.
5143 (finalize_nrv): Use it to walk the entire nesting tree.
5145 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5147 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Remove
5148 obsolete test on Is_For_Access_Subtype.
5150 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5152 * gcc-interface/decl.c (components_to_record): Set a name on the type
5153 created for the REP part, if any.
5154 * gcc-interface/utils.c (finish_record_type): Only take the maximum
5155 when merging sizes for a variant part at offset 0.
5156 (merge_sizes): Rename has_rep parameter into max.
5158 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5160 * gcc-interface/utils.c (gnat_internal_attribute_table): Add support
5161 for stack_protect attribute.
5162 (handle_stack_protect_attribute): New static function.
5164 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
5166 * gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return
5167 false if the internal builtin uses a variable list.
5169 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5171 * gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary
5172 created out of addressability concerns if it's for the _Init parameter
5173 of an initialization procedure.
5175 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5177 * gcc-interface/ada-builtin-types.def: New file.
5178 * gcc-interface/ada-builtins.def: Likewise.
5179 * gcc-interface/ada-tree.h (BUILT_IN_LIKELY): New macro.
5180 (BUILT_IN_UNLIKELY): Likewise.
5181 * gcc-interface/trans.c (independent_iterations_p): Initialize the
5182 auto-vector to 16 elements.
5183 (Call_to_gnu): Remove local variable and change the vector of actual
5184 parameters to an auto-vector. Do not convert actual parameters to
5185 the argument type for front-end built-in functions. Add support for
5186 front-end built-in functions.
5187 (build_noreturn_cond): Use internal instead of built-in function.
5188 * gcc-interface/utils.c (c_builtin_type): Include ada-builtin-types.def
5189 (install_builtin_function_types): Likewise.
5190 (install_builtin_functions): Include ada-builtins.def first.
5192 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5194 * gcc-interface/utils.c (maybe_pad_type): Issue the warning for the
5195 specific case of component types preferably.
5197 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5199 * gcc-interface/trans.c (Identifier_to_gnu): Minor tweaks.
5200 (gnat_to_gnu): Do not convert the result if it is a reference to an
5201 unconstrained array used as the prefix of an attribute reference that
5204 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5206 * gcc-interface/trans.c (Gigi_Types_Compatible): New predicate.
5207 (Identifier_to_gnu): Use it to assert that the type of the identifier
5208 and that of its entity are compatible for gigi. Rename a couple of
5209 local variables and separate the processing of the result type.
5211 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5213 * gcc-interface/trans.c (Call_to_gnu): Use the unpadded type when
5214 putting back an intermediate conversion the type of the actuals.
5216 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
5218 * gcc-interface/trans.c (gnat_to_gnu) <Shift operations>: Convert the
5219 count to the unsigned version of its base type before proceeding.
5221 2019-05-16 Martin Sebor <msebor@redhat.com>
5223 * gcc-interface/trans.c (check_inlining_for_nested_subprog): Quote
5226 2019-05-08 Arnaud Charlet <charlet@adacore.com>
5228 * standard.ads.h: New file.
5230 2019-05-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5232 * gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
5235 2019-04-29 Michael K. Darling <darlingm@gmail.com>
5237 * gnatvsn.ads: Bump Library_Version to 10.
5239 2019-04-24 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
5240 Bernd Edlinger <bernd.edlinger@hotmail.de>
5241 Jakub Jelinek <jakub@redhat.com>
5244 * raise-gcc.c (TARGET_ATTRIBUTE): Define.
5245 (continue_unwind, personality_body, PERSONALITY_FUNCTION): Add
5248 2019-04-07 Eric Botcazou <ebotcazou@adacore.com>
5250 * libgnat/i-cexten.ads (CFloat_128): New type.
5252 2019-03-22 Dmitriy Anisimkov <anisimko@adacore.com>
5255 * libgnat/g-socket.adb (Bind_Socket, Connect_Socket,
5256 Send_Socket): Fix the computation of structure lengths passed to
5258 (Is_IPv6_Address): Fix the number of expected colons.
5260 2019-03-11 Martin Liska <mliska@suse.cz>
5262 * gcc-interface/misc.c (gnat_post_options): Wrap option name in string
5263 format message and fix GNU coding style.
5265 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
5267 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Minor tweak.
5268 * gcc-interface/utils.c (convert): Do not pad when doing an unchecked
5269 conversion here. Use TREE_CONSTANT throughout the function.
5270 (unchecked_convert): Also pad if the source is a CONSTRUCTOR and the
5271 destination is a more aligned array type or a larger aggregate type,
5272 but not between original and packable versions of a type.
5274 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
5276 * gcc-interface/utils.c (max_size) <tcc_unary>: Be prepared for an
5277 operand with VOID_TYPE.
5279 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
5281 * gcc-interface/trans.c (elaborate_all_entities): Do not elaborate the
5282 entities of a package renaming another one.
5284 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
5286 * gcc-interface/trans.c (Regular_Loop_to_gnu): Replace tests on
5287 individual flag_unswitch_loops and flag_tree_loop_vectorize switches
5288 with test on global optimize switch.
5289 (Raise_Error_to_gnu): Likewise.
5291 2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
5293 * libgnarl/s-linux__sparc.ads (ETIMEDOUT): Set to correct value.
5295 2019-02-06 Arnaud Charlet <charlet@adacore.com>
5297 * libgnarl/s-linux__x32.ads: Resync list of signals with s-linux.ads
5299 2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
5301 * repinfo.adb (List_Component_Layout): Remove superfluous space for
5303 * gcc-interface/ada-tree.h (TYPE_IS_EXTRA_SUBTYPE_P): New macro.
5304 * gcc-interface/gigi.h (create_extra_subtype): Declare.
5305 * gcc-interface/decl.c (TYPE_ARRAY_SIZE_LIMIT): Likewise.
5306 (update_n_elem): New function.
5307 (gnat_to_gnu_entity): Use create_extra_subtype to create extra subtypes
5308 instead of doing it manually.
5309 <E_Array_Type>: Use update_n_elem to compute the maximum size. Use the
5310 index type instead of base type for the bounds. Set TYPE_ARRAY_MAX_SIZE
5311 of the array to the maximum size.
5312 <E_Array_Subtype>: Create an extra subtype using the index type of the
5313 base array type for self-referential bounds. Use update_n_elem to
5314 compute the maximum size. Set TYPE_ARRAY_MAX_SIZE of the array to the
5316 (gnat_to_gnu_field): Clear DECL_NONADDRESSABLE_P on discriminants.
5317 * gcc-interface/misc.c (gnat_get_alias_set): Return the alias set of
5318 the base type for an extra subtype.
5319 (gnat_type_max_size): Remove obsolete code.
5320 * gcc-interface/trans.c (Attribute_to_gnu): Minor tweak.
5321 (can_be_lower_p): Deal with pathological types.
5322 * gcc-interface/utils.c (create_extra_subtype): New function.
5323 (create_field_decl): Minor tweak.
5324 (max_size) <tcc_reference>: Compute a better value by using the extra
5325 subtypes on the self-referential bounds.
5326 <tcc_binary>: Rewrite. Deal with "negative value" in unsigned types.
5327 <tcc_expression>: Likewise.
5328 * gcc-interface/utils2.c (compare_arrays): Retrieve the original bounds
5329 of the arrays upfront. Swap only if the second length is not constant.
5330 Use comparisons on the original bounds consistently for the null tests.
5331 (build_binary_op): Use TYPE_IS_EXTRA_SUBTYPE_P macro.
5332 (build_allocator): Minor tweak.
5334 2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
5336 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
5337 the same value for every dimension of a multidimensional array type.
5339 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
5341 * gcc-interface/trans.c (Regular_Loop_to_gnu): Use the SLOC of the
5342 iteration scheme, if present, throughout the translation.
5344 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
5346 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
5347 DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned
5348 by a call to memset if the LHS is a DECL.
5350 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
5352 * gcc-interface/trans.c (struct loop_info_d): Remove artificial field.
5353 (Loop_Statement_to_gnu): Do not set it.
5355 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
5357 * gcc-interface/trans.c (Iterate_Acc_Clause_Arg): Fix formatting.
5358 (Acc_gnat_to_gnu): Likewise.
5359 (Acc_Data_to_gnu): Likewise.
5360 (Acc_Var_to_gnu): Likewise.
5361 (Acc_Reduc_to_gnu): Likewise.
5362 (Acc_Size_List_to_gnu): Likewise.
5363 (Pragma_to_gnu) <Pragma_Acc_Loop>: Likewise.
5364 <Pragma_Acc_Data>): Likewise.
5365 (find_loop_for): Remove default value for parameters.
5366 * gcc-interface/trans.c (gnat_to_gnu) <N_Op_And>: Merge into...
5367 <N_Op_Eq>): ...this.
5369 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
5371 * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Use test on
5372 the sign bit instead of on the sign of the value.
5373 <PLUS_EXPR>: Turn addition of negative constant into subtraction.
5374 <MULT_EXPR>: Add test for degenerate case.
5375 <BIT_AND_EXPR>: Simplify.
5377 2019-01-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
5379 * s-oscons-tmplt.c (AF_INET6): Do not undefine for RTEMS.
5381 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
5384 * exp_ch11.adb: Change "can not" to "cannot".
5385 * sem_ch4.adb: Likewise.
5387 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
5390 * exp_ch9.adb: Mechanically replace "can not" with "cannot".
5391 * libgnat/s-regpat.ads: Likewise.
5392 * par-ch4.adb: Likewise.
5393 * set_targ.adb: Likewise.
5394 * types.ads: Likewise.
5396 2019-01-08 Justin Squirek <squirek@adacore.com>
5399 2018-07-31 Justin Squirek <squirek@adacore.com>
5401 * lib-writ.adb (Write_With_Lines): Modfiy the generation
5402 of dependencies within ali files so that source unit
5403 bodies are properly listed even if said bodies are
5404 missing. Perform legacy behavior in GNATprove mode.
5405 * lib-writ.ads: Modify documentation to reflect current
5409 2018-09-26 Justin Squirek <squirek@adacore.com>
5411 * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
5412 documentation and an extra conditional check for RCI
5413 units so that generated ali files will list the spec
5414 only instead of a body when a body is not found.
5416 2019-01-04 Eric Botcazou <ebotcazou@adacore.com>
5418 * gnatvsn.ads: Bump copyright year.
5420 2019-01-01 Jakub Jelinek <jakub@redhat.com>
5422 Update copyright years.
5424 * gnat_ugn.texi: Bump @copying's copyright year.
5425 * gnat_rm.texi: Likewise.
5427 Copyright (C) 2019 Free Software Foundation, Inc.
5429 Copying and distribution of this file, with or without modification,
5430 are permitted in any medium without royalty provided the copyright
5431 notice and this notice are preserved.