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