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