1 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
3 * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
4 exp_ch3.adb, xoscons.adb: Minor reformatting.
6 2017-09-06 Raphael Amiard <amiard@adacore.com>
8 * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
9 Position parameter. If supplied, use it to provide efficient iteration.
10 * a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
11 a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
14 2017-09-06 Ed Schonberg <schonberg@adacore.com>
16 * exp_util.adb (Build_Allocate_Deallocate_Proc): If the
17 designated type is class-wide and the expression is an unchecked
18 conversion, preserve the conversion when checking the tag of the
19 designated object, to prevent spurious semantic errors when the
20 expression in the conversion has an untagged type (for example
21 an address attribute).
23 2017-09-06 Ed Schonberg <schonberg@adacore.com>
25 * sem_res.adb (Resolve_Entry_Call): Check whether a protected
26 operation is subject to a pragma Eliminate.
28 2017-09-06 Ed Schonberg <schonberg@adacore.com>
30 * sem_elim.ads, exp_ch4.adb: Minor reformatting.
32 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
34 * fe.h (Eliminate_Error_Msg): Remove.
37 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
39 * gcc-interface/utils.c (make_packable_type): Update call to
42 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
44 * gcc-interface/utils2.c (build_load_modify_store):
45 Use int_mode_for_size.
47 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
50 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
51 for Itypes that are E_Record_Subtype with a cloned subtype.
52 <E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
54 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
56 * gcc-interface/trans.c (convert_with_check): Use a custom base type
57 if the base type of the expression has a different machine mode.
58 Rename a couple of parameters and local variable.
60 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
62 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Address>: Do not strip
63 conversions around prefixes that are not references.
65 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
67 * gcc-interface/utils.c (unchecked_convert): When the result type is a
68 non-biased integral type with size 0, set the result to 0 directly.
70 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
72 * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to
73 (renaming_from_instantiation_p): ...this.
74 * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate
75 instead of explicit tests on kind of entities. Adjust for renaming.
76 (gnat_to_gnu_profile_type): Likewise.
77 (gnat_to_gnu_subprog_type): Likewise.
78 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
79 (Case_Statement_to_gnu): Likewise.
80 (gnat_to_gnu): Likewise.
81 (process_freeze_entity): Likewise.
82 (process_type): Likewise.
83 (add_stmt_with_node): Adjust for renaming.
84 * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming.
85 (renaming_from_generic_instantiation_p): Rename to...
86 (renaming_from_instantiation_p): ...this. Use inline predicate.
87 (pad_type_hasher::keep_cache_entry): Fold.
89 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
91 * gcc-interface/trans.c (adjust_for_implicit_deref): New function.
92 (gnat_to_gnu) <N_Explicit_Dereference>: Translate result type first.
93 (N_Indexed_Component): Invoke adjust_for_implicit_deref on the prefix.
95 (N_Selected_Component): Likewise. Do not try again to translate it.
96 (N_Free_Statement): Invoke adjust_for_implicit_deref on the expression.
98 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
100 * repinfo.ads: Document new treatment of dynamic values.
101 (TCode): Bump upper bound to 29.
102 (Dynamic_Val): New constant set to 29.
103 * repinfo.adb (Print_Expr) <Dynamic_Val>: New case.
104 (Rep_Value) <Dynamic_Val>: Likewise.
105 * repinfo.h (Dynamic_Val): New macro.
106 * gcc-interface/decl.c (annotate_value): Tidy up and cache result for
108 <INTEGER_CST>: Set TCODE instead of recursing.
109 <COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
110 <VAR_DECL>: New case.
111 <MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
112 <BIT_AND_EXPR>: Adjust.
113 <CALL_EXPR>: Do not fall through.
115 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
117 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
118 there is no target, do not create a temporary for the return value for
121 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
123 * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
124 unconstrained array type.
126 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
127 Alan Hayward <alan.hayward@arm.com>
128 David Sherwood <david.sherwood@arm.com>
130 * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
131 instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
133 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
134 Alan Hayward <alan.hayward@arm.com>
135 David Sherwood <david.sherwood@arm.com>
137 * gcc-interface/decl.c (check_ok_for_atomic_type): Use
138 is_a <scalar_int_mode>.
139 * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
140 * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
142 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
143 Alan Hayward <alan.hayward@arm.com>
144 David Sherwood <david.sherwood@arm.com>
146 * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
147 instead of mode_for_size.
148 (gnat_to_gnu_subprog_type): Likewise.
149 * gcc-interface/utils.c (make_type_from_size): Likewise.
151 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
152 Alan Hayward <alan.hayward@arm.com>
153 David Sherwood <david.sherwood@arm.com>
155 * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
156 (fp_size_to_prec): Likewise.
158 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
159 Alan Hayward <alan.hayward@arm.com>
160 David Sherwood <david.sherwood@arm.com>
162 * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
163 <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
165 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
166 Alan Hayward <alan.hayward@arm.com>
167 David Sherwood <david.sherwood@arm.com>
169 * gcc-interface/decl.c (validate_size): Update use of
170 GET_MODE_WIDER_MODE, forcing a wider mode to exist.
172 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
173 Alan Hayward <alan.hayward@arm.com>
174 David Sherwood <david.sherwood@arm.com>
176 * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
177 (fp_size_to_prec): Likewise.
179 2017-08-29 Martin Liska <mliska@suse.cz>
182 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
184 2017-08-08 Martin Liska <mliska@suse.cz>
186 * gcc-interface/trans.c: Include header files.
188 2017-07-29 Jakub Jelinek <jakub@redhat.com>
190 * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
191 as new argument to the imported_module_or_decl debug hook.
193 2017-07-25 Javier Miranda <miranda@adacore.com>
195 * checks.adb (Apply_Divide_Checks): Ensure that operands are not
198 2017-07-19 Jakub Jelinek <jakub@redhat.com>
200 * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
201 TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
202 (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
204 2017-07-18 Mike Frysinger <vapier@chromium.org>
206 * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
207 (../../gnatlink$(exeext)): Likewise.
209 2017-07-15 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
212 * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
213 (Backend_Overflow_Checks): Set to True.
215 2017-06-23 Jakub Jelinek <jakub@redhat.com>
217 * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
219 2017-06-21 Pierre-Marie de Rodat <derodat@adacore.com>
221 * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
223 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
225 (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
227 * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
228 imported subprograms for the current compilation unit as
229 definitions. Disable debug info for references to variables.
230 * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
231 * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
232 not built-in functions to their binding scope.
233 (create_subprog_decl): Add a DEFINITION parameter. If it is true, tag
234 the function as a definition. Update all callers.
235 (gnat_write_global_declarations): Emit debug info for imported
236 functions. Filter out external variables for which debug info
239 2017-06-15 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
242 * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
243 (i[3456]86-pc-gnu): Likewise.
244 (x86_64 kfreebsd): Likewise.
246 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
249 * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
251 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
254 * s-interr-hwint.adb: Reinstate.
255 * gcc-interface/Makefile.in (RTEMS): Use it again.
257 2017-06-08 Olivier Hainque <hainque@adacore.com>
259 * vx_crtbegin_auto.c: Update year in copyright notice.
260 * vx_crtbegin.c: Likewise.
261 * vx_crtbegin.inc: Likewise.
262 * vx_crtend.c: Likewise.
264 2017-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
266 * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
267 * s-tpopsp-rtems.adb: Delete.
269 2017-06-02 Olivier Hainque <hainque@adacore.com>
271 * vx_crtbegin_auto.c: New file.
272 * vx_crtbegin.c: New file.
273 * vx_crtbegin.inc: New file.
274 * vx_crtend.c: New file.
276 2017-05-25 Jonathan Wakely <jwakely@redhat.com>
278 * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
279 const qualifiers that cause -Wignored-qualifiers warnings.
281 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
283 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
284 for Itypes that are E_Access_Subtype.
285 <E_Access_Subtype>: Use the DECL of the base type directly.
287 2017-05-22 Ed Schonberg <schonberg@adacore.com>
288 Eric Botcazou <ebotcazou@adacore.com>
290 * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
291 limited view may appear in the profile of a function, and a call to
292 that function in another unit in which the full view is available must
293 use this full view to spurious type errors at the point of call.
294 * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
295 of parent body with a with clause for the main unit.
296 * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
297 (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
298 types declared in external units like types from limited with clauses.
299 Adjust final processing of defer_limited_with_list accordingly.
300 * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
301 again to translate the prefix after the field if it is incomplete.
303 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
305 * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
306 alignment for simple volatile fields and remove associated errors.
308 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
310 * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
311 * gcc-interface/trans.c (get_elaboration_procedure): Make static.
313 2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
315 * gcc-interface/utils.c (can_materialize_object_renaming_p):
316 Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
317 process Original_Node instead of expanded names.
319 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
321 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
322 addressability check in the constrained case.
324 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
326 * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
327 types not coming from a limited context.
329 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
331 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
332 the inlined list that are not public.
333 * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
334 there is a pragma Inline_Always on the subprogram.
336 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
338 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
339 <N_Allocator>: Use properly typed constants.
340 (extract_values): Move around.
341 (pos_to_constructor): Minor tweaks.
342 (Sloc_to_locus): Fix formatting.
343 * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
344 * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
345 (Gigi_Equivalent_Type): Adjust head comment.
346 * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
348 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
350 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
351 is a representation clause on an extension, propagate the alignment of
352 the parent type only if the platform requires strict alignment.
354 2017-05-12 Eric Botcazou <ebotcazou@adacore.com>
356 * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
357 instead of Word_Size.
360 2017-03-28 Andreas Schwab <schwab@suse.de>
363 * system-linux-aarch64-ilp32.ads: New file.
364 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
365 from LIBGNAT_TARGET_PAIRS.
366 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
367 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
368 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
369 or -mabi=ilp32, resp.
371 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
374 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
375 instead of Word_Size.
377 2017-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
379 * raise-gcc.c (exception_class_eq): Make ec parameter const.
381 2017-05-02 Richard Biener <rguenther@suse.de>
383 * gcc-interface/misc.c (gnat_post_options): Do not set
386 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
388 * gcc-interface/trans.c (assoc_to_constructor): Make sure
389 Corresponding_Discriminant is only called on discriminants.
390 Skip the saving of the result only for them.
391 (gnat_to_gnu) <N_Selected_Component>: Likewise.
392 <N_Unchecked_Type_Conversion>: Translate the result type first.
393 (gigi): Set TREE_NOTHROW on Begin_Handler.
394 (stmt_list_cannot_raise_p): New predicate.
395 (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
396 a cleanup if the statements of the handler cannot raise.
397 (process_freeze_entity): Use Is_Record_Type.
398 (process_type): Likewise.
400 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
402 * einfo.ads (Corresponding_Record_Component): New alias
403 for Node21 used for E_Component and E_Discriminant.
404 * einfo.adb (Corresponding_Record_Component): New function.
405 (Set_Corresponding_Record_Component): New procedure.
406 (Write_Field21_Name): Handle Corresponding_Record_Component.
407 * sem_ch3.adb (Inherit_Component): Set
408 Corresponding_Record_Component for every component in
409 the untagged case. Clear it afterwards for non-girder
411 * gcc-interface/decl.c (gnat_to_gnu_entity)
412 <E_Record_Type>: For a derived untagged type with discriminants
413 and constraints, apply the constraints to the layout of the
414 parent type to deduce the layout.
415 (field_is_aliased): Delete.
416 (components_to_record): Test DECL_ALIASED_P directly.
417 (annotate_rep): Check that fields are present except for
419 (create_field_decl_from): Add DEBUG_INFO_P
420 parameter and pass it in recursive and other calls. Add guard
421 for the manual CSE on the size.
422 (is_stored_discriminant): New predicate.
423 (copy_and_substitute_in_layout): Consider only
424 stored discriminants and check that original fields are present
425 in the old type. Deal with derived types. Adjust call to
426 create_variant_part_from.
428 2017-05-02 Ed Schonberg <schonberg@adacore.com>
430 * exp_ch6.adb (Expand_Call_Helper): When locating the
431 accessibility entity created for an access parameter, handle
432 properly a reference to a formal of an enclosing subprogram. if
433 the reference appears in an inherited class-wide condition, it
434 is the rewriting of the reference in the ancestor expression,
435 but the accessibility entity must be that of the current formal.
437 2017-05-02 Javier Miranda <miranda@adacore.com>
439 * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
440 (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
441 Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
442 Call Expand_Non_Binary_Modular_Op.
444 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
446 * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
447 has discriminants, do not override the Stored_Constraint list of
448 the full view of the derived type with that of the derived type.
450 2017-05-02 Bob Duff <duff@adacore.com>
452 * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
454 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
456 * s-os_lib.ads: Minor typo fix.
458 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
460 * gnatls.adb: Merge and refactor code from Prj.Env and remove
461 this deprecated dependency.
463 2017-05-02 Ed Schonberg <schonberg@adacore.com>
465 * exp_util.ads: minor comment addition.
467 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
469 * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
470 pastos in part #3 of the head comment.
472 2017-05-02 Ed Schonberg <schonberg@adacore.com>
474 * exp_ch3.adb (Freeze_Type): Do not generate an invariant
475 procedure body for a local (sub)type declaration within a
476 predicate function. Invariant checks do not apply to these, and
477 the expansion of the procedure will happen in the wrong scope,
478 leading to misplaced freeze nodes.
480 2017-05-02 Ed Schonberg <schonberg@adacore.com>
482 * exp_util.adb (Insert_Library_Level_Action): Use proper scope
483 to analyze generated actions. If the main unit is a body,
484 the required scope is that of the corresponding unit declaration.
486 2017-05-02 Arnaud Charlet <charlet@adacore.com>
488 * einfo.adb (Declaration_Node): flip branches of
489 an IF statement to avoid repeated negations in its condition;
490 no change in semantics, only to improve readability.
492 2017-05-02 Arnaud Charlet <charlet@adacore.com>
494 * sem_case.adb: Remove extra spaces in parameter declarations.
496 2017-05-02 Justin Squirek <squirek@adacore.com>
498 * usage.adb: Replace space with hyphen ("run time" -> "run-time")
499 in usage line for new -gnatwE switch.
501 2017-05-02 Claire Dross <dross@adacore.com>
503 * a-cofuve.ads (Remove): Remove unnecessary
504 conditions in precondition.
506 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
508 * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
509 sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
511 2017-05-02 Justin Squirek <squirek@adacore.com>
513 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
514 alternative expression.
515 * sem_res.adb (Resolve_Case_Expression): Ditto.
517 2017-05-02 Ed Schonberg <schonberg@adacore.com>
519 * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
520 Refine predicate for the case where the primitive operation
521 is a renaming of equality. An overriding operation that is
522 a user-defined renaming of predefined equality inherits its
523 slot from the overridden operation. Otherwise it is treated
524 as a predefined op and occupies the same predefined slot as
525 equality. A call to it is transformed into a call to its alias,
526 which is the predefined equality. A dispatching call thus uses
527 the proper slot if operation is further inherited and called
528 with class-wide arguments.
530 2017-05-02 Justin Squirek <squirek@adacore.com>
532 * errout.adb (Set_Msg_Text): Add a case to switch the message
533 type when the character '[' is detected signifying a warning
534 about a run-time exception.
535 * opt.ads Add a new Warning_Mode value for new switch
536 * switch-b.adb (Scan_Binder_Switches): Add case for the binder
537 to handle new warning mode
538 * usage.adb (Usage): Add usage entry for -gnatwE
539 * warnsw.adb (Set_Warning_Switch): Add case for the new switch
541 2017-05-02 Ed Schonberg <schonberg@adacore.com>
543 * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
544 declaration that operates on some fixed point type.
546 2017-05-02 Justin Squirek <squirek@adacore.com>
548 * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
550 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
552 * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
554 2017-05-02 Justin Squirek <squirek@adacore.com>
556 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
557 expression (Analyze_If_Expression): Add check for valid condition
558 * sem_eval.adb (Eval_Case_Expression): Add check for error posted
560 * sem_res.adb (Resolve_If_Expression): Add check for valid
561 condition and then-expression.
563 2017-05-02 Ed Schonberg <schonberg@adacore.com>
565 * exp_ch3.adb (Build_Initialization_Call): Generate a null
566 statement if the initialization call is a null procedure, as
567 can happen with a controlled type with no explicit Initialize
568 procedure, or an array of such.
569 * exp_ch7.adb (Process_Object_Declaration): For a type with
570 controlled components that has a trivial Initialize procedure,
571 insert declaration for finalization counter after object
573 (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
574 finalization block and attendant declarations if component has
575 a trivial Initialize procedure.
576 (Make_Init_Call): Do not generate a call if controlled type has
577 a trivial Initialize procedure.
579 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
581 * g-forstr.ads (Data): Move Format component last.
582 * g-forstr.adb ("+"): Adjust for above change.
583 * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
584 * g-sechas.ads (Context): Move Key last.
585 * g-socket.ads (Service_Entry_Type): Move Aliases last.
586 * s-fileio.adb (Temp_File_Record): Move Name last.
587 * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
588 * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
590 2017-05-02 Jerome Lambourg <lambourg@adacore.com>
592 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
593 switch introduced recently. finally not needed.
595 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
597 * sem_ch6.adb (Analyze_Null_Procedure): Set the
598 Corresponding_Body link for a null procedure declaration.
600 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
602 * atree.h (Flag290): Add missing terminating parenthesis.
603 * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
604 (Set_Is_Class_Wide_Clone): Likewise.
605 * einfo.ads (Is_Class_Wide_Clone): Likewise.
607 2017-05-02 Gary Dismukes <dismukes@adacore.com>
609 * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
610 parameter Array_Comp to indicate the case of an array object
611 with null-excluding components.
612 * checks.adb (Null_Exclusion_Static_Checks):
613 Call Compile_Time_Constraint_Error instead of
614 Apply_Compile_Time_Constraint_Error in the component case. Also
615 call that when Array_Comp is True, with an appropriate warning for
616 the array component case. Only create an explicit initialization
617 by null in the case of an object of a null-excluding access type
618 (and no longer do that in the component case).
619 * sem_ch3.adb (Check_Component): Add a Boolean parameter
620 Array_Comp defaulted to False. Pass Empty for the Comp
621 actual when calling Null_Exclusion_Static_Checks in the case
622 where Comp_Decl matches Object_Decl, because we don't have a
623 component in that case. In the case of an object or component
624 of an array type, pass True for Array_Comp on the recursive call
627 2017-05-02 Bob Duff <duff@adacore.com>
629 * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
630 compute the linux priority from the Ada priority. Call this everywhere
631 required. In particular, the previous version was not doing this
632 computation when setting the ceiling priority in various places. It
633 was just converting to C.int, which results in a ceiling that is off
636 2017-05-02 Ed Schonberg <schonberg@adacore.com>
638 * sem_ch3.adb: Comment predicate inheritance.
640 2017-05-02 Tristan Gingold <gingold@adacore.com>
642 * s-trasym.ads: Add comment.
644 2017-05-02 Bob Duff <duff@adacore.com>
646 * sem_elab.adb, sem_elab.ads: Minor comment fixes.
647 * sem_ch4.adb: Minor reformatting.
648 * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
649 * s-taspri-posix-noaltstack.ads: Minor refactoring.
650 * sinput.ads: Minor typo fix.
652 2017-05-02 Ed Schonberg <schonberg@adacore.com>
654 * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
655 * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
656 here from exp_ch9, to recognize objects whose creation requires
657 dynamic allocation, so that the proper warning can be emitted
658 when restriction No_Implicit_Heap_Allocation is in effect.
659 * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
660 to emit proper warning when an object that requires dynamic
661 allocation is declared.
663 2017-05-02 Tristan Gingold <gingold@adacore.com>
665 * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
667 2017-05-02 Ed Schonberg <schonberg@adacore.com>
669 * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
670 visibility rules for equality operators that apply within an
671 instantiation apply within an inlined body.
672 * sem_type.adb (Add_One_Interp): ditto.
674 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
676 * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
679 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
682 (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
683 Name_No_Tagged_Streams): Move to regular pragmas. Add
684 placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
685 and Secondary_Stack_Size.
686 (Pragma_Id): Move Pragma_Assume,
687 Pragma_Attribute_Definition, Pragma_Loop_Optimize and
688 Pragma_No_Tagged_Streams to second part.
690 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
692 * exp_attr.adb: Minor reformatting.
694 2017-05-02 Ed Schonberg <schonberg@adacore.com>
696 * sem_ch4.adb (Analyze_Selected_Component): Improve error
697 detection for illegal references to private components or
698 operations of a protected type in the body of the type.
700 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
702 * opt.ads: Add missing GNAT markers in comments.
703 * opt.adb (Set_Opt_Config_Switches): Do not override earlier
704 settings of Optimize_Alignment at the end.
706 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
708 * checks.adb (Apply_Constraint_Check): Do not apply
709 a discriminant check when the associated type is a constrained
710 subtype created for an unconstrained nominal type.
711 * exp_attr.adb: Minor reformatting.
713 2017-05-02 Bob Duff <duff@adacore.com>
715 * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
716 the N_Raise_Expression case.
717 * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
720 2017-05-02 Yannick Moy <moy@adacore.com>
722 * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
723 optimize length comparison in GNATprove mode.
724 * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
725 operator /= into negation of operator = when needed.
726 (Expand_SPARK): Call new
727 function to expand operator /=.
729 2017-05-02 Ed Schonberg <schonberg@adacore.com>
731 * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
732 Simplify the expression for a fixed-fixed division to remove
733 divisions by constants whenever possible, as an optimization
734 for restricted targets.
736 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
738 * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
740 2017-05-02 Bob Duff <duff@adacore.com>
742 * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
743 to find primitive ops, instead of using an Identifier that will
744 later be looked up. This is necessary because these ops are not
745 necessarily visible at all places where we need to call them.
746 * exp_util.ads: Minor comment fix.
748 2017-05-02 Ed Schonberg <schonberg@adacore.com>
750 * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
751 references are fully conformant if they are both expansions
752 of the discriminant of a protected type, within one of the
753 protected operations. One occurrence may be expanded into a
754 constant declaration while the other is an input parameter to
755 the corresponding generated subprogram.
757 2017-05-02 Justin Squirek <squirek@adacore.com>
759 * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
760 recursivly searching composite-types for null-excluding access
761 types and verifying them.
762 (Analyze_Object_Declaration): Add a
763 call to Check_Null_Excluding_Components for static verification
764 of non-initialized objects.
765 * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
766 a parameter for a composite-type's component and an extra case
767 for printing component information.
769 2017-05-02 Yannick Moy <moy@adacore.com>
771 * sem_ch10.adb (Analyze_Subunit): Take
772 configuration pragma into account when restoring appropriate
773 pragma for analysis of subunit.
775 2017-05-02 Justin Squirek <squirek@adacore.com>
777 * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
778 s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
779 g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
780 clauses from the runtime.
782 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
784 * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
785 array components specially.
787 2017-05-02 Ed Schonberg <schonberg@adacore.com>
789 * sem_ch8.adb (Premature_Usage): If the premature usage of
790 an entity is as the expression in its own object decaration,
791 rewrite the reference as Any_Id to prevent cascaded errors or
792 compiler loops when such an entity is used in an address clause.
794 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
796 * gcc-interface/decl.c (components_to_record): Add missing guard.
798 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
800 * gcc-interface/decl.c (components_to_record): Add more comments.
801 Put back pending fields onto the regular list if the misalignment
802 happens to cancel itself.
804 2017-04-28 Ed Schonberg <schonberg@adacore.com>
806 * sem_ch4.adb (Complete_Object_Operation): When rewriting the
807 controlling actual in a prefixed call, preserve the original node
808 information if the prefix itself has been rewritten, for ASIS use.
810 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
812 * exp_ch6.adb (Insert_Post_Call_Actions):
813 Code clean up. Insert the post-call actions after an enclosing
814 procedure call when N denotes a function call and appears as an
815 actual parameter in the procedure call.
817 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
819 * freeze.adb (Check_Component_Storage_Order): If there is a clause
820 for the component, also reject the attribute if the component
821 doesn't end on a byte boundary and its scalar storage order is
822 different from that of the enclosing record type.
824 2017-04-28 Javier Miranda <miranda@adacore.com>
826 * atree.ads (Info_Messages): Removed.
827 (Warning_Info_Messages): New counter.
828 (Report_Info_Messages): New counter.
829 * err_vars.ads Update documentation.
830 * errout.adb (Delete_Warning_And_Continuations): Update
831 Info_Message occurrences.
832 (Error_Msg_Internal): Update Info_Message occurrences.
833 (Delete_Warning): Update Info_Message occurrences.
834 (Write_Error_Summary): Update Info_Message occurrences.
835 (Output_Messages): Update Info_Message occurrences.
836 (To_Be_Removed): Update Info_Message occurrences.
837 (Reset_Warnings): Update Info_Message occurrences.
838 * errutil.adb (Error_Msg): Update Info_Message occurrences.
839 (Finalize): Update Info_Message occurrences.
840 (Initialize): Update Info_Message occurrences.
841 * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
842 (Compilation_Errors): Update Info_Message_Occurences.
844 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
846 * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
847 * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
848 * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
849 * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
850 * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
851 * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
853 * sem_eval.adb (Why_Not_Static): Initialize Typ.
854 * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
856 2017-04-28 Bob Duff <duff@adacore.com>
858 * sem_util.ads, sem_util.adb (Might_Raise): New function
859 that replaces Is_Exception_Safe, but has the opposite
860 sense. Is_Exception_Safe was missing various cases -- calls inside
861 a pragma Debug, calls inside an 'if' or assignment statement,
862 etc. Might_Raise now walks the entire subtree looking for things
864 * exp_ch9.adb (Is_Exception_Safe): Remove.
865 (Build_Protected_Subprogram_Body): Replace call to
866 Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
867 constants where possible).
868 * exp_ch7.adb: Rename Is_Protected_Body -->
869 Is_Protected_Subp_Body. A protected_body is something different
872 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
874 * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
875 * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
876 (P_Discrete_Choice_List): Initialize Expr_Node variable.
877 * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
878 (P_Protected): Likewise.
879 * sem_case.adb (Check_Duplicates):
880 Add pragma Warnings on variable.
881 * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
882 * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable.
883 * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
884 (Analyze_Exit_Statement): Initialize Scope_Id variable.
885 (Analyze_Iterator_Specification): Initialize Bas variable.
886 * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
887 Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
888 (Analyze_Accept_Statement): Initialize Task_Nam.
890 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
892 * checks.adb (Install_Primitive_Elaboration_Check):
893 Do not generate an elaboration check if all checks have been
896 2017-04-28 Ed Schonberg <schonberg@adacore.com>
898 * sem_ch13.adb (Analyze_Aspect_Specifications, case
899 Interrupt_Handler and Attach_Handler): Generate reference
900 to protected operation to prevent spurious warnings about
901 unreferenced entities. Previous scheme failed with style checks
904 2017-04-28 Ed Schonberg <schonberg@adacore.com>
906 * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
907 that follows an expression function must not be relocated to
908 the generated body, because it applies to the code that follows.
910 2017-04-28 Gary Dismukes <dismukes@adacore.com>
912 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
913 Relaxed_RM_Semantics to avoid having CodePeer issue errors on
914 code that might violate the more stringent checking for 'Access
915 introduced in Ada 2005.
917 2017-04-28 Arnaud Charlet <charlet@adacore.com>
919 * a-cforse.adb: minor style fix in comment.
921 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
923 * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
924 initialize Block_Decls variable.
925 (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
926 (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
927 * exp_disp.adb (Expand_Interface_Actuals): Initialize
928 Formal_DDT and Actual_DDT variables.
929 (Expand_Interface_Thunk): Initialize Iface_Formal.
930 (Make_DT): Initialize Size_Comp.
931 (Make_Select_Specific_Data_Table): Initialize Decls.
932 * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
933 Also initialize more RPC_Receiver_* variables.
934 (Build_To_Any_Function): Initialize Cstr_Formal.
935 * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
937 2017-04-28 Ed Schonberg <schonberg@adacore.com>
939 * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
940 node between access types, freeze the designated type as well,
941 so that dispatch table pointers are created in the proper scope,
942 and not in the constructed body of the expression function.
944 2017-04-28 Bob Duff <duff@adacore.com>
946 * alloc.ads (Nodes_Initial): Go back to previous value. The large
947 value makes large compilations faster, but small compilations slower.
949 2017-04-28 Arnaud Charlet <charlet@adacore.com>
951 * sem_util.adb: minor typos in Is_Child_Or_Sibling.
953 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
955 * erroutc.adb (Compilation_Errors): Do not consider info messages
956 as suitable warnings when warnings must be treated as errors.
957 * sem_ch7.adb (Analyze_Package_Specification): Do not consider
958 internally-generated packages when outputting completion
960 * errout.adb (Output_Messages): Do not consider info messages as
961 suitable warnings when warnings must be treated as errors.
962 * errutil.adb (Finalize): Do not consider info messages as
963 suitable warnings when warnings must be treated as errors.
965 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
967 * warnsw.ads: Minor fix for incorrect wording in comment.
969 2017-04-28 Ed Schonberg <schonberg@adacore.com>
971 * sem_res.adb (In_Instance_Code): New predicate in
972 Valid_Conversion, to determine whether a type conversion appears
973 as (or within) an actual for a formal object. Type conversions
974 in instances are not rechecked in Valid_Conversion because
975 visibility changes between generic location andi instance may
976 lead to spurious errors, but conversions within an actual must be
977 fully checked, and they are not fully resolved when pre-analyzing
980 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
982 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
983 New_Copy_Tree instead of Relocate_Node as any subsequent copies
984 of the relocated node will have mangled Parent pointers.
985 * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
986 tables used in conjunction with entity and itype replication.
987 (Visit_Entity): Rewrite the restriction on which entities
988 require duplication. The restriction now includes all types.
990 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
992 * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
993 a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
994 a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
997 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
999 * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
1000 gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
1002 2017-04-28 Gary Dismukes <dismukes@adacore.com>
1004 * exp_util.adb: Minor reformatting.
1006 2017-04-28 Ed Schonberg <schonberg@adacore.com>
1008 * sem_ch4.adb: Fix copy/pasto.
1010 2017-04-27 Tristan Gingold <gingold@adacore.com>
1012 * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
1013 raise-gcc.c. Fix include search path for raise-gcc.c
1015 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1017 * fe.h (Warn_On_Questionable_Layout): Declare.
1018 * warnsw.ads (Warn_On_Record_Holes): Move down.
1019 (Warn_On_Questionable_Layout): New boolean variable.
1020 (Warning_Record): Add Warn_On_Questionable_Layout field.
1021 * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
1022 (Restore_Warnings): Likewise.
1023 (Save_Warnings): Likewise.
1024 (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
1025 * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
1026 components_to_record.
1027 (gnu_field_to_gnat): New function.
1028 (warn_on_field_placement): Likewise.
1029 (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
1030 parameters. Rename local variables and adjust recursive call.
1031 Rework final scan of the field list and implement warnings on the
1032 problematic placement of specific sorts of fields.
1034 2017-04-27 Bob Duff <duff@adacore.com>
1036 * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
1037 * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
1038 * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
1039 * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
1040 * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
1041 * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
1042 For efficiency, cache results of Is_Internal_File_Name and
1043 Is_Predefined_File_Name in the Units table. This avoids a lot
1044 of repeated text processing.
1046 2017-04-27 Emmanuel Briot <briot@adacore.com>
1048 * g-comlin.adb (Sort_Sections): remove useless test.
1050 2017-04-27 Claire Dross <dross@adacore.com>
1052 * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
1053 allow the use of regular equality over elements in contracts.
1054 (Formal_Model): Ghost package containing model functions that are
1055 used in subprogram contracts.
1056 (Current_To_Last): Removed, model functions should be used instead.
1057 (First_To_Previous): Removed, model functions should be used instead.
1058 (Strict_Equal): Removed, model functions should be used instead.
1059 (No_Overlap): Removed, model functions should be used instead.
1060 (Equivalent_Keys): Functions over cursors are removed. They were
1061 awkward with explicit container parameters.
1062 * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
1063 allow the use of regular equality over elements in contracts.
1064 (Formal_Model): Ghost package containing model functions that
1065 are used in subprogram contracts.
1066 (Current_To_Last): Removed, model functions should be used instead.
1067 (First_To_Previous): Removed, model functions should be used instead.
1068 (Strict_Equal): Removed, model functions should be used instead.
1069 (No_Overlap): Removed, model functions should be used instead.
1071 2017-04-27 Yannick Moy <moy@adacore.com>
1073 * gnat1drv.adb: Code cleanup.
1075 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1077 * exp_util.adb (Replace_Entity): The prefix of a 'Result
1078 attribute reference in a post- condition is the subprogram to
1079 which the condition applies. If the condition is inherited
1080 by a type extension, the prefix becomes a reference to the
1081 inherited operation, but there is no need to create a wrapper
1082 for this operation, because 'Result is expanded independently
1083 when elaborating the postconditions.
1085 2017-04-27 Bob Duff <duff@adacore.com>
1087 * sinput.adb: Minor code cleanup.
1088 * namet.adb (Append): Create faster versions of
1089 Append(String) and Append(Name_Id) by using slice assignment
1091 * sem_util.adb (In_Instance): Speed this up by removing
1092 unnecessary tests; Is_Generic_Instance is defined for all
1094 * sem_util.ads, sem_util.adb (In_Parameter_Specification):
1095 Remove unused function.
1096 * alloc.ads (Nodes_Initial): Use a much larger value, because
1097 the compiler was spending a lot of time copying the nodes table
1098 when it grows. This number was chosen in 1996, so is rather out
1099 of date with current memory sizes. Anyway, it's virtual memory.
1100 Get rid of Orig_Nodes_...; use Node_... instead.
1101 * atree.adb (Lock): Do not release the Nodes tables; it's a
1103 Orig_Nodes_ ==> Nodes_
1104 * nlists.adb: Orig_Nodes_ ==> Nodes_
1105 * g-table.adb: Remove unused "with" clause.
1106 * g-table.ads, table.ads: Remove Big_Table_Type, which should
1107 not be used by clients.
1108 * g-dyntab.adb (Last_Allocated): New function
1109 to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
1111 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1113 * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
1115 (Subtypes_Statically_Match): Remove duplicate check.
1116 * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
1118 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1120 * exp_aggr.adb (Replace_Type): Remove the special processing
1121 for selected components.
1122 * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
1123 processing for attributes Fixed_Value and Integer_Value.
1124 * exp_util.adb (Side_Effect_Free): Merge the processing for
1125 qualified expressions, type conversions, and unchecked type
1127 * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
1129 * par-ch3.adb (P_Declarative_Items): Merge the processing for
1130 tokens function, not, overriding, and procedure.
1131 * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
1132 for qualified expressions, type conversions, and unchecked
1134 * sem_util.adb (Compile_Time_Constraint_Error): Merge the
1135 processing for Ada 83 and instances.
1136 (Object_Access_Level): Merge the processing for indexed components
1137 and selected components.
1138 * uname.adb (Add_Node_Name): Merge the processing for stubs.
1140 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1142 * checks.adb (Install_Primitive_Elaboration_Check):
1143 Do not generate the check when restriction No_Elaboration_Code
1146 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1148 * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
1149 of Expand_Dispatching_Call. If the denoted subprogram has a
1150 class-wide precondition, this is the only precondition that
1151 applies to the call, rather that the class-wide preconditions
1152 that may apply to the body that is executed. (This is specified
1155 2017-04-27 Yannick Moy <moy@adacore.com>
1157 * gnat1drv.adb (Adjust_Global_Switches): Issue
1158 a warning in GNATprove mode if the runtime library does not
1159 support IEEE-754 floats.
1161 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1163 * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
1164 is itself inherited it does not carry any contract information,
1165 so examine its parent operation which is its Alias.
1167 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1169 * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
1170 prefix can be an object reference in which case Obj'Image (X)
1171 can only be interpreted as an indexing of the parameterless
1172 version of the attribute.
1173 * par-ch4.adb (P_Name): An attribute reference can be the prefix of
1174 an indexing or a slice operation if the attribute does not require
1175 parameters. In Ada2012 'Image also belongs in this category,
1176 and A'Image (lo .. hi) is legal and must be parsed as a slice.
1178 2017-04-27 Yannick Moy <moy@adacore.com>
1180 * exp_ch4.adb: Minor reformatting.
1181 * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
1182 disable the CodePeer and C generation modes. Similar to the
1183 opposite actions done in CodePeer mode.
1185 2017-04-27 Yannick Moy <moy@adacore.com>
1187 * sem_res.adb: Remove duplicate code.
1188 * sem_attr.adb: Delete duplicate code.
1190 2017-04-27 Bob Duff <duff@adacore.com>
1192 * g-dyntab.adb: Reduce the amount of copying in
1193 Release. No need to copy items past Last.
1195 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1197 * checks.adb Add with and use clauses for Sem_Disp.
1198 (Install_Primitive_Elaboration_Check): New routine.
1199 * checks.ads (Install_Primitive_Elaboration_Check): New routine.
1200 * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
1201 processing of 'Elaborated.
1202 * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
1205 2017-04-27 Bob Duff <duff@adacore.com>
1207 * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
1208 If the table grows and then shrinks back to empty, we won't necessarily
1209 point back to the empty array. Code cleanups.
1210 * sinput.ads: Add 'Base to Size clause to match the declared
1213 2017-04-27 Claire Dross <dross@adacore.com>
1215 * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
1216 allow the use of regular equality over elements in contracts.
1217 (Formal_Model): Ghost package containing model functions that
1218 are used in subprogram contracts.
1219 (Current_To_Last): Removed, model functions should be used instead.
1220 (First_To_Previous): Removed, model functions should be used instead.
1221 (Strict_Equal): Removed, model functions should be used instead.
1222 (No_Overlap): Removed, model functions should be used instead.
1223 * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
1224 Boolean generic parameter to disable contracts for equivalence
1226 (Witness): Create a witness of a key that is used for handling of
1227 equivalence between keys.
1228 (Has_Witness): Check whether a witness is contained in a map.
1229 (W_Get): Get the element associated to a witness.
1230 (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
1232 * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
1233 Boolean generic parameter to disable contracts for equivalence
1235 * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
1236 of equivalence on functional maps.
1237 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
1238 of equivalence on functional maps.
1240 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1242 * exp_ch9.adb (Expand_Entry_Barrier): Code
1243 cleanup. Do not perform the optimization which removes the
1244 declarations of the discriminant and component renamings when
1245 validity checks on operands and attributes are in effect.
1247 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1249 * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
1250 freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
1251 a-cfhama.ads, a-cofove.ads: Minor reformatting.
1253 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1255 * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
1256 pointer dereference.
1257 * g-spipat.adb (Dump): Code clean up. Protect against a possible
1258 null pointer dereference.
1260 2017-04-27 Bob Duff <duff@adacore.com>
1262 * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
1263 Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
1264 Free renames Init, since they do the same thing.
1265 * g-table.ads: Default for Table_Low_Bound.
1266 * table.ads: Default for Table_Low_Bound, Table_Initial, and
1269 2017-04-27 Bob Duff <duff@adacore.com>
1271 * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
1273 * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
1274 * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
1275 Reorder code so that above assertions do not fail.
1276 * table.ads: Remove obsolete comment on Locked.
1278 2017-04-27 Claire Dross <dross@adacore.com>
1280 * a-cfdlli.ads: Code cleanup.
1282 2017-04-27 Yannick Moy <moy@adacore.com>
1284 * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
1285 when needed for proof. (Expand_SPARK): Call the new procedure.
1286 * exp_util.ads Fix typo.
1288 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1290 * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
1293 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1295 * sem_elab.adb Add new type Visited_Element
1296 and update the contents of table Elab_Visited. Various code clean up.
1297 (Check_Elab_Call): Determine whether a prior call to
1298 the same subprogram was already examined within the same context.
1299 (Check_Internal_Call_Continue): Register the subprogram being
1300 called as examined within a particular context. Do not suppress
1301 elaboration warnings.
1303 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1305 * xoscons.adb, osint.ads: Minor reformatting.
1307 2017-04-27 Bob Duff <duff@adacore.com>
1309 * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
1310 Table_Count_Type --> Table_Last_Type, because the name
1311 was confusing (a "count" usually starts at zero). Add
1312 functionality supported or needed by other tables packages
1313 (Move, Release_Threshold).
1314 * g-table.ads, g-table.adb: This is now just a thin wrapper
1315 around g-dyntab.ads/g-dyntab.adb. Add functionality supported
1316 or needed by other tables packages (Save, Restore).
1317 * table.ads, table.adb: This is now just a thin wrapper around
1318 * g-table.ads/g-table.adb.
1319 * namet.h, scos.h, uintp.h: These files are reaching into the
1320 private data of some instances of g-table, whose names changed,
1321 so the above change requires some adjustment here. It now uses
1324 2017-04-27 Bob Duff <duff@adacore.com>
1326 * namet.adb, namet.ads: Minor: remove unused procedures.
1328 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1330 * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
1331 (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
1332 Add pragma Warnings on Rtype variable in nested block. *
1333 * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
1334 * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
1335 (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
1336 * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
1337 (Process_Component_List_For_Finalize): Initialize Counter_Id.
1338 (Build_Finalize_Statements): Initialize Bod_Stmts.
1339 * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
1341 2017-04-27 Claire Dross <dross@adacore.com>
1343 * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
1344 allow the use of regular equality over elements in contracts.
1345 (Formal_Model): Ghost package containing model functions that are
1346 used in subprogram contracts.
1347 (Current_To_Last): Removed, model
1348 functions should be used instead.
1349 (First_To_Previous): Removed, model functions should be used instead.
1350 (Strict_Equal): Removed, model functions should be used instead.
1351 (No_Overlap): Removed, model functions should be used instead.
1352 (Equivalent_Keys): Functions over cursors are removed. They were
1353 awkward with explicit container parameters.
1354 * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
1355 (proof only) procedure to help GNATprove when equivalence over
1356 keys is not equality.
1358 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1360 * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
1361 sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
1362 Minor reformatting and code cleanups.
1364 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1366 * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
1367 subsidiary of Check_Inherited_Conditions, to build pragmas for an
1368 operation whose ancestor has classwide pre/postconditions. This
1369 is used both to check the legality of the inheritance in Ada
1370 and in SPARK, and to determine whether a wrapper is needed for
1371 an inherited operation.
1372 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
1373 Improve placement of error message for inherited classwide
1374 conditions that become illegal on type derivation.
1376 2017-04-27 Yannick Moy <moy@adacore.com>
1378 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
1379 SPARK_Mode from context on generic package.
1380 * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
1383 2017-04-27 Claire Dross <dross@adacore.com>
1385 * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
1386 overflows in computations.
1387 * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
1388 overflows in computations.
1389 (Insert): Rewrite precondition to avoid overflows in computations.
1390 * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
1391 overflows in computations.
1392 (Insert): Rewrite precondition to avoid overflows in computations.
1394 2017-04-27 Steve Baird <baird@adacore.com>
1396 * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
1397 flag when it is declared in order to avoid confusing CodePeer about
1398 the possibility of an uninitialized variable read.
1400 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1402 * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
1403 no dimensionality error if the subtype of the expression is
1404 identical to the nominal subtype in the declaration, even though
1405 the expression itself may have been constant-folded and lack a
1407 * sem_dim.ads: Add comments on setting of dimension vectors and
1408 its interaction with node rewritings and side-effect removal.
1410 2017-04-27 Bob Duff <duff@adacore.com>
1412 * debug.adb: Minor comment correction.
1413 * sem_dim.ads: Minor reformatting and typo fixes.
1415 2017-04-27 Bob Duff <duff@adacore.com>
1417 * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
1418 Last of the tables via function calls, rather than relying on layout
1421 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1423 * exp_util.adb: No wrapper in GNATprove mode.
1425 2017-04-27 Yannick Moy <moy@adacore.com>
1427 * sem_res.adb (Resolve_Comparison_Op): Always
1428 evaluate comparisons between values of universal types.
1430 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1432 * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
1433 an elaboration counter nor a check when in GNATprove mode.
1434 * sem_util.adb (Build_Elaboration_Entity): Do not create an
1435 elaboration counter when in GNATprove mode.
1437 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1439 * freeze.adb: copy-paste typo.
1441 2017-04-27 Yannick Moy <moy@adacore.com>
1443 * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
1444 Use correct test to detect call in GNATprove mode instead of
1447 2017-04-27 Claire Dross <dross@adacore.com>
1449 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
1450 New property function expressing that the element of a
1451 sequence are contained in the union of two sequences.
1452 (Formal_Model.M_Elements_Included): New property function
1453 expressing that the element of a sequence are another sequence.
1454 (Generic_Sorting): Use new property functions to state that
1455 elements are preserved by Sort and Merge.
1456 * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
1457 allow the use of regular equality over elements in contracts.
1458 (Formal_Model): Ghost package containing model functions
1459 that are used in subprogram contracts. (Capacity):
1460 On unbounded containers, return the maximal capacity.
1461 (Current_To_Last): Removed, model functions should be used instead.
1462 (First_To_Previous): Removed, model functions should be used instead.
1463 (Append): Default parameter value replaced
1464 by new wrapper to allow more precise contracts.
1465 (Insert): Subprogram restored, it seems it was useful to users even if
1467 (Delete): Subprogram restored, it seems it was useful to users even if
1469 (Prepend): Subprogram restored, it seems it was useful to users even
1470 if it is inefficient.
1471 (Delete_First): Subprogram restored, it seems it
1472 was useful to users even if it is inefficient. (Delete_Last):
1473 Default parameter value replaced by new wrapper to allow more
1475 (Generic_Sorting.Merge): Subprogram restored.
1476 * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
1477 allow the use of regular equality over elements in contracts.
1478 (Formal_Model): Ghost package containing model functions
1479 that are used in subprogram contracts. (Capacity):
1480 On unbounded containers, return the maximal capacity.
1481 (Current_To_Last): Removed, model functions should be used
1483 (First_To_Previous): Removed, model functions should be used instead.
1484 (Append): Default parameter value replaced
1485 by new wrapper to allow more precise contracts.
1486 (Insert): Subprogram restored, it seems it was useful to users even if
1488 (Delete): Subprogram restored, it seems it was useful to users even if
1490 (Prepend): Subprogram restored, it seems it was useful to users even
1491 if it is inefficient.
1492 (Delete_First): Subprogram restored, it seems it
1493 was useful to users even if it is inefficient. (Delete_Last):
1494 Default parameter value replaced by new wrapper to allow more
1496 (Generic_Sorting.Merge): Subprogram restored.
1497 (Vector): Do not reuse formal vectors, as it is no longer possible
1498 to supply them with an equality function over elements.
1500 2017-04-27 Bob Duff <duff@adacore.com>
1502 * g-dyntab.adb (Release): When allocating the new
1503 table, use the correct slice of the old table to initialize it.
1505 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1507 * einfo.ads: Minor fixes in comments.
1509 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1511 * sem_prag.adb: disable clones in SPARK_Mode.
1513 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1515 * sem_util.ads, contracts.adb: Minor reformatting.
1517 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1519 * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
1520 Build body of subprogram that has a class-wide condition that
1521 contains calls to other primitives.
1522 (Build_Class_Wide_Clone_Call); Build a call to the common
1523 class-wide clone of a subprogram with classwide conditions. The
1524 body of the subprogram becomes a wrapper for a call to the
1525 clone. The inherited operation becomes a similar wrapper to which
1526 modified conditions apply, and the call to the clone includes
1527 the proper conversion in a call the parent operation.
1528 (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
1529 subprogram that has a classwide condition that contains calls to
1530 other primitives, build an internal subprogram that is invoked
1531 through a type-specific wrapper for all inherited subprograms
1532 that may have a modified condition.
1533 * sem_prag.adb (Check_References): If subprogram has a classwide
1534 condition, create entity for corresponding clone, to be invoked
1535 through wrapper subprograns.
1536 (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
1537 message about placement if pragma isi internally generated.
1538 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
1539 a classwide clone, build body of clone as copy of original body,
1540 and rewrite original body as a wrapper as a wrapper for a call to
1541 the clone, so that it incorporates the original pre/postconditions
1543 * freeze.adb (Check_Inherited_Conditions): For an inherited
1544 subprogram that inherits a classwide condition, build spec and
1545 body of corresponding wrapper so that call to inherited operation
1546 gets the modified conditions.
1547 * contracts.adb (Analyze_Contracts): If analysis of classwide
1548 condition has created a clone for a primitive operation, analyze
1549 declaration of clone.
1551 2017-04-27 Steve Baird <baird@adacore.com>
1553 * exp_util.adb (Build_Allocate_Deallocate_Proc):
1554 Add "Suppress => All_Checks" to avoid generating unnecessary
1557 2017-04-27 Yannick Moy <moy@adacore.com>
1559 * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
1560 * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
1561 inlining body in GNATprove mode when switch -gnatdm used.
1562 * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
1563 in GNATprove mode when switch -gnatdm used.
1565 2017-04-27 Arnaud Charlet <charlet@adacore.com>
1567 * sem_ch13.adb (Analyze_Attribute_Definition_Clause
1568 [Attribute_Address]): Call Set_Address_Taken when ignoring rep
1569 clauses, so that we keep an indication of the address clause
1570 before removing it from the tree.
1572 2017-04-27 Yannick Moy <moy@adacore.com>
1574 * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
1575 of expression being qualified, when not an object name, or else
1576 evaluate the underlying name.
1578 2017-04-27 Jerome Lambourg <lambourg@adacore.com>
1580 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
1582 2017-04-27 Justin Squirek <squirek@adacore.com>
1584 * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
1585 Process_Component_List_For_Finalization as a local variable.
1586 (Process_Component_For_Finalize): Add an extra parameter to avoid
1588 (Process_Component_List_For_Finalization): Correct calls to
1589 Process_Component_For_Finalize to take Num_Comps as a parameter.
1591 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1593 * sem_ch8.adb (Find_Direct_Name): Account for the case where
1594 a use-visible entity is defined within a nested scope of an
1595 instance when giving priority to entities which were visible in
1596 the original generic.
1597 * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
1599 2017-04-27 Tristan Gingold <gingold@adacore.com>
1601 * raise-gcc.c: Don't use unwind.h while compiling
1602 for the frontend, but mimic host behavior.
1604 2017-04-27 Javier Miranda <miranda@adacore.com>
1606 * sem_ch3.adb (Build_Discriminated_Subtype):
1607 Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
1609 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1611 * sem_prag.adb (Analyze_Global_Item):
1612 Do not consider discriminants because they are not "entire
1613 objects". Remove the discriminant-related checks because they are
1615 (Analyze_Input_Output): Do not consider discriminants
1616 because they are not "entire objects".
1618 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1620 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
1621 perform check if the current scope does not come from source,
1622 as is the case for a rewritten task body, because check has
1623 been performed already, and may not be doable because of changed
1626 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1628 * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
1629 a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
1632 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1634 * sem_ch4.adb (Analyze_Call): If the return type of a function
1635 is incomplete in an context in which the full view is available,
1636 replace the type of the call by the full view, to prevent spurious
1638 * exp_disp.adb (Check_Premature_Freezing): Disable check on an
1639 abstract subprogram so that compiler does not reject a parameter
1640 of a primitive operation of a tagged type being frozen, when
1641 the untagged type of that parameter cannot be frozen.
1643 2017-04-27 Bob Duff <duff@adacore.com>
1645 * sem_attr.adb (Compute_Type_Key): Don't walk
1646 representation items for irrelevant types, which could be in a
1647 different source file.
1649 2017-04-27 Steve Baird <baird@adacore.com>
1651 * exp_attr.adb (Expand_N_Attribute_Reference):
1652 Don't expand Image, Wide_Image, Wide_Wide_Image attributes
1655 2017-04-27 Yannick Moy <moy@adacore.com>
1657 * exp_unst.ads: Fix typos in comments.
1659 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1661 * sem_eval.adb (Choice_Matches): Handle properly a real literal
1662 whose type has a defined static predicate.
1664 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1666 * exp_ch4.adb (Insert_Dereference_Action):
1667 Do not adjust the address of a controlled object when the
1668 associated access type is subject to pragma No_Heap_Finalization.
1671 2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
1673 * gcc-interface/utils.c (gnat_type_for_size): Set
1674 TYPE_ARTIFICIAL on created types.
1676 2017-04-27 Claire Dross <dross@adacore.com>
1678 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1679 modifications in functional containers.
1680 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1681 to improve readablity. Subprograms are separated between basic
1682 operations, constructors and properties. Universally quantified
1683 formulas in contracts are factorized in independant functions
1684 with a name and a comment. Names of parameters are improved.
1686 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1688 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1690 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1692 * sem_res.adb (Resolve_Type_Conversion): Do not
1693 install a predicate check here since this is already done during
1694 the expansion phase. Verify whether the operand satisfies the
1695 static predicate (if any) of the target type.
1696 * sem_ch3.adb (Analyze_Object_Declaration): Do
1697 not install a predicate check if the object is initialized by
1698 means of a type conversion because the conversion is subjected
1701 2017-04-27 Tristan Gingold <gingold@adacore.com>
1703 * raise.c (__gnat_builtin_longjmp): Remove.
1704 (__gnat_bracktrace):
1705 Add a dummy definition for the compiler (__gnat_eh_personality,
1706 __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
1707 __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
1708 __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
1709 * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
1710 * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
1711 and a-except-2005.adb.
1712 * raise-gcc.c: Allow build in compiler, compiled as a C++
1714 (__gnat_Unwind_ForcedUnwind): Adjust prototype.
1715 (db): Constify msg_format.
1716 (get_call_site_action_for): Don't use void arithmetic.
1717 * system.ads (Frontend_Exceptions): Set to False.
1718 (ZCX_By_Default): Set to True.
1719 (GCC_ZC_Support): Set to True.
1720 * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
1722 * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
1723 in gnat1 and gnatbind.
1724 * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
1725 s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
1726 * s-excmac.ads, s-excmac.adb: Copy of variants.
1727 * a-except.o: Adjust preequisites.
1728 Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
1730 2017-04-27 Claire Dross <dross@adacore.com>
1732 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1733 modifications in functional containers.
1734 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1735 to improve readablity. Subprograms are separated between basic
1736 operations, constructors and properties. Universally quantified
1737 formulas in contracts are factorized in independant functions
1738 with a name and a comment. Names of parameters are improved.
1740 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1742 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1744 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1746 * sem_res.adb (Resolve_Type_Conversion): Do not
1747 install a predicate check here since this is already done during
1748 the expansion phase. Verify whether the operand satisfies the
1749 static predicate (if any) of the target type.
1750 * sem_ch3.adb (Analyze_Object_Declaration): Do
1751 not install a predicate check if the object is initialized by
1752 means of a type conversion because the conversion is subjected
1755 2017-04-27 Tristan Gingold <gingold@adacore.com>
1757 * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
1758 replaced by their variants).
1760 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1762 * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
1763 cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
1764 a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
1766 2017-04-27 Tristan Gingold <gingold@adacore.com>
1768 * s-excmac-gcc.ads, s-excmac-gcc.adb,
1769 s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
1772 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1774 * exp_ch7.adb (Establish_Transient_Scope): Rewrite
1775 the loop which detects potential enclosing transient scopes. The
1776 loop now terminates much earlier as transient scopes are bounded
1777 by packages and subprograms.
1779 2017-04-27 Claire Dross <dross@adacore.com>
1781 * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
1782 allow the use of regular equality over elements in contracts.
1783 (Cursor): Type is now public so that it can be used in
1785 (Formal_Model): Ghost package containing
1786 model functions that are used in subprogram contracts.
1787 (Current_To_Last): Removed, model functions should be used
1789 (First_To_Previous): Removed, model functions should
1791 (Strict_Equal): Removed, model functions
1792 should be used instead.
1793 (Append): Default parameter value
1794 replaced by new wrapper to allow more precise contracts.
1795 (Insert): Default parameter value replaced by new wrapper to
1796 allow more precise contracts.
1797 (Delete): Default parameter
1798 value replaced by new wrapper to allow more precise contracts.
1799 (Prepend): Default parameter value replaced by new wrapper to
1800 allow more precise contracts.
1801 (Delete_First): Default parameter
1802 value replaced by new wrapper to allow more precise contracts.
1803 (Delete_Last): Default parameter value replaced by new wrapper
1804 to allow more precise contracts.
1806 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1808 * exp_spark.adb (Expand_SPARK): Perform specialized expansion
1809 for object declarations.
1810 (Expand_SPARK_N_Object_Declaration): New routine.
1811 * sem_elab.adb (Check_A_Call): Include calls to the
1812 Default_Initial_Condition procedure of a type under the SPARK
1813 elaboration checks umbrella.
1815 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1817 * sem.adb (Analyze): Diagnose an illegal iterated component
1819 * sem_util.ads, sem_util.adb
1820 (Diagnose_Iterated_Component_Association): New routine.
1822 2017-04-27 Bob Duff <duff@adacore.com>
1824 * adaint.c (__gnat_get_current_dir): Return 0 in length if
1826 * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
1827 exception if getcwd failed.
1829 2017-04-27 Yannick Moy <moy@adacore.com>
1831 * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
1832 entities with special prefix.
1834 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1836 * debug.adb Change the documentation of switch -gnatd.s.
1837 * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
1838 to manage the secondary stack when an enclosing scope already
1839 performs this functionality (aka relaxed management). Switch
1840 -gnatd.s may be used to force strict management in which case
1841 the block will manage the secondary stack unconditionally. Add
1842 a guard to stop the traversal when encountering a package or a
1845 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1847 * sem_res.adb (Resolve_Call): Refine further the handling of
1848 limited views of return types in function calls. If the function
1849 that returns a limited view appears in the current unit,
1850 we do not replace its type by the non-limited view because
1851 this transformation is performed int the back-end. However,
1852 the type of the call itself must be the non-limited view, to
1853 prevent spurious resolution errors.
1855 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1857 * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
1858 Removed, proposed implementation using generics for class-wide
1859 preconditions proved impractical.
1860 (Class_Wide_Clone): New attribute of subprogram. Designates
1861 subprogram created for primitive operations with class-wide
1862 pre/postconditions that contain calls to other primitives. The
1863 clone holds the body of the original primitive, but the
1864 pre/postonditions do not apply to it. The original body is
1865 rewritten as a wrapper for a call to the clone.
1866 (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
1867 the flag is set, no code for the corresponding pre/postconditions
1868 is inserted into its body.
1870 2017-04-27 Bob Duff <duff@adacore.com>
1872 * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
1873 Scalar_Storage_Order if -gnatI is given.
1874 * sem_prag.adb (Analyze_Pragma): Ignore
1875 Default_Scalar_Storage_Order if -gnatI is given.
1877 2017-04-27 Claire Dross <dross@adacore.com>
1879 * a-cofuba.ads (Add): Take as an additional input parameter
1880 the position where the element should be inserted.
1881 (Remove): New function that removes an element from the container.
1882 * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
1883 * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
1884 (Remove): New function that removes an element from a set.
1885 * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
1886 (Remove): New function that removes an element from a sequence.
1887 (Insert): New function that adds anywhere in a sequence.
1889 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1891 * checks.adb (Generate_Range_Check): Revert previous change.
1893 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1895 * sem_util.adb: Minor reformatting/rewording.
1897 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1899 * lib-xref.adb (Generate_Reference): The use
1900 of attribute 'Result is not considered a violation of pragma
1903 2017-04-27 Justin Squirek <squirek@adacore.com>
1905 * cstand.adb (Create_Standard): Correctly set
1906 Directly_Designated_Type for Any_Access.
1907 * sem_type.adb (Covers): Minor grammar fixes.
1909 2017-04-27 Bob Duff <duff@adacore.com>
1911 * sem_attr.adb: Minor cleanup.
1913 2017-04-27 Claire Dross <dross@adacore.com>
1915 * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
1916 private child of Ada.Containers used to implement all functional
1918 * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
1919 child of Ada.Containers. It provides functional indefinite unbounded
1920 maps which can be used as high level models for specification
1922 * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
1923 child of Ada.Containers. It provides functional indefinite unbounded
1924 sets which can be used as high level models for specification
1926 * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
1927 child of Ada.Containers. It provides functional indefinite unbounded
1928 vectors which can be used as high level models for specification
1930 * Makefile.rtl: Add new packages.
1931 * impunit.adb: Add new packages.
1933 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1935 * sem_ch4.adb: Minor reformatting.
1937 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1939 * sem_ch12.adb (Analyze_Associations): minor reformatting.
1940 (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
1941 point type actual that has user-defined arithmetic primitives,
1942 when there is a previous actual for a formal package that defines
1943 a fixed-point type with the parent user-defined operator.
1945 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1947 * checks.adb (Generate_Range_Check): Reinstate part of previous change.
1948 * sem_attr.adb (Resolve_Attribute): Generate a range check when
1949 the component type allows range checks.
1951 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1953 * sem_aux.adb (Is_Generic_Formal): Use original node to locate
1954 corresponding declaration, because formal derived types are
1955 rewritten as private extensions.
1957 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1959 * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
1960 dimensions of operands if node has been analyzed already, because
1961 previous analysis and dimension checking will have removed the
1962 dimension information from the operands.
1964 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1966 * debug.adb: Document the use of switch -gnatd.s.
1967 * einfo.ads Update the documentation on attribute
1968 Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
1969 the uses of these attributes from certain entities.
1970 * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
1971 which determines whether the block should continue to manage
1972 the secondary stack.
1973 (Manages_Sec_Stack): New routine.
1975 2017-04-27 Bob Duff <duff@adacore.com>
1977 * atree.ads: Minor edit.
1979 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1981 * sinfo.ads: Update the section on Ghost mode. Add
1982 a section on SPARK mode. Update the placement of section on
1983 expression functions.
1985 2017-04-27 Bob Duff <duff@adacore.com>
1987 * sinput.adb (Get_Source_File_Index): Don't
1988 assert that S is in the right range in the case where this is
1989 a .dg file under construction.
1991 2017-04-27 Yannick Moy <moy@adacore.com>
1993 * sem_util.adb (Check_Result_And_Post_State):
1994 Handle more precisely each conjunct in expressions formed by
1995 and'ing sub-expressions.
1997 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1999 * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
2001 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2003 * gnat_rm.texi, gnat_ugn.texi,
2004 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
2005 doc/gnat_ugn/platform_specific_information.rst,
2006 doc/gnat_ugn/gnat_and_program_execution.rst,
2007 doc/gnat_ugn/gnat_utility_programs.rst,
2008 doc/gnat_ugn/the_gnat_compilation_model.rst,
2009 doc/gnat_rm/implementation_defined_attributes.rst,
2010 doc/gnat_rm/the_gnat_library.rst,
2011 doc/gnat_rm/implementation_defined_pragmas.rst,
2012 doc/gnat_rm/representation_clauses_and_pragmas.rst,
2013 doc/gnat_rm/implementation_of_specific_ada_features.rst,
2014 doc/gnat_rm/implementation_defined_aspects.rst,
2015 doc/gnat_rm/implementation_defined_characteristics.rst: Update
2018 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2020 * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
2021 generating C code on complex case expressions.
2023 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2025 * sem_prag.adb (Analyze_Pragma): Generate a warning instead
2026 of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
2027 * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
2028 Ada_2012 instead of Ada_2005 to be compatible with the above
2030 * bindgen.adb: Silence new warning on pragma Ada_95.
2032 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2034 * checks.adb (Generate_Range_Check): Revert part of previous change.
2036 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2038 * sem_ch4.adb (Try_Container_Indexing): Handle properly a
2039 container indexing operation that appears as a an actual in a
2040 parameter association in a procedure call.
2042 2017-04-25 Olivier Ramonat <ramonat@adacore.com>
2044 * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
2045 Fix spelling mistakes.
2047 2017-04-25 Bob Duff <duff@adacore.com>
2049 * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
2050 * sinput-p.adb: Use regular fat pointers, with bounds checking,
2051 for source buffers. Fix misc obscure bugs.
2052 * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
2053 checking, for source buffers. Modify representation clause for
2054 Source_File_Record as appropriate. Move Source_File_Index_Table
2055 from spec to body, because it is not used outside the body.
2056 Move Set_Source_File_Index_Table into the private part, because
2057 it is used only in the body and in children. Use trickery to
2058 modify the dope in the generic instantiation case. It's ugly,
2059 but not as ugly as the previous method. Fix documentation.
2060 Remove obsolete code.
2061 * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
2062 indexing in source buffers.
2063 * fmap.adb: Avoid conversions from one string type to another.
2064 Remove a use of global name buffer.
2065 * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
2068 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2070 * exp_util.adb, exp_ch4.adb: Minor reformatting.
2072 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2074 * checks.adb: Code clean up in various routines.
2075 (Generate_Range_Check): Do not generate a range check when the
2076 expander is not active or when index/range checks are suppressed
2078 (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
2079 Remove variants that include a Supress parameter. These routines
2080 are never used, and were introduced before the current scope-based
2081 check suppression method.
2083 2017-04-25 Vasiliy Fofanov <fofanov@adacore.com>
2085 * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
2086 code and some subprogram calls that are now noop.
2088 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2090 * exp_ch4.adb (Expand_N_Case_Expression): Take
2091 Minimize_Expression_With_Actions into account when possible.
2093 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2095 * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
2096 (Known_Null): Moved to Sem_Util.
2097 * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
2098 (Known_Null): Moved to Sem_Util.
2099 * sem_util.adb Add new enumeration type Null_Status_Kind.
2100 (Known_Non_Null): Moved from Exp_Util. Most of the logic in
2101 this routine is now carried out by Null_Status.
2102 (Known_Null): Moved from Exp_Util. Most of the logic in this routine
2103 is now carried out by Null_Status.
2104 (Null_Status): New routine.
2105 * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
2106 (Known_Null): Moved from Exp_Util.
2108 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2110 * sem_ch6.adb (Analyze_Expression_Function): Do not report an
2111 error on the return type of an expression function that is a
2112 completion, if the type is derived from a generic formal type.
2114 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2116 * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
2117 conversion are those of the target type.
2119 2017-04-25 Bob Duff <duff@adacore.com>
2121 * a-clrefi.adb: Minor cleanup.
2123 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2125 * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
2127 2017-04-25 Bob Duff <duff@adacore.com>
2129 * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
2130 types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
2131 errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
2132 scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
2133 the Internal_Source buffer. This removes the incorrect call to "="
2134 the customer noticed.
2135 Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
2136 eventually need to eliminate them altogether. Or else get rid
2137 of zero-origin addressing.
2139 2017-04-25 Claire Dross <dross@adacore.com>
2141 * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
2142 function used in GNATprove to know if an expression contains
2143 non-dispatching calls on primitives of a tagged type.
2145 2017-04-25 Bob Duff <duff@adacore.com>
2147 * rtsfind.adb (Initialize): Initialize
2148 First_Implicit_With. Building the compiler with Normalize_Scalars
2149 and validity checking finds this being used as an uninitialized
2152 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2154 * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
2155 Add a warning about SPARK mode management. The routine now
2156 saves and restores both the mode and associated pragma.
2157 (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
2158 SPARK mode management. The routine now saves and restores both
2159 the mode and associated pragma.
2160 (Analyze_Object_Contract):
2161 Add a warning about SPARK mode management. The routine
2162 now saves and restores both the mode and associated pragma.
2163 (Analyze_Package_Body_Contract): Add a warning about SPARK mode
2164 management. The routine now saves and restores both the mode
2165 and associated pragma. (Analyze_Package_Contract): Add a warning
2166 about SPARK mode management. The routine now saves and restores
2167 both the mode and associated pragma.
2168 (Analyze_Task_Contract):
2169 Add a warning about SPARK mode management. The routine now saves
2170 and restores both the mode and associated pragma.
2171 * expander.adb (Expand): Change the way the Ghost mode is saved
2173 * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
2175 * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
2177 * exp_util.adb (Build_DIC_Procedure_Body):
2178 Change the way the Ghost mode is saved and restored.
2179 (Build_DIC_Procedure_Declaration): Change the way the Ghost
2180 mode is saved and restored.
2181 (Build_Invariant_Procedure_Body):
2182 Change the way the Ghost mode is saved and restored.
2183 (Build_Invariant_Procedure_Declaration): Change the way the Ghost
2184 mode is saved and restored.
2185 (Make_Predicate_Call): Change the
2186 way the Ghost mode is saved and restored.
2187 * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
2189 * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2191 (Mark_And_Set_Ghost_Body): Remove parameter
2192 Mode and its assignment.
2193 (Mark_And_Set_Ghost_Completion):
2194 Remove parameter Mode and its assignment.
2195 (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
2197 (Mark_And_Set_Ghost_Instantiation): Remove parameter
2198 Mode and its assignment.
2199 (Mark_And_Set_Ghost_Procedure_Call):
2200 Remove parameter Mode and its assignment.
2202 Remove parameter Mode and its assignment.
2203 * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2204 and update the comment on usage.
2205 (Mark_And_Set_Ghost_Body):
2206 Remove parameter Mode and update the comment on usage.
2207 (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
2208 update the comment on usage.
2209 (Mark_And_Set_Ghost_Declaration):
2210 Remove parameter Mode and update the comment on usage.
2211 (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
2212 update the comment on usage.
2213 (Mark_And_Set_Ghost_Procedure_Call):
2214 Remove parameter Mode and update the comment on usage.
2215 (Set_Ghost_Mode): Remove parameter Mode and update the comment
2217 * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
2219 * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
2220 of obsolete field SPARK_Mode_Pragma.
2221 (Load_Main_Source): Remove
2222 the assignment of obsolete field SPARK_Mode_Pragma.
2223 (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
2224 * lib-writ.adb (Add_Preprocessing_Dependency): Remove
2225 the assignment of obsolete field SPARK_Mode_Pragma.
2226 (Ensure_System_Dependency): Remove the assignment of obsolete
2227 field SPARK_Mode_Pragma.
2228 * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
2229 mode management. Change the way Ghost and SPARK modes are saved
2231 * sem.adb (Analyze): Change the way the Ghost mode is saved
2233 * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
2234 Ghost mode is saved and restored.
2235 (Process_Full_View): Change
2236 the way the Ghost mode is saved and restored.
2237 * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
2238 mode is saved and restored.
2239 * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
2240 mode is saved and restored.
2241 (Analyze_Subprogram_Body_Helper):
2242 Change the way the Ghost mode is saved and restored.
2243 * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
2244 Ghost mode is saved and restored.
2245 * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
2246 management. Save the SPARK mode-related data prior to any changes
2247 to the scope stack and contexts. The mode is then reinstalled
2248 before the subunit is analyzed in order to restore the original
2249 view of the subunit.
2250 * sem_ch12.adb (Analyze_Package_Instantiation): Update the
2251 warning on region management. Change the way the Ghost and
2252 SPARK modes are saved and restored.
2253 (Inline_Instance_Body):
2254 Add a warning about SPARK mode management. Code clean up.
2255 (Analyze_Subprogram_Instantiation): Update the warning on region
2256 management. Change the way the Ghost and SPARK modes are saved
2258 (Instantiate_Package_Body): Update the warning
2259 on region management. Change the way the Ghost and SPARK modes
2260 are saved and restored.
2261 (Instantiate_Subprogram_Body): Update
2262 the warning on region management. Change the way the Ghost and
2263 SPARK modes are saved and restored.
2264 (Set_Instance_Env): Add a
2265 warning about SPARK mode management. Change the way SPARK mode
2266 is saved and restored.
2267 * sem_ch13.adb (Build_Predicate_Functions):
2268 Change the way the Ghost mode is saved and restored.
2269 (Build_Predicate_Function_Declaration): Change the way the Ghost
2270 mode is saved and restored.
2271 * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
2272 mode management. Change the way SPARK mode is saved and restored.
2273 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
2274 Change the way the Ghost mode is saved and restored.
2275 (Analyze_Initial_Condition_In_Decl_Part): Change the way
2276 the Ghost mode is saved and restored.
2278 Change the way the Ghost mode is saved and restored.
2279 (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
2280 Ghost mode is saved and restored.
2281 * sem_util.adb (Install_SPARK_Mode): New routine.
2282 (Restore_SPARK_Mode): New routine.
2283 (Save_SPARK_Mode_And_Set): Removed.
2284 (Set_SPARK_Mode): New routine.
2285 * sem_util.ads (Install_SPARK_Mode): New routine.
2286 (Restore_SPARK_Mode): New routine.
2287 (Save_SPARK_Mode_And_Set): Removed.
2288 (Set_SPARK_Mode): New routine.
2290 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2292 * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
2293 to determine whether a type is declared in a local package that
2294 has not yet been frozen.
2295 * freeze.adb (Freeze_Before): Use new predicate to determine
2296 whether a local package must be installed on the scope stack
2297 in order to evaluate in the proper scope actions generated by
2298 aspect specifications, such as Predicate
2299 * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
2300 using new predicate.
2302 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2304 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
2305 comparisons between non- scalar expressions expressions because
2306 their values cannot be invalidated.
2307 * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
2310 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2312 * par_sco.adb: Minor reformatting.
2314 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2316 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
2317 is a type from an unfrozen local package, install package to
2318 complete the analysis of delayed aspects of the type.
2320 2017-04-25 Tristan Gingold <gingold@adacore.com>
2322 * bingen.adb (System_Version_Control_Used): New variable.
2323 (Resolve_Binder_Options): Set the above variable.
2324 (Gen_Output_File_Ada): Conditionally call Gen_Versions.
2325 (Gen_Elab_Order): Emit blank line before.
2327 2017-04-25 Justin Squirek <squirek@adacore.com>
2329 * sem_cat.adb (Validate_RT_RAT_Component): Added
2330 an extra check to ignore incomplete types.
2332 2017-04-25 Thomas Quinot <quinot@adacore.com>
2334 * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
2335 bogus circuitry for the case where Name is Predicate.
2337 2017-04-25 Thomas Quinot <quinot@adacore.com>
2339 * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
2340 Create SCOs for Predicate aspects in disabled
2341 state initially, to be enabled later on by...
2342 * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
2343 SCO for predicate as enabled.
2345 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2347 * comperr.adb (Compiler_Abort): Remove now obsolete pair of
2348 pragmas Warnings Off / On.
2349 * namet.adb (Finalize): Remove now obsolete pair of pragmas
2351 * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
2352 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
2353 consider comparisons between static expressions because their
2354 values cannot be invalidated.
2355 * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
2357 (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
2358 * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
2360 2017-04-25 Bob Duff <duff@adacore.com>
2362 * sem_elab.adb (In_Task_Activation): Trace internal calls in
2365 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2367 * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
2370 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2372 * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
2373 On/Off to defend against a spurious warning in conditional
2375 * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
2376 * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
2377 defend against a spurious warning in conditional compilation.
2378 * output.adb Add a pair of pragma Warnings On/Off to defend
2379 against a spurious warning in conditional compilation.
2380 * sem_eval.adb (Eval_Relational_Op): Major code clean up.
2381 (Fold_General_Op): New routine.
2382 (Fold_Static_Real_Op): New routine.
2383 (Test_Comparison): New routine.
2384 * sem_eval.ads (Test_Comparison): New routine.
2385 * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
2386 (Warn_On_Constant_Valid_Condition): New routine.
2387 (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
2388 to detect a specific case.
2389 * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
2390 * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
2391 to defend against a spurious warning in conditional compilation.
2392 (Tree_Write): Add a pair of pragma Warnings On/Off to defend
2393 against a spurious warning in conditional compilation.
2394 * usage.adb Add a pair of pragma Warnings On/Off to defend
2395 against a spurious warning in conditional compilation.
2397 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2399 * sinfo.ads, sem_ch13.adb: Update comment.
2401 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2403 * sem_util.adb (Is_Post_State): A reference to a
2404 generic in out parameter is considered a change in the post-state
2407 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2409 * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
2410 declaration of a subprogram instance within its wrapper package,
2411 skip over null statements that may result from the rewriting of
2414 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2416 * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
2417 If the type is an unchecked_union, replace the attribute with
2418 a Raise_Program_Error (rather than inserting such before the
2419 attribute reference) to handle properly the case where we are
2420 processing a component of a larger record, and we need to prevent
2421 further expansion for the unchecked union.
2422 (Expand_Attribute_Reference, case 'Write): If the type is
2423 an unchecked_union, check whether enclosing scope is a Write
2424 subprogram. Replace attribute with a Raise_Program_Error if the
2425 discriminants of the unchecked_union type have not default values
2426 because such a use is erroneous..
2428 2017-04-25 Tristan Gingold <gingold@adacore.com>
2430 * exp_ch9.adb (Expand_N_Task_Type_Declaration):
2431 Add relative_deadline to task record on edf profile.
2432 (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
2433 (Make_Task_Create_Call): Pass relative_deadline value.
2434 * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
2435 * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
2436 (Profile_Info): Add info for GNAT_Ravenscar_EDF.
2437 * sem_prag.adb (Set_Ravenscar_Profile): Handle
2438 GNAT_Ravenscar_EDF (set scheduling policy).
2439 (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
2441 (Sig_Flags): Add choice for Pragma_Deadline_Floor.
2442 * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
2444 (Pragma_Deadline_Floor): New pragma.
2445 * targparm.adb (Get_Target_Parameters): Recognize
2446 GNAT_Ravenscar_EDF profile.
2448 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2450 * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
2452 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2454 * sem_aux.adb (Nearest_Ancestor): Use original node of type
2455 declaration to locate nearest ancestor, because derived
2456 type declarations for record types are rewritten as record
2458 * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
2459 properly derivations that are completions of private types.
2460 (Add_Predicates): If type is private, examine rep. items of full
2461 view, which may include inherited predicates.
2462 (Build_Predicate_Functions): Ditto.
2464 2017-04-25 Javier Miranda <miranda@adacore.com>
2466 * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
2467 to generate new entities for subtype declarations located in
2468 Expression_With_Action nodes.
2470 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2472 * sem_elab.adb (Check_A_Call): Remove
2473 local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
2474 need for Elaborate_All when SPARK elaboration checks are
2475 required. Update the checks for instances, variables, and calls
2476 to Default_Initial_Condition procedures.
2478 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2480 * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
2481 into a boolean aspect, in analogy with the Ada aspect No_Return.
2483 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2485 * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
2487 2017-04-25 Bob Duff <duff@adacore.com>
2489 * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
2490 Is_True_Constant for an array variable that is passed to a
2491 foreign function as an 'in' parameter.
2492 * debug.adb: Document -gnatd.q.
2494 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2496 * sem_ch6.adb (Analyze_Expression_Function): If expression function
2497 is completion and return type is an access type do not freeze
2498 designated type: this will be done in the process of freezing
2499 the expression if needed.
2500 (Freeze_Expr_Types): Check whether type is complete before
2501 creating freeze node, to provide a better error message if
2502 reference is premature.
2503 * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
2504 functions created by type derivations.
2506 2017-04-25 Pascal Obry <obry@adacore.com>
2508 * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
2510 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2512 * sem_res.adb (Resolve_Type_Conversion):
2513 When resolving against any fixed type, set the type of the
2514 operand as universal real when the operand is a multiplication
2515 or a division where both operands are of any fixed type.
2516 (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
2517 placement of an error message by pointing to the operand of a
2518 type conversion rather than the conversion itself.
2520 2017-04-25 Thomas Quinot <quinot@adacore.com>
2522 * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
2523 Needs_Debug_Info when producing SCOs.
2525 2017-04-25 Thomas Quinot <quinot@adacore.com>
2527 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
2528 Always pass a null finalization master for a library level named access
2529 type to which a pragme No_Heap_Finalization applies.
2531 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2535 * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
2536 set to A'First(2) and vice versa.
2538 2017-04-25 Yannick Moy <moy@adacore.com>
2540 * freeze.adb (Freeze_Record_Type): Remove obsolete
2541 rule on volatile tagged record restriction on SPARK code.
2543 2017-04-25 Yannick Moy <moy@adacore.com>
2545 * sem_prag.adb (minor) Fix SPARK RM reference.
2547 2017-04-25 Yannick Moy <moy@adacore.com>
2549 * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
2550 comment to reflect which entity is chosen as unique entity.
2551 (Unique_Entity): Return full view instead of private spec for
2552 protected type or task type. Fix possible incorrect access when
2555 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2557 * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
2558 array types only instead of all packed array types.
2560 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2562 * sem_ch6.adb (Conforming_Types): If type of formal as a specified
2563 dimension system, verify that dimensions of both match.
2564 (Check_Conformance): Add error message in case of dimension
2566 * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
2569 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2571 * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
2574 2017-04-25 Yannick Moy <moy@adacore.com>
2576 * sem_util.adb: Minor refactoring.
2577 * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
2579 2017-04-25 Claire Dross <dross@adacore.com>
2581 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
2582 ultimate alias when accessing overridden operation. Indeed, if the
2583 overridden operation is itself inherited, it won't have any explicit
2586 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2588 * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
2589 overlap if the two formals have different types, because formally
2590 the corresponding actuals cannot designate the same objects.
2592 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2594 * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
2595 dimensions are present from context, use them. b) If operand is
2596 a static constant rewritten as a literal, obtain the dimensions
2597 from the original declaration, otherwise use dimensions of type
2598 established from context.
2600 2017-04-25 Yannick Moy <moy@adacore.com>
2602 * sem_util.adb (Is_Effectively_Volatile): Protect against base type
2603 of array that is private.
2605 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2607 * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
2610 2017-04-25 Yannick Moy <moy@adacore.com>
2612 * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
2615 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2617 * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
2618 the check that recognizes a call to a private overridding and
2619 replaces the called subprogram with its alias.
2621 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2623 * exp_util.adb: Minor reformatting.
2625 2017-04-25 Justin Squirek <squirek@adacore.com>
2627 * exp_ch3.adb (Freeze_Type): Add condition to always treat
2628 interface types as a partial view of a private type for the
2629 generation of invariant procedure bodies.
2630 * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
2631 Add a condition to get the Corresponding_Record_Type for
2632 concurrent types, add condition to return in the absence of a
2633 class in the pragma, remove call to Replace_Type_References,
2634 and add call to Replace_References.
2635 (Add_Interface_Invariatns),
2636 (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
2637 to including the working type T.
2638 (Add_Own_Invariants): Remove
2639 legacy condition for separate units, remove dispatching for ASIS
2640 and save a copy of the expression in the pragma expression.
2641 (Build_Invariant_Procedure_Body): Default initalize vars,
2642 remove return condition on interfaces, always use the
2643 private type for interfaces, and move the processing of types
2644 until after the processing of invariants for the full view.
2645 (Build_Invariant_Procedure_Declaration): Remove condition
2646 to return if an interface type is encountered and add
2647 condition to convert the formal parameter to its class-wide
2648 counterpart if Work_Typ is abstract.
2649 (Replace_Type): Add call to Remove_Controlling_Arguments.
2650 (Replace_Type_Ref): Remove class-wide dispatching for the current
2651 instance of the type.
2652 (Replace_Type_References): Remove parameter "Derived"
2653 (Remove_Controlling_Arguments): Created in order to removing
2654 the controlliong argument from calls to primitives in the case
2655 of the formal parameter being an class-wide abstract type.
2656 * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
2657 to the change made to Freeze_Type in exp_ch3. Add a condition
2658 to treat interface types as a partial view.
2659 * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
2660 to Build_Invariant_Procedure_Declaration to properly generate a
2661 "partial" invariant procedure when Typ is an interface.
2663 2017-04-25 Bob Duff <duff@adacore.com>
2665 * a-numeri.ads: Go back to using brackets encoding for the Greek
2668 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2670 * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
2671 (10-15): if derived type T with progenitors is abstract,
2672 and primitive P of this type inherits non-trivial classwide
2673 preconditions from both a parent operation and from an interface
2674 operation, then the inherited operation is abstract if the parent
2675 operation is not null.
2676 * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
2677 with Covered_Interface_Op to yield the actual interface operation
2678 that is implemented by a given inherited operation.
2680 2017-04-25 Javier Miranda <miranda@adacore.com>
2682 * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
2683 and right operands after performing the validity checks. Required
2684 because validity checks may remove side effects from the operands.
2686 2017-04-25 Javier Miranda <miranda@adacore.com>
2688 * exp_attr.adb (Attribute_Unrestricted_Access):
2689 Do not disable implicit type conversion. Required to generate
2690 code that displaces the pointer to reference the secondary
2693 2017-04-25 Pascal Obry <obry@adacore.com>
2695 * prj-attr.adb, snames.ads-tmpl: Add package Install's
2696 Required_Artifacts attribute.
2698 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2700 * sem_util.adb (Same_Value): String literals are compile-time
2701 values, and comparing them must use Expr_Value_S.
2703 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2705 * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
2706 dereference is introduced for the object, and the object is
2707 overloaded, do not check whether it is aliased, because it may
2708 include an implicit dereference.
2709 * sem_type.adb (Disambiguate): If two interpretations are access
2710 attribute types with the same designated type keep either of
2711 them and do not report an ambiguity. A true ambiguity will be
2714 2017-04-25 Bob Duff <duff@adacore.com>
2716 * a-numeri.ads: Change the encoding of Greek letter Pi from
2717 brackets encoding to UTF-8. Use pragma Wide_Character_Encoding
2718 to indicate the encoding. We considered using a byte order mark
2719 (BOM), but that causes various trouble (misc software eats the
2720 BOM, if you have a patch with a BOM, then it's not at the start
2721 of the patch, so it's not a BOM, the BOM affects with-ing files,
2723 * scng.adb, s-wchcnv.adb: Minor.
2725 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2727 * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
2728 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2730 * sem_ch3.adb (Add_Internal_Interface_Entities): Move
2731 Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
2732 Improve error message on operations that inherit non-conforming
2733 classwide preconditions from ancestor and progenitor.
2734 * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
2735 moved here from sem_ch3.
2736 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
2737 check given in RM 6.1.1 (17) concerning renamings of overriding
2738 operations that inherits class-wide preconditions from ancestor
2741 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2743 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
2744 (Build_Adjust_Statements): Code cleanup.
2745 (Build_Finalizer): Update the initialization of
2747 (Build_Finalize_Statements): Code cleanup.
2748 (Build_Initialize_Statements): Code cleanup.
2749 (Make_Deep_Array_Body): Update the initialization of
2751 (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
2752 (Process_Object_Declaration): Generate a null exception handler only
2753 when exceptions are allowed.
2754 (Process_Transients_In_Scope): Update the initialization of
2756 * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
2758 * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
2759 restrictions when the handler is internally generated and the
2762 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2764 * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
2765 enforce legality rule on classwide preconditions inherited from
2766 both an ancestor and a progenitor (RM 6.1.1 (10-13).
2767 * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
2768 subprogram need not be dispatching if it appears in a precondition
2769 for an abstract or null subprogram.
2771 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2773 * sem_ch10.adb: Minor typo fix.
2775 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2777 * gcc-interface/Makefile.in: Cleanup VxWorks targets.
2779 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2781 * fname.adb (Is_Internal_File_Name): Arrange for the slices to
2782 have a length which is a power of 2.
2783 (Is_Predefined_File_Name): Likewise. Adjust comment.
2785 2017-04-25 Bob Duff <duff@adacore.com>
2787 * exp_aggr.adb (Component_Count): Protect the
2788 arithmetic from attempting to convert a value >= 2**31 to Int,
2789 which would otherwise raise Constraint_Error.
2791 2017-04-25 Bob Duff <duff@adacore.com>
2793 * opt.ads (Locking_Policy): Fix incorrect documentation. The
2794 first character of the policy name is not unique.
2796 2017-04-25 Bob Duff <duff@adacore.com>
2798 * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
2799 * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
2800 about this flag not being used. It was already used, and it is
2803 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2805 * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
2806 (Ignore_SPARK_Mode_Pragmas): New routine.
2807 (Set_Ignore_SPARK_Mode_Pragmas): New routine.
2808 (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
2809 * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
2811 (Ignore_SPARK_Mode_Pragmas): New routine
2812 along with pragma Inline.
2813 (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
2814 * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
2815 Ignore_SPARK_Mode_Pragmas_In_Instance.
2816 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
2817 Save and restore the value of global flag
2818 Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
2819 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
2820 the corresponding spec or the body must ignore all SPARK_Mode
2821 pragmas found within.
2822 (Analyze_Subprogram_Declaration): Mark
2823 the spec when it needs to ignore all SPARK_Mode pragmas found
2824 within to allow the body to infer this property in case it is
2825 instantiated or inlined later.
2826 * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
2827 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2828 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2829 when the corresponding spec also ignored all SPARK_Mode pragmas
2831 (Analyze_Package_Declaration): Mark the spec when
2832 it needs to ignore all SPARK_Mode pragmas found within to allow
2833 the body to infer this property in case it is instantiated or
2835 * sem_ch12.adb (Analyze_Formal_Package_Declaration):
2836 Save and restore the value of flag
2837 Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2838 formal spec when it needs to ignore all SPARK_Mode
2839 pragmas found within to allow the body to infer this
2840 property in case it is instantiated or inlined later.
2841 (Analyze_Package_Instantiation): Save and restore the value
2842 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
2843 the instance spec when it needs to ignore all SPARK_Mode
2844 pragmas found within to allow the body to infer this
2845 property in case it is instantiated or inlined later.
2846 (Analyze_Subprogram_Instantiation): Save and restore the value
2847 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2848 instance spec and anonymous package when they need to ignore
2849 all SPARK_Mode pragmas found within to allow the body to infer
2850 this property in case it is instantiated or inlined later.
2851 (Instantiate_Package_Body): Save and restore the value of global
2852 flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
2853 global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
2854 corresponding instance spec also ignored all SPARK_Mode pragmas
2856 (Instantiate_Subprogram_Body): Save and restore the
2857 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2858 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2859 when the corresponding instance spec also ignored all SPARK_Mode
2860 pragmas found within.
2861 * sem_prag.adb (Analyze_Pragma): Update the reference to
2862 Ignore_Pragma_SPARK_Mode.
2863 * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
2864 all SPARK_Mode pragmas defined within yields mode "off".
2866 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2868 * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
2870 2017-04-25 Bob Duff <duff@adacore.com>
2872 * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
2873 All_Checks" to avoid generating unnecessary checks.
2874 * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
2876 * sem.ads: Fix comment.
2877 * expander.ads: Fix comment.
2878 * exp_atag.ads: Fix comment: "Index = 0" should be
2881 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2883 * s-taprop-linux.adb: Minor editorial fixes.
2885 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2887 * sem_util.adb (New_Copy_Tree): Put back the declarations of the
2888 hash tables at library level. Reinstate the NCT_Hash_Tables_Used
2889 variable and set it to True whenever the main hash table is
2890 populated. Short- circuit the Assoc function if it is false
2891 and add associated guards.
2893 2017-04-25 Olivier Hainque <hainque@adacore.com>
2895 * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
2896 specs without elaboration code that have an elaboration counter
2897 nevertheless, e.g. when compiled with -fpreserve-control-flow.
2898 * sem_ch10.adb (Analyze_Compilation_Unit):
2899 Set_Elaboration_Entity_Required when requested to preserve
2900 control flow, to ensure the unit elaboration is materialized at
2901 bind time, resulting in the inclusion of the unit object file
2902 in the executable closure at link time.
2904 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
2906 * exp_dbug.adb: In Debug_Renaming_Declaration,
2907 when dealing with indexed component, accept to produce a renaming
2908 symbol when the index is an IN parameter or when it is a name
2909 defined in an outer scope.
2911 2017-04-25 Yannick Moy <moy@adacore.com>
2913 * errout.adb (Error_Msg): Adapt continuation
2914 message in instantiations and inlined bodies for info messages.
2916 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2918 * fname.adb (Has_Internal_Extension): Add pragma Inline.
2919 Use direct 4-character slice comparisons.
2921 pragma Inline. (Has_Suffix): Delete.
2922 (Is_Internal_File_Name):
2923 Test Is_Predefined_File_Name first.
2924 (Is_Predefined_File_Name):
2925 Use direct slice comparisons as much as possible and limit all
2926 comparisons to at most 8 characters.
2928 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2930 * checks.adb (Insert_Valid_Check): Code cleanup.
2931 * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
2932 (Expand_Actuals): Generate proper copy-back for a validation
2933 variable when it acts as the argument of a type conversion.
2934 * sem_util.adb (Is_Validation_Variable_Reference): Augment the
2935 predicate to operate on type qualifications.
2937 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2939 * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
2942 2017-04-25 Bob Duff <duff@adacore.com>
2944 * sem_prag.adb (No_Return): Give an error if the pragma applies
2945 to a body. Specialize the error for the specless body case,
2946 as is done for (e.g.) pragma Convention.
2947 * debug.adb: Add switch -gnatd.J to disable the above legality
2948 checks. This is mainly for use in our test suite, to avoid
2949 rewriting a lot of illegal (but working) code. It might also
2950 be useful to customers. Under this switch, if a pragma No_Return
2951 applies to a body, and the procedure raises an exception (as it
2952 should), the pragma has no effect. If the procedure does return,
2953 execution is erroneous.
2955 2017-04-25 Bob Duff <duff@adacore.com>
2957 * exp_ch6.adb (Expand_Actuals): This is the
2958 root of the problem. It took N as an 'in out' parameter, and in
2959 some cases, rewrote N, but then set N to Original_Node(N). So
2960 the node returned in N had no Parent. The caller continued
2961 processing of this orphaned node. In some cases that caused a
2962 crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
2963 and trips over the Empty Parent). The solution is to make N an
2964 'in' parameter. Instead of rewriting it, return the list of
2965 post-call actions, so the caller can do the rewriting later,
2966 after N has been fully processed.
2967 (Expand_Call_Helper): Move most of Expand_Call here. It has
2968 too many premature 'return' statements, and we want to do the
2969 rewriting on return.
2970 (Insert_Post_Call_Actions): New procedure to insert the post-call
2971 actions in the appropriate place. In the problematic case,
2972 that involves rewriting N as an Expression_With_Actions.
2973 (Expand_Call): Call the new procedures Expand_Call_Helper and
2974 Insert_Post_Call_Actions.
2976 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2978 * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
2979 properly type derived from generic formal types, to handle
2980 properly modified version of ACATS 4.1B B611017.
2982 2017-04-25 Javier Miranda <miranda@adacore.com>
2984 * exp_unst.adb (Subp_Index): Adding missing
2985 support for renamings and functions that return a constrained
2986 array type (i.e. functions for which the frontend built a
2987 procedure with an extra out parameter).
2989 2017-04-25 Pascal Obry <obry@adacore.com>
2991 * s-string.adb: Minor code clean-up.
2993 2017-04-25 Bob Duff <duff@adacore.com>
2995 * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
2997 * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
2998 function for Non_Blocking_Wait_Process.
3000 2017-04-25 Bob Duff <duff@adacore.com>
3002 * prep.adb (Preprocess): Remove incorrect
3003 Assert. Current character can be ASCII.CR.
3005 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3007 * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
3008 convention Stdcall, which has a number of exceptions. Convention
3009 is legal on a component declaration whose type is an anonymous
3010 access to subprogram.
3012 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3014 * sem_ch4.adb: sem_ch4.adb Various reformattings.
3015 (Try_One_Prefix_Interpretation): Use the base type when dealing
3016 with a subtype created for purposes of constraining a private
3017 type with discriminants.
3019 2017-04-25 Javier Miranda <miranda@adacore.com>
3021 * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
3022 * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
3023 dispatching primitives (Restore_Warnings): Restore warning on
3024 late dispatching primitives (Save_Warnings): Save warning on late
3025 dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
3026 to enable/disable this warning.
3027 (WA_Warnings): Set warning on late dispatching primitives.
3028 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
3029 that its parent type has a private extension.
3030 * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
3032 * usage.adb: Document -gnatw.j and -gnatw.J.
3034 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3036 * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
3039 2017-04-25 Bob Duff <duff@adacore.com>
3041 * binde.adb (Validate): Do not pass dynamic strings
3042 to pragma Assert, because older compilers do not support that.
3044 2017-04-25 Bob Duff <duff@adacore.com>
3046 * s-fileio.adb (Close): When a temp file is
3047 closed, delete it and clean up its Temp_File_Record immediately,
3048 rather than waiting until later.
3049 (Temp_File_Record): Add File
3050 component, so Close can know which Temp_File_Record corresponds
3051 to the file being closed.
3052 (Delete): Don't delete temp files,
3053 because they are deleted by Close.
3054 (Open): Set the File component
3055 of Temp_File_Record. This requires moving the creation of the
3056 Temp_File_Record to the end, after the AFCB has been created.
3058 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3060 * checks.adb (Insert_Valid_Check): Do not generate
3061 a validity check when inside a generic.
3063 2017-04-25 Yannick Moy <moy@adacore.com>
3065 * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
3067 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3069 * snames.ads-tmpl (Snames): More names for detecting predefined
3070 potentially blocking subprograms.
3072 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3074 * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
3075 concerning inheritance of class-wide preconditions do not apply
3078 2017-04-25 Bob Duff <duff@adacore.com>
3080 * s-ficobl.ads: Minor comment fix.
3082 2017-04-25 Yannick Moy <moy@adacore.com>
3084 * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
3085 conversions from float to integer in GNATprove mode.
3086 (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
3087 to call Apply_Type_Conversion_Checks, so that range checks
3088 are properly positioned when needed on conversions, including
3089 when converting from float to integer. (Determine_Range): In
3090 GNATprove mode, take into account the possibility of conversion
3091 from float to integer.
3092 * sem_res.adb (Resolve_Type_Conversion): Only enforce range
3093 check on conversions from fixed-point to integer, not anymore
3094 on conversions from floating-point to integer, when in GNATprove
3097 2017-04-25 Yannick Moy <moy@adacore.com>
3099 * checks.adb (Determine_Range_R): Special case type conversions
3100 from integer to float in order to get bounds in that case too.
3101 * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
3102 mode, for computations involved in interval checking.
3104 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3106 * checks.adb (Insert_Valid_Check): Partially reimplement validity
3108 * einfo.adb Node36 is now used as Validated_Object.
3109 (Validated_Object): New routine.
3110 (Set_Validated_Object): New routine.
3111 (Write_Field36_Name): Add an entry for Validated_Object.
3112 * einfo.ads Add new attribute Validated_Object along with
3114 (Validated_Object): New routine along with pragma Inline.
3115 (Set_Validated_Object): New routine along with pragma Inline.
3116 * exp_attr.adb (Make_Range_Test): Add processing for validation
3117 variables to avoid extra reads and copies of the prefix.
3118 * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
3119 variables in order to reflect any changes done in the variable
3120 back into the original object.
3121 * sem_util.adb (Is_Validation_Variable_Reference): New routine.
3122 * sem_util.ads (Is_Validation_Variable_Reference): New routine.
3124 2017-04-25 Steve Baird <baird@adacore.com>
3126 * exp_ch7.adb (Build_Array_Deep_Procs,
3127 Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
3128 generate Finalize_Address routines for CodePeer.
3130 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3132 * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
3133 Analyze_Pre_Post_Condition, to implement the legality checks
3134 mandated by AI12-0131: Pre'Class shall not be specified for an
3135 overriding primitive subprogram of a tagged type T unless the
3136 Pre'Class aspect is specified for the corresponding primitive
3137 subprogram of some ancestor of T.
3139 2017-04-25 Bob Duff <duff@adacore.com>
3141 * sem_ch8.adb (Use_One_Type): If a use_type_clause
3142 is redundant, set its Used_Operations to empty. This is only
3143 necessary for use clauses that appear in the parent of a generic
3144 child unit, because those use clauses get reanalyzed when we
3145 instantiate the generic, and we don't want the Used_Operations
3146 carried over from the original context (where it was probably
3149 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3151 * exp_ch6.adb: Minor reformatting.
3153 2017-04-25 Bob Duff <duff@adacore.com>
3155 * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
3156 Use Source_Index (Current_Sem_Unit) to find the correct casing.
3157 * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
3158 (Current_Sem_Unit) to find the correct casing.
3159 * par.adb (Par): Null out Current_Source_File, to ensure that
3160 the above bugs won't rear their ugly heads again.
3162 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3164 * sem_ch8.adb (Find_Type): For an attribute reference
3165 'Class, if prefix type is synchronized and previous errors
3166 have suppressed the creation of the corresponding record type,
3167 create a spurious class-wide for the synchonized type itself,
3168 to catch other misuses of the attribute
3170 2017-04-25 Steve Baird <baird@adacore.com>
3172 * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
3173 is True, then don't generate the accessibility check for the
3174 tag of a tagged result.
3175 * exp_intr.adb (Expand_Dispatching_Constructor_Call):
3176 if CodePeer_Mode is True, then don't generate the
3177 tag checks for the result of call to an instance of
3178 Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
3179 descendant of" check and the accessibility check).
3181 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3183 * sem_ch13.adb: Code cleanups.
3184 * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
3185 * sem_ch8.ads: Minor comment fix.
3187 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3189 * exp_ch4.adb (Library_Level_Target): New function.
3190 (Expand_Concatenate): When optimization is enabled, also expand
3191 the operation out-of-line if the concatenation is present within
3192 the expression of the declaration of a library-level object and
3193 not only if it is the expression of the declaration.
3195 2017-04-25 Bob Duff <duff@adacore.com>
3197 * freeze.adb (Freeze_Object_Declaration): Do
3198 not Remove_Side_Effects if there is a pragma Linker_Section,
3199 because in that case we want static initialization in the
3200 appropriate section.
3202 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3204 * exp_dbug.adb: Minor rewording and reformatting.
3206 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3208 * sem_attr.adb (Statically_Denotes_Object): New predicate, to
3209 handle the proposed changes to rules concerning potentially
3210 unevaluated expressions, to include selected components that
3211 do not depend on discriminants, and indexed components with
3213 * sem_util.adb (Is_Potentially_Unevaluated): Add check for
3214 predicate in quantified expression, and fix bugs in the handling
3215 of case expressions and membership test.
3216 (Analyze_Attribute_Old_Result): use new predicate.
3217 (Analyze_Attribute, case Loop_Entry): ditto.
3219 2017-04-25 Bob Duff <duff@adacore.com>
3221 * s-secsta.adb (SS_Info): Add a comment
3222 explaining why we don't need to walk all the chunks in order to
3223 compute the total size.
3225 2017-04-25 Bob Duff <duff@adacore.com>
3227 * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
3228 of the global name buffer to 4*Max_Line_Length.
3230 2017-04-25 Javier Miranda <miranda@adacore.com>
3232 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
3233 renaming entity for debug information, mark the entity as needing debug
3234 info if it comes from sources.
3236 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3238 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
3239 restriction converning the use of 'Address where the prefix is
3240 of a controlled type.
3242 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
3244 * exp_dbug.adb: In Debug_Renaming_Declaration,
3245 skip slices that are made redundant by an indexed component
3247 * atree.h: New definition for Original_Node.
3249 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3251 * sem_prag.adb, sem_prag.ads: Minor reformatting.
3253 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3255 * sem_ch3.adb (Check_Entry_Contract): Call
3256 Preanalyze_Spec_Expression so that resolution takes place as well.
3257 * sem_util.adb (Check_Internal_Protected_Use): Reject properly
3258 internal calls that appear in preconditions of protected
3259 operations, in default values for same, and in contract guards
3260 for contract cases in SPARK.
3262 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3264 * a-numaux.ads: Fix description of a-numaux-darwin
3266 (Double): Define to Long_Float.
3267 * a-numaux-vxworks.ads (Double): Likewise.
3268 * a-numaux-darwin.ads
3270 * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
3271 * a-numaux-x86.ads: Fix package description.
3272 * a-numaux-x86.adb (Is_Nan): Minor tweak.
3273 (Reduce): Adjust and complete description. Call Is_Nan instead of
3274 testing manually. Use an integer temporary to hold rounded value.
3275 * a-numaux-darwin.adb (Reduce): Likewise.
3276 (Is_Nan): New function.
3278 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3280 * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
3281 on analysis of prefix whose type is a current instance of a
3282 synchronized type, but where the prefix itself is an entity that
3285 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3287 * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
3288 the identity of callable entities therein, because they have been
3289 properly resolved, and prefixed calls may have been rewritten
3292 2017-04-25 Patrick Bernardi <bernardi@adacore.com>
3294 * exp_ch3.adb (Build_Init_Statements): Convert
3295 the expression of the pragma/aspect Secondary_Stack_Size to
3296 internal type System.Parameters.Size_Type before assigning
3297 it to the Secondary_Stack_Size component of the task type's
3298 corresponding record.
3300 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3302 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
3303 (etc) optimizations when the type is modular and the offsets
3306 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3308 * s-osinte-freebsd.ads: Minor comment tweaks
3310 2017-04-25 Javier Miranda <miranda@adacore.com>
3312 * urealp.adb (UR_Write): Reverse previous patch
3313 adding documentation on why we generate multiplications instead
3314 of divisions (needed to avoid expressions whose computation with
3315 large numbers may cause division by 0).
3317 2017-04-25 Bob Duff <duff@adacore.com>
3319 * erroutc.adb (Set_Specific_Warning_Off,
3320 Set_Warnings_Mode_Off): Use the correct source file for
3321 Stop. Was using Current_Source_File, which is only valid during
3322 parsing. Current_Source_File will have a leftover value from
3323 whatever file happened to be parsed last, because of a with_clause
3326 2017-04-25 Bob Duff <duff@adacore.com>
3328 * lib.ads, lib.adb (In_Internal_Unit): New functions similar
3329 to In_Predefined_Unit, but including GNAT units.
3330 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
3331 with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
3332 because Should_Ignore_Pragma was not working reliably outside
3333 the parser, because Current_Source_File is not valid.
3334 * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
3335 * par-prag.adb: Call Should_Ignore_Pragma_Par.
3337 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3339 * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
3342 2017-04-25 Javier Miranda <miranda@adacore.com>
3344 * urealp.adb (UR_Write): Fix output of constants with a base other
3347 2017-04-25 Justin Squirek <squirek@adacore.com>
3349 * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
3350 * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
3351 Add extra parameter for Process_Interface_Name.
3352 (Process_Interface_Name): Add parameter for pragma to analyze
3353 corresponding aspect.
3354 * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
3357 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3359 * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
3362 2017-04-25 Yannick Moy <moy@adacore.com>
3364 * sem_res.adb (Resolve_Comparison_Op): Do not
3365 attempt evaluation of relational operations inside assertions.
3367 2017-04-25 Justin Squirek <squirek@adacore.com>
3369 * exp_util.adb (Add_Interface_Invariants):
3370 Restored, code moved back from Build_Invariant_Procedure_Body.
3371 (Add_Parent_Invariants): Restored, code moved back from
3372 Build_Invariant_Procedure_Body.
3373 (Build_Invariant_Procedure_Body):
3374 Remove refactored calls and integrated code from
3375 Add_Parent_Invariants and Add_Interface_Invariants.
3377 2017-04-25 Johannes Kanig <kanig@adacore.com>
3379 * errout.adb (Output_Messages): Adjust computation of total
3381 * erroutc.adb (Error_Msg): In statistics counts, deal
3382 correctly with informational messages that are not warnings.
3383 * errutil.adb (Finalize): adjust computation of total errors.
3385 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3387 * terminals.c (__gnat_terminate_pid): New.
3388 * g-exptty.ads (Terminate_Process): New. Update comments.
3390 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3392 * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
3394 2017-04-25 Justin Squirek <squirek@adacore.com>
3396 * sem_ch3.adb (Analyze_Declarations): Minor
3397 correction to comments, move out large conditional and scope
3398 traversal into a predicate.
3399 (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
3402 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3404 * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
3405 of prefix whose type is a current instance of a synchronized
3406 type. If the prefix is an object this is an external call (or
3407 requeue) that can only access public operations of the object. The
3408 previous predicate was too restrictive, and did not allow public
3409 protected operations, only task entries.
3411 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3413 * sem_ch5.adb, fname.adb: Minor reformatting.
3415 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3417 * einfo.adb (Is_Anonymous_Access_Type): New routine.
3418 * einfo.ads Update the placement of
3419 E_Anonymous_Access_Subprogram_Type along with all subtypes that
3421 (Is_Anonymous_Access_Type): New routine.
3422 * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
3423 master for an access type subject to pragma No_Heap_Finalization.
3424 * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
3425 allocated or deallocated does not finalization actions if the
3426 associated access type is subject to pragma No_Heap_Finalization.
3427 * opt.ads Add new global variable No_Heap_Finalization_Pragma.
3428 * par-prag.adb Pragma No_Heap_Finalization does not need special
3429 processing from the parser.
3430 * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
3431 ??? comments. Use the new predicate Is_Anonymous_Access_Type.
3432 * sem_prag.adb Add an entry in table Sig_Flags for pragma
3433 No_Heap_Finalization.
3434 (Analyze_Pragma): Add processing for
3435 pragma No_Heap_Finalization. Update various error messages to
3436 use Duplication_Error.
3437 * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
3438 * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
3439 and corresponding pragma id.
3441 2017-04-25 Bob Duff <duff@adacore.com>
3443 * freeze.adb (Freeze_Record_Type): Use the
3444 underlying type of the component type to determine whether it's
3445 elementary. For representation clause purposes, a private type
3446 should behave the same as its full type.
3447 * fname.ads, fname.adb (Is_Predefined_File_Name):
3448 Make sure things like "system.ali" are recognized as predefined.
3450 2017-04-25 Javier Miranda <miranda@adacore.com>
3452 * debug.adb: Update documentation of -gnatd.6.
3454 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3456 * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
3457 element iterator when the name is an overloaded function call,
3458 one of whose interpretations yields an array.
3460 2017-04-25 Bob Duff <duff@adacore.com>
3462 * uname.ads, uname.adb (Is_Predefined_Unit_Name,
3463 Is_Internal_Unit_Name): New functions for operating on unit
3464 names, as opposed to file names. There's some duplicated code
3465 with fname.adb, which is unfortunate, but it seems like we don't
3466 want to add dependencies here.
3467 * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
3468 to Is_Predefined_Unit_Name; the former was wrong, because Uname
3469 is not a file name at all.
3470 * fname.ads, fname.adb: Document the fact that
3471 Is_Predefined_File_Name and Is_Internal_File_Name can be called
3472 for ALI files, and fix the code so it works properly for ALI
3473 files. E.g. these should return True for "system.ali".
3475 2017-04-25 Justin Squirek <squirek@adacore.com>
3477 * exp_util.adb (Add_Invariant): Removed,
3478 code moved to Add_Invariant_Check, Add_Inherited_Invariant,
3479 and Add_Own_Invariant. (Add_Invariant_Check): Used
3480 for adding runtime checks from any kind of invariant.
3481 (Add_Inherited_Invariant): Generates invariant checks for
3482 class-wide invariants (Add_Interface_Invariants): Removed, code
3483 moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
3484 Create a types own invariant procedure (Add_Parent_Invariants):
3485 Removed, code moved to Build_Invariant_Procedure_Body
3486 (Build_Invariant_Procedure_Body): Add refactored calls
3487 and integrated code from Add_Parent_Invariants and
3488 Add_Interface_Invariants.
3489 (Process_Type): Removed, the
3490 relavant code was inlined into both Add_Own_Invariant and
3491 Add_Inherited_Invariant.
3493 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3495 * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
3496 scn.adb, osint.adb, fname.adb: Minor reformatting.
3498 2017-04-25 Pascal Obry <obry@adacore.com>
3500 * s-taprop-mingw.adb: Do not check for CloseHandle in
3503 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3505 * sem_util.adb (Check_Part_Of_Reference):
3506 Continue to examine the context if the reference appears within
3507 an expression function.
3509 2017-04-25 Justin Squirek <squirek@adacore.com>
3511 * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
3512 and Build_Invariant_Procedure_Declaration.
3513 * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
3514 and Build_Invariant_Procedure_Declaration from exp_ch7
3515 and break-out Is_Untagged_Private_Derivation from
3516 Build_Invariant_Procedure_Body.
3517 (Replace_Type_References):
3518 Append an extra parameter to allow for dispatching replacements
3519 and add the corrasponding logic.
3520 (Type_Invariant): Remove
3521 Replace_Typ_Refs and replace its references with calls to
3522 Replace_Type_References.
3523 * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
3525 2017-04-25 Bob Duff <duff@adacore.com>
3527 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
3528 that returns True when appropriate.
3529 * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
3530 when compiling predefined files.
3531 * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
3532 "gnat.adc" should not be considered a predefined file name.
3533 That required (or at least encouraged) a lot of cleanup of global
3534 variable usage. We shouldn't be communicating information via
3535 the global name buffer.
3536 * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
3537 * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
3538 required by the above-mentioned cleanup.
3540 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3542 * osint.adb (Find_File): Handle properly a request for a
3543 configuration file whose name is a directory.
3545 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3547 * sem_attr.adb, sem_ch5.adb: Minor reformatting.
3549 2017-04-25 Bob Duff <duff@adacore.com>
3551 * types.ads: Minor: Fix '???' comment.
3552 * sem_ch8.adb: Minor comment fix.
3554 2017-04-25 Bob Duff <duff@adacore.com>
3556 * sem_prag.adb: Remove suspicious uses of Name_Buf.
3557 * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
3558 Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
3559 Add String_To_Name with no side effects.
3561 2017-04-25 Justin Squirek <squirek@adacore.com>
3563 * sem_ch3.adb (Analyze_Declarations): Add
3564 additional condition for edge case.
3566 2017-04-25 Bob Duff <duff@adacore.com>
3568 * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
3569 reserved words inside pragmas. This is necessary to allow the
3570 pragma name Interface to be used in pragma Ignore_Pragma.
3571 * par.adb: Minor comment fix.
3573 2017-04-25 Javier Miranda <miranda@adacore.com>
3575 * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
3576 * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
3577 * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
3578 * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
3579 occurrences of RE_Type_Is_Abstract
3581 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3583 * exp_util.adb (Build_Chain): Account for ancestor
3584 subtypes while traversing the derivation chain.
3586 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3588 * sem_attr.adb: minor reformatting.
3590 2017-04-25 Doug Rupp <rupp@adacore.com>
3592 * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
3594 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3596 * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
3597 the first pass over an assignment statement with target names,
3598 to prevent the generation of subtypes (such as discriminated
3599 record components)that may carry the target name outside of the
3600 tree for the assignment. The subtypes will be generated when
3601 the assignment is reanalyzed in full.
3602 (Analyze_Target_Name): Handle properly class-wide types.
3604 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3606 * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
3607 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3608 the purposes of freezing.
3609 * exp_util.adb Update the documentation and structure of the
3610 type map used in class-wide semantics of assertion expressions.
3611 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3612 and resolve the triaged expression because all substitutions
3613 refer to the proper entities. Update the replacement of
3615 (Build_DIC_Procedure_Body): Add formal parameter
3616 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3617 are now only processed when freezing occurs. Build a body only
3619 (Entity_Hash): Removed.
3620 (Map_Types): New routine.
3621 (Replace_Object_And_Primitive_References): Removed.
3622 (Replace_References): New routine.
3623 (Replace_Type_References): Moved to the library level of Exp_Util.
3624 (Type_Map_Hash): New routine.
3625 (Update_Primitives_Mapping): Update the mapping call.
3626 (Update_Primitives_Mapping_Of_Types): Removed.
3627 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3628 parameter For_Freeze and update the comment on usage.
3629 (Map_Types): New routine.
3630 (Replace_References): New routine.
3631 (Replace_Type_References): Moved to the library level of Exp_Util.
3632 (Update_Primitives_Mapping_Of_Types): Removed.
3633 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3634 properties of the private type to the full view in case the full
3635 view derives from a parent type and inherits a DIC pragma.
3636 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3637 DIC pragma is placed at the top of a declarative region.
3639 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3641 * a-tasatt.adb: Complete previous change and use an unsigned
3642 int to avoid overflow checks.
3644 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3646 * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
3647 the error message when the attribute reference is an actual in
3648 a call to a subprogram inherited from a generic formal type with
3649 unknown discriminants, which makes the subprogram and its formal
3650 parameters intrinsic (see RM 6.3.1 (8) and (13)).
3652 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3654 * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
3655 sem_prag.adb: Minor reformatting.
3657 2017-04-25 Bob Duff <duff@adacore.com>
3659 * sem_attr.adb (Type_Key): Add code in the
3660 recursive Compute_Type_Key to protect against fetching the source
3661 code for Standard, in case a component of the type is declared
3662 in Standard. There was already code to do this for the original
3663 type, but not for its components.
3665 2017-04-25 Javier Miranda <miranda@adacore.com>
3667 * exp_ch3.adb (Build_Initialization_Call): Handle
3668 subtypes of private types when searching for the underlying full
3669 view of a private type.
3671 2017-04-25 Javier Miranda <miranda@adacore.com>
3673 * sem_res.adb (Set_Mixed_Mode_Operand): A universal
3674 real conditional expression can appear in a fixed-type context
3675 and must be resolved with that context to facilitate the code
3676 generation to the backend.
3678 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3680 * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
3681 to indicate whether during inline processing, when some unit U1
3682 appears in the context of a unit U2 compiled for instantiation
3683 or inlining purposes, the body of U1 needs to be compiled as well.
3684 * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
3685 context is a package declaration.
3686 * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
3687 Analyze_Generic_Package_Declaration): ditto.
3688 * inline.adb (Analyze_Inlined_Bodies): Check
3689 Body_Needed_For_Inlining.
3691 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3693 * par.adb (Current_Assign_Node): Global variable use to record
3694 the presence of a target_name in the right hand side of the
3695 assignment being parsed.
3696 * par-ch4.adb (P_Name): If the name is a target_name, mark the
3697 enclosing assignment node accordingly.
3698 * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
3700 * sem_ch5.adb (Analyze_Assignment): Disable expansion before
3701 analyzing RHS if the statement has target_names.
3702 * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
3703 properly choices that are subtype marks.
3704 * exp_ch5.adb: Code cleanup.
3706 2017-04-25 Bob Duff <duff@adacore.com>
3708 * s-memory.adb: Add a comment regarding efficiency.
3709 * atree.adb: Fix the assertion, and combine 2 assertions into one,
3710 "the source has an extension if and only if the destination does."
3711 * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
3713 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3715 * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
3718 2017-04-25 Doug Rupp <rupp@adacore.com>
3720 * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
3721 handling for ppc64-vx7.
3722 * sigtramp-vxworks-target.inc
3723 [SIGTRAMP_BODY]: Add section for ppc64-vx7.
3725 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3727 * ada_get_targ.adb: New file.
3729 2017-04-25 Bob Duff <duff@adacore.com>
3731 * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
3732 Direct_Val (Right), instead of the incorrect Direct_Val (Left).
3733 (UI_GCD): Remove ??? comment involving possible efficiency
3734 improvements. This just isn't important after all these years.
3736 * uintp.ads: Minor cleanup.
3738 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3740 * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
3741 Revert previous changes.
3742 * scng.adb: Minor reformatting.
3743 * s-stratt.ads: Fix unbalanced parens in comment.
3745 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3747 * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
3750 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3752 * scng.adb (Scan): Handle '@' appropriately.
3753 * sem_ch5.adb: Code cleanup.
3755 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3757 * freeze.adb (Check_Expression_Function): Do not check for the
3758 use of deferred constants if the freezing of the expression
3759 function is triggered by its generated body, rather than a
3762 2017-04-25 Javier Miranda <miranda@adacore.com>
3764 * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
3765 subtypes of private types when performing the view conversion.
3767 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3769 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3770 the purposes of freezing.
3771 * exp_util.adb Update the documentation and structure of the
3772 type map used in class-wide semantics of assertion expressions.
3773 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3774 and resolve the triaged expression because all substitutions
3775 refer to the proper entities. Update the replacement of
3777 (Build_DIC_Procedure_Body): Add formal parameter
3778 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3779 are now only processed when freezing occurs. Build a body only
3781 (Entity_Hash): Removed.
3782 (Map_Types): New routine.
3783 (Replace_Object_And_Primitive_References): Removed.
3784 (Replace_References): New routine.
3785 (Replace_Type_References): Moved to the library level of Exp_Util.
3786 (Type_Map_Hash): New routine.
3787 (Update_Primitives_Mapping): Update the mapping call.
3788 (Update_Primitives_Mapping_Of_Types): Removed.
3789 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3790 parameter For_Freeze and update the comment on usage.
3791 (Map_Types): New routine.
3792 (Replace_References): New routine.
3793 (Replace_Type_References): Moved to the library level of Exp_Util.
3794 (Update_Primitives_Mapping_Of_Types): Removed.
3795 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3796 properties of the private type to the full view in case the full
3797 view derives from a parent type and inherits a DIC pragma.
3798 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3799 DIC pragma is placed at the top of a declarative region.
3801 2017-04-25 Tristan Gingold <gingold@adacore.com>
3803 * s-mmap.ads (Data): Add pragma Inline.
3805 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3807 * checks.adb (Insert_Valid_Check): Do not use
3808 a renaming to alias a volatile name because this will lead to
3809 multiple evaluations of the volatile name. Use a constant to
3810 capture the value instead.
3812 2017-04-25 Doug Rupp <rupp@adacore.com>
3814 * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
3816 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3818 * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
3819 Add out parameter to indicate to caller that a wrapper must
3820 be constructed for an inherited primitive whose inherited
3821 pre/postcondition has called to overridden primitives.
3822 * freeze.adb (Check_Inherited_Conditions): Build wrapper body
3823 for inherited primitive that requires it.
3824 * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
3825 legal primitive operations and belong to the list of bodies
3826 generated after the freeze point of a type.
3827 * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
3828 of Build_Class_Wide_Expression.
3829 * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
3830 to construct the specification of the wrapper subprogram created
3831 for an inherited operation.
3833 2017-04-25 Bob Duff <duff@adacore.com>
3835 * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
3836 pthread_mutexattr_setprioceiling): Add new interfaces for these
3838 * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
3839 protocols as appropriate for Locking_Policy 'C' and 'I'.
3840 * s-taprop-posix.adb: Minor reformatting to make it more similar
3841 to s-taprop-linux.adb.
3843 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3845 * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
3846 Handle properly a multi- level derivation involving both renamed
3847 and constrained parent discriminants, when the type to be
3848 constrained has fewer discriminants that the ultimate ancestor.
3850 2017-04-25 Bob Duff <duff@adacore.com>
3852 * sem_util.adb (Is_Object_Reference): In the
3853 case of N_Explicit_Dereference, return False if it came from a
3854 conditional expression.
3856 2017-04-25 Bob Duff <duff@adacore.com>
3858 * par-ch4.adb (P_Case_Expression): If a semicolon
3859 is followed by "when", assume that ";" was meant to be ",".
3861 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3863 * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
3866 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3868 * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
3869 loading of an entity.
3870 * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
3871 previously repeated in the analysis.
3872 * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
3873 procedure SPARK_Implicit_Load. (Analyze_Task_Type_Declaration):
3874 use new procedure SPARK_Implicit_Load.
3875 * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
3876 SPARK_Implicit_Load.
3878 2017-04-25 Javier Miranda <miranda@adacore.com>
3880 * sem_util.adb (New_Copy_Tree): By default
3881 copying of defining identifiers is prohibited because
3882 this would introduce an entirely new entity into the
3883 tree. This patch introduces an exception to this general
3884 rule: the declaration of constants and variables located in
3885 Expression_With_Action nodes.
3886 (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
3887 (In_Map): New subprogram.
3888 (Visit_Entity): New subprogram.
3889 (Visit_Node): Handle EWA_Level,
3890 EWA_Inner_Scope_Level, and take care of defining entities defined
3891 in Expression_With_Action nodes.
3893 2017-04-25 Thomas Quinot <quinot@adacore.com>
3895 * exp_ch6.adb: minor comment edit.
3896 * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
3897 procedure specifications that come from source.
3898 * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
3899 Null_Statement attribute.
3900 * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
3901 procedure, generate statement SCO for the generated NULL statement.
3902 * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
3903 parser, if available.
3905 2017-04-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3907 * system-linux-s390.ads: Use Long_Integer'Size to define
3910 2017-04-04 Eric Botcazou <ebotcazou@adacore.com>
3912 * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
3914 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3916 * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
3917 * g-socket.adb (To_Host_Entry): Fix typo in comment.
3918 * gnat_ugn.texi: Fix typo.
3919 * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
3920 * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
3921 * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
3922 * sem_util.adb (Mark_Coextensions): Likewise.
3923 * sem_util.ads (Available_Full_View_Of_Component): Likewise.
3925 2017-03-28 Andreas Schwab <schwab@suse.de>
3928 * system-linux-aarch64-ilp32.ads: New file.
3929 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
3930 from LIBGNAT_TARGET_PAIRS.
3931 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
3932 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
3933 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
3934 or -mabi=ilp32, resp.
3936 2017-03-14 James Cowgill <James.Cowgill@imgtec.com>
3938 * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
3940 2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
3943 * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
3945 2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
3948 * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
3950 * system-linux-arm.ads (Default_Bit_Order): Likewise.
3951 * system-linux-mips.ads (Default_Bit_Order): Likewise.
3952 * system-linux-armeb.ads: Delete.
3953 * system-linux-mipsel.ads: Likewise.
3954 * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
3955 (ARM/Linux): Likewise.
3957 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3960 * gcc-interface/misc.c (gnat_handle_option): Pass true to
3961 handle_generated_option GENERATED_P.
3963 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3965 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
3966 around a justified modular type if it doesn't have the same scalar
3967 storage order as the enclosing record type.
3969 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3971 * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
3972 of boolean rvalues to function calls.
3974 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3976 * gcc-interface/utils.c (fold_bit_position): New function.
3977 (rest_of_record_type_compilation): Call it instead of bit_position to
3978 compute the field position and remove the call to remove_conversions.
3979 (compute_related_constant): Factor out the multiplication in both
3980 operands, if any, and streamline the final test.
3982 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3984 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
3986 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3988 * gcc-interface/decl.c: Include demangle.h.
3989 (is_cplusplus_method): Return again true for a primitive operation
3990 only if it is dispatching. For a subprogram with an interface name,
3991 call the demangler to get the number of C++ parameters and compare it
3992 with the number of Ada parameters.
3994 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3996 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
3997 there is no end label, put the location of the At_End procedure on
3998 the call to the procedure.
4000 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
4002 * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
4003 value for array types with TYPE_INDEX_TYPE set on their domain type.
4004 * gcc-interface/utils.c (max_size): For operations and expressions, do
4005 not build a new node if the operands have not changed or are missing.
4007 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
4009 * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
4010 argument when recursing on TRUTH_NOT_EXPR.
4012 2017-02-12 John Marino <gnugcc@marino.st>
4014 * system-freebsd-x86.ads: Rename into...
4015 * system-freebsd.ads: ...this.
4016 (Default_Bit_Order): Define using Standard'Default_Bit_Order.
4017 * gcc-interface/Makefile.in: Support aarch64-freebsd.
4018 (x86-64/FreeBSD): Adjust to above renaming.
4019 (i386/FreeBSD): Likewise.
4021 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
4023 * comperr.adb: Update FSF bug reporting URL.
4025 2017-02-01 Eric Botcazou <ebotcazou@adacore.com>
4026 Jakub Jelinek <jakub@redhat.com>
4029 * adaint.c (__gnat_killprocesstree): Fix broken string handling.
4031 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
4034 * gcc-interface/utils.c (get_global_context): Pass main_input_filename
4035 to build_translation_unit_decl.
4037 2017-01-23 Javier Miranda <miranda@adacore.com>
4039 * sem_util.adb (New_Copy_Tree): Code cleanup:
4040 removal of the internal map (ie. variable Actual_Map, its
4041 associated local variables, and all the code handling it).
4042 * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
4043 force loading of the System package when processing a task type.
4044 (Analyze_Protected_Type_Declaration): in GNATprove mode force
4045 loading of the System package when processing a protected type.
4046 * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
4047 force loading of the System package when processing compilation
4048 unit with a main-like subprogram.
4049 * frontend.adb (Frontend): remove forced loading of the System
4052 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4054 * sem_prag.adb (Default_Initial_Condition): If the desired type
4055 declaration is a derived type declaration with discriminants,
4056 it is rewritten as a private type declaration.
4057 * sem_ch13.adb (Replace_Type_References_Generic,
4058 Visible_Component): A discriminated private type with descriminnts
4059 has components that must be rewritten as selected components
4060 if they appear as identifiers in an aspect expression such as
4061 a Default_Initial_Condition.
4062 * sem_util.adb (Defining_Entity): support N_Iterator_Specification
4065 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4067 * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
4068 * gnat1drv.adb Generate an empty object file for an ignored
4069 Ghost compilation unit.
4070 * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
4072 2017-01-23 Yannick Moy <moy@adacore.com>
4074 * sem_ch4.adb (Analyze_Indexed_Component_Form):
4075 Adapt to inlined prefix with string literal subtype.
4076 * inline.adb (Expand_Inlined_Call): Keep unchecked
4077 conversion inside inlined call when formal type is constrained.
4079 2017-01-23 Javier Miranda <miranda@adacore.com>
4081 * sem_util.adb (New_Copy_Tree): Code cleanup:
4082 removal of global variables. All the global variables, global
4083 functions and tables of this subprogram are now declared locally.
4085 2017-01-23 Gary Dismukes <dismukes@adacore.com>
4087 * exp_strm.ads: Minor reformatting and typo fixes.
4089 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4091 * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
4092 exp_aggr.adb: Minor reformatting.
4093 * g-diopit.adb: minor grammar/punctuation fix in comment.
4094 * g-byorma.ads: minor fix of unbalanced parens in comment.
4096 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4098 * par.adb: Update the documentation of component Labl.
4099 * par-ch6.adb (P_Return_Statement): Set the expected label of
4100 an extended return statement to Error.
4102 2017-01-23 Tristan Gingold <gingold@adacore.com>
4104 * s-boustr.ads, s-boustr.adb (Is_Full): New function.
4106 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4108 * expander.adb: Handle N_Delta_Aggregate.
4110 2017-01-23 Javier Miranda <miranda@adacore.com>
4112 * exp_ch6.adb (Expand_Call): Improve the code that
4113 checks if some formal of the called subprogram is a class-wide
4114 interface, to handle subtypes of class-wide interfaces.
4116 2017-01-23 Javier Miranda <miranda@adacore.com>
4118 * checks.adb (Apply_Parameter_Aliasing_Checks):
4119 Remove side effects of the actuals before generating the overlap
4122 2017-01-23 Justin Squirek <squirek@adacore.com>
4124 * exp_strm.ads, exp_strm.ads
4125 (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
4126 as to avoid getting the underlying type by default.
4127 * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
4128 underlying type in the Iiput and output attribute cases when
4129 building their respective functions.
4131 2017-01-23 Gary Dismukes <dismukes@adacore.com>
4133 * scng.adb: Minor reformatting of error message.
4135 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4137 * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
4138 to freeze the return type of an expression funxtion that is a
4139 completion, if the type is a limited view and the non-limited
4142 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4144 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
4145 aggregate construct.
4146 (P_Record_Or_Array_Component_Association): An array aggregate
4147 can start with an Iterated_Component_Association.
4148 * scng.adb: Modify error message on improper use of @ in earlier
4149 versions of the language.
4150 * sinfo.ads: New node kind N_Delta_Aggregate.
4151 * sinfo.adb: An N_Delta_Aggregate has component associations and
4153 * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
4154 * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
4155 Create a new index for each one of the choices in the association,
4156 to prevent spurious homonyms in the scope.
4157 (Resolve_Delta_Aggregate): New.
4158 * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
4159 * exp_util.adb (Insert_Actions): Take into account
4161 * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
4162 * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
4163 and local procedures Expand_Delta_Array_Aggregate and
4164 expand_Delta_Record_Aggregate.
4165 * sprint.adb: Handle N_Delta_Aggregate.
4167 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4169 * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
4170 empty name when the exception declaration is subject to pragma
4172 (Null_String): New routine.
4174 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4176 * par-ch9.adb (P_Protected_Definition): Parse
4177 any optional and potentially illegal pragmas which appear in
4178 a protected operation declaration list.
4179 (P_Task_Items): Parse
4180 any optional and potentially illegal pragmas which appear in a
4183 2017-01-23 Pascal Obry <obry@adacore.com>
4185 * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
4186 is needed when a foreign thread call a Win32 API using a thread handle
4187 like GetThreadTimes() for example.
4189 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4191 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4192 allow an 'Address clause to be specified on a prefix of a
4195 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4197 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4198 attribute 'Valid is a renaming of the original expression when
4199 the expression denotes a name. For all other kinds of expression,
4200 use a constant to capture the value.
4201 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4202 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4204 2017-01-23 Justin Squirek <squirek@adacore.com>
4206 * sem_eval.adb (Eval_Integer_Literal): Add special
4207 case to avoid optimizing out check if the literal appears in
4210 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4212 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4213 allow an 'Address clause to be specified on a prefix of a
4216 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4218 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4219 attribute 'Valid is a renaming of the original expression when
4220 the expression denotes a name. For all other kinds of expression,
4221 use a constant to capture the value.
4222 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4223 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4225 2017-01-23 Justin Squirek <squirek@adacore.com>
4227 * sem_eval.adb (Eval_Integer_Literal): Add special
4228 case to avoid optimizing out check if the literal appears in
4231 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4233 * sem_ch4.adb (Try_Primitive_Operations,
4234 Is_Valid_First_Argument_Of): argument is valid if it is a derived
4235 type with unknown discriminants that matches its underlying
4237 * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
4238 expression if its type is derived from a limited type with
4239 unknown discriminants, because the expansion (which is a call)
4240 must be expanded in the enclosing context to add the proper build-
4241 in-place parameters to the call.
4242 * lib.ads, exp_ch9.adb: Minor fixes in comments.
4244 2017-01-23 Yannick Moy <moy@adacore.com>
4246 * frontend.adb (Frontend): Do not load runtime
4247 unit for GNATprove when parsing failed.
4248 * exp_ch9.adb: minor removal of extra whitespace
4249 * exp_ch6.adb: minor typo in comment
4250 * sem_util.adb: Code cleanup.
4251 * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
4252 * a-ngcefu.adb: minor style fix in whitespace
4254 2017-01-23 Thomas Quinot <quinot@adacore.com>
4256 * scos.ads: Document usage of 'd' as default SCO kind for
4258 * par_sco.adb (Traverse_Declarations_Or_Statements.
4259 Traverse_Degenerate_Subprogram): New supporting routine for expression
4260 functions and null procedures.
4261 (Traverse_Declarations_Or_Statements.Traverse_One): Add
4262 N_Expression_Function to the subprogram case; add required
4263 support for null procedures and expression functions.
4265 2017-01-23 Bob Duff <duff@adacore.com>
4267 * namet.ads (Bounded_String): Decrease the size of type
4268 Bounded_String to avoid running out of stack space.
4269 * namet.ads (Append): Don't ignore buffer overflow; raise
4270 Program_Error instead.
4272 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4274 * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
4275 sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
4277 * exp_ch9.adb: minor style fix in comment.
4279 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4281 * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
4282 for a limited record extension with unknown discriminants whose
4283 full view has no discriminants.
4285 2017-01-23 Yannick Moy <moy@adacore.com>
4287 * exp_spark.adb: Alphabetize with clauses.
4289 2017-01-23 Yannick Moy <moy@adacore.com>
4291 * sem_util.adb (Has_Enabled_Property): Treat
4292 protected objects and variables differently from other variables.
4294 2017-01-23 Thomas Quinot <quinot@adacore.com>
4296 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
4297 Split original Ada 95 part off into new subprogram
4298 below. Call that subprogram (instead of proceeding with
4299 AI95-0133 behaviour) if debug switch -gnatd.p is in use.
4300 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
4301 * debug.adb Document new switch -gnatd.p
4302 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
4303 record for reverse bit order if an error has already been posted
4304 on the record type. This avoids generating extraneous "info:"
4305 messages for illegal code.
4307 2017-01-23 Justin Squirek <squirek@adacore.com>
4309 * sem_ch3.adb (Analyze_Declarations): Correct comments
4310 * freeze.adb (Find_Constant): Add detection of deferred constants
4311 so they are not incorrectly flagged as premature.
4313 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4315 * scans.ads: New token At_Sign. Remove '@' from list of illegal
4316 characters for future version of the language. '@' is legal name.
4317 * scng.ads, scng.adb (Scan): Handle '@' appropriately.
4318 * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
4319 denotes a Target_Name.
4320 * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
4321 * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
4322 (Has_Target_Names): New flag on N_Assignment_Statement, to
4323 indicate that RHS has occurrences of N_Target_Name.
4324 * sem.adb: Call Analyze_Target_Name.
4325 * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
4326 (urrent_LHS): Global variable that denotes LHS of assignment,
4327 used in the analysis of Target_Name nodes.
4328 * sem_res.adb (Resolve_Target_Name): New procedure.
4329 * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
4330 N is an assignment statement whose RHS contains occurences of @
4331 that designate the value of the LHS of the assignment. If the
4332 LHS is side-effect free the target names can be replaced with
4333 a copy of the LHS; otherwise the semantics of the assignment
4334 is described in terms of a procedure with an in-out parameter,
4335 and expanded as such.
4336 (Expand_N_Assignment_Statement): Call
4337 Expand_Assign_With_Target_Names when needed.
4338 * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
4339 * sprint.adb: Handle N_Target_Name.
4341 2017-01-23 Eric Botcazou <ebotcazou@adacore.com>
4343 * checks.adb: Minor fix in comment.
4345 2017-01-23 Philippe Gil <gil@adacore.com>
4347 * g-debpoo.adb (Do_Report) remove freed chunks from chunks
4348 count in Sort = Memory_Usage or Allocations_Count
4350 2017-01-23 Justin Squirek <squirek@adacore.com>
4352 * sem_ch3.adb: Code cleanup.
4354 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4356 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
4357 variables to the local variable section. Update the profile
4358 of various nested routine that previously had visibility
4359 of those globals. One the matching phase has completed,
4360 remove certain classes of clauses which are considered noise.
4361 (Check_Dependency_Clause): Properly detect a match between two
4362 'Result attributes. Update the various post-match cases to use
4363 Is_Already_Matched as this routine now automatically recognizes
4364 a previously matched 'Result attribute.
4365 (Is_Already_Matched): New routine.
4366 (Remove_Extra_Clauses): New routine.
4367 (Report_Extra_Clauses): Remove the detection of ... => null
4368 clauses as this is now done in Remove_Extra_Clauses.
4370 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4372 * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
4373 report on spurious overlaps between values involving a subtype
4374 with a static predicate, because the expansion of such a subtype
4375 into individual ranges in inhibited in ASIS mode.
4377 2017-01-23 Justin Squirek <squirek@adacore.com>
4379 * sem_ch3.adb (Analyze_Declarations): Add detection
4380 of an edge case and delay freezing if it is present.
4382 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4384 * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
4385 sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
4387 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4389 * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
4390 access-to-subprogram types inherit the convention of the
4391 associated subprogram. (Set_Profile_Convention): New routine.
4392 * sem_ch6.adb (Check_Conformance): Do not compare the conventions
4393 of the two entities directly, use Conventions_Match to account
4394 for anonymous access-to-subprogram and subprogram types.
4395 (Conventions_Match): New routine.
4397 2017-01-23 Claire Dross <dross@adacore.com>
4399 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
4400 which return Universal_Integer, force the overflow check flag for
4401 Length and Range_Length for types as big as Long_Long_Integer.
4403 2017-01-23 Claire Dross <dross@adacore.com>
4405 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For
4406 attributes which return Universal_Integer, introduce a conversion
4407 to the expected type with the appropriate check flags set.
4408 * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
4409 base type if the range is null. It may still be invalid if it
4410 is higher than the lower bound. This is checked later in the
4411 context in which the range appears.
4413 2017-01-23 Pierre-Marie de Rodat <derodat@adacore.com>
4415 * scos.ads: Introduce a constant to represent ignored
4416 dependencies in SCO_Unit_Table_Entry.
4418 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4420 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
4421 spaces from error messages.
4423 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4425 * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
4426 subsidiary to Expand_N_Object_ Declaration, to compute a guard on
4427 an object declaration for an array type with a modular index type
4428 with the size of Long_Long_Integer. Special processing is needed
4429 in this case to compute reliably the size of the object, and
4430 eventually to raise Storage_Error, when wrap-around arithmetic
4431 might compute a meangingless size for the object.
4433 2017-01-23 Justin Squirek <squirek@adacore.com>
4435 * a-wtenau.adb, par-endh.adb, sem_prag.adb,
4436 sem_type.adb: Code cleanups.
4438 2017-01-23 Bob Duff <duff@adacore.com>
4440 * sem_res.adb (Resolve_Call): In the part of the code where
4441 it is deciding whether to turn the call into an indexed
4442 component, avoid doing so if the call is to an instance of
4443 Unchecked_Conversion. Otherwise, the compiler turns it into an
4444 indexed component, and resolution of that turns it back into a
4445 function call, and so on, resulting in infinite recursion.
4446 * sem_util.adb (Needs_One_Actual): If the first formal has a
4447 default, then return False.
4449 2017-01-21 Eric Botcazou <ebotcazou@adacore.com>
4451 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
4452 optimizations when the type is modular and the offsets are equal.
4454 2017-01-20 Thomas Quinot <quinot@adacore.com>
4456 * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
4459 2017-01-20 Nicolas Roche <roche@adacore.com>
4461 * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
4463 2017-01-20 Bob Duff <duff@adacore.com>
4465 * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
4466 (etc) optimizations when the type is modular.
4468 2017-01-20 Yannick Moy <moy@adacore.com>
4470 * sem_ch6.adb (Move_Pragmas): move some pragmas,
4471 but copy the SPARK_Mode pragma instead of moving it.
4472 (Build_Subprogram_Declaration): Ensure that the generated spec
4473 and original body share the same SPARK_Pragma aspect/pragma.
4474 * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
4475 procedure to copy SPARK_Mode aspect.
4477 2017-01-20 Bob Duff <duff@adacore.com>
4479 * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
4481 * sem_ch13.adb (Resolve_Name): Enable setting the entity to
4482 Empty even in ASIS mode.
4484 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4486 * exp_ch9.adb: minor style fixes in comments.
4487 * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
4488 relative statement introduces an implicit dependency on
4489 Ada.Real_Time.Clock_Time.
4490 * sem_util.adb: Minor reformatting.
4492 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4494 * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
4495 must be treated as delayed aspect even if the expression is
4496 a literal, because the aspect affects the freezing and the
4497 elaboration of the object to which it applies.
4499 2017-01-20 Tristan Gingold <gingold@adacore.com>
4501 * s-osinte-vxworks.ads (Interrup_Range): New subtype.
4503 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4505 * lib-xref.adb (Generate_Reference): Do not warn about the
4506 presence of a pragma Unreferenced if the entity appears as the
4507 actual in a procedure call that does not come from source.
4509 2017-01-20 Pascal Obry <obry@adacore.com>
4511 * expect.c, terminals.c: Fix some warnings about unused variables.
4512 * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
4515 2017-01-20 Bob Duff <duff@adacore.com>
4517 * exp_attr.adb (Constrained): Apply an access check (check that
4518 the prefix is not null) when the prefix denotes an object of an
4519 access type; that is, when there is an implicit dereference.
4521 2017-01-20 Gary Dismukes <dismukes@adacore.com>
4523 * s-rident.ads (constant Profile_Info): Remove
4524 No_Calendar from GNAT_Extended_Ravenscar restrictions.
4526 2017-01-20 Tristan Gingold <gingold@adacore.com>
4528 * s-maccod.ads: Add pragma No_Elaboration_Code_All
4530 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4532 * ghost.adb (Mark_Ghost_Clause): New routine.
4533 (Prune_Node): Do not prune compilation unit nodes.
4534 (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
4535 This does not touch the node itself, but does prune all its fields.
4536 * ghost.ads (Mark_Ghost_Clause): New routine.
4537 * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
4538 package clause mentions Ghost and non-Ghost packages. Mark a
4539 use package clause as Ghost when it mentions a Ghost package.
4540 (Analyze_Use_Type): Emit an error when a use type clause mentions
4541 Ghost and non-Ghost types. Mark a use type clause as Ghost when
4542 it mentions a Ghost type.
4543 * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
4544 Ghost when it withs a Ghost unit.
4546 2017-01-20 Javier Miranda <miranda@adacore.com>
4548 * sem_res.adb (Resolve_Call): If a function call
4549 returns a limited view of a type and at the point of the call the
4550 function is not declared in the extended main unit then replace
4551 it with the non-limited view, which must be available. If the
4552 called function is in the extended main unit then no action is
4553 needed since the back-end handles this case.
4555 2017-01-20 Eric Botcazou <ebotcazou@adacore.com>
4557 * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
4558 (Contains_Subprograms_Refs): ...this. Adjust comment
4559 for constants. (Is_Subp_Or_Const_Ref): Rename into...
4560 (Is_Subprogram_Ref): ...this.
4561 (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
4562 Has_Non_Subprograms_Referencer and adjust comment. Remove
4563 incorrect shortcut for package declarations and bodies.
4565 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4567 * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
4568 base type differs from that of the completion and the private
4569 subtype is an itype (created for a constraint on an access
4570 type e.g.), set Delayed_Freeze on both to prevent out-of-scope
4573 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4575 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4576 When inheriting the SPARK_Mode of a prior expression function,
4577 look at the properly resolved entity rather than the initial
4578 candidate which may denote a homonym.
4580 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4582 * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
4583 Precondition or Postcondition, and the context is pragma
4584 Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
4585 and suggest the standard names Assertion_Policy /Pre /Post
4588 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4590 * sem_ch10.adb, sem_cat.adb: Minor reformatting.
4592 2017-01-20 Javier Miranda <miranda@adacore.com>
4594 * sem_ch3.adb (Access_Type_Declaration): Protect access to the
4596 * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
4597 * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
4600 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4602 * sem_ch13.adb (Analyze_Aspect_Specification, case
4603 Dynamic_Predicate): If the entity E is a subtype that inherits
4604 a static predicate for its parent P,, the inherited and the
4605 new predicate combine in the generated predicate function,
4606 and E only has a dynamic predicate.
4608 2017-01-20 Tristan Gingold <gingold@adacore.com>
4610 * s-boustr.ads, s-boustr.adb: New package.
4611 * Makefile.rtl: Add s-boustr.
4613 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4615 * inline.adb (Process_Formals): Qualify the
4616 expression of a return statement when it yields a universal type.
4618 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4620 * freeze.adb (Freeze_All): Freeze the default
4621 expressions of all eligible formal parameters that appear in
4622 entries, entry families, and protected subprograms.
4624 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4626 * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
4627 for illegal inherited Implicit_Dereference aspects with renamed
4630 2017-01-20 Javier Miranda <miranda@adacore.com>
4632 * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
4633 * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
4634 * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
4635 (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
4636 Set_Prev, Tree_Read): Adding assertion.
4637 * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
4638 * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
4639 (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
4640 Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
4641 Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
4642 Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
4643 Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
4644 Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
4645 Set_ListN_With_Parent): Adding assertion.
4647 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4649 * sem_prag.adb (Process_Convention): Diagnose properly a pragma
4650 import that applies to several homograph subprograms. when one
4651 of them is declared by a subprogram body.
4653 2017-01-20 Justin Squirek <squirek@adacore.com>
4655 * exp_ch6.adb (Expand_Call): Remove optimization
4656 that nulls out calls to null procedures.
4658 2017-01-20 Yannick Moy <moy@adacore.com>
4660 * inline.adb (Expand_Inlined_Call): Keep more
4661 precise type of actual for inlining whenever possible. In
4662 particular, do not switch to the formal type in GNATprove mode in
4663 some case where the GNAT backend might require it for visibility.
4665 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4667 * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
4668 aspect Implicit_Dereference can be inherited by a full view if
4669 the partial view has no discriminants, because there is no way
4670 to apply the aspect to the partial view.
4671 (Build_Derived_Record_Type): If derived type renames discriminants
4672 of the parent, the new discriminant inherits the aspect from
4674 * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
4675 call through an access discriminant designating a subprogram.
4676 * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
4677 properly a parameterless call through an access discriminant on
4678 the left-hand side of an assignment.
4679 * sem_res.adb (resolve): If an interpreation involves a
4680 discriminant with an implicit dereference and the expression is an
4681 entity, resolution takes place later in the appropriate routine.
4682 * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
4683 access discriminants that designate a subprogram type.
4685 2017-01-20 Pascal Obry <obry@adacore.com>
4687 * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
4689 2017-01-20 Yannick Moy <moy@adacore.com>
4691 * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
4692 on implicitly with'ed units in GNATprove mode.
4693 * sinfo.ads (Implicit_With): Document use of flag for implicitly
4694 with'ed units in GNATprove mode.
4696 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4698 * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
4699 unit Do not report an error on a non-static entity that appears
4700 in the context of a spec expression, such as an aspect expression.
4702 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4704 * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
4705 (Is_Underlying_Full_View): New routine.
4706 (Set_Is_Underlying_Full_View): New routine.
4707 (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
4708 * einfo.ads Add new attribute Is_Underlying_Full_View.
4709 (Is_Underlying_Full_View): New routine along with pragma Inline.
4710 (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
4711 * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
4712 class-wide types and underlying full views. The first subtype
4713 is used as the working type for all Itypes, not just array base types.
4714 (Build_DIC_Procedure_Declaration): Do not consider
4715 class-wide types and underlying full views. The first subtype
4716 is used as the working type for all Itypes, not just array
4718 * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
4719 view or an underlying full view without clobbering the attributes
4720 of a previous freeze node.
4721 (Inherit_Freeze_Node): New routine.
4722 * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
4724 (Build_Underlying_Full_View): Mark an underlying full view as such.
4725 * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
4728 2017-01-20 Yannick Moy <moy@adacore.com>
4730 * sinfo.ads: Document lack of Do_Division_Check flag
4731 on float exponentiation.
4733 2017-01-19 Javier Miranda <miranda@adacore.com>
4735 * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
4736 identifier attribute of a block-statement node. Required to avoid
4737 assertion failure when building the new containers library.
4739 2017-01-19 Bob Duff <duff@adacore.com>
4741 * exp_ch3.adb: Update comment.
4743 2017-01-19 Vincent Celier <celier@adacore.com>
4745 * gprep.adb (Gnatprep): Parse the definition file without
4746 "replace in comments" even when switch -C is used.
4748 2017-01-19 Justin Squirek <squirek@adacore.com>
4750 * exp_ch9.adb (Is_Pure_Barrier): Create function
4751 Is_Count_Attribute to identify an expansion of the 'Count
4754 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4756 * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
4757 statements within an element iterator loop are only analyzed
4758 agter the loop is rewritten. Within a generic the analysis must
4759 be performed in any case to complete name capture.
4761 2017-01-19 Bob Duff <duff@adacore.com>
4763 * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
4764 before checking for unrecognized pragmas.
4765 Initialize Pname on its declarations; that's always good style.
4767 2017-01-19 Claire Dross <dross@adacore.com>
4769 * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
4770 body into the tree for GNATprove by setting its Parent field. The
4771 components invariants of composite types are not checked by
4772 the composite type's invariant procedure in GNATprove mode.
4773 (Build_Invariant_Procedure_Declaration): Semi-insert the
4774 declaration into the tree for GNATprove by setting its Parent
4776 * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
4777 the component invariants to the array type invariant procedure
4778 so that the procedure can be used to check the array type
4780 (Freeze_Record_Type): In GNATprove mode, do
4781 not add the component invariants to the record type invariant
4782 procedure so that the procedure can be used to check the record
4783 type invariants if any.
4785 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4787 * lib-xref-spark_specific.adb: Minor reformatting.
4788 * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
4790 2017-01-19 Javier Miranda <miranda@adacore.com>
4792 * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
4793 Build_Back_End_Aggregate.
4794 (Generate_Aggregate_For_Derived_Type): Code cleanup.
4795 (Prepend_Stored_Values): Code cleanup.
4797 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4799 * sem_ch6.adb (Analyze_Expression_Function): Check for an
4800 incomplete return type after attempting to freeze it, so that
4801 other freeze actiona are generated in the proper order.
4803 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4805 * sem_aggr.adb (Resolve_Aggregate): If the type is a string
4806 type, ie. a type whose component is a character type, and the
4807 aggregate is positional, do not convert into a string literal
4808 if the index type is not an integer type, because the original
4809 type may be required in an enclosing operation.
4811 2017-01-19 Bob Duff <duff@adacore.com>
4813 * binde.adb, debug.adb: Enable new elaboration order algorithm
4814 by default. -dp switch reverts to the old algorithm.
4816 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4818 * sem_ch3.adb Add with and use clauses for Exp_Ch7.
4819 (Analyze_Declarations): Create the DIC and Invariant
4820 procedure bodies s after all freezing has taken place.
4821 (Build_Assertion_Bodies): New routine.
4822 * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
4824 (Analyze_Package_Specification): Remove the
4825 generation of the DIC and Invariant procedure bodies. This is
4826 now done by Analyze_Declarations.
4827 * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
4828 procedures are never treated as primitives.
4830 2017-01-19 Yannick Moy <moy@adacore.com>
4832 * frontend.adb: Analyze inlined bodies and check elaboration
4833 rules in GNATprove mode too.
4834 * sem_elab.adb (Delay_Element): Add Boolean component to save
4835 indication that call is in SPARK code. (Check_Elab_Calls):
4836 Check elaboration rules in GNATprove mode, and correctly set
4837 the current value of SPARK_Mode.
4838 * lib-xref-spark_specific.adb
4839 (Add_SPARK_Xrefs): Simplify iteration over dereferences.
4841 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4843 * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
4844 checks on the expression for the high bound of concatenation
4845 when checks are disabled, to suppress warnings about potential
4846 constraint errors in restricted runtimes.
4848 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4850 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
4851 representation-to-position function as inlined.
4852 * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
4853 the purity of an internally generated entity if it has been
4854 explicitly marked as pure for optimization purposes.
4855 * exp_aggr.adb: Minor reformatting.
4857 2017-01-19 Javier Miranda <miranda@adacore.com>
4859 * exp_ch6.adb (Expand_Call): Remove side effects on
4860 actuals that are allocators with qualified expression since the
4861 initialization of the object is performed by means of individual
4862 statements (and hence it must be done before the call).
4864 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4866 * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
4867 (Build_Derived_Enumeration_Type): If the derived type inherits a
4868 dynamic predicate from its parent, the bounds of the type must
4869 freeze because an explicit constraint is constructed for the
4870 type and the corresponding range is elaborated now.
4872 2017-01-19 Arnaud Charlet <charlet@adacore.com>
4874 * sem_attr.ads: minor fix of inconsistent casing in comment
4875 * lib-writ.ads: minor align comments in columns
4876 * sem_ch3.adb: Minor reformatting.
4877 * spark_xrefs.ads: minor fix typo in SPARK-related comment
4878 * table.ads: minor style fix in comment
4879 * lib-xref-spark_specific.adb
4880 (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
4881 * sem_ch12.adb: minor whitespace fix
4882 * freeze.adb: Add comment.
4883 * sem_util.adb (Unique_Name): for instances of
4884 generic subprograms ignore the name of the wrapper package.
4886 2017-01-19 Javier Miranda <miranda@adacore.com>
4888 * exp_aggr.adb (Resolve_Record_Aggregate):
4889 Factorize code needed for aggregates of limited and unlimited
4890 types in a new routine.
4891 (Pass_Aggregate_To_Back_End): New subprogram.
4893 2017-01-19 Yannick Moy <moy@adacore.com>
4895 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
4897 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4899 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
4900 public, for use elsewhere.
4901 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
4902 an Inlined_body, recognize a call that uses object notation
4903 and has not been rewritten as a regular call because regular
4904 expansion has not taken place.
4906 2017-01-19 Bob Duff <duff@adacore.com>
4908 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
4909 in case of generic formal discrete types, because it causes crashes in
4910 the compiler when built with assertions on.
4912 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4914 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
4915 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
4917 2017-01-19 Bob Duff <duff@adacore.com>
4919 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
4920 Increment Warnings_Detected. It was decrementing, which is
4921 wrong since we just issued a warning message.
4922 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
4923 these variables to be of subtype Nat instead of Int, because
4924 they should never be negative.
4926 2017-01-19 Javier Miranda <miranda@adacore.com>
4928 * contracts.adb (Build_Postconditions_Procedure): Replace
4929 Generate_C_Code by Modify_Tree_For_C.
4930 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
4931 Replace Generate_C_Code by Modify_Tree_For_C.
4932 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
4934 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
4935 Generate_C_Code by Modify_Tree_For_C.
4936 * exp_ch4.adb (Expand_Allocator_Expression): Replace
4937 Generate_C_Code by Modify_Tree_For_C.
4938 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
4939 by Modify_Tree_For_C.
4940 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
4941 Generate_C_Code by Modify_Tree_For_C.
4942 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
4943 by Modify_Tree_For_C.
4944 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
4946 2017-01-19 Javier Miranda <miranda@adacore.com>
4948 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
4950 (Is_Inlinable_Expression_Function): New subprogram.
4951 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
4953 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
4955 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4957 * sem_ch4.adb (Diagnose_Call): Improve error message when a
4958 selected component has a prefix that might be interpreted
4959 as a parameterless function call, but none of the candidate
4960 interpretations is parameterless, and there is a hidden homonym
4961 of the prefix that is a package.
4962 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
4963 interpreted as a parameterless function call and its analysis
4964 fails, do not call Analyze_Selected_Component.
4966 2017-01-19 Steve Baird <baird@adacore.com>
4968 * sem_util.ads: Add new Use_Full_View Boolean parameter to
4970 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
4971 calls to a newly-defined Scalar_Range_Of_Right_View function.
4973 2017-01-19 Arnaud Charlet <charlet@adacore.com>
4975 * gnat1drv.adb: minor fix of unbalanced parens in comment
4976 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
4977 to visible part of the package to allow re-use in GNATprove.
4978 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
4979 from repeated code of Traverse_Compilation_Unit.
4980 (Traverse_Declaration_Or_Statement): fixed detection of
4981 generic subprograms and packages; also, iteration over case
4982 statement alternatives rewritten to avoid testing if the first
4983 alternative is present (since it must be present due to Ada
4984 syntax restrictions).
4986 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4988 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
4989 returning by reference not just for subprogram body stubs,
4990 but for all subprogram cases.
4991 * sem_util.adb: Code reformatting.
4992 (Requires_Transient_Scope): Update the call to Results_Differ.
4993 (Results_Differ): Update the parameter profile and the associated
4996 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4998 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
4999 identifier nodes that do not come from source, to handle properly
5000 dimensionality check within an inlined body which inclddes both
5001 original operands and rewritten operands. This removes spurious
5002 dimensionality errors in the presence of front-end inlining,
5003 as well as in SPARK mode.
5005 2017-01-16 Jakub Jelinek <jakub@redhat.com>
5008 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
5010 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5012 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
5014 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5016 * doc/gnat_ugn/getting_started_with_gnat.rst,
5017 doc/gnat_ugn/inline_assembler.rst,
5018 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
5019 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
5020 doc/gnat_ugn/about_this_guide.rst,
5021 doc/gnat_ugn/platform_specific_information.rst,
5022 doc/gnat_ugn/example_of_binder_output.rst,
5023 doc/gnat_ugn/gnat_and_program_execution.rst,
5024 doc/gnat_ugn/gnat_utility_programs.rst,
5025 doc/gnat_ugn/the_gnat_compilation_model.rst,
5026 doc/gnat_rm/implementation_defined_attributes.rst,
5027 doc/gnat_rm/compatibility_and_porting_guide.rst,
5028 doc/gnat_rm/standard_library_routines.rst,
5029 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
5030 doc/gnat_rm/implementation_defined_pragmas.rst,
5031 doc/gnat_rm/the_gnat_library.rst,
5032 doc/gnat_rm/obsolescent_features.rst,
5033 doc/gnat_rm/about_this_guide.rst,
5034 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
5035 doc/gnat_rm/implementation_of_ada_2012_features.rst,
5036 doc/gnat_rm/interfacing_to_other_languages.rst,
5037 doc/gnat_rm/implementation_defined_aspects.rst,
5038 doc/gnat_rm.rst: Update documentation.
5039 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
5041 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5043 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
5044 * scil_ll.adb: Minor style fix in comment.
5045 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
5046 even if entity is already set, because the node may be renalyzed
5047 after inlining transformations.
5049 2017-01-13 Javier Miranda <miranda@adacore.com>
5051 * sem_res.adb (Resolve_Call): Do not establish a transient scope
5052 for a call to inlinable expression function (since the call will
5053 be replaced by its returned object).
5054 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
5055 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
5056 (Expand_Call): For inlinable expression function call replace the
5057 call by its returned object.
5058 (Is_Inlinable_Expression_Function): New subprogram.
5060 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5062 * checks.adb: Minor typo fix and reformatting.
5064 2017-01-13 Javier Miranda <miranda@adacore.com>
5066 * contracts.adb (Contract_Only_Subprograms): Remove formal.
5067 (Copy_Original_Specification): Removed.
5068 (Skip_Contract_Only_Subprogram): Move here checks previously
5069 located in the caller of this routine (to leave the code more clean).
5070 (Build_Contract_Only_Subprogram): Code cleanup.
5071 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
5072 (Get_Contract_Only_Missing_Body_Name): Removed.
5074 2017-01-13 Javier Miranda <miranda@adacore.com>
5076 * sem_ch6.adb (Cloned_Expression): New subprogram.
5077 (Freeze_Expr_Types): Complete previous patch since the expression
5078 of an expression-function may have iterators and loops with
5079 defining identifiers which, as part of the preanalysis of the
5080 expression, may be left decorated with itypes that will not be
5081 available in the tree passed to the backend.
5083 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5085 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
5086 conversion to Integer of an expression that is an attribute
5087 reference 'Pos on an enumeration type.
5089 2017-01-13 Bob Duff <duff@adacore.com>
5091 * atree.ads: Minor comment fix.
5093 2017-01-13 Justin Squirek <squirek@adacore.com>
5095 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
5096 calls in accessibility check on return statement.
5098 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5100 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
5101 Ensure that the input body is a subprogram body before trying to
5102 determine whether it denoted an expression function. Note that
5103 subprogram body stubs cannot denote expression functions.
5105 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5107 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
5110 2017-01-13 Javier Miranda <miranda@adacore.com>
5112 * einfo.ads (Component_Bit_Offset): Fix documentation.
5113 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
5114 on record holes for components with unknown compile-time offsets.
5116 2017-01-13 Bob Duff <duff@adacore.com>
5118 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
5119 * g-locfil.ads: Minor comment fix.
5121 2017-01-13 Bob Duff <duff@adacore.com>
5123 * binde.adb (Elab_New): New elaboration order algorithm
5124 that is expected to cause fewer ABE issues. This is a work in
5125 progress. The new algorithm is currently disabled, and can be
5126 enable by the -dp switch, or by modifying the Do_Old and Do_New
5127 etc. flags and rebuilding. Experimental code is included to
5128 compare the results of the old and new algorithms.
5129 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
5130 can have multiple of these tables, so the old and new algorithms
5132 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
5133 parameter of type array. This avoids the global variable, and
5134 allows bounds checking (which is normally defeated by the tables
5135 packages). It also ensures that the Elab_Order is read-only
5137 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
5138 subprograms that need it, as above.
5139 * debug.adb: Document new -dp switch. Modify doc of old -do
5141 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
5142 and Bindgen. Move writing of closure (-R and -Ra switches)
5143 to Binde; that's more convenient.
5145 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5147 * sem_ch6.adb (Analyze_Expression_Function): If the expression
5148 function is a completion, all entities referenced in the
5149 expression are frozen. As a consequence, a reference to an
5150 uncompleted private type from an enclosing scope is illegal.
5152 2017-01-13 Javier Miranda <miranda@adacore.com>
5154 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
5155 (Analyze_Subprogram_Body_Helper): At the occurrence of an
5156 expression function declaration that is a completion, its
5157 expression causes freezing (AI12-0103).
5159 2017-01-13 Vadim Godunko <godunko@adacore.com>
5161 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
5162 Reference functions of Ada.Containers.Indefinite_Holders.
5164 2017-01-13 Bob Duff <duff@adacore.com>
5166 * s-os_lib.ads: Minor comment fixes.
5168 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5170 * exp_ch3.adb (Default_Initialize_Object): Do not default
5171 initialize an object when it is of a task type and restriction
5172 No_Tasking is in effect because the initialization is obsolete.
5173 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
5174 restriction No_Tasking is in effect.
5175 (Build_Master_Renaming): Do not rename a master when restriction
5176 No_Tasking is in effect.
5178 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5180 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
5181 the legality of An others clause applies as well to a choice in
5182 an Iterated_component_ association.
5183 (Resolve_Iterated_Component_Association): An others choice
5185 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
5186 Iterated_Component_Association is not static.
5188 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5190 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
5191 control is passed to the expresion handler before the new mode
5193 * sem_ch12.adb (Analyze_Package_Instantiation,
5194 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
5195 in case control is passed to the expresion handler before the
5198 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5200 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
5201 exp_aggr.adb: Minor reformatting.
5203 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5205 * inline.adb: Minor reformatting and typo fix.
5207 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5209 * sem_util.ads, sem_util.adb (Choice_List): Move function here
5210 from sem_aggr.adb, for use elsewhere.
5211 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
5212 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
5213 Iterated_Component_Present.
5214 * exp_aggr.adb: Use Choice_List throughout, to handle
5215 Iterated_Component_Associations.
5216 (Gen_Loop): Generate proper loop for an
5217 Iterated_Component_Association: loop variable has the identifier
5218 of the original association. Generate a loop even for a single
5219 component choice, in order to make loop parameter visible in
5221 (Flatten): An Iterated_Component_Association is not static.
5223 2017-01-13 Yannick Moy <moy@adacore.com>
5225 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
5226 float exponentiation for statically known small negative values
5227 is the reciprocal of the exponentiation for the opposite value
5229 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
5230 Ensure that the value of float exponentiation for negative values
5231 is the reciprocal of the exponentiation for the opposite value
5233 * inline.adb (Expand_Inlined_Call): Fix the count
5234 for the number of generated gotos.
5236 2017-01-13 Yannick Moy <moy@adacore.com>
5238 * inline.adb: Code cleanup.
5239 * sem_util.adb (Is_OK_Volatile_Context): Add
5240 expression in delay statement as OK for volatile context.
5242 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5244 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
5245 mode a choice that is a subtype with a static predicate is
5246 replaced by the values it covers. This transformation must not
5247 be performed in ASIS mode, to preserve the source for analysis.
5249 2017-01-13 Justin Squirek <squirek@adacore.com>
5251 * nlists.ads: Correct minor typo.
5253 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5255 * sem_ch13.adb: Minor reformatting and typo fix.
5257 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5259 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
5260 Iterated_Component_Association is a named association in an
5262 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
5263 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
5264 and resolve the discrete choices and the expression of the
5266 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
5267 Loop_Actions and Box_Present are attributes of
5268 N_Iterated_Component_Association nodes. Box_Present is always
5270 * sprint.adb (Sprint_Node): An Iterated_Component_Association
5271 has a Discrete_Choices list, as specified in the RM. A
5272 Component_Association for aggregate uses instead a Choices list.
5273 We have to live with this small inconsistency because the new
5274 construct also has a defining identifier, and there is no way
5275 to merge the two node structures.
5277 2017-01-13 Yannick Moy <moy@adacore.com>
5279 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
5280 list of pragmas to remove. Remove pragmas from the list of
5281 statements in the body to inline.
5282 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
5284 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5286 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
5287 Analyze_Declarations, to analyze and resolve the expressions of
5288 aspect specifications in the current declarative list, so that
5289 the expressions have proper entity and type info. This is needed
5290 for ASIS when there is no subsequent expansion to generate this
5291 semantic information.
5292 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
5293 original expression, to suppress cascaded errors when expression
5294 has been constant-folded.
5295 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
5296 ASIS mode, because there is no subsequent expansion to decorate
5299 2017-01-13 Yannick Moy <moy@adacore.com>
5301 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
5302 New function to detect when a call may be inlined or not in
5304 (Expand_Inlined_Call): Ensure that a temporary
5305 is always created in the cases where a type conversion may be
5306 needed on an input parameter in GNATprove mode, so that GNATprove
5307 sees the check to perform.
5308 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
5309 when not applicable due to actual requiring type conversion
5310 with possible check but no temporary value can be copied for
5311 GNATprove to see the check.
5313 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5315 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
5316 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
5317 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
5318 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
5319 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
5320 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
5321 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
5322 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
5323 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
5324 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
5325 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
5326 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
5327 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
5328 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
5329 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
5330 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
5331 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
5332 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
5333 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
5334 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
5335 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
5336 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
5337 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
5338 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
5339 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
5340 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
5341 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
5342 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
5343 statements to reflect the new style for case alternatives. Various
5344 code clean up and reformatting.
5346 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5348 * exp_util.adb: Minor reformatting.
5350 2017-01-13 Yannick Moy <moy@adacore.com>
5352 * exp_spark.adb: Code cleanup.
5353 * sem_ch9.adb (Analyze_Delay_Until): Resolve
5354 expression so that calls are identified as such inside delay
5357 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5359 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
5360 * par-ch3.adb (P_Discrete_Choice_List): An
5361 Iterated_Component_Association is an array aggregate component.
5362 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
5363 (Is_Quantified_Expression): New function that performs a lookahead
5364 to distinguish quantified expressions from iterated component
5366 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
5368 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
5369 * sem.adb (Analyze): Handle Iterated_Component_Association.
5370 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
5371 component associations.
5372 * sinfo.ads, sinfo.adb: Entries for for
5373 N_Iterated_Component_Association and its fields.
5374 * sprint.adb (Sprint_Node_Actual): Handle
5375 N_Iterated_Component_Association.
5377 2017-01-13 Justin Squirek <squirek@adacore.com>
5379 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
5380 of the style check until after preanalysis of acutals.
5382 2017-01-13 Yannick Moy <moy@adacore.com>
5384 * sem_ch13.adb: Minor reformatting.
5385 * par-ch11.adb: minor style fix in whitespace
5386 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
5387 reduced to Add_Artificial_ALI_File; style fix in declaration of
5388 Text; grammar fix in comment.
5389 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
5390 * freeze.adb: Cleanup to pass pragma instead of
5392 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
5393 replace System'To_Address by equivalent call.
5395 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5397 * bindusg.adb: Improve usage output for -f switch.
5399 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5401 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
5404 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5406 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
5407 treat comparisons on strings as legal in a Static_Predicate.
5408 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
5409 a function call that is the expansion of a string comparison.The
5410 function call is built when compiling the corresponding predicate
5411 function, but the expression has been found legal as a static
5412 predicate during earlier analysis.
5413 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
5414 properly a function call that is the expansion of a string
5415 comparison operation, in order to recover the Static_Predicate
5416 expression and apply it to a static argument when needed.
5418 2017-01-13 Tristan Gingold <gingold@adacore.com>
5420 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
5421 (Open_Read): Re-implement using Open_Read_No_Exception.
5422 (Open_Write): Raise exception in case of error.
5423 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
5424 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
5426 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
5428 2017-01-13 Yannick Moy <moy@adacore.com>
5430 * checks.adb: Code cleanup.
5432 2017-01-13 Yannick Moy <moy@adacore.com>
5434 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
5435 expression instead of unanalyzed aspect expression for checking
5436 the validity of inheriting an operation. Also copy the expression
5437 being passing it to Build_Class_Wide_Expression, as this call
5438 modifies its argument.
5439 * sem_util.ads Fix comment to reference correct function name
5442 2017-01-13 Javier Miranda <miranda@adacore.com>
5444 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
5445 when we propagate information about the indexes back to the original
5446 indexing mode and the prefix of the index is a function call, do not
5447 remove any parameter from such call.
5449 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5451 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
5452 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
5453 a build-in-place function whose result type is tagged.
5455 2017-01-13 Yannick Moy <moy@adacore.com>
5457 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5458 Do not generate a wrapper when the only candidate is a class-wide
5460 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
5461 inside a generic context.
5463 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5465 * exp_util.adb (Add_Inherited_Tagged_DIC):
5466 Pass the object parameters of both the parent and the derived
5467 type DIC procedure to the reference replacement circuitry.
5468 (Find_DIC_Type): Modify the circuitry to present the partial
5469 view of a private type in case the private type defines its own
5471 (Replace_Object_And_Primitive_References): Add two
5472 optional formal parameters. Update the comment on usage. Update
5473 the replacement of references to object parameters.
5475 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5477 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
5479 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5481 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
5482 an out parameter that is a type conversion, independently of th
5483 range check that may apply to the expression of the conversion,
5484 for use in GNATProve.
5486 2017-01-13 Yannick Moy <moy@adacore.com>
5488 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
5489 GNATprove_Mode here to Frontend.
5490 * frontend.adb (Frontend): Move the implicit with for System
5491 in GNATprove_Mode here as it ismore correct this way; the old
5492 place only worked by chance, since there were no overloaded names.
5493 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
5494 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
5495 four attributes identified in SRM 9(18), add an implicit with
5496 to Ada.Task_Identification.
5497 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5498 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
5500 * checks.adb (Apply_Discriminant_Check,
5501 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
5502 In GNATprove mode, we do not apply the checks, but we still
5503 analyze the expression to possibly issue errors on SPARK
5504 code when a run-time error can be detected at compile time.
5505 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
5508 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5510 * expander.adb (Expand): Add a warning about using return
5511 statements in Ghost management code.
5512 * exp_ch3.adb (Freeze_Type): Add a warning about using return
5513 statements in Ghost management code.
5514 * exp_ch7.adb (Build_Invariant_Procedure_Body,
5515 Build_Invariant_Procedure_Declaration): Add a warning about
5516 using return statements in Ghost management code.
5517 * exp_disp.adb (Make_DT): Add a warning about using return
5518 statements in Ghost management code.
5519 * exp_util.adb (Build_DIC_Procedure_Body,
5520 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
5521 warning about using return statements in Ghost management code.
5522 * freeze.adb (Freeze_Entity): Add a warning about using return
5523 statements in Ghost management code.
5524 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
5525 statements in Ghost management code.
5526 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
5527 a warning about using return statements in Ghost management code.
5528 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
5529 return statements in Ghost management code.
5530 * sem_ch6.adb (Analyze_Procedure_Call,
5531 Analyze_Subprogram_Body_Helper): Add a warning about using return
5532 statements in Ghost management code.
5533 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
5534 using return statements in Ghost management code.
5535 * sem_ch12.adb (Analyze_Package_Instantiation,
5536 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
5537 Instantiate_Subprogram_Body): Add a warning about using return
5538 statements in Ghost management code.
5539 * sem_ch13.adb (Build_Predicate_Functions,
5540 Build_Predicate_Function_Declarations): Add a warning about
5541 using return statements in Ghost management code.
5542 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
5543 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
5544 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
5545 using return statements in Ghost management code.
5547 2017-01-13 Tristan Gingold <gingold@adacore.com>
5549 * s-mmosin-mingw.adb: Fix pragma import.
5551 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5553 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
5556 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5558 * atree.adb (Allocate_Initialize_Node): A newly created node is
5559 no longer marked as Ghost at this level.
5560 (Mark_New_Ghost_Node): New routine.
5561 (New_Copy): Mark the copy as Ghost.
5562 (New_Entity): Mark the entity as Ghost.
5563 (New_Node): Mark the node as Ghost.
5564 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
5565 apply to unanalyzed entities.
5566 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
5568 (Set_Is_Checked_Ghost_Entity): This attribute now
5569 applies to all entities as well as unanalyzed entities.
5570 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
5571 all entities as well as unanalyzed entities.
5572 * expander.adb Add with and use clauses for Ghost.
5573 (Expand): Install and revert the Ghost region associated with the node
5575 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
5576 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
5577 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
5578 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
5579 (Freeze_Type): Install and revert the Ghost region associated
5580 with the type being frozen.
5581 * exp_ch5.adb Remove with and use clauses for Ghost.
5582 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
5583 * exp_ch6.adb Remove with and use clauses for Ghost.
5584 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
5585 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
5586 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
5587 Ghost region of the working type.
5588 (Build_Invariant_Procedure_Declaration): Install and revert
5589 the Ghost region of the working type.
5590 (Expand_N_Package_Body): Remove all Ghost-related code.
5591 * exp_ch8.adb Remove with and use clauses for Ghost.
5592 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
5594 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
5595 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
5596 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
5598 * exp_ch13.adb Remove with and use clauses for Ghost.
5599 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
5600 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
5601 the tagged type. Move the generation of various entities within
5602 the Ghost region of the type.
5603 * exp_prag.adb Remove with and use clauses for Ghost.
5604 (Expand_Pragma_Check): Remove all Ghost-related code.
5605 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
5606 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
5607 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
5608 * exp_util.adb (Build_DIC_Procedure_Body): Install
5609 and revert the Ghost region of the working types.
5610 (Build_DIC_Procedure_Declaration): Install and revert the
5611 Ghost region of the working type.
5612 (Make_Invariant_Call): Install and revert the Ghost region of the
5614 (Make_Predicate_Call): Reimplemented. Install and revert the
5615 Ghost region of the associated type.
5616 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
5617 of the entity being frozen.
5618 (New_Freeze_Node): Removed.
5619 * ghost.adb Remove with and use clauses for Opt.
5620 (Check_Ghost_Completion): Update the parameter profile
5621 and all references to formal parameters.
5622 (Ghost_Entity): Update the comment on usage.
5623 (Install_Ghost_Mode): New routines.
5624 (Is_Ghost_Assignment): New routine.
5625 (Is_Ghost_Declaration): New routine.
5626 (Is_Ghost_Pragma): New routine.
5627 (Is_Ghost_Procedure_Call): New routine.
5628 (Is_Ghost_Renaming): Removed.
5629 (Is_OK_Declaration): Reimplemented.
5630 (Is_OK_Pragma): Reimplemented.
5631 (Is_OK_Statement): Reimplemented.
5632 (Is_Subject_To_Ghost): Update the comment on usage.
5633 (Mark_And_Set_Ghost_Assignment): New routine.
5634 (Mark_And_Set_Ghost_Body): New routine.
5635 (Mark_And_Set_Ghost_Completion): New routine.
5636 (Mark_And_Set_Ghost_Declaration): New routine.
5637 (Mark_And_Set_Ghost_Instantiation): New routine.
5638 (Mark_And_Set_Ghost_Procedure_Call): New routine.
5639 (Mark_Full_View_As_Ghost): Removed.
5640 (Mark_Ghost_Declaration_Or_Body): New routine.
5641 (Mark_Ghost_Pragma): New routine.
5642 (Mark_Ghost_Renaming): New routine.
5643 (Mark_Pragma_As_Ghost): Removed.
5644 (Mark_Renaming_As_Ghost): Removed.
5645 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
5646 (Prune_Node): Freeze nodes no longer need special pruning, they
5647 are processed by the general ignored Ghost code mechanism.
5648 (Restore_Ghost_Mode): New routine.
5649 (Set_Ghost_Mode): Reimplemented.
5650 (Set_Ghost_Mode_From_Entity): Removed.
5651 * ghost.ads Add with and use clauses for Ghost.
5652 (Check_Ghost_Completion): Update the parameter profile
5653 along with the comment on usage.
5654 (Install_Ghost_Mode): New routine.
5655 (Is_Ghost_Assignment): New routine.
5656 (Is_Ghost_Declaration): New routine.
5657 (Is_Ghost_Pragma): New routine.
5658 (Is_Ghost_Procedure_Call): New routine.
5659 (Mark_And_Set_Ghost_Assignment): New routine.
5660 (Mark_And_Set_Ghost_Body): New routine.
5661 (Mark_And_Set_Ghost_Completion): New routine.
5662 (Mark_And_Set_Ghost_Declaration): New routine.
5663 (Mark_And_Set_Ghost_Instantiation): New routine.
5664 (Mark_And_Set_Ghost_Procedure_Call): New routine.
5665 (Mark_Full_View_As_Ghost): Removed.
5666 (Mark_Ghost_Pragma): New routine.
5667 (Mark_Ghost_Renaming): New routine.
5668 (Mark_Pragma_As_Ghost): Removed.
5669 (Mark_Renaming_As_Ghost): Removed.
5670 (Restore_Ghost_Mode): New routine.
5671 (Set_Ghost_Mode): Redefined.
5672 (Set_Ghost_Mode_From_Entity): Removed.
5673 * sem.adb (Analyze): Install and revert the Ghost region of the
5674 node being analyzed.
5675 (Do_Analyze): Change the way a clean Ghost
5676 region is installed and reverted.
5677 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
5678 all Ghost-related code.
5679 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
5680 (Analyze_Number_Declaration): Remove all Ghost-related code.
5681 (Analyze_Object_Declaration): Install and revert the Ghost region of
5682 a deferred object declaration's completion.
5683 (Array_Type_Declaration): Remove all Ghost-related code.
5684 (Build_Derived_Type): Update the comment on
5685 the propagation of Ghost attributes from a parent to a derived type.
5686 (Derive_Subprogram): Remove all Ghost-related code.
5687 (Make_Class_Wide_Type): Remove all Ghost-related code.
5688 (Make_Implicit_Base): Remove all Ghost-related code.
5689 (Process_Full_View): Install and revert the Ghost region of
5690 the partial view. There is no longer need to check the Ghost
5692 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
5693 region of the left hand side.
5694 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
5695 all Ghost-related code.
5696 (Analyze_Expression_Function): Remove all Ghost-related code.
5697 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
5698 (Analyze_Procedure_Call): Install and revert the Ghost region of
5699 the procedure being called.
5700 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
5701 region of the spec or body.
5702 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
5703 (Build_Subprogram_Declaration): Remove all Ghost-related code.
5704 (Find_Corresponding_Spec): Remove all Ghost-related code.
5705 (Process_Formals): Remove all Ghost-related code.
5706 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
5707 the Ghost region of the spec.
5708 (Analyze_Package_Declaration): Remove all Ghost-related code.
5709 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
5710 Ghost when it aliases a Ghost entity.
5711 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
5713 (Analyze_Object_Renaming): Mark a renaming as Ghost when
5714 it aliases a Ghost entity.
5715 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
5717 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
5718 aliases a Ghost entity.
5719 * sem_ch11.adb Remove with and use clauses for Ghost.
5720 (Analyze_Exception_Declaration): Remove all Ghost-related code.
5721 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
5723 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
5725 (Analyze_Package_Instantiation): Install and revert the Ghost region
5726 of the package instantiation.
5727 (Analyze_Subprogram_Instantiation): Install
5728 and revert the Ghost region of the subprogram instantiation.
5729 (Instantiate_Package_Body): Code clean up. Install and revert the
5730 Ghost region of the package body.
5731 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
5732 Ghost region of the subprogram body.
5733 * sem_ch13.adb (Build_Predicate_Functions): Install
5734 and revert the Ghost region of the related type.
5735 (Build_Predicate_Function_Declaration): Code clean up. Install
5736 and rever the Ghost region of the related type.
5737 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
5738 Install and revert the Ghost region of the pragma.
5739 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
5740 Ghost region of the pragma.
5741 (Analyze_Pragma): Install and revert the Ghost region of various
5742 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
5743 or encloses a Ghost entity.
5744 (Analyze_Pre_Post_Condition): Install and revert the Ghost
5745 region of the pragma.
5746 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
5747 Ghost region of the pragma.
5748 * sem_res.adb (Resolve): Remove all Ghost-related code.
5749 * sem_util.adb (Is_Declaration): Reimplemented.
5750 (Is_Declaration_Other_Than_Renaming): New routine.
5751 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
5752 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
5753 (Is_Ghost_Pragma): Removed.
5754 (Is_Ignored_Ghost_Pragma): New routine.
5755 (Set_Is_Checked_Ghost_Pragma): New routine.
5756 (Set_Is_Ghost_Pragma): Removed.
5757 (Set_Is_Ignored_Ghost_Pragma): New routine.
5758 * sinfo.ads: Update the documentation on Ghost mode and
5759 Ghost regions. New attributes Is_Checked_Ghost_Pragma
5760 and Is_Ignored_Ghost_Pragma along with usages in nodes.
5761 Remove attribute Is_Ghost_Pragma along with usages in nodes.
5762 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5763 (Is_Ghost_Pragma): Removed along with pragma Inline.
5764 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5765 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5766 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
5767 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5769 2017-01-12 Tristan Gingold <gingold@adacore.com>
5771 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
5772 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
5774 2017-01-12 Yannick Moy <moy@adacore.com>
5776 * errout.adb, errout.ads (Initialize): Factor common treatment
5778 (Reset_Warnings): New procedure to reset counts related to warnings.
5779 (Record_Compilation_Errors): New variable to store the presence of an
5780 error, used in gnat2why to allow changing the Warning_Mode.
5781 (Compilation_Errors): Use new variable Record_Compilation_Errors to
5782 store the presence of an error.
5784 2017-01-12 Javier Miranda <miranda@adacore.com>
5786 * sem_ch13.adb (Analyze_Aspect_Specifications):
5787 For Interrupt_Handler and Attach_ Handler aspects, decorate the
5788 internally built reference to the protected procedure as coming
5789 from sources and force its analysis.
5791 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5793 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
5794 inherit predicates if any from the first_subtype of the parent,
5795 not from the anonymous parent type.
5796 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
5797 predicate is not a static subtype.
5799 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5801 * freeze.adb (Check_Suspicious_Convention): New procedure
5802 performing a warning check on discriminated record types with
5803 convention C or C++. Factored out of procedure Freeze_Record_Type,
5804 and changed to only apply to base types (to avoid spurious
5805 warnings on subtypes). Minor improvement of warning messages
5806 to refer to discriminated rather than variant record types.
5807 (Freeze_Record_Type): Remove code for performing a suspicious
5809 (Freeze_Entity): Only call Freeze_Record_Type
5810 on types that aren't declared within any enclosing generic units
5811 (rather than just excluding the type when the innermost scope
5812 is generic). Call Check_Suspicious_Convention whether or not
5813 the type is declared within a generic unit.
5814 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
5815 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
5818 2017-01-12 Tristan Gingold <gingold@adacore.com>
5820 * sysdep.c, adaint.c, rtinit.c, ming32.h:
5821 (__gnat_current_codepage): Renamed from CurrentCodePage
5822 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
5824 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5826 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
5827 quantified expressions, following AI12-050: the loop parameters
5828 of two quantified expressions are conformant if they have the
5831 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5833 * gcc-interface/Makefile.in: Clean up VxWorks targets.
5835 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5837 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
5838 Hnadle properly the attribute reference when it appears as part
5839 of an expression in another loop aspect.
5841 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5843 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
5844 subsidiary of Build_Initialization_Call, to complete generation
5845 of predicate checks on discriminants whose (sub)types have
5846 predicates, and to add checks on variants that do not have an
5848 * sem_util.adb (Gather_Components): A missing Others alternative is
5849 not an error when the type of the discriminant is a static predicate
5850 (and coverage has been checked when analyzing the case statement). A
5851 runtime check is generated to verify that a given discriminant
5852 satisfies the predicate (RM 3.8.1. (21.1/2)).
5854 2017-01-12 Yannick Moy <moy@adacore.com>
5856 * gnat1drv.adb (Adjust_Global_Switches): Only
5857 perform checking of exception mechanism when generating code.
5859 2017-01-12 Justin Squirek <squirek@adacore.com>
5861 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
5862 Remove handling of access component with invariant.
5863 (Build_Invariant_Procedure_Declaration): Remove return on class
5865 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
5866 conditional exception for component or array so Has_Own_Invariants
5867 flag is not falsly set.
5868 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
5869 wide type to have no invariant flags.
5871 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5873 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
5874 sem_ch13.adb: Minor reformatting.
5876 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5878 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
5879 adjustment primitive when the ancestor type was not properly frozen.
5880 (Gen_Assign): Guard against a missing initialization
5881 primitive when the component type was not properly frozen.
5882 (Initialize_Array_Component): Guard against a missing adjustment
5883 primitive when the component type was not properly frozen.
5884 (Initialize_Record_Component): Guard against a missing adjustment
5885 primitive when the component type was not properly frozen.
5886 (Process_Transient_Component_Completion): The transient object may
5887 not be finalized when its associated type was not properly frozen.
5888 * exp_ch3.adb (Build_Assignment): Guard against a missing
5889 adjustment primitive when the component type was not properly frozen.
5890 (Build_Initialization_Call): Guard against a missing
5891 initialization primitive when the associated type was not properly
5893 (Expand_N_Object_Declaration): Guard against a missing
5894 adjustment primitive when the base type was not properly frozen.
5895 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
5896 body when there is no adjustment primitive available. Create an
5897 empty Deep_Finalize body when there is no finalization primitive
5899 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
5900 missing finalization primitive when the designated type was
5901 not properly frozen.
5902 (Expand_N_Allocator): Guard against a missing initialization primitive
5903 when the designated type was not properly frozen.
5904 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
5905 only when the corresponding adjustment primitive is available.
5906 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
5907 adjustment/finalization statements only when there is an available
5908 primitive to carry out the action.
5909 (Build_Initialize_Statements): Generate the initialization/finalization
5910 statements only when there is an available primitive to carry out the
5912 (Make_Adjust_Call): Do not generate a call when the underlying
5913 type is not present due to a possible missing full view.
5914 (Make_Final_Call): Do not generate a call when the underlying
5915 type is not present due to a possible missing full view.
5916 (Make_Finalize_Address_Stmts): Generate an empty body when the
5917 designated type lacks a finalization primitive.
5918 (Make_Init_Call): Do not generate a call when the underlying type is
5919 not present due to a possible missing full view.
5920 (Process_Component_For_Adjust): Add the adjustment call only when the
5921 corresponding adjustment primitive is available.
5922 (Process_Component_For_Finalize): Add the finalization call only when
5923 the corresponding finalization primitive is available.
5924 (Process_Object_Declaration): Use a null statement to emulate a
5925 missing call to the finalization primitive of the object type.
5926 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
5927 (Make_Final_Call): Update the comment on usage.
5928 (Make_Init_Call): Update the comment on usage.
5929 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
5931 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5933 * einfo.ads: Update documentation of Address_Taken.
5934 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
5935 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
5936 for subprograms when setting Address_Taken flag.
5938 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
5940 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
5941 Configurable_Run_Time_Mode off when analysing with'ed predefined
5944 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5946 * sem_prag.adb: Minor reformatting.
5947 * sem_util.adb (Unique_Entity): fix result for
5948 bodies of entry families.
5950 2017-01-12 Justin Squirek <squirek@adacore.com>
5952 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
5953 Resolve_Suppressible in the pragma Assertion_Policy case.
5954 (Resolve_Suppressible): Created this function to factor out
5955 common code used to resolve Suppress to either Ignore or Check
5956 * snames.ads-tmpl: Add name for Suppressible.
5958 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5960 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
5962 * debug.adb: Minor comment fixes.
5964 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5966 * sem_util.adb (Unique_Entity): For concurrent
5967 bodies that are defined with stubs and complete a declaration
5968 of a single concurrent object return the entity of an implicit
5969 concurrent type, not the entity of the anonymous concurrent
5971 * debug.adb: -gnatd.J is no longer used.
5972 * make.adb (Globalize): Removed, no longer used.
5973 * sem_ch9.adb: minor typo in comment for entry index
5975 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
5977 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
5978 * exp_ch3.adb (Build_Init_Statements): As part of initialising
5979 the value record of a task, set its _Secondary_Stack_Size field
5981 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
5982 a _Secondary_Stack_Size field in the value record of
5983 the task if a Secondary_Stack_Size rep item is present.
5984 (Make_Task_Create_Call): Include secondary stack size
5985 parameter. If No_Secondary_Stack restriction is in place, passes
5987 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
5988 Secondary_Stack_Size.
5989 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
5990 function to define the overhead of the secondary stack.
5991 * s-tarest.adb (Create_Restricted_Task,
5992 Create_Restricted_Task_Sequential): Functions now include
5993 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
5994 * s-tarest.adb (Create_Restricted_Task,
5995 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
5996 include Secondary_Stack_Size parameter.
5997 (Task_Wrapper): Secondary stack now allocated to the size specified by
5998 the Secondary_Stack_Size parameter in the task's ATCB.
5999 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
6000 Secondary_Stack_Size component.
6001 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6002 Create_Restricted_Task_Sequential): Function now include
6003 Secondary_Stack_Size parameter.
6004 (Task_Wrapper): Secondary stack now allocated to the size
6005 specified by the Secondary_Stack_Size parameter in the task's
6007 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
6008 to include Secondary_Stack_Size parameter.
6009 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
6010 Secondary_Stack_Size aspect, turning the aspect into its corresponding
6012 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
6013 * snames.adb-tmpl, snames.ads-tmpl: Added names
6014 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6015 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6017 2017-01-12 Yannick Moy <moy@adacore.com>
6019 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
6022 2017-01-12 Justin Squirek <squirek@adacore.com>
6024 * exp_attr.adb (Expand_N_Attribute_Reference):
6025 Fix Finalization_Size case by properly resolving the type after
6026 rewritting the node.
6028 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
6030 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
6032 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
6033 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
6034 exp_sel.ads: Minor reformatting.
6036 2017-01-12 Justin Squirek <squirek@adacore.com>
6038 * exp_ch6.adb (Expand_Call): Add guard to prevent
6039 invariant checks from being created for internally generated
6042 2017-01-12 Bob Duff <duff@adacore.com>
6044 * lib-writ.ads: Remove incorrect comment.
6046 2017-01-12 Javier Miranda <miranda@adacore.com>
6048 * debug.adb (-gnatd.K): Enable generation of contract-only
6049 procedures in CodePeer mode.
6050 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
6052 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
6054 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
6056 (Get_Contract_Only_Missing_Body_Name): New subprogram.
6057 (Get_Contract_Only_Body): New subprogram.
6058 (Set_Contract_Only_Body): New subprogram.
6059 (Is_Contract_Only_Body): New subprogram.
6060 (Set_Is_Contract_Only_Body): New subprogram.
6061 (SCIL_Nodes): Replace table by hash-table.
6063 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
6065 * exp_ch6.adb: Minor reformatting.
6066 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
6068 2017-01-12 Bob Duff <duff@adacore.com>
6070 * binde.adb (Forced): New reason for a dependence.
6071 (Force_Elab_Order): Implementation of the new switch.
6072 * binde.ads: Minor comment fixes.
6073 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
6074 long ago that is no longer supported; removed comment about that.
6075 * opt.ads (Force_Elab_Order_File): Name of file specified for
6077 * switch-b.adb: Parse -f switch.
6079 2017-01-12 Justin Squirek <squirek@adacore.com>
6081 * exp_ch6.adb (Check_View_Conversion): Created this function
6082 to properly chain calls to check type invariants that may be
6083 present in a subprogram call after the subprogram.
6084 (Expand_Call): Add a conditional to identify when a view conversion
6085 needs to be checked.
6086 * nlists.adb, nlists.ads (Prepend_New): New routine.
6087 (Prepend_New_To): New routine.
6089 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
6091 * sinfo.ads: Minor reformatting.
6093 2017-01-12 Gary Dismukes <dismukes@adacore.com>
6095 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
6098 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
6100 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
6101 variable Definite. Create a local object and pass its 'Access to the
6102 BIP function when the result type is either definite or it does not
6103 require any finalization or secondary stack management.
6105 2017-01-12 Bob Duff <duff@adacore.com>
6107 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
6108 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
6109 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
6110 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
6111 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
6112 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
6113 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6114 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
6115 Change name to Pragma_Name_Unmapped.
6116 (Pragma_Name_Mapped): Change name to Pragma_Name.
6117 This is because the "mapped" version should be the usual case.
6119 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
6121 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
6122 Is_Default_Init_Cond_Procedure, and
6123 Has_Inherited_Default_Init_Cond. Add uses of flags
6124 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
6125 (Default_Init_Cond_Procedure): Removed.
6126 (DIC_Procedure): New routine.
6127 (Has_Default_Init_Cond): Removed.
6128 (Has_DIC): New routine.
6129 (Has_Inheritable_Invariants): The attribute applies to the base type.
6130 (Has_Inherited_Default_Init_Cond): Removed.
6131 (Has_Inherited_DIC): New routine.
6132 (Has_Inherited_Invariants): The attribute applies to the base type.
6133 (Has_Own_DIC): New routine.
6134 (Has_Own_Invariants): The attribute applies to the base type.
6135 (Is_Default_Init_Cond_Procedure): Removed.
6136 (Is_DIC_Procedure): New routine.
6137 (Set_Default_Init_Cond_Procedure): Removed.
6138 (Set_DIC_Procedure): New routine.
6139 (Set_Has_Default_Init_Cond): Removed.
6140 (Set_Has_Inheritable_Invariants): The attribute applies
6142 (Set_Has_Inherited_Default_Init_Cond): Removed.
6143 (Set_Has_Inherited_DIC): New routine.
6144 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
6145 (Set_Has_Own_DIC): New routine.
6146 (Set_Has_Own_Invariants): The attribute applies to the base type.
6147 (Set_Is_Default_Init_Cond_Procedure): Removed.
6148 (Set_Is_DIC_Procedure): New routine.
6149 (Write_Entity_Flags): Update the output of all flags related to
6150 default initial condition.
6151 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
6152 of the call to the DIC procedure.
6153 (Freeze_Type): Generate the body of the DIC procedure.
6154 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
6155 all occurrences of Create_Append with Append_New_To. Do
6156 not generate an invariant procedure for a class-wide type.
6157 The generated body acts as a freeze action of the working type.
6158 (Build_Invariant_Procedure_Declaration): Do not generate an
6159 invariant procedure for a class-wide type.
6160 (Create_Append): Removed.
6161 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
6162 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
6163 class-wide pre/postcondition description and data structures from
6165 (Build_Class_Wide_Expression): Moved from Sem_Prag.
6166 (Build_DIC_Call): New routine.
6167 (Build_DIC_Procedure_Body): New routine.
6168 (Build_DIC_Procedure_Declaration): New routine.
6169 (Entity_Hash): Moved from Sem_Prag.
6170 (Find_DIC_Type): New routine.
6171 (Update_Primitives_Mapping): Reimplemented.
6172 (Update_Primitives_Mapping_Of_Types): New routine.
6173 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
6174 (Build_DIC_Call): New routine.
6175 (Build_DIC_Procedure_Body): New routine.
6176 (Build_DIC_Procedure_Declaration): New routine.
6177 (Update_Primitives_Mapping): Moved from Sem_Prag.
6178 (Update_Primitives_Mapping_Of_Types): New routine.
6179 * nlists.adb (Append_New): New routine.
6180 (Append_New_To): New routine.
6181 * nlists.ads (Append_New): New routine.
6182 (Append_New_To): New routine.
6183 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
6184 of DIC procedures here. This is now done at the end of the
6185 visible declarations, private declarations, and at the freeze
6187 (Analyze_Private_Extension_Declaration):
6188 A private extension inherits the DIC pragma of a parent type.
6189 (Analyze_Subtype_Declaration): No need to propagate invariant
6190 attributes to a subtype as those apply to the base type.
6191 (Build_Derived_Record_Type): No need to inherit invariants here
6192 as this is now done in Build_Derived_Type.
6193 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
6195 (Process_Full_View): Update the propagation of DIC attributes.
6196 (Propagate_Default_Init_Cond_Attributes): Removed.
6197 * sem_ch7.adb Add with and use clauses for Exp_Util.
6198 (Analyze_Package_Specification): Create the body of the DIC
6199 procedure at the end of the visible and private declarations.
6200 (Preserve_Full_Attributes): Propagate DIC attributes.
6201 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
6203 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
6204 * sem_elab.adb (Check_A_Call): Update the call to
6205 Is_Nontrivial_Default_Init_Cond_Procedure.
6206 * sem_prag.adb Remove the with and use clauses for
6207 GNAT.HTable. Move the handling of class- wide pre/postcondition
6208 description and data structures to Exp_Util.
6209 (Analyze_Pragma): Create the declaration of the DIC procedure. There
6210 is no need to propagate invariant-related attributes at this point
6211 as this is done in Build_Invariant_Procedure_Declaration.
6212 (Build_Class_Wide_Expression): Moved to Exp_Util.
6213 (Entity_Hash): Moved to Exp_Util.
6214 (Update_Primitives_Mapping): Moved to Exp_Util.
6215 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
6216 (Update_Primitives_Mapping): Moved to Exp_Util.
6217 * sem_util.adb: Remove with and use clauses for Ghost
6219 (Build_Default_Init_Cond_Call): Removed.
6220 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6221 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6222 (Get_Views): Reimplemented.
6223 (Has_Full_Default_Initialization): Reimplement the section on DIC.
6224 (Inherit_Default_Init_Cond_Procedure): Removed.
6225 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6226 (Is_Nontrivial_DIC_Procedure): New routine.
6227 (Is_Verifiable_DIC_Pragma): New routine.
6228 (Propagate_DIC_Attributes): New routine.
6229 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
6230 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6231 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6232 (Inherit_Default_Init_Cond_Procedure): Removed.
6233 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6234 (Is_Nontrivial_DIC_Procedure): New routine.
6235 (Is_Verifiable_DIC_Pragma): New routine.
6236 (Propagate_DIC_Attributes): New routine.
6237 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
6239 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
6241 (Expression_Copy): New routine along with pragma Inline.
6242 (Set_Expression_Copy): New routine along with pragma Inline.
6244 2017-01-06 Bob Duff <duff@adacore.com>
6246 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
6247 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
6248 we won't generate the call to s_stalib_adafinal when the main
6249 is not written in Ada.
6251 2017-01-06 Bob Duff <duff@adacore.com>
6253 * sem_prag.adb: Minor: remove pragma Warnings.
6255 2017-01-06 Tristan Gingold <gingold@adacore.com>
6257 * Makefile.rtl: Do not compile s-stchop by default.
6259 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
6261 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
6262 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
6263 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
6264 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
6265 Reverted previous change for now.
6267 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6269 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
6270 check to default discriminant value if checks are enabled.
6271 (Build_Assignment): If type of component has static predicate,
6272 apply check to its default value, if any.
6274 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
6276 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
6277 * exp_ch3.adb (Build_Init_Statements): As part of initialising
6278 the value record of a task, set its _Secondary_Stack_Size field
6280 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
6281 a _Secondary_Stack_Size field in the value record of
6282 the task if a Secondary_Stack_Size rep item is present.
6283 (Make_Task_Create_Call): Include secondary stack size
6284 parameter. If No_Secondary_Stack restriction is in place, passes
6286 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
6287 Secondary_Stack_Size.
6288 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
6289 function to define the overhead of the secondary stack.
6290 * s-tarest.adb (Create_Restricted_Task,
6291 Create_Restricted_Task_Sequential): Functions now include
6292 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
6293 * s-tarest.adb (Create_Restricted_Task,
6294 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
6295 now include Secondary_Stack_Size parameter.
6297 Secondary stack now allocated to the size specified by the
6298 Secondary_Stack_Size parameter in the task's ATCB.
6299 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
6300 Secondary_Stack_Size component.
6301 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6302 Create_Restricted_Task_Sequential): Function now include
6303 Secondary_Stack_Size parameter.
6304 (Task_Wrapper): Secondary stack
6305 now allocated to the size specified by the Secondary_Stack_Size
6306 parameter in the task's ATCB.
6307 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
6308 for Secondary_Stack_Size aspect, turning the aspect into its
6309 corresponding internal attribute.
6310 (Analyze_Attribute_Definition):
6311 Process Secondary_Stack_Size attribute.
6312 * snames.adb-tmpl, snames.ads-tmpl: Added names
6313 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6314 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6316 2017-01-06 Pascal Obry <obry@adacore.com>
6318 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
6319 Sequential_IO and Direct_IO.
6321 2017-01-06 Bob Duff <duff@adacore.com>
6323 * snames.ads-tmpl (Renamed): New name for the pragma argument.
6324 * par-ch2.adb: Allow the new pragma (with analysis deferred
6326 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
6327 Keep a mapping from new pragma names to old names.
6328 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
6329 implement it by calling Map_Pragma_Name.
6330 * checks.adb, contracts.adb, einfo.adb, errout.adb,
6331 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
6332 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
6333 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
6334 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
6335 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6336 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
6339 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6341 * exp_ch9.adb: Minor reformatting.
6343 2017-01-06 Tristan Gingold <gingold@adacore.com>
6345 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
6346 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
6347 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
6349 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
6350 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
6351 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
6352 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
6354 2017-01-06 Bob Duff <duff@adacore.com>
6356 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
6357 dummy implementation of Map_Pragma_Name.
6359 2017-01-06 Tristan Gingold <gingold@adacore.com>
6361 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
6362 entry_body variable constant.
6363 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
6364 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
6366 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
6367 now access to constant.
6369 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6371 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
6372 reformatting and typo fixes.
6374 2017-01-06 Bob Duff <duff@adacore.com>
6376 * snames.ads-tmpl: New names for pragma renaming.
6377 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
6378 * par-prag.adb: Add new pragma name to case statement.
6379 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
6381 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
6382 Dummy implementation of Pragma_Name_Mapped.
6384 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6386 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
6387 better detect call within an entry_wrapper.
6388 * sem_res.adb (Resolve_Call): A protected call within an
6389 entity_wrapper is analyzed in the context of the protected
6390 object but corresponds to a pre-analysis and is not an access
6392 * sem_attr.adb: Minor reformatting.
6394 2017-01-06 Justin Squirek <squirek@adacore.com>
6396 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
6397 Finalization_Size to allow a prefix of any non-class-wide type.
6398 * sem_attr.ads Modify comment for Finalization_Size to include
6399 definite type use case.
6401 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6403 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
6404 on procedures that are wrappers created for entries that have
6406 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
6407 body is an entry_wrapper, compile it in the context of the
6408 synchronized type, because a precondition may refer to funtions
6410 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
6412 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
6413 within an Entry_Wrapper this is an external call whose target
6414 is the synchronized object that is the actual in the call to
6417 2017-01-06 Yannick Moy <moy@adacore.com>
6419 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
6420 in tree, which means not analyzing the previous prefix if the node has
6421 been rewritten into its prefix.
6423 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6425 * s-tpobop.adb: Minor reformatting.
6427 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6429 * checks.adb (Ensure_Valid): Do not generate a validity check
6430 within a generated predicate function, validity checks will have
6431 been applied earlier when required.
6433 2017-01-06 Tristan Gingold <gingold@adacore.com>
6435 * s-tpoben.ads (Protection_Entries): Add comment and reorder
6436 components for performances.
6437 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
6440 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6442 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
6443 If expression is compile-time known and obeys a static predicate
6444 it must be labelled as static, to prevent spurious warnings and
6445 run-time errors, e.g. in case statements. This is relevant when
6446 the expression is the result of constant-folding a type conversion
6447 whose expression is a variable with a known static value.
6449 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6451 * exp_attr.adb, sem_attr.ads: Minor reformatting.
6453 2017-01-06 Justin Squirek <squirek@adacore.com>
6455 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
6456 expansion of Finalization_Size attribute.
6457 * sem_attr.adb (Analyze_Attribute): Add entry to check the
6458 semantics of Finalization_Size.
6459 (Eval_Attribute): Add null entry for Finalization_Size.
6460 * sem_attr.ads: Add Finalization_Size to the implementation
6461 dependent attribute list.
6462 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
6464 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6466 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
6467 iterator specification with a serious syntactic error, transform
6468 construct into an infinite loop in order to continue analysis
6469 and prevent a compiler abort.
6471 2017-01-06 Tristan Gingold <gingold@adacore.com>
6473 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
6474 max_queue_lengths_array if unused.
6476 2017-01-06 Bob Duff <duff@adacore.com>
6478 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
6479 array access, in case "\" is at the end of Text.
6480 * stylesw.adb (Set_Style_Check_Options): Don't include input
6481 characters in the error message template, because they could
6482 be control characters such as "\", which Errout will try to
6485 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6487 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
6488 For a private type examine the visible declarations that follow
6489 the partial view, not just the private declarations that follow
6492 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6494 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
6497 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6499 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
6500 alias of the inherited op is the parent iterator, no need to
6501 examine dispatch table positions which might not be established
6502 yet if type is not frozen.
6503 * sem_disp.adb (Check_Controlling_Formals): The formal of a
6504 predicate function may be a subtype of a tagged type.
6505 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
6506 of representation items for the completion of a type extension
6507 where a predicate applies to the partial view.
6508 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
6509 parameter that designates function whose actual receives a
6510 predicate check, to improve warning message when the check will
6511 lead to infinite recursion.
6512 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
6513 Apply_Predicate_Check.
6515 2017-01-06 Tristan Gingold <gingold@adacore.com>
6517 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
6518 Gnat_Extended_Ravenscar.
6519 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
6521 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6523 * sem_util.ads: Minor typo fix and reformatting.
6525 2017-01-06 Yannick Moy <moy@adacore.com>
6527 * ghost.adb Minor fixing of references to SPARK RM.
6528 (Check_Ghost_Context): Check whether reference is to a lvalue
6529 before issuing an error about violation of SPARK RM 6.9(13)
6530 when declaration has Ghost policy Check and reference has Ghost
6532 * sem_util.adb Minor indentation.
6533 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
6534 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
6535 * sem_util.ads (Unique_Defining_Entity): Document the result
6536 for package body stubs.
6538 2017-01-06 Tristan Gingold <gingold@adacore.com>
6540 * raise-gcc.c (abort): Macro to call Abort_Propagation.
6541 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
6543 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6544 Do not generate the Entry_Max_Queue_Lengths_Array if all default
6546 * exp_util.adb (Corresponding_Runtime_Package): Consider
6547 Max_Queue_Length pragma.
6549 2017-01-06 Justin Squirek <squirek@adacore.com>
6551 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6552 Remove declaration generation in the case of
6553 System_Tasking_Protected_Objects_Single_Entry being used,
6554 and add a warning message when this is detected to occur.
6555 (Make_Initialize_Protection): Remove reference pass in the case
6556 of System_Tasking_Protected_Objects_Single_Entry.
6557 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
6558 * s-tposen.adb (Initialize_Protection_Entry): Remove
6559 Entry_Queue_Max parameter.
6560 * s-tposen.ads: Remove the types use to store the entry queue
6562 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
6564 2017-01-06 Yannick Moy <moy@adacore.com>
6566 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
6567 behavior of function, to also accept out of range positions
6568 and raise Constraint_Error in such case, and to copy sloc from
6569 literal if No_Location passed as location.
6570 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
6571 of functions to raise Constraint_Error in case of value not in
6574 2017-01-06 Tristan Gingold <gingold@adacore.com>
6576 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
6577 Invalidate_Stack_Cache.
6579 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
6581 * s-os_lib.adb: Minor fix to the signature of Readlink.
6583 2017-01-06 Javier Miranda <miranda@adacore.com>
6585 * sem_ch6.adb (Conforming_Types): Handle another
6586 confusion between views in a nested instance with an actual
6587 private type whose full view is not in scope.
6589 2017-01-06 Arnaud Charlet <charlet@adacore.com>
6591 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
6592 mark a rewritten if statement as explicit (Comes_From_Source).
6594 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6596 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
6598 2017-01-06 Tristan Gingold <gingold@adacore.com>
6600 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
6602 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6604 * sem_case.adb: Minor reformatting.
6606 2017-01-06 Thomas Quinot <quinot@adacore.com>
6608 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
6610 2017-01-06 Justin Squirek <squirek@adacore.com>
6612 * aspects.adb: Register aspect in Canonical_Aspect.
6613 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
6614 into respective tables.
6615 * einfo.ads, einfo.adb: Add a new attribute for
6616 handling the parameters for Pragma_Max_Entry_Queue
6617 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
6618 for accessing and setting were added as well.
6619 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
6620 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
6621 declaration for pramga arguments and store them in the protected
6623 (Make_Initialize_Protection): Pass a reference to
6624 the Entry_Max_Queue_Lengths_Array in the protected type node to
6626 * rtsfind.adb: Minor grammar fix.
6627 * rtsfind.ads: Register new types taken from the
6628 runtime libraries RE_Protected_Entry_Queue_Max and
6629 RE_Protected_Entry_Queue_Max_Array
6630 * s-tposen.adb, s-tpoben.adb
6631 (Initialize_Protection_Entry/Initialize_Protection_Entries):
6632 Add extra parameter and add assignment to local object.
6633 * s-tposen.ads, s-tpoben.ads: Add new types to
6634 store entry queue maximums and a field to the entry object record.
6635 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
6636 for Aspect_Max_Queue_Length.
6637 (Check_Aspect_At_Freeze_Point):
6638 Add aspect to list of aspects that don't require delayed analysis.
6639 * sem_prag.adb (Analyze_Pragma): Add case statement for
6640 Pragma_Max_Queue_Length, check semantics, and register arugments
6641 in the respective entry nodes.
6642 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
6643 and Has_Max_Queue_Length
6644 * snames.ads-tmpl: Add constant for the new aspect-name
6645 Name_Max_Queue_Length and corrasponding pragma.
6647 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6649 * exp_util.adb (Is_Controlled_Function_Call):
6650 Reimplemented. Consider any node which has an entity as the
6651 function call may appear in various ways.
6653 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6655 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
6656 an unchecked type conversion when performing a view conversion
6657 to/from a private type. In all other cases use a regular type
6658 conversion to ensure that any relevant checks are properly
6661 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6663 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
6665 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6667 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
6668 error on case expression that is an entity, when coverage is
6669 incomplete and entity has a static value obtained by local
6671 (Handle_Static_Predicate): New procedure, subsidiary of
6672 Check_Choices, to handle case alternatives that are either
6673 subtype names or subtype indications involving subtypes that
6674 have static predicates.
6676 2017-01-06 Thomas Quinot <quinot@adacore.com>
6678 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
6679 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
6681 2017-01-06 Bob Duff <duff@adacore.com>
6683 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
6684 Elaborate_All(P) to P itself. That could happen in obscure cases,
6685 and always introduced a cycle (P body must be elaborated before
6687 * lib-writ.ads: Comment clarification.
6688 * ali-util.ads: Minor comment fix.
6689 * ali.adb: Minor reformatting.
6691 2017-01-06 Tristan Gingold <gingold@adacore.com>
6693 * a-exexpr-gcc.adb: Improve comment.
6695 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
6697 * s-linux-mips.ads: Use correct signal and errno constants.
6698 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
6700 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
6702 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
6703 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
6706 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
6708 * gnatvsn.ads: Bump copyright year.
6710 2017-01-01 Jakub Jelinek <jakub@redhat.com>
6712 * gnat_ugn.texi: Bump @copying's copyright year.
6713 * gnat_rm.texi: Likewise.
6715 Copyright (C) 2017 Free Software Foundation, Inc.
6717 Copying and distribution of this file, with or without modification,
6718 are permitted in any medium without royalty provided the copyright
6719 notice and this notice are preserved.