[multiple changes]
[gcc.git] / gcc / ada / ChangeLog
1 2017-01-19 Ed Schonberg <schonberg@adacore.com>
2
3 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
4 public, for use elsewhere.
5 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
6 an Inlined_body, recognize a call that uses object notation
7 and has not been rewritten as a regular call because regular
8 expansion has not taken place.
9
10 2017-01-19 Bob Duff <duff@adacore.com>
11
12 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
13 in case of generic formal discrete types, because it causes crashes in
14 the compiler when built with assertions on.
15
16 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
17
18 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
19 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
20
21 2017-01-19 Bob Duff <duff@adacore.com>
22
23 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
24 Increment Warnings_Detected. It was decrementing, which is
25 wrong since we just issued a warning message.
26 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
27 these variables to be of subtype Nat instead of Int, because
28 they should never be negative.
29
30 2017-01-19 Javier Miranda <miranda@adacore.com>
31
32 * contracts.adb (Build_Postconditions_Procedure): Replace
33 Generate_C_Code by Modify_Tree_For_C.
34 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
35 Replace Generate_C_Code by Modify_Tree_For_C.
36 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
37 Modify_Tree_For_C.
38 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
39 Generate_C_Code by Modify_Tree_For_C.
40 * exp_ch4.adb (Expand_Allocator_Expression): Replace
41 Generate_C_Code by Modify_Tree_For_C.
42 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
43 by Modify_Tree_For_C.
44 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
45 Generate_C_Code by Modify_Tree_For_C.
46 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
47 by Modify_Tree_For_C.
48 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
49
50 2017-01-19 Javier Miranda <miranda@adacore.com>
51
52 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
53 subprogram.
54 (Is_Inlinable_Expression_Function): New subprogram.
55 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
56 to Sem_Util.
57 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
58
59 2017-01-19 Ed Schonberg <schonberg@adacore.com>
60
61 * sem_ch4.adb (Diagnose_Call): Improve error message when a
62 selected component has a prefix that might be interpreted
63 as a parameterless function call, but none of the candidate
64 interpretations is parameterless, and there is a hidden homonym
65 of the prefix that is a package.
66 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
67 interpreted as a parameterless function call and its analysis
68 fails, do not call Analyze_Selected_Component.
69
70 2017-01-19 Steve Baird <baird@adacore.com>
71
72 * sem_util.ads: Add new Use_Full_View Boolean parameter to
73 Get_Index_Bounds.
74 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
75 calls to a newly-defined Scalar_Range_Of_Right_View function.
76
77 2017-01-19 Arnaud Charlet <charlet@adacore.com>
78
79 * gnat1drv.adb: minor fix of unbalanced parens in comment
80 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
81 to visible part of the package to allow re-use in GNATprove.
82 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
83 from repeated code of Traverse_Compilation_Unit.
84 (Traverse_Declaration_Or_Statement): fixed detection of
85 generic subprograms and packages; also, iteration over case
86 statement alternatives rewritten to avoid testing if the first
87 alternative is present (since it must be present due to Ada
88 syntax restrictions).
89
90 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
91
92 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
93 returning by reference not just for subprogram body stubs,
94 but for all subprogram cases.
95 * sem_util.adb: Code reformatting.
96 (Requires_Transient_Scope): Update the call to Results_Differ.
97 (Results_Differ): Update the parameter profile and the associated
98 comment on usage.
99
100 2017-01-19 Ed Schonberg <schonberg@adacore.com>
101
102 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
103 identifier nodes that do not come from source, to handle properly
104 dimensionality check within an inlined body which inclddes both
105 original operands and rewritten operands. This removes spurious
106 dimensionality errors in the presence of front-end inlining,
107 as well as in SPARK mode.
108
109 2017-01-16 Jakub Jelinek <jakub@redhat.com>
110
111 PR driver/49726
112 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
113
114 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
115
116 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
117
118 2017-01-13 Arnaud Charlet <charlet@adacore.com>
119
120 * doc/gnat_ugn/getting_started_with_gnat.rst,
121 doc/gnat_ugn/inline_assembler.rst,
122 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
123 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
124 doc/gnat_ugn/about_this_guide.rst,
125 doc/gnat_ugn/platform_specific_information.rst,
126 doc/gnat_ugn/example_of_binder_output.rst,
127 doc/gnat_ugn/gnat_and_program_execution.rst,
128 doc/gnat_ugn/gnat_utility_programs.rst,
129 doc/gnat_ugn/the_gnat_compilation_model.rst,
130 doc/gnat_rm/implementation_defined_attributes.rst,
131 doc/gnat_rm/compatibility_and_porting_guide.rst,
132 doc/gnat_rm/standard_library_routines.rst,
133 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
134 doc/gnat_rm/implementation_defined_pragmas.rst,
135 doc/gnat_rm/the_gnat_library.rst,
136 doc/gnat_rm/obsolescent_features.rst,
137 doc/gnat_rm/about_this_guide.rst,
138 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
139 doc/gnat_rm/implementation_of_ada_2012_features.rst,
140 doc/gnat_rm/interfacing_to_other_languages.rst,
141 doc/gnat_rm/implementation_defined_aspects.rst,
142 doc/gnat_rm.rst: Update documentation.
143 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
144
145 2017-01-13 Ed Schonberg <schonberg@adacore.com>
146
147 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
148 * scil_ll.adb: Minor style fix in comment.
149 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
150 even if entity is already set, because the node may be renalyzed
151 after inlining transformations.
152
153 2017-01-13 Javier Miranda <miranda@adacore.com>
154
155 * sem_res.adb (Resolve_Call): Do not establish a transient scope
156 for a call to inlinable expression function (since the call will
157 be replaced by its returned object).
158 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
159 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
160 (Expand_Call): For inlinable expression function call replace the
161 call by its returned object.
162 (Is_Inlinable_Expression_Function): New subprogram.
163
164 2017-01-13 Gary Dismukes <dismukes@adacore.com>
165
166 * checks.adb: Minor typo fix and reformatting.
167
168 2017-01-13 Javier Miranda <miranda@adacore.com>
169
170 * contracts.adb (Contract_Only_Subprograms): Remove formal.
171 (Copy_Original_Specification): Removed.
172 (Skip_Contract_Only_Subprogram): Move here checks previously
173 located in the caller of this routine (to leave the code more clean).
174 (Build_Contract_Only_Subprogram): Code cleanup.
175 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
176 (Get_Contract_Only_Missing_Body_Name): Removed.
177
178 2017-01-13 Javier Miranda <miranda@adacore.com>
179
180 * sem_ch6.adb (Cloned_Expression): New subprogram.
181 (Freeze_Expr_Types): Complete previous patch since the expression
182 of an expression-function may have iterators and loops with
183 defining identifiers which, as part of the preanalysis of the
184 expression, may be left decorated with itypes that will not be
185 available in the tree passed to the backend.
186
187 2017-01-13 Ed Schonberg <schonberg@adacore.com>
188
189 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
190 conversion to Integer of an expression that is an attribute
191 reference 'Pos on an enumeration type.
192
193 2017-01-13 Bob Duff <duff@adacore.com>
194
195 * atree.ads: Minor comment fix.
196
197 2017-01-13 Justin Squirek <squirek@adacore.com>
198
199 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
200 calls in accessibility check on return statement.
201
202 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
203
204 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
205 Ensure that the input body is a subprogram body before trying to
206 determine whether it denoted an expression function. Note that
207 subprogram body stubs cannot denote expression functions.
208
209 2017-01-13 Gary Dismukes <dismukes@adacore.com>
210
211 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
212 and typo fixes.
213
214 2017-01-13 Javier Miranda <miranda@adacore.com>
215
216 * einfo.ads (Component_Bit_Offset): Fix documentation.
217 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
218 on record holes for components with unknown compile-time offsets.
219
220 2017-01-13 Bob Duff <duff@adacore.com>
221
222 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
223 * g-locfil.ads: Minor comment fix.
224
225 2017-01-13 Bob Duff <duff@adacore.com>
226
227 * binde.adb (Elab_New): New elaboration order algorithm
228 that is expected to cause fewer ABE issues. This is a work in
229 progress. The new algorithm is currently disabled, and can be
230 enable by the -dp switch, or by modifying the Do_Old and Do_New
231 etc. flags and rebuilding. Experimental code is included to
232 compare the results of the old and new algorithms.
233 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
234 can have multiple of these tables, so the old and new algorithms
235 can coexist.
236 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
237 parameter of type array. This avoids the global variable, and
238 allows bounds checking (which is normally defeated by the tables
239 packages). It also ensures that the Elab_Order is read-only
240 to Bindgen.
241 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
242 subprograms that need it, as above.
243 * debug.adb: Document new -dp switch. Modify doc of old -do
244 switch.
245 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
246 and Bindgen. Move writing of closure (-R and -Ra switches)
247 to Binde; that's more convenient.
248
249 2017-01-13 Ed Schonberg <schonberg@adacore.com>
250
251 * sem_ch6.adb (Analyze_Expression_Function): If the expression
252 function is a completion, all entities referenced in the
253 expression are frozen. As a consequence, a reference to an
254 uncompleted private type from an enclosing scope is illegal.
255
256 2017-01-13 Javier Miranda <miranda@adacore.com>
257
258 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
259 (Analyze_Subprogram_Body_Helper): At the occurrence of an
260 expression function declaration that is a completion, its
261 expression causes freezing (AI12-0103).
262
263 2017-01-13 Vadim Godunko <godunko@adacore.com>
264
265 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
266 Reference functions of Ada.Containers.Indefinite_Holders.
267
268 2017-01-13 Bob Duff <duff@adacore.com>
269
270 * s-os_lib.ads: Minor comment fixes.
271
272 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
273
274 * exp_ch3.adb (Default_Initialize_Object): Do not default
275 initialize an object when it is of a task type and restriction
276 No_Tasking is in effect because the initialization is obsolete.
277 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
278 restriction No_Tasking is in effect.
279 (Build_Master_Renaming): Do not rename a master when restriction
280 No_Tasking is in effect.
281
282 2017-01-13 Ed Schonberg <schonberg@adacore.com>
283
284 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
285 the legality of An others clause applies as well to a choice in
286 an Iterated_component_ association.
287 (Resolve_Iterated_Component_Association): An others choice
288 is legal.
289 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
290 Iterated_Component_Association is not static.
291
292 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
293
294 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
295 control is passed to the expresion handler before the new mode
296 is set.
297 * sem_ch12.adb (Analyze_Package_Instantiation,
298 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
299 in case control is passed to the expresion handler before the
300 new mode is set.
301
302 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
303
304 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
305 exp_aggr.adb: Minor reformatting.
306
307 2017-01-13 Gary Dismukes <dismukes@adacore.com>
308
309 * inline.adb: Minor reformatting and typo fix.
310
311 2017-01-13 Ed Schonberg <schonberg@adacore.com>
312
313 * sem_util.ads, sem_util.adb (Choice_List): Move function here
314 from sem_aggr.adb, for use elsewhere.
315 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
316 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
317 Iterated_Component_Present.
318 * exp_aggr.adb: Use Choice_List throughout, to handle
319 Iterated_Component_Associations.
320 (Gen_Loop): Generate proper loop for an
321 Iterated_Component_Association: loop variable has the identifier
322 of the original association. Generate a loop even for a single
323 component choice, in order to make loop parameter visible in
324 expression.
325 (Flatten): An Iterated_Component_Association is not static.
326
327 2017-01-13 Yannick Moy <moy@adacore.com>
328
329 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
330 float exponentiation for statically known small negative values
331 is the reciprocal of the exponentiation for the opposite value
332 of the exponent.
333 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
334 Ensure that the value of float exponentiation for negative values
335 is the reciprocal of the exponentiation for the opposite value
336 of the exponent.
337 * inline.adb (Expand_Inlined_Call): Fix the count
338 for the number of generated gotos.
339
340 2017-01-13 Yannick Moy <moy@adacore.com>
341
342 * inline.adb: Code cleanup.
343 * sem_util.adb (Is_OK_Volatile_Context): Add
344 expression in delay statement as OK for volatile context.
345
346 2017-01-13 Ed Schonberg <schonberg@adacore.com>
347
348 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
349 mode a choice that is a subtype with a static predicate is
350 replaced by the values it covers. This transformation must not
351 be performed in ASIS mode, to preserve the source for analysis.
352
353 2017-01-13 Justin Squirek <squirek@adacore.com>
354
355 * nlists.ads: Correct minor typo.
356
357 2017-01-13 Gary Dismukes <dismukes@adacore.com>
358
359 * sem_ch13.adb: Minor reformatting and typo fix.
360
361 2017-01-13 Ed Schonberg <schonberg@adacore.com>
362
363 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
364 Iterated_Component_Association is a named association in an
365 array aggregate.
366 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
367 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
368 and resolve the discrete choices and the expression of the
369 new construct.
370 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
371 Loop_Actions and Box_Present are attributes of
372 N_Iterated_Component_Association nodes. Box_Present is always
373 False in this case.
374 * sprint.adb (Sprint_Node): An Iterated_Component_Association
375 has a Discrete_Choices list, as specified in the RM. A
376 Component_Association for aggregate uses instead a Choices list.
377 We have to live with this small inconsistency because the new
378 construct also has a defining identifier, and there is no way
379 to merge the two node structures.
380
381 2017-01-13 Yannick Moy <moy@adacore.com>
382
383 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
384 list of pragmas to remove. Remove pragmas from the list of
385 statements in the body to inline.
386 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
387
388 2017-01-13 Ed Schonberg <schonberg@adacore.com>
389
390 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
391 Analyze_Declarations, to analyze and resolve the expressions of
392 aspect specifications in the current declarative list, so that
393 the expressions have proper entity and type info. This is needed
394 for ASIS when there is no subsequent expansion to generate this
395 semantic information.
396 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
397 original expression, to suppress cascaded errors when expression
398 has been constant-folded.
399 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
400 ASIS mode, because there is no subsequent expansion to decorate
401 the tree.
402
403 2017-01-13 Yannick Moy <moy@adacore.com>
404
405 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
406 New function to detect when a call may be inlined or not in
407 GNATprove mode.
408 (Expand_Inlined_Call): Ensure that a temporary
409 is always created in the cases where a type conversion may be
410 needed on an input parameter in GNATprove mode, so that GNATprove
411 sees the check to perform.
412 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
413 when not applicable due to actual requiring type conversion
414 with possible check but no temporary value can be copied for
415 GNATprove to see the check.
416
417 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
418
419 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
420 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
421 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
422 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
423 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
424 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
425 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
426 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
427 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
428 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
429 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
430 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
431 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
432 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
433 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
434 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
435 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
436 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
437 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
438 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
439 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
440 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
441 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
442 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
443 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
444 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
445 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
446 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
447 statements to reflect the new style for case alternatives. Various
448 code clean up and reformatting.
449
450 2017-01-13 Gary Dismukes <dismukes@adacore.com>
451
452 * exp_util.adb: Minor reformatting.
453
454 2017-01-13 Yannick Moy <moy@adacore.com>
455
456 * exp_spark.adb: Code cleanup.
457 * sem_ch9.adb (Analyze_Delay_Until): Resolve
458 expression so that calls are identified as such inside delay
459 until.
460
461 2017-01-13 Ed Schonberg <schonberg@adacore.com>
462
463 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
464 * par-ch3.adb (P_Discrete_Choice_List): An
465 Iterated_Component_Association is an array aggregate component.
466 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
467 (Is_Quantified_Expression): New function that performs a lookahead
468 to distinguish quantified expressions from iterated component
469 associations.
470 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
471 associations.
472 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
473 * sem.adb (Analyze): Handle Iterated_Component_Association.
474 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
475 component associations.
476 * sinfo.ads, sinfo.adb: Entries for for
477 N_Iterated_Component_Association and its fields.
478 * sprint.adb (Sprint_Node_Actual): Handle
479 N_Iterated_Component_Association.
480
481 2017-01-13 Justin Squirek <squirek@adacore.com>
482
483 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
484 of the style check until after preanalysis of acutals.
485
486 2017-01-13 Yannick Moy <moy@adacore.com>
487
488 * sem_ch13.adb: Minor reformatting.
489 * par-ch11.adb: minor style fix in whitespace
490 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
491 reduced to Add_Artificial_ALI_File; style fix in declaration of
492 Text; grammar fix in comment.
493 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
494 * freeze.adb: Cleanup to pass pragma instead of
495 expression to call.
496 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
497 replace System'To_Address by equivalent call.
498
499 2017-01-13 Arnaud Charlet <charlet@adacore.com>
500
501 * bindusg.adb: Improve usage output for -f switch.
502
503 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
504
505 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
506 Minor reformatting.
507
508 2017-01-13 Ed Schonberg <schonberg@adacore.com>
509
510 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
511 treat comparisons on strings as legal in a Static_Predicate.
512 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
513 a function call that is the expansion of a string comparison.The
514 function call is built when compiling the corresponding predicate
515 function, but the expression has been found legal as a static
516 predicate during earlier analysis.
517 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
518 properly a function call that is the expansion of a string
519 comparison operation, in order to recover the Static_Predicate
520 expression and apply it to a static argument when needed.
521
522 2017-01-13 Tristan Gingold <gingold@adacore.com>
523
524 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
525 (Open_Read): Re-implement using Open_Read_No_Exception.
526 (Open_Write): Raise exception in case of error.
527 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
528 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
529 reaise exception.
530 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
531
532 2017-01-13 Yannick Moy <moy@adacore.com>
533
534 * checks.adb: Code cleanup.
535
536 2017-01-13 Yannick Moy <moy@adacore.com>
537
538 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
539 expression instead of unanalyzed aspect expression for checking
540 the validity of inheriting an operation. Also copy the expression
541 being passing it to Build_Class_Wide_Expression, as this call
542 modifies its argument.
543 * sem_util.ads Fix comment to reference correct function name
544 New_Copy_Tree.
545
546 2017-01-13 Javier Miranda <miranda@adacore.com>
547
548 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
549 when we propagate information about the indexes back to the original
550 indexing mode and the prefix of the index is a function call, do not
551 remove any parameter from such call.
552
553 2017-01-13 Gary Dismukes <dismukes@adacore.com>
554
555 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
556 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
557 a build-in-place function whose result type is tagged.
558
559 2017-01-13 Yannick Moy <moy@adacore.com>
560
561 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
562 Do not generate a wrapper when the only candidate is a class-wide
563 subprogram.
564 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
565 inside a generic context.
566
567 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
568
569 * exp_util.adb (Add_Inherited_Tagged_DIC):
570 Pass the object parameters of both the parent and the derived
571 type DIC procedure to the reference replacement circuitry.
572 (Find_DIC_Type): Modify the circuitry to present the partial
573 view of a private type in case the private type defines its own
574 DIC pragma.
575 (Replace_Object_And_Primitive_References): Add two
576 optional formal parameters. Update the comment on usage. Update
577 the replacement of references to object parameters.
578
579 2017-01-13 Gary Dismukes <dismukes@adacore.com>
580
581 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
582
583 2017-01-13 Ed Schonberg <schonberg@adacore.com>
584
585 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
586 an out parameter that is a type conversion, independently of th
587 range check that may apply to the expression of the conversion,
588 for use in GNATProve.
589
590 2017-01-13 Yannick Moy <moy@adacore.com>
591
592 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
593 GNATprove_Mode here to Frontend.
594 * frontend.adb (Frontend): Move the implicit with for System
595 in GNATprove_Mode here as it ismore correct this way; the old
596 place only worked by chance, since there were no overloaded names.
597 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
598 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
599 four attributes identified in SRM 9(18), add an implicit with
600 to Ada.Task_Identification.
601 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
602 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
603 mode.
604 * checks.adb (Apply_Discriminant_Check,
605 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
606 In GNATprove mode, we do not apply the checks, but we still
607 analyze the expression to possibly issue errors on SPARK
608 code when a run-time error can be detected at compile time.
609 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
610 in GNATprove mode.
611
612 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
613
614 * expander.adb (Expand): Add a warning about using return
615 statements in Ghost management code.
616 * exp_ch3.adb (Freeze_Type): Add a warning about using return
617 statements in Ghost management code.
618 * exp_ch7.adb (Build_Invariant_Procedure_Body,
619 Build_Invariant_Procedure_Declaration): Add a warning about
620 using return statements in Ghost management code.
621 * exp_disp.adb (Make_DT): Add a warning about using return
622 statements in Ghost management code.
623 * exp_util.adb (Build_DIC_Procedure_Body,
624 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
625 warning about using return statements in Ghost management code.
626 * freeze.adb (Freeze_Entity): Add a warning about using return
627 statements in Ghost management code.
628 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
629 statements in Ghost management code.
630 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
631 a warning about using return statements in Ghost management code.
632 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
633 return statements in Ghost management code.
634 * sem_ch6.adb (Analyze_Procedure_Call,
635 Analyze_Subprogram_Body_Helper): Add a warning about using return
636 statements in Ghost management code.
637 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
638 using return statements in Ghost management code.
639 * sem_ch12.adb (Analyze_Package_Instantiation,
640 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
641 Instantiate_Subprogram_Body): Add a warning about using return
642 statements in Ghost management code.
643 * sem_ch13.adb (Build_Predicate_Functions,
644 Build_Predicate_Function_Declarations): Add a warning about
645 using return statements in Ghost management code.
646 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
647 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
648 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
649 using return statements in Ghost management code.
650
651 2017-01-13 Tristan Gingold <gingold@adacore.com>
652
653 * s-mmosin-mingw.adb: Fix pragma import.
654
655 2017-01-13 Arnaud Charlet <charlet@adacore.com>
656
657 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
658 codepeer mode.
659
660 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
661
662 * atree.adb (Allocate_Initialize_Node): A newly created node is
663 no longer marked as Ghost at this level.
664 (Mark_New_Ghost_Node): New routine.
665 (New_Copy): Mark the copy as Ghost.
666 (New_Entity): Mark the entity as Ghost.
667 (New_Node): Mark the node as Ghost.
668 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
669 apply to unanalyzed entities.
670 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
671 entities.
672 (Set_Is_Checked_Ghost_Entity): This attribute now
673 applies to all entities as well as unanalyzed entities.
674 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
675 all entities as well as unanalyzed entities.
676 * expander.adb Add with and use clauses for Ghost.
677 (Expand): Install and revert the Ghost region associated with the node
678 being expanded.
679 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
680 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
681 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
682 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
683 (Freeze_Type): Install and revert the Ghost region associated
684 with the type being frozen.
685 * exp_ch5.adb Remove with and use clauses for Ghost.
686 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
687 * exp_ch6.adb Remove with and use clauses for Ghost.
688 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
689 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
690 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
691 Ghost region of the working type.
692 (Build_Invariant_Procedure_Declaration): Install and revert
693 the Ghost region of the working type.
694 (Expand_N_Package_Body): Remove all Ghost-related code.
695 * exp_ch8.adb Remove with and use clauses for Ghost.
696 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
697 code.
698 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
699 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
700 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
701 code.
702 * exp_ch13.adb Remove with and use clauses for Ghost.
703 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
704 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
705 the tagged type. Move the generation of various entities within
706 the Ghost region of the type.
707 * exp_prag.adb Remove with and use clauses for Ghost.
708 (Expand_Pragma_Check): Remove all Ghost-related code.
709 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
710 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
711 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
712 * exp_util.adb (Build_DIC_Procedure_Body): Install
713 and revert the Ghost region of the working types.
714 (Build_DIC_Procedure_Declaration): Install and revert the
715 Ghost region of the working type.
716 (Make_Invariant_Call): Install and revert the Ghost region of the
717 associated type.
718 (Make_Predicate_Call): Reimplemented. Install and revert the
719 Ghost region of the associated type.
720 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
721 of the entity being frozen.
722 (New_Freeze_Node): Removed.
723 * ghost.adb Remove with and use clauses for Opt.
724 (Check_Ghost_Completion): Update the parameter profile
725 and all references to formal parameters.
726 (Ghost_Entity): Update the comment on usage.
727 (Install_Ghost_Mode): New routines.
728 (Is_Ghost_Assignment): New routine.
729 (Is_Ghost_Declaration): New routine.
730 (Is_Ghost_Pragma): New routine.
731 (Is_Ghost_Procedure_Call): New routine.
732 (Is_Ghost_Renaming): Removed.
733 (Is_OK_Declaration): Reimplemented.
734 (Is_OK_Pragma): Reimplemented.
735 (Is_OK_Statement): Reimplemented.
736 (Is_Subject_To_Ghost): Update the comment on usage.
737 (Mark_And_Set_Ghost_Assignment): New routine.
738 (Mark_And_Set_Ghost_Body): New routine.
739 (Mark_And_Set_Ghost_Completion): New routine.
740 (Mark_And_Set_Ghost_Declaration): New routine.
741 (Mark_And_Set_Ghost_Instantiation): New routine.
742 (Mark_And_Set_Ghost_Procedure_Call): New routine.
743 (Mark_Full_View_As_Ghost): Removed.
744 (Mark_Ghost_Declaration_Or_Body): New routine.
745 (Mark_Ghost_Pragma): New routine.
746 (Mark_Ghost_Renaming): New routine.
747 (Mark_Pragma_As_Ghost): Removed.
748 (Mark_Renaming_As_Ghost): Removed.
749 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
750 (Prune_Node): Freeze nodes no longer need special pruning, they
751 are processed by the general ignored Ghost code mechanism.
752 (Restore_Ghost_Mode): New routine.
753 (Set_Ghost_Mode): Reimplemented.
754 (Set_Ghost_Mode_From_Entity): Removed.
755 * ghost.ads Add with and use clauses for Ghost.
756 (Check_Ghost_Completion): Update the parameter profile
757 along with the comment on usage.
758 (Install_Ghost_Mode): New routine.
759 (Is_Ghost_Assignment): New routine.
760 (Is_Ghost_Declaration): New routine.
761 (Is_Ghost_Pragma): New routine.
762 (Is_Ghost_Procedure_Call): New routine.
763 (Mark_And_Set_Ghost_Assignment): New routine.
764 (Mark_And_Set_Ghost_Body): New routine.
765 (Mark_And_Set_Ghost_Completion): New routine.
766 (Mark_And_Set_Ghost_Declaration): New routine.
767 (Mark_And_Set_Ghost_Instantiation): New routine.
768 (Mark_And_Set_Ghost_Procedure_Call): New routine.
769 (Mark_Full_View_As_Ghost): Removed.
770 (Mark_Ghost_Pragma): New routine.
771 (Mark_Ghost_Renaming): New routine.
772 (Mark_Pragma_As_Ghost): Removed.
773 (Mark_Renaming_As_Ghost): Removed.
774 (Restore_Ghost_Mode): New routine.
775 (Set_Ghost_Mode): Redefined.
776 (Set_Ghost_Mode_From_Entity): Removed.
777 * sem.adb (Analyze): Install and revert the Ghost region of the
778 node being analyzed.
779 (Do_Analyze): Change the way a clean Ghost
780 region is installed and reverted.
781 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
782 all Ghost-related code.
783 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
784 (Analyze_Number_Declaration): Remove all Ghost-related code.
785 (Analyze_Object_Declaration): Install and revert the Ghost region of
786 a deferred object declaration's completion.
787 (Array_Type_Declaration): Remove all Ghost-related code.
788 (Build_Derived_Type): Update the comment on
789 the propagation of Ghost attributes from a parent to a derived type.
790 (Derive_Subprogram): Remove all Ghost-related code.
791 (Make_Class_Wide_Type): Remove all Ghost-related code.
792 (Make_Implicit_Base): Remove all Ghost-related code.
793 (Process_Full_View): Install and revert the Ghost region of
794 the partial view. There is no longer need to check the Ghost
795 completion here.
796 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
797 region of the left hand side.
798 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
799 all Ghost-related code.
800 (Analyze_Expression_Function): Remove all Ghost-related code.
801 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
802 (Analyze_Procedure_Call): Install and revert the Ghost region of
803 the procedure being called.
804 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
805 region of the spec or body.
806 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
807 (Build_Subprogram_Declaration): Remove all Ghost-related code.
808 (Find_Corresponding_Spec): Remove all Ghost-related code.
809 (Process_Formals): Remove all Ghost-related code.
810 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
811 the Ghost region of the spec.
812 (Analyze_Package_Declaration): Remove all Ghost-related code.
813 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
814 Ghost when it aliases a Ghost entity.
815 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
816 a Ghost entity.
817 (Analyze_Object_Renaming): Mark a renaming as Ghost when
818 it aliases a Ghost entity.
819 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
820 a Ghost entity.
821 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
822 aliases a Ghost entity.
823 * sem_ch11.adb Remove with and use clauses for Ghost.
824 (Analyze_Exception_Declaration): Remove all Ghost-related code.
825 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
826 Ghost-related code.
827 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
828 code.
829 (Analyze_Package_Instantiation): Install and revert the Ghost region
830 of the package instantiation.
831 (Analyze_Subprogram_Instantiation): Install
832 and revert the Ghost region of the subprogram instantiation.
833 (Instantiate_Package_Body): Code clean up. Install and revert the
834 Ghost region of the package body.
835 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
836 Ghost region of the subprogram body.
837 * sem_ch13.adb (Build_Predicate_Functions): Install
838 and revert the Ghost region of the related type.
839 (Build_Predicate_Function_Declaration): Code clean up. Install
840 and rever the Ghost region of the related type.
841 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
842 Install and revert the Ghost region of the pragma.
843 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
844 Ghost region of the pragma.
845 (Analyze_Pragma): Install and revert the Ghost region of various
846 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
847 or encloses a Ghost entity.
848 (Analyze_Pre_Post_Condition): Install and revert the Ghost
849 region of the pragma.
850 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
851 Ghost region of the pragma.
852 * sem_res.adb (Resolve): Remove all Ghost-related code.
853 * sem_util.adb (Is_Declaration): Reimplemented.
854 (Is_Declaration_Other_Than_Renaming): New routine.
855 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
856 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
857 (Is_Ghost_Pragma): Removed.
858 (Is_Ignored_Ghost_Pragma): New routine.
859 (Set_Is_Checked_Ghost_Pragma): New routine.
860 (Set_Is_Ghost_Pragma): Removed.
861 (Set_Is_Ignored_Ghost_Pragma): New routine.
862 * sinfo.ads: Update the documentation on Ghost mode and
863 Ghost regions. New attributes Is_Checked_Ghost_Pragma
864 and Is_Ignored_Ghost_Pragma along with usages in nodes.
865 Remove attribute Is_Ghost_Pragma along with usages in nodes.
866 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
867 (Is_Ghost_Pragma): Removed along with pragma Inline.
868 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
869 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
870 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
871 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
872
873 2017-01-12 Tristan Gingold <gingold@adacore.com>
874
875 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
876 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
877
878 2017-01-12 Yannick Moy <moy@adacore.com>
879
880 * errout.adb, errout.ads (Initialize): Factor common treatment
881 in Reset_Warnings.
882 (Reset_Warnings): New procedure to reset counts related to warnings.
883 (Record_Compilation_Errors): New variable to store the presence of an
884 error, used in gnat2why to allow changing the Warning_Mode.
885 (Compilation_Errors): Use new variable Record_Compilation_Errors to
886 store the presence of an error.
887
888 2017-01-12 Javier Miranda <miranda@adacore.com>
889
890 * sem_ch13.adb (Analyze_Aspect_Specifications):
891 For Interrupt_Handler and Attach_ Handler aspects, decorate the
892 internally built reference to the protected procedure as coming
893 from sources and force its analysis.
894
895 2017-01-12 Ed Schonberg <schonberg@adacore.com>
896
897 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
898 inherit predicates if any from the first_subtype of the parent,
899 not from the anonymous parent type.
900 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
901 predicate is not a static subtype.
902
903 2017-01-12 Gary Dismukes <dismukes@adacore.com>
904
905 * freeze.adb (Check_Suspicious_Convention): New procedure
906 performing a warning check on discriminated record types with
907 convention C or C++. Factored out of procedure Freeze_Record_Type,
908 and changed to only apply to base types (to avoid spurious
909 warnings on subtypes). Minor improvement of warning messages
910 to refer to discriminated rather than variant record types.
911 (Freeze_Record_Type): Remove code for performing a suspicious
912 convention check.
913 (Freeze_Entity): Only call Freeze_Record_Type
914 on types that aren't declared within any enclosing generic units
915 (rather than just excluding the type when the innermost scope
916 is generic). Call Check_Suspicious_Convention whether or not
917 the type is declared within a generic unit.
918 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
919 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
920 from Sem_Ch8).
921
922 2017-01-12 Tristan Gingold <gingold@adacore.com>
923
924 * sysdep.c, adaint.c, rtinit.c, ming32.h:
925 (__gnat_current_codepage): Renamed from CurrentCodePage
926 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
927
928 2017-01-12 Ed Schonberg <schonberg@adacore.com>
929
930 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
931 quantified expressions, following AI12-050: the loop parameters
932 of two quantified expressions are conformant if they have the
933 same identifier.
934
935 2017-01-12 Arnaud Charlet <charlet@adacore.com>
936
937 * gcc-interface/Makefile.in: Clean up VxWorks targets.
938
939 2017-01-12 Ed Schonberg <schonberg@adacore.com>
940
941 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
942 Hnadle properly the attribute reference when it appears as part
943 of an expression in another loop aspect.
944
945 2017-01-12 Ed Schonberg <schonberg@adacore.com>
946
947 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
948 subsidiary of Build_Initialization_Call, to complete generation
949 of predicate checks on discriminants whose (sub)types have
950 predicates, and to add checks on variants that do not have an
951 others clause.
952 * sem_util.adb (Gather_Components): A missing Others alternative is
953 not an error when the type of the discriminant is a static predicate
954 (and coverage has been checked when analyzing the case statement). A
955 runtime check is generated to verify that a given discriminant
956 satisfies the predicate (RM 3.8.1. (21.1/2)).
957
958 2017-01-12 Yannick Moy <moy@adacore.com>
959
960 * gnat1drv.adb (Adjust_Global_Switches): Only
961 perform checking of exception mechanism when generating code.
962
963 2017-01-12 Justin Squirek <squirek@adacore.com>
964
965 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
966 Remove handling of access component with invariant.
967 (Build_Invariant_Procedure_Declaration): Remove return on class
968 wide type.
969 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
970 conditional exception for component or array so Has_Own_Invariants
971 flag is not falsly set.
972 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
973 wide type to have no invariant flags.
974
975 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
976
977 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
978 sem_ch13.adb: Minor reformatting.
979
980 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
981
982 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
983 adjustment primitive when the ancestor type was not properly frozen.
984 (Gen_Assign): Guard against a missing initialization
985 primitive when the component type was not properly frozen.
986 (Initialize_Array_Component): Guard against a missing adjustment
987 primitive when the component type was not properly frozen.
988 (Initialize_Record_Component): Guard against a missing adjustment
989 primitive when the component type was not properly frozen.
990 (Process_Transient_Component_Completion): The transient object may
991 not be finalized when its associated type was not properly frozen.
992 * exp_ch3.adb (Build_Assignment): Guard against a missing
993 adjustment primitive when the component type was not properly frozen.
994 (Build_Initialization_Call): Guard against a missing
995 initialization primitive when the associated type was not properly
996 frozen.
997 (Expand_N_Object_Declaration): Guard against a missing
998 adjustment primitive when the base type was not properly frozen.
999 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
1000 body when there is no adjustment primitive available. Create an
1001 empty Deep_Finalize body when there is no finalization primitive
1002 available.
1003 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
1004 missing finalization primitive when the designated type was
1005 not properly frozen.
1006 (Expand_N_Allocator): Guard against a missing initialization primitive
1007 when the designated type was not properly frozen.
1008 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
1009 only when the corresponding adjustment primitive is available.
1010 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
1011 adjustment/finalization statements only when there is an available
1012 primitive to carry out the action.
1013 (Build_Initialize_Statements): Generate the initialization/finalization
1014 statements only when there is an available primitive to carry out the
1015 action.
1016 (Make_Adjust_Call): Do not generate a call when the underlying
1017 type is not present due to a possible missing full view.
1018 (Make_Final_Call): Do not generate a call when the underlying
1019 type is not present due to a possible missing full view.
1020 (Make_Finalize_Address_Stmts): Generate an empty body when the
1021 designated type lacks a finalization primitive.
1022 (Make_Init_Call): Do not generate a call when the underlying type is
1023 not present due to a possible missing full view.
1024 (Process_Component_For_Adjust): Add the adjustment call only when the
1025 corresponding adjustment primitive is available.
1026 (Process_Component_For_Finalize): Add the finalization call only when
1027 the corresponding finalization primitive is available.
1028 (Process_Object_Declaration): Use a null statement to emulate a
1029 missing call to the finalization primitive of the object type.
1030 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
1031 (Make_Final_Call): Update the comment on usage.
1032 (Make_Init_Call): Update the comment on usage.
1033 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
1034
1035 2017-01-12 Arnaud Charlet <charlet@adacore.com>
1036
1037 * einfo.ads: Update documentation of Address_Taken.
1038 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
1039 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
1040 for subprograms when setting Address_Taken flag.
1041
1042 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
1043
1044 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
1045 Configurable_Run_Time_Mode off when analysing with'ed predefined
1046 libraries.
1047
1048 2017-01-12 Gary Dismukes <dismukes@adacore.com>
1049
1050 * sem_prag.adb: Minor reformatting.
1051 * sem_util.adb (Unique_Entity): fix result for
1052 bodies of entry families.
1053
1054 2017-01-12 Justin Squirek <squirek@adacore.com>
1055
1056 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
1057 Resolve_Suppressible in the pragma Assertion_Policy case.
1058 (Resolve_Suppressible): Created this function to factor out
1059 common code used to resolve Suppress to either Ignore or Check
1060 * snames.ads-tmpl: Add name for Suppressible.
1061
1062 2017-01-12 Gary Dismukes <dismukes@adacore.com>
1063
1064 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
1065 reformatting.
1066 * debug.adb: Minor comment fixes.
1067
1068 2017-01-12 Arnaud Charlet <charlet@adacore.com>
1069
1070 * sem_util.adb (Unique_Entity): For concurrent
1071 bodies that are defined with stubs and complete a declaration
1072 of a single concurrent object return the entity of an implicit
1073 concurrent type, not the entity of the anonymous concurrent
1074 object.
1075 * debug.adb: -gnatd.J is no longer used.
1076 * make.adb (Globalize): Removed, no longer used.
1077 * sem_ch9.adb: minor typo in comment for entry index
1078
1079 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
1080
1081 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
1082 * exp_ch3.adb (Build_Init_Statements): As part of initialising
1083 the value record of a task, set its _Secondary_Stack_Size field
1084 if present.
1085 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
1086 a _Secondary_Stack_Size field in the value record of
1087 the task if a Secondary_Stack_Size rep item is present.
1088 (Make_Task_Create_Call): Include secondary stack size
1089 parameter. If No_Secondary_Stack restriction is in place, passes
1090 stack size of 0.
1091 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
1092 Secondary_Stack_Size.
1093 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
1094 function to define the overhead of the secondary stack.
1095 * s-tarest.adb (Create_Restricted_Task,
1096 Create_Restricted_Task_Sequential): Functions now include
1097 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
1098 * s-tarest.adb (Create_Restricted_Task,
1099 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
1100 include Secondary_Stack_Size parameter.
1101 (Task_Wrapper): Secondary stack now allocated to the size specified by
1102 the Secondary_Stack_Size parameter in the task's ATCB.
1103 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
1104 Secondary_Stack_Size component.
1105 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
1106 Create_Restricted_Task_Sequential): Function now include
1107 Secondary_Stack_Size parameter.
1108 (Task_Wrapper): Secondary stack now allocated to the size
1109 specified by the Secondary_Stack_Size parameter in the task's
1110 ATCB.
1111 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
1112 to include Secondary_Stack_Size parameter.
1113 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
1114 Secondary_Stack_Size aspect, turning the aspect into its corresponding
1115 internal attribute.
1116 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
1117 * snames.adb-tmpl, snames.ads-tmpl: Added names
1118 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1119 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1120
1121 2017-01-12 Yannick Moy <moy@adacore.com>
1122
1123 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
1124 subtree.
1125
1126 2017-01-12 Justin Squirek <squirek@adacore.com>
1127
1128 * exp_attr.adb (Expand_N_Attribute_Reference):
1129 Fix Finalization_Size case by properly resolving the type after
1130 rewritting the node.
1131
1132 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1133
1134 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
1135 the tree.
1136 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
1137 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
1138 exp_sel.ads: Minor reformatting.
1139
1140 2017-01-12 Justin Squirek <squirek@adacore.com>
1141
1142 * exp_ch6.adb (Expand_Call): Add guard to prevent
1143 invariant checks from being created for internally generated
1144 subprograms.
1145
1146 2017-01-12 Bob Duff <duff@adacore.com>
1147
1148 * lib-writ.ads: Remove incorrect comment.
1149
1150 2017-01-12 Javier Miranda <miranda@adacore.com>
1151
1152 * debug.adb (-gnatd.K): Enable generation of contract-only
1153 procedures in CodePeer mode.
1154 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
1155 New subprogram.
1156 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
1157 set.
1158 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
1159 subprogram.
1160 (Get_Contract_Only_Missing_Body_Name): New subprogram.
1161 (Get_Contract_Only_Body): New subprogram.
1162 (Set_Contract_Only_Body): New subprogram.
1163 (Is_Contract_Only_Body): New subprogram.
1164 (Set_Is_Contract_Only_Body): New subprogram.
1165 (SCIL_Nodes): Replace table by hash-table.
1166
1167 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1168
1169 * exp_ch6.adb: Minor reformatting.
1170 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
1171
1172 2017-01-12 Bob Duff <duff@adacore.com>
1173
1174 * binde.adb (Forced): New reason for a dependence.
1175 (Force_Elab_Order): Implementation of the new switch.
1176 * binde.ads: Minor comment fixes.
1177 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
1178 long ago that is no longer supported; removed comment about that.
1179 * opt.ads (Force_Elab_Order_File): Name of file specified for
1180 -f switch.
1181 * switch-b.adb: Parse -f switch.
1182
1183 2017-01-12 Justin Squirek <squirek@adacore.com>
1184
1185 * exp_ch6.adb (Check_View_Conversion): Created this function
1186 to properly chain calls to check type invariants that may be
1187 present in a subprogram call after the subprogram.
1188 (Expand_Call): Add a conditional to identify when a view conversion
1189 needs to be checked.
1190 * nlists.adb, nlists.ads (Prepend_New): New routine.
1191 (Prepend_New_To): New routine.
1192
1193 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1194
1195 * sinfo.ads: Minor reformatting.
1196
1197 2017-01-12 Gary Dismukes <dismukes@adacore.com>
1198
1199 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
1200 reformatting.
1201
1202 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1203
1204 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
1205 variable Definite. Create a local object and pass its 'Access to the
1206 BIP function when the result type is either definite or it does not
1207 require any finalization or secondary stack management.
1208
1209 2017-01-12 Bob Duff <duff@adacore.com>
1210
1211 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
1212 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
1213 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
1214 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
1215 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
1216 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
1217 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1218 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
1219 Change name to Pragma_Name_Unmapped.
1220 (Pragma_Name_Mapped): Change name to Pragma_Name.
1221 This is because the "mapped" version should be the usual case.
1222
1223 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
1224
1225 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
1226 Is_Default_Init_Cond_Procedure, and
1227 Has_Inherited_Default_Init_Cond. Add uses of flags
1228 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
1229 (Default_Init_Cond_Procedure): Removed.
1230 (DIC_Procedure): New routine.
1231 (Has_Default_Init_Cond): Removed.
1232 (Has_DIC): New routine.
1233 (Has_Inheritable_Invariants): The attribute applies to the base type.
1234 (Has_Inherited_Default_Init_Cond): Removed.
1235 (Has_Inherited_DIC): New routine.
1236 (Has_Inherited_Invariants): The attribute applies to the base type.
1237 (Has_Own_DIC): New routine.
1238 (Has_Own_Invariants): The attribute applies to the base type.
1239 (Is_Default_Init_Cond_Procedure): Removed.
1240 (Is_DIC_Procedure): New routine.
1241 (Set_Default_Init_Cond_Procedure): Removed.
1242 (Set_DIC_Procedure): New routine.
1243 (Set_Has_Default_Init_Cond): Removed.
1244 (Set_Has_Inheritable_Invariants): The attribute applies
1245 to the base type.
1246 (Set_Has_Inherited_Default_Init_Cond): Removed.
1247 (Set_Has_Inherited_DIC): New routine.
1248 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
1249 (Set_Has_Own_DIC): New routine.
1250 (Set_Has_Own_Invariants): The attribute applies to the base type.
1251 (Set_Is_Default_Init_Cond_Procedure): Removed.
1252 (Set_Is_DIC_Procedure): New routine.
1253 (Write_Entity_Flags): Update the output of all flags related to
1254 default initial condition.
1255 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
1256 of the call to the DIC procedure.
1257 (Freeze_Type): Generate the body of the DIC procedure.
1258 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
1259 all occurrences of Create_Append with Append_New_To. Do
1260 not generate an invariant procedure for a class-wide type.
1261 The generated body acts as a freeze action of the working type.
1262 (Build_Invariant_Procedure_Declaration): Do not generate an
1263 invariant procedure for a class-wide type.
1264 (Create_Append): Removed.
1265 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
1266 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
1267 class-wide pre/postcondition description and data structures from
1268 Sem_Prag.
1269 (Build_Class_Wide_Expression): Moved from Sem_Prag.
1270 (Build_DIC_Call): New routine.
1271 (Build_DIC_Procedure_Body): New routine.
1272 (Build_DIC_Procedure_Declaration): New routine.
1273 (Entity_Hash): Moved from Sem_Prag.
1274 (Find_DIC_Type): New routine.
1275 (Update_Primitives_Mapping): Reimplemented.
1276 (Update_Primitives_Mapping_Of_Types): New routine.
1277 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
1278 (Build_DIC_Call): New routine.
1279 (Build_DIC_Procedure_Body): New routine.
1280 (Build_DIC_Procedure_Declaration): New routine.
1281 (Update_Primitives_Mapping): Moved from Sem_Prag.
1282 (Update_Primitives_Mapping_Of_Types): New routine.
1283 * nlists.adb (Append_New): New routine.
1284 (Append_New_To): New routine.
1285 * nlists.ads (Append_New): New routine.
1286 (Append_New_To): New routine.
1287 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
1288 of DIC procedures here. This is now done at the end of the
1289 visible declarations, private declarations, and at the freeze
1290 point of a type.
1291 (Analyze_Private_Extension_Declaration):
1292 A private extension inherits the DIC pragma of a parent type.
1293 (Analyze_Subtype_Declaration): No need to propagate invariant
1294 attributes to a subtype as those apply to the base type.
1295 (Build_Derived_Record_Type): No need to inherit invariants here
1296 as this is now done in Build_Derived_Type.
1297 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
1298 a parent type.
1299 (Process_Full_View): Update the propagation of DIC attributes.
1300 (Propagate_Default_Init_Cond_Attributes): Removed.
1301 * sem_ch7.adb Add with and use clauses for Exp_Util.
1302 (Analyze_Package_Specification): Create the body of the DIC
1303 procedure at the end of the visible and private declarations.
1304 (Preserve_Full_Attributes): Propagate DIC attributes.
1305 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
1306 DIC attributes.
1307 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
1308 * sem_elab.adb (Check_A_Call): Update the call to
1309 Is_Nontrivial_Default_Init_Cond_Procedure.
1310 * sem_prag.adb Remove the with and use clauses for
1311 GNAT.HTable. Move the handling of class- wide pre/postcondition
1312 description and data structures to Exp_Util.
1313 (Analyze_Pragma): Create the declaration of the DIC procedure. There
1314 is no need to propagate invariant-related attributes at this point
1315 as this is done in Build_Invariant_Procedure_Declaration.
1316 (Build_Class_Wide_Expression): Moved to Exp_Util.
1317 (Entity_Hash): Moved to Exp_Util.
1318 (Update_Primitives_Mapping): Moved to Exp_Util.
1319 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
1320 (Update_Primitives_Mapping): Moved to Exp_Util.
1321 * sem_util.adb: Remove with and use clauses for Ghost
1322 and Sem_Ch13.
1323 (Build_Default_Init_Cond_Call): Removed.
1324 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
1325 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
1326 (Get_Views): Reimplemented.
1327 (Has_Full_Default_Initialization): Reimplement the section on DIC.
1328 (Inherit_Default_Init_Cond_Procedure): Removed.
1329 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
1330 (Is_Nontrivial_DIC_Procedure): New routine.
1331 (Is_Verifiable_DIC_Pragma): New routine.
1332 (Propagate_DIC_Attributes): New routine.
1333 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
1334 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
1335 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
1336 (Inherit_Default_Init_Cond_Procedure): Removed.
1337 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
1338 (Is_Nontrivial_DIC_Procedure): New routine.
1339 (Is_Verifiable_DIC_Pragma): New routine.
1340 (Propagate_DIC_Attributes): New routine.
1341 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
1342 on DIC.
1343 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
1344 usage in nodes.
1345 (Expression_Copy): New routine along with pragma Inline.
1346 (Set_Expression_Copy): New routine along with pragma Inline.
1347
1348 2017-01-06 Bob Duff <duff@adacore.com>
1349
1350 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
1351 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
1352 we won't generate the call to s_stalib_adafinal when the main
1353 is not written in Ada.
1354
1355 2017-01-06 Bob Duff <duff@adacore.com>
1356
1357 * sem_prag.adb: Minor: remove pragma Warnings.
1358
1359 2017-01-06 Tristan Gingold <gingold@adacore.com>
1360
1361 * Makefile.rtl: Do not compile s-stchop by default.
1362
1363 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
1364
1365 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
1366 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
1367 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
1368 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
1369 Reverted previous change for now.
1370
1371 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1372
1373 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
1374 check to default discriminant value if checks are enabled.
1375 (Build_Assignment): If type of component has static predicate,
1376 apply check to its default value, if any.
1377
1378 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
1379
1380 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
1381 * exp_ch3.adb (Build_Init_Statements): As part of initialising
1382 the value record of a task, set its _Secondary_Stack_Size field
1383 if present.
1384 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
1385 a _Secondary_Stack_Size field in the value record of
1386 the task if a Secondary_Stack_Size rep item is present.
1387 (Make_Task_Create_Call): Include secondary stack size
1388 parameter. If No_Secondary_Stack restriction is in place, passes
1389 stack size of 0.
1390 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
1391 Secondary_Stack_Size.
1392 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
1393 function to define the overhead of the secondary stack.
1394 * s-tarest.adb (Create_Restricted_Task,
1395 Create_Restricted_Task_Sequential): Functions now include
1396 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
1397 * s-tarest.adb (Create_Restricted_Task,
1398 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
1399 now include Secondary_Stack_Size parameter.
1400 (Task_Wrapper):
1401 Secondary stack now allocated to the size specified by the
1402 Secondary_Stack_Size parameter in the task's ATCB.
1403 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
1404 Secondary_Stack_Size component.
1405 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
1406 Create_Restricted_Task_Sequential): Function now include
1407 Secondary_Stack_Size parameter.
1408 (Task_Wrapper): Secondary stack
1409 now allocated to the size specified by the Secondary_Stack_Size
1410 parameter in the task's ATCB.
1411 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
1412 for Secondary_Stack_Size aspect, turning the aspect into its
1413 corresponding internal attribute.
1414 (Analyze_Attribute_Definition):
1415 Process Secondary_Stack_Size attribute.
1416 * snames.adb-tmpl, snames.ads-tmpl: Added names
1417 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1418 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1419
1420 2017-01-06 Pascal Obry <obry@adacore.com>
1421
1422 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
1423 Sequential_IO and Direct_IO.
1424
1425 2017-01-06 Bob Duff <duff@adacore.com>
1426
1427 * snames.ads-tmpl (Renamed): New name for the pragma argument.
1428 * par-ch2.adb: Allow the new pragma (with analysis deferred
1429 to Sem_Prag).
1430 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
1431 Keep a mapping from new pragma names to old names.
1432 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
1433 implement it by calling Map_Pragma_Name.
1434 * checks.adb, contracts.adb, einfo.adb, errout.adb,
1435 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
1436 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
1437 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
1438 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
1439 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1440 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
1441 as appropriate.
1442
1443 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1444
1445 * exp_ch9.adb: Minor reformatting.
1446
1447 2017-01-06 Tristan Gingold <gingold@adacore.com>
1448
1449 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
1450 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
1451 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
1452 (unused).
1453 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
1454 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
1455 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
1456 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
1457
1458 2017-01-06 Bob Duff <duff@adacore.com>
1459
1460 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
1461 dummy implementation of Map_Pragma_Name.
1462
1463 2017-01-06 Tristan Gingold <gingold@adacore.com>
1464
1465 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
1466 entry_body variable constant.
1467 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
1468 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
1469 to constant.
1470 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
1471 now access to constant.
1472
1473 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1474
1475 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
1476 reformatting and typo fixes.
1477
1478 2017-01-06 Bob Duff <duff@adacore.com>
1479
1480 * snames.ads-tmpl: New names for pragma renaming.
1481 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
1482 * par-prag.adb: Add new pragma name to case statement.
1483 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
1484 of the pragma.
1485 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
1486 Dummy implementation of Pragma_Name_Mapped.
1487
1488 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1489
1490 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
1491 better detect call within an entry_wrapper.
1492 * sem_res.adb (Resolve_Call): A protected call within an
1493 entity_wrapper is analyzed in the context of the protected
1494 object but corresponds to a pre-analysis and is not an access
1495 before elaboration.
1496 * sem_attr.adb: Minor reformatting.
1497
1498 2017-01-06 Justin Squirek <squirek@adacore.com>
1499
1500 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
1501 Finalization_Size to allow a prefix of any non-class-wide type.
1502 * sem_attr.ads Modify comment for Finalization_Size to include
1503 definite type use case.
1504
1505 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1506
1507 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
1508 on procedures that are wrappers created for entries that have
1509 preconditions.
1510 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
1511 body is an entry_wrapper, compile it in the context of the
1512 synchronized type, because a precondition may refer to funtions
1513 of the type.
1514 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
1515 body entity.
1516 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
1517 within an Entry_Wrapper this is an external call whose target
1518 is the synchronized object that is the actual in the call to
1519 the wrapper.
1520
1521 2017-01-06 Yannick Moy <moy@adacore.com>
1522
1523 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
1524 in tree, which means not analyzing the previous prefix if the node has
1525 been rewritten into its prefix.
1526
1527 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1528
1529 * s-tpobop.adb: Minor reformatting.
1530
1531 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1532
1533 * checks.adb (Ensure_Valid): Do not generate a validity check
1534 within a generated predicate function, validity checks will have
1535 been applied earlier when required.
1536
1537 2017-01-06 Tristan Gingold <gingold@adacore.com>
1538
1539 * s-tpoben.ads (Protection_Entries): Add comment and reorder
1540 components for performances.
1541 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
1542 semantic.
1543
1544 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1545
1546 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
1547 If expression is compile-time known and obeys a static predicate
1548 it must be labelled as static, to prevent spurious warnings and
1549 run-time errors, e.g. in case statements. This is relevant when
1550 the expression is the result of constant-folding a type conversion
1551 whose expression is a variable with a known static value.
1552
1553 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1554
1555 * exp_attr.adb, sem_attr.ads: Minor reformatting.
1556
1557 2017-01-06 Justin Squirek <squirek@adacore.com>
1558
1559 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
1560 expansion of Finalization_Size attribute.
1561 * sem_attr.adb (Analyze_Attribute): Add entry to check the
1562 semantics of Finalization_Size.
1563 (Eval_Attribute): Add null entry for Finalization_Size.
1564 * sem_attr.ads: Add Finalization_Size to the implementation
1565 dependent attribute list.
1566 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
1567
1568 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1569
1570 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
1571 iterator specification with a serious syntactic error, transform
1572 construct into an infinite loop in order to continue analysis
1573 and prevent a compiler abort.
1574
1575 2017-01-06 Tristan Gingold <gingold@adacore.com>
1576
1577 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
1578 max_queue_lengths_array if unused.
1579
1580 2017-01-06 Bob Duff <duff@adacore.com>
1581
1582 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
1583 array access, in case "\" is at the end of Text.
1584 * stylesw.adb (Set_Style_Check_Options): Don't include input
1585 characters in the error message template, because they could
1586 be control characters such as "\", which Errout will try to
1587 interpret.
1588
1589 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1590
1591 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
1592 For a private type examine the visible declarations that follow
1593 the partial view, not just the private declarations that follow
1594 the full view.
1595
1596 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1597
1598 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
1599 code cleanup.
1600
1601 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1602
1603 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
1604 alias of the inherited op is the parent iterator, no need to
1605 examine dispatch table positions which might not be established
1606 yet if type is not frozen.
1607 * sem_disp.adb (Check_Controlling_Formals): The formal of a
1608 predicate function may be a subtype of a tagged type.
1609 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
1610 of representation items for the completion of a type extension
1611 where a predicate applies to the partial view.
1612 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
1613 parameter that designates function whose actual receives a
1614 predicate check, to improve warning message when the check will
1615 lead to infinite recursion.
1616 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
1617 Apply_Predicate_Check.
1618
1619 2017-01-06 Tristan Gingold <gingold@adacore.com>
1620
1621 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
1622 Gnat_Extended_Ravenscar.
1623 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
1624
1625 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1626
1627 * sem_util.ads: Minor typo fix and reformatting.
1628
1629 2017-01-06 Yannick Moy <moy@adacore.com>
1630
1631 * ghost.adb Minor fixing of references to SPARK RM.
1632 (Check_Ghost_Context): Check whether reference is to a lvalue
1633 before issuing an error about violation of SPARK RM 6.9(13)
1634 when declaration has Ghost policy Check and reference has Ghost
1635 policy Ignore.
1636 * sem_util.adb Minor indentation.
1637 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
1638 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
1639 * sem_util.ads (Unique_Defining_Entity): Document the result
1640 for package body stubs.
1641
1642 2017-01-06 Tristan Gingold <gingold@adacore.com>
1643
1644 * raise-gcc.c (abort): Macro to call Abort_Propagation.
1645 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
1646 constant.
1647 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
1648 Do not generate the Entry_Max_Queue_Lengths_Array if all default
1649 values.
1650 * exp_util.adb (Corresponding_Runtime_Package): Consider
1651 Max_Queue_Length pragma.
1652
1653 2017-01-06 Justin Squirek <squirek@adacore.com>
1654
1655 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
1656 Remove declaration generation in the case of
1657 System_Tasking_Protected_Objects_Single_Entry being used,
1658 and add a warning message when this is detected to occur.
1659 (Make_Initialize_Protection): Remove reference pass in the case
1660 of System_Tasking_Protected_Objects_Single_Entry.
1661 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
1662 * s-tposen.adb (Initialize_Protection_Entry): Remove
1663 Entry_Queue_Max parameter.
1664 * s-tposen.ads: Remove the types use to store the entry queue
1665 maximum.
1666 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
1667
1668 2017-01-06 Yannick Moy <moy@adacore.com>
1669
1670 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
1671 behavior of function, to also accept out of range positions
1672 and raise Constraint_Error in such case, and to copy sloc from
1673 literal if No_Location passed as location.
1674 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
1675 of functions to raise Constraint_Error in case of value not in
1676 appropriate range.
1677
1678 2017-01-06 Tristan Gingold <gingold@adacore.com>
1679
1680 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
1681 Invalidate_Stack_Cache.
1682
1683 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
1684
1685 * s-os_lib.adb: Minor fix to the signature of Readlink.
1686
1687 2017-01-06 Javier Miranda <miranda@adacore.com>
1688
1689 * sem_ch6.adb (Conforming_Types): Handle another
1690 confusion between views in a nested instance with an actual
1691 private type whose full view is not in scope.
1692
1693 2017-01-06 Arnaud Charlet <charlet@adacore.com>
1694
1695 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
1696 mark a rewritten if statement as explicit (Comes_From_Source).
1697
1698 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1699
1700 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
1701
1702 2017-01-06 Tristan Gingold <gingold@adacore.com>
1703
1704 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
1705
1706 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1707
1708 * sem_case.adb: Minor reformatting.
1709
1710 2017-01-06 Thomas Quinot <quinot@adacore.com>
1711
1712 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
1713
1714 2017-01-06 Justin Squirek <squirek@adacore.com>
1715
1716 * aspects.adb: Register aspect in Canonical_Aspect.
1717 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
1718 into respective tables.
1719 * einfo.ads, einfo.adb: Add a new attribute for
1720 handling the parameters for Pragma_Max_Entry_Queue
1721 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
1722 for accessing and setting were added as well.
1723 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
1724 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
1725 declaration for pramga arguments and store them in the protected
1726 type node.
1727 (Make_Initialize_Protection): Pass a reference to
1728 the Entry_Max_Queue_Lengths_Array in the protected type node to
1729 the runtime.
1730 * rtsfind.adb: Minor grammar fix.
1731 * rtsfind.ads: Register new types taken from the
1732 runtime libraries RE_Protected_Entry_Queue_Max and
1733 RE_Protected_Entry_Queue_Max_Array
1734 * s-tposen.adb, s-tpoben.adb
1735 (Initialize_Protection_Entry/Initialize_Protection_Entries):
1736 Add extra parameter and add assignment to local object.
1737 * s-tposen.ads, s-tpoben.ads: Add new types to
1738 store entry queue maximums and a field to the entry object record.
1739 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
1740 for Aspect_Max_Queue_Length.
1741 (Check_Aspect_At_Freeze_Point):
1742 Add aspect to list of aspects that don't require delayed analysis.
1743 * sem_prag.adb (Analyze_Pragma): Add case statement for
1744 Pragma_Max_Queue_Length, check semantics, and register arugments
1745 in the respective entry nodes.
1746 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
1747 and Has_Max_Queue_Length
1748 * snames.ads-tmpl: Add constant for the new aspect-name
1749 Name_Max_Queue_Length and corrasponding pragma.
1750
1751 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1752
1753 * exp_util.adb (Is_Controlled_Function_Call):
1754 Reimplemented. Consider any node which has an entity as the
1755 function call may appear in various ways.
1756
1757 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1758
1759 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
1760 an unchecked type conversion when performing a view conversion
1761 to/from a private type. In all other cases use a regular type
1762 conversion to ensure that any relevant checks are properly
1763 installed.
1764
1765 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1766
1767 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
1768
1769 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1770
1771 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
1772 error on case expression that is an entity, when coverage is
1773 incomplete and entity has a static value obtained by local
1774 propagation.
1775 (Handle_Static_Predicate): New procedure, subsidiary of
1776 Check_Choices, to handle case alternatives that are either
1777 subtype names or subtype indications involving subtypes that
1778 have static predicates.
1779
1780 2017-01-06 Thomas Quinot <quinot@adacore.com>
1781
1782 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
1783 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
1784
1785 2017-01-06 Bob Duff <duff@adacore.com>
1786
1787 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
1788 Elaborate_All(P) to P itself. That could happen in obscure cases,
1789 and always introduced a cycle (P body must be elaborated before
1790 P body).
1791 * lib-writ.ads: Comment clarification.
1792 * ali-util.ads: Minor comment fix.
1793 * ali.adb: Minor reformatting.
1794
1795 2017-01-06 Tristan Gingold <gingold@adacore.com>
1796
1797 * a-exexpr-gcc.adb: Improve comment.
1798
1799 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
1800
1801 * s-linux-mips.ads: Use correct signal and errno constants.
1802 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
1803
1804 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
1805
1806 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
1807 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
1808 sections.
1809
1810 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
1811
1812 * gnatvsn.ads: Bump copyright year.
1813
1814 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1815
1816 * gnat_ugn.texi: Bump @copying's copyright year.
1817 * gnat_rm.texi: Likewise.
1818 \f
1819 Copyright (C) 2017 Free Software Foundation, Inc.
1820
1821 Copying and distribution of this file, with or without modification,
1822 are permitted in any medium without royalty provided the copyright
1823 notice and this notice are preserved.