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