1 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
3 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
4 there is no target, do not create a temporary for the return value for
7 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
9 * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
10 unconstrained array type.
12 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
13 Alan Hayward <alan.hayward@arm.com>
14 David Sherwood <david.sherwood@arm.com>
16 * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
17 instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
19 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
20 Alan Hayward <alan.hayward@arm.com>
21 David Sherwood <david.sherwood@arm.com>
23 * gcc-interface/decl.c (check_ok_for_atomic_type): Use
24 is_a <scalar_int_mode>.
25 * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
26 * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
28 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
29 Alan Hayward <alan.hayward@arm.com>
30 David Sherwood <david.sherwood@arm.com>
32 * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
33 instead of mode_for_size.
34 (gnat_to_gnu_subprog_type): Likewise.
35 * gcc-interface/utils.c (make_type_from_size): Likewise.
37 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
38 Alan Hayward <alan.hayward@arm.com>
39 David Sherwood <david.sherwood@arm.com>
41 * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
42 (fp_size_to_prec): Likewise.
44 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
45 Alan Hayward <alan.hayward@arm.com>
46 David Sherwood <david.sherwood@arm.com>
48 * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
49 <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
51 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
52 Alan Hayward <alan.hayward@arm.com>
53 David Sherwood <david.sherwood@arm.com>
55 * gcc-interface/decl.c (validate_size): Update use of
56 GET_MODE_WIDER_MODE, forcing a wider mode to exist.
58 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
59 Alan Hayward <alan.hayward@arm.com>
60 David Sherwood <david.sherwood@arm.com>
62 * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
63 (fp_size_to_prec): Likewise.
65 2017-08-29 Martin Liska <mliska@suse.cz>
68 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
70 2017-08-08 Martin Liska <mliska@suse.cz>
72 * gcc-interface/trans.c: Include header files.
74 2017-07-29 Jakub Jelinek <jakub@redhat.com>
76 * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
77 as new argument to the imported_module_or_decl debug hook.
79 2017-07-25 Javier Miranda <miranda@adacore.com>
81 * checks.adb (Apply_Divide_Checks): Ensure that operands are not
84 2017-07-19 Jakub Jelinek <jakub@redhat.com>
86 * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
87 TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
88 (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
90 2017-07-18 Mike Frysinger <vapier@chromium.org>
92 * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
93 (../../gnatlink$(exeext)): Likewise.
95 2017-07-15 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
98 * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
99 (Backend_Overflow_Checks): Set to True.
101 2017-06-23 Jakub Jelinek <jakub@redhat.com>
103 * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
105 2017-06-21 Pierre-Marie de Rodat <derodat@adacore.com>
107 * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
109 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
111 (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
113 * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
114 imported subprograms for the current compilation unit as
115 definitions. Disable debug info for references to variables.
116 * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
117 * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
118 not built-in functions to their binding scope.
119 (create_subprog_decl): Add a DEFINITION parameter. If it is true, tag
120 the function as a definition. Update all callers.
121 (gnat_write_global_declarations): Emit debug info for imported
122 functions. Filter out external variables for which debug info
125 2017-06-15 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
128 * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
129 (i[3456]86-pc-gnu): Likewise.
130 (x86_64 kfreebsd): Likewise.
132 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
135 * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
137 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
140 * s-interr-hwint.adb: Reinstate.
141 * gcc-interface/Makefile.in (RTEMS): Use it again.
143 2017-06-08 Olivier Hainque <hainque@adacore.com>
145 * vx_crtbegin_auto.c: Update year in copyright notice.
146 * vx_crtbegin.c: Likewise.
147 * vx_crtbegin.inc: Likewise.
148 * vx_crtend.c: Likewise.
150 2017-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
152 * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
153 * s-tpopsp-rtems.adb: Delete.
155 2017-06-02 Olivier Hainque <hainque@adacore.com>
157 * vx_crtbegin_auto.c: New file.
158 * vx_crtbegin.c: New file.
159 * vx_crtbegin.inc: New file.
160 * vx_crtend.c: New file.
162 2017-05-25 Jonathan Wakely <jwakely@redhat.com>
164 * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
165 const qualifiers that cause -Wignored-qualifiers warnings.
167 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
169 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
170 for Itypes that are E_Access_Subtype.
171 <E_Access_Subtype>: Use the DECL of the base type directly.
173 2017-05-22 Ed Schonberg <schonberg@adacore.com>
174 Eric Botcazou <ebotcazou@adacore.com>
176 * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
177 limited view may appear in the profile of a function, and a call to
178 that function in another unit in which the full view is available must
179 use this full view to spurious type errors at the point of call.
180 * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
181 of parent body with a with clause for the main unit.
182 * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
183 (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
184 types declared in external units like types from limited with clauses.
185 Adjust final processing of defer_limited_with_list accordingly.
186 * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
187 again to translate the prefix after the field if it is incomplete.
189 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
191 * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
192 alignment for simple volatile fields and remove associated errors.
194 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
196 * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
197 * gcc-interface/trans.c (get_elaboration_procedure): Make static.
199 2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
201 * gcc-interface/utils.c (can_materialize_object_renaming_p):
202 Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
203 process Original_Node instead of expanded names.
205 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
207 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
208 addressability check in the constrained case.
210 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
212 * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
213 types not coming from a limited context.
215 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
217 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
218 the inlined list that are not public.
219 * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
220 there is a pragma Inline_Always on the subprogram.
222 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
224 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
225 <N_Allocator>: Use properly typed constants.
226 (extract_values): Move around.
227 (pos_to_constructor): Minor tweaks.
228 (Sloc_to_locus): Fix formatting.
229 * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
230 * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
231 (Gigi_Equivalent_Type): Adjust head comment.
232 * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
234 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
236 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
237 is a representation clause on an extension, propagate the alignment of
238 the parent type only if the platform requires strict alignment.
240 2017-05-12 Eric Botcazou <ebotcazou@adacore.com>
242 * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
243 instead of Word_Size.
246 2017-03-28 Andreas Schwab <schwab@suse.de>
249 * system-linux-aarch64-ilp32.ads: New file.
250 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
251 from LIBGNAT_TARGET_PAIRS.
252 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
253 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
254 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
255 or -mabi=ilp32, resp.
257 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
260 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
261 instead of Word_Size.
263 2017-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
265 * raise-gcc.c (exception_class_eq): Make ec parameter const.
267 2017-05-02 Richard Biener <rguenther@suse.de>
269 * gcc-interface/misc.c (gnat_post_options): Do not set
272 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
274 * gcc-interface/trans.c (assoc_to_constructor): Make sure
275 Corresponding_Discriminant is only called on discriminants.
276 Skip the saving of the result only for them.
277 (gnat_to_gnu) <N_Selected_Component>: Likewise.
278 <N_Unchecked_Type_Conversion>: Translate the result type first.
279 (gigi): Set TREE_NOTHROW on Begin_Handler.
280 (stmt_list_cannot_raise_p): New predicate.
281 (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
282 a cleanup if the statements of the handler cannot raise.
283 (process_freeze_entity): Use Is_Record_Type.
284 (process_type): Likewise.
286 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
288 * einfo.ads (Corresponding_Record_Component): New alias
289 for Node21 used for E_Component and E_Discriminant.
290 * einfo.adb (Corresponding_Record_Component): New function.
291 (Set_Corresponding_Record_Component): New procedure.
292 (Write_Field21_Name): Handle Corresponding_Record_Component.
293 * sem_ch3.adb (Inherit_Component): Set
294 Corresponding_Record_Component for every component in
295 the untagged case. Clear it afterwards for non-girder
297 * gcc-interface/decl.c (gnat_to_gnu_entity)
298 <E_Record_Type>: For a derived untagged type with discriminants
299 and constraints, apply the constraints to the layout of the
300 parent type to deduce the layout.
301 (field_is_aliased): Delete.
302 (components_to_record): Test DECL_ALIASED_P directly.
303 (annotate_rep): Check that fields are present except for
305 (create_field_decl_from): Add DEBUG_INFO_P
306 parameter and pass it in recursive and other calls. Add guard
307 for the manual CSE on the size.
308 (is_stored_discriminant): New predicate.
309 (copy_and_substitute_in_layout): Consider only
310 stored discriminants and check that original fields are present
311 in the old type. Deal with derived types. Adjust call to
312 create_variant_part_from.
314 2017-05-02 Ed Schonberg <schonberg@adacore.com>
316 * exp_ch6.adb (Expand_Call_Helper): When locating the
317 accessibility entity created for an access parameter, handle
318 properly a reference to a formal of an enclosing subprogram. if
319 the reference appears in an inherited class-wide condition, it
320 is the rewriting of the reference in the ancestor expression,
321 but the accessibility entity must be that of the current formal.
323 2017-05-02 Javier Miranda <miranda@adacore.com>
325 * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
326 (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
327 Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
328 Call Expand_Non_Binary_Modular_Op.
330 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
332 * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
333 has discriminants, do not override the Stored_Constraint list of
334 the full view of the derived type with that of the derived type.
336 2017-05-02 Bob Duff <duff@adacore.com>
338 * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
340 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
342 * s-os_lib.ads: Minor typo fix.
344 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
346 * gnatls.adb: Merge and refactor code from Prj.Env and remove
347 this deprecated dependency.
349 2017-05-02 Ed Schonberg <schonberg@adacore.com>
351 * exp_util.ads: minor comment addition.
353 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
355 * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
356 pastos in part #3 of the head comment.
358 2017-05-02 Ed Schonberg <schonberg@adacore.com>
360 * exp_ch3.adb (Freeze_Type): Do not generate an invariant
361 procedure body for a local (sub)type declaration within a
362 predicate function. Invariant checks do not apply to these, and
363 the expansion of the procedure will happen in the wrong scope,
364 leading to misplaced freeze nodes.
366 2017-05-02 Ed Schonberg <schonberg@adacore.com>
368 * exp_util.adb (Insert_Library_Level_Action): Use proper scope
369 to analyze generated actions. If the main unit is a body,
370 the required scope is that of the corresponding unit declaration.
372 2017-05-02 Arnaud Charlet <charlet@adacore.com>
374 * einfo.adb (Declaration_Node): flip branches of
375 an IF statement to avoid repeated negations in its condition;
376 no change in semantics, only to improve readability.
378 2017-05-02 Arnaud Charlet <charlet@adacore.com>
380 * sem_case.adb: Remove extra spaces in parameter declarations.
382 2017-05-02 Justin Squirek <squirek@adacore.com>
384 * usage.adb: Replace space with hyphen ("run time" -> "run-time")
385 in usage line for new -gnatwE switch.
387 2017-05-02 Claire Dross <dross@adacore.com>
389 * a-cofuve.ads (Remove): Remove unnecessary
390 conditions in precondition.
392 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
394 * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
395 sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
397 2017-05-02 Justin Squirek <squirek@adacore.com>
399 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
400 alternative expression.
401 * sem_res.adb (Resolve_Case_Expression): Ditto.
403 2017-05-02 Ed Schonberg <schonberg@adacore.com>
405 * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
406 Refine predicate for the case where the primitive operation
407 is a renaming of equality. An overriding operation that is
408 a user-defined renaming of predefined equality inherits its
409 slot from the overridden operation. Otherwise it is treated
410 as a predefined op and occupies the same predefined slot as
411 equality. A call to it is transformed into a call to its alias,
412 which is the predefined equality. A dispatching call thus uses
413 the proper slot if operation is further inherited and called
414 with class-wide arguments.
416 2017-05-02 Justin Squirek <squirek@adacore.com>
418 * errout.adb (Set_Msg_Text): Add a case to switch the message
419 type when the character '[' is detected signifying a warning
420 about a run-time exception.
421 * opt.ads Add a new Warning_Mode value for new switch
422 * switch-b.adb (Scan_Binder_Switches): Add case for the binder
423 to handle new warning mode
424 * usage.adb (Usage): Add usage entry for -gnatwE
425 * warnsw.adb (Set_Warning_Switch): Add case for the new switch
427 2017-05-02 Ed Schonberg <schonberg@adacore.com>
429 * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
430 declaration that operates on some fixed point type.
432 2017-05-02 Justin Squirek <squirek@adacore.com>
434 * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
436 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
438 * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
440 2017-05-02 Justin Squirek <squirek@adacore.com>
442 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
443 expression (Analyze_If_Expression): Add check for valid condition
444 * sem_eval.adb (Eval_Case_Expression): Add check for error posted
446 * sem_res.adb (Resolve_If_Expression): Add check for valid
447 condition and then-expression.
449 2017-05-02 Ed Schonberg <schonberg@adacore.com>
451 * exp_ch3.adb (Build_Initialization_Call): Generate a null
452 statement if the initialization call is a null procedure, as
453 can happen with a controlled type with no explicit Initialize
454 procedure, or an array of such.
455 * exp_ch7.adb (Process_Object_Declaration): For a type with
456 controlled components that has a trivial Initialize procedure,
457 insert declaration for finalization counter after object
459 (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
460 finalization block and attendant declarations if component has
461 a trivial Initialize procedure.
462 (Make_Init_Call): Do not generate a call if controlled type has
463 a trivial Initialize procedure.
465 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
467 * g-forstr.ads (Data): Move Format component last.
468 * g-forstr.adb ("+"): Adjust for above change.
469 * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
470 * g-sechas.ads (Context): Move Key last.
471 * g-socket.ads (Service_Entry_Type): Move Aliases last.
472 * s-fileio.adb (Temp_File_Record): Move Name last.
473 * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
474 * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
476 2017-05-02 Jerome Lambourg <lambourg@adacore.com>
478 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
479 switch introduced recently. finally not needed.
481 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
483 * sem_ch6.adb (Analyze_Null_Procedure): Set the
484 Corresponding_Body link for a null procedure declaration.
486 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
488 * atree.h (Flag290): Add missing terminating parenthesis.
489 * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
490 (Set_Is_Class_Wide_Clone): Likewise.
491 * einfo.ads (Is_Class_Wide_Clone): Likewise.
493 2017-05-02 Gary Dismukes <dismukes@adacore.com>
495 * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
496 parameter Array_Comp to indicate the case of an array object
497 with null-excluding components.
498 * checks.adb (Null_Exclusion_Static_Checks):
499 Call Compile_Time_Constraint_Error instead of
500 Apply_Compile_Time_Constraint_Error in the component case. Also
501 call that when Array_Comp is True, with an appropriate warning for
502 the array component case. Only create an explicit initialization
503 by null in the case of an object of a null-excluding access type
504 (and no longer do that in the component case).
505 * sem_ch3.adb (Check_Component): Add a Boolean parameter
506 Array_Comp defaulted to False. Pass Empty for the Comp
507 actual when calling Null_Exclusion_Static_Checks in the case
508 where Comp_Decl matches Object_Decl, because we don't have a
509 component in that case. In the case of an object or component
510 of an array type, pass True for Array_Comp on the recursive call
513 2017-05-02 Bob Duff <duff@adacore.com>
515 * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
516 compute the linux priority from the Ada priority. Call this everywhere
517 required. In particular, the previous version was not doing this
518 computation when setting the ceiling priority in various places. It
519 was just converting to C.int, which results in a ceiling that is off
522 2017-05-02 Ed Schonberg <schonberg@adacore.com>
524 * sem_ch3.adb: Comment predicate inheritance.
526 2017-05-02 Tristan Gingold <gingold@adacore.com>
528 * s-trasym.ads: Add comment.
530 2017-05-02 Bob Duff <duff@adacore.com>
532 * sem_elab.adb, sem_elab.ads: Minor comment fixes.
533 * sem_ch4.adb: Minor reformatting.
534 * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
535 * s-taspri-posix-noaltstack.ads: Minor refactoring.
536 * sinput.ads: Minor typo fix.
538 2017-05-02 Ed Schonberg <schonberg@adacore.com>
540 * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
541 * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
542 here from exp_ch9, to recognize objects whose creation requires
543 dynamic allocation, so that the proper warning can be emitted
544 when restriction No_Implicit_Heap_Allocation is in effect.
545 * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
546 to emit proper warning when an object that requires dynamic
547 allocation is declared.
549 2017-05-02 Tristan Gingold <gingold@adacore.com>
551 * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
553 2017-05-02 Ed Schonberg <schonberg@adacore.com>
555 * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
556 visibility rules for equality operators that apply within an
557 instantiation apply within an inlined body.
558 * sem_type.adb (Add_One_Interp): ditto.
560 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
562 * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
565 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
568 (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
569 Name_No_Tagged_Streams): Move to regular pragmas. Add
570 placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
571 and Secondary_Stack_Size.
572 (Pragma_Id): Move Pragma_Assume,
573 Pragma_Attribute_Definition, Pragma_Loop_Optimize and
574 Pragma_No_Tagged_Streams to second part.
576 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
578 * exp_attr.adb: Minor reformatting.
580 2017-05-02 Ed Schonberg <schonberg@adacore.com>
582 * sem_ch4.adb (Analyze_Selected_Component): Improve error
583 detection for illegal references to private components or
584 operations of a protected type in the body of the type.
586 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
588 * opt.ads: Add missing GNAT markers in comments.
589 * opt.adb (Set_Opt_Config_Switches): Do not override earlier
590 settings of Optimize_Alignment at the end.
592 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
594 * checks.adb (Apply_Constraint_Check): Do not apply
595 a discriminant check when the associated type is a constrained
596 subtype created for an unconstrained nominal type.
597 * exp_attr.adb: Minor reformatting.
599 2017-05-02 Bob Duff <duff@adacore.com>
601 * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
602 the N_Raise_Expression case.
603 * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
606 2017-05-02 Yannick Moy <moy@adacore.com>
608 * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
609 optimize length comparison in GNATprove mode.
610 * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
611 operator /= into negation of operator = when needed.
612 (Expand_SPARK): Call new
613 function to expand operator /=.
615 2017-05-02 Ed Schonberg <schonberg@adacore.com>
617 * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
618 Simplify the expression for a fixed-fixed division to remove
619 divisions by constants whenever possible, as an optimization
620 for restricted targets.
622 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
624 * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
626 2017-05-02 Bob Duff <duff@adacore.com>
628 * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
629 to find primitive ops, instead of using an Identifier that will
630 later be looked up. This is necessary because these ops are not
631 necessarily visible at all places where we need to call them.
632 * exp_util.ads: Minor comment fix.
634 2017-05-02 Ed Schonberg <schonberg@adacore.com>
636 * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
637 references are fully conformant if they are both expansions
638 of the discriminant of a protected type, within one of the
639 protected operations. One occurrence may be expanded into a
640 constant declaration while the other is an input parameter to
641 the corresponding generated subprogram.
643 2017-05-02 Justin Squirek <squirek@adacore.com>
645 * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
646 recursivly searching composite-types for null-excluding access
647 types and verifying them.
648 (Analyze_Object_Declaration): Add a
649 call to Check_Null_Excluding_Components for static verification
650 of non-initialized objects.
651 * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
652 a parameter for a composite-type's component and an extra case
653 for printing component information.
655 2017-05-02 Yannick Moy <moy@adacore.com>
657 * sem_ch10.adb (Analyze_Subunit): Take
658 configuration pragma into account when restoring appropriate
659 pragma for analysis of subunit.
661 2017-05-02 Justin Squirek <squirek@adacore.com>
663 * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
664 s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
665 g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
666 clauses from the runtime.
668 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
670 * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
671 array components specially.
673 2017-05-02 Ed Schonberg <schonberg@adacore.com>
675 * sem_ch8.adb (Premature_Usage): If the premature usage of
676 an entity is as the expression in its own object decaration,
677 rewrite the reference as Any_Id to prevent cascaded errors or
678 compiler loops when such an entity is used in an address clause.
680 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
682 * gcc-interface/decl.c (components_to_record): Add missing guard.
684 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
686 * gcc-interface/decl.c (components_to_record): Add more comments.
687 Put back pending fields onto the regular list if the misalignment
688 happens to cancel itself.
690 2017-04-28 Ed Schonberg <schonberg@adacore.com>
692 * sem_ch4.adb (Complete_Object_Operation): When rewriting the
693 controlling actual in a prefixed call, preserve the original node
694 information if the prefix itself has been rewritten, for ASIS use.
696 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
698 * exp_ch6.adb (Insert_Post_Call_Actions):
699 Code clean up. Insert the post-call actions after an enclosing
700 procedure call when N denotes a function call and appears as an
701 actual parameter in the procedure call.
703 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
705 * freeze.adb (Check_Component_Storage_Order): If there is a clause
706 for the component, also reject the attribute if the component
707 doesn't end on a byte boundary and its scalar storage order is
708 different from that of the enclosing record type.
710 2017-04-28 Javier Miranda <miranda@adacore.com>
712 * atree.ads (Info_Messages): Removed.
713 (Warning_Info_Messages): New counter.
714 (Report_Info_Messages): New counter.
715 * err_vars.ads Update documentation.
716 * errout.adb (Delete_Warning_And_Continuations): Update
717 Info_Message occurrences.
718 (Error_Msg_Internal): Update Info_Message occurrences.
719 (Delete_Warning): Update Info_Message occurrences.
720 (Write_Error_Summary): Update Info_Message occurrences.
721 (Output_Messages): Update Info_Message occurrences.
722 (To_Be_Removed): Update Info_Message occurrences.
723 (Reset_Warnings): Update Info_Message occurrences.
724 * errutil.adb (Error_Msg): Update Info_Message occurrences.
725 (Finalize): Update Info_Message occurrences.
726 (Initialize): Update Info_Message occurrences.
727 * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
728 (Compilation_Errors): Update Info_Message_Occurences.
730 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
732 * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
733 * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
734 * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
735 * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
736 * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
737 * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
739 * sem_eval.adb (Why_Not_Static): Initialize Typ.
740 * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
742 2017-04-28 Bob Duff <duff@adacore.com>
744 * sem_util.ads, sem_util.adb (Might_Raise): New function
745 that replaces Is_Exception_Safe, but has the opposite
746 sense. Is_Exception_Safe was missing various cases -- calls inside
747 a pragma Debug, calls inside an 'if' or assignment statement,
748 etc. Might_Raise now walks the entire subtree looking for things
750 * exp_ch9.adb (Is_Exception_Safe): Remove.
751 (Build_Protected_Subprogram_Body): Replace call to
752 Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
753 constants where possible).
754 * exp_ch7.adb: Rename Is_Protected_Body -->
755 Is_Protected_Subp_Body. A protected_body is something different
758 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
760 * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
761 * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
762 (P_Discrete_Choice_List): Initialize Expr_Node variable.
763 * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
764 (P_Protected): Likewise.
765 * sem_case.adb (Check_Duplicates):
766 Add pragma Warnings on variable.
767 * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
768 * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable.
769 * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
770 (Analyze_Exit_Statement): Initialize Scope_Id variable.
771 (Analyze_Iterator_Specification): Initialize Bas variable.
772 * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
773 Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
774 (Analyze_Accept_Statement): Initialize Task_Nam.
776 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
778 * checks.adb (Install_Primitive_Elaboration_Check):
779 Do not generate an elaboration check if all checks have been
782 2017-04-28 Ed Schonberg <schonberg@adacore.com>
784 * sem_ch13.adb (Analyze_Aspect_Specifications, case
785 Interrupt_Handler and Attach_Handler): Generate reference
786 to protected operation to prevent spurious warnings about
787 unreferenced entities. Previous scheme failed with style checks
790 2017-04-28 Ed Schonberg <schonberg@adacore.com>
792 * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
793 that follows an expression function must not be relocated to
794 the generated body, because it applies to the code that follows.
796 2017-04-28 Gary Dismukes <dismukes@adacore.com>
798 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
799 Relaxed_RM_Semantics to avoid having CodePeer issue errors on
800 code that might violate the more stringent checking for 'Access
801 introduced in Ada 2005.
803 2017-04-28 Arnaud Charlet <charlet@adacore.com>
805 * a-cforse.adb: minor style fix in comment.
807 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
809 * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
810 initialize Block_Decls variable.
811 (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
812 (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
813 * exp_disp.adb (Expand_Interface_Actuals): Initialize
814 Formal_DDT and Actual_DDT variables.
815 (Expand_Interface_Thunk): Initialize Iface_Formal.
816 (Make_DT): Initialize Size_Comp.
817 (Make_Select_Specific_Data_Table): Initialize Decls.
818 * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
819 Also initialize more RPC_Receiver_* variables.
820 (Build_To_Any_Function): Initialize Cstr_Formal.
821 * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
823 2017-04-28 Ed Schonberg <schonberg@adacore.com>
825 * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
826 node between access types, freeze the designated type as well,
827 so that dispatch table pointers are created in the proper scope,
828 and not in the constructed body of the expression function.
830 2017-04-28 Bob Duff <duff@adacore.com>
832 * alloc.ads (Nodes_Initial): Go back to previous value. The large
833 value makes large compilations faster, but small compilations slower.
835 2017-04-28 Arnaud Charlet <charlet@adacore.com>
837 * sem_util.adb: minor typos in Is_Child_Or_Sibling.
839 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
841 * erroutc.adb (Compilation_Errors): Do not consider info messages
842 as suitable warnings when warnings must be treated as errors.
843 * sem_ch7.adb (Analyze_Package_Specification): Do not consider
844 internally-generated packages when outputting completion
846 * errout.adb (Output_Messages): Do not consider info messages as
847 suitable warnings when warnings must be treated as errors.
848 * errutil.adb (Finalize): Do not consider info messages as
849 suitable warnings when warnings must be treated as errors.
851 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
853 * warnsw.ads: Minor fix for incorrect wording in comment.
855 2017-04-28 Ed Schonberg <schonberg@adacore.com>
857 * sem_res.adb (In_Instance_Code): New predicate in
858 Valid_Conversion, to determine whether a type conversion appears
859 as (or within) an actual for a formal object. Type conversions
860 in instances are not rechecked in Valid_Conversion because
861 visibility changes between generic location andi instance may
862 lead to spurious errors, but conversions within an actual must be
863 fully checked, and they are not fully resolved when pre-analyzing
866 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
868 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
869 New_Copy_Tree instead of Relocate_Node as any subsequent copies
870 of the relocated node will have mangled Parent pointers.
871 * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
872 tables used in conjunction with entity and itype replication.
873 (Visit_Entity): Rewrite the restriction on which entities
874 require duplication. The restriction now includes all types.
876 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
878 * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
879 a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
880 a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
883 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
885 * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
886 gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
888 2017-04-28 Gary Dismukes <dismukes@adacore.com>
890 * exp_util.adb: Minor reformatting.
892 2017-04-28 Ed Schonberg <schonberg@adacore.com>
894 * sem_ch4.adb: Fix copy/pasto.
896 2017-04-27 Tristan Gingold <gingold@adacore.com>
898 * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
899 raise-gcc.c. Fix include search path for raise-gcc.c
901 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
903 * fe.h (Warn_On_Questionable_Layout): Declare.
904 * warnsw.ads (Warn_On_Record_Holes): Move down.
905 (Warn_On_Questionable_Layout): New boolean variable.
906 (Warning_Record): Add Warn_On_Questionable_Layout field.
907 * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
908 (Restore_Warnings): Likewise.
909 (Save_Warnings): Likewise.
910 (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
911 * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
912 components_to_record.
913 (gnu_field_to_gnat): New function.
914 (warn_on_field_placement): Likewise.
915 (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
916 parameters. Rename local variables and adjust recursive call.
917 Rework final scan of the field list and implement warnings on the
918 problematic placement of specific sorts of fields.
920 2017-04-27 Bob Duff <duff@adacore.com>
922 * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
923 * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
924 * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
925 * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
926 * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
927 * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
928 For efficiency, cache results of Is_Internal_File_Name and
929 Is_Predefined_File_Name in the Units table. This avoids a lot
930 of repeated text processing.
932 2017-04-27 Emmanuel Briot <briot@adacore.com>
934 * g-comlin.adb (Sort_Sections): remove useless test.
936 2017-04-27 Claire Dross <dross@adacore.com>
938 * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
939 allow the use of regular equality over elements in contracts.
940 (Formal_Model): Ghost package containing model functions that are
941 used in subprogram contracts.
942 (Current_To_Last): Removed, model functions should be used instead.
943 (First_To_Previous): Removed, model functions should be used instead.
944 (Strict_Equal): Removed, model functions should be used instead.
945 (No_Overlap): Removed, model functions should be used instead.
946 (Equivalent_Keys): Functions over cursors are removed. They were
947 awkward with explicit container parameters.
948 * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
949 allow the use of regular equality over elements in contracts.
950 (Formal_Model): Ghost package containing model functions that
951 are used in subprogram contracts.
952 (Current_To_Last): Removed, model functions should be used instead.
953 (First_To_Previous): Removed, model functions should be used instead.
954 (Strict_Equal): Removed, model functions should be used instead.
955 (No_Overlap): Removed, model functions should be used instead.
957 2017-04-27 Yannick Moy <moy@adacore.com>
959 * gnat1drv.adb: Code cleanup.
961 2017-04-27 Ed Schonberg <schonberg@adacore.com>
963 * exp_util.adb (Replace_Entity): The prefix of a 'Result
964 attribute reference in a post- condition is the subprogram to
965 which the condition applies. If the condition is inherited
966 by a type extension, the prefix becomes a reference to the
967 inherited operation, but there is no need to create a wrapper
968 for this operation, because 'Result is expanded independently
969 when elaborating the postconditions.
971 2017-04-27 Bob Duff <duff@adacore.com>
973 * sinput.adb: Minor code cleanup.
974 * namet.adb (Append): Create faster versions of
975 Append(String) and Append(Name_Id) by using slice assignment
977 * sem_util.adb (In_Instance): Speed this up by removing
978 unnecessary tests; Is_Generic_Instance is defined for all
980 * sem_util.ads, sem_util.adb (In_Parameter_Specification):
981 Remove unused function.
982 * alloc.ads (Nodes_Initial): Use a much larger value, because
983 the compiler was spending a lot of time copying the nodes table
984 when it grows. This number was chosen in 1996, so is rather out
985 of date with current memory sizes. Anyway, it's virtual memory.
986 Get rid of Orig_Nodes_...; use Node_... instead.
987 * atree.adb (Lock): Do not release the Nodes tables; it's a
989 Orig_Nodes_ ==> Nodes_
990 * nlists.adb: Orig_Nodes_ ==> Nodes_
991 * g-table.adb: Remove unused "with" clause.
992 * g-table.ads, table.ads: Remove Big_Table_Type, which should
993 not be used by clients.
994 * g-dyntab.adb (Last_Allocated): New function
995 to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
997 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
999 * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
1001 (Subtypes_Statically_Match): Remove duplicate check.
1002 * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
1004 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1006 * exp_aggr.adb (Replace_Type): Remove the special processing
1007 for selected components.
1008 * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
1009 processing for attributes Fixed_Value and Integer_Value.
1010 * exp_util.adb (Side_Effect_Free): Merge the processing for
1011 qualified expressions, type conversions, and unchecked type
1013 * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
1015 * par-ch3.adb (P_Declarative_Items): Merge the processing for
1016 tokens function, not, overriding, and procedure.
1017 * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
1018 for qualified expressions, type conversions, and unchecked
1020 * sem_util.adb (Compile_Time_Constraint_Error): Merge the
1021 processing for Ada 83 and instances.
1022 (Object_Access_Level): Merge the processing for indexed components
1023 and selected components.
1024 * uname.adb (Add_Node_Name): Merge the processing for stubs.
1026 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1028 * checks.adb (Install_Primitive_Elaboration_Check):
1029 Do not generate the check when restriction No_Elaboration_Code
1032 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1034 * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
1035 of Expand_Dispatching_Call. If the denoted subprogram has a
1036 class-wide precondition, this is the only precondition that
1037 applies to the call, rather that the class-wide preconditions
1038 that may apply to the body that is executed. (This is specified
1041 2017-04-27 Yannick Moy <moy@adacore.com>
1043 * gnat1drv.adb (Adjust_Global_Switches): Issue
1044 a warning in GNATprove mode if the runtime library does not
1045 support IEEE-754 floats.
1047 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1049 * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
1050 is itself inherited it does not carry any contract information,
1051 so examine its parent operation which is its Alias.
1053 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1055 * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
1056 prefix can be an object reference in which case Obj'Image (X)
1057 can only be interpreted as an indexing of the parameterless
1058 version of the attribute.
1059 * par-ch4.adb (P_Name): An attribute reference can be the prefix of
1060 an indexing or a slice operation if the attribute does not require
1061 parameters. In Ada2012 'Image also belongs in this category,
1062 and A'Image (lo .. hi) is legal and must be parsed as a slice.
1064 2017-04-27 Yannick Moy <moy@adacore.com>
1066 * exp_ch4.adb: Minor reformatting.
1067 * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
1068 disable the CodePeer and C generation modes. Similar to the
1069 opposite actions done in CodePeer mode.
1071 2017-04-27 Yannick Moy <moy@adacore.com>
1073 * sem_res.adb: Remove duplicate code.
1074 * sem_attr.adb: Delete duplicate code.
1076 2017-04-27 Bob Duff <duff@adacore.com>
1078 * g-dyntab.adb: Reduce the amount of copying in
1079 Release. No need to copy items past Last.
1081 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1083 * checks.adb Add with and use clauses for Sem_Disp.
1084 (Install_Primitive_Elaboration_Check): New routine.
1085 * checks.ads (Install_Primitive_Elaboration_Check): New routine.
1086 * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
1087 processing of 'Elaborated.
1088 * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
1091 2017-04-27 Bob Duff <duff@adacore.com>
1093 * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
1094 If the table grows and then shrinks back to empty, we won't necessarily
1095 point back to the empty array. Code cleanups.
1096 * sinput.ads: Add 'Base to Size clause to match the declared
1099 2017-04-27 Claire Dross <dross@adacore.com>
1101 * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
1102 allow the use of regular equality over elements in contracts.
1103 (Formal_Model): Ghost package containing model functions that
1104 are used in subprogram contracts.
1105 (Current_To_Last): Removed, model functions should be used instead.
1106 (First_To_Previous): Removed, model functions should be used instead.
1107 (Strict_Equal): Removed, model functions should be used instead.
1108 (No_Overlap): Removed, model functions should be used instead.
1109 * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
1110 Boolean generic parameter to disable contracts for equivalence
1112 (Witness): Create a witness of a key that is used for handling of
1113 equivalence between keys.
1114 (Has_Witness): Check whether a witness is contained in a map.
1115 (W_Get): Get the element associated to a witness.
1116 (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
1118 * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
1119 Boolean generic parameter to disable contracts for equivalence
1121 * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
1122 of equivalence on functional maps.
1123 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
1124 of equivalence on functional maps.
1126 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1128 * exp_ch9.adb (Expand_Entry_Barrier): Code
1129 cleanup. Do not perform the optimization which removes the
1130 declarations of the discriminant and component renamings when
1131 validity checks on operands and attributes are in effect.
1133 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1135 * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
1136 freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
1137 a-cfhama.ads, a-cofove.ads: Minor reformatting.
1139 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1141 * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
1142 pointer dereference.
1143 * g-spipat.adb (Dump): Code clean up. Protect against a possible
1144 null pointer dereference.
1146 2017-04-27 Bob Duff <duff@adacore.com>
1148 * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
1149 Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
1150 Free renames Init, since they do the same thing.
1151 * g-table.ads: Default for Table_Low_Bound.
1152 * table.ads: Default for Table_Low_Bound, Table_Initial, and
1155 2017-04-27 Bob Duff <duff@adacore.com>
1157 * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
1159 * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
1160 * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
1161 Reorder code so that above assertions do not fail.
1162 * table.ads: Remove obsolete comment on Locked.
1164 2017-04-27 Claire Dross <dross@adacore.com>
1166 * a-cfdlli.ads: Code cleanup.
1168 2017-04-27 Yannick Moy <moy@adacore.com>
1170 * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
1171 when needed for proof. (Expand_SPARK): Call the new procedure.
1172 * exp_util.ads Fix typo.
1174 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1176 * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
1179 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1181 * sem_elab.adb Add new type Visited_Element
1182 and update the contents of table Elab_Visited. Various code clean up.
1183 (Check_Elab_Call): Determine whether a prior call to
1184 the same subprogram was already examined within the same context.
1185 (Check_Internal_Call_Continue): Register the subprogram being
1186 called as examined within a particular context. Do not suppress
1187 elaboration warnings.
1189 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1191 * xoscons.adb, osint.ads: Minor reformatting.
1193 2017-04-27 Bob Duff <duff@adacore.com>
1195 * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
1196 Table_Count_Type --> Table_Last_Type, because the name
1197 was confusing (a "count" usually starts at zero). Add
1198 functionality supported or needed by other tables packages
1199 (Move, Release_Threshold).
1200 * g-table.ads, g-table.adb: This is now just a thin wrapper
1201 around g-dyntab.ads/g-dyntab.adb. Add functionality supported
1202 or needed by other tables packages (Save, Restore).
1203 * table.ads, table.adb: This is now just a thin wrapper around
1204 * g-table.ads/g-table.adb.
1205 * namet.h, scos.h, uintp.h: These files are reaching into the
1206 private data of some instances of g-table, whose names changed,
1207 so the above change requires some adjustment here. It now uses
1210 2017-04-27 Bob Duff <duff@adacore.com>
1212 * namet.adb, namet.ads: Minor: remove unused procedures.
1214 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1216 * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
1217 (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
1218 Add pragma Warnings on Rtype variable in nested block. *
1219 * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
1220 * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
1221 (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
1222 * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
1223 (Process_Component_List_For_Finalize): Initialize Counter_Id.
1224 (Build_Finalize_Statements): Initialize Bod_Stmts.
1225 * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
1227 2017-04-27 Claire Dross <dross@adacore.com>
1229 * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
1230 allow the use of regular equality over elements in contracts.
1231 (Formal_Model): Ghost package containing model functions that are
1232 used in subprogram contracts.
1233 (Current_To_Last): Removed, model
1234 functions should be used instead.
1235 (First_To_Previous): Removed, model functions should be used instead.
1236 (Strict_Equal): Removed, model functions should be used instead.
1237 (No_Overlap): Removed, model functions should be used instead.
1238 (Equivalent_Keys): Functions over cursors are removed. They were
1239 awkward with explicit container parameters.
1240 * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
1241 (proof only) procedure to help GNATprove when equivalence over
1242 keys is not equality.
1244 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1246 * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
1247 sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
1248 Minor reformatting and code cleanups.
1250 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1252 * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
1253 subsidiary of Check_Inherited_Conditions, to build pragmas for an
1254 operation whose ancestor has classwide pre/postconditions. This
1255 is used both to check the legality of the inheritance in Ada
1256 and in SPARK, and to determine whether a wrapper is needed for
1257 an inherited operation.
1258 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
1259 Improve placement of error message for inherited classwide
1260 conditions that become illegal on type derivation.
1262 2017-04-27 Yannick Moy <moy@adacore.com>
1264 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
1265 SPARK_Mode from context on generic package.
1266 * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
1269 2017-04-27 Claire Dross <dross@adacore.com>
1271 * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
1272 overflows in computations.
1273 * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
1274 overflows in computations.
1275 (Insert): Rewrite precondition to avoid overflows in computations.
1276 * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
1277 overflows in computations.
1278 (Insert): Rewrite precondition to avoid overflows in computations.
1280 2017-04-27 Steve Baird <baird@adacore.com>
1282 * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
1283 flag when it is declared in order to avoid confusing CodePeer about
1284 the possibility of an uninitialized variable read.
1286 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1288 * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
1289 no dimensionality error if the subtype of the expression is
1290 identical to the nominal subtype in the declaration, even though
1291 the expression itself may have been constant-folded and lack a
1293 * sem_dim.ads: Add comments on setting of dimension vectors and
1294 its interaction with node rewritings and side-effect removal.
1296 2017-04-27 Bob Duff <duff@adacore.com>
1298 * debug.adb: Minor comment correction.
1299 * sem_dim.ads: Minor reformatting and typo fixes.
1301 2017-04-27 Bob Duff <duff@adacore.com>
1303 * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
1304 Last of the tables via function calls, rather than relying on layout
1307 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1309 * exp_util.adb: No wrapper in GNATprove mode.
1311 2017-04-27 Yannick Moy <moy@adacore.com>
1313 * sem_res.adb (Resolve_Comparison_Op): Always
1314 evaluate comparisons between values of universal types.
1316 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1318 * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
1319 an elaboration counter nor a check when in GNATprove mode.
1320 * sem_util.adb (Build_Elaboration_Entity): Do not create an
1321 elaboration counter when in GNATprove mode.
1323 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1325 * freeze.adb: copy-paste typo.
1327 2017-04-27 Yannick Moy <moy@adacore.com>
1329 * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
1330 Use correct test to detect call in GNATprove mode instead of
1333 2017-04-27 Claire Dross <dross@adacore.com>
1335 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
1336 New property function expressing that the element of a
1337 sequence are contained in the union of two sequences.
1338 (Formal_Model.M_Elements_Included): New property function
1339 expressing that the element of a sequence are another sequence.
1340 (Generic_Sorting): Use new property functions to state that
1341 elements are preserved by Sort and Merge.
1342 * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
1343 allow the use of regular equality over elements in contracts.
1344 (Formal_Model): Ghost package containing model functions
1345 that are used in subprogram contracts. (Capacity):
1346 On unbounded containers, return the maximal capacity.
1347 (Current_To_Last): Removed, model functions should be used instead.
1348 (First_To_Previous): Removed, model functions should be used instead.
1349 (Append): Default parameter value replaced
1350 by new wrapper to allow more precise contracts.
1351 (Insert): Subprogram restored, it seems it was useful to users even if
1353 (Delete): Subprogram restored, it seems it was useful to users even if
1355 (Prepend): Subprogram restored, it seems it was useful to users even
1356 if it is inefficient.
1357 (Delete_First): Subprogram restored, it seems it
1358 was useful to users even if it is inefficient. (Delete_Last):
1359 Default parameter value replaced by new wrapper to allow more
1361 (Generic_Sorting.Merge): Subprogram restored.
1362 * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
1363 allow the use of regular equality over elements in contracts.
1364 (Formal_Model): Ghost package containing model functions
1365 that are used in subprogram contracts. (Capacity):
1366 On unbounded containers, return the maximal capacity.
1367 (Current_To_Last): Removed, model functions should be used
1369 (First_To_Previous): Removed, model functions should be used instead.
1370 (Append): Default parameter value replaced
1371 by new wrapper to allow more precise contracts.
1372 (Insert): Subprogram restored, it seems it was useful to users even if
1374 (Delete): Subprogram restored, it seems it was useful to users even if
1376 (Prepend): Subprogram restored, it seems it was useful to users even
1377 if it is inefficient.
1378 (Delete_First): Subprogram restored, it seems it
1379 was useful to users even if it is inefficient. (Delete_Last):
1380 Default parameter value replaced by new wrapper to allow more
1382 (Generic_Sorting.Merge): Subprogram restored.
1383 (Vector): Do not reuse formal vectors, as it is no longer possible
1384 to supply them with an equality function over elements.
1386 2017-04-27 Bob Duff <duff@adacore.com>
1388 * g-dyntab.adb (Release): When allocating the new
1389 table, use the correct slice of the old table to initialize it.
1391 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1393 * einfo.ads: Minor fixes in comments.
1395 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1397 * sem_prag.adb: disable clones in SPARK_Mode.
1399 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1401 * sem_util.ads, contracts.adb: Minor reformatting.
1403 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1405 * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
1406 Build body of subprogram that has a class-wide condition that
1407 contains calls to other primitives.
1408 (Build_Class_Wide_Clone_Call); Build a call to the common
1409 class-wide clone of a subprogram with classwide conditions. The
1410 body of the subprogram becomes a wrapper for a call to the
1411 clone. The inherited operation becomes a similar wrapper to which
1412 modified conditions apply, and the call to the clone includes
1413 the proper conversion in a call the parent operation.
1414 (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
1415 subprogram that has a classwide condition that contains calls to
1416 other primitives, build an internal subprogram that is invoked
1417 through a type-specific wrapper for all inherited subprograms
1418 that may have a modified condition.
1419 * sem_prag.adb (Check_References): If subprogram has a classwide
1420 condition, create entity for corresponding clone, to be invoked
1421 through wrapper subprograns.
1422 (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
1423 message about placement if pragma isi internally generated.
1424 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
1425 a classwide clone, build body of clone as copy of original body,
1426 and rewrite original body as a wrapper as a wrapper for a call to
1427 the clone, so that it incorporates the original pre/postconditions
1429 * freeze.adb (Check_Inherited_Conditions): For an inherited
1430 subprogram that inherits a classwide condition, build spec and
1431 body of corresponding wrapper so that call to inherited operation
1432 gets the modified conditions.
1433 * contracts.adb (Analyze_Contracts): If analysis of classwide
1434 condition has created a clone for a primitive operation, analyze
1435 declaration of clone.
1437 2017-04-27 Steve Baird <baird@adacore.com>
1439 * exp_util.adb (Build_Allocate_Deallocate_Proc):
1440 Add "Suppress => All_Checks" to avoid generating unnecessary
1443 2017-04-27 Yannick Moy <moy@adacore.com>
1445 * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
1446 * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
1447 inlining body in GNATprove mode when switch -gnatdm used.
1448 * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
1449 in GNATprove mode when switch -gnatdm used.
1451 2017-04-27 Arnaud Charlet <charlet@adacore.com>
1453 * sem_ch13.adb (Analyze_Attribute_Definition_Clause
1454 [Attribute_Address]): Call Set_Address_Taken when ignoring rep
1455 clauses, so that we keep an indication of the address clause
1456 before removing it from the tree.
1458 2017-04-27 Yannick Moy <moy@adacore.com>
1460 * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
1461 of expression being qualified, when not an object name, or else
1462 evaluate the underlying name.
1464 2017-04-27 Jerome Lambourg <lambourg@adacore.com>
1466 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
1468 2017-04-27 Justin Squirek <squirek@adacore.com>
1470 * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
1471 Process_Component_List_For_Finalization as a local variable.
1472 (Process_Component_For_Finalize): Add an extra parameter to avoid
1474 (Process_Component_List_For_Finalization): Correct calls to
1475 Process_Component_For_Finalize to take Num_Comps as a parameter.
1477 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1479 * sem_ch8.adb (Find_Direct_Name): Account for the case where
1480 a use-visible entity is defined within a nested scope of an
1481 instance when giving priority to entities which were visible in
1482 the original generic.
1483 * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
1485 2017-04-27 Tristan Gingold <gingold@adacore.com>
1487 * raise-gcc.c: Don't use unwind.h while compiling
1488 for the frontend, but mimic host behavior.
1490 2017-04-27 Javier Miranda <miranda@adacore.com>
1492 * sem_ch3.adb (Build_Discriminated_Subtype):
1493 Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
1495 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1497 * sem_prag.adb (Analyze_Global_Item):
1498 Do not consider discriminants because they are not "entire
1499 objects". Remove the discriminant-related checks because they are
1501 (Analyze_Input_Output): Do not consider discriminants
1502 because they are not "entire objects".
1504 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1506 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
1507 perform check if the current scope does not come from source,
1508 as is the case for a rewritten task body, because check has
1509 been performed already, and may not be doable because of changed
1512 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1514 * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
1515 a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
1518 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1520 * sem_ch4.adb (Analyze_Call): If the return type of a function
1521 is incomplete in an context in which the full view is available,
1522 replace the type of the call by the full view, to prevent spurious
1524 * exp_disp.adb (Check_Premature_Freezing): Disable check on an
1525 abstract subprogram so that compiler does not reject a parameter
1526 of a primitive operation of a tagged type being frozen, when
1527 the untagged type of that parameter cannot be frozen.
1529 2017-04-27 Bob Duff <duff@adacore.com>
1531 * sem_attr.adb (Compute_Type_Key): Don't walk
1532 representation items for irrelevant types, which could be in a
1533 different source file.
1535 2017-04-27 Steve Baird <baird@adacore.com>
1537 * exp_attr.adb (Expand_N_Attribute_Reference):
1538 Don't expand Image, Wide_Image, Wide_Wide_Image attributes
1541 2017-04-27 Yannick Moy <moy@adacore.com>
1543 * exp_unst.ads: Fix typos in comments.
1545 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1547 * sem_eval.adb (Choice_Matches): Handle properly a real literal
1548 whose type has a defined static predicate.
1550 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1552 * exp_ch4.adb (Insert_Dereference_Action):
1553 Do not adjust the address of a controlled object when the
1554 associated access type is subject to pragma No_Heap_Finalization.
1557 2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
1559 * gcc-interface/utils.c (gnat_type_for_size): Set
1560 TYPE_ARTIFICIAL on created types.
1562 2017-04-27 Claire Dross <dross@adacore.com>
1564 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1565 modifications in functional containers.
1566 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1567 to improve readablity. Subprograms are separated between basic
1568 operations, constructors and properties. Universally quantified
1569 formulas in contracts are factorized in independant functions
1570 with a name and a comment. Names of parameters are improved.
1572 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1574 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1576 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1578 * sem_res.adb (Resolve_Type_Conversion): Do not
1579 install a predicate check here since this is already done during
1580 the expansion phase. Verify whether the operand satisfies the
1581 static predicate (if any) of the target type.
1582 * sem_ch3.adb (Analyze_Object_Declaration): Do
1583 not install a predicate check if the object is initialized by
1584 means of a type conversion because the conversion is subjected
1587 2017-04-27 Tristan Gingold <gingold@adacore.com>
1589 * raise.c (__gnat_builtin_longjmp): Remove.
1590 (__gnat_bracktrace):
1591 Add a dummy definition for the compiler (__gnat_eh_personality,
1592 __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
1593 __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
1594 __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
1595 * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
1596 * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
1597 and a-except-2005.adb.
1598 * raise-gcc.c: Allow build in compiler, compiled as a C++
1600 (__gnat_Unwind_ForcedUnwind): Adjust prototype.
1601 (db): Constify msg_format.
1602 (get_call_site_action_for): Don't use void arithmetic.
1603 * system.ads (Frontend_Exceptions): Set to False.
1604 (ZCX_By_Default): Set to True.
1605 (GCC_ZC_Support): Set to True.
1606 * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
1608 * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
1609 in gnat1 and gnatbind.
1610 * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
1611 s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
1612 * s-excmac.ads, s-excmac.adb: Copy of variants.
1613 * a-except.o: Adjust preequisites.
1614 Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
1616 2017-04-27 Claire Dross <dross@adacore.com>
1618 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1619 modifications in functional containers.
1620 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1621 to improve readablity. Subprograms are separated between basic
1622 operations, constructors and properties. Universally quantified
1623 formulas in contracts are factorized in independant functions
1624 with a name and a comment. Names of parameters are improved.
1626 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1628 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1630 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1632 * sem_res.adb (Resolve_Type_Conversion): Do not
1633 install a predicate check here since this is already done during
1634 the expansion phase. Verify whether the operand satisfies the
1635 static predicate (if any) of the target type.
1636 * sem_ch3.adb (Analyze_Object_Declaration): Do
1637 not install a predicate check if the object is initialized by
1638 means of a type conversion because the conversion is subjected
1641 2017-04-27 Tristan Gingold <gingold@adacore.com>
1643 * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
1644 replaced by their variants).
1646 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1648 * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
1649 cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
1650 a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
1652 2017-04-27 Tristan Gingold <gingold@adacore.com>
1654 * s-excmac-gcc.ads, s-excmac-gcc.adb,
1655 s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
1658 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1660 * exp_ch7.adb (Establish_Transient_Scope): Rewrite
1661 the loop which detects potential enclosing transient scopes. The
1662 loop now terminates much earlier as transient scopes are bounded
1663 by packages and subprograms.
1665 2017-04-27 Claire Dross <dross@adacore.com>
1667 * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
1668 allow the use of regular equality over elements in contracts.
1669 (Cursor): Type is now public so that it can be used in
1671 (Formal_Model): Ghost package containing
1672 model functions that are used in subprogram contracts.
1673 (Current_To_Last): Removed, model functions should be used
1675 (First_To_Previous): Removed, model functions should
1677 (Strict_Equal): Removed, model functions
1678 should be used instead.
1679 (Append): Default parameter value
1680 replaced by new wrapper to allow more precise contracts.
1681 (Insert): Default parameter value replaced by new wrapper to
1682 allow more precise contracts.
1683 (Delete): Default parameter
1684 value replaced by new wrapper to allow more precise contracts.
1685 (Prepend): Default parameter value replaced by new wrapper to
1686 allow more precise contracts.
1687 (Delete_First): Default parameter
1688 value replaced by new wrapper to allow more precise contracts.
1689 (Delete_Last): Default parameter value replaced by new wrapper
1690 to allow more precise contracts.
1692 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1694 * exp_spark.adb (Expand_SPARK): Perform specialized expansion
1695 for object declarations.
1696 (Expand_SPARK_N_Object_Declaration): New routine.
1697 * sem_elab.adb (Check_A_Call): Include calls to the
1698 Default_Initial_Condition procedure of a type under the SPARK
1699 elaboration checks umbrella.
1701 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1703 * sem.adb (Analyze): Diagnose an illegal iterated component
1705 * sem_util.ads, sem_util.adb
1706 (Diagnose_Iterated_Component_Association): New routine.
1708 2017-04-27 Bob Duff <duff@adacore.com>
1710 * adaint.c (__gnat_get_current_dir): Return 0 in length if
1712 * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
1713 exception if getcwd failed.
1715 2017-04-27 Yannick Moy <moy@adacore.com>
1717 * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
1718 entities with special prefix.
1720 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1722 * debug.adb Change the documentation of switch -gnatd.s.
1723 * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
1724 to manage the secondary stack when an enclosing scope already
1725 performs this functionality (aka relaxed management). Switch
1726 -gnatd.s may be used to force strict management in which case
1727 the block will manage the secondary stack unconditionally. Add
1728 a guard to stop the traversal when encountering a package or a
1731 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1733 * sem_res.adb (Resolve_Call): Refine further the handling of
1734 limited views of return types in function calls. If the function
1735 that returns a limited view appears in the current unit,
1736 we do not replace its type by the non-limited view because
1737 this transformation is performed int the back-end. However,
1738 the type of the call itself must be the non-limited view, to
1739 prevent spurious resolution errors.
1741 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1743 * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
1744 Removed, proposed implementation using generics for class-wide
1745 preconditions proved impractical.
1746 (Class_Wide_Clone): New attribute of subprogram. Designates
1747 subprogram created for primitive operations with class-wide
1748 pre/postconditions that contain calls to other primitives. The
1749 clone holds the body of the original primitive, but the
1750 pre/postonditions do not apply to it. The original body is
1751 rewritten as a wrapper for a call to the clone.
1752 (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
1753 the flag is set, no code for the corresponding pre/postconditions
1754 is inserted into its body.
1756 2017-04-27 Bob Duff <duff@adacore.com>
1758 * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
1759 Scalar_Storage_Order if -gnatI is given.
1760 * sem_prag.adb (Analyze_Pragma): Ignore
1761 Default_Scalar_Storage_Order if -gnatI is given.
1763 2017-04-27 Claire Dross <dross@adacore.com>
1765 * a-cofuba.ads (Add): Take as an additional input parameter
1766 the position where the element should be inserted.
1767 (Remove): New function that removes an element from the container.
1768 * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
1769 * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
1770 (Remove): New function that removes an element from a set.
1771 * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
1772 (Remove): New function that removes an element from a sequence.
1773 (Insert): New function that adds anywhere in a sequence.
1775 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1777 * checks.adb (Generate_Range_Check): Revert previous change.
1779 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1781 * sem_util.adb: Minor reformatting/rewording.
1783 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1785 * lib-xref.adb (Generate_Reference): The use
1786 of attribute 'Result is not considered a violation of pragma
1789 2017-04-27 Justin Squirek <squirek@adacore.com>
1791 * cstand.adb (Create_Standard): Correctly set
1792 Directly_Designated_Type for Any_Access.
1793 * sem_type.adb (Covers): Minor grammar fixes.
1795 2017-04-27 Bob Duff <duff@adacore.com>
1797 * sem_attr.adb: Minor cleanup.
1799 2017-04-27 Claire Dross <dross@adacore.com>
1801 * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
1802 private child of Ada.Containers used to implement all functional
1804 * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
1805 child of Ada.Containers. It provides functional indefinite unbounded
1806 maps which can be used as high level models for specification
1808 * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
1809 child of Ada.Containers. It provides functional indefinite unbounded
1810 sets which can be used as high level models for specification
1812 * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
1813 child of Ada.Containers. It provides functional indefinite unbounded
1814 vectors which can be used as high level models for specification
1816 * Makefile.rtl: Add new packages.
1817 * impunit.adb: Add new packages.
1819 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1821 * sem_ch4.adb: Minor reformatting.
1823 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1825 * sem_ch12.adb (Analyze_Associations): minor reformatting.
1826 (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
1827 point type actual that has user-defined arithmetic primitives,
1828 when there is a previous actual for a formal package that defines
1829 a fixed-point type with the parent user-defined operator.
1831 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1833 * checks.adb (Generate_Range_Check): Reinstate part of previous change.
1834 * sem_attr.adb (Resolve_Attribute): Generate a range check when
1835 the component type allows range checks.
1837 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1839 * sem_aux.adb (Is_Generic_Formal): Use original node to locate
1840 corresponding declaration, because formal derived types are
1841 rewritten as private extensions.
1843 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1845 * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
1846 dimensions of operands if node has been analyzed already, because
1847 previous analysis and dimension checking will have removed the
1848 dimension information from the operands.
1850 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1852 * debug.adb: Document the use of switch -gnatd.s.
1853 * einfo.ads Update the documentation on attribute
1854 Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
1855 the uses of these attributes from certain entities.
1856 * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
1857 which determines whether the block should continue to manage
1858 the secondary stack.
1859 (Manages_Sec_Stack): New routine.
1861 2017-04-27 Bob Duff <duff@adacore.com>
1863 * atree.ads: Minor edit.
1865 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1867 * sinfo.ads: Update the section on Ghost mode. Add
1868 a section on SPARK mode. Update the placement of section on
1869 expression functions.
1871 2017-04-27 Bob Duff <duff@adacore.com>
1873 * sinput.adb (Get_Source_File_Index): Don't
1874 assert that S is in the right range in the case where this is
1875 a .dg file under construction.
1877 2017-04-27 Yannick Moy <moy@adacore.com>
1879 * sem_util.adb (Check_Result_And_Post_State):
1880 Handle more precisely each conjunct in expressions formed by
1881 and'ing sub-expressions.
1883 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1885 * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
1887 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1889 * gnat_rm.texi, gnat_ugn.texi,
1890 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1891 doc/gnat_ugn/platform_specific_information.rst,
1892 doc/gnat_ugn/gnat_and_program_execution.rst,
1893 doc/gnat_ugn/gnat_utility_programs.rst,
1894 doc/gnat_ugn/the_gnat_compilation_model.rst,
1895 doc/gnat_rm/implementation_defined_attributes.rst,
1896 doc/gnat_rm/the_gnat_library.rst,
1897 doc/gnat_rm/implementation_defined_pragmas.rst,
1898 doc/gnat_rm/representation_clauses_and_pragmas.rst,
1899 doc/gnat_rm/implementation_of_specific_ada_features.rst,
1900 doc/gnat_rm/implementation_defined_aspects.rst,
1901 doc/gnat_rm/implementation_defined_characteristics.rst: Update
1904 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1906 * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
1907 generating C code on complex case expressions.
1909 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1911 * sem_prag.adb (Analyze_Pragma): Generate a warning instead
1912 of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
1913 * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
1914 Ada_2012 instead of Ada_2005 to be compatible with the above
1916 * bindgen.adb: Silence new warning on pragma Ada_95.
1918 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1920 * checks.adb (Generate_Range_Check): Revert part of previous change.
1922 2017-04-25 Ed Schonberg <schonberg@adacore.com>
1924 * sem_ch4.adb (Try_Container_Indexing): Handle properly a
1925 container indexing operation that appears as a an actual in a
1926 parameter association in a procedure call.
1928 2017-04-25 Olivier Ramonat <ramonat@adacore.com>
1930 * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
1931 Fix spelling mistakes.
1933 2017-04-25 Bob Duff <duff@adacore.com>
1935 * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
1936 * sinput-p.adb: Use regular fat pointers, with bounds checking,
1937 for source buffers. Fix misc obscure bugs.
1938 * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
1939 checking, for source buffers. Modify representation clause for
1940 Source_File_Record as appropriate. Move Source_File_Index_Table
1941 from spec to body, because it is not used outside the body.
1942 Move Set_Source_File_Index_Table into the private part, because
1943 it is used only in the body and in children. Use trickery to
1944 modify the dope in the generic instantiation case. It's ugly,
1945 but not as ugly as the previous method. Fix documentation.
1946 Remove obsolete code.
1947 * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
1948 indexing in source buffers.
1949 * fmap.adb: Avoid conversions from one string type to another.
1950 Remove a use of global name buffer.
1951 * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
1954 2017-04-25 Gary Dismukes <dismukes@adacore.com>
1956 * exp_util.adb, exp_ch4.adb: Minor reformatting.
1958 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1960 * checks.adb: Code clean up in various routines.
1961 (Generate_Range_Check): Do not generate a range check when the
1962 expander is not active or when index/range checks are suppressed
1964 (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
1965 Remove variants that include a Supress parameter. These routines
1966 are never used, and were introduced before the current scope-based
1967 check suppression method.
1969 2017-04-25 Vasiliy Fofanov <fofanov@adacore.com>
1971 * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
1972 code and some subprogram calls that are now noop.
1974 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1976 * exp_ch4.adb (Expand_N_Case_Expression): Take
1977 Minimize_Expression_With_Actions into account when possible.
1979 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1981 * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
1982 (Known_Null): Moved to Sem_Util.
1983 * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
1984 (Known_Null): Moved to Sem_Util.
1985 * sem_util.adb Add new enumeration type Null_Status_Kind.
1986 (Known_Non_Null): Moved from Exp_Util. Most of the logic in
1987 this routine is now carried out by Null_Status.
1988 (Known_Null): Moved from Exp_Util. Most of the logic in this routine
1989 is now carried out by Null_Status.
1990 (Null_Status): New routine.
1991 * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
1992 (Known_Null): Moved from Exp_Util.
1994 2017-04-25 Ed Schonberg <schonberg@adacore.com>
1996 * sem_ch6.adb (Analyze_Expression_Function): Do not report an
1997 error on the return type of an expression function that is a
1998 completion, if the type is derived from a generic formal type.
2000 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2002 * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
2003 conversion are those of the target type.
2005 2017-04-25 Bob Duff <duff@adacore.com>
2007 * a-clrefi.adb: Minor cleanup.
2009 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2011 * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
2013 2017-04-25 Bob Duff <duff@adacore.com>
2015 * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
2016 types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
2017 errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
2018 scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
2019 the Internal_Source buffer. This removes the incorrect call to "="
2020 the customer noticed.
2021 Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
2022 eventually need to eliminate them altogether. Or else get rid
2023 of zero-origin addressing.
2025 2017-04-25 Claire Dross <dross@adacore.com>
2027 * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
2028 function used in GNATprove to know if an expression contains
2029 non-dispatching calls on primitives of a tagged type.
2031 2017-04-25 Bob Duff <duff@adacore.com>
2033 * rtsfind.adb (Initialize): Initialize
2034 First_Implicit_With. Building the compiler with Normalize_Scalars
2035 and validity checking finds this being used as an uninitialized
2038 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2040 * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
2041 Add a warning about SPARK mode management. The routine now
2042 saves and restores both the mode and associated pragma.
2043 (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
2044 SPARK mode management. The routine now saves and restores both
2045 the mode and associated pragma.
2046 (Analyze_Object_Contract):
2047 Add a warning about SPARK mode management. The routine
2048 now saves and restores both the mode and associated pragma.
2049 (Analyze_Package_Body_Contract): Add a warning about SPARK mode
2050 management. The routine now saves and restores both the mode
2051 and associated pragma. (Analyze_Package_Contract): Add a warning
2052 about SPARK mode management. The routine now saves and restores
2053 both the mode and associated pragma.
2054 (Analyze_Task_Contract):
2055 Add a warning about SPARK mode management. The routine now saves
2056 and restores both the mode and associated pragma.
2057 * expander.adb (Expand): Change the way the Ghost mode is saved
2059 * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
2061 * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
2063 * exp_util.adb (Build_DIC_Procedure_Body):
2064 Change the way the Ghost mode is saved and restored.
2065 (Build_DIC_Procedure_Declaration): Change the way the Ghost
2066 mode is saved and restored.
2067 (Build_Invariant_Procedure_Body):
2068 Change the way the Ghost mode is saved and restored.
2069 (Build_Invariant_Procedure_Declaration): Change the way the Ghost
2070 mode is saved and restored.
2071 (Make_Predicate_Call): Change the
2072 way the Ghost mode is saved and restored.
2073 * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
2075 * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2077 (Mark_And_Set_Ghost_Body): Remove parameter
2078 Mode and its assignment.
2079 (Mark_And_Set_Ghost_Completion):
2080 Remove parameter Mode and its assignment.
2081 (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
2083 (Mark_And_Set_Ghost_Instantiation): Remove parameter
2084 Mode and its assignment.
2085 (Mark_And_Set_Ghost_Procedure_Call):
2086 Remove parameter Mode and its assignment.
2088 Remove parameter Mode and its assignment.
2089 * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2090 and update the comment on usage.
2091 (Mark_And_Set_Ghost_Body):
2092 Remove parameter Mode and update the comment on usage.
2093 (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
2094 update the comment on usage.
2095 (Mark_And_Set_Ghost_Declaration):
2096 Remove parameter Mode and update the comment on usage.
2097 (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
2098 update the comment on usage.
2099 (Mark_And_Set_Ghost_Procedure_Call):
2100 Remove parameter Mode and update the comment on usage.
2101 (Set_Ghost_Mode): Remove parameter Mode and update the comment
2103 * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
2105 * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
2106 of obsolete field SPARK_Mode_Pragma.
2107 (Load_Main_Source): Remove
2108 the assignment of obsolete field SPARK_Mode_Pragma.
2109 (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
2110 * lib-writ.adb (Add_Preprocessing_Dependency): Remove
2111 the assignment of obsolete field SPARK_Mode_Pragma.
2112 (Ensure_System_Dependency): Remove the assignment of obsolete
2113 field SPARK_Mode_Pragma.
2114 * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
2115 mode management. Change the way Ghost and SPARK modes are saved
2117 * sem.adb (Analyze): Change the way the Ghost mode is saved
2119 * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
2120 Ghost mode is saved and restored.
2121 (Process_Full_View): Change
2122 the way the Ghost mode is saved and restored.
2123 * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
2124 mode is saved and restored.
2125 * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
2126 mode is saved and restored.
2127 (Analyze_Subprogram_Body_Helper):
2128 Change the way the Ghost mode is saved and restored.
2129 * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
2130 Ghost mode is saved and restored.
2131 * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
2132 management. Save the SPARK mode-related data prior to any changes
2133 to the scope stack and contexts. The mode is then reinstalled
2134 before the subunit is analyzed in order to restore the original
2135 view of the subunit.
2136 * sem_ch12.adb (Analyze_Package_Instantiation): Update the
2137 warning on region management. Change the way the Ghost and
2138 SPARK modes are saved and restored.
2139 (Inline_Instance_Body):
2140 Add a warning about SPARK mode management. Code clean up.
2141 (Analyze_Subprogram_Instantiation): Update the warning on region
2142 management. Change the way the Ghost and SPARK modes are saved
2144 (Instantiate_Package_Body): Update the warning
2145 on region management. Change the way the Ghost and SPARK modes
2146 are saved and restored.
2147 (Instantiate_Subprogram_Body): Update
2148 the warning on region management. Change the way the Ghost and
2149 SPARK modes are saved and restored.
2150 (Set_Instance_Env): Add a
2151 warning about SPARK mode management. Change the way SPARK mode
2152 is saved and restored.
2153 * sem_ch13.adb (Build_Predicate_Functions):
2154 Change the way the Ghost mode is saved and restored.
2155 (Build_Predicate_Function_Declaration): Change the way the Ghost
2156 mode is saved and restored.
2157 * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
2158 mode management. Change the way SPARK mode is saved and restored.
2159 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
2160 Change the way the Ghost mode is saved and restored.
2161 (Analyze_Initial_Condition_In_Decl_Part): Change the way
2162 the Ghost mode is saved and restored.
2164 Change the way the Ghost mode is saved and restored.
2165 (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
2166 Ghost mode is saved and restored.
2167 * sem_util.adb (Install_SPARK_Mode): New routine.
2168 (Restore_SPARK_Mode): New routine.
2169 (Save_SPARK_Mode_And_Set): Removed.
2170 (Set_SPARK_Mode): New routine.
2171 * sem_util.ads (Install_SPARK_Mode): New routine.
2172 (Restore_SPARK_Mode): New routine.
2173 (Save_SPARK_Mode_And_Set): Removed.
2174 (Set_SPARK_Mode): New routine.
2176 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2178 * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
2179 to determine whether a type is declared in a local package that
2180 has not yet been frozen.
2181 * freeze.adb (Freeze_Before): Use new predicate to determine
2182 whether a local package must be installed on the scope stack
2183 in order to evaluate in the proper scope actions generated by
2184 aspect specifications, such as Predicate
2185 * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
2186 using new predicate.
2188 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2190 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
2191 comparisons between non- scalar expressions expressions because
2192 their values cannot be invalidated.
2193 * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
2196 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2198 * par_sco.adb: Minor reformatting.
2200 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2202 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
2203 is a type from an unfrozen local package, install package to
2204 complete the analysis of delayed aspects of the type.
2206 2017-04-25 Tristan Gingold <gingold@adacore.com>
2208 * bingen.adb (System_Version_Control_Used): New variable.
2209 (Resolve_Binder_Options): Set the above variable.
2210 (Gen_Output_File_Ada): Conditionally call Gen_Versions.
2211 (Gen_Elab_Order): Emit blank line before.
2213 2017-04-25 Justin Squirek <squirek@adacore.com>
2215 * sem_cat.adb (Validate_RT_RAT_Component): Added
2216 an extra check to ignore incomplete types.
2218 2017-04-25 Thomas Quinot <quinot@adacore.com>
2220 * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
2221 bogus circuitry for the case where Name is Predicate.
2223 2017-04-25 Thomas Quinot <quinot@adacore.com>
2225 * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
2226 Create SCOs for Predicate aspects in disabled
2227 state initially, to be enabled later on by...
2228 * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
2229 SCO for predicate as enabled.
2231 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2233 * comperr.adb (Compiler_Abort): Remove now obsolete pair of
2234 pragmas Warnings Off / On.
2235 * namet.adb (Finalize): Remove now obsolete pair of pragmas
2237 * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
2238 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
2239 consider comparisons between static expressions because their
2240 values cannot be invalidated.
2241 * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
2243 (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
2244 * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
2246 2017-04-25 Bob Duff <duff@adacore.com>
2248 * sem_elab.adb (In_Task_Activation): Trace internal calls in
2251 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2253 * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
2256 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2258 * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
2259 On/Off to defend against a spurious warning in conditional
2261 * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
2262 * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
2263 defend against a spurious warning in conditional compilation.
2264 * output.adb Add a pair of pragma Warnings On/Off to defend
2265 against a spurious warning in conditional compilation.
2266 * sem_eval.adb (Eval_Relational_Op): Major code clean up.
2267 (Fold_General_Op): New routine.
2268 (Fold_Static_Real_Op): New routine.
2269 (Test_Comparison): New routine.
2270 * sem_eval.ads (Test_Comparison): New routine.
2271 * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
2272 (Warn_On_Constant_Valid_Condition): New routine.
2273 (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
2274 to detect a specific case.
2275 * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
2276 * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
2277 to defend against a spurious warning in conditional compilation.
2278 (Tree_Write): Add a pair of pragma Warnings On/Off to defend
2279 against a spurious warning in conditional compilation.
2280 * usage.adb Add a pair of pragma Warnings On/Off to defend
2281 against a spurious warning in conditional compilation.
2283 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2285 * sinfo.ads, sem_ch13.adb: Update comment.
2287 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2289 * sem_util.adb (Is_Post_State): A reference to a
2290 generic in out parameter is considered a change in the post-state
2293 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2295 * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
2296 declaration of a subprogram instance within its wrapper package,
2297 skip over null statements that may result from the rewriting of
2300 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2302 * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
2303 If the type is an unchecked_union, replace the attribute with
2304 a Raise_Program_Error (rather than inserting such before the
2305 attribute reference) to handle properly the case where we are
2306 processing a component of a larger record, and we need to prevent
2307 further expansion for the unchecked union.
2308 (Expand_Attribute_Reference, case 'Write): If the type is
2309 an unchecked_union, check whether enclosing scope is a Write
2310 subprogram. Replace attribute with a Raise_Program_Error if the
2311 discriminants of the unchecked_union type have not default values
2312 because such a use is erroneous..
2314 2017-04-25 Tristan Gingold <gingold@adacore.com>
2316 * exp_ch9.adb (Expand_N_Task_Type_Declaration):
2317 Add relative_deadline to task record on edf profile.
2318 (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
2319 (Make_Task_Create_Call): Pass relative_deadline value.
2320 * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
2321 * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
2322 (Profile_Info): Add info for GNAT_Ravenscar_EDF.
2323 * sem_prag.adb (Set_Ravenscar_Profile): Handle
2324 GNAT_Ravenscar_EDF (set scheduling policy).
2325 (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
2327 (Sig_Flags): Add choice for Pragma_Deadline_Floor.
2328 * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
2330 (Pragma_Deadline_Floor): New pragma.
2331 * targparm.adb (Get_Target_Parameters): Recognize
2332 GNAT_Ravenscar_EDF profile.
2334 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2336 * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
2338 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2340 * sem_aux.adb (Nearest_Ancestor): Use original node of type
2341 declaration to locate nearest ancestor, because derived
2342 type declarations for record types are rewritten as record
2344 * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
2345 properly derivations that are completions of private types.
2346 (Add_Predicates): If type is private, examine rep. items of full
2347 view, which may include inherited predicates.
2348 (Build_Predicate_Functions): Ditto.
2350 2017-04-25 Javier Miranda <miranda@adacore.com>
2352 * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
2353 to generate new entities for subtype declarations located in
2354 Expression_With_Action nodes.
2356 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2358 * sem_elab.adb (Check_A_Call): Remove
2359 local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
2360 need for Elaborate_All when SPARK elaboration checks are
2361 required. Update the checks for instances, variables, and calls
2362 to Default_Initial_Condition procedures.
2364 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2366 * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
2367 into a boolean aspect, in analogy with the Ada aspect No_Return.
2369 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2371 * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
2373 2017-04-25 Bob Duff <duff@adacore.com>
2375 * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
2376 Is_True_Constant for an array variable that is passed to a
2377 foreign function as an 'in' parameter.
2378 * debug.adb: Document -gnatd.q.
2380 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2382 * sem_ch6.adb (Analyze_Expression_Function): If expression function
2383 is completion and return type is an access type do not freeze
2384 designated type: this will be done in the process of freezing
2385 the expression if needed.
2386 (Freeze_Expr_Types): Check whether type is complete before
2387 creating freeze node, to provide a better error message if
2388 reference is premature.
2389 * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
2390 functions created by type derivations.
2392 2017-04-25 Pascal Obry <obry@adacore.com>
2394 * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
2396 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2398 * sem_res.adb (Resolve_Type_Conversion):
2399 When resolving against any fixed type, set the type of the
2400 operand as universal real when the operand is a multiplication
2401 or a division where both operands are of any fixed type.
2402 (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
2403 placement of an error message by pointing to the operand of a
2404 type conversion rather than the conversion itself.
2406 2017-04-25 Thomas Quinot <quinot@adacore.com>
2408 * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
2409 Needs_Debug_Info when producing SCOs.
2411 2017-04-25 Thomas Quinot <quinot@adacore.com>
2413 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
2414 Always pass a null finalization master for a library level named access
2415 type to which a pragme No_Heap_Finalization applies.
2417 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2421 * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
2422 set to A'First(2) and vice versa.
2424 2017-04-25 Yannick Moy <moy@adacore.com>
2426 * freeze.adb (Freeze_Record_Type): Remove obsolete
2427 rule on volatile tagged record restriction on SPARK code.
2429 2017-04-25 Yannick Moy <moy@adacore.com>
2431 * sem_prag.adb (minor) Fix SPARK RM reference.
2433 2017-04-25 Yannick Moy <moy@adacore.com>
2435 * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
2436 comment to reflect which entity is chosen as unique entity.
2437 (Unique_Entity): Return full view instead of private spec for
2438 protected type or task type. Fix possible incorrect access when
2441 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2443 * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
2444 array types only instead of all packed array types.
2446 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2448 * sem_ch6.adb (Conforming_Types): If type of formal as a specified
2449 dimension system, verify that dimensions of both match.
2450 (Check_Conformance): Add error message in case of dimension
2452 * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
2455 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2457 * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
2460 2017-04-25 Yannick Moy <moy@adacore.com>
2462 * sem_util.adb: Minor refactoring.
2463 * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
2465 2017-04-25 Claire Dross <dross@adacore.com>
2467 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
2468 ultimate alias when accessing overridden operation. Indeed, if the
2469 overridden operation is itself inherited, it won't have any explicit
2472 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2474 * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
2475 overlap if the two formals have different types, because formally
2476 the corresponding actuals cannot designate the same objects.
2478 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2480 * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
2481 dimensions are present from context, use them. b) If operand is
2482 a static constant rewritten as a literal, obtain the dimensions
2483 from the original declaration, otherwise use dimensions of type
2484 established from context.
2486 2017-04-25 Yannick Moy <moy@adacore.com>
2488 * sem_util.adb (Is_Effectively_Volatile): Protect against base type
2489 of array that is private.
2491 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2493 * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
2496 2017-04-25 Yannick Moy <moy@adacore.com>
2498 * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
2501 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2503 * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
2504 the check that recognizes a call to a private overridding and
2505 replaces the called subprogram with its alias.
2507 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2509 * exp_util.adb: Minor reformatting.
2511 2017-04-25 Justin Squirek <squirek@adacore.com>
2513 * exp_ch3.adb (Freeze_Type): Add condition to always treat
2514 interface types as a partial view of a private type for the
2515 generation of invariant procedure bodies.
2516 * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
2517 Add a condition to get the Corresponding_Record_Type for
2518 concurrent types, add condition to return in the absence of a
2519 class in the pragma, remove call to Replace_Type_References,
2520 and add call to Replace_References.
2521 (Add_Interface_Invariatns),
2522 (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
2523 to including the working type T.
2524 (Add_Own_Invariants): Remove
2525 legacy condition for separate units, remove dispatching for ASIS
2526 and save a copy of the expression in the pragma expression.
2527 (Build_Invariant_Procedure_Body): Default initalize vars,
2528 remove return condition on interfaces, always use the
2529 private type for interfaces, and move the processing of types
2530 until after the processing of invariants for the full view.
2531 (Build_Invariant_Procedure_Declaration): Remove condition
2532 to return if an interface type is encountered and add
2533 condition to convert the formal parameter to its class-wide
2534 counterpart if Work_Typ is abstract.
2535 (Replace_Type): Add call to Remove_Controlling_Arguments.
2536 (Replace_Type_Ref): Remove class-wide dispatching for the current
2537 instance of the type.
2538 (Replace_Type_References): Remove parameter "Derived"
2539 (Remove_Controlling_Arguments): Created in order to removing
2540 the controlliong argument from calls to primitives in the case
2541 of the formal parameter being an class-wide abstract type.
2542 * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
2543 to the change made to Freeze_Type in exp_ch3. Add a condition
2544 to treat interface types as a partial view.
2545 * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
2546 to Build_Invariant_Procedure_Declaration to properly generate a
2547 "partial" invariant procedure when Typ is an interface.
2549 2017-04-25 Bob Duff <duff@adacore.com>
2551 * a-numeri.ads: Go back to using brackets encoding for the Greek
2554 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2556 * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
2557 (10-15): if derived type T with progenitors is abstract,
2558 and primitive P of this type inherits non-trivial classwide
2559 preconditions from both a parent operation and from an interface
2560 operation, then the inherited operation is abstract if the parent
2561 operation is not null.
2562 * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
2563 with Covered_Interface_Op to yield the actual interface operation
2564 that is implemented by a given inherited operation.
2566 2017-04-25 Javier Miranda <miranda@adacore.com>
2568 * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
2569 and right operands after performing the validity checks. Required
2570 because validity checks may remove side effects from the operands.
2572 2017-04-25 Javier Miranda <miranda@adacore.com>
2574 * exp_attr.adb (Attribute_Unrestricted_Access):
2575 Do not disable implicit type conversion. Required to generate
2576 code that displaces the pointer to reference the secondary
2579 2017-04-25 Pascal Obry <obry@adacore.com>
2581 * prj-attr.adb, snames.ads-tmpl: Add package Install's
2582 Required_Artifacts attribute.
2584 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2586 * sem_util.adb (Same_Value): String literals are compile-time
2587 values, and comparing them must use Expr_Value_S.
2589 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2591 * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
2592 dereference is introduced for the object, and the object is
2593 overloaded, do not check whether it is aliased, because it may
2594 include an implicit dereference.
2595 * sem_type.adb (Disambiguate): If two interpretations are access
2596 attribute types with the same designated type keep either of
2597 them and do not report an ambiguity. A true ambiguity will be
2600 2017-04-25 Bob Duff <duff@adacore.com>
2602 * a-numeri.ads: Change the encoding of Greek letter Pi from
2603 brackets encoding to UTF-8. Use pragma Wide_Character_Encoding
2604 to indicate the encoding. We considered using a byte order mark
2605 (BOM), but that causes various trouble (misc software eats the
2606 BOM, if you have a patch with a BOM, then it's not at the start
2607 of the patch, so it's not a BOM, the BOM affects with-ing files,
2609 * scng.adb, s-wchcnv.adb: Minor.
2611 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2613 * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
2614 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2616 * sem_ch3.adb (Add_Internal_Interface_Entities): Move
2617 Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
2618 Improve error message on operations that inherit non-conforming
2619 classwide preconditions from ancestor and progenitor.
2620 * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
2621 moved here from sem_ch3.
2622 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
2623 check given in RM 6.1.1 (17) concerning renamings of overriding
2624 operations that inherits class-wide preconditions from ancestor
2627 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2629 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
2630 (Build_Adjust_Statements): Code cleanup.
2631 (Build_Finalizer): Update the initialization of
2633 (Build_Finalize_Statements): Code cleanup.
2634 (Build_Initialize_Statements): Code cleanup.
2635 (Make_Deep_Array_Body): Update the initialization of
2637 (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
2638 (Process_Object_Declaration): Generate a null exception handler only
2639 when exceptions are allowed.
2640 (Process_Transients_In_Scope): Update the initialization of
2642 * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
2644 * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
2645 restrictions when the handler is internally generated and the
2648 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2650 * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
2651 enforce legality rule on classwide preconditions inherited from
2652 both an ancestor and a progenitor (RM 6.1.1 (10-13).
2653 * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
2654 subprogram need not be dispatching if it appears in a precondition
2655 for an abstract or null subprogram.
2657 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2659 * sem_ch10.adb: Minor typo fix.
2661 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2663 * gcc-interface/Makefile.in: Cleanup VxWorks targets.
2665 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2667 * fname.adb (Is_Internal_File_Name): Arrange for the slices to
2668 have a length which is a power of 2.
2669 (Is_Predefined_File_Name): Likewise. Adjust comment.
2671 2017-04-25 Bob Duff <duff@adacore.com>
2673 * exp_aggr.adb (Component_Count): Protect the
2674 arithmetic from attempting to convert a value >= 2**31 to Int,
2675 which would otherwise raise Constraint_Error.
2677 2017-04-25 Bob Duff <duff@adacore.com>
2679 * opt.ads (Locking_Policy): Fix incorrect documentation. The
2680 first character of the policy name is not unique.
2682 2017-04-25 Bob Duff <duff@adacore.com>
2684 * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
2685 * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
2686 about this flag not being used. It was already used, and it is
2689 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2691 * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
2692 (Ignore_SPARK_Mode_Pragmas): New routine.
2693 (Set_Ignore_SPARK_Mode_Pragmas): New routine.
2694 (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
2695 * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
2697 (Ignore_SPARK_Mode_Pragmas): New routine
2698 along with pragma Inline.
2699 (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
2700 * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
2701 Ignore_SPARK_Mode_Pragmas_In_Instance.
2702 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
2703 Save and restore the value of global flag
2704 Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
2705 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
2706 the corresponding spec or the body must ignore all SPARK_Mode
2707 pragmas found within.
2708 (Analyze_Subprogram_Declaration): Mark
2709 the spec when it needs to ignore all SPARK_Mode pragmas found
2710 within to allow the body to infer this property in case it is
2711 instantiated or inlined later.
2712 * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
2713 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2714 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2715 when the corresponding spec also ignored all SPARK_Mode pragmas
2717 (Analyze_Package_Declaration): Mark the spec when
2718 it needs to ignore all SPARK_Mode pragmas found within to allow
2719 the body to infer this property in case it is instantiated or
2721 * sem_ch12.adb (Analyze_Formal_Package_Declaration):
2722 Save and restore the value of flag
2723 Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2724 formal spec when it needs to ignore all SPARK_Mode
2725 pragmas found within to allow the body to infer this
2726 property in case it is instantiated or inlined later.
2727 (Analyze_Package_Instantiation): Save and restore the value
2728 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
2729 the instance spec when it needs to ignore all SPARK_Mode
2730 pragmas found within to allow the body to infer this
2731 property in case it is instantiated or inlined later.
2732 (Analyze_Subprogram_Instantiation): Save and restore the value
2733 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2734 instance spec and anonymous package when they need to ignore
2735 all SPARK_Mode pragmas found within to allow the body to infer
2736 this property in case it is instantiated or inlined later.
2737 (Instantiate_Package_Body): Save and restore the value of global
2738 flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
2739 global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
2740 corresponding instance spec also ignored all SPARK_Mode pragmas
2742 (Instantiate_Subprogram_Body): Save and restore the
2743 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2744 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2745 when the corresponding instance spec also ignored all SPARK_Mode
2746 pragmas found within.
2747 * sem_prag.adb (Analyze_Pragma): Update the reference to
2748 Ignore_Pragma_SPARK_Mode.
2749 * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
2750 all SPARK_Mode pragmas defined within yields mode "off".
2752 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2754 * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
2756 2017-04-25 Bob Duff <duff@adacore.com>
2758 * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
2759 All_Checks" to avoid generating unnecessary checks.
2760 * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
2762 * sem.ads: Fix comment.
2763 * expander.ads: Fix comment.
2764 * exp_atag.ads: Fix comment: "Index = 0" should be
2767 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2769 * s-taprop-linux.adb: Minor editorial fixes.
2771 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2773 * sem_util.adb (New_Copy_Tree): Put back the declarations of the
2774 hash tables at library level. Reinstate the NCT_Hash_Tables_Used
2775 variable and set it to True whenever the main hash table is
2776 populated. Short- circuit the Assoc function if it is false
2777 and add associated guards.
2779 2017-04-25 Olivier Hainque <hainque@adacore.com>
2781 * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
2782 specs without elaboration code that have an elaboration counter
2783 nevertheless, e.g. when compiled with -fpreserve-control-flow.
2784 * sem_ch10.adb (Analyze_Compilation_Unit):
2785 Set_Elaboration_Entity_Required when requested to preserve
2786 control flow, to ensure the unit elaboration is materialized at
2787 bind time, resulting in the inclusion of the unit object file
2788 in the executable closure at link time.
2790 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
2792 * exp_dbug.adb: In Debug_Renaming_Declaration,
2793 when dealing with indexed component, accept to produce a renaming
2794 symbol when the index is an IN parameter or when it is a name
2795 defined in an outer scope.
2797 2017-04-25 Yannick Moy <moy@adacore.com>
2799 * errout.adb (Error_Msg): Adapt continuation
2800 message in instantiations and inlined bodies for info messages.
2802 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2804 * fname.adb (Has_Internal_Extension): Add pragma Inline.
2805 Use direct 4-character slice comparisons.
2807 pragma Inline. (Has_Suffix): Delete.
2808 (Is_Internal_File_Name):
2809 Test Is_Predefined_File_Name first.
2810 (Is_Predefined_File_Name):
2811 Use direct slice comparisons as much as possible and limit all
2812 comparisons to at most 8 characters.
2814 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2816 * checks.adb (Insert_Valid_Check): Code cleanup.
2817 * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
2818 (Expand_Actuals): Generate proper copy-back for a validation
2819 variable when it acts as the argument of a type conversion.
2820 * sem_util.adb (Is_Validation_Variable_Reference): Augment the
2821 predicate to operate on type qualifications.
2823 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2825 * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
2828 2017-04-25 Bob Duff <duff@adacore.com>
2830 * sem_prag.adb (No_Return): Give an error if the pragma applies
2831 to a body. Specialize the error for the specless body case,
2832 as is done for (e.g.) pragma Convention.
2833 * debug.adb: Add switch -gnatd.J to disable the above legality
2834 checks. This is mainly for use in our test suite, to avoid
2835 rewriting a lot of illegal (but working) code. It might also
2836 be useful to customers. Under this switch, if a pragma No_Return
2837 applies to a body, and the procedure raises an exception (as it
2838 should), the pragma has no effect. If the procedure does return,
2839 execution is erroneous.
2841 2017-04-25 Bob Duff <duff@adacore.com>
2843 * exp_ch6.adb (Expand_Actuals): This is the
2844 root of the problem. It took N as an 'in out' parameter, and in
2845 some cases, rewrote N, but then set N to Original_Node(N). So
2846 the node returned in N had no Parent. The caller continued
2847 processing of this orphaned node. In some cases that caused a
2848 crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
2849 and trips over the Empty Parent). The solution is to make N an
2850 'in' parameter. Instead of rewriting it, return the list of
2851 post-call actions, so the caller can do the rewriting later,
2852 after N has been fully processed.
2853 (Expand_Call_Helper): Move most of Expand_Call here. It has
2854 too many premature 'return' statements, and we want to do the
2855 rewriting on return.
2856 (Insert_Post_Call_Actions): New procedure to insert the post-call
2857 actions in the appropriate place. In the problematic case,
2858 that involves rewriting N as an Expression_With_Actions.
2859 (Expand_Call): Call the new procedures Expand_Call_Helper and
2860 Insert_Post_Call_Actions.
2862 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2864 * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
2865 properly type derived from generic formal types, to handle
2866 properly modified version of ACATS 4.1B B611017.
2868 2017-04-25 Javier Miranda <miranda@adacore.com>
2870 * exp_unst.adb (Subp_Index): Adding missing
2871 support for renamings and functions that return a constrained
2872 array type (i.e. functions for which the frontend built a
2873 procedure with an extra out parameter).
2875 2017-04-25 Pascal Obry <obry@adacore.com>
2877 * s-string.adb: Minor code clean-up.
2879 2017-04-25 Bob Duff <duff@adacore.com>
2881 * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
2883 * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
2884 function for Non_Blocking_Wait_Process.
2886 2017-04-25 Bob Duff <duff@adacore.com>
2888 * prep.adb (Preprocess): Remove incorrect
2889 Assert. Current character can be ASCII.CR.
2891 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2893 * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
2894 convention Stdcall, which has a number of exceptions. Convention
2895 is legal on a component declaration whose type is an anonymous
2896 access to subprogram.
2898 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2900 * sem_ch4.adb: sem_ch4.adb Various reformattings.
2901 (Try_One_Prefix_Interpretation): Use the base type when dealing
2902 with a subtype created for purposes of constraining a private
2903 type with discriminants.
2905 2017-04-25 Javier Miranda <miranda@adacore.com>
2907 * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
2908 * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
2909 dispatching primitives (Restore_Warnings): Restore warning on
2910 late dispatching primitives (Save_Warnings): Save warning on late
2911 dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
2912 to enable/disable this warning.
2913 (WA_Warnings): Set warning on late dispatching primitives.
2914 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
2915 that its parent type has a private extension.
2916 * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
2918 * usage.adb: Document -gnatw.j and -gnatw.J.
2920 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2922 * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
2925 2017-04-25 Bob Duff <duff@adacore.com>
2927 * binde.adb (Validate): Do not pass dynamic strings
2928 to pragma Assert, because older compilers do not support that.
2930 2017-04-25 Bob Duff <duff@adacore.com>
2932 * s-fileio.adb (Close): When a temp file is
2933 closed, delete it and clean up its Temp_File_Record immediately,
2934 rather than waiting until later.
2935 (Temp_File_Record): Add File
2936 component, so Close can know which Temp_File_Record corresponds
2937 to the file being closed.
2938 (Delete): Don't delete temp files,
2939 because they are deleted by Close.
2940 (Open): Set the File component
2941 of Temp_File_Record. This requires moving the creation of the
2942 Temp_File_Record to the end, after the AFCB has been created.
2944 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2946 * checks.adb (Insert_Valid_Check): Do not generate
2947 a validity check when inside a generic.
2949 2017-04-25 Yannick Moy <moy@adacore.com>
2951 * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
2953 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2955 * snames.ads-tmpl (Snames): More names for detecting predefined
2956 potentially blocking subprograms.
2958 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2960 * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
2961 concerning inheritance of class-wide preconditions do not apply
2964 2017-04-25 Bob Duff <duff@adacore.com>
2966 * s-ficobl.ads: Minor comment fix.
2968 2017-04-25 Yannick Moy <moy@adacore.com>
2970 * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
2971 conversions from float to integer in GNATprove mode.
2972 (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
2973 to call Apply_Type_Conversion_Checks, so that range checks
2974 are properly positioned when needed on conversions, including
2975 when converting from float to integer. (Determine_Range): In
2976 GNATprove mode, take into account the possibility of conversion
2977 from float to integer.
2978 * sem_res.adb (Resolve_Type_Conversion): Only enforce range
2979 check on conversions from fixed-point to integer, not anymore
2980 on conversions from floating-point to integer, when in GNATprove
2983 2017-04-25 Yannick Moy <moy@adacore.com>
2985 * checks.adb (Determine_Range_R): Special case type conversions
2986 from integer to float in order to get bounds in that case too.
2987 * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
2988 mode, for computations involved in interval checking.
2990 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2992 * checks.adb (Insert_Valid_Check): Partially reimplement validity
2994 * einfo.adb Node36 is now used as Validated_Object.
2995 (Validated_Object): New routine.
2996 (Set_Validated_Object): New routine.
2997 (Write_Field36_Name): Add an entry for Validated_Object.
2998 * einfo.ads Add new attribute Validated_Object along with
3000 (Validated_Object): New routine along with pragma Inline.
3001 (Set_Validated_Object): New routine along with pragma Inline.
3002 * exp_attr.adb (Make_Range_Test): Add processing for validation
3003 variables to avoid extra reads and copies of the prefix.
3004 * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
3005 variables in order to reflect any changes done in the variable
3006 back into the original object.
3007 * sem_util.adb (Is_Validation_Variable_Reference): New routine.
3008 * sem_util.ads (Is_Validation_Variable_Reference): New routine.
3010 2017-04-25 Steve Baird <baird@adacore.com>
3012 * exp_ch7.adb (Build_Array_Deep_Procs,
3013 Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
3014 generate Finalize_Address routines for CodePeer.
3016 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3018 * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
3019 Analyze_Pre_Post_Condition, to implement the legality checks
3020 mandated by AI12-0131: Pre'Class shall not be specified for an
3021 overriding primitive subprogram of a tagged type T unless the
3022 Pre'Class aspect is specified for the corresponding primitive
3023 subprogram of some ancestor of T.
3025 2017-04-25 Bob Duff <duff@adacore.com>
3027 * sem_ch8.adb (Use_One_Type): If a use_type_clause
3028 is redundant, set its Used_Operations to empty. This is only
3029 necessary for use clauses that appear in the parent of a generic
3030 child unit, because those use clauses get reanalyzed when we
3031 instantiate the generic, and we don't want the Used_Operations
3032 carried over from the original context (where it was probably
3035 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3037 * exp_ch6.adb: Minor reformatting.
3039 2017-04-25 Bob Duff <duff@adacore.com>
3041 * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
3042 Use Source_Index (Current_Sem_Unit) to find the correct casing.
3043 * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
3044 (Current_Sem_Unit) to find the correct casing.
3045 * par.adb (Par): Null out Current_Source_File, to ensure that
3046 the above bugs won't rear their ugly heads again.
3048 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3050 * sem_ch8.adb (Find_Type): For an attribute reference
3051 'Class, if prefix type is synchronized and previous errors
3052 have suppressed the creation of the corresponding record type,
3053 create a spurious class-wide for the synchonized type itself,
3054 to catch other misuses of the attribute
3056 2017-04-25 Steve Baird <baird@adacore.com>
3058 * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
3059 is True, then don't generate the accessibility check for the
3060 tag of a tagged result.
3061 * exp_intr.adb (Expand_Dispatching_Constructor_Call):
3062 if CodePeer_Mode is True, then don't generate the
3063 tag checks for the result of call to an instance of
3064 Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
3065 descendant of" check and the accessibility check).
3067 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3069 * sem_ch13.adb: Code cleanups.
3070 * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
3071 * sem_ch8.ads: Minor comment fix.
3073 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3075 * exp_ch4.adb (Library_Level_Target): New function.
3076 (Expand_Concatenate): When optimization is enabled, also expand
3077 the operation out-of-line if the concatenation is present within
3078 the expression of the declaration of a library-level object and
3079 not only if it is the expression of the declaration.
3081 2017-04-25 Bob Duff <duff@adacore.com>
3083 * freeze.adb (Freeze_Object_Declaration): Do
3084 not Remove_Side_Effects if there is a pragma Linker_Section,
3085 because in that case we want static initialization in the
3086 appropriate section.
3088 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3090 * exp_dbug.adb: Minor rewording and reformatting.
3092 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3094 * sem_attr.adb (Statically_Denotes_Object): New predicate, to
3095 handle the proposed changes to rules concerning potentially
3096 unevaluated expressions, to include selected components that
3097 do not depend on discriminants, and indexed components with
3099 * sem_util.adb (Is_Potentially_Unevaluated): Add check for
3100 predicate in quantified expression, and fix bugs in the handling
3101 of case expressions and membership test.
3102 (Analyze_Attribute_Old_Result): use new predicate.
3103 (Analyze_Attribute, case Loop_Entry): ditto.
3105 2017-04-25 Bob Duff <duff@adacore.com>
3107 * s-secsta.adb (SS_Info): Add a comment
3108 explaining why we don't need to walk all the chunks in order to
3109 compute the total size.
3111 2017-04-25 Bob Duff <duff@adacore.com>
3113 * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
3114 of the global name buffer to 4*Max_Line_Length.
3116 2017-04-25 Javier Miranda <miranda@adacore.com>
3118 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
3119 renaming entity for debug information, mark the entity as needing debug
3120 info if it comes from sources.
3122 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3124 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
3125 restriction converning the use of 'Address where the prefix is
3126 of a controlled type.
3128 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
3130 * exp_dbug.adb: In Debug_Renaming_Declaration,
3131 skip slices that are made redundant by an indexed component
3133 * atree.h: New definition for Original_Node.
3135 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3137 * sem_prag.adb, sem_prag.ads: Minor reformatting.
3139 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3141 * sem_ch3.adb (Check_Entry_Contract): Call
3142 Preanalyze_Spec_Expression so that resolution takes place as well.
3143 * sem_util.adb (Check_Internal_Protected_Use): Reject properly
3144 internal calls that appear in preconditions of protected
3145 operations, in default values for same, and in contract guards
3146 for contract cases in SPARK.
3148 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3150 * a-numaux.ads: Fix description of a-numaux-darwin
3152 (Double): Define to Long_Float.
3153 * a-numaux-vxworks.ads (Double): Likewise.
3154 * a-numaux-darwin.ads
3156 * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
3157 * a-numaux-x86.ads: Fix package description.
3158 * a-numaux-x86.adb (Is_Nan): Minor tweak.
3159 (Reduce): Adjust and complete description. Call Is_Nan instead of
3160 testing manually. Use an integer temporary to hold rounded value.
3161 * a-numaux-darwin.adb (Reduce): Likewise.
3162 (Is_Nan): New function.
3164 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3166 * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
3167 on analysis of prefix whose type is a current instance of a
3168 synchronized type, but where the prefix itself is an entity that
3171 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3173 * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
3174 the identity of callable entities therein, because they have been
3175 properly resolved, and prefixed calls may have been rewritten
3178 2017-04-25 Patrick Bernardi <bernardi@adacore.com>
3180 * exp_ch3.adb (Build_Init_Statements): Convert
3181 the expression of the pragma/aspect Secondary_Stack_Size to
3182 internal type System.Parameters.Size_Type before assigning
3183 it to the Secondary_Stack_Size component of the task type's
3184 corresponding record.
3186 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3188 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
3189 (etc) optimizations when the type is modular and the offsets
3192 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3194 * s-osinte-freebsd.ads: Minor comment tweaks
3196 2017-04-25 Javier Miranda <miranda@adacore.com>
3198 * urealp.adb (UR_Write): Reverse previous patch
3199 adding documentation on why we generate multiplications instead
3200 of divisions (needed to avoid expressions whose computation with
3201 large numbers may cause division by 0).
3203 2017-04-25 Bob Duff <duff@adacore.com>
3205 * erroutc.adb (Set_Specific_Warning_Off,
3206 Set_Warnings_Mode_Off): Use the correct source file for
3207 Stop. Was using Current_Source_File, which is only valid during
3208 parsing. Current_Source_File will have a leftover value from
3209 whatever file happened to be parsed last, because of a with_clause
3212 2017-04-25 Bob Duff <duff@adacore.com>
3214 * lib.ads, lib.adb (In_Internal_Unit): New functions similar
3215 to In_Predefined_Unit, but including GNAT units.
3216 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
3217 with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
3218 because Should_Ignore_Pragma was not working reliably outside
3219 the parser, because Current_Source_File is not valid.
3220 * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
3221 * par-prag.adb: Call Should_Ignore_Pragma_Par.
3223 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3225 * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
3228 2017-04-25 Javier Miranda <miranda@adacore.com>
3230 * urealp.adb (UR_Write): Fix output of constants with a base other
3233 2017-04-25 Justin Squirek <squirek@adacore.com>
3235 * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
3236 * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
3237 Add extra parameter for Process_Interface_Name.
3238 (Process_Interface_Name): Add parameter for pragma to analyze
3239 corresponding aspect.
3240 * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
3243 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3245 * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
3248 2017-04-25 Yannick Moy <moy@adacore.com>
3250 * sem_res.adb (Resolve_Comparison_Op): Do not
3251 attempt evaluation of relational operations inside assertions.
3253 2017-04-25 Justin Squirek <squirek@adacore.com>
3255 * exp_util.adb (Add_Interface_Invariants):
3256 Restored, code moved back from Build_Invariant_Procedure_Body.
3257 (Add_Parent_Invariants): Restored, code moved back from
3258 Build_Invariant_Procedure_Body.
3259 (Build_Invariant_Procedure_Body):
3260 Remove refactored calls and integrated code from
3261 Add_Parent_Invariants and Add_Interface_Invariants.
3263 2017-04-25 Johannes Kanig <kanig@adacore.com>
3265 * errout.adb (Output_Messages): Adjust computation of total
3267 * erroutc.adb (Error_Msg): In statistics counts, deal
3268 correctly with informational messages that are not warnings.
3269 * errutil.adb (Finalize): adjust computation of total errors.
3271 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3273 * terminals.c (__gnat_terminate_pid): New.
3274 * g-exptty.ads (Terminate_Process): New. Update comments.
3276 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3278 * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
3280 2017-04-25 Justin Squirek <squirek@adacore.com>
3282 * sem_ch3.adb (Analyze_Declarations): Minor
3283 correction to comments, move out large conditional and scope
3284 traversal into a predicate.
3285 (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
3288 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3290 * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
3291 of prefix whose type is a current instance of a synchronized
3292 type. If the prefix is an object this is an external call (or
3293 requeue) that can only access public operations of the object. The
3294 previous predicate was too restrictive, and did not allow public
3295 protected operations, only task entries.
3297 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3299 * sem_ch5.adb, fname.adb: Minor reformatting.
3301 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3303 * einfo.adb (Is_Anonymous_Access_Type): New routine.
3304 * einfo.ads Update the placement of
3305 E_Anonymous_Access_Subprogram_Type along with all subtypes that
3307 (Is_Anonymous_Access_Type): New routine.
3308 * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
3309 master for an access type subject to pragma No_Heap_Finalization.
3310 * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
3311 allocated or deallocated does not finalization actions if the
3312 associated access type is subject to pragma No_Heap_Finalization.
3313 * opt.ads Add new global variable No_Heap_Finalization_Pragma.
3314 * par-prag.adb Pragma No_Heap_Finalization does not need special
3315 processing from the parser.
3316 * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
3317 ??? comments. Use the new predicate Is_Anonymous_Access_Type.
3318 * sem_prag.adb Add an entry in table Sig_Flags for pragma
3319 No_Heap_Finalization.
3320 (Analyze_Pragma): Add processing for
3321 pragma No_Heap_Finalization. Update various error messages to
3322 use Duplication_Error.
3323 * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
3324 * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
3325 and corresponding pragma id.
3327 2017-04-25 Bob Duff <duff@adacore.com>
3329 * freeze.adb (Freeze_Record_Type): Use the
3330 underlying type of the component type to determine whether it's
3331 elementary. For representation clause purposes, a private type
3332 should behave the same as its full type.
3333 * fname.ads, fname.adb (Is_Predefined_File_Name):
3334 Make sure things like "system.ali" are recognized as predefined.
3336 2017-04-25 Javier Miranda <miranda@adacore.com>
3338 * debug.adb: Update documentation of -gnatd.6.
3340 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3342 * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
3343 element iterator when the name is an overloaded function call,
3344 one of whose interpretations yields an array.
3346 2017-04-25 Bob Duff <duff@adacore.com>
3348 * uname.ads, uname.adb (Is_Predefined_Unit_Name,
3349 Is_Internal_Unit_Name): New functions for operating on unit
3350 names, as opposed to file names. There's some duplicated code
3351 with fname.adb, which is unfortunate, but it seems like we don't
3352 want to add dependencies here.
3353 * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
3354 to Is_Predefined_Unit_Name; the former was wrong, because Uname
3355 is not a file name at all.
3356 * fname.ads, fname.adb: Document the fact that
3357 Is_Predefined_File_Name and Is_Internal_File_Name can be called
3358 for ALI files, and fix the code so it works properly for ALI
3359 files. E.g. these should return True for "system.ali".
3361 2017-04-25 Justin Squirek <squirek@adacore.com>
3363 * exp_util.adb (Add_Invariant): Removed,
3364 code moved to Add_Invariant_Check, Add_Inherited_Invariant,
3365 and Add_Own_Invariant. (Add_Invariant_Check): Used
3366 for adding runtime checks from any kind of invariant.
3367 (Add_Inherited_Invariant): Generates invariant checks for
3368 class-wide invariants (Add_Interface_Invariants): Removed, code
3369 moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
3370 Create a types own invariant procedure (Add_Parent_Invariants):
3371 Removed, code moved to Build_Invariant_Procedure_Body
3372 (Build_Invariant_Procedure_Body): Add refactored calls
3373 and integrated code from Add_Parent_Invariants and
3374 Add_Interface_Invariants.
3375 (Process_Type): Removed, the
3376 relavant code was inlined into both Add_Own_Invariant and
3377 Add_Inherited_Invariant.
3379 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3381 * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
3382 scn.adb, osint.adb, fname.adb: Minor reformatting.
3384 2017-04-25 Pascal Obry <obry@adacore.com>
3386 * s-taprop-mingw.adb: Do not check for CloseHandle in
3389 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3391 * sem_util.adb (Check_Part_Of_Reference):
3392 Continue to examine the context if the reference appears within
3393 an expression function.
3395 2017-04-25 Justin Squirek <squirek@adacore.com>
3397 * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
3398 and Build_Invariant_Procedure_Declaration.
3399 * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
3400 and Build_Invariant_Procedure_Declaration from exp_ch7
3401 and break-out Is_Untagged_Private_Derivation from
3402 Build_Invariant_Procedure_Body.
3403 (Replace_Type_References):
3404 Append an extra parameter to allow for dispatching replacements
3405 and add the corrasponding logic.
3406 (Type_Invariant): Remove
3407 Replace_Typ_Refs and replace its references with calls to
3408 Replace_Type_References.
3409 * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
3411 2017-04-25 Bob Duff <duff@adacore.com>
3413 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
3414 that returns True when appropriate.
3415 * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
3416 when compiling predefined files.
3417 * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
3418 "gnat.adc" should not be considered a predefined file name.
3419 That required (or at least encouraged) a lot of cleanup of global
3420 variable usage. We shouldn't be communicating information via
3421 the global name buffer.
3422 * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
3423 * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
3424 required by the above-mentioned cleanup.
3426 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3428 * osint.adb (Find_File): Handle properly a request for a
3429 configuration file whose name is a directory.
3431 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3433 * sem_attr.adb, sem_ch5.adb: Minor reformatting.
3435 2017-04-25 Bob Duff <duff@adacore.com>
3437 * types.ads: Minor: Fix '???' comment.
3438 * sem_ch8.adb: Minor comment fix.
3440 2017-04-25 Bob Duff <duff@adacore.com>
3442 * sem_prag.adb: Remove suspicious uses of Name_Buf.
3443 * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
3444 Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
3445 Add String_To_Name with no side effects.
3447 2017-04-25 Justin Squirek <squirek@adacore.com>
3449 * sem_ch3.adb (Analyze_Declarations): Add
3450 additional condition for edge case.
3452 2017-04-25 Bob Duff <duff@adacore.com>
3454 * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
3455 reserved words inside pragmas. This is necessary to allow the
3456 pragma name Interface to be used in pragma Ignore_Pragma.
3457 * par.adb: Minor comment fix.
3459 2017-04-25 Javier Miranda <miranda@adacore.com>
3461 * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
3462 * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
3463 * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
3464 * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
3465 occurrences of RE_Type_Is_Abstract
3467 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3469 * exp_util.adb (Build_Chain): Account for ancestor
3470 subtypes while traversing the derivation chain.
3472 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3474 * sem_attr.adb: minor reformatting.
3476 2017-04-25 Doug Rupp <rupp@adacore.com>
3478 * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
3480 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3482 * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
3483 the first pass over an assignment statement with target names,
3484 to prevent the generation of subtypes (such as discriminated
3485 record components)that may carry the target name outside of the
3486 tree for the assignment. The subtypes will be generated when
3487 the assignment is reanalyzed in full.
3488 (Analyze_Target_Name): Handle properly class-wide types.
3490 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3492 * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
3493 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3494 the purposes of freezing.
3495 * exp_util.adb Update the documentation and structure of the
3496 type map used in class-wide semantics of assertion expressions.
3497 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3498 and resolve the triaged expression because all substitutions
3499 refer to the proper entities. Update the replacement of
3501 (Build_DIC_Procedure_Body): Add formal parameter
3502 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3503 are now only processed when freezing occurs. Build a body only
3505 (Entity_Hash): Removed.
3506 (Map_Types): New routine.
3507 (Replace_Object_And_Primitive_References): Removed.
3508 (Replace_References): New routine.
3509 (Replace_Type_References): Moved to the library level of Exp_Util.
3510 (Type_Map_Hash): New routine.
3511 (Update_Primitives_Mapping): Update the mapping call.
3512 (Update_Primitives_Mapping_Of_Types): Removed.
3513 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3514 parameter For_Freeze and update the comment on usage.
3515 (Map_Types): New routine.
3516 (Replace_References): New routine.
3517 (Replace_Type_References): Moved to the library level of Exp_Util.
3518 (Update_Primitives_Mapping_Of_Types): Removed.
3519 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3520 properties of the private type to the full view in case the full
3521 view derives from a parent type and inherits a DIC pragma.
3522 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3523 DIC pragma is placed at the top of a declarative region.
3525 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3527 * a-tasatt.adb: Complete previous change and use an unsigned
3528 int to avoid overflow checks.
3530 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3532 * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
3533 the error message when the attribute reference is an actual in
3534 a call to a subprogram inherited from a generic formal type with
3535 unknown discriminants, which makes the subprogram and its formal
3536 parameters intrinsic (see RM 6.3.1 (8) and (13)).
3538 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3540 * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
3541 sem_prag.adb: Minor reformatting.
3543 2017-04-25 Bob Duff <duff@adacore.com>
3545 * sem_attr.adb (Type_Key): Add code in the
3546 recursive Compute_Type_Key to protect against fetching the source
3547 code for Standard, in case a component of the type is declared
3548 in Standard. There was already code to do this for the original
3549 type, but not for its components.
3551 2017-04-25 Javier Miranda <miranda@adacore.com>
3553 * exp_ch3.adb (Build_Initialization_Call): Handle
3554 subtypes of private types when searching for the underlying full
3555 view of a private type.
3557 2017-04-25 Javier Miranda <miranda@adacore.com>
3559 * sem_res.adb (Set_Mixed_Mode_Operand): A universal
3560 real conditional expression can appear in a fixed-type context
3561 and must be resolved with that context to facilitate the code
3562 generation to the backend.
3564 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3566 * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
3567 to indicate whether during inline processing, when some unit U1
3568 appears in the context of a unit U2 compiled for instantiation
3569 or inlining purposes, the body of U1 needs to be compiled as well.
3570 * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
3571 context is a package declaration.
3572 * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
3573 Analyze_Generic_Package_Declaration): ditto.
3574 * inline.adb (Analyze_Inlined_Bodies): Check
3575 Body_Needed_For_Inlining.
3577 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3579 * par.adb (Current_Assign_Node): Global variable use to record
3580 the presence of a target_name in the right hand side of the
3581 assignment being parsed.
3582 * par-ch4.adb (P_Name): If the name is a target_name, mark the
3583 enclosing assignment node accordingly.
3584 * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
3586 * sem_ch5.adb (Analyze_Assignment): Disable expansion before
3587 analyzing RHS if the statement has target_names.
3588 * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
3589 properly choices that are subtype marks.
3590 * exp_ch5.adb: Code cleanup.
3592 2017-04-25 Bob Duff <duff@adacore.com>
3594 * s-memory.adb: Add a comment regarding efficiency.
3595 * atree.adb: Fix the assertion, and combine 2 assertions into one,
3596 "the source has an extension if and only if the destination does."
3597 * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
3599 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3601 * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
3604 2017-04-25 Doug Rupp <rupp@adacore.com>
3606 * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
3607 handling for ppc64-vx7.
3608 * sigtramp-vxworks-target.inc
3609 [SIGTRAMP_BODY]: Add section for ppc64-vx7.
3611 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3613 * ada_get_targ.adb: New file.
3615 2017-04-25 Bob Duff <duff@adacore.com>
3617 * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
3618 Direct_Val (Right), instead of the incorrect Direct_Val (Left).
3619 (UI_GCD): Remove ??? comment involving possible efficiency
3620 improvements. This just isn't important after all these years.
3622 * uintp.ads: Minor cleanup.
3624 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3626 * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
3627 Revert previous changes.
3628 * scng.adb: Minor reformatting.
3629 * s-stratt.ads: Fix unbalanced parens in comment.
3631 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3633 * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
3636 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3638 * scng.adb (Scan): Handle '@' appropriately.
3639 * sem_ch5.adb: Code cleanup.
3641 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3643 * freeze.adb (Check_Expression_Function): Do not check for the
3644 use of deferred constants if the freezing of the expression
3645 function is triggered by its generated body, rather than a
3648 2017-04-25 Javier Miranda <miranda@adacore.com>
3650 * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
3651 subtypes of private types when performing the view conversion.
3653 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3655 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3656 the purposes of freezing.
3657 * exp_util.adb Update the documentation and structure of the
3658 type map used in class-wide semantics of assertion expressions.
3659 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3660 and resolve the triaged expression because all substitutions
3661 refer to the proper entities. Update the replacement of
3663 (Build_DIC_Procedure_Body): Add formal parameter
3664 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3665 are now only processed when freezing occurs. Build a body only
3667 (Entity_Hash): Removed.
3668 (Map_Types): New routine.
3669 (Replace_Object_And_Primitive_References): Removed.
3670 (Replace_References): New routine.
3671 (Replace_Type_References): Moved to the library level of Exp_Util.
3672 (Type_Map_Hash): New routine.
3673 (Update_Primitives_Mapping): Update the mapping call.
3674 (Update_Primitives_Mapping_Of_Types): Removed.
3675 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3676 parameter For_Freeze and update the comment on usage.
3677 (Map_Types): New routine.
3678 (Replace_References): New routine.
3679 (Replace_Type_References): Moved to the library level of Exp_Util.
3680 (Update_Primitives_Mapping_Of_Types): Removed.
3681 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3682 properties of the private type to the full view in case the full
3683 view derives from a parent type and inherits a DIC pragma.
3684 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3685 DIC pragma is placed at the top of a declarative region.
3687 2017-04-25 Tristan Gingold <gingold@adacore.com>
3689 * s-mmap.ads (Data): Add pragma Inline.
3691 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3693 * checks.adb (Insert_Valid_Check): Do not use
3694 a renaming to alias a volatile name because this will lead to
3695 multiple evaluations of the volatile name. Use a constant to
3696 capture the value instead.
3698 2017-04-25 Doug Rupp <rupp@adacore.com>
3700 * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
3702 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3704 * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
3705 Add out parameter to indicate to caller that a wrapper must
3706 be constructed for an inherited primitive whose inherited
3707 pre/postcondition has called to overridden primitives.
3708 * freeze.adb (Check_Inherited_Conditions): Build wrapper body
3709 for inherited primitive that requires it.
3710 * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
3711 legal primitive operations and belong to the list of bodies
3712 generated after the freeze point of a type.
3713 * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
3714 of Build_Class_Wide_Expression.
3715 * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
3716 to construct the specification of the wrapper subprogram created
3717 for an inherited operation.
3719 2017-04-25 Bob Duff <duff@adacore.com>
3721 * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
3722 pthread_mutexattr_setprioceiling): Add new interfaces for these
3724 * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
3725 protocols as appropriate for Locking_Policy 'C' and 'I'.
3726 * s-taprop-posix.adb: Minor reformatting to make it more similar
3727 to s-taprop-linux.adb.
3729 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3731 * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
3732 Handle properly a multi- level derivation involving both renamed
3733 and constrained parent discriminants, when the type to be
3734 constrained has fewer discriminants that the ultimate ancestor.
3736 2017-04-25 Bob Duff <duff@adacore.com>
3738 * sem_util.adb (Is_Object_Reference): In the
3739 case of N_Explicit_Dereference, return False if it came from a
3740 conditional expression.
3742 2017-04-25 Bob Duff <duff@adacore.com>
3744 * par-ch4.adb (P_Case_Expression): If a semicolon
3745 is followed by "when", assume that ";" was meant to be ",".
3747 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3749 * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
3752 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3754 * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
3755 loading of an entity.
3756 * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
3757 previously repeated in the analysis.
3758 * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
3759 procedure SPARK_Implicit_Load. (Analyze_Task_Type_Declaration):
3760 use new procedure SPARK_Implicit_Load.
3761 * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
3762 SPARK_Implicit_Load.
3764 2017-04-25 Javier Miranda <miranda@adacore.com>
3766 * sem_util.adb (New_Copy_Tree): By default
3767 copying of defining identifiers is prohibited because
3768 this would introduce an entirely new entity into the
3769 tree. This patch introduces an exception to this general
3770 rule: the declaration of constants and variables located in
3771 Expression_With_Action nodes.
3772 (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
3773 (In_Map): New subprogram.
3774 (Visit_Entity): New subprogram.
3775 (Visit_Node): Handle EWA_Level,
3776 EWA_Inner_Scope_Level, and take care of defining entities defined
3777 in Expression_With_Action nodes.
3779 2017-04-25 Thomas Quinot <quinot@adacore.com>
3781 * exp_ch6.adb: minor comment edit.
3782 * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
3783 procedure specifications that come from source.
3784 * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
3785 Null_Statement attribute.
3786 * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
3787 procedure, generate statement SCO for the generated NULL statement.
3788 * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
3789 parser, if available.
3791 2017-04-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3793 * system-linux-s390.ads: Use Long_Integer'Size to define
3796 2017-04-04 Eric Botcazou <ebotcazou@adacore.com>
3798 * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
3800 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3802 * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
3803 * g-socket.adb (To_Host_Entry): Fix typo in comment.
3804 * gnat_ugn.texi: Fix typo.
3805 * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
3806 * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
3807 * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
3808 * sem_util.adb (Mark_Coextensions): Likewise.
3809 * sem_util.ads (Available_Full_View_Of_Component): Likewise.
3811 2017-03-28 Andreas Schwab <schwab@suse.de>
3814 * system-linux-aarch64-ilp32.ads: New file.
3815 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
3816 from LIBGNAT_TARGET_PAIRS.
3817 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
3818 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
3819 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
3820 or -mabi=ilp32, resp.
3822 2017-03-14 James Cowgill <James.Cowgill@imgtec.com>
3824 * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
3826 2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
3829 * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
3831 2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
3834 * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
3836 * system-linux-arm.ads (Default_Bit_Order): Likewise.
3837 * system-linux-mips.ads (Default_Bit_Order): Likewise.
3838 * system-linux-armeb.ads: Delete.
3839 * system-linux-mipsel.ads: Likewise.
3840 * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
3841 (ARM/Linux): Likewise.
3843 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3846 * gcc-interface/misc.c (gnat_handle_option): Pass true to
3847 handle_generated_option GENERATED_P.
3849 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3851 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
3852 around a justified modular type if it doesn't have the same scalar
3853 storage order as the enclosing record type.
3855 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3857 * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
3858 of boolean rvalues to function calls.
3860 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3862 * gcc-interface/utils.c (fold_bit_position): New function.
3863 (rest_of_record_type_compilation): Call it instead of bit_position to
3864 compute the field position and remove the call to remove_conversions.
3865 (compute_related_constant): Factor out the multiplication in both
3866 operands, if any, and streamline the final test.
3868 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3870 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
3872 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3874 * gcc-interface/decl.c: Include demangle.h.
3875 (is_cplusplus_method): Return again true for a primitive operation
3876 only if it is dispatching. For a subprogram with an interface name,
3877 call the demangler to get the number of C++ parameters and compare it
3878 with the number of Ada parameters.
3880 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3882 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
3883 there is no end label, put the location of the At_End procedure on
3884 the call to the procedure.
3886 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3888 * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
3889 value for array types with TYPE_INDEX_TYPE set on their domain type.
3890 * gcc-interface/utils.c (max_size): For operations and expressions, do
3891 not build a new node if the operands have not changed or are missing.
3893 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3895 * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
3896 argument when recursing on TRUTH_NOT_EXPR.
3898 2017-02-12 John Marino <gnugcc@marino.st>
3900 * system-freebsd-x86.ads: Rename into...
3901 * system-freebsd.ads: ...this.
3902 (Default_Bit_Order): Define using Standard'Default_Bit_Order.
3903 * gcc-interface/Makefile.in: Support aarch64-freebsd.
3904 (x86-64/FreeBSD): Adjust to above renaming.
3905 (i386/FreeBSD): Likewise.
3907 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
3909 * comperr.adb: Update FSF bug reporting URL.
3911 2017-02-01 Eric Botcazou <ebotcazou@adacore.com>
3912 Jakub Jelinek <jakub@redhat.com>
3915 * adaint.c (__gnat_killprocesstree): Fix broken string handling.
3917 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
3920 * gcc-interface/utils.c (get_global_context): Pass main_input_filename
3921 to build_translation_unit_decl.
3923 2017-01-23 Javier Miranda <miranda@adacore.com>
3925 * sem_util.adb (New_Copy_Tree): Code cleanup:
3926 removal of the internal map (ie. variable Actual_Map, its
3927 associated local variables, and all the code handling it).
3928 * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
3929 force loading of the System package when processing a task type.
3930 (Analyze_Protected_Type_Declaration): in GNATprove mode force
3931 loading of the System package when processing a protected type.
3932 * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
3933 force loading of the System package when processing compilation
3934 unit with a main-like subprogram.
3935 * frontend.adb (Frontend): remove forced loading of the System
3938 2017-01-23 Ed Schonberg <schonberg@adacore.com>
3940 * sem_prag.adb (Default_Initial_Condition): If the desired type
3941 declaration is a derived type declaration with discriminants,
3942 it is rewritten as a private type declaration.
3943 * sem_ch13.adb (Replace_Type_References_Generic,
3944 Visible_Component): A discriminated private type with descriminnts
3945 has components that must be rewritten as selected components
3946 if they appear as identifiers in an aspect expression such as
3947 a Default_Initial_Condition.
3948 * sem_util.adb (Defining_Entity): support N_Iterator_Specification
3951 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3953 * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
3954 * gnat1drv.adb Generate an empty object file for an ignored
3955 Ghost compilation unit.
3956 * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
3958 2017-01-23 Yannick Moy <moy@adacore.com>
3960 * sem_ch4.adb (Analyze_Indexed_Component_Form):
3961 Adapt to inlined prefix with string literal subtype.
3962 * inline.adb (Expand_Inlined_Call): Keep unchecked
3963 conversion inside inlined call when formal type is constrained.
3965 2017-01-23 Javier Miranda <miranda@adacore.com>
3967 * sem_util.adb (New_Copy_Tree): Code cleanup:
3968 removal of global variables. All the global variables, global
3969 functions and tables of this subprogram are now declared locally.
3971 2017-01-23 Gary Dismukes <dismukes@adacore.com>
3973 * exp_strm.ads: Minor reformatting and typo fixes.
3975 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3977 * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
3978 exp_aggr.adb: Minor reformatting.
3979 * g-diopit.adb: minor grammar/punctuation fix in comment.
3980 * g-byorma.ads: minor fix of unbalanced parens in comment.
3982 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3984 * par.adb: Update the documentation of component Labl.
3985 * par-ch6.adb (P_Return_Statement): Set the expected label of
3986 an extended return statement to Error.
3988 2017-01-23 Tristan Gingold <gingold@adacore.com>
3990 * s-boustr.ads, s-boustr.adb (Is_Full): New function.
3992 2017-01-23 Ed Schonberg <schonberg@adacore.com>
3994 * expander.adb: Handle N_Delta_Aggregate.
3996 2017-01-23 Javier Miranda <miranda@adacore.com>
3998 * exp_ch6.adb (Expand_Call): Improve the code that
3999 checks if some formal of the called subprogram is a class-wide
4000 interface, to handle subtypes of class-wide interfaces.
4002 2017-01-23 Javier Miranda <miranda@adacore.com>
4004 * checks.adb (Apply_Parameter_Aliasing_Checks):
4005 Remove side effects of the actuals before generating the overlap
4008 2017-01-23 Justin Squirek <squirek@adacore.com>
4010 * exp_strm.ads, exp_strm.ads
4011 (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
4012 as to avoid getting the underlying type by default.
4013 * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
4014 underlying type in the Iiput and output attribute cases when
4015 building their respective functions.
4017 2017-01-23 Gary Dismukes <dismukes@adacore.com>
4019 * scng.adb: Minor reformatting of error message.
4021 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4023 * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
4024 to freeze the return type of an expression funxtion that is a
4025 completion, if the type is a limited view and the non-limited
4028 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4030 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
4031 aggregate construct.
4032 (P_Record_Or_Array_Component_Association): An array aggregate
4033 can start with an Iterated_Component_Association.
4034 * scng.adb: Modify error message on improper use of @ in earlier
4035 versions of the language.
4036 * sinfo.ads: New node kind N_Delta_Aggregate.
4037 * sinfo.adb: An N_Delta_Aggregate has component associations and
4039 * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
4040 * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
4041 Create a new index for each one of the choices in the association,
4042 to prevent spurious homonyms in the scope.
4043 (Resolve_Delta_Aggregate): New.
4044 * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
4045 * exp_util.adb (Insert_Actions): Take into account
4047 * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
4048 * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
4049 and local procedures Expand_Delta_Array_Aggregate and
4050 expand_Delta_Record_Aggregate.
4051 * sprint.adb: Handle N_Delta_Aggregate.
4053 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4055 * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
4056 empty name when the exception declaration is subject to pragma
4058 (Null_String): New routine.
4060 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4062 * par-ch9.adb (P_Protected_Definition): Parse
4063 any optional and potentially illegal pragmas which appear in
4064 a protected operation declaration list.
4065 (P_Task_Items): Parse
4066 any optional and potentially illegal pragmas which appear in a
4069 2017-01-23 Pascal Obry <obry@adacore.com>
4071 * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
4072 is needed when a foreign thread call a Win32 API using a thread handle
4073 like GetThreadTimes() for example.
4075 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4077 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4078 allow an 'Address clause to be specified on a prefix of a
4081 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4083 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4084 attribute 'Valid is a renaming of the original expression when
4085 the expression denotes a name. For all other kinds of expression,
4086 use a constant to capture the value.
4087 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4088 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4090 2017-01-23 Justin Squirek <squirek@adacore.com>
4092 * sem_eval.adb (Eval_Integer_Literal): Add special
4093 case to avoid optimizing out check if the literal appears in
4096 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4098 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4099 allow an 'Address clause to be specified on a prefix of a
4102 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4104 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4105 attribute 'Valid is a renaming of the original expression when
4106 the expression denotes a name. For all other kinds of expression,
4107 use a constant to capture the value.
4108 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4109 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4111 2017-01-23 Justin Squirek <squirek@adacore.com>
4113 * sem_eval.adb (Eval_Integer_Literal): Add special
4114 case to avoid optimizing out check if the literal appears in
4117 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4119 * sem_ch4.adb (Try_Primitive_Operations,
4120 Is_Valid_First_Argument_Of): argument is valid if it is a derived
4121 type with unknown discriminants that matches its underlying
4123 * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
4124 expression if its type is derived from a limited type with
4125 unknown discriminants, because the expansion (which is a call)
4126 must be expanded in the enclosing context to add the proper build-
4127 in-place parameters to the call.
4128 * lib.ads, exp_ch9.adb: Minor fixes in comments.
4130 2017-01-23 Yannick Moy <moy@adacore.com>
4132 * frontend.adb (Frontend): Do not load runtime
4133 unit for GNATprove when parsing failed.
4134 * exp_ch9.adb: minor removal of extra whitespace
4135 * exp_ch6.adb: minor typo in comment
4136 * sem_util.adb: Code cleanup.
4137 * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
4138 * a-ngcefu.adb: minor style fix in whitespace
4140 2017-01-23 Thomas Quinot <quinot@adacore.com>
4142 * scos.ads: Document usage of 'd' as default SCO kind for
4144 * par_sco.adb (Traverse_Declarations_Or_Statements.
4145 Traverse_Degenerate_Subprogram): New supporting routine for expression
4146 functions and null procedures.
4147 (Traverse_Declarations_Or_Statements.Traverse_One): Add
4148 N_Expression_Function to the subprogram case; add required
4149 support for null procedures and expression functions.
4151 2017-01-23 Bob Duff <duff@adacore.com>
4153 * namet.ads (Bounded_String): Decrease the size of type
4154 Bounded_String to avoid running out of stack space.
4155 * namet.ads (Append): Don't ignore buffer overflow; raise
4156 Program_Error instead.
4158 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4160 * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
4161 sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
4163 * exp_ch9.adb: minor style fix in comment.
4165 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4167 * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
4168 for a limited record extension with unknown discriminants whose
4169 full view has no discriminants.
4171 2017-01-23 Yannick Moy <moy@adacore.com>
4173 * exp_spark.adb: Alphabetize with clauses.
4175 2017-01-23 Yannick Moy <moy@adacore.com>
4177 * sem_util.adb (Has_Enabled_Property): Treat
4178 protected objects and variables differently from other variables.
4180 2017-01-23 Thomas Quinot <quinot@adacore.com>
4182 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
4183 Split original Ada 95 part off into new subprogram
4184 below. Call that subprogram (instead of proceeding with
4185 AI95-0133 behaviour) if debug switch -gnatd.p is in use.
4186 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
4187 * debug.adb Document new switch -gnatd.p
4188 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
4189 record for reverse bit order if an error has already been posted
4190 on the record type. This avoids generating extraneous "info:"
4191 messages for illegal code.
4193 2017-01-23 Justin Squirek <squirek@adacore.com>
4195 * sem_ch3.adb (Analyze_Declarations): Correct comments
4196 * freeze.adb (Find_Constant): Add detection of deferred constants
4197 so they are not incorrectly flagged as premature.
4199 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4201 * scans.ads: New token At_Sign. Remove '@' from list of illegal
4202 characters for future version of the language. '@' is legal name.
4203 * scng.ads, scng.adb (Scan): Handle '@' appropriately.
4204 * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
4205 denotes a Target_Name.
4206 * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
4207 * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
4208 (Has_Target_Names): New flag on N_Assignment_Statement, to
4209 indicate that RHS has occurrences of N_Target_Name.
4210 * sem.adb: Call Analyze_Target_Name.
4211 * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
4212 (urrent_LHS): Global variable that denotes LHS of assignment,
4213 used in the analysis of Target_Name nodes.
4214 * sem_res.adb (Resolve_Target_Name): New procedure.
4215 * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
4216 N is an assignment statement whose RHS contains occurences of @
4217 that designate the value of the LHS of the assignment. If the
4218 LHS is side-effect free the target names can be replaced with
4219 a copy of the LHS; otherwise the semantics of the assignment
4220 is described in terms of a procedure with an in-out parameter,
4221 and expanded as such.
4222 (Expand_N_Assignment_Statement): Call
4223 Expand_Assign_With_Target_Names when needed.
4224 * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
4225 * sprint.adb: Handle N_Target_Name.
4227 2017-01-23 Eric Botcazou <ebotcazou@adacore.com>
4229 * checks.adb: Minor fix in comment.
4231 2017-01-23 Philippe Gil <gil@adacore.com>
4233 * g-debpoo.adb (Do_Report) remove freed chunks from chunks
4234 count in Sort = Memory_Usage or Allocations_Count
4236 2017-01-23 Justin Squirek <squirek@adacore.com>
4238 * sem_ch3.adb: Code cleanup.
4240 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4242 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
4243 variables to the local variable section. Update the profile
4244 of various nested routine that previously had visibility
4245 of those globals. One the matching phase has completed,
4246 remove certain classes of clauses which are considered noise.
4247 (Check_Dependency_Clause): Properly detect a match between two
4248 'Result attributes. Update the various post-match cases to use
4249 Is_Already_Matched as this routine now automatically recognizes
4250 a previously matched 'Result attribute.
4251 (Is_Already_Matched): New routine.
4252 (Remove_Extra_Clauses): New routine.
4253 (Report_Extra_Clauses): Remove the detection of ... => null
4254 clauses as this is now done in Remove_Extra_Clauses.
4256 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4258 * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
4259 report on spurious overlaps between values involving a subtype
4260 with a static predicate, because the expansion of such a subtype
4261 into individual ranges in inhibited in ASIS mode.
4263 2017-01-23 Justin Squirek <squirek@adacore.com>
4265 * sem_ch3.adb (Analyze_Declarations): Add detection
4266 of an edge case and delay freezing if it is present.
4268 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4270 * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
4271 sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
4273 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4275 * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
4276 access-to-subprogram types inherit the convention of the
4277 associated subprogram. (Set_Profile_Convention): New routine.
4278 * sem_ch6.adb (Check_Conformance): Do not compare the conventions
4279 of the two entities directly, use Conventions_Match to account
4280 for anonymous access-to-subprogram and subprogram types.
4281 (Conventions_Match): New routine.
4283 2017-01-23 Claire Dross <dross@adacore.com>
4285 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
4286 which return Universal_Integer, force the overflow check flag for
4287 Length and Range_Length for types as big as Long_Long_Integer.
4289 2017-01-23 Claire Dross <dross@adacore.com>
4291 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For
4292 attributes which return Universal_Integer, introduce a conversion
4293 to the expected type with the appropriate check flags set.
4294 * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
4295 base type if the range is null. It may still be invalid if it
4296 is higher than the lower bound. This is checked later in the
4297 context in which the range appears.
4299 2017-01-23 Pierre-Marie de Rodat <derodat@adacore.com>
4301 * scos.ads: Introduce a constant to represent ignored
4302 dependencies in SCO_Unit_Table_Entry.
4304 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4306 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
4307 spaces from error messages.
4309 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4311 * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
4312 subsidiary to Expand_N_Object_ Declaration, to compute a guard on
4313 an object declaration for an array type with a modular index type
4314 with the size of Long_Long_Integer. Special processing is needed
4315 in this case to compute reliably the size of the object, and
4316 eventually to raise Storage_Error, when wrap-around arithmetic
4317 might compute a meangingless size for the object.
4319 2017-01-23 Justin Squirek <squirek@adacore.com>
4321 * a-wtenau.adb, par-endh.adb, sem_prag.adb,
4322 sem_type.adb: Code cleanups.
4324 2017-01-23 Bob Duff <duff@adacore.com>
4326 * sem_res.adb (Resolve_Call): In the part of the code where
4327 it is deciding whether to turn the call into an indexed
4328 component, avoid doing so if the call is to an instance of
4329 Unchecked_Conversion. Otherwise, the compiler turns it into an
4330 indexed component, and resolution of that turns it back into a
4331 function call, and so on, resulting in infinite recursion.
4332 * sem_util.adb (Needs_One_Actual): If the first formal has a
4333 default, then return False.
4335 2017-01-21 Eric Botcazou <ebotcazou@adacore.com>
4337 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
4338 optimizations when the type is modular and the offsets are equal.
4340 2017-01-20 Thomas Quinot <quinot@adacore.com>
4342 * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
4345 2017-01-20 Nicolas Roche <roche@adacore.com>
4347 * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
4349 2017-01-20 Bob Duff <duff@adacore.com>
4351 * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
4352 (etc) optimizations when the type is modular.
4354 2017-01-20 Yannick Moy <moy@adacore.com>
4356 * sem_ch6.adb (Move_Pragmas): move some pragmas,
4357 but copy the SPARK_Mode pragma instead of moving it.
4358 (Build_Subprogram_Declaration): Ensure that the generated spec
4359 and original body share the same SPARK_Pragma aspect/pragma.
4360 * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
4361 procedure to copy SPARK_Mode aspect.
4363 2017-01-20 Bob Duff <duff@adacore.com>
4365 * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
4367 * sem_ch13.adb (Resolve_Name): Enable setting the entity to
4368 Empty even in ASIS mode.
4370 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4372 * exp_ch9.adb: minor style fixes in comments.
4373 * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
4374 relative statement introduces an implicit dependency on
4375 Ada.Real_Time.Clock_Time.
4376 * sem_util.adb: Minor reformatting.
4378 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4380 * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
4381 must be treated as delayed aspect even if the expression is
4382 a literal, because the aspect affects the freezing and the
4383 elaboration of the object to which it applies.
4385 2017-01-20 Tristan Gingold <gingold@adacore.com>
4387 * s-osinte-vxworks.ads (Interrup_Range): New subtype.
4389 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4391 * lib-xref.adb (Generate_Reference): Do not warn about the
4392 presence of a pragma Unreferenced if the entity appears as the
4393 actual in a procedure call that does not come from source.
4395 2017-01-20 Pascal Obry <obry@adacore.com>
4397 * expect.c, terminals.c: Fix some warnings about unused variables.
4398 * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
4401 2017-01-20 Bob Duff <duff@adacore.com>
4403 * exp_attr.adb (Constrained): Apply an access check (check that
4404 the prefix is not null) when the prefix denotes an object of an
4405 access type; that is, when there is an implicit dereference.
4407 2017-01-20 Gary Dismukes <dismukes@adacore.com>
4409 * s-rident.ads (constant Profile_Info): Remove
4410 No_Calendar from GNAT_Extended_Ravenscar restrictions.
4412 2017-01-20 Tristan Gingold <gingold@adacore.com>
4414 * s-maccod.ads: Add pragma No_Elaboration_Code_All
4416 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4418 * ghost.adb (Mark_Ghost_Clause): New routine.
4419 (Prune_Node): Do not prune compilation unit nodes.
4420 (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
4421 This does not touch the node itself, but does prune all its fields.
4422 * ghost.ads (Mark_Ghost_Clause): New routine.
4423 * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
4424 package clause mentions Ghost and non-Ghost packages. Mark a
4425 use package clause as Ghost when it mentions a Ghost package.
4426 (Analyze_Use_Type): Emit an error when a use type clause mentions
4427 Ghost and non-Ghost types. Mark a use type clause as Ghost when
4428 it mentions a Ghost type.
4429 * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
4430 Ghost when it withs a Ghost unit.
4432 2017-01-20 Javier Miranda <miranda@adacore.com>
4434 * sem_res.adb (Resolve_Call): If a function call
4435 returns a limited view of a type and at the point of the call the
4436 function is not declared in the extended main unit then replace
4437 it with the non-limited view, which must be available. If the
4438 called function is in the extended main unit then no action is
4439 needed since the back-end handles this case.
4441 2017-01-20 Eric Botcazou <ebotcazou@adacore.com>
4443 * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
4444 (Contains_Subprograms_Refs): ...this. Adjust comment
4445 for constants. (Is_Subp_Or_Const_Ref): Rename into...
4446 (Is_Subprogram_Ref): ...this.
4447 (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
4448 Has_Non_Subprograms_Referencer and adjust comment. Remove
4449 incorrect shortcut for package declarations and bodies.
4451 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4453 * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
4454 base type differs from that of the completion and the private
4455 subtype is an itype (created for a constraint on an access
4456 type e.g.), set Delayed_Freeze on both to prevent out-of-scope
4459 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4461 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4462 When inheriting the SPARK_Mode of a prior expression function,
4463 look at the properly resolved entity rather than the initial
4464 candidate which may denote a homonym.
4466 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4468 * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
4469 Precondition or Postcondition, and the context is pragma
4470 Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
4471 and suggest the standard names Assertion_Policy /Pre /Post
4474 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4476 * sem_ch10.adb, sem_cat.adb: Minor reformatting.
4478 2017-01-20 Javier Miranda <miranda@adacore.com>
4480 * sem_ch3.adb (Access_Type_Declaration): Protect access to the
4482 * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
4483 * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
4486 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4488 * sem_ch13.adb (Analyze_Aspect_Specification, case
4489 Dynamic_Predicate): If the entity E is a subtype that inherits
4490 a static predicate for its parent P,, the inherited and the
4491 new predicate combine in the generated predicate function,
4492 and E only has a dynamic predicate.
4494 2017-01-20 Tristan Gingold <gingold@adacore.com>
4496 * s-boustr.ads, s-boustr.adb: New package.
4497 * Makefile.rtl: Add s-boustr.
4499 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4501 * inline.adb (Process_Formals): Qualify the
4502 expression of a return statement when it yields a universal type.
4504 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4506 * freeze.adb (Freeze_All): Freeze the default
4507 expressions of all eligible formal parameters that appear in
4508 entries, entry families, and protected subprograms.
4510 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4512 * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
4513 for illegal inherited Implicit_Dereference aspects with renamed
4516 2017-01-20 Javier Miranda <miranda@adacore.com>
4518 * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
4519 * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
4520 * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
4521 (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
4522 Set_Prev, Tree_Read): Adding assertion.
4523 * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
4524 * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
4525 (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
4526 Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
4527 Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
4528 Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
4529 Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
4530 Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
4531 Set_ListN_With_Parent): Adding assertion.
4533 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4535 * sem_prag.adb (Process_Convention): Diagnose properly a pragma
4536 import that applies to several homograph subprograms. when one
4537 of them is declared by a subprogram body.
4539 2017-01-20 Justin Squirek <squirek@adacore.com>
4541 * exp_ch6.adb (Expand_Call): Remove optimization
4542 that nulls out calls to null procedures.
4544 2017-01-20 Yannick Moy <moy@adacore.com>
4546 * inline.adb (Expand_Inlined_Call): Keep more
4547 precise type of actual for inlining whenever possible. In
4548 particular, do not switch to the formal type in GNATprove mode in
4549 some case where the GNAT backend might require it for visibility.
4551 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4553 * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
4554 aspect Implicit_Dereference can be inherited by a full view if
4555 the partial view has no discriminants, because there is no way
4556 to apply the aspect to the partial view.
4557 (Build_Derived_Record_Type): If derived type renames discriminants
4558 of the parent, the new discriminant inherits the aspect from
4560 * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
4561 call through an access discriminant designating a subprogram.
4562 * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
4563 properly a parameterless call through an access discriminant on
4564 the left-hand side of an assignment.
4565 * sem_res.adb (resolve): If an interpreation involves a
4566 discriminant with an implicit dereference and the expression is an
4567 entity, resolution takes place later in the appropriate routine.
4568 * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
4569 access discriminants that designate a subprogram type.
4571 2017-01-20 Pascal Obry <obry@adacore.com>
4573 * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
4575 2017-01-20 Yannick Moy <moy@adacore.com>
4577 * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
4578 on implicitly with'ed units in GNATprove mode.
4579 * sinfo.ads (Implicit_With): Document use of flag for implicitly
4580 with'ed units in GNATprove mode.
4582 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4584 * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
4585 unit Do not report an error on a non-static entity that appears
4586 in the context of a spec expression, such as an aspect expression.
4588 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4590 * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
4591 (Is_Underlying_Full_View): New routine.
4592 (Set_Is_Underlying_Full_View): New routine.
4593 (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
4594 * einfo.ads Add new attribute Is_Underlying_Full_View.
4595 (Is_Underlying_Full_View): New routine along with pragma Inline.
4596 (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
4597 * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
4598 class-wide types and underlying full views. The first subtype
4599 is used as the working type for all Itypes, not just array base types.
4600 (Build_DIC_Procedure_Declaration): Do not consider
4601 class-wide types and underlying full views. The first subtype
4602 is used as the working type for all Itypes, not just array
4604 * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
4605 view or an underlying full view without clobbering the attributes
4606 of a previous freeze node.
4607 (Inherit_Freeze_Node): New routine.
4608 * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
4610 (Build_Underlying_Full_View): Mark an underlying full view as such.
4611 * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
4614 2017-01-20 Yannick Moy <moy@adacore.com>
4616 * sinfo.ads: Document lack of Do_Division_Check flag
4617 on float exponentiation.
4619 2017-01-19 Javier Miranda <miranda@adacore.com>
4621 * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
4622 identifier attribute of a block-statement node. Required to avoid
4623 assertion failure when building the new containers library.
4625 2017-01-19 Bob Duff <duff@adacore.com>
4627 * exp_ch3.adb: Update comment.
4629 2017-01-19 Vincent Celier <celier@adacore.com>
4631 * gprep.adb (Gnatprep): Parse the definition file without
4632 "replace in comments" even when switch -C is used.
4634 2017-01-19 Justin Squirek <squirek@adacore.com>
4636 * exp_ch9.adb (Is_Pure_Barrier): Create function
4637 Is_Count_Attribute to identify an expansion of the 'Count
4640 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4642 * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
4643 statements within an element iterator loop are only analyzed
4644 agter the loop is rewritten. Within a generic the analysis must
4645 be performed in any case to complete name capture.
4647 2017-01-19 Bob Duff <duff@adacore.com>
4649 * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
4650 before checking for unrecognized pragmas.
4651 Initialize Pname on its declarations; that's always good style.
4653 2017-01-19 Claire Dross <dross@adacore.com>
4655 * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
4656 body into the tree for GNATprove by setting its Parent field. The
4657 components invariants of composite types are not checked by
4658 the composite type's invariant procedure in GNATprove mode.
4659 (Build_Invariant_Procedure_Declaration): Semi-insert the
4660 declaration into the tree for GNATprove by setting its Parent
4662 * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
4663 the component invariants to the array type invariant procedure
4664 so that the procedure can be used to check the array type
4666 (Freeze_Record_Type): In GNATprove mode, do
4667 not add the component invariants to the record type invariant
4668 procedure so that the procedure can be used to check the record
4669 type invariants if any.
4671 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4673 * lib-xref-spark_specific.adb: Minor reformatting.
4674 * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
4676 2017-01-19 Javier Miranda <miranda@adacore.com>
4678 * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
4679 Build_Back_End_Aggregate.
4680 (Generate_Aggregate_For_Derived_Type): Code cleanup.
4681 (Prepend_Stored_Values): Code cleanup.
4683 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4685 * sem_ch6.adb (Analyze_Expression_Function): Check for an
4686 incomplete return type after attempting to freeze it, so that
4687 other freeze actiona are generated in the proper order.
4689 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4691 * sem_aggr.adb (Resolve_Aggregate): If the type is a string
4692 type, ie. a type whose component is a character type, and the
4693 aggregate is positional, do not convert into a string literal
4694 if the index type is not an integer type, because the original
4695 type may be required in an enclosing operation.
4697 2017-01-19 Bob Duff <duff@adacore.com>
4699 * binde.adb, debug.adb: Enable new elaboration order algorithm
4700 by default. -dp switch reverts to the old algorithm.
4702 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4704 * sem_ch3.adb Add with and use clauses for Exp_Ch7.
4705 (Analyze_Declarations): Create the DIC and Invariant
4706 procedure bodies s after all freezing has taken place.
4707 (Build_Assertion_Bodies): New routine.
4708 * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
4710 (Analyze_Package_Specification): Remove the
4711 generation of the DIC and Invariant procedure bodies. This is
4712 now done by Analyze_Declarations.
4713 * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
4714 procedures are never treated as primitives.
4716 2017-01-19 Yannick Moy <moy@adacore.com>
4718 * frontend.adb: Analyze inlined bodies and check elaboration
4719 rules in GNATprove mode too.
4720 * sem_elab.adb (Delay_Element): Add Boolean component to save
4721 indication that call is in SPARK code. (Check_Elab_Calls):
4722 Check elaboration rules in GNATprove mode, and correctly set
4723 the current value of SPARK_Mode.
4724 * lib-xref-spark_specific.adb
4725 (Add_SPARK_Xrefs): Simplify iteration over dereferences.
4727 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4729 * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
4730 checks on the expression for the high bound of concatenation
4731 when checks are disabled, to suppress warnings about potential
4732 constraint errors in restricted runtimes.
4734 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4736 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
4737 representation-to-position function as inlined.
4738 * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
4739 the purity of an internally generated entity if it has been
4740 explicitly marked as pure for optimization purposes.
4741 * exp_aggr.adb: Minor reformatting.
4743 2017-01-19 Javier Miranda <miranda@adacore.com>
4745 * exp_ch6.adb (Expand_Call): Remove side effects on
4746 actuals that are allocators with qualified expression since the
4747 initialization of the object is performed by means of individual
4748 statements (and hence it must be done before the call).
4750 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4752 * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
4753 (Build_Derived_Enumeration_Type): If the derived type inherits a
4754 dynamic predicate from its parent, the bounds of the type must
4755 freeze because an explicit constraint is constructed for the
4756 type and the corresponding range is elaborated now.
4758 2017-01-19 Arnaud Charlet <charlet@adacore.com>
4760 * sem_attr.ads: minor fix of inconsistent casing in comment
4761 * lib-writ.ads: minor align comments in columns
4762 * sem_ch3.adb: Minor reformatting.
4763 * spark_xrefs.ads: minor fix typo in SPARK-related comment
4764 * table.ads: minor style fix in comment
4765 * lib-xref-spark_specific.adb
4766 (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
4767 * sem_ch12.adb: minor whitespace fix
4768 * freeze.adb: Add comment.
4769 * sem_util.adb (Unique_Name): for instances of
4770 generic subprograms ignore the name of the wrapper package.
4772 2017-01-19 Javier Miranda <miranda@adacore.com>
4774 * exp_aggr.adb (Resolve_Record_Aggregate):
4775 Factorize code needed for aggregates of limited and unlimited
4776 types in a new routine.
4777 (Pass_Aggregate_To_Back_End): New subprogram.
4779 2017-01-19 Yannick Moy <moy@adacore.com>
4781 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
4783 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4785 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
4786 public, for use elsewhere.
4787 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
4788 an Inlined_body, recognize a call that uses object notation
4789 and has not been rewritten as a regular call because regular
4790 expansion has not taken place.
4792 2017-01-19 Bob Duff <duff@adacore.com>
4794 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
4795 in case of generic formal discrete types, because it causes crashes in
4796 the compiler when built with assertions on.
4798 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4800 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
4801 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
4803 2017-01-19 Bob Duff <duff@adacore.com>
4805 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
4806 Increment Warnings_Detected. It was decrementing, which is
4807 wrong since we just issued a warning message.
4808 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
4809 these variables to be of subtype Nat instead of Int, because
4810 they should never be negative.
4812 2017-01-19 Javier Miranda <miranda@adacore.com>
4814 * contracts.adb (Build_Postconditions_Procedure): Replace
4815 Generate_C_Code by Modify_Tree_For_C.
4816 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
4817 Replace Generate_C_Code by Modify_Tree_For_C.
4818 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
4820 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
4821 Generate_C_Code by Modify_Tree_For_C.
4822 * exp_ch4.adb (Expand_Allocator_Expression): Replace
4823 Generate_C_Code by Modify_Tree_For_C.
4824 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
4825 by Modify_Tree_For_C.
4826 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
4827 Generate_C_Code by Modify_Tree_For_C.
4828 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
4829 by Modify_Tree_For_C.
4830 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
4832 2017-01-19 Javier Miranda <miranda@adacore.com>
4834 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
4836 (Is_Inlinable_Expression_Function): New subprogram.
4837 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
4839 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
4841 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4843 * sem_ch4.adb (Diagnose_Call): Improve error message when a
4844 selected component has a prefix that might be interpreted
4845 as a parameterless function call, but none of the candidate
4846 interpretations is parameterless, and there is a hidden homonym
4847 of the prefix that is a package.
4848 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
4849 interpreted as a parameterless function call and its analysis
4850 fails, do not call Analyze_Selected_Component.
4852 2017-01-19 Steve Baird <baird@adacore.com>
4854 * sem_util.ads: Add new Use_Full_View Boolean parameter to
4856 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
4857 calls to a newly-defined Scalar_Range_Of_Right_View function.
4859 2017-01-19 Arnaud Charlet <charlet@adacore.com>
4861 * gnat1drv.adb: minor fix of unbalanced parens in comment
4862 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
4863 to visible part of the package to allow re-use in GNATprove.
4864 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
4865 from repeated code of Traverse_Compilation_Unit.
4866 (Traverse_Declaration_Or_Statement): fixed detection of
4867 generic subprograms and packages; also, iteration over case
4868 statement alternatives rewritten to avoid testing if the first
4869 alternative is present (since it must be present due to Ada
4870 syntax restrictions).
4872 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4874 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
4875 returning by reference not just for subprogram body stubs,
4876 but for all subprogram cases.
4877 * sem_util.adb: Code reformatting.
4878 (Requires_Transient_Scope): Update the call to Results_Differ.
4879 (Results_Differ): Update the parameter profile and the associated
4882 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4884 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
4885 identifier nodes that do not come from source, to handle properly
4886 dimensionality check within an inlined body which inclddes both
4887 original operands and rewritten operands. This removes spurious
4888 dimensionality errors in the presence of front-end inlining,
4889 as well as in SPARK mode.
4891 2017-01-16 Jakub Jelinek <jakub@redhat.com>
4894 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
4896 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4898 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
4900 2017-01-13 Arnaud Charlet <charlet@adacore.com>
4902 * doc/gnat_ugn/getting_started_with_gnat.rst,
4903 doc/gnat_ugn/inline_assembler.rst,
4904 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4905 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
4906 doc/gnat_ugn/about_this_guide.rst,
4907 doc/gnat_ugn/platform_specific_information.rst,
4908 doc/gnat_ugn/example_of_binder_output.rst,
4909 doc/gnat_ugn/gnat_and_program_execution.rst,
4910 doc/gnat_ugn/gnat_utility_programs.rst,
4911 doc/gnat_ugn/the_gnat_compilation_model.rst,
4912 doc/gnat_rm/implementation_defined_attributes.rst,
4913 doc/gnat_rm/compatibility_and_porting_guide.rst,
4914 doc/gnat_rm/standard_library_routines.rst,
4915 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
4916 doc/gnat_rm/implementation_defined_pragmas.rst,
4917 doc/gnat_rm/the_gnat_library.rst,
4918 doc/gnat_rm/obsolescent_features.rst,
4919 doc/gnat_rm/about_this_guide.rst,
4920 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
4921 doc/gnat_rm/implementation_of_ada_2012_features.rst,
4922 doc/gnat_rm/interfacing_to_other_languages.rst,
4923 doc/gnat_rm/implementation_defined_aspects.rst,
4924 doc/gnat_rm.rst: Update documentation.
4925 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
4927 2017-01-13 Ed Schonberg <schonberg@adacore.com>
4929 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
4930 * scil_ll.adb: Minor style fix in comment.
4931 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
4932 even if entity is already set, because the node may be renalyzed
4933 after inlining transformations.
4935 2017-01-13 Javier Miranda <miranda@adacore.com>
4937 * sem_res.adb (Resolve_Call): Do not establish a transient scope
4938 for a call to inlinable expression function (since the call will
4939 be replaced by its returned object).
4940 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
4941 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
4942 (Expand_Call): For inlinable expression function call replace the
4943 call by its returned object.
4944 (Is_Inlinable_Expression_Function): New subprogram.
4946 2017-01-13 Gary Dismukes <dismukes@adacore.com>
4948 * checks.adb: Minor typo fix and reformatting.
4950 2017-01-13 Javier Miranda <miranda@adacore.com>
4952 * contracts.adb (Contract_Only_Subprograms): Remove formal.
4953 (Copy_Original_Specification): Removed.
4954 (Skip_Contract_Only_Subprogram): Move here checks previously
4955 located in the caller of this routine (to leave the code more clean).
4956 (Build_Contract_Only_Subprogram): Code cleanup.
4957 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
4958 (Get_Contract_Only_Missing_Body_Name): Removed.
4960 2017-01-13 Javier Miranda <miranda@adacore.com>
4962 * sem_ch6.adb (Cloned_Expression): New subprogram.
4963 (Freeze_Expr_Types): Complete previous patch since the expression
4964 of an expression-function may have iterators and loops with
4965 defining identifiers which, as part of the preanalysis of the
4966 expression, may be left decorated with itypes that will not be
4967 available in the tree passed to the backend.
4969 2017-01-13 Ed Schonberg <schonberg@adacore.com>
4971 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
4972 conversion to Integer of an expression that is an attribute
4973 reference 'Pos on an enumeration type.
4975 2017-01-13 Bob Duff <duff@adacore.com>
4977 * atree.ads: Minor comment fix.
4979 2017-01-13 Justin Squirek <squirek@adacore.com>
4981 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
4982 calls in accessibility check on return statement.
4984 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
4986 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4987 Ensure that the input body is a subprogram body before trying to
4988 determine whether it denoted an expression function. Note that
4989 subprogram body stubs cannot denote expression functions.
4991 2017-01-13 Gary Dismukes <dismukes@adacore.com>
4993 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
4996 2017-01-13 Javier Miranda <miranda@adacore.com>
4998 * einfo.ads (Component_Bit_Offset): Fix documentation.
4999 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
5000 on record holes for components with unknown compile-time offsets.
5002 2017-01-13 Bob Duff <duff@adacore.com>
5004 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
5005 * g-locfil.ads: Minor comment fix.
5007 2017-01-13 Bob Duff <duff@adacore.com>
5009 * binde.adb (Elab_New): New elaboration order algorithm
5010 that is expected to cause fewer ABE issues. This is a work in
5011 progress. The new algorithm is currently disabled, and can be
5012 enable by the -dp switch, or by modifying the Do_Old and Do_New
5013 etc. flags and rebuilding. Experimental code is included to
5014 compare the results of the old and new algorithms.
5015 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
5016 can have multiple of these tables, so the old and new algorithms
5018 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
5019 parameter of type array. This avoids the global variable, and
5020 allows bounds checking (which is normally defeated by the tables
5021 packages). It also ensures that the Elab_Order is read-only
5023 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
5024 subprograms that need it, as above.
5025 * debug.adb: Document new -dp switch. Modify doc of old -do
5027 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
5028 and Bindgen. Move writing of closure (-R and -Ra switches)
5029 to Binde; that's more convenient.
5031 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5033 * sem_ch6.adb (Analyze_Expression_Function): If the expression
5034 function is a completion, all entities referenced in the
5035 expression are frozen. As a consequence, a reference to an
5036 uncompleted private type from an enclosing scope is illegal.
5038 2017-01-13 Javier Miranda <miranda@adacore.com>
5040 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
5041 (Analyze_Subprogram_Body_Helper): At the occurrence of an
5042 expression function declaration that is a completion, its
5043 expression causes freezing (AI12-0103).
5045 2017-01-13 Vadim Godunko <godunko@adacore.com>
5047 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
5048 Reference functions of Ada.Containers.Indefinite_Holders.
5050 2017-01-13 Bob Duff <duff@adacore.com>
5052 * s-os_lib.ads: Minor comment fixes.
5054 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5056 * exp_ch3.adb (Default_Initialize_Object): Do not default
5057 initialize an object when it is of a task type and restriction
5058 No_Tasking is in effect because the initialization is obsolete.
5059 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
5060 restriction No_Tasking is in effect.
5061 (Build_Master_Renaming): Do not rename a master when restriction
5062 No_Tasking is in effect.
5064 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5066 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
5067 the legality of An others clause applies as well to a choice in
5068 an Iterated_component_ association.
5069 (Resolve_Iterated_Component_Association): An others choice
5071 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
5072 Iterated_Component_Association is not static.
5074 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5076 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
5077 control is passed to the expresion handler before the new mode
5079 * sem_ch12.adb (Analyze_Package_Instantiation,
5080 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
5081 in case control is passed to the expresion handler before the
5084 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5086 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
5087 exp_aggr.adb: Minor reformatting.
5089 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5091 * inline.adb: Minor reformatting and typo fix.
5093 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5095 * sem_util.ads, sem_util.adb (Choice_List): Move function here
5096 from sem_aggr.adb, for use elsewhere.
5097 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
5098 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
5099 Iterated_Component_Present.
5100 * exp_aggr.adb: Use Choice_List throughout, to handle
5101 Iterated_Component_Associations.
5102 (Gen_Loop): Generate proper loop for an
5103 Iterated_Component_Association: loop variable has the identifier
5104 of the original association. Generate a loop even for a single
5105 component choice, in order to make loop parameter visible in
5107 (Flatten): An Iterated_Component_Association is not static.
5109 2017-01-13 Yannick Moy <moy@adacore.com>
5111 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
5112 float exponentiation for statically known small negative values
5113 is the reciprocal of the exponentiation for the opposite value
5115 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
5116 Ensure that the value of float exponentiation for negative values
5117 is the reciprocal of the exponentiation for the opposite value
5119 * inline.adb (Expand_Inlined_Call): Fix the count
5120 for the number of generated gotos.
5122 2017-01-13 Yannick Moy <moy@adacore.com>
5124 * inline.adb: Code cleanup.
5125 * sem_util.adb (Is_OK_Volatile_Context): Add
5126 expression in delay statement as OK for volatile context.
5128 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5130 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
5131 mode a choice that is a subtype with a static predicate is
5132 replaced by the values it covers. This transformation must not
5133 be performed in ASIS mode, to preserve the source for analysis.
5135 2017-01-13 Justin Squirek <squirek@adacore.com>
5137 * nlists.ads: Correct minor typo.
5139 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5141 * sem_ch13.adb: Minor reformatting and typo fix.
5143 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5145 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
5146 Iterated_Component_Association is a named association in an
5148 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
5149 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
5150 and resolve the discrete choices and the expression of the
5152 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
5153 Loop_Actions and Box_Present are attributes of
5154 N_Iterated_Component_Association nodes. Box_Present is always
5156 * sprint.adb (Sprint_Node): An Iterated_Component_Association
5157 has a Discrete_Choices list, as specified in the RM. A
5158 Component_Association for aggregate uses instead a Choices list.
5159 We have to live with this small inconsistency because the new
5160 construct also has a defining identifier, and there is no way
5161 to merge the two node structures.
5163 2017-01-13 Yannick Moy <moy@adacore.com>
5165 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
5166 list of pragmas to remove. Remove pragmas from the list of
5167 statements in the body to inline.
5168 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
5170 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5172 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
5173 Analyze_Declarations, to analyze and resolve the expressions of
5174 aspect specifications in the current declarative list, so that
5175 the expressions have proper entity and type info. This is needed
5176 for ASIS when there is no subsequent expansion to generate this
5177 semantic information.
5178 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
5179 original expression, to suppress cascaded errors when expression
5180 has been constant-folded.
5181 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
5182 ASIS mode, because there is no subsequent expansion to decorate
5185 2017-01-13 Yannick Moy <moy@adacore.com>
5187 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
5188 New function to detect when a call may be inlined or not in
5190 (Expand_Inlined_Call): Ensure that a temporary
5191 is always created in the cases where a type conversion may be
5192 needed on an input parameter in GNATprove mode, so that GNATprove
5193 sees the check to perform.
5194 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
5195 when not applicable due to actual requiring type conversion
5196 with possible check but no temporary value can be copied for
5197 GNATprove to see the check.
5199 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5201 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
5202 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
5203 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
5204 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
5205 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
5206 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
5207 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
5208 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
5209 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
5210 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
5211 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
5212 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
5213 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
5214 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
5215 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
5216 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
5217 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
5218 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
5219 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
5220 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
5221 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
5222 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
5223 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
5224 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
5225 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
5226 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
5227 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
5228 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
5229 statements to reflect the new style for case alternatives. Various
5230 code clean up and reformatting.
5232 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5234 * exp_util.adb: Minor reformatting.
5236 2017-01-13 Yannick Moy <moy@adacore.com>
5238 * exp_spark.adb: Code cleanup.
5239 * sem_ch9.adb (Analyze_Delay_Until): Resolve
5240 expression so that calls are identified as such inside delay
5243 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5245 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
5246 * par-ch3.adb (P_Discrete_Choice_List): An
5247 Iterated_Component_Association is an array aggregate component.
5248 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
5249 (Is_Quantified_Expression): New function that performs a lookahead
5250 to distinguish quantified expressions from iterated component
5252 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
5254 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
5255 * sem.adb (Analyze): Handle Iterated_Component_Association.
5256 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
5257 component associations.
5258 * sinfo.ads, sinfo.adb: Entries for for
5259 N_Iterated_Component_Association and its fields.
5260 * sprint.adb (Sprint_Node_Actual): Handle
5261 N_Iterated_Component_Association.
5263 2017-01-13 Justin Squirek <squirek@adacore.com>
5265 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
5266 of the style check until after preanalysis of acutals.
5268 2017-01-13 Yannick Moy <moy@adacore.com>
5270 * sem_ch13.adb: Minor reformatting.
5271 * par-ch11.adb: minor style fix in whitespace
5272 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
5273 reduced to Add_Artificial_ALI_File; style fix in declaration of
5274 Text; grammar fix in comment.
5275 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
5276 * freeze.adb: Cleanup to pass pragma instead of
5278 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
5279 replace System'To_Address by equivalent call.
5281 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5283 * bindusg.adb: Improve usage output for -f switch.
5285 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5287 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
5290 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5292 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
5293 treat comparisons on strings as legal in a Static_Predicate.
5294 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
5295 a function call that is the expansion of a string comparison.The
5296 function call is built when compiling the corresponding predicate
5297 function, but the expression has been found legal as a static
5298 predicate during earlier analysis.
5299 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
5300 properly a function call that is the expansion of a string
5301 comparison operation, in order to recover the Static_Predicate
5302 expression and apply it to a static argument when needed.
5304 2017-01-13 Tristan Gingold <gingold@adacore.com>
5306 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
5307 (Open_Read): Re-implement using Open_Read_No_Exception.
5308 (Open_Write): Raise exception in case of error.
5309 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
5310 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
5312 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
5314 2017-01-13 Yannick Moy <moy@adacore.com>
5316 * checks.adb: Code cleanup.
5318 2017-01-13 Yannick Moy <moy@adacore.com>
5320 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
5321 expression instead of unanalyzed aspect expression for checking
5322 the validity of inheriting an operation. Also copy the expression
5323 being passing it to Build_Class_Wide_Expression, as this call
5324 modifies its argument.
5325 * sem_util.ads Fix comment to reference correct function name
5328 2017-01-13 Javier Miranda <miranda@adacore.com>
5330 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
5331 when we propagate information about the indexes back to the original
5332 indexing mode and the prefix of the index is a function call, do not
5333 remove any parameter from such call.
5335 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5337 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
5338 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
5339 a build-in-place function whose result type is tagged.
5341 2017-01-13 Yannick Moy <moy@adacore.com>
5343 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5344 Do not generate a wrapper when the only candidate is a class-wide
5346 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
5347 inside a generic context.
5349 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5351 * exp_util.adb (Add_Inherited_Tagged_DIC):
5352 Pass the object parameters of both the parent and the derived
5353 type DIC procedure to the reference replacement circuitry.
5354 (Find_DIC_Type): Modify the circuitry to present the partial
5355 view of a private type in case the private type defines its own
5357 (Replace_Object_And_Primitive_References): Add two
5358 optional formal parameters. Update the comment on usage. Update
5359 the replacement of references to object parameters.
5361 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5363 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
5365 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5367 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
5368 an out parameter that is a type conversion, independently of th
5369 range check that may apply to the expression of the conversion,
5370 for use in GNATProve.
5372 2017-01-13 Yannick Moy <moy@adacore.com>
5374 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
5375 GNATprove_Mode here to Frontend.
5376 * frontend.adb (Frontend): Move the implicit with for System
5377 in GNATprove_Mode here as it ismore correct this way; the old
5378 place only worked by chance, since there were no overloaded names.
5379 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
5380 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
5381 four attributes identified in SRM 9(18), add an implicit with
5382 to Ada.Task_Identification.
5383 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5384 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
5386 * checks.adb (Apply_Discriminant_Check,
5387 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
5388 In GNATprove mode, we do not apply the checks, but we still
5389 analyze the expression to possibly issue errors on SPARK
5390 code when a run-time error can be detected at compile time.
5391 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
5394 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5396 * expander.adb (Expand): Add a warning about using return
5397 statements in Ghost management code.
5398 * exp_ch3.adb (Freeze_Type): Add a warning about using return
5399 statements in Ghost management code.
5400 * exp_ch7.adb (Build_Invariant_Procedure_Body,
5401 Build_Invariant_Procedure_Declaration): Add a warning about
5402 using return statements in Ghost management code.
5403 * exp_disp.adb (Make_DT): Add a warning about using return
5404 statements in Ghost management code.
5405 * exp_util.adb (Build_DIC_Procedure_Body,
5406 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
5407 warning about using return statements in Ghost management code.
5408 * freeze.adb (Freeze_Entity): Add a warning about using return
5409 statements in Ghost management code.
5410 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
5411 statements in Ghost management code.
5412 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
5413 a warning about using return statements in Ghost management code.
5414 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
5415 return statements in Ghost management code.
5416 * sem_ch6.adb (Analyze_Procedure_Call,
5417 Analyze_Subprogram_Body_Helper): Add a warning about using return
5418 statements in Ghost management code.
5419 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
5420 using return statements in Ghost management code.
5421 * sem_ch12.adb (Analyze_Package_Instantiation,
5422 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
5423 Instantiate_Subprogram_Body): Add a warning about using return
5424 statements in Ghost management code.
5425 * sem_ch13.adb (Build_Predicate_Functions,
5426 Build_Predicate_Function_Declarations): Add a warning about
5427 using return statements in Ghost management code.
5428 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
5429 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
5430 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
5431 using return statements in Ghost management code.
5433 2017-01-13 Tristan Gingold <gingold@adacore.com>
5435 * s-mmosin-mingw.adb: Fix pragma import.
5437 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5439 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
5442 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5444 * atree.adb (Allocate_Initialize_Node): A newly created node is
5445 no longer marked as Ghost at this level.
5446 (Mark_New_Ghost_Node): New routine.
5447 (New_Copy): Mark the copy as Ghost.
5448 (New_Entity): Mark the entity as Ghost.
5449 (New_Node): Mark the node as Ghost.
5450 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
5451 apply to unanalyzed entities.
5452 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
5454 (Set_Is_Checked_Ghost_Entity): This attribute now
5455 applies to all entities as well as unanalyzed entities.
5456 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
5457 all entities as well as unanalyzed entities.
5458 * expander.adb Add with and use clauses for Ghost.
5459 (Expand): Install and revert the Ghost region associated with the node
5461 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
5462 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
5463 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
5464 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
5465 (Freeze_Type): Install and revert the Ghost region associated
5466 with the type being frozen.
5467 * exp_ch5.adb Remove with and use clauses for Ghost.
5468 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
5469 * exp_ch6.adb Remove with and use clauses for Ghost.
5470 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
5471 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
5472 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
5473 Ghost region of the working type.
5474 (Build_Invariant_Procedure_Declaration): Install and revert
5475 the Ghost region of the working type.
5476 (Expand_N_Package_Body): Remove all Ghost-related code.
5477 * exp_ch8.adb Remove with and use clauses for Ghost.
5478 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
5480 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
5481 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
5482 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
5484 * exp_ch13.adb Remove with and use clauses for Ghost.
5485 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
5486 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
5487 the tagged type. Move the generation of various entities within
5488 the Ghost region of the type.
5489 * exp_prag.adb Remove with and use clauses for Ghost.
5490 (Expand_Pragma_Check): Remove all Ghost-related code.
5491 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
5492 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
5493 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
5494 * exp_util.adb (Build_DIC_Procedure_Body): Install
5495 and revert the Ghost region of the working types.
5496 (Build_DIC_Procedure_Declaration): Install and revert the
5497 Ghost region of the working type.
5498 (Make_Invariant_Call): Install and revert the Ghost region of the
5500 (Make_Predicate_Call): Reimplemented. Install and revert the
5501 Ghost region of the associated type.
5502 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
5503 of the entity being frozen.
5504 (New_Freeze_Node): Removed.
5505 * ghost.adb Remove with and use clauses for Opt.
5506 (Check_Ghost_Completion): Update the parameter profile
5507 and all references to formal parameters.
5508 (Ghost_Entity): Update the comment on usage.
5509 (Install_Ghost_Mode): New routines.
5510 (Is_Ghost_Assignment): New routine.
5511 (Is_Ghost_Declaration): New routine.
5512 (Is_Ghost_Pragma): New routine.
5513 (Is_Ghost_Procedure_Call): New routine.
5514 (Is_Ghost_Renaming): Removed.
5515 (Is_OK_Declaration): Reimplemented.
5516 (Is_OK_Pragma): Reimplemented.
5517 (Is_OK_Statement): Reimplemented.
5518 (Is_Subject_To_Ghost): Update the comment on usage.
5519 (Mark_And_Set_Ghost_Assignment): New routine.
5520 (Mark_And_Set_Ghost_Body): New routine.
5521 (Mark_And_Set_Ghost_Completion): New routine.
5522 (Mark_And_Set_Ghost_Declaration): New routine.
5523 (Mark_And_Set_Ghost_Instantiation): New routine.
5524 (Mark_And_Set_Ghost_Procedure_Call): New routine.
5525 (Mark_Full_View_As_Ghost): Removed.
5526 (Mark_Ghost_Declaration_Or_Body): New routine.
5527 (Mark_Ghost_Pragma): New routine.
5528 (Mark_Ghost_Renaming): New routine.
5529 (Mark_Pragma_As_Ghost): Removed.
5530 (Mark_Renaming_As_Ghost): Removed.
5531 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
5532 (Prune_Node): Freeze nodes no longer need special pruning, they
5533 are processed by the general ignored Ghost code mechanism.
5534 (Restore_Ghost_Mode): New routine.
5535 (Set_Ghost_Mode): Reimplemented.
5536 (Set_Ghost_Mode_From_Entity): Removed.
5537 * ghost.ads Add with and use clauses for Ghost.
5538 (Check_Ghost_Completion): Update the parameter profile
5539 along with the comment on usage.
5540 (Install_Ghost_Mode): New routine.
5541 (Is_Ghost_Assignment): New routine.
5542 (Is_Ghost_Declaration): New routine.
5543 (Is_Ghost_Pragma): New routine.
5544 (Is_Ghost_Procedure_Call): New routine.
5545 (Mark_And_Set_Ghost_Assignment): New routine.
5546 (Mark_And_Set_Ghost_Body): New routine.
5547 (Mark_And_Set_Ghost_Completion): New routine.
5548 (Mark_And_Set_Ghost_Declaration): New routine.
5549 (Mark_And_Set_Ghost_Instantiation): New routine.
5550 (Mark_And_Set_Ghost_Procedure_Call): New routine.
5551 (Mark_Full_View_As_Ghost): Removed.
5552 (Mark_Ghost_Pragma): New routine.
5553 (Mark_Ghost_Renaming): New routine.
5554 (Mark_Pragma_As_Ghost): Removed.
5555 (Mark_Renaming_As_Ghost): Removed.
5556 (Restore_Ghost_Mode): New routine.
5557 (Set_Ghost_Mode): Redefined.
5558 (Set_Ghost_Mode_From_Entity): Removed.
5559 * sem.adb (Analyze): Install and revert the Ghost region of the
5560 node being analyzed.
5561 (Do_Analyze): Change the way a clean Ghost
5562 region is installed and reverted.
5563 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
5564 all Ghost-related code.
5565 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
5566 (Analyze_Number_Declaration): Remove all Ghost-related code.
5567 (Analyze_Object_Declaration): Install and revert the Ghost region of
5568 a deferred object declaration's completion.
5569 (Array_Type_Declaration): Remove all Ghost-related code.
5570 (Build_Derived_Type): Update the comment on
5571 the propagation of Ghost attributes from a parent to a derived type.
5572 (Derive_Subprogram): Remove all Ghost-related code.
5573 (Make_Class_Wide_Type): Remove all Ghost-related code.
5574 (Make_Implicit_Base): Remove all Ghost-related code.
5575 (Process_Full_View): Install and revert the Ghost region of
5576 the partial view. There is no longer need to check the Ghost
5578 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
5579 region of the left hand side.
5580 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
5581 all Ghost-related code.
5582 (Analyze_Expression_Function): Remove all Ghost-related code.
5583 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
5584 (Analyze_Procedure_Call): Install and revert the Ghost region of
5585 the procedure being called.
5586 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
5587 region of the spec or body.
5588 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
5589 (Build_Subprogram_Declaration): Remove all Ghost-related code.
5590 (Find_Corresponding_Spec): Remove all Ghost-related code.
5591 (Process_Formals): Remove all Ghost-related code.
5592 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
5593 the Ghost region of the spec.
5594 (Analyze_Package_Declaration): Remove all Ghost-related code.
5595 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
5596 Ghost when it aliases a Ghost entity.
5597 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
5599 (Analyze_Object_Renaming): Mark a renaming as Ghost when
5600 it aliases a Ghost entity.
5601 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
5603 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
5604 aliases a Ghost entity.
5605 * sem_ch11.adb Remove with and use clauses for Ghost.
5606 (Analyze_Exception_Declaration): Remove all Ghost-related code.
5607 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
5609 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
5611 (Analyze_Package_Instantiation): Install and revert the Ghost region
5612 of the package instantiation.
5613 (Analyze_Subprogram_Instantiation): Install
5614 and revert the Ghost region of the subprogram instantiation.
5615 (Instantiate_Package_Body): Code clean up. Install and revert the
5616 Ghost region of the package body.
5617 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
5618 Ghost region of the subprogram body.
5619 * sem_ch13.adb (Build_Predicate_Functions): Install
5620 and revert the Ghost region of the related type.
5621 (Build_Predicate_Function_Declaration): Code clean up. Install
5622 and rever the Ghost region of the related type.
5623 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
5624 Install and revert the Ghost region of the pragma.
5625 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
5626 Ghost region of the pragma.
5627 (Analyze_Pragma): Install and revert the Ghost region of various
5628 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
5629 or encloses a Ghost entity.
5630 (Analyze_Pre_Post_Condition): Install and revert the Ghost
5631 region of the pragma.
5632 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
5633 Ghost region of the pragma.
5634 * sem_res.adb (Resolve): Remove all Ghost-related code.
5635 * sem_util.adb (Is_Declaration): Reimplemented.
5636 (Is_Declaration_Other_Than_Renaming): New routine.
5637 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
5638 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
5639 (Is_Ghost_Pragma): Removed.
5640 (Is_Ignored_Ghost_Pragma): New routine.
5641 (Set_Is_Checked_Ghost_Pragma): New routine.
5642 (Set_Is_Ghost_Pragma): Removed.
5643 (Set_Is_Ignored_Ghost_Pragma): New routine.
5644 * sinfo.ads: Update the documentation on Ghost mode and
5645 Ghost regions. New attributes Is_Checked_Ghost_Pragma
5646 and Is_Ignored_Ghost_Pragma along with usages in nodes.
5647 Remove attribute Is_Ghost_Pragma along with usages in nodes.
5648 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5649 (Is_Ghost_Pragma): Removed along with pragma Inline.
5650 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5651 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5652 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
5653 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5655 2017-01-12 Tristan Gingold <gingold@adacore.com>
5657 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
5658 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
5660 2017-01-12 Yannick Moy <moy@adacore.com>
5662 * errout.adb, errout.ads (Initialize): Factor common treatment
5664 (Reset_Warnings): New procedure to reset counts related to warnings.
5665 (Record_Compilation_Errors): New variable to store the presence of an
5666 error, used in gnat2why to allow changing the Warning_Mode.
5667 (Compilation_Errors): Use new variable Record_Compilation_Errors to
5668 store the presence of an error.
5670 2017-01-12 Javier Miranda <miranda@adacore.com>
5672 * sem_ch13.adb (Analyze_Aspect_Specifications):
5673 For Interrupt_Handler and Attach_ Handler aspects, decorate the
5674 internally built reference to the protected procedure as coming
5675 from sources and force its analysis.
5677 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5679 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
5680 inherit predicates if any from the first_subtype of the parent,
5681 not from the anonymous parent type.
5682 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
5683 predicate is not a static subtype.
5685 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5687 * freeze.adb (Check_Suspicious_Convention): New procedure
5688 performing a warning check on discriminated record types with
5689 convention C or C++. Factored out of procedure Freeze_Record_Type,
5690 and changed to only apply to base types (to avoid spurious
5691 warnings on subtypes). Minor improvement of warning messages
5692 to refer to discriminated rather than variant record types.
5693 (Freeze_Record_Type): Remove code for performing a suspicious
5695 (Freeze_Entity): Only call Freeze_Record_Type
5696 on types that aren't declared within any enclosing generic units
5697 (rather than just excluding the type when the innermost scope
5698 is generic). Call Check_Suspicious_Convention whether or not
5699 the type is declared within a generic unit.
5700 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
5701 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
5704 2017-01-12 Tristan Gingold <gingold@adacore.com>
5706 * sysdep.c, adaint.c, rtinit.c, ming32.h:
5707 (__gnat_current_codepage): Renamed from CurrentCodePage
5708 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
5710 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5712 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
5713 quantified expressions, following AI12-050: the loop parameters
5714 of two quantified expressions are conformant if they have the
5717 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5719 * gcc-interface/Makefile.in: Clean up VxWorks targets.
5721 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5723 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
5724 Hnadle properly the attribute reference when it appears as part
5725 of an expression in another loop aspect.
5727 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5729 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
5730 subsidiary of Build_Initialization_Call, to complete generation
5731 of predicate checks on discriminants whose (sub)types have
5732 predicates, and to add checks on variants that do not have an
5734 * sem_util.adb (Gather_Components): A missing Others alternative is
5735 not an error when the type of the discriminant is a static predicate
5736 (and coverage has been checked when analyzing the case statement). A
5737 runtime check is generated to verify that a given discriminant
5738 satisfies the predicate (RM 3.8.1. (21.1/2)).
5740 2017-01-12 Yannick Moy <moy@adacore.com>
5742 * gnat1drv.adb (Adjust_Global_Switches): Only
5743 perform checking of exception mechanism when generating code.
5745 2017-01-12 Justin Squirek <squirek@adacore.com>
5747 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
5748 Remove handling of access component with invariant.
5749 (Build_Invariant_Procedure_Declaration): Remove return on class
5751 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
5752 conditional exception for component or array so Has_Own_Invariants
5753 flag is not falsly set.
5754 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
5755 wide type to have no invariant flags.
5757 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5759 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
5760 sem_ch13.adb: Minor reformatting.
5762 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5764 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
5765 adjustment primitive when the ancestor type was not properly frozen.
5766 (Gen_Assign): Guard against a missing initialization
5767 primitive when the component type was not properly frozen.
5768 (Initialize_Array_Component): Guard against a missing adjustment
5769 primitive when the component type was not properly frozen.
5770 (Initialize_Record_Component): Guard against a missing adjustment
5771 primitive when the component type was not properly frozen.
5772 (Process_Transient_Component_Completion): The transient object may
5773 not be finalized when its associated type was not properly frozen.
5774 * exp_ch3.adb (Build_Assignment): Guard against a missing
5775 adjustment primitive when the component type was not properly frozen.
5776 (Build_Initialization_Call): Guard against a missing
5777 initialization primitive when the associated type was not properly
5779 (Expand_N_Object_Declaration): Guard against a missing
5780 adjustment primitive when the base type was not properly frozen.
5781 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
5782 body when there is no adjustment primitive available. Create an
5783 empty Deep_Finalize body when there is no finalization primitive
5785 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
5786 missing finalization primitive when the designated type was
5787 not properly frozen.
5788 (Expand_N_Allocator): Guard against a missing initialization primitive
5789 when the designated type was not properly frozen.
5790 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
5791 only when the corresponding adjustment primitive is available.
5792 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
5793 adjustment/finalization statements only when there is an available
5794 primitive to carry out the action.
5795 (Build_Initialize_Statements): Generate the initialization/finalization
5796 statements only when there is an available primitive to carry out the
5798 (Make_Adjust_Call): Do not generate a call when the underlying
5799 type is not present due to a possible missing full view.
5800 (Make_Final_Call): Do not generate a call when the underlying
5801 type is not present due to a possible missing full view.
5802 (Make_Finalize_Address_Stmts): Generate an empty body when the
5803 designated type lacks a finalization primitive.
5804 (Make_Init_Call): Do not generate a call when the underlying type is
5805 not present due to a possible missing full view.
5806 (Process_Component_For_Adjust): Add the adjustment call only when the
5807 corresponding adjustment primitive is available.
5808 (Process_Component_For_Finalize): Add the finalization call only when
5809 the corresponding finalization primitive is available.
5810 (Process_Object_Declaration): Use a null statement to emulate a
5811 missing call to the finalization primitive of the object type.
5812 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
5813 (Make_Final_Call): Update the comment on usage.
5814 (Make_Init_Call): Update the comment on usage.
5815 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
5817 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5819 * einfo.ads: Update documentation of Address_Taken.
5820 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
5821 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
5822 for subprograms when setting Address_Taken flag.
5824 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
5826 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
5827 Configurable_Run_Time_Mode off when analysing with'ed predefined
5830 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5832 * sem_prag.adb: Minor reformatting.
5833 * sem_util.adb (Unique_Entity): fix result for
5834 bodies of entry families.
5836 2017-01-12 Justin Squirek <squirek@adacore.com>
5838 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
5839 Resolve_Suppressible in the pragma Assertion_Policy case.
5840 (Resolve_Suppressible): Created this function to factor out
5841 common code used to resolve Suppress to either Ignore or Check
5842 * snames.ads-tmpl: Add name for Suppressible.
5844 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5846 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
5848 * debug.adb: Minor comment fixes.
5850 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5852 * sem_util.adb (Unique_Entity): For concurrent
5853 bodies that are defined with stubs and complete a declaration
5854 of a single concurrent object return the entity of an implicit
5855 concurrent type, not the entity of the anonymous concurrent
5857 * debug.adb: -gnatd.J is no longer used.
5858 * make.adb (Globalize): Removed, no longer used.
5859 * sem_ch9.adb: minor typo in comment for entry index
5861 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
5863 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
5864 * exp_ch3.adb (Build_Init_Statements): As part of initialising
5865 the value record of a task, set its _Secondary_Stack_Size field
5867 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
5868 a _Secondary_Stack_Size field in the value record of
5869 the task if a Secondary_Stack_Size rep item is present.
5870 (Make_Task_Create_Call): Include secondary stack size
5871 parameter. If No_Secondary_Stack restriction is in place, passes
5873 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
5874 Secondary_Stack_Size.
5875 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
5876 function to define the overhead of the secondary stack.
5877 * s-tarest.adb (Create_Restricted_Task,
5878 Create_Restricted_Task_Sequential): Functions now include
5879 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
5880 * s-tarest.adb (Create_Restricted_Task,
5881 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
5882 include Secondary_Stack_Size parameter.
5883 (Task_Wrapper): Secondary stack now allocated to the size specified by
5884 the Secondary_Stack_Size parameter in the task's ATCB.
5885 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
5886 Secondary_Stack_Size component.
5887 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
5888 Create_Restricted_Task_Sequential): Function now include
5889 Secondary_Stack_Size parameter.
5890 (Task_Wrapper): Secondary stack now allocated to the size
5891 specified by the Secondary_Stack_Size parameter in the task's
5893 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
5894 to include Secondary_Stack_Size parameter.
5895 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
5896 Secondary_Stack_Size aspect, turning the aspect into its corresponding
5898 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
5899 * snames.adb-tmpl, snames.ads-tmpl: Added names
5900 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
5901 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
5903 2017-01-12 Yannick Moy <moy@adacore.com>
5905 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
5908 2017-01-12 Justin Squirek <squirek@adacore.com>
5910 * exp_attr.adb (Expand_N_Attribute_Reference):
5911 Fix Finalization_Size case by properly resolving the type after
5912 rewritting the node.
5914 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5916 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
5918 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
5919 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
5920 exp_sel.ads: Minor reformatting.
5922 2017-01-12 Justin Squirek <squirek@adacore.com>
5924 * exp_ch6.adb (Expand_Call): Add guard to prevent
5925 invariant checks from being created for internally generated
5928 2017-01-12 Bob Duff <duff@adacore.com>
5930 * lib-writ.ads: Remove incorrect comment.
5932 2017-01-12 Javier Miranda <miranda@adacore.com>
5934 * debug.adb (-gnatd.K): Enable generation of contract-only
5935 procedures in CodePeer mode.
5936 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
5938 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
5940 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
5942 (Get_Contract_Only_Missing_Body_Name): New subprogram.
5943 (Get_Contract_Only_Body): New subprogram.
5944 (Set_Contract_Only_Body): New subprogram.
5945 (Is_Contract_Only_Body): New subprogram.
5946 (Set_Is_Contract_Only_Body): New subprogram.
5947 (SCIL_Nodes): Replace table by hash-table.
5949 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5951 * exp_ch6.adb: Minor reformatting.
5952 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
5954 2017-01-12 Bob Duff <duff@adacore.com>
5956 * binde.adb (Forced): New reason for a dependence.
5957 (Force_Elab_Order): Implementation of the new switch.
5958 * binde.ads: Minor comment fixes.
5959 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
5960 long ago that is no longer supported; removed comment about that.
5961 * opt.ads (Force_Elab_Order_File): Name of file specified for
5963 * switch-b.adb: Parse -f switch.
5965 2017-01-12 Justin Squirek <squirek@adacore.com>
5967 * exp_ch6.adb (Check_View_Conversion): Created this function
5968 to properly chain calls to check type invariants that may be
5969 present in a subprogram call after the subprogram.
5970 (Expand_Call): Add a conditional to identify when a view conversion
5971 needs to be checked.
5972 * nlists.adb, nlists.ads (Prepend_New): New routine.
5973 (Prepend_New_To): New routine.
5975 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5977 * sinfo.ads: Minor reformatting.
5979 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5981 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
5984 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5986 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
5987 variable Definite. Create a local object and pass its 'Access to the
5988 BIP function when the result type is either definite or it does not
5989 require any finalization or secondary stack management.
5991 2017-01-12 Bob Duff <duff@adacore.com>
5993 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
5994 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
5995 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
5996 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
5997 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
5998 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
5999 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6000 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
6001 Change name to Pragma_Name_Unmapped.
6002 (Pragma_Name_Mapped): Change name to Pragma_Name.
6003 This is because the "mapped" version should be the usual case.
6005 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
6007 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
6008 Is_Default_Init_Cond_Procedure, and
6009 Has_Inherited_Default_Init_Cond. Add uses of flags
6010 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
6011 (Default_Init_Cond_Procedure): Removed.
6012 (DIC_Procedure): New routine.
6013 (Has_Default_Init_Cond): Removed.
6014 (Has_DIC): New routine.
6015 (Has_Inheritable_Invariants): The attribute applies to the base type.
6016 (Has_Inherited_Default_Init_Cond): Removed.
6017 (Has_Inherited_DIC): New routine.
6018 (Has_Inherited_Invariants): The attribute applies to the base type.
6019 (Has_Own_DIC): New routine.
6020 (Has_Own_Invariants): The attribute applies to the base type.
6021 (Is_Default_Init_Cond_Procedure): Removed.
6022 (Is_DIC_Procedure): New routine.
6023 (Set_Default_Init_Cond_Procedure): Removed.
6024 (Set_DIC_Procedure): New routine.
6025 (Set_Has_Default_Init_Cond): Removed.
6026 (Set_Has_Inheritable_Invariants): The attribute applies
6028 (Set_Has_Inherited_Default_Init_Cond): Removed.
6029 (Set_Has_Inherited_DIC): New routine.
6030 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
6031 (Set_Has_Own_DIC): New routine.
6032 (Set_Has_Own_Invariants): The attribute applies to the base type.
6033 (Set_Is_Default_Init_Cond_Procedure): Removed.
6034 (Set_Is_DIC_Procedure): New routine.
6035 (Write_Entity_Flags): Update the output of all flags related to
6036 default initial condition.
6037 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
6038 of the call to the DIC procedure.
6039 (Freeze_Type): Generate the body of the DIC procedure.
6040 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
6041 all occurrences of Create_Append with Append_New_To. Do
6042 not generate an invariant procedure for a class-wide type.
6043 The generated body acts as a freeze action of the working type.
6044 (Build_Invariant_Procedure_Declaration): Do not generate an
6045 invariant procedure for a class-wide type.
6046 (Create_Append): Removed.
6047 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
6048 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
6049 class-wide pre/postcondition description and data structures from
6051 (Build_Class_Wide_Expression): Moved from Sem_Prag.
6052 (Build_DIC_Call): New routine.
6053 (Build_DIC_Procedure_Body): New routine.
6054 (Build_DIC_Procedure_Declaration): New routine.
6055 (Entity_Hash): Moved from Sem_Prag.
6056 (Find_DIC_Type): New routine.
6057 (Update_Primitives_Mapping): Reimplemented.
6058 (Update_Primitives_Mapping_Of_Types): New routine.
6059 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
6060 (Build_DIC_Call): New routine.
6061 (Build_DIC_Procedure_Body): New routine.
6062 (Build_DIC_Procedure_Declaration): New routine.
6063 (Update_Primitives_Mapping): Moved from Sem_Prag.
6064 (Update_Primitives_Mapping_Of_Types): New routine.
6065 * nlists.adb (Append_New): New routine.
6066 (Append_New_To): New routine.
6067 * nlists.ads (Append_New): New routine.
6068 (Append_New_To): New routine.
6069 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
6070 of DIC procedures here. This is now done at the end of the
6071 visible declarations, private declarations, and at the freeze
6073 (Analyze_Private_Extension_Declaration):
6074 A private extension inherits the DIC pragma of a parent type.
6075 (Analyze_Subtype_Declaration): No need to propagate invariant
6076 attributes to a subtype as those apply to the base type.
6077 (Build_Derived_Record_Type): No need to inherit invariants here
6078 as this is now done in Build_Derived_Type.
6079 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
6081 (Process_Full_View): Update the propagation of DIC attributes.
6082 (Propagate_Default_Init_Cond_Attributes): Removed.
6083 * sem_ch7.adb Add with and use clauses for Exp_Util.
6084 (Analyze_Package_Specification): Create the body of the DIC
6085 procedure at the end of the visible and private declarations.
6086 (Preserve_Full_Attributes): Propagate DIC attributes.
6087 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
6089 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
6090 * sem_elab.adb (Check_A_Call): Update the call to
6091 Is_Nontrivial_Default_Init_Cond_Procedure.
6092 * sem_prag.adb Remove the with and use clauses for
6093 GNAT.HTable. Move the handling of class- wide pre/postcondition
6094 description and data structures to Exp_Util.
6095 (Analyze_Pragma): Create the declaration of the DIC procedure. There
6096 is no need to propagate invariant-related attributes at this point
6097 as this is done in Build_Invariant_Procedure_Declaration.
6098 (Build_Class_Wide_Expression): Moved to Exp_Util.
6099 (Entity_Hash): Moved to Exp_Util.
6100 (Update_Primitives_Mapping): Moved to Exp_Util.
6101 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
6102 (Update_Primitives_Mapping): Moved to Exp_Util.
6103 * sem_util.adb: Remove with and use clauses for Ghost
6105 (Build_Default_Init_Cond_Call): Removed.
6106 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6107 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6108 (Get_Views): Reimplemented.
6109 (Has_Full_Default_Initialization): Reimplement the section on DIC.
6110 (Inherit_Default_Init_Cond_Procedure): Removed.
6111 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6112 (Is_Nontrivial_DIC_Procedure): New routine.
6113 (Is_Verifiable_DIC_Pragma): New routine.
6114 (Propagate_DIC_Attributes): New routine.
6115 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
6116 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6117 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6118 (Inherit_Default_Init_Cond_Procedure): Removed.
6119 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6120 (Is_Nontrivial_DIC_Procedure): New routine.
6121 (Is_Verifiable_DIC_Pragma): New routine.
6122 (Propagate_DIC_Attributes): New routine.
6123 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
6125 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
6127 (Expression_Copy): New routine along with pragma Inline.
6128 (Set_Expression_Copy): New routine along with pragma Inline.
6130 2017-01-06 Bob Duff <duff@adacore.com>
6132 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
6133 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
6134 we won't generate the call to s_stalib_adafinal when the main
6135 is not written in Ada.
6137 2017-01-06 Bob Duff <duff@adacore.com>
6139 * sem_prag.adb: Minor: remove pragma Warnings.
6141 2017-01-06 Tristan Gingold <gingold@adacore.com>
6143 * Makefile.rtl: Do not compile s-stchop by default.
6145 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
6147 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
6148 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
6149 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
6150 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
6151 Reverted previous change for now.
6153 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6155 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
6156 check to default discriminant value if checks are enabled.
6157 (Build_Assignment): If type of component has static predicate,
6158 apply check to its default value, if any.
6160 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
6162 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
6163 * exp_ch3.adb (Build_Init_Statements): As part of initialising
6164 the value record of a task, set its _Secondary_Stack_Size field
6166 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
6167 a _Secondary_Stack_Size field in the value record of
6168 the task if a Secondary_Stack_Size rep item is present.
6169 (Make_Task_Create_Call): Include secondary stack size
6170 parameter. If No_Secondary_Stack restriction is in place, passes
6172 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
6173 Secondary_Stack_Size.
6174 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
6175 function to define the overhead of the secondary stack.
6176 * s-tarest.adb (Create_Restricted_Task,
6177 Create_Restricted_Task_Sequential): Functions now include
6178 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
6179 * s-tarest.adb (Create_Restricted_Task,
6180 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
6181 now include Secondary_Stack_Size parameter.
6183 Secondary stack now allocated to the size specified by the
6184 Secondary_Stack_Size parameter in the task's ATCB.
6185 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
6186 Secondary_Stack_Size component.
6187 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6188 Create_Restricted_Task_Sequential): Function now include
6189 Secondary_Stack_Size parameter.
6190 (Task_Wrapper): Secondary stack
6191 now allocated to the size specified by the Secondary_Stack_Size
6192 parameter in the task's ATCB.
6193 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
6194 for Secondary_Stack_Size aspect, turning the aspect into its
6195 corresponding internal attribute.
6196 (Analyze_Attribute_Definition):
6197 Process Secondary_Stack_Size attribute.
6198 * snames.adb-tmpl, snames.ads-tmpl: Added names
6199 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6200 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6202 2017-01-06 Pascal Obry <obry@adacore.com>
6204 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
6205 Sequential_IO and Direct_IO.
6207 2017-01-06 Bob Duff <duff@adacore.com>
6209 * snames.ads-tmpl (Renamed): New name for the pragma argument.
6210 * par-ch2.adb: Allow the new pragma (with analysis deferred
6212 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
6213 Keep a mapping from new pragma names to old names.
6214 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
6215 implement it by calling Map_Pragma_Name.
6216 * checks.adb, contracts.adb, einfo.adb, errout.adb,
6217 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
6218 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
6219 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
6220 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
6221 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6222 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
6225 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6227 * exp_ch9.adb: Minor reformatting.
6229 2017-01-06 Tristan Gingold <gingold@adacore.com>
6231 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
6232 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
6233 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
6235 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
6236 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
6237 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
6238 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
6240 2017-01-06 Bob Duff <duff@adacore.com>
6242 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
6243 dummy implementation of Map_Pragma_Name.
6245 2017-01-06 Tristan Gingold <gingold@adacore.com>
6247 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
6248 entry_body variable constant.
6249 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
6250 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
6252 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
6253 now access to constant.
6255 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6257 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
6258 reformatting and typo fixes.
6260 2017-01-06 Bob Duff <duff@adacore.com>
6262 * snames.ads-tmpl: New names for pragma renaming.
6263 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
6264 * par-prag.adb: Add new pragma name to case statement.
6265 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
6267 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
6268 Dummy implementation of Pragma_Name_Mapped.
6270 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6272 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
6273 better detect call within an entry_wrapper.
6274 * sem_res.adb (Resolve_Call): A protected call within an
6275 entity_wrapper is analyzed in the context of the protected
6276 object but corresponds to a pre-analysis and is not an access
6278 * sem_attr.adb: Minor reformatting.
6280 2017-01-06 Justin Squirek <squirek@adacore.com>
6282 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
6283 Finalization_Size to allow a prefix of any non-class-wide type.
6284 * sem_attr.ads Modify comment for Finalization_Size to include
6285 definite type use case.
6287 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6289 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
6290 on procedures that are wrappers created for entries that have
6292 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
6293 body is an entry_wrapper, compile it in the context of the
6294 synchronized type, because a precondition may refer to funtions
6296 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
6298 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
6299 within an Entry_Wrapper this is an external call whose target
6300 is the synchronized object that is the actual in the call to
6303 2017-01-06 Yannick Moy <moy@adacore.com>
6305 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
6306 in tree, which means not analyzing the previous prefix if the node has
6307 been rewritten into its prefix.
6309 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6311 * s-tpobop.adb: Minor reformatting.
6313 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6315 * checks.adb (Ensure_Valid): Do not generate a validity check
6316 within a generated predicate function, validity checks will have
6317 been applied earlier when required.
6319 2017-01-06 Tristan Gingold <gingold@adacore.com>
6321 * s-tpoben.ads (Protection_Entries): Add comment and reorder
6322 components for performances.
6323 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
6326 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6328 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
6329 If expression is compile-time known and obeys a static predicate
6330 it must be labelled as static, to prevent spurious warnings and
6331 run-time errors, e.g. in case statements. This is relevant when
6332 the expression is the result of constant-folding a type conversion
6333 whose expression is a variable with a known static value.
6335 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6337 * exp_attr.adb, sem_attr.ads: Minor reformatting.
6339 2017-01-06 Justin Squirek <squirek@adacore.com>
6341 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
6342 expansion of Finalization_Size attribute.
6343 * sem_attr.adb (Analyze_Attribute): Add entry to check the
6344 semantics of Finalization_Size.
6345 (Eval_Attribute): Add null entry for Finalization_Size.
6346 * sem_attr.ads: Add Finalization_Size to the implementation
6347 dependent attribute list.
6348 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
6350 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6352 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
6353 iterator specification with a serious syntactic error, transform
6354 construct into an infinite loop in order to continue analysis
6355 and prevent a compiler abort.
6357 2017-01-06 Tristan Gingold <gingold@adacore.com>
6359 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
6360 max_queue_lengths_array if unused.
6362 2017-01-06 Bob Duff <duff@adacore.com>
6364 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
6365 array access, in case "\" is at the end of Text.
6366 * stylesw.adb (Set_Style_Check_Options): Don't include input
6367 characters in the error message template, because they could
6368 be control characters such as "\", which Errout will try to
6371 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6373 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
6374 For a private type examine the visible declarations that follow
6375 the partial view, not just the private declarations that follow
6378 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6380 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
6383 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6385 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
6386 alias of the inherited op is the parent iterator, no need to
6387 examine dispatch table positions which might not be established
6388 yet if type is not frozen.
6389 * sem_disp.adb (Check_Controlling_Formals): The formal of a
6390 predicate function may be a subtype of a tagged type.
6391 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
6392 of representation items for the completion of a type extension
6393 where a predicate applies to the partial view.
6394 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
6395 parameter that designates function whose actual receives a
6396 predicate check, to improve warning message when the check will
6397 lead to infinite recursion.
6398 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
6399 Apply_Predicate_Check.
6401 2017-01-06 Tristan Gingold <gingold@adacore.com>
6403 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
6404 Gnat_Extended_Ravenscar.
6405 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
6407 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6409 * sem_util.ads: Minor typo fix and reformatting.
6411 2017-01-06 Yannick Moy <moy@adacore.com>
6413 * ghost.adb Minor fixing of references to SPARK RM.
6414 (Check_Ghost_Context): Check whether reference is to a lvalue
6415 before issuing an error about violation of SPARK RM 6.9(13)
6416 when declaration has Ghost policy Check and reference has Ghost
6418 * sem_util.adb Minor indentation.
6419 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
6420 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
6421 * sem_util.ads (Unique_Defining_Entity): Document the result
6422 for package body stubs.
6424 2017-01-06 Tristan Gingold <gingold@adacore.com>
6426 * raise-gcc.c (abort): Macro to call Abort_Propagation.
6427 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
6429 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6430 Do not generate the Entry_Max_Queue_Lengths_Array if all default
6432 * exp_util.adb (Corresponding_Runtime_Package): Consider
6433 Max_Queue_Length pragma.
6435 2017-01-06 Justin Squirek <squirek@adacore.com>
6437 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6438 Remove declaration generation in the case of
6439 System_Tasking_Protected_Objects_Single_Entry being used,
6440 and add a warning message when this is detected to occur.
6441 (Make_Initialize_Protection): Remove reference pass in the case
6442 of System_Tasking_Protected_Objects_Single_Entry.
6443 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
6444 * s-tposen.adb (Initialize_Protection_Entry): Remove
6445 Entry_Queue_Max parameter.
6446 * s-tposen.ads: Remove the types use to store the entry queue
6448 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
6450 2017-01-06 Yannick Moy <moy@adacore.com>
6452 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
6453 behavior of function, to also accept out of range positions
6454 and raise Constraint_Error in such case, and to copy sloc from
6455 literal if No_Location passed as location.
6456 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
6457 of functions to raise Constraint_Error in case of value not in
6460 2017-01-06 Tristan Gingold <gingold@adacore.com>
6462 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
6463 Invalidate_Stack_Cache.
6465 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
6467 * s-os_lib.adb: Minor fix to the signature of Readlink.
6469 2017-01-06 Javier Miranda <miranda@adacore.com>
6471 * sem_ch6.adb (Conforming_Types): Handle another
6472 confusion between views in a nested instance with an actual
6473 private type whose full view is not in scope.
6475 2017-01-06 Arnaud Charlet <charlet@adacore.com>
6477 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
6478 mark a rewritten if statement as explicit (Comes_From_Source).
6480 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6482 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
6484 2017-01-06 Tristan Gingold <gingold@adacore.com>
6486 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
6488 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6490 * sem_case.adb: Minor reformatting.
6492 2017-01-06 Thomas Quinot <quinot@adacore.com>
6494 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
6496 2017-01-06 Justin Squirek <squirek@adacore.com>
6498 * aspects.adb: Register aspect in Canonical_Aspect.
6499 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
6500 into respective tables.
6501 * einfo.ads, einfo.adb: Add a new attribute for
6502 handling the parameters for Pragma_Max_Entry_Queue
6503 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
6504 for accessing and setting were added as well.
6505 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
6506 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
6507 declaration for pramga arguments and store them in the protected
6509 (Make_Initialize_Protection): Pass a reference to
6510 the Entry_Max_Queue_Lengths_Array in the protected type node to
6512 * rtsfind.adb: Minor grammar fix.
6513 * rtsfind.ads: Register new types taken from the
6514 runtime libraries RE_Protected_Entry_Queue_Max and
6515 RE_Protected_Entry_Queue_Max_Array
6516 * s-tposen.adb, s-tpoben.adb
6517 (Initialize_Protection_Entry/Initialize_Protection_Entries):
6518 Add extra parameter and add assignment to local object.
6519 * s-tposen.ads, s-tpoben.ads: Add new types to
6520 store entry queue maximums and a field to the entry object record.
6521 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
6522 for Aspect_Max_Queue_Length.
6523 (Check_Aspect_At_Freeze_Point):
6524 Add aspect to list of aspects that don't require delayed analysis.
6525 * sem_prag.adb (Analyze_Pragma): Add case statement for
6526 Pragma_Max_Queue_Length, check semantics, and register arugments
6527 in the respective entry nodes.
6528 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
6529 and Has_Max_Queue_Length
6530 * snames.ads-tmpl: Add constant for the new aspect-name
6531 Name_Max_Queue_Length and corrasponding pragma.
6533 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6535 * exp_util.adb (Is_Controlled_Function_Call):
6536 Reimplemented. Consider any node which has an entity as the
6537 function call may appear in various ways.
6539 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6541 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
6542 an unchecked type conversion when performing a view conversion
6543 to/from a private type. In all other cases use a regular type
6544 conversion to ensure that any relevant checks are properly
6547 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6549 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
6551 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6553 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
6554 error on case expression that is an entity, when coverage is
6555 incomplete and entity has a static value obtained by local
6557 (Handle_Static_Predicate): New procedure, subsidiary of
6558 Check_Choices, to handle case alternatives that are either
6559 subtype names or subtype indications involving subtypes that
6560 have static predicates.
6562 2017-01-06 Thomas Quinot <quinot@adacore.com>
6564 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
6565 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
6567 2017-01-06 Bob Duff <duff@adacore.com>
6569 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
6570 Elaborate_All(P) to P itself. That could happen in obscure cases,
6571 and always introduced a cycle (P body must be elaborated before
6573 * lib-writ.ads: Comment clarification.
6574 * ali-util.ads: Minor comment fix.
6575 * ali.adb: Minor reformatting.
6577 2017-01-06 Tristan Gingold <gingold@adacore.com>
6579 * a-exexpr-gcc.adb: Improve comment.
6581 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
6583 * s-linux-mips.ads: Use correct signal and errno constants.
6584 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
6586 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
6588 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
6589 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
6592 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
6594 * gnatvsn.ads: Bump copyright year.
6596 2017-01-01 Jakub Jelinek <jakub@redhat.com>
6598 * gnat_ugn.texi: Bump @copying's copyright year.
6599 * gnat_rm.texi: Likewise.
6601 Copyright (C) 2017 Free Software Foundation, Inc.
6603 Copying and distribution of this file, with or without modification,
6604 are permitted in any medium without royalty provided the copyright
6605 notice and this notice are preserved.