1 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
3 * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
4 sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
5 (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
7 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
9 * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
11 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
13 * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
14 in a separate routine.
15 (Is_Atomic_Object_Entity): New routine.
16 (Is_Atomic_Prefix): Cleaned up.
17 (Is_Synchronized_Object): Check that the object is atomic, or its type
19 (Object_Has_Atomic_Components): Removed.
20 * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
21 (Is_Atomic_Object_Entity): New routine.
23 2018-05-30 Ed Schonberg <schonberg@adacore.com>
25 * sem_ch3.adb (Access_Subprogram_Declaration): The flag
26 Needs_Activation_Record is only needed on a subprogram type, not on a
28 * sem_res.adb (Resolve_Selected_Component): If the context type and the
29 component type are anonymous access to subprograms, use the component
30 type to obtain the proper value of Needs_Activation_Record flag for the
33 2018-05-30 Eric Botcazou <ebotcazou@adacore.com>
35 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
36 comment about the memset case.
38 2018-05-30 Bob Duff <duff@adacore.com>
40 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
41 to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
42 We need to analyze it as part of analyzing the block, so that if the
43 call to Element that initializes Elmt_Decl returns on the secondary
44 stack, the block will ss_mark/ss_release. This block is inside the
45 loop; we don't want to leak memory until the loop exits. The purpose
46 of analyzing Elmt_Decl first was to catch the error of modifying it,
47 which is illegal because it's a loop parameter. The above causes us to
48 miss that error. Therefore, we add a flag Is_Loop_Parameter, and set
49 it on the Element entity, so we end up with an E_Variable node with the
51 * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
52 * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
53 parameter not allowed" error if Is_Loop_Parameter.
54 * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
55 trigger the call to Diagnose_Non_Variable_Lhs.
57 2018-05-30 Arnaud Charlet <charlet@adacore.com>
59 * checks.adb (Apply_Scalar_Range_Check):
60 * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
61 range values for System.Priority in CodePeer mode since the actual
62 target compiler may provide a wider range.
64 2018-05-30 Ed Schonberg <schonberg@adacore.com>
66 * exp_unst.adb: Search specification of main unit as well, for
69 2018-05-30 Ed Schonberg <schonberg@adacore.com>
71 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
72 a package body that is a compilation unit may contain blocks that
73 declare local subprograms. In Subprogram_Unnesting Mode such
74 subprograms must be handled as nested inside the (implicit) elaboration
75 procedure that executes that statement part. To handle properly uplevel
76 references we construct that subprogram explicitly, to contain blocks
77 and inner subprograms, The statement part of the compilation unit
78 becomes a call to this subprogram. This is only done if blocks are
79 present in the statement list of the body.
81 2018-05-30 Bob Duff <duff@adacore.com>
83 * exp_ch7.adb: Minor comment fix.
85 2018-05-30 Ed Schonberg <schonberg@adacore.com>
87 * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
88 that have no corresponding body and appear as attributes of the
89 corresponding wrapper package declaration.
90 (Register_Subprogram): New subprogram, used for subprogram bodies and
91 for subprogram instantiations to enter callable entity into Subp table.
93 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
95 * libgnat/s-secsta.adb: Reimplement the secondary stack support.
96 * libgnat/s-secsta.ads: Update the documentation of all routines in the
97 public part of the package. Reimplement the private part of the
98 package to account for the new secondary stack structure. Add types
99 and subprograms for testing purposes. Add several documentation
102 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
104 * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
105 exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
106 libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
107 sem_disp.ads, sem_util.adb: Minor reformatting.
109 2018-05-30 Arnaud Charlet <charlet@adacore.com>
111 * gcc-interface/Makefile.in: Move special flags for Ada runtime files
113 * Makefile.rtl: ... to here. Update comments. Protect call to
114 "GCC_FOR_TARGET" in case target_os isn't defined.
116 2018-05-30 Arnaud Charlet <charlet@adacore.com>
118 * gcc-interface/Makefile.in: Move target pair settings from here...
119 * Makefile.rtl: ... to here.
120 (setup-rts): New target.
122 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
124 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
125 List of All Switches): Replace "modules" with "units".
126 (Subprogram Inlining Control): Likewise.
127 * gnat_ugn.texi: Regenerate.
128 * usage.adb (Usage): Fix description of -gnatn switch.
130 2018-05-29 Arnaud Charlet <charlet@adacore.com>
132 * gcc-interface/Makefile.in: Fix typos.
134 2018-05-29 Ed Schonberg <schonberg@adacore.com>
136 * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
137 the finalizer procedure in the At_End handler, for use in LLVM
140 2018-05-29 Javier Miranda <miranda@adacore.com>
142 * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
143 subprogram Inherits_From_Tagged_Full_View to identify more reliably
144 untagged private types completed with a derivation of an untagged
145 private whose full view is a tagged type.
146 * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
148 (Collect_Primitive_Operations): Handle untagged private types completed
149 with a derivation of an untagged private type whose full view is a
150 tagged type. In such case, collecting the list of primitives we may
151 find two equality primitives: one associated with the untagged private
152 and another associated with the ultimate tagged type (and we must
153 remove from the returned list this latter one).
155 2018-05-29 Ed Schonberg <schonberg@adacore.com>
157 * exp_unst.adb (Visit_Node): Handle statement sequences that include an
160 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
162 * repinfo.adb (List_Entities): Also recurse into blocks without label.
164 2018-05-29 Ed Schonberg <schonberg@adacore.com>
166 * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
167 exceptions if subprogram unnesting is in effect, because these branch
168 nodes are relevant only in the presence of nested subprograms.
170 2018-05-29 Ed Schonberg <schonberg@adacore.com>
172 * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
173 unconditionally when applied to the largest positive (resp. largest
174 negative) value of a floating-point type.
176 2018-05-29 Ed Schonberg <schonberg@adacore.com>
178 * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
179 discriminants and exceptions are never components of such. The flag
180 Needs_Activation_Record is set on subprogram types, not on access to
183 2018-05-29 Ed Schonberg <schonberg@adacore.com>
185 * sem_ch3.adb: Set scope of component of subtype.
187 2018-05-29 Ed Schonberg <schonberg@adacore.com>
189 * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
190 carry no type. Such selected components appear in unit names that are
191 child units, both in the specification and possibly in an end label for
192 the unit, and they do not contain any relevant uplevel references.
194 2018-05-29 Arnaud Charlet <charlet@adacore.com>
196 * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
199 2018-05-29 Olivier Hainque <hainque@adacore.com>
201 * libgnat/system-vxworks7-ppc-rtp.ads: New file.
202 * libgnat/system-vxworks7-ppc-kernel.ads: New file.
203 * libgnat/system-vxworks7-e500-rtp.ads: New file.
204 * libgnat/system-vxworks7-e500-kernel.ads: New file.
205 * libgnat/system-vxworks7-x86-rtp.ads: New file.
206 * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
207 * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
208 gnat-crtbe link spec to use the vx7 variant.
210 2018-05-29 Olivier Hainque <hainque@adacore.com>
212 * vx_crtbegin.inc: Use a consistent naming convention for the
213 registration/deregistration functions across RTP or kernel. Remove the
214 ctor/dtor attribute setting based on RTP/kernel, expect the optional
215 attribute extension to be provided by includers instead.
216 * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
217 extension for the registration/deregistration functions.
218 * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
219 constructor/destructor attribute extensions.
220 * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
221 attribute extensions and declare _ctors/_dtors arrays.
222 * vx_crtbegin_auto.c: Remove.
223 * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
224 vxworks7-gnat-crtbe-link.spec.
225 * libgnat/system-vxworks7-aarch64.ads: Likewise.
226 * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
227 * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
228 * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
229 * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
230 * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
231 * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
232 * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
234 2018-05-29 Piotr Trojanek <trojanek@adacore.com>
236 * ali.adb: Minor reformatting.
238 2018-05-29 Joel Brobecker <brobecker@adacore.com>
240 * doc/gnat_ugn/platform_specific_information.rst: Update package
241 requirements for 32bit GNAT on x86_64-linux.
242 * gnat_ugn.texi: Regenerate.
244 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
246 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
247 Control): Adjust description of -gnatRj.
248 * gnat_ugn.texi: Regenerate.
249 * opt.ads (List_Representation_Info_To_JSON): Likewise.
250 * repinfo.adb (List_Rep_Info): Do not automatically create a file
251 if List_Representation_Info_To_JSON is true.
252 * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
253 check between -gnatRj and -gnatRs.
254 * usage.adb (Usage): Adjust description of -gnatRj.
256 2018-05-29 Pascal Obry <obry@adacore.com>
258 * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
261 2018-05-29 Pascal Obry <obry@adacore.com>
263 * libgnat/s-os_lib.adb: Minor reformatting.
265 2018-05-29 Doug Rupp <rupp@adacore.com>
267 * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
268 * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
269 * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
270 * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
272 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
274 * repinfo.ads (JSON format): Document new pair for components.
275 * repinfo.adb (Derived_Discriminant): New function.
276 (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
277 in recursive calls. If the record type is the parent of an extension,
278 find and list the derived discriminant from the extension, if any.
279 (List_Component_Layout): List the Discriminant_Number in JSON mode.
280 (List_Record_Info): Adjust call to List_Structural_Record_Layout.
282 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
284 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
285 List of All Switches): Document -gnatRj.
286 (Debugging Control): Likewise.
287 * gnat_ugn.texi: Regenerate.
288 * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
289 * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
290 extension if List_Representation_Info_To_JSON is true.
291 * repinfo.ads: Document the JSON output format.
292 * repinfo.adb (List_Location): New procedure.
293 (List_Array_Info): Add support for JSON output.
294 (List_Entities): Likewise.
297 (Print_Expr): Likewise.
298 (List_Linker_Section): Likewise.
299 (List_Mechanisms): Likewise.
300 (List_Name): Likewise.
301 (List_Object_Info): Likewise.
302 (List_Record_Info): Likewise.
303 (List_Component_Layout): Likewise. Add Indent parameter.
304 (List_Structural_Record_Layout): New procedure.
305 (List_Attr): Add support for JSON output.
306 (List_Type_Info): Likewise.
307 (Write_Unknown_Val): Likewise.
308 * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
309 * usage.adb (Usage): List -gnatRj.
311 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
313 * repinfo.adb (List_Component_Layout): New procedure extracted from...
314 (List_Record_Layout): ...here. Invoke it.
316 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
318 * repinfo.adb (Write_Unknown_Val): New procedure.
319 (List_GCC_Expression): Call it.
320 (List_Record_Layout): Likewise.
321 (Write_Val): Likewise.
323 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
325 * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
328 2018-05-29 Arnaud Charlet <charlet@adacore.com>
330 * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
331 This breaks build of cross compilers with older versions of GNAT, so
334 2018-05-29 Doug Rupp <rupp@adacore.com>
336 * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
339 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
341 * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
343 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
345 * repinfo.adb (List_Entities): Do not list the Linker_Section for
347 (List_Mechanisms): ...but here instead. Use consistent name output
348 and formatting conventions.
350 2018-05-29 Bob Duff <duff@adacore.com>
352 * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
354 * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
355 To_Mixed): New functions.
356 * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
357 allows both '\' and '/' on Windows.
359 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
361 * repinfo.ads: Minor fixes and tweaks in comments.
363 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
365 * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
366 it with calls to Unop.
368 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
370 * repinfo.ads (TCode): Adjust range.
371 (Truth_Andif_Expr): Remove.
372 (Truth_Orif_Expr): Likewise.
373 (Truth_And_Expr .. Dynamic_Val): Adjust value.
374 * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
375 (Rep_Value): Likewise.
376 * repinfo.h (Truth_Andif_Expr): Remove.
377 (Truth_Orif_Expr): Likewise.
378 (Truth_And_Expr .. Dynamic_Val): Adjust value.
379 * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
380 through to TRUTH_AND_EXPR case.
381 <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
383 2018-05-28 Ed Schonberg <schonberg@adacore.com>
385 * exp_unst.adb (Visit_Node): For indexed components and attribute
386 references, examine index expressions or associated expressions as well
387 to record uplevel references.
388 (Vist_Node): For function and procedure calls, if a formal is an
389 unconstrained array and the actual is constrained, check whether bounds
390 of actual have uplevel references.
392 2018-05-28 Ed Schonberg <schonberg@adacore.com>
394 * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
395 they can appear as components of activation records.
396 * exp_unst.adb (Visit_Node): A reference to an exception may be an
399 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
401 * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
402 depends on a discriminant manually instead of using the predicate
403 Size_Depends_On_Discriminant in the array type case.
405 2018-05-28 Ed Schonberg <schonberg@adacore.com>
407 * exp_unst.adb (Check_Static_Type): For a record subtype, check
408 discriminant constraints as well.
409 (Visit_Node): For a selected component, check type of prefix, as is
410 done for indexed components and slices.
412 2018-05-28 Javier Miranda <miranda@adacore.com>
414 * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
415 value when converting a float value to a fixed-point value. This is
416 required for CCG because it handles fixed-point types by means of
417 unsigned integer type variables. The range check is now performed using
418 the integer value stored in this temporary.
420 2018-05-28 Yannick Moy <moy@adacore.com>
422 * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
423 Length as valid non-interfering contexts for SPARK.
425 2018-05-28 Claire Dross <dross@adacore.com>
427 * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
428 generic inheritance utilities.
429 (Generic_Inherited_Subprograms): Generic version of
430 Inherited_Subprograms, generic in Find_Dispatching_Type function.
431 (Generic_Is_Overriding_Subprogram): Generic version of
432 Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
433 (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
434 Sem_Disp.Find_Dispatching_Type.
435 (Is_Overriding_Subprogram): Instance of
436 Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
437 (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
438 with Sem_Disp.Find_Dispatching_Type.
440 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
442 * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
443 component type, do not expand array equality using the unconstrained
444 base type, except for the case where the bounds of the type depend on a
447 2018-05-28 Ed Schonberg <schonberg@adacore.com>
449 * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
450 access-to-subprogram types, to indicate that an indirect call through
451 such a type requires an activation record when compiling for LLVM.
452 * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
454 2018-05-28 Ed Schonberg <schonberg@adacore.com>
456 * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
457 when bounds of fixed type are static, to remove some spuerfluous
458 implicit conversions and provide an accurate result when converting
459 back and forth between the fixed point type and a floating point type.
461 2018-05-28 Ed Schonberg <schonberg@adacore.com>
463 * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
466 2018-05-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
468 * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
469 replaced, if any; all callers changed.
470 (Note_Uplevel_Ref): Likewise. Also replace reference to deferred
471 constant with private view so we take the address of that entity.
472 (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
473 any; all callers changed. Handle N_Indexed_Component like
474 N_Attribute_Reference. Add N_Type_Conversion case.
475 (Visit_Node): Indexed references can be uplevel if the type isn't
477 (Unnest_Subprograms): Don't rewrite if no reference given. If call has
478 been relocated, set first_named pointer in original node as well.
480 2018-05-28 Ed Schonberg <schonberg@adacore.com>
482 * exp_aggr.adb (Flatten): Copy tree of expression in a component
483 association with a range or a set of discrete choices, rather than
484 relocating the node. This avoids inconsistencies in the tree when
485 handling nested subprograms with uplevel references for LLVM.
487 2018-05-28 Arnaud Charlet <charlet@adacore.com>
489 * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
492 2018-05-28 Arnaud Charlet <charlet@adacore.com>
494 * exp_unst.adb: Fix typo.
496 2018-05-28 Bob Duff <duff@adacore.com>
498 * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
499 unnecessary use of 'Unrestricted_Access.
501 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
503 * repinfo.adb (Expr_Value_S): New routine.
504 (List_Linker_Section): Properly extract the value of the section
507 2018-05-28 Patrick Bernardi <bernardi@adacore.com>
509 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
510 description of the -D binder switch to reflect current usage.
511 * gnat_ugn.texi: Regenerate.
513 2018-05-28 Gary Dismukes <dismukes@adacore.com>
515 * exp_ch3.adb: Minor reformatting
517 2018-05-28 Justin Squirek <squirek@adacore.com>
520 (Build_Initialization_Call): Add logic to pass the appropriate actual to match
522 (Init_Formals): Add new formal *_skip_null_excluding_check
523 * exp_util.adb, exp_util.ads
524 (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
526 (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
527 (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
528 used to determine how to generate an Init_Proc for a given type.
529 (Needs_Constant_Address): Minor reformatting
531 (Resolve_Null): Add logic to generate a conditional check in certain cases
533 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
535 * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
538 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
540 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
541 the declarations of single concurrent types because they fall in the
542 category of full type and object declarations.
544 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
546 * repinfo.adb (Compute_Max_Length): Skip _Parent component.
547 (List_Record_Layout): Likewise.
549 2018-05-28 Ed Schonberg <schonberg@adacore.com>
551 * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
552 includes a call to function to which it applies. This may mean an
553 omission of an attribute reference 'Result, in particular if the
554 function is pqrameterless.
556 2018-05-28 Justin Squirek <squirek@adacore.com>
558 * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
559 misresolved package name is not a case of mistaken identity.
561 2018-05-28 Yannick Moy <moy@adacore.com>
563 * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
564 GNATprove mode, as the order of resolution (low then high) means that
565 all the information is not available when resolving the low bound the
568 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
570 * repinfo.adb (List_Array_Info): Start with an explicit blank line and
571 end with the linker section, if any.
572 (List_Entities): Do not output the linker section for record types,
573 array types and variables.
574 (Print_Expr): Factor out common processing for unary operators and
575 special values. Adjust and reorder the various cases.
576 (List_Object_Info): End with the linker section, if any.
577 (List_Record_Info): Likewise.
578 (List_Type_Info): Do not start with a blank line.
580 2018-05-25 Nicolas Roche <roche@adacore.com>
582 * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
583 that the result will be either -infinite or +infinite.
585 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
587 * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
588 libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
589 Expand range of type to match the address space of the target.
590 (Task_Storage_Size): Remove unused type.
592 2018-05-25 Ed Schonberg <schonberg@adacore.com>
594 * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
595 of a fixed point type and the parent is a multiplying operation,
596 resolve the operand with its own type because the context will impose a
597 resulting type on the result of the multiplication by means of
598 approriate conversion.
600 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
602 * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
603 the in-place initialization aggregate created for pragmas
604 Initialize_Scalars or Normalize_Scalars is performed with checks
607 2018-05-25 Arnaud Charlet <charlet@adacore.com>
609 * exp_aggr.adb (Convert_To_Positional): Bump default for
610 Max_Others_Replicate to 32. Update comments.
611 * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
612 (No_File_Info_Cache): Initialize separately.
613 * osint.adb (No_File_Info_Cache): Update initializer.
615 2018-05-25 Javier Miranda <miranda@adacore.com>
617 * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
618 test when the left operand is a class-wide interface and the right
619 operand is not a class-wide type.
620 * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
623 2018-05-25 Ed Schonberg <schonberg@adacore.com>
625 * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
626 in an others clause to prevent visibility issues with the generated
628 (Component_OK_For_Backend): Return false for a quantified expression.
629 (Check_Static_Component): Ditto.
631 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
633 * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
634 (SS_Allocate_Dynamic): New routine. The allocation logic is now split
635 into three distring cases rather than in one loop which attempts to
636 handle all three cases. This rewrite eliminates an issue where the last
637 frame of the stack cannot be freed, thus causing the memory range of a
638 new frame to approach the overflow point of the memory index type.
639 Since the overflow is logically treated as a
640 too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
641 (SS_Allocate_Static): New routine. The routine factorizes the static
642 secondary stack-related code from the former SS_Allocate.
644 2018-05-25 Sergey Rybin <rybin@adacore.com>
646 * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
649 2018-05-25 Ed Schonberg <schonberg@adacore.com>
651 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
652 Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
653 is created when the proper body of the stub is analyzed.
654 * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
655 is the proper body of a subunit, the cloned body must be inserted in
656 the declarative list that contains the stub.
658 2018-05-25 Justin Squirek <squirek@adacore.com>
660 * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
661 generate code for 6.5(8-10) so that we don't get an assertion error
662 when dealing with an incomplete return type.
664 2018-05-25 Arnaud Charlet <charlet@adacore.com>
666 * pprint.adb (Expression_Name): Strip too long expressions to avoid
667 carrying very large strings.
669 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
671 * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
674 2018-05-25 Doug Rupp <rupp@adacore.com>
676 * tracebak.c (aarch64-linux): Implement.
678 2018-05-25 Justin Squirek <squirek@adacore.com>
680 * sem_ch8.adb: Minor reformatting.
682 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
684 * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
687 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
689 * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
690 pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
693 2018-05-25 Ed Schonberg <schonberg@adacore.com>
695 * sem_ch12.adb (Instance_Exists): New function, subsidiary of
696 Validate_Derived_Type_Instance, to verify that all interfaces
697 implemented by the formal type are also implemented by the actual. The
698 verification is complicated when an interface of the formal is declared
699 in a generic unit and the actual is declared in an instance of it.
700 There is currently no mechanism to relate an interface declared within
701 a generic to the corresponding interface in an instance, so we must
702 traverse the list of interfaces of the actual, looking for a name
703 match, and verifying that that interface is declared in an instance.
705 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
707 * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
708 assertions; replace function versions of Next_Formal/Next_Actual with
709 their procedural versions (which are more concise).
711 2018-05-25 Doug Rupp <rupp@adacore.com>
713 * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
714 libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
715 libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
716 libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
717 libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
718 (Relative_Timed_Wait): Remove.
719 * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
720 for incremental looping. Remove references to Rel_Time and
722 * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
723 (Timed_Delay): Make separate.
724 * libgnat/s-optide.adb: New separate procedure.
725 * libgnat/s-osprim.ads (Max_System_Delay): New constant.
726 * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
727 (Max_System_Delay): New constant.
729 2018-05-25 Ed Schonberg <schonberg@adacore.com>
731 * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
732 for a formal derived type implements all the interfaces declared for
735 2018-05-25 Yannick Moy <moy@adacore.com>
737 * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
738 and GNATprove modes when applicable policy is Ignore.
740 2018-05-25 Eric Botcazou <ebotcazou@adacore.com>
742 * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
743 boolean type with convention C.
744 * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
745 * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
746 FOREIGN and use it throughout the function.
747 <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
749 <E_Enumeration_Subtype>: Likewise for subtypes.
750 <E_Record_Type>: Force the size of a storage unit on empty classes.
751 * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
752 boolean types with precision 1 if the size is the expected one.
754 2018-05-25 Arnaud Charlet <charlet@adacore.com>
756 * pprint.adb (Expression_Name): Do not print non ASCII characters.
758 2018-05-25 Bob Duff <duff@adacore.com>
760 * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
761 libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
763 2018-05-25 Bob Duff <duff@adacore.com>
765 * sem_util.ads: Minor comment fix.
767 2018-05-25 Ed Schonberg <schonberg@adacore.com>
769 * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
770 prefixes of array attributes, to prefixes that are entity names whose
772 (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
773 subprogram, as itype created for loops in pre/postcondition may appear
774 in loops at the library level.
776 2018-05-25 Ed Schonberg <schonberg@adacore.com>
778 * sem_ch13.adb (Build_Predicate_Functions): The predicate function
779 declaration is inserted into the tree and analyzed at that point, so
780 should not be reinserted when the body is constructed. Inside a
781 generic, ensure that the body is not inserted twice in the tree.
783 2018-05-25 Yannick Moy <moy@adacore.com>
785 * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
786 declarations not coming from source.
788 2018-05-25 Fedor Rybin <frybin@adacore.com>
790 * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
791 --copy-environment for gnattest.
793 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
795 * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
797 * sem_prag.adb (Get_Base_Subprogram): Same as above.
799 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
801 * fe.h (Set_Normalized_First_Bit): Declare.
802 (Set_Normalized_Position): Likewise.
803 * repinfo.adb (List_Record_Layout): Do not use irregular output for a
804 variable position. Fix minor spacing issue.
805 * gcc-interface/decl.c (annotate_rep): If a field has a variable
806 offset, compute the normalized position and annotate it in addition to
809 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
811 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
812 Constify and rename variables. Fix formatting.
813 (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
814 <N_Raise_Statement>: Likewise.
816 2018-05-24 Javier Miranda <miranda@adacore.com>
818 * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
819 body of a variant record equality renaming.
820 (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
821 implementation of Build_Body_For_Renaming.
822 * exp_ch3.ads (Build_Variant_Record_Equality): New library level
823 function that factorizes the functionality needed by
824 Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
825 of a variant record equality subprogram.
826 * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
827 (Build_Variant_Record_Equality): New local procedure of
828 Expand_Freeze_Record_Type containing all the code specific for freezing
829 the record type that cannot be place in the new library level function.
831 2018-05-24 Ed Schonberg <schonberg@adacore.com>
833 * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
834 in_parameters, used when unesting subprograms for LLVM, to indicate
835 that a generated parameter carries the activation record from the
836 enclosing subprogram.
837 * exp_unst.adb (Check_Static_Type): Handle array attributes of types
838 whose bounds may contain up-level references that need to be added to
839 an activation recoord.
840 (Add_Extra_Formal): Set Is_Activation_Record on new formal.
842 2018-05-24 Yannick Moy <moy@adacore.com>
844 * pprint.adb (Expression_Image): Improve the printing of expressions,
845 by taking more cases into account, in particular qualified expressions
846 and aggregates. Also count more the number of parentheses to close
847 after the expression.
849 2018-05-24 Javier Miranda <miranda@adacore.com>
851 * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
852 check for renamed discriminants.
853 * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
854 Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
855 Is_Visible_Component pass the associated selector node to allow
856 checking renamed discriminants on untagged types.
858 2018-05-24 Ed Schonberg <schonberg@adacore.com>
860 * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
861 link to a use_type clause if this would cause an infinite loop in the
862 machinery that detects redundant use clauses. This may happen when the
863 redundant clauses appear in the context of a child unit and the context
866 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
868 * sinfo.ads: Fix grammar in comment.
870 2018-05-24 Justin Squirek <squirek@adacore.com>
872 * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
873 and manage doubly-linked entity chain.
874 (Nested_Scenarios): Removed entity field used for optimization during
875 elaboration to make room for the new field Prev_Entity.
876 (Link_Entities): Added to replace redundant calls to Set_Next_Entity
877 and Set_Prev_Entity as well as centralize changes to the entity chain.
878 (Predicated_Parent): Modified to use Node38.
879 (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
881 (Remove_Entity): Moved from sem_util.
882 (Set_Nested_Scenarios): Deleted.
883 (Set_Predicated_Parent): Modified to use Node38.
884 (Set_Prev_Entity): Added to set Prev_Entity field.
885 (Set_Validated_Object): Modified to use Node38.
886 (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
888 (Validated_Object): Modified to use Node38.
889 (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
890 predicated parent cases.
891 (Write_Field38_Name): Add predicated parent and Validated_Object cases.
892 * sem_ch3.adb (Process_Subtype): Add guard to protect against
893 inappropriate marking of Predicated_Parent to non-itype subtypes.
894 (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
895 (Copy_And_Swap): Add setting of Prev_Entity.
896 (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
897 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
899 (New_Overloaded_Entity): Remove block created to search for previous
900 entities in the entity chain with relevant calls to Prev_Entity as well
901 as replace duplicated code from Remove_Entity_And_Homonym with a call
903 * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
905 * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
906 initial subprogram declarations related to Nested_Scenarios.
907 (Process_Nested_Scenarios): Deleted.
908 (Save_Scenario): Deleted.
909 (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
910 node space in the entity tree.
911 * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
912 (Remove_Entity_And_Homonym): Added to separate functionality of
913 Remove_Entity from the homonym chain directly.
914 * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
915 w/ Link_Entities and Unlink_Next_Entity.
916 * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
918 * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
919 Set_Next_Entity w/ Link_Entities.
920 * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
921 Link_Entities and Unlink_Next_Entity.
922 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
923 call to Remove_Entity with its new incarnation.
924 * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
925 * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
928 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
930 * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
931 Install_Limited_Withed_Unit.
932 (Expand_With_Clause): Update the call to Install_Withed_Unit.
933 (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
934 (Install_Context_Clauses): Update the call to Install_Withed_Unit.
935 (Install_Limited_Context_Clauses): Update the calls to
936 Install_Limited_Withed_Unit.
937 (Install_Limited_Withed_Unit): Renamed to better illustrate its
939 (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
940 and Install_Limited_Withed_Unit.
941 (Install_With_Clause): Uninstall a limited with clause if a [private]
942 with clause is given for the same package.
943 (Install_Withed_Unit): Renamed to better illustrate its purpose.
944 (Remove_Limited_With_Unit): New routine.
946 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
948 * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
949 (__gnat_personality_seh0): Adjust and beef up comments, and
950 fix formatting throughout.
951 (__gnat_adjust_context): Deal minimally with version 2.
952 * seh_init.c (__gnat_map_SEH): Fix formatting.
953 (_gnat_SEH_error_handler): Adjust comments.
954 (__gnat_install_SEH_handler): Fix formatting.
956 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
958 * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
960 2018-05-24 Ed Schonberg <schonberg@adacore.com>
962 * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
963 aggregate with static bounds when named associations cover all index
964 positions and the others clause is redundant.
966 2018-05-24 Raphael Amiard <amiard@adacore.com>
968 * libgnat/a-cohama.ads: Add documentation.
970 2018-05-24 Raphael Amiard <amiard@adacore.com>
972 * libgnat/a-convec.ads: Add documentation.
974 2018-05-24 Justin Squirek <squirek@adacore.com>
976 * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
977 expansion for limited tagged types when the node to be expanded is a
978 raise expression due to it not representing a valid object.
979 * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
980 message regarding assignments to limited types to ignore genereated
983 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
985 * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
986 Ghost-related attributes of the class-wide subtype because the copy
989 2018-05-24 Justin Squirek <squirek@adacore.com>
991 * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
992 marking use clauses as effective when the reference appears within
995 2018-05-24 Cyrille Comar <comar@adacore.com>
997 * doc/gnat_rm/the_gnat_library.rst: Fix typos.
998 * gnat_rm.texi: Regenerate.
1000 2018-05-24 Bob Duff <duff@adacore.com>
1002 * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
1003 for build-in-place functions with a caller-unknown-size result.
1004 (Create_Finalizer): For build-in-place functions with a
1005 caller-unknown-size result, check at run time whether we need to
1006 release the secondary stack.
1008 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1010 * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
1011 generated incomplete type.
1013 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1015 * expander.adb (Expand): Update the save and restore of the Ghost
1017 * exp_ch3.adb (Freeze_Type): Likewise.
1018 * exp_disp.adb (Make_DT): Likewise.
1019 * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
1020 (Build_DIC_Procedure_Declaration): Likewise.
1021 (Build_Invariant_Procedure_Body): Likewise.
1022 (Build_Invariant_Procedure_Declaration): Likewise.
1023 (Make_Predicate_Call): Likewise.
1024 * freeze.adb (Add_To_Result): Insert the freeze action of a living
1025 entity prior to the start of the enclosing ignored Ghost region.
1026 (Freeze_Entity): Update the save and restore of the Ghost region.
1027 * ghost.adb (Install_Ghost_Mode): Reimplemented.
1028 (Install_Ghost_Region): New routine.
1029 (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
1030 (Mark_And_Set_Ghost_Body): Likewise.
1031 (Mark_And_Set_Ghost_Completion): Likewise.
1032 (Mark_And_Set_Ghost_Declaration): Likewise.
1033 (Mark_And_Set_Ghost_Instantiation): Likewise.
1034 (Mark_And_Set_Ghost_Procedure_Call): Likewise.
1035 (Name_To_Ghost_Mode): New routine.
1036 (Restore_Ghost_Region): New routine.
1037 * ghost.ads (Install_Ghost_Region): New routine.
1038 (Restore_Ghost_Region): New routine.
1039 * opt.ads: Add new global variable Ignored_Ghost_Region.
1040 * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
1041 region. Install a clean region.
1042 * sem.adb (Analyze): Likewise.
1043 (Do_Analyze): Likewise.
1044 * sem_ch3.adb (Analyze_Object_Declaration): Likewise
1045 (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
1046 capture the ultimate alias of the current primitive.
1047 (Process_Full_View): Update the save and restore of the Ghost region.
1048 Do not inherit DIC and invariant procedures.
1049 * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
1051 * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
1052 (Analyze_Subprogram_Body_Helper): Likewise.
1053 * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
1054 * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
1055 (Analyze_Subprogram_Instantiation): Likewise.
1056 (Instantiate_Package_Body): Likewise.
1057 (Instantiate_Subprogram_Body): Likewise.
1058 * sem_ch13.adb (Build_Predicate_Functions): Likewise.
1059 (Build_Predicate_Function_Declaration): Likewise.
1061 (Add_Dispatching_Operation): Do not consider DIC and invariant
1063 (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
1064 a dispatching subprogram.
1065 (Check_Operation_From_Private_View): Likewise.
1066 (Override_Dispatching_Operation): Likewise.
1067 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
1068 and restore of the Ghost region.
1069 (Analyze_Initial_Condition_In_Decl_Part): Likewise.
1070 (Analyze_Pragma): Update the save and restore of the Ghost region.
1071 (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
1072 * sem_util.adb (Is_Suitable_Primitive): New routine.
1073 * sem_util.ads (Is_Suitable_Primitive): New routine.
1074 * sinfo.ads: Update the section of Ghost regions.
1076 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
1078 * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
1079 Change "condition" to "case guard" after renaming in the contract
1081 * gnat_rm.texi: Regenerate.
1083 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1085 * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
1086 construct with discrete choices no longer contains a subtype with
1087 predicates since the expansion already handled this case.
1089 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1091 * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
1092 conversion to the return type to avoid a side effect where an imported
1093 relocated function generates a new anonymous access type, whose
1094 accessibility level does not agree with with that of the wrapper.
1096 2018-05-24 Javier Miranda <miranda@adacore.com>
1098 * sem_util.adb (Abstract_Interface_List): Add missing support for
1099 private types whose full view is a synchronized type.
1100 * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
1101 derivation of a private type parent type is a task type with
1102 discriminants as gigi does not use such type directly.
1104 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1106 * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
1107 variable marker when the reference appears in the formal part of a
1108 compilation unit instance because there is no place to insert it.
1109 (In_Compilation_Instance_Formal_Part): New routine.
1111 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
1113 * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
1114 configuration parameter.
1116 2018-05-24 Doug Rupp <rupp@adacore.com>
1118 * argv-lynxos178-raven-cert.c: New file.
1119 * libgnat/system-lynxos178-x86.ads: New file.
1121 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1123 * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
1124 Minor reformattings.
1126 2018-05-23 Pascal Obry <obry@adacore.com>
1128 * adaint.c (win32_wait): Properly free the handle/pid lists when
1129 WaitForMultipleObjects fails (return WAIT_FAILED).
1131 2018-05-23 Pascal Obry <obry@adacore.com>
1133 * adaint.c (win32_wait): Add missing parentheses.
1135 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1137 * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
1138 (Expand_N_Object_Declaration): Do not check for a large modular array
1140 * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
1141 (Freeze_Object_Declaration): Code cleanup. Check for a large modular
1143 * sem_ch3.adb: Minor reformatting.
1145 2018-05-23 Ed Schonberg <schonberg@adacore.com>
1147 * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
1148 retrieval of the applicable predicate function to an itype created for
1149 a constrained array component.
1150 * einfo.adb: Subprograms for Predicated_Parent.
1151 (Predicate_Function): Use new attribute.
1152 * exp_util.adb (Make_Predicate_Call): If the predicate function is not
1153 available for a subtype, retrieve it from the base type, which may have
1154 been frozen after the subtype declaration and not captured by the
1155 subtype declaration.
1156 * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
1157 legal within a generated initiqlization procedure, as may happen with a
1158 predicate check on a component, when the predicate function applies to
1159 the base type of the component.
1160 * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
1161 predicates for subtype declarations and for subtype indications in
1163 (Process_Subtype): Likewise. Handle properly the case of a private type
1164 with unknown discriminants whose full view is an unconstrained array.
1165 Use Predicated_Parent to indicate source of predicate function on an
1166 itype whose parent is itself an itype.
1167 (Complete_Private_Subtype): If the private view has unknown
1168 discriminants and the full view is an unconstrained array, set base
1169 type of completion to the full view of parent.
1170 (Inherit_Predicate_Flags): Prevent double assignment of predicate
1172 (Build_Subtype): For a constrained array component, propagate predicate
1173 information from original component type declaration.
1175 2018-05-23 Boris Yakobowski <yakobowski@adacore.com>
1177 * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
1179 2018-05-23 Arnaud Charlet <charlet@adacore.com>
1181 * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
1183 * sem_elab.adb: Make "out" parameters instead of "in out" when
1186 2018-05-23 Bob Duff <duff@adacore.com>
1188 * gnatbind.adb (List_Applicable_Restrictions): Add
1189 No_Implementation_Restrictions to the list of restrictions not to list.
1190 Remove double negative "not No_Restriction_List". Comment the
1191 commentary that is output, so it won't cause errors if used directly in
1194 2018-05-23 Ed Schonberg <schonberg@adacore.com>
1196 * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
1197 class-wide precondition on a type extension when ancestor does not have
1198 a class-wide precondition. Previously the compiler accepted such a
1199 precondition when the ancestor had a class-wide postcondition.
1201 2018-05-23 Javier Miranda <miranda@adacore.com>
1203 * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
1204 the warning on occurrences of this attribute whose evaluation is always
1205 true (since that subprogram aborts processing the attribute). In
1206 addition, replace the node by its boolean result 'True' (required
1207 because the backend has no knowledge of this attribute).
1209 2018-05-23 Bob Duff <duff@adacore.com>
1211 * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
1212 code in question is not reachable in the case where Count_Type'Last is
1215 2018-05-23 Yannick Moy <moy@adacore.com>
1217 * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
1218 local pragma Warnings Off without On.
1219 * gnat_rm.texi: Regenerate.
1221 2018-05-23 Olivier Hainque <hainque@adacore.com>
1223 * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
1224 * libgnat/g-excact.adb: Implement.
1226 2018-05-23 Ed Schonberg <schonberg@adacore.com>
1228 * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
1229 is present, verify its legality when the domain of iteration is a
1230 GNAT-specific formal container, as is already done for arrays and
1231 predefined containers.
1233 2018-05-23 Yannick Moy <moy@adacore.com>
1235 * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
1236 declaration, which was not taken into account.
1238 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1240 * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
1241 synchronized suspension.
1242 * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
1243 Ada.Synchronous_Task_Control and routines Suspend_Until_True and
1245 * sem_elab.adb: Document switch -gnatd_s.
1246 (In_Task_Body): New routine.
1247 (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
1248 body when the current construct denotes a synchronous suspension call,
1249 and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
1251 (Is_Synchronous_Suspension_Call): New routine.
1252 * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
1255 2018-05-23 Javier Miranda <miranda@adacore.com>
1257 * exp_disp.adb (Make_DT): Restrict the initialization of
1258 External_Tag and Expanded_Name to an empty string to the case where
1259 both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
1260 restricted runtimes are compiled with pragma Discard_Names.
1261 * doc/gnat_rm/implementation_defined_pragmas.rst,
1262 doc/gnat_rm/implementation_defined_characteristics.rst: Add
1264 * gnat_rm.texi: Regenerate.
1266 2018-05-23 Maroua Maalej <maalej@adacore.com>
1268 * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
1270 2018-05-23 Ed Schonberg <schonberg@adacore.com>
1272 * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
1273 iteration of an Ada2012 loop is performed to determine the type of the
1274 domain, but full analysis is performed once the loop is rewritten as a
1275 while-loop during expansion. The pre-analysis suppresses expansion; it
1276 must also suppress the generation of freeze nodes, which may otherwise
1277 appear in the wrong scope before rewritting.
1279 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1281 * sem_elab.adb: Update the section on suppressing elaboration warnings.
1283 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1285 * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
1286 Is_Elaboration_Target.
1287 (Is_Elaboration_Target): New routine.
1288 (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
1289 (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
1290 (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
1291 Is_Elaboration_Target.
1292 * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
1293 with occurrences in nodes.
1294 (Is_Elaboration_Target): New routine.
1295 * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
1296 elaboration target is subject to pragma Warnings (Off, ...).
1298 2018-05-23 Eric Botcazou <ebotcazou@adacore.com>
1300 * repinfo.adb (List_Type_Info): Remove obsolete stuff.
1302 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1304 * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
1305 (Is_Elaboration_Warnings_OK_Id): New routine.
1306 (Set_Is_Elaboration_Warnings_OK_Id): New routine.
1307 (Write_Entity_Flags): Output Flag304.
1308 * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
1309 occurrences in entities.
1310 (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
1311 (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
1313 * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
1314 elaboration warnings.
1315 * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
1316 elaboration warnings.
1317 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
1318 state of elaboration warnings.
1319 (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
1321 (Analyze_Subprogram_Declaration): Capture the state of elaboration
1323 * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
1324 elaboration warnings.
1325 (Analyze_Single_Task_Declaration): Capture the state of elaboration
1327 (Analyze_Task_Type_Declaration): Capture the state of elaboration
1329 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
1330 of elaboration warnings.
1331 (Analyze_Generic_Subprogram_Declaration): Capture the state of
1332 elaboration warnings.
1333 * sem_elab.adb: Add a section on suppressing elaboration warnings.
1334 Type Processing_Attributes includes component Suppress_Warnings
1335 intended to suppress any elaboration warnings along a path in the
1336 graph. Update Initial_State to include a value for this component.
1337 Types Target_Attributes and Task_Attriutes include component
1338 Elab_Warnings_OK to indicate whether the target or task has elaboration
1339 warnings enabled. component Elab_Warnings_OK.
1340 (Build_Access_Marker): Propagate attribute
1341 Is_Elaboration_Warnings_OK_Node from the attribute to the generated
1343 (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
1344 (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
1345 (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
1346 (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
1347 when already in this mode or when the attribute or target have warnings
1349 (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
1350 if warnings are suppressed.
1351 (Process_Conditional_ABE_Call): Suppress further elaboration warnings
1352 when already in this mode, or the target or call have warnings
1354 (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
1355 warnings are suppressed.
1356 (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
1357 warnings are suppressed.
1358 (Process_Conditional_ABE_Instantiation): Suppress further elaboration
1359 warnings when already in this mode or when the instantiation has
1360 warnings suppressed.
1361 (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
1362 diagnostics if warnings are suppressed.
1363 (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
1364 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
1365 (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
1366 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
1367 (Process_Task_Object): Suppress further elaboration warnings when
1368 already in this mode, or when the object, activation call, or task type
1369 have warnings suppressed. Update the processing state to indicate that
1370 the path goes through a task body.
1371 * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
1373 (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
1374 * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
1375 attribute references.
1377 2018-05-23 Piotr Trojanek <trojanek@adacore.com>
1379 * einfo.ads: Minor reformatting.
1381 2018-05-23 Ed Schonberg <schonberg@adacore.com>
1383 * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
1384 anonymous_access_to_ subprogram formal, apply a conversion to force an
1385 accsssibility check that will fail statically, enforcing 3.10.2 (13).
1387 2018-05-23 Daniel Mercier <mercier@adacore.com>
1389 * gnat1drv.adb: Turn off length expansion in CodePeer mode.
1391 2018-05-23 Bob Duff <duff@adacore.com>
1393 * freeze.adb: (Check_Address_Clause): Deal with build-in-place
1394 aggregates in addition to build-in-place calls.
1396 2018-05-23 Bob Duff <duff@adacore.com>
1398 * einfo.ads: Minor reformatting.
1399 * sem_ch3.adb: Likewise.
1400 * sinfo.ads: Likewise.
1402 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1404 * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
1405 initialization when the component type has predicates.
1406 * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
1407 allocation when the component type has predicates.
1409 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
1411 * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
1414 2018-05-22 Justin Squirek <squirek@adacore.com>
1416 * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
1417 original function spec into the generated function spec due to
1418 expansion of expression functions during analysis.
1419 (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
1420 references from the body to the subprogram spec in the case of
1421 expression functions because of inconsistances related to having a
1423 * libgnarl/s-osinte__android.ads: Flag parameters as unused.
1424 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
1425 * libgnarl/s-osinte__qnx.adb: Likewise.
1426 * libgnarl/s-osinte__qnx.ads: Likewise.
1428 2018-05-22 Doug Rupp <rupp@adacore.com>
1430 * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
1433 2018-05-22 Olivier Hainque <hainque@adacore.com>
1435 * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
1436 Expect an Exception_Occurence object, not an Access.
1437 (Complete_And_Propagate_Occurrence): Adjust accordingly.
1438 (Raise_From_Signal_Handler): Likewise.
1439 (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
1440 available in the provided occurrence object, just re-propagate the
1441 latter as a bare "raise;" would do.
1442 * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
1443 * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
1444 to null, to mark that the occurrence we're crafting from the stream
1445 contents is not being propagated (yet).
1447 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1449 * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
1450 code for a transient component in line with the rest of the
1451 initialization code, rather than before the aggregate. This ensures
1452 that the component has proper visibility of the discriminants.
1454 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
1456 * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
1459 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
1461 * sigtramp-qnx.c: Properly restore link register in signal trampoline.
1463 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1465 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
1466 conversions before extracting the value of the expression.
1467 * exp_ch3.adb (Default_Initialize_Object): Optimize the default
1468 initialization of an array of scalars.
1469 (Get_Simple_Init_Val): Add processing for array types. Remove the
1470 processing of strings because this case is already handled by the array
1472 (Needs_Simple_Initialization): Moved to Sem_Util.
1473 (Simple_Init_Array_Type): New routine.
1474 (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
1475 facilities from Sem_Util.
1476 (Simple_Initialization_OK): New routine.
1477 * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
1478 * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
1479 an array of scalars.
1480 * sem_prag.adb (Analyze_Float_Value): New routine.
1481 (Analyze_Integer_Value): New routine.
1482 (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
1483 to handled the extended form of the pragma.
1484 (Analyze_Type_Value_Pair): New routine.
1485 * sem_util.adb: Add invalid value-related data structures.
1486 (Examine_Array_Bounds): New routine.
1487 (Has_Static_Array_Bounds): Reimplemented.
1488 (Has_Static_Non_Empty_Array_Bounds): New routine.
1489 (Invalid_Scalar_Value): New routine.
1490 (Needs_Simple_Initialization): Moved from Exp_Ch3.
1491 (Set_Invalid_Scalar_Value): New routines.
1492 * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
1493 (Invalid_Scalar_Value): New routine.
1494 (Needs_Simple_Initialization): Moved from Exp_Ch3.
1495 (Set_Invalid_Scalar_Value): New routines.
1496 * snames.ads-tmpl: Add names for the salar type families used by pragma
1499 2018-05-22 Javier Miranda <miranda@adacore.com>
1501 * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
1502 string when pragma No_Tagged_Streams is applicable to the tagged type,
1503 and initialize the Expanded_Name with an empty string when pragma
1504 Discard_Names is applicable to the tagged type.
1506 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1508 * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
1509 formal subprogram is never subtype conformqnt, and thus cannot be the
1510 prefix of 'Access. Reject as well the attribute when applied to a
1511 renaming of a formal subprogram.
1513 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1515 * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
1516 Needs_Simple_Initialization.
1517 (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
1518 (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
1519 profile and comment on usage.
1520 (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
1521 Sloc of a value obtained from aspect Default_Value because this could
1522 potentially replicate large trees. The proper Sloc is now set in
1523 Get_Simple_Init_Val.
1524 (Get_Simple_Init_Val): Reorganized by breaking the various cases into
1525 separate routines. Eliminate the use of global variables.
1526 (Init_Component): Update the call to Get_Simple_Init_Val.
1527 (Needs_Simple_Initialization): Update the parameter profile and all
1529 (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
1530 and set the proper Sloc.
1531 * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
1533 (Needs_Simple_Initialization): Update the parameter profile.
1535 2018-05-22 Patrick Bernardi <bernardi@adacore.com>
1537 * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
1538 user tries to use a subtype indication as a discriminant constraint.
1540 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1542 * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
1543 of N_Reduction_Expression and N_Reduction_Expression_Parameter.
1544 * par-ch4.adb: Remove parsing routines for reduction expressions.
1545 * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
1546 sem_spark.adb, sprint.adb: Remove analysis routines for reduction
1549 2018-05-22 Arnaud Charlet <charlet@adacore.com>
1551 * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
1552 Relaxed_RM_Semantics mode.
1554 2018-05-22 Arnaud Charlet <charlet@adacore.com>
1556 * comperr.adb (Delete_SCIL_Files): Take into account
1557 N_Generic_Package_Renaming_Declaration.
1559 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1561 * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
1562 private, use the full view if available, because it may include renamed
1563 discriminants whose values are stored in the corresponding
1566 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1568 * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
1569 defined on packages that are actuals for formal packages, in order to
1570 set/reset the visibility of the formals of a formal package with given
1571 actuals, when there are subsequent uses of those formals in the
1572 enclosing generic, as required by RN 12.7 (10).
1573 * atree.ads, atree.adb: Add operations for Elist30.
1574 * atree.h: Add Elist30.
1575 * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
1576 that are not defaulted and are thus not visible within the current
1578 (Check_Formal_Packages): Reset visibility of formals of a formal
1579 package that are not defaulted, on exit from current instance.
1581 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1583 * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
1584 non-'Result output appears in the output list of a function.
1586 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1588 * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
1589 (Build_Record_VS_Func): Reimplemented.
1590 (Expand_N_Attribute): Reimplement the handling of attribute
1592 * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
1593 attribute 'Valid_Scalars.
1594 * sem_util.adb (Scalar_Part_Present): Reimplemented.
1595 (Validated_View): New routine.
1596 * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
1598 (Validated_View): New routine.
1599 * doc/gnat_rm/implementation_defined_attributes.rst: Update the
1600 documentation of attribute 'Valid_Scalars.
1601 * gnat_rm.texi: Regenerate.
1603 2018-05-22 Bob Duff <duff@adacore.com>
1605 * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
1606 the spec of a SAL_Interface package.
1608 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1610 * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
1611 entity E within a generic unit, indicate that there are no remaining
1612 delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
1613 entity E is not frozen yet but the aspects should not be reanalyzed at
1614 the freeze point, which may be outside of the generic and may not have
1615 the proper visibility.
1617 2018-05-22 Bob Duff <duff@adacore.com>
1619 * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
1620 the new --split-line-before-record, --indent-named-statements and
1621 --no-align-modes gnatpp switches.
1623 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1625 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
1626 a second argument that is a constant of a given string value.
1628 2018-05-22 Doug Rupp <rupp@adacore.com>
1630 * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
1632 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
1634 * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
1636 2018-05-22 Ed Schonberg <schonberg@adacore.com>
1638 * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
1639 delayed aspects, analyze them now, os that the representation of the
1640 type (size, bounds) can be computed and validated.
1642 2018-05-22 Olivier Hainque <hainque@adacore.com>
1644 * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
1645 executable code section boundaries.
1647 2018-05-22 Javier Miranda <miranda@adacore.com>
1649 * locales.c: New implementation for the Ada.Locales package.
1650 * libgnat/a-locale.ads: Remove comment indicating that this is not
1652 * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
1653 that this is not implemented.
1654 * gnat_rm.texi: Regenerate.
1656 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1658 * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
1661 2018-05-22 Justin Squirek <squirek@adacore.com>
1663 * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
1664 (Freeze_Subprogram_Body, Install_Body): Modify calls to
1665 In_Same_Declarative_Part.
1666 * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
1667 verify pragma declaration is within the same declarative list with
1668 corresponding error message.
1669 * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
1670 sem_ch12.adb and generalized to be useful outside the scope of
1673 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
1675 * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
1676 categorization of the unit after processing the aspects in case one of
1677 its aspects is converted into a categorization pragma.
1679 2018-05-21 Ed Schonberg <schonberg@adacore.com>
1681 * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
1682 declaration with an explicit address clause and a type with default
1683 initialization, if the declaration carries an aspect
1684 Suppress_Initialization.
1686 2018-05-21 Daniel Mercier <mercier@adacore.com>
1688 * pprint.adb: Use mixed case for attribute names.
1690 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
1692 * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
1693 Analyze_Aspect_Specifications_On_Body_Or_Stub.
1694 (Analyze_Subprogram_Body_Helper): Rename the calls to
1695 Analyze_Aspect_Specifications_On_Body_Or_Stub.
1696 * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
1697 Analyze_Aspect_Specifications_On_Body_Or_Stub.
1698 * sem_ch10.adb: Add with and use clause for Sem_Ch13.
1699 (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
1700 prior to analyzing its aspects.
1701 (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
1702 stub prior to analyzing its aspects. Save and restore the configuration
1704 (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
1705 prior to analyzing its aspects.
1706 * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
1707 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
1708 * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
1709 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
1710 * sem_prag.adb: Code reformatting.
1711 (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
1713 2018-05-21 Jerome Lambourg <lambourg@adacore.com>
1715 * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
1718 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
1720 * exp_cg.adb: Remove with and use clause for Exp_Disp.
1721 * exp_ch9.adb: Remove with and use clause for Exp_Disp.
1722 * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
1723 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
1724 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
1725 * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
1726 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
1727 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
1728 * exp_dist.adb: Remove with and use clause for Exp_Disp.
1729 * freeze.adb: Remove with and use clause for Exp_Disp.
1730 * sem_cat.adb: Remove with and use clause for Exp_Disp.
1731 * sem_ch6.adb: Remove with and use clause for Exp_Disp.
1732 * sem_ch12.adb: Remove with and use clause for Exp_Disp.
1733 * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
1735 * sem_util.adb: Remove with and use clause for Exp_Disp.
1736 (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
1737 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
1738 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
1739 * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
1741 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
1742 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
1744 2018-05-21 Ed Schonberg <schonberg@adacore.com>
1746 * sem_res.adb (Valid_Conversion): Improve error message on an illegal
1747 type conversion whose expression has a limited view of a type.
1749 2018-05-21 Ed Schonberg <schonberg@adacore.com>
1751 * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
1752 explicit name for iterator loop, preserve that name in expanded
1753 construct, for possible use in exit statements.
1755 2018-05-21 Javier Miranda <miranda@adacore.com>
1757 * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
1758 spec of a unit has Ada 2012 membership tests with multiple choices and
1759 the unit body is not compiled under Ada 2012 mode.
1761 2018-05-21 Doug Rupp <rupp@adacore.com>
1763 * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
1765 (CFI_COMMON_REGS): Restore LR jic probed from prologue.
1766 (REGNO_PC_OFFSET): Change to correct value for Aarch64.
1768 2018-05-21 Jose Ruiz <ruiz@adacore.com>
1770 * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
1771 libgnarl/s-tassta.adb: Minor typo fixes
1773 2018-05-21 Ed Schonberg <schonberg@adacore.com>
1775 * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
1776 indexed call originally in prefix forn is itself the prefix of a
1779 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
1781 * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
1783 (Not_Null_Range): Same as above.
1785 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
1787 * exp_ch3.adb: Minor reformatting.
1788 * exp_ch6.adb: Likewise.
1789 * freeze.adb: Likewise.
1790 * inline.adb: Likewise.
1791 * sem_util.adb: Likewise.
1793 2018-05-21 Yannick Moy <moy@adacore.com>
1795 * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
1796 conversion instead of an unchecked type conversion when inlining a
1797 return statement, unless type qualification is required (for character
1798 and string literal) or no check can result from the conversion (for
1800 * opt.ads: Update comment.
1802 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
1804 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
1805 model of the compilation unit spec, if any.
1806 * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
1807 model of the compilation unit spec, if any.
1808 * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
1809 parent compilation unit spec, if any.
1810 * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
1811 model of the main unit.
1812 (Is_Same_Unit): The routine now uses Unit_Entity.
1813 (Is_Subunit): Removed.
1814 (Normalize_Unit): Removed.
1815 (Unit_Entity): New routine.
1816 * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
1817 Elaboration_Checks. The analysis now ensures that the pragma appears at
1818 the configuration level, and on the initial declaration of a unit.
1819 Other placements are either flagged as illegal, or ignored.
1820 (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
1821 (Ignore_Elaboration_Checks_Pragma): New routine.
1822 * sem_util.adb (Install_Elaboration_Model): New routine.
1823 * sem_util.ads (Install_Elaboration_Model): New routine.
1824 * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
1825 documentation of pragma Elaboration_Checks.
1826 * gnat_rm.texi: Regenerate.
1828 2018-05-21 Olivier Hainque <hainque@adacore.com>
1830 * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
1831 of empty string when argv[0] couldn't be found on PATH.
1832 (Enable_Cache): Raise Program_Error instead of attempting a null
1833 pointer dereference when the Exec_Module initialization failed.
1835 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
1837 * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
1838 * libgnarl/a-taside.ads (Tasking_State): Likewise.
1839 * libgnat/a-calend.ads (Clock_Time): Likewise.
1841 2018-05-21 Yannick Moy <moy@adacore.com>
1843 * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
1844 call notation in inlined call in GNATprove mode.
1846 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
1848 * einfo.adb (Is_External_State): An abstract state is also external
1849 when it is declared with option "synchronous".
1850 * einfo.ads: Update the documentation of synthesized attribute
1852 * sem_util.adb (Find_Simple_Properties): New routine.
1853 (Is_Enabled_External_Property): New routine.
1854 (State_Has_Enabled_Property): Reimplemented. The two flavors of option
1855 External have precedence over option Synchronous when determining
1856 whether a property is in effect.
1858 2018-05-21 Yannick Moy <moy@adacore.com>
1860 * sem_eval.adb (Static_Length): Take into account case of variable of
1861 subtype string literal.
1863 2018-05-21 Olivier Hainque <hainque@adacore.com>
1865 * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
1866 (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
1867 * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
1869 (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
1870 * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
1873 2018-05-21 Olivier Hainque <hainque@adacore.com>
1875 * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
1876 Address, and type of Low, High to Storage_Offset.
1877 (Low): Rename as Low_Address and convey that the return value is a
1878 runtime reference accounting for a load address.
1879 * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
1880 address/offset type changes.
1881 (Aranges_Lookup): Likewise.
1882 (Symbolic_Address): Likewise.
1883 (Symbolic_Traceback): Likewise.
1884 (Dump_Cache): Likewise.
1885 (Is_Inside): Likewise.
1887 (Set_Load_Address): Likewise.
1888 (Low_Address): Likewise, and account for C.Load_Address.
1889 * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
1890 (Multi_Module_Symbolic_Traceback): Compare address in traceback
1891 with module Low_Address instead of Low.
1893 2018-05-21 Olivier Hainque <hainque@adacore.com>
1895 * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
1897 * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
1898 (Set_Load_Address): Likewise.
1899 (Symbolic_Traceback): Likewise.
1901 2018-05-21 Olivier Hainque <hainque@adacore.com>
1903 * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
1904 Load_Address argument and pass it down to Init_Module.
1905 * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
1906 lm.l_addr as the Load_Address to Add_Module_To_Cache.
1908 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
1910 * einfo.adb (Has_Discriminants): Stronger assertion.
1911 (Set_Has_Discriminants): Stronger assertion.
1912 * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
1913 the stronger assertion on Has_Discriminant.
1914 (Uninstall_Discriminants_And_Pop_Scope): Same as above.
1915 * sem_util.adb (New_Copy_Tree): Same as above.
1916 * sem_ch7.adb (Generate_Parent_References): Prevent calls to
1917 Has_Discriminant on non-type entities that might happen when the
1918 compiled code has errors.
1919 * sem_ch3.adb (Derived_Type_Declaration): Only call
1920 Set_Has_Discriminant on type entities.
1922 2018-05-21 Arnaud Charlet <charlet@adacore.com>
1924 * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
1927 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
1929 * lib.ads: Fix typo in enumeration in comment.
1931 2018-05-21 Ed Schonberg <schonberg@adacore.com>
1933 * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
1934 attribute reference is legal within a generic unit when the prefix is a
1935 formal private type.
1937 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
1939 * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
1940 delegate the secondary stack management when there is no suitable
1941 transient context, and the transient scope was intended to manage the
1942 secondary stack because this causes premature reclamation. Change the
1943 transient scope creation logic by special casing assignment statements
1944 of controlled components for type initialization procedures.
1945 (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
1946 the comment on usage.
1947 (Find_Transient_Context): Change the initinte loop into a while loop.
1948 Iterations schemes and iterator specifications are not valid transient
1949 contexts because they rely on special processing. Assignment statements
1950 are now treated as a normal transient context, special cases are
1951 handled by the caller. Add special processing for pragma Check.
1952 (Is_OK_Construct): Removed. Its functionality has been merged in
1953 routine Find_Transient_Context.
1954 * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
1955 retrieve the subprogram being invoked. Use a more accurate predicate
1956 (Requires_Transient_Scope) to determine that the function will emply
1957 the secondary stack.
1959 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
1961 * ada_get_targ.adb: Fix subprogram body headers.
1962 * adabkend.adb: Likewise.
1963 * checks.adb: Likewise.
1964 * exp_ch3.adb: Likewise.
1965 * exp_ch5.adb: Likewise.
1966 * exp_ch9.adb: Likewise.
1967 * exp_dist.adb: Likewise.
1968 * exp_tss.adb: Likewise.
1969 * inline.adb: Likewise.
1970 * lib-writ.adb: Likewise.
1971 * lib-xref-spark_specific.adb: Likewise.
1972 * libgnarl/s-osinte__darwin.adb: Likewise.
1973 * libgnarl/s-stusta.adb: Likewise.
1974 * libgnarl/s-taprop__solaris.adb: Likewise.
1975 * libgnarl/s-tposen.adb: Likewise.
1976 * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
1977 * libgnarl/s-vxwext__kernel.adb: Likewise.
1978 * libgnat/a-btgbso.adb: Likewise.
1979 * libgnat/a-cfdlli.adb: Likewise.
1980 * libgnat/a-cfhama.adb: Likewise.
1981 * libgnat/a-cfinve.adb: Likewise.
1982 * libgnat/a-cimutr.adb: Likewise.
1983 * libgnat/a-coboho.adb: Likewise.
1984 * libgnat/a-cofove.adb: Likewise.
1985 * libgnat/a-cofuve.adb: Likewise.
1986 * libgnat/a-comutr.adb: Likewise.
1987 * libgnat/a-exexda.adb: Likewise.
1988 * libgnat/a-tags.adb: Likewise.
1989 * libgnat/a-tideau.adb: Likewise.
1990 * libgnat/a-wtdeau.adb: Likewise.
1991 * libgnat/a-ztdeau.adb: Likewise.
1992 * libgnat/g-alleve.adb: Likewise.
1993 * libgnat/s-excdeb.adb: Likewise.
1994 * libgnat/s-parint.adb: Likewise.
1995 * libgnat/s-shasto.adb: Likewise.
1996 * libgnat/s-traceb__hpux.adb: Likewise.
1997 * prepcomp.adb: Likewise.
1998 * sem_ch4.adb: Likewise.
1999 * sem_ch6.adb: Likewise.
2000 * sem_dist.adb: Likewise.
2001 * sem_prag.adb: Likewise.
2002 * sem_util.adb: Likewise.
2003 * sinfo.adb: Likewise.
2004 * switch.adb: Likewise.
2006 2018-05-04 John Marino <gnugcc@marino.st>
2009 * link.c (BSD platforms): Add missing backslash.
2011 2018-04-27 Eric Botcazou <ebotcazou@adacore.com>
2014 * init.c (__gnat_handle_vms_condition): Add missing parentheses.
2016 2018-04-25 Eric Botcazou <ebotcazou@adacore.com>
2019 * gnat_ugn.texi: Regenerate.
2021 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
2024 * gnatlink.adb (Gnatlink): Remove handling of -b switch.
2025 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
2026 Remove documentation of -b switch.
2028 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
2031 * gnatlink.adb (Process_Args): Drop existing link switches if multiple
2032 switches are passed for --LINK.
2034 2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
2037 * gcc-interface/misc.c (gnat_post_options): Disable string overflow
2040 2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
2042 * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
2043 Consider only entities for objects.
2045 2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
2047 * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
2049 (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
2051 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
2053 * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
2054 guarding the overflow check emitted for the upper bound of a floating-
2057 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
2059 * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
2061 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
2063 * libgnat/i-cexten.ads (Float_128): New type.
2065 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
2067 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
2068 false if the component type is a pointer.
2070 2018-01-11 Gary Dismukes <dismukes@adacore.com>
2072 * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
2073 result of Get_Simple_Init_Value and pass the source location of the
2074 object declaration's object_definition.
2076 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2078 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
2079 properly object declarations with initializations that are
2080 build-in-place function calls, when there is an address specification,
2081 either as an aspect specification or an explicit attribute
2082 specification clause, for the initialized object.
2083 * freeze.adb (Check_Address_Clause): Do not remove side-effects from
2084 initial expressions in the case of a build-in-place call.
2086 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
2088 * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
2089 private (sub)type; refactor to avoid early return statement.
2090 (Not_Null_Range): Same as above.
2092 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2094 * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
2095 concurrent, nor effectively volatile.
2096 * ghost.adb (Check_Ghost_Type): New routine.
2097 * ghost.ads (Check_Ghost_Type): New routine.
2098 * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
2099 consider specific subsets of declarations.
2100 (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
2101 replicated by Is_Declaration.
2102 * sem_util.ads (Is_Declaration): New parameter profile. Update the
2104 (Is_Declaration_Other_Than_Renaming): Removed.
2106 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2108 * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
2109 as Part_Of consituents of single protected types are illegal when they
2110 take place inside a protected function.
2111 (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
2113 (Is_Protected_Part_Of_Constituent): New routine.
2114 (Within_Function): New routine.
2116 2018-01-11 Arnaud Charlet <charlet@adacore.com>
2118 Bump copyright notices to 2018.
2120 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2122 * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
2125 2018-01-11 Justin Squirek <squirek@adacore.com>
2127 * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
2128 to make sure a given expression function is properly parenthesized.
2130 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2132 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
2133 categorization of a subprogram body which does not complete a previous
2136 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2138 * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
2139 scope of package Ada is Standard.
2141 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2143 * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
2144 subcomponent of the current entity when building the body for a dynamic
2145 predicate function for a record with composite subcomponents.
2147 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2149 * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
2150 Establish_Transient_Scope.
2151 (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
2152 (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
2153 * exp_ch6.adb (Expand_Call_Helper): Update the call to
2154 Establish_Transient_Scope.
2155 (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
2156 Establish_Transient_Scope.
2157 * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
2158 management of the secondary stack to an enclosing scope if there is no
2159 suitable construct to wrap, and the transient scope was intended to
2160 manage the secondary stack.
2161 (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
2162 is a valid boundary for a transient expression which comes from the
2163 statements of the alternative, otherwise alternatives cannot be
2164 wrapped. Assignments of controlled objects which have controlled
2165 actions suppressed now stop the traversal as there is no point in
2166 looking for an enclosing construct. Add several N_xxx_Body choices to
2167 the termination conditions for completeness.
2168 * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
2169 and the associated comment on usage.
2170 * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
2171 Establish_Transient_Scope.
2172 (Add_Write_After): Update the call to Establish_Transient_Scope.
2173 * sem_res.adb (Check_Initialization_Call): Removed.
2174 (Resolve_Actuals): Account for additional cases where finalization
2175 actions are required by utilizing predicate Needs_Finalization rather
2177 (Resolve_Call): Type initialization procedures can now utilize
2178 transient scopes to manage the secondary stack, thus preventing leaks
2179 during initialization. Remove the previous kludgy algorithm which
2180 attempts to manage the secondary stack at the object creation site.
2182 2018-01-11 Jerome Lambourg <lambourg@adacore.com>
2184 * libgnat/g-soliop__qnx.ads: New.
2185 * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
2188 2018-01-11 Bob Duff <duff@adacore.com>
2190 * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
2191 a null procedure occurs in a protected definition.
2193 2018-01-11 Bob Duff <duff@adacore.com>
2195 * binderr.ads, namet.ads: Minor reformatting.
2197 2018-01-11 Bob Duff <duff@adacore.com>
2199 * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
2202 2018-01-11 Bob Duff <duff@adacore.com>
2204 * binde.adb (Force_Elab_Order): Give an error if there are duplicate
2207 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2209 * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
2210 controlling argument of a dispatching call. freeze the corresponding
2213 2018-01-11 Ben Brosgol <brosgol@adacore.com>
2215 * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
2217 2018-01-11 Ben Brosgol <brosgol@adacore.com>
2219 * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
2221 * gnat_rm.texi: Regenerate.
2223 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2225 * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
2226 formsl type corresponding to the actual fixed point type is private,
2227 because in this case there can be no suspicious arithmetic operations
2228 in the generic unless they reference a formal subprogram. Clarify
2231 2018-01-11 Javier Miranda <miranda@adacore.com>
2233 * exp_util.adb (Remove_Side_Effects): No action done for functions
2234 returning class-wide types since it requires generating code using
2235 'reference and the CCG target has no secondary stack.
2236 * gnat1drv.adb: Disable building static dispatch tables when generating
2239 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
2241 * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
2242 libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
2243 (File_Type): Add Default_Initial_Condition aspect.
2245 2018-01-11 Pascal Obry <obry@adacore.com>
2247 * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
2249 2018-01-11 Bob Duff <duff@adacore.com>
2251 * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
2252 to match what the Libadalang-based version does.
2253 * doc/gnat_ugn/about_this_guide.rst: Update reference.
2255 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2257 * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
2258 if it contains at least one component declaration employing a function
2259 call returning on the secondary stack.
2261 2018-01-11 Yannick Moy <moy@adacore.com>
2263 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
2264 Update description of restriction SPARK_05 with SPARK 2014.
2265 * gnat_rm.texi: Regenerate.
2267 2018-01-11 Vasiliy Fofanov <fofanov@adacore.com>
2269 * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
2271 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2273 * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
2274 sem_res.adb, sem_util.adb: Minor reformatting.
2276 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2278 * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
2279 has a delayed aspect which must be processed at the point the type is
2280 frozen. This mimics what is done when the predicate is provided by a
2283 2018-01-11 Doug Rupp <rupp@adacore.com>
2285 * init.c (vxworks): Add macro checks for __aarch64__.
2287 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2289 * exp_util.adb (Add_Failure_Expression): New routine.
2290 (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
2291 * sem_util.adb (Is_Current_Instance): Code cleanup.
2293 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
2295 * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
2296 Default_Sec_Stack_Size.
2297 * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
2298 limit check so that the integer index does not overflow. Check the
2299 dynamic stack allocation does not cause the secondary stack pointer to
2301 (SS_Info): Align colons.
2302 (SS_Init): Cover the case when bootstraping with an old compiler that
2303 does not set Default_SS_Size.
2305 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2307 * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
2308 legality of an inherited operation that may require overriding, ignore
2309 primitive_wrappers that correspond to explicit operations that override
2310 an interface primitive.
2311 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
2312 operation to which the class-wide expression applies is a protected op.
2313 with a primitive_wrapper, verify that the updated inherited expression
2314 does not contain an internal call to a protected function. This
2315 completes the implementation of AI12-0166.
2317 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2319 * ali.adb: Document the remaining letters available for ALI lines.
2320 (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
2321 * ali.ads: Update type With_Record. Field
2322 Implicit_With_From_Instantiation is no longer in use. Add field
2324 * csinfo.adb (CSinfo): Remove the setup for attribute
2325 Implicit_With_From_Instantiation.
2326 * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
2327 either implicitly or explicitly withed.
2328 (Is_Implicit_With_Clause): New routine.
2329 (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
2330 confusion with the with clause attribute by the same name.
2331 (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
2332 * rtsfind.adb (Maybe_Add_With): Code cleanup.
2333 * sem_ch8.adb (Present_System_Aux): Code cleanup.
2334 * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
2336 (Implicit_With_On_Parent): Mark the with clause as generated for a
2338 * sem_ch12.adb (Inherit_Context): With clauses inherited by an
2339 instantiation are no longer marked as Implicit_With_From_Instantiation
2340 because they are already marked as implicit.
2341 * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
2342 which marks implicit with clauses as related to an instantiation.
2343 * sinfo.adb (Implicit_With_From_Instantiation): Removed.
2344 (Parent_With): New routine.
2345 (Set_Implicit_With_From_Instantiation): Removed.
2346 (Set_Parent_With): New routine.
2347 * sinfo.ads: Update the documentation of attribute Implicit_With.
2348 Remove attribute Implicit_With_From_Instantiation along with
2349 occurrences in nodes. Add attribute Parent_With along with occurrences
2351 (Implicit_With_From_Instantiation): Removed along with pragma Inline.
2352 (Parent_With): New routine along with pragma Inline.
2353 (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
2354 (Set_Parent_With): New routine along with pragma Inline.
2356 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2358 * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
2359 entity when the enclosing construct is a body.
2361 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
2363 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
2364 Secondary_Stack_Size handling as a pragma is now generated for the
2365 corresponding aspect instead of an attribute. Pragma expression is
2366 relocated instead of evaluated. Discriminant of the corresponding
2367 record type is referenced rather than the type discriminant.
2368 (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
2369 Secondary_Stack_Size rep item checks to only look for the pragma rep.
2370 * sem_ch13.adb (Analyze_One_Aspect): Transform
2371 Aspect_Secondary_Stack_Size into a pragma instead of an attribute
2372 because the attribute does not have visibility on a task type's
2373 discriminants when the type's definition is expanded.
2374 (Analyze_Attribute_Definition_Clause): Remove handling of
2375 Attribute_Secondary_Stack_Size.
2376 * snames.adb-tmpl, snames.ads-tmpl: Remove
2377 Attribute_Secondary_Stack_Size, no longer used.
2379 2018-01-11 Justin Squirek <squirek@adacore.com>
2381 * sem_ch8.adb: Minor comment fix.
2383 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2385 * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
2386 individual action because the action may denote a complex expression,
2387 such as a case statement, which in turn may contain additional
2390 2018-01-11 Ed Schonberg <schonberg@adacore.com>
2392 * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
2393 analysis on a copy of the expression with a copy of the index variable,
2394 because full expansion will rewrite construct into a loop with the
2395 original loop variable.
2396 * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
2397 expression is an iterated component association. Full analysis takes
2398 place when construct is rewritten as a loop.
2399 (In_Place_Assign_OK, Safe_Component): An iterated_component_association
2400 is not safe for in-place assignment.
2401 * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
2402 entity with no homonym and no other entity in the scope.
2404 2018-01-11 Justin Squirek <squirek@adacore.com>
2406 * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
2407 message to be printed on the pragma argument identifier.
2409 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
2411 * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
2412 entity of the generated invariant procedure in order to construct a
2413 proper entity chain.
2415 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
2417 * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
2420 2018-01-11 Arnaud Charlet <charlet@adacore.com>
2422 * einfo.ads, einfo.adb (Activation_Record_Component,
2423 Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
2424 Allow E_Discriminant.
2426 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
2428 * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
2429 for atomic access once the component size is taken into account and
2430 also do it if the component type is Atomic or Volatile_Full_Access.
2432 2018-01-04 Eric Botcazou <ebotcazou@adacore.com>
2434 * gnatvsn.ads: Bump copyright year.
2436 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
2437 Alan Hayward <alan.hayward@arm.com>
2438 David Sherwood <david.sherwood@arm.com>
2440 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
2443 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
2444 Alan Hayward <alan.hayward@arm.com>
2445 David Sherwood <david.sherwood@arm.com>
2447 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
2450 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
2451 Alan Hayward <alan.hayward@arm.com>
2452 David Sherwood <david.sherwood@arm.com>
2454 * gcc-interface/utils.c (gnat_types_compatible_p): Handle
2455 polynomial TYPE_VECTOR_SUBPARTS.
2457 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
2458 Alan Hayward <alan.hayward@arm.com>
2459 David Sherwood <david.sherwood@arm.com>
2461 * gcc-interface/misc.c (enumerate_modes): Handle polynomial
2464 2018-01-03 Jakub Jelinek <jakub@redhat.com>
2466 Update copyright years.
2468 * gnat_ugn.texi: Bump @copying's copyright year.
2469 * gnat_rm.texi: Likewise.
2471 Copyright (C) 2018 Free Software Foundation, Inc.
2473 Copying and distribution of this file, with or without modification,
2474 are permitted in any medium without royalty provided the copyright
2475 notice and this notice are preserved.