* sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
[official-gcc.git] / gcc / ada / ChangeLog
blob71927a618bd43ea9457c5db209f4ed9bcd5688b2
1 2017-01-21  Eric Botcazou  <ebotcazou@adacore.com>
3         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
4         optimizations when the type is modular and the offsets are equal.
6 2017-01-20  Thomas Quinot  <quinot@adacore.com>
8         * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
9         message.
11 2017-01-20  Nicolas Roche  <roche@adacore.com>
13         * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
15 2017-01-20  Bob Duff  <duff@adacore.com>
17         * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
18         (etc) optimizations when the type is modular.
20 2017-01-20  Yannick Moy  <moy@adacore.com>
22         * sem_ch6.adb (Move_Pragmas): move some pragmas,
23         but copy the SPARK_Mode pragma instead of moving it.
24         (Build_Subprogram_Declaration): Ensure that the generated spec
25         and original body share the same SPARK_Pragma aspect/pragma.
26         * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
27         procedure to copy SPARK_Mode aspect.
29 2017-01-20  Bob Duff  <duff@adacore.com>
31         * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
32         even in ASIS mode.
33         * sem_ch13.adb (Resolve_Name): Enable setting the entity to
34         Empty even in ASIS mode.
36 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
38         * exp_ch9.adb: minor style fixes in comments.
39         * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
40         relative statement introduces an implicit dependency on
41         Ada.Real_Time.Clock_Time.
42         * sem_util.adb: Minor reformatting.
44 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
46         * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
47         must be treated as delayed aspect even if the expression is
48         a literal, because the aspect affects the freezing and the
49         elaboration of the object to which it applies.
51 2017-01-20  Tristan Gingold  <gingold@adacore.com>
53         * s-osinte-vxworks.ads (Interrup_Range): New subtype.
55 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
57         * lib-xref.adb (Generate_Reference): Do not warn about the
58         presence of a pragma Unreferenced if the entity appears as the
59         actual in a procedure call that does not come from source.
61 2017-01-20  Pascal Obry  <obry@adacore.com>
63         * expect.c, terminals.c: Fix some warnings about unused variables.
64         * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
65         of the runtime.
67 2017-01-20  Bob Duff  <duff@adacore.com>
69         * exp_attr.adb (Constrained): Apply an access check (check that
70         the prefix is not null) when the prefix denotes an object of an
71         access type; that is, when there is an implicit dereference.
73 2017-01-20  Gary Dismukes  <dismukes@adacore.com>
75         * s-rident.ads (constant Profile_Info): Remove
76         No_Calendar from GNAT_Extended_Ravenscar restrictions.
78 2017-01-20  Tristan Gingold  <gingold@adacore.com>
80         *  s-maccod.ads: Add pragma No_Elaboration_Code_All
82 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
84         * ghost.adb (Mark_Ghost_Clause): New routine.
85         (Prune_Node): Do not prune compilation unit nodes.
86         (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
87         This does not touch the node itself, but does prune all its fields.
88         * ghost.ads (Mark_Ghost_Clause): New routine.
89         * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
90         package clause mentions Ghost and non-Ghost packages. Mark a
91         use package clause as Ghost when it mentions a Ghost package.
92         (Analyze_Use_Type): Emit an error when a use type clause mentions
93         Ghost and non-Ghost types. Mark a use type clause as Ghost when
94         it mentions a Ghost type.
95         * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
96         Ghost when it withs a Ghost unit.
98 2017-01-20  Javier Miranda  <miranda@adacore.com>
100         * sem_res.adb (Resolve_Call): If a function call
101         returns a limited view of a type and at the point of the call the
102         function is not declared in the extended main unit then replace
103         it with the non-limited view, which must be available. If the
104         called function is in the extended main unit then no action is
105         needed since the back-end handles this case.
107 2017-01-20  Eric Botcazou  <ebotcazou@adacore.com>
109         * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
110         (Contains_Subprograms_Refs): ...this.  Adjust comment
111         for constants.  (Is_Subp_Or_Const_Ref): Rename into...
112         (Is_Subprogram_Ref): ...this.
113         (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
114         Has_Non_Subprograms_Referencer and adjust comment.  Remove
115         incorrect shortcut for package declarations and bodies.
117 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
119         * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
120         base type differs from that of the completion and the private
121         subtype is an itype (created for a constraint on an access
122         type e.g.), set Delayed_Freeze on both to prevent out-of-scope
123         anomalies in gigi.
125 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
127         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
128         When inheriting the SPARK_Mode of a prior expression function,
129         look at the properly resolved entity rather than the initial
130         candidate which may denote a homonym.
132 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
134         * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
135         Precondition or Postcondition, and the context is pragma
136         Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
137         and suggest the standard names Assertion_Policy /Pre /Post
138         instead.
140 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
142         * sem_ch10.adb, sem_cat.adb: Minor reformatting.
144 2017-01-20  Javier Miranda  <miranda@adacore.com>
146         * sem_ch3.adb (Access_Type_Declaration): Protect access to the
147         Entity attribute.
148         * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
149         * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
150         malformed trees.
152 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
154         * sem_ch13.adb (Analyze_Aspect_Specification, case
155         Dynamic_Predicate): If the entity E is a subtype that inherits
156         a static predicate for its parent P,, the inherited and the
157         new predicate combine in the generated predicate function,
158         and E only has a dynamic predicate.
160 2017-01-20  Tristan Gingold  <gingold@adacore.com>
162         * s-boustr.ads, s-boustr.adb: New package.
163         * Makefile.rtl: Add s-boustr.
165 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
167         * inline.adb (Process_Formals): Qualify the
168         expression of a return statement when it yields a universal type.
170 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
172         * freeze.adb (Freeze_All): Freeze the default
173         expressions of all eligible formal parameters that appear in
174         entries, entry families, and protected subprograms.
176 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
178         * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
179         for illegal inherited Implicit_Dereference aspects with renamed
180         discriminants.
182 2017-01-20  Javier Miranda  <miranda@adacore.com>
184         * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
185         * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
186         * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
187         (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
188         Set_Prev, Tree_Read): Adding assertion.
189         * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
190         * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
191         (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
192         Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
193         Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
194         Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
195         Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
196         Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
197         Set_ListN_With_Parent): Adding assertion.
199 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
201         * sem_prag.adb (Process_Convention): Diagnose properly a pragma
202         import that applies to several homograph subprograms. when one
203         of them is declared by a subprogram body.
205 2017-01-20  Justin Squirek  <squirek@adacore.com>
207         * exp_ch6.adb (Expand_Call): Remove optimization
208         that nulls out calls to null procedures.
210 2017-01-20  Yannick Moy  <moy@adacore.com>
212         * inline.adb (Expand_Inlined_Call): Keep more
213         precise type of actual for inlining whenever possible. In
214         particular, do not switch to the formal type in GNATprove mode in
215         some case where the GNAT backend might require it for visibility.
217 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
219         * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
220         aspect Implicit_Dereference can be inherited by a full view if
221         the partial view has no discriminants, because there is no way
222         to apply the aspect to the partial view.
223         (Build_Derived_Record_Type): If derived type renames discriminants
224         of the parent, the new discriminant inherits the aspect from
225         the old one.
226         * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
227         call through an access discriminant designating a subprogram.
228         * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
229         properly a parameterless call through an access discriminant on
230         the left-hand side of an assignment.
231         * sem_res.adb (resolve): If an interpreation involves a
232         discriminant with an implicit dereference and the expression is an
233         entity, resolution takes place later in the appropriate routine.
234         * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
235         access discriminants that designate a subprogram type.
237 2017-01-20  Pascal Obry  <obry@adacore.com>
239         * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
241 2017-01-20  Yannick Moy  <moy@adacore.com>
243         * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
244         on implicitly with'ed units in GNATprove mode.
245         * sinfo.ads (Implicit_With): Document use of flag for implicitly
246         with'ed units in GNATprove mode.
248 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
250         * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
251         unit Do not report an error on a non-static entity that appears
252         in the context of a spec expression, such as an aspect expression.
254 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
256         * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
257         (Is_Underlying_Full_View): New routine.
258         (Set_Is_Underlying_Full_View): New routine.
259         (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
260         * einfo.ads Add new attribute Is_Underlying_Full_View.
261         (Is_Underlying_Full_View): New routine along with pragma Inline.
262         (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
263         * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
264         class-wide types and underlying full views. The first subtype
265         is used as the working type for all Itypes, not just array base types.
266         (Build_DIC_Procedure_Declaration): Do not consider
267         class-wide types and underlying full views. The first subtype
268         is used as the working type for all Itypes, not just array
269         base types.
270         * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
271         view or an underlying full view without clobbering the attributes
272         of a previous freeze node.
273         (Inherit_Freeze_Node): New routine.
274         * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
275         full view as such.
276         (Build_Underlying_Full_View): Mark an underlying full view as such.
277         * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
278         full view as such.
280 2017-01-20  Yannick Moy  <moy@adacore.com>
282         * sinfo.ads: Document lack of Do_Division_Check flag
283         on float exponentiation.
285 2017-01-19  Javier Miranda  <miranda@adacore.com>
287         * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
288         identifier attribute of a block-statement node. Required to avoid
289         assertion failure when building the new containers library.
291 2017-01-19  Bob Duff  <duff@adacore.com>
293         * exp_ch3.adb: Update comment.
295 2017-01-19  Vincent Celier  <celier@adacore.com>
297         * gprep.adb (Gnatprep): Parse the definition file without
298         "replace in comments" even when switch -C is used.
300 2017-01-19  Justin Squirek  <squirek@adacore.com>
302         * exp_ch9.adb (Is_Pure_Barrier): Create function
303         Is_Count_Attribute to identify an expansion of the 'Count
304         attribute.
306 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
308         * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
309         statements within an element iterator loop are only analyzed
310         agter the loop is rewritten. Within a generic the analysis must
311         be performed in any case to complete name capture.
313 2017-01-19  Bob Duff  <duff@adacore.com>
315         * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
316         before checking for unrecognized pragmas.
317         Initialize Pname on its declarations; that's always good style.
319 2017-01-19  Claire Dross  <dross@adacore.com>
321         * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
322         body into the tree for GNATprove by setting its Parent field. The
323         components invariants of composite types are not checked by
324         the composite type's invariant procedure in GNATprove mode.
325         (Build_Invariant_Procedure_Declaration): Semi-insert the
326         declaration into the tree for GNATprove by setting its Parent
327         field.
328         * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
329         the component invariants to the array type  invariant procedure
330         so that the procedure can be used to  check the array type
331         invariants if any.
332         (Freeze_Record_Type): In GNATprove mode, do
333         not add the component invariants to the record type  invariant
334         procedure so that the procedure can be used to  check the record
335         type invariants if any.
337 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
339         * lib-xref-spark_specific.adb: Minor reformatting.
340         * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
342 2017-01-19  Javier Miranda  <miranda@adacore.com>
344         * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
345         Build_Back_End_Aggregate.
346         (Generate_Aggregate_For_Derived_Type): Code cleanup.
347         (Prepend_Stored_Values): Code cleanup.
349 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
351         * sem_ch6.adb (Analyze_Expression_Function): Check for an
352         incomplete return type after attempting to freeze it, so that
353         other freeze actiona are generated in the proper order.
355 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
357         * sem_aggr.adb (Resolve_Aggregate): If the type is a string
358         type, ie. a type whose component is a character type, and the
359         aggregate is positional, do not convert into a string literal
360         if the index type is not an integer type, because the original
361         type may be required in an enclosing operation.
363 2017-01-19  Bob Duff  <duff@adacore.com>
365         * binde.adb, debug.adb: Enable new elaboration order algorithm
366         by default. -dp switch reverts to the old algorithm.
368 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
370         * sem_ch3.adb Add with and use clauses for Exp_Ch7.
371         (Analyze_Declarations): Create the DIC and Invariant
372         procedure bodies s after all freezing has taken place.
373         (Build_Assertion_Bodies): New routine.
374         * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
375         and Exp_Util.
376         (Analyze_Package_Specification): Remove the
377         generation of the DIC and Invariant procedure bodies. This is
378         now done by Analyze_Declarations.
379         * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
380         procedures are never treated as primitives.
382 2017-01-19  Yannick Moy  <moy@adacore.com>
384         * frontend.adb: Analyze inlined bodies and check elaboration
385         rules in GNATprove mode too.
386         * sem_elab.adb (Delay_Element): Add Boolean component to save
387         indication that call is in SPARK code.  (Check_Elab_Calls):
388         Check elaboration rules in GNATprove mode, and correctly set
389         the current value of SPARK_Mode.
390         * lib-xref-spark_specific.adb
391         (Add_SPARK_Xrefs): Simplify iteration over dereferences.
393 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
395         * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
396         checks on the expression for the high bound of concatenation
397         when checks are disabled, to suppress warnings about potential
398         constraint errors in restricted runtimes.
400 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
402         * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
403         representation-to-position function as inlined.
404         * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
405         the purity of an internally generated entity if it has been
406         explicitly marked as pure for optimization purposes.
407         * exp_aggr.adb: Minor reformatting.
409 2017-01-19  Javier Miranda  <miranda@adacore.com>
411         * exp_ch6.adb (Expand_Call): Remove side effects on
412         actuals that are allocators with qualified expression since the
413         initialization of the object is performed by means of individual
414         statements (and hence it must be done before the call).
416 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
418         * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
419         (Build_Derived_Enumeration_Type): If the derived type inherits a
420         dynamic predicate from its parent, the bounds of the type must
421         freeze because an explicit constraint is constructed for the
422         type and the corresponding range is elaborated now.
424 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
426         * sem_attr.ads: minor fix of inconsistent casing in comment
427         * lib-writ.ads: minor align comments in columns
428         * sem_ch3.adb: Minor reformatting.
429         * spark_xrefs.ads: minor fix typo in SPARK-related comment
430         * table.ads: minor style fix in comment
431         * lib-xref-spark_specific.adb
432         (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
433         * sem_ch12.adb: minor whitespace fix
434         * freeze.adb: Add comment.
435         * sem_util.adb (Unique_Name): for instances of
436         generic subprograms ignore the name of the wrapper package.
438 2017-01-19  Javier Miranda  <miranda@adacore.com>
440         * exp_aggr.adb (Resolve_Record_Aggregate):
441         Factorize code needed for aggregates of limited and unlimited
442         types in a new routine.
443         (Pass_Aggregate_To_Back_End): New subprogram.
445 2017-01-19  Yannick Moy  <moy@adacore.com>
447         * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
449 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
451         * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
452         public, for use elsewhere.
453         * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
454         an Inlined_body, recognize a call that uses object notation
455         and has not been rewritten as a regular call because regular
456         expansion has not taken place.
458 2017-01-19  Bob Duff  <duff@adacore.com>
460         * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
461         in case of generic formal discrete types, because it causes crashes in
462         the compiler when built with assertions on.
464 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
466         * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
467         sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
469 2017-01-19  Bob Duff  <duff@adacore.com>
471         * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
472         Increment Warnings_Detected.  It was decrementing, which is
473         wrong since we just issued a warning message.
474         * binderr.ads (Errors_Detected, Warnings_Detected): Declare
475         these variables to be of subtype Nat instead of Int, because
476         they should never be negative.
478 2017-01-19  Javier Miranda  <miranda@adacore.com>
480         * contracts.adb (Build_Postconditions_Procedure): Replace
481         Generate_C_Code by Modify_Tree_For_C.
482         * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
483         Replace Generate_C_Code by Modify_Tree_For_C.
484         * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
485         Modify_Tree_For_C.
486         * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
487         Generate_C_Code by Modify_Tree_For_C.
488         * exp_ch4.adb (Expand_Allocator_Expression): Replace
489         Generate_C_Code by Modify_Tree_For_C.
490         * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
491         by Modify_Tree_For_C.
492         * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
493         Generate_C_Code by Modify_Tree_For_C.
494         * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
495         by Modify_Tree_For_C.
496         * sinfo.ads (Modify_Tree_For_C): Adding documentation.
498 2017-01-19  Javier Miranda  <miranda@adacore.com>
500         * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
501         subprogram.
502         (Is_Inlinable_Expression_Function): New subprogram.
503         * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
504         to Sem_Util.
505         (Is_Inlinable_Expression_Function): Moved to Sem_Util.
507 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
509         * sem_ch4.adb (Diagnose_Call): Improve error message when a
510         selected component has a prefix that might be interpreted
511         as a parameterless function call, but none of the candidate
512         interpretations is parameterless, and there is a hidden homonym
513         of the prefix that is a package.
514         * sem_ch8.adb (Find_Selected_Component): If the prefix might be
515         interpreted as a parameterless function call and its analysis
516         fails, do not call Analyze_Selected_Component.
518 2017-01-19  Steve Baird  <baird@adacore.com>
520         * sem_util.ads: Add new Use_Full_View Boolean parameter to
521         Get_Index_Bounds.
522         * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
523         calls to a newly-defined Scalar_Range_Of_Right_View function.
525 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
527         * gnat1drv.adb: minor fix of unbalanced parens in comment
528         * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
529         to visible part of the package to allow re-use in GNATprove.
530         * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
531         from repeated code of Traverse_Compilation_Unit.
532         (Traverse_Declaration_Or_Statement): fixed detection of
533         generic subprograms and packages; also, iteration over case
534         statement alternatives rewritten to avoid testing if the first
535         alternative is present (since it must be present due to Ada
536         syntax restrictions).
538 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
540         * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
541         returning by reference not just for subprogram body stubs,
542         but for all subprogram cases.
543         * sem_util.adb: Code reformatting.
544         (Requires_Transient_Scope): Update the call to Results_Differ.
545         (Results_Differ): Update the parameter profile and the associated
546         comment on usage.
548 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
550         * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
551         identifier nodes that do not come from source, to handle properly
552         dimensionality check within an inlined body which inclddes both
553         original operands and rewritten operands. This removes spurious
554         dimensionality errors in the presence of front-end inlining,
555         as well as in SPARK mode.
557 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
559         PR driver/49726
560         * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
562 2017-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
564         * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
566 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
568         * doc/gnat_ugn/getting_started_with_gnat.rst,
569         doc/gnat_ugn/inline_assembler.rst,
570         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
571         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
572         doc/gnat_ugn/about_this_guide.rst,
573         doc/gnat_ugn/platform_specific_information.rst,
574         doc/gnat_ugn/example_of_binder_output.rst,
575         doc/gnat_ugn/gnat_and_program_execution.rst,
576         doc/gnat_ugn/gnat_utility_programs.rst,
577         doc/gnat_ugn/the_gnat_compilation_model.rst,
578         doc/gnat_rm/implementation_defined_attributes.rst,
579         doc/gnat_rm/compatibility_and_porting_guide.rst,
580         doc/gnat_rm/standard_library_routines.rst,
581         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
582         doc/gnat_rm/implementation_defined_pragmas.rst,
583         doc/gnat_rm/the_gnat_library.rst,
584         doc/gnat_rm/obsolescent_features.rst,
585         doc/gnat_rm/about_this_guide.rst,
586         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
587         doc/gnat_rm/implementation_of_ada_2012_features.rst,
588         doc/gnat_rm/interfacing_to_other_languages.rst,
589         doc/gnat_rm/implementation_defined_aspects.rst,
590         doc/gnat_rm.rst: Update documentation.
591         * gnat_rm.texi, gnat_ugn.texi: Regenerated.
593 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
595         * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
596         * scil_ll.adb: Minor style fix in comment.
597         * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
598         even if entity is already set, because the node may be renalyzed
599         after inlining transformations.
601 2017-01-13  Javier Miranda  <miranda@adacore.com>
603         * sem_res.adb (Resolve_Call): Do not establish a transient scope
604         for a call to inlinable expression function (since the call will
605         be replaced by its returned object).
606         * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
607         * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
608         (Expand_Call): For inlinable expression function call replace the
609         call by its returned object.
610         (Is_Inlinable_Expression_Function): New subprogram.
612 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
614         * checks.adb: Minor typo fix and reformatting.
616 2017-01-13  Javier Miranda  <miranda@adacore.com>
618         * contracts.adb (Contract_Only_Subprograms): Remove formal.
619         (Copy_Original_Specification): Removed.
620         (Skip_Contract_Only_Subprogram): Move here checks previously
621         located in the caller of this routine (to leave the code more clean).
622         (Build_Contract_Only_Subprogram): Code cleanup.
623         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
624         (Get_Contract_Only_Missing_Body_Name): Removed.
626 2017-01-13  Javier Miranda  <miranda@adacore.com>
628         * sem_ch6.adb (Cloned_Expression): New subprogram.
629         (Freeze_Expr_Types): Complete previous patch since the expression
630         of an expression-function may have iterators and loops with
631         defining identifiers which, as part of the preanalysis of the
632         expression, may be left decorated with itypes that will not be
633         available in the tree passed to the backend.
635 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
637         * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
638         conversion to Integer of an expression that is an attribute
639         reference 'Pos on an enumeration type.
641 2017-01-13  Bob Duff  <duff@adacore.com>
643         * atree.ads: Minor comment fix.
645 2017-01-13  Justin Squirek  <squirek@adacore.com>
647         * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
648         calls in accessibility check on return statement.
650 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
652         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
653         Ensure that the input body is a subprogram body before trying to
654         determine whether it denoted an expression function.  Note that
655         subprogram body stubs cannot denote expression functions.
657 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
659         * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
660         and typo fixes.
662 2017-01-13  Javier Miranda  <miranda@adacore.com>
664         * einfo.ads (Component_Bit_Offset): Fix documentation.
665         * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
666         on record holes for components with unknown compile-time offsets.
668 2017-01-13  Bob Duff  <duff@adacore.com>
670         * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
671         * g-locfil.ads: Minor comment fix.
673 2017-01-13  Bob Duff  <duff@adacore.com>
675         * binde.adb (Elab_New): New elaboration order algorithm
676         that is expected to cause fewer ABE issues. This is a work in
677         progress. The new algorithm is currently disabled, and can be
678         enable by the -dp switch, or by modifying the Do_Old and Do_New
679         etc. flags and rebuilding. Experimental code is included to
680         compare the results of the old and new algorithms.
681         * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
682         can have multiple of these tables, so the old and new algorithms
683         can coexist.
684         * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
685         parameter of type array. This avoids the global variable, and
686         allows bounds checking (which is normally defeated by the tables
687         packages). It also ensures that the Elab_Order is read-only
688         to Bindgen.
689         * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
690         subprograms that need it, as above.
691         * debug.adb: Document new -dp switch. Modify doc of old -do
692         switch.
693         * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
694         and Bindgen.  Move writing of closure (-R and -Ra switches)
695         to Binde; that's more convenient.
697 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
699         * sem_ch6.adb (Analyze_Expression_Function): If the expression
700         function is a completion, all entities referenced in the
701         expression are frozen. As a consequence, a reference to an
702         uncompleted private type from an enclosing scope is illegal.
704 2017-01-13  Javier Miranda  <miranda@adacore.com>
706         * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
707         (Analyze_Subprogram_Body_Helper): At the occurrence of an
708         expression function declaration that is a completion, its
709         expression causes freezing (AI12-0103).
711 2017-01-13  Vadim Godunko  <godunko@adacore.com>
713         * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
714         Reference functions of Ada.Containers.Indefinite_Holders.
716 2017-01-13  Bob Duff  <duff@adacore.com>
718         * s-os_lib.ads: Minor comment fixes.
720 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
722         * exp_ch3.adb (Default_Initialize_Object): Do not default
723         initialize an object when it is of a task type and restriction
724         No_Tasking is in effect because the initialization is obsolete.
725         * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
726         restriction No_Tasking is in effect.
727         (Build_Master_Renaming): Do not rename a master when restriction
728         No_Tasking is in effect.
730 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
732         * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
733         the legality of An others clause applies as well to a choice in
734         an Iterated_component_ association.
735         (Resolve_Iterated_Component_Association): An others choice
736         is legal.
737         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
738         Iterated_Component_Association is not static.
740 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
742         * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
743         control is passed to the expresion handler before the new mode
744         is set.
745         * sem_ch12.adb (Analyze_Package_Instantiation,
746         Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
747         in case control is passed to the expresion handler before the
748         new mode is set.
750 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
752         * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
753         exp_aggr.adb: Minor reformatting.
755 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
757         * inline.adb: Minor reformatting and typo fix.
759 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
761         * sem_util.ads, sem_util.adb (Choice_List): Move function here
762         from sem_aggr.adb, for use elsewhere.
763         * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
764         * sem_aggr.adb (Resolve_Array_Aggregate): Remove
765         Iterated_Component_Present.
766         * exp_aggr.adb: Use Choice_List throughout, to handle
767         Iterated_Component_Associations.
768         (Gen_Loop): Generate proper loop for an
769         Iterated_Component_Association: loop variable has the identifier
770         of the original association. Generate a loop even for a single
771         component choice, in order to make loop parameter visible in
772         expression.
773         (Flatten): An Iterated_Component_Association is not static.
775 2017-01-13  Yannick Moy  <moy@adacore.com>
777         * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
778         float exponentiation for statically known small negative values
779         is the reciprocal of the exponentiation for the opposite value
780         of the exponent.
781         * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
782         Ensure that the value of float exponentiation for negative values
783         is the reciprocal of the exponentiation for the opposite value
784         of the exponent.
785         * inline.adb (Expand_Inlined_Call): Fix the count
786         for the number of generated gotos.
788 2017-01-13  Yannick Moy  <moy@adacore.com>
790         * inline.adb: Code cleanup.
791         * sem_util.adb (Is_OK_Volatile_Context): Add
792         expression in delay statement as OK for volatile context.
794 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
796         * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
797         mode a choice that is a subtype with a static predicate is
798         replaced by the values it covers. This transformation must not
799         be performed in ASIS mode, to preserve the source for analysis.
801 2017-01-13  Justin Squirek  <squirek@adacore.com>
803         * nlists.ads: Correct minor typo.
805 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
807         * sem_ch13.adb: Minor reformatting and typo fix.
809 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
811         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
812         Iterated_Component_Association is a named association in an
813         array aggregate.
814         * sem_aggr.adb (Resolve_Iterated_Component_Association): New
815         procedure, subsidiary of Resolve_Array_Aggregate, to analyze
816         and resolve the discrete choices and the expression of the
817         new construct.
818         * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
819         Loop_Actions and Box_Present are attributes of
820         N_Iterated_Component_Association nodes. Box_Present is always
821         False in this case.
822         * sprint.adb (Sprint_Node): An Iterated_Component_Association
823         has a Discrete_Choices list, as specified in the RM. A
824         Component_Association for aggregate uses instead a Choices list.
825         We have to live with this small inconsistency because the new
826         construct also has a defining identifier, and there is no way
827         to merge the two node structures.
829 2017-01-13  Yannick Moy  <moy@adacore.com>
831         * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
832         list of pragmas to remove.  Remove pragmas from the list of
833         statements in the body to inline.
834         * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
836 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
838         * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
839         Analyze_Declarations, to analyze and resolve the expressions of
840         aspect specifications in the current declarative list, so that
841         the expressions have proper entity and type info.  This is needed
842         for ASIS when there is no subsequent expansion to generate this
843         semantic information.
844         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
845         original expression, to suppress cascaded errors when expression
846         has been constant-folded.
847         (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
848         ASIS mode, because there is no subsequent expansion to decorate
849         the tree.
851 2017-01-13  Yannick Moy  <moy@adacore.com>
853         * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
854         New function to detect when a call may be inlined or not in
855         GNATprove mode.
856         (Expand_Inlined_Call): Ensure that a temporary
857         is always created in the cases where a type conversion may be
858         needed on an input parameter in GNATprove mode, so that GNATprove
859         sees the check to perform.
860         * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
861         when not applicable due to actual requiring type conversion
862         with possible check but no temporary value can be copied for
863         GNATprove to see the check.
865 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
867         * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
868         exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
869         layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
870         exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
871         exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
872         g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
873         sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
874         prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
875         a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
876         get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
877         g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
878         sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
879         s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
880         contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
881         g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
882         g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
883         a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
884         ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
885         get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
886         prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
887         exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
888         s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
889         a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
890         a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
891         g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
892         par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
893         uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
894         a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
895         statements to reflect the new style for case alternatives. Various
896         code clean up and reformatting.
898 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
900         * exp_util.adb: Minor reformatting.
902 2017-01-13  Yannick Moy  <moy@adacore.com>
904         * exp_spark.adb: Code cleanup.
905         * sem_ch9.adb (Analyze_Delay_Until): Resolve
906         expression so that calls are identified as such inside delay
907         until.
909 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
911         * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
912         * par-ch3.adb (P_Discrete_Choice_List): An
913         Iterated_Component_Association is an array aggregate component.
914         * par-ch4.adb (P_Iterated_Component_Association): New procedure.
915         (Is_Quantified_Expression): New function that performs a lookahead
916         to distinguish quantified expressions from iterated component
917         associations.
918         (P_Aggregate_Or_Paren_Expr): Recognize iterated component
919         associations.
920         (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
921         * sem.adb (Analyze): Handle Iterated_Component_Association.
922         * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
923         component associations.
924         * sinfo.ads, sinfo.adb: Entries for for
925         N_Iterated_Component_Association and its fields.
926         * sprint.adb (Sprint_Node_Actual): Handle
927         N_Iterated_Component_Association.
929 2017-01-13  Justin Squirek  <squirek@adacore.com>
931         * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
932         of the style check until after preanalysis of acutals.
934 2017-01-13  Yannick Moy  <moy@adacore.com>
936         * sem_ch13.adb: Minor reformatting.
937         * par-ch11.adb: minor style fix in whitespace
938         * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
939         reduced to Add_Artificial_ALI_File; style fix in declaration of
940         Text; grammar fix in comment.
941         * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
942         * freeze.adb: Cleanup to pass pragma instead of
943         expression to call.
944         * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
945         replace System'To_Address by equivalent call.
947 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
949         * bindusg.adb: Improve usage output for -f switch.
951 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
953         * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
954         Minor reformatting.
956 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
958         * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
959         treat comparisons on strings as legal in a Static_Predicate.
960         (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
961         a function call that is the expansion of a string comparison.The
962         function call is built when compiling the corresponding predicate
963         function, but the expression has been found legal as a static
964         predicate during earlier analysis.
965         * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
966         properly a function call that is the expansion of a string
967         comparison operation, in order to recover the Static_Predicate
968         expression and apply it to a static argument when needed.
970 2017-01-13  Tristan Gingold  <gingold@adacore.com>
972         * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
973         (Open_Read): Re-implement using Open_Read_No_Exception.
974         (Open_Write): Raise exception in case of error.
975         * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
976         * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
977         reaise exception.
978         * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
980 2017-01-13  Yannick Moy  <moy@adacore.com>
982         * checks.adb: Code cleanup.
984 2017-01-13  Yannick Moy  <moy@adacore.com>
986         * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
987         expression instead of unanalyzed aspect expression for checking
988         the validity of inheriting an operation. Also copy the expression
989         being passing it to Build_Class_Wide_Expression, as this call
990         modifies its argument.
991         * sem_util.ads Fix comment to reference correct function name
992         New_Copy_Tree.
994 2017-01-13  Javier Miranda  <miranda@adacore.com>
996         * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
997         when we propagate information about the indexes back to the original
998         indexing mode and the prefix of the index is a function call, do not
999         remove any parameter from such call.
1001 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1003         * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
1004         * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
1005         a build-in-place function whose result type is tagged.
1007 2017-01-13  Yannick Moy  <moy@adacore.com>
1009         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
1010         Do not generate a wrapper when the only candidate is a class-wide
1011         subprogram.
1012         (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
1013         inside a generic context.
1015 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1017         * exp_util.adb (Add_Inherited_Tagged_DIC):
1018         Pass the object parameters of both the parent and the derived
1019         type DIC procedure to the reference replacement circuitry.
1020         (Find_DIC_Type): Modify the circuitry to present the partial
1021         view of a private type in case the private type defines its own
1022         DIC pragma.
1023         (Replace_Object_And_Primitive_References): Add two
1024         optional formal parameters.  Update the comment on usage. Update
1025         the replacement of references to object parameters.
1027 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1029         * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
1031 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1033         * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
1034         an out parameter that is a type conversion, independently of th
1035         range check that may apply to the expression of the conversion,
1036         for use in GNATProve.
1038 2017-01-13  Yannick Moy  <moy@adacore.com>
1040         * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
1041         GNATprove_Mode here to Frontend.
1042         * frontend.adb (Frontend): Move the implicit with for System
1043         in GNATprove_Mode here as it ismore correct this way; the old
1044         place only worked by chance, since there were no overloaded names.
1045         * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
1046         * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
1047         four attributes identified in SRM 9(18), add an implicit with
1048         to Ada.Task_Identification.
1049         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
1050         Deal specially with the wrapper introduced for AI05-0071 in GNATprove
1051         mode.
1052         * checks.adb (Apply_Discriminant_Check,
1053         Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
1054         In GNATprove mode, we do not apply the checks, but we still
1055         analyze the expression to possibly issue errors on SPARK
1056         code when a run-time error can be detected at compile time.
1057         (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
1058         in GNATprove mode.
1060 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1062         * expander.adb (Expand): Add a warning about using return
1063         statements in Ghost management code.
1064         * exp_ch3.adb (Freeze_Type): Add a warning about using return
1065         statements in Ghost management code.
1066         * exp_ch7.adb (Build_Invariant_Procedure_Body,
1067         Build_Invariant_Procedure_Declaration): Add a warning about
1068         using return statements in Ghost management code.
1069         * exp_disp.adb (Make_DT): Add a warning about using return
1070         statements in Ghost management code.
1071         * exp_util.adb (Build_DIC_Procedure_Body,
1072         Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
1073         warning about using return statements in Ghost management code.
1074         * freeze.adb (Freeze_Entity): Add a warning about using return
1075         statements in Ghost management code.
1076         * sem.adb (Analyze, Do_Analyze): Add a warning about using return
1077         statements in Ghost management code.
1078         * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
1079         a warning about using return statements in Ghost management code.
1080         * sem_ch5.adb (Analyze_Assignment): Add a warning about using
1081         return statements in Ghost management code.
1082         * sem_ch6.adb (Analyze_Procedure_Call,
1083         Analyze_Subprogram_Body_Helper): Add a warning about using return
1084         statements in Ghost management code.
1085         * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
1086         using return statements in Ghost management code.
1087         * sem_ch12.adb (Analyze_Package_Instantiation,
1088         Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
1089         Instantiate_Subprogram_Body): Add a warning about using return
1090         statements in Ghost management code.
1091         * sem_ch13.adb (Build_Predicate_Functions,
1092         Build_Predicate_Function_Declarations): Add a warning about
1093         using return statements in Ghost management code.
1094         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
1095         Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
1096         Analyze_Pre_Post_Condition_In_Decl_Part):  Add a warning about
1097         using return statements in Ghost management code.
1099 2017-01-13  Tristan Gingold  <gingold@adacore.com>
1101         * s-mmosin-mingw.adb: Fix pragma import.
1103 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
1105         * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
1106         codepeer mode.
1108 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1110         * atree.adb (Allocate_Initialize_Node): A newly created node is
1111         no longer marked as Ghost at this level.
1112         (Mark_New_Ghost_Node): New routine.
1113         (New_Copy): Mark the copy as Ghost.
1114         (New_Entity): Mark the entity as Ghost.
1115         (New_Node): Mark the node as Ghost.
1116         * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
1117         apply to unanalyzed entities.
1118         (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
1119         entities.
1120         (Set_Is_Checked_Ghost_Entity): This attribute now
1121         applies to all entities as well as unanalyzed entities.
1122         (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
1123         all entities as well as unanalyzed entities.
1124         * expander.adb Add with and use clauses for Ghost.
1125         (Expand): Install and revert the Ghost region associated with the node
1126         being expanded.
1127         * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
1128         (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
1129         (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
1130         (Expand_Freeze_Record_Type): Remove all Ghost-related code.
1131         (Freeze_Type): Install and revert the Ghost region associated
1132         with the type being frozen.
1133         * exp_ch5.adb Remove with and use clauses for Ghost.
1134         (Expand_N_Assignment_Statement): Remove all Ghost-related code.
1135         * exp_ch6.adb Remove with and use clauses for Ghost.
1136         (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
1137         (Expand_N_Subprogram_Body): Remove all Ghost-related code.
1138         * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
1139         Ghost region of the working type.
1140         (Build_Invariant_Procedure_Declaration): Install and revert
1141         the Ghost region of the working type.
1142         (Expand_N_Package_Body): Remove all Ghost-related code.
1143         * exp_ch8.adb Remove with and use clauses for Ghost.
1144         (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
1145         code.
1146         (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
1147         (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
1148         (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
1149         code.
1150         * exp_ch13.adb Remove with and use clauses for Ghost.
1151         (Expand_N_Freeze_Entity): Remove all Ghost-related code.
1152         * exp_disp.adb (Make_DT): Install and revert the Ghost region of
1153         the tagged type. Move the generation of various entities within
1154         the Ghost region of the type.
1155         * exp_prag.adb Remove with and use clauses for Ghost.
1156         (Expand_Pragma_Check): Remove all Ghost-related code.
1157         (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
1158         (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
1159         (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
1160         * exp_util.adb (Build_DIC_Procedure_Body): Install
1161         and revert the Ghost region of the working types.
1162         (Build_DIC_Procedure_Declaration): Install and revert the
1163         Ghost region of the working type.
1164         (Make_Invariant_Call): Install and revert the Ghost region of the
1165         associated type.
1166         (Make_Predicate_Call): Reimplemented. Install and revert the
1167         Ghost region of the associated type.
1168         * freeze.adb (Freeze_Entity): Install and revert the Ghost region
1169         of the entity being frozen.
1170         (New_Freeze_Node): Removed.
1171         * ghost.adb Remove with and use clauses for Opt.
1172         (Check_Ghost_Completion): Update the parameter profile
1173         and all references to formal parameters.
1174         (Ghost_Entity): Update the comment on usage.
1175         (Install_Ghost_Mode): New routines.
1176         (Is_Ghost_Assignment): New routine.
1177         (Is_Ghost_Declaration): New routine.
1178         (Is_Ghost_Pragma): New routine.
1179         (Is_Ghost_Procedure_Call): New routine.
1180         (Is_Ghost_Renaming): Removed.
1181         (Is_OK_Declaration): Reimplemented.
1182         (Is_OK_Pragma): Reimplemented.
1183         (Is_OK_Statement): Reimplemented.
1184         (Is_Subject_To_Ghost): Update the comment on usage.
1185         (Mark_And_Set_Ghost_Assignment): New routine.
1186         (Mark_And_Set_Ghost_Body): New routine.
1187         (Mark_And_Set_Ghost_Completion): New routine.
1188         (Mark_And_Set_Ghost_Declaration): New routine.
1189         (Mark_And_Set_Ghost_Instantiation): New routine.
1190         (Mark_And_Set_Ghost_Procedure_Call): New routine.
1191         (Mark_Full_View_As_Ghost): Removed.
1192         (Mark_Ghost_Declaration_Or_Body): New routine.
1193         (Mark_Ghost_Pragma): New routine.
1194         (Mark_Ghost_Renaming): New routine.
1195         (Mark_Pragma_As_Ghost): Removed.
1196         (Mark_Renaming_As_Ghost): Removed.
1197         (Propagate_Ignored_Ghost_Code): Update the comment on usage.
1198         (Prune_Node): Freeze nodes no longer need special pruning, they
1199         are processed by the general ignored Ghost code mechanism.
1200         (Restore_Ghost_Mode): New routine.
1201         (Set_Ghost_Mode): Reimplemented.
1202         (Set_Ghost_Mode_From_Entity): Removed.
1203         * ghost.ads Add with and use clauses for Ghost.
1204         (Check_Ghost_Completion): Update the parameter profile
1205         along with the comment on usage.
1206         (Install_Ghost_Mode): New routine.
1207         (Is_Ghost_Assignment): New routine.
1208         (Is_Ghost_Declaration): New routine.
1209         (Is_Ghost_Pragma): New routine.
1210         (Is_Ghost_Procedure_Call): New routine.
1211         (Mark_And_Set_Ghost_Assignment): New routine.
1212         (Mark_And_Set_Ghost_Body): New routine.
1213         (Mark_And_Set_Ghost_Completion): New routine.
1214         (Mark_And_Set_Ghost_Declaration): New routine.
1215         (Mark_And_Set_Ghost_Instantiation): New routine.
1216         (Mark_And_Set_Ghost_Procedure_Call): New routine.
1217         (Mark_Full_View_As_Ghost): Removed.
1218         (Mark_Ghost_Pragma): New routine.
1219         (Mark_Ghost_Renaming): New routine.
1220         (Mark_Pragma_As_Ghost): Removed.
1221         (Mark_Renaming_As_Ghost): Removed.
1222         (Restore_Ghost_Mode): New routine.
1223         (Set_Ghost_Mode): Redefined.
1224         (Set_Ghost_Mode_From_Entity): Removed.
1225         * sem.adb (Analyze): Install and revert the Ghost region of the
1226         node being analyzed.
1227         (Do_Analyze): Change the way a clean Ghost
1228         region is installed and reverted.
1229         * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
1230         all Ghost-related code.
1231         (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
1232         (Analyze_Number_Declaration): Remove all Ghost-related code.
1233         (Analyze_Object_Declaration): Install and revert the Ghost region of
1234         a deferred object declaration's completion.
1235         (Array_Type_Declaration): Remove all Ghost-related code.
1236         (Build_Derived_Type): Update the comment on
1237         the propagation of Ghost attributes from a parent to a derived type.
1238         (Derive_Subprogram): Remove all Ghost-related code.
1239         (Make_Class_Wide_Type): Remove all Ghost-related code.
1240         (Make_Implicit_Base): Remove all Ghost-related code.
1241         (Process_Full_View): Install and revert the Ghost region of
1242         the partial view.  There is no longer need to check the Ghost
1243         completion here.
1244         * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
1245         region of the left hand side.
1246         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
1247         all Ghost-related code.
1248         (Analyze_Expression_Function): Remove all Ghost-related code.
1249         (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
1250         (Analyze_Procedure_Call): Install and revert the Ghost region of
1251         the procedure being called.
1252         (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
1253         region of the spec or body.
1254         (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
1255         (Build_Subprogram_Declaration): Remove all Ghost-related code.
1256         (Find_Corresponding_Spec): Remove all Ghost-related code.
1257         (Process_Formals): Remove all Ghost-related code.
1258         * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
1259         the Ghost region of the spec.
1260         (Analyze_Package_Declaration): Remove all Ghost-related code.
1261         * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
1262         Ghost when it aliases a Ghost entity.
1263         (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
1264         a Ghost entity.
1265         (Analyze_Object_Renaming): Mark a renaming as Ghost when
1266         it aliases a Ghost entity.
1267         (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
1268         a Ghost entity.
1269         (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
1270         aliases a Ghost entity.
1271         * sem_ch11.adb Remove with and use clauses for Ghost.
1272         (Analyze_Exception_Declaration): Remove all Ghost-related code.
1273         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
1274         Ghost-related code.
1275         (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
1276         code.
1277         (Analyze_Package_Instantiation): Install and revert the Ghost region
1278         of the package instantiation.
1279         (Analyze_Subprogram_Instantiation): Install
1280         and revert the Ghost region of the subprogram instantiation.
1281         (Instantiate_Package_Body): Code clean up. Install and revert the
1282         Ghost region of the package body.
1283         (Instantiate_Subprogram_Body): Code clean up. Install and revert the
1284         Ghost region of the subprogram body.
1285         * sem_ch13.adb (Build_Predicate_Functions): Install
1286         and revert the Ghost region of the related type.
1287         (Build_Predicate_Function_Declaration): Code clean up. Install
1288         and rever the Ghost region of the related type.
1289         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
1290         Install and revert the Ghost region of the pragma.
1291         (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
1292         Ghost region of the pragma.
1293         (Analyze_Pragma): Install and revert the Ghost region of various
1294         pragmas.  Mark a pragma as Ghost when it is related to a Ghost entity
1295         or encloses a Ghost entity.
1296         (Analyze_Pre_Post_Condition): Install and revert the Ghost
1297         region of the pragma.
1298         (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
1299         Ghost region of the pragma.
1300         * sem_res.adb (Resolve): Remove all Ghost-related code.
1301         * sem_util.adb (Is_Declaration): Reimplemented.
1302         (Is_Declaration_Other_Than_Renaming): New routine.
1303         * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
1304         * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
1305         (Is_Ghost_Pragma): Removed.
1306         (Is_Ignored_Ghost_Pragma): New routine.
1307         (Set_Is_Checked_Ghost_Pragma): New routine.
1308         (Set_Is_Ghost_Pragma): Removed.
1309         (Set_Is_Ignored_Ghost_Pragma): New routine.
1310         * sinfo.ads: Update the documentation on Ghost mode and
1311         Ghost regions.  New attributes Is_Checked_Ghost_Pragma
1312         and Is_Ignored_Ghost_Pragma along with usages in nodes.
1313         Remove attribute Is_Ghost_Pragma along with usages in nodes.
1314         (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
1315         (Is_Ghost_Pragma): Removed along with pragma Inline.
1316         (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
1317         (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
1318         (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
1319         (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
1321 2017-01-12  Tristan Gingold  <gingold@adacore.com>
1323         * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
1324         s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
1326 2017-01-12  Yannick Moy  <moy@adacore.com>
1328         * errout.adb, errout.ads (Initialize): Factor common treatment
1329         in Reset_Warnings.
1330         (Reset_Warnings): New procedure to reset counts related to warnings.
1331         (Record_Compilation_Errors): New variable to store the presence of an
1332         error, used in gnat2why to allow changing the Warning_Mode.
1333         (Compilation_Errors): Use new variable Record_Compilation_Errors to
1334         store the presence of an error.
1336 2017-01-12  Javier Miranda  <miranda@adacore.com>
1338         * sem_ch13.adb (Analyze_Aspect_Specifications):
1339         For Interrupt_Handler and Attach_ Handler aspects, decorate the
1340         internally built reference to the protected procedure as coming
1341         from sources and force its analysis.
1343 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
1345         * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
1346         inherit predicates if any from the first_subtype of the parent,
1347         not from the anonymous parent type.
1348         * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
1349         predicate is not a static subtype.
1351 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
1353         * freeze.adb (Check_Suspicious_Convention): New procedure
1354         performing a warning check on discriminated record types with
1355         convention C or C++. Factored out of procedure Freeze_Record_Type,
1356         and changed to only apply to base types (to avoid spurious
1357         warnings on subtypes). Minor improvement of warning messages
1358         to refer to discriminated rather than variant record types.
1359         (Freeze_Record_Type): Remove code for performing a suspicious
1360         convention check.
1361         (Freeze_Entity): Only call Freeze_Record_Type
1362         on types that aren't declared within any enclosing generic units
1363         (rather than just excluding the type when the innermost scope
1364         is generic). Call Check_Suspicious_Convention whether or not
1365         the type is declared within a generic unit.
1366         * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
1367         * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
1368         from Sem_Ch8).
1370 2017-01-12  Tristan Gingold  <gingold@adacore.com>
1372         * sysdep.c, adaint.c, rtinit.c, ming32.h:
1373         (__gnat_current_codepage): Renamed from CurrentCodePage
1374         (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
1376 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
1378         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
1379         quantified expressions, following AI12-050: the loop parameters
1380         of two quantified expressions are conformant if they have the
1381         same identifier.
1383 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
1385         * gcc-interface/Makefile.in: Clean up VxWorks targets.
1387 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
1389         * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
1390         Hnadle properly the attribute reference when it appears as part
1391         of an expression in another loop aspect.
1393 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
1395         * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
1396         subsidiary of Build_Initialization_Call, to complete generation
1397         of predicate checks on discriminants whose (sub)types have
1398         predicates, and to add checks on variants that do not have an
1399         others clause.
1400         * sem_util.adb (Gather_Components): A missing Others alternative is
1401         not an error when the type of the discriminant is a static predicate
1402         (and coverage has been checked when analyzing the case statement). A
1403         runtime check is generated to verify that a given discriminant
1404         satisfies the predicate (RM 3.8.1. (21.1/2)).
1406 2017-01-12  Yannick Moy  <moy@adacore.com>
1408         * gnat1drv.adb (Adjust_Global_Switches): Only
1409         perform checking of exception mechanism when generating code.
1411 2017-01-12  Justin Squirek  <squirek@adacore.com>
1413         * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
1414         Remove handling of access component with invariant.
1415         (Build_Invariant_Procedure_Declaration): Remove return on class
1416         wide type.
1417         * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
1418         conditional exception for component or array so Has_Own_Invariants
1419         flag is not falsly set.
1420         * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
1421         wide type to have no invariant flags.
1423 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
1425         * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
1426         sem_ch13.adb: Minor reformatting.
1428 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
1430         * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
1431         adjustment primitive when the ancestor type was not properly frozen.
1432         (Gen_Assign): Guard against a missing initialization
1433         primitive when the component type was not properly frozen.
1434         (Initialize_Array_Component): Guard against a missing adjustment
1435         primitive when the component type was not properly frozen.
1436         (Initialize_Record_Component): Guard against a missing adjustment
1437         primitive when the component type was not properly frozen.
1438         (Process_Transient_Component_Completion): The transient object may
1439         not be finalized when its associated type was not properly frozen.
1440         * exp_ch3.adb (Build_Assignment): Guard against a missing
1441         adjustment primitive when the component type was not properly frozen.
1442         (Build_Initialization_Call): Guard against a missing
1443         initialization primitive when the associated type was not properly
1444         frozen.
1445         (Expand_N_Object_Declaration): Guard against a missing
1446         adjustment primitive when the base type was not properly frozen.
1447         (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
1448         body when there is no adjustment primitive available. Create an
1449         empty Deep_Finalize body when there is no finalization primitive
1450         available.
1451         * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
1452         missing finalization primitive when the designated type was
1453         not properly frozen.
1454         (Expand_N_Allocator): Guard against a missing initialization primitive
1455         when the designated type was not properly frozen.
1456         * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
1457         only when the corresponding adjustment primitive is available.
1458         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
1459         adjustment/finalization statements only when there is an available
1460         primitive to carry out the action.
1461         (Build_Initialize_Statements): Generate the initialization/finalization
1462         statements only when there is an available primitive to carry out the
1463         action.
1464         (Make_Adjust_Call): Do not generate a call when the underlying
1465         type is not present due to a possible missing full view.
1466         (Make_Final_Call): Do not generate a call when the underlying
1467         type is not present due to a possible missing full view.
1468         (Make_Finalize_Address_Stmts): Generate an empty body when the
1469         designated type lacks a finalization primitive.
1470         (Make_Init_Call): Do not generate a call when the underlying type is
1471         not present due to a possible missing full view.
1472         (Process_Component_For_Adjust): Add the adjustment call only when the
1473         corresponding adjustment primitive is available.
1474         (Process_Component_For_Finalize): Add the finalization call only when
1475         the corresponding finalization primitive is available.
1476         (Process_Object_Declaration): Use a null statement to emulate a
1477         missing call to the finalization primitive of the object type.
1478         * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
1479         (Make_Final_Call): Update the comment on usage.
1480         (Make_Init_Call): Update the comment on usage.
1481         * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
1483 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
1485         * einfo.ads: Update documentation of Address_Taken.
1486         * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
1487         [Access_Attribute]): Only consider 'Access/'Unchecked_Access
1488         for subprograms when setting Address_Taken flag.
1490 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
1492         * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
1493         Configurable_Run_Time_Mode off when analysing with'ed predefined
1494         libraries.
1496 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
1498         * sem_prag.adb: Minor reformatting.
1499         * sem_util.adb (Unique_Entity): fix result for
1500         bodies of entry families.
1502 2017-01-12  Justin Squirek  <squirek@adacore.com>
1504         * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
1505         Resolve_Suppressible in the pragma Assertion_Policy case.
1506         (Resolve_Suppressible): Created this function to factor out
1507         common code used to resolve Suppress to either Ignore or Check
1508         * snames.ads-tmpl: Add name for Suppressible.
1510 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
1512         * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
1513         reformatting.
1514         * debug.adb: Minor comment fixes.
1516 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
1518         * sem_util.adb (Unique_Entity): For concurrent
1519         bodies that are defined with stubs and complete a declaration
1520         of a single concurrent object return the entity of an implicit
1521         concurrent type, not the entity of the anonymous concurrent
1522         object.
1523         * debug.adb: -gnatd.J is no longer used.
1524         * make.adb (Globalize): Removed, no longer used.
1525         * sem_ch9.adb: minor typo in comment for entry index
1527 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
1529         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
1530         * exp_ch3.adb (Build_Init_Statements): As part of initialising
1531         the value record of a task, set its _Secondary_Stack_Size field
1532         if present.
1533         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
1534         a _Secondary_Stack_Size field in the value record of
1535         the task if a Secondary_Stack_Size rep item is present.
1536         (Make_Task_Create_Call): Include secondary stack size
1537         parameter. If No_Secondary_Stack restriction is in place, passes
1538         stack size of 0.
1539         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
1540         Secondary_Stack_Size.
1541         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
1542         function to define the overhead of the secondary stack.
1543         * s-tarest.adb (Create_Restricted_Task,
1544         Create_Restricted_Task_Sequential): Functions now include
1545         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
1546         * s-tarest.adb (Create_Restricted_Task,
1547         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
1548         include Secondary_Stack_Size parameter.
1549         (Task_Wrapper): Secondary stack now allocated to the size specified by
1550         the Secondary_Stack_Size parameter in the task's ATCB.
1551         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
1552         Secondary_Stack_Size component.
1553         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
1554         Create_Restricted_Task_Sequential): Function now include
1555         Secondary_Stack_Size parameter.
1556         (Task_Wrapper): Secondary stack now allocated to the size
1557         specified by the Secondary_Stack_Size parameter in the task's
1558         ATCB.
1559         * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
1560         to include Secondary_Stack_Size parameter.
1561         * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
1562         Secondary_Stack_Size aspect, turning the aspect into its corresponding
1563         internal attribute.
1564         (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
1565         * snames.adb-tmpl, snames.ads-tmpl: Added names
1566         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1567         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1569 2017-01-12  Yannick Moy  <moy@adacore.com>
1571         * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
1572         subtree.
1574 2017-01-12  Justin Squirek  <squirek@adacore.com>
1576         * exp_attr.adb (Expand_N_Attribute_Reference):
1577         Fix Finalization_Size case by properly resolving the type after
1578         rewritting the node.
1580 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
1582         * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
1583         the tree.
1584         (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
1585         * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
1586         exp_sel.ads: Minor reformatting.
1588 2017-01-12  Justin Squirek  <squirek@adacore.com>
1590         * exp_ch6.adb (Expand_Call): Add guard to prevent
1591         invariant checks from being created for internally generated
1592         subprograms.
1594 2017-01-12  Bob Duff  <duff@adacore.com>
1596         * lib-writ.ads: Remove incorrect comment.
1598 2017-01-12  Javier Miranda  <miranda@adacore.com>
1600         * debug.adb (-gnatd.K): Enable generation of contract-only
1601         procedures in CodePeer mode.
1602         * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
1603         New subprogram.
1604         (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
1605         set.
1606         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
1607         subprogram.
1608         (Get_Contract_Only_Missing_Body_Name): New subprogram.
1609         (Get_Contract_Only_Body): New subprogram.
1610         (Set_Contract_Only_Body): New subprogram.
1611         (Is_Contract_Only_Body): New subprogram.
1612         (Set_Is_Contract_Only_Body): New subprogram.
1613         (SCIL_Nodes): Replace table by hash-table.
1615 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
1617         * exp_ch6.adb: Minor reformatting.
1618         * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
1620 2017-01-12  Bob Duff  <duff@adacore.com>
1622         * binde.adb (Forced): New reason for a dependence.
1623         (Force_Elab_Order): Implementation of the new switch.
1624         * binde.ads: Minor comment fixes.
1625         * bindusg.adb: Add -f switch. Apparently, there was an -f switch
1626         long ago that is no longer supported; removed comment about that.
1627         * opt.ads (Force_Elab_Order_File): Name of file specified for
1628         -f switch.
1629         * switch-b.adb: Parse -f switch.
1631 2017-01-12  Justin Squirek  <squirek@adacore.com>
1633         * exp_ch6.adb (Check_View_Conversion): Created this function
1634         to properly chain calls to check type invariants that may be
1635         present in a subprogram call after the subprogram.
1636         (Expand_Call): Add a conditional to identify when a view conversion
1637         needs to be checked.
1638         * nlists.adb, nlists.ads (Prepend_New): New routine.
1639         (Prepend_New_To): New routine.
1641 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
1643         * sinfo.ads: Minor reformatting.
1645 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
1647         * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
1648         reformatting.
1650 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
1652         * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
1653         variable Definite. Create a local object and pass its 'Access to the
1654         BIP function when the result type is either definite or it does not
1655         require any finalization or secondary stack management.
1657 2017-01-12  Bob Duff  <duff@adacore.com>
1659         * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
1660         exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
1661         frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
1662         par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
1663         sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
1664         sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
1665         sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1666         sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
1667         Change name to Pragma_Name_Unmapped.
1668         (Pragma_Name_Mapped): Change name to Pragma_Name.
1669         This is because the "mapped" version should be the usual case.
1671 2017-01-09  Hristian Kirtchev  <kirtchev@adacore.com>
1673         * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
1674         Is_Default_Init_Cond_Procedure, and
1675         Has_Inherited_Default_Init_Cond.  Add uses of flags
1676         Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
1677         (Default_Init_Cond_Procedure): Removed.
1678         (DIC_Procedure): New routine.
1679         (Has_Default_Init_Cond): Removed.
1680         (Has_DIC): New routine.
1681         (Has_Inheritable_Invariants): The attribute applies to the base type.
1682         (Has_Inherited_Default_Init_Cond): Removed.
1683         (Has_Inherited_DIC): New routine.
1684         (Has_Inherited_Invariants): The attribute applies to the base type.
1685         (Has_Own_DIC): New routine.
1686         (Has_Own_Invariants): The attribute applies to the base type.
1687         (Is_Default_Init_Cond_Procedure): Removed.
1688         (Is_DIC_Procedure): New routine.
1689         (Set_Default_Init_Cond_Procedure): Removed.
1690         (Set_DIC_Procedure): New routine.
1691         (Set_Has_Default_Init_Cond): Removed.
1692         (Set_Has_Inheritable_Invariants): The attribute applies
1693         to the base type.
1694         (Set_Has_Inherited_Default_Init_Cond): Removed.
1695         (Set_Has_Inherited_DIC): New routine.
1696         (Set_Has_Inherited_Invariants): The attribute applies to the base type.
1697         (Set_Has_Own_DIC): New routine.
1698         (Set_Has_Own_Invariants): The attribute applies to the base type.
1699         (Set_Is_Default_Init_Cond_Procedure): Removed.
1700         (Set_Is_DIC_Procedure): New routine.
1701         (Write_Entity_Flags): Update the output of all flags related to
1702         default initial condition.
1703         * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
1704         of the call to the DIC procedure.
1705         (Freeze_Type): Generate the body of the DIC procedure.
1706         * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
1707         all occurrences of Create_Append with Append_New_To. Do
1708         not generate an invariant procedure for a class-wide type.
1709         The generated body acts as a freeze action of the working type.
1710         (Build_Invariant_Procedure_Declaration): Do not generate an
1711         invariant procedure for a class-wide type.
1712         (Create_Append): Removed.
1713         * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
1714         sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
1715         class-wide pre/postcondition description and data structures from
1716         Sem_Prag.
1717         (Build_Class_Wide_Expression): Moved from Sem_Prag.
1718         (Build_DIC_Call): New routine.
1719         (Build_DIC_Procedure_Body): New routine.
1720         (Build_DIC_Procedure_Declaration): New routine.
1721         (Entity_Hash): Moved from Sem_Prag.
1722         (Find_DIC_Type): New routine.
1723         (Update_Primitives_Mapping): Reimplemented.
1724         (Update_Primitives_Mapping_Of_Types): New routine.
1725         * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
1726         (Build_DIC_Call): New routine.
1727         (Build_DIC_Procedure_Body): New routine.
1728         (Build_DIC_Procedure_Declaration): New routine.
1729         (Update_Primitives_Mapping): Moved from Sem_Prag.
1730         (Update_Primitives_Mapping_Of_Types): New routine.
1731         * nlists.adb (Append_New): New routine.
1732         (Append_New_To): New routine.
1733         * nlists.ads (Append_New): New routine.
1734         (Append_New_To): New routine.
1735         * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
1736         of DIC procedures here. This is now done at the end of the
1737         visible declarations, private declarations, and at the freeze
1738         point of a type.
1739         (Analyze_Private_Extension_Declaration):
1740         A private extension inherits the DIC pragma of a parent type.
1741         (Analyze_Subtype_Declaration): No need to propagate invariant
1742         attributes to a subtype as those apply to the base type.
1743         (Build_Derived_Record_Type): No need to inherit invariants here
1744         as this is now done in Build_Derived_Type.
1745         (Build_Derived_Type): Inherit both the DIC pragma and invariants from
1746         a parent type.
1747         (Process_Full_View): Update the propagation of DIC attributes.
1748         (Propagate_Default_Init_Cond_Attributes): Removed.
1749         * sem_ch7.adb Add with and use clauses for Exp_Util.
1750         (Analyze_Package_Specification): Create the body of the DIC
1751         procedure at the end of the visible and private declarations.
1752         (Preserve_Full_Attributes): Propagate DIC attributes.
1753         * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
1754         DIC attributes.
1755         (Analyze_Task_Type_Declaration): Propagate DIC attributes.
1756         * sem_elab.adb (Check_A_Call): Update the call to
1757         Is_Nontrivial_Default_Init_Cond_Procedure.
1758         * sem_prag.adb Remove the with and use clauses for
1759         GNAT.HTable. Move the handling of class- wide pre/postcondition
1760         description and data structures to Exp_Util.
1761         (Analyze_Pragma): Create the declaration of the DIC procedure. There
1762         is no need to propagate invariant-related attributes at this point
1763         as this is done in Build_Invariant_Procedure_Declaration.
1764         (Build_Class_Wide_Expression): Moved to Exp_Util.
1765         (Entity_Hash): Moved to Exp_Util.
1766         (Update_Primitives_Mapping): Moved to Exp_Util.
1767         * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
1768         (Update_Primitives_Mapping): Moved to Exp_Util.
1769         * sem_util.adb: Remove with and use clauses for Ghost
1770         and Sem_Ch13.
1771         (Build_Default_Init_Cond_Call): Removed.
1772         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
1773         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
1774         (Get_Views): Reimplemented.
1775         (Has_Full_Default_Initialization): Reimplement the section on DIC.
1776         (Inherit_Default_Init_Cond_Procedure): Removed.
1777         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
1778         (Is_Nontrivial_DIC_Procedure): New routine.
1779         (Is_Verifiable_DIC_Pragma): New routine.
1780         (Propagate_DIC_Attributes): New routine.
1781         * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
1782         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
1783         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
1784         (Inherit_Default_Init_Cond_Procedure): Removed.
1785         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
1786         (Is_Nontrivial_DIC_Procedure): New routine.
1787         (Is_Verifiable_DIC_Pragma): New routine.
1788         (Propagate_DIC_Attributes): New routine.
1789         * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
1790         on DIC.
1791         * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
1792         usage in nodes.
1793         (Expression_Copy): New routine along with pragma Inline.
1794         (Set_Expression_Copy): New routine along with pragma Inline.
1796 2017-01-06  Bob Duff  <duff@adacore.com>
1798         * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
1799         "Bind_Main_Program" to "not Bind_For_Library", because otherwise
1800         we won't generate the call to s_stalib_adafinal when the main
1801         is not written in Ada.
1803 2017-01-06  Bob Duff  <duff@adacore.com>
1805         * sem_prag.adb: Minor: remove pragma Warnings.
1807 2017-01-06  Tristan Gingold  <gingold@adacore.com>
1809         * Makefile.rtl: Do not compile s-stchop by default.
1811 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
1813         * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
1814         sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
1815         snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
1816         s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
1817         Reverted previous change for now.
1819 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
1821         * exp_ch3.adb (Build_Initialization_Call): Apply predicate
1822         check to default discriminant value if checks are enabled.
1823         (Build_Assignment): If type of component has static predicate,
1824         apply check to its default value, if any.
1826 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
1828         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
1829         * exp_ch3.adb (Build_Init_Statements): As part of initialising
1830         the value record of a task, set its _Secondary_Stack_Size field
1831         if present.
1832         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
1833         a _Secondary_Stack_Size field in the value record of
1834         the task if a Secondary_Stack_Size rep item is present.
1835         (Make_Task_Create_Call): Include secondary stack size
1836         parameter. If No_Secondary_Stack restriction is in place, passes
1837         stack size of 0.
1838         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
1839         Secondary_Stack_Size.
1840         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
1841         function to define the overhead of the secondary stack.
1842         * s-tarest.adb (Create_Restricted_Task,
1843         Create_Restricted_Task_Sequential): Functions now include
1844         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
1845         * s-tarest.adb (Create_Restricted_Task,
1846         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
1847         now include Secondary_Stack_Size parameter.
1848         (Task_Wrapper):
1849         Secondary stack now allocated to the size specified by the
1850         Secondary_Stack_Size parameter in the task's ATCB.
1851         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
1852         Secondary_Stack_Size component.
1853         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
1854         Create_Restricted_Task_Sequential): Function now include
1855         Secondary_Stack_Size parameter.
1856         (Task_Wrapper): Secondary stack
1857         now allocated to the size specified by the Secondary_Stack_Size
1858         parameter in the task's ATCB.
1859         * sem_ch13.adb (Analyze_Aspect_Specification): Add support
1860         for Secondary_Stack_Size aspect, turning the aspect into its
1861         corresponding internal attribute.
1862         (Analyze_Attribute_Definition):
1863         Process Secondary_Stack_Size attribute.
1864         * snames.adb-tmpl, snames.ads-tmpl: Added names
1865         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1866         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1868 2017-01-06  Pascal Obry  <obry@adacore.com>
1870         * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
1871         Sequential_IO and Direct_IO.
1873 2017-01-06  Bob Duff  <duff@adacore.com>
1875         * snames.ads-tmpl (Renamed): New name for the pragma argument.
1876         * par-ch2.adb: Allow the new pragma (with analysis deferred
1877         to Sem_Prag).
1878         * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
1879         Keep a mapping from new pragma names to old names.
1880         * sem_prag.adb: Check legality of pragma Rename_Pragma, and
1881         implement it by calling Map_Pragma_Name.
1882         * checks.adb, contracts.adb, einfo.adb, errout.adb,
1883         * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
1884         * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
1885         * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
1886         * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
1887         * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1888         * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
1889         as appropriate.
1891 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
1893         * exp_ch9.adb: Minor reformatting.
1895 2017-01-06  Tristan Gingold  <gingold@adacore.com>
1897         * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
1898         * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
1899         (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
1900         (unused).
1901         * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
1902         Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
1903         * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
1904         Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
1906 2017-01-06  Bob Duff  <duff@adacore.com>
1908         * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
1909         dummy implementation of Map_Pragma_Name.
1911 2017-01-06  Tristan Gingold  <gingold@adacore.com>
1913         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
1914         entry_body variable constant.
1915         * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
1916         * s-tpoben.ads (Protected_Entry_Body_Access): Now access
1917         to constant.
1918         * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
1919         now access to constant.
1921 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
1923         * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
1924         reformatting and typo fixes.
1926 2017-01-06  Bob Duff  <duff@adacore.com>
1928         * snames.ads-tmpl: New names for pragma renaming.
1929         * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
1930         * par-prag.adb: Add new pragma name to case statement.
1931         * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
1932         of the pragma.
1933         * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
1934         Dummy implementation of Pragma_Name_Mapped.
1936 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
1938         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
1939         better detect call within an entry_wrapper.
1940         * sem_res.adb (Resolve_Call): A protected call within an
1941         entity_wrapper is analyzed in the context of the protected
1942         object but corresponds to a pre-analysis and is not an access
1943         before elaboration.
1944         * sem_attr.adb: Minor reformatting.
1946 2017-01-06  Justin Squirek  <squirek@adacore.com>
1948         * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
1949         Finalization_Size to allow a prefix of any non-class-wide type.
1950         * sem_attr.ads Modify comment for Finalization_Size to include
1951         definite type use case.
1953 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
1955         * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
1956         on procedures that are wrappers created for entries that have
1957         preconditions.
1958         * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
1959         body is an entry_wrapper, compile it in the context of the
1960         synchronized type, because a precondition may refer to funtions
1961         of the type.
1962         * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
1963         body entity.
1964         * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
1965         within an Entry_Wrapper this is an external call whose target
1966         is the synchronized object that is the actual in the call to
1967         the wrapper.
1969 2017-01-06  Yannick Moy  <moy@adacore.com>
1971         * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
1972         in tree, which means not analyzing the previous prefix if the node has
1973         been rewritten into its prefix.
1975 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
1977         * s-tpobop.adb: Minor reformatting.
1979 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
1981         * checks.adb (Ensure_Valid): Do not generate a validity check
1982         within a generated predicate function, validity checks will have
1983         been applied earlier when required.
1985 2017-01-06  Tristan Gingold  <gingold@adacore.com>
1987         * s-tpoben.ads (Protection_Entries): Add comment and reorder
1988         components for performances.
1989         * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
1990         semantic.
1992 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
1994         * sem_eval.adb (Check_Expression_Against_Static_Predicate):
1995         If expression is compile-time known and obeys a static predicate
1996         it must be labelled as static, to prevent spurious warnings and
1997         run-time errors, e.g. in case statements. This is relevant when
1998         the expression is the result of constant-folding a type conversion
1999         whose expression is a variable with a known static value.
2001 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2003         * exp_attr.adb, sem_attr.ads: Minor reformatting.
2005 2017-01-06  Justin Squirek  <squirek@adacore.com>
2007         * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
2008         expansion of Finalization_Size attribute.
2009         * sem_attr.adb (Analyze_Attribute): Add entry to check the
2010         semantics of Finalization_Size.
2011         (Eval_Attribute): Add null entry for Finalization_Size.
2012         * sem_attr.ads: Add Finalization_Size to the implementation
2013         dependent attribute list.
2014         * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
2016 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2018         * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
2019         iterator specification with a serious syntactic error, transform
2020         construct into an infinite loop in order to continue analysis
2021         and prevent a compiler abort.
2023 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2025         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
2026         max_queue_lengths_array if unused.
2028 2017-01-06  Bob Duff  <duff@adacore.com>
2030         * errout.adb (Set_Msg_Text): Protect against out-of-bounds
2031         array access, in case "\" is at the end of Text.
2032         * stylesw.adb (Set_Style_Check_Options): Don't include input
2033         characters in the error message template, because they could
2034         be control characters such as "\", which Errout will try to
2035         interpret.
2037 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2039         * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
2040         For a private type examine the visible declarations that follow
2041         the partial view, not just the private declarations that follow
2042         the full view.
2044 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2046         * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
2047         code cleanup.
2049 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2051         * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
2052         alias of the inherited op is the parent iterator, no need to
2053         examine dispatch table positions which might not be established
2054         yet if type is not frozen.
2055         * sem_disp.adb (Check_Controlling_Formals): The formal of a
2056         predicate function may be a subtype of a tagged type.
2057         * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
2058         of representation items for the completion of a type extension
2059         where a predicate applies to the partial view.
2060         * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
2061         parameter that designates function whose actual receives a
2062         predicate check, to improve warning message when the check will
2063         lead to infinite recursion.
2064         * sem_res.adb (Resolve_Actuals): Pass additional parameter to
2065         Apply_Predicate_Check.
2067 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2069         * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
2070         Gnat_Extended_Ravenscar.
2071         * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
2073 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
2075         * sem_util.ads: Minor typo fix and reformatting.
2077 2017-01-06  Yannick Moy  <moy@adacore.com>
2079         * ghost.adb Minor fixing of references to SPARK RM.
2080         (Check_Ghost_Context): Check whether reference is to a lvalue
2081         before issuing an error about violation of SPARK RM 6.9(13)
2082         when declaration has Ghost policy Check and reference has Ghost
2083         policy Ignore.
2084         * sem_util.adb Minor indentation.
2085         * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
2086         Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
2087         * sem_util.ads (Unique_Defining_Entity): Document the result
2088         for package body stubs.
2090 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2092         * raise-gcc.c (abort): Macro to call Abort_Propagation.
2093         * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
2094         constant.
2095         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
2096         Do not generate the Entry_Max_Queue_Lengths_Array if all default
2097         values.
2098         * exp_util.adb (Corresponding_Runtime_Package): Consider
2099         Max_Queue_Length pragma.
2101 2017-01-06  Justin Squirek  <squirek@adacore.com>
2103         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
2104         Remove declaration generation in the case of
2105         System_Tasking_Protected_Objects_Single_Entry being used,
2106         and add a warning message when this is detected to occur.
2107         (Make_Initialize_Protection): Remove reference pass in the case
2108         of System_Tasking_Protected_Objects_Single_Entry.
2109         * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
2110         * s-tposen.adb (Initialize_Protection_Entry): Remove
2111         Entry_Queue_Max parameter.
2112         * s-tposen.ads: Remove the types use to store the entry queue
2113         maximum.
2114         * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
2116 2017-01-06  Yannick Moy  <moy@adacore.com>
2118         * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
2119         behavior of function, to also accept out of range positions
2120         and raise Constraint_Error in such case, and to copy sloc from
2121         literal if No_Location passed as location.
2122         * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
2123         of functions to raise Constraint_Error in case of value not in
2124         appropriate range.
2126 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2128         * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
2129         Invalidate_Stack_Cache.
2131 2017-01-06  Eric Botcazou  <ebotcazou@adacore.com>
2133         * s-os_lib.adb: Minor fix to the signature of Readlink.
2135 2017-01-06  Javier Miranda  <miranda@adacore.com>
2137         * sem_ch6.adb (Conforming_Types): Handle another
2138         confusion between views in a nested instance with an actual
2139         private type whose full view is not in scope.
2141 2017-01-06  Arnaud Charlet  <charlet@adacore.com>
2143         * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
2144         mark a rewritten if statement as explicit (Comes_From_Source).
2146 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
2148         * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
2150 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2152         * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
2154 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2156         * sem_case.adb: Minor reformatting.
2158 2017-01-06  Thomas Quinot  <quinot@adacore.com>
2160         * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
2162 2017-01-06  Justin Squirek  <squirek@adacore.com>
2164         * aspects.adb: Register aspect in Canonical_Aspect.
2165         * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
2166         into respective tables.
2167         * einfo.ads, einfo.adb: Add a new attribute for
2168         handling the parameters for Pragma_Max_Entry_Queue
2169         (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
2170         for accessing and setting were added as well.
2171         * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
2172         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
2173         declaration for pramga arguments and store them in the protected
2174         type node.
2175         (Make_Initialize_Protection): Pass a reference to
2176         the Entry_Max_Queue_Lengths_Array in the protected type node to
2177         the runtime.
2178         * rtsfind.adb: Minor grammar fix.
2179         * rtsfind.ads: Register new types taken from the
2180         runtime libraries RE_Protected_Entry_Queue_Max and
2181         RE_Protected_Entry_Queue_Max_Array
2182         * s-tposen.adb, s-tpoben.adb
2183         (Initialize_Protection_Entry/Initialize_Protection_Entries):
2184         Add extra parameter and add assignment to local object.
2185         * s-tposen.ads, s-tpoben.ads: Add new types to
2186         store entry queue maximums and a field to the entry object record.
2187         * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
2188         for Aspect_Max_Queue_Length.
2189         (Check_Aspect_At_Freeze_Point):
2190         Add aspect to list of aspects that don't require delayed analysis.
2191         * sem_prag.adb (Analyze_Pragma): Add case statement for
2192         Pragma_Max_Queue_Length, check semantics, and register arugments
2193         in the respective entry nodes.
2194         * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
2195         and Has_Max_Queue_Length
2196         * snames.ads-tmpl: Add constant for the new aspect-name
2197         Name_Max_Queue_Length and corrasponding pragma.
2199 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2201         * exp_util.adb (Is_Controlled_Function_Call):
2202         Reimplemented. Consider any node which has an entity as the
2203         function call may appear in various ways.
2205 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2207         * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
2208         an unchecked type conversion when performing a view conversion
2209         to/from a private type. In all other cases use a regular type
2210         conversion to ensure that any relevant checks are properly
2211         installed.
2213 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2215         * sem_prag.adb, sem_ch8.adb: Minor reformatting.
2217 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2219         * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
2220         error on case expression that is an entity, when coverage is
2221         incomplete and entity has a static value obtained by local
2222         propagation.
2223         (Handle_Static_Predicate): New procedure, subsidiary of
2224         Check_Choices, to handle case alternatives that are either
2225         subtype names or subtype indications involving subtypes that
2226         have static predicates.
2228 2017-01-06  Thomas Quinot  <quinot@adacore.com>
2230         * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
2231         (GNAT.Socket): Add support for Busy_Polling and Generic_Option
2233 2017-01-06  Bob Duff  <duff@adacore.com>
2235         * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
2236         Elaborate_All(P) to P itself. That could happen in obscure cases,
2237         and always introduced a cycle (P body must be elaborated before
2238         P body).
2239         * lib-writ.ads: Comment clarification.
2240         * ali-util.ads: Minor comment fix.
2241         * ali.adb: Minor reformatting.
2243 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2245         * a-exexpr-gcc.adb: Improve comment.
2247 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
2249         * s-linux-mips.ads: Use correct signal and errno constants.
2250         (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
2252 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
2254         * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
2255         * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
2256         sections.
2258 2017-01-01  Eric Botcazou  <ebotcazou@adacore.com>
2260         * gnatvsn.ads: Bump copyright year.
2262 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
2264         * gnat_ugn.texi: Bump @copying's copyright year.
2265         * gnat_rm.texi: Likewise.
2267 Copyright (C) 2017 Free Software Foundation, Inc.
2269 Copying and distribution of this file, with or without modification,
2270 are permitted in any medium without royalty provided the copyright
2271 notice and this notice are preserved.