[Ada] Avoid confusing warning on exception propagation in GNATprove mode
[gcc.git] / gcc / ada / ChangeLog
1 2018-07-17 Yannick Moy <moy@adacore.com>
2
3 * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
4 being propagated in GNATprove mode.
5
6 2018-07-17 Dmitriy Anisimkov <anisimko@adacore.com>
7
8 * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
9 public components of Inet_Addr_Type. Introduce public binary
10 operations.
11
12 2018-07-17 Javier Miranda <miranda@adacore.com>
13
14 * exp_ch7.adb (Make_Transient_Block): When determining whether an
15 enclosing scope already handles the secondary stack, take into account
16 transient blocks nested in a block that do not manage the secondary
17 stack and are located within a loop.
18
19 2018-07-17 Ed Schonberg <schonberg@adacore.com>
20
21 * sem_util.adb (Enclosing_Subprogram): Protected entries and task
22 entries must be treated separately: task entries are within the
23 enclosing subprogram of the task type, while protected entries are
24 transformed into the corresponding Protected_Body_Subprogram, which is
25 the enclosing_subprogram of any subprogram declared within the entry
26 body.
27
28 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
29
30 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
31 sections on -gnatH and -gnatJ compiler switches.
32 * gnat_ugn.texi: Regenerate.
33
34 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
35
36 * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
37 table.
38 * atree.adb: Add a soft link for a procedure which is invoked whenever
39 an ignored Ghost node or entity is created.
40 (Change_Node): Preserve relevant attributes which come from the Flags
41 table.
42 (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
43 entity.
44 (Rewrite): Preserve relevant attributes which come from the Flags
45 table.
46 (Set_Ignored_Ghost_Recording_Proc): New routine.
47 * atree.ads: Define an access-to-suprogram type for a soft link which
48 records a newly created ignored Ghost node or entity.
49 (Set_Ignored_Ghost_Recording_Proc): New routine.
50 * ghost.adb: Remove with and use clause for Lib. Remove table
51 Ignored_Ghost_Units. Add new table Ignored_Ghost_Nodes.
52 (Add_Ignored_Ghost_Unit): Removed.
53 (Initialize): Initialize the table which stores ignored Ghost nodes.
54 Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
55 ignored Ghost node.
56 (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
57 an eliminated ignored Ghost unit.
58 (Lock): Release and lock the table which stores ignored Ghost nodes.
59 (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
60 Ghost nodes.
61 (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
62 ignored Ghost nodes.
63 (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
64 (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
65 Ghost nodes.
66 (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
67 (Propagate_Ignored_Ghost_Code): Removed.
68 (Record_Ignored_Ghost_Node): New routine.
69 (Remove_Ignored_Ghost_Code): Reimplemented.
70 (Remove_Ignored_Ghost_Node): New routine.
71 (Ultimate_Original_Node): New routine.
72 * ghost.ads (Check_Ghost_Completion): Removed.
73 * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
74 package clause as ignored Ghost if applicable.
75 * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
76
77 2018-07-17 Javier Miranda <miranda@adacore.com>
78
79 * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
80 to reuse it.
81 (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
82 of the loop iterator relies on the secondary stack.
83
84 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
85
86 * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
87 which happens for inlined calls, then fetch the next actual from the
88 original AST.
89
90 2018-07-17 Ed Schonberg <schonberg@adacore.com>
91
92 * einfo.ads: Update documentation for Scalar_Range.
93
94 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
95
96 * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
97 the Standard package.
98
99 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
100
101 * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
102
103 2018-07-17 Ed Schonberg <schonberg@adacore.com>
104
105 * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
106 synchronized types that are completions of limited types or private
107 extensions.
108 (Scope_Within): Handle properly accept statements in task bodies.
109
110 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
111
112 * sem_prag.adb (Has_Visible_State): Do not consider generic formals
113 because they are not part of the visible state space. Add constants to
114 the list of acceptable visible states.
115 (Propagate_Part_Of): Do not consider generic formals when propagating
116 the Part_Of indicator.
117 * sem_util.adb (Entity_Of): Do not follow renaming chains which go
118 through a generic formal because they are not visible for SPARK
119 purposes.
120 * sem_util.ads (Entity_Of): Update the comment on usage.
121
122 2018-07-17 Ed Schonberg <schonberg@adacore.com>
123
124 * sem_util.adb (Gather_Components): A discriminant of an ancestor may
125 have been constrained by a later ancestor, so when looking for the
126 value of that hidden discriminant we must examine the stored constraint
127 of other ancestors than the immediate parent type.
128
129 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
130
131 * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
132 constructs and entities within receive new entities when replicating a
133 tree.
134 (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
135 and entities within receive new entities when replicating a tree.
136 * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
137 (Visit_Entity): Visit entities within scoping constructs inside
138 expression with actions nodes when requested by the caller. Add blocks,
139 labels, and procedures to the list of entities which need replication.
140 * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
141 the comment on usage.
142
143 2018-07-17 Arnaud Charlet <charlet@adacore.com>
144
145 * doc/gnat_ugn/about_this_guide.rst,
146 doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
147 * gnat_ugn.texi: Regenerate.
148
149 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
150
151 * contracts.adb (Analyze_Contracts): Add specialized processing for
152 package instantiation contracts.
153 (Analyze_Package_Contract): Remove the verification of a missing
154 Part_Of indicator.
155 (Analyze_Package_Instantiation_Contract): New routine.
156 * contracts.ads (Analyze_Package_Contract): Update the comment on
157 usage.
158 * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
159 instance is being examined when trying to determine whether a package
160 instantiation needs a Part_Of indicator.
161
162 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
163
164 * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
165 sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
166 sem_util.adb: Minor reformatting.
167
168 2018-07-16 Arnaud Charlet <charlet@adacore.com>
169
170 * frontend.adb: Only unnest subprograms if no previous errors were
171 detected.
172
173 2018-07-16 Ed Schonberg <schonberg@adacore.com>
174
175 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
176 contain blocks in the elaboration code for a package body. Create the
177 elaboration subprogram wrapper only if there is a subprogram
178 declaration in a block or loop.
179
180 2018-07-16 Ed Schonberg <schonberg@adacore.com>
181
182 * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
183 deep copy of the left operand when building each conjuct of the
184 expanded membership operation, to avoid sharing nodes between them.
185 This sharing interferes with the unnesting machinery and is generally
186 undesirable.
187
188 2018-07-16 Ed Schonberg <schonberg@adacore.com>
189
190 * exp_unst.adb (Visit_Node): Handle 'Address references that are
191 calls.
192
193 2018-07-16 Ed Schonberg <schonberg@adacore.com>
194
195 * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
196 in relevant nodes: Allocate, Free, and return statements.
197
198 2018-07-16 Ed Schonberg <schonberg@adacore.com>
199
200 * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
201 instance that carries an aspect Default_Storage_Pool that overrides a
202 default storage pool that applies to the generic unit. The aspect in
203 the generic unit was removed before copying it in the instance, rather
204 than removing it from the copy of the aspects that are appended to the
205 aspects in the instance.
206
207 2018-07-16 Ed Schonberg <schonberg@adacore.com>
208
209 * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
210 loop parameters.
211 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
212 bodies.
213 * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
214 entry body to be the corresponding generated subprogram, for correct
215 analysis of uplevel references.
216 * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
217 Ignore pragmas, fix component associations.
218 (Register_Subprograms): Subprograms in synchronized types must be
219 treated as reachable.
220
221 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
222
223 * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
224 states and variables.
225
226 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
227
228 * sinfo.ads, sinfo.adb (Withed_Body): Remove.
229 (Set_Withed_Body): Remove.
230
231 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
232
233 * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
234 when printing debug info.
235
236 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
237
238 * sem.adb (Walk_Library_Items): Reuse local constant.
239 (Is_Subunit_Of_Main): Turn condition to positive and flip the
240 IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
241 Lib variable.
242
243 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
244
245 * sem.adb (Walk_Library_Items): Deconstruct dead code.
246
247 2018-07-16 Ed Schonberg <schonberg@adacore.com>
248
249 * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
250 Expand_Nonbinary_Modular_Op. Needed for unnesting.
251
252 2018-07-16 Ed Schonberg <schonberg@adacore.com>
253
254 * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
255 static predicate (for example True) but has no
256 static_discrete_predicate.
257
258 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
259
260 * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
261 class-wide types and record extensions.
262
263 2018-07-16 Justin Squirek <squirek@adacore.com>
264
265 * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
266 checks on expanded literals within if and case expressions.
267
268 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
269
270 * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
271 longest sequence factor. Code clean up.
272 (Wide_Wide_String_To_String): Use the appropriate longest sequence
273 factor. Code clean up.
274
275 2018-07-16 Javier Miranda <miranda@adacore.com>
276
277 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
278 on Bit_Order when defined for a record extension.
279
280 2018-07-16 Arnaud Charlet <charlet@adacore.com>
281
282 * libgnat/s-objrea.ads: Minor code clean up.
283
284 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
285
286 * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
287 rule.
288
289 2018-07-16 Arnaud Charlet <charlet@adacore.com>
290
291 * adaint.c (__gnat_set_file_time_name): Code clean up.
292
293 2018-07-16 Javier Miranda <miranda@adacore.com>
294
295 * inline.adb (Build_Body_To_Inline): Minor code reorganization that
296 ensures that calls to function Has_Single_Return() pass a decorated
297 tree.
298 (Has_Single_Return.Check_Return): Peform checks on entities (instead on
299 relying on their characters).
300
301 2018-07-16 Javier Miranda <miranda@adacore.com>
302
303 * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
304 to avoid generating an ill-formed tree that confuses gnatprove causing
305 it to blowup.
306
307 2018-07-16 Yannick Moy <moy@adacore.com>
308
309 * inline.adb (Has_Single_Return): Rewrap comment.
310
311 2018-07-16 Eric Botcazou <ebotcazou@adacore.com>
312
313 * einfo.ads: Minor tweak in comment.
314
315 2018-07-16 Javier Miranda <miranda@adacore.com>
316
317 * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
318
319 2018-07-16 Javier Miranda <miranda@adacore.com>
320
321 * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
322 transform 'Count into a function call if the current scope has been
323 eliminated.
324
325 2018-07-16 Javier Miranda <miranda@adacore.com>
326
327 * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
328 public part of this package.
329
330 2018-07-16 Yannick Moy <moy@adacore.com>
331
332 * sem_res.adb (Resolve_Call): Do not inline calls inside
333 compiler-generated functions translated as predicates in GNATprove.
334
335 2018-07-16 Gary Dismukes <dismukes@adacore.com>
336
337 * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
338 addition to the existing test for no Storage_Pool as a condition
339 enabling generation of the call to Check_Standard_Allocator when the
340 restriction No_Standard_Allocators_After_Elaboration is active.
341 * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
342 say that Storage_Error will be raised (rather than Program_Error).
343 * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
344 rather than Program_Error when Elaboration_In_Progress is False.
345
346 2018-07-16 Gary Dismukes <dismukes@adacore.com>
347
348 * sem_eval.adb: Fix spelling for compile-time-known.
349
350 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
351
352 * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
353 the compiler from entering infinite recursion when trying to determine
354 whether a deferred constant has a compile time known value, and the
355 initialization expression of the constant is a reference to the
356 constant itself.
357
358 2018-07-16 Nicolas Roche <roche@adacore.com>
359
360 * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
361 factor from 1/32 to 1/2 for Unbounded_String.
362
363 2018-07-13 Eric Botcazou <ebotcazou@adacore.com>
364
365 * gcc-interface/lang.opt (funsigned-char): New option.
366 * gcc-interface/misc.c (gnat_handle_option): Accept it.
367 * gcc-interface/utils.c (finish_character_type): Tweak comment.
368
369 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
370
371 * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
372 variable and use it throughout.
373 <E_Variable>: If the nominal subtype of the object is unconstrained,
374 compute the Ada size separately and put in on the padding type if the
375 size is not fixed.
376 <E_Record_Type>: Minor tweak.
377 * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
378 into max_size_unit throughout.
379
380 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
381
382 * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
383 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
384 * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
385 (add_decl_expr): Change type of second parameter and rename it.
386 (renaming_from_instantiation_p): New function moved from...
387 (set_expr_location_from_node): Test for exceptions here and add one
388 for actual subtypes built for unconstrained composite actuals.
389 * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
390
391 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
392
393 * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
394 and adjust recursive calls.
395 (Identifier_to_gnu): Adjust calls to lvalue_required_p.
396 (gnat_to_gnu): Likewise.
397
398 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
399
400 * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
401 (gnat_to_gnu_subprog_type): New pure_flag local variable. Set it for
402 a pure Ada function with a by-ref In parameter. Propagate it onto the
403 function type by means of the TYPE_QUAL_RESTRICT flag.
404 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
405 function type has the TYPE_QUAL_RESTRICT flag set.
406
407 2018-07-06 Jim Wilson <jimw@sifive.com>
408
409 * Makefile.rtl: Add riscv*-linux* support.
410 * libgnarl/s-linux__riscv.ads: New.
411 * libgnat/system-linux-riscv.ads: New.
412
413 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
414 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
415 * gcc-interface/Makefile.in (xoscons): Likewise.
416
417 2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
418
419 * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
420 (ZCX_By_Default): Set to True.
421
422 2018-07-02 Martin Liska <mliska@suse.cz>
423
424 * gnatvsn.ads: Bump Library_Version to 9.
425
426 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
427
428 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
429 using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
430 (TYPE_ALIGN_OK): Move around.
431 (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
432 * gcc-interface/decl.c (change_qualified_type): Move to...
433 (gnat_to_gnu_entity): Adjust comment.
434 * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
435 (ceil_pow2): Use ceil_log2.
436 * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
437 and do not set TREE_SIDE_EFFECTS.
438 (handle_noreturn_attribute): Use change_qualified_type.
439
440 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
441
442 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
443 the expression of a dispatch table that is not being defined.
444 <E_Record_Subtype>: Remove obsolete kludge.
445
446 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
447
448 * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
449 for discriminants.
450 (warn_on_list_placement): New static function.
451 (components_to_record): Use it to warn on multiple fields in list.
452
453 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
454
455 * gcc-interface/decl.c (variant_desc): Add AUX field.
456 (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
457 directly.
458 (reverse_sort_field_list): New static function.
459 (components_to_record): Place the variant part at the beginning of the
460 field list when there is an obvious order of increasing position.
461 (build_variant_list): Initialize it.
462 (create_variant_part_from): Do not call compute_record_mode directly.
463 (copy_and_substitute_in_layout): Likewise. Always sort the fields with
464 fixed position in order of increasing position, in the record and all
465 the variants, in any. Call reverse_sort_field_list.
466 * gcc-interface/utils.c (make_packable_type): Compute the sizes before
467 calling finish_record_type. Do not call compute_record_mode directly.
468 (finish_record_type): Overhaul final processing depending on REP_LEVEL
469 and call finish_bitfield_layout if it is equal to one or two.
470
471 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
472
473 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
474 existing fields of a dummy fat pointer type, if any. Clear the
475 TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
476
477 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
478
479 * contracts.adb (Process_Body_Postconditions): Expand only checked
480 postconditions.
481 (Process_Contract_Cases_For): Expand only checked contract cases.
482 (Process_Inherited_Preconditions): Ignored class-wide preconditions are
483 partially expanded because some of their semantic checks are tied to
484 the expansion.
485 (Process_Preconditions_For): Expand only checked preconditions.
486 (Process_Spec_Postconditions): Expand only checked preconditions.
487 Ignored class-wide preconditions are partially expanded because some of
488 their semantic checks are tied to the expansion.
489 * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
490 assertion pragmas.
491 * exp_util.adb (Add_Inherited_Invariants): Code clean up.
492 * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
493
494 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
495
496 * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
497 libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
498 libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
499 reformatting.
500
501 2018-06-11 Gary Dismukes <dismukes@adacore.com>
502
503 * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
504
505 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
506
507 * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
508 not add any actuals when the size of the object is known, and the
509 caller will allocate it.
510 (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
511 better illustrate its functionality. Update the comment on the
512 generated code. Generate a branch for the heap and pool cases where
513 the object is not necessarity controlled.
514 (Expand_N_Extended_Return_Statement): Expand the extended return
515 statement into four branches depending the requested mode if the caller
516 will not allocate the object on its side.
517 (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
518 object on the caller side because this will violate the semantics of
519 finalizable types. Instead notify the function to allocate the object
520 on the heap or a user-defined storage pool.
521 (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
522 which of the four modes to employ when returning a limited controlled
523 result.
524 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
525 guard which is already covered in Needs_Finalization.
526
527 2018-06-11 Olivier Hainque <hainque@adacore.com>
528
529 * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
530 * libgnat/a-exexpr.adb: ... Here, then add comments describing the
531 major datastructures associated with the current exception raised.
532 (Setup_Current_Excep): Accept a "Phase" argument conveying the
533 unwinding phase during which this subprogram is called. For an Ada
534 exception, don't update the current exception buffer from the raised
535 exception object during SEARCH_PHASE, as this is redundant with the
536 call now issued just before propagation starts.
537 (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
538 the unwinding start, conveying Phase 0.
539 (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
540 the call to Setup_Current_Excep.
541 * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
542 on calls to Setup_Current_Excep.
543
544 2018-06-11 Ed Schonberg <schonberg@adacore.com>
545
546 * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
547 Build_Access_Type_Decl): New subprograms to handle uplevel references
548 to formals of an unconstrained array type. The activation record
549 component for these is an access type, and the reference is rewritten
550 as an explicit derefenrence of that component.
551
552 2018-06-11 Bob Duff <duff@adacore.com>
553
554 * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
555 libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
556 (Element): Add code to detect dangling cursors in some cases.
557
558 2018-06-11 Yannick Moy <moy@adacore.com>
559
560 * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
561 from source.
562
563 2018-06-11 Ed Schonberg <schonberg@adacore.com>
564
565 * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
566 that its parent is already frozen so that its predicate function, if
567 any, has already been constructed.
568
569 2018-06-11 Yannick Moy <moy@adacore.com>
570
571 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
572 possible task unit as the enclosing context.
573
574 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
575
576 * gnat1drv.adb: Remove use clause for Repinfo.
577 (Gnat1drv): Beef up comment about the interplay between -gnatc and
578 back-end annotations. Use full qualified name for List_Rep_Info.
579
580 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
581
582 * libgnat/g-arrspl.ads: Add pragma Preelaborate.
583
584 2018-06-11 Arnaud Charlet <charlet@adacore.com>
585
586 * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
587 then" and general logical "ada" in codepeer mode.
588
589 2018-06-11 Javier Miranda <miranda@adacore.com>
590
591 * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
592 N_Call_Marker nodes.
593
594 2018-06-11 Arnaud Charlet <charlet@adacore.com>
595
596 * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
597 reformatting.
598
599 2018-06-11 Yannick Moy <moy@adacore.com>
600
601 * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
602 argument to Assertion_Policy
603 * gnat_rm.texi: Regenerate.
604
605 2018-06-11 Yannick Moy <moy@adacore.com>
606
607 * gnat1drv.adb: Do not check representation information in CodePeer and
608 GNATprove modes, as these modes call a special backend instead of gigi,
609 so do not have the information.
610
611 2018-06-11 Yannick Moy <moy@adacore.com>
612
613 * inline.adb (Build_Body_To_Inline): Consider case of extended return
614 of unconstrained type as one case where inlining is not supported.
615 (Expand_Inlined_Call): Remove special case for body as extended return
616 of unconstrained type.
617
618 2018-06-11 Yannick Moy <moy@adacore.com>
619
620 * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
621 unit.
622 (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
623
624 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
625
626 * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
627 expressions in Pre/Post contracts while in GNATprove_Mode.
628
629 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
630
631 * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
632 with AND THEN expressions broken down into individual conjuncts.
633
634 2018-06-11 Ed Schonberg <schonberg@adacore.com>
635
636 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
637
638 2018-06-11 Ed Schonberg <schonberg@adacore.com>
639
640 * exp_unst.adb (Visit_Node): Skip generic associations.
641
642 2018-06-11 Arnaud Charlet <charlet@adacore.com>
643
644 * libgnat/memtrack.adb (fwrite): Remove second definition.
645
646 2018-06-11 Javier Miranda <miranda@adacore.com>
647
648 * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
649 (Is_Static_Coextension): Adding documentation.
650 * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
651 (Is_Static_Coextension): Extending the assertion.
652 * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
653 setting flag Is_Dynamic_Coextension (and vice versa).
654
655 2018-06-11 Ed Schonberg <schonberg@adacore.com>
656
657 * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
658 level of a compilation unit, becuase they may contain nested
659 subprograms that need an activation record.
660
661 2018-06-11 Arnaud Charlet <charlet@adacore.com>
662
663 * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
664
665 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
666
667 * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
668 Minor reformatting.
669 * sinfo.ads: Fix a typo.
670
671 2018-06-11 Ed Schonberg <schonberg@adacore.com>
672
673 * inline.adb (Expand_Inlined_Call): If no optimization level is
674 specified, the expansion of a call to an Inline_Always function is
675 fully performed in the front-end even on a target that support back-end
676 inlining.
677
678 2018-06-11 Arnaud Charlet <charlet@adacore.com>
679
680 * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
681 with Sec_Stack_Used.
682
683 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
684
685 * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
686 Is_Assignment_LHS further in. Use predicate
687 Needs_Variable_Reference_Marker to determine whether to create a
688 variable marker.
689 (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
690 in. Use predicate Needs_Variable_Reference_Marker to determine whether
691 to create a variable marker.
692 * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
693 checks that determine whether the identifier or expanded name is a
694 suitable variable reference. The checks are now performed by
695 Needs_Variable_Reference_Marker.
696 * sem_res.adb (Resolve_Actuals): Use predicate
697 Needs_Variable_Reference_Marker to determine whether to create a
698 variable marker.
699 * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
700 * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
701
702 2018-06-11 Valentine Reboul <reboul@adacore.com>
703
704 * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
705 "Community Edition".
706
707 2018-06-11 Ed Schonberg <schonberg@adacore.com>
708
709 * sem_ch12.adb (Install_Body): In order to determine the placement of
710 the freeze node for an instance of a generic nested within another
711 instance, take into account that the outer instance may be declared in
712 the visible part of a package and the inner intance may be in the
713 private part of the same package.
714
715 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
716
717 * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
718
719 2018-06-11 Nicolas Roche <roche@adacore.com>
720
721 * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
722 stack overflow while raising a constraint error.
723
724 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
725
726 * repinfo.ads (Rep_Value): Use a single line.
727 * repinfo.adb (Rep_Value): Likewise.
728 (List_Attr): Do not use string concatenation.
729
730 2018-06-11 Ed Schonberg <schonberg@adacore.com>
731
732 * exp_unst.adb (Visit_Node): Check reference to formal parameter of
733 current procedure, because the bounds of its type may be uplevel
734 references.
735
736 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
737
738 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
739 not a definition, retrieve the expression only if it's a compile-time
740 known value if we are just annotating types.
741
742 * gcc-interface/utils.c (convert): Do not try to upcast properly for a
743 conversion between tagged types in type_annotate_only mode.
744
745 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
746
747 * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
748 * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
749 type built for an aliased component with variable size.
750
751 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
752
753 * doc/gnat_ugn/project-manager-figure.png: Delete.
754
755 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
756
757 * vxworks-arm-link.spec, vxworks-e500-link.spec,
758 vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
759 vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
760 vxworks-smp-x86-link.spec: New files.
761
762 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
763
764 * gnatvsn.adb: Re-center the copyright header.
765 * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
766
767 2018-05-31 Fedor Rybin <frybin@adacore.com>
768
769 * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
770 gnattest section on user guide.
771
772 2018-05-31 Ed Schonberg <schonberg@adacore.com>
773
774 * sem_res.adb (Resolve_String_Literal): If the type is a string type
775 whose component subtype has a static predicate, ensure that the
776 predicate is applied to each character by expanding the string into the
777 equivalent aggregate. This is also done if the component subtype is
778 constrained.
779
780 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
781
782 * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
783
784 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
785
786 * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
787 explicit spec.
788
789 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
790
791 * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
792 the type of the parameter is an unconstrained array type, convert
793 to the type of the actual before the type of the formal only if the
794 conversion was suppressed earlier. Use in_param and gnu_actual_type
795 local variables throughout, and uniform spelling for In Out or Out.
796 Also remove dead code in the component-by-reference case.
797
798 2018-05-31 Frederic Konrad <konrad@adacore.com>
799
800 * tracebak.c (STOP_FRAME): Harden condition.
801 (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
802 mode.
803
804 2018-05-31 Ed Schonberg <schonberg@adacore.com>
805
806 * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
807 check to a call to a build-in-place function, given that the return
808 object is limited and cannot be copied.
809
810 2018-05-31 Olivier Hainque <hainque@adacore.com>
811
812 * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
813 builtins.
814
815 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
816
817 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
818 there is no target, also create a temporary for the return value for
819 an allocator if the type is an unconstrained record type with default
820 discriminant.
821
822 2018-05-31 Hristian Kirtchev <kirtchev@adacore.com>
823
824 * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
825 boudary for a transient scope.
826
827 2018-05-31 Valentine Reboul <reboul@adacore.com>
828
829 * gnatvsn.ads: Rename "GPL" version to "Community".
830
831 2018-05-31 Ed Schonberg <schonberg@adacore.com>
832
833 * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
834 flag.
835
836 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
837
838 * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
839 with a semantically equivalent call to Defining_Entity.
840
841 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
842
843 * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
844 Max_Queue_Length expression.
845
846 2018-05-31 Sergey Rybin <rybin@adacore.com>
847
848 * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
849 that the main unit to be built before the call, now it computes the
850 closure of the main unit itself.
851 * gnat_ugn.texi: Regenerate.
852
853 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
854
855 * repinfo.adb (List_Structural_Record_Layout): Set First to false
856 after having listed the fields of the parent type, if any.
857
858 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
859
860 * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
861 deal with the ___XP suffix for packed array types here...
862 <E_Array_Subtype>: ...or here when processing the implementation type
863 but when processing the original type instead. Do not reuse the DECL
864 of the implementation type for the original type. Tidy up.
865
866 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
867
868 * einfo.ads (Object_Size_Clause): Declare.
869 * einfo.adb (Object_Size_Clause): New function.
870 * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
871 retrieving Size_Clause and post the warning on the object size clause
872 if Has_Object_Size_Clause is true.
873
874 2018-05-31 Javier Miranda <miranda@adacore.com>
875
876 * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
877 * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
878 Find_Primitive_Eq to search for the primitive of types whose underlying
879 type is a tagged type.
880
881 2018-05-31 Yannick Moy <moy@adacore.com>
882
883 * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
884 order of treatment between nodes recognized as loop pragmas (or
885 generated from one) and block statements.
886
887 2018-05-31 Doug Rupp <rupp@adacore.com>
888
889 * libgnat/s-osprim__posix2008.adb (Clock): Implement using
890 clock_gettime.
891
892 2018-05-31 Ed Schonberg <schonberg@adacore.com>
893
894 * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
895 mark subprograms that cannot be eliminated because they must be treated
896 as reachable from outside the current unit. This includes entry bodies
897 and protected operations.
898
899 2018-05-31 Ed Schonberg <schonberg@adacore.com>
900
901 * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
902 Convert all operands of the generated code to Standard.Unsigned, to
903 prevent spurious visibility errors. This is needed when the generated
904 expansion involves a modular index type of an array type, and the index
905 type is not immediately visible.
906
907 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
908
909 * einfo.ads (Package_Instantiation): Update comment after a routine
910 that uses this field has been renamed.
911
912 2018-05-30 Ed Schonberg <schonberg@adacore.com>
913
914 * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
915 if the local raise statement includes a string expression. This
916 expression might be picked up by an outer handler or discarded, but
917 plays no role in this transformation.
918
919 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
920
921 * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
922 reformatting.
923
924 2018-05-30 Ed Schonberg <schonberg@adacore.com>
925
926 * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
927 field in relevant nodes: Allocate, Free, and return statements.
928
929 2018-05-30 Ed Schonberg <schonberg@adacore.com>
930
931 * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
932 that has not been analyzed, as will be the case for a nested aggregate
933 that is expanded into individual assignments.
934
935 2018-05-30 Justin Squirek <squirek@adacore.com>
936
937 * aspects.adb, aspects.ads: Register new aspect.
938 * par-prag.adb (Prag): Register new pragma.
939 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
940 aspect similar to Aspect_Max_Queue_Length.
941 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
942 set it to use the same processing as Pragma_Max_Queue_Length.
943 * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
944 that it can be processed as a pragma in addition to a restriction and
945 add an entry for the pragma itself.
946
947 2018-05-30 Ed Schonberg <schonberg@adacore.com>
948
949 * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
950 is now legal on a variable of composite type initialized with an
951 aggregate that is fully static and requires no elaboration code.
952 * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
953 nested aggregates that are compile-time static, so they can be used to
954 initialize variables declared with Threqd_Local_Storage.
955 * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
956 Thread_Local_Storage.
957 * gnat_rm.texi: Regenerate.
958
959 2018-05-30 Yannick Moy <moy@adacore.com>
960
961 * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
962 GNATprove modes.
963
964 2018-05-30 Justin Squirek <squirek@adacore.com>
965
966 * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
967 Add implementation.
968 (Start_Search): Modify to use Start_Search_Internal
969 (Start_Search_Internal): Add to break out an extra flag for searching
970 case insensative due to the potential for directories within the same
971 OS to allow different casing schemes.
972 * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
973 for when the more precise solution fails.
974
975 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
976
977 * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
978 Minor reformatting.
979
980 2018-05-30 Pascal Obry <obry@adacore.com>
981
982 * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
983 * libgnat/g-comlin.adb: Add corresponding implementation.
984
985 2018-05-30 Gary Dismukes <dismukes@adacore.com>
986
987 * sem_res.adb, sem_util.adb: Fix several typos.
988
989 2018-05-30 Olivier Hainque <hainque@adacore.com>
990
991 * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
992 (eh_registration_ctors, eh_registration_tors): New static variables,
993 forced in a .ctors/.dtors section, respectively, with priority.
994
995 2018-05-30 Bob Duff <duff@adacore.com>
996
997 * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
998 freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
999 sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
1000 sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
1001 sinfo.ads: Spell preanalysis, preanalyze correctly.
1002
1003 2018-05-30 Bob Duff <duff@adacore.com>
1004
1005 * libgnat/g-sestin.ads: Rework documentation comments.
1006
1007 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
1008
1009 * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
1010 sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
1011 (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
1012
1013 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
1014
1015 * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
1016
1017 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1018
1019 * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
1020 in a separate routine.
1021 (Is_Atomic_Object_Entity): New routine.
1022 (Is_Atomic_Prefix): Cleaned up.
1023 (Is_Synchronized_Object): Check that the object is atomic, or its type
1024 is atomic.
1025 (Object_Has_Atomic_Components): Removed.
1026 * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
1027 (Is_Atomic_Object_Entity): New routine.
1028
1029 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1030
1031 * sem_ch3.adb (Access_Subprogram_Declaration): The flag
1032 Needs_Activation_Record is only needed on a subprogram type, not on a
1033 pointer to such.
1034 * sem_res.adb (Resolve_Selected_Component): If the context type and the
1035 component type are anonymous access to subprograms, use the component
1036 type to obtain the proper value of Needs_Activation_Record flag for the
1037 expression.
1038
1039 2018-05-30 Eric Botcazou <ebotcazou@adacore.com>
1040
1041 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
1042 comment about the memset case.
1043
1044 2018-05-30 Bob Duff <duff@adacore.com>
1045
1046 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
1047 to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
1048 We need to analyze it as part of analyzing the block, so that if the
1049 call to Element that initializes Elmt_Decl returns on the secondary
1050 stack, the block will ss_mark/ss_release. This block is inside the
1051 loop; we don't want to leak memory until the loop exits. The purpose
1052 of analyzing Elmt_Decl first was to catch the error of modifying it,
1053 which is illegal because it's a loop parameter. The above causes us to
1054 miss that error. Therefore, we add a flag Is_Loop_Parameter, and set
1055 it on the Element entity, so we end up with an E_Variable node with the
1056 flag set.
1057 * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
1058 * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
1059 parameter not allowed" error if Is_Loop_Parameter.
1060 * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
1061 trigger the call to Diagnose_Non_Variable_Lhs.
1062
1063 2018-05-30 Arnaud Charlet <charlet@adacore.com>
1064
1065 * checks.adb (Apply_Scalar_Range_Check):
1066 * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
1067 range values for System.Priority in CodePeer mode since the actual
1068 target compiler may provide a wider range.
1069
1070 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1071
1072 * exp_unst.adb: Search specification of main unit as well, for
1073 unnesting.
1074
1075 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1076
1077 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
1078 a package body that is a compilation unit may contain blocks that
1079 declare local subprograms. In Subprogram_Unnesting Mode such
1080 subprograms must be handled as nested inside the (implicit) elaboration
1081 procedure that executes that statement part. To handle properly uplevel
1082 references we construct that subprogram explicitly, to contain blocks
1083 and inner subprograms, The statement part of the compilation unit
1084 becomes a call to this subprogram. This is only done if blocks are
1085 present in the statement list of the body.
1086
1087 2018-05-30 Bob Duff <duff@adacore.com>
1088
1089 * exp_ch7.adb: Minor comment fix.
1090
1091 2018-05-30 Ed Schonberg <schonberg@adacore.com>
1092
1093 * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
1094 that have no corresponding body and appear as attributes of the
1095 corresponding wrapper package declaration.
1096 (Register_Subprogram): New subprogram, used for subprogram bodies and
1097 for subprogram instantiations to enter callable entity into Subp table.
1098
1099 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1100
1101 * libgnat/s-secsta.adb: Reimplement the secondary stack support.
1102 * libgnat/s-secsta.ads: Update the documentation of all routines in the
1103 public part of the package. Reimplement the private part of the
1104 package to account for the new secondary stack structure. Add types
1105 and subprograms for testing purposes. Add several documentation
1106 sections.
1107
1108 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
1109
1110 * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
1111 exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
1112 libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
1113 sem_disp.ads, sem_util.adb: Minor reformatting.
1114
1115 2018-05-30 Arnaud Charlet <charlet@adacore.com>
1116
1117 * gcc-interface/Makefile.in: Move special flags for Ada runtime files
1118 from here...
1119 * Makefile.rtl: ... to here. Update comments. Protect call to
1120 "GCC_FOR_TARGET" in case target_os isn't defined.
1121
1122 2018-05-30 Arnaud Charlet <charlet@adacore.com>
1123
1124 * gcc-interface/Makefile.in: Move target pair settings from here...
1125 * Makefile.rtl: ... to here.
1126 (setup-rts): New target.
1127
1128 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1129
1130 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
1131 List of All Switches): Replace "modules" with "units".
1132 (Subprogram Inlining Control): Likewise.
1133 * gnat_ugn.texi: Regenerate.
1134 * usage.adb (Usage): Fix description of -gnatn switch.
1135
1136 2018-05-29 Arnaud Charlet <charlet@adacore.com>
1137
1138 * gcc-interface/Makefile.in: Fix typos.
1139
1140 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1141
1142 * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
1143 the finalizer procedure in the At_End handler, for use in LLVM
1144 generation.
1145
1146 2018-05-29 Javier Miranda <miranda@adacore.com>
1147
1148 * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
1149 subprogram Inherits_From_Tagged_Full_View to identify more reliably
1150 untagged private types completed with a derivation of an untagged
1151 private whose full view is a tagged type.
1152 * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
1153 subprogram.
1154 (Collect_Primitive_Operations): Handle untagged private types completed
1155 with a derivation of an untagged private type whose full view is a
1156 tagged type. In such case, collecting the list of primitives we may
1157 find two equality primitives: one associated with the untagged private
1158 and another associated with the ultimate tagged type (and we must
1159 remove from the returned list this latter one).
1160
1161 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1162
1163 * exp_unst.adb (Visit_Node): Handle statement sequences that include an
1164 At_End handler.
1165
1166 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1167
1168 * repinfo.adb (List_Entities): Also recurse into blocks without label.
1169
1170 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1171
1172 * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
1173 exceptions if subprogram unnesting is in effect, because these branch
1174 nodes are relevant only in the presence of nested subprograms.
1175
1176 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1177
1178 * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
1179 unconditionally when applied to the largest positive (resp. largest
1180 negative) value of a floating-point type.
1181
1182 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1183
1184 * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
1185 discriminants and exceptions are never components of such. The flag
1186 Needs_Activation_Record is set on subprogram types, not on access to
1187 them.
1188
1189 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1190
1191 * sem_ch3.adb: Set scope of component of subtype.
1192
1193 2018-05-29 Ed Schonberg <schonberg@adacore.com>
1194
1195 * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
1196 carry no type. Such selected components appear in unit names that are
1197 child units, both in the specification and possibly in an end label for
1198 the unit, and they do not contain any relevant uplevel references.
1199
1200 2018-05-29 Arnaud Charlet <charlet@adacore.com>
1201
1202 * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
1203 function.
1204
1205 2018-05-29 Olivier Hainque <hainque@adacore.com>
1206
1207 * libgnat/system-vxworks7-ppc-rtp.ads: New file.
1208 * libgnat/system-vxworks7-ppc-kernel.ads: New file.
1209 * libgnat/system-vxworks7-e500-rtp.ads: New file.
1210 * libgnat/system-vxworks7-e500-kernel.ads: New file.
1211 * libgnat/system-vxworks7-x86-rtp.ads: New file.
1212 * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
1213 * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
1214 gnat-crtbe link spec to use the vx7 variant.
1215
1216 2018-05-29 Olivier Hainque <hainque@adacore.com>
1217
1218 * vx_crtbegin.inc: Use a consistent naming convention for the
1219 registration/deregistration functions across RTP or kernel. Remove the
1220 ctor/dtor attribute setting based on RTP/kernel, expect the optional
1221 attribute extension to be provided by includers instead.
1222 * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
1223 extension for the registration/deregistration functions.
1224 * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
1225 constructor/destructor attribute extensions.
1226 * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
1227 attribute extensions and declare _ctors/_dtors arrays.
1228 * vx_crtbegin_auto.c: Remove.
1229 * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
1230 vxworks7-gnat-crtbe-link.spec.
1231 * libgnat/system-vxworks7-aarch64.ads: Likewise.
1232 * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
1233 * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
1234 * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
1235 * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
1236 * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
1237 * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
1238 * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
1239
1240 2018-05-29 Piotr Trojanek <trojanek@adacore.com>
1241
1242 * ali.adb: Minor reformatting.
1243
1244 2018-05-29 Joel Brobecker <brobecker@adacore.com>
1245
1246 * doc/gnat_ugn/platform_specific_information.rst: Update package
1247 requirements for 32bit GNAT on x86_64-linux.
1248 * gnat_ugn.texi: Regenerate.
1249
1250 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1251
1252 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
1253 Control): Adjust description of -gnatRj.
1254 * gnat_ugn.texi: Regenerate.
1255 * opt.ads (List_Representation_Info_To_JSON): Likewise.
1256 * repinfo.adb (List_Rep_Info): Do not automatically create a file
1257 if List_Representation_Info_To_JSON is true.
1258 * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
1259 check between -gnatRj and -gnatRs.
1260 * usage.adb (Usage): Adjust description of -gnatRj.
1261
1262 2018-05-29 Pascal Obry <obry@adacore.com>
1263
1264 * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
1265 the root directory.
1266
1267 2018-05-29 Pascal Obry <obry@adacore.com>
1268
1269 * libgnat/s-os_lib.adb: Minor reformatting.
1270
1271 2018-05-29 Doug Rupp <rupp@adacore.com>
1272
1273 * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
1274 * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
1275 * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
1276 * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
1277
1278 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1279
1280 * repinfo.ads (JSON format): Document new pair for components.
1281 * repinfo.adb (Derived_Discriminant): New function.
1282 (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
1283 in recursive calls. If the record type is the parent of an extension,
1284 find and list the derived discriminant from the extension, if any.
1285 (List_Component_Layout): List the Discriminant_Number in JSON mode.
1286 (List_Record_Info): Adjust call to List_Structural_Record_Layout.
1287
1288 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1289
1290 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
1291 List of All Switches): Document -gnatRj.
1292 (Debugging Control): Likewise.
1293 * gnat_ugn.texi: Regenerate.
1294 * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
1295 * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
1296 extension if List_Representation_Info_To_JSON is true.
1297 * repinfo.ads: Document the JSON output format.
1298 * repinfo.adb (List_Location): New procedure.
1299 (List_Array_Info): Add support for JSON output.
1300 (List_Entities): Likewise.
1301 (Unop): Likewise.
1302 (Binop): Likewise.
1303 (Print_Expr): Likewise.
1304 (List_Linker_Section): Likewise.
1305 (List_Mechanisms): Likewise.
1306 (List_Name): Likewise.
1307 (List_Object_Info): Likewise.
1308 (List_Record_Info): Likewise.
1309 (List_Component_Layout): Likewise. Add Indent parameter.
1310 (List_Structural_Record_Layout): New procedure.
1311 (List_Attr): Add support for JSON output.
1312 (List_Type_Info): Likewise.
1313 (Write_Unknown_Val): Likewise.
1314 * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
1315 * usage.adb (Usage): List -gnatRj.
1316
1317 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1318
1319 * repinfo.adb (List_Component_Layout): New procedure extracted from...
1320 (List_Record_Layout): ...here. Invoke it.
1321
1322 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1323
1324 * repinfo.adb (Write_Unknown_Val): New procedure.
1325 (List_GCC_Expression): Call it.
1326 (List_Record_Layout): Likewise.
1327 (Write_Val): Likewise.
1328
1329 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1330
1331 * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
1332 code to do check.
1333
1334 2018-05-29 Arnaud Charlet <charlet@adacore.com>
1335
1336 * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
1337 This breaks build of cross compilers with older versions of GNAT, so
1338 better avoid it.
1339
1340 2018-05-29 Doug Rupp <rupp@adacore.com>
1341
1342 * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
1343 reflect reality.
1344
1345 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1346
1347 * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
1348
1349 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
1350
1351 * repinfo.adb (List_Entities): Do not list the Linker_Section for
1352 subprograms here...
1353 (List_Mechanisms): ...but here instead. Use consistent name output
1354 and formatting conventions.
1355
1356 2018-05-29 Bob Duff <duff@adacore.com>
1357
1358 * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
1359 To_Lower function.
1360 * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
1361 To_Mixed): New functions.
1362 * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
1363 allows both '\' and '/' on Windows.
1364
1365 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1366
1367 * repinfo.ads: Minor fixes and tweaks in comments.
1368
1369 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1370
1371 * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
1372 it with calls to Unop.
1373
1374 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1375
1376 * repinfo.ads (TCode): Adjust range.
1377 (Truth_Andif_Expr): Remove.
1378 (Truth_Orif_Expr): Likewise.
1379 (Truth_And_Expr .. Dynamic_Val): Adjust value.
1380 * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
1381 (Rep_Value): Likewise.
1382 * repinfo.h (Truth_Andif_Expr): Remove.
1383 (Truth_Orif_Expr): Likewise.
1384 (Truth_And_Expr .. Dynamic_Val): Adjust value.
1385 * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
1386 through to TRUTH_AND_EXPR case.
1387 <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
1388
1389 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1390
1391 * exp_unst.adb (Visit_Node): For indexed components and attribute
1392 references, examine index expressions or associated expressions as well
1393 to record uplevel references.
1394 (Vist_Node): For function and procedure calls, if a formal is an
1395 unconstrained array and the actual is constrained, check whether bounds
1396 of actual have uplevel references.
1397
1398 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1399
1400 * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
1401 they can appear as components of activation records.
1402 * exp_unst.adb (Visit_Node): A reference to an exception may be an
1403 uplevel reference.
1404
1405 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1406
1407 * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
1408 depends on a discriminant manually instead of using the predicate
1409 Size_Depends_On_Discriminant in the array type case.
1410
1411 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1412
1413 * exp_unst.adb (Check_Static_Type): For a record subtype, check
1414 discriminant constraints as well.
1415 (Visit_Node): For a selected component, check type of prefix, as is
1416 done for indexed components and slices.
1417
1418 2018-05-28 Javier Miranda <miranda@adacore.com>
1419
1420 * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
1421 value when converting a float value to a fixed-point value. This is
1422 required for CCG because it handles fixed-point types by means of
1423 unsigned integer type variables. The range check is now performed using
1424 the integer value stored in this temporary.
1425
1426 2018-05-28 Yannick Moy <moy@adacore.com>
1427
1428 * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
1429 Length as valid non-interfering contexts for SPARK.
1430
1431 2018-05-28 Claire Dross <dross@adacore.com>
1432
1433 * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
1434 generic inheritance utilities.
1435 (Generic_Inherited_Subprograms): Generic version of
1436 Inherited_Subprograms, generic in Find_Dispatching_Type function.
1437 (Generic_Is_Overriding_Subprogram): Generic version of
1438 Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
1439 (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
1440 Sem_Disp.Find_Dispatching_Type.
1441 (Is_Overriding_Subprogram): Instance of
1442 Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
1443 (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
1444 with Sem_Disp.Find_Dispatching_Type.
1445
1446 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1447
1448 * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
1449 component type, do not expand array equality using the unconstrained
1450 base type, except for the case where the bounds of the type depend on a
1451 discriminant.
1452
1453 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1454
1455 * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
1456 access-to-subprogram types, to indicate that an indirect call through
1457 such a type requires an activation record when compiling for LLVM.
1458 * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
1459
1460 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1461
1462 * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
1463 when bounds of fixed type are static, to remove some spuerfluous
1464 implicit conversions and provide an accurate result when converting
1465 back and forth between the fixed point type and a floating point type.
1466
1467 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1468
1469 * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
1470 activation records.
1471
1472 2018-05-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1473
1474 * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
1475 replaced, if any; all callers changed.
1476 (Note_Uplevel_Ref): Likewise. Also replace reference to deferred
1477 constant with private view so we take the address of that entity.
1478 (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
1479 any; all callers changed. Handle N_Indexed_Component like
1480 N_Attribute_Reference. Add N_Type_Conversion case.
1481 (Visit_Node): Indexed references can be uplevel if the type isn't
1482 static.
1483 (Unnest_Subprograms): Don't rewrite if no reference given. If call has
1484 been relocated, set first_named pointer in original node as well.
1485
1486 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1487
1488 * exp_aggr.adb (Flatten): Copy tree of expression in a component
1489 association with a range or a set of discrete choices, rather than
1490 relocating the node. This avoids inconsistencies in the tree when
1491 handling nested subprograms with uplevel references for LLVM.
1492
1493 2018-05-28 Arnaud Charlet <charlet@adacore.com>
1494
1495 * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
1496 codepeer mode.
1497
1498 2018-05-28 Arnaud Charlet <charlet@adacore.com>
1499
1500 * exp_unst.adb: Fix typo.
1501
1502 2018-05-28 Bob Duff <duff@adacore.com>
1503
1504 * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
1505 unnecessary use of 'Unrestricted_Access.
1506
1507 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
1508
1509 * repinfo.adb (Expr_Value_S): New routine.
1510 (List_Linker_Section): Properly extract the value of the section
1511 argument.
1512
1513 2018-05-28 Patrick Bernardi <bernardi@adacore.com>
1514
1515 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
1516 description of the -D binder switch to reflect current usage.
1517 * gnat_ugn.texi: Regenerate.
1518
1519 2018-05-28 Gary Dismukes <dismukes@adacore.com>
1520
1521 * exp_ch3.adb: Minor reformatting
1522
1523 2018-05-28 Justin Squirek <squirek@adacore.com>
1524
1525 * exp_ch3.adb
1526 (Build_Initialization_Call): Add logic to pass the appropriate actual to match
1527 new formal.
1528 (Init_Formals): Add new formal *_skip_null_excluding_check
1529 * exp_util.adb, exp_util.ads
1530 (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
1531 scope.
1532 (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
1533 (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
1534 used to determine how to generate an Init_Proc for a given type.
1535 (Needs_Constant_Address): Minor reformatting
1536 * sem_res.adb
1537 (Resolve_Null): Add logic to generate a conditional check in certain cases
1538
1539 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
1540
1541 * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
1542 Minor reformatting.
1543
1544 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
1545
1546 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
1547 the declarations of single concurrent types because they fall in the
1548 category of full type and object declarations.
1549
1550 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1551
1552 * repinfo.adb (Compute_Max_Length): Skip _Parent component.
1553 (List_Record_Layout): Likewise.
1554
1555 2018-05-28 Ed Schonberg <schonberg@adacore.com>
1556
1557 * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
1558 includes a call to function to which it applies. This may mean an
1559 omission of an attribute reference 'Result, in particular if the
1560 function is pqrameterless.
1561
1562 2018-05-28 Justin Squirek <squirek@adacore.com>
1563
1564 * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
1565 misresolved package name is not a case of mistaken identity.
1566
1567 2018-05-28 Yannick Moy <moy@adacore.com>
1568
1569 * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
1570 GNATprove mode, as the order of resolution (low then high) means that
1571 all the information is not available when resolving the low bound the
1572 first time.
1573
1574 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
1575
1576 * repinfo.adb (List_Array_Info): Start with an explicit blank line and
1577 end with the linker section, if any.
1578 (List_Entities): Do not output the linker section for record types,
1579 array types and variables.
1580 (Print_Expr): Factor out common processing for unary operators and
1581 special values. Adjust and reorder the various cases.
1582 (List_Object_Info): End with the linker section, if any.
1583 (List_Record_Info): Likewise.
1584 (List_Type_Info): Do not start with a blank line.
1585
1586 2018-05-25 Nicolas Roche <roche@adacore.com>
1587
1588 * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
1589 that the result will be either -infinite or +infinite.
1590
1591 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
1592
1593 * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
1594 libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
1595 Expand range of type to match the address space of the target.
1596 (Task_Storage_Size): Remove unused type.
1597
1598 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1599
1600 * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
1601 of a fixed point type and the parent is a multiplying operation,
1602 resolve the operand with its own type because the context will impose a
1603 resulting type on the result of the multiplication by means of
1604 approriate conversion.
1605
1606 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
1607
1608 * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
1609 the in-place initialization aggregate created for pragmas
1610 Initialize_Scalars or Normalize_Scalars is performed with checks
1611 suppressed.
1612
1613 2018-05-25 Arnaud Charlet <charlet@adacore.com>
1614
1615 * exp_aggr.adb (Convert_To_Positional): Bump default for
1616 Max_Others_Replicate to 32. Update comments.
1617 * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
1618 (No_File_Info_Cache): Initialize separately.
1619 * osint.adb (No_File_Info_Cache): Update initializer.
1620
1621 2018-05-25 Javier Miranda <miranda@adacore.com>
1622
1623 * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
1624 test when the left operand is a class-wide interface and the right
1625 operand is not a class-wide type.
1626 * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
1627 left operand.
1628
1629 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1630
1631 * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
1632 in an others clause to prevent visibility issues with the generated
1633 loop variable.
1634 (Component_OK_For_Backend): Return false for a quantified expression.
1635 (Check_Static_Component): Ditto.
1636
1637 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
1638
1639 * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
1640 (SS_Allocate_Dynamic): New routine. The allocation logic is now split
1641 into three distring cases rather than in one loop which attempts to
1642 handle all three cases. This rewrite eliminates an issue where the last
1643 frame of the stack cannot be freed, thus causing the memory range of a
1644 new frame to approach the overflow point of the memory index type.
1645 Since the overflow is logically treated as a
1646 too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
1647 (SS_Allocate_Static): New routine. The routine factorizes the static
1648 secondary stack-related code from the former SS_Allocate.
1649
1650 2018-05-25 Sergey Rybin <rybin@adacore.com>
1651
1652 * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
1653 option for gnatelim.
1654
1655 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1656
1657 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
1658 Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
1659 is created when the proper body of the stub is analyzed.
1660 * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
1661 is the proper body of a subunit, the cloned body must be inserted in
1662 the declarative list that contains the stub.
1663
1664 2018-05-25 Justin Squirek <squirek@adacore.com>
1665
1666 * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
1667 generate code for 6.5(8-10) so that we don't get an assertion error
1668 when dealing with an incomplete return type.
1669
1670 2018-05-25 Arnaud Charlet <charlet@adacore.com>
1671
1672 * pprint.adb (Expression_Name): Strip too long expressions to avoid
1673 carrying very large strings.
1674
1675 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
1676
1677 * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
1678 numbers.
1679
1680 2018-05-25 Doug Rupp <rupp@adacore.com>
1681
1682 * tracebak.c (aarch64-linux): Implement.
1683
1684 2018-05-25 Justin Squirek <squirek@adacore.com>
1685
1686 * sem_ch8.adb: Minor reformatting.
1687
1688 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
1689
1690 * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
1691 assertions.
1692
1693 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
1694
1695 * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
1696 pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
1697 Minor reformatting.
1698
1699 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1700
1701 * sem_ch12.adb (Instance_Exists): New function, subsidiary of
1702 Validate_Derived_Type_Instance, to verify that all interfaces
1703 implemented by the formal type are also implemented by the actual. The
1704 verification is complicated when an interface of the formal is declared
1705 in a generic unit and the actual is declared in an instance of it.
1706 There is currently no mechanism to relate an interface declared within
1707 a generic to the corresponding interface in an instance, so we must
1708 traverse the list of interfaces of the actual, looking for a name
1709 match, and verifying that that interface is declared in an instance.
1710
1711 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
1712
1713 * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
1714 assertions; replace function versions of Next_Formal/Next_Actual with
1715 their procedural versions (which are more concise).
1716
1717 2018-05-25 Doug Rupp <rupp@adacore.com>
1718
1719 * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
1720 libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
1721 libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
1722 libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
1723 libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
1724 (Relative_Timed_Wait): Remove.
1725 * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
1726 for incremental looping. Remove references to Rel_Time and
1727 Relative_Timed_Wait.
1728 * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
1729 (Timed_Delay): Make separate.
1730 * libgnat/s-optide.adb: New separate procedure.
1731 * libgnat/s-osprim.ads (Max_System_Delay): New constant.
1732 * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
1733 (Max_System_Delay): New constant.
1734
1735 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1736
1737 * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
1738 for a formal derived type implements all the interfaces declared for
1739 the formal.
1740
1741 2018-05-25 Yannick Moy <moy@adacore.com>
1742
1743 * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
1744 and GNATprove modes when applicable policy is Ignore.
1745
1746 2018-05-25 Eric Botcazou <ebotcazou@adacore.com>
1747
1748 * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
1749 boolean type with convention C.
1750 * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
1751 * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
1752 FOREIGN and use it throughout the function.
1753 <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
1754 convention.
1755 <E_Enumeration_Subtype>: Likewise for subtypes.
1756 <E_Record_Type>: Force the size of a storage unit on empty classes.
1757 * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
1758 boolean types with precision 1 if the size is the expected one.
1759
1760 2018-05-25 Arnaud Charlet <charlet@adacore.com>
1761
1762 * pprint.adb (Expression_Name): Do not print non ASCII characters.
1763
1764 2018-05-25 Bob Duff <duff@adacore.com>
1765
1766 * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
1767 libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
1768
1769 2018-05-25 Bob Duff <duff@adacore.com>
1770
1771 * sem_util.ads: Minor comment fix.
1772
1773 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1774
1775 * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
1776 prefixes of array attributes, to prefixes that are entity names whose
1777 type is constrained.
1778 (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
1779 subprogram, as itype created for loops in pre/postcondition may appear
1780 in loops at the library level.
1781
1782 2018-05-25 Ed Schonberg <schonberg@adacore.com>
1783
1784 * sem_ch13.adb (Build_Predicate_Functions): The predicate function
1785 declaration is inserted into the tree and analyzed at that point, so
1786 should not be reinserted when the body is constructed. Inside a
1787 generic, ensure that the body is not inserted twice in the tree.
1788
1789 2018-05-25 Yannick Moy <moy@adacore.com>
1790
1791 * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
1792 declarations not coming from source.
1793
1794 2018-05-25 Fedor Rybin <frybin@adacore.com>
1795
1796 * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
1797 --copy-environment for gnattest.
1798
1799 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
1800
1801 * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
1802 variable.
1803 * sem_prag.adb (Get_Base_Subprogram): Same as above.
1804
1805 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
1806
1807 * fe.h (Set_Normalized_First_Bit): Declare.
1808 (Set_Normalized_Position): Likewise.
1809 * repinfo.adb (List_Record_Layout): Do not use irregular output for a
1810 variable position. Fix minor spacing issue.
1811 * gcc-interface/decl.c (annotate_rep): If a field has a variable
1812 offset, compute the normalized position and annotate it in addition to
1813 the bit offset.
1814
1815 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
1816
1817 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
1818 Constify and rename variables. Fix formatting.
1819 (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
1820 <N_Raise_Statement>: Likewise.
1821
1822 2018-05-24 Javier Miranda <miranda@adacore.com>
1823
1824 * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
1825 body of a variant record equality renaming.
1826 (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
1827 implementation of Build_Body_For_Renaming.
1828 * exp_ch3.ads (Build_Variant_Record_Equality): New library level
1829 function that factorizes the functionality needed by
1830 Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
1831 of a variant record equality subprogram.
1832 * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
1833 (Build_Variant_Record_Equality): New local procedure of
1834 Expand_Freeze_Record_Type containing all the code specific for freezing
1835 the record type that cannot be place in the new library level function.
1836
1837 2018-05-24 Ed Schonberg <schonberg@adacore.com>
1838
1839 * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
1840 in_parameters, used when unesting subprograms for LLVM, to indicate
1841 that a generated parameter carries the activation record from the
1842 enclosing subprogram.
1843 * exp_unst.adb (Check_Static_Type): Handle array attributes of types
1844 whose bounds may contain up-level references that need to be added to
1845 an activation recoord.
1846 (Add_Extra_Formal): Set Is_Activation_Record on new formal.
1847
1848 2018-05-24 Yannick Moy <moy@adacore.com>
1849
1850 * pprint.adb (Expression_Image): Improve the printing of expressions,
1851 by taking more cases into account, in particular qualified expressions
1852 and aggregates. Also count more the number of parentheses to close
1853 after the expression.
1854
1855 2018-05-24 Javier Miranda <miranda@adacore.com>
1856
1857 * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
1858 check for renamed discriminants.
1859 * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
1860 Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
1861 Is_Visible_Component pass the associated selector node to allow
1862 checking renamed discriminants on untagged types.
1863
1864 2018-05-24 Ed Schonberg <schonberg@adacore.com>
1865
1866 * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
1867 link to a use_type clause if this would cause an infinite loop in the
1868 machinery that detects redundant use clauses. This may happen when the
1869 redundant clauses appear in the context of a child unit and the context
1870 of its parent.
1871
1872 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
1873
1874 * sinfo.ads: Fix grammar in comment.
1875
1876 2018-05-24 Justin Squirek <squirek@adacore.com>
1877
1878 * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
1879 and manage doubly-linked entity chain.
1880 (Nested_Scenarios): Removed entity field used for optimization during
1881 elaboration to make room for the new field Prev_Entity.
1882 (Link_Entities): Added to replace redundant calls to Set_Next_Entity
1883 and Set_Prev_Entity as well as centralize changes to the entity chain.
1884 (Predicated_Parent): Modified to use Node38.
1885 (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
1886 types.
1887 (Remove_Entity): Moved from sem_util.
1888 (Set_Nested_Scenarios): Deleted.
1889 (Set_Predicated_Parent): Modified to use Node38.
1890 (Set_Prev_Entity): Added to set Prev_Entity field.
1891 (Set_Validated_Object): Modified to use Node38.
1892 (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
1893 action is required.
1894 (Validated_Object): Modified to use Node38.
1895 (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
1896 predicated parent cases.
1897 (Write_Field38_Name): Add predicated parent and Validated_Object cases.
1898 * sem_ch3.adb (Process_Subtype): Add guard to protect against
1899 inappropriate marking of Predicated_Parent to non-itype subtypes.
1900 (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
1901 (Copy_And_Swap): Add setting of Prev_Entity.
1902 (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
1903 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
1904 w/ Link_Entities.
1905 (New_Overloaded_Entity): Remove block created to search for previous
1906 entities in the entity chain with relevant calls to Prev_Entity as well
1907 as replace duplicated code from Remove_Entity_And_Homonym with a call
1908 to that subprogram.
1909 * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
1910 Link_Entities.
1911 * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
1912 initial subprogram declarations related to Nested_Scenarios.
1913 (Process_Nested_Scenarios): Deleted.
1914 (Save_Scenario): Deleted.
1915 (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
1916 node space in the entity tree.
1917 * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
1918 (Remove_Entity_And_Homonym): Added to separate functionality of
1919 Remove_Entity from the homonym chain directly.
1920 * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
1921 w/ Link_Entities and Unlink_Next_Entity.
1922 * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
1923 Link_Entities.
1924 * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
1925 Set_Next_Entity w/ Link_Entities.
1926 * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
1927 Link_Entities and Unlink_Next_Entity.
1928 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
1929 call to Remove_Entity with its new incarnation.
1930 * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
1931 * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
1932 Link_Entities.
1933
1934 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1935
1936 * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
1937 Install_Limited_Withed_Unit.
1938 (Expand_With_Clause): Update the call to Install_Withed_Unit.
1939 (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
1940 (Install_Context_Clauses): Update the call to Install_Withed_Unit.
1941 (Install_Limited_Context_Clauses): Update the calls to
1942 Install_Limited_Withed_Unit.
1943 (Install_Limited_Withed_Unit): Renamed to better illustrate its
1944 purpose.
1945 (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
1946 and Install_Limited_Withed_Unit.
1947 (Install_With_Clause): Uninstall a limited with clause if a [private]
1948 with clause is given for the same package.
1949 (Install_Withed_Unit): Renamed to better illustrate its purpose.
1950 (Remove_Limited_With_Unit): New routine.
1951
1952 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
1953
1954 * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
1955 (__gnat_personality_seh0): Adjust and beef up comments, and
1956 fix formatting throughout.
1957 (__gnat_adjust_context): Deal minimally with version 2.
1958 * seh_init.c (__gnat_map_SEH): Fix formatting.
1959 (_gnat_SEH_error_handler): Adjust comments.
1960 (__gnat_install_SEH_handler): Fix formatting.
1961
1962 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1963
1964 * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
1965
1966 2018-05-24 Ed Schonberg <schonberg@adacore.com>
1967
1968 * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
1969 aggregate with static bounds when named associations cover all index
1970 positions and the others clause is redundant.
1971
1972 2018-05-24 Raphael Amiard <amiard@adacore.com>
1973
1974 * libgnat/a-cohama.ads: Add documentation.
1975
1976 2018-05-24 Raphael Amiard <amiard@adacore.com>
1977
1978 * libgnat/a-convec.ads: Add documentation.
1979
1980 2018-05-24 Justin Squirek <squirek@adacore.com>
1981
1982 * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
1983 expansion for limited tagged types when the node to be expanded is a
1984 raise expression due to it not representing a valid object.
1985 * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
1986 message regarding assignments to limited types to ignore genereated
1987 code.
1988
1989 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
1990
1991 * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
1992 Ghost-related attributes of the class-wide subtype because the copy
1993 clobbers them.
1994
1995 2018-05-24 Justin Squirek <squirek@adacore.com>
1996
1997 * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
1998 marking use clauses as effective when the reference appears within
1999 generated code.
2000
2001 2018-05-24 Cyrille Comar <comar@adacore.com>
2002
2003 * doc/gnat_rm/the_gnat_library.rst: Fix typos.
2004 * gnat_rm.texi: Regenerate.
2005
2006 2018-05-24 Bob Duff <duff@adacore.com>
2007
2008 * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
2009 for build-in-place functions with a caller-unknown-size result.
2010 (Create_Finalizer): For build-in-place functions with a
2011 caller-unknown-size result, check at run time whether we need to
2012 release the secondary stack.
2013
2014 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2015
2016 * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
2017 generated incomplete type.
2018
2019 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2020
2021 * expander.adb (Expand): Update the save and restore of the Ghost
2022 region.
2023 * exp_ch3.adb (Freeze_Type): Likewise.
2024 * exp_disp.adb (Make_DT): Likewise.
2025 * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
2026 (Build_DIC_Procedure_Declaration): Likewise.
2027 (Build_Invariant_Procedure_Body): Likewise.
2028 (Build_Invariant_Procedure_Declaration): Likewise.
2029 (Make_Predicate_Call): Likewise.
2030 * freeze.adb (Add_To_Result): Insert the freeze action of a living
2031 entity prior to the start of the enclosing ignored Ghost region.
2032 (Freeze_Entity): Update the save and restore of the Ghost region.
2033 * ghost.adb (Install_Ghost_Mode): Reimplemented.
2034 (Install_Ghost_Region): New routine.
2035 (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
2036 (Mark_And_Set_Ghost_Body): Likewise.
2037 (Mark_And_Set_Ghost_Completion): Likewise.
2038 (Mark_And_Set_Ghost_Declaration): Likewise.
2039 (Mark_And_Set_Ghost_Instantiation): Likewise.
2040 (Mark_And_Set_Ghost_Procedure_Call): Likewise.
2041 (Name_To_Ghost_Mode): New routine.
2042 (Restore_Ghost_Region): New routine.
2043 * ghost.ads (Install_Ghost_Region): New routine.
2044 (Restore_Ghost_Region): New routine.
2045 * opt.ads: Add new global variable Ignored_Ghost_Region.
2046 * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
2047 region. Install a clean region.
2048 * sem.adb (Analyze): Likewise.
2049 (Do_Analyze): Likewise.
2050 * sem_ch3.adb (Analyze_Object_Declaration): Likewise
2051 (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
2052 capture the ultimate alias of the current primitive.
2053 (Process_Full_View): Update the save and restore of the Ghost region.
2054 Do not inherit DIC and invariant procedures.
2055 * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
2056 Ghost region.
2057 * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
2058 (Analyze_Subprogram_Body_Helper): Likewise.
2059 * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
2060 * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
2061 (Analyze_Subprogram_Instantiation): Likewise.
2062 (Instantiate_Package_Body): Likewise.
2063 (Instantiate_Subprogram_Body): Likewise.
2064 * sem_ch13.adb (Build_Predicate_Functions): Likewise.
2065 (Build_Predicate_Function_Declaration): Likewise.
2066 * sem_disp.adb
2067 (Add_Dispatching_Operation): Do not consider DIC and invariant
2068 procedures.
2069 (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
2070 a dispatching subprogram.
2071 (Check_Operation_From_Private_View): Likewise.
2072 (Override_Dispatching_Operation): Likewise.
2073 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
2074 and restore of the Ghost region.
2075 (Analyze_Initial_Condition_In_Decl_Part): Likewise.
2076 (Analyze_Pragma): Update the save and restore of the Ghost region.
2077 (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
2078 * sem_util.adb (Is_Suitable_Primitive): New routine.
2079 * sem_util.ads (Is_Suitable_Primitive): New routine.
2080 * sinfo.ads: Update the section of Ghost regions.
2081
2082 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
2083
2084 * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
2085 Change "condition" to "case guard" after renaming in the contract
2086 grammar.
2087 * gnat_rm.texi: Regenerate.
2088
2089 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2090
2091 * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
2092 construct with discrete choices no longer contains a subtype with
2093 predicates since the expansion already handled this case.
2094
2095 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2096
2097 * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
2098 conversion to the return type to avoid a side effect where an imported
2099 relocated function generates a new anonymous access type, whose
2100 accessibility level does not agree with with that of the wrapper.
2101
2102 2018-05-24 Javier Miranda <miranda@adacore.com>
2103
2104 * sem_util.adb (Abstract_Interface_List): Add missing support for
2105 private types whose full view is a synchronized type.
2106 * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
2107 derivation of a private type parent type is a task type with
2108 discriminants as gigi does not use such type directly.
2109
2110 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
2111
2112 * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
2113 variable marker when the reference appears in the formal part of a
2114 compilation unit instance because there is no place to insert it.
2115 (In_Compilation_Instance_Formal_Part): New routine.
2116
2117 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
2118
2119 * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
2120 configuration parameter.
2121
2122 2018-05-24 Doug Rupp <rupp@adacore.com>
2123
2124 * argv-lynxos178-raven-cert.c: New file.
2125 * libgnat/system-lynxos178-x86.ads: New file.
2126
2127 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2128
2129 * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
2130 Minor reformattings.
2131
2132 2018-05-23 Pascal Obry <obry@adacore.com>
2133
2134 * adaint.c (win32_wait): Properly free the handle/pid lists when
2135 WaitForMultipleObjects fails (return WAIT_FAILED).
2136
2137 2018-05-23 Pascal Obry <obry@adacore.com>
2138
2139 * adaint.c (win32_wait): Add missing parentheses.
2140
2141 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2142
2143 * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
2144 (Expand_N_Object_Declaration): Do not check for a large modular array
2145 here.
2146 * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
2147 (Freeze_Object_Declaration): Code cleanup. Check for a large modular
2148 array.
2149 * sem_ch3.adb: Minor reformatting.
2150
2151 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2152
2153 * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
2154 retrieval of the applicable predicate function to an itype created for
2155 a constrained array component.
2156 * einfo.adb: Subprograms for Predicated_Parent.
2157 (Predicate_Function): Use new attribute.
2158 * exp_util.adb (Make_Predicate_Call): If the predicate function is not
2159 available for a subtype, retrieve it from the base type, which may have
2160 been frozen after the subtype declaration and not captured by the
2161 subtype declaration.
2162 * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
2163 legal within a generated initiqlization procedure, as may happen with a
2164 predicate check on a component, when the predicate function applies to
2165 the base type of the component.
2166 * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
2167 predicates for subtype declarations and for subtype indications in
2168 other contexts.
2169 (Process_Subtype): Likewise. Handle properly the case of a private type
2170 with unknown discriminants whose full view is an unconstrained array.
2171 Use Predicated_Parent to indicate source of predicate function on an
2172 itype whose parent is itself an itype.
2173 (Complete_Private_Subtype): If the private view has unknown
2174 discriminants and the full view is an unconstrained array, set base
2175 type of completion to the full view of parent.
2176 (Inherit_Predicate_Flags): Prevent double assignment of predicate
2177 function and flags.
2178 (Build_Subtype): For a constrained array component, propagate predicate
2179 information from original component type declaration.
2180
2181 2018-05-23 Boris Yakobowski <yakobowski@adacore.com>
2182
2183 * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
2184
2185 2018-05-23 Arnaud Charlet <charlet@adacore.com>
2186
2187 * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
2188 Hi.
2189 * sem_elab.adb: Make "out" parameters instead of "in out" when
2190 relevant.
2191
2192 2018-05-23 Bob Duff <duff@adacore.com>
2193
2194 * gnatbind.adb (List_Applicable_Restrictions): Add
2195 No_Implementation_Restrictions to the list of restrictions not to list.
2196 Remove double negative "not No_Restriction_List". Comment the
2197 commentary that is output, so it won't cause errors if used directly in
2198 a gnat.adc.
2199
2200 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2201
2202 * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
2203 class-wide precondition on a type extension when ancestor does not have
2204 a class-wide precondition. Previously the compiler accepted such a
2205 precondition when the ancestor had a class-wide postcondition.
2206
2207 2018-05-23 Javier Miranda <miranda@adacore.com>
2208
2209 * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
2210 the warning on occurrences of this attribute whose evaluation is always
2211 true (since that subprogram aborts processing the attribute). In
2212 addition, replace the node by its boolean result 'True' (required
2213 because the backend has no knowledge of this attribute).
2214
2215 2018-05-23 Bob Duff <duff@adacore.com>
2216
2217 * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
2218 code in question is not reachable in the case where Count_Type'Last is
2219 out of range.
2220
2221 2018-05-23 Yannick Moy <moy@adacore.com>
2222
2223 * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
2224 local pragma Warnings Off without On.
2225 * gnat_rm.texi: Regenerate.
2226
2227 2018-05-23 Olivier Hainque <hainque@adacore.com>
2228
2229 * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
2230 * libgnat/g-excact.adb: Implement.
2231
2232 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2233
2234 * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
2235 is present, verify its legality when the domain of iteration is a
2236 GNAT-specific formal container, as is already done for arrays and
2237 predefined containers.
2238
2239 2018-05-23 Yannick Moy <moy@adacore.com>
2240
2241 * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
2242 declaration, which was not taken into account.
2243
2244 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2245
2246 * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
2247 synchronized suspension.
2248 * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
2249 Ada.Synchronous_Task_Control and routines Suspend_Until_True and
2250 Wait_For_Release.
2251 * sem_elab.adb: Document switch -gnatd_s.
2252 (In_Task_Body): New routine.
2253 (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
2254 body when the current construct denotes a synchronous suspension call,
2255 and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
2256 is in effect.
2257 (Is_Synchronous_Suspension_Call): New routine.
2258 * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
2259 -gnatd_s.
2260
2261 2018-05-23 Javier Miranda <miranda@adacore.com>
2262
2263 * exp_disp.adb (Make_DT): Restrict the initialization of
2264 External_Tag and Expanded_Name to an empty string to the case where
2265 both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
2266 restricted runtimes are compiled with pragma Discard_Names.
2267 * doc/gnat_rm/implementation_defined_pragmas.rst,
2268 doc/gnat_rm/implementation_defined_characteristics.rst: Add
2269 documentation.
2270 * gnat_rm.texi: Regenerate.
2271
2272 2018-05-23 Maroua Maalej <maalej@adacore.com>
2273
2274 * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
2275
2276 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2277
2278 * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
2279 iteration of an Ada2012 loop is performed to determine the type of the
2280 domain, but full analysis is performed once the loop is rewritten as a
2281 while-loop during expansion. The pre-analysis suppresses expansion; it
2282 must also suppress the generation of freeze nodes, which may otherwise
2283 appear in the wrong scope before rewritting.
2284
2285 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2286
2287 * sem_elab.adb: Update the section on suppressing elaboration warnings.
2288
2289 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2290
2291 * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
2292 Is_Elaboration_Target.
2293 (Is_Elaboration_Target): New routine.
2294 (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
2295 (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
2296 (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
2297 Is_Elaboration_Target.
2298 * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
2299 with occurrences in nodes.
2300 (Is_Elaboration_Target): New routine.
2301 * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
2302 elaboration target is subject to pragma Warnings (Off, ...).
2303
2304 2018-05-23 Eric Botcazou <ebotcazou@adacore.com>
2305
2306 * repinfo.adb (List_Type_Info): Remove obsolete stuff.
2307
2308 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2309
2310 * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
2311 (Is_Elaboration_Warnings_OK_Id): New routine.
2312 (Set_Is_Elaboration_Warnings_OK_Id): New routine.
2313 (Write_Entity_Flags): Output Flag304.
2314 * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
2315 occurrences in entities.
2316 (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
2317 (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
2318 Inline.
2319 * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
2320 elaboration warnings.
2321 * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
2322 elaboration warnings.
2323 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
2324 state of elaboration warnings.
2325 (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
2326 warnings.
2327 (Analyze_Subprogram_Declaration): Capture the state of elaboration
2328 warnings.
2329 * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
2330 elaboration warnings.
2331 (Analyze_Single_Task_Declaration): Capture the state of elaboration
2332 warnings.
2333 (Analyze_Task_Type_Declaration): Capture the state of elaboration
2334 warnings.
2335 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
2336 of elaboration warnings.
2337 (Analyze_Generic_Subprogram_Declaration): Capture the state of
2338 elaboration warnings.
2339 * sem_elab.adb: Add a section on suppressing elaboration warnings.
2340 Type Processing_Attributes includes component Suppress_Warnings
2341 intended to suppress any elaboration warnings along a path in the
2342 graph. Update Initial_State to include a value for this component.
2343 Types Target_Attributes and Task_Attriutes include component
2344 Elab_Warnings_OK to indicate whether the target or task has elaboration
2345 warnings enabled. component Elab_Warnings_OK.
2346 (Build_Access_Marker): Propagate attribute
2347 Is_Elaboration_Warnings_OK_Node from the attribute to the generated
2348 call marker.
2349 (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
2350 (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
2351 (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
2352 (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
2353 when already in this mode or when the attribute or target have warnings
2354 suppressed.
2355 (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
2356 if warnings are suppressed.
2357 (Process_Conditional_ABE_Call): Suppress further elaboration warnings
2358 when already in this mode, or the target or call have warnings
2359 suppressed.
2360 (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
2361 warnings are suppressed.
2362 (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
2363 warnings are suppressed.
2364 (Process_Conditional_ABE_Instantiation): Suppress further elaboration
2365 warnings when already in this mode or when the instantiation has
2366 warnings suppressed.
2367 (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
2368 diagnostics if warnings are suppressed.
2369 (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
2370 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
2371 (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
2372 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
2373 (Process_Task_Object): Suppress further elaboration warnings when
2374 already in this mode, or when the object, activation call, or task type
2375 have warnings suppressed. Update the processing state to indicate that
2376 the path goes through a task body.
2377 * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
2378 references.
2379 (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
2380 * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
2381 attribute references.
2382
2383 2018-05-23 Piotr Trojanek <trojanek@adacore.com>
2384
2385 * einfo.ads: Minor reformatting.
2386
2387 2018-05-23 Ed Schonberg <schonberg@adacore.com>
2388
2389 * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
2390 anonymous_access_to_ subprogram formal, apply a conversion to force an
2391 accsssibility check that will fail statically, enforcing 3.10.2 (13).
2392
2393 2018-05-23 Daniel Mercier <mercier@adacore.com>
2394
2395 * gnat1drv.adb: Turn off length expansion in CodePeer mode.
2396
2397 2018-05-23 Bob Duff <duff@adacore.com>
2398
2399 * freeze.adb: (Check_Address_Clause): Deal with build-in-place
2400 aggregates in addition to build-in-place calls.
2401
2402 2018-05-23 Bob Duff <duff@adacore.com>
2403
2404 * einfo.ads: Minor reformatting.
2405 * sem_ch3.adb: Likewise.
2406 * sinfo.ads: Likewise.
2407
2408 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2409
2410 * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
2411 initialization when the component type has predicates.
2412 * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
2413 allocation when the component type has predicates.
2414
2415 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
2416
2417 * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
2418 Minor reformatting.
2419
2420 2018-05-22 Justin Squirek <squirek@adacore.com>
2421
2422 * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
2423 original function spec into the generated function spec due to
2424 expansion of expression functions during analysis.
2425 (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
2426 references from the body to the subprogram spec in the case of
2427 expression functions because of inconsistances related to having a
2428 generated body.
2429 * libgnarl/s-osinte__android.ads: Flag parameters as unused.
2430 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
2431 * libgnarl/s-osinte__qnx.adb: Likewise.
2432 * libgnarl/s-osinte__qnx.ads: Likewise.
2433
2434 2018-05-22 Doug Rupp <rupp@adacore.com>
2435
2436 * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
2437 AArch64.
2438
2439 2018-05-22 Olivier Hainque <hainque@adacore.com>
2440
2441 * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
2442 Expect an Exception_Occurence object, not an Access.
2443 (Complete_And_Propagate_Occurrence): Adjust accordingly.
2444 (Raise_From_Signal_Handler): Likewise.
2445 (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
2446 available in the provided occurrence object, just re-propagate the
2447 latter as a bare "raise;" would do.
2448 * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
2449 * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
2450 to null, to mark that the occurrence we're crafting from the stream
2451 contents is not being propagated (yet).
2452
2453 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2454
2455 * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
2456 code for a transient component in line with the rest of the
2457 initialization code, rather than before the aggregate. This ensures
2458 that the component has proper visibility of the discriminants.
2459
2460 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
2461
2462 * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
2463 number of CPUs.
2464
2465 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
2466
2467 * sigtramp-qnx.c: Properly restore link register in signal trampoline.
2468
2469 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2470
2471 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
2472 conversions before extracting the value of the expression.
2473 * exp_ch3.adb (Default_Initialize_Object): Optimize the default
2474 initialization of an array of scalars.
2475 (Get_Simple_Init_Val): Add processing for array types. Remove the
2476 processing of strings because this case is already handled by the array
2477 case.
2478 (Needs_Simple_Initialization): Moved to Sem_Util.
2479 (Simple_Init_Array_Type): New routine.
2480 (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
2481 facilities from Sem_Util.
2482 (Simple_Initialization_OK): New routine.
2483 * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
2484 * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
2485 an array of scalars.
2486 * sem_prag.adb (Analyze_Float_Value): New routine.
2487 (Analyze_Integer_Value): New routine.
2488 (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
2489 to handled the extended form of the pragma.
2490 (Analyze_Type_Value_Pair): New routine.
2491 * sem_util.adb: Add invalid value-related data structures.
2492 (Examine_Array_Bounds): New routine.
2493 (Has_Static_Array_Bounds): Reimplemented.
2494 (Has_Static_Non_Empty_Array_Bounds): New routine.
2495 (Invalid_Scalar_Value): New routine.
2496 (Needs_Simple_Initialization): Moved from Exp_Ch3.
2497 (Set_Invalid_Scalar_Value): New routines.
2498 * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
2499 (Invalid_Scalar_Value): New routine.
2500 (Needs_Simple_Initialization): Moved from Exp_Ch3.
2501 (Set_Invalid_Scalar_Value): New routines.
2502 * snames.ads-tmpl: Add names for the salar type families used by pragma
2503 Initialize_Scalars.
2504
2505 2018-05-22 Javier Miranda <miranda@adacore.com>
2506
2507 * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
2508 string when pragma No_Tagged_Streams is applicable to the tagged type,
2509 and initialize the Expanded_Name with an empty string when pragma
2510 Discard_Names is applicable to the tagged type.
2511
2512 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2513
2514 * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
2515 formal subprogram is never subtype conformqnt, and thus cannot be the
2516 prefix of 'Access. Reject as well the attribute when applied to a
2517 renaming of a formal subprogram.
2518
2519 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2520
2521 * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
2522 Needs_Simple_Initialization.
2523 (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
2524 (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
2525 profile and comment on usage.
2526 (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
2527 Sloc of a value obtained from aspect Default_Value because this could
2528 potentially replicate large trees. The proper Sloc is now set in
2529 Get_Simple_Init_Val.
2530 (Get_Simple_Init_Val): Reorganized by breaking the various cases into
2531 separate routines. Eliminate the use of global variables.
2532 (Init_Component): Update the call to Get_Simple_Init_Val.
2533 (Needs_Simple_Initialization): Update the parameter profile and all
2534 uses of T.
2535 (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
2536 and set the proper Sloc.
2537 * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
2538 comment on usage.
2539 (Needs_Simple_Initialization): Update the parameter profile.
2540
2541 2018-05-22 Patrick Bernardi <bernardi@adacore.com>
2542
2543 * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
2544 user tries to use a subtype indication as a discriminant constraint.
2545
2546 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2547
2548 * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
2549 of N_Reduction_Expression and N_Reduction_Expression_Parameter.
2550 * par-ch4.adb: Remove parsing routines for reduction expressions.
2551 * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
2552 sem_spark.adb, sprint.adb: Remove analysis routines for reduction
2553 expressions.
2554
2555 2018-05-22 Arnaud Charlet <charlet@adacore.com>
2556
2557 * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
2558 Relaxed_RM_Semantics mode.
2559
2560 2018-05-22 Arnaud Charlet <charlet@adacore.com>
2561
2562 * comperr.adb (Delete_SCIL_Files): Take into account
2563 N_Generic_Package_Renaming_Declaration.
2564
2565 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2566
2567 * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
2568 private, use the full view if available, because it may include renamed
2569 discriminants whose values are stored in the corresponding
2570 Stored_Constraint.
2571
2572 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2573
2574 * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
2575 defined on packages that are actuals for formal packages, in order to
2576 set/reset the visibility of the formals of a formal package with given
2577 actuals, when there are subsequent uses of those formals in the
2578 enclosing generic, as required by RN 12.7 (10).
2579 * atree.ads, atree.adb: Add operations for Elist30.
2580 * atree.h: Add Elist30.
2581 * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
2582 that are not defaulted and are thus not visible within the current
2583 instance.
2584 (Check_Formal_Packages): Reset visibility of formals of a formal
2585 package that are not defaulted, on exit from current instance.
2586
2587 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2588
2589 * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
2590 non-'Result output appears in the output list of a function.
2591
2592 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2593
2594 * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
2595 (Build_Record_VS_Func): Reimplemented.
2596 (Expand_N_Attribute): Reimplement the handling of attribute
2597 'Valid_Scalars.
2598 * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
2599 attribute 'Valid_Scalars.
2600 * sem_util.adb (Scalar_Part_Present): Reimplemented.
2601 (Validated_View): New routine.
2602 * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
2603 comment on usage.
2604 (Validated_View): New routine.
2605 * doc/gnat_rm/implementation_defined_attributes.rst: Update the
2606 documentation of attribute 'Valid_Scalars.
2607 * gnat_rm.texi: Regenerate.
2608
2609 2018-05-22 Bob Duff <duff@adacore.com>
2610
2611 * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
2612 the spec of a SAL_Interface package.
2613
2614 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2615
2616 * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
2617 entity E within a generic unit, indicate that there are no remaining
2618 delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
2619 entity E is not frozen yet but the aspects should not be reanalyzed at
2620 the freeze point, which may be outside of the generic and may not have
2621 the proper visibility.
2622
2623 2018-05-22 Bob Duff <duff@adacore.com>
2624
2625 * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
2626 the new --split-line-before-record, --indent-named-statements and
2627 --no-align-modes gnatpp switches.
2628
2629 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2630
2631 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
2632 a second argument that is a constant of a given string value.
2633
2634 2018-05-22 Doug Rupp <rupp@adacore.com>
2635
2636 * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
2637
2638 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
2639
2640 * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
2641
2642 2018-05-22 Ed Schonberg <schonberg@adacore.com>
2643
2644 * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
2645 delayed aspects, analyze them now, os that the representation of the
2646 type (size, bounds) can be computed and validated.
2647
2648 2018-05-22 Olivier Hainque <hainque@adacore.com>
2649
2650 * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
2651 executable code section boundaries.
2652
2653 2018-05-22 Javier Miranda <miranda@adacore.com>
2654
2655 * locales.c: New implementation for the Ada.Locales package.
2656 * libgnat/a-locale.ads: Remove comment indicating that this is not
2657 implemented.
2658 * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
2659 that this is not implemented.
2660 * gnat_rm.texi: Regenerate.
2661
2662 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2663
2664 * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
2665 reformattings.
2666
2667 2018-05-22 Justin Squirek <squirek@adacore.com>
2668
2669 * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
2670 (Freeze_Subprogram_Body, Install_Body): Modify calls to
2671 In_Same_Declarative_Part.
2672 * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
2673 verify pragma declaration is within the same declarative list with
2674 corresponding error message.
2675 * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
2676 sem_ch12.adb and generalized to be useful outside the scope of
2677 freezing.
2678
2679 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
2680
2681 * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
2682 categorization of the unit after processing the aspects in case one of
2683 its aspects is converted into a categorization pragma.
2684
2685 2018-05-21 Ed Schonberg <schonberg@adacore.com>
2686
2687 * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
2688 declaration with an explicit address clause and a type with default
2689 initialization, if the declaration carries an aspect
2690 Suppress_Initialization.
2691
2692 2018-05-21 Daniel Mercier <mercier@adacore.com>
2693
2694 * pprint.adb: Use mixed case for attribute names.
2695
2696 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
2697
2698 * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
2699 Analyze_Aspect_Specifications_On_Body_Or_Stub.
2700 (Analyze_Subprogram_Body_Helper): Rename the calls to
2701 Analyze_Aspect_Specifications_On_Body_Or_Stub.
2702 * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
2703 Analyze_Aspect_Specifications_On_Body_Or_Stub.
2704 * sem_ch10.adb: Add with and use clause for Sem_Ch13.
2705 (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
2706 prior to analyzing its aspects.
2707 (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
2708 stub prior to analyzing its aspects. Save and restore the configuration
2709 switches.
2710 (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
2711 prior to analyzing its aspects.
2712 * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
2713 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
2714 * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
2715 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
2716 * sem_prag.adb: Code reformatting.
2717 (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
2718
2719 2018-05-21 Jerome Lambourg <lambourg@adacore.com>
2720
2721 * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
2722 for QNX.
2723
2724 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
2725
2726 * exp_cg.adb: Remove with and use clause for Exp_Disp.
2727 * exp_ch9.adb: Remove with and use clause for Exp_Disp.
2728 * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
2729 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
2730 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
2731 * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
2732 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
2733 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
2734 * exp_dist.adb: Remove with and use clause for Exp_Disp.
2735 * freeze.adb: Remove with and use clause for Exp_Disp.
2736 * sem_cat.adb: Remove with and use clause for Exp_Disp.
2737 * sem_ch6.adb: Remove with and use clause for Exp_Disp.
2738 * sem_ch12.adb: Remove with and use clause for Exp_Disp.
2739 * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
2740 primitives.
2741 * sem_util.adb: Remove with and use clause for Exp_Disp.
2742 (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
2743 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
2744 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
2745 * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
2746 Exp_Disp.
2747 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
2748 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
2749
2750 2018-05-21 Ed Schonberg <schonberg@adacore.com>
2751
2752 * sem_res.adb (Valid_Conversion): Improve error message on an illegal
2753 type conversion whose expression has a limited view of a type.
2754
2755 2018-05-21 Ed Schonberg <schonberg@adacore.com>
2756
2757 * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
2758 explicit name for iterator loop, preserve that name in expanded
2759 construct, for possible use in exit statements.
2760
2761 2018-05-21 Javier Miranda <miranda@adacore.com>
2762
2763 * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
2764 spec of a unit has Ada 2012 membership tests with multiple choices and
2765 the unit body is not compiled under Ada 2012 mode.
2766
2767 2018-05-21 Doug Rupp <rupp@adacore.com>
2768
2769 * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
2770 pregs.
2771 (CFI_COMMON_REGS): Restore LR jic probed from prologue.
2772 (REGNO_PC_OFFSET): Change to correct value for Aarch64.
2773
2774 2018-05-21 Jose Ruiz <ruiz@adacore.com>
2775
2776 * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
2777 libgnarl/s-tassta.adb: Minor typo fixes
2778
2779 2018-05-21 Ed Schonberg <schonberg@adacore.com>
2780
2781 * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
2782 indexed call originally in prefix forn is itself the prefix of a
2783 further call.
2784
2785 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
2786
2787 * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
2788 type.
2789 (Not_Null_Range): Same as above.
2790
2791 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
2792
2793 * exp_ch3.adb: Minor reformatting.
2794 * exp_ch6.adb: Likewise.
2795 * freeze.adb: Likewise.
2796 * inline.adb: Likewise.
2797 * sem_util.adb: Likewise.
2798
2799 2018-05-21 Yannick Moy <moy@adacore.com>
2800
2801 * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
2802 conversion instead of an unchecked type conversion when inlining a
2803 return statement, unless type qualification is required (for character
2804 and string literal) or no check can result from the conversion (for
2805 access types).
2806 * opt.ads: Update comment.
2807
2808 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
2809
2810 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
2811 model of the compilation unit spec, if any.
2812 * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
2813 model of the compilation unit spec, if any.
2814 * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
2815 parent compilation unit spec, if any.
2816 * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
2817 model of the main unit.
2818 (Is_Same_Unit): The routine now uses Unit_Entity.
2819 (Is_Subunit): Removed.
2820 (Normalize_Unit): Removed.
2821 (Unit_Entity): New routine.
2822 * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
2823 Elaboration_Checks. The analysis now ensures that the pragma appears at
2824 the configuration level, and on the initial declaration of a unit.
2825 Other placements are either flagged as illegal, or ignored.
2826 (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
2827 (Ignore_Elaboration_Checks_Pragma): New routine.
2828 * sem_util.adb (Install_Elaboration_Model): New routine.
2829 * sem_util.ads (Install_Elaboration_Model): New routine.
2830 * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
2831 documentation of pragma Elaboration_Checks.
2832 * gnat_rm.texi: Regenerate.
2833
2834 2018-05-21 Olivier Hainque <hainque@adacore.com>
2835
2836 * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
2837 of empty string when argv[0] couldn't be found on PATH.
2838 (Enable_Cache): Raise Program_Error instead of attempting a null
2839 pointer dereference when the Exec_Module initialization failed.
2840
2841 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
2842
2843 * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
2844 * libgnarl/a-taside.ads (Tasking_State): Likewise.
2845 * libgnat/a-calend.ads (Clock_Time): Likewise.
2846
2847 2018-05-21 Yannick Moy <moy@adacore.com>
2848
2849 * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
2850 call notation in inlined call in GNATprove mode.
2851
2852 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
2853
2854 * einfo.adb (Is_External_State): An abstract state is also external
2855 when it is declared with option "synchronous".
2856 * einfo.ads: Update the documentation of synthesized attribute
2857 Is_External_State.
2858 * sem_util.adb (Find_Simple_Properties): New routine.
2859 (Is_Enabled_External_Property): New routine.
2860 (State_Has_Enabled_Property): Reimplemented. The two flavors of option
2861 External have precedence over option Synchronous when determining
2862 whether a property is in effect.
2863
2864 2018-05-21 Yannick Moy <moy@adacore.com>
2865
2866 * sem_eval.adb (Static_Length): Take into account case of variable of
2867 subtype string literal.
2868
2869 2018-05-21 Olivier Hainque <hainque@adacore.com>
2870
2871 * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
2872 (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
2873 * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
2874 component name.
2875 (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
2876 * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
2877 change.
2878
2879 2018-05-21 Olivier Hainque <hainque@adacore.com>
2880
2881 * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
2882 Address, and type of Low, High to Storage_Offset.
2883 (Low): Rename as Low_Address and convey that the return value is a
2884 runtime reference accounting for a load address.
2885 * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
2886 address/offset type changes.
2887 (Aranges_Lookup): Likewise.
2888 (Symbolic_Address): Likewise.
2889 (Symbolic_Traceback): Likewise.
2890 (Dump_Cache): Likewise.
2891 (Is_Inside): Likewise.
2892 (Open): Likewise.
2893 (Set_Load_Address): Likewise.
2894 (Low_Address): Likewise, and account for C.Load_Address.
2895 * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
2896 (Multi_Module_Symbolic_Traceback): Compare address in traceback
2897 with module Low_Address instead of Low.
2898
2899 2018-05-21 Olivier Hainque <hainque@adacore.com>
2900
2901 * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
2902 Load_Address.
2903 * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
2904 (Set_Load_Address): Likewise.
2905 (Symbolic_Traceback): Likewise.
2906
2907 2018-05-21 Olivier Hainque <hainque@adacore.com>
2908
2909 * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
2910 Load_Address argument and pass it down to Init_Module.
2911 * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
2912 lm.l_addr as the Load_Address to Add_Module_To_Cache.
2913
2914 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
2915
2916 * einfo.adb (Has_Discriminants): Stronger assertion.
2917 (Set_Has_Discriminants): Stronger assertion.
2918 * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
2919 the stronger assertion on Has_Discriminant.
2920 (Uninstall_Discriminants_And_Pop_Scope): Same as above.
2921 * sem_util.adb (New_Copy_Tree): Same as above.
2922 * sem_ch7.adb (Generate_Parent_References): Prevent calls to
2923 Has_Discriminant on non-type entities that might happen when the
2924 compiled code has errors.
2925 * sem_ch3.adb (Derived_Type_Declaration): Only call
2926 Set_Has_Discriminant on type entities.
2927
2928 2018-05-21 Arnaud Charlet <charlet@adacore.com>
2929
2930 * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
2931 code generation.
2932
2933 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
2934
2935 * lib.ads: Fix typo in enumeration in comment.
2936
2937 2018-05-21 Ed Schonberg <schonberg@adacore.com>
2938
2939 * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
2940 attribute reference is legal within a generic unit when the prefix is a
2941 formal private type.
2942
2943 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
2944
2945 * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
2946 delegate the secondary stack management when there is no suitable
2947 transient context, and the transient scope was intended to manage the
2948 secondary stack because this causes premature reclamation. Change the
2949 transient scope creation logic by special casing assignment statements
2950 of controlled components for type initialization procedures.
2951 (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
2952 the comment on usage.
2953 (Find_Transient_Context): Change the initinte loop into a while loop.
2954 Iterations schemes and iterator specifications are not valid transient
2955 contexts because they rely on special processing. Assignment statements
2956 are now treated as a normal transient context, special cases are
2957 handled by the caller. Add special processing for pragma Check.
2958 (Is_OK_Construct): Removed. Its functionality has been merged in
2959 routine Find_Transient_Context.
2960 * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
2961 retrieve the subprogram being invoked. Use a more accurate predicate
2962 (Requires_Transient_Scope) to determine that the function will emply
2963 the secondary stack.
2964
2965 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
2966
2967 * ada_get_targ.adb: Fix subprogram body headers.
2968 * adabkend.adb: Likewise.
2969 * checks.adb: Likewise.
2970 * exp_ch3.adb: Likewise.
2971 * exp_ch5.adb: Likewise.
2972 * exp_ch9.adb: Likewise.
2973 * exp_dist.adb: Likewise.
2974 * exp_tss.adb: Likewise.
2975 * inline.adb: Likewise.
2976 * lib-writ.adb: Likewise.
2977 * lib-xref-spark_specific.adb: Likewise.
2978 * libgnarl/s-osinte__darwin.adb: Likewise.
2979 * libgnarl/s-stusta.adb: Likewise.
2980 * libgnarl/s-taprop__solaris.adb: Likewise.
2981 * libgnarl/s-tposen.adb: Likewise.
2982 * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
2983 * libgnarl/s-vxwext__kernel.adb: Likewise.
2984 * libgnat/a-btgbso.adb: Likewise.
2985 * libgnat/a-cfdlli.adb: Likewise.
2986 * libgnat/a-cfhama.adb: Likewise.
2987 * libgnat/a-cfinve.adb: Likewise.
2988 * libgnat/a-cimutr.adb: Likewise.
2989 * libgnat/a-coboho.adb: Likewise.
2990 * libgnat/a-cofove.adb: Likewise.
2991 * libgnat/a-cofuve.adb: Likewise.
2992 * libgnat/a-comutr.adb: Likewise.
2993 * libgnat/a-exexda.adb: Likewise.
2994 * libgnat/a-tags.adb: Likewise.
2995 * libgnat/a-tideau.adb: Likewise.
2996 * libgnat/a-wtdeau.adb: Likewise.
2997 * libgnat/a-ztdeau.adb: Likewise.
2998 * libgnat/g-alleve.adb: Likewise.
2999 * libgnat/s-excdeb.adb: Likewise.
3000 * libgnat/s-parint.adb: Likewise.
3001 * libgnat/s-shasto.adb: Likewise.
3002 * libgnat/s-traceb__hpux.adb: Likewise.
3003 * prepcomp.adb: Likewise.
3004 * sem_ch4.adb: Likewise.
3005 * sem_ch6.adb: Likewise.
3006 * sem_dist.adb: Likewise.
3007 * sem_prag.adb: Likewise.
3008 * sem_util.adb: Likewise.
3009 * sinfo.adb: Likewise.
3010 * switch.adb: Likewise.
3011
3012 2018-05-04 John Marino <gnugcc@marino.st>
3013
3014 PR ada/85635
3015 * link.c (BSD platforms): Add missing backslash.
3016
3017 2018-04-27 Eric Botcazou <ebotcazou@adacore.com>
3018
3019 PR ada/85540
3020 * init.c (__gnat_handle_vms_condition): Add missing parentheses.
3021
3022 2018-04-25 Eric Botcazou <ebotcazou@adacore.com>
3023
3024 PR ada/85007
3025 * gnat_ugn.texi: Regenerate.
3026
3027 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
3028
3029 PR ada/85007
3030 * gnatlink.adb (Gnatlink): Remove handling of -b switch.
3031 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
3032 Remove documentation of -b switch.
3033
3034 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
3035
3036 PR ada/85036
3037 * gnatlink.adb (Process_Args): Drop existing link switches if multiple
3038 switches are passed for --LINK.
3039
3040 2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
3041
3042 PR ada/82813
3043 * gcc-interface/misc.c (gnat_post_options): Disable string overflow
3044 warnings.
3045
3046 2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
3047
3048 * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
3049 Consider only entities for objects.
3050
3051 2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
3052
3053 * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
3054 $(GNATLIBCFLAGS).
3055 (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
3056
3057 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
3058
3059 * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
3060 guarding the overflow check emitted for the upper bound of a floating-
3061 point conversion.
3062
3063 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
3064
3065 * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
3066
3067 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
3068
3069 * libgnat/i-cexten.ads (Float_128): New type.
3070
3071 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
3072
3073 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
3074 false if the component type is a pointer.
3075
3076 2018-01-11 Gary Dismukes <dismukes@adacore.com>
3077
3078 * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
3079 result of Get_Simple_Init_Value and pass the source location of the
3080 object declaration's object_definition.
3081
3082 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3083
3084 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
3085 properly object declarations with initializations that are
3086 build-in-place function calls, when there is an address specification,
3087 either as an aspect specification or an explicit attribute
3088 specification clause, for the initialized object.
3089 * freeze.adb (Check_Address_Clause): Do not remove side-effects from
3090 initial expressions in the case of a build-in-place call.
3091
3092 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
3093
3094 * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
3095 private (sub)type; refactor to avoid early return statement.
3096 (Not_Null_Range): Same as above.
3097
3098 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3099
3100 * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
3101 concurrent, nor effectively volatile.
3102 * ghost.adb (Check_Ghost_Type): New routine.
3103 * ghost.ads (Check_Ghost_Type): New routine.
3104 * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
3105 consider specific subsets of declarations.
3106 (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
3107 replicated by Is_Declaration.
3108 * sem_util.ads (Is_Declaration): New parameter profile. Update the
3109 comment on usage.
3110 (Is_Declaration_Other_Than_Renaming): Removed.
3111
3112 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3113
3114 * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
3115 as Part_Of consituents of single protected types are illegal when they
3116 take place inside a protected function.
3117 (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
3118 enclosing function.
3119 (Is_Protected_Part_Of_Constituent): New routine.
3120 (Within_Function): New routine.
3121
3122 2018-01-11 Arnaud Charlet <charlet@adacore.com>
3123
3124 Bump copyright notices to 2018.
3125
3126 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3127
3128 * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
3129 Minor reformatting.
3130
3131 2018-01-11 Justin Squirek <squirek@adacore.com>
3132
3133 * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
3134 to make sure a given expression function is properly parenthesized.
3135
3136 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3137
3138 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
3139 categorization of a subprogram body which does not complete a previous
3140 declaration.
3141
3142 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3143
3144 * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
3145 scope of package Ada is Standard.
3146
3147 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3148
3149 * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
3150 subcomponent of the current entity when building the body for a dynamic
3151 predicate function for a record with composite subcomponents.
3152
3153 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3154
3155 * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
3156 Establish_Transient_Scope.
3157 (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
3158 (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
3159 * exp_ch6.adb (Expand_Call_Helper): Update the call to
3160 Establish_Transient_Scope.
3161 (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
3162 Establish_Transient_Scope.
3163 * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
3164 management of the secondary stack to an enclosing scope if there is no
3165 suitable construct to wrap, and the transient scope was intended to
3166 manage the secondary stack.
3167 (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
3168 is a valid boundary for a transient expression which comes from the
3169 statements of the alternative, otherwise alternatives cannot be
3170 wrapped. Assignments of controlled objects which have controlled
3171 actions suppressed now stop the traversal as there is no point in
3172 looking for an enclosing construct. Add several N_xxx_Body choices to
3173 the termination conditions for completeness.
3174 * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
3175 and the associated comment on usage.
3176 * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
3177 Establish_Transient_Scope.
3178 (Add_Write_After): Update the call to Establish_Transient_Scope.
3179 * sem_res.adb (Check_Initialization_Call): Removed.
3180 (Resolve_Actuals): Account for additional cases where finalization
3181 actions are required by utilizing predicate Needs_Finalization rather
3182 than Is_Controlled.
3183 (Resolve_Call): Type initialization procedures can now utilize
3184 transient scopes to manage the secondary stack, thus preventing leaks
3185 during initialization. Remove the previous kludgy algorithm which
3186 attempts to manage the secondary stack at the object creation site.
3187
3188 2018-01-11 Jerome Lambourg <lambourg@adacore.com>
3189
3190 * libgnat/g-soliop__qnx.ads: New.
3191 * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
3192 for QNX.
3193
3194 2018-01-11 Bob Duff <duff@adacore.com>
3195
3196 * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
3197 a null procedure occurs in a protected definition.
3198
3199 2018-01-11 Bob Duff <duff@adacore.com>
3200
3201 * binderr.ads, namet.ads: Minor reformatting.
3202
3203 2018-01-11 Bob Duff <duff@adacore.com>
3204
3205 * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
3206 xml2gnat.
3207
3208 2018-01-11 Bob Duff <duff@adacore.com>
3209
3210 * binde.adb (Force_Elab_Order): Give an error if there are duplicate
3211 unit names.
3212
3213 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3214
3215 * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
3216 controlling argument of a dispatching call. freeze the corresponding
3217 designated type.
3218
3219 2018-01-11 Ben Brosgol <brosgol@adacore.com>
3220
3221 * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
3222
3223 2018-01-11 Ben Brosgol <brosgol@adacore.com>
3224
3225 * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
3226 corrections.
3227 * gnat_rm.texi: Regenerate.
3228
3229 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3230
3231 * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
3232 formsl type corresponding to the actual fixed point type is private,
3233 because in this case there can be no suspicious arithmetic operations
3234 in the generic unless they reference a formal subprogram. Clarify
3235 warning.
3236
3237 2018-01-11 Javier Miranda <miranda@adacore.com>
3238
3239 * exp_util.adb (Remove_Side_Effects): No action done for functions
3240 returning class-wide types since it requires generating code using
3241 'reference and the CCG target has no secondary stack.
3242 * gnat1drv.adb: Disable building static dispatch tables when generating
3243 C code.
3244
3245 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
3246
3247 * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
3248 libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
3249 (File_Type): Add Default_Initial_Condition aspect.
3250
3251 2018-01-11 Pascal Obry <obry@adacore.com>
3252
3253 * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
3254
3255 2018-01-11 Bob Duff <duff@adacore.com>
3256
3257 * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
3258 to match what the Libadalang-based version does.
3259 * doc/gnat_ugn/about_this_guide.rst: Update reference.
3260
3261 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3262
3263 * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
3264 if it contains at least one component declaration employing a function
3265 call returning on the secondary stack.
3266
3267 2018-01-11 Yannick Moy <moy@adacore.com>
3268
3269 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
3270 Update description of restriction SPARK_05 with SPARK 2014.
3271 * gnat_rm.texi: Regenerate.
3272
3273 2018-01-11 Vasiliy Fofanov <fofanov@adacore.com>
3274
3275 * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
3276
3277 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3278
3279 * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
3280 sem_res.adb, sem_util.adb: Minor reformatting.
3281
3282 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3283
3284 * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
3285 has a delayed aspect which must be processed at the point the type is
3286 frozen. This mimics what is done when the predicate is provided by a
3287 source aspect.
3288
3289 2018-01-11 Doug Rupp <rupp@adacore.com>
3290
3291 * init.c (vxworks): Add macro checks for __aarch64__.
3292
3293 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3294
3295 * exp_util.adb (Add_Failure_Expression): New routine.
3296 (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
3297 * sem_util.adb (Is_Current_Instance): Code cleanup.
3298
3299 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
3300
3301 * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
3302 Default_Sec_Stack_Size.
3303 * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
3304 limit check so that the integer index does not overflow. Check the
3305 dynamic stack allocation does not cause the secondary stack pointer to
3306 overflow.
3307 (SS_Info): Align colons.
3308 (SS_Init): Cover the case when bootstraping with an old compiler that
3309 does not set Default_SS_Size.
3310
3311 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3312
3313 * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
3314 legality of an inherited operation that may require overriding, ignore
3315 primitive_wrappers that correspond to explicit operations that override
3316 an interface primitive.
3317 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
3318 operation to which the class-wide expression applies is a protected op.
3319 with a primitive_wrapper, verify that the updated inherited expression
3320 does not contain an internal call to a protected function. This
3321 completes the implementation of AI12-0166.
3322
3323 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3324
3325 * ali.adb: Document the remaining letters available for ALI lines.
3326 (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
3327 * ali.ads: Update type With_Record. Field
3328 Implicit_With_From_Instantiation is no longer in use. Add field
3329 Implicit_With.
3330 * csinfo.adb (CSinfo): Remove the setup for attribute
3331 Implicit_With_From_Instantiation.
3332 * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
3333 either implicitly or explicitly withed.
3334 (Is_Implicit_With_Clause): New routine.
3335 (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
3336 confusion with the with clause attribute by the same name.
3337 (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
3338 * rtsfind.adb (Maybe_Add_With): Code cleanup.
3339 * sem_ch8.adb (Present_System_Aux): Code cleanup.
3340 * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
3341 for a parent unit.
3342 (Implicit_With_On_Parent): Mark the with clause as generated for a
3343 parent unit.
3344 * sem_ch12.adb (Inherit_Context): With clauses inherited by an
3345 instantiation are no longer marked as Implicit_With_From_Instantiation
3346 because they are already marked as implicit.
3347 * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
3348 which marks implicit with clauses as related to an instantiation.
3349 * sinfo.adb (Implicit_With_From_Instantiation): Removed.
3350 (Parent_With): New routine.
3351 (Set_Implicit_With_From_Instantiation): Removed.
3352 (Set_Parent_With): New routine.
3353 * sinfo.ads: Update the documentation of attribute Implicit_With.
3354 Remove attribute Implicit_With_From_Instantiation along with
3355 occurrences in nodes. Add attribute Parent_With along with occurrences
3356 in nodes.
3357 (Implicit_With_From_Instantiation): Removed along with pragma Inline.
3358 (Parent_With): New routine along with pragma Inline.
3359 (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
3360 (Set_Parent_With): New routine along with pragma Inline.
3361
3362 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3363
3364 * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
3365 entity when the enclosing construct is a body.
3366
3367 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
3368
3369 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
3370 Secondary_Stack_Size handling as a pragma is now generated for the
3371 corresponding aspect instead of an attribute. Pragma expression is
3372 relocated instead of evaluated. Discriminant of the corresponding
3373 record type is referenced rather than the type discriminant.
3374 (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
3375 Secondary_Stack_Size rep item checks to only look for the pragma rep.
3376 * sem_ch13.adb (Analyze_One_Aspect): Transform
3377 Aspect_Secondary_Stack_Size into a pragma instead of an attribute
3378 because the attribute does not have visibility on a task type's
3379 discriminants when the type's definition is expanded.
3380 (Analyze_Attribute_Definition_Clause): Remove handling of
3381 Attribute_Secondary_Stack_Size.
3382 * snames.adb-tmpl, snames.ads-tmpl: Remove
3383 Attribute_Secondary_Stack_Size, no longer used.
3384
3385 2018-01-11 Justin Squirek <squirek@adacore.com>
3386
3387 * sem_ch8.adb: Minor comment fix.
3388
3389 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3390
3391 * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
3392 individual action because the action may denote a complex expression,
3393 such as a case statement, which in turn may contain additional
3394 transient objects.
3395
3396 2018-01-11 Ed Schonberg <schonberg@adacore.com>
3397
3398 * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
3399 analysis on a copy of the expression with a copy of the index variable,
3400 because full expansion will rewrite construct into a loop with the
3401 original loop variable.
3402 * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
3403 expression is an iterated component association. Full analysis takes
3404 place when construct is rewritten as a loop.
3405 (In_Place_Assign_OK, Safe_Component): An iterated_component_association
3406 is not safe for in-place assignment.
3407 * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
3408 entity with no homonym and no other entity in the scope.
3409
3410 2018-01-11 Justin Squirek <squirek@adacore.com>
3411
3412 * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
3413 message to be printed on the pragma argument identifier.
3414
3415 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
3416
3417 * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
3418 entity of the generated invariant procedure in order to construct a
3419 proper entity chain.
3420
3421 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
3422
3423 * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
3424 comment.
3425
3426 2018-01-11 Arnaud Charlet <charlet@adacore.com>
3427
3428 * einfo.ads, einfo.adb (Activation_Record_Component,
3429 Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
3430 Allow E_Discriminant.
3431
3432 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
3433
3434 * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
3435 for atomic access once the component size is taken into account and
3436 also do it if the component type is Atomic or Volatile_Full_Access.
3437
3438 2018-01-04 Eric Botcazou <ebotcazou@adacore.com>
3439
3440 * gnatvsn.ads: Bump copyright year.
3441
3442 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3443 Alan Hayward <alan.hayward@arm.com>
3444 David Sherwood <david.sherwood@arm.com>
3445
3446 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
3447 as polynomial.
3448
3449 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3450 Alan Hayward <alan.hayward@arm.com>
3451 David Sherwood <david.sherwood@arm.com>
3452
3453 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
3454 as polynomial.
3455
3456 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3457 Alan Hayward <alan.hayward@arm.com>
3458 David Sherwood <david.sherwood@arm.com>
3459
3460 * gcc-interface/utils.c (gnat_types_compatible_p): Handle
3461 polynomial TYPE_VECTOR_SUBPARTS.
3462
3463 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3464 Alan Hayward <alan.hayward@arm.com>
3465 David Sherwood <david.sherwood@arm.com>
3466
3467 * gcc-interface/misc.c (enumerate_modes): Handle polynomial
3468 GET_MODE_NUNITS.
3469
3470 2018-01-03 Jakub Jelinek <jakub@redhat.com>
3471
3472 Update copyright years.
3473
3474 * gnat_ugn.texi: Bump @copying's copyright year.
3475 * gnat_rm.texi: Likewise.
3476 \f
3477 Copyright (C) 2018 Free Software Foundation, Inc.
3478
3479 Copying and distribution of this file, with or without modification,
3480 are permitted in any medium without royalty provided the copyright
3481 notice and this notice are preserved.