* gimple.c (gimple_assign_set_rhs_with_ops): Do not ask gsi_replace
[official-gcc.git] / gcc / ada / ChangeLog
blob3daed1e1f35612ac5bb90360ee1fcb71df6cbcc2
1 2017-07-25  Javier Miranda  <miranda@adacore.com>
3         * checks.adb (Apply_Divide_Checks): Ensure that operands are not
4         evaluated twice. 
6 2017-07-19  Jakub Jelinek  <jakub@redhat.com>
8         * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
9         TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
10         (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
12 2017-07-18  Mike Frysinger  <vapier@chromium.org>
14         * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
15         (../../gnatlink$(exeext)): Likewise.
17 2017-07-15  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>
19         PR ada/81446
20         * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
21         (Backend_Overflow_Checks): Set to True.
23 2017-06-23  Jakub Jelinek  <jakub@redhat.com>
25         * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
27 2017-06-21  Pierre-Marie de Rodat  <derodat@adacore.com>
29         * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
30         notice.  New macro.
31         * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
32         as a definition.
33         (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
34         definition.
35         * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
36         imported subprograms for the current compilation unit as
37         definitions.  Disable debug info for references to variables.
38         * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
39         * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
40         not built-in functions to their binding scope.
41         (create_subprog_decl): Add a DEFINITION parameter.  If it is true, tag
42         the function as a definition.  Update all callers.
43         (gnat_write_global_declarations): Emit debug info for imported
44         functions.  Filter out external variables for which debug info
45         is disabled.
47 2017-06-15  Nicolas Boulenguez  <nicolas.boulenguez@free.fr>
49         PR ada/81105
50         * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
51         (i[3456]86-pc-gnu): Likewise.
52         (x86_64 kfreebsd): Likewise.
54 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
56         PR bootstrap/80897
57         * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
59 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
61         PR ada/81070
62         * s-interr-hwint.adb: Reinstate.
63         * gcc-interface/Makefile.in (RTEMS): Use it again.
65 2017-06-08  Olivier Hainque  <hainque@adacore.com>
67         * vx_crtbegin_auto.c: Update year in copyright notice.
68         * vx_crtbegin.c: Likewise.
69         * vx_crtbegin.inc: Likewise. 
70         * vx_crtend.c:  Likewise.
72 2017-06-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
74         * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
75         * s-tpopsp-rtems.adb: Delete.
77 2017-06-02  Olivier Hainque  <hainque@adacore.com>
79         * vx_crtbegin_auto.c: New file.
80         * vx_crtbegin.c: New file.
81         * vx_crtbegin.inc: New file.
82         * vx_crtend.c: New file.
84 2017-05-25  Jonathan Wakely  <jwakely@redhat.com>
86         * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
87         const qualifiers that cause -Wignored-qualifiers warnings.
89 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
91         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
92         for Itypes that are E_Access_Subtype.
93         <E_Access_Subtype>: Use the DECL of the base type directly.
95 2017-05-22  Ed Schonberg  <schonberg@adacore.com>
96             Eric Botcazou  <ebotcazou@adacore.com>
98         * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
99         limited view may appear in the profile of a function, and a call to
100         that function in another unit in which the full view is available must
101         use this full view to spurious type errors at the point of call.
102         * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
103         of parent body with a with clause for the main unit.
104         * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
105         (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
106         types declared in external units like types from limited with clauses.
107         Adjust final processing of defer_limited_with_list accordingly.
108         * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
109         again to translate the prefix after the field if it is incomplete.
111 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
113         * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
114         alignment for simple volatile fields and remove associated errors.
116 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
118         * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
119         * gcc-interface/trans.c (get_elaboration_procedure): Make static.
121 2017-05-15  Pierre-Marie de Rodat  <derodat@adacore.com>
123         * gcc-interface/utils.c (can_materialize_object_renaming_p):
124         Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
125         process Original_Node instead of expanded names.
127 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
129         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
130         addressability check in the constrained case.
132 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
134         * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
135         types not coming from a limited context.
137 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
139         * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
140         the inlined list that are not public.
141         * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
142         there is a pragma Inline_Always on the subprogram.
144 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
146         * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
147         <N_Allocator>: Use properly typed constants.
148         (extract_values): Move around.
149         (pos_to_constructor): Minor tweaks.
150         (Sloc_to_locus): Fix formatting.
151         * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
152         * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
153         (Gigi_Equivalent_Type): Adjust head comment.
154         * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
156 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
158         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
159         is a representation clause on an extension, propagate the alignment of
160         the parent type only if the platform requires strict alignment.
162 2017-05-12  Eric Botcazou  <ebotcazou@adacore.com>
164         * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
165         instead of Word_Size.
167         Revert
168         2017-03-28  Andreas Schwab  <schwab@suse.de>
170         PR ada/80117
171         * system-linux-aarch64-ilp32.ads: New file.
172         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
173         from LIBGNAT_TARGET_PAIRS.
174         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
175         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
176         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
177         or -mabi=ilp32, resp.
179 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
181         PR ada/80626
182         * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
183         instead of Word_Size.
185 2017-05-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
187         * raise-gcc.c (exception_class_eq): Make ec parameter const.
189 2017-05-02  Richard Biener  <rguenther@suse.de>
191         * gcc-interface/misc.c (gnat_post_options): Do not set
192         -fstrict-overflow.
194 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
196         * gcc-interface/trans.c (assoc_to_constructor): Make sure
197         Corresponding_Discriminant is only called on discriminants.
198         Skip the saving of the result only for them.
199         (gnat_to_gnu) <N_Selected_Component>: Likewise.
200         <N_Unchecked_Type_Conversion>: Translate the result type first.
201         (gigi): Set TREE_NOTHROW on Begin_Handler.
202         (stmt_list_cannot_raise_p): New predicate.
203         (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
204         a cleanup if the statements of the handler cannot raise.
205         (process_freeze_entity): Use Is_Record_Type.
206         (process_type): Likewise.
208 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
210         * einfo.ads (Corresponding_Record_Component): New alias
211         for Node21 used for E_Component and E_Discriminant.
212         * einfo.adb (Corresponding_Record_Component): New function.
213         (Set_Corresponding_Record_Component): New procedure.
214         (Write_Field21_Name): Handle Corresponding_Record_Component.
215         * sem_ch3.adb (Inherit_Component): Set
216         Corresponding_Record_Component for every component in
217         the untagged case.  Clear it afterwards for non-girder
218         discriminants.
219         * gcc-interface/decl.c (gnat_to_gnu_entity)
220         <E_Record_Type>: For a derived untagged type with discriminants
221         and constraints, apply the constraints to the layout of the
222         parent type to deduce the layout.
223         (field_is_aliased): Delete.
224         (components_to_record): Test DECL_ALIASED_P directly.
225         (annotate_rep): Check that fields are present except for
226         an extension.
227         (create_field_decl_from): Add DEBUG_INFO_P
228         parameter and pass it in recursive and other calls.  Add guard
229         for the manual CSE on the size.
230         (is_stored_discriminant): New predicate.
231         (copy_and_substitute_in_layout): Consider only
232         stored discriminants and check that original fields are present
233         in the old type.  Deal with derived types.  Adjust call to
234         create_variant_part_from.
236 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
238         * exp_ch6.adb (Expand_Call_Helper): When locating the
239         accessibility entity created for an access parameter, handle
240         properly a reference to a formal of an enclosing subprogram. if
241         the reference appears in an inherited class-wide condition, it
242         is the rewriting of the reference in the ancestor expression,
243         but the accessibility entity must be that of the current formal.
245 2017-05-02  Javier Miranda  <miranda@adacore.com>
247         * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
248         (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
249         Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
250         Call Expand_Non_Binary_Modular_Op.
252 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
254         * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
255         has discriminants, do not override the Stored_Constraint list of
256         the full view of the derived type with that of the derived type.
258 2017-05-02  Bob Duff  <duff@adacore.com>
260         * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
262 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
264         * s-os_lib.ads: Minor typo fix.
266 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
268         * gnatls.adb: Merge and refactor code from Prj.Env and remove
269         this deprecated dependency.
271 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
273         * exp_util.ads: minor comment addition.
275 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
277         * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
278         pastos in part #3 of the head comment.
280 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
282         * exp_ch3.adb (Freeze_Type): Do not generate an invariant
283         procedure body for a local (sub)type declaration within a
284         predicate function. Invariant checks do not apply to these, and
285         the expansion of the procedure will happen in the wrong scope,
286         leading to misplaced freeze nodes.
288 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
290         * exp_util.adb (Insert_Library_Level_Action): Use proper scope
291         to analyze generated actions.  If the main unit is a body,
292         the required scope is that of the corresponding unit declaration.
294 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
296         * einfo.adb (Declaration_Node): flip branches of
297         an IF statement to avoid repeated negations in its condition;
298         no change in semantics, only to improve readability.
300 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
302         * sem_case.adb: Remove extra spaces in parameter declarations.
304 2017-05-02  Justin Squirek  <squirek@adacore.com>
306         * usage.adb: Replace space with hyphen ("run time" -> "run-time")
307         in usage line for new -gnatwE switch.
309 2017-05-02  Claire Dross  <dross@adacore.com>
311         * a-cofuve.ads (Remove): Remove unnecessary
312         conditions in precondition.
314 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
316         * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
317         sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
319 2017-05-02  Justin Squirek  <squirek@adacore.com>
321         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
322         alternative expression.
323         * sem_res.adb (Resolve_Case_Expression): Ditto.
325 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
327         * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
328         Refine predicate for the case where the primitive operation
329         is a renaming of equality.  An overriding operation that is
330         a user-defined renaming of predefined equality inherits its
331         slot from the overridden operation. Otherwise it is treated
332         as a predefined op and occupies the same predefined slot as
333         equality. A call to it is transformed into a call to its alias,
334         which is the predefined equality. A dispatching call thus uses
335         the proper slot if operation is further inherited and called
336         with class-wide arguments.
338 2017-05-02  Justin Squirek  <squirek@adacore.com>
340         * errout.adb (Set_Msg_Text): Add a case to switch the message
341         type when the character '[' is detected signifying a warning
342         about a run-time exception.
343         * opt.ads Add a new Warning_Mode value for new switch
344         * switch-b.adb (Scan_Binder_Switches): Add case for the binder
345         to handle new warning mode
346         * usage.adb (Usage): Add usage entry for -gnatwE
347         * warnsw.adb (Set_Warning_Switch): Add case for the new switch
349 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
351         * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
352         declaration that operates on some fixed point type.
354 2017-05-02  Justin Squirek  <squirek@adacore.com>
356         * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
358 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
360         * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
362 2017-05-02  Justin Squirek  <squirek@adacore.com>
364         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
365         expression (Analyze_If_Expression): Add check for valid condition
366         * sem_eval.adb (Eval_Case_Expression): Add check for error posted
367         on case-expression
368         * sem_res.adb (Resolve_If_Expression): Add check for valid
369         condition and then-expression.
371 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
373         * exp_ch3.adb (Build_Initialization_Call): Generate a null
374         statement if the initialization call is a null procedure, as
375         can happen with a controlled type with no explicit Initialize
376         procedure, or an array of such.
377         * exp_ch7.adb (Process_Object_Declaration): For a type with
378         controlled components that has a trivial Initialize procedure,
379         insert declaration for finalization counter after object
380         declaration itself.
381         (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
382         finalization block and attendant declarations if component has
383         a trivial Initialize procedure.
384         (Make_Init_Call): Do not generate a call if controlled type has
385         a trivial Initialize procedure.
387 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
389         * g-forstr.ads (Data): Move Format component last.
390         * g-forstr.adb ("+"): Adjust for above change.
391         * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
392         * g-sechas.ads (Context): Move Key last.
393         * g-socket.ads (Service_Entry_Type): Move Aliases last.
394         * s-fileio.adb (Temp_File_Record): Move Name last.
395         * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
396         * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
398 2017-05-02  Jerome Lambourg  <lambourg@adacore.com>
400         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
401         switch introduced recently. finally not needed.
403 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
405         * sem_ch6.adb (Analyze_Null_Procedure): Set the
406         Corresponding_Body link for a null procedure declaration.
408 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
410         * atree.h (Flag290): Add missing terminating parenthesis.
411         * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
412         (Set_Is_Class_Wide_Clone): Likewise.
413         * einfo.ads (Is_Class_Wide_Clone): Likewise.
415 2017-05-02  Gary Dismukes  <dismukes@adacore.com>
417         * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
418         parameter Array_Comp to indicate the case of an array object
419         with null-excluding components.
420         * checks.adb (Null_Exclusion_Static_Checks):
421         Call Compile_Time_Constraint_Error instead of
422         Apply_Compile_Time_Constraint_Error in the component case. Also
423         call that when Array_Comp is True, with an appropriate warning for
424         the array component case. Only create an explicit initialization
425         by null in the case of an object of a null-excluding access type
426         (and no longer do that in the component case).
427         * sem_ch3.adb (Check_Component): Add a Boolean parameter
428         Array_Comp defaulted to False.  Pass Empty for the Comp
429         actual when calling Null_Exclusion_Static_Checks in the case
430         where Comp_Decl matches Object_Decl, because we don't have a
431         component in that case. In the case of an object or component
432         of an array type, pass True for Array_Comp on the recursive call
433         to Check_Component.
435 2017-05-02  Bob Duff  <duff@adacore.com>
437         * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
438         compute the linux priority from the Ada priority. Call this everywhere
439         required. In particular, the previous version was not doing this
440         computation when setting the ceiling priority in various places. It
441         was just converting to C.int, which results in a ceiling that is off
442         by 1.
444 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
446         * sem_ch3.adb: Comment predicate inheritance.
448 2017-05-02  Tristan Gingold  <gingold@adacore.com>
450         * s-trasym.ads: Add comment.
452 2017-05-02  Bob Duff  <duff@adacore.com>
454         * sem_elab.adb, sem_elab.ads: Minor comment fixes.
455         * sem_ch4.adb: Minor reformatting.
456         * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
457         * s-taspri-posix-noaltstack.ads: Minor refactoring.
458         * sinput.ads: Minor typo fix.
460 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
462         * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
463         * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
464         here from exp_ch9, to recognize objects whose creation requires
465         dynamic allocation, so that the proper warning can be emitted
466         when restriction No_Implicit_Heap_Allocation is in effect.
467         * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
468         to emit proper warning when an object that requires dynamic
469         allocation is declared.
471 2017-05-02  Tristan Gingold  <gingold@adacore.com>
473         * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
475 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
477         * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
478         visibility rules for equality operators that apply within an
479         instantiation apply within an inlined body.
480         * sem_type.adb (Add_One_Interp): ditto.
482 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
484         * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
485         procedures.
487 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
489         * snames.ads-tmpl
490         (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
491         Name_No_Tagged_Streams): Move to regular pragmas.  Add
492         placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
493         and Secondary_Stack_Size.
494         (Pragma_Id): Move Pragma_Assume,
495         Pragma_Attribute_Definition, Pragma_Loop_Optimize and
496         Pragma_No_Tagged_Streams to second part.
498 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
500         * exp_attr.adb: Minor reformatting.
502 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
504         * sem_ch4.adb (Analyze_Selected_Component): Improve error
505         detection for illegal references to private components or
506         operations of a protected type in the body of the type.
508 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
510         * opt.ads: Add missing GNAT markers in comments.
511         * opt.adb (Set_Opt_Config_Switches): Do not override earlier
512         settings of Optimize_Alignment at the end.
514 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
516         * checks.adb (Apply_Constraint_Check): Do not apply
517         a discriminant check when the associated type is a constrained
518         subtype created for an unconstrained nominal type.
519         * exp_attr.adb: Minor reformatting.
521 2017-05-02  Bob Duff  <duff@adacore.com>
523         * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
524         the N_Raise_Expression case.
525         * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
526         and add assertions.
528 2017-05-02  Yannick Moy  <moy@adacore.com>
530         * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
531         optimize length comparison in GNATprove mode.
532         * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
533         operator /= into negation of operator = when needed.
534         (Expand_SPARK): Call new
535         function to expand operator /=.
537 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
539         * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
540         Simplify the expression for a fixed-fixed division to remove
541         divisions by constants whenever possible, as an optimization
542         for restricted targets.
544 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
546         * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
548 2017-05-02  Bob Duff  <duff@adacore.com>
550         * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
551         to find primitive ops, instead of using an Identifier that will
552         later be looked up. This is necessary because these ops are not
553         necessarily visible at all places where we need to call them.
554         * exp_util.ads: Minor comment fix.
556 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
558         * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
559         references are fully conformant if they are both expansions
560         of the discriminant of a protected type, within one of the
561         protected operations. One occurrence may be expanded into a
562         constant declaration while the other is an input parameter to
563         the corresponding generated subprogram.
565 2017-05-02  Justin Squirek  <squirek@adacore.com>
567         * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
568         recursivly searching composite-types for null-excluding access
569         types and verifying them.
570         (Analyze_Object_Declaration): Add a
571         call to Check_Null_Excluding_Components for static verification
572         of non-initialized objects.
573         * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
574         a parameter for a composite-type's component and an extra case
575         for printing component information.
577 2017-05-02  Yannick Moy  <moy@adacore.com>
579         * sem_ch10.adb (Analyze_Subunit): Take
580         configuration pragma into account when restoring appropriate
581         pragma for analysis of subunit.
583 2017-05-02  Justin Squirek  <squirek@adacore.com>
585         * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
586         s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
587         g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
588         clauses from the runtime.
590 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
592         * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
593         array components specially.
595 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
597         * sem_ch8.adb (Premature_Usage): If the premature usage of
598         an entity is as the expression in its own object decaration,
599         rewrite the reference as Any_Id to prevent cascaded errors or
600         compiler loops when such an entity is used in an address clause.
602 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
604         * gcc-interface/decl.c (components_to_record): Add missing guard.
606 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
608         * gcc-interface/decl.c (components_to_record): Add more comments.
609         Put back pending fields onto the regular list if the misalignment
610         happens to cancel itself.
612 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
614         * sem_ch4.adb (Complete_Object_Operation): When rewriting the
615         controlling actual in a prefixed call, preserve the original node
616         information if the prefix itself has been rewritten, for ASIS use.
618 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
620         * exp_ch6.adb (Insert_Post_Call_Actions):
621         Code clean up. Insert the post-call actions after an enclosing
622         procedure call when N denotes a function call and appears as an
623         actual parameter in the procedure call.
625 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
627         * freeze.adb (Check_Component_Storage_Order): If there is a clause
628         for the component, also reject the attribute if the component
629         doesn't end on a byte boundary and its scalar storage order is
630         different from that of the enclosing record type.
632 2017-04-28  Javier Miranda  <miranda@adacore.com>
634         * atree.ads (Info_Messages): Removed.
635         (Warning_Info_Messages): New counter.
636         (Report_Info_Messages): New counter.
637         * err_vars.ads Update documentation.
638         * errout.adb (Delete_Warning_And_Continuations): Update
639         Info_Message occurrences.
640         (Error_Msg_Internal): Update Info_Message occurrences.
641         (Delete_Warning): Update Info_Message occurrences.
642         (Write_Error_Summary): Update Info_Message occurrences.
643         (Output_Messages): Update Info_Message occurrences.
644         (To_Be_Removed): Update Info_Message occurrences.
645         (Reset_Warnings): Update Info_Message occurrences.
646         * errutil.adb (Error_Msg): Update Info_Message occurrences.
647         (Finalize): Update Info_Message occurrences.
648         (Initialize): Update Info_Message occurrences.
649         * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
650         (Compilation_Errors): Update Info_Message_Occurences.
652 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
654         * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
655         * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
656         * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
657         * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
658         * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
659         * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
660         Y_Size.
661         * sem_eval.adb (Why_Not_Static): Initialize Typ.
662         * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
664 2017-04-28  Bob Duff  <duff@adacore.com>
666         * sem_util.ads, sem_util.adb (Might_Raise): New function
667         that replaces Is_Exception_Safe, but has the opposite
668         sense. Is_Exception_Safe was missing various cases -- calls inside
669         a pragma Debug, calls inside an 'if' or assignment statement,
670         etc. Might_Raise now walks the entire subtree looking for things
671         that can raise.
672         * exp_ch9.adb (Is_Exception_Safe): Remove.
673         (Build_Protected_Subprogram_Body): Replace call to
674         Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
675         constants where possible).
676         * exp_ch7.adb: Rename Is_Protected_Body -->
677         Is_Protected_Subp_Body. A protected_body is something different
678         in the grammar.
680 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
682         * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
683         * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
684         (P_Discrete_Choice_List): Initialize Expr_Node variable.
685         * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
686         (P_Protected): Likewise.
687         * sem_case.adb (Check_Duplicates):
688         Add pragma Warnings on variable.
689         * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
690         * sem_ch4.adb (List_Operand_Interps):  Add pragma Warnings on variable.
691         * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
692         (Analyze_Exit_Statement): Initialize Scope_Id variable.
693         (Analyze_Iterator_Specification): Initialize Bas variable.
694         * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
695         Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
696         (Analyze_Accept_Statement): Initialize Task_Nam.
698 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
700         * checks.adb (Install_Primitive_Elaboration_Check):
701         Do not generate an elaboration check if all checks have been
702         suppressed.
704 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
706         * sem_ch13.adb (Analyze_Aspect_Specifications, case
707         Interrupt_Handler and Attach_Handler): Generate reference
708         to protected operation to prevent spurious warnings about
709         unreferenced entities. Previous scheme failed with style checks
710         enabled.
712 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
714         * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
715         that follows an expression function must not be relocated to
716         the generated body, because it applies to the code that follows.
718 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
720         * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
721         Relaxed_RM_Semantics to avoid having CodePeer issue errors on
722         code that might violate the more stringent checking for 'Access
723         introduced in Ada 2005.
725 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
727         * a-cforse.adb: minor style fix in comment.
729 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
731         * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
732         initialize Block_Decls variable.
733         (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
734         (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
735         * exp_disp.adb (Expand_Interface_Actuals): Initialize
736         Formal_DDT and Actual_DDT variables.
737         (Expand_Interface_Thunk): Initialize Iface_Formal.
738         (Make_DT): Initialize Size_Comp.
739         (Make_Select_Specific_Data_Table): Initialize Decls.
740         * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
741         Also initialize more RPC_Receiver_* variables.
742         (Build_To_Any_Function): Initialize Cstr_Formal.
743         * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
745 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
747         * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
748         node between access types, freeze the designated type as well,
749         so that dispatch table pointers are created in the proper scope,
750         and not in the constructed body of the expression function.
752 2017-04-28  Bob Duff  <duff@adacore.com>
754         * alloc.ads (Nodes_Initial): Go back to previous value. The large
755         value makes large compilations faster, but small compilations slower.
757 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
759         * sem_util.adb: minor typos in Is_Child_Or_Sibling.
761 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
763         * erroutc.adb (Compilation_Errors): Do not consider info messages
764         as suitable warnings when warnings must be treated as errors.
765         * sem_ch7.adb (Analyze_Package_Specification): Do not consider
766         internally-generated packages when outputting completion
767         information.
768         * errout.adb (Output_Messages): Do not consider info messages as
769         suitable warnings when warnings must be treated as errors.
770         * errutil.adb (Finalize): Do not consider info messages as
771         suitable warnings when warnings must be treated as errors.
773 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
775         * warnsw.ads: Minor fix for incorrect wording in comment.
777 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
779         * sem_res.adb (In_Instance_Code): New predicate in
780         Valid_Conversion, to determine whether a type conversion appears
781         as (or within) an actual for a formal object.  Type conversions
782         in instances are not rechecked in Valid_Conversion because
783         visibility changes between generic location andi instance may
784         lead to spurious errors, but conversions within an actual must be
785         fully checked, and they are not fully resolved when pre-analyzing
786         the actuals.
788 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
790         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
791         New_Copy_Tree instead of Relocate_Node as any subsequent copies
792         of the relocated node will have mangled Parent pointers.
793         * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
794         tables used in conjunction with entity and itype replication.
795         (Visit_Entity): Rewrite the restriction on which entities
796         require duplication.  The restriction now includes all types.
798 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
800         * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
801         a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
802         a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
803         cleanups.
805 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
807         * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
808         gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
810 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
812         * exp_util.adb: Minor reformatting.
814 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
816         * sem_ch4.adb: Fix copy/pasto.
818 2017-04-27  Tristan Gingold  <gingold@adacore.com>
820         * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
821         raise-gcc.c. Fix include search path for raise-gcc.c
823 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
825         * fe.h (Warn_On_Questionable_Layout): Declare.
826         * warnsw.ads (Warn_On_Record_Holes): Move down.
827         (Warn_On_Questionable_Layout): New boolean variable.
828         (Warning_Record): Add Warn_On_Questionable_Layout field.
829         * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
830         (Restore_Warnings): Likewise.
831         (Save_Warnings): Likewise.
832         (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
833         * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
834         components_to_record.
835         (gnu_field_to_gnat): New function.
836         (warn_on_field_placement): Likewise.
837         (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
838         parameters.  Rename local variables and adjust recursive call.
839         Rework final scan of the field list and implement warnings on the
840         problematic placement of specific sorts of fields.
842 2017-04-27  Bob Duff  <duff@adacore.com>
844         * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
845         * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
846         * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
847         * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
848         * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
849         * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
850         For efficiency, cache results of Is_Internal_File_Name and
851         Is_Predefined_File_Name in the Units table. This avoids a lot
852         of repeated text processing.
854 2017-04-27  Emmanuel Briot  <briot@adacore.com>
856         * g-comlin.adb (Sort_Sections): remove useless test.
858 2017-04-27  Claire Dross  <dross@adacore.com>
860         * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
861         allow the use of regular equality over elements in contracts.
862         (Formal_Model): Ghost package containing model functions that are
863         used in subprogram contracts.
864         (Current_To_Last): Removed, model functions should be used instead.
865         (First_To_Previous): Removed, model functions should be used instead.
866         (Strict_Equal): Removed, model functions should be used instead.
867         (No_Overlap): Removed, model functions should be used instead.
868         (Equivalent_Keys): Functions over cursors are removed. They were
869         awkward with explicit container parameters.
870         * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
871         allow the use of regular equality over elements in contracts.
872         (Formal_Model): Ghost package containing model functions that
873         are used in subprogram contracts.
874         (Current_To_Last): Removed, model functions should be used instead.
875         (First_To_Previous): Removed, model functions should be used instead.
876         (Strict_Equal): Removed, model functions should be used instead.
877         (No_Overlap): Removed, model functions should be used instead.
879 2017-04-27  Yannick Moy  <moy@adacore.com>
881         * gnat1drv.adb: Code cleanup.
883 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
885         * exp_util.adb (Replace_Entity): The prefix of a 'Result
886         attribute reference in a post- condition is the subprogram to
887         which the condition applies. If the condition is inherited
888         by a type extension, the prefix becomes a reference to the
889         inherited operation, but there is no need to create a wrapper
890         for this operation, because 'Result is expanded independently
891         when elaborating the postconditions.
893 2017-04-27  Bob Duff  <duff@adacore.com>
895         * sinput.adb: Minor code cleanup.
896         * namet.adb (Append): Create faster versions of
897         Append(String) and Append(Name_Id) by using slice assignment
898         instead of loops.
899         * sem_util.adb (In_Instance): Speed this up by removing
900         unnecessary tests; Is_Generic_Instance is defined for all
901         entities.
902         * sem_util.ads, sem_util.adb (In_Parameter_Specification):
903         Remove unused function.
904         * alloc.ads (Nodes_Initial): Use a much larger value, because
905         the compiler was spending a lot of time copying the nodes table
906         when it grows. This number was chosen in 1996, so is rather out
907         of date with current memory sizes. Anyway, it's virtual memory.
908         Get rid of Orig_Nodes_...; use Node_... instead.
909         * atree.adb (Lock): Do not release the Nodes tables; it's a
910         waste of time.
911         Orig_Nodes_ ==> Nodes_
912         * nlists.adb: Orig_Nodes_ ==> Nodes_
913         * g-table.adb: Remove unused "with" clause.
914         * g-table.ads, table.ads: Remove Big_Table_Type, which should
915         not be used by clients.
916         * g-dyntab.adb (Last_Allocated): New function
917         to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
919 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
921         * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
922         check.
923         (Subtypes_Statically_Match): Remove duplicate check.
924         * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
926 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
928         * exp_aggr.adb (Replace_Type): Remove the special processing
929         for selected components.
930         * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
931         processing for attributes Fixed_Value and Integer_Value.
932         * exp_util.adb (Side_Effect_Free): Merge the processing for
933         qualified expressions, type conversions, and unchecked type
934         conversions.
935         * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
936         and Optional.
937         * par-ch3.adb (P_Declarative_Items): Merge the processing for
938         tokens function, not, overriding, and procedure.
939         * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
940         for qualified expressions, type conversions, and unchecked
941         type conversions.
942         * sem_util.adb (Compile_Time_Constraint_Error): Merge the
943         processing for Ada 83 and instances.
944         (Object_Access_Level): Merge the processing for indexed components
945         and selected components.
946         * uname.adb (Add_Node_Name): Merge the processing for stubs.
948 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
950         * checks.adb (Install_Primitive_Elaboration_Check):
951         Do not generate the check when restriction No_Elaboration_Code
952         is in effect.
954 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
956         * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
957         of Expand_Dispatching_Call. If the denoted subprogram has a
958         class-wide precondition, this is the only precondition that
959         applies to the call, rather that the class-wide preconditions
960         that may apply to the body that is executed. (This is specified
961         in AI12-0195).
963 2017-04-27  Yannick Moy  <moy@adacore.com>
965         * gnat1drv.adb (Adjust_Global_Switches): Issue
966         a warning in GNATprove mode if the runtime library does not
967         support IEEE-754 floats.
969 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
971         * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
972         is itself inherited it does not carry any contract information,
973         so examine its parent operation which is its Alias.
975 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
977         * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
978         prefix can be an object reference in which case Obj'Image (X)
979         can only be interpreted as an indexing of the parameterless
980         version of the attribute.
981         * par-ch4.adb (P_Name): An attribute reference can be the prefix of
982         an indexing or a slice operation if the attribute does not require
983         parameters. In Ada2012 'Image also belongs in this category,
984         and A'Image (lo .. hi) is legal and must be parsed as a slice.
986 2017-04-27  Yannick Moy  <moy@adacore.com>
988         * exp_ch4.adb: Minor reformatting.
989         * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
990         disable the CodePeer and C generation modes. Similar to the
991         opposite actions done in CodePeer mode.
993 2017-04-27  Yannick Moy  <moy@adacore.com>
995         * sem_res.adb: Remove duplicate code.
996         * sem_attr.adb: Delete duplicate code.
998 2017-04-27  Bob Duff  <duff@adacore.com>
1000         * g-dyntab.adb: Reduce the amount of copying in
1001         Release. No need to copy items past Last.
1003 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1005         * checks.adb Add with and use clauses for Sem_Disp.
1006         (Install_Primitive_Elaboration_Check): New routine.
1007         * checks.ads (Install_Primitive_Elaboration_Check): New routine.
1008         * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
1009         processing of 'Elaborated.
1010         * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
1011         elaboration check.
1013 2017-04-27  Bob Duff  <duff@adacore.com>
1015         * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
1016         If the table grows and then shrinks back to empty, we won't necessarily
1017         point back to the empty array. Code cleanups.
1018         * sinput.ads: Add 'Base to Size clause to match the declared
1019         component subtypes.
1021 2017-04-27  Claire Dross  <dross@adacore.com>
1023         * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
1024         allow the use of regular equality over elements in contracts.
1025         (Formal_Model): Ghost package containing model functions that
1026         are used in subprogram contracts.
1027         (Current_To_Last): Removed, model functions should be used instead.
1028         (First_To_Previous): Removed, model functions should be used instead.
1029         (Strict_Equal): Removed, model functions should be used instead.
1030         (No_Overlap): Removed, model functions should be used instead.
1031         * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
1032         Boolean generic parameter to disable contracts for equivalence
1033         between keys.
1034         (Witness): Create a witness of a key that is used for handling of
1035         equivalence between keys.
1036         (Has_Witness): Check whether a witness is contained in a map.
1037         (W_Get): Get the element associated to a witness.
1038         (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
1039         directly.
1040         * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
1041         Boolean generic parameter to disable contracts for equivalence
1042         between keys.
1043         * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
1044         of equivalence on functional maps.
1045         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
1046         of equivalence on functional maps.
1048 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1050         * exp_ch9.adb (Expand_Entry_Barrier): Code
1051         cleanup. Do not perform the optimization which removes the
1052         declarations of the discriminant and component renamings when
1053         validity checks on operands and attributes are in effect.
1055 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1057         * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
1058         freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
1059         a-cfhama.ads, a-cofove.ads: Minor reformatting.
1061 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1063         * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
1064         pointer dereference.
1065         * g-spipat.adb (Dump): Code clean up. Protect against a possible
1066         null pointer dereference.
1068 2017-04-27  Bob Duff  <duff@adacore.com>
1070         * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
1071         Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
1072         Free renames Init, since they do the same thing.
1073         * g-table.ads: Default for Table_Low_Bound.
1074         * table.ads: Default for Table_Low_Bound, Table_Initial, and
1075         Table_Increment.
1077 2017-04-27  Bob Duff  <duff@adacore.com>
1079         * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
1080         can reallocate.
1081         * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
1082         * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
1083         Reorder code so that above assertions do not fail.
1084         * table.ads: Remove obsolete comment on Locked.
1086 2017-04-27  Claire Dross  <dross@adacore.com>
1088         * a-cfdlli.ads: Code cleanup.
1090 2017-04-27  Yannick Moy  <moy@adacore.com>
1092         * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
1093         when needed for proof.  (Expand_SPARK): Call the new procedure.
1094         * exp_util.ads Fix typo.
1096 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1098         * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
1099         fixes.
1101 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1103         * sem_elab.adb Add new type Visited_Element
1104         and update the contents of table Elab_Visited.  Various code clean up.
1105         (Check_Elab_Call): Determine whether a prior call to
1106         the same subprogram was already examined within the same context.
1107         (Check_Internal_Call_Continue): Register the subprogram being
1108         called as examined within a particular context. Do not suppress
1109         elaboration warnings.
1111 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1113         * xoscons.adb, osint.ads: Minor reformatting.
1115 2017-04-27  Bob Duff  <duff@adacore.com>
1117         * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
1118         Table_Count_Type --> Table_Last_Type, because the name
1119         was confusing (a "count" usually starts at zero).  Add
1120         functionality supported or needed by other tables packages
1121         (Move, Release_Threshold).
1122         * g-table.ads, g-table.adb: This is now just a thin wrapper
1123         around g-dyntab.ads/g-dyntab.adb.  Add functionality supported
1124         or needed by other tables packages (Save, Restore).
1125         * table.ads, table.adb: This is now just a thin wrapper around
1126         * g-table.ads/g-table.adb.
1127         * namet.h, scos.h, uintp.h: These files are reaching into the
1128         private data of some instances of g-table, whose names changed,
1129         so the above change requires some adjustment here. It now uses
1130         public interfaces.
1132 2017-04-27  Bob Duff  <duff@adacore.com>
1134         * namet.adb, namet.ads: Minor: remove unused procedures.
1136 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
1138         * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
1139         (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
1140         Add pragma Warnings on Rtype variable in nested block.  *
1141         * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
1142         * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
1143         (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
1144         * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
1145         (Process_Component_List_For_Finalize): Initialize Counter_Id.
1146         (Build_Finalize_Statements): Initialize Bod_Stmts.
1147         * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
1149 2017-04-27  Claire Dross  <dross@adacore.com>
1151         * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
1152         allow the use of regular equality over elements in contracts.
1153         (Formal_Model): Ghost package containing model functions that are
1154         used in subprogram contracts.
1155         (Current_To_Last): Removed, model
1156         functions should be used instead.
1157         (First_To_Previous): Removed, model functions should be used instead.
1158         (Strict_Equal): Removed, model functions should be used instead.
1159         (No_Overlap): Removed, model functions should be used instead.
1160         (Equivalent_Keys): Functions over cursors are removed. They were
1161         awkward with explicit container parameters.
1162         * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
1163         (proof only) procedure to help GNATprove when equivalence over
1164         keys is not equality.
1166 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1168         * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
1169         sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
1170         Minor reformatting and code cleanups.
1172 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1174         * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
1175         subsidiary of Check_Inherited_Conditions, to build pragmas for an
1176         operation whose ancestor has classwide pre/postconditions. This
1177         is used both to check the legality of the inheritance in Ada
1178         and in SPARK, and to determine whether a wrapper is needed for
1179         an inherited operation.
1180         * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
1181         Improve placement of error message for inherited classwide
1182         conditions that become illegal on type derivation.
1184 2017-04-27  Yannick Moy  <moy@adacore.com>
1186         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
1187         SPARK_Mode from context on generic package.
1188         * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
1189         useless test.
1191 2017-04-27  Claire Dross  <dross@adacore.com>
1193         * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
1194         overflows in computations.
1195         * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
1196         overflows in computations.
1197         (Insert): Rewrite precondition to avoid overflows in computations.
1198         * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
1199         overflows in computations.
1200         (Insert): Rewrite precondition to avoid overflows in computations.
1202 2017-04-27  Steve Baird  <baird@adacore.com>
1204         * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
1205         flag when it is declared in order to avoid confusing CodePeer about
1206         the possibility of an uninitialized variable read.
1208 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1210         * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
1211         no dimensionality error if the subtype of the expression is
1212         identical to the nominal subtype in the declaration, even though
1213         the expression itself may have been constant-folded and lack a
1214         dimension vector.
1215         * sem_dim.ads: Add comments on setting of dimension vectors and
1216         its interaction with node rewritings and side-effect removal.
1218 2017-04-27  Bob Duff  <duff@adacore.com>
1220         * debug.adb: Minor comment correction.
1221         * sem_dim.ads: Minor reformatting and typo fixes.
1223 2017-04-27  Bob Duff  <duff@adacore.com>
1225         * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
1226         Last of the tables via function calls, rather than relying on layout
1227         of data structures.
1229 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1231         * exp_util.adb: No wrapper in GNATprove mode.
1233 2017-04-27  Yannick Moy  <moy@adacore.com>
1235         * sem_res.adb (Resolve_Comparison_Op): Always
1236         evaluate comparisons between values of universal types.
1238 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1240         * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
1241         an elaboration counter nor a check when in GNATprove mode.
1242         * sem_util.adb (Build_Elaboration_Entity): Do not create an
1243         elaboration counter when in GNATprove mode.
1245 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1247         * freeze.adb: copy-paste typo.
1249 2017-04-27  Yannick Moy  <moy@adacore.com>
1251         * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
1252         Use correct test to detect call in GNATprove mode instead of
1253         compilation.
1255 2017-04-27  Claire Dross  <dross@adacore.com>
1257         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
1258         New property function expressing that the element of a
1259         sequence are contained in the union of two sequences.
1260         (Formal_Model.M_Elements_Included): New property function
1261         expressing that the element of a sequence are another sequence.
1262         (Generic_Sorting): Use new property functions to state that
1263         elements are preserved by Sort and Merge.
1264         * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
1265         allow the use of regular equality over elements in contracts.
1266         (Formal_Model): Ghost package containing model functions
1267         that are used in subprogram contracts.  (Capacity):
1268         On unbounded containers, return the maximal capacity.
1269         (Current_To_Last): Removed, model functions should be used instead.
1270         (First_To_Previous): Removed, model functions should be used instead.
1271         (Append): Default parameter value replaced
1272         by new wrapper to allow more precise contracts.
1273         (Insert): Subprogram restored, it seems it was useful to users even if
1274         it is inefficient.
1275         (Delete): Subprogram restored, it seems it was useful to users even if
1276         it is inefficient.
1277         (Prepend): Subprogram restored, it seems it was useful to users even
1278         if it is inefficient.
1279         (Delete_First): Subprogram restored, it seems it
1280         was useful to users even if it is inefficient.  (Delete_Last):
1281         Default parameter value replaced by new wrapper to allow more
1282         precise contracts.
1283         (Generic_Sorting.Merge): Subprogram restored.
1284         * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
1285         allow the use of regular equality over elements in contracts.
1286         (Formal_Model): Ghost package containing model functions
1287         that are used in subprogram contracts.  (Capacity):
1288         On unbounded containers, return the maximal capacity.
1289         (Current_To_Last): Removed, model functions should be used
1290         instead.
1291         (First_To_Previous): Removed, model functions should be used instead.
1292         (Append): Default parameter value replaced
1293         by new wrapper to allow more precise contracts.
1294         (Insert): Subprogram restored, it seems it was useful to users even if
1295         it is inefficient.
1296         (Delete): Subprogram restored, it seems it was useful to users even if
1297         it is inefficient.
1298         (Prepend): Subprogram restored, it seems it was useful to users even
1299         if it is inefficient.
1300         (Delete_First): Subprogram restored, it seems it
1301         was useful to users even if it is inefficient.  (Delete_Last):
1302         Default parameter value replaced by new wrapper to allow more
1303         precise contracts.
1304         (Generic_Sorting.Merge): Subprogram restored.
1305         (Vector): Do not reuse formal vectors, as it is no longer possible
1306         to supply them with an equality function over elements.
1308 2017-04-27  Bob Duff  <duff@adacore.com>
1310         * g-dyntab.adb (Release): When allocating the new
1311         table, use the correct slice of the old table to initialize it.
1313 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
1315         * einfo.ads: Minor fixes in comments.
1317 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1319         * sem_prag.adb: disable clones in SPARK_Mode.
1321 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1323         * sem_util.ads, contracts.adb: Minor reformatting.
1325 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1327         * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
1328         Build body of subprogram that has a class-wide condition that
1329         contains calls to other primitives.
1330         (Build_Class_Wide_Clone_Call); Build a call to the common
1331         class-wide clone of a subprogram with classwide conditions. The
1332         body of the subprogram becomes a wrapper for a call to the
1333         clone. The inherited operation becomes a similar wrapper to which
1334         modified conditions apply, and the call to the clone includes
1335         the proper conversion in a call the parent operation.
1336         (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
1337         subprogram that has a classwide condition that contains calls to
1338         other primitives, build an internal subprogram that is invoked
1339         through a type-specific wrapper for all inherited subprograms
1340         that may have a modified condition.
1341         * sem_prag.adb (Check_References): If subprogram has a classwide
1342         condition, create entity for corresponding clone, to be invoked
1343         through wrapper subprograns.
1344         (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
1345         message about placement if pragma isi internally generated.
1346         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
1347         a classwide clone, build body of clone as copy of original body,
1348         and rewrite original body as a wrapper as a wrapper for a call to
1349         the clone, so that it incorporates the original pre/postconditions
1350         of the subprogram.
1351         * freeze.adb (Check_Inherited_Conditions): For an inherited
1352         subprogram that inherits a classwide condition, build spec and
1353         body of corresponding wrapper so that call to inherited operation
1354         gets the modified conditions.
1355         * contracts.adb (Analyze_Contracts): If analysis of classwide
1356         condition has created a clone for a primitive operation, analyze
1357         declaration of clone.
1359 2017-04-27  Steve Baird  <baird@adacore.com>
1361         * exp_util.adb (Build_Allocate_Deallocate_Proc):
1362         Add "Suppress => All_Checks" to avoid generating unnecessary
1363         checks.
1365 2017-04-27  Yannick Moy  <moy@adacore.com>
1367         * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
1368         * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
1369         inlining body in GNATprove mode when switch -gnatdm used.
1370         * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
1371         in GNATprove mode when switch -gnatdm used.
1373 2017-04-27  Arnaud Charlet  <charlet@adacore.com>
1375         * sem_ch13.adb (Analyze_Attribute_Definition_Clause
1376         [Attribute_Address]): Call Set_Address_Taken when ignoring rep
1377         clauses, so that we keep an indication of the address clause
1378         before removing it from the tree.
1380 2017-04-27  Yannick Moy  <moy@adacore.com>
1382         * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
1383         of expression being qualified, when not an object name, or else
1384         evaluate the underlying name.
1386 2017-04-27  Jerome Lambourg  <lambourg@adacore.com>
1388         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
1390 2017-04-27  Justin Squirek  <squirek@adacore.com>
1392         * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
1393         Process_Component_List_For_Finalization as a local variable.
1394         (Process_Component_For_Finalize): Add an extra parameter to avoid
1395         global references.
1396         (Process_Component_List_For_Finalization): Correct calls to
1397         Process_Component_For_Finalize to take Num_Comps as a parameter.
1399 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1401         * sem_ch8.adb (Find_Direct_Name): Account for the case where
1402         a use-visible entity is defined within a nested scope of an
1403         instance when giving priority to entities which were visible in
1404         the original generic.
1405         * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
1407 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1409         * raise-gcc.c: Don't use unwind.h while compiling
1410         for the frontend, but mimic host behavior.
1412 2017-04-27  Javier Miranda  <miranda@adacore.com>
1414         * sem_ch3.adb (Build_Discriminated_Subtype):
1415         Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
1417 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1419         * sem_prag.adb (Analyze_Global_Item):
1420         Do not consider discriminants because they are not "entire
1421         objects". Remove the discriminant-related checks because they are
1422         obsolete.
1423         (Analyze_Input_Output): Do not consider discriminants
1424         because they are not "entire objects".
1426 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1428         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
1429         perform check if the current scope does not come from source,
1430         as is the case for a rewritten task body, because check has
1431         been performed already, and may not be doable because of changed
1432         visibility.
1434 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1436         * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
1437         a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
1438         Minor reformatting.
1440 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1442         * sem_ch4.adb (Analyze_Call): If the return type of a function
1443         is incomplete in an context in which the full view is available,
1444         replace the type of the call by the full view, to prevent spurious
1445         type errors.
1446         * exp_disp.adb (Check_Premature_Freezing): Disable check on an
1447         abstract subprogram so that compiler does not reject a parameter
1448         of a primitive operation of a tagged type being frozen, when
1449         the untagged type of that parameter cannot be frozen.
1451 2017-04-27  Bob Duff  <duff@adacore.com>
1453         * sem_attr.adb (Compute_Type_Key): Don't walk
1454         representation items for irrelevant types, which could be in a
1455         different source file.
1457 2017-04-27  Steve Baird  <baird@adacore.com>
1459         * exp_attr.adb (Expand_N_Attribute_Reference):
1460         Don't expand Image, Wide_Image, Wide_Wide_Image attributes
1461         for CodePeer.
1463 2017-04-27  Yannick Moy  <moy@adacore.com>
1465         * exp_unst.ads: Fix typos in comments.
1467 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1469         * sem_eval.adb (Choice_Matches): Handle properly a real literal
1470         whose type has a defined static predicate.
1472 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1474         * exp_ch4.adb (Insert_Dereference_Action):
1475         Do not adjust the address of a controlled object when the
1476         associated access type is subject to pragma No_Heap_Finalization.
1477         Code reformatting.
1479 2017-04-27  Pierre-Marie de Rodat  <derodat@adacore.com>
1481         * gcc-interface/utils.c (gnat_type_for_size): Set
1482         TYPE_ARTIFICIAL on created types.
1484 2017-04-27  Claire Dross  <dross@adacore.com>
1486         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1487         modifications in functional containers.
1488         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1489         to improve readablity. Subprograms are separated between basic
1490         operations, constructors and properties. Universally quantified
1491         formulas in contracts are factorized in independant functions
1492         with a name and a comment.  Names of parameters are improved.
1494 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1496         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1498 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1500         * sem_res.adb (Resolve_Type_Conversion): Do not
1501         install a predicate check here since this is already done during
1502         the expansion phase. Verify whether the operand satisfies the
1503         static predicate (if any) of the target type.
1504         * sem_ch3.adb (Analyze_Object_Declaration): Do
1505         not install a predicate check if the object is initialized by
1506         means of a type conversion because the conversion is subjected
1507         to the same check.
1509 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1511         * raise.c (__gnat_builtin_longjmp): Remove.
1512         (__gnat_bracktrace):
1513         Add a dummy definition for the compiler (__gnat_eh_personality,
1514         __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
1515         __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
1516         __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
1517         * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
1518         * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
1519         and a-except-2005.adb.
1520         * raise-gcc.c: Allow build in compiler, compiled as a C++
1521         file.
1522         (__gnat_Unwind_ForcedUnwind): Adjust prototype.
1523         (db): Constify msg_format.
1524         (get_call_site_action_for): Don't use void arithmetic.
1525         * system.ads (Frontend_Exceptions): Set to False.
1526         (ZCX_By_Default): Set to True.
1527         (GCC_ZC_Support): Set to True.
1528         * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
1529         a-except.ad[sb].
1530         * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
1531         in gnat1 and gnatbind.
1532         * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
1533         s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
1534         * s-excmac.ads, s-excmac.adb: Copy of variants.
1535         * a-except.o: Adjust preequisites.
1536         Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
1538 2017-04-27  Claire Dross  <dross@adacore.com>
1540         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
1541         modifications in functional containers.
1542         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
1543         to improve readablity. Subprograms are separated between basic
1544         operations, constructors and properties. Universally quantified
1545         formulas in contracts are factorized in independant functions
1546         with a name and a comment.  Names of parameters are improved.
1548 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1550         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
1552 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1554         * sem_res.adb (Resolve_Type_Conversion): Do not
1555         install a predicate check here since this is already done during
1556         the expansion phase. Verify whether the operand satisfies the
1557         static predicate (if any) of the target type.
1558         * sem_ch3.adb (Analyze_Object_Declaration): Do
1559         not install a predicate check if the object is initialized by
1560         means of a type conversion because the conversion is subjected
1561         to the same check.
1563 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1565         * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
1566         replaced by their variants).
1568 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1570         * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
1571         cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
1572         a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
1574 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1576         * s-excmac-gcc.ads, s-excmac-gcc.adb,
1577         s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
1578         Ada95.
1580 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1582         * exp_ch7.adb (Establish_Transient_Scope): Rewrite
1583         the loop which detects potential enclosing transient scopes. The
1584         loop now terminates much earlier as transient scopes are bounded
1585         by packages and subprograms.
1587 2017-04-27  Claire Dross  <dross@adacore.com>
1589         * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
1590         allow the use of regular equality over elements in contracts.
1591         (Cursor): Type is now public so that it can be used in
1592         model functions.
1593         (Formal_Model): Ghost package containing
1594         model functions that are used in subprogram contracts.
1595         (Current_To_Last): Removed, model functions should be used
1596         instead.
1597         (First_To_Previous): Removed, model functions should
1598         be used instead.
1599         (Strict_Equal): Removed, model functions
1600         should be used instead.
1601         (Append): Default parameter value
1602         replaced by new wrapper to allow more precise contracts.
1603         (Insert): Default parameter value replaced by new wrapper to
1604         allow more precise contracts.
1605         (Delete): Default parameter
1606         value replaced by new wrapper to allow more precise contracts.
1607         (Prepend): Default parameter value replaced by new wrapper to
1608         allow more precise contracts.
1609         (Delete_First): Default parameter
1610         value replaced by new wrapper to allow more precise contracts.
1611         (Delete_Last): Default parameter value replaced by new wrapper
1612         to allow more precise contracts.
1614 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1616         * exp_spark.adb (Expand_SPARK): Perform specialized expansion
1617         for object declarations.
1618         (Expand_SPARK_N_Object_Declaration): New routine.
1619         * sem_elab.adb (Check_A_Call): Include calls to the
1620         Default_Initial_Condition procedure of a type under the SPARK
1621         elaboration checks umbrella.
1623 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1625         * sem.adb (Analyze): Diagnose an illegal iterated component
1626         association.
1627         * sem_util.ads, sem_util.adb
1628         (Diagnose_Iterated_Component_Association): New routine.
1630 2017-04-27  Bob Duff  <duff@adacore.com>
1632         * adaint.c (__gnat_get_current_dir): Return 0 in length if
1633         getcwd fails.
1634         * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
1635         exception if getcwd failed.
1637 2017-04-27  Yannick Moy  <moy@adacore.com>
1639         * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
1640         entities with special prefix.
1642 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1644         * debug.adb Change the documentation of switch -gnatd.s.
1645         * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
1646         to manage the secondary stack when an enclosing scope already
1647         performs this functionality (aka relaxed management). Switch
1648         -gnatd.s may be used to force strict management in which case
1649         the block will manage the secondary stack unconditionally. Add
1650         a guard to stop the traversal when encountering a package or a
1651         subprogram scope.
1653 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1655         * sem_res.adb (Resolve_Call): Refine further the handling of
1656         limited views of return types in function calls. If the function
1657         that returns a limited view appears in the current unit,
1658         we do not replace its type by the non-limited view because
1659         this transformation is performed int the back-end. However,
1660         the type of the call itself must be the non-limited view, to
1661         prevent spurious resolution errors.
1663 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1665         * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
1666         Removed, proposed implementation using generics for class-wide
1667         preconditions proved impractical.
1668         (Class_Wide_Clone): New attribute of subprogram. Designates
1669         subprogram created for primitive operations with class-wide
1670         pre/postconditions that contain calls to other primitives. The
1671         clone holds the body of the original primitive, but the
1672         pre/postonditions do not apply to it. The original body is
1673         rewritten as a wrapper for a call to the clone.
1674         (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
1675         the flag is set, no code for the corresponding pre/postconditions
1676         is inserted into its body.
1678 2017-04-27  Bob Duff  <duff@adacore.com>
1680         * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
1681         Scalar_Storage_Order if -gnatI is given.
1682         * sem_prag.adb (Analyze_Pragma): Ignore
1683         Default_Scalar_Storage_Order if -gnatI is given.
1685 2017-04-27  Claire Dross  <dross@adacore.com>
1687         * a-cofuba.ads (Add): Take as an additional input parameter
1688         the position where the element should be inserted.
1689         (Remove): New function that removes an element from the container.
1690         * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
1691         * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
1692         (Remove): New function that removes an element from a set.
1693         * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
1694         (Remove): New function that removes an element from a sequence.
1695         (Insert): New function that adds anywhere in a sequence.
1697 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1699         * checks.adb (Generate_Range_Check): Revert previous change.
1701 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1703         * sem_util.adb: Minor reformatting/rewording.
1705 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1707         * lib-xref.adb (Generate_Reference): The use
1708         of attribute 'Result is not considered a violation of pragma
1709         Unreferenced.
1711 2017-04-27  Justin Squirek  <squirek@adacore.com>
1713         * cstand.adb (Create_Standard): Correctly set
1714         Directly_Designated_Type for Any_Access.
1715         * sem_type.adb (Covers): Minor grammar fixes.
1717 2017-04-27  Bob Duff  <duff@adacore.com>
1719         * sem_attr.adb: Minor cleanup.
1721 2017-04-27  Claire Dross  <dross@adacore.com>
1723         * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
1724         private child of Ada.Containers used to implement all functional
1725         containers.
1726         * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
1727         child of Ada.Containers. It provides functional indefinite unbounded
1728         maps which can be used as high level models for specification
1729         of data structures.
1730         * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
1731         child of Ada.Containers. It provides functional indefinite unbounded
1732         sets which can be used as high level models for specification
1733         of data structures.
1734         * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
1735         child of Ada.Containers.  It provides functional indefinite unbounded
1736         vectors which can be used as high level models for specification
1737         of data structures.
1738         * Makefile.rtl: Add new packages.
1739         * impunit.adb: Add new packages.
1741 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1743         * sem_ch4.adb: Minor reformatting.
1745 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1747         * sem_ch12.adb (Analyze_Associations): minor reformatting.
1748         (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
1749         point type actual that has user-defined arithmetic primitives,
1750         when there is a previous actual for a formal package that defines
1751         a fixed-point type with the parent user-defined operator.
1753 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1755         * checks.adb (Generate_Range_Check): Reinstate part of previous change.
1756         * sem_attr.adb (Resolve_Attribute): Generate a range check when
1757         the component type allows range checks.
1759 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1761         * sem_aux.adb (Is_Generic_Formal): Use original node to locate
1762         corresponding declaration, because formal derived types are
1763         rewritten as private extensions.
1765 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1767         * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
1768         dimensions of operands if node has been analyzed already, because
1769         previous analysis and dimension checking will have removed the
1770         dimension information from the operands.
1772 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1774         * debug.adb: Document the use of switch -gnatd.s.
1775         * einfo.ads Update the documentation on attribute
1776         Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
1777         the uses of these attributes from certain entities.
1778         * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
1779         which determines whether the block should continue to manage
1780         the secondary stack.
1781         (Manages_Sec_Stack): New routine.
1783 2017-04-27  Bob Duff  <duff@adacore.com>
1785         * atree.ads: Minor edit.
1787 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1789         * sinfo.ads: Update the section on Ghost mode. Add
1790         a section on SPARK mode. Update the placement of section on
1791         expression functions.
1793 2017-04-27  Bob Duff  <duff@adacore.com>
1795         * sinput.adb (Get_Source_File_Index): Don't
1796         assert that S is in the right range in the case where this is
1797         a .dg file under construction.
1799 2017-04-27  Yannick Moy  <moy@adacore.com>
1801         * sem_util.adb (Check_Result_And_Post_State):
1802         Handle more precisely each conjunct in expressions formed by
1803         and'ing sub-expressions.
1805 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
1807         * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
1809 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1811         * gnat_rm.texi, gnat_ugn.texi,
1812         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1813         doc/gnat_ugn/platform_specific_information.rst,
1814         doc/gnat_ugn/gnat_and_program_execution.rst,
1815         doc/gnat_ugn/gnat_utility_programs.rst,
1816         doc/gnat_ugn/the_gnat_compilation_model.rst,
1817         doc/gnat_rm/implementation_defined_attributes.rst,
1818         doc/gnat_rm/the_gnat_library.rst,
1819         doc/gnat_rm/implementation_defined_pragmas.rst,
1820         doc/gnat_rm/representation_clauses_and_pragmas.rst,
1821         doc/gnat_rm/implementation_of_specific_ada_features.rst,
1822         doc/gnat_rm/implementation_defined_aspects.rst,
1823         doc/gnat_rm/implementation_defined_characteristics.rst: Update
1824         documentation.
1826 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1828         * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
1829         generating C code on complex case expressions.
1831 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1833         * sem_prag.adb (Analyze_Pragma): Generate a warning instead
1834         of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
1835         * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
1836         Ada_2012 instead of Ada_2005 to be compatible with the above
1837         change.
1838         * bindgen.adb: Silence new warning on pragma Ada_95.
1840 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1842         * checks.adb (Generate_Range_Check): Revert part of previous change.
1844 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
1846         * sem_ch4.adb (Try_Container_Indexing): Handle properly a
1847         container indexing operation that appears as a an actual in a
1848         parameter association in a procedure call.
1850 2017-04-25  Olivier Ramonat  <ramonat@adacore.com>
1852         * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
1853         Fix spelling mistakes.
1855 2017-04-25  Bob Duff  <duff@adacore.com>
1857         * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
1858         * sinput-p.adb: Use regular fat pointers, with bounds checking,
1859         for source buffers.  Fix misc obscure bugs.
1860         * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
1861         checking, for source buffers.  Modify representation clause for
1862         Source_File_Record as appropriate.  Move Source_File_Index_Table
1863         from spec to body, because it is not used outside the body.
1864         Move Set_Source_File_Index_Table into the private part, because
1865         it is used only in the body and in children.  Use trickery to
1866         modify the dope in the generic instantiation case.  It's ugly,
1867         but not as ugly as the previous method.  Fix documentation.
1868         Remove obsolete code.
1869         * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
1870         indexing in source buffers.
1871         * fmap.adb: Avoid conversions from one string type to another.
1872         Remove a use of global name buffer.
1873         * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
1874         fixes.
1876 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
1878         * exp_util.adb, exp_ch4.adb: Minor reformatting.
1880 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1882         * checks.adb: Code clean up in various routines.
1883         (Generate_Range_Check): Do not generate a range check when the
1884         expander is not active or when index/range checks are suppressed
1885         on the target type.
1886         (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
1887         Remove variants that include a Supress parameter. These routines
1888         are never used, and were introduced before the current scope-based
1889         check suppression method.
1891 2017-04-25  Vasiliy Fofanov  <fofanov@adacore.com>
1893         * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
1894         code and some subprogram calls that are now noop.
1896 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
1898         * exp_ch4.adb (Expand_N_Case_Expression): Take
1899         Minimize_Expression_With_Actions into account when possible.
1901 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1903         * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
1904         (Known_Null): Moved to Sem_Util.
1905         * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
1906         (Known_Null): Moved to Sem_Util.
1907         * sem_util.adb Add new enumeration type Null_Status_Kind.
1908         (Known_Non_Null): Moved from Exp_Util. Most of the logic in
1909         this routine is now carried out by Null_Status.
1910         (Known_Null): Moved from Exp_Util. Most of the logic in this routine
1911         is now carried out by Null_Status.
1912         (Null_Status): New routine.
1913         * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
1914         (Known_Null): Moved from Exp_Util.
1916 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
1918         * sem_ch6.adb (Analyze_Expression_Function): Do not report an
1919         error on the return type of an expression function that is a
1920         completion, if the type is derived from a generic formal type.
1922 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
1924         * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
1925         conversion are those of the target type.
1927 2017-04-25  Bob Duff  <duff@adacore.com>
1929         * a-clrefi.adb: Minor cleanup.
1931 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
1933         * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
1935 2017-04-25  Bob Duff  <duff@adacore.com>
1937         * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
1938         types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
1939         errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
1940         scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
1941         the Internal_Source buffer. This removes the incorrect call to "="
1942         the customer noticed.
1943         Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
1944         eventually need to eliminate them altogether. Or else get rid
1945         of zero-origin addressing.
1947 2017-04-25  Claire Dross  <dross@adacore.com>
1949         * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
1950         function used in GNATprove to know if an expression contains
1951         non-dispatching calls on primitives of a tagged type.
1953 2017-04-25  Bob Duff  <duff@adacore.com>
1955         * rtsfind.adb (Initialize): Initialize
1956         First_Implicit_With. Building the compiler with Normalize_Scalars
1957         and validity checking finds this being used as an uninitialized
1958         variable.
1960 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
1962         * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
1963         Add a warning about SPARK mode management. The routine now
1964         saves and restores both the mode and associated pragma.
1965         (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
1966         SPARK mode management. The routine now saves and restores both
1967         the mode and associated pragma.
1968         (Analyze_Object_Contract):
1969         Add a warning about SPARK mode management. The routine
1970         now saves and restores both the mode and associated pragma.
1971         (Analyze_Package_Body_Contract): Add a warning about SPARK mode
1972         management.  The routine now saves and restores both the mode
1973         and associated pragma.  (Analyze_Package_Contract): Add a warning
1974         about SPARK mode management. The routine now saves and restores
1975         both the mode and associated pragma.
1976         (Analyze_Task_Contract):
1977         Add a warning about SPARK mode management. The routine now saves
1978         and restores both the mode and associated pragma.
1979         * expander.adb (Expand): Change the way the Ghost mode is saved
1980         and restored.
1981         * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
1982         saved and restored.
1983         * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
1984         and restored.
1985         * exp_util.adb (Build_DIC_Procedure_Body):
1986         Change the way the Ghost mode is saved and restored.
1987         (Build_DIC_Procedure_Declaration): Change the way the Ghost
1988         mode is saved and restored.
1989         (Build_Invariant_Procedure_Body):
1990         Change the way the Ghost mode is saved and restored.
1991         (Build_Invariant_Procedure_Declaration): Change the way the Ghost
1992         mode is saved and restored.
1993         (Make_Predicate_Call): Change the
1994         way the Ghost mode is saved and restored.
1995         * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
1996         saved and restored.
1997         * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
1998         and its assignment.
1999         (Mark_And_Set_Ghost_Body): Remove parameter
2000         Mode and its assignment.
2001         (Mark_And_Set_Ghost_Completion):
2002         Remove parameter Mode and its assignment.
2003         (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
2004         assignment.
2005         (Mark_And_Set_Ghost_Instantiation): Remove parameter
2006         Mode and its assignment.
2007         (Mark_And_Set_Ghost_Procedure_Call):
2008         Remove parameter Mode and its assignment.
2009         (Set_Ghost_Mode):
2010         Remove parameter Mode and its assignment.
2011         * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
2012         and update the comment on usage.
2013         (Mark_And_Set_Ghost_Body):
2014         Remove parameter Mode and update the comment on usage.
2015         (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
2016         update the comment on usage.
2017         (Mark_And_Set_Ghost_Declaration):
2018         Remove parameter Mode and update the comment on usage.
2019         (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
2020         update the comment on usage.
2021         (Mark_And_Set_Ghost_Procedure_Call):
2022         Remove parameter Mode and update the comment on usage.
2023         (Set_Ghost_Mode): Remove parameter Mode and update the comment
2024         on usage.
2025         * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
2026         types.
2027         * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
2028         of obsolete field SPARK_Mode_Pragma.
2029         (Load_Main_Source): Remove
2030         the assignment of obsolete field SPARK_Mode_Pragma.
2031         (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
2032         * lib-writ.adb (Add_Preprocessing_Dependency): Remove
2033         the assignment of obsolete field SPARK_Mode_Pragma.
2034         (Ensure_System_Dependency): Remove the assignment of obsolete
2035         field SPARK_Mode_Pragma.
2036         * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
2037         mode management. Change the way Ghost and SPARK modes are saved
2038         and restored.
2039         * sem.adb (Analyze): Change the way the Ghost mode is saved
2040         and restored.
2041         * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
2042         Ghost mode is saved and restored.
2043         (Process_Full_View): Change
2044         the way the Ghost mode is saved and restored.
2045         * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
2046         mode is saved and restored.
2047         * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
2048         mode is saved and restored.
2049         (Analyze_Subprogram_Body_Helper):
2050         Change the way the Ghost mode is saved and restored.
2051         * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
2052         Ghost mode is saved and restored.
2053         * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
2054         management. Save the SPARK mode-related data prior to any changes
2055         to the scope stack and contexts. The mode is then reinstalled
2056         before the subunit is analyzed in order to restore the original
2057         view of the subunit.
2058         * sem_ch12.adb (Analyze_Package_Instantiation): Update the
2059         warning on region management.  Change the way the Ghost and
2060         SPARK modes are saved and restored.
2061         (Inline_Instance_Body):
2062         Add a warning about SPARK mode management. Code clean up.
2063         (Analyze_Subprogram_Instantiation): Update the warning on region
2064         management.  Change the way the Ghost and SPARK modes are saved
2065         and restored.
2066         (Instantiate_Package_Body): Update the warning
2067         on region management. Change the way the Ghost and SPARK modes
2068         are saved and restored.
2069         (Instantiate_Subprogram_Body): Update
2070         the warning on region management. Change the way the Ghost and
2071         SPARK modes are saved and restored.
2072         (Set_Instance_Env): Add a
2073         warning about SPARK mode management. Change the way SPARK mode
2074         is saved and restored.
2075         * sem_ch13.adb (Build_Predicate_Functions):
2076         Change the way the Ghost mode is saved and restored.
2077         (Build_Predicate_Function_Declaration): Change the way the Ghost
2078         mode is saved and restored.
2079         * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
2080         mode management. Change the way SPARK mode is saved and restored.
2081         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
2082         Change the way the Ghost mode is saved and restored.
2083         (Analyze_Initial_Condition_In_Decl_Part): Change the way
2084         the Ghost mode is saved and restored.
2085         (Analyze_Pragma):
2086         Change the way the Ghost mode is saved and restored.
2087         (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
2088         Ghost mode is saved and restored.
2089         * sem_util.adb (Install_SPARK_Mode): New routine.
2090         (Restore_SPARK_Mode): New routine.
2091         (Save_SPARK_Mode_And_Set): Removed.
2092         (Set_SPARK_Mode): New routine.
2093         * sem_util.ads (Install_SPARK_Mode): New routine.
2094         (Restore_SPARK_Mode): New routine.
2095         (Save_SPARK_Mode_And_Set): Removed.
2096         (Set_SPARK_Mode): New routine.
2098 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2100         * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
2101         to determine whether a type is declared in a local package that
2102         has not yet been frozen.
2103         * freeze.adb (Freeze_Before): Use new predicate to determine
2104         whether a local package must be installed on the scope stack
2105         in order to evaluate in the proper scope actions generated by
2106         aspect specifications, such as Predicate
2107         * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
2108         using new predicate.
2110 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2112         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
2113         comparisons between non- scalar expressions expressions because
2114         their values cannot be invalidated.
2115         * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
2116         comment on usage.
2118 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2120         * par_sco.adb: Minor reformatting.
2122 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2124         * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
2125         is a type from an unfrozen local package, install package to
2126         complete the analysis of delayed aspects of the type.
2128 2017-04-25  Tristan Gingold  <gingold@adacore.com>
2130         * bingen.adb (System_Version_Control_Used): New variable.
2131         (Resolve_Binder_Options): Set the above variable.
2132         (Gen_Output_File_Ada): Conditionally call Gen_Versions.
2133         (Gen_Elab_Order): Emit blank line before.
2135 2017-04-25  Justin Squirek  <squirek@adacore.com>
2137         * sem_cat.adb (Validate_RT_RAT_Component): Added
2138         an extra check to ignore incomplete types.
2140 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2142         * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
2143         bogus circuitry for the case where Name is Predicate.
2145 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2147         * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
2148         Create SCOs for Predicate aspects in disabled
2149         state initially, to be enabled later on by...
2150         * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
2151         SCO for predicate as enabled.
2153 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2155         * comperr.adb (Compiler_Abort): Remove now obsolete pair of
2156         pragmas Warnings Off / On.
2157         * namet.adb (Finalize): Remove now obsolete pair of pragmas
2158         Warnings Off / On.
2159         * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
2160         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
2161         consider comparisons between static expressions because their
2162         values cannot be invalidated.
2163         * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
2164         Warnings Off / On.
2165         (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
2166         * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
2168 2017-04-25  Bob Duff  <duff@adacore.com>
2170         * sem_elab.adb (In_Task_Activation): Trace internal calls in
2171         task bodies.
2173 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2175         * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
2176         typo fixes.
2178 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2180         * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
2181         On/Off to defend against a spurious warning in conditional
2182         compilation.
2183         * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
2184         * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
2185         defend against a spurious warning in conditional compilation.
2186         * output.adb Add a pair of pragma Warnings On/Off to defend
2187         against a spurious warning in conditional compilation.
2188         * sem_eval.adb (Eval_Relational_Op): Major code clean up.
2189         (Fold_General_Op): New routine.
2190         (Fold_Static_Real_Op): New routine.
2191         (Test_Comparison): New routine.
2192         * sem_eval.ads (Test_Comparison): New routine.
2193         * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
2194         (Warn_On_Constant_Valid_Condition): New routine.
2195         (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
2196         to detect a specific case.
2197         * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
2198         * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
2199         to defend against a spurious warning in conditional compilation.
2200         (Tree_Write): Add a pair of pragma Warnings On/Off to defend
2201         against a spurious warning in conditional compilation.
2202         * usage.adb Add a pair of pragma Warnings On/Off to defend
2203         against a spurious warning in conditional compilation.
2205 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2207         * sinfo.ads, sem_ch13.adb: Update comment.
2209 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2211         * sem_util.adb (Is_Post_State): A reference to a
2212         generic in out parameter is considered a change in the post-state
2213         of a subprogram.
2215 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2217         * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
2218         declaration of a subprogram instance within its wrapper package,
2219         skip over null statements that may result from the rewriting of
2220         ignored pragmas.
2222 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2224         * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
2225         If the type is an unchecked_union, replace the attribute with
2226         a Raise_Program_Error (rather than inserting such before the
2227         attribute reference) to handle properly the case where we are
2228         processing a component of a larger record, and we need to prevent
2229         further expansion for the unchecked union.
2230         (Expand_Attribute_Reference, case 'Write): If the type is
2231         an unchecked_union, check whether enclosing scope is a Write
2232         subprogram. Replace attribute with a Raise_Program_Error if the
2233         discriminants of the unchecked_union type have not default values
2234         because such a use is erroneous..
2236 2017-04-25  Tristan Gingold  <gingold@adacore.com>
2238         * exp_ch9.adb (Expand_N_Task_Type_Declaration):
2239         Add relative_deadline to task record on edf profile.
2240         (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
2241         (Make_Task_Create_Call): Pass relative_deadline value.
2242         * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
2243         * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
2244         (Profile_Info): Add info for GNAT_Ravenscar_EDF.
2245         * sem_prag.adb (Set_Ravenscar_Profile): Handle
2246         GNAT_Ravenscar_EDF (set scheduling policy).
2247         (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
2248         pragma.
2249         (Sig_Flags): Add choice for Pragma_Deadline_Floor.
2250         * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
2251         New names.
2252         (Pragma_Deadline_Floor): New pragma.
2253         * targparm.adb (Get_Target_Parameters): Recognize
2254         GNAT_Ravenscar_EDF profile.
2256 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
2258         * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
2260 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2262         * sem_aux.adb (Nearest_Ancestor): Use original node of type
2263         declaration to locate nearest ancestor, because derived
2264         type declarations for record types are rewritten as record
2265         declarations.
2266         * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
2267         properly derivations that are completions of private types.
2268         (Add_Predicates): If type is private, examine rep. items of full
2269         view, which may include inherited predicates.
2270         (Build_Predicate_Functions): Ditto.
2272 2017-04-25  Javier Miranda  <miranda@adacore.com>
2274         * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
2275         to generate new entities for subtype declarations located in
2276         Expression_With_Action nodes.
2278 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2280         * sem_elab.adb (Check_A_Call): Remove
2281         local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
2282         need for Elaborate_All when SPARK elaboration checks are
2283         required. Update the checks for instances, variables, and calls
2284         to Default_Initial_Condition procedures.
2286 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2288         * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
2289         into a boolean aspect, in analogy with the Ada aspect No_Return.
2291 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2293         * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
2295 2017-04-25  Bob Duff  <duff@adacore.com>
2297         * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
2298         Is_True_Constant for an array variable that is passed to a
2299         foreign function as an 'in' parameter.
2300         * debug.adb: Document -gnatd.q.
2302 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2304         * sem_ch6.adb (Analyze_Expression_Function): If expression function
2305         is completion and return type is an access type do not freeze
2306         designated type: this will be done in the process of freezing
2307         the expression if needed.
2308         (Freeze_Expr_Types): Check whether type is complete before
2309         creating freeze node, to provide a better error message if
2310         reference is premature.
2311         * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
2312         functions created by type derivations.
2314 2017-04-25  Pascal Obry  <obry@adacore.com>
2316         * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
2318 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2320         * sem_res.adb (Resolve_Type_Conversion):
2321         When resolving against any fixed type, set the type of the
2322         operand as universal real when the operand is a multiplication
2323         or a division where both operands are of any fixed type.
2324         (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
2325         placement of an error message by pointing to the operand of a
2326         type conversion rather than the conversion itself.
2328 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2330         * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
2331         Needs_Debug_Info when producing SCOs.
2333 2017-04-25  Thomas Quinot  <quinot@adacore.com>
2335         * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
2336         Always pass a null finalization master for a library level named access
2337         type to which a pragme No_Heap_Finalization applies.
2339 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
2341         PR ada/78845
2343         * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
2344         set to A'First(2) and vice versa.
2346 2017-04-25  Yannick Moy  <moy@adacore.com>
2348         * freeze.adb (Freeze_Record_Type): Remove obsolete
2349         rule on volatile tagged record restriction on SPARK code.
2351 2017-04-25  Yannick Moy  <moy@adacore.com>
2353         * sem_prag.adb (minor) Fix SPARK RM reference.
2355 2017-04-25  Yannick Moy  <moy@adacore.com>
2357         * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
2358         comment to reflect which entity is chosen as unique entity.
2359         (Unique_Entity): Return full view instead of private spec for
2360         protected type or task type. Fix possible incorrect access when
2361         called on entry.
2363 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2365         * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
2366         array types only instead of all packed array types.
2368 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2370         * sem_ch6.adb (Conforming_Types): If type of formal as a specified
2371         dimension system, verify that dimensions of both match.
2372         (Check_Conformance): Add error message in case of dimension
2373         mismatch.
2374         * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
2375         predicate.
2377 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
2379         * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
2380         confusing.
2382 2017-04-25  Yannick Moy  <moy@adacore.com>
2384         * sem_util.adb: Minor refactoring.
2385         * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
2387 2017-04-25  Claire Dross  <dross@adacore.com>
2389         * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
2390         ultimate alias when accessing overridden operation. Indeed, if the
2391         overridden operation is itself inherited, it won't have any explicit
2392         contract.
2394 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2396         * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
2397         overlap if the two formals have different types, because formally
2398         the corresponding actuals cannot designate the same objects.
2400 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2402         * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
2403         dimensions are present from context, use them.  b) If operand is
2404         a static constant rewritten as a literal, obtain the dimensions
2405         from the original declaration, otherwise use dimensions of type
2406         established from context.
2408 2017-04-25  Yannick Moy  <moy@adacore.com>
2410         * sem_util.adb (Is_Effectively_Volatile): Protect against base type
2411         of array that is private.
2413 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2415         * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
2416         reformatting.
2418 2017-04-25  Yannick Moy  <moy@adacore.com>
2420         * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
2421         on body.
2423 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2425         * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
2426         the check that recognizes a call to a private overridding and
2427         replaces the called subprogram with its alias.
2429 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2431         * exp_util.adb: Minor reformatting.
2433 2017-04-25  Justin Squirek  <squirek@adacore.com>
2435         * exp_ch3.adb (Freeze_Type): Add condition to always treat
2436         interface types as a partial view of a private type for the
2437         generation of invariant procedure bodies.
2438         * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
2439         Add a condition to get the Corresponding_Record_Type for
2440         concurrent types, add condition to return in the absence of a
2441         class in the pragma, remove call to Replace_Type_References,
2442         and add call to Replace_References.
2443         (Add_Interface_Invariatns),
2444         (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
2445         to including the working type T.
2446         (Add_Own_Invariants): Remove
2447         legacy condition for separate units, remove dispatching for ASIS
2448         and save a copy of the expression in the pragma expression.
2449         (Build_Invariant_Procedure_Body): Default initalize vars,
2450         remove return condition on interfaces, always use the
2451         private type for interfaces, and move the processing of types
2452         until after the processing of invariants for the full view.
2453         (Build_Invariant_Procedure_Declaration): Remove condition
2454         to return if an interface type is encountered and add
2455         condition to convert the formal parameter to its class-wide
2456         counterpart if Work_Typ is abstract.
2457         (Replace_Type): Add call to Remove_Controlling_Arguments.
2458         (Replace_Type_Ref): Remove class-wide dispatching for the current
2459         instance of the type.
2460         (Replace_Type_References): Remove parameter "Derived"
2461         (Remove_Controlling_Arguments): Created in order to removing
2462         the controlliong argument from calls to primitives in the case
2463         of the formal parameter being an class-wide abstract type.
2464         * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
2465         to the change made to Freeze_Type in exp_ch3. Add a condition
2466         to treat interface types as a partial view.
2467         * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
2468         to Build_Invariant_Procedure_Declaration to properly generate a
2469         "partial" invariant procedure when Typ is an interface.
2471 2017-04-25  Bob Duff  <duff@adacore.com>
2473         * a-numeri.ads: Go back to using brackets encoding for the Greek
2474         letter pi.
2476 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2478         * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
2479         (10-15): if derived type T with progenitors is abstract,
2480         and primitive P of this type inherits non-trivial classwide
2481         preconditions from both a parent operation and from an interface
2482         operation, then the inherited operation is abstract if the parent
2483         operation is not null.
2484         * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
2485         with Covered_Interface_Op to yield the actual interface operation
2486         that is implemented by a given inherited operation.
2488 2017-04-25  Javier Miranda  <miranda@adacore.com>
2490         * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
2491         and right operands after performing the validity checks. Required
2492         because validity checks may remove side effects from the operands.
2494 2017-04-25  Javier Miranda  <miranda@adacore.com>
2496         * exp_attr.adb (Attribute_Unrestricted_Access):
2497         Do not disable implicit type conversion.  Required to generate
2498         code that displaces the pointer to reference the secondary
2499         dispatch table.
2501 2017-04-25  Pascal Obry  <obry@adacore.com>
2503         * prj-attr.adb, snames.ads-tmpl: Add package Install's
2504         Required_Artifacts attribute.
2506 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2508         * sem_util.adb (Same_Value): String literals are compile-time
2509         values, and comparing them must use Expr_Value_S.
2511 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2513         * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
2514         dereference is introduced for the object, and the object is
2515         overloaded, do not check whether it is aliased, because it may
2516         include an implicit dereference.
2517         * sem_type.adb (Disambiguate): If two interpretations are access
2518         attribute types with the same designated type keep either of
2519         them and do not report an ambiguity.  A true ambiguity will be
2520         reported elsewhere.
2522 2017-04-25  Bob Duff  <duff@adacore.com>
2524         * a-numeri.ads: Change the encoding of Greek letter Pi from
2525         brackets encoding to UTF-8.  Use pragma Wide_Character_Encoding
2526         to indicate the encoding. We considered using a byte order mark
2527         (BOM), but that causes various trouble (misc software eats the
2528         BOM, if you have a patch with a BOM, then it's not at the start
2529         of the patch, so it's not a BOM, the BOM affects with-ing files,
2530         etc.).
2531         * scng.adb, s-wchcnv.adb: Minor.
2533 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2535         * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
2536 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2538         * sem_ch3.adb (Add_Internal_Interface_Entities): Move
2539         Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
2540         Improve error message on operations that inherit non-conforming
2541         classwide preconditions from ancestor and progenitor.
2542         * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
2543         moved here from sem_ch3.
2544         * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
2545         check given in RM 6.1.1 (17) concerning renamings of overriding
2546         operations that inherits class-wide preconditions from ancestor
2547         or progenitor.
2549 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2551         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
2552         (Build_Adjust_Statements): Code cleanup.
2553         (Build_Finalizer): Update the initialization of
2554         Exceptions_OK.
2555         (Build_Finalize_Statements): Code cleanup.
2556         (Build_Initialize_Statements): Code cleanup.
2557         (Make_Deep_Array_Body): Update the initialization of
2558         Exceptions_OK.
2559         (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
2560         (Process_Object_Declaration): Generate a null exception handler only
2561         when exceptions are allowed.
2562         (Process_Transients_In_Scope): Update the initialization of
2563         Exceptions_OK.
2564         * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
2565         routine.
2566         * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
2567         restrictions when the handler is internally generated and the
2568         mode is warnings.
2570 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2572         * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
2573         enforce legality rule on classwide preconditions inherited from
2574         both an ancestor and a progenitor (RM 6.1.1 (10-13).
2575         * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
2576         subprogram need not be dispatching if it appears in a precondition
2577         for an abstract or null subprogram.
2579 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2581         * sem_ch10.adb: Minor typo fix.
2583 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2585         * gcc-interface/Makefile.in: Cleanup VxWorks targets.
2587 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2589         * fname.adb (Is_Internal_File_Name): Arrange for the slices to
2590         have a length which is a power of 2.
2591         (Is_Predefined_File_Name): Likewise. Adjust comment.
2593 2017-04-25  Bob Duff  <duff@adacore.com>
2595         * exp_aggr.adb (Component_Count): Protect the
2596         arithmetic from attempting to convert a value >= 2**31 to Int,
2597         which would otherwise raise Constraint_Error.
2599 2017-04-25  Bob Duff  <duff@adacore.com>
2601         * opt.ads (Locking_Policy): Fix incorrect documentation. The
2602         first character of the policy name is not unique.
2604 2017-04-25  Bob Duff  <duff@adacore.com>
2606         * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
2607         * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
2608         about this flag not being used. It was already used, and it is
2609         now used more.
2611 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2613         * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
2614         (Ignore_SPARK_Mode_Pragmas): New routine.
2615         (Set_Ignore_SPARK_Mode_Pragmas): New routine.
2616         (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
2617         * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
2618         related entities.
2619         (Ignore_SPARK_Mode_Pragmas): New routine
2620         along with pragma Inline.
2621         (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
2622         * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
2623         Ignore_SPARK_Mode_Pragmas_In_Instance.
2624         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
2625         Save and restore the value of global flag
2626         Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
2627         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
2628         the corresponding spec or the body must ignore all SPARK_Mode
2629         pragmas found within.
2630         (Analyze_Subprogram_Declaration): Mark
2631         the spec when it needs to ignore all SPARK_Mode pragmas found
2632         within to allow the body to infer this property in case it is
2633         instantiated or inlined later.
2634         * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
2635         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2636         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2637         when the corresponding spec also ignored all SPARK_Mode pragmas
2638         found within.
2639         (Analyze_Package_Declaration): Mark the spec when
2640         it needs to ignore all SPARK_Mode pragmas found within to allow
2641         the body to infer this property in case it is instantiated or
2642         inlined later.
2643         * sem_ch12.adb (Analyze_Formal_Package_Declaration):
2644         Save and restore the value of flag
2645         Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2646         formal spec when it needs to ignore all SPARK_Mode
2647         pragmas found within to allow the body to infer this
2648         property in case it is instantiated or inlined later.
2649         (Analyze_Package_Instantiation): Save and restore the value
2650         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
2651         the instance spec when it needs to ignore all SPARK_Mode
2652         pragmas found within to allow the body to infer this
2653         property in case it is instantiated or inlined later.
2654         (Analyze_Subprogram_Instantiation): Save and restore the value
2655         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
2656         instance spec and anonymous package when they need to ignore
2657         all SPARK_Mode pragmas found within to allow the body to infer
2658         this property in case it is instantiated or inlined later.
2659         (Instantiate_Package_Body): Save and restore the value of global
2660         flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
2661         global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
2662         corresponding instance spec also ignored all SPARK_Mode pragmas
2663         found within.
2664         (Instantiate_Subprogram_Body): Save and restore the
2665         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
2666         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
2667         when the corresponding instance spec also ignored all SPARK_Mode
2668         pragmas found within.
2669         * sem_prag.adb (Analyze_Pragma): Update the reference to
2670         Ignore_Pragma_SPARK_Mode.
2671         * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
2672         all SPARK_Mode pragmas defined within yields mode "off".
2674 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2676         * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
2678 2017-04-25  Bob Duff  <duff@adacore.com>
2680         * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
2681         All_Checks" to avoid generating unnecessary checks.
2682         * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
2683         All_Checks".
2684         * sem.ads: Fix comment.
2685         * expander.ads: Fix comment.
2686         * exp_atag.ads: Fix comment: "Index = 0" should be
2687         "Index >= 0".
2689 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2691         * s-taprop-linux.adb: Minor editorial fixes.
2693 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2695         * sem_util.adb (New_Copy_Tree): Put back the declarations of the
2696         hash tables at library level.  Reinstate the NCT_Hash_Tables_Used
2697         variable and set it to True whenever the main hash table is
2698         populated.  Short- circuit the Assoc function if it is false
2699         and add associated guards.
2701 2017-04-25  Olivier Hainque  <hainque@adacore.com>
2703         * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
2704         specs without elaboration code that have an elaboration counter
2705         nevertheless, e.g.  when compiled with -fpreserve-control-flow.
2706         * sem_ch10.adb (Analyze_Compilation_Unit):
2707         Set_Elaboration_Entity_Required when requested to preserve
2708         control flow, to ensure the unit elaboration is materialized at
2709         bind time, resulting in the inclusion of the unit object file
2710         in the executable closure at link time.
2712 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
2714         * exp_dbug.adb: In Debug_Renaming_Declaration,
2715         when dealing with indexed component, accept to produce a renaming
2716         symbol when the index is an IN parameter or when it is a name
2717         defined in an outer scope.
2719 2017-04-25  Yannick Moy  <moy@adacore.com>
2721         * errout.adb (Error_Msg): Adapt continuation
2722         message in instantiations and inlined bodies for info messages.
2724 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2726         * fname.adb (Has_Internal_Extension): Add pragma Inline.
2727         Use direct 4-character slice comparisons.
2728         (Has_Prefix): Add
2729         pragma Inline.  (Has_Suffix): Delete.
2730         (Is_Internal_File_Name):
2731         Test Is_Predefined_File_Name first.
2732         (Is_Predefined_File_Name):
2733         Use direct slice comparisons as much as possible and limit all
2734         comparisons to at most 8 characters.
2736 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2738         * checks.adb (Insert_Valid_Check): Code cleanup.
2739         * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
2740         (Expand_Actuals): Generate proper copy-back for a validation
2741         variable when it acts as the argument of a type conversion.
2742         * sem_util.adb (Is_Validation_Variable_Reference): Augment the
2743         predicate to operate on type qualifications.
2745 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2747         * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
2748         Minor reformatting.
2750 2017-04-25  Bob Duff  <duff@adacore.com>
2752         * sem_prag.adb (No_Return): Give an error if the pragma applies
2753         to a body. Specialize the error for the specless body case,
2754         as is done for (e.g.) pragma Convention.
2755         * debug.adb: Add switch -gnatd.J to disable the above legality
2756         checks. This is mainly for use in our test suite, to avoid
2757         rewriting a lot of illegal (but working) code.  It might also
2758         be useful to customers. Under this switch, if a pragma No_Return
2759         applies to a body, and the procedure raises an exception (as it
2760         should), the pragma has no effect. If the procedure does return,
2761         execution is erroneous.
2763 2017-04-25  Bob Duff  <duff@adacore.com>
2765         * exp_ch6.adb (Expand_Actuals): This is the
2766         root of the problem. It took N as an 'in out' parameter, and in
2767         some cases, rewrote N, but then set N to Original_Node(N). So
2768         the node returned in N had no Parent. The caller continued
2769         processing of this orphaned node. In some cases that caused a
2770         crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
2771         and trips over the Empty Parent). The solution is to make N an
2772         'in' parameter.  Instead of rewriting it, return the list of
2773         post-call actions, so the caller can do the rewriting later,
2774         after N has been fully processed.
2775         (Expand_Call_Helper): Move most of Expand_Call here. It has
2776         too many premature 'return' statements, and we want to do the
2777         rewriting on return.
2778         (Insert_Post_Call_Actions): New procedure to insert the post-call
2779         actions in the appropriate place. In the problematic case,
2780         that involves rewriting N as an Expression_With_Actions.
2781         (Expand_Call): Call the new procedures Expand_Call_Helper and
2782         Insert_Post_Call_Actions.
2784 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2786         * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
2787         properly type derived from generic formal types, to handle
2788         properly modified version of ACATS 4.1B B611017.
2790 2017-04-25  Javier Miranda  <miranda@adacore.com>
2792         * exp_unst.adb (Subp_Index): Adding missing
2793         support for renamings and functions that return a constrained
2794         array type (i.e. functions for which the frontend built a
2795         procedure with an extra out parameter).
2797 2017-04-25  Pascal Obry  <obry@adacore.com>
2799         * s-string.adb: Minor code clean-up.
2801 2017-04-25  Bob Duff  <duff@adacore.com>
2803         * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
2804         procedure.
2805         * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
2806         function for Non_Blocking_Wait_Process.
2808 2017-04-25  Bob Duff  <duff@adacore.com>
2810         * prep.adb (Preprocess): Remove incorrect
2811         Assert. Current character can be ASCII.CR.
2813 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2815         * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
2816         convention Stdcall, which has a number of exceptions. Convention
2817         is legal on a component declaration whose type is an anonymous
2818         access to subprogram.
2820 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2822         * sem_ch4.adb: sem_ch4.adb Various reformattings.
2823         (Try_One_Prefix_Interpretation): Use the base type when dealing
2824         with a subtype created for purposes of constraining a private
2825         type with discriminants.
2827 2017-04-25  Javier Miranda  <miranda@adacore.com>
2829         * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
2830         * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
2831         dispatching primitives (Restore_Warnings): Restore warning on
2832         late dispatching primitives (Save_Warnings): Save warning on late
2833         dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
2834         to enable/disable this warning.
2835         (WA_Warnings): Set warning on late dispatching primitives.
2836         * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
2837         that its parent type has a private extension.
2838         * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
2839         New subprogram.
2840         * usage.adb: Document -gnatw.j and -gnatw.J.
2842 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2844         * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
2845         reformatting.
2847 2017-04-25  Bob Duff  <duff@adacore.com>
2849         * binde.adb (Validate): Do not pass dynamic strings
2850         to pragma Assert, because older compilers do not support that.
2852 2017-04-25  Bob Duff  <duff@adacore.com>
2854         * s-fileio.adb (Close): When a temp file is
2855         closed, delete it and clean up its Temp_File_Record immediately,
2856         rather than waiting until later.
2857         (Temp_File_Record): Add File
2858         component, so Close can know which Temp_File_Record corresponds
2859         to the file being closed.
2860         (Delete): Don't delete temp files,
2861         because they are deleted by Close.
2862         (Open): Set the File component
2863         of Temp_File_Record. This requires moving the creation of the
2864         Temp_File_Record to the end, after the AFCB has been created.
2866 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2868         * checks.adb (Insert_Valid_Check): Do not generate
2869         a validity check when inside a generic.
2871 2017-04-25  Yannick Moy  <moy@adacore.com>
2873         * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
2875 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2877         * snames.ads-tmpl (Snames): More names for detecting predefined
2878         potentially blocking subprograms.
2880 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2882         * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
2883         concerning inheritance of class-wide preconditions do not apply
2884         to postconditions.
2886 2017-04-25  Bob Duff  <duff@adacore.com>
2888         * s-ficobl.ads: Minor comment fix.
2890 2017-04-25  Yannick Moy  <moy@adacore.com>
2892         * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
2893         conversions from float to integer in GNATprove mode.
2894         (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
2895         to call Apply_Type_Conversion_Checks, so that range checks
2896         are properly positioned when needed on conversions, including
2897         when converting from float to integer.  (Determine_Range): In
2898         GNATprove mode, take into account the possibility of conversion
2899         from float to integer.
2900         * sem_res.adb (Resolve_Type_Conversion): Only enforce range
2901         check on conversions from fixed-point to integer, not anymore
2902         on conversions from floating-point to integer, when in GNATprove
2903         mode.
2905 2017-04-25  Yannick Moy  <moy@adacore.com>
2907         * checks.adb (Determine_Range_R): Special case type conversions
2908         from integer to float in order to get bounds in that case too.
2909         * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
2910         mode, for computations involved in interval checking.
2912 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2914         * checks.adb (Insert_Valid_Check): Partially reimplement validity
2915         checks.
2916         * einfo.adb Node36 is now used as Validated_Object.
2917         (Validated_Object): New routine.
2918         (Set_Validated_Object): New routine.
2919         (Write_Field36_Name): Add an entry for Validated_Object.
2920         * einfo.ads Add new attribute Validated_Object along with
2921         usage in entities.
2922         (Validated_Object): New routine along with pragma Inline.
2923         (Set_Validated_Object): New routine along with pragma Inline.
2924         * exp_attr.adb (Make_Range_Test): Add processing for validation
2925         variables to avoid extra reads and copies of the prefix.
2926         * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
2927         variables in order to reflect any changes done in the variable
2928         back into the original object.
2929         * sem_util.adb (Is_Validation_Variable_Reference): New routine.
2930         * sem_util.ads (Is_Validation_Variable_Reference): New routine.
2932 2017-04-25  Steve Baird  <baird@adacore.com>
2934         * exp_ch7.adb (Build_Array_Deep_Procs,
2935         Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
2936         generate Finalize_Address routines for CodePeer.
2938 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2940         * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
2941         Analyze_Pre_Post_Condition, to implement the legality checks
2942         mandated by AI12-0131: Pre'Class shall not be specified for an
2943         overriding primitive subprogram of a tagged type T unless the
2944         Pre'Class aspect is specified for the corresponding primitive
2945         subprogram of some ancestor of T.
2947 2017-04-25  Bob Duff  <duff@adacore.com>
2949         * sem_ch8.adb (Use_One_Type): If a use_type_clause
2950         is redundant, set its Used_Operations to empty. This is only
2951         necessary for use clauses that appear in the parent of a generic
2952         child unit, because those use clauses get reanalyzed when we
2953         instantiate the generic, and we don't want the Used_Operations
2954         carried over from the original context (where it was probably
2955         not redundant).
2957 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2959         * exp_ch6.adb: Minor reformatting.
2961 2017-04-25  Bob Duff  <duff@adacore.com>
2963         * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
2964         Use Source_Index (Current_Sem_Unit) to find the correct casing.
2965         * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
2966         (Current_Sem_Unit) to find the correct casing.
2967         * par.adb (Par): Null out Current_Source_File, to ensure that
2968         the above bugs won't rear their ugly heads again.
2970 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2972         * sem_ch8.adb (Find_Type): For an attribute reference
2973         'Class, if prefix type is synchronized and previous errors
2974         have suppressed the creation of the corresponding record type,
2975         create a spurious class-wide for the synchonized type itself,
2976         to catch other misuses of the attribute
2978 2017-04-25  Steve Baird  <baird@adacore.com>
2980         * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
2981         is True, then don't generate the accessibility check for the
2982         tag of a tagged result.
2983         * exp_intr.adb (Expand_Dispatching_Constructor_Call):
2984         if CodePeer_Mode is True, then don't generate the
2985         tag checks for the result of call to an instance of
2986         Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
2987         descendant of" check and the accessibility check).
2989 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2991         * sem_ch13.adb: Code cleanups.
2992         * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
2993         * sem_ch8.ads: Minor comment fix.
2995 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
2997         * exp_ch4.adb (Library_Level_Target): New function.
2998         (Expand_Concatenate): When optimization is enabled, also expand
2999         the operation out-of-line if the concatenation is present within
3000         the expression of the declaration of a library-level object and
3001         not only if it is the expression of the declaration.
3003 2017-04-25  Bob Duff  <duff@adacore.com>
3005         * freeze.adb (Freeze_Object_Declaration): Do
3006         not Remove_Side_Effects if there is a pragma Linker_Section,
3007         because in that case we want static initialization in the
3008         appropriate section.
3010 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3012         * exp_dbug.adb: Minor rewording and reformatting.
3014 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3016         * sem_attr.adb (Statically_Denotes_Object): New predicate, to
3017         handle the proposed changes to rules concerning potentially
3018         unevaluated expressions, to include selected components that
3019         do not depend on discriminants, and indexed components with
3020         static indices.
3021         * sem_util.adb (Is_Potentially_Unevaluated): Add check for
3022         predicate in quantified expression, and fix bugs in the handling
3023         of case expressions and membership test.
3024         (Analyze_Attribute_Old_Result): use new predicate.
3025         (Analyze_Attribute, case Loop_Entry): ditto.
3027 2017-04-25  Bob Duff  <duff@adacore.com>
3029         * s-secsta.adb (SS_Info): Add a comment
3030         explaining why we don't need to walk all the chunks in order to
3031         compute the total size.
3033 2017-04-25  Bob Duff  <duff@adacore.com>
3035         * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
3036         of the global name buffer to 4*Max_Line_Length.
3038 2017-04-25  Javier Miranda  <miranda@adacore.com>
3040         * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
3041         renaming entity for debug information, mark the entity as needing debug
3042         info if it comes from sources.
3044 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3046         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
3047         restriction converning the use of 'Address where the prefix is
3048         of a controlled type.
3050 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
3052         * exp_dbug.adb: In Debug_Renaming_Declaration,
3053         skip slices that are made redundant by an indexed component
3054         access.
3055         * atree.h: New definition for Original_Node.
3057 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3059         * sem_prag.adb, sem_prag.ads: Minor reformatting.
3061 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3063         * sem_ch3.adb (Check_Entry_Contract): Call
3064         Preanalyze_Spec_Expression so that resolution takes place as well.
3065         * sem_util.adb (Check_Internal_Protected_Use): Reject properly
3066         internal calls that appear in preconditions of protected
3067         operations, in default values for same, and in contract guards
3068         for contract cases in SPARK.
3070 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3072         * a-numaux.ads: Fix description of a-numaux-darwin
3073         and a-numaux-x86.
3074         (Double): Define to Long_Float.
3075         * a-numaux-vxworks.ads (Double): Likewise.
3076         * a-numaux-darwin.ads
3077         (Double): Likewise.
3078         * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
3079         * a-numaux-x86.ads: Fix package description.
3080         * a-numaux-x86.adb (Is_Nan): Minor tweak.
3081         (Reduce): Adjust and complete description. Call Is_Nan instead of
3082         testing manually. Use an integer temporary to hold rounded value.
3083         * a-numaux-darwin.adb (Reduce): Likewise.
3084         (Is_Nan): New function.
3086 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3088         * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
3089         on analysis of prefix whose type is a current instance of a
3090         synchronized type, but where the prefix itself is an entity that
3091         is an object.
3093 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3095         * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
3096         the identity of callable entities therein, because they have been
3097         properly resolved, and prefixed calls may have been rewritten
3098         as normal calls.
3100 2017-04-25  Patrick Bernardi  <bernardi@adacore.com>
3102         * exp_ch3.adb (Build_Init_Statements): Convert
3103         the expression of the pragma/aspect Secondary_Stack_Size to
3104         internal type System.Parameters.Size_Type before assigning
3105         it to the Secondary_Stack_Size component of the task type's
3106         corresponding record.
3108 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3110         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
3111         (etc) optimizations when the type is modular and the offsets
3112         are equal.
3114 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3116         * s-osinte-freebsd.ads: Minor comment tweaks
3118 2017-04-25  Javier Miranda  <miranda@adacore.com>
3120         * urealp.adb (UR_Write): Reverse previous patch
3121         adding documentation on why we generate multiplications instead
3122         of divisions (needed to avoid expressions whose computation with
3123         large numbers may cause division by 0).
3125 2017-04-25  Bob Duff  <duff@adacore.com>
3127         * erroutc.adb (Set_Specific_Warning_Off,
3128         Set_Warnings_Mode_Off): Use the correct source file for
3129         Stop. Was using Current_Source_File, which is only valid during
3130         parsing. Current_Source_File will have a leftover value from
3131         whatever file happened to be parsed last, because of a with_clause
3132         or something.
3134 2017-04-25  Bob Duff  <duff@adacore.com>
3136         * lib.ads, lib.adb (In_Internal_Unit): New functions similar
3137         to In_Predefined_Unit, but including GNAT units.
3138         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
3139         with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
3140         because Should_Ignore_Pragma was not working reliably outside
3141         the parser, because Current_Source_File is not valid.
3142         * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
3143         * par-prag.adb: Call Should_Ignore_Pragma_Par.
3145 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3147         * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
3148         codepeer mode.
3150 2017-04-25  Javier Miranda  <miranda@adacore.com>
3152         * urealp.adb (UR_Write): Fix output of constants with a base other
3153         that 10.
3155 2017-04-25  Justin Squirek  <squirek@adacore.com>
3157         * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
3158         * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
3159         Add extra parameter for Process_Interface_Name.
3160         (Process_Interface_Name): Add parameter for pragma to analyze
3161         corresponding aspect.
3162         * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
3163         from sem_ch13.adb
3165 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3167         * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
3168         correction.
3170 2017-04-25  Yannick Moy  <moy@adacore.com>
3172         * sem_res.adb (Resolve_Comparison_Op): Do not
3173         attempt evaluation of relational operations inside assertions.
3175 2017-04-25  Justin Squirek  <squirek@adacore.com>
3177         * exp_util.adb (Add_Interface_Invariants):
3178         Restored, code moved back from Build_Invariant_Procedure_Body.
3179         (Add_Parent_Invariants): Restored, code moved back from
3180         Build_Invariant_Procedure_Body.
3181         (Build_Invariant_Procedure_Body):
3182         Remove refactored calls and integrated code from
3183         Add_Parent_Invariants and Add_Interface_Invariants.
3185 2017-04-25  Johannes Kanig  <kanig@adacore.com>
3187         * errout.adb (Output_Messages): Adjust computation of total
3188         errors
3189         * erroutc.adb (Error_Msg): In statistics counts, deal
3190         correctly with informational messages that are not warnings.
3191         * errutil.adb (Finalize): adjust computation of total errors.
3193 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3195         * terminals.c (__gnat_terminate_pid): New.
3196         * g-exptty.ads (Terminate_Process): New. Update comments.
3198 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3200         * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
3202 2017-04-25  Justin Squirek  <squirek@adacore.com>
3204         * sem_ch3.adb (Analyze_Declarations): Minor
3205         correction to comments, move out large conditional and scope
3206         traversal into a predicate.
3207         (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
3208         logic.
3210 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3212         * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
3213         of prefix whose type is a current instance of a synchronized
3214         type. If the prefix is an object this is an external call (or
3215         requeue) that can only access public operations of the object. The
3216         previous predicate was too restrictive, and did not allow public
3217         protected operations, only task entries.
3219 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3221         * sem_ch5.adb, fname.adb: Minor reformatting.
3223 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3225         * einfo.adb (Is_Anonymous_Access_Type): New routine.
3226         * einfo.ads Update the placement of
3227         E_Anonymous_Access_Subprogram_Type along with all subtypes that
3228         mention the ekind.
3229         (Is_Anonymous_Access_Type): New routine.
3230         * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
3231         master for an access type subject to pragma No_Heap_Finalization.
3232         * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
3233         allocated or deallocated does not finalization actions if the
3234         associated access type is subject to pragma No_Heap_Finalization.
3235         * opt.ads Add new global variable No_Heap_Finalization_Pragma.
3236         * par-prag.adb Pragma No_Heap_Finalization does not need special
3237         processing from the parser.
3238         * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
3239         ??? comments. Use the new predicate Is_Anonymous_Access_Type.
3240         * sem_prag.adb Add an entry in table Sig_Flags for pragma
3241         No_Heap_Finalization.
3242         (Analyze_Pragma): Add processing for
3243         pragma No_Heap_Finalization. Update various error messages to
3244         use Duplication_Error.
3245         * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
3246         * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
3247         and corresponding pragma id.
3249 2017-04-25  Bob Duff  <duff@adacore.com>
3251         * freeze.adb (Freeze_Record_Type): Use the
3252         underlying type of the component type to determine whether it's
3253         elementary. For representation clause purposes, a private type
3254         should behave the same as its full type.
3255         * fname.ads, fname.adb (Is_Predefined_File_Name):
3256         Make sure things like "system.ali" are recognized as predefined.
3258 2017-04-25  Javier Miranda  <miranda@adacore.com>
3260         * debug.adb: Update documentation of -gnatd.6.
3262 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3264         * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
3265         element iterator when the name is an overloaded function call,
3266         one of whose interpretations yields an array.
3268 2017-04-25  Bob Duff  <duff@adacore.com>
3270         * uname.ads, uname.adb (Is_Predefined_Unit_Name,
3271         Is_Internal_Unit_Name): New functions for operating on unit
3272         names, as opposed to file names. There's some duplicated code
3273         with fname.adb, which is unfortunate, but it seems like we don't
3274         want to add dependencies here.
3275         * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
3276         to Is_Predefined_Unit_Name; the former was wrong, because Uname
3277         is not a file name at all.
3278         * fname.ads, fname.adb: Document the fact that
3279         Is_Predefined_File_Name and Is_Internal_File_Name can be called
3280         for ALI files, and fix the code so it works properly for ALI
3281         files. E.g. these should return True for "system.ali".
3283 2017-04-25  Justin Squirek  <squirek@adacore.com>
3285         * exp_util.adb (Add_Invariant): Removed,
3286         code moved to Add_Invariant_Check, Add_Inherited_Invariant,
3287         and Add_Own_Invariant.  (Add_Invariant_Check): Used
3288         for adding runtime checks from any kind of invariant.
3289         (Add_Inherited_Invariant): Generates invariant checks for
3290         class-wide invariants (Add_Interface_Invariants): Removed, code
3291         moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
3292         Create a types own invariant procedure (Add_Parent_Invariants):
3293         Removed, code moved to Build_Invariant_Procedure_Body
3294         (Build_Invariant_Procedure_Body): Add refactored calls
3295         and integrated code from Add_Parent_Invariants and
3296         Add_Interface_Invariants.
3297         (Process_Type): Removed, the
3298         relavant code was inlined into both Add_Own_Invariant and
3299         Add_Inherited_Invariant.
3301 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3303         * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
3304         scn.adb, osint.adb, fname.adb: Minor reformatting.
3306 2017-04-25  Pascal Obry  <obry@adacore.com>
3308         * s-taprop-mingw.adb: Do not check for CloseHandle in
3309         Finalize_TCB.
3311 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3313         * sem_util.adb (Check_Part_Of_Reference):
3314         Continue to examine the context if the reference appears within
3315         an expression function.
3317 2017-04-25  Justin Squirek  <squirek@adacore.com>
3319         * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
3320         and Build_Invariant_Procedure_Declaration.
3321         * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
3322         and Build_Invariant_Procedure_Declaration from exp_ch7
3323         and break-out Is_Untagged_Private_Derivation from
3324         Build_Invariant_Procedure_Body.
3325         (Replace_Type_References):
3326         Append an extra parameter to allow for dispatching replacements
3327         and add the corrasponding logic.
3328         (Type_Invariant): Remove
3329         Replace_Typ_Refs and replace its references with calls to
3330         Replace_Type_References.
3331         * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
3333 2017-04-25  Bob Duff  <duff@adacore.com>
3335         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
3336         that returns True when appropriate.
3337         * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
3338         when compiling predefined files.
3339         * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
3340         "gnat.adc" should not be considered a predefined file name.
3341         That required (or at least encouraged) a lot of cleanup of global
3342         variable usage. We shouldn't be communicating information via
3343         the global name buffer.
3344         * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
3345         * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
3346         required by the above-mentioned cleanup.
3348 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3350         * osint.adb (Find_File): Handle properly a request for a
3351         configuration file whose name is a directory.
3353 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3355         * sem_attr.adb, sem_ch5.adb: Minor reformatting.
3357 2017-04-25  Bob Duff  <duff@adacore.com>
3359         * types.ads: Minor: Fix '???' comment.
3360         * sem_ch8.adb: Minor comment fix.
3362 2017-04-25  Bob Duff  <duff@adacore.com>
3364         * sem_prag.adb: Remove suspicious uses of Name_Buf.
3365         * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
3366         Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
3367         Add String_To_Name with no side effects.
3369 2017-04-25  Justin Squirek  <squirek@adacore.com>
3371         * sem_ch3.adb (Analyze_Declarations): Add
3372         additional condition for edge case.
3374 2017-04-25  Bob Duff  <duff@adacore.com>
3376         * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
3377         reserved words inside pragmas. This is necessary to allow the
3378         pragma name Interface to be used in pragma Ignore_Pragma.
3379         * par.adb: Minor comment fix.
3381 2017-04-25  Javier Miranda  <miranda@adacore.com>
3383         * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
3384         * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
3385         * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
3386         * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
3387         occurrences of RE_Type_Is_Abstract
3389 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3391         * exp_util.adb (Build_Chain): Account for ancestor
3392         subtypes while traversing the derivation chain.
3394 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3396         * sem_attr.adb: minor reformatting.
3398 2017-04-25  Doug Rupp  <rupp@adacore.com>
3400         * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
3402 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3404         * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
3405         the first pass over an assignment statement with target names,
3406         to prevent the generation of subtypes (such as discriminated
3407         record components)that may carry the target name outside of the
3408         tree for the assignment. The subtypes will be generated when
3409         the assignment is reanalyzed in full.
3410         (Analyze_Target_Name): Handle properly class-wide types.
3412 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3414         * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
3415         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3416         the purposes of freezing.
3417         * exp_util.adb Update the documentation and structure of the
3418         type map used in class-wide semantics of assertion expressions.
3419         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3420         and resolve the triaged expression because all substitutions
3421         refer to the proper entities.  Update the replacement of
3422         references.
3423         (Build_DIC_Procedure_Body): Add formal parameter
3424         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3425         are now only processed when freezing occurs.  Build a body only
3426         when one is needed.
3427         (Entity_Hash): Removed.
3428         (Map_Types): New routine.
3429         (Replace_Object_And_Primitive_References): Removed.
3430         (Replace_References): New routine.
3431         (Replace_Type_References): Moved to the library level of Exp_Util.
3432         (Type_Map_Hash): New routine.
3433         (Update_Primitives_Mapping): Update the mapping call.
3434         (Update_Primitives_Mapping_Of_Types): Removed.
3435         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3436         parameter For_Freeze and update the comment on usage.
3437         (Map_Types): New routine.
3438         (Replace_References): New routine.
3439         (Replace_Type_References): Moved to the library level of Exp_Util.
3440         (Update_Primitives_Mapping_Of_Types): Removed.
3441         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3442         properties of the private type to the full view in case the full
3443         view derives from a parent type and inherits a DIC pragma.
3444         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3445         DIC pragma is placed at the top of a declarative region.
3447 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3449         * a-tasatt.adb: Complete previous change and use an unsigned
3450         int to avoid overflow checks.
3452 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3454         * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
3455         the error message when the attribute reference is an actual in
3456         a call to a subprogram inherited from a generic formal type with
3457         unknown discriminants, which makes the subprogram and its formal
3458         parameters intrinsic (see RM 6.3.1 (8) and (13)).
3460 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3462         * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
3463         sem_prag.adb: Minor reformatting.
3465 2017-04-25  Bob Duff  <duff@adacore.com>
3467         * sem_attr.adb (Type_Key): Add code in the
3468         recursive Compute_Type_Key to protect against fetching the source
3469         code for Standard, in case a component of the type is declared
3470         in Standard. There was already code to do this for the original
3471         type, but not for its components.
3473 2017-04-25  Javier Miranda  <miranda@adacore.com>
3475         * exp_ch3.adb (Build_Initialization_Call): Handle
3476         subtypes of private types when searching for the underlying full
3477         view of a private type.
3479 2017-04-25  Javier Miranda  <miranda@adacore.com>
3481         * sem_res.adb (Set_Mixed_Mode_Operand): A universal
3482         real conditional expression can appear in a fixed-type context
3483         and must be resolved with that context to facilitate the code
3484         generation to the backend.
3486 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3488         * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
3489         to indicate whether during inline processing, when some unit U1
3490         appears in the context of a unit U2 compiled for instantiation
3491         or inlining purposes, the body of U1 needs to be compiled as well.
3492         * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
3493         context is a package declaration.
3494         * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
3495         Analyze_Generic_Package_Declaration): ditto.
3496         * inline.adb (Analyze_Inlined_Bodies): Check
3497         Body_Needed_For_Inlining.
3499 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3501         * par.adb (Current_Assign_Node): Global variable use to record
3502         the presence of a target_name in the right hand side of the
3503         assignment being parsed.
3504         * par-ch4.adb (P_Name): If the name is a target_name, mark the
3505         enclosing assignment node accordingly.
3506         * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
3507         appropriately.
3508         * sem_ch5.adb (Analyze_Assignment): Disable expansion before
3509         analyzing RHS if the statement has target_names.
3510         * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
3511         properly choices that are subtype marks.
3512         * exp_ch5.adb: Code cleanup.
3514 2017-04-25  Bob Duff  <duff@adacore.com>
3516         * s-memory.adb: Add a comment regarding efficiency.
3517         * atree.adb: Fix the assertion, and combine 2 assertions into one,
3518         "the source has an extension if and only if the destination does."
3519         * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
3521 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3523         * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
3524         conversion.
3526 2017-04-25  Doug Rupp  <rupp@adacore.com>
3528         * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
3529         handling for ppc64-vx7.
3530         * sigtramp-vxworks-target.inc
3531         [SIGTRAMP_BODY]: Add section for ppc64-vx7.
3533 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3535         * ada_get_targ.adb: New file.
3537 2017-04-25  Bob Duff  <duff@adacore.com>
3539         * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
3540         Direct_Val (Right), instead of the incorrect Direct_Val (Left).
3541         (UI_GCD): Remove ??? comment involving possible efficiency
3542         improvements. This just isn't important after all these years.
3543         Also minor cleanup.
3544         * uintp.ads: Minor cleanup.
3546 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3548         * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
3549         Revert previous changes.
3550         * scng.adb: Minor reformatting.
3551         * s-stratt.ads: Fix unbalanced parens in comment.
3553 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3555         * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
3556         Minor reformatting.
3558 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3560         * scng.adb (Scan): Handle '@' appropriately.
3561         * sem_ch5.adb: Code cleanup.
3563 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3565         * freeze.adb (Check_Expression_Function): Do not check for the
3566         use of deferred constants if the freezing of the expression
3567         function is triggered by its generated body, rather than a
3568         premature use.
3570 2017-04-25  Javier Miranda  <miranda@adacore.com>
3572         * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
3573         subtypes of private types when performing the view conversion.
3575 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3577         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
3578         the purposes of freezing.
3579         * exp_util.adb Update the documentation and structure of the
3580         type map used in class-wide semantics of assertion expressions.
3581         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
3582         and resolve the triaged expression because all substitutions
3583         refer to the proper entities.  Update the replacement of
3584         references.
3585         (Build_DIC_Procedure_Body): Add formal parameter
3586         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
3587         are now only processed when freezing occurs.  Build a body only
3588         when one is needed.
3589         (Entity_Hash): Removed.
3590         (Map_Types): New routine.
3591         (Replace_Object_And_Primitive_References): Removed.
3592         (Replace_References): New routine.
3593         (Replace_Type_References): Moved to the library level of Exp_Util.
3594         (Type_Map_Hash): New routine.
3595         (Update_Primitives_Mapping): Update the mapping call.
3596         (Update_Primitives_Mapping_Of_Types): Removed.
3597         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
3598         parameter For_Freeze and update the comment on usage.
3599         (Map_Types): New routine.
3600         (Replace_References): New routine.
3601         (Replace_Type_References): Moved to the library level of Exp_Util.
3602         (Update_Primitives_Mapping_Of_Types): Removed.
3603         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
3604         properties of the private type to the full view in case the full
3605         view derives from a parent type and inherits a DIC pragma.
3606         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
3607         DIC pragma is placed at the top of a declarative region.
3609 2017-04-25  Tristan Gingold  <gingold@adacore.com>
3611         * s-mmap.ads (Data): Add pragma Inline.
3613 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3615         * checks.adb (Insert_Valid_Check): Do not use
3616         a renaming to alias a volatile name because this will lead to
3617         multiple evaluations of the volatile name. Use a constant to
3618         capture the value instead.
3620 2017-04-25  Doug Rupp  <rupp@adacore.com>
3622         * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
3624 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3626         * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
3627         Add out parameter to indicate to caller that a wrapper must
3628         be constructed for an inherited primitive whose inherited
3629         pre/postcondition has called to overridden primitives.
3630         * freeze.adb (Check_Inherited_Conditions): Build wrapper body
3631         for inherited primitive that requires it.
3632         * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
3633         legal primitive operations and belong to the list of bodies
3634         generated after the freeze point of a type.
3635         * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
3636         of Build_Class_Wide_Expression.
3637         * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
3638         to construct the specification of the wrapper subprogram created
3639         for an inherited operation.
3641 2017-04-25  Bob Duff  <duff@adacore.com>
3643         * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
3644         pthread_mutexattr_setprioceiling): Add new interfaces for these
3645         pthread operations.
3646         * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
3647         protocols as appropriate for Locking_Policy 'C' and 'I'.
3648         * s-taprop-posix.adb: Minor reformatting to make it more similar
3649         to s-taprop-linux.adb.
3651 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3653         * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
3654         Handle properly a multi- level derivation involving both renamed
3655         and constrained parent discriminants, when the type to be
3656         constrained has fewer discriminants that the ultimate ancestor.
3658 2017-04-25  Bob Duff  <duff@adacore.com>
3660         * sem_util.adb (Is_Object_Reference): In the
3661         case of N_Explicit_Dereference, return False if it came from a
3662         conditional expression.
3664 2017-04-25  Bob Duff  <duff@adacore.com>
3666         * par-ch4.adb (P_Case_Expression): If a semicolon
3667         is followed by "when", assume that ";" was meant to be ",".
3669 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3671         * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
3672         fixes.
3674 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3676         * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
3677         loading of an entity.
3678         * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
3679         previously repeated in the analysis.
3680         * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
3681         procedure SPARK_Implicit_Load.  (Analyze_Task_Type_Declaration):
3682         use new procedure SPARK_Implicit_Load.
3683         * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
3684         SPARK_Implicit_Load.
3686 2017-04-25  Javier Miranda  <miranda@adacore.com>
3688         * sem_util.adb (New_Copy_Tree): By default
3689         copying of defining identifiers is prohibited because
3690         this would introduce an entirely new entity into the
3691         tree. This patch introduces an exception to this general
3692         rule: the declaration of constants and variables located in
3693         Expression_With_Action nodes.
3694         (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
3695         (In_Map): New subprogram.
3696         (Visit_Entity): New subprogram.
3697         (Visit_Node): Handle EWA_Level,
3698         EWA_Inner_Scope_Level, and take care of defining entities defined
3699         in Expression_With_Action nodes.
3701 2017-04-25  Thomas Quinot  <quinot@adacore.com>
3703         * exp_ch6.adb: minor comment edit.
3704         * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
3705         procedure specifications that come from source.
3706         * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
3707         Null_Statement attribute.
3708         * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
3709         procedure, generate statement SCO for the generated NULL statement.
3710         * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
3711         parser, if available.
3713 2017-04-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
3715         * system-linux-s390.ads: Use Long_Integer'Size to define
3716         Memory_Size.
3718 2017-04-04  Eric Botcazou  <ebotcazou@adacore.com>
3720         * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
3722 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
3724         * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
3725         * g-socket.adb (To_Host_Entry): Fix typo in comment.
3726         * gnat_ugn.texi: Fix typo.
3727         * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
3728         * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
3729         * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
3730         * sem_util.adb (Mark_Coextensions): Likewise.
3731         * sem_util.ads (Available_Full_View_Of_Component): Likewise.
3733 2017-03-28  Andreas Schwab  <schwab@suse.de>
3735         PR ada/80117
3736         * system-linux-aarch64-ilp32.ads: New file.
3737         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
3738         from LIBGNAT_TARGET_PAIRS.
3739         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
3740         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
3741         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
3742         or -mabi=ilp32, resp.
3744 2017-03-14  James Cowgill  <James.Cowgill@imgtec.com>
3746         * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
3748 2017-03-08  Thanassis Tsiodras  <ttsiodras@gmail.com>
3750         PR ada/79903
3751         * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
3753 2017-03-08  Eric Botcazou  <ebotcazou@adacore.com>
3755         PR ada/79945
3756         * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
3758         * system-linux-arm.ads (Default_Bit_Order): Likewise.
3759         * system-linux-mips.ads (Default_Bit_Order): Likewise.
3760         * system-linux-armeb.ads: Delete.
3761         * system-linux-mipsel.ads: Likewise.
3762         * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
3763         (ARM/Linux): Likewise.
3765 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
3767         PR c/79677
3768         * gcc-interface/misc.c (gnat_handle_option): Pass true to
3769         handle_generated_option GENERATED_P.
3771 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3773         * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
3774         around a justified modular type if it doesn't have the same scalar
3775         storage order as the enclosing record type.
3777 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3779         * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
3780         of boolean rvalues to function calls.
3782 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3784         * gcc-interface/utils.c (fold_bit_position): New function.
3785         (rest_of_record_type_compilation): Call it instead of bit_position to
3786         compute the field position and remove the call to remove_conversions.
3787         (compute_related_constant): Factor out the multiplication in both
3788         operands, if any, and streamline the final test.
3790 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3792         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
3794 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3796         * gcc-interface/decl.c: Include demangle.h.
3797         (is_cplusplus_method): Return again true for a primitive operation
3798         only if it is dispatching.  For a subprogram with an interface name,
3799         call the demangler to get the number of C++ parameters and compare it
3800         with the number of Ada parameters.
3802 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3804         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
3805         there is no end label, put the location of the At_End procedure on
3806         the call to the procedure.
3808 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3810         * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
3811         value for array types with TYPE_INDEX_TYPE set on their domain type.
3812         * gcc-interface/utils.c (max_size): For operations and expressions, do
3813         not build a new node if the operands have not changed or are missing.
3815 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
3817         * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
3818         argument when recursing on TRUTH_NOT_EXPR.
3820 2017-02-12  John Marino  <gnugcc@marino.st>
3822         * system-freebsd-x86.ads: Rename into...
3823         * system-freebsd.ads: ...this.
3824         (Default_Bit_Order): Define using Standard'Default_Bit_Order.
3825         * gcc-interface/Makefile.in: Support aarch64-freebsd.
3826         (x86-64/FreeBSD): Adjust to above renaming.
3827         (i386/FreeBSD): Likewise.
3829 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
3831         * comperr.adb: Update FSF bug reporting URL.
3833 2017-02-01  Eric Botcazou  <ebotcazou@adacore.com>
3834             Jakub Jelinek  <jakub@redhat.com>
3836         PR ada/79309
3837         * adaint.c (__gnat_killprocesstree): Fix broken string handling.
3839 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
3841         PR lto/79061
3842         * gcc-interface/utils.c (get_global_context): Pass main_input_filename
3843         to build_translation_unit_decl.
3845 2017-01-23  Javier Miranda  <miranda@adacore.com>
3847         * sem_util.adb (New_Copy_Tree): Code cleanup:
3848         removal of the internal map (ie. variable Actual_Map, its
3849         associated local variables, and all the code handling it).
3850         * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
3851         force loading of the System package when processing a task type.
3852         (Analyze_Protected_Type_Declaration): in GNATprove mode force
3853         loading of the System package when processing a protected type.
3854         * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
3855         force loading of the System package when processing compilation
3856         unit with a main-like subprogram.
3857         * frontend.adb (Frontend): remove forced loading of the System
3858         package.
3860 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3862         * sem_prag.adb (Default_Initial_Condition): If the desired type
3863         declaration is a derived type declaration with discriminants,
3864         it is rewritten as a private type declaration.
3865         * sem_ch13.adb (Replace_Type_References_Generic,
3866         Visible_Component): A discriminated private type with descriminnts
3867         has components that must be rewritten as selected components
3868         if they appear as identifiers in an aspect expression such as
3869         a Default_Initial_Condition.
3870         * sem_util.adb (Defining_Entity): support N_Iterator_Specification
3871         nodes.
3873 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3875         * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
3876         * gnat1drv.adb Generate an empty object file for an ignored
3877         Ghost compilation unit.
3878         * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
3880 2017-01-23  Yannick Moy  <moy@adacore.com>
3882         * sem_ch4.adb (Analyze_Indexed_Component_Form):
3883         Adapt to inlined prefix with string literal subtype.
3884         * inline.adb (Expand_Inlined_Call): Keep unchecked
3885         conversion inside inlined call when formal type is constrained.
3887 2017-01-23  Javier Miranda  <miranda@adacore.com>
3889         * sem_util.adb (New_Copy_Tree): Code cleanup:
3890         removal of global variables. All the global variables, global
3891         functions and tables of this subprogram are now declared locally.
3893 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
3895         * exp_strm.ads: Minor reformatting and typo fixes.
3897 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3899         * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
3900         exp_aggr.adb: Minor reformatting.
3901         * g-diopit.adb: minor grammar/punctuation fix in comment.
3902         * g-byorma.ads: minor fix of unbalanced parens in comment.
3904 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3906         * par.adb: Update the documentation of component Labl.
3907         * par-ch6.adb (P_Return_Statement): Set the expected label of
3908         an extended return statement to Error.
3910 2017-01-23  Tristan Gingold  <gingold@adacore.com>
3912         * s-boustr.ads, s-boustr.adb (Is_Full): New function.
3914 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3916         * expander.adb: Handle N_Delta_Aggregate.
3918 2017-01-23  Javier Miranda  <miranda@adacore.com>
3920         * exp_ch6.adb (Expand_Call): Improve the code that
3921         checks if some formal of the called subprogram is a class-wide
3922         interface, to handle subtypes of class-wide interfaces.
3924 2017-01-23  Javier Miranda  <miranda@adacore.com>
3926         * checks.adb (Apply_Parameter_Aliasing_Checks):
3927         Remove side effects of the actuals before generating the overlap
3928         check.
3930 2017-01-23  Justin Squirek  <squirek@adacore.com>
3932         * exp_strm.ads, exp_strm.ads
3933         (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
3934         as to avoid getting the underlying type by default.
3935         * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
3936         underlying type in the Iiput and output attribute cases when
3937         building their respective functions.
3939 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
3941         * scng.adb: Minor reformatting of error message.
3943 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3945         * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
3946         to freeze the return type of an expression funxtion that is a
3947         completion, if the type is a limited view and the non-limited
3948         view is available.
3950 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
3952         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
3953         aggregate construct.
3954         (P_Record_Or_Array_Component_Association): An array aggregate
3955         can start with an Iterated_Component_Association.
3956         * scng.adb: Modify error message on improper use of @ in earlier
3957         versions of the language.
3958         * sinfo.ads: New node kind N_Delta_Aggregate.
3959         * sinfo.adb: An N_Delta_Aggregate has component associations and
3960         an expression.
3961         * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
3962         * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
3963         Create a new index for each one of the choices in the association,
3964         to prevent spurious homonyms in the scope.
3965         (Resolve_Delta_Aggregate): New.
3966         * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
3967         * exp_util.adb (Insert_Actions): Take into account
3968         N_Delta_Aggregate.
3969         * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
3970         * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
3971         and local procedures Expand_Delta_Array_Aggregate and
3972         expand_Delta_Record_Aggregate.
3973         * sprint.adb: Handle N_Delta_Aggregate.
3975 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3977         * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
3978         empty name when the exception declaration is subject to pragma
3979         Discard_Names.
3980         (Null_String): New routine.
3982 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3984         * par-ch9.adb (P_Protected_Definition): Parse
3985         any optional and potentially illegal pragmas which appear in
3986         a protected operation declaration list.
3987         (P_Task_Items): Parse
3988         any optional and potentially illegal pragmas which appear in a
3989         task item list.
3991 2017-01-23  Pascal Obry  <obry@adacore.com>
3993         * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
3994         is needed when a foreign thread call a Win32 API using a thread handle
3995         like GetThreadTimes() for example.
3997 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
3999         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4000         allow an 'Address clause to be specified on a prefix of a
4001         class-wide type.
4003 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4005         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4006         attribute 'Valid is a renaming of the original expression when
4007         the expression denotes a name. For all other kinds of expression,
4008         use a constant to capture the value.
4009         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4010         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4012 2017-01-23  Justin Squirek  <squirek@adacore.com>
4014         * sem_eval.adb (Eval_Integer_Literal): Add special
4015         case to avoid optimizing out check if the literal appears in
4016         an if-expression.
4018 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4020         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
4021         allow an 'Address clause to be specified on a prefix of a
4022         class-wide type.
4024 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4026         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
4027         attribute 'Valid is a renaming of the original expression when
4028         the expression denotes a name. For all other kinds of expression,
4029         use a constant to capture the value.
4030         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
4031         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
4033 2017-01-23  Justin Squirek  <squirek@adacore.com>
4035         * sem_eval.adb (Eval_Integer_Literal): Add special
4036         case to avoid optimizing out check if the literal appears in
4037         an if-expression.
4039 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4041         * sem_ch4.adb (Try_Primitive_Operations,
4042         Is_Valid_First_Argument_Of): argument is valid if it is a derived
4043         type with unknown discriminants that matches its underlying
4044         record view.
4045         * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
4046         expression if its type is derived from a limited type with
4047         unknown discriminants, because the expansion (which is a call)
4048         must be expanded in the enclosing context to add the proper build-
4049         in-place parameters to the call.
4050         * lib.ads, exp_ch9.adb: Minor fixes in comments.
4052 2017-01-23  Yannick Moy  <moy@adacore.com>
4054         * frontend.adb (Frontend): Do not load runtime
4055         unit for GNATprove when parsing failed.
4056         * exp_ch9.adb: minor removal of extra whitespace
4057         * exp_ch6.adb: minor typo in comment
4058         * sem_util.adb: Code cleanup.
4059         * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
4060         * a-ngcefu.adb: minor style fix in whitespace
4062 2017-01-23  Thomas Quinot  <quinot@adacore.com>
4064         * scos.ads: Document usage of 'd' as default SCO kind for
4065         declarations.
4066         * par_sco.adb (Traverse_Declarations_Or_Statements.
4067         Traverse_Degenerate_Subprogram): New supporting routine for expression
4068         functions and null procedures.
4069         (Traverse_Declarations_Or_Statements.Traverse_One): Add
4070         N_Expression_Function to the subprogram case; add required
4071         support for null procedures and expression functions.
4073 2017-01-23  Bob Duff  <duff@adacore.com>
4075         * namet.ads (Bounded_String): Decrease the size of type
4076         Bounded_String to avoid running out of stack space.
4077         * namet.ads (Append): Don't ignore buffer overflow; raise
4078         Program_Error instead.
4080 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4082         * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
4083         sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
4084         reformatting.
4085         * exp_ch9.adb: minor style fix in comment.
4087 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4089         * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
4090         for a limited record extension with unknown discriminants whose
4091         full view has no discriminants.
4093 2017-01-23  Yannick Moy  <moy@adacore.com>
4095         * exp_spark.adb: Alphabetize with clauses.
4097 2017-01-23  Yannick Moy  <moy@adacore.com>
4099         * sem_util.adb (Has_Enabled_Property): Treat
4100         protected objects and variables differently from other variables.
4102 2017-01-23  Thomas Quinot  <quinot@adacore.com>
4104         * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
4105         Split original Ada 95 part off into new subprogram
4106         below. Call that subprogram (instead of proceeding with
4107         AI95-0133 behaviour) if debug switch -gnatd.p is in use.
4108         (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
4109         * debug.adb Document new switch -gnatd.p
4110         * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
4111         record for reverse bit order if an error has already been posted
4112         on the record type.  This avoids generating extraneous "info:"
4113         messages for illegal code.
4115 2017-01-23  Justin Squirek  <squirek@adacore.com>
4117         * sem_ch3.adb (Analyze_Declarations): Correct comments
4118         * freeze.adb (Find_Constant): Add detection of deferred constants
4119         so they are not incorrectly flagged as premature.
4121 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4123         * scans.ads: New token At_Sign. Remove '@' from list of illegal
4124         characters for future version of the language. '@' is legal name.
4125         * scng.ads, scng.adb (Scan):  Handle '@' appropriately.
4126         * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
4127         denotes a Target_Name.
4128         * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
4129         * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
4130         (Has_Target_Names): New flag on N_Assignment_Statement, to
4131         indicate that RHS has occurrences of N_Target_Name.
4132         * sem.adb: Call Analyze_Target_Name.
4133         * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
4134         (urrent_LHS): Global variable that denotes LHS of assignment,
4135         used in the analysis of Target_Name nodes.
4136         * sem_res.adb (Resolve_Target_Name): New procedure.
4137         * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
4138         N is an assignment statement whose RHS contains occurences of @
4139         that designate the value of the LHS of the assignment. If the
4140         LHS is side-effect free the target names can be replaced with
4141         a copy of the LHS; otherwise the semantics of the assignment
4142         is described in terms of a procedure with an in-out parameter,
4143         and expanded as such.
4144         (Expand_N_Assignment_Statement): Call
4145         Expand_Assign_With_Target_Names when needed.
4146         * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
4147         * sprint.adb: Handle N_Target_Name.
4149 2017-01-23  Eric Botcazou  <ebotcazou@adacore.com>
4151         * checks.adb: Minor fix in comment.
4153 2017-01-23  Philippe Gil  <gil@adacore.com>
4155         * g-debpoo.adb (Do_Report) remove freed chunks from chunks
4156         count in Sort = Memory_Usage or Allocations_Count
4158 2017-01-23  Justin Squirek  <squirek@adacore.com>
4160         * sem_ch3.adb: Code cleanup.
4162 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4164         * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
4165         variables to the local variable section. Update the profile
4166         of various nested routine that previously had visibility
4167         of those globals. One the matching phase has completed,
4168         remove certain classes of clauses which are considered noise.
4169         (Check_Dependency_Clause): Properly detect a match between two
4170         'Result attributes. Update the various post-match cases to use
4171         Is_Already_Matched as this routine now automatically recognizes
4172         a previously matched 'Result attribute.
4173         (Is_Already_Matched): New routine.
4174         (Remove_Extra_Clauses): New routine.
4175         (Report_Extra_Clauses): Remove the detection of ... => null
4176         clauses as this is now done in Remove_Extra_Clauses.
4178 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4180         * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
4181         report on spurious overlaps between values involving a subtype
4182         with a static predicate, because the expansion of such a subtype
4183         into individual ranges in inhibited in ASIS mode.
4185 2017-01-23  Justin Squirek  <squirek@adacore.com>
4187         * sem_ch3.adb (Analyze_Declarations): Add detection
4188         of an edge case and delay freezing if it is present.
4190 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4192         * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
4193         sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
4195 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4197         * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
4198         access-to-subprogram types inherit the convention of the
4199         associated subprogram.  (Set_Profile_Convention): New routine.
4200         * sem_ch6.adb (Check_Conformance): Do not compare the conventions
4201         of the two entities directly, use Conventions_Match to account
4202         for anonymous access-to-subprogram and subprogram types.
4203         (Conventions_Match): New routine.
4205 2017-01-23  Claire Dross  <dross@adacore.com>
4207         * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
4208         which return Universal_Integer, force the overflow check flag for
4209         Length and Range_Length for types as big as Long_Long_Integer.
4211 2017-01-23  Claire Dross  <dross@adacore.com>
4213         * exp_spark.adb (Expand_SPARK_Attribute_Reference):  For
4214         attributes which return Universal_Integer, introduce a conversion
4215         to the expected type with the appropriate check flags set.
4216         * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
4217         base type if the range is null. It may still be invalid if it
4218         is higher than the lower bound. This is checked later in the
4219         context in which the range appears.
4221 2017-01-23  Pierre-Marie de Rodat  <derodat@adacore.com>
4223         * scos.ads: Introduce a constant to represent ignored
4224         dependencies in SCO_Unit_Table_Entry.
4226 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4228         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
4229         spaces from error messages.
4231 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4233         * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
4234         subsidiary to Expand_N_Object_ Declaration, to compute a guard on
4235         an object declaration for an array type with a modular index type
4236         with the size of Long_Long_Integer. Special processing is needed
4237         in this case to compute reliably the size of the object, and
4238         eventually  to raise Storage_Error, when wrap-around arithmetic
4239         might compute a meangingless size for the object.
4241 2017-01-23  Justin Squirek  <squirek@adacore.com>
4243         * a-wtenau.adb, par-endh.adb, sem_prag.adb,
4244         sem_type.adb: Code cleanups.
4246 2017-01-23  Bob Duff  <duff@adacore.com>
4248         * sem_res.adb (Resolve_Call): In the part of the code where
4249         it is deciding whether to turn the call into an indexed
4250         component, avoid doing so if the call is to an instance of
4251         Unchecked_Conversion. Otherwise, the compiler turns it into an
4252         indexed component, and resolution of that turns it back into a
4253         function call, and so on, resulting in infinite recursion.
4254         * sem_util.adb (Needs_One_Actual): If the first formal has a
4255         default, then return False.
4257 2017-01-21  Eric Botcazou  <ebotcazou@adacore.com>
4259         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
4260         optimizations when the type is modular and the offsets are equal.
4262 2017-01-20  Thomas Quinot  <quinot@adacore.com>
4264         * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
4265         message.
4267 2017-01-20  Nicolas Roche  <roche@adacore.com>
4269         * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
4271 2017-01-20  Bob Duff  <duff@adacore.com>
4273         * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
4274         (etc) optimizations when the type is modular.
4276 2017-01-20  Yannick Moy  <moy@adacore.com>
4278         * sem_ch6.adb (Move_Pragmas): move some pragmas,
4279         but copy the SPARK_Mode pragma instead of moving it.
4280         (Build_Subprogram_Declaration): Ensure that the generated spec
4281         and original body share the same SPARK_Pragma aspect/pragma.
4282         * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
4283         procedure to copy SPARK_Mode aspect.
4285 2017-01-20  Bob Duff  <duff@adacore.com>
4287         * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
4288         even in ASIS mode.
4289         * sem_ch13.adb (Resolve_Name): Enable setting the entity to
4290         Empty even in ASIS mode.
4292 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4294         * exp_ch9.adb: minor style fixes in comments.
4295         * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
4296         relative statement introduces an implicit dependency on
4297         Ada.Real_Time.Clock_Time.
4298         * sem_util.adb: Minor reformatting.
4300 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4302         * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
4303         must be treated as delayed aspect even if the expression is
4304         a literal, because the aspect affects the freezing and the
4305         elaboration of the object to which it applies.
4307 2017-01-20  Tristan Gingold  <gingold@adacore.com>
4309         * s-osinte-vxworks.ads (Interrup_Range): New subtype.
4311 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4313         * lib-xref.adb (Generate_Reference): Do not warn about the
4314         presence of a pragma Unreferenced if the entity appears as the
4315         actual in a procedure call that does not come from source.
4317 2017-01-20  Pascal Obry  <obry@adacore.com>
4319         * expect.c, terminals.c: Fix some warnings about unused variables.
4320         * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
4321         of the runtime.
4323 2017-01-20  Bob Duff  <duff@adacore.com>
4325         * exp_attr.adb (Constrained): Apply an access check (check that
4326         the prefix is not null) when the prefix denotes an object of an
4327         access type; that is, when there is an implicit dereference.
4329 2017-01-20  Gary Dismukes  <dismukes@adacore.com>
4331         * s-rident.ads (constant Profile_Info): Remove
4332         No_Calendar from GNAT_Extended_Ravenscar restrictions.
4334 2017-01-20  Tristan Gingold  <gingold@adacore.com>
4336         *  s-maccod.ads: Add pragma No_Elaboration_Code_All
4338 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4340         * ghost.adb (Mark_Ghost_Clause): New routine.
4341         (Prune_Node): Do not prune compilation unit nodes.
4342         (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
4343         This does not touch the node itself, but does prune all its fields.
4344         * ghost.ads (Mark_Ghost_Clause): New routine.
4345         * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
4346         package clause mentions Ghost and non-Ghost packages. Mark a
4347         use package clause as Ghost when it mentions a Ghost package.
4348         (Analyze_Use_Type): Emit an error when a use type clause mentions
4349         Ghost and non-Ghost types. Mark a use type clause as Ghost when
4350         it mentions a Ghost type.
4351         * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
4352         Ghost when it withs a Ghost unit.
4354 2017-01-20  Javier Miranda  <miranda@adacore.com>
4356         * sem_res.adb (Resolve_Call): If a function call
4357         returns a limited view of a type and at the point of the call the
4358         function is not declared in the extended main unit then replace
4359         it with the non-limited view, which must be available. If the
4360         called function is in the extended main unit then no action is
4361         needed since the back-end handles this case.
4363 2017-01-20  Eric Botcazou  <ebotcazou@adacore.com>
4365         * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
4366         (Contains_Subprograms_Refs): ...this.  Adjust comment
4367         for constants.  (Is_Subp_Or_Const_Ref): Rename into...
4368         (Is_Subprogram_Ref): ...this.
4369         (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
4370         Has_Non_Subprograms_Referencer and adjust comment.  Remove
4371         incorrect shortcut for package declarations and bodies.
4373 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4375         * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
4376         base type differs from that of the completion and the private
4377         subtype is an itype (created for a constraint on an access
4378         type e.g.), set Delayed_Freeze on both to prevent out-of-scope
4379         anomalies in gigi.
4381 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4383         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4384         When inheriting the SPARK_Mode of a prior expression function,
4385         look at the properly resolved entity rather than the initial
4386         candidate which may denote a homonym.
4388 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4390         * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
4391         Precondition or Postcondition, and the context is pragma
4392         Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
4393         and suggest the standard names Assertion_Policy /Pre /Post
4394         instead.
4396 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4398         * sem_ch10.adb, sem_cat.adb: Minor reformatting.
4400 2017-01-20  Javier Miranda  <miranda@adacore.com>
4402         * sem_ch3.adb (Access_Type_Declaration): Protect access to the
4403         Entity attribute.
4404         * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
4405         * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
4406         malformed trees.
4408 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4410         * sem_ch13.adb (Analyze_Aspect_Specification, case
4411         Dynamic_Predicate): If the entity E is a subtype that inherits
4412         a static predicate for its parent P,, the inherited and the
4413         new predicate combine in the generated predicate function,
4414         and E only has a dynamic predicate.
4416 2017-01-20  Tristan Gingold  <gingold@adacore.com>
4418         * s-boustr.ads, s-boustr.adb: New package.
4419         * Makefile.rtl: Add s-boustr.
4421 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4423         * inline.adb (Process_Formals): Qualify the
4424         expression of a return statement when it yields a universal type.
4426 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4428         * freeze.adb (Freeze_All): Freeze the default
4429         expressions of all eligible formal parameters that appear in
4430         entries, entry families, and protected subprograms.
4432 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4434         * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
4435         for illegal inherited Implicit_Dereference aspects with renamed
4436         discriminants.
4438 2017-01-20  Javier Miranda  <miranda@adacore.com>
4440         * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
4441         * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
4442         * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
4443         (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
4444         Set_Prev, Tree_Read): Adding assertion.
4445         * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
4446         * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
4447         (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
4448         Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
4449         Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
4450         Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
4451         Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
4452         Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
4453         Set_ListN_With_Parent): Adding assertion.
4455 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4457         * sem_prag.adb (Process_Convention): Diagnose properly a pragma
4458         import that applies to several homograph subprograms. when one
4459         of them is declared by a subprogram body.
4461 2017-01-20  Justin Squirek  <squirek@adacore.com>
4463         * exp_ch6.adb (Expand_Call): Remove optimization
4464         that nulls out calls to null procedures.
4466 2017-01-20  Yannick Moy  <moy@adacore.com>
4468         * inline.adb (Expand_Inlined_Call): Keep more
4469         precise type of actual for inlining whenever possible. In
4470         particular, do not switch to the formal type in GNATprove mode in
4471         some case where the GNAT backend might require it for visibility.
4473 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4475         * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
4476         aspect Implicit_Dereference can be inherited by a full view if
4477         the partial view has no discriminants, because there is no way
4478         to apply the aspect to the partial view.
4479         (Build_Derived_Record_Type): If derived type renames discriminants
4480         of the parent, the new discriminant inherits the aspect from
4481         the old one.
4482         * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
4483         call through an access discriminant designating a subprogram.
4484         * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
4485         properly a parameterless call through an access discriminant on
4486         the left-hand side of an assignment.
4487         * sem_res.adb (resolve): If an interpreation involves a
4488         discriminant with an implicit dereference and the expression is an
4489         entity, resolution takes place later in the appropriate routine.
4490         * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
4491         access discriminants that designate a subprogram type.
4493 2017-01-20  Pascal Obry  <obry@adacore.com>
4495         * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
4497 2017-01-20  Yannick Moy  <moy@adacore.com>
4499         * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
4500         on implicitly with'ed units in GNATprove mode.
4501         * sinfo.ads (Implicit_With): Document use of flag for implicitly
4502         with'ed units in GNATprove mode.
4504 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
4506         * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
4507         unit Do not report an error on a non-static entity that appears
4508         in the context of a spec expression, such as an aspect expression.
4510 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
4512         * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
4513         (Is_Underlying_Full_View): New routine.
4514         (Set_Is_Underlying_Full_View): New routine.
4515         (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
4516         * einfo.ads Add new attribute Is_Underlying_Full_View.
4517         (Is_Underlying_Full_View): New routine along with pragma Inline.
4518         (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
4519         * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
4520         class-wide types and underlying full views. The first subtype
4521         is used as the working type for all Itypes, not just array base types.
4522         (Build_DIC_Procedure_Declaration): Do not consider
4523         class-wide types and underlying full views. The first subtype
4524         is used as the working type for all Itypes, not just array
4525         base types.
4526         * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
4527         view or an underlying full view without clobbering the attributes
4528         of a previous freeze node.
4529         (Inherit_Freeze_Node): New routine.
4530         * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
4531         full view as such.
4532         (Build_Underlying_Full_View): Mark an underlying full view as such.
4533         * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
4534         full view as such.
4536 2017-01-20  Yannick Moy  <moy@adacore.com>
4538         * sinfo.ads: Document lack of Do_Division_Check flag
4539         on float exponentiation.
4541 2017-01-19  Javier Miranda  <miranda@adacore.com>
4543         * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
4544         identifier attribute of a block-statement node. Required to avoid
4545         assertion failure when building the new containers library.
4547 2017-01-19  Bob Duff  <duff@adacore.com>
4549         * exp_ch3.adb: Update comment.
4551 2017-01-19  Vincent Celier  <celier@adacore.com>
4553         * gprep.adb (Gnatprep): Parse the definition file without
4554         "replace in comments" even when switch -C is used.
4556 2017-01-19  Justin Squirek  <squirek@adacore.com>
4558         * exp_ch9.adb (Is_Pure_Barrier): Create function
4559         Is_Count_Attribute to identify an expansion of the 'Count
4560         attribute.
4562 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4564         * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
4565         statements within an element iterator loop are only analyzed
4566         agter the loop is rewritten. Within a generic the analysis must
4567         be performed in any case to complete name capture.
4569 2017-01-19  Bob Duff  <duff@adacore.com>
4571         * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
4572         before checking for unrecognized pragmas.
4573         Initialize Pname on its declarations; that's always good style.
4575 2017-01-19  Claire Dross  <dross@adacore.com>
4577         * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
4578         body into the tree for GNATprove by setting its Parent field. The
4579         components invariants of composite types are not checked by
4580         the composite type's invariant procedure in GNATprove mode.
4581         (Build_Invariant_Procedure_Declaration): Semi-insert the
4582         declaration into the tree for GNATprove by setting its Parent
4583         field.
4584         * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
4585         the component invariants to the array type  invariant procedure
4586         so that the procedure can be used to  check the array type
4587         invariants if any.
4588         (Freeze_Record_Type): In GNATprove mode, do
4589         not add the component invariants to the record type  invariant
4590         procedure so that the procedure can be used to  check the record
4591         type invariants if any.
4593 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4595         * lib-xref-spark_specific.adb: Minor reformatting.
4596         * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
4598 2017-01-19  Javier Miranda  <miranda@adacore.com>
4600         * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
4601         Build_Back_End_Aggregate.
4602         (Generate_Aggregate_For_Derived_Type): Code cleanup.
4603         (Prepend_Stored_Values): Code cleanup.
4605 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4607         * sem_ch6.adb (Analyze_Expression_Function): Check for an
4608         incomplete return type after attempting to freeze it, so that
4609         other freeze actiona are generated in the proper order.
4611 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4613         * sem_aggr.adb (Resolve_Aggregate): If the type is a string
4614         type, ie. a type whose component is a character type, and the
4615         aggregate is positional, do not convert into a string literal
4616         if the index type is not an integer type, because the original
4617         type may be required in an enclosing operation.
4619 2017-01-19  Bob Duff  <duff@adacore.com>
4621         * binde.adb, debug.adb: Enable new elaboration order algorithm
4622         by default. -dp switch reverts to the old algorithm.
4624 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4626         * sem_ch3.adb Add with and use clauses for Exp_Ch7.
4627         (Analyze_Declarations): Create the DIC and Invariant
4628         procedure bodies s after all freezing has taken place.
4629         (Build_Assertion_Bodies): New routine.
4630         * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
4631         and Exp_Util.
4632         (Analyze_Package_Specification): Remove the
4633         generation of the DIC and Invariant procedure bodies. This is
4634         now done by Analyze_Declarations.
4635         * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
4636         procedures are never treated as primitives.
4638 2017-01-19  Yannick Moy  <moy@adacore.com>
4640         * frontend.adb: Analyze inlined bodies and check elaboration
4641         rules in GNATprove mode too.
4642         * sem_elab.adb (Delay_Element): Add Boolean component to save
4643         indication that call is in SPARK code.  (Check_Elab_Calls):
4644         Check elaboration rules in GNATprove mode, and correctly set
4645         the current value of SPARK_Mode.
4646         * lib-xref-spark_specific.adb
4647         (Add_SPARK_Xrefs): Simplify iteration over dereferences.
4649 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4651         * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
4652         checks on the expression for the high bound of concatenation
4653         when checks are disabled, to suppress warnings about potential
4654         constraint errors in restricted runtimes.
4656 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4658         * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
4659         representation-to-position function as inlined.
4660         * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
4661         the purity of an internally generated entity if it has been
4662         explicitly marked as pure for optimization purposes.
4663         * exp_aggr.adb: Minor reformatting.
4665 2017-01-19  Javier Miranda  <miranda@adacore.com>
4667         * exp_ch6.adb (Expand_Call): Remove side effects on
4668         actuals that are allocators with qualified expression since the
4669         initialization of the object is performed by means of individual
4670         statements (and hence it must be done before the call).
4672 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4674         * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
4675         (Build_Derived_Enumeration_Type): If the derived type inherits a
4676         dynamic predicate from its parent, the bounds of the type must
4677         freeze because an explicit constraint is constructed for the
4678         type and the corresponding range is elaborated now.
4680 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
4682         * sem_attr.ads: minor fix of inconsistent casing in comment
4683         * lib-writ.ads: minor align comments in columns
4684         * sem_ch3.adb: Minor reformatting.
4685         * spark_xrefs.ads: minor fix typo in SPARK-related comment
4686         * table.ads: minor style fix in comment
4687         * lib-xref-spark_specific.adb
4688         (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
4689         * sem_ch12.adb: minor whitespace fix
4690         * freeze.adb: Add comment.
4691         * sem_util.adb (Unique_Name): for instances of
4692         generic subprograms ignore the name of the wrapper package.
4694 2017-01-19  Javier Miranda  <miranda@adacore.com>
4696         * exp_aggr.adb (Resolve_Record_Aggregate):
4697         Factorize code needed for aggregates of limited and unlimited
4698         types in a new routine.
4699         (Pass_Aggregate_To_Back_End): New subprogram.
4701 2017-01-19  Yannick Moy  <moy@adacore.com>
4703         * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
4705 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4707         * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
4708         public, for use elsewhere.
4709         * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
4710         an Inlined_body, recognize a call that uses object notation
4711         and has not been rewritten as a regular call because regular
4712         expansion has not taken place.
4714 2017-01-19  Bob Duff  <duff@adacore.com>
4716         * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
4717         in case of generic formal discrete types, because it causes crashes in
4718         the compiler when built with assertions on.
4720 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4722         * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
4723         sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
4725 2017-01-19  Bob Duff  <duff@adacore.com>
4727         * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
4728         Increment Warnings_Detected.  It was decrementing, which is
4729         wrong since we just issued a warning message.
4730         * binderr.ads (Errors_Detected, Warnings_Detected): Declare
4731         these variables to be of subtype Nat instead of Int, because
4732         they should never be negative.
4734 2017-01-19  Javier Miranda  <miranda@adacore.com>
4736         * contracts.adb (Build_Postconditions_Procedure): Replace
4737         Generate_C_Code by Modify_Tree_For_C.
4738         * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
4739         Replace Generate_C_Code by Modify_Tree_For_C.
4740         * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
4741         Modify_Tree_For_C.
4742         * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
4743         Generate_C_Code by Modify_Tree_For_C.
4744         * exp_ch4.adb (Expand_Allocator_Expression): Replace
4745         Generate_C_Code by Modify_Tree_For_C.
4746         * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
4747         by Modify_Tree_For_C.
4748         * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
4749         Generate_C_Code by Modify_Tree_For_C.
4750         * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
4751         by Modify_Tree_For_C.
4752         * sinfo.ads (Modify_Tree_For_C): Adding documentation.
4754 2017-01-19  Javier Miranda  <miranda@adacore.com>
4756         * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
4757         subprogram.
4758         (Is_Inlinable_Expression_Function): New subprogram.
4759         * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
4760         to Sem_Util.
4761         (Is_Inlinable_Expression_Function): Moved to Sem_Util.
4763 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4765         * sem_ch4.adb (Diagnose_Call): Improve error message when a
4766         selected component has a prefix that might be interpreted
4767         as a parameterless function call, but none of the candidate
4768         interpretations is parameterless, and there is a hidden homonym
4769         of the prefix that is a package.
4770         * sem_ch8.adb (Find_Selected_Component): If the prefix might be
4771         interpreted as a parameterless function call and its analysis
4772         fails, do not call Analyze_Selected_Component.
4774 2017-01-19  Steve Baird  <baird@adacore.com>
4776         * sem_util.ads: Add new Use_Full_View Boolean parameter to
4777         Get_Index_Bounds.
4778         * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
4779         calls to a newly-defined Scalar_Range_Of_Right_View function.
4781 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
4783         * gnat1drv.adb: minor fix of unbalanced parens in comment
4784         * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
4785         to visible part of the package to allow re-use in GNATprove.
4786         * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
4787         from repeated code of Traverse_Compilation_Unit.
4788         (Traverse_Declaration_Or_Statement): fixed detection of
4789         generic subprograms and packages; also, iteration over case
4790         statement alternatives rewritten to avoid testing if the first
4791         alternative is present (since it must be present due to Ada
4792         syntax restrictions).
4794 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
4796         * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
4797         returning by reference not just for subprogram body stubs,
4798         but for all subprogram cases.
4799         * sem_util.adb: Code reformatting.
4800         (Requires_Transient_Scope): Update the call to Results_Differ.
4801         (Results_Differ): Update the parameter profile and the associated
4802         comment on usage.
4804 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
4806         * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
4807         identifier nodes that do not come from source, to handle properly
4808         dimensionality check within an inlined body which inclddes both
4809         original operands and rewritten operands. This removes spurious
4810         dimensionality errors in the presence of front-end inlining,
4811         as well as in SPARK mode.
4813 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
4815         PR driver/49726
4816         * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
4818 2017-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4820         * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
4822 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
4824         * doc/gnat_ugn/getting_started_with_gnat.rst,
4825         doc/gnat_ugn/inline_assembler.rst,
4826         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4827         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
4828         doc/gnat_ugn/about_this_guide.rst,
4829         doc/gnat_ugn/platform_specific_information.rst,
4830         doc/gnat_ugn/example_of_binder_output.rst,
4831         doc/gnat_ugn/gnat_and_program_execution.rst,
4832         doc/gnat_ugn/gnat_utility_programs.rst,
4833         doc/gnat_ugn/the_gnat_compilation_model.rst,
4834         doc/gnat_rm/implementation_defined_attributes.rst,
4835         doc/gnat_rm/compatibility_and_porting_guide.rst,
4836         doc/gnat_rm/standard_library_routines.rst,
4837         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
4838         doc/gnat_rm/implementation_defined_pragmas.rst,
4839         doc/gnat_rm/the_gnat_library.rst,
4840         doc/gnat_rm/obsolescent_features.rst,
4841         doc/gnat_rm/about_this_guide.rst,
4842         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
4843         doc/gnat_rm/implementation_of_ada_2012_features.rst,
4844         doc/gnat_rm/interfacing_to_other_languages.rst,
4845         doc/gnat_rm/implementation_defined_aspects.rst,
4846         doc/gnat_rm.rst: Update documentation.
4847         * gnat_rm.texi, gnat_ugn.texi: Regenerated.
4849 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
4851         * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
4852         * scil_ll.adb: Minor style fix in comment.
4853         * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
4854         even if entity is already set, because the node may be renalyzed
4855         after inlining transformations.
4857 2017-01-13  Javier Miranda  <miranda@adacore.com>
4859         * sem_res.adb (Resolve_Call): Do not establish a transient scope
4860         for a call to inlinable expression function (since the call will
4861         be replaced by its returned object).
4862         * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
4863         * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
4864         (Expand_Call): For inlinable expression function call replace the
4865         call by its returned object.
4866         (Is_Inlinable_Expression_Function): New subprogram.
4868 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
4870         * checks.adb: Minor typo fix and reformatting.
4872 2017-01-13  Javier Miranda  <miranda@adacore.com>
4874         * contracts.adb (Contract_Only_Subprograms): Remove formal.
4875         (Copy_Original_Specification): Removed.
4876         (Skip_Contract_Only_Subprogram): Move here checks previously
4877         located in the caller of this routine (to leave the code more clean).
4878         (Build_Contract_Only_Subprogram): Code cleanup.
4879         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
4880         (Get_Contract_Only_Missing_Body_Name): Removed.
4882 2017-01-13  Javier Miranda  <miranda@adacore.com>
4884         * sem_ch6.adb (Cloned_Expression): New subprogram.
4885         (Freeze_Expr_Types): Complete previous patch since the expression
4886         of an expression-function may have iterators and loops with
4887         defining identifiers which, as part of the preanalysis of the
4888         expression, may be left decorated with itypes that will not be
4889         available in the tree passed to the backend.
4891 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
4893         * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
4894         conversion to Integer of an expression that is an attribute
4895         reference 'Pos on an enumeration type.
4897 2017-01-13  Bob Duff  <duff@adacore.com>
4899         * atree.ads: Minor comment fix.
4901 2017-01-13  Justin Squirek  <squirek@adacore.com>
4903         * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
4904         calls in accessibility check on return statement.
4906 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
4908         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4909         Ensure that the input body is a subprogram body before trying to
4910         determine whether it denoted an expression function.  Note that
4911         subprogram body stubs cannot denote expression functions.
4913 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
4915         * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
4916         and typo fixes.
4918 2017-01-13  Javier Miranda  <miranda@adacore.com>
4920         * einfo.ads (Component_Bit_Offset): Fix documentation.
4921         * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
4922         on record holes for components with unknown compile-time offsets.
4924 2017-01-13  Bob Duff  <duff@adacore.com>
4926         * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
4927         * g-locfil.ads: Minor comment fix.
4929 2017-01-13  Bob Duff  <duff@adacore.com>
4931         * binde.adb (Elab_New): New elaboration order algorithm
4932         that is expected to cause fewer ABE issues. This is a work in
4933         progress. The new algorithm is currently disabled, and can be
4934         enable by the -dp switch, or by modifying the Do_Old and Do_New
4935         etc. flags and rebuilding. Experimental code is included to
4936         compare the results of the old and new algorithms.
4937         * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
4938         can have multiple of these tables, so the old and new algorithms
4939         can coexist.
4940         * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
4941         parameter of type array. This avoids the global variable, and
4942         allows bounds checking (which is normally defeated by the tables
4943         packages). It also ensures that the Elab_Order is read-only
4944         to Bindgen.
4945         * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
4946         subprograms that need it, as above.
4947         * debug.adb: Document new -dp switch. Modify doc of old -do
4948         switch.
4949         * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
4950         and Bindgen.  Move writing of closure (-R and -Ra switches)
4951         to Binde; that's more convenient.
4953 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
4955         * sem_ch6.adb (Analyze_Expression_Function): If the expression
4956         function is a completion, all entities referenced in the
4957         expression are frozen. As a consequence, a reference to an
4958         uncompleted private type from an enclosing scope is illegal.
4960 2017-01-13  Javier Miranda  <miranda@adacore.com>
4962         * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
4963         (Analyze_Subprogram_Body_Helper): At the occurrence of an
4964         expression function declaration that is a completion, its
4965         expression causes freezing (AI12-0103).
4967 2017-01-13  Vadim Godunko  <godunko@adacore.com>
4969         * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
4970         Reference functions of Ada.Containers.Indefinite_Holders.
4972 2017-01-13  Bob Duff  <duff@adacore.com>
4974         * s-os_lib.ads: Minor comment fixes.
4976 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
4978         * exp_ch3.adb (Default_Initialize_Object): Do not default
4979         initialize an object when it is of a task type and restriction
4980         No_Tasking is in effect because the initialization is obsolete.
4981         * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
4982         restriction No_Tasking is in effect.
4983         (Build_Master_Renaming): Do not rename a master when restriction
4984         No_Tasking is in effect.
4986 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
4988         * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
4989         the legality of An others clause applies as well to a choice in
4990         an Iterated_component_ association.
4991         (Resolve_Iterated_Component_Association): An others choice
4992         is legal.
4993         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
4994         Iterated_Component_Association is not static.
4996 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
4998         * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
4999         control is passed to the expresion handler before the new mode
5000         is set.
5001         * sem_ch12.adb (Analyze_Package_Instantiation,
5002         Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
5003         in case control is passed to the expresion handler before the
5004         new mode is set.
5006 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5008         * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
5009         exp_aggr.adb: Minor reformatting.
5011 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5013         * inline.adb: Minor reformatting and typo fix.
5015 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5017         * sem_util.ads, sem_util.adb (Choice_List): Move function here
5018         from sem_aggr.adb, for use elsewhere.
5019         * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
5020         * sem_aggr.adb (Resolve_Array_Aggregate): Remove
5021         Iterated_Component_Present.
5022         * exp_aggr.adb: Use Choice_List throughout, to handle
5023         Iterated_Component_Associations.
5024         (Gen_Loop): Generate proper loop for an
5025         Iterated_Component_Association: loop variable has the identifier
5026         of the original association. Generate a loop even for a single
5027         component choice, in order to make loop parameter visible in
5028         expression.
5029         (Flatten): An Iterated_Component_Association is not static.
5031 2017-01-13  Yannick Moy  <moy@adacore.com>
5033         * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
5034         float exponentiation for statically known small negative values
5035         is the reciprocal of the exponentiation for the opposite value
5036         of the exponent.
5037         * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
5038         Ensure that the value of float exponentiation for negative values
5039         is the reciprocal of the exponentiation for the opposite value
5040         of the exponent.
5041         * inline.adb (Expand_Inlined_Call): Fix the count
5042         for the number of generated gotos.
5044 2017-01-13  Yannick Moy  <moy@adacore.com>
5046         * inline.adb: Code cleanup.
5047         * sem_util.adb (Is_OK_Volatile_Context): Add
5048         expression in delay statement as OK for volatile context.
5050 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5052         * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
5053         mode a choice that is a subtype with a static predicate is
5054         replaced by the values it covers. This transformation must not
5055         be performed in ASIS mode, to preserve the source for analysis.
5057 2017-01-13  Justin Squirek  <squirek@adacore.com>
5059         * nlists.ads: Correct minor typo.
5061 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5063         * sem_ch13.adb: Minor reformatting and typo fix.
5065 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5067         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
5068         Iterated_Component_Association is a named association in an
5069         array aggregate.
5070         * sem_aggr.adb (Resolve_Iterated_Component_Association): New
5071         procedure, subsidiary of Resolve_Array_Aggregate, to analyze
5072         and resolve the discrete choices and the expression of the
5073         new construct.
5074         * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
5075         Loop_Actions and Box_Present are attributes of
5076         N_Iterated_Component_Association nodes. Box_Present is always
5077         False in this case.
5078         * sprint.adb (Sprint_Node): An Iterated_Component_Association
5079         has a Discrete_Choices list, as specified in the RM. A
5080         Component_Association for aggregate uses instead a Choices list.
5081         We have to live with this small inconsistency because the new
5082         construct also has a defining identifier, and there is no way
5083         to merge the two node structures.
5085 2017-01-13  Yannick Moy  <moy@adacore.com>
5087         * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
5088         list of pragmas to remove.  Remove pragmas from the list of
5089         statements in the body to inline.
5090         * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
5092 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5094         * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
5095         Analyze_Declarations, to analyze and resolve the expressions of
5096         aspect specifications in the current declarative list, so that
5097         the expressions have proper entity and type info.  This is needed
5098         for ASIS when there is no subsequent expansion to generate this
5099         semantic information.
5100         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
5101         original expression, to suppress cascaded errors when expression
5102         has been constant-folded.
5103         (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
5104         ASIS mode, because there is no subsequent expansion to decorate
5105         the tree.
5107 2017-01-13  Yannick Moy  <moy@adacore.com>
5109         * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
5110         New function to detect when a call may be inlined or not in
5111         GNATprove mode.
5112         (Expand_Inlined_Call): Ensure that a temporary
5113         is always created in the cases where a type conversion may be
5114         needed on an input parameter in GNATprove mode, so that GNATprove
5115         sees the check to perform.
5116         * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
5117         when not applicable due to actual requiring type conversion
5118         with possible check but no temporary value can be copied for
5119         GNATprove to see the check.
5121 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5123         * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
5124         exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
5125         layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
5126         exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
5127         exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
5128         g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
5129         sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
5130         prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
5131         a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
5132         get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
5133         g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
5134         sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
5135         s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
5136         contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
5137         g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
5138         g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
5139         a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
5140         ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
5141         get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
5142         prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
5143         exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
5144         s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
5145         a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
5146         a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
5147         g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
5148         par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
5149         uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
5150         a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
5151         statements to reflect the new style for case alternatives. Various
5152         code clean up and reformatting.
5154 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5156         * exp_util.adb: Minor reformatting.
5158 2017-01-13  Yannick Moy  <moy@adacore.com>
5160         * exp_spark.adb: Code cleanup.
5161         * sem_ch9.adb (Analyze_Delay_Until): Resolve
5162         expression so that calls are identified as such inside delay
5163         until.
5165 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5167         * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
5168         * par-ch3.adb (P_Discrete_Choice_List): An
5169         Iterated_Component_Association is an array aggregate component.
5170         * par-ch4.adb (P_Iterated_Component_Association): New procedure.
5171         (Is_Quantified_Expression): New function that performs a lookahead
5172         to distinguish quantified expressions from iterated component
5173         associations.
5174         (P_Aggregate_Or_Paren_Expr): Recognize iterated component
5175         associations.
5176         (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
5177         * sem.adb (Analyze): Handle Iterated_Component_Association.
5178         * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
5179         component associations.
5180         * sinfo.ads, sinfo.adb: Entries for for
5181         N_Iterated_Component_Association and its fields.
5182         * sprint.adb (Sprint_Node_Actual): Handle
5183         N_Iterated_Component_Association.
5185 2017-01-13  Justin Squirek  <squirek@adacore.com>
5187         * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
5188         of the style check until after preanalysis of acutals.
5190 2017-01-13  Yannick Moy  <moy@adacore.com>
5192         * sem_ch13.adb: Minor reformatting.
5193         * par-ch11.adb: minor style fix in whitespace
5194         * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
5195         reduced to Add_Artificial_ALI_File; style fix in declaration of
5196         Text; grammar fix in comment.
5197         * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
5198         * freeze.adb: Cleanup to pass pragma instead of
5199         expression to call.
5200         * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
5201         replace System'To_Address by equivalent call.
5203 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
5205         * bindusg.adb: Improve usage output for -f switch.
5207 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5209         * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
5210         Minor reformatting.
5212 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5214         * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
5215         treat comparisons on strings as legal in a Static_Predicate.
5216         (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
5217         a function call that is the expansion of a string comparison.The
5218         function call is built when compiling the corresponding predicate
5219         function, but the expression has been found legal as a static
5220         predicate during earlier analysis.
5221         * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
5222         properly a function call that is the expansion of a string
5223         comparison operation, in order to recover the Static_Predicate
5224         expression and apply it to a static argument when needed.
5226 2017-01-13  Tristan Gingold  <gingold@adacore.com>
5228         * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
5229         (Open_Read): Re-implement using Open_Read_No_Exception.
5230         (Open_Write): Raise exception in case of error.
5231         * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
5232         * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
5233         reaise exception.
5234         * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
5236 2017-01-13  Yannick Moy  <moy@adacore.com>
5238         * checks.adb: Code cleanup.
5240 2017-01-13  Yannick Moy  <moy@adacore.com>
5242         * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
5243         expression instead of unanalyzed aspect expression for checking
5244         the validity of inheriting an operation. Also copy the expression
5245         being passing it to Build_Class_Wide_Expression, as this call
5246         modifies its argument.
5247         * sem_util.ads Fix comment to reference correct function name
5248         New_Copy_Tree.
5250 2017-01-13  Javier Miranda  <miranda@adacore.com>
5252         * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
5253         when we propagate information about the indexes back to the original
5254         indexing mode and the prefix of the index is a function call, do not
5255         remove any parameter from such call.
5257 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5259         * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
5260         * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
5261         a build-in-place function whose result type is tagged.
5263 2017-01-13  Yannick Moy  <moy@adacore.com>
5265         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5266         Do not generate a wrapper when the only candidate is a class-wide
5267         subprogram.
5268         (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
5269         inside a generic context.
5271 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5273         * exp_util.adb (Add_Inherited_Tagged_DIC):
5274         Pass the object parameters of both the parent and the derived
5275         type DIC procedure to the reference replacement circuitry.
5276         (Find_DIC_Type): Modify the circuitry to present the partial
5277         view of a private type in case the private type defines its own
5278         DIC pragma.
5279         (Replace_Object_And_Primitive_References): Add two
5280         optional formal parameters.  Update the comment on usage. Update
5281         the replacement of references to object parameters.
5283 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5285         * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
5287 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5289         * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
5290         an out parameter that is a type conversion, independently of th
5291         range check that may apply to the expression of the conversion,
5292         for use in GNATProve.
5294 2017-01-13  Yannick Moy  <moy@adacore.com>
5296         * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
5297         GNATprove_Mode here to Frontend.
5298         * frontend.adb (Frontend): Move the implicit with for System
5299         in GNATprove_Mode here as it ismore correct this way; the old
5300         place only worked by chance, since there were no overloaded names.
5301         * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
5302         * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
5303         four attributes identified in SRM 9(18), add an implicit with
5304         to Ada.Task_Identification.
5305         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
5306         Deal specially with the wrapper introduced for AI05-0071 in GNATprove
5307         mode.
5308         * checks.adb (Apply_Discriminant_Check,
5309         Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
5310         In GNATprove mode, we do not apply the checks, but we still
5311         analyze the expression to possibly issue errors on SPARK
5312         code when a run-time error can be detected at compile time.
5313         (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
5314         in GNATprove mode.
5316 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5318         * expander.adb (Expand): Add a warning about using return
5319         statements in Ghost management code.
5320         * exp_ch3.adb (Freeze_Type): Add a warning about using return
5321         statements in Ghost management code.
5322         * exp_ch7.adb (Build_Invariant_Procedure_Body,
5323         Build_Invariant_Procedure_Declaration): Add a warning about
5324         using return statements in Ghost management code.
5325         * exp_disp.adb (Make_DT): Add a warning about using return
5326         statements in Ghost management code.
5327         * exp_util.adb (Build_DIC_Procedure_Body,
5328         Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
5329         warning about using return statements in Ghost management code.
5330         * freeze.adb (Freeze_Entity): Add a warning about using return
5331         statements in Ghost management code.
5332         * sem.adb (Analyze, Do_Analyze): Add a warning about using return
5333         statements in Ghost management code.
5334         * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
5335         a warning about using return statements in Ghost management code.
5336         * sem_ch5.adb (Analyze_Assignment): Add a warning about using
5337         return statements in Ghost management code.
5338         * sem_ch6.adb (Analyze_Procedure_Call,
5339         Analyze_Subprogram_Body_Helper): Add a warning about using return
5340         statements in Ghost management code.
5341         * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
5342         using return statements in Ghost management code.
5343         * sem_ch12.adb (Analyze_Package_Instantiation,
5344         Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
5345         Instantiate_Subprogram_Body): Add a warning about using return
5346         statements in Ghost management code.
5347         * sem_ch13.adb (Build_Predicate_Functions,
5348         Build_Predicate_Function_Declarations): Add a warning about
5349         using return statements in Ghost management code.
5350         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
5351         Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
5352         Analyze_Pre_Post_Condition_In_Decl_Part):  Add a warning about
5353         using return statements in Ghost management code.
5355 2017-01-13  Tristan Gingold  <gingold@adacore.com>
5357         * s-mmosin-mingw.adb: Fix pragma import.
5359 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
5361         * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
5362         codepeer mode.
5364 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5366         * atree.adb (Allocate_Initialize_Node): A newly created node is
5367         no longer marked as Ghost at this level.
5368         (Mark_New_Ghost_Node): New routine.
5369         (New_Copy): Mark the copy as Ghost.
5370         (New_Entity): Mark the entity as Ghost.
5371         (New_Node): Mark the node as Ghost.
5372         * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
5373         apply to unanalyzed entities.
5374         (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
5375         entities.
5376         (Set_Is_Checked_Ghost_Entity): This attribute now
5377         applies to all entities as well as unanalyzed entities.
5378         (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
5379         all entities as well as unanalyzed entities.
5380         * expander.adb Add with and use clauses for Ghost.
5381         (Expand): Install and revert the Ghost region associated with the node
5382         being expanded.
5383         * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
5384         (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
5385         (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
5386         (Expand_Freeze_Record_Type): Remove all Ghost-related code.
5387         (Freeze_Type): Install and revert the Ghost region associated
5388         with the type being frozen.
5389         * exp_ch5.adb Remove with and use clauses for Ghost.
5390         (Expand_N_Assignment_Statement): Remove all Ghost-related code.
5391         * exp_ch6.adb Remove with and use clauses for Ghost.
5392         (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
5393         (Expand_N_Subprogram_Body): Remove all Ghost-related code.
5394         * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
5395         Ghost region of the working type.
5396         (Build_Invariant_Procedure_Declaration): Install and revert
5397         the Ghost region of the working type.
5398         (Expand_N_Package_Body): Remove all Ghost-related code.
5399         * exp_ch8.adb Remove with and use clauses for Ghost.
5400         (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
5401         code.
5402         (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
5403         (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
5404         (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
5405         code.
5406         * exp_ch13.adb Remove with and use clauses for Ghost.
5407         (Expand_N_Freeze_Entity): Remove all Ghost-related code.
5408         * exp_disp.adb (Make_DT): Install and revert the Ghost region of
5409         the tagged type. Move the generation of various entities within
5410         the Ghost region of the type.
5411         * exp_prag.adb Remove with and use clauses for Ghost.
5412         (Expand_Pragma_Check): Remove all Ghost-related code.
5413         (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
5414         (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
5415         (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
5416         * exp_util.adb (Build_DIC_Procedure_Body): Install
5417         and revert the Ghost region of the working types.
5418         (Build_DIC_Procedure_Declaration): Install and revert the
5419         Ghost region of the working type.
5420         (Make_Invariant_Call): Install and revert the Ghost region of the
5421         associated type.
5422         (Make_Predicate_Call): Reimplemented. Install and revert the
5423         Ghost region of the associated type.
5424         * freeze.adb (Freeze_Entity): Install and revert the Ghost region
5425         of the entity being frozen.
5426         (New_Freeze_Node): Removed.
5427         * ghost.adb Remove with and use clauses for Opt.
5428         (Check_Ghost_Completion): Update the parameter profile
5429         and all references to formal parameters.
5430         (Ghost_Entity): Update the comment on usage.
5431         (Install_Ghost_Mode): New routines.
5432         (Is_Ghost_Assignment): New routine.
5433         (Is_Ghost_Declaration): New routine.
5434         (Is_Ghost_Pragma): New routine.
5435         (Is_Ghost_Procedure_Call): New routine.
5436         (Is_Ghost_Renaming): Removed.
5437         (Is_OK_Declaration): Reimplemented.
5438         (Is_OK_Pragma): Reimplemented.
5439         (Is_OK_Statement): Reimplemented.
5440         (Is_Subject_To_Ghost): Update the comment on usage.
5441         (Mark_And_Set_Ghost_Assignment): New routine.
5442         (Mark_And_Set_Ghost_Body): New routine.
5443         (Mark_And_Set_Ghost_Completion): New routine.
5444         (Mark_And_Set_Ghost_Declaration): New routine.
5445         (Mark_And_Set_Ghost_Instantiation): New routine.
5446         (Mark_And_Set_Ghost_Procedure_Call): New routine.
5447         (Mark_Full_View_As_Ghost): Removed.
5448         (Mark_Ghost_Declaration_Or_Body): New routine.
5449         (Mark_Ghost_Pragma): New routine.
5450         (Mark_Ghost_Renaming): New routine.
5451         (Mark_Pragma_As_Ghost): Removed.
5452         (Mark_Renaming_As_Ghost): Removed.
5453         (Propagate_Ignored_Ghost_Code): Update the comment on usage.
5454         (Prune_Node): Freeze nodes no longer need special pruning, they
5455         are processed by the general ignored Ghost code mechanism.
5456         (Restore_Ghost_Mode): New routine.
5457         (Set_Ghost_Mode): Reimplemented.
5458         (Set_Ghost_Mode_From_Entity): Removed.
5459         * ghost.ads Add with and use clauses for Ghost.
5460         (Check_Ghost_Completion): Update the parameter profile
5461         along with the comment on usage.
5462         (Install_Ghost_Mode): New routine.
5463         (Is_Ghost_Assignment): New routine.
5464         (Is_Ghost_Declaration): New routine.
5465         (Is_Ghost_Pragma): New routine.
5466         (Is_Ghost_Procedure_Call): New routine.
5467         (Mark_And_Set_Ghost_Assignment): New routine.
5468         (Mark_And_Set_Ghost_Body): New routine.
5469         (Mark_And_Set_Ghost_Completion): New routine.
5470         (Mark_And_Set_Ghost_Declaration): New routine.
5471         (Mark_And_Set_Ghost_Instantiation): New routine.
5472         (Mark_And_Set_Ghost_Procedure_Call): New routine.
5473         (Mark_Full_View_As_Ghost): Removed.
5474         (Mark_Ghost_Pragma): New routine.
5475         (Mark_Ghost_Renaming): New routine.
5476         (Mark_Pragma_As_Ghost): Removed.
5477         (Mark_Renaming_As_Ghost): Removed.
5478         (Restore_Ghost_Mode): New routine.
5479         (Set_Ghost_Mode): Redefined.
5480         (Set_Ghost_Mode_From_Entity): Removed.
5481         * sem.adb (Analyze): Install and revert the Ghost region of the
5482         node being analyzed.
5483         (Do_Analyze): Change the way a clean Ghost
5484         region is installed and reverted.
5485         * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
5486         all Ghost-related code.
5487         (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
5488         (Analyze_Number_Declaration): Remove all Ghost-related code.
5489         (Analyze_Object_Declaration): Install and revert the Ghost region of
5490         a deferred object declaration's completion.
5491         (Array_Type_Declaration): Remove all Ghost-related code.
5492         (Build_Derived_Type): Update the comment on
5493         the propagation of Ghost attributes from a parent to a derived type.
5494         (Derive_Subprogram): Remove all Ghost-related code.
5495         (Make_Class_Wide_Type): Remove all Ghost-related code.
5496         (Make_Implicit_Base): Remove all Ghost-related code.
5497         (Process_Full_View): Install and revert the Ghost region of
5498         the partial view.  There is no longer need to check the Ghost
5499         completion here.
5500         * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
5501         region of the left hand side.
5502         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
5503         all Ghost-related code.
5504         (Analyze_Expression_Function): Remove all Ghost-related code.
5505         (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
5506         (Analyze_Procedure_Call): Install and revert the Ghost region of
5507         the procedure being called.
5508         (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
5509         region of the spec or body.
5510         (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
5511         (Build_Subprogram_Declaration): Remove all Ghost-related code.
5512         (Find_Corresponding_Spec): Remove all Ghost-related code.
5513         (Process_Formals): Remove all Ghost-related code.
5514         * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
5515         the Ghost region of the spec.
5516         (Analyze_Package_Declaration): Remove all Ghost-related code.
5517         * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
5518         Ghost when it aliases a Ghost entity.
5519         (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
5520         a Ghost entity.
5521         (Analyze_Object_Renaming): Mark a renaming as Ghost when
5522         it aliases a Ghost entity.
5523         (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
5524         a Ghost entity.
5525         (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
5526         aliases a Ghost entity.
5527         * sem_ch11.adb Remove with and use clauses for Ghost.
5528         (Analyze_Exception_Declaration): Remove all Ghost-related code.
5529         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
5530         Ghost-related code.
5531         (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
5532         code.
5533         (Analyze_Package_Instantiation): Install and revert the Ghost region
5534         of the package instantiation.
5535         (Analyze_Subprogram_Instantiation): Install
5536         and revert the Ghost region of the subprogram instantiation.
5537         (Instantiate_Package_Body): Code clean up. Install and revert the
5538         Ghost region of the package body.
5539         (Instantiate_Subprogram_Body): Code clean up. Install and revert the
5540         Ghost region of the subprogram body.
5541         * sem_ch13.adb (Build_Predicate_Functions): Install
5542         and revert the Ghost region of the related type.
5543         (Build_Predicate_Function_Declaration): Code clean up. Install
5544         and rever the Ghost region of the related type.
5545         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
5546         Install and revert the Ghost region of the pragma.
5547         (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
5548         Ghost region of the pragma.
5549         (Analyze_Pragma): Install and revert the Ghost region of various
5550         pragmas.  Mark a pragma as Ghost when it is related to a Ghost entity
5551         or encloses a Ghost entity.
5552         (Analyze_Pre_Post_Condition): Install and revert the Ghost
5553         region of the pragma.
5554         (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
5555         Ghost region of the pragma.
5556         * sem_res.adb (Resolve): Remove all Ghost-related code.
5557         * sem_util.adb (Is_Declaration): Reimplemented.
5558         (Is_Declaration_Other_Than_Renaming): New routine.
5559         * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
5560         * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
5561         (Is_Ghost_Pragma): Removed.
5562         (Is_Ignored_Ghost_Pragma): New routine.
5563         (Set_Is_Checked_Ghost_Pragma): New routine.
5564         (Set_Is_Ghost_Pragma): Removed.
5565         (Set_Is_Ignored_Ghost_Pragma): New routine.
5566         * sinfo.ads: Update the documentation on Ghost mode and
5567         Ghost regions.  New attributes Is_Checked_Ghost_Pragma
5568         and Is_Ignored_Ghost_Pragma along with usages in nodes.
5569         Remove attribute Is_Ghost_Pragma along with usages in nodes.
5570         (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5571         (Is_Ghost_Pragma): Removed along with pragma Inline.
5572         (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5573         (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
5574         (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
5575         (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
5577 2017-01-12  Tristan Gingold  <gingold@adacore.com>
5579         * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
5580         s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
5582 2017-01-12  Yannick Moy  <moy@adacore.com>
5584         * errout.adb, errout.ads (Initialize): Factor common treatment
5585         in Reset_Warnings.
5586         (Reset_Warnings): New procedure to reset counts related to warnings.
5587         (Record_Compilation_Errors): New variable to store the presence of an
5588         error, used in gnat2why to allow changing the Warning_Mode.
5589         (Compilation_Errors): Use new variable Record_Compilation_Errors to
5590         store the presence of an error.
5592 2017-01-12  Javier Miranda  <miranda@adacore.com>
5594         * sem_ch13.adb (Analyze_Aspect_Specifications):
5595         For Interrupt_Handler and Attach_ Handler aspects, decorate the
5596         internally built reference to the protected procedure as coming
5597         from sources and force its analysis.
5599 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5601         * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
5602         inherit predicates if any from the first_subtype of the parent,
5603         not from the anonymous parent type.
5604         * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
5605         predicate is not a static subtype.
5607 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5609         * freeze.adb (Check_Suspicious_Convention): New procedure
5610         performing a warning check on discriminated record types with
5611         convention C or C++. Factored out of procedure Freeze_Record_Type,
5612         and changed to only apply to base types (to avoid spurious
5613         warnings on subtypes). Minor improvement of warning messages
5614         to refer to discriminated rather than variant record types.
5615         (Freeze_Record_Type): Remove code for performing a suspicious
5616         convention check.
5617         (Freeze_Entity): Only call Freeze_Record_Type
5618         on types that aren't declared within any enclosing generic units
5619         (rather than just excluding the type when the innermost scope
5620         is generic). Call Check_Suspicious_Convention whether or not
5621         the type is declared within a generic unit.
5622         * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
5623         * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
5624         from Sem_Ch8).
5626 2017-01-12  Tristan Gingold  <gingold@adacore.com>
5628         * sysdep.c, adaint.c, rtinit.c, ming32.h:
5629         (__gnat_current_codepage): Renamed from CurrentCodePage
5630         (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
5632 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5634         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
5635         quantified expressions, following AI12-050: the loop parameters
5636         of two quantified expressions are conformant if they have the
5637         same identifier.
5639 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
5641         * gcc-interface/Makefile.in: Clean up VxWorks targets.
5643 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5645         * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
5646         Hnadle properly the attribute reference when it appears as part
5647         of an expression in another loop aspect.
5649 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
5651         * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
5652         subsidiary of Build_Initialization_Call, to complete generation
5653         of predicate checks on discriminants whose (sub)types have
5654         predicates, and to add checks on variants that do not have an
5655         others clause.
5656         * sem_util.adb (Gather_Components): A missing Others alternative is
5657         not an error when the type of the discriminant is a static predicate
5658         (and coverage has been checked when analyzing the case statement). A
5659         runtime check is generated to verify that a given discriminant
5660         satisfies the predicate (RM 3.8.1. (21.1/2)).
5662 2017-01-12  Yannick Moy  <moy@adacore.com>
5664         * gnat1drv.adb (Adjust_Global_Switches): Only
5665         perform checking of exception mechanism when generating code.
5667 2017-01-12  Justin Squirek  <squirek@adacore.com>
5669         * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
5670         Remove handling of access component with invariant.
5671         (Build_Invariant_Procedure_Declaration): Remove return on class
5672         wide type.
5673         * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
5674         conditional exception for component or array so Has_Own_Invariants
5675         flag is not falsly set.
5676         * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
5677         wide type to have no invariant flags.
5679 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5681         * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
5682         sem_ch13.adb: Minor reformatting.
5684 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5686         * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
5687         adjustment primitive when the ancestor type was not properly frozen.
5688         (Gen_Assign): Guard against a missing initialization
5689         primitive when the component type was not properly frozen.
5690         (Initialize_Array_Component): Guard against a missing adjustment
5691         primitive when the component type was not properly frozen.
5692         (Initialize_Record_Component): Guard against a missing adjustment
5693         primitive when the component type was not properly frozen.
5694         (Process_Transient_Component_Completion): The transient object may
5695         not be finalized when its associated type was not properly frozen.
5696         * exp_ch3.adb (Build_Assignment): Guard against a missing
5697         adjustment primitive when the component type was not properly frozen.
5698         (Build_Initialization_Call): Guard against a missing
5699         initialization primitive when the associated type was not properly
5700         frozen.
5701         (Expand_N_Object_Declaration): Guard against a missing
5702         adjustment primitive when the base type was not properly frozen.
5703         (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
5704         body when there is no adjustment primitive available. Create an
5705         empty Deep_Finalize body when there is no finalization primitive
5706         available.
5707         * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
5708         missing finalization primitive when the designated type was
5709         not properly frozen.
5710         (Expand_N_Allocator): Guard against a missing initialization primitive
5711         when the designated type was not properly frozen.
5712         * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
5713         only when the corresponding adjustment primitive is available.
5714         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
5715         adjustment/finalization statements only when there is an available
5716         primitive to carry out the action.
5717         (Build_Initialize_Statements): Generate the initialization/finalization
5718         statements only when there is an available primitive to carry out the
5719         action.
5720         (Make_Adjust_Call): Do not generate a call when the underlying
5721         type is not present due to a possible missing full view.
5722         (Make_Final_Call): Do not generate a call when the underlying
5723         type is not present due to a possible missing full view.
5724         (Make_Finalize_Address_Stmts): Generate an empty body when the
5725         designated type lacks a finalization primitive.
5726         (Make_Init_Call): Do not generate a call when the underlying type is
5727         not present due to a possible missing full view.
5728         (Process_Component_For_Adjust): Add the adjustment call only when the
5729         corresponding adjustment primitive is available.
5730         (Process_Component_For_Finalize): Add the finalization call only when
5731         the corresponding finalization primitive is available.
5732         (Process_Object_Declaration): Use a null statement to emulate a
5733         missing call to the finalization primitive of the object type.
5734         * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
5735         (Make_Final_Call): Update the comment on usage.
5736         (Make_Init_Call): Update the comment on usage.
5737         * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
5739 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
5741         * einfo.ads: Update documentation of Address_Taken.
5742         * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
5743         [Access_Attribute]): Only consider 'Access/'Unchecked_Access
5744         for subprograms when setting Address_Taken flag.
5746 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
5748         * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
5749         Configurable_Run_Time_Mode off when analysing with'ed predefined
5750         libraries.
5752 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5754         * sem_prag.adb: Minor reformatting.
5755         * sem_util.adb (Unique_Entity): fix result for
5756         bodies of entry families.
5758 2017-01-12  Justin Squirek  <squirek@adacore.com>
5760         * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
5761         Resolve_Suppressible in the pragma Assertion_Policy case.
5762         (Resolve_Suppressible): Created this function to factor out
5763         common code used to resolve Suppress to either Ignore or Check
5764         * snames.ads-tmpl: Add name for Suppressible.
5766 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5768         * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
5769         reformatting.
5770         * debug.adb: Minor comment fixes.
5772 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
5774         * sem_util.adb (Unique_Entity): For concurrent
5775         bodies that are defined with stubs and complete a declaration
5776         of a single concurrent object return the entity of an implicit
5777         concurrent type, not the entity of the anonymous concurrent
5778         object.
5779         * debug.adb: -gnatd.J is no longer used.
5780         * make.adb (Globalize): Removed, no longer used.
5781         * sem_ch9.adb: minor typo in comment for entry index
5783 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
5785         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
5786         * exp_ch3.adb (Build_Init_Statements): As part of initialising
5787         the value record of a task, set its _Secondary_Stack_Size field
5788         if present.
5789         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
5790         a _Secondary_Stack_Size field in the value record of
5791         the task if a Secondary_Stack_Size rep item is present.
5792         (Make_Task_Create_Call): Include secondary stack size
5793         parameter. If No_Secondary_Stack restriction is in place, passes
5794         stack size of 0.
5795         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
5796         Secondary_Stack_Size.
5797         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
5798         function to define the overhead of the secondary stack.
5799         * s-tarest.adb (Create_Restricted_Task,
5800         Create_Restricted_Task_Sequential): Functions now include
5801         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
5802         * s-tarest.adb (Create_Restricted_Task,
5803         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
5804         include Secondary_Stack_Size parameter.
5805         (Task_Wrapper): Secondary stack now allocated to the size specified by
5806         the Secondary_Stack_Size parameter in the task's ATCB.
5807         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
5808         Secondary_Stack_Size component.
5809         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
5810         Create_Restricted_Task_Sequential): Function now include
5811         Secondary_Stack_Size parameter.
5812         (Task_Wrapper): Secondary stack now allocated to the size
5813         specified by the Secondary_Stack_Size parameter in the task's
5814         ATCB.
5815         * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
5816         to include Secondary_Stack_Size parameter.
5817         * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
5818         Secondary_Stack_Size aspect, turning the aspect into its corresponding
5819         internal attribute.
5820         (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
5821         * snames.adb-tmpl, snames.ads-tmpl: Added names
5822         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
5823         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
5825 2017-01-12  Yannick Moy  <moy@adacore.com>
5827         * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
5828         subtree.
5830 2017-01-12  Justin Squirek  <squirek@adacore.com>
5832         * exp_attr.adb (Expand_N_Attribute_Reference):
5833         Fix Finalization_Size case by properly resolving the type after
5834         rewritting the node.
5836 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5838         * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
5839         the tree.
5840         (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
5841         * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
5842         exp_sel.ads: Minor reformatting.
5844 2017-01-12  Justin Squirek  <squirek@adacore.com>
5846         * exp_ch6.adb (Expand_Call): Add guard to prevent
5847         invariant checks from being created for internally generated
5848         subprograms.
5850 2017-01-12  Bob Duff  <duff@adacore.com>
5852         * lib-writ.ads: Remove incorrect comment.
5854 2017-01-12  Javier Miranda  <miranda@adacore.com>
5856         * debug.adb (-gnatd.K): Enable generation of contract-only
5857         procedures in CodePeer mode.
5858         * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
5859         New subprogram.
5860         (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
5861         set.
5862         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
5863         subprogram.
5864         (Get_Contract_Only_Missing_Body_Name): New subprogram.
5865         (Get_Contract_Only_Body): New subprogram.
5866         (Set_Contract_Only_Body): New subprogram.
5867         (Is_Contract_Only_Body): New subprogram.
5868         (Set_Is_Contract_Only_Body): New subprogram.
5869         (SCIL_Nodes): Replace table by hash-table.
5871 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5873         * exp_ch6.adb: Minor reformatting.
5874         * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
5876 2017-01-12  Bob Duff  <duff@adacore.com>
5878         * binde.adb (Forced): New reason for a dependence.
5879         (Force_Elab_Order): Implementation of the new switch.
5880         * binde.ads: Minor comment fixes.
5881         * bindusg.adb: Add -f switch. Apparently, there was an -f switch
5882         long ago that is no longer supported; removed comment about that.
5883         * opt.ads (Force_Elab_Order_File): Name of file specified for
5884         -f switch.
5885         * switch-b.adb: Parse -f switch.
5887 2017-01-12  Justin Squirek  <squirek@adacore.com>
5889         * exp_ch6.adb (Check_View_Conversion): Created this function
5890         to properly chain calls to check type invariants that may be
5891         present in a subprogram call after the subprogram.
5892         (Expand_Call): Add a conditional to identify when a view conversion
5893         needs to be checked.
5894         * nlists.adb, nlists.ads (Prepend_New): New routine.
5895         (Prepend_New_To): New routine.
5897 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5899         * sinfo.ads: Minor reformatting.
5901 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
5903         * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
5904         reformatting.
5906 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
5908         * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
5909         variable Definite. Create a local object and pass its 'Access to the
5910         BIP function when the result type is either definite or it does not
5911         require any finalization or secondary stack management.
5913 2017-01-12  Bob Duff  <duff@adacore.com>
5915         * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
5916         exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
5917         frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
5918         par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
5919         sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
5920         sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
5921         sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
5922         sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
5923         Change name to Pragma_Name_Unmapped.
5924         (Pragma_Name_Mapped): Change name to Pragma_Name.
5925         This is because the "mapped" version should be the usual case.
5927 2017-01-09  Hristian Kirtchev  <kirtchev@adacore.com>
5929         * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
5930         Is_Default_Init_Cond_Procedure, and
5931         Has_Inherited_Default_Init_Cond.  Add uses of flags
5932         Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
5933         (Default_Init_Cond_Procedure): Removed.
5934         (DIC_Procedure): New routine.
5935         (Has_Default_Init_Cond): Removed.
5936         (Has_DIC): New routine.
5937         (Has_Inheritable_Invariants): The attribute applies to the base type.
5938         (Has_Inherited_Default_Init_Cond): Removed.
5939         (Has_Inherited_DIC): New routine.
5940         (Has_Inherited_Invariants): The attribute applies to the base type.
5941         (Has_Own_DIC): New routine.
5942         (Has_Own_Invariants): The attribute applies to the base type.
5943         (Is_Default_Init_Cond_Procedure): Removed.
5944         (Is_DIC_Procedure): New routine.
5945         (Set_Default_Init_Cond_Procedure): Removed.
5946         (Set_DIC_Procedure): New routine.
5947         (Set_Has_Default_Init_Cond): Removed.
5948         (Set_Has_Inheritable_Invariants): The attribute applies
5949         to the base type.
5950         (Set_Has_Inherited_Default_Init_Cond): Removed.
5951         (Set_Has_Inherited_DIC): New routine.
5952         (Set_Has_Inherited_Invariants): The attribute applies to the base type.
5953         (Set_Has_Own_DIC): New routine.
5954         (Set_Has_Own_Invariants): The attribute applies to the base type.
5955         (Set_Is_Default_Init_Cond_Procedure): Removed.
5956         (Set_Is_DIC_Procedure): New routine.
5957         (Write_Entity_Flags): Update the output of all flags related to
5958         default initial condition.
5959         * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
5960         of the call to the DIC procedure.
5961         (Freeze_Type): Generate the body of the DIC procedure.
5962         * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
5963         all occurrences of Create_Append with Append_New_To. Do
5964         not generate an invariant procedure for a class-wide type.
5965         The generated body acts as a freeze action of the working type.
5966         (Build_Invariant_Procedure_Declaration): Do not generate an
5967         invariant procedure for a class-wide type.
5968         (Create_Append): Removed.
5969         * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
5970         sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
5971         class-wide pre/postcondition description and data structures from
5972         Sem_Prag.
5973         (Build_Class_Wide_Expression): Moved from Sem_Prag.
5974         (Build_DIC_Call): New routine.
5975         (Build_DIC_Procedure_Body): New routine.
5976         (Build_DIC_Procedure_Declaration): New routine.
5977         (Entity_Hash): Moved from Sem_Prag.
5978         (Find_DIC_Type): New routine.
5979         (Update_Primitives_Mapping): Reimplemented.
5980         (Update_Primitives_Mapping_Of_Types): New routine.
5981         * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
5982         (Build_DIC_Call): New routine.
5983         (Build_DIC_Procedure_Body): New routine.
5984         (Build_DIC_Procedure_Declaration): New routine.
5985         (Update_Primitives_Mapping): Moved from Sem_Prag.
5986         (Update_Primitives_Mapping_Of_Types): New routine.
5987         * nlists.adb (Append_New): New routine.
5988         (Append_New_To): New routine.
5989         * nlists.ads (Append_New): New routine.
5990         (Append_New_To): New routine.
5991         * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
5992         of DIC procedures here. This is now done at the end of the
5993         visible declarations, private declarations, and at the freeze
5994         point of a type.
5995         (Analyze_Private_Extension_Declaration):
5996         A private extension inherits the DIC pragma of a parent type.
5997         (Analyze_Subtype_Declaration): No need to propagate invariant
5998         attributes to a subtype as those apply to the base type.
5999         (Build_Derived_Record_Type): No need to inherit invariants here
6000         as this is now done in Build_Derived_Type.
6001         (Build_Derived_Type): Inherit both the DIC pragma and invariants from
6002         a parent type.
6003         (Process_Full_View): Update the propagation of DIC attributes.
6004         (Propagate_Default_Init_Cond_Attributes): Removed.
6005         * sem_ch7.adb Add with and use clauses for Exp_Util.
6006         (Analyze_Package_Specification): Create the body of the DIC
6007         procedure at the end of the visible and private declarations.
6008         (Preserve_Full_Attributes): Propagate DIC attributes.
6009         * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
6010         DIC attributes.
6011         (Analyze_Task_Type_Declaration): Propagate DIC attributes.
6012         * sem_elab.adb (Check_A_Call): Update the call to
6013         Is_Nontrivial_Default_Init_Cond_Procedure.
6014         * sem_prag.adb Remove the with and use clauses for
6015         GNAT.HTable. Move the handling of class- wide pre/postcondition
6016         description and data structures to Exp_Util.
6017         (Analyze_Pragma): Create the declaration of the DIC procedure. There
6018         is no need to propagate invariant-related attributes at this point
6019         as this is done in Build_Invariant_Procedure_Declaration.
6020         (Build_Class_Wide_Expression): Moved to Exp_Util.
6021         (Entity_Hash): Moved to Exp_Util.
6022         (Update_Primitives_Mapping): Moved to Exp_Util.
6023         * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
6024         (Update_Primitives_Mapping): Moved to Exp_Util.
6025         * sem_util.adb: Remove with and use clauses for Ghost
6026         and Sem_Ch13.
6027         (Build_Default_Init_Cond_Call): Removed.
6028         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6029         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6030         (Get_Views): Reimplemented.
6031         (Has_Full_Default_Initialization): Reimplement the section on DIC.
6032         (Inherit_Default_Init_Cond_Procedure): Removed.
6033         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6034         (Is_Nontrivial_DIC_Procedure): New routine.
6035         (Is_Verifiable_DIC_Pragma): New routine.
6036         (Propagate_DIC_Attributes): New routine.
6037         * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
6038         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
6039         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
6040         (Inherit_Default_Init_Cond_Procedure): Removed.
6041         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
6042         (Is_Nontrivial_DIC_Procedure): New routine.
6043         (Is_Verifiable_DIC_Pragma): New routine.
6044         (Propagate_DIC_Attributes): New routine.
6045         * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
6046         on DIC.
6047         * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
6048         usage in nodes.
6049         (Expression_Copy): New routine along with pragma Inline.
6050         (Set_Expression_Copy): New routine along with pragma Inline.
6052 2017-01-06  Bob Duff  <duff@adacore.com>
6054         * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
6055         "Bind_Main_Program" to "not Bind_For_Library", because otherwise
6056         we won't generate the call to s_stalib_adafinal when the main
6057         is not written in Ada.
6059 2017-01-06  Bob Duff  <duff@adacore.com>
6061         * sem_prag.adb: Minor: remove pragma Warnings.
6063 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6065         * Makefile.rtl: Do not compile s-stchop by default.
6067 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
6069         * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
6070         sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
6071         snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
6072         s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
6073         Reverted previous change for now.
6075 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6077         * exp_ch3.adb (Build_Initialization_Call): Apply predicate
6078         check to default discriminant value if checks are enabled.
6079         (Build_Assignment): If type of component has static predicate,
6080         apply check to its default value, if any.
6082 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
6084         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
6085         * exp_ch3.adb (Build_Init_Statements): As part of initialising
6086         the value record of a task, set its _Secondary_Stack_Size field
6087         if present.
6088         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
6089         a _Secondary_Stack_Size field in the value record of
6090         the task if a Secondary_Stack_Size rep item is present.
6091         (Make_Task_Create_Call): Include secondary stack size
6092         parameter. If No_Secondary_Stack restriction is in place, passes
6093         stack size of 0.
6094         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
6095         Secondary_Stack_Size.
6096         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
6097         function to define the overhead of the secondary stack.
6098         * s-tarest.adb (Create_Restricted_Task,
6099         Create_Restricted_Task_Sequential): Functions now include
6100         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
6101         * s-tarest.adb (Create_Restricted_Task,
6102         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
6103         now include Secondary_Stack_Size parameter.
6104         (Task_Wrapper):
6105         Secondary stack now allocated to the size specified by the
6106         Secondary_Stack_Size parameter in the task's ATCB.
6107         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
6108         Secondary_Stack_Size component.
6109         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6110         Create_Restricted_Task_Sequential): Function now include
6111         Secondary_Stack_Size parameter.
6112         (Task_Wrapper): Secondary stack
6113         now allocated to the size specified by the Secondary_Stack_Size
6114         parameter in the task's ATCB.
6115         * sem_ch13.adb (Analyze_Aspect_Specification): Add support
6116         for Secondary_Stack_Size aspect, turning the aspect into its
6117         corresponding internal attribute.
6118         (Analyze_Attribute_Definition):
6119         Process Secondary_Stack_Size attribute.
6120         * snames.adb-tmpl, snames.ads-tmpl: Added names
6121         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6122         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6124 2017-01-06  Pascal Obry  <obry@adacore.com>
6126         * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
6127         Sequential_IO and Direct_IO.
6129 2017-01-06  Bob Duff  <duff@adacore.com>
6131         * snames.ads-tmpl (Renamed): New name for the pragma argument.
6132         * par-ch2.adb: Allow the new pragma (with analysis deferred
6133         to Sem_Prag).
6134         * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
6135         Keep a mapping from new pragma names to old names.
6136         * sem_prag.adb: Check legality of pragma Rename_Pragma, and
6137         implement it by calling Map_Pragma_Name.
6138         * checks.adb, contracts.adb, einfo.adb, errout.adb,
6139         * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
6140         * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
6141         * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
6142         * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
6143         * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6144         * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
6145         as appropriate.
6147 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6149         * exp_ch9.adb: Minor reformatting.
6151 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6153         * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
6154         * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
6155         (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
6156         (unused).
6157         * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
6158         Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
6159         * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
6160         Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
6162 2017-01-06  Bob Duff  <duff@adacore.com>
6164         * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
6165         dummy implementation of Map_Pragma_Name.
6167 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6169         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
6170         entry_body variable constant.
6171         * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
6172         * s-tpoben.ads (Protected_Entry_Body_Access): Now access
6173         to constant.
6174         * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
6175         now access to constant.
6177 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6179         * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
6180         reformatting and typo fixes.
6182 2017-01-06  Bob Duff  <duff@adacore.com>
6184         * snames.ads-tmpl: New names for pragma renaming.
6185         * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
6186         * par-prag.adb: Add new pragma name to case statement.
6187         * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
6188         of the pragma.
6189         * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
6190         Dummy implementation of Pragma_Name_Mapped.
6192 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6194         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
6195         better detect call within an entry_wrapper.
6196         * sem_res.adb (Resolve_Call): A protected call within an
6197         entity_wrapper is analyzed in the context of the protected
6198         object but corresponds to a pre-analysis and is not an access
6199         before elaboration.
6200         * sem_attr.adb: Minor reformatting.
6202 2017-01-06  Justin Squirek  <squirek@adacore.com>
6204         * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
6205         Finalization_Size to allow a prefix of any non-class-wide type.
6206         * sem_attr.ads Modify comment for Finalization_Size to include
6207         definite type use case.
6209 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6211         * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
6212         on procedures that are wrappers created for entries that have
6213         preconditions.
6214         * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
6215         body is an entry_wrapper, compile it in the context of the
6216         synchronized type, because a precondition may refer to funtions
6217         of the type.
6218         * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
6219         body entity.
6220         * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
6221         within an Entry_Wrapper this is an external call whose target
6222         is the synchronized object that is the actual in the call to
6223         the wrapper.
6225 2017-01-06  Yannick Moy  <moy@adacore.com>
6227         * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
6228         in tree, which means not analyzing the previous prefix if the node has
6229         been rewritten into its prefix.
6231 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6233         * s-tpobop.adb: Minor reformatting.
6235 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6237         * checks.adb (Ensure_Valid): Do not generate a validity check
6238         within a generated predicate function, validity checks will have
6239         been applied earlier when required.
6241 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6243         * s-tpoben.ads (Protection_Entries): Add comment and reorder
6244         components for performances.
6245         * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
6246         semantic.
6248 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6250         * sem_eval.adb (Check_Expression_Against_Static_Predicate):
6251         If expression is compile-time known and obeys a static predicate
6252         it must be labelled as static, to prevent spurious warnings and
6253         run-time errors, e.g. in case statements. This is relevant when
6254         the expression is the result of constant-folding a type conversion
6255         whose expression is a variable with a known static value.
6257 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6259         * exp_attr.adb, sem_attr.ads: Minor reformatting.
6261 2017-01-06  Justin Squirek  <squirek@adacore.com>
6263         * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
6264         expansion of Finalization_Size attribute.
6265         * sem_attr.adb (Analyze_Attribute): Add entry to check the
6266         semantics of Finalization_Size.
6267         (Eval_Attribute): Add null entry for Finalization_Size.
6268         * sem_attr.ads: Add Finalization_Size to the implementation
6269         dependent attribute list.
6270         * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
6272 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6274         * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
6275         iterator specification with a serious syntactic error, transform
6276         construct into an infinite loop in order to continue analysis
6277         and prevent a compiler abort.
6279 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6281         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
6282         max_queue_lengths_array if unused.
6284 2017-01-06  Bob Duff  <duff@adacore.com>
6286         * errout.adb (Set_Msg_Text): Protect against out-of-bounds
6287         array access, in case "\" is at the end of Text.
6288         * stylesw.adb (Set_Style_Check_Options): Don't include input
6289         characters in the error message template, because they could
6290         be control characters such as "\", which Errout will try to
6291         interpret.
6293 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6295         * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
6296         For a private type examine the visible declarations that follow
6297         the partial view, not just the private declarations that follow
6298         the full view.
6300 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6302         * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
6303         code cleanup.
6305 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6307         * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
6308         alias of the inherited op is the parent iterator, no need to
6309         examine dispatch table positions which might not be established
6310         yet if type is not frozen.
6311         * sem_disp.adb (Check_Controlling_Formals): The formal of a
6312         predicate function may be a subtype of a tagged type.
6313         * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
6314         of representation items for the completion of a type extension
6315         where a predicate applies to the partial view.
6316         * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
6317         parameter that designates function whose actual receives a
6318         predicate check, to improve warning message when the check will
6319         lead to infinite recursion.
6320         * sem_res.adb (Resolve_Actuals): Pass additional parameter to
6321         Apply_Predicate_Check.
6323 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6325         * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
6326         Gnat_Extended_Ravenscar.
6327         * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
6329 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6331         * sem_util.ads: Minor typo fix and reformatting.
6333 2017-01-06  Yannick Moy  <moy@adacore.com>
6335         * ghost.adb Minor fixing of references to SPARK RM.
6336         (Check_Ghost_Context): Check whether reference is to a lvalue
6337         before issuing an error about violation of SPARK RM 6.9(13)
6338         when declaration has Ghost policy Check and reference has Ghost
6339         policy Ignore.
6340         * sem_util.adb Minor indentation.
6341         * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
6342         Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
6343         * sem_util.ads (Unique_Defining_Entity): Document the result
6344         for package body stubs.
6346 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6348         * raise-gcc.c (abort): Macro to call Abort_Propagation.
6349         * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
6350         constant.
6351         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6352         Do not generate the Entry_Max_Queue_Lengths_Array if all default
6353         values.
6354         * exp_util.adb (Corresponding_Runtime_Package): Consider
6355         Max_Queue_Length pragma.
6357 2017-01-06  Justin Squirek  <squirek@adacore.com>
6359         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
6360         Remove declaration generation in the case of
6361         System_Tasking_Protected_Objects_Single_Entry being used,
6362         and add a warning message when this is detected to occur.
6363         (Make_Initialize_Protection): Remove reference pass in the case
6364         of System_Tasking_Protected_Objects_Single_Entry.
6365         * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
6366         * s-tposen.adb (Initialize_Protection_Entry): Remove
6367         Entry_Queue_Max parameter.
6368         * s-tposen.ads: Remove the types use to store the entry queue
6369         maximum.
6370         * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
6372 2017-01-06  Yannick Moy  <moy@adacore.com>
6374         * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
6375         behavior of function, to also accept out of range positions
6376         and raise Constraint_Error in such case, and to copy sloc from
6377         literal if No_Location passed as location.
6378         * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
6379         of functions to raise Constraint_Error in case of value not in
6380         appropriate range.
6382 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6384         * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
6385         Invalidate_Stack_Cache.
6387 2017-01-06  Eric Botcazou  <ebotcazou@adacore.com>
6389         * s-os_lib.adb: Minor fix to the signature of Readlink.
6391 2017-01-06  Javier Miranda  <miranda@adacore.com>
6393         * sem_ch6.adb (Conforming_Types): Handle another
6394         confusion between views in a nested instance with an actual
6395         private type whose full view is not in scope.
6397 2017-01-06  Arnaud Charlet  <charlet@adacore.com>
6399         * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
6400         mark a rewritten if statement as explicit (Comes_From_Source).
6402 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
6404         * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
6406 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6408         * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
6410 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6412         * sem_case.adb: Minor reformatting.
6414 2017-01-06  Thomas Quinot  <quinot@adacore.com>
6416         * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
6418 2017-01-06  Justin Squirek  <squirek@adacore.com>
6420         * aspects.adb: Register aspect in Canonical_Aspect.
6421         * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
6422         into respective tables.
6423         * einfo.ads, einfo.adb: Add a new attribute for
6424         handling the parameters for Pragma_Max_Entry_Queue
6425         (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
6426         for accessing and setting were added as well.
6427         * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
6428         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
6429         declaration for pramga arguments and store them in the protected
6430         type node.
6431         (Make_Initialize_Protection): Pass a reference to
6432         the Entry_Max_Queue_Lengths_Array in the protected type node to
6433         the runtime.
6434         * rtsfind.adb: Minor grammar fix.
6435         * rtsfind.ads: Register new types taken from the
6436         runtime libraries RE_Protected_Entry_Queue_Max and
6437         RE_Protected_Entry_Queue_Max_Array
6438         * s-tposen.adb, s-tpoben.adb
6439         (Initialize_Protection_Entry/Initialize_Protection_Entries):
6440         Add extra parameter and add assignment to local object.
6441         * s-tposen.ads, s-tpoben.ads: Add new types to
6442         store entry queue maximums and a field to the entry object record.
6443         * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
6444         for Aspect_Max_Queue_Length.
6445         (Check_Aspect_At_Freeze_Point):
6446         Add aspect to list of aspects that don't require delayed analysis.
6447         * sem_prag.adb (Analyze_Pragma): Add case statement for
6448         Pragma_Max_Queue_Length, check semantics, and register arugments
6449         in the respective entry nodes.
6450         * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
6451         and Has_Max_Queue_Length
6452         * snames.ads-tmpl: Add constant for the new aspect-name
6453         Name_Max_Queue_Length and corrasponding pragma.
6455 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6457         * exp_util.adb (Is_Controlled_Function_Call):
6458         Reimplemented. Consider any node which has an entity as the
6459         function call may appear in various ways.
6461 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6463         * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
6464         an unchecked type conversion when performing a view conversion
6465         to/from a private type. In all other cases use a regular type
6466         conversion to ensure that any relevant checks are properly
6467         installed.
6469 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
6471         * sem_prag.adb, sem_ch8.adb: Minor reformatting.
6473 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
6475         * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
6476         error on case expression that is an entity, when coverage is
6477         incomplete and entity has a static value obtained by local
6478         propagation.
6479         (Handle_Static_Predicate): New procedure, subsidiary of
6480         Check_Choices, to handle case alternatives that are either
6481         subtype names or subtype indications involving subtypes that
6482         have static predicates.
6484 2017-01-06  Thomas Quinot  <quinot@adacore.com>
6486         * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
6487         (GNAT.Socket): Add support for Busy_Polling and Generic_Option
6489 2017-01-06  Bob Duff  <duff@adacore.com>
6491         * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
6492         Elaborate_All(P) to P itself. That could happen in obscure cases,
6493         and always introduced a cycle (P body must be elaborated before
6494         P body).
6495         * lib-writ.ads: Comment clarification.
6496         * ali-util.ads: Minor comment fix.
6497         * ali.adb: Minor reformatting.
6499 2017-01-06  Tristan Gingold  <gingold@adacore.com>
6501         * a-exexpr-gcc.adb: Improve comment.
6503 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
6505         * s-linux-mips.ads: Use correct signal and errno constants.
6506         (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
6508 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
6510         * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
6511         * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
6512         sections.
6514 2017-01-01  Eric Botcazou  <ebotcazou@adacore.com>
6516         * gnatvsn.ads: Bump copyright year.
6518 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
6520         * gnat_ugn.texi: Bump @copying's copyright year.
6521         * gnat_rm.texi: Likewise.
6523 Copyright (C) 2017 Free Software Foundation, Inc.
6525 Copying and distribution of this file, with or without modification,
6526 are permitted in any medium without royalty provided the copyright
6527 notice and this notice are preserved.