1 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
3 * gcc-interface/gigi.h (error_gnat_node): Delete.
4 * gcc-interface/trans.c (error_gnat_node): Likewise.
5 (gigi): Replace it with Current_Error_Node.
6 (gnat_to_gnu): Likewise.
7 * gcc-interface/utils.c (rest_of_subprog_body_compilation):
9 * gcc-interface/misc.c (internal_error_function): Do not set it.
11 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
13 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
14 code retrieving the address when a clause has already been
16 * gcc-interface/trans.c (gnat_to_gnu)
17 <N_Attribute_Definition_Clause>: For an object with a Freeze
18 node, build a meaningful expression.
20 2018-09-26 Arnaud Charlet <charlet@adacore.com>
22 * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets
24 * debug.adb: Update debug flags documentation.
26 2018-09-26 Ed Schonberg <schonberg@adacore.com>
28 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
29 analysis of preconditions specified by pragmas (rather than
30 aspects) is not delayed, and therefore expressions functions
31 that are completions do not need special handling during
34 2018-09-26 Ed Schonberg <schonberg@adacore.com>
36 * exp_unst.adb: Fix handling of up level references for entries.
38 2018-09-26 Ed Schonberg <schonberg@adacore.com>
40 * contracts.adb (Expand_Subprogram_Contract,
41 Process_Preconditions_For): Apply Freeze_Expr_Types to the
42 expression for a precondition of an expression function that is
43 a completion, when the completion appears in the private part
44 and the declaration it completes is in the visible part of the
46 * freeze.adb (Freeze_Expr_Types): Do not establish the scope of
47 the operation if it is already installed, as will be the case
48 when called to analyze the contract oc the subprogram (which
49 happens when generating code inside the subprogram body).
51 2018-09-26 Maroua Maalej <maalej@adacore.com>
53 * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global):
54 Change the operation associated to assigning to an IN parameter.
55 In SPARK, IN access-to-variable is an observe operation for a
56 function, and borrow operation for a procedure.
58 2018-09-26 Arnaud Charlet <charlet@adacore.com>
60 * vxlink.adb: Minor reformatting.
62 2018-09-26 Gary Dismukes <dismukes@adacore.com>
64 * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
67 2018-09-26 Jerome Lambourg <lambourg@adacore.com>
69 * vxlink.adb: Kill a CodePeer warning.
71 2018-09-24 Eric Botcazou <ebotcazou@adacore.com>
74 * fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
75 of 'char' as the type of the second parameter.
77 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
79 * Makefile.rtl (arm% linux-gnueabi%): Always set EH_MECHANISM to -arm.
81 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
84 * terminals.c: Do not include termio.h.
86 2018-08-27 Martin Liska <mliska@suse.cz>
88 * gcc-interface/decl.c (update_profile): Use new function
89 fndecl_built_in_p and remove check for FUNCTION_DECL if
91 * gcc-interface/gigi.h (call_is_atomic_load): Likewise.
92 * gcc-interface/utils.c (gnat_pushdecl): Likewise.
94 2018-08-23 Giuliano Belinassi <giuliano.belinassi@usp.br>
96 * exp_unst.ads: Fix typo 'exapnded' to 'expanded'.
98 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
100 * checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
101 exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
102 exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
103 lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
104 sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
105 sprint.adb: Minor reformatting.
107 2018-08-21 Jerome Lambourg <lambourg@adacore.com>
109 * vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
110 vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
111 new tool vxlink to handle VxWorks constructors in DKMs.
112 * gcc-interface/Makefile.in: add rules to build vxlink
114 2018-08-21 Ed Schonberg <schonberg@adacore.com>
116 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
117 Refine the handling of freezing types for expression functions
118 that are not completions, when analyzing the generated body for
119 the function: the body is inserted at the end of the enclosing
120 declarative part, and its analysis may freeze types declared in
121 the same scope that have not been frozen yet.
123 2018-08-21 Ed Schonberg <schonberg@adacore.com>
125 * sem_ch6.adb: Remove Freeze_Expr_Types.
126 * freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
127 sem_ch6.adb, and extended to handle other expressions that may
128 contain unfrozen types that must be frozen in their proper
130 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
131 contract is for the generated body of an expression function
132 that is a completion, traverse the expressions for pre- and
133 postconditions to freeze all types before adding the contract
134 code within the subprogram body.
136 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
138 * sem_ch10.adb: Remove the with and use clause for unit Ghost.
139 (Analyze_With_Clause): Do not mark a with clause which mentions
140 an ignored Ghost code for elimination.
142 2018-08-21 Javier Miranda <miranda@adacore.com>
144 * lib-writ.adb (Write_Unit_Information): Handle pragmas removed
147 2018-08-21 Ed Schonberg <schonberg@adacore.com>
149 * sem_ch6.adb (Check_Synchronized_Overriding): The conformance
150 between an overriding protected operation and the overridden
151 abstract progenitor operation requires subtype conformance;
152 requiring equality of return types in the case of a function is
153 too restrictive and leads to spurious errors when the return
154 type is a generic actual.
156 2018-08-21 Ed Schonberg <schonberg@adacore.com>
158 * exp_ch9.adb (Expand_N_Timed_Entry_Call,
159 Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
160 properly the scope of all entities created in blocks generated
161 by the expansion of these constructs.
163 2018-08-21 Ed Schonberg <schonberg@adacore.com>
165 * sem_ch13.adb (Build_Predicate_Functioss): Apply
166 Reset_Quantified_Variables_Scope after predicate function has
167 been analyzed, so that the scope can be reset on the generated
168 loop statements that have replaced the quantified expressions.
170 2018-08-21 Bob Duff <duff@adacore.com>
172 * einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
175 2018-08-21 Maroua Maalej <maalej@adacore.com>
177 * sem_spark.adb (Check_Call_Statement): Check global and formal
178 parameter permissions at call sites.
179 (Check_Callable_Body): Assume permissions on globals and
180 parameters depending on their modes then analyse the body
182 (Check_Declaration): Consider both deep (including elementary
183 access) object declarations and normal variables. First check
184 whether the deep object is of Ownership Aspec True or not, then,
185 depending on its initialization, assign the appropriate state.
186 Check related to non access type variables deal with
187 initialization value permissions.
188 (Check_Expression): Check nodes used in the expression being
190 (Check_Globals): Call by Check_Call_Statement to perform the
192 (Check_List): Call Check_Node on each element of the list.
193 (Check_Loop_Statement): Check the Iteration_Scheme and loop
195 (Check_Node): Main traversal procedure to check safe pointer usage.
196 (Check_Package_Body): Check subprogram's body.
197 (Check_Param_In): Take a formal and an actual parameter and
198 Check the permission of every in-mode parameter.
199 (Check_Param_Out): Take a formal and an actual parameter and
200 check the state of out-mode and in out-mode parameters.
201 (Check_Statement): Check statements other than procedure call.
202 (Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
203 related to the given name.
204 (Is_Deep): Return True if an object is of access type or has
205 subfields of access type.
206 (Perm_Error, Perm_Error_Subprogram_End): Add an error message
207 whenever the found state on the given name is different from the
208 one expected (in the statement being analyzed).
209 (Process_Path): Given an operation and a current state, call
210 Perm_Error if there is any mismatch.
211 (Return_Declarations, Return_Globals, Return_The_Global): Check
212 the state of a given name at the end of the subprogram. These
213 procedures may change depending on how we shall finally deal
214 with globals and the rhs state in a move operation.
215 (Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
216 Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
217 Setup_Parameters): Set up the new states to the given node and
218 up and down the tree after an operation.
219 (Has_Ownership_Aspect_True): This function may disappear later
220 when the Ownership Aspect will be implemented in the FE.
222 2018-08-21 Ed Schonberg <schonberg@adacore.com>
224 * sem_res.adb (Resolve_Call): Resolve correctly a parameterless
225 call that returns an access type whose designated type is the
226 component type of an array, when the function has no defaulted
229 2018-08-21 Yannick Moy <moy@adacore.com>
231 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
232 Document entries of the target parametrization file.
233 * gnat_ugn.texi: Regenerate.
235 2018-08-21 Ed Schonberg <schonberg@adacore.com>
237 * sem_attr.adb: Set scope of elaboration flag for 'Access.
239 2018-08-21 Ed Schonberg <schonberg@adacore.com>
241 * sprint.adb: Add guard on printing aspects.
243 2018-08-21 Javier Miranda <miranda@adacore.com>
245 * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
248 2018-08-21 Ed Schonberg <schonberg@adacore.com>
250 * layout.adb: Do not set size of access subprogram if unnesting.
252 2018-08-21 Ed Schonberg <schonberg@adacore.com>
254 * freeze.adb: Remove warnings for access to subprograms when
257 2018-08-21 Ed Schonberg <schonberg@adacore.com>
259 * exp_aggr.adb (Expand_Array_Aggregate): If the component type
260 is limited, the array must be constructed in place, so set flag
261 In_Place_Assign_OK_For_Declaration accordingly. This prevents
262 improper copying of an array of tasks during initialization.
264 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
266 * gcc-interface/trans.c (Call_to_gnu): Always suppress an
267 unchecked conversion around the actual for an In parameter
270 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
272 * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
273 selected component inherited in a record extension and subject
274 to a representation clause, retrieve the position and size from
275 the original record component.
277 2018-08-21 Ed Schonberg <schonberg@adacore.com>
279 * sem_util.ads, sem_util.adb (New_External_Entity): Type of
280 Suffix_Index must be Int, not Nat, so that a negative value can
281 be used to generate a unique name for an external object, as
282 specified in Tbuild.New_External_Name.
283 (Scope_Within): Handle private type whose completion is a
284 synchronized type (For unnesting).
285 * itypes.ads, itypes.adb (Create_Itype): Ditto
286 * sem_ch3.adb (Constrain_Corresponding_Record): Generate a
287 unique name for the created subtype, because there may be
288 several discriminated tasks present in the same scope, and each
289 needs its distinct corresponding record subtype.
291 2018-08-21 Yannick Moy <moy@adacore.com>
293 * doc/gnat_ugn/gnat_and_program_execution.rst: Update
294 documentation of dimensionality analysis.
295 * gnat_ugn.texi: Regenerate.
296 * Makefile.rtl, impunit.adb: Consider the new units.
297 * libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
298 libgnat/s-diflmk.ads: New units based on Float.
299 * libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
300 libgnat/s-dlmopr.ads: New units based on Long_Float.
301 * libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
303 System.Dim.Generic_Mks.Generic_Other_Prefixes.
304 * libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
305 into an instance of System.Dim.Generic_Mks.
307 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
309 * impunit.adb: Add g-lists to the set of non-implementation
311 * libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
312 * Makefile.rtl: Add g-lists to the set of non-tasking units.
313 * gcc-interface/Make-lang.in: Add g-lists to the set of files
316 2018-08-21 Ed Schonberg <schonberg@adacore.com>
318 * exp_ch9.adb (Reset_Scopes): Do not recurse into type
319 declarations when resetting the scope of entities declared the
320 procedures generated for entry bodies and accept alternatives.
321 Use the entity of the procedure declaration, not its body, as
324 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
326 * einfo.adb (Elaboration_Entity): Include entries and entry
327 families in the set of legal entities.
328 (Elaboration_Entity_Required): Include entries and entry
329 families in the set of legal entities.
330 (Set_Elaboration_Entity): Include entries and entry families in
331 the set of legal entities.
332 (Set_Elaboration_Entity_Required): Include entries and entry
333 families in the set of legal entities.
334 (Write_Field13_Name): Update the output of attribute
336 * einfo.ads: Attributes Elaboration_Entity and
337 Elaboration_Entity_Required now apply to entries and entry
340 2018-08-21 Arnaud Charlet <charlet@adacore.com>
342 * set_targ.adb: Mark some CodePeer message as Intentional.
344 2018-08-21 Ed Schonberg <schonberg@adacore.com>
346 * sem_res.adb (Resolve_Call): Force the freezing of an
347 expression function that is called to provide a default value
348 for a defaulted discriminant in an object initialization.
350 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
352 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
355 2018-08-21 Javier Miranda <miranda@adacore.com>
357 * checks.ads (Determine_Range): Adding documentation.
358 * checks.adb (Determine_Range): Don't deal with enumerated types
359 with non-standard representation.
360 (Convert_And_Check_Range): For conversion of enumeration types
361 with non standard representation to an integer type perform a
362 direct conversion to the target integer type.
364 2018-08-21 Piotr Trojanek <trojanek@adacore.com>
366 * lib-xref.ads, lib-xref-spark_specific.adb
367 (Enclosing_Subprogram_Or_Library_Package): Now roughtly works
368 for pragmas that come from aspect specifications.
370 2018-08-21 Pierre-Marie de Rodat <derodat@adacore.com>
372 * sa_messages.ads, sa_messages.adb: New source files.
374 2018-08-03 Pierre-Marie de Rodat <derodat@adacore.com>
377 2018-07-06 Jim Wilson <jimw@sifive.com>
379 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
380 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
381 * gcc-interface/Makefile.in (xoscons): Likewise.
383 2018-07-31 Alexandre Oliva <oliva@adacore.com>
384 Olivier Hainque <hainque@adacore.com>
386 * gcc-interface/trans.c: Include debug.h.
387 (file_map): New static variable.
388 (gigi): Set it. Create decl_to_instance_map when needed.
389 (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
390 (Sloc_to_locus): ... this. Add decl parm, map it to instance.
391 * gcc-interface/gigi.h (Sloc_to_locus): Adjust declaration.
393 2018-07-31 Arnaud Charlet <charlet@adacore.com>
395 * clean.adb, gnatchop.adb, gnatfind.adb, gnatls.adb,
396 gnatmake.ads, gnatxref.adb, make.adb, make.ads, make_util.ads,
397 sfn_scan.adb, vxaddr2line.adb, xeinfo.adb, xoscons.adb,
398 xr_tabls.adb, xref_lib.adb: Address CodePeer messages.
400 2018-07-31 Arnaud Charlet <charlet@adacore.com>
402 * gnatlink.adb: Fix potential Constraint_Error if
403 Library_Version is too long.
405 2018-07-31 Arnaud Charlet <charlet@adacore.com>
407 * sem_elab.adb: Remove duplicate condition detected by CodePeer.
409 2018-07-31 Ed Schonberg <schonberg@adacore.com>
411 * exp_unst.adb (Subp_Index): In the case of a protected
412 operation, the relevant entry is the generated
413 protected_subprogram_body into which the original body is
414 rewritten. Assorted cleanup and optimizations.
416 2018-07-31 Ed Schonberg <schonberg@adacore.com>
418 * exp_attr.adb (Expand_Attribute, case Fixed_Value): Set the
419 base type of the result to ensure that proper overflow and range
420 checks are generated. If the target is a fixed-point tyoe,
421 generate the required overflow and range checks explicitly,
422 rather than relying on Apply_Type_Conversion_Checks, which might
423 simply set the Do_Range_Check flag and rely on the backend to
426 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
428 * sem_res.adb (Resolve_Call): Establish a transient scope to
429 manage the secondary stack when the designated type of an
430 access-to-subprogram requires it.
432 2018-07-31 Ed Schonberg <schonberg@adacore.com>
434 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): To find local
435 subprograms in the elaboration code for a package body, recurse
436 through nested statement sequences because a compiler-generated
437 procedure may appear within a condition statement.
439 2018-07-31 Ed Schonberg <schonberg@adacore.com>
441 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Handle
442 properly a protected call that includes a default parameter that
443 is a call to a protected function of the same type.
445 2018-07-31 Justin Squirek <squirek@adacore.com>
447 * lib-writ.adb (Write_With_Lines): Modfiy the generation of
448 dependencies within ali files so that source unit bodies are
449 properly listed even if said bodies are missing. Perform legacy
450 behavior in GNATprove mode.
451 * lib-writ.ads: Modify documentation to reflect current behavior.
453 2018-07-31 Eric Botcazou <ebotcazou@adacore.com>
455 * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.
456 (mutex_t): Use it for 'lock' and 'data' components.
457 (cond_t): Likewise for 'data' and use single 'flags' component.
459 2018-07-31 Justin Squirek <squirek@adacore.com>
461 * exp_ch5.adb (Make_Field_Assign): Force temporarily generated
462 objects for assignment of overlaid user objects to be renamings
463 instead of constant declarations.
465 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
467 * exp_ch9.adb (Analyze_Pragmas): New routine.
468 (Build_Private_Protected_Declaration): Code clean up. Relocate
469 relevant aspects and pragmas from the stand-alone body to the
470 newly created spec. Explicitly analyze any pragmas that have
471 been either relocated or produced by the analysis of the
473 (Move_Pragmas): New routine.
474 * sem_prag.adb (Find_Related_Declaration_Or_Body): Recognize the
475 case where a pragma applies to the internally created spec for a
476 stand-along subprogram body declared in a protected body.
478 2018-07-31 Gary Dismukes <dismukes@adacore.com>
480 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
481 calls to Current_Scope in three assertions with calls to
484 2018-07-31 Ed Schonberg <schonberg@adacore.com>
486 * sem_eval.adb (Check_Non_Static_Context): Do not warn on an
487 integer literal greater than the upper bound of
488 Universal_Integer'Last when expansion is disabled, to avoid a
489 spurious warning over ranges involving 64-bit modular types.
491 2018-07-31 Arnaud Charlet <charlet@adacore.com>
493 * einfo.adb (Write_Entity_Flags): Also print
494 Is_Activation_Record flag.
496 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
498 * exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb,
499 repinfo.adb, sem_ch9.adb: Minor replace Ekind membership tests
500 with a wrapper routine.
502 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
504 * ali.adb (Known_ALI_Lines): Remove 'F' as a prefix for lines
505 related to the FORMAL analysis done by GNATprove.
507 2018-07-31 Javier Miranda <miranda@adacore.com>
509 * sem.ads (Inside_Preanalysis_Without_Freezing): New global
511 * sem.adb (Semantics): This subprogram has now the
512 responsibility of resetting the counter before analyzing a unit,
513 and restoring its previous value before returning.
514 * freeze.adb (Freeze_Entity): Do not freeze if we are
515 preanalyzing without freezing.
516 * sem_res.adb (Preanalyze_And_Resolve): Set & restore
517 In_Preanalysis_Without_Freezing.
519 2018-07-31 Ed Schonberg <schonberg@adacore.com>
521 * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
522 may rename a matching class-wide operation only if the renaming
523 declaration for that actual is in an enclosing scope (i.e.
524 within the corrresponding instance).
526 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
528 * checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
529 exp_disp.adb, make.adb, sem_ch4.adb, sem_eval.adb, sem_res.adb,
530 usage.adb: Minor reformatting.
532 2018-07-31 Bob Duff <duff@adacore.com>
534 * sem_res.adb (Resolve_Allocator): Do not complain about the
535 implicit allocator that occurs in the expansion of a return
536 statement for a build-in-place function.
538 2018-07-20 Martin Sebor <msebor@redhat.com>
541 * gcc-interface/misc.c (gnat_handle_option): Change function argument
544 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
546 * gcc-interface/decl.c (choices_to_gnu): Rename parameters. Deal with
547 an operand of Character type. Factor out range generation to the end.
548 Check that the bounds are literals and convert them to the type of the
549 operand before building the ranges.
550 * gcc-interface/utils.c (make_dummy_type): Minor tweak.
551 (make_packable_type): Propagate TYPE_DEBUG_TYPE.
552 (maybe_pad_type): Likewise.
554 2018-07-17 Ed Schonberg <schonberg@adacore.com>
556 * sem_ch4.adb (Try_Object_Operation): Handle properly a prefixed call
557 in an instance, when the generic parameters include an interface type
558 and a abstract operation of that type, and the actuals in the instance
559 include an interface type and a corresponding abstract operation of it,
560 with a different name than the corresponding generic subprogram
563 2018-07-17 Arnaud Charlet <charlet@adacore.com>
565 * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
568 2018-07-17 Arnaud Charlet <charlet@adacore.com>
570 * checks.adb (Apply_Division_Check): Add provision for floating-point
573 2018-07-17 Ed Schonberg <schonberg@adacore.com>
575 * exp_aggr.adb (Component_OK_For_Backend): If an array component of the
576 enclosing record has a bound that is out of range (and that has been
577 rewritten as a raise statement) the aggregate is not OK for any back
578 end, and should be expanded into individual assignments.
580 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
582 * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
584 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
586 * sem_util.ads (Denotes_Same_Object): Likewise.
587 * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
589 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
591 * exp_disp.adb (Make_Tags): When the type has user-defined primitives,
592 build the access type that is later used by Build_Get_Prim_Op_Address
593 as pointing to a subtype of Ada.Tags.Address_Array.
595 2018-07-17 Patrick Bernardi <bernardi@adacore.com>
597 * libgnat/s-memory__mingw.adb: Remove.
598 * Makefile.rtl: Remove s-memory.adb target pair from the Cygwin/Mingw32
601 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
603 * frontend.adb (Frontend): The removal of ignored Ghost code must be
604 the last semantic operation performed on the tree.
606 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
608 * frontend.adb (Frontend): Update the call to Register_Config_Switches.
609 * inline.ads: Add new component Config_Switches to record
610 Pending_Body_Info which captures the configuration state of the pending
611 body. Remove components Version, Version_Pragma, SPARK_Mode, and
612 SPARK_Mode_Pragma from record Pending_Body_Info because they are
613 already captured in component Config_Switches.
614 * opt.adb (Register_Opt_Config_Switches): Rename to
615 Register_Config_Switches.
616 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
617 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
618 routine is now a function, and returns the saved configuration state as
619 an aggregate to avoid missing an attribute.
620 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
621 * opt.ads (Register_Opt_Config_Switches): Rename to
622 Register_Config_Switches.
623 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
624 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
625 routine is now a function.
626 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
627 * par.adb (Par): Update the calls to configuration switch-related
629 * sem.adb (Semantics): Update the calls to configuration switch-related
631 * sem_ch10.adb (Analyze_Package_Body_Stub): Update the calls to
632 configuration switch-related subprograms.
633 (Analyze_Protected_Body_Stub): Update the calls to configuration
634 switch-related subprograms.
635 (Analyze_Subprogram_Body_Stub): Update calls to configuration
636 switch-related subprograms.
637 * sem_ch12.adb (Add_Pending_Instantiation): Update the capture of
638 pending instantiation attributes.
639 (Inline_Instance_Body): Update the capture of pending instantiation
640 attributes. It is no longer needed to explicitly manipulate the SPARK
642 (Instantiate_Package_Body): Update the restoration of the context
644 (Instantiate_Subprogram_Body): Update the restoration of context
646 (Load_Parent_Of_Generic): Update the capture of pending instantiation
648 (Set_Instance_Env): Update the way relevant configuration attributes
649 are saved and restored.
651 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
653 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
654 more rvalues in the expression of a renaming.
656 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
658 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
660 (TYPE_RETURN_UNCONSTRAINED_P): Likewise.
661 (TYPE_CI_CO_LIST): Likewise.
662 * gcc-interface/gigi.h (is_cplusplus_method): Delete.
663 (fntype_same_flags_p): Adjust comment.
664 * gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
665 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
667 (is_cplusplus_method): Make static and adjust head comment.
668 (gnat_to_gnu_param): Return a pointer for the "this" parameter of
670 (gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
671 callable form. Generate a METHOD_TYPE node for imported C++ methods.
672 Set param_list at the very end of the processing.
673 (substitute_in_type) <METHOD_TYPE>: New case.
674 * gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
675 (gnat_type_hash_eq): Accept METHOD_TYPE.
676 * gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
677 (Attribute_to_gnu): Likewise.
678 (Call_to_gnu): Likewise.
679 (process_freeze_entity): Likewise.
680 * gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
681 (fntype_same_flags_p): Likewise.
683 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
685 * inline.adb (Expand_Inlined_Call): Remove extra parentheses.
687 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
689 * exp_disp.adb (Gen_Parameters_Profile): Make the _Init parameter an
691 (Set_CPP_Constructors): Adjust comment accordingly.
693 2018-07-17 Bob Duff <duff@adacore.com>
695 * exp_disp.adb (Build_Class_Wide_Check): Return early if the
696 precondition is supposed to be ignored.
698 2018-07-17 Ed Schonberg <schonberg@adacore.com>
700 * sem_ch6.adb (Check_Untagged_Equality): Extend check to operations
701 declared in the same scope as the operand type, when that scope is a
704 2018-07-17 Ed Schonberg <schonberg@adacore.com>
706 * exp_unst.adb (Unnest_Subprograms): Do nothing if the expander is not
707 active. Don't use Get_Actual_Subtype for record subtypes. Ignore
708 rewritten identifiers and uplevel references to bounds of types that
709 come from the original type reference.
711 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
713 * exp_ch13.adb, exp_ch7.adb, exp_unst.adb, freeze.adb,
714 libgnat/s-os_lib.adb, sem_ch3.adb, sem_ch3.ads, sem_ch5.adb,
715 sem_eval.adb, sem_res.adb, sem_util.adb: Minor reformatting.
717 2018-07-17 Javier Miranda <miranda@adacore.com>
719 * exp_ch13.adb (Expand_N_Freeze_Entity): Handle subtype declared for an
721 * freeze.adb (Freeze_Expression): Handle freeze of an entity defined
722 outside of a subprogram body. This case was previously handled during
723 preanalysis; the frozen entities were remembered and left pending until
724 we continued freezeing entities outside of the subprogram. Now, when
725 climbing the parents chain to locate the correct placement for the
726 freezeing node, we check if the entity can be frozen and only when no
727 enclosing node is marked as Must_Not_Freeze the entity is frozen.
728 * sem_ch3.ads (Preanalyze_Default_Expression): Declaration moved to the
730 * sem_ch3.adb (Preanalyze_Default_Expression): Code adjusted to invoke
731 the new subprogram Preanalyze_With_Freezing_And_Resolve.
732 * sem_ch6.adb (Preanalyze_Formal_Expression): New subprogram.
733 (Analyze_Expression_Function, Process_Formals): Invoke
734 Preanalyze_Formal_Expression instead of Preanalyze_Spec_Expression
735 since the analysis of the formals may freeze entities.
736 (Analyze_Subprogram_Body_Helper): Skip building the body of the
737 class-wide clone for eliminated subprograms.
738 * sem_res.ads, sem_res.adb (Preanalyze_And_Resolve): New subprogram.
739 Its code is basically the previous version of this routine but extended
740 with an additional parameter which is used to specify if during
741 preanalysis we are allowed to freeze entities. If the new parameter is
742 True then the subtree root node is marked as Must_Not_Freeze and no
743 entities are frozen during preanalysis.
744 (Preanalyze_And_Resolve): Invokes the internal version of
745 Preanalyze_And_Resolve without entity freezing.
746 (Preanalyze_With_Freezing_And_Resolve): Invokes the internal version of
747 Prenalyze_And_Resolve with freezing enabled.
749 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
751 * einfo.ads, libgnat/g-comlin.ads: Minor change "ie" to "i.e." in docs
754 2018-07-17 Justin Squirek <squirek@adacore.com>
756 * libgnat/s-os_lib.adb (Argument_String_To_List): Fix trimming of
759 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
761 * sem_prag.adb (Has_Visible_State): Do not consider constants as
762 visible state because it is not possible to determine whether a
763 constant depends on variable input.
764 (Propagate_Part_Of): Add comment clarifying the behavior with respect
767 2018-07-17 Yannick Moy <moy@adacore.com>
769 * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
770 being propagated in GNATprove mode.
772 2018-07-17 Dmitriy Anisimkov <anisimko@adacore.com>
774 * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
775 public components of Inet_Addr_Type. Introduce public binary
778 2018-07-17 Javier Miranda <miranda@adacore.com>
780 * exp_ch7.adb (Make_Transient_Block): When determining whether an
781 enclosing scope already handles the secondary stack, take into account
782 transient blocks nested in a block that do not manage the secondary
783 stack and are located within a loop.
785 2018-07-17 Ed Schonberg <schonberg@adacore.com>
787 * sem_util.adb (Enclosing_Subprogram): Protected entries and task
788 entries must be treated separately: task entries are within the
789 enclosing subprogram of the task type, while protected entries are
790 transformed into the corresponding Protected_Body_Subprogram, which is
791 the enclosing_subprogram of any subprogram declared within the entry
794 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
796 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
797 sections on -gnatH and -gnatJ compiler switches.
798 * gnat_ugn.texi: Regenerate.
800 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
802 * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
804 * atree.adb: Add a soft link for a procedure which is invoked whenever
805 an ignored Ghost node or entity is created.
806 (Change_Node): Preserve relevant attributes which come from the Flags
808 (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
810 (Rewrite): Preserve relevant attributes which come from the Flags
812 (Set_Ignored_Ghost_Recording_Proc): New routine.
813 * atree.ads: Define an access-to-suprogram type for a soft link which
814 records a newly created ignored Ghost node or entity.
815 (Set_Ignored_Ghost_Recording_Proc): New routine.
816 * ghost.adb: Remove with and use clause for Lib. Remove table
817 Ignored_Ghost_Units. Add new table Ignored_Ghost_Nodes.
818 (Add_Ignored_Ghost_Unit): Removed.
819 (Initialize): Initialize the table which stores ignored Ghost nodes.
820 Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
822 (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
823 an eliminated ignored Ghost unit.
824 (Lock): Release and lock the table which stores ignored Ghost nodes.
825 (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
827 (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
829 (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
830 (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
832 (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
833 (Propagate_Ignored_Ghost_Code): Removed.
834 (Record_Ignored_Ghost_Node): New routine.
835 (Remove_Ignored_Ghost_Code): Reimplemented.
836 (Remove_Ignored_Ghost_Node): New routine.
837 (Ultimate_Original_Node): New routine.
838 * ghost.ads (Check_Ghost_Completion): Removed.
839 * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
840 package clause as ignored Ghost if applicable.
841 * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
843 2018-07-17 Javier Miranda <miranda@adacore.com>
845 * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
847 (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
848 of the loop iterator relies on the secondary stack.
850 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
852 * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
853 which happens for inlined calls, then fetch the next actual from the
856 2018-07-17 Ed Schonberg <schonberg@adacore.com>
858 * einfo.ads: Update documentation for Scalar_Range.
860 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
862 * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
863 the Standard package.
865 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
867 * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
869 2018-07-17 Ed Schonberg <schonberg@adacore.com>
871 * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
872 synchronized types that are completions of limited types or private
874 (Scope_Within): Handle properly accept statements in task bodies.
876 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
878 * sem_prag.adb (Has_Visible_State): Do not consider generic formals
879 because they are not part of the visible state space. Add constants to
880 the list of acceptable visible states.
881 (Propagate_Part_Of): Do not consider generic formals when propagating
882 the Part_Of indicator.
883 * sem_util.adb (Entity_Of): Do not follow renaming chains which go
884 through a generic formal because they are not visible for SPARK
886 * sem_util.ads (Entity_Of): Update the comment on usage.
888 2018-07-17 Ed Schonberg <schonberg@adacore.com>
890 * sem_util.adb (Gather_Components): A discriminant of an ancestor may
891 have been constrained by a later ancestor, so when looking for the
892 value of that hidden discriminant we must examine the stored constraint
893 of other ancestors than the immediate parent type.
895 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
897 * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
898 constructs and entities within receive new entities when replicating a
900 (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
901 and entities within receive new entities when replicating a tree.
902 * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
903 (Visit_Entity): Visit entities within scoping constructs inside
904 expression with actions nodes when requested by the caller. Add blocks,
905 labels, and procedures to the list of entities which need replication.
906 * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
907 the comment on usage.
909 2018-07-17 Arnaud Charlet <charlet@adacore.com>
911 * doc/gnat_ugn/about_this_guide.rst,
912 doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
913 * gnat_ugn.texi: Regenerate.
915 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
917 * contracts.adb (Analyze_Contracts): Add specialized processing for
918 package instantiation contracts.
919 (Analyze_Package_Contract): Remove the verification of a missing
921 (Analyze_Package_Instantiation_Contract): New routine.
922 * contracts.ads (Analyze_Package_Contract): Update the comment on
924 * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
925 instance is being examined when trying to determine whether a package
926 instantiation needs a Part_Of indicator.
928 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
930 * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
931 sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
932 sem_util.adb: Minor reformatting.
934 2018-07-16 Arnaud Charlet <charlet@adacore.com>
936 * frontend.adb: Only unnest subprograms if no previous errors were
939 2018-07-16 Ed Schonberg <schonberg@adacore.com>
941 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
942 contain blocks in the elaboration code for a package body. Create the
943 elaboration subprogram wrapper only if there is a subprogram
944 declaration in a block or loop.
946 2018-07-16 Ed Schonberg <schonberg@adacore.com>
948 * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
949 deep copy of the left operand when building each conjuct of the
950 expanded membership operation, to avoid sharing nodes between them.
951 This sharing interferes with the unnesting machinery and is generally
954 2018-07-16 Ed Schonberg <schonberg@adacore.com>
956 * exp_unst.adb (Visit_Node): Handle 'Address references that are
959 2018-07-16 Ed Schonberg <schonberg@adacore.com>
961 * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
962 in relevant nodes: Allocate, Free, and return statements.
964 2018-07-16 Ed Schonberg <schonberg@adacore.com>
966 * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
967 instance that carries an aspect Default_Storage_Pool that overrides a
968 default storage pool that applies to the generic unit. The aspect in
969 the generic unit was removed before copying it in the instance, rather
970 than removing it from the copy of the aspects that are appended to the
971 aspects in the instance.
973 2018-07-16 Ed Schonberg <schonberg@adacore.com>
975 * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
977 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
979 * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
980 entry body to be the corresponding generated subprogram, for correct
981 analysis of uplevel references.
982 * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
983 Ignore pragmas, fix component associations.
984 (Register_Subprograms): Subprograms in synchronized types must be
985 treated as reachable.
987 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
989 * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
990 states and variables.
992 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
994 * sinfo.ads, sinfo.adb (Withed_Body): Remove.
995 (Set_Withed_Body): Remove.
997 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
999 * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
1000 when printing debug info.
1002 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
1004 * sem.adb (Walk_Library_Items): Reuse local constant.
1005 (Is_Subunit_Of_Main): Turn condition to positive and flip the
1006 IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
1009 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
1011 * sem.adb (Walk_Library_Items): Deconstruct dead code.
1013 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1015 * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
1016 Expand_Nonbinary_Modular_Op. Needed for unnesting.
1018 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1020 * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
1021 static predicate (for example True) but has no
1022 static_discrete_predicate.
1024 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
1026 * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
1027 class-wide types and record extensions.
1029 2018-07-16 Justin Squirek <squirek@adacore.com>
1031 * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
1032 checks on expanded literals within if and case expressions.
1034 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
1036 * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
1037 longest sequence factor. Code clean up.
1038 (Wide_Wide_String_To_String): Use the appropriate longest sequence
1039 factor. Code clean up.
1041 2018-07-16 Javier Miranda <miranda@adacore.com>
1043 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
1044 on Bit_Order when defined for a record extension.
1046 2018-07-16 Arnaud Charlet <charlet@adacore.com>
1048 * libgnat/s-objrea.ads: Minor code clean up.
1050 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
1052 * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
1055 2018-07-16 Arnaud Charlet <charlet@adacore.com>
1057 * adaint.c (__gnat_set_file_time_name): Code clean up.
1059 2018-07-16 Javier Miranda <miranda@adacore.com>
1061 * inline.adb (Build_Body_To_Inline): Minor code reorganization that
1062 ensures that calls to function Has_Single_Return() pass a decorated
1064 (Has_Single_Return.Check_Return): Peform checks on entities (instead on
1065 relying on their characters).
1067 2018-07-16 Javier Miranda <miranda@adacore.com>
1069 * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
1070 to avoid generating an ill-formed tree that confuses gnatprove causing
1073 2018-07-16 Yannick Moy <moy@adacore.com>
1075 * inline.adb (Has_Single_Return): Rewrap comment.
1077 2018-07-16 Eric Botcazou <ebotcazou@adacore.com>
1079 * einfo.ads: Minor tweak in comment.
1081 2018-07-16 Javier Miranda <miranda@adacore.com>
1083 * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
1085 2018-07-16 Javier Miranda <miranda@adacore.com>
1087 * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
1088 transform 'Count into a function call if the current scope has been
1091 2018-07-16 Javier Miranda <miranda@adacore.com>
1093 * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
1094 public part of this package.
1096 2018-07-16 Yannick Moy <moy@adacore.com>
1098 * sem_res.adb (Resolve_Call): Do not inline calls inside
1099 compiler-generated functions translated as predicates in GNATprove.
1101 2018-07-16 Gary Dismukes <dismukes@adacore.com>
1103 * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
1104 addition to the existing test for no Storage_Pool as a condition
1105 enabling generation of the call to Check_Standard_Allocator when the
1106 restriction No_Standard_Allocators_After_Elaboration is active.
1107 * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
1108 say that Storage_Error will be raised (rather than Program_Error).
1109 * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
1110 rather than Program_Error when Elaboration_In_Progress is False.
1112 2018-07-16 Gary Dismukes <dismukes@adacore.com>
1114 * sem_eval.adb: Fix spelling for compile-time-known.
1116 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
1118 * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
1119 the compiler from entering infinite recursion when trying to determine
1120 whether a deferred constant has a compile time known value, and the
1121 initialization expression of the constant is a reference to the
1124 2018-07-16 Nicolas Roche <roche@adacore.com>
1126 * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
1127 factor from 1/32 to 1/2 for Unbounded_String.
1129 2018-07-13 Eric Botcazou <ebotcazou@adacore.com>
1131 * gcc-interface/lang.opt (funsigned-char): New option.
1132 * gcc-interface/misc.c (gnat_handle_option): Accept it.
1133 * gcc-interface/utils.c (finish_character_type): Tweak comment.
1135 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
1137 * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
1138 variable and use it throughout.
1139 <E_Variable>: If the nominal subtype of the object is unconstrained,
1140 compute the Ada size separately and put in on the padding type if the
1142 <E_Record_Type>: Minor tweak.
1143 * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
1144 into max_size_unit throughout.
1146 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
1148 * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
1149 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
1150 * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
1151 (add_decl_expr): Change type of second parameter and rename it.
1152 (renaming_from_instantiation_p): New function moved from...
1153 (set_expr_location_from_node): Test for exceptions here and add one
1154 for actual subtypes built for unconstrained composite actuals.
1155 * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
1157 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
1159 * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
1160 and adjust recursive calls.
1161 (Identifier_to_gnu): Adjust calls to lvalue_required_p.
1162 (gnat_to_gnu): Likewise.
1164 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
1166 * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
1167 (gnat_to_gnu_subprog_type): New pure_flag local variable. Set it for
1168 a pure Ada function with a by-ref In parameter. Propagate it onto the
1169 function type by means of the TYPE_QUAL_RESTRICT flag.
1170 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
1171 function type has the TYPE_QUAL_RESTRICT flag set.
1173 2018-07-06 Jim Wilson <jimw@sifive.com>
1175 * Makefile.rtl: Add riscv*-linux* support.
1176 * libgnarl/s-linux__riscv.ads: New.
1177 * libgnat/system-linux-riscv.ads: New.
1179 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
1180 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
1181 * gcc-interface/Makefile.in (xoscons): Likewise.
1183 2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
1185 * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
1186 (ZCX_By_Default): Set to True.
1188 2018-07-02 Martin Liska <mliska@suse.cz>
1190 * gnatvsn.ads: Bump Library_Version to 9.
1192 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
1194 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
1195 using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
1196 (TYPE_ALIGN_OK): Move around.
1197 (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
1198 * gcc-interface/decl.c (change_qualified_type): Move to...
1199 (gnat_to_gnu_entity): Adjust comment.
1200 * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
1201 (ceil_pow2): Use ceil_log2.
1202 * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
1203 and do not set TREE_SIDE_EFFECTS.
1204 (handle_noreturn_attribute): Use change_qualified_type.
1206 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
1208 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
1209 the expression of a dispatch table that is not being defined.
1210 <E_Record_Subtype>: Remove obsolete kludge.
1212 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
1214 * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
1216 (warn_on_list_placement): New static function.
1217 (components_to_record): Use it to warn on multiple fields in list.
1219 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
1221 * gcc-interface/decl.c (variant_desc): Add AUX field.
1222 (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
1224 (reverse_sort_field_list): New static function.
1225 (components_to_record): Place the variant part at the beginning of the
1226 field list when there is an obvious order of increasing position.
1227 (build_variant_list): Initialize it.
1228 (create_variant_part_from): Do not call compute_record_mode directly.
1229 (copy_and_substitute_in_layout): Likewise. Always sort the fields with
1230 fixed position in order of increasing position, in the record and all
1231 the variants, in any. Call reverse_sort_field_list.
1232 * gcc-interface/utils.c (make_packable_type): Compute the sizes before
1233 calling finish_record_type. Do not call compute_record_mode directly.
1234 (finish_record_type): Overhaul final processing depending on REP_LEVEL
1235 and call finish_bitfield_layout if it is equal to one or two.
1237 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
1239 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
1240 existing fields of a dummy fat pointer type, if any. Clear the
1241 TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
1243 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
1245 * contracts.adb (Process_Body_Postconditions): Expand only checked
1247 (Process_Contract_Cases_For): Expand only checked contract cases.
1248 (Process_Inherited_Preconditions): Ignored class-wide preconditions are
1249 partially expanded because some of their semantic checks are tied to
1251 (Process_Preconditions_For): Expand only checked preconditions.
1252 (Process_Spec_Postconditions): Expand only checked preconditions.
1253 Ignored class-wide preconditions are partially expanded because some of
1254 their semantic checks are tied to the expansion.
1255 * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
1257 * exp_util.adb (Add_Inherited_Invariants): Code clean up.
1258 * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
1260 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
1262 * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
1263 libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
1264 libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
1267 2018-06-11 Gary Dismukes <dismukes@adacore.com>
1269 * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
1271 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
1273 * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
1274 not add any actuals when the size of the object is known, and the
1275 caller will allocate it.
1276 (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
1277 better illustrate its functionality. Update the comment on the
1278 generated code. Generate a branch for the heap and pool cases where
1279 the object is not necessarity controlled.
1280 (Expand_N_Extended_Return_Statement): Expand the extended return
1281 statement into four branches depending the requested mode if the caller
1282 will not allocate the object on its side.
1283 (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
1284 object on the caller side because this will violate the semantics of
1285 finalizable types. Instead notify the function to allocate the object
1286 on the heap or a user-defined storage pool.
1287 (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
1288 which of the four modes to employ when returning a limited controlled
1290 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
1291 guard which is already covered in Needs_Finalization.
1293 2018-06-11 Olivier Hainque <hainque@adacore.com>
1295 * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
1296 * libgnat/a-exexpr.adb: ... Here, then add comments describing the
1297 major datastructures associated with the current exception raised.
1298 (Setup_Current_Excep): Accept a "Phase" argument conveying the
1299 unwinding phase during which this subprogram is called. For an Ada
1300 exception, don't update the current exception buffer from the raised
1301 exception object during SEARCH_PHASE, as this is redundant with the
1302 call now issued just before propagation starts.
1303 (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
1304 the unwinding start, conveying Phase 0.
1305 (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
1306 the call to Setup_Current_Excep.
1307 * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
1308 on calls to Setup_Current_Excep.
1310 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1312 * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
1313 Build_Access_Type_Decl): New subprograms to handle uplevel references
1314 to formals of an unconstrained array type. The activation record
1315 component for these is an access type, and the reference is rewritten
1316 as an explicit derefenrence of that component.
1318 2018-06-11 Bob Duff <duff@adacore.com>
1320 * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
1321 libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
1322 (Element): Add code to detect dangling cursors in some cases.
1324 2018-06-11 Yannick Moy <moy@adacore.com>
1326 * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
1329 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1331 * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
1332 that its parent is already frozen so that its predicate function, if
1333 any, has already been constructed.
1335 2018-06-11 Yannick Moy <moy@adacore.com>
1337 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
1338 possible task unit as the enclosing context.
1340 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
1342 * gnat1drv.adb: Remove use clause for Repinfo.
1343 (Gnat1drv): Beef up comment about the interplay between -gnatc and
1344 back-end annotations. Use full qualified name for List_Rep_Info.
1346 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
1348 * libgnat/g-arrspl.ads: Add pragma Preelaborate.
1350 2018-06-11 Arnaud Charlet <charlet@adacore.com>
1352 * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
1353 then" and general logical "ada" in codepeer mode.
1355 2018-06-11 Javier Miranda <miranda@adacore.com>
1357 * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
1358 N_Call_Marker nodes.
1360 2018-06-11 Arnaud Charlet <charlet@adacore.com>
1362 * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
1365 2018-06-11 Yannick Moy <moy@adacore.com>
1367 * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
1368 argument to Assertion_Policy
1369 * gnat_rm.texi: Regenerate.
1371 2018-06-11 Yannick Moy <moy@adacore.com>
1373 * gnat1drv.adb: Do not check representation information in CodePeer and
1374 GNATprove modes, as these modes call a special backend instead of gigi,
1375 so do not have the information.
1377 2018-06-11 Yannick Moy <moy@adacore.com>
1379 * inline.adb (Build_Body_To_Inline): Consider case of extended return
1380 of unconstrained type as one case where inlining is not supported.
1381 (Expand_Inlined_Call): Remove special case for body as extended return
1382 of unconstrained type.
1384 2018-06-11 Yannick Moy <moy@adacore.com>
1386 * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
1388 (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
1390 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
1392 * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
1393 expressions in Pre/Post contracts while in GNATprove_Mode.
1395 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
1397 * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
1398 with AND THEN expressions broken down into individual conjuncts.
1400 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1402 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
1404 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1406 * exp_unst.adb (Visit_Node): Skip generic associations.
1408 2018-06-11 Arnaud Charlet <charlet@adacore.com>
1410 * libgnat/memtrack.adb (fwrite): Remove second definition.
1412 2018-06-11 Javier Miranda <miranda@adacore.com>
1414 * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
1415 (Is_Static_Coextension): Adding documentation.
1416 * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
1417 (Is_Static_Coextension): Extending the assertion.
1418 * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
1419 setting flag Is_Dynamic_Coextension (and vice versa).
1421 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1423 * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
1424 level of a compilation unit, becuase they may contain nested
1425 subprograms that need an activation record.
1427 2018-06-11 Arnaud Charlet <charlet@adacore.com>
1429 * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
1431 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
1433 * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
1435 * sinfo.ads: Fix a typo.
1437 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1439 * inline.adb (Expand_Inlined_Call): If no optimization level is
1440 specified, the expansion of a call to an Inline_Always function is
1441 fully performed in the front-end even on a target that support back-end
1444 2018-06-11 Arnaud Charlet <charlet@adacore.com>
1446 * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
1447 with Sec_Stack_Used.
1449 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
1451 * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
1452 Is_Assignment_LHS further in. Use predicate
1453 Needs_Variable_Reference_Marker to determine whether to create a
1455 (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
1456 in. Use predicate Needs_Variable_Reference_Marker to determine whether
1457 to create a variable marker.
1458 * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
1459 checks that determine whether the identifier or expanded name is a
1460 suitable variable reference. The checks are now performed by
1461 Needs_Variable_Reference_Marker.
1462 * sem_res.adb (Resolve_Actuals): Use predicate
1463 Needs_Variable_Reference_Marker to determine whether to create a
1465 * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
1466 * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
1468 2018-06-11 Valentine Reboul <reboul@adacore.com>
1470 * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
1471 "Community Edition".
1473 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1475 * sem_ch12.adb (Install_Body): In order to determine the placement of
1476 the freeze node for an instance of a generic nested within another
1477 instance, take into account that the outer instance may be declared in
1478 the visible part of a package and the inner intance may be in the
1479 private part of the same package.
1481 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
1483 * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
1485 2018-06-11 Nicolas Roche <roche@adacore.com>
1487 * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
1488 stack overflow while raising a constraint error.
1490 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
1492 * repinfo.ads (Rep_Value): Use a single line.
1493 * repinfo.adb (Rep_Value): Likewise.
1494 (List_Attr): Do not use string concatenation.
1496 2018-06-11 Ed Schonberg <schonberg@adacore.com>
1498 * exp_unst.adb (Visit_Node): Check reference to formal parameter of
1499 current procedure, because the bounds of its type may be uplevel
1502 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
1504 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
1505 not a definition, retrieve the expression only if it's a compile-time
1506 known value if we are just annotating types.
1508 * gcc-interface/utils.c (convert): Do not try to upcast properly for a
1509 conversion between tagged types in type_annotate_only mode.
1511 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
1513 * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
1514 * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
1515 type built for an aliased component with variable size.
1517 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
1519 * doc/gnat_ugn/project-manager-figure.png: Delete.
1521 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
1523 * vxworks-arm-link.spec, vxworks-e500-link.spec,
1524 vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
1525 vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
1526 vxworks-smp-x86-link.spec: New files.
1528 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
1530 * gnatvsn.adb: Re-center the copyright header.
1531 * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
1533 2018-05-31 Fedor Rybin <frybin@adacore.com>
1535 * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
1536 gnattest section on user guide.
1538 2018-05-31 Ed Schonberg <schonberg@adacore.com>
1540 * sem_res.adb (Resolve_String_Literal): If the type is a string type
1541 whose component subtype has a static predicate, ensure that the
1542 predicate is applied to each character by expanding the string into the
1543 equivalent aggregate. This is also done if the component subtype is
1546 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
1548 * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
1550 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
1552 * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
1555 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
1557 * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
1558 the type of the parameter is an unconstrained array type, convert
1559 to the type of the actual before the type of the formal only if the
1560 conversion was suppressed earlier. Use in_param and gnu_actual_type
1561 local variables throughout, and uniform spelling for In Out or Out.
1562 Also remove dead code in the component-by-reference case.
1564 2018-05-31 Frederic Konrad <konrad@adacore.com>
1566 * tracebak.c (STOP_FRAME): Harden condition.
1567 (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
1570 2018-05-31 Ed Schonberg <schonberg@adacore.com>
1572 * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
1573 check to a call to a build-in-place function, given that the return
1574 object is limited and cannot be copied.
1576 2018-05-31 Olivier Hainque <hainque@adacore.com>
1578 * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
1581 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
1583 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
1584 there is no target, also create a temporary for the return value for
1585 an allocator if the type is an unconstrained record type with default
1588 2018-05-31 Hristian Kirtchev <kirtchev@adacore.com>
1590 * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
1591 boudary for a transient scope.
1593 2018-05-31 Valentine Reboul <reboul@adacore.com>
1595 * gnatvsn.ads: Rename "GPL" version to "Community".
1597 2018-05-31 Ed Schonberg <schonberg@adacore.com>
1599 * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
1602 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
1604 * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
1605 with a semantically equivalent call to Defining_Entity.
1607 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
1609 * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
1610 Max_Queue_Length expression.
1612 2018-05-31 Sergey Rybin <rybin@adacore.com>
1614 * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
1615 that the main unit to be built before the call, now it computes the
1616 closure of the main unit itself.
1617 * gnat_ugn.texi: Regenerate.
1619 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
1621 * repinfo.adb (List_Structural_Record_Layout): Set First to false
1622 after having listed the fields of the parent type, if any.
1624 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
1626 * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
1627 deal with the ___XP suffix for packed array types here...
1628 <E_Array_Subtype>: ...or here when processing the implementation type
1629 but when processing the original type instead. Do not reuse the DECL
1630 of the implementation type for the original type. Tidy up.
1632 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
1634 * einfo.ads (Object_Size_Clause): Declare.
1635 * einfo.adb (Object_Size_Clause): New function.
1636 * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
1637 retrieving Size_Clause and post the warning on the object size clause
1638 if Has_Object_Size_Clause is true.
1640 2018-05-31 Javier Miranda <miranda@adacore.com>
1642 * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
1643 * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
1644 Find_Primitive_Eq to search for the primitive of types whose underlying
1645 type is a tagged type.
1647 2018-05-31 Yannick Moy <moy@adacore.com>
1649 * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
1650 order of treatment between nodes recognized as loop pragmas (or
1651 generated from one) and block statements.
1653 2018-05-31 Doug Rupp <rupp@adacore.com>
1655 * libgnat/s-osprim__posix2008.adb (Clock): Implement using
1658 2018-05-31 Ed Schonberg <schonberg@adacore.com>
1660 * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
1661 mark subprograms that cannot be eliminated because they must be treated
1662 as reachable from outside the current unit. This includes entry bodies
1663 and protected operations.
1665 2018-05-31 Ed Schonberg <schonberg@adacore.com>
1667 * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
1668 Convert all operands of the generated code to Standard.Unsigned, to
1669 prevent spurious visibility errors. This is needed when the generated
1670 expansion involves a modular index type of an array type, and the index
1671 type is not immediately visible.
1673 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
1675 * einfo.ads (Package_Instantiation): Update comment after a routine
1676 that uses this field has been renamed.
1678 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1680 * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
1681 if the local raise statement includes a string expression. This
1682 expression might be picked up by an outer handler or discarded, but
1683 plays no role in this transformation.
1685 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1687 * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
1690 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1692 * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
1693 field in relevant nodes: Allocate, Free, and return statements.
1695 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1697 * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
1698 that has not been analyzed, as will be the case for a nested aggregate
1699 that is expanded into individual assignments.
1701 2018-05-30 Justin Squirek <squirek@adacore.com>
1703 * aspects.adb, aspects.ads: Register new aspect.
1704 * par-prag.adb (Prag): Register new pragma.
1705 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
1706 aspect similar to Aspect_Max_Queue_Length.
1707 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
1708 set it to use the same processing as Pragma_Max_Queue_Length.
1709 * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
1710 that it can be processed as a pragma in addition to a restriction and
1711 add an entry for the pragma itself.
1713 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1715 * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
1716 is now legal on a variable of composite type initialized with an
1717 aggregate that is fully static and requires no elaboration code.
1718 * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
1719 nested aggregates that are compile-time static, so they can be used to
1720 initialize variables declared with Threqd_Local_Storage.
1721 * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
1722 Thread_Local_Storage.
1723 * gnat_rm.texi: Regenerate.
1725 2018-05-30 Yannick Moy <moy@adacore.com>
1727 * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
1730 2018-05-30 Justin Squirek <squirek@adacore.com>
1732 * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
1734 (Start_Search): Modify to use Start_Search_Internal
1735 (Start_Search_Internal): Add to break out an extra flag for searching
1736 case insensative due to the potential for directories within the same
1737 OS to allow different casing schemes.
1738 * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
1739 for when the more precise solution fails.
1741 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1743 * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
1746 2018-05-30 Pascal Obry <obry@adacore.com>
1748 * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
1749 * libgnat/g-comlin.adb: Add corresponding implementation.
1751 2018-05-30 Gary Dismukes <dismukes@adacore.com>
1753 * sem_res.adb, sem_util.adb: Fix several typos.
1755 2018-05-30 Olivier Hainque <hainque@adacore.com>
1757 * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
1758 (eh_registration_ctors, eh_registration_tors): New static variables,
1759 forced in a .ctors/.dtors section, respectively, with priority.
1761 2018-05-30 Bob Duff <duff@adacore.com>
1763 * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
1764 freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
1765 sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
1766 sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
1767 sinfo.ads: Spell preanalysis, preanalyze correctly.
1769 2018-05-30 Bob Duff <duff@adacore.com>
1771 * libgnat/g-sestin.ads: Rework documentation comments.
1773 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
1775 * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
1776 sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
1777 (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
1779 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
1781 * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
1783 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1785 * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
1786 in a separate routine.
1787 (Is_Atomic_Object_Entity): New routine.
1788 (Is_Atomic_Prefix): Cleaned up.
1789 (Is_Synchronized_Object): Check that the object is atomic, or its type
1791 (Object_Has_Atomic_Components): Removed.
1792 * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
1793 (Is_Atomic_Object_Entity): New routine.
1795 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1797 * sem_ch3.adb (Access_Subprogram_Declaration): The flag
1798 Needs_Activation_Record is only needed on a subprogram type, not on a
1800 * sem_res.adb (Resolve_Selected_Component): If the context type and the
1801 component type are anonymous access to subprograms, use the component
1802 type to obtain the proper value of Needs_Activation_Record flag for the
1805 2018-05-30 Eric Botcazou <ebotcazou@adacore.com>
1807 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
1808 comment about the memset case.
1810 2018-05-30 Bob Duff <duff@adacore.com>
1812 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
1813 to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
1814 We need to analyze it as part of analyzing the block, so that if the
1815 call to Element that initializes Elmt_Decl returns on the secondary
1816 stack, the block will ss_mark/ss_release. This block is inside the
1817 loop; we don't want to leak memory until the loop exits. The purpose
1818 of analyzing Elmt_Decl first was to catch the error of modifying it,
1819 which is illegal because it's a loop parameter. The above causes us to
1820 miss that error. Therefore, we add a flag Is_Loop_Parameter, and set
1821 it on the Element entity, so we end up with an E_Variable node with the
1823 * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
1824 * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
1825 parameter not allowed" error if Is_Loop_Parameter.
1826 * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
1827 trigger the call to Diagnose_Non_Variable_Lhs.
1829 2018-05-30 Arnaud Charlet <charlet@adacore.com>
1831 * checks.adb (Apply_Scalar_Range_Check):
1832 * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
1833 range values for System.Priority in CodePeer mode since the actual
1834 target compiler may provide a wider range.
1836 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1838 * exp_unst.adb: Search specification of main unit as well, for
1841 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1843 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
1844 a package body that is a compilation unit may contain blocks that
1845 declare local subprograms. In Subprogram_Unnesting Mode such
1846 subprograms must be handled as nested inside the (implicit) elaboration
1847 procedure that executes that statement part. To handle properly uplevel
1848 references we construct that subprogram explicitly, to contain blocks
1849 and inner subprograms, The statement part of the compilation unit
1850 becomes a call to this subprogram. This is only done if blocks are
1851 present in the statement list of the body.
1853 2018-05-30 Bob Duff <duff@adacore.com>
1855 * exp_ch7.adb: Minor comment fix.
1857 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1859 * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
1860 that have no corresponding body and appear as attributes of the
1861 corresponding wrapper package declaration.
1862 (Register_Subprogram): New subprogram, used for subprogram bodies and
1863 for subprogram instantiations to enter callable entity into Subp table.
1865 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1867 * libgnat/s-secsta.adb: Reimplement the secondary stack support.
1868 * libgnat/s-secsta.ads: Update the documentation of all routines in the
1869 public part of the package. Reimplement the private part of the
1870 package to account for the new secondary stack structure. Add types
1871 and subprograms for testing purposes. Add several documentation
1874 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1876 * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
1877 exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
1878 libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
1879 sem_disp.ads, sem_util.adb: Minor reformatting.
1881 2018-05-30 Arnaud Charlet <charlet@adacore.com>
1883 * gcc-interface/Makefile.in: Move special flags for Ada runtime files
1885 * Makefile.rtl: ... to here. Update comments. Protect call to
1886 "GCC_FOR_TARGET" in case target_os isn't defined.
1888 2018-05-30 Arnaud Charlet <charlet@adacore.com>
1890 * gcc-interface/Makefile.in: Move target pair settings from here...
1891 * Makefile.rtl: ... to here.
1892 (setup-rts): New target.
1894 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1896 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
1897 List of All Switches): Replace "modules" with "units".
1898 (Subprogram Inlining Control): Likewise.
1899 * gnat_ugn.texi: Regenerate.
1900 * usage.adb (Usage): Fix description of -gnatn switch.
1902 2018-05-29 Arnaud Charlet <charlet@adacore.com>
1904 * gcc-interface/Makefile.in: Fix typos.
1906 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1908 * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
1909 the finalizer procedure in the At_End handler, for use in LLVM
1912 2018-05-29 Javier Miranda <miranda@adacore.com>
1914 * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
1915 subprogram Inherits_From_Tagged_Full_View to identify more reliably
1916 untagged private types completed with a derivation of an untagged
1917 private whose full view is a tagged type.
1918 * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
1920 (Collect_Primitive_Operations): Handle untagged private types completed
1921 with a derivation of an untagged private type whose full view is a
1922 tagged type. In such case, collecting the list of primitives we may
1923 find two equality primitives: one associated with the untagged private
1924 and another associated with the ultimate tagged type (and we must
1925 remove from the returned list this latter one).
1927 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1929 * exp_unst.adb (Visit_Node): Handle statement sequences that include an
1932 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1934 * repinfo.adb (List_Entities): Also recurse into blocks without label.
1936 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1938 * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
1939 exceptions if subprogram unnesting is in effect, because these branch
1940 nodes are relevant only in the presence of nested subprograms.
1942 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1944 * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
1945 unconditionally when applied to the largest positive (resp. largest
1946 negative) value of a floating-point type.
1948 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1950 * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
1951 discriminants and exceptions are never components of such. The flag
1952 Needs_Activation_Record is set on subprogram types, not on access to
1955 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1957 * sem_ch3.adb: Set scope of component of subtype.
1959 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1961 * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
1962 carry no type. Such selected components appear in unit names that are
1963 child units, both in the specification and possibly in an end label for
1964 the unit, and they do not contain any relevant uplevel references.
1966 2018-05-29 Arnaud Charlet <charlet@adacore.com>
1968 * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
1971 2018-05-29 Olivier Hainque <hainque@adacore.com>
1973 * libgnat/system-vxworks7-ppc-rtp.ads: New file.
1974 * libgnat/system-vxworks7-ppc-kernel.ads: New file.
1975 * libgnat/system-vxworks7-e500-rtp.ads: New file.
1976 * libgnat/system-vxworks7-e500-kernel.ads: New file.
1977 * libgnat/system-vxworks7-x86-rtp.ads: New file.
1978 * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
1979 * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
1980 gnat-crtbe link spec to use the vx7 variant.
1982 2018-05-29 Olivier Hainque <hainque@adacore.com>
1984 * vx_crtbegin.inc: Use a consistent naming convention for the
1985 registration/deregistration functions across RTP or kernel. Remove the
1986 ctor/dtor attribute setting based on RTP/kernel, expect the optional
1987 attribute extension to be provided by includers instead.
1988 * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
1989 extension for the registration/deregistration functions.
1990 * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
1991 constructor/destructor attribute extensions.
1992 * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
1993 attribute extensions and declare _ctors/_dtors arrays.
1994 * vx_crtbegin_auto.c: Remove.
1995 * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
1996 vxworks7-gnat-crtbe-link.spec.
1997 * libgnat/system-vxworks7-aarch64.ads: Likewise.
1998 * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
1999 * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
2000 * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
2001 * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
2002 * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
2003 * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
2004 * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
2006 2018-05-29 Piotr Trojanek <trojanek@adacore.com>
2008 * ali.adb: Minor reformatting.
2010 2018-05-29 Joel Brobecker <brobecker@adacore.com>
2012 * doc/gnat_ugn/platform_specific_information.rst: Update package
2013 requirements for 32bit GNAT on x86_64-linux.
2014 * gnat_ugn.texi: Regenerate.
2016 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2018 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
2019 Control): Adjust description of -gnatRj.
2020 * gnat_ugn.texi: Regenerate.
2021 * opt.ads (List_Representation_Info_To_JSON): Likewise.
2022 * repinfo.adb (List_Rep_Info): Do not automatically create a file
2023 if List_Representation_Info_To_JSON is true.
2024 * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
2025 check between -gnatRj and -gnatRs.
2026 * usage.adb (Usage): Adjust description of -gnatRj.
2028 2018-05-29 Pascal Obry <obry@adacore.com>
2030 * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
2033 2018-05-29 Pascal Obry <obry@adacore.com>
2035 * libgnat/s-os_lib.adb: Minor reformatting.
2037 2018-05-29 Doug Rupp <rupp@adacore.com>
2039 * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
2040 * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
2041 * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
2042 * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
2044 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2046 * repinfo.ads (JSON format): Document new pair for components.
2047 * repinfo.adb (Derived_Discriminant): New function.
2048 (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
2049 in recursive calls. If the record type is the parent of an extension,
2050 find and list the derived discriminant from the extension, if any.
2051 (List_Component_Layout): List the Discriminant_Number in JSON mode.
2052 (List_Record_Info): Adjust call to List_Structural_Record_Layout.
2054 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2056 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
2057 List of All Switches): Document -gnatRj.
2058 (Debugging Control): Likewise.
2059 * gnat_ugn.texi: Regenerate.
2060 * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
2061 * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
2062 extension if List_Representation_Info_To_JSON is true.
2063 * repinfo.ads: Document the JSON output format.
2064 * repinfo.adb (List_Location): New procedure.
2065 (List_Array_Info): Add support for JSON output.
2066 (List_Entities): Likewise.
2069 (Print_Expr): Likewise.
2070 (List_Linker_Section): Likewise.
2071 (List_Mechanisms): Likewise.
2072 (List_Name): Likewise.
2073 (List_Object_Info): Likewise.
2074 (List_Record_Info): Likewise.
2075 (List_Component_Layout): Likewise. Add Indent parameter.
2076 (List_Structural_Record_Layout): New procedure.
2077 (List_Attr): Add support for JSON output.
2078 (List_Type_Info): Likewise.
2079 (Write_Unknown_Val): Likewise.
2080 * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
2081 * usage.adb (Usage): List -gnatRj.
2083 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2085 * repinfo.adb (List_Component_Layout): New procedure extracted from...
2086 (List_Record_Layout): ...here. Invoke it.
2088 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2090 * repinfo.adb (Write_Unknown_Val): New procedure.
2091 (List_GCC_Expression): Call it.
2092 (List_Record_Layout): Likewise.
2093 (Write_Val): Likewise.
2095 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2097 * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
2100 2018-05-29 Arnaud Charlet <charlet@adacore.com>
2102 * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
2103 This breaks build of cross compilers with older versions of GNAT, so
2106 2018-05-29 Doug Rupp <rupp@adacore.com>
2108 * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
2111 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2113 * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
2115 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2117 * repinfo.adb (List_Entities): Do not list the Linker_Section for
2119 (List_Mechanisms): ...but here instead. Use consistent name output
2120 and formatting conventions.
2122 2018-05-29 Bob Duff <duff@adacore.com>
2124 * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
2126 * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
2127 To_Mixed): New functions.
2128 * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
2129 allows both '\' and '/' on Windows.
2131 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2133 * repinfo.ads: Minor fixes and tweaks in comments.
2135 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2137 * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
2138 it with calls to Unop.
2140 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2142 * repinfo.ads (TCode): Adjust range.
2143 (Truth_Andif_Expr): Remove.
2144 (Truth_Orif_Expr): Likewise.
2145 (Truth_And_Expr .. Dynamic_Val): Adjust value.
2146 * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
2147 (Rep_Value): Likewise.
2148 * repinfo.h (Truth_Andif_Expr): Remove.
2149 (Truth_Orif_Expr): Likewise.
2150 (Truth_And_Expr .. Dynamic_Val): Adjust value.
2151 * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
2152 through to TRUTH_AND_EXPR case.
2153 <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
2155 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2157 * exp_unst.adb (Visit_Node): For indexed components and attribute
2158 references, examine index expressions or associated expressions as well
2159 to record uplevel references.
2160 (Vist_Node): For function and procedure calls, if a formal is an
2161 unconstrained array and the actual is constrained, check whether bounds
2162 of actual have uplevel references.
2164 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2166 * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
2167 they can appear as components of activation records.
2168 * exp_unst.adb (Visit_Node): A reference to an exception may be an
2171 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2173 * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
2174 depends on a discriminant manually instead of using the predicate
2175 Size_Depends_On_Discriminant in the array type case.
2177 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2179 * exp_unst.adb (Check_Static_Type): For a record subtype, check
2180 discriminant constraints as well.
2181 (Visit_Node): For a selected component, check type of prefix, as is
2182 done for indexed components and slices.
2184 2018-05-28 Javier Miranda <miranda@adacore.com>
2186 * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
2187 value when converting a float value to a fixed-point value. This is
2188 required for CCG because it handles fixed-point types by means of
2189 unsigned integer type variables. The range check is now performed using
2190 the integer value stored in this temporary.
2192 2018-05-28 Yannick Moy <moy@adacore.com>
2194 * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
2195 Length as valid non-interfering contexts for SPARK.
2197 2018-05-28 Claire Dross <dross@adacore.com>
2199 * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
2200 generic inheritance utilities.
2201 (Generic_Inherited_Subprograms): Generic version of
2202 Inherited_Subprograms, generic in Find_Dispatching_Type function.
2203 (Generic_Is_Overriding_Subprogram): Generic version of
2204 Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
2205 (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
2206 Sem_Disp.Find_Dispatching_Type.
2207 (Is_Overriding_Subprogram): Instance of
2208 Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
2209 (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
2210 with Sem_Disp.Find_Dispatching_Type.
2212 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2214 * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
2215 component type, do not expand array equality using the unconstrained
2216 base type, except for the case where the bounds of the type depend on a
2219 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2221 * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
2222 access-to-subprogram types, to indicate that an indirect call through
2223 such a type requires an activation record when compiling for LLVM.
2224 * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
2226 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2228 * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
2229 when bounds of fixed type are static, to remove some spuerfluous
2230 implicit conversions and provide an accurate result when converting
2231 back and forth between the fixed point type and a floating point type.
2233 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2235 * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
2238 2018-05-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2240 * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
2241 replaced, if any; all callers changed.
2242 (Note_Uplevel_Ref): Likewise. Also replace reference to deferred
2243 constant with private view so we take the address of that entity.
2244 (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
2245 any; all callers changed. Handle N_Indexed_Component like
2246 N_Attribute_Reference. Add N_Type_Conversion case.
2247 (Visit_Node): Indexed references can be uplevel if the type isn't
2249 (Unnest_Subprograms): Don't rewrite if no reference given. If call has
2250 been relocated, set first_named pointer in original node as well.
2252 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2254 * exp_aggr.adb (Flatten): Copy tree of expression in a component
2255 association with a range or a set of discrete choices, rather than
2256 relocating the node. This avoids inconsistencies in the tree when
2257 handling nested subprograms with uplevel references for LLVM.
2259 2018-05-28 Arnaud Charlet <charlet@adacore.com>
2261 * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
2264 2018-05-28 Arnaud Charlet <charlet@adacore.com>
2266 * exp_unst.adb: Fix typo.
2268 2018-05-28 Bob Duff <duff@adacore.com>
2270 * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
2271 unnecessary use of 'Unrestricted_Access.
2273 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
2275 * repinfo.adb (Expr_Value_S): New routine.
2276 (List_Linker_Section): Properly extract the value of the section
2279 2018-05-28 Patrick Bernardi <bernardi@adacore.com>
2281 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
2282 description of the -D binder switch to reflect current usage.
2283 * gnat_ugn.texi: Regenerate.
2285 2018-05-28 Gary Dismukes <dismukes@adacore.com>
2287 * exp_ch3.adb: Minor reformatting
2289 2018-05-28 Justin Squirek <squirek@adacore.com>
2292 (Build_Initialization_Call): Add logic to pass the appropriate actual to match
2294 (Init_Formals): Add new formal *_skip_null_excluding_check
2295 * exp_util.adb, exp_util.ads
2296 (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
2298 (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
2299 (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
2300 used to determine how to generate an Init_Proc for a given type.
2301 (Needs_Constant_Address): Minor reformatting
2303 (Resolve_Null): Add logic to generate a conditional check in certain cases
2305 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
2307 * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
2310 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
2312 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
2313 the declarations of single concurrent types because they fall in the
2314 category of full type and object declarations.
2316 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2318 * repinfo.adb (Compute_Max_Length): Skip _Parent component.
2319 (List_Record_Layout): Likewise.
2321 2018-05-28 Ed Schonberg <schonberg@adacore.com>
2323 * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
2324 includes a call to function to which it applies. This may mean an
2325 omission of an attribute reference 'Result, in particular if the
2326 function is pqrameterless.
2328 2018-05-28 Justin Squirek <squirek@adacore.com>
2330 * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
2331 misresolved package name is not a case of mistaken identity.
2333 2018-05-28 Yannick Moy <moy@adacore.com>
2335 * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
2336 GNATprove mode, as the order of resolution (low then high) means that
2337 all the information is not available when resolving the low bound the
2340 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
2342 * repinfo.adb (List_Array_Info): Start with an explicit blank line and
2343 end with the linker section, if any.
2344 (List_Entities): Do not output the linker section for record types,
2345 array types and variables.
2346 (Print_Expr): Factor out common processing for unary operators and
2347 special values. Adjust and reorder the various cases.
2348 (List_Object_Info): End with the linker section, if any.
2349 (List_Record_Info): Likewise.
2350 (List_Type_Info): Do not start with a blank line.
2352 2018-05-25 Nicolas Roche <roche@adacore.com>
2354 * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
2355 that the result will be either -infinite or +infinite.
2357 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
2359 * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
2360 libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
2361 Expand range of type to match the address space of the target.
2362 (Task_Storage_Size): Remove unused type.
2364 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2366 * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
2367 of a fixed point type and the parent is a multiplying operation,
2368 resolve the operand with its own type because the context will impose a
2369 resulting type on the result of the multiplication by means of
2370 approriate conversion.
2372 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
2374 * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
2375 the in-place initialization aggregate created for pragmas
2376 Initialize_Scalars or Normalize_Scalars is performed with checks
2379 2018-05-25 Arnaud Charlet <charlet@adacore.com>
2381 * exp_aggr.adb (Convert_To_Positional): Bump default for
2382 Max_Others_Replicate to 32. Update comments.
2383 * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
2384 (No_File_Info_Cache): Initialize separately.
2385 * osint.adb (No_File_Info_Cache): Update initializer.
2387 2018-05-25 Javier Miranda <miranda@adacore.com>
2389 * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
2390 test when the left operand is a class-wide interface and the right
2391 operand is not a class-wide type.
2392 * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
2395 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2397 * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
2398 in an others clause to prevent visibility issues with the generated
2400 (Component_OK_For_Backend): Return false for a quantified expression.
2401 (Check_Static_Component): Ditto.
2403 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
2405 * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
2406 (SS_Allocate_Dynamic): New routine. The allocation logic is now split
2407 into three distring cases rather than in one loop which attempts to
2408 handle all three cases. This rewrite eliminates an issue where the last
2409 frame of the stack cannot be freed, thus causing the memory range of a
2410 new frame to approach the overflow point of the memory index type.
2411 Since the overflow is logically treated as a
2412 too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
2413 (SS_Allocate_Static): New routine. The routine factorizes the static
2414 secondary stack-related code from the former SS_Allocate.
2416 2018-05-25 Sergey Rybin <rybin@adacore.com>
2418 * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
2419 option for gnatelim.
2421 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2423 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
2424 Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
2425 is created when the proper body of the stub is analyzed.
2426 * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
2427 is the proper body of a subunit, the cloned body must be inserted in
2428 the declarative list that contains the stub.
2430 2018-05-25 Justin Squirek <squirek@adacore.com>
2432 * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
2433 generate code for 6.5(8-10) so that we don't get an assertion error
2434 when dealing with an incomplete return type.
2436 2018-05-25 Arnaud Charlet <charlet@adacore.com>
2438 * pprint.adb (Expression_Name): Strip too long expressions to avoid
2439 carrying very large strings.
2441 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
2443 * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
2446 2018-05-25 Doug Rupp <rupp@adacore.com>
2448 * tracebak.c (aarch64-linux): Implement.
2450 2018-05-25 Justin Squirek <squirek@adacore.com>
2452 * sem_ch8.adb: Minor reformatting.
2454 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
2456 * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
2459 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
2461 * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
2462 pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
2465 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2467 * sem_ch12.adb (Instance_Exists): New function, subsidiary of
2468 Validate_Derived_Type_Instance, to verify that all interfaces
2469 implemented by the formal type are also implemented by the actual. The
2470 verification is complicated when an interface of the formal is declared
2471 in a generic unit and the actual is declared in an instance of it.
2472 There is currently no mechanism to relate an interface declared within
2473 a generic to the corresponding interface in an instance, so we must
2474 traverse the list of interfaces of the actual, looking for a name
2475 match, and verifying that that interface is declared in an instance.
2477 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
2479 * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
2480 assertions; replace function versions of Next_Formal/Next_Actual with
2481 their procedural versions (which are more concise).
2483 2018-05-25 Doug Rupp <rupp@adacore.com>
2485 * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
2486 libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
2487 libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
2488 libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
2489 libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
2490 (Relative_Timed_Wait): Remove.
2491 * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
2492 for incremental looping. Remove references to Rel_Time and
2493 Relative_Timed_Wait.
2494 * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
2495 (Timed_Delay): Make separate.
2496 * libgnat/s-optide.adb: New separate procedure.
2497 * libgnat/s-osprim.ads (Max_System_Delay): New constant.
2498 * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
2499 (Max_System_Delay): New constant.
2501 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2503 * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
2504 for a formal derived type implements all the interfaces declared for
2507 2018-05-25 Yannick Moy <moy@adacore.com>
2509 * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
2510 and GNATprove modes when applicable policy is Ignore.
2512 2018-05-25 Eric Botcazou <ebotcazou@adacore.com>
2514 * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
2515 boolean type with convention C.
2516 * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
2517 * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
2518 FOREIGN and use it throughout the function.
2519 <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
2521 <E_Enumeration_Subtype>: Likewise for subtypes.
2522 <E_Record_Type>: Force the size of a storage unit on empty classes.
2523 * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
2524 boolean types with precision 1 if the size is the expected one.
2526 2018-05-25 Arnaud Charlet <charlet@adacore.com>
2528 * pprint.adb (Expression_Name): Do not print non ASCII characters.
2530 2018-05-25 Bob Duff <duff@adacore.com>
2532 * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
2533 libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
2535 2018-05-25 Bob Duff <duff@adacore.com>
2537 * sem_util.ads: Minor comment fix.
2539 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2541 * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
2542 prefixes of array attributes, to prefixes that are entity names whose
2543 type is constrained.
2544 (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
2545 subprogram, as itype created for loops in pre/postcondition may appear
2546 in loops at the library level.
2548 2018-05-25 Ed Schonberg <schonberg@adacore.com>
2550 * sem_ch13.adb (Build_Predicate_Functions): The predicate function
2551 declaration is inserted into the tree and analyzed at that point, so
2552 should not be reinserted when the body is constructed. Inside a
2553 generic, ensure that the body is not inserted twice in the tree.
2555 2018-05-25 Yannick Moy <moy@adacore.com>
2557 * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
2558 declarations not coming from source.
2560 2018-05-25 Fedor Rybin <frybin@adacore.com>
2562 * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
2563 --copy-environment for gnattest.
2565 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
2567 * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
2569 * sem_prag.adb (Get_Base_Subprogram): Same as above.
2571 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
2573 * fe.h (Set_Normalized_First_Bit): Declare.
2574 (Set_Normalized_Position): Likewise.
2575 * repinfo.adb (List_Record_Layout): Do not use irregular output for a
2576 variable position. Fix minor spacing issue.
2577 * gcc-interface/decl.c (annotate_rep): If a field has a variable
2578 offset, compute the normalized position and annotate it in addition to
2581 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
2583 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
2584 Constify and rename variables. Fix formatting.
2585 (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
2586 <N_Raise_Statement>: Likewise.
2588 2018-05-24 Javier Miranda <miranda@adacore.com>
2590 * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
2591 body of a variant record equality renaming.
2592 (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
2593 implementation of Build_Body_For_Renaming.
2594 * exp_ch3.ads (Build_Variant_Record_Equality): New library level
2595 function that factorizes the functionality needed by
2596 Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
2597 of a variant record equality subprogram.
2598 * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
2599 (Build_Variant_Record_Equality): New local procedure of
2600 Expand_Freeze_Record_Type containing all the code specific for freezing
2601 the record type that cannot be place in the new library level function.
2603 2018-05-24 Ed Schonberg <schonberg@adacore.com>
2605 * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
2606 in_parameters, used when unesting subprograms for LLVM, to indicate
2607 that a generated parameter carries the activation record from the
2608 enclosing subprogram.
2609 * exp_unst.adb (Check_Static_Type): Handle array attributes of types
2610 whose bounds may contain up-level references that need to be added to
2611 an activation recoord.
2612 (Add_Extra_Formal): Set Is_Activation_Record on new formal.
2614 2018-05-24 Yannick Moy <moy@adacore.com>
2616 * pprint.adb (Expression_Image): Improve the printing of expressions,
2617 by taking more cases into account, in particular qualified expressions
2618 and aggregates. Also count more the number of parentheses to close
2619 after the expression.
2621 2018-05-24 Javier Miranda <miranda@adacore.com>
2623 * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
2624 check for renamed discriminants.
2625 * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
2626 Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
2627 Is_Visible_Component pass the associated selector node to allow
2628 checking renamed discriminants on untagged types.
2630 2018-05-24 Ed Schonberg <schonberg@adacore.com>
2632 * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
2633 link to a use_type clause if this would cause an infinite loop in the
2634 machinery that detects redundant use clauses. This may happen when the
2635 redundant clauses appear in the context of a child unit and the context
2638 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
2640 * sinfo.ads: Fix grammar in comment.
2642 2018-05-24 Justin Squirek <squirek@adacore.com>
2644 * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
2645 and manage doubly-linked entity chain.
2646 (Nested_Scenarios): Removed entity field used for optimization during
2647 elaboration to make room for the new field Prev_Entity.
2648 (Link_Entities): Added to replace redundant calls to Set_Next_Entity
2649 and Set_Prev_Entity as well as centralize changes to the entity chain.
2650 (Predicated_Parent): Modified to use Node38.
2651 (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
2653 (Remove_Entity): Moved from sem_util.
2654 (Set_Nested_Scenarios): Deleted.
2655 (Set_Predicated_Parent): Modified to use Node38.
2656 (Set_Prev_Entity): Added to set Prev_Entity field.
2657 (Set_Validated_Object): Modified to use Node38.
2658 (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
2660 (Validated_Object): Modified to use Node38.
2661 (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
2662 predicated parent cases.
2663 (Write_Field38_Name): Add predicated parent and Validated_Object cases.
2664 * sem_ch3.adb (Process_Subtype): Add guard to protect against
2665 inappropriate marking of Predicated_Parent to non-itype subtypes.
2666 (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
2667 (Copy_And_Swap): Add setting of Prev_Entity.
2668 (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
2669 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
2671 (New_Overloaded_Entity): Remove block created to search for previous
2672 entities in the entity chain with relevant calls to Prev_Entity as well
2673 as replace duplicated code from Remove_Entity_And_Homonym with a call
2675 * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
2677 * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
2678 initial subprogram declarations related to Nested_Scenarios.
2679 (Process_Nested_Scenarios): Deleted.
2680 (Save_Scenario): Deleted.
2681 (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
2682 node space in the entity tree.
2683 * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
2684 (Remove_Entity_And_Homonym): Added to separate functionality of
2685 Remove_Entity from the homonym chain directly.
2686 * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
2687 w/ Link_Entities and Unlink_Next_Entity.
2688 * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
2690 * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
2691 Set_Next_Entity w/ Link_Entities.
2692 * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
2693 Link_Entities and Unlink_Next_Entity.
2694 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
2695 call to Remove_Entity with its new incarnation.
2696 * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
2697 * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
2700 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2702 * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
2703 Install_Limited_Withed_Unit.
2704 (Expand_With_Clause): Update the call to Install_Withed_Unit.
2705 (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
2706 (Install_Context_Clauses): Update the call to Install_Withed_Unit.
2707 (Install_Limited_Context_Clauses): Update the calls to
2708 Install_Limited_Withed_Unit.
2709 (Install_Limited_Withed_Unit): Renamed to better illustrate its
2711 (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
2712 and Install_Limited_Withed_Unit.
2713 (Install_With_Clause): Uninstall a limited with clause if a [private]
2714 with clause is given for the same package.
2715 (Install_Withed_Unit): Renamed to better illustrate its purpose.
2716 (Remove_Limited_With_Unit): New routine.
2718 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
2720 * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
2721 (__gnat_personality_seh0): Adjust and beef up comments, and
2722 fix formatting throughout.
2723 (__gnat_adjust_context): Deal minimally with version 2.
2724 * seh_init.c (__gnat_map_SEH): Fix formatting.
2725 (_gnat_SEH_error_handler): Adjust comments.
2726 (__gnat_install_SEH_handler): Fix formatting.
2728 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2730 * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
2732 2018-05-24 Ed Schonberg <schonberg@adacore.com>
2734 * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
2735 aggregate with static bounds when named associations cover all index
2736 positions and the others clause is redundant.
2738 2018-05-24 Raphael Amiard <amiard@adacore.com>
2740 * libgnat/a-cohama.ads: Add documentation.
2742 2018-05-24 Raphael Amiard <amiard@adacore.com>
2744 * libgnat/a-convec.ads: Add documentation.
2746 2018-05-24 Justin Squirek <squirek@adacore.com>
2748 * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
2749 expansion for limited tagged types when the node to be expanded is a
2750 raise expression due to it not representing a valid object.
2751 * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
2752 message regarding assignments to limited types to ignore genereated
2755 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2757 * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
2758 Ghost-related attributes of the class-wide subtype because the copy
2761 2018-05-24 Justin Squirek <squirek@adacore.com>
2763 * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
2764 marking use clauses as effective when the reference appears within
2767 2018-05-24 Cyrille Comar <comar@adacore.com>
2769 * doc/gnat_rm/the_gnat_library.rst: Fix typos.
2770 * gnat_rm.texi: Regenerate.
2772 2018-05-24 Bob Duff <duff@adacore.com>
2774 * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
2775 for build-in-place functions with a caller-unknown-size result.
2776 (Create_Finalizer): For build-in-place functions with a
2777 caller-unknown-size result, check at run time whether we need to
2778 release the secondary stack.
2780 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2782 * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
2783 generated incomplete type.
2785 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2787 * expander.adb (Expand): Update the save and restore of the Ghost
2789 * exp_ch3.adb (Freeze_Type): Likewise.
2790 * exp_disp.adb (Make_DT): Likewise.
2791 * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
2792 (Build_DIC_Procedure_Declaration): Likewise.
2793 (Build_Invariant_Procedure_Body): Likewise.
2794 (Build_Invariant_Procedure_Declaration): Likewise.
2795 (Make_Predicate_Call): Likewise.
2796 * freeze.adb (Add_To_Result): Insert the freeze action of a living
2797 entity prior to the start of the enclosing ignored Ghost region.
2798 (Freeze_Entity): Update the save and restore of the Ghost region.
2799 * ghost.adb (Install_Ghost_Mode): Reimplemented.
2800 (Install_Ghost_Region): New routine.
2801 (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
2802 (Mark_And_Set_Ghost_Body): Likewise.
2803 (Mark_And_Set_Ghost_Completion): Likewise.
2804 (Mark_And_Set_Ghost_Declaration): Likewise.
2805 (Mark_And_Set_Ghost_Instantiation): Likewise.
2806 (Mark_And_Set_Ghost_Procedure_Call): Likewise.
2807 (Name_To_Ghost_Mode): New routine.
2808 (Restore_Ghost_Region): New routine.
2809 * ghost.ads (Install_Ghost_Region): New routine.
2810 (Restore_Ghost_Region): New routine.
2811 * opt.ads: Add new global variable Ignored_Ghost_Region.
2812 * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
2813 region. Install a clean region.
2814 * sem.adb (Analyze): Likewise.
2815 (Do_Analyze): Likewise.
2816 * sem_ch3.adb (Analyze_Object_Declaration): Likewise
2817 (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
2818 capture the ultimate alias of the current primitive.
2819 (Process_Full_View): Update the save and restore of the Ghost region.
2820 Do not inherit DIC and invariant procedures.
2821 * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
2823 * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
2824 (Analyze_Subprogram_Body_Helper): Likewise.
2825 * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
2826 * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
2827 (Analyze_Subprogram_Instantiation): Likewise.
2828 (Instantiate_Package_Body): Likewise.
2829 (Instantiate_Subprogram_Body): Likewise.
2830 * sem_ch13.adb (Build_Predicate_Functions): Likewise.
2831 (Build_Predicate_Function_Declaration): Likewise.
2833 (Add_Dispatching_Operation): Do not consider DIC and invariant
2835 (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
2836 a dispatching subprogram.
2837 (Check_Operation_From_Private_View): Likewise.
2838 (Override_Dispatching_Operation): Likewise.
2839 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
2840 and restore of the Ghost region.
2841 (Analyze_Initial_Condition_In_Decl_Part): Likewise.
2842 (Analyze_Pragma): Update the save and restore of the Ghost region.
2843 (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
2844 * sem_util.adb (Is_Suitable_Primitive): New routine.
2845 * sem_util.ads (Is_Suitable_Primitive): New routine.
2846 * sinfo.ads: Update the section of Ghost regions.
2848 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
2850 * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
2851 Change "condition" to "case guard" after renaming in the contract
2853 * gnat_rm.texi: Regenerate.
2855 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2857 * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
2858 construct with discrete choices no longer contains a subtype with
2859 predicates since the expansion already handled this case.
2861 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2863 * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
2864 conversion to the return type to avoid a side effect where an imported
2865 relocated function generates a new anonymous access type, whose
2866 accessibility level does not agree with with that of the wrapper.
2868 2018-05-24 Javier Miranda <miranda@adacore.com>
2870 * sem_util.adb (Abstract_Interface_List): Add missing support for
2871 private types whose full view is a synchronized type.
2872 * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
2873 derivation of a private type parent type is a task type with
2874 discriminants as gigi does not use such type directly.
2876 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2878 * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
2879 variable marker when the reference appears in the formal part of a
2880 compilation unit instance because there is no place to insert it.
2881 (In_Compilation_Instance_Formal_Part): New routine.
2883 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
2885 * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
2886 configuration parameter.
2888 2018-05-24 Doug Rupp <rupp@adacore.com>
2890 * argv-lynxos178-raven-cert.c: New file.
2891 * libgnat/system-lynxos178-x86.ads: New file.
2893 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2895 * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
2896 Minor reformattings.
2898 2018-05-23 Pascal Obry <obry@adacore.com>
2900 * adaint.c (win32_wait): Properly free the handle/pid lists when
2901 WaitForMultipleObjects fails (return WAIT_FAILED).
2903 2018-05-23 Pascal Obry <obry@adacore.com>
2905 * adaint.c (win32_wait): Add missing parentheses.
2907 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2909 * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
2910 (Expand_N_Object_Declaration): Do not check for a large modular array
2912 * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
2913 (Freeze_Object_Declaration): Code cleanup. Check for a large modular
2915 * sem_ch3.adb: Minor reformatting.
2917 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2919 * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
2920 retrieval of the applicable predicate function to an itype created for
2921 a constrained array component.
2922 * einfo.adb: Subprograms for Predicated_Parent.
2923 (Predicate_Function): Use new attribute.
2924 * exp_util.adb (Make_Predicate_Call): If the predicate function is not
2925 available for a subtype, retrieve it from the base type, which may have
2926 been frozen after the subtype declaration and not captured by the
2927 subtype declaration.
2928 * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
2929 legal within a generated initiqlization procedure, as may happen with a
2930 predicate check on a component, when the predicate function applies to
2931 the base type of the component.
2932 * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
2933 predicates for subtype declarations and for subtype indications in
2935 (Process_Subtype): Likewise. Handle properly the case of a private type
2936 with unknown discriminants whose full view is an unconstrained array.
2937 Use Predicated_Parent to indicate source of predicate function on an
2938 itype whose parent is itself an itype.
2939 (Complete_Private_Subtype): If the private view has unknown
2940 discriminants and the full view is an unconstrained array, set base
2941 type of completion to the full view of parent.
2942 (Inherit_Predicate_Flags): Prevent double assignment of predicate
2944 (Build_Subtype): For a constrained array component, propagate predicate
2945 information from original component type declaration.
2947 2018-05-23 Boris Yakobowski <yakobowski@adacore.com>
2949 * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
2951 2018-05-23 Arnaud Charlet <charlet@adacore.com>
2953 * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
2955 * sem_elab.adb: Make "out" parameters instead of "in out" when
2958 2018-05-23 Bob Duff <duff@adacore.com>
2960 * gnatbind.adb (List_Applicable_Restrictions): Add
2961 No_Implementation_Restrictions to the list of restrictions not to list.
2962 Remove double negative "not No_Restriction_List". Comment the
2963 commentary that is output, so it won't cause errors if used directly in
2966 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2968 * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
2969 class-wide precondition on a type extension when ancestor does not have
2970 a class-wide precondition. Previously the compiler accepted such a
2971 precondition when the ancestor had a class-wide postcondition.
2973 2018-05-23 Javier Miranda <miranda@adacore.com>
2975 * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
2976 the warning on occurrences of this attribute whose evaluation is always
2977 true (since that subprogram aborts processing the attribute). In
2978 addition, replace the node by its boolean result 'True' (required
2979 because the backend has no knowledge of this attribute).
2981 2018-05-23 Bob Duff <duff@adacore.com>
2983 * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
2984 code in question is not reachable in the case where Count_Type'Last is
2987 2018-05-23 Yannick Moy <moy@adacore.com>
2989 * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
2990 local pragma Warnings Off without On.
2991 * gnat_rm.texi: Regenerate.
2993 2018-05-23 Olivier Hainque <hainque@adacore.com>
2995 * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
2996 * libgnat/g-excact.adb: Implement.
2998 2018-05-23 Ed Schonberg <schonberg@adacore.com>
3000 * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
3001 is present, verify its legality when the domain of iteration is a
3002 GNAT-specific formal container, as is already done for arrays and
3003 predefined containers.
3005 2018-05-23 Yannick Moy <moy@adacore.com>
3007 * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
3008 declaration, which was not taken into account.
3010 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3012 * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
3013 synchronized suspension.
3014 * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
3015 Ada.Synchronous_Task_Control and routines Suspend_Until_True and
3017 * sem_elab.adb: Document switch -gnatd_s.
3018 (In_Task_Body): New routine.
3019 (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
3020 body when the current construct denotes a synchronous suspension call,
3021 and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
3023 (Is_Synchronous_Suspension_Call): New routine.
3024 * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
3027 2018-05-23 Javier Miranda <miranda@adacore.com>
3029 * exp_disp.adb (Make_DT): Restrict the initialization of
3030 External_Tag and Expanded_Name to an empty string to the case where
3031 both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
3032 restricted runtimes are compiled with pragma Discard_Names.
3033 * doc/gnat_rm/implementation_defined_pragmas.rst,
3034 doc/gnat_rm/implementation_defined_characteristics.rst: Add
3036 * gnat_rm.texi: Regenerate.
3038 2018-05-23 Maroua Maalej <maalej@adacore.com>
3040 * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
3042 2018-05-23 Ed Schonberg <schonberg@adacore.com>
3044 * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
3045 iteration of an Ada2012 loop is performed to determine the type of the
3046 domain, but full analysis is performed once the loop is rewritten as a
3047 while-loop during expansion. The pre-analysis suppresses expansion; it
3048 must also suppress the generation of freeze nodes, which may otherwise
3049 appear in the wrong scope before rewritting.
3051 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3053 * sem_elab.adb: Update the section on suppressing elaboration warnings.
3055 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3057 * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
3058 Is_Elaboration_Target.
3059 (Is_Elaboration_Target): New routine.
3060 (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
3061 (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
3062 (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
3063 Is_Elaboration_Target.
3064 * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
3065 with occurrences in nodes.
3066 (Is_Elaboration_Target): New routine.
3067 * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
3068 elaboration target is subject to pragma Warnings (Off, ...).
3070 2018-05-23 Eric Botcazou <ebotcazou@adacore.com>
3072 * repinfo.adb (List_Type_Info): Remove obsolete stuff.
3074 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3076 * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
3077 (Is_Elaboration_Warnings_OK_Id): New routine.
3078 (Set_Is_Elaboration_Warnings_OK_Id): New routine.
3079 (Write_Entity_Flags): Output Flag304.
3080 * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
3081 occurrences in entities.
3082 (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
3083 (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
3085 * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
3086 elaboration warnings.
3087 * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
3088 elaboration warnings.
3089 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
3090 state of elaboration warnings.
3091 (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
3093 (Analyze_Subprogram_Declaration): Capture the state of elaboration
3095 * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
3096 elaboration warnings.
3097 (Analyze_Single_Task_Declaration): Capture the state of elaboration
3099 (Analyze_Task_Type_Declaration): Capture the state of elaboration
3101 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
3102 of elaboration warnings.
3103 (Analyze_Generic_Subprogram_Declaration): Capture the state of
3104 elaboration warnings.
3105 * sem_elab.adb: Add a section on suppressing elaboration warnings.
3106 Type Processing_Attributes includes component Suppress_Warnings
3107 intended to suppress any elaboration warnings along a path in the
3108 graph. Update Initial_State to include a value for this component.
3109 Types Target_Attributes and Task_Attriutes include component
3110 Elab_Warnings_OK to indicate whether the target or task has elaboration
3111 warnings enabled. component Elab_Warnings_OK.
3112 (Build_Access_Marker): Propagate attribute
3113 Is_Elaboration_Warnings_OK_Node from the attribute to the generated
3115 (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
3116 (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
3117 (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
3118 (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
3119 when already in this mode or when the attribute or target have warnings
3121 (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
3122 if warnings are suppressed.
3123 (Process_Conditional_ABE_Call): Suppress further elaboration warnings
3124 when already in this mode, or the target or call have warnings
3126 (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
3127 warnings are suppressed.
3128 (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
3129 warnings are suppressed.
3130 (Process_Conditional_ABE_Instantiation): Suppress further elaboration
3131 warnings when already in this mode or when the instantiation has
3132 warnings suppressed.
3133 (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
3134 diagnostics if warnings are suppressed.
3135 (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
3136 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
3137 (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
3138 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
3139 (Process_Task_Object): Suppress further elaboration warnings when
3140 already in this mode, or when the object, activation call, or task type
3141 have warnings suppressed. Update the processing state to indicate that
3142 the path goes through a task body.
3143 * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
3145 (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
3146 * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
3147 attribute references.
3149 2018-05-23 Piotr Trojanek <trojanek@adacore.com>
3151 * einfo.ads: Minor reformatting.
3153 2018-05-23 Ed Schonberg <schonberg@adacore.com>
3155 * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
3156 anonymous_access_to_ subprogram formal, apply a conversion to force an
3157 accsssibility check that will fail statically, enforcing 3.10.2 (13).
3159 2018-05-23 Daniel Mercier <mercier@adacore.com>
3161 * gnat1drv.adb: Turn off length expansion in CodePeer mode.
3163 2018-05-23 Bob Duff <duff@adacore.com>
3165 * freeze.adb: (Check_Address_Clause): Deal with build-in-place
3166 aggregates in addition to build-in-place calls.
3168 2018-05-23 Bob Duff <duff@adacore.com>
3170 * einfo.ads: Minor reformatting.
3171 * sem_ch3.adb: Likewise.
3172 * sinfo.ads: Likewise.
3174 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3176 * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
3177 initialization when the component type has predicates.
3178 * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
3179 allocation when the component type has predicates.
3181 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3183 * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
3186 2018-05-22 Justin Squirek <squirek@adacore.com>
3188 * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
3189 original function spec into the generated function spec due to
3190 expansion of expression functions during analysis.
3191 (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
3192 references from the body to the subprogram spec in the case of
3193 expression functions because of inconsistances related to having a
3195 * libgnarl/s-osinte__android.ads: Flag parameters as unused.
3196 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
3197 * libgnarl/s-osinte__qnx.adb: Likewise.
3198 * libgnarl/s-osinte__qnx.ads: Likewise.
3200 2018-05-22 Doug Rupp <rupp@adacore.com>
3202 * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
3205 2018-05-22 Olivier Hainque <hainque@adacore.com>
3207 * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
3208 Expect an Exception_Occurence object, not an Access.
3209 (Complete_And_Propagate_Occurrence): Adjust accordingly.
3210 (Raise_From_Signal_Handler): Likewise.
3211 (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
3212 available in the provided occurrence object, just re-propagate the
3213 latter as a bare "raise;" would do.
3214 * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
3215 * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
3216 to null, to mark that the occurrence we're crafting from the stream
3217 contents is not being propagated (yet).
3219 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3221 * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
3222 code for a transient component in line with the rest of the
3223 initialization code, rather than before the aggregate. This ensures
3224 that the component has proper visibility of the discriminants.
3226 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
3228 * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
3231 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
3233 * sigtramp-qnx.c: Properly restore link register in signal trampoline.
3235 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3237 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
3238 conversions before extracting the value of the expression.
3239 * exp_ch3.adb (Default_Initialize_Object): Optimize the default
3240 initialization of an array of scalars.
3241 (Get_Simple_Init_Val): Add processing for array types. Remove the
3242 processing of strings because this case is already handled by the array
3244 (Needs_Simple_Initialization): Moved to Sem_Util.
3245 (Simple_Init_Array_Type): New routine.
3246 (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
3247 facilities from Sem_Util.
3248 (Simple_Initialization_OK): New routine.
3249 * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
3250 * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
3251 an array of scalars.
3252 * sem_prag.adb (Analyze_Float_Value): New routine.
3253 (Analyze_Integer_Value): New routine.
3254 (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
3255 to handled the extended form of the pragma.
3256 (Analyze_Type_Value_Pair): New routine.
3257 * sem_util.adb: Add invalid value-related data structures.
3258 (Examine_Array_Bounds): New routine.
3259 (Has_Static_Array_Bounds): Reimplemented.
3260 (Has_Static_Non_Empty_Array_Bounds): New routine.
3261 (Invalid_Scalar_Value): New routine.
3262 (Needs_Simple_Initialization): Moved from Exp_Ch3.
3263 (Set_Invalid_Scalar_Value): New routines.
3264 * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
3265 (Invalid_Scalar_Value): New routine.
3266 (Needs_Simple_Initialization): Moved from Exp_Ch3.
3267 (Set_Invalid_Scalar_Value): New routines.
3268 * snames.ads-tmpl: Add names for the salar type families used by pragma
3271 2018-05-22 Javier Miranda <miranda@adacore.com>
3273 * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
3274 string when pragma No_Tagged_Streams is applicable to the tagged type,
3275 and initialize the Expanded_Name with an empty string when pragma
3276 Discard_Names is applicable to the tagged type.
3278 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3280 * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
3281 formal subprogram is never subtype conformqnt, and thus cannot be the
3282 prefix of 'Access. Reject as well the attribute when applied to a
3283 renaming of a formal subprogram.
3285 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3287 * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
3288 Needs_Simple_Initialization.
3289 (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
3290 (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
3291 profile and comment on usage.
3292 (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
3293 Sloc of a value obtained from aspect Default_Value because this could
3294 potentially replicate large trees. The proper Sloc is now set in
3295 Get_Simple_Init_Val.
3296 (Get_Simple_Init_Val): Reorganized by breaking the various cases into
3297 separate routines. Eliminate the use of global variables.
3298 (Init_Component): Update the call to Get_Simple_Init_Val.
3299 (Needs_Simple_Initialization): Update the parameter profile and all
3301 (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
3302 and set the proper Sloc.
3303 * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
3305 (Needs_Simple_Initialization): Update the parameter profile.
3307 2018-05-22 Patrick Bernardi <bernardi@adacore.com>
3309 * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
3310 user tries to use a subtype indication as a discriminant constraint.
3312 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3314 * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
3315 of N_Reduction_Expression and N_Reduction_Expression_Parameter.
3316 * par-ch4.adb: Remove parsing routines for reduction expressions.
3317 * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
3318 sem_spark.adb, sprint.adb: Remove analysis routines for reduction
3321 2018-05-22 Arnaud Charlet <charlet@adacore.com>
3323 * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
3324 Relaxed_RM_Semantics mode.
3326 2018-05-22 Arnaud Charlet <charlet@adacore.com>
3328 * comperr.adb (Delete_SCIL_Files): Take into account
3329 N_Generic_Package_Renaming_Declaration.
3331 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3333 * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
3334 private, use the full view if available, because it may include renamed
3335 discriminants whose values are stored in the corresponding
3338 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3340 * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
3341 defined on packages that are actuals for formal packages, in order to
3342 set/reset the visibility of the formals of a formal package with given
3343 actuals, when there are subsequent uses of those formals in the
3344 enclosing generic, as required by RN 12.7 (10).
3345 * atree.ads, atree.adb: Add operations for Elist30.
3346 * atree.h: Add Elist30.
3347 * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
3348 that are not defaulted and are thus not visible within the current
3350 (Check_Formal_Packages): Reset visibility of formals of a formal
3351 package that are not defaulted, on exit from current instance.
3353 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3355 * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
3356 non-'Result output appears in the output list of a function.
3358 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3360 * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
3361 (Build_Record_VS_Func): Reimplemented.
3362 (Expand_N_Attribute): Reimplement the handling of attribute
3364 * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
3365 attribute 'Valid_Scalars.
3366 * sem_util.adb (Scalar_Part_Present): Reimplemented.
3367 (Validated_View): New routine.
3368 * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
3370 (Validated_View): New routine.
3371 * doc/gnat_rm/implementation_defined_attributes.rst: Update the
3372 documentation of attribute 'Valid_Scalars.
3373 * gnat_rm.texi: Regenerate.
3375 2018-05-22 Bob Duff <duff@adacore.com>
3377 * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
3378 the spec of a SAL_Interface package.
3380 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3382 * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
3383 entity E within a generic unit, indicate that there are no remaining
3384 delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
3385 entity E is not frozen yet but the aspects should not be reanalyzed at
3386 the freeze point, which may be outside of the generic and may not have
3387 the proper visibility.
3389 2018-05-22 Bob Duff <duff@adacore.com>
3391 * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
3392 the new --split-line-before-record, --indent-named-statements and
3393 --no-align-modes gnatpp switches.
3395 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3397 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
3398 a second argument that is a constant of a given string value.
3400 2018-05-22 Doug Rupp <rupp@adacore.com>
3402 * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
3404 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
3406 * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
3408 2018-05-22 Ed Schonberg <schonberg@adacore.com>
3410 * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
3411 delayed aspects, analyze them now, os that the representation of the
3412 type (size, bounds) can be computed and validated.
3414 2018-05-22 Olivier Hainque <hainque@adacore.com>
3416 * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
3417 executable code section boundaries.
3419 2018-05-22 Javier Miranda <miranda@adacore.com>
3421 * locales.c: New implementation for the Ada.Locales package.
3422 * libgnat/a-locale.ads: Remove comment indicating that this is not
3424 * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
3425 that this is not implemented.
3426 * gnat_rm.texi: Regenerate.
3428 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3430 * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
3433 2018-05-22 Justin Squirek <squirek@adacore.com>
3435 * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
3436 (Freeze_Subprogram_Body, Install_Body): Modify calls to
3437 In_Same_Declarative_Part.
3438 * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
3439 verify pragma declaration is within the same declarative list with
3440 corresponding error message.
3441 * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
3442 sem_ch12.adb and generalized to be useful outside the scope of
3445 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
3447 * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
3448 categorization of the unit after processing the aspects in case one of
3449 its aspects is converted into a categorization pragma.
3451 2018-05-21 Ed Schonberg <schonberg@adacore.com>
3453 * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
3454 declaration with an explicit address clause and a type with default
3455 initialization, if the declaration carries an aspect
3456 Suppress_Initialization.
3458 2018-05-21 Daniel Mercier <mercier@adacore.com>
3460 * pprint.adb: Use mixed case for attribute names.
3462 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
3464 * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
3465 Analyze_Aspect_Specifications_On_Body_Or_Stub.
3466 (Analyze_Subprogram_Body_Helper): Rename the calls to
3467 Analyze_Aspect_Specifications_On_Body_Or_Stub.
3468 * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
3469 Analyze_Aspect_Specifications_On_Body_Or_Stub.
3470 * sem_ch10.adb: Add with and use clause for Sem_Ch13.
3471 (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
3472 prior to analyzing its aspects.
3473 (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
3474 stub prior to analyzing its aspects. Save and restore the configuration
3476 (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
3477 prior to analyzing its aspects.
3478 * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
3479 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
3480 * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
3481 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
3482 * sem_prag.adb: Code reformatting.
3483 (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
3485 2018-05-21 Jerome Lambourg <lambourg@adacore.com>
3487 * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
3490 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
3492 * exp_cg.adb: Remove with and use clause for Exp_Disp.
3493 * exp_ch9.adb: Remove with and use clause for Exp_Disp.
3494 * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
3495 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
3496 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
3497 * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
3498 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
3499 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
3500 * exp_dist.adb: Remove with and use clause for Exp_Disp.
3501 * freeze.adb: Remove with and use clause for Exp_Disp.
3502 * sem_cat.adb: Remove with and use clause for Exp_Disp.
3503 * sem_ch6.adb: Remove with and use clause for Exp_Disp.
3504 * sem_ch12.adb: Remove with and use clause for Exp_Disp.
3505 * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
3507 * sem_util.adb: Remove with and use clause for Exp_Disp.
3508 (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
3509 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
3510 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
3511 * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
3513 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
3514 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
3516 2018-05-21 Ed Schonberg <schonberg@adacore.com>
3518 * sem_res.adb (Valid_Conversion): Improve error message on an illegal
3519 type conversion whose expression has a limited view of a type.
3521 2018-05-21 Ed Schonberg <schonberg@adacore.com>
3523 * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
3524 explicit name for iterator loop, preserve that name in expanded
3525 construct, for possible use in exit statements.
3527 2018-05-21 Javier Miranda <miranda@adacore.com>
3529 * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
3530 spec of a unit has Ada 2012 membership tests with multiple choices and
3531 the unit body is not compiled under Ada 2012 mode.
3533 2018-05-21 Doug Rupp <rupp@adacore.com>
3535 * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
3537 (CFI_COMMON_REGS): Restore LR jic probed from prologue.
3538 (REGNO_PC_OFFSET): Change to correct value for Aarch64.
3540 2018-05-21 Jose Ruiz <ruiz@adacore.com>
3542 * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
3543 libgnarl/s-tassta.adb: Minor typo fixes
3545 2018-05-21 Ed Schonberg <schonberg@adacore.com>
3547 * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
3548 indexed call originally in prefix forn is itself the prefix of a
3551 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
3553 * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
3555 (Not_Null_Range): Same as above.
3557 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
3559 * exp_ch3.adb: Minor reformatting.
3560 * exp_ch6.adb: Likewise.
3561 * freeze.adb: Likewise.
3562 * inline.adb: Likewise.
3563 * sem_util.adb: Likewise.
3565 2018-05-21 Yannick Moy <moy@adacore.com>
3567 * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
3568 conversion instead of an unchecked type conversion when inlining a
3569 return statement, unless type qualification is required (for character
3570 and string literal) or no check can result from the conversion (for
3572 * opt.ads: Update comment.
3574 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
3576 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
3577 model of the compilation unit spec, if any.
3578 * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
3579 model of the compilation unit spec, if any.
3580 * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
3581 parent compilation unit spec, if any.
3582 * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
3583 model of the main unit.
3584 (Is_Same_Unit): The routine now uses Unit_Entity.
3585 (Is_Subunit): Removed.
3586 (Normalize_Unit): Removed.
3587 (Unit_Entity): New routine.
3588 * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
3589 Elaboration_Checks. The analysis now ensures that the pragma appears at
3590 the configuration level, and on the initial declaration of a unit.
3591 Other placements are either flagged as illegal, or ignored.
3592 (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
3593 (Ignore_Elaboration_Checks_Pragma): New routine.
3594 * sem_util.adb (Install_Elaboration_Model): New routine.
3595 * sem_util.ads (Install_Elaboration_Model): New routine.
3596 * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
3597 documentation of pragma Elaboration_Checks.
3598 * gnat_rm.texi: Regenerate.
3600 2018-05-21 Olivier Hainque <hainque@adacore.com>
3602 * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
3603 of empty string when argv[0] couldn't be found on PATH.
3604 (Enable_Cache): Raise Program_Error instead of attempting a null
3605 pointer dereference when the Exec_Module initialization failed.
3607 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
3609 * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
3610 * libgnarl/a-taside.ads (Tasking_State): Likewise.
3611 * libgnat/a-calend.ads (Clock_Time): Likewise.
3613 2018-05-21 Yannick Moy <moy@adacore.com>
3615 * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
3616 call notation in inlined call in GNATprove mode.
3618 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
3620 * einfo.adb (Is_External_State): An abstract state is also external
3621 when it is declared with option "synchronous".
3622 * einfo.ads: Update the documentation of synthesized attribute
3624 * sem_util.adb (Find_Simple_Properties): New routine.
3625 (Is_Enabled_External_Property): New routine.
3626 (State_Has_Enabled_Property): Reimplemented. The two flavors of option
3627 External have precedence over option Synchronous when determining
3628 whether a property is in effect.
3630 2018-05-21 Yannick Moy <moy@adacore.com>
3632 * sem_eval.adb (Static_Length): Take into account case of variable of
3633 subtype string literal.
3635 2018-05-21 Olivier Hainque <hainque@adacore.com>
3637 * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
3638 (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
3639 * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
3641 (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
3642 * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
3645 2018-05-21 Olivier Hainque <hainque@adacore.com>
3647 * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
3648 Address, and type of Low, High to Storage_Offset.
3649 (Low): Rename as Low_Address and convey that the return value is a
3650 runtime reference accounting for a load address.
3651 * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
3652 address/offset type changes.
3653 (Aranges_Lookup): Likewise.
3654 (Symbolic_Address): Likewise.
3655 (Symbolic_Traceback): Likewise.
3656 (Dump_Cache): Likewise.
3657 (Is_Inside): Likewise.
3659 (Set_Load_Address): Likewise.
3660 (Low_Address): Likewise, and account for C.Load_Address.
3661 * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
3662 (Multi_Module_Symbolic_Traceback): Compare address in traceback
3663 with module Low_Address instead of Low.
3665 2018-05-21 Olivier Hainque <hainque@adacore.com>
3667 * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
3669 * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
3670 (Set_Load_Address): Likewise.
3671 (Symbolic_Traceback): Likewise.
3673 2018-05-21 Olivier Hainque <hainque@adacore.com>
3675 * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
3676 Load_Address argument and pass it down to Init_Module.
3677 * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
3678 lm.l_addr as the Load_Address to Add_Module_To_Cache.
3680 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
3682 * einfo.adb (Has_Discriminants): Stronger assertion.
3683 (Set_Has_Discriminants): Stronger assertion.
3684 * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
3685 the stronger assertion on Has_Discriminant.
3686 (Uninstall_Discriminants_And_Pop_Scope): Same as above.
3687 * sem_util.adb (New_Copy_Tree): Same as above.
3688 * sem_ch7.adb (Generate_Parent_References): Prevent calls to
3689 Has_Discriminant on non-type entities that might happen when the
3690 compiled code has errors.
3691 * sem_ch3.adb (Derived_Type_Declaration): Only call
3692 Set_Has_Discriminant on type entities.
3694 2018-05-21 Arnaud Charlet <charlet@adacore.com>
3696 * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
3699 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
3701 * lib.ads: Fix typo in enumeration in comment.
3703 2018-05-21 Ed Schonberg <schonberg@adacore.com>
3705 * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
3706 attribute reference is legal within a generic unit when the prefix is a
3707 formal private type.
3709 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
3711 * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
3712 delegate the secondary stack management when there is no suitable
3713 transient context, and the transient scope was intended to manage the
3714 secondary stack because this causes premature reclamation. Change the
3715 transient scope creation logic by special casing assignment statements
3716 of controlled components for type initialization procedures.
3717 (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
3718 the comment on usage.
3719 (Find_Transient_Context): Change the initinte loop into a while loop.
3720 Iterations schemes and iterator specifications are not valid transient
3721 contexts because they rely on special processing. Assignment statements
3722 are now treated as a normal transient context, special cases are
3723 handled by the caller. Add special processing for pragma Check.
3724 (Is_OK_Construct): Removed. Its functionality has been merged in
3725 routine Find_Transient_Context.
3726 * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
3727 retrieve the subprogram being invoked. Use a more accurate predicate
3728 (Requires_Transient_Scope) to determine that the function will emply
3729 the secondary stack.
3731 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
3733 * ada_get_targ.adb: Fix subprogram body headers.
3734 * adabkend.adb: Likewise.
3735 * checks.adb: Likewise.
3736 * exp_ch3.adb: Likewise.
3737 * exp_ch5.adb: Likewise.
3738 * exp_ch9.adb: Likewise.
3739 * exp_dist.adb: Likewise.
3740 * exp_tss.adb: Likewise.
3741 * inline.adb: Likewise.
3742 * lib-writ.adb: Likewise.
3743 * lib-xref-spark_specific.adb: Likewise.
3744 * libgnarl/s-osinte__darwin.adb: Likewise.
3745 * libgnarl/s-stusta.adb: Likewise.
3746 * libgnarl/s-taprop__solaris.adb: Likewise.
3747 * libgnarl/s-tposen.adb: Likewise.
3748 * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
3749 * libgnarl/s-vxwext__kernel.adb: Likewise.
3750 * libgnat/a-btgbso.adb: Likewise.
3751 * libgnat/a-cfdlli.adb: Likewise.
3752 * libgnat/a-cfhama.adb: Likewise.
3753 * libgnat/a-cfinve.adb: Likewise.
3754 * libgnat/a-cimutr.adb: Likewise.
3755 * libgnat/a-coboho.adb: Likewise.
3756 * libgnat/a-cofove.adb: Likewise.
3757 * libgnat/a-cofuve.adb: Likewise.
3758 * libgnat/a-comutr.adb: Likewise.
3759 * libgnat/a-exexda.adb: Likewise.
3760 * libgnat/a-tags.adb: Likewise.
3761 * libgnat/a-tideau.adb: Likewise.
3762 * libgnat/a-wtdeau.adb: Likewise.
3763 * libgnat/a-ztdeau.adb: Likewise.
3764 * libgnat/g-alleve.adb: Likewise.
3765 * libgnat/s-excdeb.adb: Likewise.
3766 * libgnat/s-parint.adb: Likewise.
3767 * libgnat/s-shasto.adb: Likewise.
3768 * libgnat/s-traceb__hpux.adb: Likewise.
3769 * prepcomp.adb: Likewise.
3770 * sem_ch4.adb: Likewise.
3771 * sem_ch6.adb: Likewise.
3772 * sem_dist.adb: Likewise.
3773 * sem_prag.adb: Likewise.
3774 * sem_util.adb: Likewise.
3775 * sinfo.adb: Likewise.
3776 * switch.adb: Likewise.
3778 2018-05-04 John Marino <gnugcc@marino.st>
3781 * link.c (BSD platforms): Add missing backslash.
3783 2018-04-27 Eric Botcazou <ebotcazou@adacore.com>
3786 * init.c (__gnat_handle_vms_condition): Add missing parentheses.
3788 2018-04-25 Eric Botcazou <ebotcazou@adacore.com>
3791 * gnat_ugn.texi: Regenerate.
3793 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
3796 * gnatlink.adb (Gnatlink): Remove handling of -b switch.
3797 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
3798 Remove documentation of -b switch.
3800 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
3803 * gnatlink.adb (Process_Args): Drop existing link switches if multiple
3804 switches are passed for --LINK.
3806 2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
3809 * gcc-interface/misc.c (gnat_post_options): Disable string overflow
3812 2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
3814 * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
3815 Consider only entities for objects.
3817 2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
3819 * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
3821 (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
3823 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
3825 * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
3826 guarding the overflow check emitted for the upper bound of a floating-
3829 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
3831 * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
3833 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
3835 * libgnat/i-cexten.ads (Float_128): New type.
3837 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
3839 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
3840 false if the component type is a pointer.
3842 2018-01-11 Gary Dismukes <dismukes@adacore.com>
3844 * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
3845 result of Get_Simple_Init_Value and pass the source location of the
3846 object declaration's object_definition.
3848 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3850 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
3851 properly object declarations with initializations that are
3852 build-in-place function calls, when there is an address specification,
3853 either as an aspect specification or an explicit attribute
3854 specification clause, for the initialized object.
3855 * freeze.adb (Check_Address_Clause): Do not remove side-effects from
3856 initial expressions in the case of a build-in-place call.
3858 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
3860 * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
3861 private (sub)type; refactor to avoid early return statement.
3862 (Not_Null_Range): Same as above.
3864 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3866 * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
3867 concurrent, nor effectively volatile.
3868 * ghost.adb (Check_Ghost_Type): New routine.
3869 * ghost.ads (Check_Ghost_Type): New routine.
3870 * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
3871 consider specific subsets of declarations.
3872 (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
3873 replicated by Is_Declaration.
3874 * sem_util.ads (Is_Declaration): New parameter profile. Update the
3876 (Is_Declaration_Other_Than_Renaming): Removed.
3878 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3880 * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
3881 as Part_Of consituents of single protected types are illegal when they
3882 take place inside a protected function.
3883 (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
3885 (Is_Protected_Part_Of_Constituent): New routine.
3886 (Within_Function): New routine.
3888 2018-01-11 Arnaud Charlet <charlet@adacore.com>
3890 Bump copyright notices to 2018.
3892 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3894 * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
3897 2018-01-11 Justin Squirek <squirek@adacore.com>
3899 * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
3900 to make sure a given expression function is properly parenthesized.
3902 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3904 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
3905 categorization of a subprogram body which does not complete a previous
3908 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3910 * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
3911 scope of package Ada is Standard.
3913 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3915 * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
3916 subcomponent of the current entity when building the body for a dynamic
3917 predicate function for a record with composite subcomponents.
3919 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3921 * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
3922 Establish_Transient_Scope.
3923 (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
3924 (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
3925 * exp_ch6.adb (Expand_Call_Helper): Update the call to
3926 Establish_Transient_Scope.
3927 (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
3928 Establish_Transient_Scope.
3929 * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
3930 management of the secondary stack to an enclosing scope if there is no
3931 suitable construct to wrap, and the transient scope was intended to
3932 manage the secondary stack.
3933 (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
3934 is a valid boundary for a transient expression which comes from the
3935 statements of the alternative, otherwise alternatives cannot be
3936 wrapped. Assignments of controlled objects which have controlled
3937 actions suppressed now stop the traversal as there is no point in
3938 looking for an enclosing construct. Add several N_xxx_Body choices to
3939 the termination conditions for completeness.
3940 * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
3941 and the associated comment on usage.
3942 * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
3943 Establish_Transient_Scope.
3944 (Add_Write_After): Update the call to Establish_Transient_Scope.
3945 * sem_res.adb (Check_Initialization_Call): Removed.
3946 (Resolve_Actuals): Account for additional cases where finalization
3947 actions are required by utilizing predicate Needs_Finalization rather
3949 (Resolve_Call): Type initialization procedures can now utilize
3950 transient scopes to manage the secondary stack, thus preventing leaks
3951 during initialization. Remove the previous kludgy algorithm which
3952 attempts to manage the secondary stack at the object creation site.
3954 2018-01-11 Jerome Lambourg <lambourg@adacore.com>
3956 * libgnat/g-soliop__qnx.ads: New.
3957 * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
3960 2018-01-11 Bob Duff <duff@adacore.com>
3962 * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
3963 a null procedure occurs in a protected definition.
3965 2018-01-11 Bob Duff <duff@adacore.com>
3967 * binderr.ads, namet.ads: Minor reformatting.
3969 2018-01-11 Bob Duff <duff@adacore.com>
3971 * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
3974 2018-01-11 Bob Duff <duff@adacore.com>
3976 * binde.adb (Force_Elab_Order): Give an error if there are duplicate
3979 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3981 * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
3982 controlling argument of a dispatching call. freeze the corresponding
3985 2018-01-11 Ben Brosgol <brosgol@adacore.com>
3987 * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
3989 2018-01-11 Ben Brosgol <brosgol@adacore.com>
3991 * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
3993 * gnat_rm.texi: Regenerate.
3995 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3997 * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
3998 formsl type corresponding to the actual fixed point type is private,
3999 because in this case there can be no suspicious arithmetic operations
4000 in the generic unless they reference a formal subprogram. Clarify
4003 2018-01-11 Javier Miranda <miranda@adacore.com>
4005 * exp_util.adb (Remove_Side_Effects): No action done for functions
4006 returning class-wide types since it requires generating code using
4007 'reference and the CCG target has no secondary stack.
4008 * gnat1drv.adb: Disable building static dispatch tables when generating
4011 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
4013 * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
4014 libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
4015 (File_Type): Add Default_Initial_Condition aspect.
4017 2018-01-11 Pascal Obry <obry@adacore.com>
4019 * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
4021 2018-01-11 Bob Duff <duff@adacore.com>
4023 * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
4024 to match what the Libadalang-based version does.
4025 * doc/gnat_ugn/about_this_guide.rst: Update reference.
4027 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4029 * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
4030 if it contains at least one component declaration employing a function
4031 call returning on the secondary stack.
4033 2018-01-11 Yannick Moy <moy@adacore.com>
4035 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
4036 Update description of restriction SPARK_05 with SPARK 2014.
4037 * gnat_rm.texi: Regenerate.
4039 2018-01-11 Vasiliy Fofanov <fofanov@adacore.com>
4041 * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
4043 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4045 * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
4046 sem_res.adb, sem_util.adb: Minor reformatting.
4048 2018-01-11 Ed Schonberg <schonberg@adacore.com>
4050 * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
4051 has a delayed aspect which must be processed at the point the type is
4052 frozen. This mimics what is done when the predicate is provided by a
4055 2018-01-11 Doug Rupp <rupp@adacore.com>
4057 * init.c (vxworks): Add macro checks for __aarch64__.
4059 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4061 * exp_util.adb (Add_Failure_Expression): New routine.
4062 (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
4063 * sem_util.adb (Is_Current_Instance): Code cleanup.
4065 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
4067 * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
4068 Default_Sec_Stack_Size.
4069 * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
4070 limit check so that the integer index does not overflow. Check the
4071 dynamic stack allocation does not cause the secondary stack pointer to
4073 (SS_Info): Align colons.
4074 (SS_Init): Cover the case when bootstraping with an old compiler that
4075 does not set Default_SS_Size.
4077 2018-01-11 Ed Schonberg <schonberg@adacore.com>
4079 * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
4080 legality of an inherited operation that may require overriding, ignore
4081 primitive_wrappers that correspond to explicit operations that override
4082 an interface primitive.
4083 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
4084 operation to which the class-wide expression applies is a protected op.
4085 with a primitive_wrapper, verify that the updated inherited expression
4086 does not contain an internal call to a protected function. This
4087 completes the implementation of AI12-0166.
4089 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4091 * ali.adb: Document the remaining letters available for ALI lines.
4092 (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
4093 * ali.ads: Update type With_Record. Field
4094 Implicit_With_From_Instantiation is no longer in use. Add field
4096 * csinfo.adb (CSinfo): Remove the setup for attribute
4097 Implicit_With_From_Instantiation.
4098 * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
4099 either implicitly or explicitly withed.
4100 (Is_Implicit_With_Clause): New routine.
4101 (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
4102 confusion with the with clause attribute by the same name.
4103 (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
4104 * rtsfind.adb (Maybe_Add_With): Code cleanup.
4105 * sem_ch8.adb (Present_System_Aux): Code cleanup.
4106 * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
4108 (Implicit_With_On_Parent): Mark the with clause as generated for a
4110 * sem_ch12.adb (Inherit_Context): With clauses inherited by an
4111 instantiation are no longer marked as Implicit_With_From_Instantiation
4112 because they are already marked as implicit.
4113 * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
4114 which marks implicit with clauses as related to an instantiation.
4115 * sinfo.adb (Implicit_With_From_Instantiation): Removed.
4116 (Parent_With): New routine.
4117 (Set_Implicit_With_From_Instantiation): Removed.
4118 (Set_Parent_With): New routine.
4119 * sinfo.ads: Update the documentation of attribute Implicit_With.
4120 Remove attribute Implicit_With_From_Instantiation along with
4121 occurrences in nodes. Add attribute Parent_With along with occurrences
4123 (Implicit_With_From_Instantiation): Removed along with pragma Inline.
4124 (Parent_With): New routine along with pragma Inline.
4125 (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
4126 (Set_Parent_With): New routine along with pragma Inline.
4128 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4130 * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
4131 entity when the enclosing construct is a body.
4133 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
4135 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
4136 Secondary_Stack_Size handling as a pragma is now generated for the
4137 corresponding aspect instead of an attribute. Pragma expression is
4138 relocated instead of evaluated. Discriminant of the corresponding
4139 record type is referenced rather than the type discriminant.
4140 (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
4141 Secondary_Stack_Size rep item checks to only look for the pragma rep.
4142 * sem_ch13.adb (Analyze_One_Aspect): Transform
4143 Aspect_Secondary_Stack_Size into a pragma instead of an attribute
4144 because the attribute does not have visibility on a task type's
4145 discriminants when the type's definition is expanded.
4146 (Analyze_Attribute_Definition_Clause): Remove handling of
4147 Attribute_Secondary_Stack_Size.
4148 * snames.adb-tmpl, snames.ads-tmpl: Remove
4149 Attribute_Secondary_Stack_Size, no longer used.
4151 2018-01-11 Justin Squirek <squirek@adacore.com>
4153 * sem_ch8.adb: Minor comment fix.
4155 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4157 * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
4158 individual action because the action may denote a complex expression,
4159 such as a case statement, which in turn may contain additional
4162 2018-01-11 Ed Schonberg <schonberg@adacore.com>
4164 * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
4165 analysis on a copy of the expression with a copy of the index variable,
4166 because full expansion will rewrite construct into a loop with the
4167 original loop variable.
4168 * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
4169 expression is an iterated component association. Full analysis takes
4170 place when construct is rewritten as a loop.
4171 (In_Place_Assign_OK, Safe_Component): An iterated_component_association
4172 is not safe for in-place assignment.
4173 * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
4174 entity with no homonym and no other entity in the scope.
4176 2018-01-11 Justin Squirek <squirek@adacore.com>
4178 * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
4179 message to be printed on the pragma argument identifier.
4181 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4183 * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
4184 entity of the generated invariant procedure in order to construct a
4185 proper entity chain.
4187 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
4189 * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
4192 2018-01-11 Arnaud Charlet <charlet@adacore.com>
4194 * einfo.ads, einfo.adb (Activation_Record_Component,
4195 Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
4196 Allow E_Discriminant.
4198 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
4200 * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
4201 for atomic access once the component size is taken into account and
4202 also do it if the component type is Atomic or Volatile_Full_Access.
4204 2018-01-04 Eric Botcazou <ebotcazou@adacore.com>
4206 * gnatvsn.ads: Bump copyright year.
4208 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4209 Alan Hayward <alan.hayward@arm.com>
4210 David Sherwood <david.sherwood@arm.com>
4212 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
4215 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4216 Alan Hayward <alan.hayward@arm.com>
4217 David Sherwood <david.sherwood@arm.com>
4219 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
4222 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4223 Alan Hayward <alan.hayward@arm.com>
4224 David Sherwood <david.sherwood@arm.com>
4226 * gcc-interface/utils.c (gnat_types_compatible_p): Handle
4227 polynomial TYPE_VECTOR_SUBPARTS.
4229 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4230 Alan Hayward <alan.hayward@arm.com>
4231 David Sherwood <david.sherwood@arm.com>
4233 * gcc-interface/misc.c (enumerate_modes): Handle polynomial
4236 2018-01-03 Jakub Jelinek <jakub@redhat.com>
4238 Update copyright years.
4240 * gnat_ugn.texi: Bump @copying's copyright year.
4241 * gnat_rm.texi: Likewise.
4243 Copyright (C) 2018 Free Software Foundation, Inc.
4245 Copying and distribution of this file, with or without modification,
4246 are permitted in any medium without royalty provided the copyright
4247 notice and this notice are preserved.