[17/77] Add an int_mode_for_size helper function
[official-gcc.git] / gcc / ada / ChangeLog
blob633ca11e4cede5aab5a1197ad6d570706dcbf041
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/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
6         instead of mode_for_size.
7         (gnat_to_gnu_subprog_type): Likewise.
8         * gcc-interface/utils.c (make_type_from_size): Likewise.
10 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
11             Alan Hayward  <alan.hayward@arm.com>
12             David Sherwood  <david.sherwood@arm.com>
14         * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
15         (fp_size_to_prec): Likewise.
17 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
18             Alan Hayward  <alan.hayward@arm.com>
19             David Sherwood  <david.sherwood@arm.com>
21         * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
22         <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
24 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
25             Alan Hayward  <alan.hayward@arm.com>
26             David Sherwood  <david.sherwood@arm.com>
28         * gcc-interface/decl.c (validate_size): Update use of
29         GET_MODE_WIDER_MODE, forcing a wider mode to exist.
31 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
32             Alan Hayward  <alan.hayward@arm.com>
33             David Sherwood  <david.sherwood@arm.com>
35         * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
36         (fp_size_to_prec): Likewise.
38 2017-08-29  Martin Liska  <mliska@suse.cz>
40         PR other/39851
41         * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
43 2017-08-08  Martin Liska  <mliska@suse.cz>
45         * gcc-interface/trans.c: Include header files.
47 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
49         * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
50         as new argument to the imported_module_or_decl debug hook.
52 2017-07-25  Javier Miranda  <miranda@adacore.com>
54         * checks.adb (Apply_Divide_Checks): Ensure that operands are not
55         evaluated twice. 
57 2017-07-19  Jakub Jelinek  <jakub@redhat.com>
59         * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
60         TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
61         (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
63 2017-07-18  Mike Frysinger  <vapier@chromium.org>
65         * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
66         (../../gnatlink$(exeext)): Likewise.
68 2017-07-15  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>
70         PR ada/81446
71         * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
72         (Backend_Overflow_Checks): Set to True.
74 2017-06-23  Jakub Jelinek  <jakub@redhat.com>
76         * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
78 2017-06-21  Pierre-Marie de Rodat  <derodat@adacore.com>
80         * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
81         notice.  New macro.
82         * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
83         as a definition.
84         (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
85         definition.
86         * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
87         imported subprograms for the current compilation unit as
88         definitions.  Disable debug info for references to variables.
89         * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
90         * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
91         not built-in functions to their binding scope.
92         (create_subprog_decl): Add a DEFINITION parameter.  If it is true, tag
93         the function as a definition.  Update all callers.
94         (gnat_write_global_declarations): Emit debug info for imported
95         functions.  Filter out external variables for which debug info
96         is disabled.
98 2017-06-15  Nicolas Boulenguez  <nicolas.boulenguez@free.fr>
100         PR ada/81105
101         * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
102         (i[3456]86-pc-gnu): Likewise.
103         (x86_64 kfreebsd): Likewise.
105 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
107         PR bootstrap/80897
108         * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
110 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
112         PR ada/81070
113         * s-interr-hwint.adb: Reinstate.
114         * gcc-interface/Makefile.in (RTEMS): Use it again.
116 2017-06-08  Olivier Hainque  <hainque@adacore.com>
118         * vx_crtbegin_auto.c: Update year in copyright notice.
119         * vx_crtbegin.c: Likewise.
120         * vx_crtbegin.inc: Likewise. 
121         * vx_crtend.c:  Likewise.
123 2017-06-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
125         * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
126         * s-tpopsp-rtems.adb: Delete.
128 2017-06-02  Olivier Hainque  <hainque@adacore.com>
130         * vx_crtbegin_auto.c: New file.
131         * vx_crtbegin.c: New file.
132         * vx_crtbegin.inc: New file.
133         * vx_crtend.c: New file.
135 2017-05-25  Jonathan Wakely  <jwakely@redhat.com>
137         * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
138         const qualifiers that cause -Wignored-qualifiers warnings.
140 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
142         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
143         for Itypes that are E_Access_Subtype.
144         <E_Access_Subtype>: Use the DECL of the base type directly.
146 2017-05-22  Ed Schonberg  <schonberg@adacore.com>
147             Eric Botcazou  <ebotcazou@adacore.com>
149         * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
150         limited view may appear in the profile of a function, and a call to
151         that function in another unit in which the full view is available must
152         use this full view to spurious type errors at the point of call.
153         * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
154         of parent body with a with clause for the main unit.
155         * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
156         (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
157         types declared in external units like types from limited with clauses.
158         Adjust final processing of defer_limited_with_list accordingly.
159         * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
160         again to translate the prefix after the field if it is incomplete.
162 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
164         * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
165         alignment for simple volatile fields and remove associated errors.
167 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
169         * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
170         * gcc-interface/trans.c (get_elaboration_procedure): Make static.
172 2017-05-15  Pierre-Marie de Rodat  <derodat@adacore.com>
174         * gcc-interface/utils.c (can_materialize_object_renaming_p):
175         Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
176         process Original_Node instead of expanded names.
178 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
180         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
181         addressability check in the constrained case.
183 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
185         * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
186         types not coming from a limited context.
188 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
190         * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
191         the inlined list that are not public.
192         * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
193         there is a pragma Inline_Always on the subprogram.
195 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
197         * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
198         <N_Allocator>: Use properly typed constants.
199         (extract_values): Move around.
200         (pos_to_constructor): Minor tweaks.
201         (Sloc_to_locus): Fix formatting.
202         * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
203         * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
204         (Gigi_Equivalent_Type): Adjust head comment.
205         * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
207 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
209         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
210         is a representation clause on an extension, propagate the alignment of
211         the parent type only if the platform requires strict alignment.
213 2017-05-12  Eric Botcazou  <ebotcazou@adacore.com>
215         * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
216         instead of Word_Size.
218         Revert
219         2017-03-28  Andreas Schwab  <schwab@suse.de>
221         PR ada/80117
222         * system-linux-aarch64-ilp32.ads: New file.
223         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
224         from LIBGNAT_TARGET_PAIRS.
225         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
226         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
227         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
228         or -mabi=ilp32, resp.
230 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
232         PR ada/80626
233         * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
234         instead of Word_Size.
236 2017-05-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
238         * raise-gcc.c (exception_class_eq): Make ec parameter const.
240 2017-05-02  Richard Biener  <rguenther@suse.de>
242         * gcc-interface/misc.c (gnat_post_options): Do not set
243         -fstrict-overflow.
245 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
247         * gcc-interface/trans.c (assoc_to_constructor): Make sure
248         Corresponding_Discriminant is only called on discriminants.
249         Skip the saving of the result only for them.
250         (gnat_to_gnu) <N_Selected_Component>: Likewise.
251         <N_Unchecked_Type_Conversion>: Translate the result type first.
252         (gigi): Set TREE_NOTHROW on Begin_Handler.
253         (stmt_list_cannot_raise_p): New predicate.
254         (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
255         a cleanup if the statements of the handler cannot raise.
256         (process_freeze_entity): Use Is_Record_Type.
257         (process_type): Likewise.
259 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
261         * einfo.ads (Corresponding_Record_Component): New alias
262         for Node21 used for E_Component and E_Discriminant.
263         * einfo.adb (Corresponding_Record_Component): New function.
264         (Set_Corresponding_Record_Component): New procedure.
265         (Write_Field21_Name): Handle Corresponding_Record_Component.
266         * sem_ch3.adb (Inherit_Component): Set
267         Corresponding_Record_Component for every component in
268         the untagged case.  Clear it afterwards for non-girder
269         discriminants.
270         * gcc-interface/decl.c (gnat_to_gnu_entity)
271         <E_Record_Type>: For a derived untagged type with discriminants
272         and constraints, apply the constraints to the layout of the
273         parent type to deduce the layout.
274         (field_is_aliased): Delete.
275         (components_to_record): Test DECL_ALIASED_P directly.
276         (annotate_rep): Check that fields are present except for
277         an extension.
278         (create_field_decl_from): Add DEBUG_INFO_P
279         parameter and pass it in recursive and other calls.  Add guard
280         for the manual CSE on the size.
281         (is_stored_discriminant): New predicate.
282         (copy_and_substitute_in_layout): Consider only
283         stored discriminants and check that original fields are present
284         in the old type.  Deal with derived types.  Adjust call to
285         create_variant_part_from.
287 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
289         * exp_ch6.adb (Expand_Call_Helper): When locating the
290         accessibility entity created for an access parameter, handle
291         properly a reference to a formal of an enclosing subprogram. if
292         the reference appears in an inherited class-wide condition, it
293         is the rewriting of the reference in the ancestor expression,
294         but the accessibility entity must be that of the current formal.
296 2017-05-02  Javier Miranda  <miranda@adacore.com>
298         * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
299         (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
300         Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
301         Call Expand_Non_Binary_Modular_Op.
303 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
305         * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
306         has discriminants, do not override the Stored_Constraint list of
307         the full view of the derived type with that of the derived type.
309 2017-05-02  Bob Duff  <duff@adacore.com>
311         * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
313 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
315         * s-os_lib.ads: Minor typo fix.
317 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
319         * gnatls.adb: Merge and refactor code from Prj.Env and remove
320         this deprecated dependency.
322 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
324         * exp_util.ads: minor comment addition.
326 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
328         * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
329         pastos in part #3 of the head comment.
331 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
333         * exp_ch3.adb (Freeze_Type): Do not generate an invariant
334         procedure body for a local (sub)type declaration within a
335         predicate function. Invariant checks do not apply to these, and
336         the expansion of the procedure will happen in the wrong scope,
337         leading to misplaced freeze nodes.
339 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
341         * exp_util.adb (Insert_Library_Level_Action): Use proper scope
342         to analyze generated actions.  If the main unit is a body,
343         the required scope is that of the corresponding unit declaration.
345 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
347         * einfo.adb (Declaration_Node): flip branches of
348         an IF statement to avoid repeated negations in its condition;
349         no change in semantics, only to improve readability.
351 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
353         * sem_case.adb: Remove extra spaces in parameter declarations.
355 2017-05-02  Justin Squirek  <squirek@adacore.com>
357         * usage.adb: Replace space with hyphen ("run time" -> "run-time")
358         in usage line for new -gnatwE switch.
360 2017-05-02  Claire Dross  <dross@adacore.com>
362         * a-cofuve.ads (Remove): Remove unnecessary
363         conditions in precondition.
365 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
367         * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
368         sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
370 2017-05-02  Justin Squirek  <squirek@adacore.com>
372         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
373         alternative expression.
374         * sem_res.adb (Resolve_Case_Expression): Ditto.
376 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
378         * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
379         Refine predicate for the case where the primitive operation
380         is a renaming of equality.  An overriding operation that is
381         a user-defined renaming of predefined equality inherits its
382         slot from the overridden operation. Otherwise it is treated
383         as a predefined op and occupies the same predefined slot as
384         equality. A call to it is transformed into a call to its alias,
385         which is the predefined equality. A dispatching call thus uses
386         the proper slot if operation is further inherited and called
387         with class-wide arguments.
389 2017-05-02  Justin Squirek  <squirek@adacore.com>
391         * errout.adb (Set_Msg_Text): Add a case to switch the message
392         type when the character '[' is detected signifying a warning
393         about a run-time exception.
394         * opt.ads Add a new Warning_Mode value for new switch
395         * switch-b.adb (Scan_Binder_Switches): Add case for the binder
396         to handle new warning mode
397         * usage.adb (Usage): Add usage entry for -gnatwE
398         * warnsw.adb (Set_Warning_Switch): Add case for the new switch
400 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
402         * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
403         declaration that operates on some fixed point type.
405 2017-05-02  Justin Squirek  <squirek@adacore.com>
407         * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
409 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
411         * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
413 2017-05-02  Justin Squirek  <squirek@adacore.com>
415         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
416         expression (Analyze_If_Expression): Add check for valid condition
417         * sem_eval.adb (Eval_Case_Expression): Add check for error posted
418         on case-expression
419         * sem_res.adb (Resolve_If_Expression): Add check for valid
420         condition and then-expression.
422 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
424         * exp_ch3.adb (Build_Initialization_Call): Generate a null
425         statement if the initialization call is a null procedure, as
426         can happen with a controlled type with no explicit Initialize
427         procedure, or an array of such.
428         * exp_ch7.adb (Process_Object_Declaration): For a type with
429         controlled components that has a trivial Initialize procedure,
430         insert declaration for finalization counter after object
431         declaration itself.
432         (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
433         finalization block and attendant declarations if component has
434         a trivial Initialize procedure.
435         (Make_Init_Call): Do not generate a call if controlled type has
436         a trivial Initialize procedure.
438 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
440         * g-forstr.ads (Data): Move Format component last.
441         * g-forstr.adb ("+"): Adjust for above change.
442         * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
443         * g-sechas.ads (Context): Move Key last.
444         * g-socket.ads (Service_Entry_Type): Move Aliases last.
445         * s-fileio.adb (Temp_File_Record): Move Name last.
446         * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
447         * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
449 2017-05-02  Jerome Lambourg  <lambourg@adacore.com>
451         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
452         switch introduced recently. finally not needed.
454 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
456         * sem_ch6.adb (Analyze_Null_Procedure): Set the
457         Corresponding_Body link for a null procedure declaration.
459 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
461         * atree.h (Flag290): Add missing terminating parenthesis.
462         * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
463         (Set_Is_Class_Wide_Clone): Likewise.
464         * einfo.ads (Is_Class_Wide_Clone): Likewise.
466 2017-05-02  Gary Dismukes  <dismukes@adacore.com>
468         * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
469         parameter Array_Comp to indicate the case of an array object
470         with null-excluding components.
471         * checks.adb (Null_Exclusion_Static_Checks):
472         Call Compile_Time_Constraint_Error instead of
473         Apply_Compile_Time_Constraint_Error in the component case. Also
474         call that when Array_Comp is True, with an appropriate warning for
475         the array component case. Only create an explicit initialization
476         by null in the case of an object of a null-excluding access type
477         (and no longer do that in the component case).
478         * sem_ch3.adb (Check_Component): Add a Boolean parameter
479         Array_Comp defaulted to False.  Pass Empty for the Comp
480         actual when calling Null_Exclusion_Static_Checks in the case
481         where Comp_Decl matches Object_Decl, because we don't have a
482         component in that case. In the case of an object or component
483         of an array type, pass True for Array_Comp on the recursive call
484         to Check_Component.
486 2017-05-02  Bob Duff  <duff@adacore.com>
488         * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
489         compute the linux priority from the Ada priority. Call this everywhere
490         required. In particular, the previous version was not doing this
491         computation when setting the ceiling priority in various places. It
492         was just converting to C.int, which results in a ceiling that is off
493         by 1.
495 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
497         * sem_ch3.adb: Comment predicate inheritance.
499 2017-05-02  Tristan Gingold  <gingold@adacore.com>
501         * s-trasym.ads: Add comment.
503 2017-05-02  Bob Duff  <duff@adacore.com>
505         * sem_elab.adb, sem_elab.ads: Minor comment fixes.
506         * sem_ch4.adb: Minor reformatting.
507         * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
508         * s-taspri-posix-noaltstack.ads: Minor refactoring.
509         * sinput.ads: Minor typo fix.
511 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
513         * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
514         * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
515         here from exp_ch9, to recognize objects whose creation requires
516         dynamic allocation, so that the proper warning can be emitted
517         when restriction No_Implicit_Heap_Allocation is in effect.
518         * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
519         to emit proper warning when an object that requires dynamic
520         allocation is declared.
522 2017-05-02  Tristan Gingold  <gingold@adacore.com>
524         * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
526 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
528         * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
529         visibility rules for equality operators that apply within an
530         instantiation apply within an inlined body.
531         * sem_type.adb (Add_One_Interp): ditto.
533 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
535         * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
536         procedures.
538 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
540         * snames.ads-tmpl
541         (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
542         Name_No_Tagged_Streams): Move to regular pragmas.  Add
543         placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
544         and Secondary_Stack_Size.
545         (Pragma_Id): Move Pragma_Assume,
546         Pragma_Attribute_Definition, Pragma_Loop_Optimize and
547         Pragma_No_Tagged_Streams to second part.
549 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
551         * exp_attr.adb: Minor reformatting.
553 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
555         * sem_ch4.adb (Analyze_Selected_Component): Improve error
556         detection for illegal references to private components or
557         operations of a protected type in the body of the type.
559 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
561         * opt.ads: Add missing GNAT markers in comments.
562         * opt.adb (Set_Opt_Config_Switches): Do not override earlier
563         settings of Optimize_Alignment at the end.
565 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
567         * checks.adb (Apply_Constraint_Check): Do not apply
568         a discriminant check when the associated type is a constrained
569         subtype created for an unconstrained nominal type.
570         * exp_attr.adb: Minor reformatting.
572 2017-05-02  Bob Duff  <duff@adacore.com>
574         * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
575         the N_Raise_Expression case.
576         * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
577         and add assertions.
579 2017-05-02  Yannick Moy  <moy@adacore.com>
581         * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
582         optimize length comparison in GNATprove mode.
583         * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
584         operator /= into negation of operator = when needed.
585         (Expand_SPARK): Call new
586         function to expand operator /=.
588 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
590         * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
591         Simplify the expression for a fixed-fixed division to remove
592         divisions by constants whenever possible, as an optimization
593         for restricted targets.
595 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
597         * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
599 2017-05-02  Bob Duff  <duff@adacore.com>
601         * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
602         to find primitive ops, instead of using an Identifier that will
603         later be looked up. This is necessary because these ops are not
604         necessarily visible at all places where we need to call them.
605         * exp_util.ads: Minor comment fix.
607 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
609         * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
610         references are fully conformant if they are both expansions
611         of the discriminant of a protected type, within one of the
612         protected operations. One occurrence may be expanded into a
613         constant declaration while the other is an input parameter to
614         the corresponding generated subprogram.
616 2017-05-02  Justin Squirek  <squirek@adacore.com>
618         * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
619         recursivly searching composite-types for null-excluding access
620         types and verifying them.
621         (Analyze_Object_Declaration): Add a
622         call to Check_Null_Excluding_Components for static verification
623         of non-initialized objects.
624         * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
625         a parameter for a composite-type's component and an extra case
626         for printing component information.
628 2017-05-02  Yannick Moy  <moy@adacore.com>
630         * sem_ch10.adb (Analyze_Subunit): Take
631         configuration pragma into account when restoring appropriate
632         pragma for analysis of subunit.
634 2017-05-02  Justin Squirek  <squirek@adacore.com>
636         * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
637         s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
638         g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
639         clauses from the runtime.
641 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
643         * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
644         array components specially.
646 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
648         * sem_ch8.adb (Premature_Usage): If the premature usage of
649         an entity is as the expression in its own object decaration,
650         rewrite the reference as Any_Id to prevent cascaded errors or
651         compiler loops when such an entity is used in an address clause.
653 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
655         * gcc-interface/decl.c (components_to_record): Add missing guard.
657 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
659         * gcc-interface/decl.c (components_to_record): Add more comments.
660         Put back pending fields onto the regular list if the misalignment
661         happens to cancel itself.
663 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
665         * sem_ch4.adb (Complete_Object_Operation): When rewriting the
666         controlling actual in a prefixed call, preserve the original node
667         information if the prefix itself has been rewritten, for ASIS use.
669 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
671         * exp_ch6.adb (Insert_Post_Call_Actions):
672         Code clean up. Insert the post-call actions after an enclosing
673         procedure call when N denotes a function call and appears as an
674         actual parameter in the procedure call.
676 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
678         * freeze.adb (Check_Component_Storage_Order): If there is a clause
679         for the component, also reject the attribute if the component
680         doesn't end on a byte boundary and its scalar storage order is
681         different from that of the enclosing record type.
683 2017-04-28  Javier Miranda  <miranda@adacore.com>
685         * atree.ads (Info_Messages): Removed.
686         (Warning_Info_Messages): New counter.
687         (Report_Info_Messages): New counter.
688         * err_vars.ads Update documentation.
689         * errout.adb (Delete_Warning_And_Continuations): Update
690         Info_Message occurrences.
691         (Error_Msg_Internal): Update Info_Message occurrences.
692         (Delete_Warning): Update Info_Message occurrences.
693         (Write_Error_Summary): Update Info_Message occurrences.
694         (Output_Messages): Update Info_Message occurrences.
695         (To_Be_Removed): Update Info_Message occurrences.
696         (Reset_Warnings): Update Info_Message occurrences.
697         * errutil.adb (Error_Msg): Update Info_Message occurrences.
698         (Finalize): Update Info_Message occurrences.
699         (Initialize): Update Info_Message occurrences.
700         * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
701         (Compilation_Errors): Update Info_Message_Occurences.
703 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
705         * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
706         * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
707         * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
708         * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
709         * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
710         * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
711         Y_Size.
712         * sem_eval.adb (Why_Not_Static): Initialize Typ.
713         * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
715 2017-04-28  Bob Duff  <duff@adacore.com>
717         * sem_util.ads, sem_util.adb (Might_Raise): New function
718         that replaces Is_Exception_Safe, but has the opposite
719         sense. Is_Exception_Safe was missing various cases -- calls inside
720         a pragma Debug, calls inside an 'if' or assignment statement,
721         etc. Might_Raise now walks the entire subtree looking for things
722         that can raise.
723         * exp_ch9.adb (Is_Exception_Safe): Remove.
724         (Build_Protected_Subprogram_Body): Replace call to
725         Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
726         constants where possible).
727         * exp_ch7.adb: Rename Is_Protected_Body -->
728         Is_Protected_Subp_Body. A protected_body is something different
729         in the grammar.
731 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
733         * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
734         * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
735         (P_Discrete_Choice_List): Initialize Expr_Node variable.
736         * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
737         (P_Protected): Likewise.
738         * sem_case.adb (Check_Duplicates):
739         Add pragma Warnings on variable.
740         * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
741         * sem_ch4.adb (List_Operand_Interps):  Add pragma Warnings on variable.
742         * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
743         (Analyze_Exit_Statement): Initialize Scope_Id variable.
744         (Analyze_Iterator_Specification): Initialize Bas variable.
745         * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
746         Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
747         (Analyze_Accept_Statement): Initialize Task_Nam.
749 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
751         * checks.adb (Install_Primitive_Elaboration_Check):
752         Do not generate an elaboration check if all checks have been
753         suppressed.
755 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
757         * sem_ch13.adb (Analyze_Aspect_Specifications, case
758         Interrupt_Handler and Attach_Handler): Generate reference
759         to protected operation to prevent spurious warnings about
760         unreferenced entities. Previous scheme failed with style checks
761         enabled.
763 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
765         * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
766         that follows an expression function must not be relocated to
767         the generated body, because it applies to the code that follows.
769 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
771         * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
772         Relaxed_RM_Semantics to avoid having CodePeer issue errors on
773         code that might violate the more stringent checking for 'Access
774         introduced in Ada 2005.
776 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
778         * a-cforse.adb: minor style fix in comment.
780 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
782         * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
783         initialize Block_Decls variable.
784         (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
785         (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
786         * exp_disp.adb (Expand_Interface_Actuals): Initialize
787         Formal_DDT and Actual_DDT variables.
788         (Expand_Interface_Thunk): Initialize Iface_Formal.
789         (Make_DT): Initialize Size_Comp.
790         (Make_Select_Specific_Data_Table): Initialize Decls.
791         * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
792         Also initialize more RPC_Receiver_* variables.
793         (Build_To_Any_Function): Initialize Cstr_Formal.
794         * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
796 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
798         * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
799         node between access types, freeze the designated type as well,
800         so that dispatch table pointers are created in the proper scope,
801         and not in the constructed body of the expression function.
803 2017-04-28  Bob Duff  <duff@adacore.com>
805         * alloc.ads (Nodes_Initial): Go back to previous value. The large
806         value makes large compilations faster, but small compilations slower.
808 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
810         * sem_util.adb: minor typos in Is_Child_Or_Sibling.
812 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
814         * erroutc.adb (Compilation_Errors): Do not consider info messages
815         as suitable warnings when warnings must be treated as errors.
816         * sem_ch7.adb (Analyze_Package_Specification): Do not consider
817         internally-generated packages when outputting completion
818         information.
819         * errout.adb (Output_Messages): Do not consider info messages as
820         suitable warnings when warnings must be treated as errors.
821         * errutil.adb (Finalize): Do not consider info messages as
822         suitable warnings when warnings must be treated as errors.
824 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
826         * warnsw.ads: Minor fix for incorrect wording in comment.
828 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
830         * sem_res.adb (In_Instance_Code): New predicate in
831         Valid_Conversion, to determine whether a type conversion appears
832         as (or within) an actual for a formal object.  Type conversions
833         in instances are not rechecked in Valid_Conversion because
834         visibility changes between generic location andi instance may
835         lead to spurious errors, but conversions within an actual must be
836         fully checked, and they are not fully resolved when pre-analyzing
837         the actuals.
839 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
841         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
842         New_Copy_Tree instead of Relocate_Node as any subsequent copies
843         of the relocated node will have mangled Parent pointers.
844         * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
845         tables used in conjunction with entity and itype replication.
846         (Visit_Entity): Rewrite the restriction on which entities
847         require duplication.  The restriction now includes all types.
849 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
851         * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
852         a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
853         a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
854         cleanups.
856 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
858         * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
859         gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
861 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
863         * exp_util.adb: Minor reformatting.
865 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
867         * sem_ch4.adb: Fix copy/pasto.
869 2017-04-27  Tristan Gingold  <gingold@adacore.com>
871         * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
872         raise-gcc.c. Fix include search path for raise-gcc.c
874 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
876         * fe.h (Warn_On_Questionable_Layout): Declare.
877         * warnsw.ads (Warn_On_Record_Holes): Move down.
878         (Warn_On_Questionable_Layout): New boolean variable.
879         (Warning_Record): Add Warn_On_Questionable_Layout field.
880         * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
881         (Restore_Warnings): Likewise.
882         (Save_Warnings): Likewise.
883         (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
884         * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
885         components_to_record.
886         (gnu_field_to_gnat): New function.
887         (warn_on_field_placement): Likewise.
888         (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
889         parameters.  Rename local variables and adjust recursive call.
890         Rework final scan of the field list and implement warnings on the
891         problematic placement of specific sorts of fields.
893 2017-04-27  Bob Duff  <duff@adacore.com>
895         * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
896         * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
897         * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
898         * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
899         * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
900         * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
901         For efficiency, cache results of Is_Internal_File_Name and
902         Is_Predefined_File_Name in the Units table. This avoids a lot
903         of repeated text processing.
905 2017-04-27  Emmanuel Briot  <briot@adacore.com>
907         * g-comlin.adb (Sort_Sections): remove useless test.
909 2017-04-27  Claire Dross  <dross@adacore.com>
911         * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
912         allow the use of regular equality over elements in contracts.
913         (Formal_Model): Ghost package containing model functions that are
914         used in subprogram contracts.
915         (Current_To_Last): Removed, model functions should be used instead.
916         (First_To_Previous): Removed, model functions should be used instead.
917         (Strict_Equal): Removed, model functions should be used instead.
918         (No_Overlap): Removed, model functions should be used instead.
919         (Equivalent_Keys): Functions over cursors are removed. They were
920         awkward with explicit container parameters.
921         * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
922         allow the use of regular equality over elements in contracts.
923         (Formal_Model): Ghost package containing model functions that
924         are used in subprogram contracts.
925         (Current_To_Last): Removed, model functions should be used instead.
926         (First_To_Previous): Removed, model functions should be used instead.
927         (Strict_Equal): Removed, model functions should be used instead.
928         (No_Overlap): Removed, model functions should be used instead.
930 2017-04-27  Yannick Moy  <moy@adacore.com>
932         * gnat1drv.adb: Code cleanup.
934 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
936         * exp_util.adb (Replace_Entity): The prefix of a 'Result
937         attribute reference in a post- condition is the subprogram to
938         which the condition applies. If the condition is inherited
939         by a type extension, the prefix becomes a reference to the
940         inherited operation, but there is no need to create a wrapper
941         for this operation, because 'Result is expanded independently
942         when elaborating the postconditions.
944 2017-04-27  Bob Duff  <duff@adacore.com>
946         * sinput.adb: Minor code cleanup.
947         * namet.adb (Append): Create faster versions of
948         Append(String) and Append(Name_Id) by using slice assignment
949         instead of loops.
950         * sem_util.adb (In_Instance): Speed this up by removing
951         unnecessary tests; Is_Generic_Instance is defined for all
952         entities.
953         * sem_util.ads, sem_util.adb (In_Parameter_Specification):
954         Remove unused function.
955         * alloc.ads (Nodes_Initial): Use a much larger value, because
956         the compiler was spending a lot of time copying the nodes table
957         when it grows. This number was chosen in 1996, so is rather out
958         of date with current memory sizes. Anyway, it's virtual memory.
959         Get rid of Orig_Nodes_...; use Node_... instead.
960         * atree.adb (Lock): Do not release the Nodes tables; it's a
961         waste of time.
962         Orig_Nodes_ ==> Nodes_
963         * nlists.adb: Orig_Nodes_ ==> Nodes_
964         * g-table.adb: Remove unused "with" clause.
965         * g-table.ads, table.ads: Remove Big_Table_Type, which should
966         not be used by clients.
967         * g-dyntab.adb (Last_Allocated): New function
968         to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
970 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
972         * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
973         check.
974         (Subtypes_Statically_Match): Remove duplicate check.
975         * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
977 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
979         * exp_aggr.adb (Replace_Type): Remove the special processing
980         for selected components.
981         * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
982         processing for attributes Fixed_Value and Integer_Value.
983         * exp_util.adb (Side_Effect_Free): Merge the processing for
984         qualified expressions, type conversions, and unchecked type
985         conversions.
986         * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
987         and Optional.
988         * par-ch3.adb (P_Declarative_Items): Merge the processing for
989         tokens function, not, overriding, and procedure.
990         * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
991         for qualified expressions, type conversions, and unchecked
992         type conversions.
993         * sem_util.adb (Compile_Time_Constraint_Error): Merge the
994         processing for Ada 83 and instances.
995         (Object_Access_Level): Merge the processing for indexed components
996         and selected components.
997         * uname.adb (Add_Node_Name): Merge the processing for stubs.
999 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1001         * checks.adb (Install_Primitive_Elaboration_Check):
1002         Do not generate the check when restriction No_Elaboration_Code
1003         is in effect.
1005 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1007         * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
1008         of Expand_Dispatching_Call. If the denoted subprogram has a
1009         class-wide precondition, this is the only precondition that
1010         applies to the call, rather that the class-wide preconditions
1011         that may apply to the body that is executed. (This is specified
1012         in AI12-0195).
1014 2017-04-27  Yannick Moy  <moy@adacore.com>
1016         * gnat1drv.adb (Adjust_Global_Switches): Issue
1017         a warning in GNATprove mode if the runtime library does not
1018         support IEEE-754 floats.
1020 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1022         * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
1023         is itself inherited it does not carry any contract information,
1024         so examine its parent operation which is its Alias.
1026 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1028         * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
1029         prefix can be an object reference in which case Obj'Image (X)
1030         can only be interpreted as an indexing of the parameterless
1031         version of the attribute.
1032         * par-ch4.adb (P_Name): An attribute reference can be the prefix of
1033         an indexing or a slice operation if the attribute does not require
1034         parameters. In Ada2012 'Image also belongs in this category,
1035         and A'Image (lo .. hi) is legal and must be parsed as a slice.
1037 2017-04-27  Yannick Moy  <moy@adacore.com>
1039         * exp_ch4.adb: Minor reformatting.
1040         * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
1041         disable the CodePeer and C generation modes. Similar to the
1042         opposite actions done in CodePeer mode.
1044 2017-04-27  Yannick Moy  <moy@adacore.com>
1046         * sem_res.adb: Remove duplicate code.
1047         * sem_attr.adb: Delete duplicate code.
1049 2017-04-27  Bob Duff  <duff@adacore.com>
1051         * g-dyntab.adb: Reduce the amount of copying in
1052         Release. No need to copy items past Last.
1054 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1056         * checks.adb Add with and use clauses for Sem_Disp.
1057         (Install_Primitive_Elaboration_Check): New routine.
1058         * checks.ads (Install_Primitive_Elaboration_Check): New routine.
1059         * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
1060         processing of 'Elaborated.
1061         * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
1062         elaboration check.
1064 2017-04-27  Bob Duff  <duff@adacore.com>
1066         * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
1067         If the table grows and then shrinks back to empty, we won't necessarily
1068         point back to the empty array. Code cleanups.
1069         * sinput.ads: Add 'Base to Size clause to match the declared
1070         component subtypes.
1072 2017-04-27  Claire Dross  <dross@adacore.com>
1074         * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
1075         allow the use of regular equality over elements in contracts.
1076         (Formal_Model): Ghost package containing model functions that
1077         are used in subprogram contracts.
1078         (Current_To_Last): Removed, model functions should be used instead.
1079         (First_To_Previous): Removed, model functions should be used instead.
1080         (Strict_Equal): Removed, model functions should be used instead.
1081         (No_Overlap): Removed, model functions should be used instead.
1082         * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
1083         Boolean generic parameter to disable contracts for equivalence
1084         between keys.
1085         (Witness): Create a witness of a key that is used for handling of
1086         equivalence between keys.
1087         (Has_Witness): Check whether a witness is contained in a map.
1088         (W_Get): Get the element associated to a witness.
1089         (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
1090         directly.
1091         * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
1092         Boolean generic parameter to disable contracts for equivalence
1093         between keys.
1094         * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
1095         of equivalence on functional maps.
1096         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
1097         of equivalence on functional maps.
1099 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1101         * exp_ch9.adb (Expand_Entry_Barrier): Code
1102         cleanup. Do not perform the optimization which removes the
1103         declarations of the discriminant and component renamings when
1104         validity checks on operands and attributes are in effect.
1106 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1108         * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
1109         freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
1110         a-cfhama.ads, a-cofove.ads: Minor reformatting.
1112 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1114         * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
1115         pointer dereference.
1116         * g-spipat.adb (Dump): Code clean up. Protect against a possible
1117         null pointer dereference.
1119 2017-04-27  Bob Duff  <duff@adacore.com>
1121         * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
1122         Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
1123         Free renames Init, since they do the same thing.
1124         * g-table.ads: Default for Table_Low_Bound.
1125         * table.ads: Default for Table_Low_Bound, Table_Initial, and
1126         Table_Increment.
1128 2017-04-27  Bob Duff  <duff@adacore.com>
1130         * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
1131         can reallocate.
1132         * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
1133         * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
1134         Reorder code so that above assertions do not fail.
1135         * table.ads: Remove obsolete comment on Locked.
1137 2017-04-27  Claire Dross  <dross@adacore.com>
1139         * a-cfdlli.ads: Code cleanup.
1141 2017-04-27  Yannick Moy  <moy@adacore.com>
1143         * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
1144         when needed for proof.  (Expand_SPARK): Call the new procedure.
1145         * exp_util.ads Fix typo.
1147 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1149         * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
1150         fixes.
1152 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1154         * sem_elab.adb Add new type Visited_Element
1155         and update the contents of table Elab_Visited.  Various code clean up.
1156         (Check_Elab_Call): Determine whether a prior call to
1157         the same subprogram was already examined within the same context.
1158         (Check_Internal_Call_Continue): Register the subprogram being
1159         called as examined within a particular context. Do not suppress
1160         elaboration warnings.
1162 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1164         * xoscons.adb, osint.ads: Minor reformatting.
1166 2017-04-27  Bob Duff  <duff@adacore.com>
1168         * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
1169         Table_Count_Type --> Table_Last_Type, because the name
1170         was confusing (a "count" usually starts at zero).  Add
1171         functionality supported or needed by other tables packages
1172         (Move, Release_Threshold).
1173         * g-table.ads, g-table.adb: This is now just a thin wrapper
1174         around g-dyntab.ads/g-dyntab.adb.  Add functionality supported
1175         or needed by other tables packages (Save, Restore).
1176         * table.ads, table.adb: This is now just a thin wrapper around
1177         * g-table.ads/g-table.adb.
1178         * namet.h, scos.h, uintp.h: These files are reaching into the
1179         private data of some instances of g-table, whose names changed,
1180         so the above change requires some adjustment here. It now uses
1181         public interfaces.
1183 2017-04-27  Bob Duff  <duff@adacore.com>
1185         * namet.adb, namet.ads: Minor: remove unused procedures.
1187 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
1189         * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
1190         (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
1191         Add pragma Warnings on Rtype variable in nested block.  *
1192         * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
1193         * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
1194         (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
1195         * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
1196         (Process_Component_List_For_Finalize): Initialize Counter_Id.
1197         (Build_Finalize_Statements): Initialize Bod_Stmts.
1198         * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
1200 2017-04-27  Claire Dross  <dross@adacore.com>
1202         * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
1203         allow the use of regular equality over elements in contracts.
1204         (Formal_Model): Ghost package containing model functions that are
1205         used in subprogram contracts.
1206         (Current_To_Last): Removed, model
1207         functions should be used instead.
1208         (First_To_Previous): Removed, model functions should be used instead.
1209         (Strict_Equal): Removed, model functions should be used instead.
1210         (No_Overlap): Removed, model functions should be used instead.
1211         (Equivalent_Keys): Functions over cursors are removed. They were
1212         awkward with explicit container parameters.
1213         * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
1214         (proof only) procedure to help GNATprove when equivalence over
1215         keys is not equality.
1217 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1219         * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
1220         sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
1221         Minor reformatting and code cleanups.
1223 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1225         * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
1226         subsidiary of Check_Inherited_Conditions, to build pragmas for an
1227         operation whose ancestor has classwide pre/postconditions. This
1228         is used both to check the legality of the inheritance in Ada
1229         and in SPARK, and to determine whether a wrapper is needed for
1230         an inherited operation.
1231         * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
1232         Improve placement of error message for inherited classwide
1233         conditions that become illegal on type derivation.
1235 2017-04-27  Yannick Moy  <moy@adacore.com>
1237         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
1238         SPARK_Mode from context on generic package.
1239         * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
1240         useless test.
1242 2017-04-27  Claire Dross  <dross@adacore.com>
1244         * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
1245         overflows in computations.
1246         * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
1247         overflows in computations.
1248         (Insert): Rewrite precondition to avoid overflows in computations.
1249         * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
1250         overflows in computations.
1251         (Insert): Rewrite precondition to avoid overflows in computations.
1253 2017-04-27  Steve Baird  <baird@adacore.com>
1255         * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
1256         flag when it is declared in order to avoid confusing CodePeer about
1257         the possibility of an uninitialized variable read.
1259 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1261         * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
1262         no dimensionality error if the subtype of the expression is
1263         identical to the nominal subtype in the declaration, even though
1264         the expression itself may have been constant-folded and lack a
1265         dimension vector.
1266         * sem_dim.ads: Add comments on setting of dimension vectors and
1267         its interaction with node rewritings and side-effect removal.
1269 2017-04-27  Bob Duff  <duff@adacore.com>
1271         * debug.adb: Minor comment correction.
1272         * sem_dim.ads: Minor reformatting and typo fixes.
1274 2017-04-27  Bob Duff  <duff@adacore.com>
1276         * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
1277         Last of the tables via function calls, rather than relying on layout
1278         of data structures.
1280 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1282         * exp_util.adb: No wrapper in GNATprove mode.
1284 2017-04-27  Yannick Moy  <moy@adacore.com>
1286         * sem_res.adb (Resolve_Comparison_Op): Always
1287         evaluate comparisons between values of universal types.
1289 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1291         * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
1292         an elaboration counter nor a check when in GNATprove mode.
1293         * sem_util.adb (Build_Elaboration_Entity): Do not create an
1294         elaboration counter when in GNATprove mode.
1296 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1298         * freeze.adb: copy-paste typo.
1300 2017-04-27  Yannick Moy  <moy@adacore.com>
1302         * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
1303         Use correct test to detect call in GNATprove mode instead of
1304         compilation.
1306 2017-04-27  Claire Dross  <dross@adacore.com>
1308         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
1309         New property function expressing that the element of a
1310         sequence are contained in the union of two sequences.
1311         (Formal_Model.M_Elements_Included): New property function
1312         expressing that the element of a sequence are another sequence.
1313         (Generic_Sorting): Use new property functions to state that
1314         elements are preserved by Sort and Merge.
1315         * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
1316         allow the use of regular equality over elements in contracts.
1317         (Formal_Model): Ghost package containing model functions
1318         that are used in subprogram contracts.  (Capacity):
1319         On unbounded containers, return the maximal capacity.
1320         (Current_To_Last): Removed, model functions should be used instead.
1321         (First_To_Previous): Removed, model functions should be used instead.
1322         (Append): Default parameter value replaced
1323         by new wrapper to allow more precise contracts.
1324         (Insert): Subprogram restored, it seems it was useful to users even if
1325         it is inefficient.
1326         (Delete): Subprogram restored, it seems it was useful to users even if
1327         it is inefficient.
1328         (Prepend): Subprogram restored, it seems it was useful to users even
1329         if it is inefficient.
1330         (Delete_First): Subprogram restored, it seems it
1331         was useful to users even if it is inefficient.  (Delete_Last):
1332         Default parameter value replaced by new wrapper to allow more
1333         precise contracts.
1334         (Generic_Sorting.Merge): Subprogram restored.
1335         * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
1336         allow the use of regular equality over elements in contracts.
1337         (Formal_Model): Ghost package containing model functions
1338         that are used in subprogram contracts.  (Capacity):
1339         On unbounded containers, return the maximal capacity.
1340         (Current_To_Last): Removed, model functions should be used
1341         instead.
1342         (First_To_Previous): Removed, model functions should be used instead.
1343         (Append): Default parameter value replaced
1344         by new wrapper to allow more precise contracts.
1345         (Insert): Subprogram restored, it seems it was useful to users even if
1346         it is inefficient.
1347         (Delete): Subprogram restored, it seems it was useful to users even if
1348         it is inefficient.
1349         (Prepend): Subprogram restored, it seems it was useful to users even
1350         if it is inefficient.
1351         (Delete_First): Subprogram restored, it seems it
1352         was useful to users even if it is inefficient.  (Delete_Last):
1353         Default parameter value replaced by new wrapper to allow more
1354         precise contracts.
1355         (Generic_Sorting.Merge): Subprogram restored.
1356         (Vector): Do not reuse formal vectors, as it is no longer possible
1357         to supply them with an equality function over elements.
1359 2017-04-27  Bob Duff  <duff@adacore.com>
1361         * g-dyntab.adb (Release): When allocating the new
1362         table, use the correct slice of the old table to initialize it.
1364 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
1366         * einfo.ads: Minor fixes in comments.
1368 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1370         * sem_prag.adb: disable clones in SPARK_Mode.
1372 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1374         * sem_util.ads, contracts.adb: Minor reformatting.
1376 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1378         * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
1379         Build body of subprogram that has a class-wide condition that
1380         contains calls to other primitives.
1381         (Build_Class_Wide_Clone_Call); Build a call to the common
1382         class-wide clone of a subprogram with classwide conditions. The
1383         body of the subprogram becomes a wrapper for a call to the
1384         clone. The inherited operation becomes a similar wrapper to which
1385         modified conditions apply, and the call to the clone includes
1386         the proper conversion in a call the parent operation.
1387         (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
1388         subprogram that has a classwide condition that contains calls to
1389         other primitives, build an internal subprogram that is invoked
1390         through a type-specific wrapper for all inherited subprograms
1391         that may have a modified condition.
1392         * sem_prag.adb (Check_References): If subprogram has a classwide
1393         condition, create entity for corresponding clone, to be invoked
1394         through wrapper subprograns.
1395         (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
1396         message about placement if pragma isi internally generated.
1397         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
1398         a classwide clone, build body of clone as copy of original body,
1399         and rewrite original body as a wrapper as a wrapper for a call to
1400         the clone, so that it incorporates the original pre/postconditions
1401         of the subprogram.
1402         * freeze.adb (Check_Inherited_Conditions): For an inherited
1403         subprogram that inherits a classwide condition, build spec and
1404         body of corresponding wrapper so that call to inherited operation
1405         gets the modified conditions.
1406         * contracts.adb (Analyze_Contracts): If analysis of classwide
1407         condition has created a clone for a primitive operation, analyze
1408         declaration of clone.
1410 2017-04-27  Steve Baird  <baird@adacore.com>
1412         * exp_util.adb (Build_Allocate_Deallocate_Proc):
1413         Add "Suppress => All_Checks" to avoid generating unnecessary
1414         checks.
1416 2017-04-27  Yannick Moy  <moy@adacore.com>
1418         * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
1419         * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
1420         inlining body in GNATprove mode when switch -gnatdm used.
1421         * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
1422         in GNATprove mode when switch -gnatdm used.
1424 2017-04-27  Arnaud Charlet  <charlet@adacore.com>
1426         * sem_ch13.adb (Analyze_Attribute_Definition_Clause
1427         [Attribute_Address]): Call Set_Address_Taken when ignoring rep
1428         clauses, so that we keep an indication of the address clause
1429         before removing it from the tree.
1431 2017-04-27  Yannick Moy  <moy@adacore.com>
1433         * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
1434         of expression being qualified, when not an object name, or else
1435         evaluate the underlying name.
1437 2017-04-27  Jerome Lambourg  <lambourg@adacore.com>
1439         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
1441 2017-04-27  Justin Squirek  <squirek@adacore.com>
1443         * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
1444         Process_Component_List_For_Finalization as a local variable.
1445         (Process_Component_For_Finalize): Add an extra parameter to avoid
1446         global references.
1447         (Process_Component_List_For_Finalization): Correct calls to
1448         Process_Component_For_Finalize to take Num_Comps as a parameter.
1450 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1452         * sem_ch8.adb (Find_Direct_Name): Account for the case where
1453         a use-visible entity is defined within a nested scope of an
1454         instance when giving priority to entities which were visible in
1455         the original generic.
1456         * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
1458 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1460         * raise-gcc.c: Don't use unwind.h while compiling
1461         for the frontend, but mimic host behavior.
1463 2017-04-27  Javier Miranda  <miranda@adacore.com>
1465         * sem_ch3.adb (Build_Discriminated_Subtype):
1466         Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
1468 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1470         * sem_prag.adb (Analyze_Global_Item):
1471         Do not consider discriminants because they are not "entire
1472         objects". Remove the discriminant-related checks because they are
1473         obsolete.
1474         (Analyze_Input_Output): Do not consider discriminants
1475         because they are not "entire objects".
1477 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1479         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
1480         perform check if the current scope does not come from source,
1481         as is the case for a rewritten task body, because check has
1482         been performed already, and may not be doable because of changed
1483         visibility.
1485 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1487         * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
1488         a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
1489         Minor reformatting.
1491 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1493         * sem_ch4.adb (Analyze_Call): If the return type of a function
1494         is incomplete in an context in which the full view is available,
1495         replace the type of the call by the full view, to prevent spurious
1496         type errors.
1497         * exp_disp.adb (Check_Premature_Freezing): Disable check on an
1498         abstract subprogram so that compiler does not reject a parameter
1499         of a primitive operation of a tagged type being frozen, when
1500         the untagged type of that parameter cannot be frozen.
1502 2017-04-27  Bob Duff  <duff@adacore.com>
1504         * sem_attr.adb (Compute_Type_Key): Don't walk
1505         representation items for irrelevant types, which could be in a
1506         different source file.
1508 2017-04-27  Steve Baird  <baird@adacore.com>
1510         * exp_attr.adb (Expand_N_Attribute_Reference):
1511         Don't expand Image, Wide_Image, Wide_Wide_Image attributes
1512         for CodePeer.
1514 2017-04-27  Yannick Moy  <moy@adacore.com>
1516         * exp_unst.ads: Fix typos in comments.
1518 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1520         * sem_eval.adb (Choice_Matches): Handle properly a real literal
1521         whose type has a defined static predicate.
1523 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1525         * exp_ch4.adb (Insert_Dereference_Action):
1526         Do not adjust the address of a controlled object when the
1527         associated access type is subject to pragma No_Heap_Finalization.
1528         Code reformatting.
1530 2017-04-27  Pierre-Marie de Rodat  <derodat@adacore.com>
1532         * gcc-interface/utils.c (gnat_type_for_size): Set
1533         TYPE_ARTIFICIAL on created types.
1535 2017-04-27  Claire Dross  <dross@adacore.com>
1537         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1538         modifications in functional containers.
1539         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1540         to improve readablity. Subprograms are separated between basic
1541         operations, constructors and properties. Universally quantified
1542         formulas in contracts are factorized in independant functions
1543         with a name and a comment.  Names of parameters are improved.
1545 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1547         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1549 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1551         * sem_res.adb (Resolve_Type_Conversion): Do not
1552         install a predicate check here since this is already done during
1553         the expansion phase. Verify whether the operand satisfies the
1554         static predicate (if any) of the target type.
1555         * sem_ch3.adb (Analyze_Object_Declaration): Do
1556         not install a predicate check if the object is initialized by
1557         means of a type conversion because the conversion is subjected
1558         to the same check.
1560 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1562         * raise.c (__gnat_builtin_longjmp): Remove.
1563         (__gnat_bracktrace):
1564         Add a dummy definition for the compiler (__gnat_eh_personality,
1565         __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
1566         __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
1567         __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
1568         * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
1569         * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
1570         and a-except-2005.adb.
1571         * raise-gcc.c: Allow build in compiler, compiled as a C++
1572         file.
1573         (__gnat_Unwind_ForcedUnwind): Adjust prototype.
1574         (db): Constify msg_format.
1575         (get_call_site_action_for): Don't use void arithmetic.
1576         * system.ads (Frontend_Exceptions): Set to False.
1577         (ZCX_By_Default): Set to True.
1578         (GCC_ZC_Support): Set to True.
1579         * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
1580         a-except.ad[sb].
1581         * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
1582         in gnat1 and gnatbind.
1583         * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
1584         s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
1585         * s-excmac.ads, s-excmac.adb: Copy of variants.
1586         * a-except.o: Adjust preequisites.
1587         Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
1589 2017-04-27  Claire Dross  <dross@adacore.com>
1591         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1592         modifications in functional containers.
1593         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1594         to improve readablity. Subprograms are separated between basic
1595         operations, constructors and properties. Universally quantified
1596         formulas in contracts are factorized in independant functions
1597         with a name and a comment.  Names of parameters are improved.
1599 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1601         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1603 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1605         * sem_res.adb (Resolve_Type_Conversion): Do not
1606         install a predicate check here since this is already done during
1607         the expansion phase. Verify whether the operand satisfies the
1608         static predicate (if any) of the target type.
1609         * sem_ch3.adb (Analyze_Object_Declaration): Do
1610         not install a predicate check if the object is initialized by
1611         means of a type conversion because the conversion is subjected
1612         to the same check.
1614 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1616         * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
1617         replaced by their variants).
1619 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1621         * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
1622         cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
1623         a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
1625 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1627         * s-excmac-gcc.ads, s-excmac-gcc.adb,
1628         s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
1629         Ada95.
1631 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1633         * exp_ch7.adb (Establish_Transient_Scope): Rewrite
1634         the loop which detects potential enclosing transient scopes. The
1635         loop now terminates much earlier as transient scopes are bounded
1636         by packages and subprograms.
1638 2017-04-27  Claire Dross  <dross@adacore.com>
1640         * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
1641         allow the use of regular equality over elements in contracts.
1642         (Cursor): Type is now public so that it can be used in
1643         model functions.
1644         (Formal_Model): Ghost package containing
1645         model functions that are used in subprogram contracts.
1646         (Current_To_Last): Removed, model functions should be used
1647         instead.
1648         (First_To_Previous): Removed, model functions should
1649         be used instead.
1650         (Strict_Equal): Removed, model functions
1651         should be used instead.
1652         (Append): Default parameter value
1653         replaced by new wrapper to allow more precise contracts.
1654         (Insert): Default parameter value replaced by new wrapper to
1655         allow more precise contracts.
1656         (Delete): Default parameter
1657         value replaced by new wrapper to allow more precise contracts.
1658         (Prepend): Default parameter value replaced by new wrapper to
1659         allow more precise contracts.
1660         (Delete_First): Default parameter
1661         value replaced by new wrapper to allow more precise contracts.
1662         (Delete_Last): Default parameter value replaced by new wrapper
1663         to allow more precise contracts.
1665 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1667         * exp_spark.adb (Expand_SPARK): Perform specialized expansion
1668         for object declarations.
1669         (Expand_SPARK_N_Object_Declaration): New routine.
1670         * sem_elab.adb (Check_A_Call): Include calls to the
1671         Default_Initial_Condition procedure of a type under the SPARK
1672         elaboration checks umbrella.
1674 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1676         * sem.adb (Analyze): Diagnose an illegal iterated component
1677         association.
1678         * sem_util.ads, sem_util.adb
1679         (Diagnose_Iterated_Component_Association): New routine.
1681 2017-04-27  Bob Duff  <duff@adacore.com>
1683         * adaint.c (__gnat_get_current_dir): Return 0 in length if
1684         getcwd fails.
1685         * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
1686         exception if getcwd failed.
1688 2017-04-27  Yannick Moy  <moy@adacore.com>
1690         * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
1691         entities with special prefix.
1693 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1695         * debug.adb Change the documentation of switch -gnatd.s.
1696         * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
1697         to manage the secondary stack when an enclosing scope already
1698         performs this functionality (aka relaxed management). Switch
1699         -gnatd.s may be used to force strict management in which case
1700         the block will manage the secondary stack unconditionally. Add
1701         a guard to stop the traversal when encountering a package or a
1702         subprogram scope.
1704 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1706         * sem_res.adb (Resolve_Call): Refine further the handling of
1707         limited views of return types in function calls. If the function
1708         that returns a limited view appears in the current unit,
1709         we do not replace its type by the non-limited view because
1710         this transformation is performed int the back-end. However,
1711         the type of the call itself must be the non-limited view, to
1712         prevent spurious resolution errors.
1714 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1716         * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
1717         Removed, proposed implementation using generics for class-wide
1718         preconditions proved impractical.
1719         (Class_Wide_Clone): New attribute of subprogram. Designates
1720         subprogram created for primitive operations with class-wide
1721         pre/postconditions that contain calls to other primitives. The
1722         clone holds the body of the original primitive, but the
1723         pre/postonditions do not apply to it. The original body is
1724         rewritten as a wrapper for a call to the clone.
1725         (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
1726         the flag is set, no code for the corresponding pre/postconditions
1727         is inserted into its body.
1729 2017-04-27  Bob Duff  <duff@adacore.com>
1731         * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
1732         Scalar_Storage_Order if -gnatI is given.
1733         * sem_prag.adb (Analyze_Pragma): Ignore
1734         Default_Scalar_Storage_Order if -gnatI is given.
1736 2017-04-27  Claire Dross  <dross@adacore.com>
1738         * a-cofuba.ads (Add): Take as an additional input parameter
1739         the position where the element should be inserted.
1740         (Remove): New function that removes an element from the container.
1741         * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
1742         * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
1743         (Remove): New function that removes an element from a set.
1744         * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
1745         (Remove): New function that removes an element from a sequence.
1746         (Insert): New function that adds anywhere in a sequence.
1748 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1750         * checks.adb (Generate_Range_Check): Revert previous change.
1752 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1754         * sem_util.adb: Minor reformatting/rewording.
1756 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1758         * lib-xref.adb (Generate_Reference): The use
1759         of attribute 'Result is not considered a violation of pragma
1760         Unreferenced.
1762 2017-04-27  Justin Squirek  <squirek@adacore.com>
1764         * cstand.adb (Create_Standard): Correctly set
1765         Directly_Designated_Type for Any_Access.
1766         * sem_type.adb (Covers): Minor grammar fixes.
1768 2017-04-27  Bob Duff  <duff@adacore.com>
1770         * sem_attr.adb: Minor cleanup.
1772 2017-04-27  Claire Dross  <dross@adacore.com>
1774         * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
1775         private child of Ada.Containers used to implement all functional
1776         containers.
1777         * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
1778         child of Ada.Containers. It provides functional indefinite unbounded
1779         maps which can be used as high level models for specification
1780         of data structures.
1781         * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
1782         child of Ada.Containers. It provides functional indefinite unbounded
1783         sets which can be used as high level models for specification
1784         of data structures.
1785         * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
1786         child of Ada.Containers.  It provides functional indefinite unbounded
1787         vectors which can be used as high level models for specification
1788         of data structures.
1789         * Makefile.rtl: Add new packages.
1790         * impunit.adb: Add new packages.
1792 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1794         * sem_ch4.adb: Minor reformatting.
1796 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1798         * sem_ch12.adb (Analyze_Associations): minor reformatting.
1799         (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
1800         point type actual that has user-defined arithmetic primitives,
1801         when there is a previous actual for a formal package that defines
1802         a fixed-point type with the parent user-defined operator.
1804 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1806         * checks.adb (Generate_Range_Check): Reinstate part of previous change.
1807         * sem_attr.adb (Resolve_Attribute): Generate a range check when
1808         the component type allows range checks.
1810 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1812         * sem_aux.adb (Is_Generic_Formal): Use original node to locate
1813         corresponding declaration, because formal derived types are
1814         rewritten as private extensions.
1816 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1818         * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
1819         dimensions of operands if node has been analyzed already, because
1820         previous analysis and dimension checking will have removed the
1821         dimension information from the operands.
1823 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1825         * debug.adb: Document the use of switch -gnatd.s.
1826         * einfo.ads Update the documentation on attribute
1827         Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
1828         the uses of these attributes from certain entities.
1829         * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
1830         which determines whether the block should continue to manage
1831         the secondary stack.
1832         (Manages_Sec_Stack): New routine.
1834 2017-04-27  Bob Duff  <duff@adacore.com>
1836         * atree.ads: Minor edit.
1838 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1840         * sinfo.ads: Update the section on Ghost mode. Add
1841         a section on SPARK mode. Update the placement of section on
1842         expression functions.
1844 2017-04-27  Bob Duff  <duff@adacore.com>
1846         * sinput.adb (Get_Source_File_Index): Don't
1847         assert that S is in the right range in the case where this is
1848         a .dg file under construction.
1850 2017-04-27  Yannick Moy  <moy@adacore.com>
1852         * sem_util.adb (Check_Result_And_Post_State):
1853         Handle more precisely each conjunct in expressions formed by
1854         and'ing sub-expressions.
1856 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1858         * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
1860 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1862         * gnat_rm.texi, gnat_ugn.texi,
1863         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1864         doc/gnat_ugn/platform_specific_information.rst,
1865         doc/gnat_ugn/gnat_and_program_execution.rst,
1866         doc/gnat_ugn/gnat_utility_programs.rst,
1867         doc/gnat_ugn/the_gnat_compilation_model.rst,
1868         doc/gnat_rm/implementation_defined_attributes.rst,
1869         doc/gnat_rm/the_gnat_library.rst,
1870         doc/gnat_rm/implementation_defined_pragmas.rst,
1871         doc/gnat_rm/representation_clauses_and_pragmas.rst,
1872         doc/gnat_rm/implementation_of_specific_ada_features.rst,
1873         doc/gnat_rm/implementation_defined_aspects.rst,
1874         doc/gnat_rm/implementation_defined_characteristics.rst: Update
1875         documentation.
1877 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1879         * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
1880         generating C code on complex case expressions.
1882 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1884         * sem_prag.adb (Analyze_Pragma): Generate a warning instead
1885         of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
1886         * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
1887         Ada_2012 instead of Ada_2005 to be compatible with the above
1888         change.
1889         * bindgen.adb: Silence new warning on pragma Ada_95.
1891 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1893         * checks.adb (Generate_Range_Check): Revert part of previous change.
1895 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
1897         * sem_ch4.adb (Try_Container_Indexing): Handle properly a
1898         container indexing operation that appears as a an actual in a
1899         parameter association in a procedure call.
1901 2017-04-25  Olivier Ramonat  <ramonat@adacore.com>
1903         * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
1904         Fix spelling mistakes.
1906 2017-04-25  Bob Duff  <duff@adacore.com>
1908         * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
1909         * sinput-p.adb: Use regular fat pointers, with bounds checking,
1910         for source buffers.  Fix misc obscure bugs.
1911         * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
1912         checking, for source buffers.  Modify representation clause for
1913         Source_File_Record as appropriate.  Move Source_File_Index_Table
1914         from spec to body, because it is not used outside the body.
1915         Move Set_Source_File_Index_Table into the private part, because
1916         it is used only in the body and in children.  Use trickery to
1917         modify the dope in the generic instantiation case.  It's ugly,
1918         but not as ugly as the previous method.  Fix documentation.
1919         Remove obsolete code.
1920         * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
1921         indexing in source buffers.
1922         * fmap.adb: Avoid conversions from one string type to another.
1923         Remove a use of global name buffer.
1924         * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
1925         fixes.
1927 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
1929         * exp_util.adb, exp_ch4.adb: Minor reformatting.
1931 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1933         * checks.adb: Code clean up in various routines.
1934         (Generate_Range_Check): Do not generate a range check when the
1935         expander is not active or when index/range checks are suppressed
1936         on the target type.
1937         (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
1938         Remove variants that include a Supress parameter. These routines
1939         are never used, and were introduced before the current scope-based
1940         check suppression method.
1942 2017-04-25  Vasiliy Fofanov  <fofanov@adacore.com>
1944         * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
1945         code and some subprogram calls that are now noop.
1947 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1949         * exp_ch4.adb (Expand_N_Case_Expression): Take
1950         Minimize_Expression_With_Actions into account when possible.
1952 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1954         * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
1955         (Known_Null): Moved to Sem_Util.
1956         * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
1957         (Known_Null): Moved to Sem_Util.
1958         * sem_util.adb Add new enumeration type Null_Status_Kind.
1959         (Known_Non_Null): Moved from Exp_Util. Most of the logic in
1960         this routine is now carried out by Null_Status.
1961         (Known_Null): Moved from Exp_Util. Most of the logic in this routine
1962         is now carried out by Null_Status.
1963         (Null_Status): New routine.
1964         * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
1965         (Known_Null): Moved from Exp_Util.
1967 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
1969         * sem_ch6.adb (Analyze_Expression_Function): Do not report an
1970         error on the return type of an expression function that is a
1971         completion, if the type is derived from a generic formal type.
1973 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
1975         * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
1976         conversion are those of the target type.
1978 2017-04-25  Bob Duff  <duff@adacore.com>
1980         * a-clrefi.adb: Minor cleanup.
1982 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
1984         * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
1986 2017-04-25  Bob Duff  <duff@adacore.com>
1988         * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
1989         types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
1990         errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
1991         scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
1992         the Internal_Source buffer. This removes the incorrect call to "="
1993         the customer noticed.
1994         Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
1995         eventually need to eliminate them altogether. Or else get rid
1996         of zero-origin addressing.
1998 2017-04-25  Claire Dross  <dross@adacore.com>
2000         * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
2001         function used in GNATprove to know if an expression contains
2002         non-dispatching calls on primitives of a tagged type.
2004 2017-04-25  Bob Duff  <duff@adacore.com>
2006         * rtsfind.adb (Initialize): Initialize
2007         First_Implicit_With. Building the compiler with Normalize_Scalars
2008         and validity checking finds this being used as an uninitialized
2009         variable.
2011 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2013         * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
2014         Add a warning about SPARK mode management. The routine now
2015         saves and restores both the mode and associated pragma.
2016         (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
2017         SPARK mode management. The routine now saves and restores both
2018         the mode and associated pragma.
2019         (Analyze_Object_Contract):
2020         Add a warning about SPARK mode management. The routine
2021         now saves and restores both the mode and associated pragma.
2022         (Analyze_Package_Body_Contract): Add a warning about SPARK mode
2023         management.  The routine now saves and restores both the mode
2024         and associated pragma.  (Analyze_Package_Contract): Add a warning
2025         about SPARK mode management. The routine now saves and restores
2026         both the mode and associated pragma.
2027         (Analyze_Task_Contract):
2028         Add a warning about SPARK mode management. The routine now saves
2029         and restores both the mode and associated pragma.
2030         * expander.adb (Expand): Change the way the Ghost mode is saved
2031         and restored.
2032         * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
2033         saved and restored.
2034         * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
2035         and restored.
2036         * exp_util.adb (Build_DIC_Procedure_Body):
2037         Change the way the Ghost mode is saved and restored.
2038         (Build_DIC_Procedure_Declaration): Change the way the Ghost
2039         mode is saved and restored.
2040         (Build_Invariant_Procedure_Body):
2041         Change the way the Ghost mode is saved and restored.
2042         (Build_Invariant_Procedure_Declaration): Change the way the Ghost
2043         mode is saved and restored.
2044         (Make_Predicate_Call): Change the
2045         way the Ghost mode is saved and restored.
2046         * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
2047         saved and restored.
2048         * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2049         and its assignment.
2050         (Mark_And_Set_Ghost_Body): Remove parameter
2051         Mode and its assignment.
2052         (Mark_And_Set_Ghost_Completion):
2053         Remove parameter Mode and its assignment.
2054         (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
2055         assignment.
2056         (Mark_And_Set_Ghost_Instantiation): Remove parameter
2057         Mode and its assignment.
2058         (Mark_And_Set_Ghost_Procedure_Call):
2059         Remove parameter Mode and its assignment.
2060         (Set_Ghost_Mode):
2061         Remove parameter Mode and its assignment.
2062         * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2063         and update the comment on usage.
2064         (Mark_And_Set_Ghost_Body):
2065         Remove parameter Mode and update the comment on usage.
2066         (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
2067         update the comment on usage.
2068         (Mark_And_Set_Ghost_Declaration):
2069         Remove parameter Mode and update the comment on usage.
2070         (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
2071         update the comment on usage.
2072         (Mark_And_Set_Ghost_Procedure_Call):
2073         Remove parameter Mode and update the comment on usage.
2074         (Set_Ghost_Mode): Remove parameter Mode and update the comment
2075         on usage.
2076         * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
2077         types.
2078         * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
2079         of obsolete field SPARK_Mode_Pragma.
2080         (Load_Main_Source): Remove
2081         the assignment of obsolete field SPARK_Mode_Pragma.
2082         (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
2083         * lib-writ.adb (Add_Preprocessing_Dependency): Remove
2084         the assignment of obsolete field SPARK_Mode_Pragma.
2085         (Ensure_System_Dependency): Remove the assignment of obsolete
2086         field SPARK_Mode_Pragma.
2087         * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
2088         mode management. Change the way Ghost and SPARK modes are saved
2089         and restored.
2090         * sem.adb (Analyze): Change the way the Ghost mode is saved
2091         and restored.
2092         * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
2093         Ghost mode is saved and restored.
2094         (Process_Full_View): Change
2095         the way the Ghost mode is saved and restored.
2096         * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
2097         mode is saved and restored.
2098         * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
2099         mode is saved and restored.
2100         (Analyze_Subprogram_Body_Helper):
2101         Change the way the Ghost mode is saved and restored.
2102         * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
2103         Ghost mode is saved and restored.
2104         * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
2105         management. Save the SPARK mode-related data prior to any changes
2106         to the scope stack and contexts. The mode is then reinstalled
2107         before the subunit is analyzed in order to restore the original
2108         view of the subunit.
2109         * sem_ch12.adb (Analyze_Package_Instantiation): Update the
2110         warning on region management.  Change the way the Ghost and
2111         SPARK modes are saved and restored.
2112         (Inline_Instance_Body):
2113         Add a warning about SPARK mode management. Code clean up.
2114         (Analyze_Subprogram_Instantiation): Update the warning on region
2115         management.  Change the way the Ghost and SPARK modes are saved
2116         and restored.
2117         (Instantiate_Package_Body): Update the warning
2118         on region management. Change the way the Ghost and SPARK modes
2119         are saved and restored.
2120         (Instantiate_Subprogram_Body): Update
2121         the warning on region management. Change the way the Ghost and
2122         SPARK modes are saved and restored.
2123         (Set_Instance_Env): Add a
2124         warning about SPARK mode management. Change the way SPARK mode
2125         is saved and restored.
2126         * sem_ch13.adb (Build_Predicate_Functions):
2127         Change the way the Ghost mode is saved and restored.
2128         (Build_Predicate_Function_Declaration): Change the way the Ghost
2129         mode is saved and restored.
2130         * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
2131         mode management. Change the way SPARK mode is saved and restored.
2132         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
2133         Change the way the Ghost mode is saved and restored.
2134         (Analyze_Initial_Condition_In_Decl_Part): Change the way
2135         the Ghost mode is saved and restored.
2136         (Analyze_Pragma):
2137         Change the way the Ghost mode is saved and restored.
2138         (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
2139         Ghost mode is saved and restored.
2140         * sem_util.adb (Install_SPARK_Mode): New routine.
2141         (Restore_SPARK_Mode): New routine.
2142         (Save_SPARK_Mode_And_Set): Removed.
2143         (Set_SPARK_Mode): New routine.
2144         * sem_util.ads (Install_SPARK_Mode): New routine.
2145         (Restore_SPARK_Mode): New routine.
2146         (Save_SPARK_Mode_And_Set): Removed.
2147         (Set_SPARK_Mode): New routine.
2149 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2151         * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
2152         to determine whether a type is declared in a local package that
2153         has not yet been frozen.
2154         * freeze.adb (Freeze_Before): Use new predicate to determine
2155         whether a local package must be installed on the scope stack
2156         in order to evaluate in the proper scope actions generated by
2157         aspect specifications, such as Predicate
2158         * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
2159         using new predicate.
2161 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2163         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
2164         comparisons between non- scalar expressions expressions because
2165         their values cannot be invalidated.
2166         * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
2167         comment on usage.
2169 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2171         * par_sco.adb: Minor reformatting.
2173 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2175         * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
2176         is a type from an unfrozen local package, install package to
2177         complete the analysis of delayed aspects of the type.
2179 2017-04-25  Tristan Gingold  <gingold@adacore.com>
2181         * bingen.adb (System_Version_Control_Used): New variable.
2182         (Resolve_Binder_Options): Set the above variable.
2183         (Gen_Output_File_Ada): Conditionally call Gen_Versions.
2184         (Gen_Elab_Order): Emit blank line before.
2186 2017-04-25  Justin Squirek  <squirek@adacore.com>
2188         * sem_cat.adb (Validate_RT_RAT_Component): Added
2189         an extra check to ignore incomplete types.
2191 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2193         * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
2194         bogus circuitry for the case where Name is Predicate.
2196 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2198         * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
2199         Create SCOs for Predicate aspects in disabled
2200         state initially, to be enabled later on by...
2201         * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
2202         SCO for predicate as enabled.
2204 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2206         * comperr.adb (Compiler_Abort): Remove now obsolete pair of
2207         pragmas Warnings Off / On.
2208         * namet.adb (Finalize): Remove now obsolete pair of pragmas
2209         Warnings Off / On.
2210         * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
2211         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
2212         consider comparisons between static expressions because their
2213         values cannot be invalidated.
2214         * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
2215         Warnings Off / On.
2216         (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
2217         * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
2219 2017-04-25  Bob Duff  <duff@adacore.com>
2221         * sem_elab.adb (In_Task_Activation): Trace internal calls in
2222         task bodies.
2224 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2226         * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
2227         typo fixes.
2229 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2231         * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
2232         On/Off to defend against a spurious warning in conditional
2233         compilation.
2234         * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
2235         * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
2236         defend against a spurious warning in conditional compilation.
2237         * output.adb Add a pair of pragma Warnings On/Off to defend
2238         against a spurious warning in conditional compilation.
2239         * sem_eval.adb (Eval_Relational_Op): Major code clean up.
2240         (Fold_General_Op): New routine.
2241         (Fold_Static_Real_Op): New routine.
2242         (Test_Comparison): New routine.
2243         * sem_eval.ads (Test_Comparison): New routine.
2244         * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
2245         (Warn_On_Constant_Valid_Condition): New routine.
2246         (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
2247         to detect a specific case.
2248         * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
2249         * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
2250         to defend against a spurious warning in conditional compilation.
2251         (Tree_Write): Add a pair of pragma Warnings On/Off to defend
2252         against a spurious warning in conditional compilation.
2253         * usage.adb Add a pair of pragma Warnings On/Off to defend
2254         against a spurious warning in conditional compilation.
2256 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2258         * sinfo.ads, sem_ch13.adb: Update comment.
2260 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2262         * sem_util.adb (Is_Post_State): A reference to a
2263         generic in out parameter is considered a change in the post-state
2264         of a subprogram.
2266 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2268         * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
2269         declaration of a subprogram instance within its wrapper package,
2270         skip over null statements that may result from the rewriting of
2271         ignored pragmas.
2273 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2275         * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
2276         If the type is an unchecked_union, replace the attribute with
2277         a Raise_Program_Error (rather than inserting such before the
2278         attribute reference) to handle properly the case where we are
2279         processing a component of a larger record, and we need to prevent
2280         further expansion for the unchecked union.
2281         (Expand_Attribute_Reference, case 'Write): If the type is
2282         an unchecked_union, check whether enclosing scope is a Write
2283         subprogram. Replace attribute with a Raise_Program_Error if the
2284         discriminants of the unchecked_union type have not default values
2285         because such a use is erroneous..
2287 2017-04-25  Tristan Gingold  <gingold@adacore.com>
2289         * exp_ch9.adb (Expand_N_Task_Type_Declaration):
2290         Add relative_deadline to task record on edf profile.
2291         (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
2292         (Make_Task_Create_Call): Pass relative_deadline value.
2293         * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
2294         * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
2295         (Profile_Info): Add info for GNAT_Ravenscar_EDF.
2296         * sem_prag.adb (Set_Ravenscar_Profile): Handle
2297         GNAT_Ravenscar_EDF (set scheduling policy).
2298         (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
2299         pragma.
2300         (Sig_Flags): Add choice for Pragma_Deadline_Floor.
2301         * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
2302         New names.
2303         (Pragma_Deadline_Floor): New pragma.
2304         * targparm.adb (Get_Target_Parameters): Recognize
2305         GNAT_Ravenscar_EDF profile.
2307 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
2309         * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
2311 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2313         * sem_aux.adb (Nearest_Ancestor): Use original node of type
2314         declaration to locate nearest ancestor, because derived
2315         type declarations for record types are rewritten as record
2316         declarations.
2317         * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
2318         properly derivations that are completions of private types.
2319         (Add_Predicates): If type is private, examine rep. items of full
2320         view, which may include inherited predicates.
2321         (Build_Predicate_Functions): Ditto.
2323 2017-04-25  Javier Miranda  <miranda@adacore.com>
2325         * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
2326         to generate new entities for subtype declarations located in
2327         Expression_With_Action nodes.
2329 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2331         * sem_elab.adb (Check_A_Call): Remove
2332         local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
2333         need for Elaborate_All when SPARK elaboration checks are
2334         required. Update the checks for instances, variables, and calls
2335         to Default_Initial_Condition procedures.
2337 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2339         * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
2340         into a boolean aspect, in analogy with the Ada aspect No_Return.
2342 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2344         * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
2346 2017-04-25  Bob Duff  <duff@adacore.com>
2348         * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
2349         Is_True_Constant for an array variable that is passed to a
2350         foreign function as an 'in' parameter.
2351         * debug.adb: Document -gnatd.q.
2353 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2355         * sem_ch6.adb (Analyze_Expression_Function): If expression function
2356         is completion and return type is an access type do not freeze
2357         designated type: this will be done in the process of freezing
2358         the expression if needed.
2359         (Freeze_Expr_Types): Check whether type is complete before
2360         creating freeze node, to provide a better error message if
2361         reference is premature.
2362         * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
2363         functions created by type derivations.
2365 2017-04-25  Pascal Obry  <obry@adacore.com>
2367         * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
2369 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2371         * sem_res.adb (Resolve_Type_Conversion):
2372         When resolving against any fixed type, set the type of the
2373         operand as universal real when the operand is a multiplication
2374         or a division where both operands are of any fixed type.
2375         (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
2376         placement of an error message by pointing to the operand of a
2377         type conversion rather than the conversion itself.
2379 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2381         * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
2382         Needs_Debug_Info when producing SCOs.
2384 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2386         * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
2387         Always pass a null finalization master for a library level named access
2388         type to which a pragme No_Heap_Finalization applies.
2390 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
2392         PR ada/78845
2394         * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
2395         set to A'First(2) and vice versa.
2397 2017-04-25  Yannick Moy  <moy@adacore.com>
2399         * freeze.adb (Freeze_Record_Type): Remove obsolete
2400         rule on volatile tagged record restriction on SPARK code.
2402 2017-04-25  Yannick Moy  <moy@adacore.com>
2404         * sem_prag.adb (minor) Fix SPARK RM reference.
2406 2017-04-25  Yannick Moy  <moy@adacore.com>
2408         * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
2409         comment to reflect which entity is chosen as unique entity.
2410         (Unique_Entity): Return full view instead of private spec for
2411         protected type or task type. Fix possible incorrect access when
2412         called on entry.
2414 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2416         * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
2417         array types only instead of all packed array types.
2419 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2421         * sem_ch6.adb (Conforming_Types): If type of formal as a specified
2422         dimension system, verify that dimensions of both match.
2423         (Check_Conformance): Add error message in case of dimension
2424         mismatch.
2425         * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
2426         predicate.
2428 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
2430         * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
2431         confusing.
2433 2017-04-25  Yannick Moy  <moy@adacore.com>
2435         * sem_util.adb: Minor refactoring.
2436         * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
2438 2017-04-25  Claire Dross  <dross@adacore.com>
2440         * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
2441         ultimate alias when accessing overridden operation. Indeed, if the
2442         overridden operation is itself inherited, it won't have any explicit
2443         contract.
2445 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2447         * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
2448         overlap if the two formals have different types, because formally
2449         the corresponding actuals cannot designate the same objects.
2451 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2453         * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
2454         dimensions are present from context, use them.  b) If operand is
2455         a static constant rewritten as a literal, obtain the dimensions
2456         from the original declaration, otherwise use dimensions of type
2457         established from context.
2459 2017-04-25  Yannick Moy  <moy@adacore.com>
2461         * sem_util.adb (Is_Effectively_Volatile): Protect against base type
2462         of array that is private.
2464 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2466         * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
2467         reformatting.
2469 2017-04-25  Yannick Moy  <moy@adacore.com>
2471         * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
2472         on body.
2474 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2476         * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
2477         the check that recognizes a call to a private overridding and
2478         replaces the called subprogram with its alias.
2480 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2482         * exp_util.adb: Minor reformatting.
2484 2017-04-25  Justin Squirek  <squirek@adacore.com>
2486         * exp_ch3.adb (Freeze_Type): Add condition to always treat
2487         interface types as a partial view of a private type for the
2488         generation of invariant procedure bodies.
2489         * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
2490         Add a condition to get the Corresponding_Record_Type for
2491         concurrent types, add condition to return in the absence of a
2492         class in the pragma, remove call to Replace_Type_References,
2493         and add call to Replace_References.
2494         (Add_Interface_Invariatns),
2495         (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
2496         to including the working type T.
2497         (Add_Own_Invariants): Remove
2498         legacy condition for separate units, remove dispatching for ASIS
2499         and save a copy of the expression in the pragma expression.
2500         (Build_Invariant_Procedure_Body): Default initalize vars,
2501         remove return condition on interfaces, always use the
2502         private type for interfaces, and move the processing of types
2503         until after the processing of invariants for the full view.
2504         (Build_Invariant_Procedure_Declaration): Remove condition
2505         to return if an interface type is encountered and add
2506         condition to convert the formal parameter to its class-wide
2507         counterpart if Work_Typ is abstract.
2508         (Replace_Type): Add call to Remove_Controlling_Arguments.
2509         (Replace_Type_Ref): Remove class-wide dispatching for the current
2510         instance of the type.
2511         (Replace_Type_References): Remove parameter "Derived"
2512         (Remove_Controlling_Arguments): Created in order to removing
2513         the controlliong argument from calls to primitives in the case
2514         of the formal parameter being an class-wide abstract type.
2515         * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
2516         to the change made to Freeze_Type in exp_ch3. Add a condition
2517         to treat interface types as a partial view.
2518         * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
2519         to Build_Invariant_Procedure_Declaration to properly generate a
2520         "partial" invariant procedure when Typ is an interface.
2522 2017-04-25  Bob Duff  <duff@adacore.com>
2524         * a-numeri.ads: Go back to using brackets encoding for the Greek
2525         letter pi.
2527 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2529         * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
2530         (10-15): if derived type T with progenitors is abstract,
2531         and primitive P of this type inherits non-trivial classwide
2532         preconditions from both a parent operation and from an interface
2533         operation, then the inherited operation is abstract if the parent
2534         operation is not null.
2535         * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
2536         with Covered_Interface_Op to yield the actual interface operation
2537         that is implemented by a given inherited operation.
2539 2017-04-25  Javier Miranda  <miranda@adacore.com>
2541         * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
2542         and right operands after performing the validity checks. Required
2543         because validity checks may remove side effects from the operands.
2545 2017-04-25  Javier Miranda  <miranda@adacore.com>
2547         * exp_attr.adb (Attribute_Unrestricted_Access):
2548         Do not disable implicit type conversion.  Required to generate
2549         code that displaces the pointer to reference the secondary
2550         dispatch table.
2552 2017-04-25  Pascal Obry  <obry@adacore.com>
2554         * prj-attr.adb, snames.ads-tmpl: Add package Install's
2555         Required_Artifacts attribute.
2557 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2559         * sem_util.adb (Same_Value): String literals are compile-time
2560         values, and comparing them must use Expr_Value_S.
2562 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2564         * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
2565         dereference is introduced for the object, and the object is
2566         overloaded, do not check whether it is aliased, because it may
2567         include an implicit dereference.
2568         * sem_type.adb (Disambiguate): If two interpretations are access
2569         attribute types with the same designated type keep either of
2570         them and do not report an ambiguity.  A true ambiguity will be
2571         reported elsewhere.
2573 2017-04-25  Bob Duff  <duff@adacore.com>
2575         * a-numeri.ads: Change the encoding of Greek letter Pi from
2576         brackets encoding to UTF-8.  Use pragma Wide_Character_Encoding
2577         to indicate the encoding. We considered using a byte order mark
2578         (BOM), but that causes various trouble (misc software eats the
2579         BOM, if you have a patch with a BOM, then it's not at the start
2580         of the patch, so it's not a BOM, the BOM affects with-ing files,
2581         etc.).
2582         * scng.adb, s-wchcnv.adb: Minor.
2584 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2586         * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
2587 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2589         * sem_ch3.adb (Add_Internal_Interface_Entities): Move
2590         Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
2591         Improve error message on operations that inherit non-conforming
2592         classwide preconditions from ancestor and progenitor.
2593         * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
2594         moved here from sem_ch3.
2595         * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
2596         check given in RM 6.1.1 (17) concerning renamings of overriding
2597         operations that inherits class-wide preconditions from ancestor
2598         or progenitor.
2600 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2602         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
2603         (Build_Adjust_Statements): Code cleanup.
2604         (Build_Finalizer): Update the initialization of
2605         Exceptions_OK.
2606         (Build_Finalize_Statements): Code cleanup.
2607         (Build_Initialize_Statements): Code cleanup.
2608         (Make_Deep_Array_Body): Update the initialization of
2609         Exceptions_OK.
2610         (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
2611         (Process_Object_Declaration): Generate a null exception handler only
2612         when exceptions are allowed.
2613         (Process_Transients_In_Scope): Update the initialization of
2614         Exceptions_OK.
2615         * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
2616         routine.
2617         * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
2618         restrictions when the handler is internally generated and the
2619         mode is warnings.
2621 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2623         * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
2624         enforce legality rule on classwide preconditions inherited from
2625         both an ancestor and a progenitor (RM 6.1.1 (10-13).
2626         * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
2627         subprogram need not be dispatching if it appears in a precondition
2628         for an abstract or null subprogram.
2630 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2632         * sem_ch10.adb: Minor typo fix.
2634 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2636         * gcc-interface/Makefile.in: Cleanup VxWorks targets.
2638 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2640         * fname.adb (Is_Internal_File_Name): Arrange for the slices to
2641         have a length which is a power of 2.
2642         (Is_Predefined_File_Name): Likewise. Adjust comment.
2644 2017-04-25  Bob Duff  <duff@adacore.com>
2646         * exp_aggr.adb (Component_Count): Protect the
2647         arithmetic from attempting to convert a value >= 2**31 to Int,
2648         which would otherwise raise Constraint_Error.
2650 2017-04-25  Bob Duff  <duff@adacore.com>
2652         * opt.ads (Locking_Policy): Fix incorrect documentation. The
2653         first character of the policy name is not unique.
2655 2017-04-25  Bob Duff  <duff@adacore.com>
2657         * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
2658         * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
2659         about this flag not being used. It was already used, and it is
2660         now used more.
2662 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2664         * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
2665         (Ignore_SPARK_Mode_Pragmas): New routine.
2666         (Set_Ignore_SPARK_Mode_Pragmas): New routine.
2667         (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
2668         * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
2669         related entities.
2670         (Ignore_SPARK_Mode_Pragmas): New routine
2671         along with pragma Inline.
2672         (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
2673         * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
2674         Ignore_SPARK_Mode_Pragmas_In_Instance.
2675         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
2676         Save and restore the value of global flag
2677         Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
2678         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
2679         the corresponding spec or the body must ignore all SPARK_Mode
2680         pragmas found within.
2681         (Analyze_Subprogram_Declaration): Mark
2682         the spec when it needs to ignore all SPARK_Mode pragmas found
2683         within to allow the body to infer this property in case it is
2684         instantiated or inlined later.
2685         * sem_ch7.adb (Analyze_Package_Body_Helper): 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 spec also ignored all SPARK_Mode pragmas
2689         found within.
2690         (Analyze_Package_Declaration): Mark the spec when
2691         it needs to ignore all SPARK_Mode pragmas found within to allow
2692         the body to infer this property in case it is instantiated or
2693         inlined later.
2694         * sem_ch12.adb (Analyze_Formal_Package_Declaration):
2695         Save and restore the value of flag
2696         Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2697         formal spec when it needs to ignore all SPARK_Mode
2698         pragmas found within to allow the body to infer this
2699         property in case it is instantiated or inlined later.
2700         (Analyze_Package_Instantiation): Save and restore the value
2701         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
2702         the instance spec when it needs to ignore all SPARK_Mode
2703         pragmas found within to allow the body to infer this
2704         property in case it is instantiated or inlined later.
2705         (Analyze_Subprogram_Instantiation): Save and restore the value
2706         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2707         instance spec and anonymous package when they need to ignore
2708         all SPARK_Mode pragmas found within to allow the body to infer
2709         this property in case it is instantiated or inlined later.
2710         (Instantiate_Package_Body): Save and restore the value of global
2711         flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
2712         global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
2713         corresponding instance spec also ignored all SPARK_Mode pragmas
2714         found within.
2715         (Instantiate_Subprogram_Body): Save and restore the
2716         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2717         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2718         when the corresponding instance spec also ignored all SPARK_Mode
2719         pragmas found within.
2720         * sem_prag.adb (Analyze_Pragma): Update the reference to
2721         Ignore_Pragma_SPARK_Mode.
2722         * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
2723         all SPARK_Mode pragmas defined within yields mode "off".
2725 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2727         * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
2729 2017-04-25  Bob Duff  <duff@adacore.com>
2731         * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
2732         All_Checks" to avoid generating unnecessary checks.
2733         * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
2734         All_Checks".
2735         * sem.ads: Fix comment.
2736         * expander.ads: Fix comment.
2737         * exp_atag.ads: Fix comment: "Index = 0" should be
2738         "Index >= 0".
2740 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2742         * s-taprop-linux.adb: Minor editorial fixes.
2744 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2746         * sem_util.adb (New_Copy_Tree): Put back the declarations of the
2747         hash tables at library level.  Reinstate the NCT_Hash_Tables_Used
2748         variable and set it to True whenever the main hash table is
2749         populated.  Short- circuit the Assoc function if it is false
2750         and add associated guards.
2752 2017-04-25  Olivier Hainque  <hainque@adacore.com>
2754         * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
2755         specs without elaboration code that have an elaboration counter
2756         nevertheless, e.g.  when compiled with -fpreserve-control-flow.
2757         * sem_ch10.adb (Analyze_Compilation_Unit):
2758         Set_Elaboration_Entity_Required when requested to preserve
2759         control flow, to ensure the unit elaboration is materialized at
2760         bind time, resulting in the inclusion of the unit object file
2761         in the executable closure at link time.
2763 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
2765         * exp_dbug.adb: In Debug_Renaming_Declaration,
2766         when dealing with indexed component, accept to produce a renaming
2767         symbol when the index is an IN parameter or when it is a name
2768         defined in an outer scope.
2770 2017-04-25  Yannick Moy  <moy@adacore.com>
2772         * errout.adb (Error_Msg): Adapt continuation
2773         message in instantiations and inlined bodies for info messages.
2775 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2777         * fname.adb (Has_Internal_Extension): Add pragma Inline.
2778         Use direct 4-character slice comparisons.
2779         (Has_Prefix): Add
2780         pragma Inline.  (Has_Suffix): Delete.
2781         (Is_Internal_File_Name):
2782         Test Is_Predefined_File_Name first.
2783         (Is_Predefined_File_Name):
2784         Use direct slice comparisons as much as possible and limit all
2785         comparisons to at most 8 characters.
2787 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2789         * checks.adb (Insert_Valid_Check): Code cleanup.
2790         * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
2791         (Expand_Actuals): Generate proper copy-back for a validation
2792         variable when it acts as the argument of a type conversion.
2793         * sem_util.adb (Is_Validation_Variable_Reference): Augment the
2794         predicate to operate on type qualifications.
2796 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2798         * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
2799         Minor reformatting.
2801 2017-04-25  Bob Duff  <duff@adacore.com>
2803         * sem_prag.adb (No_Return): Give an error if the pragma applies
2804         to a body. Specialize the error for the specless body case,
2805         as is done for (e.g.) pragma Convention.
2806         * debug.adb: Add switch -gnatd.J to disable the above legality
2807         checks. This is mainly for use in our test suite, to avoid
2808         rewriting a lot of illegal (but working) code.  It might also
2809         be useful to customers. Under this switch, if a pragma No_Return
2810         applies to a body, and the procedure raises an exception (as it
2811         should), the pragma has no effect. If the procedure does return,
2812         execution is erroneous.
2814 2017-04-25  Bob Duff  <duff@adacore.com>
2816         * exp_ch6.adb (Expand_Actuals): This is the
2817         root of the problem. It took N as an 'in out' parameter, and in
2818         some cases, rewrote N, but then set N to Original_Node(N). So
2819         the node returned in N had no Parent. The caller continued
2820         processing of this orphaned node. In some cases that caused a
2821         crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
2822         and trips over the Empty Parent). The solution is to make N an
2823         'in' parameter.  Instead of rewriting it, return the list of
2824         post-call actions, so the caller can do the rewriting later,
2825         after N has been fully processed.
2826         (Expand_Call_Helper): Move most of Expand_Call here. It has
2827         too many premature 'return' statements, and we want to do the
2828         rewriting on return.
2829         (Insert_Post_Call_Actions): New procedure to insert the post-call
2830         actions in the appropriate place. In the problematic case,
2831         that involves rewriting N as an Expression_With_Actions.
2832         (Expand_Call): Call the new procedures Expand_Call_Helper and
2833         Insert_Post_Call_Actions.
2835 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2837         * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
2838         properly type derived from generic formal types, to handle
2839         properly modified version of ACATS 4.1B B611017.
2841 2017-04-25  Javier Miranda  <miranda@adacore.com>
2843         * exp_unst.adb (Subp_Index): Adding missing
2844         support for renamings and functions that return a constrained
2845         array type (i.e. functions for which the frontend built a
2846         procedure with an extra out parameter).
2848 2017-04-25  Pascal Obry  <obry@adacore.com>
2850         * s-string.adb: Minor code clean-up.
2852 2017-04-25  Bob Duff  <duff@adacore.com>
2854         * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
2855         procedure.
2856         * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
2857         function for Non_Blocking_Wait_Process.
2859 2017-04-25  Bob Duff  <duff@adacore.com>
2861         * prep.adb (Preprocess): Remove incorrect
2862         Assert. Current character can be ASCII.CR.
2864 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2866         * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
2867         convention Stdcall, which has a number of exceptions. Convention
2868         is legal on a component declaration whose type is an anonymous
2869         access to subprogram.
2871 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2873         * sem_ch4.adb: sem_ch4.adb Various reformattings.
2874         (Try_One_Prefix_Interpretation): Use the base type when dealing
2875         with a subtype created for purposes of constraining a private
2876         type with discriminants.
2878 2017-04-25  Javier Miranda  <miranda@adacore.com>
2880         * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
2881         * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
2882         dispatching primitives (Restore_Warnings): Restore warning on
2883         late dispatching primitives (Save_Warnings): Save warning on late
2884         dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
2885         to enable/disable this warning.
2886         (WA_Warnings): Set warning on late dispatching primitives.
2887         * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
2888         that its parent type has a private extension.
2889         * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
2890         New subprogram.
2891         * usage.adb: Document -gnatw.j and -gnatw.J.
2893 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2895         * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
2896         reformatting.
2898 2017-04-25  Bob Duff  <duff@adacore.com>
2900         * binde.adb (Validate): Do not pass dynamic strings
2901         to pragma Assert, because older compilers do not support that.
2903 2017-04-25  Bob Duff  <duff@adacore.com>
2905         * s-fileio.adb (Close): When a temp file is
2906         closed, delete it and clean up its Temp_File_Record immediately,
2907         rather than waiting until later.
2908         (Temp_File_Record): Add File
2909         component, so Close can know which Temp_File_Record corresponds
2910         to the file being closed.
2911         (Delete): Don't delete temp files,
2912         because they are deleted by Close.
2913         (Open): Set the File component
2914         of Temp_File_Record. This requires moving the creation of the
2915         Temp_File_Record to the end, after the AFCB has been created.
2917 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2919         * checks.adb (Insert_Valid_Check): Do not generate
2920         a validity check when inside a generic.
2922 2017-04-25  Yannick Moy  <moy@adacore.com>
2924         * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
2926 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2928         * snames.ads-tmpl (Snames): More names for detecting predefined
2929         potentially blocking subprograms.
2931 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2933         * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
2934         concerning inheritance of class-wide preconditions do not apply
2935         to postconditions.
2937 2017-04-25  Bob Duff  <duff@adacore.com>
2939         * s-ficobl.ads: Minor comment fix.
2941 2017-04-25  Yannick Moy  <moy@adacore.com>
2943         * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
2944         conversions from float to integer in GNATprove mode.
2945         (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
2946         to call Apply_Type_Conversion_Checks, so that range checks
2947         are properly positioned when needed on conversions, including
2948         when converting from float to integer.  (Determine_Range): In
2949         GNATprove mode, take into account the possibility of conversion
2950         from float to integer.
2951         * sem_res.adb (Resolve_Type_Conversion): Only enforce range
2952         check on conversions from fixed-point to integer, not anymore
2953         on conversions from floating-point to integer, when in GNATprove
2954         mode.
2956 2017-04-25  Yannick Moy  <moy@adacore.com>
2958         * checks.adb (Determine_Range_R): Special case type conversions
2959         from integer to float in order to get bounds in that case too.
2960         * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
2961         mode, for computations involved in interval checking.
2963 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2965         * checks.adb (Insert_Valid_Check): Partially reimplement validity
2966         checks.
2967         * einfo.adb Node36 is now used as Validated_Object.
2968         (Validated_Object): New routine.
2969         (Set_Validated_Object): New routine.
2970         (Write_Field36_Name): Add an entry for Validated_Object.
2971         * einfo.ads Add new attribute Validated_Object along with
2972         usage in entities.
2973         (Validated_Object): New routine along with pragma Inline.
2974         (Set_Validated_Object): New routine along with pragma Inline.
2975         * exp_attr.adb (Make_Range_Test): Add processing for validation
2976         variables to avoid extra reads and copies of the prefix.
2977         * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
2978         variables in order to reflect any changes done in the variable
2979         back into the original object.
2980         * sem_util.adb (Is_Validation_Variable_Reference): New routine.
2981         * sem_util.ads (Is_Validation_Variable_Reference): New routine.
2983 2017-04-25  Steve Baird  <baird@adacore.com>
2985         * exp_ch7.adb (Build_Array_Deep_Procs,
2986         Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
2987         generate Finalize_Address routines for CodePeer.
2989 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2991         * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
2992         Analyze_Pre_Post_Condition, to implement the legality checks
2993         mandated by AI12-0131: Pre'Class shall not be specified for an
2994         overriding primitive subprogram of a tagged type T unless the
2995         Pre'Class aspect is specified for the corresponding primitive
2996         subprogram of some ancestor of T.
2998 2017-04-25  Bob Duff  <duff@adacore.com>
3000         * sem_ch8.adb (Use_One_Type): If a use_type_clause
3001         is redundant, set its Used_Operations to empty. This is only
3002         necessary for use clauses that appear in the parent of a generic
3003         child unit, because those use clauses get reanalyzed when we
3004         instantiate the generic, and we don't want the Used_Operations
3005         carried over from the original context (where it was probably
3006         not redundant).
3008 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3010         * exp_ch6.adb: Minor reformatting.
3012 2017-04-25  Bob Duff  <duff@adacore.com>
3014         * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
3015         Use Source_Index (Current_Sem_Unit) to find the correct casing.
3016         * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
3017         (Current_Sem_Unit) to find the correct casing.
3018         * par.adb (Par): Null out Current_Source_File, to ensure that
3019         the above bugs won't rear their ugly heads again.
3021 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3023         * sem_ch8.adb (Find_Type): For an attribute reference
3024         'Class, if prefix type is synchronized and previous errors
3025         have suppressed the creation of the corresponding record type,
3026         create a spurious class-wide for the synchonized type itself,
3027         to catch other misuses of the attribute
3029 2017-04-25  Steve Baird  <baird@adacore.com>
3031         * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
3032         is True, then don't generate the accessibility check for the
3033         tag of a tagged result.
3034         * exp_intr.adb (Expand_Dispatching_Constructor_Call):
3035         if CodePeer_Mode is True, then don't generate the
3036         tag checks for the result of call to an instance of
3037         Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
3038         descendant of" check and the accessibility check).
3040 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3042         * sem_ch13.adb: Code cleanups.
3043         * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
3044         * sem_ch8.ads: Minor comment fix.
3046 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3048         * exp_ch4.adb (Library_Level_Target): New function.
3049         (Expand_Concatenate): When optimization is enabled, also expand
3050         the operation out-of-line if the concatenation is present within
3051         the expression of the declaration of a library-level object and
3052         not only if it is the expression of the declaration.
3054 2017-04-25  Bob Duff  <duff@adacore.com>
3056         * freeze.adb (Freeze_Object_Declaration): Do
3057         not Remove_Side_Effects if there is a pragma Linker_Section,
3058         because in that case we want static initialization in the
3059         appropriate section.
3061 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3063         * exp_dbug.adb: Minor rewording and reformatting.
3065 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3067         * sem_attr.adb (Statically_Denotes_Object): New predicate, to
3068         handle the proposed changes to rules concerning potentially
3069         unevaluated expressions, to include selected components that
3070         do not depend on discriminants, and indexed components with
3071         static indices.
3072         * sem_util.adb (Is_Potentially_Unevaluated): Add check for
3073         predicate in quantified expression, and fix bugs in the handling
3074         of case expressions and membership test.
3075         (Analyze_Attribute_Old_Result): use new predicate.
3076         (Analyze_Attribute, case Loop_Entry): ditto.
3078 2017-04-25  Bob Duff  <duff@adacore.com>
3080         * s-secsta.adb (SS_Info): Add a comment
3081         explaining why we don't need to walk all the chunks in order to
3082         compute the total size.
3084 2017-04-25  Bob Duff  <duff@adacore.com>
3086         * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
3087         of the global name buffer to 4*Max_Line_Length.
3089 2017-04-25  Javier Miranda  <miranda@adacore.com>
3091         * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
3092         renaming entity for debug information, mark the entity as needing debug
3093         info if it comes from sources.
3095 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3097         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
3098         restriction converning the use of 'Address where the prefix is
3099         of a controlled type.
3101 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
3103         * exp_dbug.adb: In Debug_Renaming_Declaration,
3104         skip slices that are made redundant by an indexed component
3105         access.
3106         * atree.h: New definition for Original_Node.
3108 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3110         * sem_prag.adb, sem_prag.ads: Minor reformatting.
3112 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3114         * sem_ch3.adb (Check_Entry_Contract): Call
3115         Preanalyze_Spec_Expression so that resolution takes place as well.
3116         * sem_util.adb (Check_Internal_Protected_Use): Reject properly
3117         internal calls that appear in preconditions of protected
3118         operations, in default values for same, and in contract guards
3119         for contract cases in SPARK.
3121 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3123         * a-numaux.ads: Fix description of a-numaux-darwin
3124         and a-numaux-x86.
3125         (Double): Define to Long_Float.
3126         * a-numaux-vxworks.ads (Double): Likewise.
3127         * a-numaux-darwin.ads
3128         (Double): Likewise.
3129         * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
3130         * a-numaux-x86.ads: Fix package description.
3131         * a-numaux-x86.adb (Is_Nan): Minor tweak.
3132         (Reduce): Adjust and complete description. Call Is_Nan instead of
3133         testing manually. Use an integer temporary to hold rounded value.
3134         * a-numaux-darwin.adb (Reduce): Likewise.
3135         (Is_Nan): New function.
3137 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3139         * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
3140         on analysis of prefix whose type is a current instance of a
3141         synchronized type, but where the prefix itself is an entity that
3142         is an object.
3144 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3146         * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
3147         the identity of callable entities therein, because they have been
3148         properly resolved, and prefixed calls may have been rewritten
3149         as normal calls.
3151 2017-04-25  Patrick Bernardi  <bernardi@adacore.com>
3153         * exp_ch3.adb (Build_Init_Statements): Convert
3154         the expression of the pragma/aspect Secondary_Stack_Size to
3155         internal type System.Parameters.Size_Type before assigning
3156         it to the Secondary_Stack_Size component of the task type's
3157         corresponding record.
3159 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3161         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
3162         (etc) optimizations when the type is modular and the offsets
3163         are equal.
3165 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3167         * s-osinte-freebsd.ads: Minor comment tweaks
3169 2017-04-25  Javier Miranda  <miranda@adacore.com>
3171         * urealp.adb (UR_Write): Reverse previous patch
3172         adding documentation on why we generate multiplications instead
3173         of divisions (needed to avoid expressions whose computation with
3174         large numbers may cause division by 0).
3176 2017-04-25  Bob Duff  <duff@adacore.com>
3178         * erroutc.adb (Set_Specific_Warning_Off,
3179         Set_Warnings_Mode_Off): Use the correct source file for
3180         Stop. Was using Current_Source_File, which is only valid during
3181         parsing. Current_Source_File will have a leftover value from
3182         whatever file happened to be parsed last, because of a with_clause
3183         or something.
3185 2017-04-25  Bob Duff  <duff@adacore.com>
3187         * lib.ads, lib.adb (In_Internal_Unit): New functions similar
3188         to In_Predefined_Unit, but including GNAT units.
3189         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
3190         with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
3191         because Should_Ignore_Pragma was not working reliably outside
3192         the parser, because Current_Source_File is not valid.
3193         * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
3194         * par-prag.adb: Call Should_Ignore_Pragma_Par.
3196 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3198         * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
3199         codepeer mode.
3201 2017-04-25  Javier Miranda  <miranda@adacore.com>
3203         * urealp.adb (UR_Write): Fix output of constants with a base other
3204         that 10.
3206 2017-04-25  Justin Squirek  <squirek@adacore.com>
3208         * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
3209         * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
3210         Add extra parameter for Process_Interface_Name.
3211         (Process_Interface_Name): Add parameter for pragma to analyze
3212         corresponding aspect.
3213         * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
3214         from sem_ch13.adb
3216 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3218         * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
3219         correction.
3221 2017-04-25  Yannick Moy  <moy@adacore.com>
3223         * sem_res.adb (Resolve_Comparison_Op): Do not
3224         attempt evaluation of relational operations inside assertions.
3226 2017-04-25  Justin Squirek  <squirek@adacore.com>
3228         * exp_util.adb (Add_Interface_Invariants):
3229         Restored, code moved back from Build_Invariant_Procedure_Body.
3230         (Add_Parent_Invariants): Restored, code moved back from
3231         Build_Invariant_Procedure_Body.
3232         (Build_Invariant_Procedure_Body):
3233         Remove refactored calls and integrated code from
3234         Add_Parent_Invariants and Add_Interface_Invariants.
3236 2017-04-25  Johannes Kanig  <kanig@adacore.com>
3238         * errout.adb (Output_Messages): Adjust computation of total
3239         errors
3240         * erroutc.adb (Error_Msg): In statistics counts, deal
3241         correctly with informational messages that are not warnings.
3242         * errutil.adb (Finalize): adjust computation of total errors.
3244 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3246         * terminals.c (__gnat_terminate_pid): New.
3247         * g-exptty.ads (Terminate_Process): New. Update comments.
3249 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3251         * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
3253 2017-04-25  Justin Squirek  <squirek@adacore.com>
3255         * sem_ch3.adb (Analyze_Declarations): Minor
3256         correction to comments, move out large conditional and scope
3257         traversal into a predicate.
3258         (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
3259         logic.
3261 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3263         * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
3264         of prefix whose type is a current instance of a synchronized
3265         type. If the prefix is an object this is an external call (or
3266         requeue) that can only access public operations of the object. The
3267         previous predicate was too restrictive, and did not allow public
3268         protected operations, only task entries.
3270 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3272         * sem_ch5.adb, fname.adb: Minor reformatting.
3274 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3276         * einfo.adb (Is_Anonymous_Access_Type): New routine.
3277         * einfo.ads Update the placement of
3278         E_Anonymous_Access_Subprogram_Type along with all subtypes that
3279         mention the ekind.
3280         (Is_Anonymous_Access_Type): New routine.
3281         * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
3282         master for an access type subject to pragma No_Heap_Finalization.
3283         * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
3284         allocated or deallocated does not finalization actions if the
3285         associated access type is subject to pragma No_Heap_Finalization.
3286         * opt.ads Add new global variable No_Heap_Finalization_Pragma.
3287         * par-prag.adb Pragma No_Heap_Finalization does not need special
3288         processing from the parser.
3289         * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
3290         ??? comments. Use the new predicate Is_Anonymous_Access_Type.
3291         * sem_prag.adb Add an entry in table Sig_Flags for pragma
3292         No_Heap_Finalization.
3293         (Analyze_Pragma): Add processing for
3294         pragma No_Heap_Finalization. Update various error messages to
3295         use Duplication_Error.
3296         * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
3297         * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
3298         and corresponding pragma id.
3300 2017-04-25  Bob Duff  <duff@adacore.com>
3302         * freeze.adb (Freeze_Record_Type): Use the
3303         underlying type of the component type to determine whether it's
3304         elementary. For representation clause purposes, a private type
3305         should behave the same as its full type.
3306         * fname.ads, fname.adb (Is_Predefined_File_Name):
3307         Make sure things like "system.ali" are recognized as predefined.
3309 2017-04-25  Javier Miranda  <miranda@adacore.com>
3311         * debug.adb: Update documentation of -gnatd.6.
3313 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3315         * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
3316         element iterator when the name is an overloaded function call,
3317         one of whose interpretations yields an array.
3319 2017-04-25  Bob Duff  <duff@adacore.com>
3321         * uname.ads, uname.adb (Is_Predefined_Unit_Name,
3322         Is_Internal_Unit_Name): New functions for operating on unit
3323         names, as opposed to file names. There's some duplicated code
3324         with fname.adb, which is unfortunate, but it seems like we don't
3325         want to add dependencies here.
3326         * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
3327         to Is_Predefined_Unit_Name; the former was wrong, because Uname
3328         is not a file name at all.
3329         * fname.ads, fname.adb: Document the fact that
3330         Is_Predefined_File_Name and Is_Internal_File_Name can be called
3331         for ALI files, and fix the code so it works properly for ALI
3332         files. E.g. these should return True for "system.ali".
3334 2017-04-25  Justin Squirek  <squirek@adacore.com>
3336         * exp_util.adb (Add_Invariant): Removed,
3337         code moved to Add_Invariant_Check, Add_Inherited_Invariant,
3338         and Add_Own_Invariant.  (Add_Invariant_Check): Used
3339         for adding runtime checks from any kind of invariant.
3340         (Add_Inherited_Invariant): Generates invariant checks for
3341         class-wide invariants (Add_Interface_Invariants): Removed, code
3342         moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
3343         Create a types own invariant procedure (Add_Parent_Invariants):
3344         Removed, code moved to Build_Invariant_Procedure_Body
3345         (Build_Invariant_Procedure_Body): Add refactored calls
3346         and integrated code from Add_Parent_Invariants and
3347         Add_Interface_Invariants.
3348         (Process_Type): Removed, the
3349         relavant code was inlined into both Add_Own_Invariant and
3350         Add_Inherited_Invariant.
3352 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3354         * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
3355         scn.adb, osint.adb, fname.adb: Minor reformatting.
3357 2017-04-25  Pascal Obry  <obry@adacore.com>
3359         * s-taprop-mingw.adb: Do not check for CloseHandle in
3360         Finalize_TCB.
3362 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3364         * sem_util.adb (Check_Part_Of_Reference):
3365         Continue to examine the context if the reference appears within
3366         an expression function.
3368 2017-04-25  Justin Squirek  <squirek@adacore.com>
3370         * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
3371         and Build_Invariant_Procedure_Declaration.
3372         * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
3373         and Build_Invariant_Procedure_Declaration from exp_ch7
3374         and break-out Is_Untagged_Private_Derivation from
3375         Build_Invariant_Procedure_Body.
3376         (Replace_Type_References):
3377         Append an extra parameter to allow for dispatching replacements
3378         and add the corrasponding logic.
3379         (Type_Invariant): Remove
3380         Replace_Typ_Refs and replace its references with calls to
3381         Replace_Type_References.
3382         * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
3384 2017-04-25  Bob Duff  <duff@adacore.com>
3386         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
3387         that returns True when appropriate.
3388         * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
3389         when compiling predefined files.
3390         * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
3391         "gnat.adc" should not be considered a predefined file name.
3392         That required (or at least encouraged) a lot of cleanup of global
3393         variable usage. We shouldn't be communicating information via
3394         the global name buffer.
3395         * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
3396         * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
3397         required by the above-mentioned cleanup.
3399 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3401         * osint.adb (Find_File): Handle properly a request for a
3402         configuration file whose name is a directory.
3404 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3406         * sem_attr.adb, sem_ch5.adb: Minor reformatting.
3408 2017-04-25  Bob Duff  <duff@adacore.com>
3410         * types.ads: Minor: Fix '???' comment.
3411         * sem_ch8.adb: Minor comment fix.
3413 2017-04-25  Bob Duff  <duff@adacore.com>
3415         * sem_prag.adb: Remove suspicious uses of Name_Buf.
3416         * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
3417         Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
3418         Add String_To_Name with no side effects.
3420 2017-04-25  Justin Squirek  <squirek@adacore.com>
3422         * sem_ch3.adb (Analyze_Declarations): Add
3423         additional condition for edge case.
3425 2017-04-25  Bob Duff  <duff@adacore.com>
3427         * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
3428         reserved words inside pragmas. This is necessary to allow the
3429         pragma name Interface to be used in pragma Ignore_Pragma.
3430         * par.adb: Minor comment fix.
3432 2017-04-25  Javier Miranda  <miranda@adacore.com>
3434         * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
3435         * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
3436         * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
3437         * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
3438         occurrences of RE_Type_Is_Abstract
3440 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3442         * exp_util.adb (Build_Chain): Account for ancestor
3443         subtypes while traversing the derivation chain.
3445 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3447         * sem_attr.adb: minor reformatting.
3449 2017-04-25  Doug Rupp  <rupp@adacore.com>
3451         * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
3453 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3455         * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
3456         the first pass over an assignment statement with target names,
3457         to prevent the generation of subtypes (such as discriminated
3458         record components)that may carry the target name outside of the
3459         tree for the assignment. The subtypes will be generated when
3460         the assignment is reanalyzed in full.
3461         (Analyze_Target_Name): Handle properly class-wide types.
3463 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3465         * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
3466         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3467         the purposes of freezing.
3468         * exp_util.adb Update the documentation and structure of the
3469         type map used in class-wide semantics of assertion expressions.
3470         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3471         and resolve the triaged expression because all substitutions
3472         refer to the proper entities.  Update the replacement of
3473         references.
3474         (Build_DIC_Procedure_Body): Add formal parameter
3475         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3476         are now only processed when freezing occurs.  Build a body only
3477         when one is needed.
3478         (Entity_Hash): Removed.
3479         (Map_Types): New routine.
3480         (Replace_Object_And_Primitive_References): Removed.
3481         (Replace_References): New routine.
3482         (Replace_Type_References): Moved to the library level of Exp_Util.
3483         (Type_Map_Hash): New routine.
3484         (Update_Primitives_Mapping): Update the mapping call.
3485         (Update_Primitives_Mapping_Of_Types): Removed.
3486         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3487         parameter For_Freeze and update the comment on usage.
3488         (Map_Types): New routine.
3489         (Replace_References): New routine.
3490         (Replace_Type_References): Moved to the library level of Exp_Util.
3491         (Update_Primitives_Mapping_Of_Types): Removed.
3492         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3493         properties of the private type to the full view in case the full
3494         view derives from a parent type and inherits a DIC pragma.
3495         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3496         DIC pragma is placed at the top of a declarative region.
3498 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3500         * a-tasatt.adb: Complete previous change and use an unsigned
3501         int to avoid overflow checks.
3503 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3505         * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
3506         the error message when the attribute reference is an actual in
3507         a call to a subprogram inherited from a generic formal type with
3508         unknown discriminants, which makes the subprogram and its formal
3509         parameters intrinsic (see RM 6.3.1 (8) and (13)).
3511 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3513         * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
3514         sem_prag.adb: Minor reformatting.
3516 2017-04-25  Bob Duff  <duff@adacore.com>
3518         * sem_attr.adb (Type_Key): Add code in the
3519         recursive Compute_Type_Key to protect against fetching the source
3520         code for Standard, in case a component of the type is declared
3521         in Standard. There was already code to do this for the original
3522         type, but not for its components.
3524 2017-04-25  Javier Miranda  <miranda@adacore.com>
3526         * exp_ch3.adb (Build_Initialization_Call): Handle
3527         subtypes of private types when searching for the underlying full
3528         view of a private type.
3530 2017-04-25  Javier Miranda  <miranda@adacore.com>
3532         * sem_res.adb (Set_Mixed_Mode_Operand): A universal
3533         real conditional expression can appear in a fixed-type context
3534         and must be resolved with that context to facilitate the code
3535         generation to the backend.
3537 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3539         * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
3540         to indicate whether during inline processing, when some unit U1
3541         appears in the context of a unit U2 compiled for instantiation
3542         or inlining purposes, the body of U1 needs to be compiled as well.
3543         * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
3544         context is a package declaration.
3545         * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
3546         Analyze_Generic_Package_Declaration): ditto.
3547         * inline.adb (Analyze_Inlined_Bodies): Check
3548         Body_Needed_For_Inlining.
3550 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3552         * par.adb (Current_Assign_Node): Global variable use to record
3553         the presence of a target_name in the right hand side of the
3554         assignment being parsed.
3555         * par-ch4.adb (P_Name): If the name is a target_name, mark the
3556         enclosing assignment node accordingly.
3557         * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
3558         appropriately.
3559         * sem_ch5.adb (Analyze_Assignment): Disable expansion before
3560         analyzing RHS if the statement has target_names.
3561         * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
3562         properly choices that are subtype marks.
3563         * exp_ch5.adb: Code cleanup.
3565 2017-04-25  Bob Duff  <duff@adacore.com>
3567         * s-memory.adb: Add a comment regarding efficiency.
3568         * atree.adb: Fix the assertion, and combine 2 assertions into one,
3569         "the source has an extension if and only if the destination does."
3570         * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
3572 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3574         * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
3575         conversion.
3577 2017-04-25  Doug Rupp  <rupp@adacore.com>
3579         * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
3580         handling for ppc64-vx7.
3581         * sigtramp-vxworks-target.inc
3582         [SIGTRAMP_BODY]: Add section for ppc64-vx7.
3584 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3586         * ada_get_targ.adb: New file.
3588 2017-04-25  Bob Duff  <duff@adacore.com>
3590         * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
3591         Direct_Val (Right), instead of the incorrect Direct_Val (Left).
3592         (UI_GCD): Remove ??? comment involving possible efficiency
3593         improvements. This just isn't important after all these years.
3594         Also minor cleanup.
3595         * uintp.ads: Minor cleanup.
3597 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3599         * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
3600         Revert previous changes.
3601         * scng.adb: Minor reformatting.
3602         * s-stratt.ads: Fix unbalanced parens in comment.
3604 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3606         * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
3607         Minor reformatting.
3609 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3611         * scng.adb (Scan): Handle '@' appropriately.
3612         * sem_ch5.adb: Code cleanup.
3614 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3616         * freeze.adb (Check_Expression_Function): Do not check for the
3617         use of deferred constants if the freezing of the expression
3618         function is triggered by its generated body, rather than a
3619         premature use.
3621 2017-04-25  Javier Miranda  <miranda@adacore.com>
3623         * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
3624         subtypes of private types when performing the view conversion.
3626 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3628         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3629         the purposes of freezing.
3630         * exp_util.adb Update the documentation and structure of the
3631         type map used in class-wide semantics of assertion expressions.
3632         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3633         and resolve the triaged expression because all substitutions
3634         refer to the proper entities.  Update the replacement of
3635         references.
3636         (Build_DIC_Procedure_Body): Add formal parameter
3637         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3638         are now only processed when freezing occurs.  Build a body only
3639         when one is needed.
3640         (Entity_Hash): Removed.
3641         (Map_Types): New routine.
3642         (Replace_Object_And_Primitive_References): Removed.
3643         (Replace_References): New routine.
3644         (Replace_Type_References): Moved to the library level of Exp_Util.
3645         (Type_Map_Hash): New routine.
3646         (Update_Primitives_Mapping): Update the mapping call.
3647         (Update_Primitives_Mapping_Of_Types): Removed.
3648         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3649         parameter For_Freeze and update the comment on usage.
3650         (Map_Types): New routine.
3651         (Replace_References): New routine.
3652         (Replace_Type_References): Moved to the library level of Exp_Util.
3653         (Update_Primitives_Mapping_Of_Types): Removed.
3654         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3655         properties of the private type to the full view in case the full
3656         view derives from a parent type and inherits a DIC pragma.
3657         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3658         DIC pragma is placed at the top of a declarative region.
3660 2017-04-25  Tristan Gingold  <gingold@adacore.com>
3662         * s-mmap.ads (Data): Add pragma Inline.
3664 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3666         * checks.adb (Insert_Valid_Check): Do not use
3667         a renaming to alias a volatile name because this will lead to
3668         multiple evaluations of the volatile name. Use a constant to
3669         capture the value instead.
3671 2017-04-25  Doug Rupp  <rupp@adacore.com>
3673         * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
3675 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3677         * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
3678         Add out parameter to indicate to caller that a wrapper must
3679         be constructed for an inherited primitive whose inherited
3680         pre/postcondition has called to overridden primitives.
3681         * freeze.adb (Check_Inherited_Conditions): Build wrapper body
3682         for inherited primitive that requires it.
3683         * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
3684         legal primitive operations and belong to the list of bodies
3685         generated after the freeze point of a type.
3686         * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
3687         of Build_Class_Wide_Expression.
3688         * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
3689         to construct the specification of the wrapper subprogram created
3690         for an inherited operation.
3692 2017-04-25  Bob Duff  <duff@adacore.com>
3694         * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
3695         pthread_mutexattr_setprioceiling): Add new interfaces for these
3696         pthread operations.
3697         * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
3698         protocols as appropriate for Locking_Policy 'C' and 'I'.
3699         * s-taprop-posix.adb: Minor reformatting to make it more similar
3700         to s-taprop-linux.adb.
3702 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3704         * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
3705         Handle properly a multi- level derivation involving both renamed
3706         and constrained parent discriminants, when the type to be
3707         constrained has fewer discriminants that the ultimate ancestor.
3709 2017-04-25  Bob Duff  <duff@adacore.com>
3711         * sem_util.adb (Is_Object_Reference): In the
3712         case of N_Explicit_Dereference, return False if it came from a
3713         conditional expression.
3715 2017-04-25  Bob Duff  <duff@adacore.com>
3717         * par-ch4.adb (P_Case_Expression): If a semicolon
3718         is followed by "when", assume that ";" was meant to be ",".
3720 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3722         * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
3723         fixes.
3725 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3727         * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
3728         loading of an entity.
3729         * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
3730         previously repeated in the analysis.
3731         * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
3732         procedure SPARK_Implicit_Load.  (Analyze_Task_Type_Declaration):
3733         use new procedure SPARK_Implicit_Load.
3734         * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
3735         SPARK_Implicit_Load.
3737 2017-04-25  Javier Miranda  <miranda@adacore.com>
3739         * sem_util.adb (New_Copy_Tree): By default
3740         copying of defining identifiers is prohibited because
3741         this would introduce an entirely new entity into the
3742         tree. This patch introduces an exception to this general
3743         rule: the declaration of constants and variables located in
3744         Expression_With_Action nodes.
3745         (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
3746         (In_Map): New subprogram.
3747         (Visit_Entity): New subprogram.
3748         (Visit_Node): Handle EWA_Level,
3749         EWA_Inner_Scope_Level, and take care of defining entities defined
3750         in Expression_With_Action nodes.
3752 2017-04-25  Thomas Quinot  <quinot@adacore.com>
3754         * exp_ch6.adb: minor comment edit.
3755         * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
3756         procedure specifications that come from source.
3757         * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
3758         Null_Statement attribute.
3759         * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
3760         procedure, generate statement SCO for the generated NULL statement.
3761         * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
3762         parser, if available.
3764 2017-04-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
3766         * system-linux-s390.ads: Use Long_Integer'Size to define
3767         Memory_Size.
3769 2017-04-04  Eric Botcazou  <ebotcazou@adacore.com>
3771         * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
3773 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
3775         * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
3776         * g-socket.adb (To_Host_Entry): Fix typo in comment.
3777         * gnat_ugn.texi: Fix typo.
3778         * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
3779         * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
3780         * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
3781         * sem_util.adb (Mark_Coextensions): Likewise.
3782         * sem_util.ads (Available_Full_View_Of_Component): Likewise.
3784 2017-03-28  Andreas Schwab  <schwab@suse.de>
3786         PR ada/80117
3787         * system-linux-aarch64-ilp32.ads: New file.
3788         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
3789         from LIBGNAT_TARGET_PAIRS.
3790         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
3791         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
3792         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
3793         or -mabi=ilp32, resp.
3795 2017-03-14  James Cowgill  <James.Cowgill@imgtec.com>
3797         * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
3799 2017-03-08  Thanassis Tsiodras  <ttsiodras@gmail.com>
3801         PR ada/79903
3802         * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
3804 2017-03-08  Eric Botcazou  <ebotcazou@adacore.com>
3806         PR ada/79945
3807         * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
3809         * system-linux-arm.ads (Default_Bit_Order): Likewise.
3810         * system-linux-mips.ads (Default_Bit_Order): Likewise.
3811         * system-linux-armeb.ads: Delete.
3812         * system-linux-mipsel.ads: Likewise.
3813         * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
3814         (ARM/Linux): Likewise.
3816 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
3818         PR c/79677
3819         * gcc-interface/misc.c (gnat_handle_option): Pass true to
3820         handle_generated_option GENERATED_P.
3822 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3824         * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
3825         around a justified modular type if it doesn't have the same scalar
3826         storage order as the enclosing record type.
3828 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3830         * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
3831         of boolean rvalues to function calls.
3833 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3835         * gcc-interface/utils.c (fold_bit_position): New function.
3836         (rest_of_record_type_compilation): Call it instead of bit_position to
3837         compute the field position and remove the call to remove_conversions.
3838         (compute_related_constant): Factor out the multiplication in both
3839         operands, if any, and streamline the final test.
3841 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3843         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
3845 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3847         * gcc-interface/decl.c: Include demangle.h.
3848         (is_cplusplus_method): Return again true for a primitive operation
3849         only if it is dispatching.  For a subprogram with an interface name,
3850         call the demangler to get the number of C++ parameters and compare it
3851         with the number of Ada parameters.
3853 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3855         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
3856         there is no end label, put the location of the At_End procedure on
3857         the call to the procedure.
3859 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3861         * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
3862         value for array types with TYPE_INDEX_TYPE set on their domain type.
3863         * gcc-interface/utils.c (max_size): For operations and expressions, do
3864         not build a new node if the operands have not changed or are missing.
3866 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3868         * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
3869         argument when recursing on TRUTH_NOT_EXPR.
3871 2017-02-12  John Marino  <gnugcc@marino.st>
3873         * system-freebsd-x86.ads: Rename into...
3874         * system-freebsd.ads: ...this.
3875         (Default_Bit_Order): Define using Standard'Default_Bit_Order.
3876         * gcc-interface/Makefile.in: Support aarch64-freebsd.
3877         (x86-64/FreeBSD): Adjust to above renaming.
3878         (i386/FreeBSD): Likewise.
3880 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
3882         * comperr.adb: Update FSF bug reporting URL.
3884 2017-02-01  Eric Botcazou  <ebotcazou@adacore.com>
3885             Jakub Jelinek  <jakub@redhat.com>
3887         PR ada/79309
3888         * adaint.c (__gnat_killprocesstree): Fix broken string handling.
3890 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
3892         PR lto/79061
3893         * gcc-interface/utils.c (get_global_context): Pass main_input_filename
3894         to build_translation_unit_decl.
3896 2017-01-23  Javier Miranda  <miranda@adacore.com>
3898         * sem_util.adb (New_Copy_Tree): Code cleanup:
3899         removal of the internal map (ie. variable Actual_Map, its
3900         associated local variables, and all the code handling it).
3901         * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
3902         force loading of the System package when processing a task type.
3903         (Analyze_Protected_Type_Declaration): in GNATprove mode force
3904         loading of the System package when processing a protected type.
3905         * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
3906         force loading of the System package when processing compilation
3907         unit with a main-like subprogram.
3908         * frontend.adb (Frontend): remove forced loading of the System
3909         package.
3911 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3913         * sem_prag.adb (Default_Initial_Condition): If the desired type
3914         declaration is a derived type declaration with discriminants,
3915         it is rewritten as a private type declaration.
3916         * sem_ch13.adb (Replace_Type_References_Generic,
3917         Visible_Component): A discriminated private type with descriminnts
3918         has components that must be rewritten as selected components
3919         if they appear as identifiers in an aspect expression such as
3920         a Default_Initial_Condition.
3921         * sem_util.adb (Defining_Entity): support N_Iterator_Specification
3922         nodes.
3924 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3926         * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
3927         * gnat1drv.adb Generate an empty object file for an ignored
3928         Ghost compilation unit.
3929         * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
3931 2017-01-23  Yannick Moy  <moy@adacore.com>
3933         * sem_ch4.adb (Analyze_Indexed_Component_Form):
3934         Adapt to inlined prefix with string literal subtype.
3935         * inline.adb (Expand_Inlined_Call): Keep unchecked
3936         conversion inside inlined call when formal type is constrained.
3938 2017-01-23  Javier Miranda  <miranda@adacore.com>
3940         * sem_util.adb (New_Copy_Tree): Code cleanup:
3941         removal of global variables. All the global variables, global
3942         functions and tables of this subprogram are now declared locally.
3944 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
3946         * exp_strm.ads: Minor reformatting and typo fixes.
3948 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3950         * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
3951         exp_aggr.adb: Minor reformatting.
3952         * g-diopit.adb: minor grammar/punctuation fix in comment.
3953         * g-byorma.ads: minor fix of unbalanced parens in comment.
3955 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3957         * par.adb: Update the documentation of component Labl.
3958         * par-ch6.adb (P_Return_Statement): Set the expected label of
3959         an extended return statement to Error.
3961 2017-01-23  Tristan Gingold  <gingold@adacore.com>
3963         * s-boustr.ads, s-boustr.adb (Is_Full): New function.
3965 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3967         * expander.adb: Handle N_Delta_Aggregate.
3969 2017-01-23  Javier Miranda  <miranda@adacore.com>
3971         * exp_ch6.adb (Expand_Call): Improve the code that
3972         checks if some formal of the called subprogram is a class-wide
3973         interface, to handle subtypes of class-wide interfaces.
3975 2017-01-23  Javier Miranda  <miranda@adacore.com>
3977         * checks.adb (Apply_Parameter_Aliasing_Checks):
3978         Remove side effects of the actuals before generating the overlap
3979         check.
3981 2017-01-23  Justin Squirek  <squirek@adacore.com>
3983         * exp_strm.ads, exp_strm.ads
3984         (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
3985         as to avoid getting the underlying type by default.
3986         * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
3987         underlying type in the Iiput and output attribute cases when
3988         building their respective functions.
3990 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
3992         * scng.adb: Minor reformatting of error message.
3994 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3996         * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
3997         to freeze the return type of an expression funxtion that is a
3998         completion, if the type is a limited view and the non-limited
3999         view is available.
4001 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4003         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
4004         aggregate construct.
4005         (P_Record_Or_Array_Component_Association): An array aggregate
4006         can start with an Iterated_Component_Association.
4007         * scng.adb: Modify error message on improper use of @ in earlier
4008         versions of the language.
4009         * sinfo.ads: New node kind N_Delta_Aggregate.
4010         * sinfo.adb: An N_Delta_Aggregate has component associations and
4011         an expression.
4012         * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
4013         * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
4014         Create a new index for each one of the choices in the association,
4015         to prevent spurious homonyms in the scope.
4016         (Resolve_Delta_Aggregate): New.
4017         * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
4018         * exp_util.adb (Insert_Actions): Take into account
4019         N_Delta_Aggregate.
4020         * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
4021         * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
4022         and local procedures Expand_Delta_Array_Aggregate and
4023         expand_Delta_Record_Aggregate.
4024         * sprint.adb: Handle N_Delta_Aggregate.
4026 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4028         * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
4029         empty name when the exception declaration is subject to pragma
4030         Discard_Names.
4031         (Null_String): New routine.
4033 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4035         * par-ch9.adb (P_Protected_Definition): Parse
4036         any optional and potentially illegal pragmas which appear in
4037         a protected operation declaration list.
4038         (P_Task_Items): Parse
4039         any optional and potentially illegal pragmas which appear in a
4040         task item list.
4042 2017-01-23  Pascal Obry  <obry@adacore.com>
4044         * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
4045         is needed when a foreign thread call a Win32 API using a thread handle
4046         like GetThreadTimes() for example.
4048 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4050         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4051         allow an 'Address clause to be specified on a prefix of a
4052         class-wide type.
4054 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4056         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4057         attribute 'Valid is a renaming of the original expression when
4058         the expression denotes a name. For all other kinds of expression,
4059         use a constant to capture the value.
4060         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4061         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4063 2017-01-23  Justin Squirek  <squirek@adacore.com>
4065         * sem_eval.adb (Eval_Integer_Literal): Add special
4066         case to avoid optimizing out check if the literal appears in
4067         an if-expression.
4069 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4071         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4072         allow an 'Address clause to be specified on a prefix of a
4073         class-wide type.
4075 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4077         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4078         attribute 'Valid is a renaming of the original expression when
4079         the expression denotes a name. For all other kinds of expression,
4080         use a constant to capture the value.
4081         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4082         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4084 2017-01-23  Justin Squirek  <squirek@adacore.com>
4086         * sem_eval.adb (Eval_Integer_Literal): Add special
4087         case to avoid optimizing out check if the literal appears in
4088         an if-expression.
4090 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4092         * sem_ch4.adb (Try_Primitive_Operations,
4093         Is_Valid_First_Argument_Of): argument is valid if it is a derived
4094         type with unknown discriminants that matches its underlying
4095         record view.
4096         * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
4097         expression if its type is derived from a limited type with
4098         unknown discriminants, because the expansion (which is a call)
4099         must be expanded in the enclosing context to add the proper build-
4100         in-place parameters to the call.
4101         * lib.ads, exp_ch9.adb: Minor fixes in comments.
4103 2017-01-23  Yannick Moy  <moy@adacore.com>
4105         * frontend.adb (Frontend): Do not load runtime
4106         unit for GNATprove when parsing failed.
4107         * exp_ch9.adb: minor removal of extra whitespace
4108         * exp_ch6.adb: minor typo in comment
4109         * sem_util.adb: Code cleanup.
4110         * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
4111         * a-ngcefu.adb: minor style fix in whitespace
4113 2017-01-23  Thomas Quinot  <quinot@adacore.com>
4115         * scos.ads: Document usage of 'd' as default SCO kind for
4116         declarations.
4117         * par_sco.adb (Traverse_Declarations_Or_Statements.
4118         Traverse_Degenerate_Subprogram): New supporting routine for expression
4119         functions and null procedures.
4120         (Traverse_Declarations_Or_Statements.Traverse_One): Add
4121         N_Expression_Function to the subprogram case; add required
4122         support for null procedures and expression functions.
4124 2017-01-23  Bob Duff  <duff@adacore.com>
4126         * namet.ads (Bounded_String): Decrease the size of type
4127         Bounded_String to avoid running out of stack space.
4128         * namet.ads (Append): Don't ignore buffer overflow; raise
4129         Program_Error instead.
4131 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4133         * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
4134         sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
4135         reformatting.
4136         * exp_ch9.adb: minor style fix in comment.
4138 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4140         * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
4141         for a limited record extension with unknown discriminants whose
4142         full view has no discriminants.
4144 2017-01-23  Yannick Moy  <moy@adacore.com>
4146         * exp_spark.adb: Alphabetize with clauses.
4148 2017-01-23  Yannick Moy  <moy@adacore.com>
4150         * sem_util.adb (Has_Enabled_Property): Treat
4151         protected objects and variables differently from other variables.
4153 2017-01-23  Thomas Quinot  <quinot@adacore.com>
4155         * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
4156         Split original Ada 95 part off into new subprogram
4157         below. Call that subprogram (instead of proceeding with
4158         AI95-0133 behaviour) if debug switch -gnatd.p is in use.
4159         (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
4160         * debug.adb Document new switch -gnatd.p
4161         * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
4162         record for reverse bit order if an error has already been posted
4163         on the record type.  This avoids generating extraneous "info:"
4164         messages for illegal code.
4166 2017-01-23  Justin Squirek  <squirek@adacore.com>
4168         * sem_ch3.adb (Analyze_Declarations): Correct comments
4169         * freeze.adb (Find_Constant): Add detection of deferred constants
4170         so they are not incorrectly flagged as premature.
4172 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4174         * scans.ads: New token At_Sign. Remove '@' from list of illegal
4175         characters for future version of the language. '@' is legal name.
4176         * scng.ads, scng.adb (Scan):  Handle '@' appropriately.
4177         * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
4178         denotes a Target_Name.
4179         * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
4180         * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
4181         (Has_Target_Names): New flag on N_Assignment_Statement, to
4182         indicate that RHS has occurrences of N_Target_Name.
4183         * sem.adb: Call Analyze_Target_Name.
4184         * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
4185         (urrent_LHS): Global variable that denotes LHS of assignment,
4186         used in the analysis of Target_Name nodes.
4187         * sem_res.adb (Resolve_Target_Name): New procedure.
4188         * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
4189         N is an assignment statement whose RHS contains occurences of @
4190         that designate the value of the LHS of the assignment. If the
4191         LHS is side-effect free the target names can be replaced with
4192         a copy of the LHS; otherwise the semantics of the assignment
4193         is described in terms of a procedure with an in-out parameter,
4194         and expanded as such.
4195         (Expand_N_Assignment_Statement): Call
4196         Expand_Assign_With_Target_Names when needed.
4197         * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
4198         * sprint.adb: Handle N_Target_Name.
4200 2017-01-23  Eric Botcazou  <ebotcazou@adacore.com>
4202         * checks.adb: Minor fix in comment.
4204 2017-01-23  Philippe Gil  <gil@adacore.com>
4206         * g-debpoo.adb (Do_Report) remove freed chunks from chunks
4207         count in Sort = Memory_Usage or Allocations_Count
4209 2017-01-23  Justin Squirek  <squirek@adacore.com>
4211         * sem_ch3.adb: Code cleanup.
4213 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4215         * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
4216         variables to the local variable section. Update the profile
4217         of various nested routine that previously had visibility
4218         of those globals. One the matching phase has completed,
4219         remove certain classes of clauses which are considered noise.
4220         (Check_Dependency_Clause): Properly detect a match between two
4221         'Result attributes. Update the various post-match cases to use
4222         Is_Already_Matched as this routine now automatically recognizes
4223         a previously matched 'Result attribute.
4224         (Is_Already_Matched): New routine.
4225         (Remove_Extra_Clauses): New routine.
4226         (Report_Extra_Clauses): Remove the detection of ... => null
4227         clauses as this is now done in Remove_Extra_Clauses.
4229 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4231         * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
4232         report on spurious overlaps between values involving a subtype
4233         with a static predicate, because the expansion of such a subtype
4234         into individual ranges in inhibited in ASIS mode.
4236 2017-01-23  Justin Squirek  <squirek@adacore.com>
4238         * sem_ch3.adb (Analyze_Declarations): Add detection
4239         of an edge case and delay freezing if it is present.
4241 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4243         * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
4244         sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
4246 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4248         * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
4249         access-to-subprogram types inherit the convention of the
4250         associated subprogram.  (Set_Profile_Convention): New routine.
4251         * sem_ch6.adb (Check_Conformance): Do not compare the conventions
4252         of the two entities directly, use Conventions_Match to account
4253         for anonymous access-to-subprogram and subprogram types.
4254         (Conventions_Match): New routine.
4256 2017-01-23  Claire Dross  <dross@adacore.com>
4258         * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
4259         which return Universal_Integer, force the overflow check flag for
4260         Length and Range_Length for types as big as Long_Long_Integer.
4262 2017-01-23  Claire Dross  <dross@adacore.com>
4264         * exp_spark.adb (Expand_SPARK_Attribute_Reference):  For
4265         attributes which return Universal_Integer, introduce a conversion
4266         to the expected type with the appropriate check flags set.
4267         * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
4268         base type if the range is null. It may still be invalid if it
4269         is higher than the lower bound. This is checked later in the
4270         context in which the range appears.
4272 2017-01-23  Pierre-Marie de Rodat  <derodat@adacore.com>
4274         * scos.ads: Introduce a constant to represent ignored
4275         dependencies in SCO_Unit_Table_Entry.
4277 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4279         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
4280         spaces from error messages.
4282 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4284         * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
4285         subsidiary to Expand_N_Object_ Declaration, to compute a guard on
4286         an object declaration for an array type with a modular index type
4287         with the size of Long_Long_Integer. Special processing is needed
4288         in this case to compute reliably the size of the object, and
4289         eventually  to raise Storage_Error, when wrap-around arithmetic
4290         might compute a meangingless size for the object.
4292 2017-01-23  Justin Squirek  <squirek@adacore.com>
4294         * a-wtenau.adb, par-endh.adb, sem_prag.adb,
4295         sem_type.adb: Code cleanups.
4297 2017-01-23  Bob Duff  <duff@adacore.com>
4299         * sem_res.adb (Resolve_Call): In the part of the code where
4300         it is deciding whether to turn the call into an indexed
4301         component, avoid doing so if the call is to an instance of
4302         Unchecked_Conversion. Otherwise, the compiler turns it into an
4303         indexed component, and resolution of that turns it back into a
4304         function call, and so on, resulting in infinite recursion.
4305         * sem_util.adb (Needs_One_Actual): If the first formal has a
4306         default, then return False.
4308 2017-01-21  Eric Botcazou  <ebotcazou@adacore.com>
4310         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
4311         optimizations when the type is modular and the offsets are equal.
4313 2017-01-20  Thomas Quinot  <quinot@adacore.com>
4315         * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
4316         message.
4318 2017-01-20  Nicolas Roche  <roche@adacore.com>
4320         * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
4322 2017-01-20  Bob Duff  <duff@adacore.com>
4324         * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
4325         (etc) optimizations when the type is modular.
4327 2017-01-20  Yannick Moy  <moy@adacore.com>
4329         * sem_ch6.adb (Move_Pragmas): move some pragmas,
4330         but copy the SPARK_Mode pragma instead of moving it.
4331         (Build_Subprogram_Declaration): Ensure that the generated spec
4332         and original body share the same SPARK_Pragma aspect/pragma.
4333         * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
4334         procedure to copy SPARK_Mode aspect.
4336 2017-01-20  Bob Duff  <duff@adacore.com>
4338         * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
4339         even in ASIS mode.
4340         * sem_ch13.adb (Resolve_Name): Enable setting the entity to
4341         Empty even in ASIS mode.
4343 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4345         * exp_ch9.adb: minor style fixes in comments.
4346         * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
4347         relative statement introduces an implicit dependency on
4348         Ada.Real_Time.Clock_Time.
4349         * sem_util.adb: Minor reformatting.
4351 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4353         * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
4354         must be treated as delayed aspect even if the expression is
4355         a literal, because the aspect affects the freezing and the
4356         elaboration of the object to which it applies.
4358 2017-01-20  Tristan Gingold  <gingold@adacore.com>
4360         * s-osinte-vxworks.ads (Interrup_Range): New subtype.
4362 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4364         * lib-xref.adb (Generate_Reference): Do not warn about the
4365         presence of a pragma Unreferenced if the entity appears as the
4366         actual in a procedure call that does not come from source.
4368 2017-01-20  Pascal Obry  <obry@adacore.com>
4370         * expect.c, terminals.c: Fix some warnings about unused variables.
4371         * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
4372         of the runtime.
4374 2017-01-20  Bob Duff  <duff@adacore.com>
4376         * exp_attr.adb (Constrained): Apply an access check (check that
4377         the prefix is not null) when the prefix denotes an object of an
4378         access type; that is, when there is an implicit dereference.
4380 2017-01-20  Gary Dismukes  <dismukes@adacore.com>
4382         * s-rident.ads (constant Profile_Info): Remove
4383         No_Calendar from GNAT_Extended_Ravenscar restrictions.
4385 2017-01-20  Tristan Gingold  <gingold@adacore.com>
4387         *  s-maccod.ads: Add pragma No_Elaboration_Code_All
4389 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4391         * ghost.adb (Mark_Ghost_Clause): New routine.
4392         (Prune_Node): Do not prune compilation unit nodes.
4393         (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
4394         This does not touch the node itself, but does prune all its fields.
4395         * ghost.ads (Mark_Ghost_Clause): New routine.
4396         * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
4397         package clause mentions Ghost and non-Ghost packages. Mark a
4398         use package clause as Ghost when it mentions a Ghost package.
4399         (Analyze_Use_Type): Emit an error when a use type clause mentions
4400         Ghost and non-Ghost types. Mark a use type clause as Ghost when
4401         it mentions a Ghost type.
4402         * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
4403         Ghost when it withs a Ghost unit.
4405 2017-01-20  Javier Miranda  <miranda@adacore.com>
4407         * sem_res.adb (Resolve_Call): If a function call
4408         returns a limited view of a type and at the point of the call the
4409         function is not declared in the extended main unit then replace
4410         it with the non-limited view, which must be available. If the
4411         called function is in the extended main unit then no action is
4412         needed since the back-end handles this case.
4414 2017-01-20  Eric Botcazou  <ebotcazou@adacore.com>
4416         * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
4417         (Contains_Subprograms_Refs): ...this.  Adjust comment
4418         for constants.  (Is_Subp_Or_Const_Ref): Rename into...
4419         (Is_Subprogram_Ref): ...this.
4420         (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
4421         Has_Non_Subprograms_Referencer and adjust comment.  Remove
4422         incorrect shortcut for package declarations and bodies.
4424 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4426         * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
4427         base type differs from that of the completion and the private
4428         subtype is an itype (created for a constraint on an access
4429         type e.g.), set Delayed_Freeze on both to prevent out-of-scope
4430         anomalies in gigi.
4432 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4434         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4435         When inheriting the SPARK_Mode of a prior expression function,
4436         look at the properly resolved entity rather than the initial
4437         candidate which may denote a homonym.
4439 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4441         * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
4442         Precondition or Postcondition, and the context is pragma
4443         Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
4444         and suggest the standard names Assertion_Policy /Pre /Post
4445         instead.
4447 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4449         * sem_ch10.adb, sem_cat.adb: Minor reformatting.
4451 2017-01-20  Javier Miranda  <miranda@adacore.com>
4453         * sem_ch3.adb (Access_Type_Declaration): Protect access to the
4454         Entity attribute.
4455         * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
4456         * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
4457         malformed trees.
4459 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4461         * sem_ch13.adb (Analyze_Aspect_Specification, case
4462         Dynamic_Predicate): If the entity E is a subtype that inherits
4463         a static predicate for its parent P,, the inherited and the
4464         new predicate combine in the generated predicate function,
4465         and E only has a dynamic predicate.
4467 2017-01-20  Tristan Gingold  <gingold@adacore.com>
4469         * s-boustr.ads, s-boustr.adb: New package.
4470         * Makefile.rtl: Add s-boustr.
4472 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4474         * inline.adb (Process_Formals): Qualify the
4475         expression of a return statement when it yields a universal type.
4477 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4479         * freeze.adb (Freeze_All): Freeze the default
4480         expressions of all eligible formal parameters that appear in
4481         entries, entry families, and protected subprograms.
4483 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4485         * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
4486         for illegal inherited Implicit_Dereference aspects with renamed
4487         discriminants.
4489 2017-01-20  Javier Miranda  <miranda@adacore.com>
4491         * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
4492         * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
4493         * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
4494         (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
4495         Set_Prev, Tree_Read): Adding assertion.
4496         * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
4497         * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
4498         (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
4499         Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
4500         Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
4501         Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
4502         Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
4503         Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
4504         Set_ListN_With_Parent): Adding assertion.
4506 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4508         * sem_prag.adb (Process_Convention): Diagnose properly a pragma
4509         import that applies to several homograph subprograms. when one
4510         of them is declared by a subprogram body.
4512 2017-01-20  Justin Squirek  <squirek@adacore.com>
4514         * exp_ch6.adb (Expand_Call): Remove optimization
4515         that nulls out calls to null procedures.
4517 2017-01-20  Yannick Moy  <moy@adacore.com>
4519         * inline.adb (Expand_Inlined_Call): Keep more
4520         precise type of actual for inlining whenever possible. In
4521         particular, do not switch to the formal type in GNATprove mode in
4522         some case where the GNAT backend might require it for visibility.
4524 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4526         * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
4527         aspect Implicit_Dereference can be inherited by a full view if
4528         the partial view has no discriminants, because there is no way
4529         to apply the aspect to the partial view.
4530         (Build_Derived_Record_Type): If derived type renames discriminants
4531         of the parent, the new discriminant inherits the aspect from
4532         the old one.
4533         * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
4534         call through an access discriminant designating a subprogram.
4535         * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
4536         properly a parameterless call through an access discriminant on
4537         the left-hand side of an assignment.
4538         * sem_res.adb (resolve): If an interpreation involves a
4539         discriminant with an implicit dereference and the expression is an
4540         entity, resolution takes place later in the appropriate routine.
4541         * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
4542         access discriminants that designate a subprogram type.
4544 2017-01-20  Pascal Obry  <obry@adacore.com>
4546         * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
4548 2017-01-20  Yannick Moy  <moy@adacore.com>
4550         * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
4551         on implicitly with'ed units in GNATprove mode.
4552         * sinfo.ads (Implicit_With): Document use of flag for implicitly
4553         with'ed units in GNATprove mode.
4555 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4557         * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
4558         unit Do not report an error on a non-static entity that appears
4559         in the context of a spec expression, such as an aspect expression.
4561 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4563         * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
4564         (Is_Underlying_Full_View): New routine.
4565         (Set_Is_Underlying_Full_View): New routine.
4566         (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
4567         * einfo.ads Add new attribute Is_Underlying_Full_View.
4568         (Is_Underlying_Full_View): New routine along with pragma Inline.
4569         (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
4570         * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
4571         class-wide types and underlying full views. The first subtype
4572         is used as the working type for all Itypes, not just array base types.
4573         (Build_DIC_Procedure_Declaration): Do not consider
4574         class-wide types and underlying full views. The first subtype
4575         is used as the working type for all Itypes, not just array
4576         base types.
4577         * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
4578         view or an underlying full view without clobbering the attributes
4579         of a previous freeze node.
4580         (Inherit_Freeze_Node): New routine.
4581         * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
4582         full view as such.
4583         (Build_Underlying_Full_View): Mark an underlying full view as such.
4584         * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
4585         full view as such.
4587 2017-01-20  Yannick Moy  <moy@adacore.com>
4589         * sinfo.ads: Document lack of Do_Division_Check flag
4590         on float exponentiation.
4592 2017-01-19  Javier Miranda  <miranda@adacore.com>
4594         * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
4595         identifier attribute of a block-statement node. Required to avoid
4596         assertion failure when building the new containers library.
4598 2017-01-19  Bob Duff  <duff@adacore.com>
4600         * exp_ch3.adb: Update comment.
4602 2017-01-19  Vincent Celier  <celier@adacore.com>
4604         * gprep.adb (Gnatprep): Parse the definition file without
4605         "replace in comments" even when switch -C is used.
4607 2017-01-19  Justin Squirek  <squirek@adacore.com>
4609         * exp_ch9.adb (Is_Pure_Barrier): Create function
4610         Is_Count_Attribute to identify an expansion of the 'Count
4611         attribute.
4613 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4615         * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
4616         statements within an element iterator loop are only analyzed
4617         agter the loop is rewritten. Within a generic the analysis must
4618         be performed in any case to complete name capture.
4620 2017-01-19  Bob Duff  <duff@adacore.com>
4622         * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
4623         before checking for unrecognized pragmas.
4624         Initialize Pname on its declarations; that's always good style.
4626 2017-01-19  Claire Dross  <dross@adacore.com>
4628         * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
4629         body into the tree for GNATprove by setting its Parent field. The
4630         components invariants of composite types are not checked by
4631         the composite type's invariant procedure in GNATprove mode.
4632         (Build_Invariant_Procedure_Declaration): Semi-insert the
4633         declaration into the tree for GNATprove by setting its Parent
4634         field.
4635         * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
4636         the component invariants to the array type  invariant procedure
4637         so that the procedure can be used to  check the array type
4638         invariants if any.
4639         (Freeze_Record_Type): In GNATprove mode, do
4640         not add the component invariants to the record type  invariant
4641         procedure so that the procedure can be used to  check the record
4642         type invariants if any.
4644 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4646         * lib-xref-spark_specific.adb: Minor reformatting.
4647         * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
4649 2017-01-19  Javier Miranda  <miranda@adacore.com>
4651         * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
4652         Build_Back_End_Aggregate.
4653         (Generate_Aggregate_For_Derived_Type): Code cleanup.
4654         (Prepend_Stored_Values): Code cleanup.
4656 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4658         * sem_ch6.adb (Analyze_Expression_Function): Check for an
4659         incomplete return type after attempting to freeze it, so that
4660         other freeze actiona are generated in the proper order.
4662 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4664         * sem_aggr.adb (Resolve_Aggregate): If the type is a string
4665         type, ie. a type whose component is a character type, and the
4666         aggregate is positional, do not convert into a string literal
4667         if the index type is not an integer type, because the original
4668         type may be required in an enclosing operation.
4670 2017-01-19  Bob Duff  <duff@adacore.com>
4672         * binde.adb, debug.adb: Enable new elaboration order algorithm
4673         by default. -dp switch reverts to the old algorithm.
4675 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4677         * sem_ch3.adb Add with and use clauses for Exp_Ch7.
4678         (Analyze_Declarations): Create the DIC and Invariant
4679         procedure bodies s after all freezing has taken place.
4680         (Build_Assertion_Bodies): New routine.
4681         * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
4682         and Exp_Util.
4683         (Analyze_Package_Specification): Remove the
4684         generation of the DIC and Invariant procedure bodies. This is
4685         now done by Analyze_Declarations.
4686         * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
4687         procedures are never treated as primitives.
4689 2017-01-19  Yannick Moy  <moy@adacore.com>
4691         * frontend.adb: Analyze inlined bodies and check elaboration
4692         rules in GNATprove mode too.
4693         * sem_elab.adb (Delay_Element): Add Boolean component to save
4694         indication that call is in SPARK code.  (Check_Elab_Calls):
4695         Check elaboration rules in GNATprove mode, and correctly set
4696         the current value of SPARK_Mode.
4697         * lib-xref-spark_specific.adb
4698         (Add_SPARK_Xrefs): Simplify iteration over dereferences.
4700 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4702         * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
4703         checks on the expression for the high bound of concatenation
4704         when checks are disabled, to suppress warnings about potential
4705         constraint errors in restricted runtimes.
4707 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4709         * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
4710         representation-to-position function as inlined.
4711         * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
4712         the purity of an internally generated entity if it has been
4713         explicitly marked as pure for optimization purposes.
4714         * exp_aggr.adb: Minor reformatting.
4716 2017-01-19  Javier Miranda  <miranda@adacore.com>
4718         * exp_ch6.adb (Expand_Call): Remove side effects on
4719         actuals that are allocators with qualified expression since the
4720         initialization of the object is performed by means of individual
4721         statements (and hence it must be done before the call).
4723 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4725         * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
4726         (Build_Derived_Enumeration_Type): If the derived type inherits a
4727         dynamic predicate from its parent, the bounds of the type must
4728         freeze because an explicit constraint is constructed for the
4729         type and the corresponding range is elaborated now.
4731 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
4733         * sem_attr.ads: minor fix of inconsistent casing in comment
4734         * lib-writ.ads: minor align comments in columns
4735         * sem_ch3.adb: Minor reformatting.
4736         * spark_xrefs.ads: minor fix typo in SPARK-related comment
4737         * table.ads: minor style fix in comment
4738         * lib-xref-spark_specific.adb
4739         (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
4740         * sem_ch12.adb: minor whitespace fix
4741         * freeze.adb: Add comment.
4742         * sem_util.adb (Unique_Name): for instances of
4743         generic subprograms ignore the name of the wrapper package.
4745 2017-01-19  Javier Miranda  <miranda@adacore.com>
4747         * exp_aggr.adb (Resolve_Record_Aggregate):
4748         Factorize code needed for aggregates of limited and unlimited
4749         types in a new routine.
4750         (Pass_Aggregate_To_Back_End): New subprogram.
4752 2017-01-19  Yannick Moy  <moy@adacore.com>
4754         * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
4756 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4758         * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
4759         public, for use elsewhere.
4760         * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
4761         an Inlined_body, recognize a call that uses object notation
4762         and has not been rewritten as a regular call because regular
4763         expansion has not taken place.
4765 2017-01-19  Bob Duff  <duff@adacore.com>
4767         * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
4768         in case of generic formal discrete types, because it causes crashes in
4769         the compiler when built with assertions on.
4771 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4773         * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
4774         sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
4776 2017-01-19  Bob Duff  <duff@adacore.com>
4778         * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
4779         Increment Warnings_Detected.  It was decrementing, which is
4780         wrong since we just issued a warning message.
4781         * binderr.ads (Errors_Detected, Warnings_Detected): Declare
4782         these variables to be of subtype Nat instead of Int, because
4783         they should never be negative.
4785 2017-01-19  Javier Miranda  <miranda@adacore.com>
4787         * contracts.adb (Build_Postconditions_Procedure): Replace
4788         Generate_C_Code by Modify_Tree_For_C.
4789         * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
4790         Replace Generate_C_Code by Modify_Tree_For_C.
4791         * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
4792         Modify_Tree_For_C.
4793         * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
4794         Generate_C_Code by Modify_Tree_For_C.
4795         * exp_ch4.adb (Expand_Allocator_Expression): Replace
4796         Generate_C_Code by Modify_Tree_For_C.
4797         * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
4798         by Modify_Tree_For_C.
4799         * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
4800         Generate_C_Code by Modify_Tree_For_C.
4801         * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
4802         by Modify_Tree_For_C.
4803         * sinfo.ads (Modify_Tree_For_C): Adding documentation.
4805 2017-01-19  Javier Miranda  <miranda@adacore.com>
4807         * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
4808         subprogram.
4809         (Is_Inlinable_Expression_Function): New subprogram.
4810         * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
4811         to Sem_Util.
4812         (Is_Inlinable_Expression_Function): Moved to Sem_Util.
4814 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4816         * sem_ch4.adb (Diagnose_Call): Improve error message when a
4817         selected component has a prefix that might be interpreted
4818         as a parameterless function call, but none of the candidate
4819         interpretations is parameterless, and there is a hidden homonym
4820         of the prefix that is a package.
4821         * sem_ch8.adb (Find_Selected_Component): If the prefix might be
4822         interpreted as a parameterless function call and its analysis
4823         fails, do not call Analyze_Selected_Component.
4825 2017-01-19  Steve Baird  <baird@adacore.com>
4827         * sem_util.ads: Add new Use_Full_View Boolean parameter to
4828         Get_Index_Bounds.
4829         * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
4830         calls to a newly-defined Scalar_Range_Of_Right_View function.
4832 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
4834         * gnat1drv.adb: minor fix of unbalanced parens in comment
4835         * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
4836         to visible part of the package to allow re-use in GNATprove.
4837         * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
4838         from repeated code of Traverse_Compilation_Unit.
4839         (Traverse_Declaration_Or_Statement): fixed detection of
4840         generic subprograms and packages; also, iteration over case
4841         statement alternatives rewritten to avoid testing if the first
4842         alternative is present (since it must be present due to Ada
4843         syntax restrictions).
4845 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4847         * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
4848         returning by reference not just for subprogram body stubs,
4849         but for all subprogram cases.
4850         * sem_util.adb: Code reformatting.
4851         (Requires_Transient_Scope): Update the call to Results_Differ.
4852         (Results_Differ): Update the parameter profile and the associated
4853         comment on usage.
4855 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4857         * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
4858         identifier nodes that do not come from source, to handle properly
4859         dimensionality check within an inlined body which inclddes both
4860         original operands and rewritten operands. This removes spurious
4861         dimensionality errors in the presence of front-end inlining,
4862         as well as in SPARK mode.
4864 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
4866         PR driver/49726
4867         * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
4869 2017-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4871         * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
4873 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
4875         * doc/gnat_ugn/getting_started_with_gnat.rst,
4876         doc/gnat_ugn/inline_assembler.rst,
4877         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4878         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
4879         doc/gnat_ugn/about_this_guide.rst,
4880         doc/gnat_ugn/platform_specific_information.rst,
4881         doc/gnat_ugn/example_of_binder_output.rst,
4882         doc/gnat_ugn/gnat_and_program_execution.rst,
4883         doc/gnat_ugn/gnat_utility_programs.rst,
4884         doc/gnat_ugn/the_gnat_compilation_model.rst,
4885         doc/gnat_rm/implementation_defined_attributes.rst,
4886         doc/gnat_rm/compatibility_and_porting_guide.rst,
4887         doc/gnat_rm/standard_library_routines.rst,
4888         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
4889         doc/gnat_rm/implementation_defined_pragmas.rst,
4890         doc/gnat_rm/the_gnat_library.rst,
4891         doc/gnat_rm/obsolescent_features.rst,
4892         doc/gnat_rm/about_this_guide.rst,
4893         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
4894         doc/gnat_rm/implementation_of_ada_2012_features.rst,
4895         doc/gnat_rm/interfacing_to_other_languages.rst,
4896         doc/gnat_rm/implementation_defined_aspects.rst,
4897         doc/gnat_rm.rst: Update documentation.
4898         * gnat_rm.texi, gnat_ugn.texi: Regenerated.
4900 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
4902         * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
4903         * scil_ll.adb: Minor style fix in comment.
4904         * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
4905         even if entity is already set, because the node may be renalyzed
4906         after inlining transformations.
4908 2017-01-13  Javier Miranda  <miranda@adacore.com>
4910         * sem_res.adb (Resolve_Call): Do not establish a transient scope
4911         for a call to inlinable expression function (since the call will
4912         be replaced by its returned object).
4913         * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
4914         * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
4915         (Expand_Call): For inlinable expression function call replace the
4916         call by its returned object.
4917         (Is_Inlinable_Expression_Function): New subprogram.
4919 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
4921         * checks.adb: Minor typo fix and reformatting.
4923 2017-01-13  Javier Miranda  <miranda@adacore.com>
4925         * contracts.adb (Contract_Only_Subprograms): Remove formal.
4926         (Copy_Original_Specification): Removed.
4927         (Skip_Contract_Only_Subprogram): Move here checks previously
4928         located in the caller of this routine (to leave the code more clean).
4929         (Build_Contract_Only_Subprogram): Code cleanup.
4930         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
4931         (Get_Contract_Only_Missing_Body_Name): Removed.
4933 2017-01-13  Javier Miranda  <miranda@adacore.com>
4935         * sem_ch6.adb (Cloned_Expression): New subprogram.
4936         (Freeze_Expr_Types): Complete previous patch since the expression
4937         of an expression-function may have iterators and loops with
4938         defining identifiers which, as part of the preanalysis of the
4939         expression, may be left decorated with itypes that will not be
4940         available in the tree passed to the backend.
4942 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
4944         * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
4945         conversion to Integer of an expression that is an attribute
4946         reference 'Pos on an enumeration type.
4948 2017-01-13  Bob Duff  <duff@adacore.com>
4950         * atree.ads: Minor comment fix.
4952 2017-01-13  Justin Squirek  <squirek@adacore.com>
4954         * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
4955         calls in accessibility check on return statement.
4957 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
4959         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4960         Ensure that the input body is a subprogram body before trying to
4961         determine whether it denoted an expression function.  Note that
4962         subprogram body stubs cannot denote expression functions.
4964 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
4966         * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
4967         and typo fixes.
4969 2017-01-13  Javier Miranda  <miranda@adacore.com>
4971         * einfo.ads (Component_Bit_Offset): Fix documentation.
4972         * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
4973         on record holes for components with unknown compile-time offsets.
4975 2017-01-13  Bob Duff  <duff@adacore.com>
4977         * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
4978         * g-locfil.ads: Minor comment fix.
4980 2017-01-13  Bob Duff  <duff@adacore.com>
4982         * binde.adb (Elab_New): New elaboration order algorithm
4983         that is expected to cause fewer ABE issues. This is a work in
4984         progress. The new algorithm is currently disabled, and can be
4985         enable by the -dp switch, or by modifying the Do_Old and Do_New
4986         etc. flags and rebuilding. Experimental code is included to
4987         compare the results of the old and new algorithms.
4988         * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
4989         can have multiple of these tables, so the old and new algorithms
4990         can coexist.
4991         * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
4992         parameter of type array. This avoids the global variable, and
4993         allows bounds checking (which is normally defeated by the tables
4994         packages). It also ensures that the Elab_Order is read-only
4995         to Bindgen.
4996         * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
4997         subprograms that need it, as above.
4998         * debug.adb: Document new -dp switch. Modify doc of old -do
4999         switch.
5000         * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
5001         and Bindgen.  Move writing of closure (-R and -Ra switches)
5002         to Binde; that's more convenient.
5004 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5006         * sem_ch6.adb (Analyze_Expression_Function): If the expression
5007         function is a completion, all entities referenced in the
5008         expression are frozen. As a consequence, a reference to an
5009         uncompleted private type from an enclosing scope is illegal.
5011 2017-01-13  Javier Miranda  <miranda@adacore.com>
5013         * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
5014         (Analyze_Subprogram_Body_Helper): At the occurrence of an
5015         expression function declaration that is a completion, its
5016         expression causes freezing (AI12-0103).
5018 2017-01-13  Vadim Godunko  <godunko@adacore.com>
5020         * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
5021         Reference functions of Ada.Containers.Indefinite_Holders.
5023 2017-01-13  Bob Duff  <duff@adacore.com>
5025         * s-os_lib.ads: Minor comment fixes.
5027 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5029         * exp_ch3.adb (Default_Initialize_Object): Do not default
5030         initialize an object when it is of a task type and restriction
5031         No_Tasking is in effect because the initialization is obsolete.
5032         * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
5033         restriction No_Tasking is in effect.
5034         (Build_Master_Renaming): Do not rename a master when restriction
5035         No_Tasking is in effect.
5037 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5039         * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
5040         the legality of An others clause applies as well to a choice in
5041         an Iterated_component_ association.
5042         (Resolve_Iterated_Component_Association): An others choice
5043         is legal.
5044         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
5045         Iterated_Component_Association is not static.
5047 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5049         * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
5050         control is passed to the expresion handler before the new mode
5051         is set.
5052         * sem_ch12.adb (Analyze_Package_Instantiation,
5053         Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
5054         in case control is passed to the expresion handler before the
5055         new mode is set.
5057 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5059         * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
5060         exp_aggr.adb: Minor reformatting.
5062 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5064         * inline.adb: Minor reformatting and typo fix.
5066 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5068         * sem_util.ads, sem_util.adb (Choice_List): Move function here
5069         from sem_aggr.adb, for use elsewhere.
5070         * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
5071         * sem_aggr.adb (Resolve_Array_Aggregate): Remove
5072         Iterated_Component_Present.
5073         * exp_aggr.adb: Use Choice_List throughout, to handle
5074         Iterated_Component_Associations.
5075         (Gen_Loop): Generate proper loop for an
5076         Iterated_Component_Association: loop variable has the identifier
5077         of the original association. Generate a loop even for a single
5078         component choice, in order to make loop parameter visible in
5079         expression.
5080         (Flatten): An Iterated_Component_Association is not static.
5082 2017-01-13  Yannick Moy  <moy@adacore.com>
5084         * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
5085         float exponentiation for statically known small negative values
5086         is the reciprocal of the exponentiation for the opposite value
5087         of the exponent.
5088         * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
5089         Ensure that the value of float exponentiation for negative values
5090         is the reciprocal of the exponentiation for the opposite value
5091         of the exponent.
5092         * inline.adb (Expand_Inlined_Call): Fix the count
5093         for the number of generated gotos.
5095 2017-01-13  Yannick Moy  <moy@adacore.com>
5097         * inline.adb: Code cleanup.
5098         * sem_util.adb (Is_OK_Volatile_Context): Add
5099         expression in delay statement as OK for volatile context.
5101 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5103         * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
5104         mode a choice that is a subtype with a static predicate is
5105         replaced by the values it covers. This transformation must not
5106         be performed in ASIS mode, to preserve the source for analysis.
5108 2017-01-13  Justin Squirek  <squirek@adacore.com>
5110         * nlists.ads: Correct minor typo.
5112 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5114         * sem_ch13.adb: Minor reformatting and typo fix.
5116 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5118         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
5119         Iterated_Component_Association is a named association in an
5120         array aggregate.
5121         * sem_aggr.adb (Resolve_Iterated_Component_Association): New
5122         procedure, subsidiary of Resolve_Array_Aggregate, to analyze
5123         and resolve the discrete choices and the expression of the
5124         new construct.
5125         * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
5126         Loop_Actions and Box_Present are attributes of
5127         N_Iterated_Component_Association nodes. Box_Present is always
5128         False in this case.
5129         * sprint.adb (Sprint_Node): An Iterated_Component_Association
5130         has a Discrete_Choices list, as specified in the RM. A
5131         Component_Association for aggregate uses instead a Choices list.
5132         We have to live with this small inconsistency because the new
5133         construct also has a defining identifier, and there is no way
5134         to merge the two node structures.
5136 2017-01-13  Yannick Moy  <moy@adacore.com>
5138         * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
5139         list of pragmas to remove.  Remove pragmas from the list of
5140         statements in the body to inline.
5141         * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
5143 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5145         * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
5146         Analyze_Declarations, to analyze and resolve the expressions of
5147         aspect specifications in the current declarative list, so that
5148         the expressions have proper entity and type info.  This is needed
5149         for ASIS when there is no subsequent expansion to generate this
5150         semantic information.
5151         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
5152         original expression, to suppress cascaded errors when expression
5153         has been constant-folded.
5154         (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
5155         ASIS mode, because there is no subsequent expansion to decorate
5156         the tree.
5158 2017-01-13  Yannick Moy  <moy@adacore.com>
5160         * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
5161         New function to detect when a call may be inlined or not in
5162         GNATprove mode.
5163         (Expand_Inlined_Call): Ensure that a temporary
5164         is always created in the cases where a type conversion may be
5165         needed on an input parameter in GNATprove mode, so that GNATprove
5166         sees the check to perform.
5167         * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
5168         when not applicable due to actual requiring type conversion
5169         with possible check but no temporary value can be copied for
5170         GNATprove to see the check.
5172 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5174         * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
5175         exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
5176         layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
5177         exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
5178         exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
5179         g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
5180         sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
5181         prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
5182         a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
5183         get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
5184         g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
5185         sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
5186         s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
5187         contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
5188         g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
5189         g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
5190         a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
5191         ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
5192         get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
5193         prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
5194         exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
5195         s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
5196         a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
5197         a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
5198         g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
5199         par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
5200         uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
5201         a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
5202         statements to reflect the new style for case alternatives. Various
5203         code clean up and reformatting.
5205 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5207         * exp_util.adb: Minor reformatting.
5209 2017-01-13  Yannick Moy  <moy@adacore.com>
5211         * exp_spark.adb: Code cleanup.
5212         * sem_ch9.adb (Analyze_Delay_Until): Resolve
5213         expression so that calls are identified as such inside delay
5214         until.
5216 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5218         * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
5219         * par-ch3.adb (P_Discrete_Choice_List): An
5220         Iterated_Component_Association is an array aggregate component.
5221         * par-ch4.adb (P_Iterated_Component_Association): New procedure.
5222         (Is_Quantified_Expression): New function that performs a lookahead
5223         to distinguish quantified expressions from iterated component
5224         associations.
5225         (P_Aggregate_Or_Paren_Expr): Recognize iterated component
5226         associations.
5227         (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
5228         * sem.adb (Analyze): Handle Iterated_Component_Association.
5229         * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
5230         component associations.
5231         * sinfo.ads, sinfo.adb: Entries for for
5232         N_Iterated_Component_Association and its fields.
5233         * sprint.adb (Sprint_Node_Actual): Handle
5234         N_Iterated_Component_Association.
5236 2017-01-13  Justin Squirek  <squirek@adacore.com>
5238         * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
5239         of the style check until after preanalysis of acutals.
5241 2017-01-13  Yannick Moy  <moy@adacore.com>
5243         * sem_ch13.adb: Minor reformatting.
5244         * par-ch11.adb: minor style fix in whitespace
5245         * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
5246         reduced to Add_Artificial_ALI_File; style fix in declaration of
5247         Text; grammar fix in comment.
5248         * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
5249         * freeze.adb: Cleanup to pass pragma instead of
5250         expression to call.
5251         * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
5252         replace System'To_Address by equivalent call.
5254 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
5256         * bindusg.adb: Improve usage output for -f switch.
5258 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5260         * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
5261         Minor reformatting.
5263 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5265         * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
5266         treat comparisons on strings as legal in a Static_Predicate.
5267         (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
5268         a function call that is the expansion of a string comparison.The
5269         function call is built when compiling the corresponding predicate
5270         function, but the expression has been found legal as a static
5271         predicate during earlier analysis.
5272         * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
5273         properly a function call that is the expansion of a string
5274         comparison operation, in order to recover the Static_Predicate
5275         expression and apply it to a static argument when needed.
5277 2017-01-13  Tristan Gingold  <gingold@adacore.com>
5279         * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
5280         (Open_Read): Re-implement using Open_Read_No_Exception.
5281         (Open_Write): Raise exception in case of error.
5282         * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
5283         * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
5284         reaise exception.
5285         * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
5287 2017-01-13  Yannick Moy  <moy@adacore.com>
5289         * checks.adb: Code cleanup.
5291 2017-01-13  Yannick Moy  <moy@adacore.com>
5293         * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
5294         expression instead of unanalyzed aspect expression for checking
5295         the validity of inheriting an operation. Also copy the expression
5296         being passing it to Build_Class_Wide_Expression, as this call
5297         modifies its argument.
5298         * sem_util.ads Fix comment to reference correct function name
5299         New_Copy_Tree.
5301 2017-01-13  Javier Miranda  <miranda@adacore.com>
5303         * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
5304         when we propagate information about the indexes back to the original
5305         indexing mode and the prefix of the index is a function call, do not
5306         remove any parameter from such call.
5308 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5310         * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
5311         * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
5312         a build-in-place function whose result type is tagged.
5314 2017-01-13  Yannick Moy  <moy@adacore.com>
5316         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5317         Do not generate a wrapper when the only candidate is a class-wide
5318         subprogram.
5319         (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
5320         inside a generic context.
5322 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5324         * exp_util.adb (Add_Inherited_Tagged_DIC):
5325         Pass the object parameters of both the parent and the derived
5326         type DIC procedure to the reference replacement circuitry.
5327         (Find_DIC_Type): Modify the circuitry to present the partial
5328         view of a private type in case the private type defines its own
5329         DIC pragma.
5330         (Replace_Object_And_Primitive_References): Add two
5331         optional formal parameters.  Update the comment on usage. Update
5332         the replacement of references to object parameters.
5334 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5336         * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
5338 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5340         * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
5341         an out parameter that is a type conversion, independently of th
5342         range check that may apply to the expression of the conversion,
5343         for use in GNATProve.
5345 2017-01-13  Yannick Moy  <moy@adacore.com>
5347         * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
5348         GNATprove_Mode here to Frontend.
5349         * frontend.adb (Frontend): Move the implicit with for System
5350         in GNATprove_Mode here as it ismore correct this way; the old
5351         place only worked by chance, since there were no overloaded names.
5352         * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
5353         * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
5354         four attributes identified in SRM 9(18), add an implicit with
5355         to Ada.Task_Identification.
5356         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5357         Deal specially with the wrapper introduced for AI05-0071 in GNATprove
5358         mode.
5359         * checks.adb (Apply_Discriminant_Check,
5360         Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
5361         In GNATprove mode, we do not apply the checks, but we still
5362         analyze the expression to possibly issue errors on SPARK
5363         code when a run-time error can be detected at compile time.
5364         (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
5365         in GNATprove mode.
5367 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5369         * expander.adb (Expand): Add a warning about using return
5370         statements in Ghost management code.
5371         * exp_ch3.adb (Freeze_Type): Add a warning about using return
5372         statements in Ghost management code.
5373         * exp_ch7.adb (Build_Invariant_Procedure_Body,
5374         Build_Invariant_Procedure_Declaration): Add a warning about
5375         using return statements in Ghost management code.
5376         * exp_disp.adb (Make_DT): Add a warning about using return
5377         statements in Ghost management code.
5378         * exp_util.adb (Build_DIC_Procedure_Body,
5379         Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
5380         warning about using return statements in Ghost management code.
5381         * freeze.adb (Freeze_Entity): Add a warning about using return
5382         statements in Ghost management code.
5383         * sem.adb (Analyze, Do_Analyze): Add a warning about using return
5384         statements in Ghost management code.
5385         * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
5386         a warning about using return statements in Ghost management code.
5387         * sem_ch5.adb (Analyze_Assignment): Add a warning about using
5388         return statements in Ghost management code.
5389         * sem_ch6.adb (Analyze_Procedure_Call,
5390         Analyze_Subprogram_Body_Helper): Add a warning about using return
5391         statements in Ghost management code.
5392         * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
5393         using return statements in Ghost management code.
5394         * sem_ch12.adb (Analyze_Package_Instantiation,
5395         Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
5396         Instantiate_Subprogram_Body): Add a warning about using return
5397         statements in Ghost management code.
5398         * sem_ch13.adb (Build_Predicate_Functions,
5399         Build_Predicate_Function_Declarations): Add a warning about
5400         using return statements in Ghost management code.
5401         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
5402         Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
5403         Analyze_Pre_Post_Condition_In_Decl_Part):  Add a warning about
5404         using return statements in Ghost management code.
5406 2017-01-13  Tristan Gingold  <gingold@adacore.com>
5408         * s-mmosin-mingw.adb: Fix pragma import.
5410 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
5412         * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
5413         codepeer mode.
5415 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5417         * atree.adb (Allocate_Initialize_Node): A newly created node is
5418         no longer marked as Ghost at this level.
5419         (Mark_New_Ghost_Node): New routine.
5420         (New_Copy): Mark the copy as Ghost.
5421         (New_Entity): Mark the entity as Ghost.
5422         (New_Node): Mark the node as Ghost.
5423         * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
5424         apply to unanalyzed entities.
5425         (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
5426         entities.
5427         (Set_Is_Checked_Ghost_Entity): This attribute now
5428         applies to all entities as well as unanalyzed entities.
5429         (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
5430         all entities as well as unanalyzed entities.
5431         * expander.adb Add with and use clauses for Ghost.
5432         (Expand): Install and revert the Ghost region associated with the node
5433         being expanded.
5434         * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
5435         (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
5436         (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
5437         (Expand_Freeze_Record_Type): Remove all Ghost-related code.
5438         (Freeze_Type): Install and revert the Ghost region associated
5439         with the type being frozen.
5440         * exp_ch5.adb Remove with and use clauses for Ghost.
5441         (Expand_N_Assignment_Statement): Remove all Ghost-related code.
5442         * exp_ch6.adb Remove with and use clauses for Ghost.
5443         (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
5444         (Expand_N_Subprogram_Body): Remove all Ghost-related code.
5445         * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
5446         Ghost region of the working type.
5447         (Build_Invariant_Procedure_Declaration): Install and revert
5448         the Ghost region of the working type.
5449         (Expand_N_Package_Body): Remove all Ghost-related code.
5450         * exp_ch8.adb Remove with and use clauses for Ghost.
5451         (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
5452         code.
5453         (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
5454         (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
5455         (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
5456         code.
5457         * exp_ch13.adb Remove with and use clauses for Ghost.
5458         (Expand_N_Freeze_Entity): Remove all Ghost-related code.
5459         * exp_disp.adb (Make_DT): Install and revert the Ghost region of
5460         the tagged type. Move the generation of various entities within
5461         the Ghost region of the type.
5462         * exp_prag.adb Remove with and use clauses for Ghost.
5463         (Expand_Pragma_Check): Remove all Ghost-related code.
5464         (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
5465         (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
5466         (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
5467         * exp_util.adb (Build_DIC_Procedure_Body): Install
5468         and revert the Ghost region of the working types.
5469         (Build_DIC_Procedure_Declaration): Install and revert the
5470         Ghost region of the working type.
5471         (Make_Invariant_Call): Install and revert the Ghost region of the
5472         associated type.
5473         (Make_Predicate_Call): Reimplemented. Install and revert the
5474         Ghost region of the associated type.
5475         * freeze.adb (Freeze_Entity): Install and revert the Ghost region
5476         of the entity being frozen.
5477         (New_Freeze_Node): Removed.
5478         * ghost.adb Remove with and use clauses for Opt.
5479         (Check_Ghost_Completion): Update the parameter profile
5480         and all references to formal parameters.
5481         (Ghost_Entity): Update the comment on usage.
5482         (Install_Ghost_Mode): New routines.
5483         (Is_Ghost_Assignment): New routine.
5484         (Is_Ghost_Declaration): New routine.
5485         (Is_Ghost_Pragma): New routine.
5486         (Is_Ghost_Procedure_Call): New routine.
5487         (Is_Ghost_Renaming): Removed.
5488         (Is_OK_Declaration): Reimplemented.
5489         (Is_OK_Pragma): Reimplemented.
5490         (Is_OK_Statement): Reimplemented.
5491         (Is_Subject_To_Ghost): Update the comment on usage.
5492         (Mark_And_Set_Ghost_Assignment): New routine.
5493         (Mark_And_Set_Ghost_Body): New routine.
5494         (Mark_And_Set_Ghost_Completion): New routine.
5495         (Mark_And_Set_Ghost_Declaration): New routine.
5496         (Mark_And_Set_Ghost_Instantiation): New routine.
5497         (Mark_And_Set_Ghost_Procedure_Call): New routine.
5498         (Mark_Full_View_As_Ghost): Removed.
5499         (Mark_Ghost_Declaration_Or_Body): New routine.
5500         (Mark_Ghost_Pragma): New routine.
5501         (Mark_Ghost_Renaming): New routine.
5502         (Mark_Pragma_As_Ghost): Removed.
5503         (Mark_Renaming_As_Ghost): Removed.
5504         (Propagate_Ignored_Ghost_Code): Update the comment on usage.
5505         (Prune_Node): Freeze nodes no longer need special pruning, they
5506         are processed by the general ignored Ghost code mechanism.
5507         (Restore_Ghost_Mode): New routine.
5508         (Set_Ghost_Mode): Reimplemented.
5509         (Set_Ghost_Mode_From_Entity): Removed.
5510         * ghost.ads Add with and use clauses for Ghost.
5511         (Check_Ghost_Completion): Update the parameter profile
5512         along with the comment on usage.
5513         (Install_Ghost_Mode): New routine.
5514         (Is_Ghost_Assignment): New routine.
5515         (Is_Ghost_Declaration): New routine.
5516         (Is_Ghost_Pragma): New routine.
5517         (Is_Ghost_Procedure_Call): New routine.
5518         (Mark_And_Set_Ghost_Assignment): New routine.
5519         (Mark_And_Set_Ghost_Body): New routine.
5520         (Mark_And_Set_Ghost_Completion): New routine.
5521         (Mark_And_Set_Ghost_Declaration): New routine.
5522         (Mark_And_Set_Ghost_Instantiation): New routine.
5523         (Mark_And_Set_Ghost_Procedure_Call): New routine.
5524         (Mark_Full_View_As_Ghost): Removed.
5525         (Mark_Ghost_Pragma): New routine.
5526         (Mark_Ghost_Renaming): New routine.
5527         (Mark_Pragma_As_Ghost): Removed.
5528         (Mark_Renaming_As_Ghost): Removed.
5529         (Restore_Ghost_Mode): New routine.
5530         (Set_Ghost_Mode): Redefined.
5531         (Set_Ghost_Mode_From_Entity): Removed.
5532         * sem.adb (Analyze): Install and revert the Ghost region of the
5533         node being analyzed.
5534         (Do_Analyze): Change the way a clean Ghost
5535         region is installed and reverted.
5536         * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
5537         all Ghost-related code.
5538         (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
5539         (Analyze_Number_Declaration): Remove all Ghost-related code.
5540         (Analyze_Object_Declaration): Install and revert the Ghost region of
5541         a deferred object declaration's completion.
5542         (Array_Type_Declaration): Remove all Ghost-related code.
5543         (Build_Derived_Type): Update the comment on
5544         the propagation of Ghost attributes from a parent to a derived type.
5545         (Derive_Subprogram): Remove all Ghost-related code.
5546         (Make_Class_Wide_Type): Remove all Ghost-related code.
5547         (Make_Implicit_Base): Remove all Ghost-related code.
5548         (Process_Full_View): Install and revert the Ghost region of
5549         the partial view.  There is no longer need to check the Ghost
5550         completion here.
5551         * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
5552         region of the left hand side.
5553         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
5554         all Ghost-related code.
5555         (Analyze_Expression_Function): Remove all Ghost-related code.
5556         (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
5557         (Analyze_Procedure_Call): Install and revert the Ghost region of
5558         the procedure being called.
5559         (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
5560         region of the spec or body.
5561         (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
5562         (Build_Subprogram_Declaration): Remove all Ghost-related code.
5563         (Find_Corresponding_Spec): Remove all Ghost-related code.
5564         (Process_Formals): Remove all Ghost-related code.
5565         * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
5566         the Ghost region of the spec.
5567         (Analyze_Package_Declaration): Remove all Ghost-related code.
5568         * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
5569         Ghost when it aliases a Ghost entity.
5570         (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
5571         a Ghost entity.
5572         (Analyze_Object_Renaming): Mark a renaming as Ghost when
5573         it aliases a Ghost entity.
5574         (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
5575         a Ghost entity.
5576         (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
5577         aliases a Ghost entity.
5578         * sem_ch11.adb Remove with and use clauses for Ghost.
5579         (Analyze_Exception_Declaration): Remove all Ghost-related code.
5580         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
5581         Ghost-related code.
5582         (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
5583         code.
5584         (Analyze_Package_Instantiation): Install and revert the Ghost region
5585         of the package instantiation.
5586         (Analyze_Subprogram_Instantiation): Install
5587         and revert the Ghost region of the subprogram instantiation.
5588         (Instantiate_Package_Body): Code clean up. Install and revert the
5589         Ghost region of the package body.
5590         (Instantiate_Subprogram_Body): Code clean up. Install and revert the
5591         Ghost region of the subprogram body.
5592         * sem_ch13.adb (Build_Predicate_Functions): Install
5593         and revert the Ghost region of the related type.
5594         (Build_Predicate_Function_Declaration): Code clean up. Install
5595         and rever the Ghost region of the related type.
5596         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
5597         Install and revert the Ghost region of the pragma.
5598         (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
5599         Ghost region of the pragma.
5600         (Analyze_Pragma): Install and revert the Ghost region of various
5601         pragmas.  Mark a pragma as Ghost when it is related to a Ghost entity
5602         or encloses a Ghost entity.
5603         (Analyze_Pre_Post_Condition): Install and revert the Ghost
5604         region of the pragma.
5605         (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
5606         Ghost region of the pragma.
5607         * sem_res.adb (Resolve): Remove all Ghost-related code.
5608         * sem_util.adb (Is_Declaration): Reimplemented.
5609         (Is_Declaration_Other_Than_Renaming): New routine.
5610         * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
5611         * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
5612         (Is_Ghost_Pragma): Removed.
5613         (Is_Ignored_Ghost_Pragma): New routine.
5614         (Set_Is_Checked_Ghost_Pragma): New routine.
5615         (Set_Is_Ghost_Pragma): Removed.
5616         (Set_Is_Ignored_Ghost_Pragma): New routine.
5617         * sinfo.ads: Update the documentation on Ghost mode and
5618         Ghost regions.  New attributes Is_Checked_Ghost_Pragma
5619         and Is_Ignored_Ghost_Pragma along with usages in nodes.
5620         Remove attribute Is_Ghost_Pragma along with usages in nodes.
5621         (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5622         (Is_Ghost_Pragma): Removed along with pragma Inline.
5623         (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5624         (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5625         (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
5626         (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5628 2017-01-12  Tristan Gingold  <gingold@adacore.com>
5630         * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
5631         s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
5633 2017-01-12  Yannick Moy  <moy@adacore.com>
5635         * errout.adb, errout.ads (Initialize): Factor common treatment
5636         in Reset_Warnings.
5637         (Reset_Warnings): New procedure to reset counts related to warnings.
5638         (Record_Compilation_Errors): New variable to store the presence of an
5639         error, used in gnat2why to allow changing the Warning_Mode.
5640         (Compilation_Errors): Use new variable Record_Compilation_Errors to
5641         store the presence of an error.
5643 2017-01-12  Javier Miranda  <miranda@adacore.com>
5645         * sem_ch13.adb (Analyze_Aspect_Specifications):
5646         For Interrupt_Handler and Attach_ Handler aspects, decorate the
5647         internally built reference to the protected procedure as coming
5648         from sources and force its analysis.
5650 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5652         * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
5653         inherit predicates if any from the first_subtype of the parent,
5654         not from the anonymous parent type.
5655         * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
5656         predicate is not a static subtype.
5658 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5660         * freeze.adb (Check_Suspicious_Convention): New procedure
5661         performing a warning check on discriminated record types with
5662         convention C or C++. Factored out of procedure Freeze_Record_Type,
5663         and changed to only apply to base types (to avoid spurious
5664         warnings on subtypes). Minor improvement of warning messages
5665         to refer to discriminated rather than variant record types.
5666         (Freeze_Record_Type): Remove code for performing a suspicious
5667         convention check.
5668         (Freeze_Entity): Only call Freeze_Record_Type
5669         on types that aren't declared within any enclosing generic units
5670         (rather than just excluding the type when the innermost scope
5671         is generic). Call Check_Suspicious_Convention whether or not
5672         the type is declared within a generic unit.
5673         * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
5674         * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
5675         from Sem_Ch8).
5677 2017-01-12  Tristan Gingold  <gingold@adacore.com>
5679         * sysdep.c, adaint.c, rtinit.c, ming32.h:
5680         (__gnat_current_codepage): Renamed from CurrentCodePage
5681         (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
5683 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5685         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
5686         quantified expressions, following AI12-050: the loop parameters
5687         of two quantified expressions are conformant if they have the
5688         same identifier.
5690 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
5692         * gcc-interface/Makefile.in: Clean up VxWorks targets.
5694 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5696         * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
5697         Hnadle properly the attribute reference when it appears as part
5698         of an expression in another loop aspect.
5700 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5702         * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
5703         subsidiary of Build_Initialization_Call, to complete generation
5704         of predicate checks on discriminants whose (sub)types have
5705         predicates, and to add checks on variants that do not have an
5706         others clause.
5707         * sem_util.adb (Gather_Components): A missing Others alternative is
5708         not an error when the type of the discriminant is a static predicate
5709         (and coverage has been checked when analyzing the case statement). A
5710         runtime check is generated to verify that a given discriminant
5711         satisfies the predicate (RM 3.8.1. (21.1/2)).
5713 2017-01-12  Yannick Moy  <moy@adacore.com>
5715         * gnat1drv.adb (Adjust_Global_Switches): Only
5716         perform checking of exception mechanism when generating code.
5718 2017-01-12  Justin Squirek  <squirek@adacore.com>
5720         * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
5721         Remove handling of access component with invariant.
5722         (Build_Invariant_Procedure_Declaration): Remove return on class
5723         wide type.
5724         * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
5725         conditional exception for component or array so Has_Own_Invariants
5726         flag is not falsly set.
5727         * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
5728         wide type to have no invariant flags.
5730 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5732         * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
5733         sem_ch13.adb: Minor reformatting.
5735 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5737         * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
5738         adjustment primitive when the ancestor type was not properly frozen.
5739         (Gen_Assign): Guard against a missing initialization
5740         primitive when the component type was not properly frozen.
5741         (Initialize_Array_Component): Guard against a missing adjustment
5742         primitive when the component type was not properly frozen.
5743         (Initialize_Record_Component): Guard against a missing adjustment
5744         primitive when the component type was not properly frozen.
5745         (Process_Transient_Component_Completion): The transient object may
5746         not be finalized when its associated type was not properly frozen.
5747         * exp_ch3.adb (Build_Assignment): Guard against a missing
5748         adjustment primitive when the component type was not properly frozen.
5749         (Build_Initialization_Call): Guard against a missing
5750         initialization primitive when the associated type was not properly
5751         frozen.
5752         (Expand_N_Object_Declaration): Guard against a missing
5753         adjustment primitive when the base type was not properly frozen.
5754         (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
5755         body when there is no adjustment primitive available. Create an
5756         empty Deep_Finalize body when there is no finalization primitive
5757         available.
5758         * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
5759         missing finalization primitive when the designated type was
5760         not properly frozen.
5761         (Expand_N_Allocator): Guard against a missing initialization primitive
5762         when the designated type was not properly frozen.
5763         * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
5764         only when the corresponding adjustment primitive is available.
5765         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
5766         adjustment/finalization statements only when there is an available
5767         primitive to carry out the action.
5768         (Build_Initialize_Statements): Generate the initialization/finalization
5769         statements only when there is an available primitive to carry out the
5770         action.
5771         (Make_Adjust_Call): Do not generate a call when the underlying
5772         type is not present due to a possible missing full view.
5773         (Make_Final_Call): Do not generate a call when the underlying
5774         type is not present due to a possible missing full view.
5775         (Make_Finalize_Address_Stmts): Generate an empty body when the
5776         designated type lacks a finalization primitive.
5777         (Make_Init_Call): Do not generate a call when the underlying type is
5778         not present due to a possible missing full view.
5779         (Process_Component_For_Adjust): Add the adjustment call only when the
5780         corresponding adjustment primitive is available.
5781         (Process_Component_For_Finalize): Add the finalization call only when
5782         the corresponding finalization primitive is available.
5783         (Process_Object_Declaration): Use a null statement to emulate a
5784         missing call to the finalization primitive of the object type.
5785         * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
5786         (Make_Final_Call): Update the comment on usage.
5787         (Make_Init_Call): Update the comment on usage.
5788         * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
5790 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
5792         * einfo.ads: Update documentation of Address_Taken.
5793         * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
5794         [Access_Attribute]): Only consider 'Access/'Unchecked_Access
5795         for subprograms when setting Address_Taken flag.
5797 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
5799         * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
5800         Configurable_Run_Time_Mode off when analysing with'ed predefined
5801         libraries.
5803 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5805         * sem_prag.adb: Minor reformatting.
5806         * sem_util.adb (Unique_Entity): fix result for
5807         bodies of entry families.
5809 2017-01-12  Justin Squirek  <squirek@adacore.com>
5811         * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
5812         Resolve_Suppressible in the pragma Assertion_Policy case.
5813         (Resolve_Suppressible): Created this function to factor out
5814         common code used to resolve Suppress to either Ignore or Check
5815         * snames.ads-tmpl: Add name for Suppressible.
5817 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5819         * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
5820         reformatting.
5821         * debug.adb: Minor comment fixes.
5823 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
5825         * sem_util.adb (Unique_Entity): For concurrent
5826         bodies that are defined with stubs and complete a declaration
5827         of a single concurrent object return the entity of an implicit
5828         concurrent type, not the entity of the anonymous concurrent
5829         object.
5830         * debug.adb: -gnatd.J is no longer used.
5831         * make.adb (Globalize): Removed, no longer used.
5832         * sem_ch9.adb: minor typo in comment for entry index
5834 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
5836         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
5837         * exp_ch3.adb (Build_Init_Statements): As part of initialising
5838         the value record of a task, set its _Secondary_Stack_Size field
5839         if present.
5840         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
5841         a _Secondary_Stack_Size field in the value record of
5842         the task if a Secondary_Stack_Size rep item is present.
5843         (Make_Task_Create_Call): Include secondary stack size
5844         parameter. If No_Secondary_Stack restriction is in place, passes
5845         stack size of 0.
5846         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
5847         Secondary_Stack_Size.
5848         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
5849         function to define the overhead of the secondary stack.
5850         * s-tarest.adb (Create_Restricted_Task,
5851         Create_Restricted_Task_Sequential): Functions now include
5852         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
5853         * s-tarest.adb (Create_Restricted_Task,
5854         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
5855         include Secondary_Stack_Size parameter.
5856         (Task_Wrapper): Secondary stack now allocated to the size specified by
5857         the Secondary_Stack_Size parameter in the task's ATCB.
5858         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
5859         Secondary_Stack_Size component.
5860         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
5861         Create_Restricted_Task_Sequential): Function now include
5862         Secondary_Stack_Size parameter.
5863         (Task_Wrapper): Secondary stack now allocated to the size
5864         specified by the Secondary_Stack_Size parameter in the task's
5865         ATCB.
5866         * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
5867         to include Secondary_Stack_Size parameter.
5868         * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
5869         Secondary_Stack_Size aspect, turning the aspect into its corresponding
5870         internal attribute.
5871         (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
5872         * snames.adb-tmpl, snames.ads-tmpl: Added names
5873         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
5874         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
5876 2017-01-12  Yannick Moy  <moy@adacore.com>
5878         * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
5879         subtree.
5881 2017-01-12  Justin Squirek  <squirek@adacore.com>
5883         * exp_attr.adb (Expand_N_Attribute_Reference):
5884         Fix Finalization_Size case by properly resolving the type after
5885         rewritting the node.
5887 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5889         * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
5890         the tree.
5891         (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
5892         * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
5893         exp_sel.ads: Minor reformatting.
5895 2017-01-12  Justin Squirek  <squirek@adacore.com>
5897         * exp_ch6.adb (Expand_Call): Add guard to prevent
5898         invariant checks from being created for internally generated
5899         subprograms.
5901 2017-01-12  Bob Duff  <duff@adacore.com>
5903         * lib-writ.ads: Remove incorrect comment.
5905 2017-01-12  Javier Miranda  <miranda@adacore.com>
5907         * debug.adb (-gnatd.K): Enable generation of contract-only
5908         procedures in CodePeer mode.
5909         * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
5910         New subprogram.
5911         (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
5912         set.
5913         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
5914         subprogram.
5915         (Get_Contract_Only_Missing_Body_Name): New subprogram.
5916         (Get_Contract_Only_Body): New subprogram.
5917         (Set_Contract_Only_Body): New subprogram.
5918         (Is_Contract_Only_Body): New subprogram.
5919         (Set_Is_Contract_Only_Body): New subprogram.
5920         (SCIL_Nodes): Replace table by hash-table.
5922 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5924         * exp_ch6.adb: Minor reformatting.
5925         * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
5927 2017-01-12  Bob Duff  <duff@adacore.com>
5929         * binde.adb (Forced): New reason for a dependence.
5930         (Force_Elab_Order): Implementation of the new switch.
5931         * binde.ads: Minor comment fixes.
5932         * bindusg.adb: Add -f switch. Apparently, there was an -f switch
5933         long ago that is no longer supported; removed comment about that.
5934         * opt.ads (Force_Elab_Order_File): Name of file specified for
5935         -f switch.
5936         * switch-b.adb: Parse -f switch.
5938 2017-01-12  Justin Squirek  <squirek@adacore.com>
5940         * exp_ch6.adb (Check_View_Conversion): Created this function
5941         to properly chain calls to check type invariants that may be
5942         present in a subprogram call after the subprogram.
5943         (Expand_Call): Add a conditional to identify when a view conversion
5944         needs to be checked.
5945         * nlists.adb, nlists.ads (Prepend_New): New routine.
5946         (Prepend_New_To): New routine.
5948 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5950         * sinfo.ads: Minor reformatting.
5952 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5954         * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
5955         reformatting.
5957 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5959         * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
5960         variable Definite. Create a local object and pass its 'Access to the
5961         BIP function when the result type is either definite or it does not
5962         require any finalization or secondary stack management.
5964 2017-01-12  Bob Duff  <duff@adacore.com>
5966         * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
5967         exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
5968         frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
5969         par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
5970         sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
5971         sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
5972         sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
5973         sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
5974         Change name to Pragma_Name_Unmapped.
5975         (Pragma_Name_Mapped): Change name to Pragma_Name.
5976         This is because the "mapped" version should be the usual case.
5978 2017-01-09  Hristian Kirtchev  <kirtchev@adacore.com>
5980         * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
5981         Is_Default_Init_Cond_Procedure, and
5982         Has_Inherited_Default_Init_Cond.  Add uses of flags
5983         Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
5984         (Default_Init_Cond_Procedure): Removed.
5985         (DIC_Procedure): New routine.
5986         (Has_Default_Init_Cond): Removed.
5987         (Has_DIC): New routine.
5988         (Has_Inheritable_Invariants): The attribute applies to the base type.
5989         (Has_Inherited_Default_Init_Cond): Removed.
5990         (Has_Inherited_DIC): New routine.
5991         (Has_Inherited_Invariants): The attribute applies to the base type.
5992         (Has_Own_DIC): New routine.
5993         (Has_Own_Invariants): The attribute applies to the base type.
5994         (Is_Default_Init_Cond_Procedure): Removed.
5995         (Is_DIC_Procedure): New routine.
5996         (Set_Default_Init_Cond_Procedure): Removed.
5997         (Set_DIC_Procedure): New routine.
5998         (Set_Has_Default_Init_Cond): Removed.
5999         (Set_Has_Inheritable_Invariants): The attribute applies
6000         to the base type.
6001         (Set_Has_Inherited_Default_Init_Cond): Removed.
6002         (Set_Has_Inherited_DIC): New routine.
6003         (Set_Has_Inherited_Invariants): The attribute applies to the base type.
6004         (Set_Has_Own_DIC): New routine.
6005         (Set_Has_Own_Invariants): The attribute applies to the base type.
6006         (Set_Is_Default_Init_Cond_Procedure): Removed.
6007         (Set_Is_DIC_Procedure): New routine.
6008         (Write_Entity_Flags): Update the output of all flags related to
6009         default initial condition.
6010         * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
6011         of the call to the DIC procedure.
6012         (Freeze_Type): Generate the body of the DIC procedure.
6013         * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
6014         all occurrences of Create_Append with Append_New_To. Do
6015         not generate an invariant procedure for a class-wide type.
6016         The generated body acts as a freeze action of the working type.
6017         (Build_Invariant_Procedure_Declaration): Do not generate an
6018         invariant procedure for a class-wide type.
6019         (Create_Append): Removed.
6020         * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
6021         sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
6022         class-wide pre/postcondition description and data structures from
6023         Sem_Prag.
6024         (Build_Class_Wide_Expression): Moved from Sem_Prag.
6025         (Build_DIC_Call): New routine.
6026         (Build_DIC_Procedure_Body): New routine.
6027         (Build_DIC_Procedure_Declaration): New routine.
6028         (Entity_Hash): Moved from Sem_Prag.
6029         (Find_DIC_Type): New routine.
6030         (Update_Primitives_Mapping): Reimplemented.
6031         (Update_Primitives_Mapping_Of_Types): New routine.
6032         * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
6033         (Build_DIC_Call): New routine.
6034         (Build_DIC_Procedure_Body): New routine.
6035         (Build_DIC_Procedure_Declaration): New routine.
6036         (Update_Primitives_Mapping): Moved from Sem_Prag.
6037         (Update_Primitives_Mapping_Of_Types): New routine.
6038         * nlists.adb (Append_New): New routine.
6039         (Append_New_To): New routine.
6040         * nlists.ads (Append_New): New routine.
6041         (Append_New_To): New routine.
6042         * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
6043         of DIC procedures here. This is now done at the end of the
6044         visible declarations, private declarations, and at the freeze
6045         point of a type.
6046         (Analyze_Private_Extension_Declaration):
6047         A private extension inherits the DIC pragma of a parent type.
6048         (Analyze_Subtype_Declaration): No need to propagate invariant
6049         attributes to a subtype as those apply to the base type.
6050         (Build_Derived_Record_Type): No need to inherit invariants here
6051         as this is now done in Build_Derived_Type.
6052         (Build_Derived_Type): Inherit both the DIC pragma and invariants from
6053         a parent type.
6054         (Process_Full_View): Update the propagation of DIC attributes.
6055         (Propagate_Default_Init_Cond_Attributes): Removed.
6056         * sem_ch7.adb Add with and use clauses for Exp_Util.
6057         (Analyze_Package_Specification): Create the body of the DIC
6058         procedure at the end of the visible and private declarations.
6059         (Preserve_Full_Attributes): Propagate DIC attributes.
6060         * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
6061         DIC attributes.
6062         (Analyze_Task_Type_Declaration): Propagate DIC attributes.
6063         * sem_elab.adb (Check_A_Call): Update the call to
6064         Is_Nontrivial_Default_Init_Cond_Procedure.
6065         * sem_prag.adb Remove the with and use clauses for
6066         GNAT.HTable. Move the handling of class- wide pre/postcondition
6067         description and data structures to Exp_Util.
6068         (Analyze_Pragma): Create the declaration of the DIC procedure. There
6069         is no need to propagate invariant-related attributes at this point
6070         as this is done in Build_Invariant_Procedure_Declaration.
6071         (Build_Class_Wide_Expression): Moved to Exp_Util.
6072         (Entity_Hash): Moved to Exp_Util.
6073         (Update_Primitives_Mapping): Moved to Exp_Util.
6074         * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
6075         (Update_Primitives_Mapping): Moved to Exp_Util.
6076         * sem_util.adb: Remove with and use clauses for Ghost
6077         and Sem_Ch13.
6078         (Build_Default_Init_Cond_Call): Removed.
6079         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6080         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6081         (Get_Views): Reimplemented.
6082         (Has_Full_Default_Initialization): Reimplement the section on DIC.
6083         (Inherit_Default_Init_Cond_Procedure): Removed.
6084         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6085         (Is_Nontrivial_DIC_Procedure): New routine.
6086         (Is_Verifiable_DIC_Pragma): New routine.
6087         (Propagate_DIC_Attributes): New routine.
6088         * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
6089         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6090         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6091         (Inherit_Default_Init_Cond_Procedure): Removed.
6092         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6093         (Is_Nontrivial_DIC_Procedure): New routine.
6094         (Is_Verifiable_DIC_Pragma): New routine.
6095         (Propagate_DIC_Attributes): New routine.
6096         * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
6097         on DIC.
6098         * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
6099         usage in nodes.
6100         (Expression_Copy): New routine along with pragma Inline.
6101         (Set_Expression_Copy): New routine along with pragma Inline.
6103 2017-01-06  Bob Duff  <duff@adacore.com>
6105         * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
6106         "Bind_Main_Program" to "not Bind_For_Library", because otherwise
6107         we won't generate the call to s_stalib_adafinal when the main
6108         is not written in Ada.
6110 2017-01-06  Bob Duff  <duff@adacore.com>
6112         * sem_prag.adb: Minor: remove pragma Warnings.
6114 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6116         * Makefile.rtl: Do not compile s-stchop by default.
6118 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
6120         * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
6121         sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
6122         snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
6123         s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
6124         Reverted previous change for now.
6126 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6128         * exp_ch3.adb (Build_Initialization_Call): Apply predicate
6129         check to default discriminant value if checks are enabled.
6130         (Build_Assignment): If type of component has static predicate,
6131         apply check to its default value, if any.
6133 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
6135         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
6136         * exp_ch3.adb (Build_Init_Statements): As part of initialising
6137         the value record of a task, set its _Secondary_Stack_Size field
6138         if present.
6139         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
6140         a _Secondary_Stack_Size field in the value record of
6141         the task if a Secondary_Stack_Size rep item is present.
6142         (Make_Task_Create_Call): Include secondary stack size
6143         parameter. If No_Secondary_Stack restriction is in place, passes
6144         stack size of 0.
6145         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
6146         Secondary_Stack_Size.
6147         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
6148         function to define the overhead of the secondary stack.
6149         * s-tarest.adb (Create_Restricted_Task,
6150         Create_Restricted_Task_Sequential): Functions now include
6151         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
6152         * s-tarest.adb (Create_Restricted_Task,
6153         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
6154         now include Secondary_Stack_Size parameter.
6155         (Task_Wrapper):
6156         Secondary stack now allocated to the size specified by the
6157         Secondary_Stack_Size parameter in the task's ATCB.
6158         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
6159         Secondary_Stack_Size component.
6160         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6161         Create_Restricted_Task_Sequential): Function now include
6162         Secondary_Stack_Size parameter.
6163         (Task_Wrapper): Secondary stack
6164         now allocated to the size specified by the Secondary_Stack_Size
6165         parameter in the task's ATCB.
6166         * sem_ch13.adb (Analyze_Aspect_Specification): Add support
6167         for Secondary_Stack_Size aspect, turning the aspect into its
6168         corresponding internal attribute.
6169         (Analyze_Attribute_Definition):
6170         Process Secondary_Stack_Size attribute.
6171         * snames.adb-tmpl, snames.ads-tmpl: Added names
6172         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6173         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6175 2017-01-06  Pascal Obry  <obry@adacore.com>
6177         * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
6178         Sequential_IO and Direct_IO.
6180 2017-01-06  Bob Duff  <duff@adacore.com>
6182         * snames.ads-tmpl (Renamed): New name for the pragma argument.
6183         * par-ch2.adb: Allow the new pragma (with analysis deferred
6184         to Sem_Prag).
6185         * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
6186         Keep a mapping from new pragma names to old names.
6187         * sem_prag.adb: Check legality of pragma Rename_Pragma, and
6188         implement it by calling Map_Pragma_Name.
6189         * checks.adb, contracts.adb, einfo.adb, errout.adb,
6190         * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
6191         * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
6192         * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
6193         * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
6194         * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6195         * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
6196         as appropriate.
6198 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6200         * exp_ch9.adb: Minor reformatting.
6202 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6204         * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
6205         * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
6206         (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
6207         (unused).
6208         * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
6209         Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
6210         * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
6211         Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
6213 2017-01-06  Bob Duff  <duff@adacore.com>
6215         * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
6216         dummy implementation of Map_Pragma_Name.
6218 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6220         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
6221         entry_body variable constant.
6222         * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
6223         * s-tpoben.ads (Protected_Entry_Body_Access): Now access
6224         to constant.
6225         * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
6226         now access to constant.
6228 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6230         * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
6231         reformatting and typo fixes.
6233 2017-01-06  Bob Duff  <duff@adacore.com>
6235         * snames.ads-tmpl: New names for pragma renaming.
6236         * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
6237         * par-prag.adb: Add new pragma name to case statement.
6238         * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
6239         of the pragma.
6240         * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
6241         Dummy implementation of Pragma_Name_Mapped.
6243 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6245         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
6246         better detect call within an entry_wrapper.
6247         * sem_res.adb (Resolve_Call): A protected call within an
6248         entity_wrapper is analyzed in the context of the protected
6249         object but corresponds to a pre-analysis and is not an access
6250         before elaboration.
6251         * sem_attr.adb: Minor reformatting.
6253 2017-01-06  Justin Squirek  <squirek@adacore.com>
6255         * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
6256         Finalization_Size to allow a prefix of any non-class-wide type.
6257         * sem_attr.ads Modify comment for Finalization_Size to include
6258         definite type use case.
6260 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6262         * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
6263         on procedures that are wrappers created for entries that have
6264         preconditions.
6265         * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
6266         body is an entry_wrapper, compile it in the context of the
6267         synchronized type, because a precondition may refer to funtions
6268         of the type.
6269         * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
6270         body entity.
6271         * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
6272         within an Entry_Wrapper this is an external call whose target
6273         is the synchronized object that is the actual in the call to
6274         the wrapper.
6276 2017-01-06  Yannick Moy  <moy@adacore.com>
6278         * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
6279         in tree, which means not analyzing the previous prefix if the node has
6280         been rewritten into its prefix.
6282 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6284         * s-tpobop.adb: Minor reformatting.
6286 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6288         * checks.adb (Ensure_Valid): Do not generate a validity check
6289         within a generated predicate function, validity checks will have
6290         been applied earlier when required.
6292 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6294         * s-tpoben.ads (Protection_Entries): Add comment and reorder
6295         components for performances.
6296         * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
6297         semantic.
6299 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6301         * sem_eval.adb (Check_Expression_Against_Static_Predicate):
6302         If expression is compile-time known and obeys a static predicate
6303         it must be labelled as static, to prevent spurious warnings and
6304         run-time errors, e.g. in case statements. This is relevant when
6305         the expression is the result of constant-folding a type conversion
6306         whose expression is a variable with a known static value.
6308 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6310         * exp_attr.adb, sem_attr.ads: Minor reformatting.
6312 2017-01-06  Justin Squirek  <squirek@adacore.com>
6314         * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
6315         expansion of Finalization_Size attribute.
6316         * sem_attr.adb (Analyze_Attribute): Add entry to check the
6317         semantics of Finalization_Size.
6318         (Eval_Attribute): Add null entry for Finalization_Size.
6319         * sem_attr.ads: Add Finalization_Size to the implementation
6320         dependent attribute list.
6321         * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
6323 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6325         * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
6326         iterator specification with a serious syntactic error, transform
6327         construct into an infinite loop in order to continue analysis
6328         and prevent a compiler abort.
6330 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6332         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
6333         max_queue_lengths_array if unused.
6335 2017-01-06  Bob Duff  <duff@adacore.com>
6337         * errout.adb (Set_Msg_Text): Protect against out-of-bounds
6338         array access, in case "\" is at the end of Text.
6339         * stylesw.adb (Set_Style_Check_Options): Don't include input
6340         characters in the error message template, because they could
6341         be control characters such as "\", which Errout will try to
6342         interpret.
6344 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6346         * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
6347         For a private type examine the visible declarations that follow
6348         the partial view, not just the private declarations that follow
6349         the full view.
6351 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6353         * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
6354         code cleanup.
6356 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6358         * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
6359         alias of the inherited op is the parent iterator, no need to
6360         examine dispatch table positions which might not be established
6361         yet if type is not frozen.
6362         * sem_disp.adb (Check_Controlling_Formals): The formal of a
6363         predicate function may be a subtype of a tagged type.
6364         * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
6365         of representation items for the completion of a type extension
6366         where a predicate applies to the partial view.
6367         * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
6368         parameter that designates function whose actual receives a
6369         predicate check, to improve warning message when the check will
6370         lead to infinite recursion.
6371         * sem_res.adb (Resolve_Actuals): Pass additional parameter to
6372         Apply_Predicate_Check.
6374 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6376         * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
6377         Gnat_Extended_Ravenscar.
6378         * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
6380 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6382         * sem_util.ads: Minor typo fix and reformatting.
6384 2017-01-06  Yannick Moy  <moy@adacore.com>
6386         * ghost.adb Minor fixing of references to SPARK RM.
6387         (Check_Ghost_Context): Check whether reference is to a lvalue
6388         before issuing an error about violation of SPARK RM 6.9(13)
6389         when declaration has Ghost policy Check and reference has Ghost
6390         policy Ignore.
6391         * sem_util.adb Minor indentation.
6392         * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
6393         Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
6394         * sem_util.ads (Unique_Defining_Entity): Document the result
6395         for package body stubs.
6397 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6399         * raise-gcc.c (abort): Macro to call Abort_Propagation.
6400         * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
6401         constant.
6402         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6403         Do not generate the Entry_Max_Queue_Lengths_Array if all default
6404         values.
6405         * exp_util.adb (Corresponding_Runtime_Package): Consider
6406         Max_Queue_Length pragma.
6408 2017-01-06  Justin Squirek  <squirek@adacore.com>
6410         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6411         Remove declaration generation in the case of
6412         System_Tasking_Protected_Objects_Single_Entry being used,
6413         and add a warning message when this is detected to occur.
6414         (Make_Initialize_Protection): Remove reference pass in the case
6415         of System_Tasking_Protected_Objects_Single_Entry.
6416         * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
6417         * s-tposen.adb (Initialize_Protection_Entry): Remove
6418         Entry_Queue_Max parameter.
6419         * s-tposen.ads: Remove the types use to store the entry queue
6420         maximum.
6421         * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
6423 2017-01-06  Yannick Moy  <moy@adacore.com>
6425         * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
6426         behavior of function, to also accept out of range positions
6427         and raise Constraint_Error in such case, and to copy sloc from
6428         literal if No_Location passed as location.
6429         * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
6430         of functions to raise Constraint_Error in case of value not in
6431         appropriate range.
6433 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6435         * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
6436         Invalidate_Stack_Cache.
6438 2017-01-06  Eric Botcazou  <ebotcazou@adacore.com>
6440         * s-os_lib.adb: Minor fix to the signature of Readlink.
6442 2017-01-06  Javier Miranda  <miranda@adacore.com>
6444         * sem_ch6.adb (Conforming_Types): Handle another
6445         confusion between views in a nested instance with an actual
6446         private type whose full view is not in scope.
6448 2017-01-06  Arnaud Charlet  <charlet@adacore.com>
6450         * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
6451         mark a rewritten if statement as explicit (Comes_From_Source).
6453 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6455         * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
6457 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6459         * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
6461 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6463         * sem_case.adb: Minor reformatting.
6465 2017-01-06  Thomas Quinot  <quinot@adacore.com>
6467         * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
6469 2017-01-06  Justin Squirek  <squirek@adacore.com>
6471         * aspects.adb: Register aspect in Canonical_Aspect.
6472         * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
6473         into respective tables.
6474         * einfo.ads, einfo.adb: Add a new attribute for
6475         handling the parameters for Pragma_Max_Entry_Queue
6476         (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
6477         for accessing and setting were added as well.
6478         * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
6479         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
6480         declaration for pramga arguments and store them in the protected
6481         type node.
6482         (Make_Initialize_Protection): Pass a reference to
6483         the Entry_Max_Queue_Lengths_Array in the protected type node to
6484         the runtime.
6485         * rtsfind.adb: Minor grammar fix.
6486         * rtsfind.ads: Register new types taken from the
6487         runtime libraries RE_Protected_Entry_Queue_Max and
6488         RE_Protected_Entry_Queue_Max_Array
6489         * s-tposen.adb, s-tpoben.adb
6490         (Initialize_Protection_Entry/Initialize_Protection_Entries):
6491         Add extra parameter and add assignment to local object.
6492         * s-tposen.ads, s-tpoben.ads: Add new types to
6493         store entry queue maximums and a field to the entry object record.
6494         * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
6495         for Aspect_Max_Queue_Length.
6496         (Check_Aspect_At_Freeze_Point):
6497         Add aspect to list of aspects that don't require delayed analysis.
6498         * sem_prag.adb (Analyze_Pragma): Add case statement for
6499         Pragma_Max_Queue_Length, check semantics, and register arugments
6500         in the respective entry nodes.
6501         * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
6502         and Has_Max_Queue_Length
6503         * snames.ads-tmpl: Add constant for the new aspect-name
6504         Name_Max_Queue_Length and corrasponding pragma.
6506 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6508         * exp_util.adb (Is_Controlled_Function_Call):
6509         Reimplemented. Consider any node which has an entity as the
6510         function call may appear in various ways.
6512 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6514         * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
6515         an unchecked type conversion when performing a view conversion
6516         to/from a private type. In all other cases use a regular type
6517         conversion to ensure that any relevant checks are properly
6518         installed.
6520 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6522         * sem_prag.adb, sem_ch8.adb: Minor reformatting.
6524 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6526         * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
6527         error on case expression that is an entity, when coverage is
6528         incomplete and entity has a static value obtained by local
6529         propagation.
6530         (Handle_Static_Predicate): New procedure, subsidiary of
6531         Check_Choices, to handle case alternatives that are either
6532         subtype names or subtype indications involving subtypes that
6533         have static predicates.
6535 2017-01-06  Thomas Quinot  <quinot@adacore.com>
6537         * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
6538         (GNAT.Socket): Add support for Busy_Polling and Generic_Option
6540 2017-01-06  Bob Duff  <duff@adacore.com>
6542         * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
6543         Elaborate_All(P) to P itself. That could happen in obscure cases,
6544         and always introduced a cycle (P body must be elaborated before
6545         P body).
6546         * lib-writ.ads: Comment clarification.
6547         * ali-util.ads: Minor comment fix.
6548         * ali.adb: Minor reformatting.
6550 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6552         * a-exexpr-gcc.adb: Improve comment.
6554 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
6556         * s-linux-mips.ads: Use correct signal and errno constants.
6557         (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
6559 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
6561         * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
6562         * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
6563         sections.
6565 2017-01-01  Eric Botcazou  <ebotcazou@adacore.com>
6567         * gnatvsn.ads: Bump copyright year.
6569 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
6571         * gnat_ugn.texi: Bump @copying's copyright year.
6572         * gnat_rm.texi: Likewise.
6574 Copyright (C) 2017 Free Software Foundation, Inc.
6576 Copying and distribution of this file, with or without modification,
6577 are permitted in any medium without royalty provided the copyright
6578 notice and this notice are preserved.