1 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2 Alan Hayward <alan.hayward@arm.com>
3 David Sherwood <david.sherwood@arm.com>
5 * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
6 (fp_size_to_prec): Likewise.
8 2017-08-29 Martin Liska <mliska@suse.cz>
11 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
13 2017-08-08 Martin Liska <mliska@suse.cz>
15 * gcc-interface/trans.c: Include header files.
17 2017-07-29 Jakub Jelinek <jakub@redhat.com>
19 * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
20 as new argument to the imported_module_or_decl debug hook.
22 2017-07-25 Javier Miranda <miranda@adacore.com>
24 * checks.adb (Apply_Divide_Checks): Ensure that operands are not
27 2017-07-19 Jakub Jelinek <jakub@redhat.com>
29 * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
30 TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
31 (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
33 2017-07-18 Mike Frysinger <vapier@chromium.org>
35 * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
36 (../../gnatlink$(exeext)): Likewise.
38 2017-07-15 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
41 * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
42 (Backend_Overflow_Checks): Set to True.
44 2017-06-23 Jakub Jelinek <jakub@redhat.com>
46 * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
48 2017-06-21 Pierre-Marie de Rodat <derodat@adacore.com>
50 * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
52 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
54 (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
56 * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
57 imported subprograms for the current compilation unit as
58 definitions. Disable debug info for references to variables.
59 * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
60 * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
61 not built-in functions to their binding scope.
62 (create_subprog_decl): Add a DEFINITION parameter. If it is true, tag
63 the function as a definition. Update all callers.
64 (gnat_write_global_declarations): Emit debug info for imported
65 functions. Filter out external variables for which debug info
68 2017-06-15 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
71 * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
72 (i[3456]86-pc-gnu): Likewise.
73 (x86_64 kfreebsd): Likewise.
75 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
78 * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
80 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
83 * s-interr-hwint.adb: Reinstate.
84 * gcc-interface/Makefile.in (RTEMS): Use it again.
86 2017-06-08 Olivier Hainque <hainque@adacore.com>
88 * vx_crtbegin_auto.c: Update year in copyright notice.
89 * vx_crtbegin.c: Likewise.
90 * vx_crtbegin.inc: Likewise.
91 * vx_crtend.c: Likewise.
93 2017-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
95 * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
96 * s-tpopsp-rtems.adb: Delete.
98 2017-06-02 Olivier Hainque <hainque@adacore.com>
100 * vx_crtbegin_auto.c: New file.
101 * vx_crtbegin.c: New file.
102 * vx_crtbegin.inc: New file.
103 * vx_crtend.c: New file.
105 2017-05-25 Jonathan Wakely <jwakely@redhat.com>
107 * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
108 const qualifiers that cause -Wignored-qualifiers warnings.
110 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
112 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
113 for Itypes that are E_Access_Subtype.
114 <E_Access_Subtype>: Use the DECL of the base type directly.
116 2017-05-22 Ed Schonberg <schonberg@adacore.com>
117 Eric Botcazou <ebotcazou@adacore.com>
119 * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
120 limited view may appear in the profile of a function, and a call to
121 that function in another unit in which the full view is available must
122 use this full view to spurious type errors at the point of call.
123 * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
124 of parent body with a with clause for the main unit.
125 * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
126 (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
127 types declared in external units like types from limited with clauses.
128 Adjust final processing of defer_limited_with_list accordingly.
129 * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
130 again to translate the prefix after the field if it is incomplete.
132 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
134 * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
135 alignment for simple volatile fields and remove associated errors.
137 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
139 * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
140 * gcc-interface/trans.c (get_elaboration_procedure): Make static.
142 2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
144 * gcc-interface/utils.c (can_materialize_object_renaming_p):
145 Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
146 process Original_Node instead of expanded names.
148 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
150 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
151 addressability check in the constrained case.
153 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
155 * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
156 types not coming from a limited context.
158 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
160 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
161 the inlined list that are not public.
162 * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
163 there is a pragma Inline_Always on the subprogram.
165 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
167 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
168 <N_Allocator>: Use properly typed constants.
169 (extract_values): Move around.
170 (pos_to_constructor): Minor tweaks.
171 (Sloc_to_locus): Fix formatting.
172 * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
173 * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
174 (Gigi_Equivalent_Type): Adjust head comment.
175 * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
177 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
179 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
180 is a representation clause on an extension, propagate the alignment of
181 the parent type only if the platform requires strict alignment.
183 2017-05-12 Eric Botcazou <ebotcazou@adacore.com>
185 * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
186 instead of Word_Size.
189 2017-03-28 Andreas Schwab <schwab@suse.de>
192 * system-linux-aarch64-ilp32.ads: New file.
193 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
194 from LIBGNAT_TARGET_PAIRS.
195 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
196 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
197 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
198 or -mabi=ilp32, resp.
200 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
203 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
204 instead of Word_Size.
206 2017-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
208 * raise-gcc.c (exception_class_eq): Make ec parameter const.
210 2017-05-02 Richard Biener <rguenther@suse.de>
212 * gcc-interface/misc.c (gnat_post_options): Do not set
215 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
217 * gcc-interface/trans.c (assoc_to_constructor): Make sure
218 Corresponding_Discriminant is only called on discriminants.
219 Skip the saving of the result only for them.
220 (gnat_to_gnu) <N_Selected_Component>: Likewise.
221 <N_Unchecked_Type_Conversion>: Translate the result type first.
222 (gigi): Set TREE_NOTHROW on Begin_Handler.
223 (stmt_list_cannot_raise_p): New predicate.
224 (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
225 a cleanup if the statements of the handler cannot raise.
226 (process_freeze_entity): Use Is_Record_Type.
227 (process_type): Likewise.
229 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
231 * einfo.ads (Corresponding_Record_Component): New alias
232 for Node21 used for E_Component and E_Discriminant.
233 * einfo.adb (Corresponding_Record_Component): New function.
234 (Set_Corresponding_Record_Component): New procedure.
235 (Write_Field21_Name): Handle Corresponding_Record_Component.
236 * sem_ch3.adb (Inherit_Component): Set
237 Corresponding_Record_Component for every component in
238 the untagged case. Clear it afterwards for non-girder
240 * gcc-interface/decl.c (gnat_to_gnu_entity)
241 <E_Record_Type>: For a derived untagged type with discriminants
242 and constraints, apply the constraints to the layout of the
243 parent type to deduce the layout.
244 (field_is_aliased): Delete.
245 (components_to_record): Test DECL_ALIASED_P directly.
246 (annotate_rep): Check that fields are present except for
248 (create_field_decl_from): Add DEBUG_INFO_P
249 parameter and pass it in recursive and other calls. Add guard
250 for the manual CSE on the size.
251 (is_stored_discriminant): New predicate.
252 (copy_and_substitute_in_layout): Consider only
253 stored discriminants and check that original fields are present
254 in the old type. Deal with derived types. Adjust call to
255 create_variant_part_from.
257 2017-05-02 Ed Schonberg <schonberg@adacore.com>
259 * exp_ch6.adb (Expand_Call_Helper): When locating the
260 accessibility entity created for an access parameter, handle
261 properly a reference to a formal of an enclosing subprogram. if
262 the reference appears in an inherited class-wide condition, it
263 is the rewriting of the reference in the ancestor expression,
264 but the accessibility entity must be that of the current formal.
266 2017-05-02 Javier Miranda <miranda@adacore.com>
268 * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
269 (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
270 Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
271 Call Expand_Non_Binary_Modular_Op.
273 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
275 * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
276 has discriminants, do not override the Stored_Constraint list of
277 the full view of the derived type with that of the derived type.
279 2017-05-02 Bob Duff <duff@adacore.com>
281 * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
283 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
285 * s-os_lib.ads: Minor typo fix.
287 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
289 * gnatls.adb: Merge and refactor code from Prj.Env and remove
290 this deprecated dependency.
292 2017-05-02 Ed Schonberg <schonberg@adacore.com>
294 * exp_util.ads: minor comment addition.
296 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
298 * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
299 pastos in part #3 of the head comment.
301 2017-05-02 Ed Schonberg <schonberg@adacore.com>
303 * exp_ch3.adb (Freeze_Type): Do not generate an invariant
304 procedure body for a local (sub)type declaration within a
305 predicate function. Invariant checks do not apply to these, and
306 the expansion of the procedure will happen in the wrong scope,
307 leading to misplaced freeze nodes.
309 2017-05-02 Ed Schonberg <schonberg@adacore.com>
311 * exp_util.adb (Insert_Library_Level_Action): Use proper scope
312 to analyze generated actions. If the main unit is a body,
313 the required scope is that of the corresponding unit declaration.
315 2017-05-02 Arnaud Charlet <charlet@adacore.com>
317 * einfo.adb (Declaration_Node): flip branches of
318 an IF statement to avoid repeated negations in its condition;
319 no change in semantics, only to improve readability.
321 2017-05-02 Arnaud Charlet <charlet@adacore.com>
323 * sem_case.adb: Remove extra spaces in parameter declarations.
325 2017-05-02 Justin Squirek <squirek@adacore.com>
327 * usage.adb: Replace space with hyphen ("run time" -> "run-time")
328 in usage line for new -gnatwE switch.
330 2017-05-02 Claire Dross <dross@adacore.com>
332 * a-cofuve.ads (Remove): Remove unnecessary
333 conditions in precondition.
335 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
337 * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
338 sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
340 2017-05-02 Justin Squirek <squirek@adacore.com>
342 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
343 alternative expression.
344 * sem_res.adb (Resolve_Case_Expression): Ditto.
346 2017-05-02 Ed Schonberg <schonberg@adacore.com>
348 * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
349 Refine predicate for the case where the primitive operation
350 is a renaming of equality. An overriding operation that is
351 a user-defined renaming of predefined equality inherits its
352 slot from the overridden operation. Otherwise it is treated
353 as a predefined op and occupies the same predefined slot as
354 equality. A call to it is transformed into a call to its alias,
355 which is the predefined equality. A dispatching call thus uses
356 the proper slot if operation is further inherited and called
357 with class-wide arguments.
359 2017-05-02 Justin Squirek <squirek@adacore.com>
361 * errout.adb (Set_Msg_Text): Add a case to switch the message
362 type when the character '[' is detected signifying a warning
363 about a run-time exception.
364 * opt.ads Add a new Warning_Mode value for new switch
365 * switch-b.adb (Scan_Binder_Switches): Add case for the binder
366 to handle new warning mode
367 * usage.adb (Usage): Add usage entry for -gnatwE
368 * warnsw.adb (Set_Warning_Switch): Add case for the new switch
370 2017-05-02 Ed Schonberg <schonberg@adacore.com>
372 * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
373 declaration that operates on some fixed point type.
375 2017-05-02 Justin Squirek <squirek@adacore.com>
377 * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
379 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
381 * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
383 2017-05-02 Justin Squirek <squirek@adacore.com>
385 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
386 expression (Analyze_If_Expression): Add check for valid condition
387 * sem_eval.adb (Eval_Case_Expression): Add check for error posted
389 * sem_res.adb (Resolve_If_Expression): Add check for valid
390 condition and then-expression.
392 2017-05-02 Ed Schonberg <schonberg@adacore.com>
394 * exp_ch3.adb (Build_Initialization_Call): Generate a null
395 statement if the initialization call is a null procedure, as
396 can happen with a controlled type with no explicit Initialize
397 procedure, or an array of such.
398 * exp_ch7.adb (Process_Object_Declaration): For a type with
399 controlled components that has a trivial Initialize procedure,
400 insert declaration for finalization counter after object
402 (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
403 finalization block and attendant declarations if component has
404 a trivial Initialize procedure.
405 (Make_Init_Call): Do not generate a call if controlled type has
406 a trivial Initialize procedure.
408 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
410 * g-forstr.ads (Data): Move Format component last.
411 * g-forstr.adb ("+"): Adjust for above change.
412 * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
413 * g-sechas.ads (Context): Move Key last.
414 * g-socket.ads (Service_Entry_Type): Move Aliases last.
415 * s-fileio.adb (Temp_File_Record): Move Name last.
416 * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
417 * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
419 2017-05-02 Jerome Lambourg <lambourg@adacore.com>
421 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
422 switch introduced recently. finally not needed.
424 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
426 * sem_ch6.adb (Analyze_Null_Procedure): Set the
427 Corresponding_Body link for a null procedure declaration.
429 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
431 * atree.h (Flag290): Add missing terminating parenthesis.
432 * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
433 (Set_Is_Class_Wide_Clone): Likewise.
434 * einfo.ads (Is_Class_Wide_Clone): Likewise.
436 2017-05-02 Gary Dismukes <dismukes@adacore.com>
438 * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
439 parameter Array_Comp to indicate the case of an array object
440 with null-excluding components.
441 * checks.adb (Null_Exclusion_Static_Checks):
442 Call Compile_Time_Constraint_Error instead of
443 Apply_Compile_Time_Constraint_Error in the component case. Also
444 call that when Array_Comp is True, with an appropriate warning for
445 the array component case. Only create an explicit initialization
446 by null in the case of an object of a null-excluding access type
447 (and no longer do that in the component case).
448 * sem_ch3.adb (Check_Component): Add a Boolean parameter
449 Array_Comp defaulted to False. Pass Empty for the Comp
450 actual when calling Null_Exclusion_Static_Checks in the case
451 where Comp_Decl matches Object_Decl, because we don't have a
452 component in that case. In the case of an object or component
453 of an array type, pass True for Array_Comp on the recursive call
456 2017-05-02 Bob Duff <duff@adacore.com>
458 * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
459 compute the linux priority from the Ada priority. Call this everywhere
460 required. In particular, the previous version was not doing this
461 computation when setting the ceiling priority in various places. It
462 was just converting to C.int, which results in a ceiling that is off
465 2017-05-02 Ed Schonberg <schonberg@adacore.com>
467 * sem_ch3.adb: Comment predicate inheritance.
469 2017-05-02 Tristan Gingold <gingold@adacore.com>
471 * s-trasym.ads: Add comment.
473 2017-05-02 Bob Duff <duff@adacore.com>
475 * sem_elab.adb, sem_elab.ads: Minor comment fixes.
476 * sem_ch4.adb: Minor reformatting.
477 * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
478 * s-taspri-posix-noaltstack.ads: Minor refactoring.
479 * sinput.ads: Minor typo fix.
481 2017-05-02 Ed Schonberg <schonberg@adacore.com>
483 * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
484 * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
485 here from exp_ch9, to recognize objects whose creation requires
486 dynamic allocation, so that the proper warning can be emitted
487 when restriction No_Implicit_Heap_Allocation is in effect.
488 * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
489 to emit proper warning when an object that requires dynamic
490 allocation is declared.
492 2017-05-02 Tristan Gingold <gingold@adacore.com>
494 * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
496 2017-05-02 Ed Schonberg <schonberg@adacore.com>
498 * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
499 visibility rules for equality operators that apply within an
500 instantiation apply within an inlined body.
501 * sem_type.adb (Add_One_Interp): ditto.
503 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
505 * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
508 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
511 (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
512 Name_No_Tagged_Streams): Move to regular pragmas. Add
513 placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
514 and Secondary_Stack_Size.
515 (Pragma_Id): Move Pragma_Assume,
516 Pragma_Attribute_Definition, Pragma_Loop_Optimize and
517 Pragma_No_Tagged_Streams to second part.
519 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
521 * exp_attr.adb: Minor reformatting.
523 2017-05-02 Ed Schonberg <schonberg@adacore.com>
525 * sem_ch4.adb (Analyze_Selected_Component): Improve error
526 detection for illegal references to private components or
527 operations of a protected type in the body of the type.
529 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
531 * opt.ads: Add missing GNAT markers in comments.
532 * opt.adb (Set_Opt_Config_Switches): Do not override earlier
533 settings of Optimize_Alignment at the end.
535 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
537 * checks.adb (Apply_Constraint_Check): Do not apply
538 a discriminant check when the associated type is a constrained
539 subtype created for an unconstrained nominal type.
540 * exp_attr.adb: Minor reformatting.
542 2017-05-02 Bob Duff <duff@adacore.com>
544 * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
545 the N_Raise_Expression case.
546 * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
549 2017-05-02 Yannick Moy <moy@adacore.com>
551 * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
552 optimize length comparison in GNATprove mode.
553 * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
554 operator /= into negation of operator = when needed.
555 (Expand_SPARK): Call new
556 function to expand operator /=.
558 2017-05-02 Ed Schonberg <schonberg@adacore.com>
560 * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
561 Simplify the expression for a fixed-fixed division to remove
562 divisions by constants whenever possible, as an optimization
563 for restricted targets.
565 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
567 * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
569 2017-05-02 Bob Duff <duff@adacore.com>
571 * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
572 to find primitive ops, instead of using an Identifier that will
573 later be looked up. This is necessary because these ops are not
574 necessarily visible at all places where we need to call them.
575 * exp_util.ads: Minor comment fix.
577 2017-05-02 Ed Schonberg <schonberg@adacore.com>
579 * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
580 references are fully conformant if they are both expansions
581 of the discriminant of a protected type, within one of the
582 protected operations. One occurrence may be expanded into a
583 constant declaration while the other is an input parameter to
584 the corresponding generated subprogram.
586 2017-05-02 Justin Squirek <squirek@adacore.com>
588 * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
589 recursivly searching composite-types for null-excluding access
590 types and verifying them.
591 (Analyze_Object_Declaration): Add a
592 call to Check_Null_Excluding_Components for static verification
593 of non-initialized objects.
594 * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
595 a parameter for a composite-type's component and an extra case
596 for printing component information.
598 2017-05-02 Yannick Moy <moy@adacore.com>
600 * sem_ch10.adb (Analyze_Subunit): Take
601 configuration pragma into account when restoring appropriate
602 pragma for analysis of subunit.
604 2017-05-02 Justin Squirek <squirek@adacore.com>
606 * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
607 s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
608 g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
609 clauses from the runtime.
611 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
613 * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
614 array components specially.
616 2017-05-02 Ed Schonberg <schonberg@adacore.com>
618 * sem_ch8.adb (Premature_Usage): If the premature usage of
619 an entity is as the expression in its own object decaration,
620 rewrite the reference as Any_Id to prevent cascaded errors or
621 compiler loops when such an entity is used in an address clause.
623 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
625 * gcc-interface/decl.c (components_to_record): Add missing guard.
627 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
629 * gcc-interface/decl.c (components_to_record): Add more comments.
630 Put back pending fields onto the regular list if the misalignment
631 happens to cancel itself.
633 2017-04-28 Ed Schonberg <schonberg@adacore.com>
635 * sem_ch4.adb (Complete_Object_Operation): When rewriting the
636 controlling actual in a prefixed call, preserve the original node
637 information if the prefix itself has been rewritten, for ASIS use.
639 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
641 * exp_ch6.adb (Insert_Post_Call_Actions):
642 Code clean up. Insert the post-call actions after an enclosing
643 procedure call when N denotes a function call and appears as an
644 actual parameter in the procedure call.
646 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
648 * freeze.adb (Check_Component_Storage_Order): If there is a clause
649 for the component, also reject the attribute if the component
650 doesn't end on a byte boundary and its scalar storage order is
651 different from that of the enclosing record type.
653 2017-04-28 Javier Miranda <miranda@adacore.com>
655 * atree.ads (Info_Messages): Removed.
656 (Warning_Info_Messages): New counter.
657 (Report_Info_Messages): New counter.
658 * err_vars.ads Update documentation.
659 * errout.adb (Delete_Warning_And_Continuations): Update
660 Info_Message occurrences.
661 (Error_Msg_Internal): Update Info_Message occurrences.
662 (Delete_Warning): Update Info_Message occurrences.
663 (Write_Error_Summary): Update Info_Message occurrences.
664 (Output_Messages): Update Info_Message occurrences.
665 (To_Be_Removed): Update Info_Message occurrences.
666 (Reset_Warnings): Update Info_Message occurrences.
667 * errutil.adb (Error_Msg): Update Info_Message occurrences.
668 (Finalize): Update Info_Message occurrences.
669 (Initialize): Update Info_Message occurrences.
670 * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
671 (Compilation_Errors): Update Info_Message_Occurences.
673 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
675 * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
676 * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
677 * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
678 * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
679 * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
680 * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
682 * sem_eval.adb (Why_Not_Static): Initialize Typ.
683 * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
685 2017-04-28 Bob Duff <duff@adacore.com>
687 * sem_util.ads, sem_util.adb (Might_Raise): New function
688 that replaces Is_Exception_Safe, but has the opposite
689 sense. Is_Exception_Safe was missing various cases -- calls inside
690 a pragma Debug, calls inside an 'if' or assignment statement,
691 etc. Might_Raise now walks the entire subtree looking for things
693 * exp_ch9.adb (Is_Exception_Safe): Remove.
694 (Build_Protected_Subprogram_Body): Replace call to
695 Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
696 constants where possible).
697 * exp_ch7.adb: Rename Is_Protected_Body -->
698 Is_Protected_Subp_Body. A protected_body is something different
701 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
703 * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
704 * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
705 (P_Discrete_Choice_List): Initialize Expr_Node variable.
706 * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
707 (P_Protected): Likewise.
708 * sem_case.adb (Check_Duplicates):
709 Add pragma Warnings on variable.
710 * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
711 * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable.
712 * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
713 (Analyze_Exit_Statement): Initialize Scope_Id variable.
714 (Analyze_Iterator_Specification): Initialize Bas variable.
715 * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
716 Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
717 (Analyze_Accept_Statement): Initialize Task_Nam.
719 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
721 * checks.adb (Install_Primitive_Elaboration_Check):
722 Do not generate an elaboration check if all checks have been
725 2017-04-28 Ed Schonberg <schonberg@adacore.com>
727 * sem_ch13.adb (Analyze_Aspect_Specifications, case
728 Interrupt_Handler and Attach_Handler): Generate reference
729 to protected operation to prevent spurious warnings about
730 unreferenced entities. Previous scheme failed with style checks
733 2017-04-28 Ed Schonberg <schonberg@adacore.com>
735 * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
736 that follows an expression function must not be relocated to
737 the generated body, because it applies to the code that follows.
739 2017-04-28 Gary Dismukes <dismukes@adacore.com>
741 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
742 Relaxed_RM_Semantics to avoid having CodePeer issue errors on
743 code that might violate the more stringent checking for 'Access
744 introduced in Ada 2005.
746 2017-04-28 Arnaud Charlet <charlet@adacore.com>
748 * a-cforse.adb: minor style fix in comment.
750 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
752 * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
753 initialize Block_Decls variable.
754 (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
755 (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
756 * exp_disp.adb (Expand_Interface_Actuals): Initialize
757 Formal_DDT and Actual_DDT variables.
758 (Expand_Interface_Thunk): Initialize Iface_Formal.
759 (Make_DT): Initialize Size_Comp.
760 (Make_Select_Specific_Data_Table): Initialize Decls.
761 * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
762 Also initialize more RPC_Receiver_* variables.
763 (Build_To_Any_Function): Initialize Cstr_Formal.
764 * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
766 2017-04-28 Ed Schonberg <schonberg@adacore.com>
768 * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
769 node between access types, freeze the designated type as well,
770 so that dispatch table pointers are created in the proper scope,
771 and not in the constructed body of the expression function.
773 2017-04-28 Bob Duff <duff@adacore.com>
775 * alloc.ads (Nodes_Initial): Go back to previous value. The large
776 value makes large compilations faster, but small compilations slower.
778 2017-04-28 Arnaud Charlet <charlet@adacore.com>
780 * sem_util.adb: minor typos in Is_Child_Or_Sibling.
782 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
784 * erroutc.adb (Compilation_Errors): Do not consider info messages
785 as suitable warnings when warnings must be treated as errors.
786 * sem_ch7.adb (Analyze_Package_Specification): Do not consider
787 internally-generated packages when outputting completion
789 * errout.adb (Output_Messages): Do not consider info messages as
790 suitable warnings when warnings must be treated as errors.
791 * errutil.adb (Finalize): Do not consider info messages as
792 suitable warnings when warnings must be treated as errors.
794 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
796 * warnsw.ads: Minor fix for incorrect wording in comment.
798 2017-04-28 Ed Schonberg <schonberg@adacore.com>
800 * sem_res.adb (In_Instance_Code): New predicate in
801 Valid_Conversion, to determine whether a type conversion appears
802 as (or within) an actual for a formal object. Type conversions
803 in instances are not rechecked in Valid_Conversion because
804 visibility changes between generic location andi instance may
805 lead to spurious errors, but conversions within an actual must be
806 fully checked, and they are not fully resolved when pre-analyzing
809 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
811 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
812 New_Copy_Tree instead of Relocate_Node as any subsequent copies
813 of the relocated node will have mangled Parent pointers.
814 * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
815 tables used in conjunction with entity and itype replication.
816 (Visit_Entity): Rewrite the restriction on which entities
817 require duplication. The restriction now includes all types.
819 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
821 * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
822 a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
823 a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
826 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
828 * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
829 gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
831 2017-04-28 Gary Dismukes <dismukes@adacore.com>
833 * exp_util.adb: Minor reformatting.
835 2017-04-28 Ed Schonberg <schonberg@adacore.com>
837 * sem_ch4.adb: Fix copy/pasto.
839 2017-04-27 Tristan Gingold <gingold@adacore.com>
841 * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
842 raise-gcc.c. Fix include search path for raise-gcc.c
844 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
846 * fe.h (Warn_On_Questionable_Layout): Declare.
847 * warnsw.ads (Warn_On_Record_Holes): Move down.
848 (Warn_On_Questionable_Layout): New boolean variable.
849 (Warning_Record): Add Warn_On_Questionable_Layout field.
850 * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
851 (Restore_Warnings): Likewise.
852 (Save_Warnings): Likewise.
853 (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
854 * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
855 components_to_record.
856 (gnu_field_to_gnat): New function.
857 (warn_on_field_placement): Likewise.
858 (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
859 parameters. Rename local variables and adjust recursive call.
860 Rework final scan of the field list and implement warnings on the
861 problematic placement of specific sorts of fields.
863 2017-04-27 Bob Duff <duff@adacore.com>
865 * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
866 * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
867 * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
868 * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
869 * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
870 * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
871 For efficiency, cache results of Is_Internal_File_Name and
872 Is_Predefined_File_Name in the Units table. This avoids a lot
873 of repeated text processing.
875 2017-04-27 Emmanuel Briot <briot@adacore.com>
877 * g-comlin.adb (Sort_Sections): remove useless test.
879 2017-04-27 Claire Dross <dross@adacore.com>
881 * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
882 allow the use of regular equality over elements in contracts.
883 (Formal_Model): Ghost package containing model functions that are
884 used in subprogram contracts.
885 (Current_To_Last): Removed, model functions should be used instead.
886 (First_To_Previous): Removed, model functions should be used instead.
887 (Strict_Equal): Removed, model functions should be used instead.
888 (No_Overlap): Removed, model functions should be used instead.
889 (Equivalent_Keys): Functions over cursors are removed. They were
890 awkward with explicit container parameters.
891 * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
892 allow the use of regular equality over elements in contracts.
893 (Formal_Model): Ghost package containing model functions that
894 are used in subprogram contracts.
895 (Current_To_Last): Removed, model functions should be used instead.
896 (First_To_Previous): Removed, model functions should be used instead.
897 (Strict_Equal): Removed, model functions should be used instead.
898 (No_Overlap): Removed, model functions should be used instead.
900 2017-04-27 Yannick Moy <moy@adacore.com>
902 * gnat1drv.adb: Code cleanup.
904 2017-04-27 Ed Schonberg <schonberg@adacore.com>
906 * exp_util.adb (Replace_Entity): The prefix of a 'Result
907 attribute reference in a post- condition is the subprogram to
908 which the condition applies. If the condition is inherited
909 by a type extension, the prefix becomes a reference to the
910 inherited operation, but there is no need to create a wrapper
911 for this operation, because 'Result is expanded independently
912 when elaborating the postconditions.
914 2017-04-27 Bob Duff <duff@adacore.com>
916 * sinput.adb: Minor code cleanup.
917 * namet.adb (Append): Create faster versions of
918 Append(String) and Append(Name_Id) by using slice assignment
920 * sem_util.adb (In_Instance): Speed this up by removing
921 unnecessary tests; Is_Generic_Instance is defined for all
923 * sem_util.ads, sem_util.adb (In_Parameter_Specification):
924 Remove unused function.
925 * alloc.ads (Nodes_Initial): Use a much larger value, because
926 the compiler was spending a lot of time copying the nodes table
927 when it grows. This number was chosen in 1996, so is rather out
928 of date with current memory sizes. Anyway, it's virtual memory.
929 Get rid of Orig_Nodes_...; use Node_... instead.
930 * atree.adb (Lock): Do not release the Nodes tables; it's a
932 Orig_Nodes_ ==> Nodes_
933 * nlists.adb: Orig_Nodes_ ==> Nodes_
934 * g-table.adb: Remove unused "with" clause.
935 * g-table.ads, table.ads: Remove Big_Table_Type, which should
936 not be used by clients.
937 * g-dyntab.adb (Last_Allocated): New function
938 to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
940 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
942 * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
944 (Subtypes_Statically_Match): Remove duplicate check.
945 * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
947 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
949 * exp_aggr.adb (Replace_Type): Remove the special processing
950 for selected components.
951 * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
952 processing for attributes Fixed_Value and Integer_Value.
953 * exp_util.adb (Side_Effect_Free): Merge the processing for
954 qualified expressions, type conversions, and unchecked type
956 * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
958 * par-ch3.adb (P_Declarative_Items): Merge the processing for
959 tokens function, not, overriding, and procedure.
960 * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
961 for qualified expressions, type conversions, and unchecked
963 * sem_util.adb (Compile_Time_Constraint_Error): Merge the
964 processing for Ada 83 and instances.
965 (Object_Access_Level): Merge the processing for indexed components
966 and selected components.
967 * uname.adb (Add_Node_Name): Merge the processing for stubs.
969 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
971 * checks.adb (Install_Primitive_Elaboration_Check):
972 Do not generate the check when restriction No_Elaboration_Code
975 2017-04-27 Ed Schonberg <schonberg@adacore.com>
977 * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
978 of Expand_Dispatching_Call. If the denoted subprogram has a
979 class-wide precondition, this is the only precondition that
980 applies to the call, rather that the class-wide preconditions
981 that may apply to the body that is executed. (This is specified
984 2017-04-27 Yannick Moy <moy@adacore.com>
986 * gnat1drv.adb (Adjust_Global_Switches): Issue
987 a warning in GNATprove mode if the runtime library does not
988 support IEEE-754 floats.
990 2017-04-27 Ed Schonberg <schonberg@adacore.com>
992 * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
993 is itself inherited it does not carry any contract information,
994 so examine its parent operation which is its Alias.
996 2017-04-27 Ed Schonberg <schonberg@adacore.com>
998 * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
999 prefix can be an object reference in which case Obj'Image (X)
1000 can only be interpreted as an indexing of the parameterless
1001 version of the attribute.
1002 * par-ch4.adb (P_Name): An attribute reference can be the prefix of
1003 an indexing or a slice operation if the attribute does not require
1004 parameters. In Ada2012 'Image also belongs in this category,
1005 and A'Image (lo .. hi) is legal and must be parsed as a slice.
1007 2017-04-27 Yannick Moy <moy@adacore.com>
1009 * exp_ch4.adb: Minor reformatting.
1010 * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
1011 disable the CodePeer and C generation modes. Similar to the
1012 opposite actions done in CodePeer mode.
1014 2017-04-27 Yannick Moy <moy@adacore.com>
1016 * sem_res.adb: Remove duplicate code.
1017 * sem_attr.adb: Delete duplicate code.
1019 2017-04-27 Bob Duff <duff@adacore.com>
1021 * g-dyntab.adb: Reduce the amount of copying in
1022 Release. No need to copy items past Last.
1024 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1026 * checks.adb Add with and use clauses for Sem_Disp.
1027 (Install_Primitive_Elaboration_Check): New routine.
1028 * checks.ads (Install_Primitive_Elaboration_Check): New routine.
1029 * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
1030 processing of 'Elaborated.
1031 * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
1034 2017-04-27 Bob Duff <duff@adacore.com>
1036 * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
1037 If the table grows and then shrinks back to empty, we won't necessarily
1038 point back to the empty array. Code cleanups.
1039 * sinput.ads: Add 'Base to Size clause to match the declared
1042 2017-04-27 Claire Dross <dross@adacore.com>
1044 * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
1045 allow the use of regular equality over elements in contracts.
1046 (Formal_Model): Ghost package containing model functions that
1047 are used in subprogram contracts.
1048 (Current_To_Last): Removed, model functions should be used instead.
1049 (First_To_Previous): Removed, model functions should be used instead.
1050 (Strict_Equal): Removed, model functions should be used instead.
1051 (No_Overlap): Removed, model functions should be used instead.
1052 * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
1053 Boolean generic parameter to disable contracts for equivalence
1055 (Witness): Create a witness of a key that is used for handling of
1056 equivalence between keys.
1057 (Has_Witness): Check whether a witness is contained in a map.
1058 (W_Get): Get the element associated to a witness.
1059 (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
1061 * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
1062 Boolean generic parameter to disable contracts for equivalence
1064 * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
1065 of equivalence on functional maps.
1066 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
1067 of equivalence on functional maps.
1069 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1071 * exp_ch9.adb (Expand_Entry_Barrier): Code
1072 cleanup. Do not perform the optimization which removes the
1073 declarations of the discriminant and component renamings when
1074 validity checks on operands and attributes are in effect.
1076 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1078 * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
1079 freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
1080 a-cfhama.ads, a-cofove.ads: Minor reformatting.
1082 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1084 * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
1085 pointer dereference.
1086 * g-spipat.adb (Dump): Code clean up. Protect against a possible
1087 null pointer dereference.
1089 2017-04-27 Bob Duff <duff@adacore.com>
1091 * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
1092 Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
1093 Free renames Init, since they do the same thing.
1094 * g-table.ads: Default for Table_Low_Bound.
1095 * table.ads: Default for Table_Low_Bound, Table_Initial, and
1098 2017-04-27 Bob Duff <duff@adacore.com>
1100 * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
1102 * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
1103 * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
1104 Reorder code so that above assertions do not fail.
1105 * table.ads: Remove obsolete comment on Locked.
1107 2017-04-27 Claire Dross <dross@adacore.com>
1109 * a-cfdlli.ads: Code cleanup.
1111 2017-04-27 Yannick Moy <moy@adacore.com>
1113 * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
1114 when needed for proof. (Expand_SPARK): Call the new procedure.
1115 * exp_util.ads Fix typo.
1117 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1119 * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
1122 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1124 * sem_elab.adb Add new type Visited_Element
1125 and update the contents of table Elab_Visited. Various code clean up.
1126 (Check_Elab_Call): Determine whether a prior call to
1127 the same subprogram was already examined within the same context.
1128 (Check_Internal_Call_Continue): Register the subprogram being
1129 called as examined within a particular context. Do not suppress
1130 elaboration warnings.
1132 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1134 * xoscons.adb, osint.ads: Minor reformatting.
1136 2017-04-27 Bob Duff <duff@adacore.com>
1138 * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
1139 Table_Count_Type --> Table_Last_Type, because the name
1140 was confusing (a "count" usually starts at zero). Add
1141 functionality supported or needed by other tables packages
1142 (Move, Release_Threshold).
1143 * g-table.ads, g-table.adb: This is now just a thin wrapper
1144 around g-dyntab.ads/g-dyntab.adb. Add functionality supported
1145 or needed by other tables packages (Save, Restore).
1146 * table.ads, table.adb: This is now just a thin wrapper around
1147 * g-table.ads/g-table.adb.
1148 * namet.h, scos.h, uintp.h: These files are reaching into the
1149 private data of some instances of g-table, whose names changed,
1150 so the above change requires some adjustment here. It now uses
1153 2017-04-27 Bob Duff <duff@adacore.com>
1155 * namet.adb, namet.ads: Minor: remove unused procedures.
1157 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1159 * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
1160 (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
1161 Add pragma Warnings on Rtype variable in nested block. *
1162 * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
1163 * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
1164 (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
1165 * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
1166 (Process_Component_List_For_Finalize): Initialize Counter_Id.
1167 (Build_Finalize_Statements): Initialize Bod_Stmts.
1168 * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
1170 2017-04-27 Claire Dross <dross@adacore.com>
1172 * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
1173 allow the use of regular equality over elements in contracts.
1174 (Formal_Model): Ghost package containing model functions that are
1175 used in subprogram contracts.
1176 (Current_To_Last): Removed, model
1177 functions should be used instead.
1178 (First_To_Previous): Removed, model functions should be used instead.
1179 (Strict_Equal): Removed, model functions should be used instead.
1180 (No_Overlap): Removed, model functions should be used instead.
1181 (Equivalent_Keys): Functions over cursors are removed. They were
1182 awkward with explicit container parameters.
1183 * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
1184 (proof only) procedure to help GNATprove when equivalence over
1185 keys is not equality.
1187 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1189 * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
1190 sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
1191 Minor reformatting and code cleanups.
1193 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1195 * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
1196 subsidiary of Check_Inherited_Conditions, to build pragmas for an
1197 operation whose ancestor has classwide pre/postconditions. This
1198 is used both to check the legality of the inheritance in Ada
1199 and in SPARK, and to determine whether a wrapper is needed for
1200 an inherited operation.
1201 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
1202 Improve placement of error message for inherited classwide
1203 conditions that become illegal on type derivation.
1205 2017-04-27 Yannick Moy <moy@adacore.com>
1207 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
1208 SPARK_Mode from context on generic package.
1209 * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
1212 2017-04-27 Claire Dross <dross@adacore.com>
1214 * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
1215 overflows in computations.
1216 * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
1217 overflows in computations.
1218 (Insert): Rewrite precondition to avoid overflows in computations.
1219 * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
1220 overflows in computations.
1221 (Insert): Rewrite precondition to avoid overflows in computations.
1223 2017-04-27 Steve Baird <baird@adacore.com>
1225 * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
1226 flag when it is declared in order to avoid confusing CodePeer about
1227 the possibility of an uninitialized variable read.
1229 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1231 * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
1232 no dimensionality error if the subtype of the expression is
1233 identical to the nominal subtype in the declaration, even though
1234 the expression itself may have been constant-folded and lack a
1236 * sem_dim.ads: Add comments on setting of dimension vectors and
1237 its interaction with node rewritings and side-effect removal.
1239 2017-04-27 Bob Duff <duff@adacore.com>
1241 * debug.adb: Minor comment correction.
1242 * sem_dim.ads: Minor reformatting and typo fixes.
1244 2017-04-27 Bob Duff <duff@adacore.com>
1246 * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
1247 Last of the tables via function calls, rather than relying on layout
1250 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1252 * exp_util.adb: No wrapper in GNATprove mode.
1254 2017-04-27 Yannick Moy <moy@adacore.com>
1256 * sem_res.adb (Resolve_Comparison_Op): Always
1257 evaluate comparisons between values of universal types.
1259 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1261 * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
1262 an elaboration counter nor a check when in GNATprove mode.
1263 * sem_util.adb (Build_Elaboration_Entity): Do not create an
1264 elaboration counter when in GNATprove mode.
1266 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1268 * freeze.adb: copy-paste typo.
1270 2017-04-27 Yannick Moy <moy@adacore.com>
1272 * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
1273 Use correct test to detect call in GNATprove mode instead of
1276 2017-04-27 Claire Dross <dross@adacore.com>
1278 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
1279 New property function expressing that the element of a
1280 sequence are contained in the union of two sequences.
1281 (Formal_Model.M_Elements_Included): New property function
1282 expressing that the element of a sequence are another sequence.
1283 (Generic_Sorting): Use new property functions to state that
1284 elements are preserved by Sort and Merge.
1285 * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
1286 allow the use of regular equality over elements in contracts.
1287 (Formal_Model): Ghost package containing model functions
1288 that are used in subprogram contracts. (Capacity):
1289 On unbounded containers, return the maximal capacity.
1290 (Current_To_Last): Removed, model functions should be used instead.
1291 (First_To_Previous): Removed, model functions should be used instead.
1292 (Append): Default parameter value replaced
1293 by new wrapper to allow more precise contracts.
1294 (Insert): Subprogram restored, it seems it was useful to users even if
1296 (Delete): Subprogram restored, it seems it was useful to users even if
1298 (Prepend): Subprogram restored, it seems it was useful to users even
1299 if it is inefficient.
1300 (Delete_First): Subprogram restored, it seems it
1301 was useful to users even if it is inefficient. (Delete_Last):
1302 Default parameter value replaced by new wrapper to allow more
1304 (Generic_Sorting.Merge): Subprogram restored.
1305 * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
1306 allow the use of regular equality over elements in contracts.
1307 (Formal_Model): Ghost package containing model functions
1308 that are used in subprogram contracts. (Capacity):
1309 On unbounded containers, return the maximal capacity.
1310 (Current_To_Last): Removed, model functions should be used
1312 (First_To_Previous): Removed, model functions should be used instead.
1313 (Append): Default parameter value replaced
1314 by new wrapper to allow more precise contracts.
1315 (Insert): Subprogram restored, it seems it was useful to users even if
1317 (Delete): Subprogram restored, it seems it was useful to users even if
1319 (Prepend): Subprogram restored, it seems it was useful to users even
1320 if it is inefficient.
1321 (Delete_First): Subprogram restored, it seems it
1322 was useful to users even if it is inefficient. (Delete_Last):
1323 Default parameter value replaced by new wrapper to allow more
1325 (Generic_Sorting.Merge): Subprogram restored.
1326 (Vector): Do not reuse formal vectors, as it is no longer possible
1327 to supply them with an equality function over elements.
1329 2017-04-27 Bob Duff <duff@adacore.com>
1331 * g-dyntab.adb (Release): When allocating the new
1332 table, use the correct slice of the old table to initialize it.
1334 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
1336 * einfo.ads: Minor fixes in comments.
1338 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1340 * sem_prag.adb: disable clones in SPARK_Mode.
1342 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1344 * sem_util.ads, contracts.adb: Minor reformatting.
1346 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1348 * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
1349 Build body of subprogram that has a class-wide condition that
1350 contains calls to other primitives.
1351 (Build_Class_Wide_Clone_Call); Build a call to the common
1352 class-wide clone of a subprogram with classwide conditions. The
1353 body of the subprogram becomes a wrapper for a call to the
1354 clone. The inherited operation becomes a similar wrapper to which
1355 modified conditions apply, and the call to the clone includes
1356 the proper conversion in a call the parent operation.
1357 (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
1358 subprogram that has a classwide condition that contains calls to
1359 other primitives, build an internal subprogram that is invoked
1360 through a type-specific wrapper for all inherited subprograms
1361 that may have a modified condition.
1362 * sem_prag.adb (Check_References): If subprogram has a classwide
1363 condition, create entity for corresponding clone, to be invoked
1364 through wrapper subprograns.
1365 (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
1366 message about placement if pragma isi internally generated.
1367 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
1368 a classwide clone, build body of clone as copy of original body,
1369 and rewrite original body as a wrapper as a wrapper for a call to
1370 the clone, so that it incorporates the original pre/postconditions
1372 * freeze.adb (Check_Inherited_Conditions): For an inherited
1373 subprogram that inherits a classwide condition, build spec and
1374 body of corresponding wrapper so that call to inherited operation
1375 gets the modified conditions.
1376 * contracts.adb (Analyze_Contracts): If analysis of classwide
1377 condition has created a clone for a primitive operation, analyze
1378 declaration of clone.
1380 2017-04-27 Steve Baird <baird@adacore.com>
1382 * exp_util.adb (Build_Allocate_Deallocate_Proc):
1383 Add "Suppress => All_Checks" to avoid generating unnecessary
1386 2017-04-27 Yannick Moy <moy@adacore.com>
1388 * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
1389 * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
1390 inlining body in GNATprove mode when switch -gnatdm used.
1391 * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
1392 in GNATprove mode when switch -gnatdm used.
1394 2017-04-27 Arnaud Charlet <charlet@adacore.com>
1396 * sem_ch13.adb (Analyze_Attribute_Definition_Clause
1397 [Attribute_Address]): Call Set_Address_Taken when ignoring rep
1398 clauses, so that we keep an indication of the address clause
1399 before removing it from the tree.
1401 2017-04-27 Yannick Moy <moy@adacore.com>
1403 * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
1404 of expression being qualified, when not an object name, or else
1405 evaluate the underlying name.
1407 2017-04-27 Jerome Lambourg <lambourg@adacore.com>
1409 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
1411 2017-04-27 Justin Squirek <squirek@adacore.com>
1413 * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
1414 Process_Component_List_For_Finalization as a local variable.
1415 (Process_Component_For_Finalize): Add an extra parameter to avoid
1417 (Process_Component_List_For_Finalization): Correct calls to
1418 Process_Component_For_Finalize to take Num_Comps as a parameter.
1420 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1422 * sem_ch8.adb (Find_Direct_Name): Account for the case where
1423 a use-visible entity is defined within a nested scope of an
1424 instance when giving priority to entities which were visible in
1425 the original generic.
1426 * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
1428 2017-04-27 Tristan Gingold <gingold@adacore.com>
1430 * raise-gcc.c: Don't use unwind.h while compiling
1431 for the frontend, but mimic host behavior.
1433 2017-04-27 Javier Miranda <miranda@adacore.com>
1435 * sem_ch3.adb (Build_Discriminated_Subtype):
1436 Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
1438 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1440 * sem_prag.adb (Analyze_Global_Item):
1441 Do not consider discriminants because they are not "entire
1442 objects". Remove the discriminant-related checks because they are
1444 (Analyze_Input_Output): Do not consider discriminants
1445 because they are not "entire objects".
1447 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1449 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
1450 perform check if the current scope does not come from source,
1451 as is the case for a rewritten task body, because check has
1452 been performed already, and may not be doable because of changed
1455 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1457 * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
1458 a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
1461 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1463 * sem_ch4.adb (Analyze_Call): If the return type of a function
1464 is incomplete in an context in which the full view is available,
1465 replace the type of the call by the full view, to prevent spurious
1467 * exp_disp.adb (Check_Premature_Freezing): Disable check on an
1468 abstract subprogram so that compiler does not reject a parameter
1469 of a primitive operation of a tagged type being frozen, when
1470 the untagged type of that parameter cannot be frozen.
1472 2017-04-27 Bob Duff <duff@adacore.com>
1474 * sem_attr.adb (Compute_Type_Key): Don't walk
1475 representation items for irrelevant types, which could be in a
1476 different source file.
1478 2017-04-27 Steve Baird <baird@adacore.com>
1480 * exp_attr.adb (Expand_N_Attribute_Reference):
1481 Don't expand Image, Wide_Image, Wide_Wide_Image attributes
1484 2017-04-27 Yannick Moy <moy@adacore.com>
1486 * exp_unst.ads: Fix typos in comments.
1488 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1490 * sem_eval.adb (Choice_Matches): Handle properly a real literal
1491 whose type has a defined static predicate.
1493 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1495 * exp_ch4.adb (Insert_Dereference_Action):
1496 Do not adjust the address of a controlled object when the
1497 associated access type is subject to pragma No_Heap_Finalization.
1500 2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
1502 * gcc-interface/utils.c (gnat_type_for_size): Set
1503 TYPE_ARTIFICIAL on created types.
1505 2017-04-27 Claire Dross <dross@adacore.com>
1507 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1508 modifications in functional containers.
1509 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1510 to improve readablity. Subprograms are separated between basic
1511 operations, constructors and properties. Universally quantified
1512 formulas in contracts are factorized in independant functions
1513 with a name and a comment. Names of parameters are improved.
1515 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1517 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1519 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1521 * sem_res.adb (Resolve_Type_Conversion): Do not
1522 install a predicate check here since this is already done during
1523 the expansion phase. Verify whether the operand satisfies the
1524 static predicate (if any) of the target type.
1525 * sem_ch3.adb (Analyze_Object_Declaration): Do
1526 not install a predicate check if the object is initialized by
1527 means of a type conversion because the conversion is subjected
1530 2017-04-27 Tristan Gingold <gingold@adacore.com>
1532 * raise.c (__gnat_builtin_longjmp): Remove.
1533 (__gnat_bracktrace):
1534 Add a dummy definition for the compiler (__gnat_eh_personality,
1535 __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
1536 __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
1537 __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
1538 * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
1539 * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
1540 and a-except-2005.adb.
1541 * raise-gcc.c: Allow build in compiler, compiled as a C++
1543 (__gnat_Unwind_ForcedUnwind): Adjust prototype.
1544 (db): Constify msg_format.
1545 (get_call_site_action_for): Don't use void arithmetic.
1546 * system.ads (Frontend_Exceptions): Set to False.
1547 (ZCX_By_Default): Set to True.
1548 (GCC_ZC_Support): Set to True.
1549 * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
1551 * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
1552 in gnat1 and gnatbind.
1553 * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
1554 s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
1555 * s-excmac.ads, s-excmac.adb: Copy of variants.
1556 * a-except.o: Adjust preequisites.
1557 Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
1559 2017-04-27 Claire Dross <dross@adacore.com>
1561 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1562 modifications in functional containers.
1563 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1564 to improve readablity. Subprograms are separated between basic
1565 operations, constructors and properties. Universally quantified
1566 formulas in contracts are factorized in independant functions
1567 with a name and a comment. Names of parameters are improved.
1569 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1571 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1573 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1575 * sem_res.adb (Resolve_Type_Conversion): Do not
1576 install a predicate check here since this is already done during
1577 the expansion phase. Verify whether the operand satisfies the
1578 static predicate (if any) of the target type.
1579 * sem_ch3.adb (Analyze_Object_Declaration): Do
1580 not install a predicate check if the object is initialized by
1581 means of a type conversion because the conversion is subjected
1584 2017-04-27 Tristan Gingold <gingold@adacore.com>
1586 * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
1587 replaced by their variants).
1589 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1591 * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
1592 cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
1593 a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
1595 2017-04-27 Tristan Gingold <gingold@adacore.com>
1597 * s-excmac-gcc.ads, s-excmac-gcc.adb,
1598 s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
1601 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1603 * exp_ch7.adb (Establish_Transient_Scope): Rewrite
1604 the loop which detects potential enclosing transient scopes. The
1605 loop now terminates much earlier as transient scopes are bounded
1606 by packages and subprograms.
1608 2017-04-27 Claire Dross <dross@adacore.com>
1610 * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
1611 allow the use of regular equality over elements in contracts.
1612 (Cursor): Type is now public so that it can be used in
1614 (Formal_Model): Ghost package containing
1615 model functions that are used in subprogram contracts.
1616 (Current_To_Last): Removed, model functions should be used
1618 (First_To_Previous): Removed, model functions should
1620 (Strict_Equal): Removed, model functions
1621 should be used instead.
1622 (Append): Default parameter value
1623 replaced by new wrapper to allow more precise contracts.
1624 (Insert): Default parameter value replaced by new wrapper to
1625 allow more precise contracts.
1626 (Delete): Default parameter
1627 value replaced by new wrapper to allow more precise contracts.
1628 (Prepend): Default parameter value replaced by new wrapper to
1629 allow more precise contracts.
1630 (Delete_First): Default parameter
1631 value replaced by new wrapper to allow more precise contracts.
1632 (Delete_Last): Default parameter value replaced by new wrapper
1633 to allow more precise contracts.
1635 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1637 * exp_spark.adb (Expand_SPARK): Perform specialized expansion
1638 for object declarations.
1639 (Expand_SPARK_N_Object_Declaration): New routine.
1640 * sem_elab.adb (Check_A_Call): Include calls to the
1641 Default_Initial_Condition procedure of a type under the SPARK
1642 elaboration checks umbrella.
1644 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1646 * sem.adb (Analyze): Diagnose an illegal iterated component
1648 * sem_util.ads, sem_util.adb
1649 (Diagnose_Iterated_Component_Association): New routine.
1651 2017-04-27 Bob Duff <duff@adacore.com>
1653 * adaint.c (__gnat_get_current_dir): Return 0 in length if
1655 * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
1656 exception if getcwd failed.
1658 2017-04-27 Yannick Moy <moy@adacore.com>
1660 * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
1661 entities with special prefix.
1663 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1665 * debug.adb Change the documentation of switch -gnatd.s.
1666 * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
1667 to manage the secondary stack when an enclosing scope already
1668 performs this functionality (aka relaxed management). Switch
1669 -gnatd.s may be used to force strict management in which case
1670 the block will manage the secondary stack unconditionally. Add
1671 a guard to stop the traversal when encountering a package or a
1674 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1676 * sem_res.adb (Resolve_Call): Refine further the handling of
1677 limited views of return types in function calls. If the function
1678 that returns a limited view appears in the current unit,
1679 we do not replace its type by the non-limited view because
1680 this transformation is performed int the back-end. However,
1681 the type of the call itself must be the non-limited view, to
1682 prevent spurious resolution errors.
1684 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1686 * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
1687 Removed, proposed implementation using generics for class-wide
1688 preconditions proved impractical.
1689 (Class_Wide_Clone): New attribute of subprogram. Designates
1690 subprogram created for primitive operations with class-wide
1691 pre/postconditions that contain calls to other primitives. The
1692 clone holds the body of the original primitive, but the
1693 pre/postonditions do not apply to it. The original body is
1694 rewritten as a wrapper for a call to the clone.
1695 (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
1696 the flag is set, no code for the corresponding pre/postconditions
1697 is inserted into its body.
1699 2017-04-27 Bob Duff <duff@adacore.com>
1701 * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
1702 Scalar_Storage_Order if -gnatI is given.
1703 * sem_prag.adb (Analyze_Pragma): Ignore
1704 Default_Scalar_Storage_Order if -gnatI is given.
1706 2017-04-27 Claire Dross <dross@adacore.com>
1708 * a-cofuba.ads (Add): Take as an additional input parameter
1709 the position where the element should be inserted.
1710 (Remove): New function that removes an element from the container.
1711 * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
1712 * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
1713 (Remove): New function that removes an element from a set.
1714 * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
1715 (Remove): New function that removes an element from a sequence.
1716 (Insert): New function that adds anywhere in a sequence.
1718 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1720 * checks.adb (Generate_Range_Check): Revert previous change.
1722 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1724 * sem_util.adb: Minor reformatting/rewording.
1726 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1728 * lib-xref.adb (Generate_Reference): The use
1729 of attribute 'Result is not considered a violation of pragma
1732 2017-04-27 Justin Squirek <squirek@adacore.com>
1734 * cstand.adb (Create_Standard): Correctly set
1735 Directly_Designated_Type for Any_Access.
1736 * sem_type.adb (Covers): Minor grammar fixes.
1738 2017-04-27 Bob Duff <duff@adacore.com>
1740 * sem_attr.adb: Minor cleanup.
1742 2017-04-27 Claire Dross <dross@adacore.com>
1744 * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
1745 private child of Ada.Containers used to implement all functional
1747 * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
1748 child of Ada.Containers. It provides functional indefinite unbounded
1749 maps which can be used as high level models for specification
1751 * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
1752 child of Ada.Containers. It provides functional indefinite unbounded
1753 sets which can be used as high level models for specification
1755 * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
1756 child of Ada.Containers. It provides functional indefinite unbounded
1757 vectors which can be used as high level models for specification
1759 * Makefile.rtl: Add new packages.
1760 * impunit.adb: Add new packages.
1762 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1764 * sem_ch4.adb: Minor reformatting.
1766 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1768 * sem_ch12.adb (Analyze_Associations): minor reformatting.
1769 (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
1770 point type actual that has user-defined arithmetic primitives,
1771 when there is a previous actual for a formal package that defines
1772 a fixed-point type with the parent user-defined operator.
1774 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1776 * checks.adb (Generate_Range_Check): Reinstate part of previous change.
1777 * sem_attr.adb (Resolve_Attribute): Generate a range check when
1778 the component type allows range checks.
1780 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1782 * sem_aux.adb (Is_Generic_Formal): Use original node to locate
1783 corresponding declaration, because formal derived types are
1784 rewritten as private extensions.
1786 2017-04-27 Ed Schonberg <schonberg@adacore.com>
1788 * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
1789 dimensions of operands if node has been analyzed already, because
1790 previous analysis and dimension checking will have removed the
1791 dimension information from the operands.
1793 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1795 * debug.adb: Document the use of switch -gnatd.s.
1796 * einfo.ads Update the documentation on attribute
1797 Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
1798 the uses of these attributes from certain entities.
1799 * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
1800 which determines whether the block should continue to manage
1801 the secondary stack.
1802 (Manages_Sec_Stack): New routine.
1804 2017-04-27 Bob Duff <duff@adacore.com>
1806 * atree.ads: Minor edit.
1808 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1810 * sinfo.ads: Update the section on Ghost mode. Add
1811 a section on SPARK mode. Update the placement of section on
1812 expression functions.
1814 2017-04-27 Bob Duff <duff@adacore.com>
1816 * sinput.adb (Get_Source_File_Index): Don't
1817 assert that S is in the right range in the case where this is
1818 a .dg file under construction.
1820 2017-04-27 Yannick Moy <moy@adacore.com>
1822 * sem_util.adb (Check_Result_And_Post_State):
1823 Handle more precisely each conjunct in expressions formed by
1824 and'ing sub-expressions.
1826 2017-04-27 Gary Dismukes <dismukes@adacore.com>
1828 * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
1830 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1832 * gnat_rm.texi, gnat_ugn.texi,
1833 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1834 doc/gnat_ugn/platform_specific_information.rst,
1835 doc/gnat_ugn/gnat_and_program_execution.rst,
1836 doc/gnat_ugn/gnat_utility_programs.rst,
1837 doc/gnat_ugn/the_gnat_compilation_model.rst,
1838 doc/gnat_rm/implementation_defined_attributes.rst,
1839 doc/gnat_rm/the_gnat_library.rst,
1840 doc/gnat_rm/implementation_defined_pragmas.rst,
1841 doc/gnat_rm/representation_clauses_and_pragmas.rst,
1842 doc/gnat_rm/implementation_of_specific_ada_features.rst,
1843 doc/gnat_rm/implementation_defined_aspects.rst,
1844 doc/gnat_rm/implementation_defined_characteristics.rst: Update
1847 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1849 * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
1850 generating C code on complex case expressions.
1852 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1854 * sem_prag.adb (Analyze_Pragma): Generate a warning instead
1855 of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
1856 * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
1857 Ada_2012 instead of Ada_2005 to be compatible with the above
1859 * bindgen.adb: Silence new warning on pragma Ada_95.
1861 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1863 * checks.adb (Generate_Range_Check): Revert part of previous change.
1865 2017-04-25 Ed Schonberg <schonberg@adacore.com>
1867 * sem_ch4.adb (Try_Container_Indexing): Handle properly a
1868 container indexing operation that appears as a an actual in a
1869 parameter association in a procedure call.
1871 2017-04-25 Olivier Ramonat <ramonat@adacore.com>
1873 * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
1874 Fix spelling mistakes.
1876 2017-04-25 Bob Duff <duff@adacore.com>
1878 * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
1879 * sinput-p.adb: Use regular fat pointers, with bounds checking,
1880 for source buffers. Fix misc obscure bugs.
1881 * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
1882 checking, for source buffers. Modify representation clause for
1883 Source_File_Record as appropriate. Move Source_File_Index_Table
1884 from spec to body, because it is not used outside the body.
1885 Move Set_Source_File_Index_Table into the private part, because
1886 it is used only in the body and in children. Use trickery to
1887 modify the dope in the generic instantiation case. It's ugly,
1888 but not as ugly as the previous method. Fix documentation.
1889 Remove obsolete code.
1890 * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
1891 indexing in source buffers.
1892 * fmap.adb: Avoid conversions from one string type to another.
1893 Remove a use of global name buffer.
1894 * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
1897 2017-04-25 Gary Dismukes <dismukes@adacore.com>
1899 * exp_util.adb, exp_ch4.adb: Minor reformatting.
1901 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1903 * checks.adb: Code clean up in various routines.
1904 (Generate_Range_Check): Do not generate a range check when the
1905 expander is not active or when index/range checks are suppressed
1907 (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
1908 Remove variants that include a Supress parameter. These routines
1909 are never used, and were introduced before the current scope-based
1910 check suppression method.
1912 2017-04-25 Vasiliy Fofanov <fofanov@adacore.com>
1914 * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
1915 code and some subprogram calls that are now noop.
1917 2017-04-25 Arnaud Charlet <charlet@adacore.com>
1919 * exp_ch4.adb (Expand_N_Case_Expression): Take
1920 Minimize_Expression_With_Actions into account when possible.
1922 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1924 * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
1925 (Known_Null): Moved to Sem_Util.
1926 * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
1927 (Known_Null): Moved to Sem_Util.
1928 * sem_util.adb Add new enumeration type Null_Status_Kind.
1929 (Known_Non_Null): Moved from Exp_Util. Most of the logic in
1930 this routine is now carried out by Null_Status.
1931 (Known_Null): Moved from Exp_Util. Most of the logic in this routine
1932 is now carried out by Null_Status.
1933 (Null_Status): New routine.
1934 * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
1935 (Known_Null): Moved from Exp_Util.
1937 2017-04-25 Ed Schonberg <schonberg@adacore.com>
1939 * sem_ch6.adb (Analyze_Expression_Function): Do not report an
1940 error on the return type of an expression function that is a
1941 completion, if the type is derived from a generic formal type.
1943 2017-04-25 Ed Schonberg <schonberg@adacore.com>
1945 * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
1946 conversion are those of the target type.
1948 2017-04-25 Bob Duff <duff@adacore.com>
1950 * a-clrefi.adb: Minor cleanup.
1952 2017-04-25 Gary Dismukes <dismukes@adacore.com>
1954 * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
1956 2017-04-25 Bob Duff <duff@adacore.com>
1958 * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
1959 types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
1960 errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
1961 scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
1962 the Internal_Source buffer. This removes the incorrect call to "="
1963 the customer noticed.
1964 Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
1965 eventually need to eliminate them altogether. Or else get rid
1966 of zero-origin addressing.
1968 2017-04-25 Claire Dross <dross@adacore.com>
1970 * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
1971 function used in GNATprove to know if an expression contains
1972 non-dispatching calls on primitives of a tagged type.
1974 2017-04-25 Bob Duff <duff@adacore.com>
1976 * rtsfind.adb (Initialize): Initialize
1977 First_Implicit_With. Building the compiler with Normalize_Scalars
1978 and validity checking finds this being used as an uninitialized
1981 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
1983 * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
1984 Add a warning about SPARK mode management. The routine now
1985 saves and restores both the mode and associated pragma.
1986 (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
1987 SPARK mode management. The routine now saves and restores both
1988 the mode and associated pragma.
1989 (Analyze_Object_Contract):
1990 Add a warning about SPARK mode management. The routine
1991 now saves and restores both the mode and associated pragma.
1992 (Analyze_Package_Body_Contract): Add a warning about SPARK mode
1993 management. The routine now saves and restores both the mode
1994 and associated pragma. (Analyze_Package_Contract): Add a warning
1995 about SPARK mode management. The routine now saves and restores
1996 both the mode and associated pragma.
1997 (Analyze_Task_Contract):
1998 Add a warning about SPARK mode management. The routine now saves
1999 and restores both the mode and associated pragma.
2000 * expander.adb (Expand): Change the way the Ghost mode is saved
2002 * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
2004 * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
2006 * exp_util.adb (Build_DIC_Procedure_Body):
2007 Change the way the Ghost mode is saved and restored.
2008 (Build_DIC_Procedure_Declaration): Change the way the Ghost
2009 mode is saved and restored.
2010 (Build_Invariant_Procedure_Body):
2011 Change the way the Ghost mode is saved and restored.
2012 (Build_Invariant_Procedure_Declaration): Change the way the Ghost
2013 mode is saved and restored.
2014 (Make_Predicate_Call): Change the
2015 way the Ghost mode is saved and restored.
2016 * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
2018 * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2020 (Mark_And_Set_Ghost_Body): Remove parameter
2021 Mode and its assignment.
2022 (Mark_And_Set_Ghost_Completion):
2023 Remove parameter Mode and its assignment.
2024 (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
2026 (Mark_And_Set_Ghost_Instantiation): Remove parameter
2027 Mode and its assignment.
2028 (Mark_And_Set_Ghost_Procedure_Call):
2029 Remove parameter Mode and its assignment.
2031 Remove parameter Mode and its assignment.
2032 * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2033 and update the comment on usage.
2034 (Mark_And_Set_Ghost_Body):
2035 Remove parameter Mode and update the comment on usage.
2036 (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
2037 update the comment on usage.
2038 (Mark_And_Set_Ghost_Declaration):
2039 Remove parameter Mode and update the comment on usage.
2040 (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
2041 update the comment on usage.
2042 (Mark_And_Set_Ghost_Procedure_Call):
2043 Remove parameter Mode and update the comment on usage.
2044 (Set_Ghost_Mode): Remove parameter Mode and update the comment
2046 * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
2048 * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
2049 of obsolete field SPARK_Mode_Pragma.
2050 (Load_Main_Source): Remove
2051 the assignment of obsolete field SPARK_Mode_Pragma.
2052 (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
2053 * lib-writ.adb (Add_Preprocessing_Dependency): Remove
2054 the assignment of obsolete field SPARK_Mode_Pragma.
2055 (Ensure_System_Dependency): Remove the assignment of obsolete
2056 field SPARK_Mode_Pragma.
2057 * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
2058 mode management. Change the way Ghost and SPARK modes are saved
2060 * sem.adb (Analyze): Change the way the Ghost mode is saved
2062 * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
2063 Ghost mode is saved and restored.
2064 (Process_Full_View): Change
2065 the way the Ghost mode is saved and restored.
2066 * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
2067 mode is saved and restored.
2068 * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
2069 mode is saved and restored.
2070 (Analyze_Subprogram_Body_Helper):
2071 Change the way the Ghost mode is saved and restored.
2072 * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
2073 Ghost mode is saved and restored.
2074 * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
2075 management. Save the SPARK mode-related data prior to any changes
2076 to the scope stack and contexts. The mode is then reinstalled
2077 before the subunit is analyzed in order to restore the original
2078 view of the subunit.
2079 * sem_ch12.adb (Analyze_Package_Instantiation): Update the
2080 warning on region management. Change the way the Ghost and
2081 SPARK modes are saved and restored.
2082 (Inline_Instance_Body):
2083 Add a warning about SPARK mode management. Code clean up.
2084 (Analyze_Subprogram_Instantiation): Update the warning on region
2085 management. Change the way the Ghost and SPARK modes are saved
2087 (Instantiate_Package_Body): Update the warning
2088 on region management. Change the way the Ghost and SPARK modes
2089 are saved and restored.
2090 (Instantiate_Subprogram_Body): Update
2091 the warning on region management. Change the way the Ghost and
2092 SPARK modes are saved and restored.
2093 (Set_Instance_Env): Add a
2094 warning about SPARK mode management. Change the way SPARK mode
2095 is saved and restored.
2096 * sem_ch13.adb (Build_Predicate_Functions):
2097 Change the way the Ghost mode is saved and restored.
2098 (Build_Predicate_Function_Declaration): Change the way the Ghost
2099 mode is saved and restored.
2100 * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
2101 mode management. Change the way SPARK mode is saved and restored.
2102 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
2103 Change the way the Ghost mode is saved and restored.
2104 (Analyze_Initial_Condition_In_Decl_Part): Change the way
2105 the Ghost mode is saved and restored.
2107 Change the way the Ghost mode is saved and restored.
2108 (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
2109 Ghost mode is saved and restored.
2110 * sem_util.adb (Install_SPARK_Mode): New routine.
2111 (Restore_SPARK_Mode): New routine.
2112 (Save_SPARK_Mode_And_Set): Removed.
2113 (Set_SPARK_Mode): New routine.
2114 * sem_util.ads (Install_SPARK_Mode): New routine.
2115 (Restore_SPARK_Mode): New routine.
2116 (Save_SPARK_Mode_And_Set): Removed.
2117 (Set_SPARK_Mode): New routine.
2119 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2121 * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
2122 to determine whether a type is declared in a local package that
2123 has not yet been frozen.
2124 * freeze.adb (Freeze_Before): Use new predicate to determine
2125 whether a local package must be installed on the scope stack
2126 in order to evaluate in the proper scope actions generated by
2127 aspect specifications, such as Predicate
2128 * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
2129 using new predicate.
2131 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2133 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
2134 comparisons between non- scalar expressions expressions because
2135 their values cannot be invalidated.
2136 * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
2139 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2141 * par_sco.adb: Minor reformatting.
2143 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2145 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
2146 is a type from an unfrozen local package, install package to
2147 complete the analysis of delayed aspects of the type.
2149 2017-04-25 Tristan Gingold <gingold@adacore.com>
2151 * bingen.adb (System_Version_Control_Used): New variable.
2152 (Resolve_Binder_Options): Set the above variable.
2153 (Gen_Output_File_Ada): Conditionally call Gen_Versions.
2154 (Gen_Elab_Order): Emit blank line before.
2156 2017-04-25 Justin Squirek <squirek@adacore.com>
2158 * sem_cat.adb (Validate_RT_RAT_Component): Added
2159 an extra check to ignore incomplete types.
2161 2017-04-25 Thomas Quinot <quinot@adacore.com>
2163 * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
2164 bogus circuitry for the case where Name is Predicate.
2166 2017-04-25 Thomas Quinot <quinot@adacore.com>
2168 * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
2169 Create SCOs for Predicate aspects in disabled
2170 state initially, to be enabled later on by...
2171 * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
2172 SCO for predicate as enabled.
2174 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2176 * comperr.adb (Compiler_Abort): Remove now obsolete pair of
2177 pragmas Warnings Off / On.
2178 * namet.adb (Finalize): Remove now obsolete pair of pragmas
2180 * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
2181 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
2182 consider comparisons between static expressions because their
2183 values cannot be invalidated.
2184 * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
2186 (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
2187 * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
2189 2017-04-25 Bob Duff <duff@adacore.com>
2191 * sem_elab.adb (In_Task_Activation): Trace internal calls in
2194 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2196 * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
2199 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2201 * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
2202 On/Off to defend against a spurious warning in conditional
2204 * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
2205 * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
2206 defend against a spurious warning in conditional compilation.
2207 * output.adb Add a pair of pragma Warnings On/Off to defend
2208 against a spurious warning in conditional compilation.
2209 * sem_eval.adb (Eval_Relational_Op): Major code clean up.
2210 (Fold_General_Op): New routine.
2211 (Fold_Static_Real_Op): New routine.
2212 (Test_Comparison): New routine.
2213 * sem_eval.ads (Test_Comparison): New routine.
2214 * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
2215 (Warn_On_Constant_Valid_Condition): New routine.
2216 (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
2217 to detect a specific case.
2218 * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
2219 * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
2220 to defend against a spurious warning in conditional compilation.
2221 (Tree_Write): Add a pair of pragma Warnings On/Off to defend
2222 against a spurious warning in conditional compilation.
2223 * usage.adb Add a pair of pragma Warnings On/Off to defend
2224 against a spurious warning in conditional compilation.
2226 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2228 * sinfo.ads, sem_ch13.adb: Update comment.
2230 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2232 * sem_util.adb (Is_Post_State): A reference to a
2233 generic in out parameter is considered a change in the post-state
2236 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2238 * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
2239 declaration of a subprogram instance within its wrapper package,
2240 skip over null statements that may result from the rewriting of
2243 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2245 * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
2246 If the type is an unchecked_union, replace the attribute with
2247 a Raise_Program_Error (rather than inserting such before the
2248 attribute reference) to handle properly the case where we are
2249 processing a component of a larger record, and we need to prevent
2250 further expansion for the unchecked union.
2251 (Expand_Attribute_Reference, case 'Write): If the type is
2252 an unchecked_union, check whether enclosing scope is a Write
2253 subprogram. Replace attribute with a Raise_Program_Error if the
2254 discriminants of the unchecked_union type have not default values
2255 because such a use is erroneous..
2257 2017-04-25 Tristan Gingold <gingold@adacore.com>
2259 * exp_ch9.adb (Expand_N_Task_Type_Declaration):
2260 Add relative_deadline to task record on edf profile.
2261 (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
2262 (Make_Task_Create_Call): Pass relative_deadline value.
2263 * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
2264 * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
2265 (Profile_Info): Add info for GNAT_Ravenscar_EDF.
2266 * sem_prag.adb (Set_Ravenscar_Profile): Handle
2267 GNAT_Ravenscar_EDF (set scheduling policy).
2268 (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
2270 (Sig_Flags): Add choice for Pragma_Deadline_Floor.
2271 * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
2273 (Pragma_Deadline_Floor): New pragma.
2274 * targparm.adb (Get_Target_Parameters): Recognize
2275 GNAT_Ravenscar_EDF profile.
2277 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2279 * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
2281 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2283 * sem_aux.adb (Nearest_Ancestor): Use original node of type
2284 declaration to locate nearest ancestor, because derived
2285 type declarations for record types are rewritten as record
2287 * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
2288 properly derivations that are completions of private types.
2289 (Add_Predicates): If type is private, examine rep. items of full
2290 view, which may include inherited predicates.
2291 (Build_Predicate_Functions): Ditto.
2293 2017-04-25 Javier Miranda <miranda@adacore.com>
2295 * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
2296 to generate new entities for subtype declarations located in
2297 Expression_With_Action nodes.
2299 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2301 * sem_elab.adb (Check_A_Call): Remove
2302 local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
2303 need for Elaborate_All when SPARK elaboration checks are
2304 required. Update the checks for instances, variables, and calls
2305 to Default_Initial_Condition procedures.
2307 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2309 * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
2310 into a boolean aspect, in analogy with the Ada aspect No_Return.
2312 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2314 * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
2316 2017-04-25 Bob Duff <duff@adacore.com>
2318 * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
2319 Is_True_Constant for an array variable that is passed to a
2320 foreign function as an 'in' parameter.
2321 * debug.adb: Document -gnatd.q.
2323 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2325 * sem_ch6.adb (Analyze_Expression_Function): If expression function
2326 is completion and return type is an access type do not freeze
2327 designated type: this will be done in the process of freezing
2328 the expression if needed.
2329 (Freeze_Expr_Types): Check whether type is complete before
2330 creating freeze node, to provide a better error message if
2331 reference is premature.
2332 * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
2333 functions created by type derivations.
2335 2017-04-25 Pascal Obry <obry@adacore.com>
2337 * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
2339 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2341 * sem_res.adb (Resolve_Type_Conversion):
2342 When resolving against any fixed type, set the type of the
2343 operand as universal real when the operand is a multiplication
2344 or a division where both operands are of any fixed type.
2345 (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
2346 placement of an error message by pointing to the operand of a
2347 type conversion rather than the conversion itself.
2349 2017-04-25 Thomas Quinot <quinot@adacore.com>
2351 * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
2352 Needs_Debug_Info when producing SCOs.
2354 2017-04-25 Thomas Quinot <quinot@adacore.com>
2356 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
2357 Always pass a null finalization master for a library level named access
2358 type to which a pragme No_Heap_Finalization applies.
2360 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2364 * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
2365 set to A'First(2) and vice versa.
2367 2017-04-25 Yannick Moy <moy@adacore.com>
2369 * freeze.adb (Freeze_Record_Type): Remove obsolete
2370 rule on volatile tagged record restriction on SPARK code.
2372 2017-04-25 Yannick Moy <moy@adacore.com>
2374 * sem_prag.adb (minor) Fix SPARK RM reference.
2376 2017-04-25 Yannick Moy <moy@adacore.com>
2378 * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
2379 comment to reflect which entity is chosen as unique entity.
2380 (Unique_Entity): Return full view instead of private spec for
2381 protected type or task type. Fix possible incorrect access when
2384 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2386 * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
2387 array types only instead of all packed array types.
2389 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2391 * sem_ch6.adb (Conforming_Types): If type of formal as a specified
2392 dimension system, verify that dimensions of both match.
2393 (Check_Conformance): Add error message in case of dimension
2395 * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
2398 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
2400 * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
2403 2017-04-25 Yannick Moy <moy@adacore.com>
2405 * sem_util.adb: Minor refactoring.
2406 * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
2408 2017-04-25 Claire Dross <dross@adacore.com>
2410 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
2411 ultimate alias when accessing overridden operation. Indeed, if the
2412 overridden operation is itself inherited, it won't have any explicit
2415 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2417 * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
2418 overlap if the two formals have different types, because formally
2419 the corresponding actuals cannot designate the same objects.
2421 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2423 * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
2424 dimensions are present from context, use them. b) If operand is
2425 a static constant rewritten as a literal, obtain the dimensions
2426 from the original declaration, otherwise use dimensions of type
2427 established from context.
2429 2017-04-25 Yannick Moy <moy@adacore.com>
2431 * sem_util.adb (Is_Effectively_Volatile): Protect against base type
2432 of array that is private.
2434 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2436 * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
2439 2017-04-25 Yannick Moy <moy@adacore.com>
2441 * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
2444 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2446 * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
2447 the check that recognizes a call to a private overridding and
2448 replaces the called subprogram with its alias.
2450 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2452 * exp_util.adb: Minor reformatting.
2454 2017-04-25 Justin Squirek <squirek@adacore.com>
2456 * exp_ch3.adb (Freeze_Type): Add condition to always treat
2457 interface types as a partial view of a private type for the
2458 generation of invariant procedure bodies.
2459 * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
2460 Add a condition to get the Corresponding_Record_Type for
2461 concurrent types, add condition to return in the absence of a
2462 class in the pragma, remove call to Replace_Type_References,
2463 and add call to Replace_References.
2464 (Add_Interface_Invariatns),
2465 (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
2466 to including the working type T.
2467 (Add_Own_Invariants): Remove
2468 legacy condition for separate units, remove dispatching for ASIS
2469 and save a copy of the expression in the pragma expression.
2470 (Build_Invariant_Procedure_Body): Default initalize vars,
2471 remove return condition on interfaces, always use the
2472 private type for interfaces, and move the processing of types
2473 until after the processing of invariants for the full view.
2474 (Build_Invariant_Procedure_Declaration): Remove condition
2475 to return if an interface type is encountered and add
2476 condition to convert the formal parameter to its class-wide
2477 counterpart if Work_Typ is abstract.
2478 (Replace_Type): Add call to Remove_Controlling_Arguments.
2479 (Replace_Type_Ref): Remove class-wide dispatching for the current
2480 instance of the type.
2481 (Replace_Type_References): Remove parameter "Derived"
2482 (Remove_Controlling_Arguments): Created in order to removing
2483 the controlliong argument from calls to primitives in the case
2484 of the formal parameter being an class-wide abstract type.
2485 * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
2486 to the change made to Freeze_Type in exp_ch3. Add a condition
2487 to treat interface types as a partial view.
2488 * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
2489 to Build_Invariant_Procedure_Declaration to properly generate a
2490 "partial" invariant procedure when Typ is an interface.
2492 2017-04-25 Bob Duff <duff@adacore.com>
2494 * a-numeri.ads: Go back to using brackets encoding for the Greek
2497 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2499 * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
2500 (10-15): if derived type T with progenitors is abstract,
2501 and primitive P of this type inherits non-trivial classwide
2502 preconditions from both a parent operation and from an interface
2503 operation, then the inherited operation is abstract if the parent
2504 operation is not null.
2505 * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
2506 with Covered_Interface_Op to yield the actual interface operation
2507 that is implemented by a given inherited operation.
2509 2017-04-25 Javier Miranda <miranda@adacore.com>
2511 * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
2512 and right operands after performing the validity checks. Required
2513 because validity checks may remove side effects from the operands.
2515 2017-04-25 Javier Miranda <miranda@adacore.com>
2517 * exp_attr.adb (Attribute_Unrestricted_Access):
2518 Do not disable implicit type conversion. Required to generate
2519 code that displaces the pointer to reference the secondary
2522 2017-04-25 Pascal Obry <obry@adacore.com>
2524 * prj-attr.adb, snames.ads-tmpl: Add package Install's
2525 Required_Artifacts attribute.
2527 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2529 * sem_util.adb (Same_Value): String literals are compile-time
2530 values, and comparing them must use Expr_Value_S.
2532 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2534 * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
2535 dereference is introduced for the object, and the object is
2536 overloaded, do not check whether it is aliased, because it may
2537 include an implicit dereference.
2538 * sem_type.adb (Disambiguate): If two interpretations are access
2539 attribute types with the same designated type keep either of
2540 them and do not report an ambiguity. A true ambiguity will be
2543 2017-04-25 Bob Duff <duff@adacore.com>
2545 * a-numeri.ads: Change the encoding of Greek letter Pi from
2546 brackets encoding to UTF-8. Use pragma Wide_Character_Encoding
2547 to indicate the encoding. We considered using a byte order mark
2548 (BOM), but that causes various trouble (misc software eats the
2549 BOM, if you have a patch with a BOM, then it's not at the start
2550 of the patch, so it's not a BOM, the BOM affects with-ing files,
2552 * scng.adb, s-wchcnv.adb: Minor.
2554 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2556 * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
2557 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2559 * sem_ch3.adb (Add_Internal_Interface_Entities): Move
2560 Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
2561 Improve error message on operations that inherit non-conforming
2562 classwide preconditions from ancestor and progenitor.
2563 * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
2564 moved here from sem_ch3.
2565 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
2566 check given in RM 6.1.1 (17) concerning renamings of overriding
2567 operations that inherits class-wide preconditions from ancestor
2570 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2572 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
2573 (Build_Adjust_Statements): Code cleanup.
2574 (Build_Finalizer): Update the initialization of
2576 (Build_Finalize_Statements): Code cleanup.
2577 (Build_Initialize_Statements): Code cleanup.
2578 (Make_Deep_Array_Body): Update the initialization of
2580 (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
2581 (Process_Object_Declaration): Generate a null exception handler only
2582 when exceptions are allowed.
2583 (Process_Transients_In_Scope): Update the initialization of
2585 * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
2587 * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
2588 restrictions when the handler is internally generated and the
2591 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2593 * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
2594 enforce legality rule on classwide preconditions inherited from
2595 both an ancestor and a progenitor (RM 6.1.1 (10-13).
2596 * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
2597 subprogram need not be dispatching if it appears in a precondition
2598 for an abstract or null subprogram.
2600 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2602 * sem_ch10.adb: Minor typo fix.
2604 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2606 * gcc-interface/Makefile.in: Cleanup VxWorks targets.
2608 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2610 * fname.adb (Is_Internal_File_Name): Arrange for the slices to
2611 have a length which is a power of 2.
2612 (Is_Predefined_File_Name): Likewise. Adjust comment.
2614 2017-04-25 Bob Duff <duff@adacore.com>
2616 * exp_aggr.adb (Component_Count): Protect the
2617 arithmetic from attempting to convert a value >= 2**31 to Int,
2618 which would otherwise raise Constraint_Error.
2620 2017-04-25 Bob Duff <duff@adacore.com>
2622 * opt.ads (Locking_Policy): Fix incorrect documentation. The
2623 first character of the policy name is not unique.
2625 2017-04-25 Bob Duff <duff@adacore.com>
2627 * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
2628 * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
2629 about this flag not being used. It was already used, and it is
2632 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2634 * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
2635 (Ignore_SPARK_Mode_Pragmas): New routine.
2636 (Set_Ignore_SPARK_Mode_Pragmas): New routine.
2637 (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
2638 * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
2640 (Ignore_SPARK_Mode_Pragmas): New routine
2641 along with pragma Inline.
2642 (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
2643 * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
2644 Ignore_SPARK_Mode_Pragmas_In_Instance.
2645 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
2646 Save and restore the value of global flag
2647 Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
2648 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
2649 the corresponding spec or the body must ignore all SPARK_Mode
2650 pragmas found within.
2651 (Analyze_Subprogram_Declaration): Mark
2652 the spec when it needs to ignore all SPARK_Mode pragmas found
2653 within to allow the body to infer this property in case it is
2654 instantiated or inlined later.
2655 * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
2656 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2657 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2658 when the corresponding spec also ignored all SPARK_Mode pragmas
2660 (Analyze_Package_Declaration): Mark the spec when
2661 it needs to ignore all SPARK_Mode pragmas found within to allow
2662 the body to infer this property in case it is instantiated or
2664 * sem_ch12.adb (Analyze_Formal_Package_Declaration):
2665 Save and restore the value of flag
2666 Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2667 formal spec when it needs to ignore all SPARK_Mode
2668 pragmas found within to allow the body to infer this
2669 property in case it is instantiated or inlined later.
2670 (Analyze_Package_Instantiation): Save and restore the value
2671 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
2672 the instance spec when it needs to ignore all SPARK_Mode
2673 pragmas found within to allow the body to infer this
2674 property in case it is instantiated or inlined later.
2675 (Analyze_Subprogram_Instantiation): Save and restore the value
2676 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2677 instance spec and anonymous package when they need to ignore
2678 all SPARK_Mode pragmas found within to allow the body to infer
2679 this property in case it is instantiated or inlined later.
2680 (Instantiate_Package_Body): Save and restore the value of global
2681 flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
2682 global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
2683 corresponding instance spec also ignored all SPARK_Mode pragmas
2685 (Instantiate_Subprogram_Body): Save and restore the
2686 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2687 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2688 when the corresponding instance spec also ignored all SPARK_Mode
2689 pragmas found within.
2690 * sem_prag.adb (Analyze_Pragma): Update the reference to
2691 Ignore_Pragma_SPARK_Mode.
2692 * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
2693 all SPARK_Mode pragmas defined within yields mode "off".
2695 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2697 * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
2699 2017-04-25 Bob Duff <duff@adacore.com>
2701 * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
2702 All_Checks" to avoid generating unnecessary checks.
2703 * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
2705 * sem.ads: Fix comment.
2706 * expander.ads: Fix comment.
2707 * exp_atag.ads: Fix comment: "Index = 0" should be
2710 2017-04-25 Gary Dismukes <dismukes@adacore.com>
2712 * s-taprop-linux.adb: Minor editorial fixes.
2714 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2716 * sem_util.adb (New_Copy_Tree): Put back the declarations of the
2717 hash tables at library level. Reinstate the NCT_Hash_Tables_Used
2718 variable and set it to True whenever the main hash table is
2719 populated. Short- circuit the Assoc function if it is false
2720 and add associated guards.
2722 2017-04-25 Olivier Hainque <hainque@adacore.com>
2724 * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
2725 specs without elaboration code that have an elaboration counter
2726 nevertheless, e.g. when compiled with -fpreserve-control-flow.
2727 * sem_ch10.adb (Analyze_Compilation_Unit):
2728 Set_Elaboration_Entity_Required when requested to preserve
2729 control flow, to ensure the unit elaboration is materialized at
2730 bind time, resulting in the inclusion of the unit object file
2731 in the executable closure at link time.
2733 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
2735 * exp_dbug.adb: In Debug_Renaming_Declaration,
2736 when dealing with indexed component, accept to produce a renaming
2737 symbol when the index is an IN parameter or when it is a name
2738 defined in an outer scope.
2740 2017-04-25 Yannick Moy <moy@adacore.com>
2742 * errout.adb (Error_Msg): Adapt continuation
2743 message in instantiations and inlined bodies for info messages.
2745 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
2747 * fname.adb (Has_Internal_Extension): Add pragma Inline.
2748 Use direct 4-character slice comparisons.
2750 pragma Inline. (Has_Suffix): Delete.
2751 (Is_Internal_File_Name):
2752 Test Is_Predefined_File_Name first.
2753 (Is_Predefined_File_Name):
2754 Use direct slice comparisons as much as possible and limit all
2755 comparisons to at most 8 characters.
2757 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2759 * checks.adb (Insert_Valid_Check): Code cleanup.
2760 * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
2761 (Expand_Actuals): Generate proper copy-back for a validation
2762 variable when it acts as the argument of a type conversion.
2763 * sem_util.adb (Is_Validation_Variable_Reference): Augment the
2764 predicate to operate on type qualifications.
2766 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2768 * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
2771 2017-04-25 Bob Duff <duff@adacore.com>
2773 * sem_prag.adb (No_Return): Give an error if the pragma applies
2774 to a body. Specialize the error for the specless body case,
2775 as is done for (e.g.) pragma Convention.
2776 * debug.adb: Add switch -gnatd.J to disable the above legality
2777 checks. This is mainly for use in our test suite, to avoid
2778 rewriting a lot of illegal (but working) code. It might also
2779 be useful to customers. Under this switch, if a pragma No_Return
2780 applies to a body, and the procedure raises an exception (as it
2781 should), the pragma has no effect. If the procedure does return,
2782 execution is erroneous.
2784 2017-04-25 Bob Duff <duff@adacore.com>
2786 * exp_ch6.adb (Expand_Actuals): This is the
2787 root of the problem. It took N as an 'in out' parameter, and in
2788 some cases, rewrote N, but then set N to Original_Node(N). So
2789 the node returned in N had no Parent. The caller continued
2790 processing of this orphaned node. In some cases that caused a
2791 crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
2792 and trips over the Empty Parent). The solution is to make N an
2793 'in' parameter. Instead of rewriting it, return the list of
2794 post-call actions, so the caller can do the rewriting later,
2795 after N has been fully processed.
2796 (Expand_Call_Helper): Move most of Expand_Call here. It has
2797 too many premature 'return' statements, and we want to do the
2798 rewriting on return.
2799 (Insert_Post_Call_Actions): New procedure to insert the post-call
2800 actions in the appropriate place. In the problematic case,
2801 that involves rewriting N as an Expression_With_Actions.
2802 (Expand_Call): Call the new procedures Expand_Call_Helper and
2803 Insert_Post_Call_Actions.
2805 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2807 * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
2808 properly type derived from generic formal types, to handle
2809 properly modified version of ACATS 4.1B B611017.
2811 2017-04-25 Javier Miranda <miranda@adacore.com>
2813 * exp_unst.adb (Subp_Index): Adding missing
2814 support for renamings and functions that return a constrained
2815 array type (i.e. functions for which the frontend built a
2816 procedure with an extra out parameter).
2818 2017-04-25 Pascal Obry <obry@adacore.com>
2820 * s-string.adb: Minor code clean-up.
2822 2017-04-25 Bob Duff <duff@adacore.com>
2824 * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
2826 * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
2827 function for Non_Blocking_Wait_Process.
2829 2017-04-25 Bob Duff <duff@adacore.com>
2831 * prep.adb (Preprocess): Remove incorrect
2832 Assert. Current character can be ASCII.CR.
2834 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2836 * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
2837 convention Stdcall, which has a number of exceptions. Convention
2838 is legal on a component declaration whose type is an anonymous
2839 access to subprogram.
2841 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2843 * sem_ch4.adb: sem_ch4.adb Various reformattings.
2844 (Try_One_Prefix_Interpretation): Use the base type when dealing
2845 with a subtype created for purposes of constraining a private
2846 type with discriminants.
2848 2017-04-25 Javier Miranda <miranda@adacore.com>
2850 * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
2851 * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
2852 dispatching primitives (Restore_Warnings): Restore warning on
2853 late dispatching primitives (Save_Warnings): Save warning on late
2854 dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
2855 to enable/disable this warning.
2856 (WA_Warnings): Set warning on late dispatching primitives.
2857 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
2858 that its parent type has a private extension.
2859 * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
2861 * usage.adb: Document -gnatw.j and -gnatw.J.
2863 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2865 * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
2868 2017-04-25 Bob Duff <duff@adacore.com>
2870 * binde.adb (Validate): Do not pass dynamic strings
2871 to pragma Assert, because older compilers do not support that.
2873 2017-04-25 Bob Duff <duff@adacore.com>
2875 * s-fileio.adb (Close): When a temp file is
2876 closed, delete it and clean up its Temp_File_Record immediately,
2877 rather than waiting until later.
2878 (Temp_File_Record): Add File
2879 component, so Close can know which Temp_File_Record corresponds
2880 to the file being closed.
2881 (Delete): Don't delete temp files,
2882 because they are deleted by Close.
2883 (Open): Set the File component
2884 of Temp_File_Record. This requires moving the creation of the
2885 Temp_File_Record to the end, after the AFCB has been created.
2887 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2889 * checks.adb (Insert_Valid_Check): Do not generate
2890 a validity check when inside a generic.
2892 2017-04-25 Yannick Moy <moy@adacore.com>
2894 * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
2896 2017-04-25 Arnaud Charlet <charlet@adacore.com>
2898 * snames.ads-tmpl (Snames): More names for detecting predefined
2899 potentially blocking subprograms.
2901 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2903 * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
2904 concerning inheritance of class-wide preconditions do not apply
2907 2017-04-25 Bob Duff <duff@adacore.com>
2909 * s-ficobl.ads: Minor comment fix.
2911 2017-04-25 Yannick Moy <moy@adacore.com>
2913 * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
2914 conversions from float to integer in GNATprove mode.
2915 (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
2916 to call Apply_Type_Conversion_Checks, so that range checks
2917 are properly positioned when needed on conversions, including
2918 when converting from float to integer. (Determine_Range): In
2919 GNATprove mode, take into account the possibility of conversion
2920 from float to integer.
2921 * sem_res.adb (Resolve_Type_Conversion): Only enforce range
2922 check on conversions from fixed-point to integer, not anymore
2923 on conversions from floating-point to integer, when in GNATprove
2926 2017-04-25 Yannick Moy <moy@adacore.com>
2928 * checks.adb (Determine_Range_R): Special case type conversions
2929 from integer to float in order to get bounds in that case too.
2930 * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
2931 mode, for computations involved in interval checking.
2933 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2935 * checks.adb (Insert_Valid_Check): Partially reimplement validity
2937 * einfo.adb Node36 is now used as Validated_Object.
2938 (Validated_Object): New routine.
2939 (Set_Validated_Object): New routine.
2940 (Write_Field36_Name): Add an entry for Validated_Object.
2941 * einfo.ads Add new attribute Validated_Object along with
2943 (Validated_Object): New routine along with pragma Inline.
2944 (Set_Validated_Object): New routine along with pragma Inline.
2945 * exp_attr.adb (Make_Range_Test): Add processing for validation
2946 variables to avoid extra reads and copies of the prefix.
2947 * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
2948 variables in order to reflect any changes done in the variable
2949 back into the original object.
2950 * sem_util.adb (Is_Validation_Variable_Reference): New routine.
2951 * sem_util.ads (Is_Validation_Variable_Reference): New routine.
2953 2017-04-25 Steve Baird <baird@adacore.com>
2955 * exp_ch7.adb (Build_Array_Deep_Procs,
2956 Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
2957 generate Finalize_Address routines for CodePeer.
2959 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2961 * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
2962 Analyze_Pre_Post_Condition, to implement the legality checks
2963 mandated by AI12-0131: Pre'Class shall not be specified for an
2964 overriding primitive subprogram of a tagged type T unless the
2965 Pre'Class aspect is specified for the corresponding primitive
2966 subprogram of some ancestor of T.
2968 2017-04-25 Bob Duff <duff@adacore.com>
2970 * sem_ch8.adb (Use_One_Type): If a use_type_clause
2971 is redundant, set its Used_Operations to empty. This is only
2972 necessary for use clauses that appear in the parent of a generic
2973 child unit, because those use clauses get reanalyzed when we
2974 instantiate the generic, and we don't want the Used_Operations
2975 carried over from the original context (where it was probably
2978 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
2980 * exp_ch6.adb: Minor reformatting.
2982 2017-04-25 Bob Duff <duff@adacore.com>
2984 * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
2985 Use Source_Index (Current_Sem_Unit) to find the correct casing.
2986 * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
2987 (Current_Sem_Unit) to find the correct casing.
2988 * par.adb (Par): Null out Current_Source_File, to ensure that
2989 the above bugs won't rear their ugly heads again.
2991 2017-04-25 Ed Schonberg <schonberg@adacore.com>
2993 * sem_ch8.adb (Find_Type): For an attribute reference
2994 'Class, if prefix type is synchronized and previous errors
2995 have suppressed the creation of the corresponding record type,
2996 create a spurious class-wide for the synchonized type itself,
2997 to catch other misuses of the attribute
2999 2017-04-25 Steve Baird <baird@adacore.com>
3001 * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
3002 is True, then don't generate the accessibility check for the
3003 tag of a tagged result.
3004 * exp_intr.adb (Expand_Dispatching_Constructor_Call):
3005 if CodePeer_Mode is True, then don't generate the
3006 tag checks for the result of call to an instance of
3007 Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
3008 descendant of" check and the accessibility check).
3010 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3012 * sem_ch13.adb: Code cleanups.
3013 * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
3014 * sem_ch8.ads: Minor comment fix.
3016 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3018 * exp_ch4.adb (Library_Level_Target): New function.
3019 (Expand_Concatenate): When optimization is enabled, also expand
3020 the operation out-of-line if the concatenation is present within
3021 the expression of the declaration of a library-level object and
3022 not only if it is the expression of the declaration.
3024 2017-04-25 Bob Duff <duff@adacore.com>
3026 * freeze.adb (Freeze_Object_Declaration): Do
3027 not Remove_Side_Effects if there is a pragma Linker_Section,
3028 because in that case we want static initialization in the
3029 appropriate section.
3031 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3033 * exp_dbug.adb: Minor rewording and reformatting.
3035 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3037 * sem_attr.adb (Statically_Denotes_Object): New predicate, to
3038 handle the proposed changes to rules concerning potentially
3039 unevaluated expressions, to include selected components that
3040 do not depend on discriminants, and indexed components with
3042 * sem_util.adb (Is_Potentially_Unevaluated): Add check for
3043 predicate in quantified expression, and fix bugs in the handling
3044 of case expressions and membership test.
3045 (Analyze_Attribute_Old_Result): use new predicate.
3046 (Analyze_Attribute, case Loop_Entry): ditto.
3048 2017-04-25 Bob Duff <duff@adacore.com>
3050 * s-secsta.adb (SS_Info): Add a comment
3051 explaining why we don't need to walk all the chunks in order to
3052 compute the total size.
3054 2017-04-25 Bob Duff <duff@adacore.com>
3056 * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
3057 of the global name buffer to 4*Max_Line_Length.
3059 2017-04-25 Javier Miranda <miranda@adacore.com>
3061 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
3062 renaming entity for debug information, mark the entity as needing debug
3063 info if it comes from sources.
3065 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3067 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
3068 restriction converning the use of 'Address where the prefix is
3069 of a controlled type.
3071 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
3073 * exp_dbug.adb: In Debug_Renaming_Declaration,
3074 skip slices that are made redundant by an indexed component
3076 * atree.h: New definition for Original_Node.
3078 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3080 * sem_prag.adb, sem_prag.ads: Minor reformatting.
3082 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3084 * sem_ch3.adb (Check_Entry_Contract): Call
3085 Preanalyze_Spec_Expression so that resolution takes place as well.
3086 * sem_util.adb (Check_Internal_Protected_Use): Reject properly
3087 internal calls that appear in preconditions of protected
3088 operations, in default values for same, and in contract guards
3089 for contract cases in SPARK.
3091 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3093 * a-numaux.ads: Fix description of a-numaux-darwin
3095 (Double): Define to Long_Float.
3096 * a-numaux-vxworks.ads (Double): Likewise.
3097 * a-numaux-darwin.ads
3099 * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
3100 * a-numaux-x86.ads: Fix package description.
3101 * a-numaux-x86.adb (Is_Nan): Minor tweak.
3102 (Reduce): Adjust and complete description. Call Is_Nan instead of
3103 testing manually. Use an integer temporary to hold rounded value.
3104 * a-numaux-darwin.adb (Reduce): Likewise.
3105 (Is_Nan): New function.
3107 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3109 * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
3110 on analysis of prefix whose type is a current instance of a
3111 synchronized type, but where the prefix itself is an entity that
3114 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3116 * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
3117 the identity of callable entities therein, because they have been
3118 properly resolved, and prefixed calls may have been rewritten
3121 2017-04-25 Patrick Bernardi <bernardi@adacore.com>
3123 * exp_ch3.adb (Build_Init_Statements): Convert
3124 the expression of the pragma/aspect Secondary_Stack_Size to
3125 internal type System.Parameters.Size_Type before assigning
3126 it to the Secondary_Stack_Size component of the task type's
3127 corresponding record.
3129 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3131 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
3132 (etc) optimizations when the type is modular and the offsets
3135 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
3137 * s-osinte-freebsd.ads: Minor comment tweaks
3139 2017-04-25 Javier Miranda <miranda@adacore.com>
3141 * urealp.adb (UR_Write): Reverse previous patch
3142 adding documentation on why we generate multiplications instead
3143 of divisions (needed to avoid expressions whose computation with
3144 large numbers may cause division by 0).
3146 2017-04-25 Bob Duff <duff@adacore.com>
3148 * erroutc.adb (Set_Specific_Warning_Off,
3149 Set_Warnings_Mode_Off): Use the correct source file for
3150 Stop. Was using Current_Source_File, which is only valid during
3151 parsing. Current_Source_File will have a leftover value from
3152 whatever file happened to be parsed last, because of a with_clause
3155 2017-04-25 Bob Duff <duff@adacore.com>
3157 * lib.ads, lib.adb (In_Internal_Unit): New functions similar
3158 to In_Predefined_Unit, but including GNAT units.
3159 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
3160 with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
3161 because Should_Ignore_Pragma was not working reliably outside
3162 the parser, because Current_Source_File is not valid.
3163 * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
3164 * par-prag.adb: Call Should_Ignore_Pragma_Par.
3166 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3168 * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
3171 2017-04-25 Javier Miranda <miranda@adacore.com>
3173 * urealp.adb (UR_Write): Fix output of constants with a base other
3176 2017-04-25 Justin Squirek <squirek@adacore.com>
3178 * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
3179 * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
3180 Add extra parameter for Process_Interface_Name.
3181 (Process_Interface_Name): Add parameter for pragma to analyze
3182 corresponding aspect.
3183 * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
3186 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3188 * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
3191 2017-04-25 Yannick Moy <moy@adacore.com>
3193 * sem_res.adb (Resolve_Comparison_Op): Do not
3194 attempt evaluation of relational operations inside assertions.
3196 2017-04-25 Justin Squirek <squirek@adacore.com>
3198 * exp_util.adb (Add_Interface_Invariants):
3199 Restored, code moved back from Build_Invariant_Procedure_Body.
3200 (Add_Parent_Invariants): Restored, code moved back from
3201 Build_Invariant_Procedure_Body.
3202 (Build_Invariant_Procedure_Body):
3203 Remove refactored calls and integrated code from
3204 Add_Parent_Invariants and Add_Interface_Invariants.
3206 2017-04-25 Johannes Kanig <kanig@adacore.com>
3208 * errout.adb (Output_Messages): Adjust computation of total
3210 * erroutc.adb (Error_Msg): In statistics counts, deal
3211 correctly with informational messages that are not warnings.
3212 * errutil.adb (Finalize): adjust computation of total errors.
3214 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3216 * terminals.c (__gnat_terminate_pid): New.
3217 * g-exptty.ads (Terminate_Process): New. Update comments.
3219 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3221 * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
3223 2017-04-25 Justin Squirek <squirek@adacore.com>
3225 * sem_ch3.adb (Analyze_Declarations): Minor
3226 correction to comments, move out large conditional and scope
3227 traversal into a predicate.
3228 (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
3231 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3233 * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
3234 of prefix whose type is a current instance of a synchronized
3235 type. If the prefix is an object this is an external call (or
3236 requeue) that can only access public operations of the object. The
3237 previous predicate was too restrictive, and did not allow public
3238 protected operations, only task entries.
3240 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3242 * sem_ch5.adb, fname.adb: Minor reformatting.
3244 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3246 * einfo.adb (Is_Anonymous_Access_Type): New routine.
3247 * einfo.ads Update the placement of
3248 E_Anonymous_Access_Subprogram_Type along with all subtypes that
3250 (Is_Anonymous_Access_Type): New routine.
3251 * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
3252 master for an access type subject to pragma No_Heap_Finalization.
3253 * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
3254 allocated or deallocated does not finalization actions if the
3255 associated access type is subject to pragma No_Heap_Finalization.
3256 * opt.ads Add new global variable No_Heap_Finalization_Pragma.
3257 * par-prag.adb Pragma No_Heap_Finalization does not need special
3258 processing from the parser.
3259 * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
3260 ??? comments. Use the new predicate Is_Anonymous_Access_Type.
3261 * sem_prag.adb Add an entry in table Sig_Flags for pragma
3262 No_Heap_Finalization.
3263 (Analyze_Pragma): Add processing for
3264 pragma No_Heap_Finalization. Update various error messages to
3265 use Duplication_Error.
3266 * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
3267 * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
3268 and corresponding pragma id.
3270 2017-04-25 Bob Duff <duff@adacore.com>
3272 * freeze.adb (Freeze_Record_Type): Use the
3273 underlying type of the component type to determine whether it's
3274 elementary. For representation clause purposes, a private type
3275 should behave the same as its full type.
3276 * fname.ads, fname.adb (Is_Predefined_File_Name):
3277 Make sure things like "system.ali" are recognized as predefined.
3279 2017-04-25 Javier Miranda <miranda@adacore.com>
3281 * debug.adb: Update documentation of -gnatd.6.
3283 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3285 * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
3286 element iterator when the name is an overloaded function call,
3287 one of whose interpretations yields an array.
3289 2017-04-25 Bob Duff <duff@adacore.com>
3291 * uname.ads, uname.adb (Is_Predefined_Unit_Name,
3292 Is_Internal_Unit_Name): New functions for operating on unit
3293 names, as opposed to file names. There's some duplicated code
3294 with fname.adb, which is unfortunate, but it seems like we don't
3295 want to add dependencies here.
3296 * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
3297 to Is_Predefined_Unit_Name; the former was wrong, because Uname
3298 is not a file name at all.
3299 * fname.ads, fname.adb: Document the fact that
3300 Is_Predefined_File_Name and Is_Internal_File_Name can be called
3301 for ALI files, and fix the code so it works properly for ALI
3302 files. E.g. these should return True for "system.ali".
3304 2017-04-25 Justin Squirek <squirek@adacore.com>
3306 * exp_util.adb (Add_Invariant): Removed,
3307 code moved to Add_Invariant_Check, Add_Inherited_Invariant,
3308 and Add_Own_Invariant. (Add_Invariant_Check): Used
3309 for adding runtime checks from any kind of invariant.
3310 (Add_Inherited_Invariant): Generates invariant checks for
3311 class-wide invariants (Add_Interface_Invariants): Removed, code
3312 moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
3313 Create a types own invariant procedure (Add_Parent_Invariants):
3314 Removed, code moved to Build_Invariant_Procedure_Body
3315 (Build_Invariant_Procedure_Body): Add refactored calls
3316 and integrated code from Add_Parent_Invariants and
3317 Add_Interface_Invariants.
3318 (Process_Type): Removed, the
3319 relavant code was inlined into both Add_Own_Invariant and
3320 Add_Inherited_Invariant.
3322 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3324 * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
3325 scn.adb, osint.adb, fname.adb: Minor reformatting.
3327 2017-04-25 Pascal Obry <obry@adacore.com>
3329 * s-taprop-mingw.adb: Do not check for CloseHandle in
3332 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3334 * sem_util.adb (Check_Part_Of_Reference):
3335 Continue to examine the context if the reference appears within
3336 an expression function.
3338 2017-04-25 Justin Squirek <squirek@adacore.com>
3340 * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
3341 and Build_Invariant_Procedure_Declaration.
3342 * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
3343 and Build_Invariant_Procedure_Declaration from exp_ch7
3344 and break-out Is_Untagged_Private_Derivation from
3345 Build_Invariant_Procedure_Body.
3346 (Replace_Type_References):
3347 Append an extra parameter to allow for dispatching replacements
3348 and add the corrasponding logic.
3349 (Type_Invariant): Remove
3350 Replace_Typ_Refs and replace its references with calls to
3351 Replace_Type_References.
3352 * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
3354 2017-04-25 Bob Duff <duff@adacore.com>
3356 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
3357 that returns True when appropriate.
3358 * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
3359 when compiling predefined files.
3360 * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
3361 "gnat.adc" should not be considered a predefined file name.
3362 That required (or at least encouraged) a lot of cleanup of global
3363 variable usage. We shouldn't be communicating information via
3364 the global name buffer.
3365 * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
3366 * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
3367 required by the above-mentioned cleanup.
3369 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3371 * osint.adb (Find_File): Handle properly a request for a
3372 configuration file whose name is a directory.
3374 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3376 * sem_attr.adb, sem_ch5.adb: Minor reformatting.
3378 2017-04-25 Bob Duff <duff@adacore.com>
3380 * types.ads: Minor: Fix '???' comment.
3381 * sem_ch8.adb: Minor comment fix.
3383 2017-04-25 Bob Duff <duff@adacore.com>
3385 * sem_prag.adb: Remove suspicious uses of Name_Buf.
3386 * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
3387 Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
3388 Add String_To_Name with no side effects.
3390 2017-04-25 Justin Squirek <squirek@adacore.com>
3392 * sem_ch3.adb (Analyze_Declarations): Add
3393 additional condition for edge case.
3395 2017-04-25 Bob Duff <duff@adacore.com>
3397 * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
3398 reserved words inside pragmas. This is necessary to allow the
3399 pragma name Interface to be used in pragma Ignore_Pragma.
3400 * par.adb: Minor comment fix.
3402 2017-04-25 Javier Miranda <miranda@adacore.com>
3404 * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
3405 * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
3406 * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
3407 * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
3408 occurrences of RE_Type_Is_Abstract
3410 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3412 * exp_util.adb (Build_Chain): Account for ancestor
3413 subtypes while traversing the derivation chain.
3415 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3417 * sem_attr.adb: minor reformatting.
3419 2017-04-25 Doug Rupp <rupp@adacore.com>
3421 * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
3423 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3425 * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
3426 the first pass over an assignment statement with target names,
3427 to prevent the generation of subtypes (such as discriminated
3428 record components)that may carry the target name outside of the
3429 tree for the assignment. The subtypes will be generated when
3430 the assignment is reanalyzed in full.
3431 (Analyze_Target_Name): Handle properly class-wide types.
3433 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3435 * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
3436 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3437 the purposes of freezing.
3438 * exp_util.adb Update the documentation and structure of the
3439 type map used in class-wide semantics of assertion expressions.
3440 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3441 and resolve the triaged expression because all substitutions
3442 refer to the proper entities. Update the replacement of
3444 (Build_DIC_Procedure_Body): Add formal parameter
3445 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3446 are now only processed when freezing occurs. Build a body only
3448 (Entity_Hash): Removed.
3449 (Map_Types): New routine.
3450 (Replace_Object_And_Primitive_References): Removed.
3451 (Replace_References): New routine.
3452 (Replace_Type_References): Moved to the library level of Exp_Util.
3453 (Type_Map_Hash): New routine.
3454 (Update_Primitives_Mapping): Update the mapping call.
3455 (Update_Primitives_Mapping_Of_Types): Removed.
3456 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3457 parameter For_Freeze and update the comment on usage.
3458 (Map_Types): New routine.
3459 (Replace_References): New routine.
3460 (Replace_Type_References): Moved to the library level of Exp_Util.
3461 (Update_Primitives_Mapping_Of_Types): Removed.
3462 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3463 properties of the private type to the full view in case the full
3464 view derives from a parent type and inherits a DIC pragma.
3465 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3466 DIC pragma is placed at the top of a declarative region.
3468 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3470 * a-tasatt.adb: Complete previous change and use an unsigned
3471 int to avoid overflow checks.
3473 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3475 * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
3476 the error message when the attribute reference is an actual in
3477 a call to a subprogram inherited from a generic formal type with
3478 unknown discriminants, which makes the subprogram and its formal
3479 parameters intrinsic (see RM 6.3.1 (8) and (13)).
3481 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3483 * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
3484 sem_prag.adb: Minor reformatting.
3486 2017-04-25 Bob Duff <duff@adacore.com>
3488 * sem_attr.adb (Type_Key): Add code in the
3489 recursive Compute_Type_Key to protect against fetching the source
3490 code for Standard, in case a component of the type is declared
3491 in Standard. There was already code to do this for the original
3492 type, but not for its components.
3494 2017-04-25 Javier Miranda <miranda@adacore.com>
3496 * exp_ch3.adb (Build_Initialization_Call): Handle
3497 subtypes of private types when searching for the underlying full
3498 view of a private type.
3500 2017-04-25 Javier Miranda <miranda@adacore.com>
3502 * sem_res.adb (Set_Mixed_Mode_Operand): A universal
3503 real conditional expression can appear in a fixed-type context
3504 and must be resolved with that context to facilitate the code
3505 generation to the backend.
3507 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3509 * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
3510 to indicate whether during inline processing, when some unit U1
3511 appears in the context of a unit U2 compiled for instantiation
3512 or inlining purposes, the body of U1 needs to be compiled as well.
3513 * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
3514 context is a package declaration.
3515 * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
3516 Analyze_Generic_Package_Declaration): ditto.
3517 * inline.adb (Analyze_Inlined_Bodies): Check
3518 Body_Needed_For_Inlining.
3520 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3522 * par.adb (Current_Assign_Node): Global variable use to record
3523 the presence of a target_name in the right hand side of the
3524 assignment being parsed.
3525 * par-ch4.adb (P_Name): If the name is a target_name, mark the
3526 enclosing assignment node accordingly.
3527 * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
3529 * sem_ch5.adb (Analyze_Assignment): Disable expansion before
3530 analyzing RHS if the statement has target_names.
3531 * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
3532 properly choices that are subtype marks.
3533 * exp_ch5.adb: Code cleanup.
3535 2017-04-25 Bob Duff <duff@adacore.com>
3537 * s-memory.adb: Add a comment regarding efficiency.
3538 * atree.adb: Fix the assertion, and combine 2 assertions into one,
3539 "the source has an extension if and only if the destination does."
3540 * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
3542 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
3544 * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
3547 2017-04-25 Doug Rupp <rupp@adacore.com>
3549 * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
3550 handling for ppc64-vx7.
3551 * sigtramp-vxworks-target.inc
3552 [SIGTRAMP_BODY]: Add section for ppc64-vx7.
3554 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3556 * ada_get_targ.adb: New file.
3558 2017-04-25 Bob Duff <duff@adacore.com>
3560 * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
3561 Direct_Val (Right), instead of the incorrect Direct_Val (Left).
3562 (UI_GCD): Remove ??? comment involving possible efficiency
3563 improvements. This just isn't important after all these years.
3565 * uintp.ads: Minor cleanup.
3567 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3569 * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
3570 Revert previous changes.
3571 * scng.adb: Minor reformatting.
3572 * s-stratt.ads: Fix unbalanced parens in comment.
3574 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3576 * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
3579 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3581 * scng.adb (Scan): Handle '@' appropriately.
3582 * sem_ch5.adb: Code cleanup.
3584 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3586 * freeze.adb (Check_Expression_Function): Do not check for the
3587 use of deferred constants if the freezing of the expression
3588 function is triggered by its generated body, rather than a
3591 2017-04-25 Javier Miranda <miranda@adacore.com>
3593 * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
3594 subtypes of private types when performing the view conversion.
3596 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3598 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3599 the purposes of freezing.
3600 * exp_util.adb Update the documentation and structure of the
3601 type map used in class-wide semantics of assertion expressions.
3602 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3603 and resolve the triaged expression because all substitutions
3604 refer to the proper entities. Update the replacement of
3606 (Build_DIC_Procedure_Body): Add formal parameter
3607 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3608 are now only processed when freezing occurs. Build a body only
3610 (Entity_Hash): Removed.
3611 (Map_Types): New routine.
3612 (Replace_Object_And_Primitive_References): Removed.
3613 (Replace_References): New routine.
3614 (Replace_Type_References): Moved to the library level of Exp_Util.
3615 (Type_Map_Hash): New routine.
3616 (Update_Primitives_Mapping): Update the mapping call.
3617 (Update_Primitives_Mapping_Of_Types): Removed.
3618 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3619 parameter For_Freeze and update the comment on usage.
3620 (Map_Types): New routine.
3621 (Replace_References): New routine.
3622 (Replace_Type_References): Moved to the library level of Exp_Util.
3623 (Update_Primitives_Mapping_Of_Types): Removed.
3624 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3625 properties of the private type to the full view in case the full
3626 view derives from a parent type and inherits a DIC pragma.
3627 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3628 DIC pragma is placed at the top of a declarative region.
3630 2017-04-25 Tristan Gingold <gingold@adacore.com>
3632 * s-mmap.ads (Data): Add pragma Inline.
3634 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
3636 * checks.adb (Insert_Valid_Check): Do not use
3637 a renaming to alias a volatile name because this will lead to
3638 multiple evaluations of the volatile name. Use a constant to
3639 capture the value instead.
3641 2017-04-25 Doug Rupp <rupp@adacore.com>
3643 * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
3645 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3647 * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
3648 Add out parameter to indicate to caller that a wrapper must
3649 be constructed for an inherited primitive whose inherited
3650 pre/postcondition has called to overridden primitives.
3651 * freeze.adb (Check_Inherited_Conditions): Build wrapper body
3652 for inherited primitive that requires it.
3653 * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
3654 legal primitive operations and belong to the list of bodies
3655 generated after the freeze point of a type.
3656 * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
3657 of Build_Class_Wide_Expression.
3658 * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
3659 to construct the specification of the wrapper subprogram created
3660 for an inherited operation.
3662 2017-04-25 Bob Duff <duff@adacore.com>
3664 * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
3665 pthread_mutexattr_setprioceiling): Add new interfaces for these
3667 * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
3668 protocols as appropriate for Locking_Policy 'C' and 'I'.
3669 * s-taprop-posix.adb: Minor reformatting to make it more similar
3670 to s-taprop-linux.adb.
3672 2017-04-25 Ed Schonberg <schonberg@adacore.com>
3674 * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
3675 Handle properly a multi- level derivation involving both renamed
3676 and constrained parent discriminants, when the type to be
3677 constrained has fewer discriminants that the ultimate ancestor.
3679 2017-04-25 Bob Duff <duff@adacore.com>
3681 * sem_util.adb (Is_Object_Reference): In the
3682 case of N_Explicit_Dereference, return False if it came from a
3683 conditional expression.
3685 2017-04-25 Bob Duff <duff@adacore.com>
3687 * par-ch4.adb (P_Case_Expression): If a semicolon
3688 is followed by "when", assume that ";" was meant to be ",".
3690 2017-04-25 Gary Dismukes <dismukes@adacore.com>
3692 * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
3695 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3697 * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
3698 loading of an entity.
3699 * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
3700 previously repeated in the analysis.
3701 * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
3702 procedure SPARK_Implicit_Load. (Analyze_Task_Type_Declaration):
3703 use new procedure SPARK_Implicit_Load.
3704 * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
3705 SPARK_Implicit_Load.
3707 2017-04-25 Javier Miranda <miranda@adacore.com>
3709 * sem_util.adb (New_Copy_Tree): By default
3710 copying of defining identifiers is prohibited because
3711 this would introduce an entirely new entity into the
3712 tree. This patch introduces an exception to this general
3713 rule: the declaration of constants and variables located in
3714 Expression_With_Action nodes.
3715 (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
3716 (In_Map): New subprogram.
3717 (Visit_Entity): New subprogram.
3718 (Visit_Node): Handle EWA_Level,
3719 EWA_Inner_Scope_Level, and take care of defining entities defined
3720 in Expression_With_Action nodes.
3722 2017-04-25 Thomas Quinot <quinot@adacore.com>
3724 * exp_ch6.adb: minor comment edit.
3725 * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
3726 procedure specifications that come from source.
3727 * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
3728 Null_Statement attribute.
3729 * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
3730 procedure, generate statement SCO for the generated NULL statement.
3731 * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
3732 parser, if available.
3734 2017-04-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3736 * system-linux-s390.ads: Use Long_Integer'Size to define
3739 2017-04-04 Eric Botcazou <ebotcazou@adacore.com>
3741 * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
3743 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
3745 * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
3746 * g-socket.adb (To_Host_Entry): Fix typo in comment.
3747 * gnat_ugn.texi: Fix typo.
3748 * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
3749 * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
3750 * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
3751 * sem_util.adb (Mark_Coextensions): Likewise.
3752 * sem_util.ads (Available_Full_View_Of_Component): Likewise.
3754 2017-03-28 Andreas Schwab <schwab@suse.de>
3757 * system-linux-aarch64-ilp32.ads: New file.
3758 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
3759 from LIBGNAT_TARGET_PAIRS.
3760 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
3761 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
3762 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
3763 or -mabi=ilp32, resp.
3765 2017-03-14 James Cowgill <James.Cowgill@imgtec.com>
3767 * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
3769 2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
3772 * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
3774 2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
3777 * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
3779 * system-linux-arm.ads (Default_Bit_Order): Likewise.
3780 * system-linux-mips.ads (Default_Bit_Order): Likewise.
3781 * system-linux-armeb.ads: Delete.
3782 * system-linux-mipsel.ads: Likewise.
3783 * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
3784 (ARM/Linux): Likewise.
3786 2017-02-24 Jakub Jelinek <jakub@redhat.com>
3789 * gcc-interface/misc.c (gnat_handle_option): Pass true to
3790 handle_generated_option GENERATED_P.
3792 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3794 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
3795 around a justified modular type if it doesn't have the same scalar
3796 storage order as the enclosing record type.
3798 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3800 * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
3801 of boolean rvalues to function calls.
3803 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3805 * gcc-interface/utils.c (fold_bit_position): New function.
3806 (rest_of_record_type_compilation): Call it instead of bit_position to
3807 compute the field position and remove the call to remove_conversions.
3808 (compute_related_constant): Factor out the multiplication in both
3809 operands, if any, and streamline the final test.
3811 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3813 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
3815 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3817 * gcc-interface/decl.c: Include demangle.h.
3818 (is_cplusplus_method): Return again true for a primitive operation
3819 only if it is dispatching. For a subprogram with an interface name,
3820 call the demangler to get the number of C++ parameters and compare it
3821 with the number of Ada parameters.
3823 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3825 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
3826 there is no end label, put the location of the At_End procedure on
3827 the call to the procedure.
3829 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3831 * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
3832 value for array types with TYPE_INDEX_TYPE set on their domain type.
3833 * gcc-interface/utils.c (max_size): For operations and expressions, do
3834 not build a new node if the operands have not changed or are missing.
3836 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
3838 * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
3839 argument when recursing on TRUTH_NOT_EXPR.
3841 2017-02-12 John Marino <gnugcc@marino.st>
3843 * system-freebsd-x86.ads: Rename into...
3844 * system-freebsd.ads: ...this.
3845 (Default_Bit_Order): Define using Standard'Default_Bit_Order.
3846 * gcc-interface/Makefile.in: Support aarch64-freebsd.
3847 (x86-64/FreeBSD): Adjust to above renaming.
3848 (i386/FreeBSD): Likewise.
3850 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
3852 * comperr.adb: Update FSF bug reporting URL.
3854 2017-02-01 Eric Botcazou <ebotcazou@adacore.com>
3855 Jakub Jelinek <jakub@redhat.com>
3858 * adaint.c (__gnat_killprocesstree): Fix broken string handling.
3860 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
3863 * gcc-interface/utils.c (get_global_context): Pass main_input_filename
3864 to build_translation_unit_decl.
3866 2017-01-23 Javier Miranda <miranda@adacore.com>
3868 * sem_util.adb (New_Copy_Tree): Code cleanup:
3869 removal of the internal map (ie. variable Actual_Map, its
3870 associated local variables, and all the code handling it).
3871 * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
3872 force loading of the System package when processing a task type.
3873 (Analyze_Protected_Type_Declaration): in GNATprove mode force
3874 loading of the System package when processing a protected type.
3875 * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
3876 force loading of the System package when processing compilation
3877 unit with a main-like subprogram.
3878 * frontend.adb (Frontend): remove forced loading of the System
3881 2017-01-23 Ed Schonberg <schonberg@adacore.com>
3883 * sem_prag.adb (Default_Initial_Condition): If the desired type
3884 declaration is a derived type declaration with discriminants,
3885 it is rewritten as a private type declaration.
3886 * sem_ch13.adb (Replace_Type_References_Generic,
3887 Visible_Component): A discriminated private type with descriminnts
3888 has components that must be rewritten as selected components
3889 if they appear as identifiers in an aspect expression such as
3890 a Default_Initial_Condition.
3891 * sem_util.adb (Defining_Entity): support N_Iterator_Specification
3894 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3896 * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
3897 * gnat1drv.adb Generate an empty object file for an ignored
3898 Ghost compilation unit.
3899 * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
3901 2017-01-23 Yannick Moy <moy@adacore.com>
3903 * sem_ch4.adb (Analyze_Indexed_Component_Form):
3904 Adapt to inlined prefix with string literal subtype.
3905 * inline.adb (Expand_Inlined_Call): Keep unchecked
3906 conversion inside inlined call when formal type is constrained.
3908 2017-01-23 Javier Miranda <miranda@adacore.com>
3910 * sem_util.adb (New_Copy_Tree): Code cleanup:
3911 removal of global variables. All the global variables, global
3912 functions and tables of this subprogram are now declared locally.
3914 2017-01-23 Gary Dismukes <dismukes@adacore.com>
3916 * exp_strm.ads: Minor reformatting and typo fixes.
3918 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3920 * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
3921 exp_aggr.adb: Minor reformatting.
3922 * g-diopit.adb: minor grammar/punctuation fix in comment.
3923 * g-byorma.ads: minor fix of unbalanced parens in comment.
3925 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3927 * par.adb: Update the documentation of component Labl.
3928 * par-ch6.adb (P_Return_Statement): Set the expected label of
3929 an extended return statement to Error.
3931 2017-01-23 Tristan Gingold <gingold@adacore.com>
3933 * s-boustr.ads, s-boustr.adb (Is_Full): New function.
3935 2017-01-23 Ed Schonberg <schonberg@adacore.com>
3937 * expander.adb: Handle N_Delta_Aggregate.
3939 2017-01-23 Javier Miranda <miranda@adacore.com>
3941 * exp_ch6.adb (Expand_Call): Improve the code that
3942 checks if some formal of the called subprogram is a class-wide
3943 interface, to handle subtypes of class-wide interfaces.
3945 2017-01-23 Javier Miranda <miranda@adacore.com>
3947 * checks.adb (Apply_Parameter_Aliasing_Checks):
3948 Remove side effects of the actuals before generating the overlap
3951 2017-01-23 Justin Squirek <squirek@adacore.com>
3953 * exp_strm.ads, exp_strm.ads
3954 (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
3955 as to avoid getting the underlying type by default.
3956 * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
3957 underlying type in the Iiput and output attribute cases when
3958 building their respective functions.
3960 2017-01-23 Gary Dismukes <dismukes@adacore.com>
3962 * scng.adb: Minor reformatting of error message.
3964 2017-01-23 Ed Schonberg <schonberg@adacore.com>
3966 * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
3967 to freeze the return type of an expression funxtion that is a
3968 completion, if the type is a limited view and the non-limited
3971 2017-01-23 Ed Schonberg <schonberg@adacore.com>
3973 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
3974 aggregate construct.
3975 (P_Record_Or_Array_Component_Association): An array aggregate
3976 can start with an Iterated_Component_Association.
3977 * scng.adb: Modify error message on improper use of @ in earlier
3978 versions of the language.
3979 * sinfo.ads: New node kind N_Delta_Aggregate.
3980 * sinfo.adb: An N_Delta_Aggregate has component associations and
3982 * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
3983 * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
3984 Create a new index for each one of the choices in the association,
3985 to prevent spurious homonyms in the scope.
3986 (Resolve_Delta_Aggregate): New.
3987 * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
3988 * exp_util.adb (Insert_Actions): Take into account
3990 * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
3991 * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
3992 and local procedures Expand_Delta_Array_Aggregate and
3993 expand_Delta_Record_Aggregate.
3994 * sprint.adb: Handle N_Delta_Aggregate.
3996 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
3998 * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
3999 empty name when the exception declaration is subject to pragma
4001 (Null_String): New routine.
4003 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4005 * par-ch9.adb (P_Protected_Definition): Parse
4006 any optional and potentially illegal pragmas which appear in
4007 a protected operation declaration list.
4008 (P_Task_Items): Parse
4009 any optional and potentially illegal pragmas which appear in a
4012 2017-01-23 Pascal Obry <obry@adacore.com>
4014 * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
4015 is needed when a foreign thread call a Win32 API using a thread handle
4016 like GetThreadTimes() for example.
4018 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4020 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4021 allow an 'Address clause to be specified on a prefix of a
4024 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4026 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4027 attribute 'Valid is a renaming of the original expression when
4028 the expression denotes a name. For all other kinds of expression,
4029 use a constant to capture the value.
4030 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4031 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4033 2017-01-23 Justin Squirek <squirek@adacore.com>
4035 * sem_eval.adb (Eval_Integer_Literal): Add special
4036 case to avoid optimizing out check if the literal appears in
4039 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4041 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4042 allow an 'Address clause to be specified on a prefix of a
4045 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4047 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4048 attribute 'Valid is a renaming of the original expression when
4049 the expression denotes a name. For all other kinds of expression,
4050 use a constant to capture the value.
4051 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4052 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4054 2017-01-23 Justin Squirek <squirek@adacore.com>
4056 * sem_eval.adb (Eval_Integer_Literal): Add special
4057 case to avoid optimizing out check if the literal appears in
4060 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4062 * sem_ch4.adb (Try_Primitive_Operations,
4063 Is_Valid_First_Argument_Of): argument is valid if it is a derived
4064 type with unknown discriminants that matches its underlying
4066 * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
4067 expression if its type is derived from a limited type with
4068 unknown discriminants, because the expansion (which is a call)
4069 must be expanded in the enclosing context to add the proper build-
4070 in-place parameters to the call.
4071 * lib.ads, exp_ch9.adb: Minor fixes in comments.
4073 2017-01-23 Yannick Moy <moy@adacore.com>
4075 * frontend.adb (Frontend): Do not load runtime
4076 unit for GNATprove when parsing failed.
4077 * exp_ch9.adb: minor removal of extra whitespace
4078 * exp_ch6.adb: minor typo in comment
4079 * sem_util.adb: Code cleanup.
4080 * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
4081 * a-ngcefu.adb: minor style fix in whitespace
4083 2017-01-23 Thomas Quinot <quinot@adacore.com>
4085 * scos.ads: Document usage of 'd' as default SCO kind for
4087 * par_sco.adb (Traverse_Declarations_Or_Statements.
4088 Traverse_Degenerate_Subprogram): New supporting routine for expression
4089 functions and null procedures.
4090 (Traverse_Declarations_Or_Statements.Traverse_One): Add
4091 N_Expression_Function to the subprogram case; add required
4092 support for null procedures and expression functions.
4094 2017-01-23 Bob Duff <duff@adacore.com>
4096 * namet.ads (Bounded_String): Decrease the size of type
4097 Bounded_String to avoid running out of stack space.
4098 * namet.ads (Append): Don't ignore buffer overflow; raise
4099 Program_Error instead.
4101 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4103 * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
4104 sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
4106 * exp_ch9.adb: minor style fix in comment.
4108 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4110 * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
4111 for a limited record extension with unknown discriminants whose
4112 full view has no discriminants.
4114 2017-01-23 Yannick Moy <moy@adacore.com>
4116 * exp_spark.adb: Alphabetize with clauses.
4118 2017-01-23 Yannick Moy <moy@adacore.com>
4120 * sem_util.adb (Has_Enabled_Property): Treat
4121 protected objects and variables differently from other variables.
4123 2017-01-23 Thomas Quinot <quinot@adacore.com>
4125 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
4126 Split original Ada 95 part off into new subprogram
4127 below. Call that subprogram (instead of proceeding with
4128 AI95-0133 behaviour) if debug switch -gnatd.p is in use.
4129 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
4130 * debug.adb Document new switch -gnatd.p
4131 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
4132 record for reverse bit order if an error has already been posted
4133 on the record type. This avoids generating extraneous "info:"
4134 messages for illegal code.
4136 2017-01-23 Justin Squirek <squirek@adacore.com>
4138 * sem_ch3.adb (Analyze_Declarations): Correct comments
4139 * freeze.adb (Find_Constant): Add detection of deferred constants
4140 so they are not incorrectly flagged as premature.
4142 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4144 * scans.ads: New token At_Sign. Remove '@' from list of illegal
4145 characters for future version of the language. '@' is legal name.
4146 * scng.ads, scng.adb (Scan): Handle '@' appropriately.
4147 * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
4148 denotes a Target_Name.
4149 * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
4150 * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
4151 (Has_Target_Names): New flag on N_Assignment_Statement, to
4152 indicate that RHS has occurrences of N_Target_Name.
4153 * sem.adb: Call Analyze_Target_Name.
4154 * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
4155 (urrent_LHS): Global variable that denotes LHS of assignment,
4156 used in the analysis of Target_Name nodes.
4157 * sem_res.adb (Resolve_Target_Name): New procedure.
4158 * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
4159 N is an assignment statement whose RHS contains occurences of @
4160 that designate the value of the LHS of the assignment. If the
4161 LHS is side-effect free the target names can be replaced with
4162 a copy of the LHS; otherwise the semantics of the assignment
4163 is described in terms of a procedure with an in-out parameter,
4164 and expanded as such.
4165 (Expand_N_Assignment_Statement): Call
4166 Expand_Assign_With_Target_Names when needed.
4167 * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
4168 * sprint.adb: Handle N_Target_Name.
4170 2017-01-23 Eric Botcazou <ebotcazou@adacore.com>
4172 * checks.adb: Minor fix in comment.
4174 2017-01-23 Philippe Gil <gil@adacore.com>
4176 * g-debpoo.adb (Do_Report) remove freed chunks from chunks
4177 count in Sort = Memory_Usage or Allocations_Count
4179 2017-01-23 Justin Squirek <squirek@adacore.com>
4181 * sem_ch3.adb: Code cleanup.
4183 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4185 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
4186 variables to the local variable section. Update the profile
4187 of various nested routine that previously had visibility
4188 of those globals. One the matching phase has completed,
4189 remove certain classes of clauses which are considered noise.
4190 (Check_Dependency_Clause): Properly detect a match between two
4191 'Result attributes. Update the various post-match cases to use
4192 Is_Already_Matched as this routine now automatically recognizes
4193 a previously matched 'Result attribute.
4194 (Is_Already_Matched): New routine.
4195 (Remove_Extra_Clauses): New routine.
4196 (Report_Extra_Clauses): Remove the detection of ... => null
4197 clauses as this is now done in Remove_Extra_Clauses.
4199 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4201 * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
4202 report on spurious overlaps between values involving a subtype
4203 with a static predicate, because the expansion of such a subtype
4204 into individual ranges in inhibited in ASIS mode.
4206 2017-01-23 Justin Squirek <squirek@adacore.com>
4208 * sem_ch3.adb (Analyze_Declarations): Add detection
4209 of an edge case and delay freezing if it is present.
4211 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4213 * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
4214 sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
4216 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4218 * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
4219 access-to-subprogram types inherit the convention of the
4220 associated subprogram. (Set_Profile_Convention): New routine.
4221 * sem_ch6.adb (Check_Conformance): Do not compare the conventions
4222 of the two entities directly, use Conventions_Match to account
4223 for anonymous access-to-subprogram and subprogram types.
4224 (Conventions_Match): New routine.
4226 2017-01-23 Claire Dross <dross@adacore.com>
4228 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
4229 which return Universal_Integer, force the overflow check flag for
4230 Length and Range_Length for types as big as Long_Long_Integer.
4232 2017-01-23 Claire Dross <dross@adacore.com>
4234 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For
4235 attributes which return Universal_Integer, introduce a conversion
4236 to the expected type with the appropriate check flags set.
4237 * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
4238 base type if the range is null. It may still be invalid if it
4239 is higher than the lower bound. This is checked later in the
4240 context in which the range appears.
4242 2017-01-23 Pierre-Marie de Rodat <derodat@adacore.com>
4244 * scos.ads: Introduce a constant to represent ignored
4245 dependencies in SCO_Unit_Table_Entry.
4247 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
4249 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
4250 spaces from error messages.
4252 2017-01-23 Ed Schonberg <schonberg@adacore.com>
4254 * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
4255 subsidiary to Expand_N_Object_ Declaration, to compute a guard on
4256 an object declaration for an array type with a modular index type
4257 with the size of Long_Long_Integer. Special processing is needed
4258 in this case to compute reliably the size of the object, and
4259 eventually to raise Storage_Error, when wrap-around arithmetic
4260 might compute a meangingless size for the object.
4262 2017-01-23 Justin Squirek <squirek@adacore.com>
4264 * a-wtenau.adb, par-endh.adb, sem_prag.adb,
4265 sem_type.adb: Code cleanups.
4267 2017-01-23 Bob Duff <duff@adacore.com>
4269 * sem_res.adb (Resolve_Call): In the part of the code where
4270 it is deciding whether to turn the call into an indexed
4271 component, avoid doing so if the call is to an instance of
4272 Unchecked_Conversion. Otherwise, the compiler turns it into an
4273 indexed component, and resolution of that turns it back into a
4274 function call, and so on, resulting in infinite recursion.
4275 * sem_util.adb (Needs_One_Actual): If the first formal has a
4276 default, then return False.
4278 2017-01-21 Eric Botcazou <ebotcazou@adacore.com>
4280 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
4281 optimizations when the type is modular and the offsets are equal.
4283 2017-01-20 Thomas Quinot <quinot@adacore.com>
4285 * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
4288 2017-01-20 Nicolas Roche <roche@adacore.com>
4290 * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
4292 2017-01-20 Bob Duff <duff@adacore.com>
4294 * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
4295 (etc) optimizations when the type is modular.
4297 2017-01-20 Yannick Moy <moy@adacore.com>
4299 * sem_ch6.adb (Move_Pragmas): move some pragmas,
4300 but copy the SPARK_Mode pragma instead of moving it.
4301 (Build_Subprogram_Declaration): Ensure that the generated spec
4302 and original body share the same SPARK_Pragma aspect/pragma.
4303 * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
4304 procedure to copy SPARK_Mode aspect.
4306 2017-01-20 Bob Duff <duff@adacore.com>
4308 * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
4310 * sem_ch13.adb (Resolve_Name): Enable setting the entity to
4311 Empty even in ASIS mode.
4313 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4315 * exp_ch9.adb: minor style fixes in comments.
4316 * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
4317 relative statement introduces an implicit dependency on
4318 Ada.Real_Time.Clock_Time.
4319 * sem_util.adb: Minor reformatting.
4321 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4323 * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
4324 must be treated as delayed aspect even if the expression is
4325 a literal, because the aspect affects the freezing and the
4326 elaboration of the object to which it applies.
4328 2017-01-20 Tristan Gingold <gingold@adacore.com>
4330 * s-osinte-vxworks.ads (Interrup_Range): New subtype.
4332 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4334 * lib-xref.adb (Generate_Reference): Do not warn about the
4335 presence of a pragma Unreferenced if the entity appears as the
4336 actual in a procedure call that does not come from source.
4338 2017-01-20 Pascal Obry <obry@adacore.com>
4340 * expect.c, terminals.c: Fix some warnings about unused variables.
4341 * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
4344 2017-01-20 Bob Duff <duff@adacore.com>
4346 * exp_attr.adb (Constrained): Apply an access check (check that
4347 the prefix is not null) when the prefix denotes an object of an
4348 access type; that is, when there is an implicit dereference.
4350 2017-01-20 Gary Dismukes <dismukes@adacore.com>
4352 * s-rident.ads (constant Profile_Info): Remove
4353 No_Calendar from GNAT_Extended_Ravenscar restrictions.
4355 2017-01-20 Tristan Gingold <gingold@adacore.com>
4357 * s-maccod.ads: Add pragma No_Elaboration_Code_All
4359 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4361 * ghost.adb (Mark_Ghost_Clause): New routine.
4362 (Prune_Node): Do not prune compilation unit nodes.
4363 (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
4364 This does not touch the node itself, but does prune all its fields.
4365 * ghost.ads (Mark_Ghost_Clause): New routine.
4366 * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
4367 package clause mentions Ghost and non-Ghost packages. Mark a
4368 use package clause as Ghost when it mentions a Ghost package.
4369 (Analyze_Use_Type): Emit an error when a use type clause mentions
4370 Ghost and non-Ghost types. Mark a use type clause as Ghost when
4371 it mentions a Ghost type.
4372 * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
4373 Ghost when it withs a Ghost unit.
4375 2017-01-20 Javier Miranda <miranda@adacore.com>
4377 * sem_res.adb (Resolve_Call): If a function call
4378 returns a limited view of a type and at the point of the call the
4379 function is not declared in the extended main unit then replace
4380 it with the non-limited view, which must be available. If the
4381 called function is in the extended main unit then no action is
4382 needed since the back-end handles this case.
4384 2017-01-20 Eric Botcazou <ebotcazou@adacore.com>
4386 * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
4387 (Contains_Subprograms_Refs): ...this. Adjust comment
4388 for constants. (Is_Subp_Or_Const_Ref): Rename into...
4389 (Is_Subprogram_Ref): ...this.
4390 (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
4391 Has_Non_Subprograms_Referencer and adjust comment. Remove
4392 incorrect shortcut for package declarations and bodies.
4394 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4396 * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
4397 base type differs from that of the completion and the private
4398 subtype is an itype (created for a constraint on an access
4399 type e.g.), set Delayed_Freeze on both to prevent out-of-scope
4402 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4404 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4405 When inheriting the SPARK_Mode of a prior expression function,
4406 look at the properly resolved entity rather than the initial
4407 candidate which may denote a homonym.
4409 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4411 * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
4412 Precondition or Postcondition, and the context is pragma
4413 Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
4414 and suggest the standard names Assertion_Policy /Pre /Post
4417 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4419 * sem_ch10.adb, sem_cat.adb: Minor reformatting.
4421 2017-01-20 Javier Miranda <miranda@adacore.com>
4423 * sem_ch3.adb (Access_Type_Declaration): Protect access to the
4425 * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
4426 * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
4429 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4431 * sem_ch13.adb (Analyze_Aspect_Specification, case
4432 Dynamic_Predicate): If the entity E is a subtype that inherits
4433 a static predicate for its parent P,, the inherited and the
4434 new predicate combine in the generated predicate function,
4435 and E only has a dynamic predicate.
4437 2017-01-20 Tristan Gingold <gingold@adacore.com>
4439 * s-boustr.ads, s-boustr.adb: New package.
4440 * Makefile.rtl: Add s-boustr.
4442 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4444 * inline.adb (Process_Formals): Qualify the
4445 expression of a return statement when it yields a universal type.
4447 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4449 * freeze.adb (Freeze_All): Freeze the default
4450 expressions of all eligible formal parameters that appear in
4451 entries, entry families, and protected subprograms.
4453 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4455 * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
4456 for illegal inherited Implicit_Dereference aspects with renamed
4459 2017-01-20 Javier Miranda <miranda@adacore.com>
4461 * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
4462 * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
4463 * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
4464 (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
4465 Set_Prev, Tree_Read): Adding assertion.
4466 * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
4467 * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
4468 (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
4469 Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
4470 Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
4471 Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
4472 Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
4473 Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
4474 Set_ListN_With_Parent): Adding assertion.
4476 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4478 * sem_prag.adb (Process_Convention): Diagnose properly a pragma
4479 import that applies to several homograph subprograms. when one
4480 of them is declared by a subprogram body.
4482 2017-01-20 Justin Squirek <squirek@adacore.com>
4484 * exp_ch6.adb (Expand_Call): Remove optimization
4485 that nulls out calls to null procedures.
4487 2017-01-20 Yannick Moy <moy@adacore.com>
4489 * inline.adb (Expand_Inlined_Call): Keep more
4490 precise type of actual for inlining whenever possible. In
4491 particular, do not switch to the formal type in GNATprove mode in
4492 some case where the GNAT backend might require it for visibility.
4494 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4496 * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
4497 aspect Implicit_Dereference can be inherited by a full view if
4498 the partial view has no discriminants, because there is no way
4499 to apply the aspect to the partial view.
4500 (Build_Derived_Record_Type): If derived type renames discriminants
4501 of the parent, the new discriminant inherits the aspect from
4503 * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
4504 call through an access discriminant designating a subprogram.
4505 * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
4506 properly a parameterless call through an access discriminant on
4507 the left-hand side of an assignment.
4508 * sem_res.adb (resolve): If an interpreation involves a
4509 discriminant with an implicit dereference and the expression is an
4510 entity, resolution takes place later in the appropriate routine.
4511 * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
4512 access discriminants that designate a subprogram type.
4514 2017-01-20 Pascal Obry <obry@adacore.com>
4516 * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
4518 2017-01-20 Yannick Moy <moy@adacore.com>
4520 * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
4521 on implicitly with'ed units in GNATprove mode.
4522 * sinfo.ads (Implicit_With): Document use of flag for implicitly
4523 with'ed units in GNATprove mode.
4525 2017-01-20 Ed Schonberg <schonberg@adacore.com>
4527 * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
4528 unit Do not report an error on a non-static entity that appears
4529 in the context of a spec expression, such as an aspect expression.
4531 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
4533 * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
4534 (Is_Underlying_Full_View): New routine.
4535 (Set_Is_Underlying_Full_View): New routine.
4536 (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
4537 * einfo.ads Add new attribute Is_Underlying_Full_View.
4538 (Is_Underlying_Full_View): New routine along with pragma Inline.
4539 (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
4540 * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
4541 class-wide types and underlying full views. The first subtype
4542 is used as the working type for all Itypes, not just array base types.
4543 (Build_DIC_Procedure_Declaration): Do not consider
4544 class-wide types and underlying full views. The first subtype
4545 is used as the working type for all Itypes, not just array
4547 * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
4548 view or an underlying full view without clobbering the attributes
4549 of a previous freeze node.
4550 (Inherit_Freeze_Node): New routine.
4551 * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
4553 (Build_Underlying_Full_View): Mark an underlying full view as such.
4554 * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
4557 2017-01-20 Yannick Moy <moy@adacore.com>
4559 * sinfo.ads: Document lack of Do_Division_Check flag
4560 on float exponentiation.
4562 2017-01-19 Javier Miranda <miranda@adacore.com>
4564 * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
4565 identifier attribute of a block-statement node. Required to avoid
4566 assertion failure when building the new containers library.
4568 2017-01-19 Bob Duff <duff@adacore.com>
4570 * exp_ch3.adb: Update comment.
4572 2017-01-19 Vincent Celier <celier@adacore.com>
4574 * gprep.adb (Gnatprep): Parse the definition file without
4575 "replace in comments" even when switch -C is used.
4577 2017-01-19 Justin Squirek <squirek@adacore.com>
4579 * exp_ch9.adb (Is_Pure_Barrier): Create function
4580 Is_Count_Attribute to identify an expansion of the 'Count
4583 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4585 * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
4586 statements within an element iterator loop are only analyzed
4587 agter the loop is rewritten. Within a generic the analysis must
4588 be performed in any case to complete name capture.
4590 2017-01-19 Bob Duff <duff@adacore.com>
4592 * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
4593 before checking for unrecognized pragmas.
4594 Initialize Pname on its declarations; that's always good style.
4596 2017-01-19 Claire Dross <dross@adacore.com>
4598 * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
4599 body into the tree for GNATprove by setting its Parent field. The
4600 components invariants of composite types are not checked by
4601 the composite type's invariant procedure in GNATprove mode.
4602 (Build_Invariant_Procedure_Declaration): Semi-insert the
4603 declaration into the tree for GNATprove by setting its Parent
4605 * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
4606 the component invariants to the array type invariant procedure
4607 so that the procedure can be used to check the array type
4609 (Freeze_Record_Type): In GNATprove mode, do
4610 not add the component invariants to the record type invariant
4611 procedure so that the procedure can be used to check the record
4612 type invariants if any.
4614 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4616 * lib-xref-spark_specific.adb: Minor reformatting.
4617 * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
4619 2017-01-19 Javier Miranda <miranda@adacore.com>
4621 * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
4622 Build_Back_End_Aggregate.
4623 (Generate_Aggregate_For_Derived_Type): Code cleanup.
4624 (Prepend_Stored_Values): Code cleanup.
4626 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4628 * sem_ch6.adb (Analyze_Expression_Function): Check for an
4629 incomplete return type after attempting to freeze it, so that
4630 other freeze actiona are generated in the proper order.
4632 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4634 * sem_aggr.adb (Resolve_Aggregate): If the type is a string
4635 type, ie. a type whose component is a character type, and the
4636 aggregate is positional, do not convert into a string literal
4637 if the index type is not an integer type, because the original
4638 type may be required in an enclosing operation.
4640 2017-01-19 Bob Duff <duff@adacore.com>
4642 * binde.adb, debug.adb: Enable new elaboration order algorithm
4643 by default. -dp switch reverts to the old algorithm.
4645 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4647 * sem_ch3.adb Add with and use clauses for Exp_Ch7.
4648 (Analyze_Declarations): Create the DIC and Invariant
4649 procedure bodies s after all freezing has taken place.
4650 (Build_Assertion_Bodies): New routine.
4651 * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
4653 (Analyze_Package_Specification): Remove the
4654 generation of the DIC and Invariant procedure bodies. This is
4655 now done by Analyze_Declarations.
4656 * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
4657 procedures are never treated as primitives.
4659 2017-01-19 Yannick Moy <moy@adacore.com>
4661 * frontend.adb: Analyze inlined bodies and check elaboration
4662 rules in GNATprove mode too.
4663 * sem_elab.adb (Delay_Element): Add Boolean component to save
4664 indication that call is in SPARK code. (Check_Elab_Calls):
4665 Check elaboration rules in GNATprove mode, and correctly set
4666 the current value of SPARK_Mode.
4667 * lib-xref-spark_specific.adb
4668 (Add_SPARK_Xrefs): Simplify iteration over dereferences.
4670 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4672 * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
4673 checks on the expression for the high bound of concatenation
4674 when checks are disabled, to suppress warnings about potential
4675 constraint errors in restricted runtimes.
4677 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4679 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
4680 representation-to-position function as inlined.
4681 * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
4682 the purity of an internally generated entity if it has been
4683 explicitly marked as pure for optimization purposes.
4684 * exp_aggr.adb: Minor reformatting.
4686 2017-01-19 Javier Miranda <miranda@adacore.com>
4688 * exp_ch6.adb (Expand_Call): Remove side effects on
4689 actuals that are allocators with qualified expression since the
4690 initialization of the object is performed by means of individual
4691 statements (and hence it must be done before the call).
4693 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4695 * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
4696 (Build_Derived_Enumeration_Type): If the derived type inherits a
4697 dynamic predicate from its parent, the bounds of the type must
4698 freeze because an explicit constraint is constructed for the
4699 type and the corresponding range is elaborated now.
4701 2017-01-19 Arnaud Charlet <charlet@adacore.com>
4703 * sem_attr.ads: minor fix of inconsistent casing in comment
4704 * lib-writ.ads: minor align comments in columns
4705 * sem_ch3.adb: Minor reformatting.
4706 * spark_xrefs.ads: minor fix typo in SPARK-related comment
4707 * table.ads: minor style fix in comment
4708 * lib-xref-spark_specific.adb
4709 (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
4710 * sem_ch12.adb: minor whitespace fix
4711 * freeze.adb: Add comment.
4712 * sem_util.adb (Unique_Name): for instances of
4713 generic subprograms ignore the name of the wrapper package.
4715 2017-01-19 Javier Miranda <miranda@adacore.com>
4717 * exp_aggr.adb (Resolve_Record_Aggregate):
4718 Factorize code needed for aggregates of limited and unlimited
4719 types in a new routine.
4720 (Pass_Aggregate_To_Back_End): New subprogram.
4722 2017-01-19 Yannick Moy <moy@adacore.com>
4724 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
4726 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4728 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
4729 public, for use elsewhere.
4730 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
4731 an Inlined_body, recognize a call that uses object notation
4732 and has not been rewritten as a regular call because regular
4733 expansion has not taken place.
4735 2017-01-19 Bob Duff <duff@adacore.com>
4737 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
4738 in case of generic formal discrete types, because it causes crashes in
4739 the compiler when built with assertions on.
4741 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4743 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
4744 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
4746 2017-01-19 Bob Duff <duff@adacore.com>
4748 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
4749 Increment Warnings_Detected. It was decrementing, which is
4750 wrong since we just issued a warning message.
4751 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
4752 these variables to be of subtype Nat instead of Int, because
4753 they should never be negative.
4755 2017-01-19 Javier Miranda <miranda@adacore.com>
4757 * contracts.adb (Build_Postconditions_Procedure): Replace
4758 Generate_C_Code by Modify_Tree_For_C.
4759 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
4760 Replace Generate_C_Code by Modify_Tree_For_C.
4761 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
4763 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
4764 Generate_C_Code by Modify_Tree_For_C.
4765 * exp_ch4.adb (Expand_Allocator_Expression): Replace
4766 Generate_C_Code by Modify_Tree_For_C.
4767 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
4768 by Modify_Tree_For_C.
4769 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
4770 Generate_C_Code by Modify_Tree_For_C.
4771 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
4772 by Modify_Tree_For_C.
4773 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
4775 2017-01-19 Javier Miranda <miranda@adacore.com>
4777 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
4779 (Is_Inlinable_Expression_Function): New subprogram.
4780 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
4782 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
4784 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4786 * sem_ch4.adb (Diagnose_Call): Improve error message when a
4787 selected component has a prefix that might be interpreted
4788 as a parameterless function call, but none of the candidate
4789 interpretations is parameterless, and there is a hidden homonym
4790 of the prefix that is a package.
4791 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
4792 interpreted as a parameterless function call and its analysis
4793 fails, do not call Analyze_Selected_Component.
4795 2017-01-19 Steve Baird <baird@adacore.com>
4797 * sem_util.ads: Add new Use_Full_View Boolean parameter to
4799 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
4800 calls to a newly-defined Scalar_Range_Of_Right_View function.
4802 2017-01-19 Arnaud Charlet <charlet@adacore.com>
4804 * gnat1drv.adb: minor fix of unbalanced parens in comment
4805 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
4806 to visible part of the package to allow re-use in GNATprove.
4807 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
4808 from repeated code of Traverse_Compilation_Unit.
4809 (Traverse_Declaration_Or_Statement): fixed detection of
4810 generic subprograms and packages; also, iteration over case
4811 statement alternatives rewritten to avoid testing if the first
4812 alternative is present (since it must be present due to Ada
4813 syntax restrictions).
4815 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
4817 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
4818 returning by reference not just for subprogram body stubs,
4819 but for all subprogram cases.
4820 * sem_util.adb: Code reformatting.
4821 (Requires_Transient_Scope): Update the call to Results_Differ.
4822 (Results_Differ): Update the parameter profile and the associated
4825 2017-01-19 Ed Schonberg <schonberg@adacore.com>
4827 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
4828 identifier nodes that do not come from source, to handle properly
4829 dimensionality check within an inlined body which inclddes both
4830 original operands and rewritten operands. This removes spurious
4831 dimensionality errors in the presence of front-end inlining,
4832 as well as in SPARK mode.
4834 2017-01-16 Jakub Jelinek <jakub@redhat.com>
4837 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
4839 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4841 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
4843 2017-01-13 Arnaud Charlet <charlet@adacore.com>
4845 * doc/gnat_ugn/getting_started_with_gnat.rst,
4846 doc/gnat_ugn/inline_assembler.rst,
4847 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4848 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
4849 doc/gnat_ugn/about_this_guide.rst,
4850 doc/gnat_ugn/platform_specific_information.rst,
4851 doc/gnat_ugn/example_of_binder_output.rst,
4852 doc/gnat_ugn/gnat_and_program_execution.rst,
4853 doc/gnat_ugn/gnat_utility_programs.rst,
4854 doc/gnat_ugn/the_gnat_compilation_model.rst,
4855 doc/gnat_rm/implementation_defined_attributes.rst,
4856 doc/gnat_rm/compatibility_and_porting_guide.rst,
4857 doc/gnat_rm/standard_library_routines.rst,
4858 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
4859 doc/gnat_rm/implementation_defined_pragmas.rst,
4860 doc/gnat_rm/the_gnat_library.rst,
4861 doc/gnat_rm/obsolescent_features.rst,
4862 doc/gnat_rm/about_this_guide.rst,
4863 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
4864 doc/gnat_rm/implementation_of_ada_2012_features.rst,
4865 doc/gnat_rm/interfacing_to_other_languages.rst,
4866 doc/gnat_rm/implementation_defined_aspects.rst,
4867 doc/gnat_rm.rst: Update documentation.
4868 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
4870 2017-01-13 Ed Schonberg <schonberg@adacore.com>
4872 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
4873 * scil_ll.adb: Minor style fix in comment.
4874 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
4875 even if entity is already set, because the node may be renalyzed
4876 after inlining transformations.
4878 2017-01-13 Javier Miranda <miranda@adacore.com>
4880 * sem_res.adb (Resolve_Call): Do not establish a transient scope
4881 for a call to inlinable expression function (since the call will
4882 be replaced by its returned object).
4883 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
4884 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
4885 (Expand_Call): For inlinable expression function call replace the
4886 call by its returned object.
4887 (Is_Inlinable_Expression_Function): New subprogram.
4889 2017-01-13 Gary Dismukes <dismukes@adacore.com>
4891 * checks.adb: Minor typo fix and reformatting.
4893 2017-01-13 Javier Miranda <miranda@adacore.com>
4895 * contracts.adb (Contract_Only_Subprograms): Remove formal.
4896 (Copy_Original_Specification): Removed.
4897 (Skip_Contract_Only_Subprogram): Move here checks previously
4898 located in the caller of this routine (to leave the code more clean).
4899 (Build_Contract_Only_Subprogram): Code cleanup.
4900 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
4901 (Get_Contract_Only_Missing_Body_Name): Removed.
4903 2017-01-13 Javier Miranda <miranda@adacore.com>
4905 * sem_ch6.adb (Cloned_Expression): New subprogram.
4906 (Freeze_Expr_Types): Complete previous patch since the expression
4907 of an expression-function may have iterators and loops with
4908 defining identifiers which, as part of the preanalysis of the
4909 expression, may be left decorated with itypes that will not be
4910 available in the tree passed to the backend.
4912 2017-01-13 Ed Schonberg <schonberg@adacore.com>
4914 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
4915 conversion to Integer of an expression that is an attribute
4916 reference 'Pos on an enumeration type.
4918 2017-01-13 Bob Duff <duff@adacore.com>
4920 * atree.ads: Minor comment fix.
4922 2017-01-13 Justin Squirek <squirek@adacore.com>
4924 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
4925 calls in accessibility check on return statement.
4927 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
4929 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4930 Ensure that the input body is a subprogram body before trying to
4931 determine whether it denoted an expression function. Note that
4932 subprogram body stubs cannot denote expression functions.
4934 2017-01-13 Gary Dismukes <dismukes@adacore.com>
4936 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
4939 2017-01-13 Javier Miranda <miranda@adacore.com>
4941 * einfo.ads (Component_Bit_Offset): Fix documentation.
4942 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
4943 on record holes for components with unknown compile-time offsets.
4945 2017-01-13 Bob Duff <duff@adacore.com>
4947 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
4948 * g-locfil.ads: Minor comment fix.
4950 2017-01-13 Bob Duff <duff@adacore.com>
4952 * binde.adb (Elab_New): New elaboration order algorithm
4953 that is expected to cause fewer ABE issues. This is a work in
4954 progress. The new algorithm is currently disabled, and can be
4955 enable by the -dp switch, or by modifying the Do_Old and Do_New
4956 etc. flags and rebuilding. Experimental code is included to
4957 compare the results of the old and new algorithms.
4958 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
4959 can have multiple of these tables, so the old and new algorithms
4961 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
4962 parameter of type array. This avoids the global variable, and
4963 allows bounds checking (which is normally defeated by the tables
4964 packages). It also ensures that the Elab_Order is read-only
4966 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
4967 subprograms that need it, as above.
4968 * debug.adb: Document new -dp switch. Modify doc of old -do
4970 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
4971 and Bindgen. Move writing of closure (-R and -Ra switches)
4972 to Binde; that's more convenient.
4974 2017-01-13 Ed Schonberg <schonberg@adacore.com>
4976 * sem_ch6.adb (Analyze_Expression_Function): If the expression
4977 function is a completion, all entities referenced in the
4978 expression are frozen. As a consequence, a reference to an
4979 uncompleted private type from an enclosing scope is illegal.
4981 2017-01-13 Javier Miranda <miranda@adacore.com>
4983 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
4984 (Analyze_Subprogram_Body_Helper): At the occurrence of an
4985 expression function declaration that is a completion, its
4986 expression causes freezing (AI12-0103).
4988 2017-01-13 Vadim Godunko <godunko@adacore.com>
4990 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
4991 Reference functions of Ada.Containers.Indefinite_Holders.
4993 2017-01-13 Bob Duff <duff@adacore.com>
4995 * s-os_lib.ads: Minor comment fixes.
4997 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
4999 * exp_ch3.adb (Default_Initialize_Object): Do not default
5000 initialize an object when it is of a task type and restriction
5001 No_Tasking is in effect because the initialization is obsolete.
5002 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
5003 restriction No_Tasking is in effect.
5004 (Build_Master_Renaming): Do not rename a master when restriction
5005 No_Tasking is in effect.
5007 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5009 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
5010 the legality of An others clause applies as well to a choice in
5011 an Iterated_component_ association.
5012 (Resolve_Iterated_Component_Association): An others choice
5014 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
5015 Iterated_Component_Association is not static.
5017 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5019 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
5020 control is passed to the expresion handler before the new mode
5022 * sem_ch12.adb (Analyze_Package_Instantiation,
5023 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
5024 in case control is passed to the expresion handler before the
5027 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5029 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
5030 exp_aggr.adb: Minor reformatting.
5032 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5034 * inline.adb: Minor reformatting and typo fix.
5036 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5038 * sem_util.ads, sem_util.adb (Choice_List): Move function here
5039 from sem_aggr.adb, for use elsewhere.
5040 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
5041 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
5042 Iterated_Component_Present.
5043 * exp_aggr.adb: Use Choice_List throughout, to handle
5044 Iterated_Component_Associations.
5045 (Gen_Loop): Generate proper loop for an
5046 Iterated_Component_Association: loop variable has the identifier
5047 of the original association. Generate a loop even for a single
5048 component choice, in order to make loop parameter visible in
5050 (Flatten): An Iterated_Component_Association is not static.
5052 2017-01-13 Yannick Moy <moy@adacore.com>
5054 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
5055 float exponentiation for statically known small negative values
5056 is the reciprocal of the exponentiation for the opposite value
5058 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
5059 Ensure that the value of float exponentiation for negative values
5060 is the reciprocal of the exponentiation for the opposite value
5062 * inline.adb (Expand_Inlined_Call): Fix the count
5063 for the number of generated gotos.
5065 2017-01-13 Yannick Moy <moy@adacore.com>
5067 * inline.adb: Code cleanup.
5068 * sem_util.adb (Is_OK_Volatile_Context): Add
5069 expression in delay statement as OK for volatile context.
5071 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5073 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
5074 mode a choice that is a subtype with a static predicate is
5075 replaced by the values it covers. This transformation must not
5076 be performed in ASIS mode, to preserve the source for analysis.
5078 2017-01-13 Justin Squirek <squirek@adacore.com>
5080 * nlists.ads: Correct minor typo.
5082 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5084 * sem_ch13.adb: Minor reformatting and typo fix.
5086 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5088 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
5089 Iterated_Component_Association is a named association in an
5091 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
5092 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
5093 and resolve the discrete choices and the expression of the
5095 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
5096 Loop_Actions and Box_Present are attributes of
5097 N_Iterated_Component_Association nodes. Box_Present is always
5099 * sprint.adb (Sprint_Node): An Iterated_Component_Association
5100 has a Discrete_Choices list, as specified in the RM. A
5101 Component_Association for aggregate uses instead a Choices list.
5102 We have to live with this small inconsistency because the new
5103 construct also has a defining identifier, and there is no way
5104 to merge the two node structures.
5106 2017-01-13 Yannick Moy <moy@adacore.com>
5108 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
5109 list of pragmas to remove. Remove pragmas from the list of
5110 statements in the body to inline.
5111 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
5113 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5115 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
5116 Analyze_Declarations, to analyze and resolve the expressions of
5117 aspect specifications in the current declarative list, so that
5118 the expressions have proper entity and type info. This is needed
5119 for ASIS when there is no subsequent expansion to generate this
5120 semantic information.
5121 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
5122 original expression, to suppress cascaded errors when expression
5123 has been constant-folded.
5124 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
5125 ASIS mode, because there is no subsequent expansion to decorate
5128 2017-01-13 Yannick Moy <moy@adacore.com>
5130 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
5131 New function to detect when a call may be inlined or not in
5133 (Expand_Inlined_Call): Ensure that a temporary
5134 is always created in the cases where a type conversion may be
5135 needed on an input parameter in GNATprove mode, so that GNATprove
5136 sees the check to perform.
5137 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
5138 when not applicable due to actual requiring type conversion
5139 with possible check but no temporary value can be copied for
5140 GNATprove to see the check.
5142 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5144 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
5145 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
5146 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
5147 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
5148 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
5149 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
5150 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
5151 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
5152 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
5153 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
5154 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
5155 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
5156 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
5157 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
5158 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
5159 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
5160 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
5161 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
5162 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
5163 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
5164 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
5165 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
5166 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
5167 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
5168 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
5169 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
5170 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
5171 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
5172 statements to reflect the new style for case alternatives. Various
5173 code clean up and reformatting.
5175 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5177 * exp_util.adb: Minor reformatting.
5179 2017-01-13 Yannick Moy <moy@adacore.com>
5181 * exp_spark.adb: Code cleanup.
5182 * sem_ch9.adb (Analyze_Delay_Until): Resolve
5183 expression so that calls are identified as such inside delay
5186 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5188 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
5189 * par-ch3.adb (P_Discrete_Choice_List): An
5190 Iterated_Component_Association is an array aggregate component.
5191 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
5192 (Is_Quantified_Expression): New function that performs a lookahead
5193 to distinguish quantified expressions from iterated component
5195 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
5197 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
5198 * sem.adb (Analyze): Handle Iterated_Component_Association.
5199 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
5200 component associations.
5201 * sinfo.ads, sinfo.adb: Entries for for
5202 N_Iterated_Component_Association and its fields.
5203 * sprint.adb (Sprint_Node_Actual): Handle
5204 N_Iterated_Component_Association.
5206 2017-01-13 Justin Squirek <squirek@adacore.com>
5208 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
5209 of the style check until after preanalysis of acutals.
5211 2017-01-13 Yannick Moy <moy@adacore.com>
5213 * sem_ch13.adb: Minor reformatting.
5214 * par-ch11.adb: minor style fix in whitespace
5215 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
5216 reduced to Add_Artificial_ALI_File; style fix in declaration of
5217 Text; grammar fix in comment.
5218 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
5219 * freeze.adb: Cleanup to pass pragma instead of
5221 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
5222 replace System'To_Address by equivalent call.
5224 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5226 * bindusg.adb: Improve usage output for -f switch.
5228 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5230 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
5233 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5235 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
5236 treat comparisons on strings as legal in a Static_Predicate.
5237 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
5238 a function call that is the expansion of a string comparison.The
5239 function call is built when compiling the corresponding predicate
5240 function, but the expression has been found legal as a static
5241 predicate during earlier analysis.
5242 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
5243 properly a function call that is the expansion of a string
5244 comparison operation, in order to recover the Static_Predicate
5245 expression and apply it to a static argument when needed.
5247 2017-01-13 Tristan Gingold <gingold@adacore.com>
5249 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
5250 (Open_Read): Re-implement using Open_Read_No_Exception.
5251 (Open_Write): Raise exception in case of error.
5252 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
5253 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
5255 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
5257 2017-01-13 Yannick Moy <moy@adacore.com>
5259 * checks.adb: Code cleanup.
5261 2017-01-13 Yannick Moy <moy@adacore.com>
5263 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
5264 expression instead of unanalyzed aspect expression for checking
5265 the validity of inheriting an operation. Also copy the expression
5266 being passing it to Build_Class_Wide_Expression, as this call
5267 modifies its argument.
5268 * sem_util.ads Fix comment to reference correct function name
5271 2017-01-13 Javier Miranda <miranda@adacore.com>
5273 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
5274 when we propagate information about the indexes back to the original
5275 indexing mode and the prefix of the index is a function call, do not
5276 remove any parameter from such call.
5278 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5280 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
5281 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
5282 a build-in-place function whose result type is tagged.
5284 2017-01-13 Yannick Moy <moy@adacore.com>
5286 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5287 Do not generate a wrapper when the only candidate is a class-wide
5289 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
5290 inside a generic context.
5292 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5294 * exp_util.adb (Add_Inherited_Tagged_DIC):
5295 Pass the object parameters of both the parent and the derived
5296 type DIC procedure to the reference replacement circuitry.
5297 (Find_DIC_Type): Modify the circuitry to present the partial
5298 view of a private type in case the private type defines its own
5300 (Replace_Object_And_Primitive_References): Add two
5301 optional formal parameters. Update the comment on usage. Update
5302 the replacement of references to object parameters.
5304 2017-01-13 Gary Dismukes <dismukes@adacore.com>
5306 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
5308 2017-01-13 Ed Schonberg <schonberg@adacore.com>
5310 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
5311 an out parameter that is a type conversion, independently of th
5312 range check that may apply to the expression of the conversion,
5313 for use in GNATProve.
5315 2017-01-13 Yannick Moy <moy@adacore.com>
5317 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
5318 GNATprove_Mode here to Frontend.
5319 * frontend.adb (Frontend): Move the implicit with for System
5320 in GNATprove_Mode here as it ismore correct this way; the old
5321 place only worked by chance, since there were no overloaded names.
5322 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
5323 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
5324 four attributes identified in SRM 9(18), add an implicit with
5325 to Ada.Task_Identification.
5326 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5327 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
5329 * checks.adb (Apply_Discriminant_Check,
5330 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
5331 In GNATprove mode, we do not apply the checks, but we still
5332 analyze the expression to possibly issue errors on SPARK
5333 code when a run-time error can be detected at compile time.
5334 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
5337 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5339 * expander.adb (Expand): Add a warning about using return
5340 statements in Ghost management code.
5341 * exp_ch3.adb (Freeze_Type): Add a warning about using return
5342 statements in Ghost management code.
5343 * exp_ch7.adb (Build_Invariant_Procedure_Body,
5344 Build_Invariant_Procedure_Declaration): Add a warning about
5345 using return statements in Ghost management code.
5346 * exp_disp.adb (Make_DT): Add a warning about using return
5347 statements in Ghost management code.
5348 * exp_util.adb (Build_DIC_Procedure_Body,
5349 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
5350 warning about using return statements in Ghost management code.
5351 * freeze.adb (Freeze_Entity): Add a warning about using return
5352 statements in Ghost management code.
5353 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
5354 statements in Ghost management code.
5355 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
5356 a warning about using return statements in Ghost management code.
5357 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
5358 return statements in Ghost management code.
5359 * sem_ch6.adb (Analyze_Procedure_Call,
5360 Analyze_Subprogram_Body_Helper): Add a warning about using return
5361 statements in Ghost management code.
5362 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
5363 using return statements in Ghost management code.
5364 * sem_ch12.adb (Analyze_Package_Instantiation,
5365 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
5366 Instantiate_Subprogram_Body): Add a warning about using return
5367 statements in Ghost management code.
5368 * sem_ch13.adb (Build_Predicate_Functions,
5369 Build_Predicate_Function_Declarations): Add a warning about
5370 using return statements in Ghost management code.
5371 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
5372 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
5373 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
5374 using return statements in Ghost management code.
5376 2017-01-13 Tristan Gingold <gingold@adacore.com>
5378 * s-mmosin-mingw.adb: Fix pragma import.
5380 2017-01-13 Arnaud Charlet <charlet@adacore.com>
5382 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
5385 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
5387 * atree.adb (Allocate_Initialize_Node): A newly created node is
5388 no longer marked as Ghost at this level.
5389 (Mark_New_Ghost_Node): New routine.
5390 (New_Copy): Mark the copy as Ghost.
5391 (New_Entity): Mark the entity as Ghost.
5392 (New_Node): Mark the node as Ghost.
5393 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
5394 apply to unanalyzed entities.
5395 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
5397 (Set_Is_Checked_Ghost_Entity): This attribute now
5398 applies to all entities as well as unanalyzed entities.
5399 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
5400 all entities as well as unanalyzed entities.
5401 * expander.adb Add with and use clauses for Ghost.
5402 (Expand): Install and revert the Ghost region associated with the node
5404 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
5405 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
5406 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
5407 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
5408 (Freeze_Type): Install and revert the Ghost region associated
5409 with the type being frozen.
5410 * exp_ch5.adb Remove with and use clauses for Ghost.
5411 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
5412 * exp_ch6.adb Remove with and use clauses for Ghost.
5413 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
5414 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
5415 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
5416 Ghost region of the working type.
5417 (Build_Invariant_Procedure_Declaration): Install and revert
5418 the Ghost region of the working type.
5419 (Expand_N_Package_Body): Remove all Ghost-related code.
5420 * exp_ch8.adb Remove with and use clauses for Ghost.
5421 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
5423 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
5424 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
5425 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
5427 * exp_ch13.adb Remove with and use clauses for Ghost.
5428 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
5429 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
5430 the tagged type. Move the generation of various entities within
5431 the Ghost region of the type.
5432 * exp_prag.adb Remove with and use clauses for Ghost.
5433 (Expand_Pragma_Check): Remove all Ghost-related code.
5434 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
5435 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
5436 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
5437 * exp_util.adb (Build_DIC_Procedure_Body): Install
5438 and revert the Ghost region of the working types.
5439 (Build_DIC_Procedure_Declaration): Install and revert the
5440 Ghost region of the working type.
5441 (Make_Invariant_Call): Install and revert the Ghost region of the
5443 (Make_Predicate_Call): Reimplemented. Install and revert the
5444 Ghost region of the associated type.
5445 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
5446 of the entity being frozen.
5447 (New_Freeze_Node): Removed.
5448 * ghost.adb Remove with and use clauses for Opt.
5449 (Check_Ghost_Completion): Update the parameter profile
5450 and all references to formal parameters.
5451 (Ghost_Entity): Update the comment on usage.
5452 (Install_Ghost_Mode): New routines.
5453 (Is_Ghost_Assignment): New routine.
5454 (Is_Ghost_Declaration): New routine.
5455 (Is_Ghost_Pragma): New routine.
5456 (Is_Ghost_Procedure_Call): New routine.
5457 (Is_Ghost_Renaming): Removed.
5458 (Is_OK_Declaration): Reimplemented.
5459 (Is_OK_Pragma): Reimplemented.
5460 (Is_OK_Statement): Reimplemented.
5461 (Is_Subject_To_Ghost): Update the comment on usage.
5462 (Mark_And_Set_Ghost_Assignment): New routine.
5463 (Mark_And_Set_Ghost_Body): New routine.
5464 (Mark_And_Set_Ghost_Completion): New routine.
5465 (Mark_And_Set_Ghost_Declaration): New routine.
5466 (Mark_And_Set_Ghost_Instantiation): New routine.
5467 (Mark_And_Set_Ghost_Procedure_Call): New routine.
5468 (Mark_Full_View_As_Ghost): Removed.
5469 (Mark_Ghost_Declaration_Or_Body): New routine.
5470 (Mark_Ghost_Pragma): New routine.
5471 (Mark_Ghost_Renaming): New routine.
5472 (Mark_Pragma_As_Ghost): Removed.
5473 (Mark_Renaming_As_Ghost): Removed.
5474 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
5475 (Prune_Node): Freeze nodes no longer need special pruning, they
5476 are processed by the general ignored Ghost code mechanism.
5477 (Restore_Ghost_Mode): New routine.
5478 (Set_Ghost_Mode): Reimplemented.
5479 (Set_Ghost_Mode_From_Entity): Removed.
5480 * ghost.ads Add with and use clauses for Ghost.
5481 (Check_Ghost_Completion): Update the parameter profile
5482 along with the comment on usage.
5483 (Install_Ghost_Mode): New routine.
5484 (Is_Ghost_Assignment): New routine.
5485 (Is_Ghost_Declaration): New routine.
5486 (Is_Ghost_Pragma): New routine.
5487 (Is_Ghost_Procedure_Call): New routine.
5488 (Mark_And_Set_Ghost_Assignment): New routine.
5489 (Mark_And_Set_Ghost_Body): New routine.
5490 (Mark_And_Set_Ghost_Completion): New routine.
5491 (Mark_And_Set_Ghost_Declaration): New routine.
5492 (Mark_And_Set_Ghost_Instantiation): New routine.
5493 (Mark_And_Set_Ghost_Procedure_Call): New routine.
5494 (Mark_Full_View_As_Ghost): Removed.
5495 (Mark_Ghost_Pragma): New routine.
5496 (Mark_Ghost_Renaming): New routine.
5497 (Mark_Pragma_As_Ghost): Removed.
5498 (Mark_Renaming_As_Ghost): Removed.
5499 (Restore_Ghost_Mode): New routine.
5500 (Set_Ghost_Mode): Redefined.
5501 (Set_Ghost_Mode_From_Entity): Removed.
5502 * sem.adb (Analyze): Install and revert the Ghost region of the
5503 node being analyzed.
5504 (Do_Analyze): Change the way a clean Ghost
5505 region is installed and reverted.
5506 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
5507 all Ghost-related code.
5508 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
5509 (Analyze_Number_Declaration): Remove all Ghost-related code.
5510 (Analyze_Object_Declaration): Install and revert the Ghost region of
5511 a deferred object declaration's completion.
5512 (Array_Type_Declaration): Remove all Ghost-related code.
5513 (Build_Derived_Type): Update the comment on
5514 the propagation of Ghost attributes from a parent to a derived type.
5515 (Derive_Subprogram): Remove all Ghost-related code.
5516 (Make_Class_Wide_Type): Remove all Ghost-related code.
5517 (Make_Implicit_Base): Remove all Ghost-related code.
5518 (Process_Full_View): Install and revert the Ghost region of
5519 the partial view. There is no longer need to check the Ghost
5521 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
5522 region of the left hand side.
5523 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
5524 all Ghost-related code.
5525 (Analyze_Expression_Function): Remove all Ghost-related code.
5526 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
5527 (Analyze_Procedure_Call): Install and revert the Ghost region of
5528 the procedure being called.
5529 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
5530 region of the spec or body.
5531 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
5532 (Build_Subprogram_Declaration): Remove all Ghost-related code.
5533 (Find_Corresponding_Spec): Remove all Ghost-related code.
5534 (Process_Formals): Remove all Ghost-related code.
5535 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
5536 the Ghost region of the spec.
5537 (Analyze_Package_Declaration): Remove all Ghost-related code.
5538 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
5539 Ghost when it aliases a Ghost entity.
5540 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
5542 (Analyze_Object_Renaming): Mark a renaming as Ghost when
5543 it aliases a Ghost entity.
5544 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
5546 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
5547 aliases a Ghost entity.
5548 * sem_ch11.adb Remove with and use clauses for Ghost.
5549 (Analyze_Exception_Declaration): Remove all Ghost-related code.
5550 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
5552 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
5554 (Analyze_Package_Instantiation): Install and revert the Ghost region
5555 of the package instantiation.
5556 (Analyze_Subprogram_Instantiation): Install
5557 and revert the Ghost region of the subprogram instantiation.
5558 (Instantiate_Package_Body): Code clean up. Install and revert the
5559 Ghost region of the package body.
5560 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
5561 Ghost region of the subprogram body.
5562 * sem_ch13.adb (Build_Predicate_Functions): Install
5563 and revert the Ghost region of the related type.
5564 (Build_Predicate_Function_Declaration): Code clean up. Install
5565 and rever the Ghost region of the related type.
5566 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
5567 Install and revert the Ghost region of the pragma.
5568 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
5569 Ghost region of the pragma.
5570 (Analyze_Pragma): Install and revert the Ghost region of various
5571 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
5572 or encloses a Ghost entity.
5573 (Analyze_Pre_Post_Condition): Install and revert the Ghost
5574 region of the pragma.
5575 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
5576 Ghost region of the pragma.
5577 * sem_res.adb (Resolve): Remove all Ghost-related code.
5578 * sem_util.adb (Is_Declaration): Reimplemented.
5579 (Is_Declaration_Other_Than_Renaming): New routine.
5580 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
5581 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
5582 (Is_Ghost_Pragma): Removed.
5583 (Is_Ignored_Ghost_Pragma): New routine.
5584 (Set_Is_Checked_Ghost_Pragma): New routine.
5585 (Set_Is_Ghost_Pragma): Removed.
5586 (Set_Is_Ignored_Ghost_Pragma): New routine.
5587 * sinfo.ads: Update the documentation on Ghost mode and
5588 Ghost regions. New attributes Is_Checked_Ghost_Pragma
5589 and Is_Ignored_Ghost_Pragma along with usages in nodes.
5590 Remove attribute Is_Ghost_Pragma along with usages in nodes.
5591 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5592 (Is_Ghost_Pragma): Removed along with pragma Inline.
5593 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5594 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5595 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
5596 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5598 2017-01-12 Tristan Gingold <gingold@adacore.com>
5600 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
5601 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
5603 2017-01-12 Yannick Moy <moy@adacore.com>
5605 * errout.adb, errout.ads (Initialize): Factor common treatment
5607 (Reset_Warnings): New procedure to reset counts related to warnings.
5608 (Record_Compilation_Errors): New variable to store the presence of an
5609 error, used in gnat2why to allow changing the Warning_Mode.
5610 (Compilation_Errors): Use new variable Record_Compilation_Errors to
5611 store the presence of an error.
5613 2017-01-12 Javier Miranda <miranda@adacore.com>
5615 * sem_ch13.adb (Analyze_Aspect_Specifications):
5616 For Interrupt_Handler and Attach_ Handler aspects, decorate the
5617 internally built reference to the protected procedure as coming
5618 from sources and force its analysis.
5620 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5622 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
5623 inherit predicates if any from the first_subtype of the parent,
5624 not from the anonymous parent type.
5625 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
5626 predicate is not a static subtype.
5628 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5630 * freeze.adb (Check_Suspicious_Convention): New procedure
5631 performing a warning check on discriminated record types with
5632 convention C or C++. Factored out of procedure Freeze_Record_Type,
5633 and changed to only apply to base types (to avoid spurious
5634 warnings on subtypes). Minor improvement of warning messages
5635 to refer to discriminated rather than variant record types.
5636 (Freeze_Record_Type): Remove code for performing a suspicious
5638 (Freeze_Entity): Only call Freeze_Record_Type
5639 on types that aren't declared within any enclosing generic units
5640 (rather than just excluding the type when the innermost scope
5641 is generic). Call Check_Suspicious_Convention whether or not
5642 the type is declared within a generic unit.
5643 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
5644 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
5647 2017-01-12 Tristan Gingold <gingold@adacore.com>
5649 * sysdep.c, adaint.c, rtinit.c, ming32.h:
5650 (__gnat_current_codepage): Renamed from CurrentCodePage
5651 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
5653 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5655 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
5656 quantified expressions, following AI12-050: the loop parameters
5657 of two quantified expressions are conformant if they have the
5660 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5662 * gcc-interface/Makefile.in: Clean up VxWorks targets.
5664 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5666 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
5667 Hnadle properly the attribute reference when it appears as part
5668 of an expression in another loop aspect.
5670 2017-01-12 Ed Schonberg <schonberg@adacore.com>
5672 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
5673 subsidiary of Build_Initialization_Call, to complete generation
5674 of predicate checks on discriminants whose (sub)types have
5675 predicates, and to add checks on variants that do not have an
5677 * sem_util.adb (Gather_Components): A missing Others alternative is
5678 not an error when the type of the discriminant is a static predicate
5679 (and coverage has been checked when analyzing the case statement). A
5680 runtime check is generated to verify that a given discriminant
5681 satisfies the predicate (RM 3.8.1. (21.1/2)).
5683 2017-01-12 Yannick Moy <moy@adacore.com>
5685 * gnat1drv.adb (Adjust_Global_Switches): Only
5686 perform checking of exception mechanism when generating code.
5688 2017-01-12 Justin Squirek <squirek@adacore.com>
5690 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
5691 Remove handling of access component with invariant.
5692 (Build_Invariant_Procedure_Declaration): Remove return on class
5694 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
5695 conditional exception for component or array so Has_Own_Invariants
5696 flag is not falsly set.
5697 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
5698 wide type to have no invariant flags.
5700 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5702 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
5703 sem_ch13.adb: Minor reformatting.
5705 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5707 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
5708 adjustment primitive when the ancestor type was not properly frozen.
5709 (Gen_Assign): Guard against a missing initialization
5710 primitive when the component type was not properly frozen.
5711 (Initialize_Array_Component): Guard against a missing adjustment
5712 primitive when the component type was not properly frozen.
5713 (Initialize_Record_Component): Guard against a missing adjustment
5714 primitive when the component type was not properly frozen.
5715 (Process_Transient_Component_Completion): The transient object may
5716 not be finalized when its associated type was not properly frozen.
5717 * exp_ch3.adb (Build_Assignment): Guard against a missing
5718 adjustment primitive when the component type was not properly frozen.
5719 (Build_Initialization_Call): Guard against a missing
5720 initialization primitive when the associated type was not properly
5722 (Expand_N_Object_Declaration): Guard against a missing
5723 adjustment primitive when the base type was not properly frozen.
5724 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
5725 body when there is no adjustment primitive available. Create an
5726 empty Deep_Finalize body when there is no finalization primitive
5728 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
5729 missing finalization primitive when the designated type was
5730 not properly frozen.
5731 (Expand_N_Allocator): Guard against a missing initialization primitive
5732 when the designated type was not properly frozen.
5733 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
5734 only when the corresponding adjustment primitive is available.
5735 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
5736 adjustment/finalization statements only when there is an available
5737 primitive to carry out the action.
5738 (Build_Initialize_Statements): Generate the initialization/finalization
5739 statements only when there is an available primitive to carry out the
5741 (Make_Adjust_Call): Do not generate a call when the underlying
5742 type is not present due to a possible missing full view.
5743 (Make_Final_Call): Do not generate a call when the underlying
5744 type is not present due to a possible missing full view.
5745 (Make_Finalize_Address_Stmts): Generate an empty body when the
5746 designated type lacks a finalization primitive.
5747 (Make_Init_Call): Do not generate a call when the underlying type is
5748 not present due to a possible missing full view.
5749 (Process_Component_For_Adjust): Add the adjustment call only when the
5750 corresponding adjustment primitive is available.
5751 (Process_Component_For_Finalize): Add the finalization call only when
5752 the corresponding finalization primitive is available.
5753 (Process_Object_Declaration): Use a null statement to emulate a
5754 missing call to the finalization primitive of the object type.
5755 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
5756 (Make_Final_Call): Update the comment on usage.
5757 (Make_Init_Call): Update the comment on usage.
5758 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
5760 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5762 * einfo.ads: Update documentation of Address_Taken.
5763 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
5764 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
5765 for subprograms when setting Address_Taken flag.
5767 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
5769 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
5770 Configurable_Run_Time_Mode off when analysing with'ed predefined
5773 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5775 * sem_prag.adb: Minor reformatting.
5776 * sem_util.adb (Unique_Entity): fix result for
5777 bodies of entry families.
5779 2017-01-12 Justin Squirek <squirek@adacore.com>
5781 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
5782 Resolve_Suppressible in the pragma Assertion_Policy case.
5783 (Resolve_Suppressible): Created this function to factor out
5784 common code used to resolve Suppress to either Ignore or Check
5785 * snames.ads-tmpl: Add name for Suppressible.
5787 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5789 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
5791 * debug.adb: Minor comment fixes.
5793 2017-01-12 Arnaud Charlet <charlet@adacore.com>
5795 * sem_util.adb (Unique_Entity): For concurrent
5796 bodies that are defined with stubs and complete a declaration
5797 of a single concurrent object return the entity of an implicit
5798 concurrent type, not the entity of the anonymous concurrent
5800 * debug.adb: -gnatd.J is no longer used.
5801 * make.adb (Globalize): Removed, no longer used.
5802 * sem_ch9.adb: minor typo in comment for entry index
5804 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
5806 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
5807 * exp_ch3.adb (Build_Init_Statements): As part of initialising
5808 the value record of a task, set its _Secondary_Stack_Size field
5810 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
5811 a _Secondary_Stack_Size field in the value record of
5812 the task if a Secondary_Stack_Size rep item is present.
5813 (Make_Task_Create_Call): Include secondary stack size
5814 parameter. If No_Secondary_Stack restriction is in place, passes
5816 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
5817 Secondary_Stack_Size.
5818 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
5819 function to define the overhead of the secondary stack.
5820 * s-tarest.adb (Create_Restricted_Task,
5821 Create_Restricted_Task_Sequential): Functions now include
5822 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
5823 * s-tarest.adb (Create_Restricted_Task,
5824 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
5825 include Secondary_Stack_Size parameter.
5826 (Task_Wrapper): Secondary stack now allocated to the size specified by
5827 the Secondary_Stack_Size parameter in the task's ATCB.
5828 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
5829 Secondary_Stack_Size component.
5830 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
5831 Create_Restricted_Task_Sequential): Function now include
5832 Secondary_Stack_Size parameter.
5833 (Task_Wrapper): Secondary stack now allocated to the size
5834 specified by the Secondary_Stack_Size parameter in the task's
5836 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
5837 to include Secondary_Stack_Size parameter.
5838 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
5839 Secondary_Stack_Size aspect, turning the aspect into its corresponding
5841 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
5842 * snames.adb-tmpl, snames.ads-tmpl: Added names
5843 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
5844 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
5846 2017-01-12 Yannick Moy <moy@adacore.com>
5848 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
5851 2017-01-12 Justin Squirek <squirek@adacore.com>
5853 * exp_attr.adb (Expand_N_Attribute_Reference):
5854 Fix Finalization_Size case by properly resolving the type after
5855 rewritting the node.
5857 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5859 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
5861 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
5862 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
5863 exp_sel.ads: Minor reformatting.
5865 2017-01-12 Justin Squirek <squirek@adacore.com>
5867 * exp_ch6.adb (Expand_Call): Add guard to prevent
5868 invariant checks from being created for internally generated
5871 2017-01-12 Bob Duff <duff@adacore.com>
5873 * lib-writ.ads: Remove incorrect comment.
5875 2017-01-12 Javier Miranda <miranda@adacore.com>
5877 * debug.adb (-gnatd.K): Enable generation of contract-only
5878 procedures in CodePeer mode.
5879 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
5881 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
5883 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
5885 (Get_Contract_Only_Missing_Body_Name): New subprogram.
5886 (Get_Contract_Only_Body): New subprogram.
5887 (Set_Contract_Only_Body): New subprogram.
5888 (Is_Contract_Only_Body): New subprogram.
5889 (Set_Is_Contract_Only_Body): New subprogram.
5890 (SCIL_Nodes): Replace table by hash-table.
5892 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5894 * exp_ch6.adb: Minor reformatting.
5895 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
5897 2017-01-12 Bob Duff <duff@adacore.com>
5899 * binde.adb (Forced): New reason for a dependence.
5900 (Force_Elab_Order): Implementation of the new switch.
5901 * binde.ads: Minor comment fixes.
5902 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
5903 long ago that is no longer supported; removed comment about that.
5904 * opt.ads (Force_Elab_Order_File): Name of file specified for
5906 * switch-b.adb: Parse -f switch.
5908 2017-01-12 Justin Squirek <squirek@adacore.com>
5910 * exp_ch6.adb (Check_View_Conversion): Created this function
5911 to properly chain calls to check type invariants that may be
5912 present in a subprogram call after the subprogram.
5913 (Expand_Call): Add a conditional to identify when a view conversion
5914 needs to be checked.
5915 * nlists.adb, nlists.ads (Prepend_New): New routine.
5916 (Prepend_New_To): New routine.
5918 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5920 * sinfo.ads: Minor reformatting.
5922 2017-01-12 Gary Dismukes <dismukes@adacore.com>
5924 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
5927 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
5929 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
5930 variable Definite. Create a local object and pass its 'Access to the
5931 BIP function when the result type is either definite or it does not
5932 require any finalization or secondary stack management.
5934 2017-01-12 Bob Duff <duff@adacore.com>
5936 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
5937 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
5938 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
5939 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
5940 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
5941 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
5942 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
5943 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
5944 Change name to Pragma_Name_Unmapped.
5945 (Pragma_Name_Mapped): Change name to Pragma_Name.
5946 This is because the "mapped" version should be the usual case.
5948 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
5950 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
5951 Is_Default_Init_Cond_Procedure, and
5952 Has_Inherited_Default_Init_Cond. Add uses of flags
5953 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
5954 (Default_Init_Cond_Procedure): Removed.
5955 (DIC_Procedure): New routine.
5956 (Has_Default_Init_Cond): Removed.
5957 (Has_DIC): New routine.
5958 (Has_Inheritable_Invariants): The attribute applies to the base type.
5959 (Has_Inherited_Default_Init_Cond): Removed.
5960 (Has_Inherited_DIC): New routine.
5961 (Has_Inherited_Invariants): The attribute applies to the base type.
5962 (Has_Own_DIC): New routine.
5963 (Has_Own_Invariants): The attribute applies to the base type.
5964 (Is_Default_Init_Cond_Procedure): Removed.
5965 (Is_DIC_Procedure): New routine.
5966 (Set_Default_Init_Cond_Procedure): Removed.
5967 (Set_DIC_Procedure): New routine.
5968 (Set_Has_Default_Init_Cond): Removed.
5969 (Set_Has_Inheritable_Invariants): The attribute applies
5971 (Set_Has_Inherited_Default_Init_Cond): Removed.
5972 (Set_Has_Inherited_DIC): New routine.
5973 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
5974 (Set_Has_Own_DIC): New routine.
5975 (Set_Has_Own_Invariants): The attribute applies to the base type.
5976 (Set_Is_Default_Init_Cond_Procedure): Removed.
5977 (Set_Is_DIC_Procedure): New routine.
5978 (Write_Entity_Flags): Update the output of all flags related to
5979 default initial condition.
5980 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
5981 of the call to the DIC procedure.
5982 (Freeze_Type): Generate the body of the DIC procedure.
5983 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
5984 all occurrences of Create_Append with Append_New_To. Do
5985 not generate an invariant procedure for a class-wide type.
5986 The generated body acts as a freeze action of the working type.
5987 (Build_Invariant_Procedure_Declaration): Do not generate an
5988 invariant procedure for a class-wide type.
5989 (Create_Append): Removed.
5990 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
5991 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
5992 class-wide pre/postcondition description and data structures from
5994 (Build_Class_Wide_Expression): Moved from Sem_Prag.
5995 (Build_DIC_Call): New routine.
5996 (Build_DIC_Procedure_Body): New routine.
5997 (Build_DIC_Procedure_Declaration): New routine.
5998 (Entity_Hash): Moved from Sem_Prag.
5999 (Find_DIC_Type): New routine.
6000 (Update_Primitives_Mapping): Reimplemented.
6001 (Update_Primitives_Mapping_Of_Types): New routine.
6002 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
6003 (Build_DIC_Call): New routine.
6004 (Build_DIC_Procedure_Body): New routine.
6005 (Build_DIC_Procedure_Declaration): New routine.
6006 (Update_Primitives_Mapping): Moved from Sem_Prag.
6007 (Update_Primitives_Mapping_Of_Types): New routine.
6008 * nlists.adb (Append_New): New routine.
6009 (Append_New_To): New routine.
6010 * nlists.ads (Append_New): New routine.
6011 (Append_New_To): New routine.
6012 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
6013 of DIC procedures here. This is now done at the end of the
6014 visible declarations, private declarations, and at the freeze
6016 (Analyze_Private_Extension_Declaration):
6017 A private extension inherits the DIC pragma of a parent type.
6018 (Analyze_Subtype_Declaration): No need to propagate invariant
6019 attributes to a subtype as those apply to the base type.
6020 (Build_Derived_Record_Type): No need to inherit invariants here
6021 as this is now done in Build_Derived_Type.
6022 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
6024 (Process_Full_View): Update the propagation of DIC attributes.
6025 (Propagate_Default_Init_Cond_Attributes): Removed.
6026 * sem_ch7.adb Add with and use clauses for Exp_Util.
6027 (Analyze_Package_Specification): Create the body of the DIC
6028 procedure at the end of the visible and private declarations.
6029 (Preserve_Full_Attributes): Propagate DIC attributes.
6030 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
6032 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
6033 * sem_elab.adb (Check_A_Call): Update the call to
6034 Is_Nontrivial_Default_Init_Cond_Procedure.
6035 * sem_prag.adb Remove the with and use clauses for
6036 GNAT.HTable. Move the handling of class- wide pre/postcondition
6037 description and data structures to Exp_Util.
6038 (Analyze_Pragma): Create the declaration of the DIC procedure. There
6039 is no need to propagate invariant-related attributes at this point
6040 as this is done in Build_Invariant_Procedure_Declaration.
6041 (Build_Class_Wide_Expression): Moved to Exp_Util.
6042 (Entity_Hash): Moved to Exp_Util.
6043 (Update_Primitives_Mapping): Moved to Exp_Util.
6044 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
6045 (Update_Primitives_Mapping): Moved to Exp_Util.
6046 * sem_util.adb: Remove with and use clauses for Ghost
6048 (Build_Default_Init_Cond_Call): Removed.
6049 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6050 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6051 (Get_Views): Reimplemented.
6052 (Has_Full_Default_Initialization): Reimplement the section on DIC.
6053 (Inherit_Default_Init_Cond_Procedure): Removed.
6054 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6055 (Is_Nontrivial_DIC_Procedure): New routine.
6056 (Is_Verifiable_DIC_Pragma): New routine.
6057 (Propagate_DIC_Attributes): New routine.
6058 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
6059 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6060 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6061 (Inherit_Default_Init_Cond_Procedure): Removed.
6062 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6063 (Is_Nontrivial_DIC_Procedure): New routine.
6064 (Is_Verifiable_DIC_Pragma): New routine.
6065 (Propagate_DIC_Attributes): New routine.
6066 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
6068 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
6070 (Expression_Copy): New routine along with pragma Inline.
6071 (Set_Expression_Copy): New routine along with pragma Inline.
6073 2017-01-06 Bob Duff <duff@adacore.com>
6075 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
6076 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
6077 we won't generate the call to s_stalib_adafinal when the main
6078 is not written in Ada.
6080 2017-01-06 Bob Duff <duff@adacore.com>
6082 * sem_prag.adb: Minor: remove pragma Warnings.
6084 2017-01-06 Tristan Gingold <gingold@adacore.com>
6086 * Makefile.rtl: Do not compile s-stchop by default.
6088 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
6090 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
6091 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
6092 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
6093 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
6094 Reverted previous change for now.
6096 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6098 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
6099 check to default discriminant value if checks are enabled.
6100 (Build_Assignment): If type of component has static predicate,
6101 apply check to its default value, if any.
6103 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
6105 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
6106 * exp_ch3.adb (Build_Init_Statements): As part of initialising
6107 the value record of a task, set its _Secondary_Stack_Size field
6109 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
6110 a _Secondary_Stack_Size field in the value record of
6111 the task if a Secondary_Stack_Size rep item is present.
6112 (Make_Task_Create_Call): Include secondary stack size
6113 parameter. If No_Secondary_Stack restriction is in place, passes
6115 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
6116 Secondary_Stack_Size.
6117 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
6118 function to define the overhead of the secondary stack.
6119 * s-tarest.adb (Create_Restricted_Task,
6120 Create_Restricted_Task_Sequential): Functions now include
6121 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
6122 * s-tarest.adb (Create_Restricted_Task,
6123 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
6124 now include Secondary_Stack_Size parameter.
6126 Secondary stack now allocated to the size specified by the
6127 Secondary_Stack_Size parameter in the task's ATCB.
6128 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
6129 Secondary_Stack_Size component.
6130 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6131 Create_Restricted_Task_Sequential): Function now include
6132 Secondary_Stack_Size parameter.
6133 (Task_Wrapper): Secondary stack
6134 now allocated to the size specified by the Secondary_Stack_Size
6135 parameter in the task's ATCB.
6136 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
6137 for Secondary_Stack_Size aspect, turning the aspect into its
6138 corresponding internal attribute.
6139 (Analyze_Attribute_Definition):
6140 Process Secondary_Stack_Size attribute.
6141 * snames.adb-tmpl, snames.ads-tmpl: Added names
6142 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6143 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6145 2017-01-06 Pascal Obry <obry@adacore.com>
6147 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
6148 Sequential_IO and Direct_IO.
6150 2017-01-06 Bob Duff <duff@adacore.com>
6152 * snames.ads-tmpl (Renamed): New name for the pragma argument.
6153 * par-ch2.adb: Allow the new pragma (with analysis deferred
6155 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
6156 Keep a mapping from new pragma names to old names.
6157 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
6158 implement it by calling Map_Pragma_Name.
6159 * checks.adb, contracts.adb, einfo.adb, errout.adb,
6160 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
6161 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
6162 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
6163 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
6164 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6165 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
6168 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6170 * exp_ch9.adb: Minor reformatting.
6172 2017-01-06 Tristan Gingold <gingold@adacore.com>
6174 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
6175 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
6176 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
6178 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
6179 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
6180 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
6181 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
6183 2017-01-06 Bob Duff <duff@adacore.com>
6185 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
6186 dummy implementation of Map_Pragma_Name.
6188 2017-01-06 Tristan Gingold <gingold@adacore.com>
6190 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
6191 entry_body variable constant.
6192 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
6193 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
6195 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
6196 now access to constant.
6198 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6200 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
6201 reformatting and typo fixes.
6203 2017-01-06 Bob Duff <duff@adacore.com>
6205 * snames.ads-tmpl: New names for pragma renaming.
6206 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
6207 * par-prag.adb: Add new pragma name to case statement.
6208 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
6210 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
6211 Dummy implementation of Pragma_Name_Mapped.
6213 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6215 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
6216 better detect call within an entry_wrapper.
6217 * sem_res.adb (Resolve_Call): A protected call within an
6218 entity_wrapper is analyzed in the context of the protected
6219 object but corresponds to a pre-analysis and is not an access
6221 * sem_attr.adb: Minor reformatting.
6223 2017-01-06 Justin Squirek <squirek@adacore.com>
6225 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
6226 Finalization_Size to allow a prefix of any non-class-wide type.
6227 * sem_attr.ads Modify comment for Finalization_Size to include
6228 definite type use case.
6230 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6232 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
6233 on procedures that are wrappers created for entries that have
6235 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
6236 body is an entry_wrapper, compile it in the context of the
6237 synchronized type, because a precondition may refer to funtions
6239 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
6241 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
6242 within an Entry_Wrapper this is an external call whose target
6243 is the synchronized object that is the actual in the call to
6246 2017-01-06 Yannick Moy <moy@adacore.com>
6248 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
6249 in tree, which means not analyzing the previous prefix if the node has
6250 been rewritten into its prefix.
6252 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6254 * s-tpobop.adb: Minor reformatting.
6256 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6258 * checks.adb (Ensure_Valid): Do not generate a validity check
6259 within a generated predicate function, validity checks will have
6260 been applied earlier when required.
6262 2017-01-06 Tristan Gingold <gingold@adacore.com>
6264 * s-tpoben.ads (Protection_Entries): Add comment and reorder
6265 components for performances.
6266 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
6269 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6271 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
6272 If expression is compile-time known and obeys a static predicate
6273 it must be labelled as static, to prevent spurious warnings and
6274 run-time errors, e.g. in case statements. This is relevant when
6275 the expression is the result of constant-folding a type conversion
6276 whose expression is a variable with a known static value.
6278 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6280 * exp_attr.adb, sem_attr.ads: Minor reformatting.
6282 2017-01-06 Justin Squirek <squirek@adacore.com>
6284 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
6285 expansion of Finalization_Size attribute.
6286 * sem_attr.adb (Analyze_Attribute): Add entry to check the
6287 semantics of Finalization_Size.
6288 (Eval_Attribute): Add null entry for Finalization_Size.
6289 * sem_attr.ads: Add Finalization_Size to the implementation
6290 dependent attribute list.
6291 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
6293 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6295 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
6296 iterator specification with a serious syntactic error, transform
6297 construct into an infinite loop in order to continue analysis
6298 and prevent a compiler abort.
6300 2017-01-06 Tristan Gingold <gingold@adacore.com>
6302 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
6303 max_queue_lengths_array if unused.
6305 2017-01-06 Bob Duff <duff@adacore.com>
6307 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
6308 array access, in case "\" is at the end of Text.
6309 * stylesw.adb (Set_Style_Check_Options): Don't include input
6310 characters in the error message template, because they could
6311 be control characters such as "\", which Errout will try to
6314 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6316 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
6317 For a private type examine the visible declarations that follow
6318 the partial view, not just the private declarations that follow
6321 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6323 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
6326 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6328 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
6329 alias of the inherited op is the parent iterator, no need to
6330 examine dispatch table positions which might not be established
6331 yet if type is not frozen.
6332 * sem_disp.adb (Check_Controlling_Formals): The formal of a
6333 predicate function may be a subtype of a tagged type.
6334 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
6335 of representation items for the completion of a type extension
6336 where a predicate applies to the partial view.
6337 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
6338 parameter that designates function whose actual receives a
6339 predicate check, to improve warning message when the check will
6340 lead to infinite recursion.
6341 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
6342 Apply_Predicate_Check.
6344 2017-01-06 Tristan Gingold <gingold@adacore.com>
6346 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
6347 Gnat_Extended_Ravenscar.
6348 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
6350 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6352 * sem_util.ads: Minor typo fix and reformatting.
6354 2017-01-06 Yannick Moy <moy@adacore.com>
6356 * ghost.adb Minor fixing of references to SPARK RM.
6357 (Check_Ghost_Context): Check whether reference is to a lvalue
6358 before issuing an error about violation of SPARK RM 6.9(13)
6359 when declaration has Ghost policy Check and reference has Ghost
6361 * sem_util.adb Minor indentation.
6362 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
6363 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
6364 * sem_util.ads (Unique_Defining_Entity): Document the result
6365 for package body stubs.
6367 2017-01-06 Tristan Gingold <gingold@adacore.com>
6369 * raise-gcc.c (abort): Macro to call Abort_Propagation.
6370 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
6372 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6373 Do not generate the Entry_Max_Queue_Lengths_Array if all default
6375 * exp_util.adb (Corresponding_Runtime_Package): Consider
6376 Max_Queue_Length pragma.
6378 2017-01-06 Justin Squirek <squirek@adacore.com>
6380 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6381 Remove declaration generation in the case of
6382 System_Tasking_Protected_Objects_Single_Entry being used,
6383 and add a warning message when this is detected to occur.
6384 (Make_Initialize_Protection): Remove reference pass in the case
6385 of System_Tasking_Protected_Objects_Single_Entry.
6386 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
6387 * s-tposen.adb (Initialize_Protection_Entry): Remove
6388 Entry_Queue_Max parameter.
6389 * s-tposen.ads: Remove the types use to store the entry queue
6391 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
6393 2017-01-06 Yannick Moy <moy@adacore.com>
6395 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
6396 behavior of function, to also accept out of range positions
6397 and raise Constraint_Error in such case, and to copy sloc from
6398 literal if No_Location passed as location.
6399 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
6400 of functions to raise Constraint_Error in case of value not in
6403 2017-01-06 Tristan Gingold <gingold@adacore.com>
6405 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
6406 Invalidate_Stack_Cache.
6408 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
6410 * s-os_lib.adb: Minor fix to the signature of Readlink.
6412 2017-01-06 Javier Miranda <miranda@adacore.com>
6414 * sem_ch6.adb (Conforming_Types): Handle another
6415 confusion between views in a nested instance with an actual
6416 private type whose full view is not in scope.
6418 2017-01-06 Arnaud Charlet <charlet@adacore.com>
6420 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
6421 mark a rewritten if statement as explicit (Comes_From_Source).
6423 2017-01-06 Gary Dismukes <dismukes@adacore.com>
6425 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
6427 2017-01-06 Tristan Gingold <gingold@adacore.com>
6429 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
6431 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6433 * sem_case.adb: Minor reformatting.
6435 2017-01-06 Thomas Quinot <quinot@adacore.com>
6437 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
6439 2017-01-06 Justin Squirek <squirek@adacore.com>
6441 * aspects.adb: Register aspect in Canonical_Aspect.
6442 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
6443 into respective tables.
6444 * einfo.ads, einfo.adb: Add a new attribute for
6445 handling the parameters for Pragma_Max_Entry_Queue
6446 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
6447 for accessing and setting were added as well.
6448 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
6449 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
6450 declaration for pramga arguments and store them in the protected
6452 (Make_Initialize_Protection): Pass a reference to
6453 the Entry_Max_Queue_Lengths_Array in the protected type node to
6455 * rtsfind.adb: Minor grammar fix.
6456 * rtsfind.ads: Register new types taken from the
6457 runtime libraries RE_Protected_Entry_Queue_Max and
6458 RE_Protected_Entry_Queue_Max_Array
6459 * s-tposen.adb, s-tpoben.adb
6460 (Initialize_Protection_Entry/Initialize_Protection_Entries):
6461 Add extra parameter and add assignment to local object.
6462 * s-tposen.ads, s-tpoben.ads: Add new types to
6463 store entry queue maximums and a field to the entry object record.
6464 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
6465 for Aspect_Max_Queue_Length.
6466 (Check_Aspect_At_Freeze_Point):
6467 Add aspect to list of aspects that don't require delayed analysis.
6468 * sem_prag.adb (Analyze_Pragma): Add case statement for
6469 Pragma_Max_Queue_Length, check semantics, and register arugments
6470 in the respective entry nodes.
6471 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
6472 and Has_Max_Queue_Length
6473 * snames.ads-tmpl: Add constant for the new aspect-name
6474 Name_Max_Queue_Length and corrasponding pragma.
6476 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6478 * exp_util.adb (Is_Controlled_Function_Call):
6479 Reimplemented. Consider any node which has an entity as the
6480 function call may appear in various ways.
6482 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6484 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
6485 an unchecked type conversion when performing a view conversion
6486 to/from a private type. In all other cases use a regular type
6487 conversion to ensure that any relevant checks are properly
6490 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
6492 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
6494 2017-01-06 Ed Schonberg <schonberg@adacore.com>
6496 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
6497 error on case expression that is an entity, when coverage is
6498 incomplete and entity has a static value obtained by local
6500 (Handle_Static_Predicate): New procedure, subsidiary of
6501 Check_Choices, to handle case alternatives that are either
6502 subtype names or subtype indications involving subtypes that
6503 have static predicates.
6505 2017-01-06 Thomas Quinot <quinot@adacore.com>
6507 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
6508 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
6510 2017-01-06 Bob Duff <duff@adacore.com>
6512 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
6513 Elaborate_All(P) to P itself. That could happen in obscure cases,
6514 and always introduced a cycle (P body must be elaborated before
6516 * lib-writ.ads: Comment clarification.
6517 * ali-util.ads: Minor comment fix.
6518 * ali.adb: Minor reformatting.
6520 2017-01-06 Tristan Gingold <gingold@adacore.com>
6522 * a-exexpr-gcc.adb: Improve comment.
6524 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
6526 * s-linux-mips.ads: Use correct signal and errno constants.
6527 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
6529 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
6531 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
6532 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
6535 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
6537 * gnatvsn.ads: Bump copyright year.
6539 2017-01-01 Jakub Jelinek <jakub@redhat.com>
6541 * gnat_ugn.texi: Bump @copying's copyright year.
6542 * gnat_rm.texi: Likewise.
6544 Copyright (C) 2017 Free Software Foundation, Inc.
6546 Copying and distribution of this file, with or without modification,
6547 are permitted in any medium without royalty provided the copyright
6548 notice and this notice are preserved.