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