1 2017-09-08 Bob Duff <duff@adacore.com>
3 * par-prag.adb, sem_prag.adb, snames.ads-tmpl: Implement pragma
4 Ada_2020, along the same lines as the other Ada version pragmas.
6 2017-09-08 Gary Dismukes <dismukes@adacore.com>
8 * sem_ch12.adb: Minor typo fixes and reformatting.
10 2017-09-08 Yannick Moy <moy@adacore.com>
12 * sem_aggr.adb (Resolve_Record_Aggregate):
13 Rewrite bounds of aggregate subexpressions which may depend on
14 discriminants of the enclosing aggregate.
16 2017-09-08 Yannick Moy <moy@adacore.com>
18 * sem_ch5.adb: Prevent assertion failure on illegal code.
20 2017-09-08 Yannick Moy <moy@adacore.com>
22 * lib-xref-spark_specific.adb (Add_SPARK_Xrefs.Is_SPARK_Scope): Avoid
23 calling Renamed_Entity on an entity which cannot be a renaming.
25 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
27 * exp_aggr.adb: Add with & use clause for Urealp.
28 (Aggr_Assignment_OK_For_Backend): Accept (almost all)
29 elementary types instead of just discrete types.
30 * sem_eval.adb (Expr_Value): Deal with N_Null for access types.
31 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>:
32 Be prepared for the FP zero value in the memset case. Add small
35 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
37 * s-htable.adb (Static_HTable.Reset): Use aggregate instead
40 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
42 * exp_aggr.adb (Expand_Array_Aggregate): Use New_Copy_Tree instead
43 of New_Copy because the latter leaves the syntactic structure of
44 the tree inconsistent (a child is accessible through two parents)
45 and prevents proper replication of itypes by subsequent calls
47 * exp_ch4.adb (Expand_Concatenate): Use New_Copy_Tree instead of
48 New_Copy because the latter leaves the syntactic structure of the
49 tree inconsistent (a child is accessible through two parents)
50 and prevents proper replication of itypes by subsequent calls
52 * sem_util.adb (In_Subtree): New routine.
53 (New_Copy_Tree): Reimplemented.
54 * sem_util.ads (In_Subtree): New routine.
55 (New_Copy_Tree): Reimplemented.
57 2017-09-08 Ed Schonberg <schonberg@adacore.com>
59 * sem_ch13.adb (Resolve_Aspect_Expressions): The expression
60 for aspect Default_Value is a static scalar value, but it does
61 not freeze the type. Yhis allows for subsequent representation
64 2017-09-08 Javier Miranda <miranda@adacore.com>
66 * sem_ch8.adb (Find_Direct_Name.Undefined): Do
67 not add entries into the undefined reference table when we are
68 compiling with errors ignored.
70 2017-09-08 Ed Schonberg <schonberg@adacore.com>
72 * sem_ch12.adb (Check_Formal_Packages): Do not apply conformance
73 check if the instance is within an enclosing instance body. The
74 formal package was legal in the enclosing generic, and is
75 legal in the enclosing instantiation. This optimisation may be
76 applicable elsewhere, and it also removes spurious errors that
77 may arise with on-the-fly processing of instantiations that
78 contain Inline_Always subprograms.
80 2017-09-08 Vincent Celier <celier@adacore.com>
82 * gnatcmd.adb: Disregard empty argument of GNAT driver.
84 2017-09-08 Justin Squirek <squirek@adacore.com>
86 * checks.adb (Insert_Valid_Check): Manually decorate
87 the generated temporary for range valdity checks.
89 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
91 * usage.adb (Usage): Document new -gnatw.q/-gnatw.Q switches.
93 2017-09-08 Justin Squirek <squirek@adacore.com>
95 * switch-c.adb (Scan_Front_End_Switches): Add new warning switch
96 case to handle underscore flags.
97 * warnsw.adb, warnsw.ads (Set_Underscore_Warning_Switch): Create
98 new procedure to handle underscores.
100 2017-09-08 Javier Miranda <miranda@adacore.com>
102 * exp_ch4.adb (Expand_N_Op_Divide): Reordering code that handles
103 divisions with fixed point results to avoid generating twice
104 the runtime check on divide by zero.
105 * checks.adb (Apply_Divide_Checks): Ensure that operands are
106 not evaluated twice (once for their runtime checks and once for
107 their regular computation).
109 2017-09-08 Yannick Moy <moy@adacore.com>
111 * sem_prag.adb (Analyze_Part_Of): Add missing
112 return statements after issuing errors. Add detection of
113 out-of-order item and single concurrent type.
115 2017-09-08 Nicolas Roche <roche@adacore.com>
117 * gcc-interface/Makefile.in, a-extiti.ads, s-taprop-linux.adb,
118 s-osinte-solaris.adb, a-intnam.ads, s-osinte-solaris.ads,
119 s-tpobop.adb, s-intman-android.adb, s-tasinf.adb, s-tpobop.ads,
120 s-tasinf.ads, i-vxinco.adb, a-exetim-posix.adb, i-vxinco.ads,
121 a-astaco.adb, a-astaco.ads, s-tporft.adb, s-tpoaal.adb, a-taside.adb,
122 a-taside.ads, s-tpopsp-posix.adb, s-tasdeb.adb, s-tasdeb.ads,
123 s-tpoben.adb, a-dinopr.ads, s-inmaop-vxworks.adb, s-tpoben.ads,
124 s-interr-vxworks.adb, s-interr-dummy.adb, s-tassta.adb,
125 a-intnam-mingw.ads, s-tassta.ads, s-taasde.adb, a-stcoed.ads,
126 s-taasde.ads, s-osinte-darwin.adb, s-proinf.adb, s-taprop-dummy.adb,
127 s-osinte-darwin.ads, s-proinf.ads, s-linux.ads, a-intnam-linux.ads,
128 s-tasren.adb, s-tasren.ads, s-mudido.adb, g-semaph.adb, s-mudido.ads,
129 s-taprop-posix.adb, g-semaph.ads, s-osinte-mingw.ads, s-vxwork-x86.ads,
130 s-tposen.adb, s-linux-sparc.ads, s-taprop-vxworks.adb, s-tasini.adb,
131 s-tposen.ads, s-tasini.ads, a-etgrbu.ads, s-interr-hwint.adb,
132 s-osinte-linux.ads, s-taprop.ads, s-tasque.adb, s-tasque.ads,
133 s-taenca.adb, s-taspri-vxworks.ads, s-taenca.ads, a-dynpri.adb,
134 s-tpopsp-solaris.adb, a-dynpri.ads, s-taprop-hpux-dce.adb,
135 a-interr.adb, a-intnam-freebsd.ads, s-tarest.adb, a-interr.ads,
136 s-intman-susv3.adb, a-synbar.adb, a-intnam-dummy.ads, s-tadeca.adb,
137 s-osinte-vxworks.adb, s-tarest.ads, s-taskin.adb, a-synbar.ads,
138 s-taspri-hpux-dce.ads, s-tadeca.ads, s-osinte-vxworks.ads,
139 s-taskin.ads, s-intman-solaris.adb, a-sytaco.adb, s-vxwext-kernel.adb,
140 s-mudido-affinity.adb, a-sytaco.ads, s-vxwext-kernel.ads, s-taprob.adb,
141 s-intman-mingw.adb, s-taprob.ads, s-osinte-kfreebsd-gnu.ads,
142 s-osinte-dummy.ads, s-osinte-gnu.adb, s-osinte-rtems.adb, s-interr.adb,
143 s-inmaop.ads, s-vxwext-rtp.adb, s-osinte-gnu.ads, s-osinte-rtems.ads,
144 a-synbar-posix.adb, s-interr.ads, s-taspri-posix-noaltstack.ads,
145 s-vxwext-rtp.ads, a-synbar-posix.ads, a-extiin.ads, s-osinte-posix.adb,
146 s-tpinop.adb, s-tasres.ads, s-tpinop.ads, a-disedf.ads, a-diroro.ads,
147 s-linux-alpha.ads, a-tasatt.adb, s-solita.adb, a-intnam-solaris.ads,
148 a-tasatt.ads, s-solita.ads, s-tasinf-solaris.adb, s-tasinf-solaris.ads,
149 s-vxwork-arm.ads, s-tpopsp-posix-foreign.adb, s-intman-dummy.adb,
150 s-intman.ads, s-stusta.adb, s-stusta.ads, s-intman-posix.adb,
151 s-tpopsp-vxworks.adb, s-inmaop-dummy.adb, s-taspri-mingw.ads,
152 a-intnam-darwin.ads, s-osinte-aix.adb, s-osinte-dragonfly.adb,
153 s-osinte-aix.ads, s-tasinf-mingw.adb, s-osinte-dragonfly.ads,
154 s-linux-hppa.ads, s-osinte-x32.adb, s-inmaop-posix.adb,
155 s-tasinf-mingw.ads, s-intman-vxworks.adb, s-linux-mips.ads,
156 s-intman-vxworks.ads, s-osinte-android.adb, s-tasinf-linux.adb,
157 s-osinte-android.ads, s-vxwork-ppc.ads, s-tasinf-linux.ads,
158 a-dispat.adb, a-dispat.ads, s-tadert.adb, g-thread.adb, s-tadert.ads,
159 g-thread.ads, a-intnam-hpux.ads, s-linux-android.ads, s-tataat.adb,
160 a-exetim.ads, s-tataat.ads, a-reatim.adb, a-reatim.ads, thread.c,
161 g-boubuf.adb, s-osinte-freebsd.adb, g-boubuf.ads, s-osinte-freebsd.ads,
162 s-tasuti.adb, s-taspri-dummy.ads, a-exetim-mingw.adb, s-linux-x32.ads,
163 s-tasuti.ads, g-signal.adb, a-exetim-mingw.ads, s-interr-sigaction.adb,
164 g-signal.ads, s-osinte-hpux.ads, a-intnam-vxworks.ads,
165 s-osinte-hpux-dce.adb, s-taspri-posix.ads, s-osinte-hpux-dce.ads,
166 s-tasinf-vxworks.ads, g-tastus.ads, s-tpopsp-tls.adb,
167 s-taprop-solaris.adb, a-retide.adb, a-exetim-darwin.adb, a-retide.ads,
168 s-vxwext.adb, s-vxwext.ads, a-rttiev.adb, a-rttiev.ads, g-boumai.ads,
169 a-exetim-default.ads, s-taprop-mingw.adb, s-taspri-solaris.ads,
170 a-intnam-aix.ads: Move libgnarl sources to libgnarl subdir.
172 2017-09-08 Arnaud Charlet <charlet@adacore.com>
174 * doc/share/conf.py, doc/share/latex_elements.py,
175 doc/share/ada_pygments.py, doc/Makefile: Improve support for Ada
178 2017-09-08 Arnaud Charlet <charlet@adacore.com>
180 * gnat_rm.texi, gnat_ugn.texi,
181 doc/gnat_ugn/the_gnat_compilation_model.rst,
182 doc/gnat_ugn/getting_started_with_gnat.rst,
183 doc/gnat_ugn/inline_assembler.rst,
184 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
185 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
186 doc/gnat_ugn/about_this_guide.rst,
187 doc/gnat_ugn/platform_specific_information.rst,
188 doc/gnat_ugn/example_of_binder_output.rst,
189 doc/gnat_ugn/gnat_and_program_execution.rst,
190 doc/gnat_ugn/gnat_utility_programs.rst,
191 doc/gnat_rm/implementation_of_specific_ada_features.rst,
192 doc/gnat_rm/interfacing_to_other_languages.rst,
193 doc/gnat_rm/implementation_defined_aspects.rst,
194 doc/gnat_rm/intrinsic_subprograms.rst,
195 doc/gnat_rm/implementation_defined_characteristics.rst,
196 doc/gnat_rm/implementation_advice.rst,
197 doc/gnat_rm/implementation_defined_attributes.rst,
198 doc/gnat_rm/compatibility_and_porting_guide.rst,
199 doc/gnat_rm/standard_library_routines.rst,
200 doc/gnat_rm/the_gnat_library.rst,
201 doc/gnat_rm/implementation_defined_pragmas.rst,
202 doc/gnat_rm/representation_clauses_and_pragmas.rst,
203 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
204 doc/gnat_rm/obsolescent_features.rst,
205 doc/gnat_rm/about_this_guide.rst,
206 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
207 doc/gnat_rm/implementation_of_ada_2012_features.rst,
209 doc/gnat_rm.rst: Update documentation.
211 2017-09-08 Arnaud Charlet <charlet@adacore.com>
213 * s-dwalin.ads, s-dwalin.adb, s-trasym-dwarf.adb, s-objrea.ads,
214 s-objrea.adb, s-tsmona-linux.adb, s-tsmona-mingw.adb: New.
215 * gcc-interface/Makefile.in: Enable s-trasym-dwarf.adb on x86*linux.
217 2017-09-08 Bob Duff <duff@adacore.com>
219 * s-ststop.ads, s-ststop.adb, rtsfind.ads (String_Input_Tag):
220 New routine to read the Tag robustly.
221 * exp_attr.adb (Input): Change the expansion of 'Input,
222 in the class-wide case, to call String_Input_Tag instead of
225 2017-09-08 Arnaud Charlet <charlet@adacore.com>
227 * s-rident.ads (Restriction_Id): reorder enum
228 literals, so that Pure_Barriers is no longer in range of the
229 Cunit_Boolean_Restrictions subtype.
231 2017-09-08 Nicolas Roche <roche@adacore.com>
233 * a-taster.ads, a-taster.adb: Move to libgnarl
234 * gcc-interface/Makefile.in: Remove obsolete targets. Code cleanups.
235 Add support for files in libgnarl.
237 2017-09-08 Ed Schonberg <schonberg@adacore.com>
239 * exp_ch4.adb (Expand_N_Type_Conversion): Do not apply
240 accessibility check to an interface conversion, whose purpose
241 is to perform a pointer adjustment in a dispatching call.
242 * exp_ch6.adb (Expand_Call_JHelper): Add accessibility checks
243 when the actual is a construct that involves a dereference of an
244 expression that includes a formal of the enclosing subprogram,
245 In such cases, the accessibility level of the actual is that of
246 the corresponding formal, which is passed in as an additional
247 actual in the outer call.
249 2017-09-08 Bob Duff <duff@adacore.com>
251 * exp_intr.adb (Add_Source_Info): Do not decode
252 file names; they were not encoded in the first place.
254 2017-09-08 Bob Duff <duff@adacore.com>
256 * a-tags.adb (Internal_Tag): Unsuppress checks, so we get
257 exceptions instead of crashes. Check for absurdly long strings
258 and empty strings. Empty strings cause trouble because they can
259 have super-null ranges (e.g. 100..10), which causes Ext_Copy to
260 be empty, which causes an array index out of bounds.
261 * s-ststop.adb (Input): Unsuppress checks, so we get exceptions
264 2017-09-08 Arnaud Charlet <charlet@adacore.com>
266 * sem_util.adb (Is_CCT_Instance): allow use in
267 the context of protected types.
269 2017-09-08 Arnaud Charlet <charlet@adacore.com>
271 * a-tigeli.adb: minor remove extra whitespace.
273 2017-09-08 Gary Dismukes <dismukes@adacore.com>
275 * par-ch4.adb: Reformatting of an error message.
277 2017-09-08 Javier Miranda <miranda@adacore.com>
279 * sem_ch3.adb (Resolve_Name): Under ASIS mode analyze overloaded
280 identifiers to ensure their correct decoration of names on
283 2017-09-08 Yannick Moy <moy@adacore.com>
285 * exp_attr.adb (Expand_Loop_Entry_Attribute): Do
286 not skip a loop coming from source which is rewritten into a loop.
288 2017-09-08 Ed Schonberg <schonberg@adacore.com>
290 * freeze.adb (Wrap_Imported_Subprogram): Indicate that the
291 wrapper has convention Ada, to prevent spurious warnings on
292 unconstrained array parameters.
294 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
296 * sem_prag.adb (Check_Variant): Use First_Non_Pragma/Next_Non_Pragma.
297 (Analyze_Pragma) <Pragma_Unchecked_Union>: Likewise.
299 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
301 * sem_ch6.adb (Freeze_Expr_Types): Rename Spec_Id into Def_Id.
303 2017-09-08 Arnaud Charlet <charlet@adacore.com>
305 * exp_intr.adb (Append_Entity_Name): Move to ...
306 * sem_util.ads, sem_util.adb: ... here to share it.
307 (Subprogram_Name): New subprogram, to compute the name of the enclosing
309 * errutil.adb (Error_Msg): Fill new field Node.
310 * erroutc.ads (Subprogram_Name_Ptr): New.
311 (Error_Msg_Object): New field Node.
312 * erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
313 * errout.adb (Error_Msg): New variant with node id parameter.
314 Fill new parameter Node when emitting messages. Revert previous
315 changes for Include_Subprogram_In_Messages.
316 * sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
317 generating warning message.
319 2017-09-08 Ed Schonberg <schonberg@adacore.com>
321 * par-ch4.adb (P_Iterated_Component_Association): Place construct
322 under -gnat2020 flag, given that it is a future feature of
324 * sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
325 defining identifier as referenced to prevent spurious warnings:
326 corresponding loop is expanded into one or more loops whose
327 variable has the same name, and the expression uses those names
328 and not the original one.
330 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
332 * sem_elab.adb (Check_A_Call): Do not consider
333 references to internal variables for SPARK semantics.
335 2017-09-08 Arnaud Charlet <charlet@adacore.com>
337 * inline.adb (In_Package_Spec): refine type of
338 the parameter from Node_Id to Entity_Id.
340 2017-09-08 Justin Squirek <squirek@adacore.com>
342 * exp_ch5.adb (Expand_Formal_Container_Loop):
343 Reset the scope of the loop parameter after it is reanalyzed.
345 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
347 * sem_util.ads (Set_Rep_Info): New inline procedure.
348 * sem_util.adb (Set_Rep_Info): Implement it.
349 * sem_ch3.adb (Process_Subtype): If the case of a constraint present,
350 always copy the representation aspects onto the subtype.
352 2017-09-08 Georges-Alex Jaloyan <jaloyan@adacore.com>
354 * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_key):
355 Correction of the return type from access type to option type.
356 (Simple_HTable): Moving the Instance_Data to ads file.
358 2017-09-08 Yannick Moy <moy@adacore.com>
360 * sem_prag.adb: Use System.Case_Util.To_Lower to simplify code.
362 2017-09-08 Arnaud Charlet <charlet@adacore.com>
364 * opt.ads (Include_Subprogram_In_Messages): New variable.
365 * errout.ads (Current_Subprogram_Ptr): New variable.
366 * errout.adb (Error_Msg): Prepend current subprogram info
367 in messages if Include_Subprogram_In_Messages is set.
368 * sem_util.adb (elab code): Initialize Current_Subprogram_Ptr to
370 * gnat1drv.adb (Adjust_Global_Switches): Set
371 Include_Subprogram_In_Messages when -gnatdJ is set.
372 * debug.adb: Document and reserve -gnatdJ.
374 2017-09-08 Georges-Axel Jaloyan <jaloyan@adacore.com>
376 * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_Key): New
377 functions to iterate over simple hastables.
378 (Load_Factor_HTable): Remove obsolete and inefficient implementation.
380 2017-09-08 Javier Miranda <miranda@adacore.com>
382 * exp_ch6.adb (Unqual_BIP_Function_Call): Adding
383 missing checks on the presence of Entity() before checking the
386 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
388 * sem_ch6.adb (Analyze_Expression_Function): Reorder some
389 statements, use local variable and remove unnecessary processing.
391 2017-09-08 Javier Miranda <miranda@adacore.com>
393 * exp_ch6.ads (Make_Build_In_Place_Iface_Call_In_Allocator): New
395 (Make_Build_In_Place_Iface_Call_In_Anonymous_Context): New subprogram.
396 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
398 (Unqual_BIP_Iface_Function_Call): New subprogram.
399 * exp_ch6.adb (Replace_Renaming_Declaration_Id): New
400 subprogram containing code that was previously inside
401 Make_Build_In_Place_Call_In_Object_Declaration since it is also
402 required for one of the new subprograms.
404 Invoke Make_Build_In_Place_Iface_Call_In_Anonymous_Context
405 (Expand_N_Extended_Return_Statement): Extend the
406 cases covered by an assertion on expected BIP object
408 (Make_Build_In_Place_Call_In_Assignment):
409 Removing unused code; found working on this ticket.
410 (Make_Build_In_Place_Call_In_Object_Declaration): Move the code
411 that replaces the internal name of the renaming declaration
412 into the new subprogram Replace_Renaming_Declaration_Id.
413 (Make_Build_In_Place_Iface_Call_In_Allocator): New subprogram.
414 (Make_Build_In_Place_Iface_Call_In_Anonymous_Context):
416 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
418 (Unqual_BIP_Iface_Function_Call): New subprogram.
419 * exp_ch3.adb (Expand_N_Object_Declaration): Invoke the new
420 subprogram Make_Build_In_Place_Iface_Call_In_Object_Declaration.
421 * exp_attr.adb (Expand_N_Attribute_Reference): Invoke the new
422 subprogram Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
423 * exp_ch4.adb (Expand_Allocator_Expression): Invoke the new
424 subprogram Make_Build_In_Place_Iface_Call_In_Allocator.
425 (Expand_N_Indexed_Component): Invoke the new subprogram
426 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
427 (Expand_N_Selected_Component): Invoke the new subprogram
428 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
429 (Expand_N_Slice): Invoke the new subprogram
430 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
431 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration):
432 Invoke the new subprogram
433 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
435 2017-09-08 Javier Miranda <miranda@adacore.com>
437 * exp_disp.adb (Expand_Interface_Conversion): Fix handling of
438 access to interface types. Remove also the accessibility check.
440 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
442 * sem_ch6.adb (Freeze_Expr_Types): Really freeze
443 all the types that are referenced by the expression.
444 (Analyze_Expression_Function): Call Freeze_Expr_Types for
445 a completion instead of manually freezing the type of the
447 (Analyze_Subprogram_Body_Helper): Do not call Freeze_Expr_Types here.
449 2017-09-08 Ed Schonberg <schonberg@adacore.com>
451 * exp_prag.adb (Replace_Discriminals_Of_Protected_Op):
452 New procedure, auxiliary to Expand_Pragma_Check, to handle
453 references to the discriminants of a protected type within a
454 precondition of a protected operation. This is needed because
455 the original precondition has been analyzed in the context of
456 the protected declaration, but in the body of the operation
457 references to the discriminants have been replaved by references
458 to the discriminants of the target object, and these references
459 are only created when expanding the protected body.
461 2017-09-08 Yannick Moy <moy@adacore.com>
463 * sem_prag.adb (Analyze_Pragma): Issue more precise error messages on
466 2017-09-08 Ed Schonberg <schonberg@adacore.com>
468 * exp_attr.adb (Build_Record_VS_Func): If the record is an
469 unchecked union, do not emit checks for its (non-existent)
470 discriminants, or for variant parts that depend on them.
472 2017-09-08 Justin Squirek <squirek@adacore.com>
474 * sem_ch4.adb (Find_Equality_Types.Try_One_Interp,
475 Find_Comparison_Type.Try_One_Interp): Add check for generic
478 2017-09-08 Arnaud Charlet <charlet@adacore.com>
480 * sem_ch3.adb, layout.adb, layout.ads, exp_attr.adb, debug.adb,
481 exp_pakd.adb, sem_prag.adb, gnat1drv.adb, targparm.adb, targparm.ads,
482 repinfo.adb, exp_ch6.adb, exp_aggr.adb, sem_eval.adb, sem_ch13.adb,
483 exp_ch3.adb: Remove references to Frontend_Layout_On_Target and
484 remaining references to AAMP_On_Target.
486 2017-09-08 Ed Schonberg <schonberg@adacore.com>
488 * style.adb: Fix typo.
490 2017-09-08 Javier Miranda <miranda@adacore.com>
492 * einfo.adb (Underlying_Type): Add missing support for class-wide
493 types that come from the limited view.
494 * exp_attr.adb (Attribute_Address): Check class-wide type
495 interfaces using the underlying type to handle limited-withed
497 (Attribute_Tag): Check class-wide type interfaces using
498 the underlying type to handle limited-withed types.
500 2017-09-08 Ed Schonberg <schonberg@adacore.com>
502 * exp_ch5.adb (Expand_Predicated_Loop): Handle properly a loop
503 over a subtype of a type with a static predicate, taking into
504 account the predicate function of the parent type and the bounds
505 given in the loop specification.
506 * sem_ch3.adb (Inherit_Predicate_Flags): For qn Itype created for
507 a loop specification that is a subtype indication whose type mark
508 is a type with a static predicate, inherit predicate function,
509 used to build case statement for rewritten loop.
511 2017-09-08 Justin Squirek <squirek@adacore.com>
513 * lib-load.adb: Modify printing of error message to exclude file
516 2017-09-08 Arnaud Charlet <charlet@adacore.com>
518 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode):
519 don't inline subprograms declared in both visible and private
521 (In_Package_Spec): previously In_Package_Visible_Spec; now
522 detects subprograms declared both in visible and private parts
525 2017-09-08 Ed Schonberg <schonberg@adacore.com>
527 * exp_util.adb (Build_Invariant_Procedure_Declaration): If
528 the type is an anonymous array in an object declaration, whose
529 component type has an invariant, use the object declaration
530 as the insertion point for the invariant procedure, given that
531 there is no explicit type declaration for an anonymous array type.
533 2017-09-08 Bob Duff <duff@adacore.com>
535 * a-cbprqu.ads, a-cbdlli.adb: Suppress warnings.
537 2017-09-08 Bob Duff <duff@adacore.com>
539 * a-strfix.adb (Trim): Compute Low and High only if needed.
541 2017-09-08 Justin Squirek <squirek@adacore.com>
543 * lib-load.adb (Load_Main_Source): Add error output in the case a
544 source file is missing.
546 2017-09-08 Bob Duff <duff@adacore.com>
549 * a-textio.adb, a-witeio.adb, a-ztexio.adb (Set_WCEM): Use
550 Default_WCEM by default (i.e. if the encoding is not specified
553 2017-09-08 Bob Duff <duff@adacore.com>
555 * s-trasym.ads (Hexa_Traceback): If
556 Suppress_Hex is True, print "..." instead of a hexadecimal
558 * s-trasym.adb: Ignore No_Hex in this version.
561 2017-09-08 Bob Duff <duff@adacore.com>
563 * debug.adb: Minor reformatting.
565 2017-09-08 Bob Duff <duff@adacore.com>
567 * a-cbdlli.adb, a-cohama.adb, a-cohase.adb (Copy): Rewrite the
568 code so it doesn't trigger an "uninit var" warning.
570 2017-09-08 Nicolas Roche <roche@adacore.com>
572 * s-hibaen.ads: Remove obsolete file.
574 2017-09-08 Arnaud Charlet <charlet@adacore.com>
576 * a-locale.ads: Add comment explaining the state of this package.
578 2017-09-08 Arnaud Charlet <charlet@adacore.com>
580 * sem_util.adb (Is_CCT_Instance): Allow calls in the context
582 * sem_prag.ads, sem_prag.adb (Find_Related_Declaration_Or_Body):
583 allow calls in the context of package spec (for pragma
584 Initializes) and bodies (for pragma Refined_State).
586 2017-09-08 Bob Duff <duff@adacore.com>
588 * checks.adb (Insert_Valid_Check): Copy the Do_Range_Check flag to the
591 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
593 * debug.adb (dA): Adjust comment.
594 * gnat1drv.adb (Gnat1drv): Likewise.
595 * opt.ads (List_Representation_Info_Extended): New variable.
596 * repinfo.adb (List_Record_Info): Split implementation into...
597 (Compute_Max_Length): ...this. Recurse on records if requested.
598 (List_Record_Layout): Likewise.
599 * switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
600 statement, accept '0' and set List_Representation_Info_Extended
602 * usage.adb (Usage): Document new -gnatRe variant.
604 2017-09-08 Ed Schonberg <schonberg@adacore.com>
606 * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
607 Do not save the given entity in the global variable Default_Pool
608 if the pragma appears within a generic unit.
610 2017-09-08 Bob Duff <duff@adacore.com>
612 * errout.adb (Delete_Warning): Do not
613 decrement Warnings_Treated_As_Errors. This is called before
614 Warnings_Treated_As_Errors has been incremented to account for
615 this warning. Decrementing it here can lead to negative values
616 of Warnings_Treated_As_Errors, raising Constraint_Error in
617 checks-on builds, and causing the compiler to return an error
618 code in checks-off builds.
620 2017-09-08 Arnaud Charlet <charlet@adacore.com>
622 * sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
623 entities of named concurrent types as Ref_Id and not of anonymous
624 concurrent objects (because callers already know when a conversion
625 is necessary and can easily do it); also, do not expect protected
626 types or protected objects as Context_Id (because no flow-related
627 SPARK pragmas are attached there); reflect these changes in a
628 more precise comment.
630 2017-09-08 Olivier Hainque <hainque@adacore.com>
632 * g-altive.ads: Add documentation.
634 2017-09-08 Bob Duff <duff@adacore.com>
636 * sem_util.ads, debug.adb: Minor comment fix.
637 * erroutc.ads: Comment fix.
639 2017-09-08 Ed Schonberg <schonberg@adacore.com>
641 * sem_ch12.adb (Validate_Array_Type_Instance): Suppress check
642 for compatibility of component types of formal and actual in an
643 instantiation of a child unit, when the component type of the
644 formal is itself a formal of an enclosing generic.
646 2017-09-08 Arnaud Charlet <charlet@adacore.com>
648 * sem_util.ads, sem_util.adb (Is_CCT_Instance): moved from
649 sem_prag.adb to make it available for GNATprove; for concurrent
650 types replace custom scope climbing with Scope_Same_Or_Within; for
651 single concurrent objects add scope climbing (with Scope_Within),
652 which was not there (that's the primary semantic change of this
653 commit); also, when comparing a single concurrent object with
654 its corresponding concurrent type rely on equality of types,
655 not of objects (because that's simpler to code).
656 * sem_prag.adb (Is_CCT_Instance): lifted to sem_util.ads.
657 (Analyze_Global_Item): adjust special-casing of references to the
658 current instance of a concurrent unit in the Global contracts
659 of task types and single tasks objects; similar for references
660 in the protected operations and entries of protected types and
661 single protected objects (in all these cases the current instance
662 behaves as an implicit parameter and must not be mentioned in
663 the Global contract).
665 2017-09-08 Arnaud Charlet <charlet@adacore.com>
667 * exp_ch6.adb (Expand_Call_Helper): Introduce temporary for
668 function calls returning a record within a subprogram call,
671 2017-09-08 Ed Schonberg <schonberg@adacore.com>
673 * sem_ch8.adb (Find_Expanded_Name): Handle properly an expanded
674 name that designates the current instance of a child unit in its
675 own body and appears as the prefix of a reference to an entity
676 local to the child unit.
677 * exp_ch6.adb, freeze.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
680 2017-09-08 Yannick Moy <moy@adacore.com>
682 * sem_res.adb (Resolve_Equality_Op): Do not warn on comparisons that
685 2017-09-08 Tristan Gingold <gingold@adacore.com>
687 * sem_warn.adb (Check_Unused_Withs): Remove test that disabled
688 warnings on internal units in configurable run time mode.
690 2017-09-08 Bob Duff <duff@adacore.com>
692 * sem_ch3.adb (Build_Derived_Private_Type): Inherit
693 representation items from interfaces that the derived type
694 implements, not just from the parent type.
695 * sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
696 this to return an empty list when there are no interfaces.
697 * einfo.ads, sem_ch13.adb: Minor comment fixes.
698 * sem_attr.adb: Minor comment fix.
700 2017-09-08 Doug Rupp <rupp@adacore.com>
702 * sigtramp-vxworks.c [i386]: Adjust the kernel context for
705 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
707 * exp_ch4.adb (Expand_N_Allocator): Generate a
708 call to Allocate_Any_Controlled when the allocation does not
709 require any initialization.
711 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
713 * sem_util.adb (Copy_Node_With_Replacement):
714 Update the Renamed_Object field of a replicated object renaming
717 2017-09-08 Patrick Bernardi <bernardi@adacore.com>
719 * exp_ch9.adb (Is_Pure_Barrier): Allow type
720 conversions and components of objects. Simplified the detection
721 of the Count attribute by identifying the corresponding run-time
724 2017-09-08 Yannick Moy <moy@adacore.com>
726 * exp_ch9.adb, exp_disp.adb, repinfo.adb, sem_ch12.adb, sem_dim.adb,
727 sem_type.adb, sinfo.ads: Minor reformatting.
729 2017-09-08 Ed Schonberg <schonberg@adacore.com>
731 * freeze.adb (Has_Incomplete_Compoent): New predicate, subsidiary
732 of Freeze_Profile, used to inhibit the freezing of the profile
733 of an expression function declared within a nested package, when
734 some type in the profile depends on a private type declared in
735 an enclosing package.
737 2017-09-08 Bob Duff <duff@adacore.com>
739 * gnat1drv.adb (Gnat1drv): Do not set the Force_ALI_Tree_File flag in
740 the subunit case. It's still OK to set it in the "missing subunits"
741 case, because that won't cause the obsolete .ali files that cause
744 2017-09-08 Bob Duff <duff@adacore.com>
746 * sinput-l.adb: Remove unused "with Unchecked_Conversion;". It's
747 unclear why this didn't cause a warning.
748 * a-uncdea.ads, a-unccon.ads: Add "Ada." to names in the
749 pragmas. It's unclear why this didn't cause an error.
751 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
753 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration):
755 (Expand_SPARK_Potential_Renaming): Code clean up.
756 * sem_prag.adb (Analyze_Initialization_Item): Add a guard in case
757 the item does not have a proper entity.
758 (Analyze_Input_Item): Add a guard in case the item does not have a
760 (Collect_States_And_Objects): Include object renamings in the
761 items being collected.
762 (Resolve_State): Update the documentation of this routine.
763 * sem_util.adb (Entity_Of): Add circuitry to handle
764 renamings of function results.
765 (Remove_Entity): New routine.
766 (Remove_Overloaded_Entity): Take advantage of factorization.
767 * sem_util.ads (Entity_Of): Update the documentation
769 (Remove_Entity): New routine.
770 (Remove_Overloaded_Entity): Update the documentation of this
773 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
775 * repinfo.adb (List_Record_Info): During first loop,
776 do not override the normalized position and first bit
777 if they have already been set. Move fallback code
778 for the packed case to the case where it belongs.
779 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
780 Also adjust the normalized position of components.
781 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): Likewise.
783 2017-09-08 Ed Schonberg <schonberg@adacore.com>
785 * exp_disp.adb (Make_DT, Set_All_DT_Position): Handle properly
786 the placement of a primitive operation O that renames an operation
787 R declared in an inner package, and which is thus not a primitive
788 of the dispatching type of O. In this case O is a new primitive
789 and does not inherit its dispatch table position from R (which
792 2017-09-08 Ed Schonberg <schonberg@adacore.com>
794 * sem_dim.adb (Analyze_Dimension_If_Expression,
795 Analyze_Dimension_Case_Expression): new subprograms to verify
796 the dimensional correctness of Ada2012 conditional expressions,
797 and set properly the dimensions of the construct.
798 * sem_res.adb (Resolve_If_Expression, Resolve_Case_Expression)):
799 call Analyze_Dimension.
801 2017-09-08 Ed Schonberg <schonberg@adacore.com>
803 * sem_type.adb (Expand_Interface_Conversion): Prevent an infinite
804 loop on an interface declared as a private extension of another
805 synchronized interface.
807 2017-09-08 Ed Schonberg <schonberg@adacore.com>
809 * sem_ch12.adb (Check_Generic_Parent): New procedure within
810 Analyze_Associations, to handle actual packages that depend on
811 previous instances. If a package IAP that is an instantiation is
812 used as an actual in a subsequent instantiation SI in the same
813 scope, and IAP has a body, IAP must be frozen before SI. If
814 the generic parent of IAP is itself declared in a previous
815 instantiation in the same scope, that instantiation must also
817 (Install_Body): Prevent double insertion of freeze node for
820 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
822 * sem_prag.adb (Resolve_State): Update the
823 comment on documentation. Generate a reference to the state once
824 resolution takes place.
826 2017-09-08 Ed Schonberg <schonberg@adacore.com>
828 * sem_ch13.adb (Analyze_Aspect_Specifications, case
829 Linker_Section): If the aspect applies to an object declaration
830 with explicit initialization, do not delay the freezing of the
831 object, to prevent access-before-elaboration in the generated
834 2017-09-08 Ed Schonberg <schonberg@adacore.com>
836 * a-wtdeio.adb (Put, all versions): Use Long_Long_Integer
837 (Integer_Value (Item)) when the size of the fixed decimal type
838 is larger than Integer.
840 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
843 * gcc-interface/decl.c (copy_and_substitute_in_layout): Put the fields
844 in order of increasing position in more cases.
846 2017-09-07 Yannick Moy <moy@adacore.com>
848 * a-exetim-mingw.ads: Add contract Global=>null
849 on all operations that are modeled as having no read or write
850 of global variables in SPARK.
852 2017-09-07 Raphael Amiard <amiard@adacore.com>
854 * a-chtgop.adb, a-chtgop.ads (Generic_Iteration_With_Position): Added
855 to Hmaps.Generic_Ops.
856 * a-cohama.adb (Ada.Containers.Hmaps.Iterate): Pass proper position in
858 * a-cihama.adb (Ada.Containers.Indefinite_Hmaps.Iterate): Pass pos in
860 * a-cohase.adb (Ada.Containers.Hashed_Sets.Iterate): Pass proper
863 2017-09-07 Javier Miranda <miranda@adacore.com>
865 * sem_elab.adb (Check_Task_Activation): Adding switch -gnatd.y to
866 allow disabling the generation of implicit pragma Elaborate_All
869 2017-09-07 Javier Miranda <miranda@adacore.com>
871 * exp_disp.adb (Make_Tags): Avoid suffix counter
872 in the external name of the elaboration flag. Required to fix
873 the regressions introduced by the initial version of this patch.
875 2017-09-07 Bob Duff <duff@adacore.com>
877 * sem_ch6.adb (Analyze_Function_Return): Do not
878 insert an explicit conversion to force the displacement of the
879 "this" pointer to reference the secondary dispatch table in the
880 case where the return statement is returning a raise expression,
881 as in "return raise ...".
883 2017-09-07 Arnaud Charlet <charlet@adacore.com>
885 * sem_disp.adb (Is_User_Defined_Equality): Removed procedure.
886 * sem_util.ads, sem_util.adb (Is_User_Defined_Equality): Copied
887 procedure from sem_disp.adb.
888 * sem_ch12.ads (Get_Unit_Instantiation_Node): rename Package
890 * sem_ch12.adb (Get_Unit_Instantiation_Node): function extended to
891 return the instantiation node for subprograms. Update references
892 to Get_Unit_Instantiation_Node.
893 * sem_ch7.adb (Install_Parent_Private_Declarations): update
894 reference to Get_Unit_Instantiation_Node.
895 * exp_dist.adb (Build_Package_Stubs): update reference to
896 Get_Unit_Instantiation_Node.
897 * sem_ch9.adb: minor typo in comment.
898 * lib-xref-spark_specific.adb
899 (Traverse_Declaration_Or_Statement): traverse into task type
902 2017-09-07 Ed Schonberg <schonberg@adacore.com>
904 * sem_dim.adb (Analyze_Dimension_Type_Conversion): New procedure
905 to handle properly various cases of type conversions where the
906 target type and/or the expression carry dimension information.
907 (Dimension_System_Root); If a subtype carries dimension
908 information, obtain the source parent type that carries the
911 2017-09-07 Dmitriy Anisimkov <anisimko@adacore.com>
913 * g-socket.adb, g-socket.ads (GNAT.Sockets.To_Ada): New routine.
915 2017-09-07 Ed Schonberg <schonberg@adacore.com>
917 * exp_attr.adb (Expand_N_Attribute_Reference, case 'Constrained):
918 If the prefix is a reference to an object, rewrite it as an
919 explicit dereference, as required by 3.7.2 (2) and as is done
920 with most other attributes whose prefix is an access value.
922 2017-09-07 Bob Duff <duff@adacore.com>
924 * par-ch13.adb: Set the Inside_Depends flag if we are inside a
925 Refined_Depends aspect.
926 * par-ch2.adb: Set the Inside_Depends flag if we are inside a
927 Refined_Depends pragma.
928 * scans.ads: Fix documentation of Inside_Depends flag.
929 * styleg.adb, styleg.ads: Minor reformatting and comment fixes.
931 2017-09-07 Hristian Kirtchev <kirtchev@adacore.com>
933 * exp_ch7.adb (Insert_Actions_In_Scope_Around):
934 Account for the case where the are no lists to insert, but the
935 secondary stack still requires management.
936 * a-chtgop.adb, a-cihama.adb, a-cohama.adb, a-cohase.adb, a-tags.adb,
937 comperr.adb, einfo.adb, exp_aggr.adb, exp_ch3.adb, exp_disp.adb,
938 lib-xref.adb, lib-xref-spark_specific.adb, sem_ch12.adb, sem_ch13.adb,
939 sem_ch6.adb, sem_dim.adb, sem_dim.ads, sem_elab.adb, sem_prag.adb:
942 2017-09-07 Vincent Celier <celier@adacore.com>
944 * clean.adb: Do not get the target parameters before calling
947 2017-09-07 Nicolas Roche <roche@adacore.com>
949 * s-osinte-solaris-posix.ads: Removed.
951 2017-09-07 Arnaud Charlet <charlet@adacore.com>
953 * sem_prag.adb (Collect_States_And_Objects): Detect also instances of
954 single concurrent objects.
956 2017-09-07 Javier Miranda <miranda@adacore.com>
958 * s-regexp.ads: Fix documentation of the globbing grammar.
960 2017-09-07 Gary Dismukes <dismukes@adacore.com>
962 * a-tags.ads, einfo.ads, exp_disp.ads: Minor reformatting.
964 2017-09-07 Arnaud Charlet <charlet@adacore.com>
966 * gnat1drv.adb (Gnat1drv): Enable pragma Ignore_Pragma (Global)
967 in CodePeer mode, to support more legacy code automatically.
969 2017-09-07 Ed Schonberg <schonberg@adacore.com>
971 * exp_disp.adb (Replace_Formals): If thr formal is classwide,
972 and thus not a controlling argument, preserve its type after
973 rewriting because it may appear in an nested call with a classwide
976 2017-09-07 Arnaud Charlet <charlet@adacore.com>
978 * comperr.adb (Delete_SCIL_Files): Handle case of
979 N_Package_Instantiation.
981 2017-09-07 Ed Schonberg <schonberg@adacore.com>
983 * sem_ch10.adb (Remove_Private_With_Clause): If a private with
984 clause for a unit U appears in a context that includes a regular
985 with_clause on U, rewrite the redundant private clause into a null
986 statement, rather than removing it altogether from the context,
987 so that ASIS tools can reconstruct the original source.
989 2017-09-07 Ed Schonberg <schonberg@adacore.com>
991 * sem_ch13.adb (Check_Aspect_At_Freeze_Point): The expression
992 for aspect Small can be of any real type (not only a universal
993 real literal) as long as it is a static constant.
995 2017-09-07 Thomas Quinot <quinot@adacore.com>
997 * par_sco.adb: Minor reformatting.
999 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1001 * s-parame-ae653.ads: Removed.
1003 2017-09-07 Nicolas Roche <roche@adacore.com>
1005 * s-traces-default.adb, s-trafor-default.adb, s-trafor-default.ads,
1006 s-traces.adb, s-traces.ads, s-tratas-default.adb, s-tfsetr-default.adb,
1007 s-tfsetr-vxworks.adb, s-tratas.adb, s-tratas.ads, s-tasuti.adb,
1008 s-parame-hpux.ads, s-tassta.adb, s-taasde.adb, s-tasren.adb,
1009 s-taprob.adb, a-caldel.adb, s-parame.ads, Makefile.rtl, s-tpobop.adb,
1010 s-taenca.adb, s-parame-vxworks.ads: Remove support for System.Traces.
1012 2017-09-07 Yannick Moy <moy@adacore.com>
1014 * a-ngelfu.ads Add preconditions to all functions
1015 listed in Ada RM A.5.1(19-33) as having constraints on inputs.
1017 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1019 * lib-xref.adb (Generate_Reference): ignore
1020 references to entities which are Part_Of single concurrent
1023 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1025 * sem_ch7.adb (Hide_Public_Entities): Add paragraph to main
1028 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1030 * a-taside.adb (Activation_Is_Complete): Raise Program_Error if
1031 Null_Task_Id is passed.
1033 2017-09-07 Javier Miranda <miranda@adacore.com>
1035 * einfo.ads, einfo.adb (Access_Disp_Table_Elab_Flag): New
1036 attribute. Defined for record types and subtypes.
1037 * exp_ch3.ads (Init_Secondary_Tags): Adding new formal
1038 (Init_Tags_List) to facilitate generating separate code in the
1039 IP routine to initialize the object components and for completing
1040 the elaboration of dispatch tables.
1041 * exp_ch3.adb (Build_Init_Procedure): Improve the code
1042 generated in the IP routines by means of keeping separate
1043 the initialization of the object components from the
1044 initialization of its dispatch tables. (Init_Secondary_Tags):
1045 Adding new formal (Init_Tags_List) and adjusting calls to
1046 Ada.Tags.Set_Dynamic_Offset_To_Top since it has a new formal;
1047 adjusting also calls to Ada.Tags.Register_Interface_Offset
1048 because the type of one of its formals has been changed.
1049 * a-tags.ads, a-tags.adb (Register_Interface_Offset): Profile
1050 modified. Instead of receiving a pointer to an object this
1051 routine receives now a primary tag.
1052 (Set_Dyanic_Offset_To_Top): Profile modified. This routine receives an
1053 additional formal: the tag of the primary dispatch table.
1054 * exp_disp.ads (Elab_Flag_Needed): New subprogram.
1055 * exp_disp.adb (Elab_Flag_Needed): New subprogram.
1056 (Make_Tags): Adding the declaration of the elaboration flag (if needed).
1057 * exp_aggr.adb (Build_Record_Aggr_Code): Adding actual of new
1058 formal in calls to Init_Secondary_Tags.
1060 2017-09-07 Javier Miranda <miranda@adacore.com>
1062 * ghost.adb (Mark_And_Set_Ghost_Instantiation.Check_Ghost_Actuals): New
1064 * sem_prag.adb (Pragma_Ghost): Add missing support for ghost
1065 applied to generic subprograms.
1067 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1069 * sem_util.adb (Check_Part_Of_Reference): rename Conc_Typ to Conc_Obj
1070 (because it refers to the anonymous concurrent object, not its type);
1071 fix condition for emitting error message about task/protected type,
1073 2017-09-07 Bob Duff <duff@adacore.com>
1075 * binde.adb (Debug_Flag_Old): If both -do and -dp
1076 are specified, behave as if just -do was specified, rather than
1079 2017-09-07 Nicolas Roche <roche@adacore.com>
1081 * system-vxworks-sparcv9.ads, s-vxwork-m68k.ads, s-vxwork-mips.ads,
1082 system-vxworks-m68k.ads, system-vxworks-mips.ads: Removed.
1084 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1086 * sem_prag.adb (Find_Role): The Global_Seen flag
1087 is now consulted not only for abstract states and variables,
1088 but for all kinds of items.
1089 (Collect_Subprogram_Inputs_Outputs): Do not process formal
1090 generic parameters, because unlike ordinary formal parameters,
1091 generic formals only act as input/ outputs if they are explicitly
1092 mentioned in a Global contract.
1094 2017-09-07 Yannick Moy <moy@adacore.com>
1096 * ghost.adb (Check_Ghost_Context): Do not err on ghost code inside
1097 predicate procedure. Check predicate pragma/aspect with Ghost entity.
1098 * exp_ch6.adb, par-ch6.adb, sem_ch13.adb, sem_prag.adb; Minor
1101 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1103 * sem_aggr.adb: Move New_Copy_Tree_And_Dimensions to sem_dim
1105 * sem_ch3.adb (Build_Derived_Record_Type):i Call
1106 Copy_Dimensions_Of_Components after creating the copy of the
1108 * sem_dim.ads, sem_dim.adb (Copy_Dimensions_Of_Components): For a
1109 derived recor type, copy the dikensions if any of each component
1110 of the parent record to the corresponding component declarations
1111 of the derived record. These expressions are used among other
1112 things as default values in aggregates with box associations.
1113 * a-dirval-mingw.adb, g-cgi.adb, gnatcmd.adb, lib-xref.adb,
1114 repinfo.adb, sem_attr.adb, sem_ch10.adb, sem_ch6.adb, sem_prag.adb:
1117 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1119 * sem_util.adb: Remove extra space after THEN.
1121 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1123 * sem_ch7.adb (Has_Referencer): For a subprogram renaming,
1124 also mark the renamed subprogram as referenced.
1126 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1128 * par-ch6.adb (P_Subprogram): Improve error message on null
1129 procedure with misplaced aspect specification, which the parser
1130 first attempts to interpret as a malformed expression function.
1132 2017-09-07 Gary Dismukes <dismukes@adacore.com>
1134 * sem_attr.adb (Analyze_Attribute_Old_Result):
1135 Allow attributes Result and Old in the case of an expression
1138 2017-09-07 Justin Squirek <squirek@adacore.com>
1140 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Propagate
1141 Volatile to subcomponents.
1143 2017-09-07 Bob Duff <duff@adacore.com>
1145 * exp_ch7.adb (Find_Last_Init): Check for the
1146 case where a build-in-place function call has been replaced by a
1147 'Reference attribute reference.
1149 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1151 * sem_ch7.adb (Has_Referencer): Recurse on Actions of freeze
1154 2017-09-07 Bob Duff <duff@adacore.com>
1156 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration,
1157 Make_Build_In_Place_Call_In_Anonymous_Context): Do not use the
1158 secondary stack for all functions that return limited tagged
1159 types -- just do it for dispatching calls. Misc cleanup.
1160 * sem_util.ads, sem_util.adb (Unqual_Conv): New function to
1161 remove qualifications and type conversions. Fix various bugs
1162 where only a single level of qualification or conversion was
1163 removed, so e.g. "T1'(T2'(X))" would incorrectly return "T2'(X)"
1165 * checks.adb, exp_util.ads, exp_util.adb, sem_res.adb: Misc related
1168 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1170 * sem_ch6.adb (setr_Actual_Subtypes): Within a predicate function
1171 do not create actual subtypes that may generate further predicate
1173 * sem_ch13.adb (Build_Predicate_Functions): Indicate that entity
1174 of body is a predicate function as well.
1175 (Resolve_Aspect_Expressions, Resolve_Name): For a component
1176 association, only the expression needs resolution, not the name.
1177 (Resolve_Aspect_Expressions, case Predicates): Construct and
1178 analyze the predicate function declaration in the scope of the
1179 type, before making the type and its discriminants visible.
1181 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1183 * gcc-interface/decl.c (warn_on_field_placement): Issue the warning
1184 only if the record type itself comes from source.
1186 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1188 * sem_ch5.adb: Minor reformatting and a typo fix
1190 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1192 * sinput-l.ads: minor remove extra period at the end of comment
1194 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1196 * sem_prag.adb (Add_Item_To_Name_Buffer): remove support for
1198 (Find_Role): remove support for E_Discriminant.
1200 2017-09-06 Javier Miranda <miranda@adacore.com>
1202 * exp_ch6.adb (Expand_Simple_Function_Return):
1203 Add missing implicit type conversion to force displacement of the
1206 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1208 * sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting.
1210 2017-09-06 Yannick Moy <moy@adacore.com>
1212 * sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set
1213 global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once.
1215 2017-09-06 Bob Duff <duff@adacore.com>
1217 * sem_ch8.adb: Change Assert to be consistent with
1220 2017-09-06 Bob Duff <duff@adacore.com>
1222 * binde.adb (Find_Elab_Order): Do not run Elab_Old unless
1223 requested. Previously, the -do switch meant "run Elab_New and
1224 Elab_Old and use the order chosen by Elab_Old, possibly with
1225 debugging printouts comparing the two orders." Now it means
1226 "do not run Elab_New." This is of use if there are bugs that
1227 cause Elab_New to crash.
1228 (Elab_Position, Num_Chosen): Change type to Nat, to avoid various
1230 * ali.ads (Elab_Position): Change type to Nat, to avoid various
1233 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1235 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix
1236 reference to SPARK RM.
1238 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1240 * layout.adb: Use SSU short hand consistently throughout the file.
1242 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1244 * freeze.adb (Freeze_Record_Type)
1245 <Sized_Component_Total_Round_RM_Size>: New local variable to
1246 accumulate the rounded RM_Size of components. Update it for
1247 every component whose RM_Size is statically known. Add missing
1248 guard to check that bit packing is really required before issuing
1249 the error about packing. Swap condition for clarity's sake.
1250 * sem_prag.adb (Usage_Error): Fix reference to SPARK RM in comment.
1252 2017-09-06 Fedor Rybin <frybin@adacore.com>
1254 * makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb,
1255 mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads,
1256 mlib-tgt-specific.adb, mlib-tgt-specific.ads,
1257 mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
1258 mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb,
1259 mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb,
1260 mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb,
1261 mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads,
1262 prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb,
1263 prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads,
1264 prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb,
1265 prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads,
1266 prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb,
1267 prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads,
1268 prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete
1269 project manager sources.
1271 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1273 * sem_ch5.adb (Analyze_Assigment): If the left-hand side is an
1274 entity of a mutable type and the right-hand side is a conditional
1275 expression, resolve the alternatives of the conditional using
1276 the base type of the target entity, because the alternatives
1277 may have distinct subtypes. This is particularly relevant if
1278 the alternatives are aggregates.
1280 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1282 * checks.adb (Apply_Predicate_Check): If the expression is an
1283 aggregate that is the RHS of an assignment, apply the check to
1284 the LHS after the assignment, rather than to the aggregate. This
1285 is more efficient than creating a temporary for the aggregate,
1286 and prevents back-end crashes when the aggregate includes a
1287 dynamic "others' association.
1289 2017-09-06 Yannick Moy <moy@adacore.com>
1291 * sem_ch12.adb (Analyze_Instance_And_Renamings):
1292 Set variable to ignore SPARK_Mode in instance before the analysis
1293 of the generated package declaration.
1295 2017-09-06 Yannick Moy <moy@adacore.com>
1297 * sem_res.adb (Resolve_Call): Do not issue a
1298 message for calls inside expression function, unless body was
1299 seen and is candidate for inlining.
1301 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1303 * sem_aux.adb (Is_Generic_Formal): Handle properly formal packages.
1304 * sem_ch3.adb (Analyze_Declarations): In a generic subprogram
1305 body. do not freeze the formals of the generic unit.
1307 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1309 * errout.adb (Error_Msg): Separate the
1310 treatment for warning vs. style messages in inlinings and
1311 instantiations. Prevents blowups on calls to Warn_Insertion for
1312 style messages, which should not be called in that case because
1313 Warning_Msg_Char is not set.
1315 2017-09-06 Justin Squirek <squirek@adacore.com>
1317 * sem_prag.adb (Check_VFA_Conflicts): Created
1318 to group all Volatile_Full_Access checks relating to other
1319 representation pragmas (Mark_Component_Or_Object): Created
1320 to centeralize the flagging of attributes for the record type
1321 component case, a pragma applied individually to a component, and
1323 (Process_Atomic_Independent_Shared_Volatile):
1324 Add propagation of certain pragmas to record components and move
1325 evaluation of VFA checks
1327 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1329 * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram):
1330 Do not warn on conditions that are not obeyed for Inline_Always
1331 subprograms, when assertions are not enabled.
1333 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1335 * sem_util.adb (Unique_Entity): For abstract states return their
1338 2017-09-06 Bob Duff <duff@adacore.com>
1340 * sem_ch12.adb (Copy_Generic_Node): When we copy a node
1341 that is a proper body corresponding to a stub, we defer the
1342 adjustment of the sloc until after the correct adjustment has
1343 been computed. Otherwise, Adjust_Instantiation_Sloc will ignore
1344 the adjustment, because it will be outside the range in (the old,
1345 incorrect) S_Adjustment.
1346 * inline.adb: Use named notation for readability and uniformity.
1347 * sinput-l.adb: Minor improvements to debugging output printed
1349 * sinput-l.ads (Create_Instantiation_Source): Minor comment
1352 2017-09-06 Vincent Celier <celier@adacore.com>
1354 * make.adb: Do not invoke gprbuild for -bargs -P.
1356 2017-09-06 Sylvain Dailler <dailler@adacore.com>
1358 * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Adding a
1359 case when Op is of kind N_Qualified_Expression. In this case,
1360 the function is called recursively on the subexpression like in
1362 * make.adb: Minor reformatting
1364 2017-09-06 Justin Squirek <squirek@adacore.com>
1366 * einfo.adb (Set_Linker_Section_Pragma): Modify
1367 Set_Linker_Section_Pragma to be consistant with the "getter"
1368 Linker_Section_Pragma.
1369 * exp_ch5.adb (Expand_Formal_Container_Loop): Add proper error
1370 checking for container loops so that the index cursor is not
1371 directly changable by the user with the use of E_Loop_Parameter.
1372 * sem_ch5.adb (Analyze_Block_Statement): Revert previous change.
1373 * sem_warn.adb (Check_References): Revert previous change.
1375 2017-09-06 Bob Duff <duff@adacore.com>
1377 * exp_util.adb (Is_Displace_Call): Make sure it works for indirect
1380 2017-09-06 Yannick Moy <moy@adacore.com>
1382 * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object
1383 declarations to only consider valid uses of Global/Depends those on
1384 single concurrent objects.
1386 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1388 * sem_ch13.adb (Check_Record_Representation_Clause): Give an
1389 error as soon as one of the specified components overlaps the
1392 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1394 * sem_prag.ads: minor fix typo in comment.
1396 2017-09-06 Justin Squirek <squirek@adacore.com>
1398 * sem_ch5.adb (Analyze_Block_Statement): Verify a block comes
1399 from source before checking source references.
1400 * sem_warn.adb (Check_References): Add check for internal block
1403 2017-09-06 Vincent Celier <celier@adacore.com>
1405 * make.adb, makeusg.adb, switch-m.adb, switch-m.ads, make_util.adb,
1406 make_util.ads, sinput.adb, sinput.ads, clean.adb, gnatls.adb,
1407 gnatname.adb: Remove the Project Manager from the GNAT tools.
1408 * gcc-interface/Makefile.in: ditto.
1410 2017-09-06 Bob Duff <duff@adacore.com>
1412 * sem_util.ads: Minor comment fix.
1414 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1416 * sem_ch12.adb (Analyze_Associations, case of Formal_Package):
1417 Generate a freeze node for the actual of a formal package, if
1418 the actual is declared in the same unit and has a corresponding
1419 body, to prevent the current instance from being frozen before
1422 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1424 * sem_ch7.adb (Entity_Table_Size): Change to nearest prime number.
1426 2017-09-06 Yannick Moy <moy@adacore.com>
1428 * sem_warn.adb: Minor refactoring.
1430 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1432 * einfo.ads, einfo.adb (Get_Classwwide_Pragma): New utility,
1433 to retrieve the inherited classwide precondition/postcondition
1435 * freeze.adb (Freeze_Entity): Use Get_Classwide_Pragma when
1436 freezing a subprogram, to complete the generation of the
1437 corresponding checking code.
1439 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1441 * exp_util.adb (Is_Controlled_Indexing): New routine.
1442 (Is_Displace_Call): Use routine Strip to remove indirections.
1443 (Is_Displacement_Of_Object_Or_Function_Result): Code clean up. Add a
1444 missing case of controlled generalized indexing.
1445 (Is_Source_Object): Use routine Strip to remove indirections.
1446 (Strip): New routine.
1448 2017-09-06 Bob Duff <duff@adacore.com>
1450 * sysdep.c (__gnat_has_cap_sys_nice): If HAVE_CAPABILITY is defined,
1451 we include the proper header. Otherwise, we just declare the necessary
1452 things from the capabilities library. This is so we can build on
1453 machines without that library, while still enabling that library.
1454 At run time, we're using weak symbols, so __gnat_has_cap_sys_nice will
1455 simply return 0 if the library is not present, or not included
1458 2017-09-06 Pierre-Marie de Rodat <derodat@adacore.com>
1460 * exp_dbug.adb (Debug_Renaming_Declaration): Do not create an encoding
1461 for renamings that involve function calls in prefix form.
1463 2017-09-06 Bob Duff <duff@adacore.com>
1465 * sem_ch3.adb (Analyze_Subtype_Declaration):
1466 Set Has_Delayed_Freeze on a subtype of an incomplete type.
1468 2017-09-06 Pierre-Marie de Rodat <derodat@adacore.com>
1470 * par_sco.adb (Extend_Statement_Sequence): When the accept statement
1471 has no parameter specification and no entry index, use the entry name
1472 as the end of the generated SCO statement.
1474 2017-09-06 Steve Baird <baird@adacore.com>
1476 * exp_util.adb (Side_Effect_Free): For CodePeer (only) treat
1477 uses of 'Image and related attributes as having side effects in
1478 order to avoid replicating such uses.
1479 * pprint.ads (Expression_Image) Add new generic formal flag
1480 Hide_Temp_Derefs. The flag defaults to False; CodePeer will
1481 (eventually) override the default.
1482 * pprint.adb (Expression_Image) If the new flag is set, then
1483 suppress the ".all" suffix when displaying a dereference whose
1484 prefix is a use of a value-capturing compiler temp of the sort
1485 generated by Expr_Util.Remove_Side_Effects .
1486 * exp_attr.adb, g-catiio.adb, inline.adb, sem_attr.adb, sem_ch13.adb,
1487 sem_ch7.adb, sem_dim.adb, sem_util.adb, sem_util.ads, sem_warn.adb:
1489 * inline.adb: Minor wording change.
1491 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1493 * sem_ch7.adb: Update comment.
1495 2017-09-06 Yannick Moy <moy@adacore.com>
1497 * einfo.adb, einfo.ads (Is_Subprogram_Or_Entry): New predicate.
1498 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Use new function.
1499 * sem_util.adb, sem_util.ads (Within_Protected_Type): Renaming
1500 with slight modification from Is_Subp_Or_Entry_Inside_Protected,
1501 so that applies to any entity.
1503 2017-09-06 Yannick Moy <moy@adacore.com>
1505 * sem_ch3.adb (Derived_Type_Declaration): Use
1506 Incomplete_Or_Partial_View rather than local Find_Partial_View.
1508 2017-09-06 Javier Miranda <miranda@adacore.com>
1510 * g-catiio.ads, g-catiio.adb (Value): Extended to parse an UTC time
1513 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1515 * sem_dim.adb (Analyze_Dimension): In an instance, a type
1516 conversion takes its dimensions from the expression, not from
1518 (Dimensions_Of_Operand): Ditto.
1520 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1522 * exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
1523 null procedures when GNAT coverage is used, so that their (empty)
1524 bodies are properly covered.
1526 2017-09-06 Bob Duff <duff@adacore.com>
1528 * sem_ch13.adb (Resolve_Aspect_Expressions): If
1529 the entity is a type with discriminants, make the discriminants
1530 directly visible in aspect clauses.
1532 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1534 * sem_res.adb (Resolve_Arithmentic_Op): If both operands are
1535 Universal_Real and the context is a floating-point type, resolve
1536 both operands to the target type.
1538 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1540 * a-comlin.adb, exp_aggr.adb, exp_ch6.adb, frontend.adb, gnatbind.adb,
1541 sem_ch3.adb, sem_util.adb: Minor reformatting.
1543 2017-09-06 Yannick Moy <moy@adacore.com>
1545 * freeze.adb (Check_Inherited_Conditions): Rewriting
1546 of inherited preconditions and postconditions should only occur
1547 in GNATprove mode, that is, when GNATprove_Mode is True, not to
1548 be confused with SPARK_Mode being On.
1550 2017-09-06 Yannick Moy <moy@adacore.com>
1552 * sem_warn.adb (Check_References): Take into
1553 account possibility of attribute reference as original node.
1555 2017-09-06 Yannick Moy <moy@adacore.com>
1557 * exp_attr.adb (Expand_N_Attribute_Reference): Protect against invalid
1560 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1562 * inline.adb (Split_Unconstrained_Function): Also set Is_Inlined
1563 on the procedure created to encapsulate the body.
1564 * sem_ch7.adb: Add with clause for GNAT.HTable.
1565 (Entity_Table_Size): New constant.
1566 (Entity_Hash): New function.
1567 (Subprogram_Table): New instantiation of GNAT.Htable.Simple_HTable.
1568 (Is_Subprogram_Ref): Rename into...
1569 (Scan_Subprogram_Ref): ...this. Record references to subprograms in
1570 the table instead of bailing out on them. Scan the value of constants
1571 if it is not known at compile time.
1572 (Contains_Subprograms_Refs): Rename into...
1573 (Scan_Subprogram_Refs): ...this.
1574 (Has_Referencer): Scan the body of all inlined subprograms. Reset the
1575 Is_Public flag on subprograms if they are not actually referenced.
1576 (Hide_Public_Entities): Beef up comment on the algorithm.
1577 Reset the table of subprograms on entry.
1579 2017-09-06 Yannick Moy <moy@adacore.com>
1581 * inline.adb: Add comments to Can_Be_Inlined_In_GNATprove_Mode.
1583 2017-09-06 Javier Miranda <miranda@adacore.com>
1585 * exp_aggr.adb (Component_Not_OK_For_Backend): The C backend
1586 cannot handle a type conversion of an array as an aggregate
1589 2017-09-06 Bob Duff <duff@adacore.com>
1591 * g-comlin.adb (Try_Help): Remove ".exe" so we
1592 get the same results on windows and unix.
1594 2017-09-06 Justin Squirek <squirek@adacore.com>
1596 * exp_imgv.adb (Expand_Image_Attribute),
1597 (Expand_Wide_Image_Attribute), (Expand_Wide_Wide_Image_Attribute):
1598 Added case to handle new-style 'Image expansion
1599 (Rewrite_Object_Image): Moved from exp_attr.adb
1600 * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1601 attribute cases so that the relevant subprograms in exp_imgv.adb
1602 handle all expansion.
1603 (Rewrite_Object_Reference_Image): Moved to exp_imgv.adb
1604 * sem_attr.adb (Analyze_Attribute): Modified Image attribute
1605 cases to call common function Analyze_Image_Attribute.
1606 (Analyze_Image_Attribute): Created as a common path for all
1607 image attributes (Check_Object_Reference_Image): Removed
1608 * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1609 Removed and refactored into Is_Object_Image (Is_Object_Image):
1610 Created as a replacement for Is_Image_Applied_To_Object
1612 2017-09-06 Yannick Moy <moy@adacore.com>
1614 * sem_prag.adb (Analyze_Depends_In_Decl_Part): Add continuation
1615 message for missing input.
1617 2017-09-06 Yannick Moy <moy@adacore.com>
1619 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Prevent inlining
1620 of protected subprograms and entries.
1621 * sem_util.adb, sem_util.ads (Is_Subp_Or_Entry_Inside_Protected):
1622 New function to detect when a subprogram of entry is defined
1623 inside a protected object.
1625 2017-09-06 Bob Duff <duff@adacore.com>
1627 * sysdep.c (__gnat_has_cap_sys_nice): New function to determine
1628 whether the current process has the CAP_SYS_NICE capability.
1629 * s-taprop-linux.adb (Get_Ceiling_Support): Update this to allow
1630 ceiling priorities if the current process has the CAP_SYS_NICE
1633 2017-09-06 Bob Duff <duff@adacore.com>
1635 * a-comlin.ads, a-comlin.adb (Argument): Move the constraint
1636 check back to the body, because SPARK is not yet ready for
1637 "or else raise Constraint_Error".
1639 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1641 * exp_ch6.adb (Expand_Call_Helper): Replace call to null
1642 procedure by a single null statement, after evaluating the
1643 actuals that require it.
1645 2017-09-06 Javier Miranda <miranda@adacore.com>
1647 * exp_aggr.adb (Backend_Processing_Possible.Component_Check):
1648 Generating C code improve the code that checks the use of nested
1649 aggregates to initialize object declarations.
1651 2017-09-06 Yannick Moy <moy@adacore.com>
1653 * sem_ch3.adb (Derived_Type_Declaration): Detect
1654 violations of new rule SPARK RM 3.4(1). Also refactor existing
1655 check to use the new function Find_Partial_View.
1657 2017-09-06 Vincent Celier <celier@adacore.com>
1659 * gnatcmd.adb: gnat ls -V -P... invokes gprls -V -P... The code
1660 from the Prj hierarchy has been removed from the GNAT driver.
1662 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1664 * sem_type.adb (Interface_Present_In_Ancestor): Within an
1665 expression function, or within a spec expression (default value,
1666 etc) a reference to an incomplete type is legal: legality of
1667 the operation will be checked when some related entity (type,
1668 object or subprogram) is frozen.
1670 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1672 * exp_ch5.adb, s-diinio.ads, sem_ch4.adb, s-diflio.ads: Minor spelling
1673 adjustments and a typo fix.
1675 2017-09-06 Yannick Moy <moy@adacore.com>
1677 * sem_res.adb (Resolve_Call): Do not issue info
1678 message about inlining of calls to functions in assertions,
1679 for functions whose body has not been seen yet.
1681 2017-09-06 Bob Duff <duff@adacore.com>
1683 * a-comlin.ads, a-comlin.adb (Argument): Simplify the code, now that
1684 we can use modern Ada in this package.
1685 * s-resfil.ads, s-resfil.adb, a-clrefi.ads, a-clrefi.adb:
1686 Move Ada.Command_Line.Response_File to System.Response_File,
1687 and make Ada.Command_Line.Response_File into a rename of
1688 System.Response_File. This is to avoid having gnatbind depend
1689 Ada.Command_Line, which would damage the bootstrap process now
1690 that Ada.Command_Line contains modern Ada (the raise expression).
1691 * gnatbind.adb: Avoid dependence on
1692 Ada.Command_Line. Depend on System.Response_File instead
1693 of Ada.Command_Line.Response_File. Change one call to
1694 Ada.Command_Line.Command_Name to use Fill_Arg. Change one call
1695 to Ada.Command_Line.Argument_Count to use Arg_Count.
1696 * gcc-interface/Make-lang.in, Makefile.rtl: Take note of the new files.
1698 2017-09-06 Bob Duff <duff@adacore.com>
1700 * frontend.adb (Frontend): Skip -gnatec=gnat.adc
1701 switch, because we've already read gnat.adc by default.
1703 2017-09-06 Bob Duff <duff@adacore.com>
1705 * exp_ch5.adb (Get_Default_Iterator): Replace
1706 "Assert(False)" with "return Iter", because if an iterable
1707 type is derived from a noniterable one, then we won't find an
1708 overriding or inherited default iterator.
1710 2017-09-06 Yannick Moy <moy@adacore.com>
1712 * sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
1713 literal index used to access a string is null or negative.
1715 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1717 * einfo.adb (Status_Flag_Or_Transient_Decl): The attribute is now
1718 allowed on loop parameters.
1719 (Set_Status_Flag_Or_Transient_Decl): The attribute is now allowed
1721 (Write_Field15_Name): Update the output for
1722 Status_Flag_Or_Transient_Decl.
1723 * einfo.ads: Attribute Status_Flag_Or_Transient_Decl now applies
1724 to loop parameters. Update the documentation of the attribute
1725 and the E_Loop_Parameter entity.
1726 * exp_ch7.adb (Process_Declarations): Remove the bogus guard
1727 which assumes that cursors can never be controlled.
1728 * exp_util.adb (Requires_Cleanup_Actions): Remove the bogus
1729 guard which assumes that cursors can never be controlled.
1731 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1733 * exp_attr.adb, sem_util.adb, sem_attr.adb, sem_ch6.adb, sem_ch8.adb,
1734 sem_warn.adb: Minor reformatting.
1736 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1738 * sem_warn.adb (Warn_On_Overlapping_Actuals): Refine previous
1739 fix and preserve older GNAT warning on overlapping actuals that
1740 are not elementary types.
1742 2017-09-06 Justin Squirek <squirek@adacore.com>
1744 * sem_attr.adb: Comment correction.
1746 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1748 * sem_util.adb: Minor reformatting.
1750 2017-09-06 Yannick Moy <moy@adacore.com>
1752 * a-comlin.ads (Argument): Add precondition for analysis.
1754 2017-09-06 Yannick Moy <moy@adacore.com>
1756 * sem_res.adb (Resolve): Update message for function call as statement.
1758 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1760 * sem_ch6.adb (Check_Returns): Clean up warnings coming from
1761 generated bodies for renamings that are completions, when renamed
1762 procedure is No_Return.
1763 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
1764 rule in 6.5.1 (7/2): if a renaming is a completion of a subprogram
1765 with No_Return, the renamed entity must be No_Return as well.
1767 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1769 * exp_ch5.adb, freeze.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb:
1772 2017-09-06 Justin Squirek <squirek@adacore.com>
1774 * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1775 attribute cases (Rewrite_Object_Reference_Image): Created to
1776 aid the rewriting of new-style 'Image attributes.
1777 * sem_attr.adb (Analyze_Attribute): Modified Image attribute cases
1778 (Check_Object_Reference_Image): Created to handle verification of
1779 'Image with object-references as prefixes.
1780 * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1781 Create predicate to identify cases where an 'Image attribute's
1782 prefix applies to an object reference.
1784 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1786 * freeze.adb (Freeze_Entity): Do not generate a freeze
1787 node for a generic unit, even if it includes delayed aspect
1788 specifications. Freeze nodes for generic entities must never
1789 appear in the tree that reaches the back-end of the compiler.
1791 2017-09-06 Yannick Moy <moy@adacore.com>
1793 * treepr.adb (Print_Entity_Info): Do not print empty Elist.
1795 2017-09-06 Yannick Moy <moy@adacore.com>
1797 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not consider calls
1798 to subprograms in other units as possibly inlined.
1800 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1802 * freeze.adb (Freeze_Entity): For a derived type that has no
1803 explicit delayed aspects but may inherit delayed aspects from its
1804 parent type, analyze aspect at freeze point for proper capture
1805 of an inherited aspect.
1807 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1809 * lib-xref.adb (Get_Through_Renamings): Get through subprogram
1810 renamings; also, avoid repeated calls to Renamed_Object when getting
1811 through object renamings.
1813 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1815 * sem_ch3.adb (Array_Type_Declaration): Handle properly an
1816 array type declaration in a private part, when an index is a
1817 subtype indication of a discrete type with a private partial view.
1819 2017-09-06 Javier Miranda <miranda@adacore.com>
1821 * exp_ch4.adb (Expand_Modular_Op): Force generating
1822 temporary to improve the generated code.
1824 2017-09-06 Tristan Gingold <gingold@adacore.com>
1826 * s-fatgen.adb: Minor typo fix in comment.
1828 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1830 * exp_ch5.adb (Make_Field_Assign): If the type
1831 of the right-hand side has stored constraint, use its values
1832 (except for those that are renamings of parent discriminants)
1833 to produce additional assignments for the discriminants of the
1834 left-hand side, which are invisible in the righ-hand side and
1835 not retrievable as selected components.
1837 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1839 * sem_util.adb (Needs_One_Formal): The first formal of such a
1840 function must be a controlling formal, so that Obj.F (X, Y)
1841 can have the interpretation F(Obj)(X, Y).
1842 * sem_util.ads: Clarify documentation.
1844 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1846 * table.ads, table.adb: Restore original implementation.
1847 * namet.h (Names_Ptr): Adjust back.
1848 (Name_Chars_Ptr): Likewise.
1849 * uintp.h (Uints_Ptr): Likewise.
1850 (Udigits_Ptr): Likewise.
1851 * g-table.ads: Remove pragma Compiler_Unit_Warning.
1852 * par_sco.adb: Do not with GNAT.Table and use Table consistently.
1853 * scos.ads: Replace GNAT.Table with Table and adjust instantiations.
1854 * spark_xrefs.ads: Likewise.
1855 * scos.h: Undo latest changes.
1857 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1859 * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate
1860 No_Return flag to instance if pragma applies to generic unit. This
1861 must be done explicitly because the pragma does not appear
1862 directly in the generic declaration (unlike the corresponding
1863 aspect specification).
1865 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1867 * sem_ch7.adb (Has_Referencer): Move up and expand comment
1868 explaining the test used to detect inlining. Use same test
1869 in second occurrence.
1870 (Analyze_Package_Body_Helper): Minor formatting fixes.
1872 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1874 * exp_ch4.adb (Handle_Changed_Representation): For an untagged
1875 derived type with a mixture of renamed and constrained parent
1876 discriminants, the constraint for the target must obtain the
1877 discriminant values from both the operand and from the stored
1878 constraint for it, given that the constrained discriminants are
1879 not visible in the object.
1880 * exp_ch5.adb (Make_Field_Assign): The type of the right-hand
1881 side may be derived from that of the left-hand side (as in the
1882 case of an assignment with a change of representation) so the
1883 discriminant to be used in the retrieval of the value of the
1884 component must be the entity in the type of the right-hand side.
1886 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1888 * sem_ch3.adb, sem_ch7.adb, sem_util.adb, g-debpoo.adb, sem_ch4.adb,
1889 sem_ch6.adb, sem_ch8.adb: Minor reformatting.
1890 * exp_util.adb (Is_Source_Object): Account for
1891 the cases where the source object may appear as a dereference
1892 or within a type conversion.
1893 * exp_ch6.adb: Fix missing space in error message.
1895 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1897 * sem_prag.adb: Update description of Eliminate.
1899 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1901 * sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
1902 properly an attribute reference 'Loop_Entry that appears in the
1903 list of indices of an indexed expression, to prevent an infinite
1904 loop in the compiler.
1906 2017-09-06 Bob Duff <duff@adacore.com>
1908 * s-fileio.adb (Name): Do not raise Use_Error for temp files.
1910 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1912 * sem_ch4.adb (Analyze_Set_Membership): If an alternative
1913 in a set membership is an overloaded enumeration literal, and
1914 the type of the alternative is resolved from a previous one,
1915 replace the entity of the alternative as well as the type,
1916 to prevent inconsistencies between the entity and the type.
1918 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1920 * ali.ads (ALIs_Record): Add No_Component_Reordering component.
1921 (No_Component_Reordering_Specified): New switch.
1922 * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified.
1923 (Scan_ALI): Set No_Component_Reordering and deal with NC marker.
1924 * bcheck.adb (Check_Consistent_No_Component_Reordering):
1926 (Check_Configuration_Consistency): Invoke it.
1927 * debug.adb (d.r): Toggle the effect of the switch.
1928 (d.v): Change to no-op.
1929 * einfo.ads (Has_Complex_Representation):
1930 Restrict to record types.
1931 (No_Reordering): New alias for Flag239.
1932 (OK_To_Reorder_Components): Delete.
1933 (No_Reordering): Declare.
1934 (Set_No_Reordering): Likewise.
1935 (OK_To_Reorder_Components): Delete.
1936 (Set_OK_To_Reorder_Components): Likewise.
1937 * einfo.adb (Has_Complex_Representation): Expect record types.
1938 (No_Reordering): New function.
1939 (OK_To_Reorder_Components): Delete.
1940 (Set_Has_Complex_Representation): Expect base record types.
1941 (Set_No_Reordering): New procedure.
1942 (Set_OK_To_Reorder_Components): Delete.
1943 (Write_Entity_Flags): Adjust to above change.
1944 * fe.h (Debug_Flag_Dot_R): New macro and declaration.
1945 * freeze.adb (Freeze_Record_Type): Remove conditional code setting
1946 OK_To_Reorder_Components on record types with convention Ada.
1947 * lib-writ.adb (Write_ALI): Deal with NC marker.
1948 * opt.ads (No_Component_Reordering): New flag.
1949 (No_Component_Reordering_Config): Likewise.
1950 (Config_Switches_Type): Add No_Component_Reordering component.
1951 * opt.adb (Register_Opt_Config_Switches): Copy
1952 No_Component_Reordering onto No_Component_Reordering_Config.
1953 (Restore_Opt_Config_Switches): Restore No_Component_Reordering.
1954 (Save_Opt_Config_Switches): Save No_Component_Reordering.
1955 (Set_Opt_Config_Switches): Set No_Component_Reordering.
1956 * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering.
1957 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the
1958 No_Reordering flag from the default.
1959 (Build_Derived_Private_Type): Likewise.
1960 (Build_Derived_Record_Type): Likewise. Then inherit it
1961 for untagged types and clean up handling of similar flags.
1962 (Record_Type_Declaration): Likewise.
1963 * sem_ch13.adb (Same_Representation): Deal with No_Reordering and
1964 remove redundant test on Is_Tagged_Type.
1965 * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering.
1966 (Sig_Flags): Likewise.
1967 * snames.ads-tmpl (Name_No_Component_Reordering): New name.
1968 (Pragma_Id): Add Pragma_No_Component_Reordering value.
1969 * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well.
1970 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>:
1971 Copy the layout of the parent type only if the No_Reordering
1973 (components_to_record): Reorder record types with
1974 convention Ada by default unless No_Reordering is set or -gnatd.r
1975 is specified and do not warn if No_Reordering is set in GNAT mode.
1977 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1979 * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure):
1980 new predicate to reject declarations that can be completions,
1981 when there is a visible prior homograph that is a null procedure.
1982 * sem_ch6.adb (Analyze_Null_Procedure): use it.
1983 * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto.
1985 2017-09-06 Thomas Quinot <quinot@adacore.com>
1987 * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal
1988 run of 253 characters or more.
1990 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1992 * einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
1993 properly incomplete subtypes that may be created by explicit or
1994 implicit declarations.
1995 (Is_Base_Type): Take E_Incomplete_Subtype into account.
1996 (Subtype_Kind): Ditto.
1997 * sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
1998 Ekind of a subtype of a discriminated incomplete type.
1999 (Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
2000 incomplete types, to preserve error reporting.
2001 (Process_Incomplete_Dependents): Do not create a subtype
2002 declaration for an incomplete subtype that is created internally.
2003 * sem_ch7.adb (Analyze_Package_Specification): Handle properly
2004 incomplete subtypes that do not require a completion, either
2005 because they are limited views, of they are generic actuals.
2007 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
2009 * checks.adb (Insert_Valid_Check): Remove the
2010 suspicious manipulation of the Do_Range_Check flag as ths is
2011 no linger needed. Suppress validity check when analysing the
2012 validation variable.
2014 2017-09-06 Philippe Gil <gil@adacore.com>
2016 * g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
2019 2017-09-06 Bob Duff <duff@adacore.com>
2021 * sem_elim.adb: Minor comment fix.
2023 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2025 * sem_util.adb (Is_Object_Reference): A function call is an
2026 object reference, and thus attribute references for attributes
2027 that are functions (such as Pred and Succ) as well as predefined
2028 operators are legal in contexts that require an object, such as
2029 the prefix of attribute Img and the Ada2020 version of 'Image.
2031 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
2033 * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
2034 exp_ch3.adb, xoscons.adb: Minor reformatting.
2036 2017-09-06 Raphael Amiard <amiard@adacore.com>
2038 * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
2039 Position parameter. If supplied, use it to provide efficient iteration.
2040 * a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
2041 a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
2044 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2046 * exp_util.adb (Build_Allocate_Deallocate_Proc): If the
2047 designated type is class-wide and the expression is an unchecked
2048 conversion, preserve the conversion when checking the tag of the
2049 designated object, to prevent spurious semantic errors when the
2050 expression in the conversion has an untagged type (for example
2051 an address attribute).
2053 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2055 * sem_res.adb (Resolve_Entry_Call): Check whether a protected
2056 operation is subject to a pragma Eliminate.
2058 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2060 * sem_elim.ads, exp_ch4.adb: Minor reformatting.
2062 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
2064 * fe.h (Eliminate_Error_Msg): Remove.
2066 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
2068 * gcc-interface/utils.c (make_packable_type): Update call to
2071 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
2073 * gcc-interface/utils2.c (build_load_modify_store):
2074 Use int_mode_for_size.
2076 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2079 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2080 for Itypes that are E_Record_Subtype with a cloned subtype.
2081 <E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
2083 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2085 * gcc-interface/trans.c (convert_with_check): Use a custom base type
2086 if the base type of the expression has a different machine mode.
2087 Rename a couple of parameters and local variable.
2089 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2091 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Address>: Do not strip
2092 conversions around prefixes that are not references.
2094 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2096 * gcc-interface/utils.c (unchecked_convert): When the result type is a
2097 non-biased integral type with size 0, set the result to 0 directly.
2099 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2101 * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to
2102 (renaming_from_instantiation_p): ...this.
2103 * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate
2104 instead of explicit tests on kind of entities. Adjust for renaming.
2105 (gnat_to_gnu_profile_type): Likewise.
2106 (gnat_to_gnu_subprog_type): Likewise.
2107 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
2108 (Case_Statement_to_gnu): Likewise.
2109 (gnat_to_gnu): Likewise.
2110 (process_freeze_entity): Likewise.
2111 (process_type): Likewise.
2112 (add_stmt_with_node): Adjust for renaming.
2113 * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming.
2114 (renaming_from_generic_instantiation_p): Rename to...
2115 (renaming_from_instantiation_p): ...this. Use inline predicate.
2116 (pad_type_hasher::keep_cache_entry): Fold.
2118 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2120 * gcc-interface/trans.c (adjust_for_implicit_deref): New function.
2121 (gnat_to_gnu) <N_Explicit_Dereference>: Translate result type first.
2122 (N_Indexed_Component): Invoke adjust_for_implicit_deref on the prefix.
2123 (N_Slice): Likewise.
2124 (N_Selected_Component): Likewise. Do not try again to translate it.
2125 (N_Free_Statement): Invoke adjust_for_implicit_deref on the expression.
2127 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2129 * repinfo.ads: Document new treatment of dynamic values.
2130 (TCode): Bump upper bound to 29.
2131 (Dynamic_Val): New constant set to 29.
2132 * repinfo.adb (Print_Expr) <Dynamic_Val>: New case.
2133 (Rep_Value) <Dynamic_Val>: Likewise.
2134 * repinfo.h (Dynamic_Val): New macro.
2135 * gcc-interface/decl.c (annotate_value): Tidy up and cache result for
2137 <INTEGER_CST>: Set TCODE instead of recursing.
2138 <COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
2139 <VAR_DECL>: New case.
2140 <MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
2141 <BIT_AND_EXPR>: Adjust.
2142 <CALL_EXPR>: Do not fall through.
2144 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2146 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2147 there is no target, do not create a temporary for the return value for
2148 an allocator either.
2150 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2152 * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
2153 unconstrained array type.
2155 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2156 Alan Hayward <alan.hayward@arm.com>
2157 David Sherwood <david.sherwood@arm.com>
2159 * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
2160 instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
2162 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2163 Alan Hayward <alan.hayward@arm.com>
2164 David Sherwood <david.sherwood@arm.com>
2166 * gcc-interface/decl.c (check_ok_for_atomic_type): Use
2167 is_a <scalar_int_mode>.
2168 * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
2169 * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
2171 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2172 Alan Hayward <alan.hayward@arm.com>
2173 David Sherwood <david.sherwood@arm.com>
2175 * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
2176 instead of mode_for_size.
2177 (gnat_to_gnu_subprog_type): Likewise.
2178 * gcc-interface/utils.c (make_type_from_size): Likewise.
2180 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2181 Alan Hayward <alan.hayward@arm.com>
2182 David Sherwood <david.sherwood@arm.com>
2184 * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
2185 (fp_size_to_prec): Likewise.
2187 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2188 Alan Hayward <alan.hayward@arm.com>
2189 David Sherwood <david.sherwood@arm.com>
2191 * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
2192 <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
2194 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2195 Alan Hayward <alan.hayward@arm.com>
2196 David Sherwood <david.sherwood@arm.com>
2198 * gcc-interface/decl.c (validate_size): Update use of
2199 GET_MODE_WIDER_MODE, forcing a wider mode to exist.
2201 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2202 Alan Hayward <alan.hayward@arm.com>
2203 David Sherwood <david.sherwood@arm.com>
2205 * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
2206 (fp_size_to_prec): Likewise.
2208 2017-08-29 Martin Liska <mliska@suse.cz>
2211 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
2213 2017-08-08 Martin Liska <mliska@suse.cz>
2215 * gcc-interface/trans.c: Include header files.
2217 2017-07-29 Jakub Jelinek <jakub@redhat.com>
2219 * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
2220 as new argument to the imported_module_or_decl debug hook.
2222 2017-07-25 Javier Miranda <miranda@adacore.com>
2224 * checks.adb (Apply_Divide_Checks): Ensure that operands are not
2227 2017-07-19 Jakub Jelinek <jakub@redhat.com>
2229 * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
2230 TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
2231 (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
2233 2017-07-18 Mike Frysinger <vapier@chromium.org>
2235 * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
2236 (../../gnatlink$(exeext)): Likewise.
2238 2017-07-15 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2241 * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
2242 (Backend_Overflow_Checks): Set to True.
2244 2017-06-23 Jakub Jelinek <jakub@redhat.com>
2246 * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
2248 2017-06-21 Pierre-Marie de Rodat <derodat@adacore.com>
2250 * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
2252 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
2254 (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
2256 * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
2257 imported subprograms for the current compilation unit as
2258 definitions. Disable debug info for references to variables.
2259 * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
2260 * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
2261 not built-in functions to their binding scope.
2262 (create_subprog_decl): Add a DEFINITION parameter. If it is true, tag
2263 the function as a definition. Update all callers.
2264 (gnat_write_global_declarations): Emit debug info for imported
2265 functions. Filter out external variables for which debug info
2268 2017-06-15 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
2271 * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
2272 (i[3456]86-pc-gnu): Likewise.
2273 (x86_64 kfreebsd): Likewise.
2275 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
2278 * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
2280 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
2283 * s-interr-hwint.adb: Reinstate.
2284 * gcc-interface/Makefile.in (RTEMS): Use it again.
2286 2017-06-08 Olivier Hainque <hainque@adacore.com>
2288 * vx_crtbegin_auto.c: Update year in copyright notice.
2289 * vx_crtbegin.c: Likewise.
2290 * vx_crtbegin.inc: Likewise.
2291 * vx_crtend.c: Likewise.
2293 2017-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
2295 * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
2296 * s-tpopsp-rtems.adb: Delete.
2298 2017-06-02 Olivier Hainque <hainque@adacore.com>
2300 * vx_crtbegin_auto.c: New file.
2301 * vx_crtbegin.c: New file.
2302 * vx_crtbegin.inc: New file.
2303 * vx_crtend.c: New file.
2305 2017-05-25 Jonathan Wakely <jwakely@redhat.com>
2307 * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
2308 const qualifiers that cause -Wignored-qualifiers warnings.
2310 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
2312 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2313 for Itypes that are E_Access_Subtype.
2314 <E_Access_Subtype>: Use the DECL of the base type directly.
2316 2017-05-22 Ed Schonberg <schonberg@adacore.com>
2317 Eric Botcazou <ebotcazou@adacore.com>
2319 * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
2320 limited view may appear in the profile of a function, and a call to
2321 that function in another unit in which the full view is available must
2322 use this full view to spurious type errors at the point of call.
2323 * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
2324 of parent body with a with clause for the main unit.
2325 * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
2326 (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
2327 types declared in external units like types from limited with clauses.
2328 Adjust final processing of defer_limited_with_list accordingly.
2329 * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
2330 again to translate the prefix after the field if it is incomplete.
2332 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
2334 * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
2335 alignment for simple volatile fields and remove associated errors.
2337 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2339 * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
2340 * gcc-interface/trans.c (get_elaboration_procedure): Make static.
2342 2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
2344 * gcc-interface/utils.c (can_materialize_object_renaming_p):
2345 Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
2346 process Original_Node instead of expanded names.
2348 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2350 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
2351 addressability check in the constrained case.
2353 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2355 * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
2356 types not coming from a limited context.
2358 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2360 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
2361 the inlined list that are not public.
2362 * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
2363 there is a pragma Inline_Always on the subprogram.
2365 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2367 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
2368 <N_Allocator>: Use properly typed constants.
2369 (extract_values): Move around.
2370 (pos_to_constructor): Minor tweaks.
2371 (Sloc_to_locus): Fix formatting.
2372 * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
2373 * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
2374 (Gigi_Equivalent_Type): Adjust head comment.
2375 * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
2377 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2379 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
2380 is a representation clause on an extension, propagate the alignment of
2381 the parent type only if the platform requires strict alignment.
2383 2017-05-12 Eric Botcazou <ebotcazou@adacore.com>
2385 * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
2386 instead of Word_Size.
2389 2017-03-28 Andreas Schwab <schwab@suse.de>
2392 * system-linux-aarch64-ilp32.ads: New file.
2393 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
2394 from LIBGNAT_TARGET_PAIRS.
2395 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
2396 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
2397 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
2398 or -mabi=ilp32, resp.
2400 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2403 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
2404 instead of Word_Size.
2406 2017-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
2408 * raise-gcc.c (exception_class_eq): Make ec parameter const.
2410 2017-05-02 Richard Biener <rguenther@suse.de>
2412 * gcc-interface/misc.c (gnat_post_options): Do not set
2415 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2417 * gcc-interface/trans.c (assoc_to_constructor): Make sure
2418 Corresponding_Discriminant is only called on discriminants.
2419 Skip the saving of the result only for them.
2420 (gnat_to_gnu) <N_Selected_Component>: Likewise.
2421 <N_Unchecked_Type_Conversion>: Translate the result type first.
2422 (gigi): Set TREE_NOTHROW on Begin_Handler.
2423 (stmt_list_cannot_raise_p): New predicate.
2424 (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
2425 a cleanup if the statements of the handler cannot raise.
2426 (process_freeze_entity): Use Is_Record_Type.
2427 (process_type): Likewise.
2429 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2431 * einfo.ads (Corresponding_Record_Component): New alias
2432 for Node21 used for E_Component and E_Discriminant.
2433 * einfo.adb (Corresponding_Record_Component): New function.
2434 (Set_Corresponding_Record_Component): New procedure.
2435 (Write_Field21_Name): Handle Corresponding_Record_Component.
2436 * sem_ch3.adb (Inherit_Component): Set
2437 Corresponding_Record_Component for every component in
2438 the untagged case. Clear it afterwards for non-girder
2440 * gcc-interface/decl.c (gnat_to_gnu_entity)
2441 <E_Record_Type>: For a derived untagged type with discriminants
2442 and constraints, apply the constraints to the layout of the
2443 parent type to deduce the layout.
2444 (field_is_aliased): Delete.
2445 (components_to_record): Test DECL_ALIASED_P directly.
2446 (annotate_rep): Check that fields are present except for
2448 (create_field_decl_from): Add DEBUG_INFO_P
2449 parameter and pass it in recursive and other calls. Add guard
2450 for the manual CSE on the size.
2451 (is_stored_discriminant): New predicate.
2452 (copy_and_substitute_in_layout): Consider only
2453 stored discriminants and check that original fields are present
2454 in the old type. Deal with derived types. Adjust call to
2455 create_variant_part_from.
2457 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2459 * exp_ch6.adb (Expand_Call_Helper): When locating the
2460 accessibility entity created for an access parameter, handle
2461 properly a reference to a formal of an enclosing subprogram. if
2462 the reference appears in an inherited class-wide condition, it
2463 is the rewriting of the reference in the ancestor expression,
2464 but the accessibility entity must be that of the current formal.
2466 2017-05-02 Javier Miranda <miranda@adacore.com>
2468 * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
2469 (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
2470 Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
2471 Call Expand_Non_Binary_Modular_Op.
2473 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2475 * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
2476 has discriminants, do not override the Stored_Constraint list of
2477 the full view of the derived type with that of the derived type.
2479 2017-05-02 Bob Duff <duff@adacore.com>
2481 * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
2483 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2485 * s-os_lib.ads: Minor typo fix.
2487 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2489 * gnatls.adb: Merge and refactor code from Prj.Env and remove
2490 this deprecated dependency.
2492 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2494 * exp_util.ads: minor comment addition.
2496 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2498 * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
2499 pastos in part #3 of the head comment.
2501 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2503 * exp_ch3.adb (Freeze_Type): Do not generate an invariant
2504 procedure body for a local (sub)type declaration within a
2505 predicate function. Invariant checks do not apply to these, and
2506 the expansion of the procedure will happen in the wrong scope,
2507 leading to misplaced freeze nodes.
2509 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2511 * exp_util.adb (Insert_Library_Level_Action): Use proper scope
2512 to analyze generated actions. If the main unit is a body,
2513 the required scope is that of the corresponding unit declaration.
2515 2017-05-02 Arnaud Charlet <charlet@adacore.com>
2517 * einfo.adb (Declaration_Node): flip branches of
2518 an IF statement to avoid repeated negations in its condition;
2519 no change in semantics, only to improve readability.
2521 2017-05-02 Arnaud Charlet <charlet@adacore.com>
2523 * sem_case.adb: Remove extra spaces in parameter declarations.
2525 2017-05-02 Justin Squirek <squirek@adacore.com>
2527 * usage.adb: Replace space with hyphen ("run time" -> "run-time")
2528 in usage line for new -gnatwE switch.
2530 2017-05-02 Claire Dross <dross@adacore.com>
2532 * a-cofuve.ads (Remove): Remove unnecessary
2533 conditions in precondition.
2535 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2537 * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
2538 sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
2540 2017-05-02 Justin Squirek <squirek@adacore.com>
2542 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2543 alternative expression.
2544 * sem_res.adb (Resolve_Case_Expression): Ditto.
2546 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2548 * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
2549 Refine predicate for the case where the primitive operation
2550 is a renaming of equality. An overriding operation that is
2551 a user-defined renaming of predefined equality inherits its
2552 slot from the overridden operation. Otherwise it is treated
2553 as a predefined op and occupies the same predefined slot as
2554 equality. A call to it is transformed into a call to its alias,
2555 which is the predefined equality. A dispatching call thus uses
2556 the proper slot if operation is further inherited and called
2557 with class-wide arguments.
2559 2017-05-02 Justin Squirek <squirek@adacore.com>
2561 * errout.adb (Set_Msg_Text): Add a case to switch the message
2562 type when the character '[' is detected signifying a warning
2563 about a run-time exception.
2564 * opt.ads Add a new Warning_Mode value for new switch
2565 * switch-b.adb (Scan_Binder_Switches): Add case for the binder
2566 to handle new warning mode
2567 * usage.adb (Usage): Add usage entry for -gnatwE
2568 * warnsw.adb (Set_Warning_Switch): Add case for the new switch
2570 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2572 * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
2573 declaration that operates on some fixed point type.
2575 2017-05-02 Justin Squirek <squirek@adacore.com>
2577 * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
2579 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2581 * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
2583 2017-05-02 Justin Squirek <squirek@adacore.com>
2585 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2586 expression (Analyze_If_Expression): Add check for valid condition
2587 * sem_eval.adb (Eval_Case_Expression): Add check for error posted
2589 * sem_res.adb (Resolve_If_Expression): Add check for valid
2590 condition and then-expression.
2592 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2594 * exp_ch3.adb (Build_Initialization_Call): Generate a null
2595 statement if the initialization call is a null procedure, as
2596 can happen with a controlled type with no explicit Initialize
2597 procedure, or an array of such.
2598 * exp_ch7.adb (Process_Object_Declaration): For a type with
2599 controlled components that has a trivial Initialize procedure,
2600 insert declaration for finalization counter after object
2602 (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
2603 finalization block and attendant declarations if component has
2604 a trivial Initialize procedure.
2605 (Make_Init_Call): Do not generate a call if controlled type has
2606 a trivial Initialize procedure.
2608 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2610 * g-forstr.ads (Data): Move Format component last.
2611 * g-forstr.adb ("+"): Adjust for above change.
2612 * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
2613 * g-sechas.ads (Context): Move Key last.
2614 * g-socket.ads (Service_Entry_Type): Move Aliases last.
2615 * s-fileio.adb (Temp_File_Record): Move Name last.
2616 * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
2617 * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
2619 2017-05-02 Jerome Lambourg <lambourg@adacore.com>
2621 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
2622 switch introduced recently. finally not needed.
2624 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2626 * sem_ch6.adb (Analyze_Null_Procedure): Set the
2627 Corresponding_Body link for a null procedure declaration.
2629 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2631 * atree.h (Flag290): Add missing terminating parenthesis.
2632 * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
2633 (Set_Is_Class_Wide_Clone): Likewise.
2634 * einfo.ads (Is_Class_Wide_Clone): Likewise.
2636 2017-05-02 Gary Dismukes <dismukes@adacore.com>
2638 * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
2639 parameter Array_Comp to indicate the case of an array object
2640 with null-excluding components.
2641 * checks.adb (Null_Exclusion_Static_Checks):
2642 Call Compile_Time_Constraint_Error instead of
2643 Apply_Compile_Time_Constraint_Error in the component case. Also
2644 call that when Array_Comp is True, with an appropriate warning for
2645 the array component case. Only create an explicit initialization
2646 by null in the case of an object of a null-excluding access type
2647 (and no longer do that in the component case).
2648 * sem_ch3.adb (Check_Component): Add a Boolean parameter
2649 Array_Comp defaulted to False. Pass Empty for the Comp
2650 actual when calling Null_Exclusion_Static_Checks in the case
2651 where Comp_Decl matches Object_Decl, because we don't have a
2652 component in that case. In the case of an object or component
2653 of an array type, pass True for Array_Comp on the recursive call
2656 2017-05-02 Bob Duff <duff@adacore.com>
2658 * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
2659 compute the linux priority from the Ada priority. Call this everywhere
2660 required. In particular, the previous version was not doing this
2661 computation when setting the ceiling priority in various places. It
2662 was just converting to C.int, which results in a ceiling that is off
2665 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2667 * sem_ch3.adb: Comment predicate inheritance.
2669 2017-05-02 Tristan Gingold <gingold@adacore.com>
2671 * s-trasym.ads: Add comment.
2673 2017-05-02 Bob Duff <duff@adacore.com>
2675 * sem_elab.adb, sem_elab.ads: Minor comment fixes.
2676 * sem_ch4.adb: Minor reformatting.
2677 * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
2678 * s-taspri-posix-noaltstack.ads: Minor refactoring.
2679 * sinput.ads: Minor typo fix.
2681 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2683 * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
2684 * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
2685 here from exp_ch9, to recognize objects whose creation requires
2686 dynamic allocation, so that the proper warning can be emitted
2687 when restriction No_Implicit_Heap_Allocation is in effect.
2688 * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
2689 to emit proper warning when an object that requires dynamic
2690 allocation is declared.
2692 2017-05-02 Tristan Gingold <gingold@adacore.com>
2694 * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
2696 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2698 * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
2699 visibility rules for equality operators that apply within an
2700 instantiation apply within an inlined body.
2701 * sem_type.adb (Add_One_Interp): ditto.
2703 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2705 * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
2708 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2711 (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
2712 Name_No_Tagged_Streams): Move to regular pragmas. Add
2713 placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
2714 and Secondary_Stack_Size.
2715 (Pragma_Id): Move Pragma_Assume,
2716 Pragma_Attribute_Definition, Pragma_Loop_Optimize and
2717 Pragma_No_Tagged_Streams to second part.
2719 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2721 * exp_attr.adb: Minor reformatting.
2723 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2725 * sem_ch4.adb (Analyze_Selected_Component): Improve error
2726 detection for illegal references to private components or
2727 operations of a protected type in the body of the type.
2729 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2731 * opt.ads: Add missing GNAT markers in comments.
2732 * opt.adb (Set_Opt_Config_Switches): Do not override earlier
2733 settings of Optimize_Alignment at the end.
2735 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2737 * checks.adb (Apply_Constraint_Check): Do not apply
2738 a discriminant check when the associated type is a constrained
2739 subtype created for an unconstrained nominal type.
2740 * exp_attr.adb: Minor reformatting.
2742 2017-05-02 Bob Duff <duff@adacore.com>
2744 * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
2745 the N_Raise_Expression case.
2746 * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
2749 2017-05-02 Yannick Moy <moy@adacore.com>
2751 * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
2752 optimize length comparison in GNATprove mode.
2753 * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
2754 operator /= into negation of operator = when needed.
2755 (Expand_SPARK): Call new
2756 function to expand operator /=.
2758 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2760 * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
2761 Simplify the expression for a fixed-fixed division to remove
2762 divisions by constants whenever possible, as an optimization
2763 for restricted targets.
2765 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2767 * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
2769 2017-05-02 Bob Duff <duff@adacore.com>
2771 * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
2772 to find primitive ops, instead of using an Identifier that will
2773 later be looked up. This is necessary because these ops are not
2774 necessarily visible at all places where we need to call them.
2775 * exp_util.ads: Minor comment fix.
2777 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2779 * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
2780 references are fully conformant if they are both expansions
2781 of the discriminant of a protected type, within one of the
2782 protected operations. One occurrence may be expanded into a
2783 constant declaration while the other is an input parameter to
2784 the corresponding generated subprogram.
2786 2017-05-02 Justin Squirek <squirek@adacore.com>
2788 * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
2789 recursivly searching composite-types for null-excluding access
2790 types and verifying them.
2791 (Analyze_Object_Declaration): Add a
2792 call to Check_Null_Excluding_Components for static verification
2793 of non-initialized objects.
2794 * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
2795 a parameter for a composite-type's component and an extra case
2796 for printing component information.
2798 2017-05-02 Yannick Moy <moy@adacore.com>
2800 * sem_ch10.adb (Analyze_Subunit): Take
2801 configuration pragma into account when restoring appropriate
2802 pragma for analysis of subunit.
2804 2017-05-02 Justin Squirek <squirek@adacore.com>
2806 * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
2807 s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
2808 g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
2809 clauses from the runtime.
2811 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2813 * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
2814 array components specially.
2816 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2818 * sem_ch8.adb (Premature_Usage): If the premature usage of
2819 an entity is as the expression in its own object decaration,
2820 rewrite the reference as Any_Id to prevent cascaded errors or
2821 compiler loops when such an entity is used in an address clause.
2823 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
2825 * gcc-interface/decl.c (components_to_record): Add missing guard.
2827 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
2829 * gcc-interface/decl.c (components_to_record): Add more comments.
2830 Put back pending fields onto the regular list if the misalignment
2831 happens to cancel itself.
2833 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2835 * sem_ch4.adb (Complete_Object_Operation): When rewriting the
2836 controlling actual in a prefixed call, preserve the original node
2837 information if the prefix itself has been rewritten, for ASIS use.
2839 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2841 * exp_ch6.adb (Insert_Post_Call_Actions):
2842 Code clean up. Insert the post-call actions after an enclosing
2843 procedure call when N denotes a function call and appears as an
2844 actual parameter in the procedure call.
2846 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2848 * freeze.adb (Check_Component_Storage_Order): If there is a clause
2849 for the component, also reject the attribute if the component
2850 doesn't end on a byte boundary and its scalar storage order is
2851 different from that of the enclosing record type.
2853 2017-04-28 Javier Miranda <miranda@adacore.com>
2855 * atree.ads (Info_Messages): Removed.
2856 (Warning_Info_Messages): New counter.
2857 (Report_Info_Messages): New counter.
2858 * err_vars.ads Update documentation.
2859 * errout.adb (Delete_Warning_And_Continuations): Update
2860 Info_Message occurrences.
2861 (Error_Msg_Internal): Update Info_Message occurrences.
2862 (Delete_Warning): Update Info_Message occurrences.
2863 (Write_Error_Summary): Update Info_Message occurrences.
2864 (Output_Messages): Update Info_Message occurrences.
2865 (To_Be_Removed): Update Info_Message occurrences.
2866 (Reset_Warnings): Update Info_Message occurrences.
2867 * errutil.adb (Error_Msg): Update Info_Message occurrences.
2868 (Finalize): Update Info_Message occurrences.
2869 (Initialize): Update Info_Message occurrences.
2870 * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
2871 (Compilation_Errors): Update Info_Message_Occurences.
2873 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2875 * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
2876 * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
2877 * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
2878 * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
2879 * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
2880 * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
2882 * sem_eval.adb (Why_Not_Static): Initialize Typ.
2883 * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
2885 2017-04-28 Bob Duff <duff@adacore.com>
2887 * sem_util.ads, sem_util.adb (Might_Raise): New function
2888 that replaces Is_Exception_Safe, but has the opposite
2889 sense. Is_Exception_Safe was missing various cases -- calls inside
2890 a pragma Debug, calls inside an 'if' or assignment statement,
2891 etc. Might_Raise now walks the entire subtree looking for things
2893 * exp_ch9.adb (Is_Exception_Safe): Remove.
2894 (Build_Protected_Subprogram_Body): Replace call to
2895 Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
2896 constants where possible).
2897 * exp_ch7.adb: Rename Is_Protected_Body -->
2898 Is_Protected_Subp_Body. A protected_body is something different
2901 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2903 * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
2904 * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
2905 (P_Discrete_Choice_List): Initialize Expr_Node variable.
2906 * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
2907 (P_Protected): Likewise.
2908 * sem_case.adb (Check_Duplicates):
2909 Add pragma Warnings on variable.
2910 * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
2911 * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable.
2912 * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
2913 (Analyze_Exit_Statement): Initialize Scope_Id variable.
2914 (Analyze_Iterator_Specification): Initialize Bas variable.
2915 * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
2916 Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
2917 (Analyze_Accept_Statement): Initialize Task_Nam.
2919 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2921 * checks.adb (Install_Primitive_Elaboration_Check):
2922 Do not generate an elaboration check if all checks have been
2925 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2927 * sem_ch13.adb (Analyze_Aspect_Specifications, case
2928 Interrupt_Handler and Attach_Handler): Generate reference
2929 to protected operation to prevent spurious warnings about
2930 unreferenced entities. Previous scheme failed with style checks
2933 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2935 * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
2936 that follows an expression function must not be relocated to
2937 the generated body, because it applies to the code that follows.
2939 2017-04-28 Gary Dismukes <dismukes@adacore.com>
2941 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
2942 Relaxed_RM_Semantics to avoid having CodePeer issue errors on
2943 code that might violate the more stringent checking for 'Access
2944 introduced in Ada 2005.
2946 2017-04-28 Arnaud Charlet <charlet@adacore.com>
2948 * a-cforse.adb: minor style fix in comment.
2950 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2952 * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
2953 initialize Block_Decls variable.
2954 (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
2955 (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
2956 * exp_disp.adb (Expand_Interface_Actuals): Initialize
2957 Formal_DDT and Actual_DDT variables.
2958 (Expand_Interface_Thunk): Initialize Iface_Formal.
2959 (Make_DT): Initialize Size_Comp.
2960 (Make_Select_Specific_Data_Table): Initialize Decls.
2961 * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
2962 Also initialize more RPC_Receiver_* variables.
2963 (Build_To_Any_Function): Initialize Cstr_Formal.
2964 * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
2966 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2968 * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
2969 node between access types, freeze the designated type as well,
2970 so that dispatch table pointers are created in the proper scope,
2971 and not in the constructed body of the expression function.
2973 2017-04-28 Bob Duff <duff@adacore.com>
2975 * alloc.ads (Nodes_Initial): Go back to previous value. The large
2976 value makes large compilations faster, but small compilations slower.
2978 2017-04-28 Arnaud Charlet <charlet@adacore.com>
2980 * sem_util.adb: minor typos in Is_Child_Or_Sibling.
2982 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2984 * erroutc.adb (Compilation_Errors): Do not consider info messages
2985 as suitable warnings when warnings must be treated as errors.
2986 * sem_ch7.adb (Analyze_Package_Specification): Do not consider
2987 internally-generated packages when outputting completion
2989 * errout.adb (Output_Messages): Do not consider info messages as
2990 suitable warnings when warnings must be treated as errors.
2991 * errutil.adb (Finalize): Do not consider info messages as
2992 suitable warnings when warnings must be treated as errors.
2994 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2996 * warnsw.ads: Minor fix for incorrect wording in comment.
2998 2017-04-28 Ed Schonberg <schonberg@adacore.com>
3000 * sem_res.adb (In_Instance_Code): New predicate in
3001 Valid_Conversion, to determine whether a type conversion appears
3002 as (or within) an actual for a formal object. Type conversions
3003 in instances are not rechecked in Valid_Conversion because
3004 visibility changes between generic location andi instance may
3005 lead to spurious errors, but conversions within an actual must be
3006 fully checked, and they are not fully resolved when pre-analyzing
3009 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3011 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
3012 New_Copy_Tree instead of Relocate_Node as any subsequent copies
3013 of the relocated node will have mangled Parent pointers.
3014 * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
3015 tables used in conjunction with entity and itype replication.
3016 (Visit_Entity): Rewrite the restriction on which entities
3017 require duplication. The restriction now includes all types.
3019 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3021 * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
3022 a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
3023 a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
3026 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3028 * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
3029 gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
3031 2017-04-28 Gary Dismukes <dismukes@adacore.com>
3033 * exp_util.adb: Minor reformatting.
3035 2017-04-28 Ed Schonberg <schonberg@adacore.com>
3037 * sem_ch4.adb: Fix copy/pasto.
3039 2017-04-27 Tristan Gingold <gingold@adacore.com>
3041 * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
3042 raise-gcc.c. Fix include search path for raise-gcc.c
3044 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3046 * fe.h (Warn_On_Questionable_Layout): Declare.
3047 * warnsw.ads (Warn_On_Record_Holes): Move down.
3048 (Warn_On_Questionable_Layout): New boolean variable.
3049 (Warning_Record): Add Warn_On_Questionable_Layout field.
3050 * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
3051 (Restore_Warnings): Likewise.
3052 (Save_Warnings): Likewise.
3053 (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
3054 * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
3055 components_to_record.
3056 (gnu_field_to_gnat): New function.
3057 (warn_on_field_placement): Likewise.
3058 (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
3059 parameters. Rename local variables and adjust recursive call.
3060 Rework final scan of the field list and implement warnings on the
3061 problematic placement of specific sorts of fields.
3063 2017-04-27 Bob Duff <duff@adacore.com>
3065 * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
3066 * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
3067 * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
3068 * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
3069 * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
3070 * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
3071 For efficiency, cache results of Is_Internal_File_Name and
3072 Is_Predefined_File_Name in the Units table. This avoids a lot
3073 of repeated text processing.
3075 2017-04-27 Emmanuel Briot <briot@adacore.com>
3077 * g-comlin.adb (Sort_Sections): remove useless test.
3079 2017-04-27 Claire Dross <dross@adacore.com>
3081 * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
3082 allow the use of regular equality over elements in contracts.
3083 (Formal_Model): Ghost package containing model functions that are
3084 used in subprogram contracts.
3085 (Current_To_Last): Removed, model functions should be used instead.
3086 (First_To_Previous): Removed, model functions should be used instead.
3087 (Strict_Equal): Removed, model functions should be used instead.
3088 (No_Overlap): Removed, model functions should be used instead.
3089 (Equivalent_Keys): Functions over cursors are removed. They were
3090 awkward with explicit container parameters.
3091 * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
3092 allow the use of regular equality over elements in contracts.
3093 (Formal_Model): Ghost package containing model functions that
3094 are used in subprogram contracts.
3095 (Current_To_Last): Removed, model functions should be used instead.
3096 (First_To_Previous): Removed, model functions should be used instead.
3097 (Strict_Equal): Removed, model functions should be used instead.
3098 (No_Overlap): Removed, model functions should be used instead.
3100 2017-04-27 Yannick Moy <moy@adacore.com>
3102 * gnat1drv.adb: Code cleanup.
3104 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3106 * exp_util.adb (Replace_Entity): The prefix of a 'Result
3107 attribute reference in a post- condition is the subprogram to
3108 which the condition applies. If the condition is inherited
3109 by a type extension, the prefix becomes a reference to the
3110 inherited operation, but there is no need to create a wrapper
3111 for this operation, because 'Result is expanded independently
3112 when elaborating the postconditions.
3114 2017-04-27 Bob Duff <duff@adacore.com>
3116 * sinput.adb: Minor code cleanup.
3117 * namet.adb (Append): Create faster versions of
3118 Append(String) and Append(Name_Id) by using slice assignment
3120 * sem_util.adb (In_Instance): Speed this up by removing
3121 unnecessary tests; Is_Generic_Instance is defined for all
3123 * sem_util.ads, sem_util.adb (In_Parameter_Specification):
3124 Remove unused function.
3125 * alloc.ads (Nodes_Initial): Use a much larger value, because
3126 the compiler was spending a lot of time copying the nodes table
3127 when it grows. This number was chosen in 1996, so is rather out
3128 of date with current memory sizes. Anyway, it's virtual memory.
3129 Get rid of Orig_Nodes_...; use Node_... instead.
3130 * atree.adb (Lock): Do not release the Nodes tables; it's a
3132 Orig_Nodes_ ==> Nodes_
3133 * nlists.adb: Orig_Nodes_ ==> Nodes_
3134 * g-table.adb: Remove unused "with" clause.
3135 * g-table.ads, table.ads: Remove Big_Table_Type, which should
3136 not be used by clients.
3137 * g-dyntab.adb (Last_Allocated): New function
3138 to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
3140 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3142 * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
3144 (Subtypes_Statically_Match): Remove duplicate check.
3145 * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
3147 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3149 * exp_aggr.adb (Replace_Type): Remove the special processing
3150 for selected components.
3151 * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
3152 processing for attributes Fixed_Value and Integer_Value.
3153 * exp_util.adb (Side_Effect_Free): Merge the processing for
3154 qualified expressions, type conversions, and unchecked type
3156 * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
3158 * par-ch3.adb (P_Declarative_Items): Merge the processing for
3159 tokens function, not, overriding, and procedure.
3160 * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
3161 for qualified expressions, type conversions, and unchecked
3163 * sem_util.adb (Compile_Time_Constraint_Error): Merge the
3164 processing for Ada 83 and instances.
3165 (Object_Access_Level): Merge the processing for indexed components
3166 and selected components.
3167 * uname.adb (Add_Node_Name): Merge the processing for stubs.
3169 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3171 * checks.adb (Install_Primitive_Elaboration_Check):
3172 Do not generate the check when restriction No_Elaboration_Code
3175 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3177 * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
3178 of Expand_Dispatching_Call. If the denoted subprogram has a
3179 class-wide precondition, this is the only precondition that
3180 applies to the call, rather that the class-wide preconditions
3181 that may apply to the body that is executed. (This is specified
3184 2017-04-27 Yannick Moy <moy@adacore.com>
3186 * gnat1drv.adb (Adjust_Global_Switches): Issue
3187 a warning in GNATprove mode if the runtime library does not
3188 support IEEE-754 floats.
3190 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3192 * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
3193 is itself inherited it does not carry any contract information,
3194 so examine its parent operation which is its Alias.
3196 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3198 * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
3199 prefix can be an object reference in which case Obj'Image (X)
3200 can only be interpreted as an indexing of the parameterless
3201 version of the attribute.
3202 * par-ch4.adb (P_Name): An attribute reference can be the prefix of
3203 an indexing or a slice operation if the attribute does not require
3204 parameters. In Ada2012 'Image also belongs in this category,
3205 and A'Image (lo .. hi) is legal and must be parsed as a slice.
3207 2017-04-27 Yannick Moy <moy@adacore.com>
3209 * exp_ch4.adb: Minor reformatting.
3210 * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
3211 disable the CodePeer and C generation modes. Similar to the
3212 opposite actions done in CodePeer mode.
3214 2017-04-27 Yannick Moy <moy@adacore.com>
3216 * sem_res.adb: Remove duplicate code.
3217 * sem_attr.adb: Delete duplicate code.
3219 2017-04-27 Bob Duff <duff@adacore.com>
3221 * g-dyntab.adb: Reduce the amount of copying in
3222 Release. No need to copy items past Last.
3224 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3226 * checks.adb Add with and use clauses for Sem_Disp.
3227 (Install_Primitive_Elaboration_Check): New routine.
3228 * checks.ads (Install_Primitive_Elaboration_Check): New routine.
3229 * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
3230 processing of 'Elaborated.
3231 * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
3234 2017-04-27 Bob Duff <duff@adacore.com>
3236 * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
3237 If the table grows and then shrinks back to empty, we won't necessarily
3238 point back to the empty array. Code cleanups.
3239 * sinput.ads: Add 'Base to Size clause to match the declared
3242 2017-04-27 Claire Dross <dross@adacore.com>
3244 * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
3245 allow the use of regular equality over elements in contracts.
3246 (Formal_Model): Ghost package containing model functions that
3247 are used in subprogram contracts.
3248 (Current_To_Last): Removed, model functions should be used instead.
3249 (First_To_Previous): Removed, model functions should be used instead.
3250 (Strict_Equal): Removed, model functions should be used instead.
3251 (No_Overlap): Removed, model functions should be used instead.
3252 * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
3253 Boolean generic parameter to disable contracts for equivalence
3255 (Witness): Create a witness of a key that is used for handling of
3256 equivalence between keys.
3257 (Has_Witness): Check whether a witness is contained in a map.
3258 (W_Get): Get the element associated to a witness.
3259 (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
3261 * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
3262 Boolean generic parameter to disable contracts for equivalence
3264 * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
3265 of equivalence on functional maps.
3266 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
3267 of equivalence on functional maps.
3269 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3271 * exp_ch9.adb (Expand_Entry_Barrier): Code
3272 cleanup. Do not perform the optimization which removes the
3273 declarations of the discriminant and component renamings when
3274 validity checks on operands and attributes are in effect.
3276 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3278 * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
3279 freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
3280 a-cfhama.ads, a-cofove.ads: Minor reformatting.
3282 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3284 * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
3285 pointer dereference.
3286 * g-spipat.adb (Dump): Code clean up. Protect against a possible
3287 null pointer dereference.
3289 2017-04-27 Bob Duff <duff@adacore.com>
3291 * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
3292 Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
3293 Free renames Init, since they do the same thing.
3294 * g-table.ads: Default for Table_Low_Bound.
3295 * table.ads: Default for Table_Low_Bound, Table_Initial, and
3298 2017-04-27 Bob Duff <duff@adacore.com>
3300 * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
3302 * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
3303 * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
3304 Reorder code so that above assertions do not fail.
3305 * table.ads: Remove obsolete comment on Locked.
3307 2017-04-27 Claire Dross <dross@adacore.com>
3309 * a-cfdlli.ads: Code cleanup.
3311 2017-04-27 Yannick Moy <moy@adacore.com>
3313 * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
3314 when needed for proof. (Expand_SPARK): Call the new procedure.
3315 * exp_util.ads Fix typo.
3317 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3319 * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
3322 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3324 * sem_elab.adb Add new type Visited_Element
3325 and update the contents of table Elab_Visited. Various code clean up.
3326 (Check_Elab_Call): Determine whether a prior call to
3327 the same subprogram was already examined within the same context.
3328 (Check_Internal_Call_Continue): Register the subprogram being
3329 called as examined within a particular context. Do not suppress
3330 elaboration warnings.
3332 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3334 * xoscons.adb, osint.ads: Minor reformatting.
3336 2017-04-27 Bob Duff <duff@adacore.com>
3338 * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
3339 Table_Count_Type --> Table_Last_Type, because the name
3340 was confusing (a "count" usually starts at zero). Add
3341 functionality supported or needed by other tables packages
3342 (Move, Release_Threshold).
3343 * g-table.ads, g-table.adb: This is now just a thin wrapper
3344 around g-dyntab.ads/g-dyntab.adb. Add functionality supported
3345 or needed by other tables packages (Save, Restore).
3346 * table.ads, table.adb: This is now just a thin wrapper around
3347 * g-table.ads/g-table.adb.
3348 * namet.h, scos.h, uintp.h: These files are reaching into the
3349 private data of some instances of g-table, whose names changed,
3350 so the above change requires some adjustment here. It now uses
3353 2017-04-27 Bob Duff <duff@adacore.com>
3355 * namet.adb, namet.ads: Minor: remove unused procedures.
3357 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3359 * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
3360 (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
3361 Add pragma Warnings on Rtype variable in nested block. *
3362 * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
3363 * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
3364 (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
3365 * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
3366 (Process_Component_List_For_Finalize): Initialize Counter_Id.
3367 (Build_Finalize_Statements): Initialize Bod_Stmts.
3368 * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
3370 2017-04-27 Claire Dross <dross@adacore.com>
3372 * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
3373 allow the use of regular equality over elements in contracts.
3374 (Formal_Model): Ghost package containing model functions that are
3375 used in subprogram contracts.
3376 (Current_To_Last): Removed, model
3377 functions should be used instead.
3378 (First_To_Previous): Removed, model functions should be used instead.
3379 (Strict_Equal): Removed, model functions should be used instead.
3380 (No_Overlap): Removed, model functions should be used instead.
3381 (Equivalent_Keys): Functions over cursors are removed. They were
3382 awkward with explicit container parameters.
3383 * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
3384 (proof only) procedure to help GNATprove when equivalence over
3385 keys is not equality.
3387 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3389 * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
3390 sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
3391 Minor reformatting and code cleanups.
3393 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3395 * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
3396 subsidiary of Check_Inherited_Conditions, to build pragmas for an
3397 operation whose ancestor has classwide pre/postconditions. This
3398 is used both to check the legality of the inheritance in Ada
3399 and in SPARK, and to determine whether a wrapper is needed for
3400 an inherited operation.
3401 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
3402 Improve placement of error message for inherited classwide
3403 conditions that become illegal on type derivation.
3405 2017-04-27 Yannick Moy <moy@adacore.com>
3407 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
3408 SPARK_Mode from context on generic package.
3409 * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
3412 2017-04-27 Claire Dross <dross@adacore.com>
3414 * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
3415 overflows in computations.
3416 * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
3417 overflows in computations.
3418 (Insert): Rewrite precondition to avoid overflows in computations.
3419 * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
3420 overflows in computations.
3421 (Insert): Rewrite precondition to avoid overflows in computations.
3423 2017-04-27 Steve Baird <baird@adacore.com>
3425 * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
3426 flag when it is declared in order to avoid confusing CodePeer about
3427 the possibility of an uninitialized variable read.
3429 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3431 * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
3432 no dimensionality error if the subtype of the expression is
3433 identical to the nominal subtype in the declaration, even though
3434 the expression itself may have been constant-folded and lack a
3436 * sem_dim.ads: Add comments on setting of dimension vectors and
3437 its interaction with node rewritings and side-effect removal.
3439 2017-04-27 Bob Duff <duff@adacore.com>
3441 * debug.adb: Minor comment correction.
3442 * sem_dim.ads: Minor reformatting and typo fixes.
3444 2017-04-27 Bob Duff <duff@adacore.com>
3446 * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
3447 Last of the tables via function calls, rather than relying on layout
3450 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3452 * exp_util.adb: No wrapper in GNATprove mode.
3454 2017-04-27 Yannick Moy <moy@adacore.com>
3456 * sem_res.adb (Resolve_Comparison_Op): Always
3457 evaluate comparisons between values of universal types.
3459 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3461 * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
3462 an elaboration counter nor a check when in GNATprove mode.
3463 * sem_util.adb (Build_Elaboration_Entity): Do not create an
3464 elaboration counter when in GNATprove mode.
3466 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3468 * freeze.adb: copy-paste typo.
3470 2017-04-27 Yannick Moy <moy@adacore.com>
3472 * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
3473 Use correct test to detect call in GNATprove mode instead of
3476 2017-04-27 Claire Dross <dross@adacore.com>
3478 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
3479 New property function expressing that the element of a
3480 sequence are contained in the union of two sequences.
3481 (Formal_Model.M_Elements_Included): New property function
3482 expressing that the element of a sequence are another sequence.
3483 (Generic_Sorting): Use new property functions to state that
3484 elements are preserved by Sort and Merge.
3485 * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
3486 allow the use of regular equality over elements in contracts.
3487 (Formal_Model): Ghost package containing model functions
3488 that are used in subprogram contracts. (Capacity):
3489 On unbounded containers, return the maximal capacity.
3490 (Current_To_Last): Removed, model functions should be used instead.
3491 (First_To_Previous): Removed, model functions should be used instead.
3492 (Append): Default parameter value replaced
3493 by new wrapper to allow more precise contracts.
3494 (Insert): Subprogram restored, it seems it was useful to users even if
3496 (Delete): Subprogram restored, it seems it was useful to users even if
3498 (Prepend): Subprogram restored, it seems it was useful to users even
3499 if it is inefficient.
3500 (Delete_First): Subprogram restored, it seems it
3501 was useful to users even if it is inefficient. (Delete_Last):
3502 Default parameter value replaced by new wrapper to allow more
3504 (Generic_Sorting.Merge): Subprogram restored.
3505 * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
3506 allow the use of regular equality over elements in contracts.
3507 (Formal_Model): Ghost package containing model functions
3508 that are used in subprogram contracts. (Capacity):
3509 On unbounded containers, return the maximal capacity.
3510 (Current_To_Last): Removed, model functions should be used
3512 (First_To_Previous): Removed, model functions should be used instead.
3513 (Append): Default parameter value replaced
3514 by new wrapper to allow more precise contracts.
3515 (Insert): Subprogram restored, it seems it was useful to users even if
3517 (Delete): Subprogram restored, it seems it was useful to users even if
3519 (Prepend): Subprogram restored, it seems it was useful to users even
3520 if it is inefficient.
3521 (Delete_First): Subprogram restored, it seems it
3522 was useful to users even if it is inefficient. (Delete_Last):
3523 Default parameter value replaced by new wrapper to allow more
3525 (Generic_Sorting.Merge): Subprogram restored.
3526 (Vector): Do not reuse formal vectors, as it is no longer possible
3527 to supply them with an equality function over elements.
3529 2017-04-27 Bob Duff <duff@adacore.com>
3531 * g-dyntab.adb (Release): When allocating the new
3532 table, use the correct slice of the old table to initialize it.
3534 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3536 * einfo.ads: Minor fixes in comments.
3538 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3540 * sem_prag.adb: disable clones in SPARK_Mode.
3542 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3544 * sem_util.ads, contracts.adb: Minor reformatting.
3546 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3548 * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
3549 Build body of subprogram that has a class-wide condition that
3550 contains calls to other primitives.
3551 (Build_Class_Wide_Clone_Call); Build a call to the common
3552 class-wide clone of a subprogram with classwide conditions. The
3553 body of the subprogram becomes a wrapper for a call to the
3554 clone. The inherited operation becomes a similar wrapper to which
3555 modified conditions apply, and the call to the clone includes
3556 the proper conversion in a call the parent operation.
3557 (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
3558 subprogram that has a classwide condition that contains calls to
3559 other primitives, build an internal subprogram that is invoked
3560 through a type-specific wrapper for all inherited subprograms
3561 that may have a modified condition.
3562 * sem_prag.adb (Check_References): If subprogram has a classwide
3563 condition, create entity for corresponding clone, to be invoked
3564 through wrapper subprograns.
3565 (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
3566 message about placement if pragma isi internally generated.
3567 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
3568 a classwide clone, build body of clone as copy of original body,
3569 and rewrite original body as a wrapper as a wrapper for a call to
3570 the clone, so that it incorporates the original pre/postconditions
3572 * freeze.adb (Check_Inherited_Conditions): For an inherited
3573 subprogram that inherits a classwide condition, build spec and
3574 body of corresponding wrapper so that call to inherited operation
3575 gets the modified conditions.
3576 * contracts.adb (Analyze_Contracts): If analysis of classwide
3577 condition has created a clone for a primitive operation, analyze
3578 declaration of clone.
3580 2017-04-27 Steve Baird <baird@adacore.com>
3582 * exp_util.adb (Build_Allocate_Deallocate_Proc):
3583 Add "Suppress => All_Checks" to avoid generating unnecessary
3586 2017-04-27 Yannick Moy <moy@adacore.com>
3588 * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
3589 * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
3590 inlining body in GNATprove mode when switch -gnatdm used.
3591 * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
3592 in GNATprove mode when switch -gnatdm used.
3594 2017-04-27 Arnaud Charlet <charlet@adacore.com>
3596 * sem_ch13.adb (Analyze_Attribute_Definition_Clause
3597 [Attribute_Address]): Call Set_Address_Taken when ignoring rep
3598 clauses, so that we keep an indication of the address clause
3599 before removing it from the tree.
3601 2017-04-27 Yannick Moy <moy@adacore.com>
3603 * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
3604 of expression being qualified, when not an object name, or else
3605 evaluate the underlying name.
3607 2017-04-27 Jerome Lambourg <lambourg@adacore.com>
3609 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
3611 2017-04-27 Justin Squirek <squirek@adacore.com>
3613 * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
3614 Process_Component_List_For_Finalization as a local variable.
3615 (Process_Component_For_Finalize): Add an extra parameter to avoid
3617 (Process_Component_List_For_Finalization): Correct calls to
3618 Process_Component_For_Finalize to take Num_Comps as a parameter.
3620 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3622 * sem_ch8.adb (Find_Direct_Name): Account for the case where
3623 a use-visible entity is defined within a nested scope of an
3624 instance when giving priority to entities which were visible in
3625 the original generic.
3626 * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
3628 2017-04-27 Tristan Gingold <gingold@adacore.com>
3630 * raise-gcc.c: Don't use unwind.h while compiling
3631 for the frontend, but mimic host behavior.
3633 2017-04-27 Javier Miranda <miranda@adacore.com>
3635 * sem_ch3.adb (Build_Discriminated_Subtype):
3636 Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
3638 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3640 * sem_prag.adb (Analyze_Global_Item):
3641 Do not consider discriminants because they are not "entire
3642 objects". Remove the discriminant-related checks because they are
3644 (Analyze_Input_Output): Do not consider discriminants
3645 because they are not "entire objects".
3647 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3649 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
3650 perform check if the current scope does not come from source,
3651 as is the case for a rewritten task body, because check has
3652 been performed already, and may not be doable because of changed
3655 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3657 * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
3658 a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
3661 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3663 * sem_ch4.adb (Analyze_Call): If the return type of a function
3664 is incomplete in an context in which the full view is available,
3665 replace the type of the call by the full view, to prevent spurious
3667 * exp_disp.adb (Check_Premature_Freezing): Disable check on an
3668 abstract subprogram so that compiler does not reject a parameter
3669 of a primitive operation of a tagged type being frozen, when
3670 the untagged type of that parameter cannot be frozen.
3672 2017-04-27 Bob Duff <duff@adacore.com>
3674 * sem_attr.adb (Compute_Type_Key): Don't walk
3675 representation items for irrelevant types, which could be in a
3676 different source file.
3678 2017-04-27 Steve Baird <baird@adacore.com>
3680 * exp_attr.adb (Expand_N_Attribute_Reference):
3681 Don't expand Image, Wide_Image, Wide_Wide_Image attributes
3684 2017-04-27 Yannick Moy <moy@adacore.com>
3686 * exp_unst.ads: Fix typos in comments.
3688 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3690 * sem_eval.adb (Choice_Matches): Handle properly a real literal
3691 whose type has a defined static predicate.
3693 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3695 * exp_ch4.adb (Insert_Dereference_Action):
3696 Do not adjust the address of a controlled object when the
3697 associated access type is subject to pragma No_Heap_Finalization.
3700 2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
3702 * gcc-interface/utils.c (gnat_type_for_size): Set
3703 TYPE_ARTIFICIAL on created types.
3705 2017-04-27 Claire Dross <dross@adacore.com>
3707 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
3708 modifications in functional containers.
3709 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
3710 to improve readablity. Subprograms are separated between basic
3711 operations, constructors and properties. Universally quantified
3712 formulas in contracts are factorized in independant functions
3713 with a name and a comment. Names of parameters are improved.
3715 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3717 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
3719 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3721 * sem_res.adb (Resolve_Type_Conversion): Do not
3722 install a predicate check here since this is already done during
3723 the expansion phase. Verify whether the operand satisfies the
3724 static predicate (if any) of the target type.
3725 * sem_ch3.adb (Analyze_Object_Declaration): Do
3726 not install a predicate check if the object is initialized by
3727 means of a type conversion because the conversion is subjected
3730 2017-04-27 Tristan Gingold <gingold@adacore.com>
3732 * raise.c (__gnat_builtin_longjmp): Remove.
3733 (__gnat_bracktrace):
3734 Add a dummy definition for the compiler (__gnat_eh_personality,
3735 __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
3736 __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
3737 __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
3738 * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
3739 * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
3740 and a-except-2005.adb.
3741 * raise-gcc.c: Allow build in compiler, compiled as a C++
3743 (__gnat_Unwind_ForcedUnwind): Adjust prototype.
3744 (db): Constify msg_format.
3745 (get_call_site_action_for): Don't use void arithmetic.
3746 * system.ads (Frontend_Exceptions): Set to False.
3747 (ZCX_By_Default): Set to True.
3748 (GCC_ZC_Support): Set to True.
3749 * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
3751 * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
3752 in gnat1 and gnatbind.
3753 * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
3754 s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
3755 * s-excmac.ads, s-excmac.adb: Copy of variants.
3756 * a-except.o: Adjust preequisites.
3757 Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
3759 2017-04-27 Claire Dross <dross@adacore.com>
3761 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
3762 modifications in functional containers.
3763 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
3764 to improve readablity. Subprograms are separated between basic
3765 operations, constructors and properties. Universally quantified
3766 formulas in contracts are factorized in independant functions
3767 with a name and a comment. Names of parameters are improved.
3769 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3771 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
3773 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3775 * sem_res.adb (Resolve_Type_Conversion): Do not
3776 install a predicate check here since this is already done during
3777 the expansion phase. Verify whether the operand satisfies the
3778 static predicate (if any) of the target type.
3779 * sem_ch3.adb (Analyze_Object_Declaration): Do
3780 not install a predicate check if the object is initialized by
3781 means of a type conversion because the conversion is subjected
3784 2017-04-27 Tristan Gingold <gingold@adacore.com>
3786 * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
3787 replaced by their variants).
3789 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3791 * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
3792 cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
3793 a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
3795 2017-04-27 Tristan Gingold <gingold@adacore.com>
3797 * s-excmac-gcc.ads, s-excmac-gcc.adb,
3798 s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
3801 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3803 * exp_ch7.adb (Establish_Transient_Scope): Rewrite
3804 the loop which detects potential enclosing transient scopes. The
3805 loop now terminates much earlier as transient scopes are bounded
3806 by packages and subprograms.
3808 2017-04-27 Claire Dross <dross@adacore.com>
3810 * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
3811 allow the use of regular equality over elements in contracts.
3812 (Cursor): Type is now public so that it can be used in
3814 (Formal_Model): Ghost package containing
3815 model functions that are used in subprogram contracts.
3816 (Current_To_Last): Removed, model functions should be used
3818 (First_To_Previous): Removed, model functions should
3820 (Strict_Equal): Removed, model functions
3821 should be used instead.
3822 (Append): Default parameter value
3823 replaced by new wrapper to allow more precise contracts.
3824 (Insert): Default parameter value replaced by new wrapper to
3825 allow more precise contracts.
3826 (Delete): Default parameter
3827 value replaced by new wrapper to allow more precise contracts.
3828 (Prepend): Default parameter value replaced by new wrapper to
3829 allow more precise contracts.
3830 (Delete_First): Default parameter
3831 value replaced by new wrapper to allow more precise contracts.
3832 (Delete_Last): Default parameter value replaced by new wrapper
3833 to allow more precise contracts.
3835 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3837 * exp_spark.adb (Expand_SPARK): Perform specialized expansion
3838 for object declarations.
3839 (Expand_SPARK_N_Object_Declaration): New routine.
3840 * sem_elab.adb (Check_A_Call): Include calls to the
3841 Default_Initial_Condition procedure of a type under the SPARK
3842 elaboration checks umbrella.
3844 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3846 * sem.adb (Analyze): Diagnose an illegal iterated component
3848 * sem_util.ads, sem_util.adb
3849 (Diagnose_Iterated_Component_Association): New routine.
3851 2017-04-27 Bob Duff <duff@adacore.com>
3853 * adaint.c (__gnat_get_current_dir): Return 0 in length if
3855 * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
3856 exception if getcwd failed.
3858 2017-04-27 Yannick Moy <moy@adacore.com>
3860 * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
3861 entities with special prefix.
3863 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3865 * debug.adb Change the documentation of switch -gnatd.s.
3866 * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
3867 to manage the secondary stack when an enclosing scope already
3868 performs this functionality (aka relaxed management). Switch
3869 -gnatd.s may be used to force strict management in which case
3870 the block will manage the secondary stack unconditionally. Add
3871 a guard to stop the traversal when encountering a package or a
3874 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3876 * sem_res.adb (Resolve_Call): Refine further the handling of
3877 limited views of return types in function calls. If the function
3878 that returns a limited view appears in the current unit,
3879 we do not replace its type by the non-limited view because
3880 this transformation is performed int the back-end. However,
3881 the type of the call itself must be the non-limited view, to
3882 prevent spurious resolution errors.
3884 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3886 * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
3887 Removed, proposed implementation using generics for class-wide
3888 preconditions proved impractical.
3889 (Class_Wide_Clone): New attribute of subprogram. Designates
3890 subprogram created for primitive operations with class-wide
3891 pre/postconditions that contain calls to other primitives. The
3892 clone holds the body of the original primitive, but the
3893 pre/postonditions do not apply to it. The original body is
3894 rewritten as a wrapper for a call to the clone.
3895 (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
3896 the flag is set, no code for the corresponding pre/postconditions
3897 is inserted into its body.
3899 2017-04-27 Bob Duff <duff@adacore.com>
3901 * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
3902 Scalar_Storage_Order if -gnatI is given.
3903 * sem_prag.adb (Analyze_Pragma): Ignore
3904 Default_Scalar_Storage_Order if -gnatI is given.
3906 2017-04-27 Claire Dross <dross@adacore.com>
3908 * a-cofuba.ads (Add): Take as an additional input parameter
3909 the position where the element should be inserted.
3910 (Remove): New function that removes an element from the container.
3911 * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
3912 * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
3913 (Remove): New function that removes an element from a set.
3914 * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
3915 (Remove): New function that removes an element from a sequence.
3916 (Insert): New function that adds anywhere in a sequence.
3918 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3920 * checks.adb (Generate_Range_Check): Revert previous change.
3922 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3924 * sem_util.adb: Minor reformatting/rewording.
3926 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3928 * lib-xref.adb (Generate_Reference): The use
3929 of attribute 'Result is not considered a violation of pragma
3932 2017-04-27 Justin Squirek <squirek@adacore.com>
3934 * cstand.adb (Create_Standard): Correctly set
3935 Directly_Designated_Type for Any_Access.
3936 * sem_type.adb (Covers): Minor grammar fixes.
3938 2017-04-27 Bob Duff <duff@adacore.com>
3940 * sem_attr.adb: Minor cleanup.
3942 2017-04-27 Claire Dross <dross@adacore.com>
3944 * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
3945 private child of Ada.Containers used to implement all functional
3947 * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
3948 child of Ada.Containers. It provides functional indefinite unbounded
3949 maps which can be used as high level models for specification
3951 * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
3952 child of Ada.Containers. It provides functional indefinite unbounded
3953 sets which can be used as high level models for specification
3955 * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
3956 child of Ada.Containers. It provides functional indefinite unbounded
3957 vectors which can be used as high level models for specification
3959 * Makefile.rtl: Add new packages.
3960 * impunit.adb: Add new packages.
3962 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3964 * sem_ch4.adb: Minor reformatting.
3966 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3968 * sem_ch12.adb (Analyze_Associations): minor reformatting.
3969 (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
3970 point type actual that has user-defined arithmetic primitives,
3971 when there is a previous actual for a formal package that defines
3972 a fixed-point type with the parent user-defined operator.
3974 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3976 * checks.adb (Generate_Range_Check): Reinstate part of previous change.
3977 * sem_attr.adb (Resolve_Attribute): Generate a range check when
3978 the component type allows range checks.
3980 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3982 * sem_aux.adb (Is_Generic_Formal): Use original node to locate
3983 corresponding declaration, because formal derived types are
3984 rewritten as private extensions.
3986 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3988 * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
3989 dimensions of operands if node has been analyzed already, because
3990 previous analysis and dimension checking will have removed the
3991 dimension information from the operands.
3993 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3995 * debug.adb: Document the use of switch -gnatd.s.
3996 * einfo.ads Update the documentation on attribute
3997 Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
3998 the uses of these attributes from certain entities.
3999 * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
4000 which determines whether the block should continue to manage
4001 the secondary stack.
4002 (Manages_Sec_Stack): New routine.
4004 2017-04-27 Bob Duff <duff@adacore.com>
4006 * atree.ads: Minor edit.
4008 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
4010 * sinfo.ads: Update the section on Ghost mode. Add
4011 a section on SPARK mode. Update the placement of section on
4012 expression functions.
4014 2017-04-27 Bob Duff <duff@adacore.com>
4016 * sinput.adb (Get_Source_File_Index): Don't
4017 assert that S is in the right range in the case where this is
4018 a .dg file under construction.
4020 2017-04-27 Yannick Moy <moy@adacore.com>
4022 * sem_util.adb (Check_Result_And_Post_State):
4023 Handle more precisely each conjunct in expressions formed by
4024 and'ing sub-expressions.
4026 2017-04-27 Gary Dismukes <dismukes@adacore.com>
4028 * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
4030 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4032 * gnat_rm.texi, gnat_ugn.texi,
4033 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4034 doc/gnat_ugn/platform_specific_information.rst,
4035 doc/gnat_ugn/gnat_and_program_execution.rst,
4036 doc/gnat_ugn/gnat_utility_programs.rst,
4037 doc/gnat_ugn/the_gnat_compilation_model.rst,
4038 doc/gnat_rm/implementation_defined_attributes.rst,
4039 doc/gnat_rm/the_gnat_library.rst,
4040 doc/gnat_rm/implementation_defined_pragmas.rst,
4041 doc/gnat_rm/representation_clauses_and_pragmas.rst,
4042 doc/gnat_rm/implementation_of_specific_ada_features.rst,
4043 doc/gnat_rm/implementation_defined_aspects.rst,
4044 doc/gnat_rm/implementation_defined_characteristics.rst: Update
4047 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4049 * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
4050 generating C code on complex case expressions.
4052 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4054 * sem_prag.adb (Analyze_Pragma): Generate a warning instead
4055 of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
4056 * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
4057 Ada_2012 instead of Ada_2005 to be compatible with the above
4059 * bindgen.adb: Silence new warning on pragma Ada_95.
4061 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4063 * checks.adb (Generate_Range_Check): Revert part of previous change.
4065 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4067 * sem_ch4.adb (Try_Container_Indexing): Handle properly a
4068 container indexing operation that appears as a an actual in a
4069 parameter association in a procedure call.
4071 2017-04-25 Olivier Ramonat <ramonat@adacore.com>
4073 * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
4074 Fix spelling mistakes.
4076 2017-04-25 Bob Duff <duff@adacore.com>
4078 * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
4079 * sinput-p.adb: Use regular fat pointers, with bounds checking,
4080 for source buffers. Fix misc obscure bugs.
4081 * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
4082 checking, for source buffers. Modify representation clause for
4083 Source_File_Record as appropriate. Move Source_File_Index_Table
4084 from spec to body, because it is not used outside the body.
4085 Move Set_Source_File_Index_Table into the private part, because
4086 it is used only in the body and in children. Use trickery to
4087 modify the dope in the generic instantiation case. It's ugly,
4088 but not as ugly as the previous method. Fix documentation.
4089 Remove obsolete code.
4090 * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
4091 indexing in source buffers.
4092 * fmap.adb: Avoid conversions from one string type to another.
4093 Remove a use of global name buffer.
4094 * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
4097 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4099 * exp_util.adb, exp_ch4.adb: Minor reformatting.
4101 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4103 * checks.adb: Code clean up in various routines.
4104 (Generate_Range_Check): Do not generate a range check when the
4105 expander is not active or when index/range checks are suppressed
4107 (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
4108 Remove variants that include a Supress parameter. These routines
4109 are never used, and were introduced before the current scope-based
4110 check suppression method.
4112 2017-04-25 Vasiliy Fofanov <fofanov@adacore.com>
4114 * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
4115 code and some subprogram calls that are now noop.
4117 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4119 * exp_ch4.adb (Expand_N_Case_Expression): Take
4120 Minimize_Expression_With_Actions into account when possible.
4122 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4124 * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
4125 (Known_Null): Moved to Sem_Util.
4126 * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
4127 (Known_Null): Moved to Sem_Util.
4128 * sem_util.adb Add new enumeration type Null_Status_Kind.
4129 (Known_Non_Null): Moved from Exp_Util. Most of the logic in
4130 this routine is now carried out by Null_Status.
4131 (Known_Null): Moved from Exp_Util. Most of the logic in this routine
4132 is now carried out by Null_Status.
4133 (Null_Status): New routine.
4134 * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
4135 (Known_Null): Moved from Exp_Util.
4137 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4139 * sem_ch6.adb (Analyze_Expression_Function): Do not report an
4140 error on the return type of an expression function that is a
4141 completion, if the type is derived from a generic formal type.
4143 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4145 * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
4146 conversion are those of the target type.
4148 2017-04-25 Bob Duff <duff@adacore.com>
4150 * a-clrefi.adb: Minor cleanup.
4152 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4154 * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
4156 2017-04-25 Bob Duff <duff@adacore.com>
4158 * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
4159 types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
4160 errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
4161 scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
4162 the Internal_Source buffer. This removes the incorrect call to "="
4163 the customer noticed.
4164 Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
4165 eventually need to eliminate them altogether. Or else get rid
4166 of zero-origin addressing.
4168 2017-04-25 Claire Dross <dross@adacore.com>
4170 * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
4171 function used in GNATprove to know if an expression contains
4172 non-dispatching calls on primitives of a tagged type.
4174 2017-04-25 Bob Duff <duff@adacore.com>
4176 * rtsfind.adb (Initialize): Initialize
4177 First_Implicit_With. Building the compiler with Normalize_Scalars
4178 and validity checking finds this being used as an uninitialized
4181 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4183 * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
4184 Add a warning about SPARK mode management. The routine now
4185 saves and restores both the mode and associated pragma.
4186 (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
4187 SPARK mode management. The routine now saves and restores both
4188 the mode and associated pragma.
4189 (Analyze_Object_Contract):
4190 Add a warning about SPARK mode management. The routine
4191 now saves and restores both the mode and associated pragma.
4192 (Analyze_Package_Body_Contract): Add a warning about SPARK mode
4193 management. The routine now saves and restores both the mode
4194 and associated pragma. (Analyze_Package_Contract): Add a warning
4195 about SPARK mode management. The routine now saves and restores
4196 both the mode and associated pragma.
4197 (Analyze_Task_Contract):
4198 Add a warning about SPARK mode management. The routine now saves
4199 and restores both the mode and associated pragma.
4200 * expander.adb (Expand): Change the way the Ghost mode is saved
4202 * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
4204 * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
4206 * exp_util.adb (Build_DIC_Procedure_Body):
4207 Change the way the Ghost mode is saved and restored.
4208 (Build_DIC_Procedure_Declaration): Change the way the Ghost
4209 mode is saved and restored.
4210 (Build_Invariant_Procedure_Body):
4211 Change the way the Ghost mode is saved and restored.
4212 (Build_Invariant_Procedure_Declaration): Change the way the Ghost
4213 mode is saved and restored.
4214 (Make_Predicate_Call): Change the
4215 way the Ghost mode is saved and restored.
4216 * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
4218 * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4220 (Mark_And_Set_Ghost_Body): Remove parameter
4221 Mode and its assignment.
4222 (Mark_And_Set_Ghost_Completion):
4223 Remove parameter Mode and its assignment.
4224 (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
4226 (Mark_And_Set_Ghost_Instantiation): Remove parameter
4227 Mode and its assignment.
4228 (Mark_And_Set_Ghost_Procedure_Call):
4229 Remove parameter Mode and its assignment.
4231 Remove parameter Mode and its assignment.
4232 * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4233 and update the comment on usage.
4234 (Mark_And_Set_Ghost_Body):
4235 Remove parameter Mode and update the comment on usage.
4236 (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
4237 update the comment on usage.
4238 (Mark_And_Set_Ghost_Declaration):
4239 Remove parameter Mode and update the comment on usage.
4240 (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
4241 update the comment on usage.
4242 (Mark_And_Set_Ghost_Procedure_Call):
4243 Remove parameter Mode and update the comment on usage.
4244 (Set_Ghost_Mode): Remove parameter Mode and update the comment
4246 * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
4248 * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
4249 of obsolete field SPARK_Mode_Pragma.
4250 (Load_Main_Source): Remove
4251 the assignment of obsolete field SPARK_Mode_Pragma.
4252 (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
4253 * lib-writ.adb (Add_Preprocessing_Dependency): Remove
4254 the assignment of obsolete field SPARK_Mode_Pragma.
4255 (Ensure_System_Dependency): Remove the assignment of obsolete
4256 field SPARK_Mode_Pragma.
4257 * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
4258 mode management. Change the way Ghost and SPARK modes are saved
4260 * sem.adb (Analyze): Change the way the Ghost mode is saved
4262 * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
4263 Ghost mode is saved and restored.
4264 (Process_Full_View): Change
4265 the way the Ghost mode is saved and restored.
4266 * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
4267 mode is saved and restored.
4268 * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
4269 mode is saved and restored.
4270 (Analyze_Subprogram_Body_Helper):
4271 Change the way the Ghost mode is saved and restored.
4272 * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
4273 Ghost mode is saved and restored.
4274 * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
4275 management. Save the SPARK mode-related data prior to any changes
4276 to the scope stack and contexts. The mode is then reinstalled
4277 before the subunit is analyzed in order to restore the original
4278 view of the subunit.
4279 * sem_ch12.adb (Analyze_Package_Instantiation): Update the
4280 warning on region management. Change the way the Ghost and
4281 SPARK modes are saved and restored.
4282 (Inline_Instance_Body):
4283 Add a warning about SPARK mode management. Code clean up.
4284 (Analyze_Subprogram_Instantiation): Update the warning on region
4285 management. Change the way the Ghost and SPARK modes are saved
4287 (Instantiate_Package_Body): Update the warning
4288 on region management. Change the way the Ghost and SPARK modes
4289 are saved and restored.
4290 (Instantiate_Subprogram_Body): Update
4291 the warning on region management. Change the way the Ghost and
4292 SPARK modes are saved and restored.
4293 (Set_Instance_Env): Add a
4294 warning about SPARK mode management. Change the way SPARK mode
4295 is saved and restored.
4296 * sem_ch13.adb (Build_Predicate_Functions):
4297 Change the way the Ghost mode is saved and restored.
4298 (Build_Predicate_Function_Declaration): Change the way the Ghost
4299 mode is saved and restored.
4300 * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
4301 mode management. Change the way SPARK mode is saved and restored.
4302 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
4303 Change the way the Ghost mode is saved and restored.
4304 (Analyze_Initial_Condition_In_Decl_Part): Change the way
4305 the Ghost mode is saved and restored.
4307 Change the way the Ghost mode is saved and restored.
4308 (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
4309 Ghost mode is saved and restored.
4310 * sem_util.adb (Install_SPARK_Mode): New routine.
4311 (Restore_SPARK_Mode): New routine.
4312 (Save_SPARK_Mode_And_Set): Removed.
4313 (Set_SPARK_Mode): New routine.
4314 * sem_util.ads (Install_SPARK_Mode): New routine.
4315 (Restore_SPARK_Mode): New routine.
4316 (Save_SPARK_Mode_And_Set): Removed.
4317 (Set_SPARK_Mode): New routine.
4319 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4321 * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
4322 to determine whether a type is declared in a local package that
4323 has not yet been frozen.
4324 * freeze.adb (Freeze_Before): Use new predicate to determine
4325 whether a local package must be installed on the scope stack
4326 in order to evaluate in the proper scope actions generated by
4327 aspect specifications, such as Predicate
4328 * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
4329 using new predicate.
4331 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4333 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
4334 comparisons between non- scalar expressions expressions because
4335 their values cannot be invalidated.
4336 * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
4339 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4341 * par_sco.adb: Minor reformatting.
4343 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4345 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
4346 is a type from an unfrozen local package, install package to
4347 complete the analysis of delayed aspects of the type.
4349 2017-04-25 Tristan Gingold <gingold@adacore.com>
4351 * bingen.adb (System_Version_Control_Used): New variable.
4352 (Resolve_Binder_Options): Set the above variable.
4353 (Gen_Output_File_Ada): Conditionally call Gen_Versions.
4354 (Gen_Elab_Order): Emit blank line before.
4356 2017-04-25 Justin Squirek <squirek@adacore.com>
4358 * sem_cat.adb (Validate_RT_RAT_Component): Added
4359 an extra check to ignore incomplete types.
4361 2017-04-25 Thomas Quinot <quinot@adacore.com>
4363 * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
4364 bogus circuitry for the case where Name is Predicate.
4366 2017-04-25 Thomas Quinot <quinot@adacore.com>
4368 * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
4369 Create SCOs for Predicate aspects in disabled
4370 state initially, to be enabled later on by...
4371 * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
4372 SCO for predicate as enabled.
4374 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4376 * comperr.adb (Compiler_Abort): Remove now obsolete pair of
4377 pragmas Warnings Off / On.
4378 * namet.adb (Finalize): Remove now obsolete pair of pragmas
4380 * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
4381 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
4382 consider comparisons between static expressions because their
4383 values cannot be invalidated.
4384 * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
4386 (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
4387 * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
4389 2017-04-25 Bob Duff <duff@adacore.com>
4391 * sem_elab.adb (In_Task_Activation): Trace internal calls in
4394 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4396 * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
4399 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4401 * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
4402 On/Off to defend against a spurious warning in conditional
4404 * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
4405 * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
4406 defend against a spurious warning in conditional compilation.
4407 * output.adb Add a pair of pragma Warnings On/Off to defend
4408 against a spurious warning in conditional compilation.
4409 * sem_eval.adb (Eval_Relational_Op): Major code clean up.
4410 (Fold_General_Op): New routine.
4411 (Fold_Static_Real_Op): New routine.
4412 (Test_Comparison): New routine.
4413 * sem_eval.ads (Test_Comparison): New routine.
4414 * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
4415 (Warn_On_Constant_Valid_Condition): New routine.
4416 (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
4417 to detect a specific case.
4418 * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
4419 * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
4420 to defend against a spurious warning in conditional compilation.
4421 (Tree_Write): Add a pair of pragma Warnings On/Off to defend
4422 against a spurious warning in conditional compilation.
4423 * usage.adb Add a pair of pragma Warnings On/Off to defend
4424 against a spurious warning in conditional compilation.
4426 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4428 * sinfo.ads, sem_ch13.adb: Update comment.
4430 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4432 * sem_util.adb (Is_Post_State): A reference to a
4433 generic in out parameter is considered a change in the post-state
4436 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4438 * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
4439 declaration of a subprogram instance within its wrapper package,
4440 skip over null statements that may result from the rewriting of
4443 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4445 * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
4446 If the type is an unchecked_union, replace the attribute with
4447 a Raise_Program_Error (rather than inserting such before the
4448 attribute reference) to handle properly the case where we are
4449 processing a component of a larger record, and we need to prevent
4450 further expansion for the unchecked union.
4451 (Expand_Attribute_Reference, case 'Write): If the type is
4452 an unchecked_union, check whether enclosing scope is a Write
4453 subprogram. Replace attribute with a Raise_Program_Error if the
4454 discriminants of the unchecked_union type have not default values
4455 because such a use is erroneous..
4457 2017-04-25 Tristan Gingold <gingold@adacore.com>
4459 * exp_ch9.adb (Expand_N_Task_Type_Declaration):
4460 Add relative_deadline to task record on edf profile.
4461 (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
4462 (Make_Task_Create_Call): Pass relative_deadline value.
4463 * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
4464 * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
4465 (Profile_Info): Add info for GNAT_Ravenscar_EDF.
4466 * sem_prag.adb (Set_Ravenscar_Profile): Handle
4467 GNAT_Ravenscar_EDF (set scheduling policy).
4468 (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
4470 (Sig_Flags): Add choice for Pragma_Deadline_Floor.
4471 * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
4473 (Pragma_Deadline_Floor): New pragma.
4474 * targparm.adb (Get_Target_Parameters): Recognize
4475 GNAT_Ravenscar_EDF profile.
4477 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4479 * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
4481 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4483 * sem_aux.adb (Nearest_Ancestor): Use original node of type
4484 declaration to locate nearest ancestor, because derived
4485 type declarations for record types are rewritten as record
4487 * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
4488 properly derivations that are completions of private types.
4489 (Add_Predicates): If type is private, examine rep. items of full
4490 view, which may include inherited predicates.
4491 (Build_Predicate_Functions): Ditto.
4493 2017-04-25 Javier Miranda <miranda@adacore.com>
4495 * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
4496 to generate new entities for subtype declarations located in
4497 Expression_With_Action nodes.
4499 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4501 * sem_elab.adb (Check_A_Call): Remove
4502 local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
4503 need for Elaborate_All when SPARK elaboration checks are
4504 required. Update the checks for instances, variables, and calls
4505 to Default_Initial_Condition procedures.
4507 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4509 * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
4510 into a boolean aspect, in analogy with the Ada aspect No_Return.
4512 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4514 * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
4516 2017-04-25 Bob Duff <duff@adacore.com>
4518 * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
4519 Is_True_Constant for an array variable that is passed to a
4520 foreign function as an 'in' parameter.
4521 * debug.adb: Document -gnatd.q.
4523 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4525 * sem_ch6.adb (Analyze_Expression_Function): If expression function
4526 is completion and return type is an access type do not freeze
4527 designated type: this will be done in the process of freezing
4528 the expression if needed.
4529 (Freeze_Expr_Types): Check whether type is complete before
4530 creating freeze node, to provide a better error message if
4531 reference is premature.
4532 * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
4533 functions created by type derivations.
4535 2017-04-25 Pascal Obry <obry@adacore.com>
4537 * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
4539 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4541 * sem_res.adb (Resolve_Type_Conversion):
4542 When resolving against any fixed type, set the type of the
4543 operand as universal real when the operand is a multiplication
4544 or a division where both operands are of any fixed type.
4545 (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
4546 placement of an error message by pointing to the operand of a
4547 type conversion rather than the conversion itself.
4549 2017-04-25 Thomas Quinot <quinot@adacore.com>
4551 * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
4552 Needs_Debug_Info when producing SCOs.
4554 2017-04-25 Thomas Quinot <quinot@adacore.com>
4556 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
4557 Always pass a null finalization master for a library level named access
4558 type to which a pragme No_Heap_Finalization applies.
4560 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4564 * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
4565 set to A'First(2) and vice versa.
4567 2017-04-25 Yannick Moy <moy@adacore.com>
4569 * freeze.adb (Freeze_Record_Type): Remove obsolete
4570 rule on volatile tagged record restriction on SPARK code.
4572 2017-04-25 Yannick Moy <moy@adacore.com>
4574 * sem_prag.adb (minor) Fix SPARK RM reference.
4576 2017-04-25 Yannick Moy <moy@adacore.com>
4578 * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
4579 comment to reflect which entity is chosen as unique entity.
4580 (Unique_Entity): Return full view instead of private spec for
4581 protected type or task type. Fix possible incorrect access when
4584 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4586 * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
4587 array types only instead of all packed array types.
4589 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4591 * sem_ch6.adb (Conforming_Types): If type of formal as a specified
4592 dimension system, verify that dimensions of both match.
4593 (Check_Conformance): Add error message in case of dimension
4595 * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
4598 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4600 * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
4603 2017-04-25 Yannick Moy <moy@adacore.com>
4605 * sem_util.adb: Minor refactoring.
4606 * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
4608 2017-04-25 Claire Dross <dross@adacore.com>
4610 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
4611 ultimate alias when accessing overridden operation. Indeed, if the
4612 overridden operation is itself inherited, it won't have any explicit
4615 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4617 * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
4618 overlap if the two formals have different types, because formally
4619 the corresponding actuals cannot designate the same objects.
4621 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4623 * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
4624 dimensions are present from context, use them. b) If operand is
4625 a static constant rewritten as a literal, obtain the dimensions
4626 from the original declaration, otherwise use dimensions of type
4627 established from context.
4629 2017-04-25 Yannick Moy <moy@adacore.com>
4631 * sem_util.adb (Is_Effectively_Volatile): Protect against base type
4632 of array that is private.
4634 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4636 * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
4639 2017-04-25 Yannick Moy <moy@adacore.com>
4641 * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
4644 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4646 * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
4647 the check that recognizes a call to a private overridding and
4648 replaces the called subprogram with its alias.
4650 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4652 * exp_util.adb: Minor reformatting.
4654 2017-04-25 Justin Squirek <squirek@adacore.com>
4656 * exp_ch3.adb (Freeze_Type): Add condition to always treat
4657 interface types as a partial view of a private type for the
4658 generation of invariant procedure bodies.
4659 * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
4660 Add a condition to get the Corresponding_Record_Type for
4661 concurrent types, add condition to return in the absence of a
4662 class in the pragma, remove call to Replace_Type_References,
4663 and add call to Replace_References.
4664 (Add_Interface_Invariatns),
4665 (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
4666 to including the working type T.
4667 (Add_Own_Invariants): Remove
4668 legacy condition for separate units, remove dispatching for ASIS
4669 and save a copy of the expression in the pragma expression.
4670 (Build_Invariant_Procedure_Body): Default initalize vars,
4671 remove return condition on interfaces, always use the
4672 private type for interfaces, and move the processing of types
4673 until after the processing of invariants for the full view.
4674 (Build_Invariant_Procedure_Declaration): Remove condition
4675 to return if an interface type is encountered and add
4676 condition to convert the formal parameter to its class-wide
4677 counterpart if Work_Typ is abstract.
4678 (Replace_Type): Add call to Remove_Controlling_Arguments.
4679 (Replace_Type_Ref): Remove class-wide dispatching for the current
4680 instance of the type.
4681 (Replace_Type_References): Remove parameter "Derived"
4682 (Remove_Controlling_Arguments): Created in order to removing
4683 the controlliong argument from calls to primitives in the case
4684 of the formal parameter being an class-wide abstract type.
4685 * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
4686 to the change made to Freeze_Type in exp_ch3. Add a condition
4687 to treat interface types as a partial view.
4688 * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
4689 to Build_Invariant_Procedure_Declaration to properly generate a
4690 "partial" invariant procedure when Typ is an interface.
4692 2017-04-25 Bob Duff <duff@adacore.com>
4694 * a-numeri.ads: Go back to using brackets encoding for the Greek
4697 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4699 * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
4700 (10-15): if derived type T with progenitors is abstract,
4701 and primitive P of this type inherits non-trivial classwide
4702 preconditions from both a parent operation and from an interface
4703 operation, then the inherited operation is abstract if the parent
4704 operation is not null.
4705 * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
4706 with Covered_Interface_Op to yield the actual interface operation
4707 that is implemented by a given inherited operation.
4709 2017-04-25 Javier Miranda <miranda@adacore.com>
4711 * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
4712 and right operands after performing the validity checks. Required
4713 because validity checks may remove side effects from the operands.
4715 2017-04-25 Javier Miranda <miranda@adacore.com>
4717 * exp_attr.adb (Attribute_Unrestricted_Access):
4718 Do not disable implicit type conversion. Required to generate
4719 code that displaces the pointer to reference the secondary
4722 2017-04-25 Pascal Obry <obry@adacore.com>
4724 * prj-attr.adb, snames.ads-tmpl: Add package Install's
4725 Required_Artifacts attribute.
4727 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4729 * sem_util.adb (Same_Value): String literals are compile-time
4730 values, and comparing them must use Expr_Value_S.
4732 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4734 * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
4735 dereference is introduced for the object, and the object is
4736 overloaded, do not check whether it is aliased, because it may
4737 include an implicit dereference.
4738 * sem_type.adb (Disambiguate): If two interpretations are access
4739 attribute types with the same designated type keep either of
4740 them and do not report an ambiguity. A true ambiguity will be
4743 2017-04-25 Bob Duff <duff@adacore.com>
4745 * a-numeri.ads: Change the encoding of Greek letter Pi from
4746 brackets encoding to UTF-8. Use pragma Wide_Character_Encoding
4747 to indicate the encoding. We considered using a byte order mark
4748 (BOM), but that causes various trouble (misc software eats the
4749 BOM, if you have a patch with a BOM, then it's not at the start
4750 of the patch, so it's not a BOM, the BOM affects with-ing files,
4752 * scng.adb, s-wchcnv.adb: Minor.
4754 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4756 * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
4757 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4759 * sem_ch3.adb (Add_Internal_Interface_Entities): Move
4760 Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
4761 Improve error message on operations that inherit non-conforming
4762 classwide preconditions from ancestor and progenitor.
4763 * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
4764 moved here from sem_ch3.
4765 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
4766 check given in RM 6.1.1 (17) concerning renamings of overriding
4767 operations that inherits class-wide preconditions from ancestor
4770 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4772 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
4773 (Build_Adjust_Statements): Code cleanup.
4774 (Build_Finalizer): Update the initialization of
4776 (Build_Finalize_Statements): Code cleanup.
4777 (Build_Initialize_Statements): Code cleanup.
4778 (Make_Deep_Array_Body): Update the initialization of
4780 (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
4781 (Process_Object_Declaration): Generate a null exception handler only
4782 when exceptions are allowed.
4783 (Process_Transients_In_Scope): Update the initialization of
4785 * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
4787 * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
4788 restrictions when the handler is internally generated and the
4791 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4793 * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
4794 enforce legality rule on classwide preconditions inherited from
4795 both an ancestor and a progenitor (RM 6.1.1 (10-13).
4796 * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
4797 subprogram need not be dispatching if it appears in a precondition
4798 for an abstract or null subprogram.
4800 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4802 * sem_ch10.adb: Minor typo fix.
4804 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4806 * gcc-interface/Makefile.in: Cleanup VxWorks targets.
4808 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4810 * fname.adb (Is_Internal_File_Name): Arrange for the slices to
4811 have a length which is a power of 2.
4812 (Is_Predefined_File_Name): Likewise. Adjust comment.
4814 2017-04-25 Bob Duff <duff@adacore.com>
4816 * exp_aggr.adb (Component_Count): Protect the
4817 arithmetic from attempting to convert a value >= 2**31 to Int,
4818 which would otherwise raise Constraint_Error.
4820 2017-04-25 Bob Duff <duff@adacore.com>
4822 * opt.ads (Locking_Policy): Fix incorrect documentation. The
4823 first character of the policy name is not unique.
4825 2017-04-25 Bob Duff <duff@adacore.com>
4827 * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
4828 * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
4829 about this flag not being used. It was already used, and it is
4832 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4834 * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
4835 (Ignore_SPARK_Mode_Pragmas): New routine.
4836 (Set_Ignore_SPARK_Mode_Pragmas): New routine.
4837 (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
4838 * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
4840 (Ignore_SPARK_Mode_Pragmas): New routine
4841 along with pragma Inline.
4842 (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
4843 * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
4844 Ignore_SPARK_Mode_Pragmas_In_Instance.
4845 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4846 Save and restore the value of global flag
4847 Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
4848 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
4849 the corresponding spec or the body must ignore all SPARK_Mode
4850 pragmas found within.
4851 (Analyze_Subprogram_Declaration): Mark
4852 the spec when it needs to ignore all SPARK_Mode pragmas found
4853 within to allow the body to infer this property in case it is
4854 instantiated or inlined later.
4855 * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
4856 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
4857 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
4858 when the corresponding spec also ignored all SPARK_Mode pragmas
4860 (Analyze_Package_Declaration): Mark the spec when
4861 it needs to ignore all SPARK_Mode pragmas found within to allow
4862 the body to infer this property in case it is instantiated or
4864 * sem_ch12.adb (Analyze_Formal_Package_Declaration):
4865 Save and restore the value of flag
4866 Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
4867 formal spec when it needs to ignore all SPARK_Mode
4868 pragmas found within to allow the body to infer this
4869 property in case it is instantiated or inlined later.
4870 (Analyze_Package_Instantiation): Save and restore the value
4871 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
4872 the instance spec when it needs to ignore all SPARK_Mode
4873 pragmas found within to allow the body to infer this
4874 property in case it is instantiated or inlined later.
4875 (Analyze_Subprogram_Instantiation): Save and restore the value
4876 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
4877 instance spec and anonymous package when they need to ignore
4878 all SPARK_Mode pragmas found within to allow the body to infer
4879 this property in case it is instantiated or inlined later.
4880 (Instantiate_Package_Body): Save and restore the value of global
4881 flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
4882 global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
4883 corresponding instance spec also ignored all SPARK_Mode pragmas
4885 (Instantiate_Subprogram_Body): Save and restore the
4886 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
4887 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
4888 when the corresponding instance spec also ignored all SPARK_Mode
4889 pragmas found within.
4890 * sem_prag.adb (Analyze_Pragma): Update the reference to
4891 Ignore_Pragma_SPARK_Mode.
4892 * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
4893 all SPARK_Mode pragmas defined within yields mode "off".
4895 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4897 * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
4899 2017-04-25 Bob Duff <duff@adacore.com>
4901 * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
4902 All_Checks" to avoid generating unnecessary checks.
4903 * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
4905 * sem.ads: Fix comment.
4906 * expander.ads: Fix comment.
4907 * exp_atag.ads: Fix comment: "Index = 0" should be
4910 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4912 * s-taprop-linux.adb: Minor editorial fixes.
4914 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4916 * sem_util.adb (New_Copy_Tree): Put back the declarations of the
4917 hash tables at library level. Reinstate the NCT_Hash_Tables_Used
4918 variable and set it to True whenever the main hash table is
4919 populated. Short- circuit the Assoc function if it is false
4920 and add associated guards.
4922 2017-04-25 Olivier Hainque <hainque@adacore.com>
4924 * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
4925 specs without elaboration code that have an elaboration counter
4926 nevertheless, e.g. when compiled with -fpreserve-control-flow.
4927 * sem_ch10.adb (Analyze_Compilation_Unit):
4928 Set_Elaboration_Entity_Required when requested to preserve
4929 control flow, to ensure the unit elaboration is materialized at
4930 bind time, resulting in the inclusion of the unit object file
4931 in the executable closure at link time.
4933 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
4935 * exp_dbug.adb: In Debug_Renaming_Declaration,
4936 when dealing with indexed component, accept to produce a renaming
4937 symbol when the index is an IN parameter or when it is a name
4938 defined in an outer scope.
4940 2017-04-25 Yannick Moy <moy@adacore.com>
4942 * errout.adb (Error_Msg): Adapt continuation
4943 message in instantiations and inlined bodies for info messages.
4945 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4947 * fname.adb (Has_Internal_Extension): Add pragma Inline.
4948 Use direct 4-character slice comparisons.
4950 pragma Inline. (Has_Suffix): Delete.
4951 (Is_Internal_File_Name):
4952 Test Is_Predefined_File_Name first.
4953 (Is_Predefined_File_Name):
4954 Use direct slice comparisons as much as possible and limit all
4955 comparisons to at most 8 characters.
4957 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4959 * checks.adb (Insert_Valid_Check): Code cleanup.
4960 * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
4961 (Expand_Actuals): Generate proper copy-back for a validation
4962 variable when it acts as the argument of a type conversion.
4963 * sem_util.adb (Is_Validation_Variable_Reference): Augment the
4964 predicate to operate on type qualifications.
4966 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4968 * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
4971 2017-04-25 Bob Duff <duff@adacore.com>
4973 * sem_prag.adb (No_Return): Give an error if the pragma applies
4974 to a body. Specialize the error for the specless body case,
4975 as is done for (e.g.) pragma Convention.
4976 * debug.adb: Add switch -gnatd.J to disable the above legality
4977 checks. This is mainly for use in our test suite, to avoid
4978 rewriting a lot of illegal (but working) code. It might also
4979 be useful to customers. Under this switch, if a pragma No_Return
4980 applies to a body, and the procedure raises an exception (as it
4981 should), the pragma has no effect. If the procedure does return,
4982 execution is erroneous.
4984 2017-04-25 Bob Duff <duff@adacore.com>
4986 * exp_ch6.adb (Expand_Actuals): This is the
4987 root of the problem. It took N as an 'in out' parameter, and in
4988 some cases, rewrote N, but then set N to Original_Node(N). So
4989 the node returned in N had no Parent. The caller continued
4990 processing of this orphaned node. In some cases that caused a
4991 crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
4992 and trips over the Empty Parent). The solution is to make N an
4993 'in' parameter. Instead of rewriting it, return the list of
4994 post-call actions, so the caller can do the rewriting later,
4995 after N has been fully processed.
4996 (Expand_Call_Helper): Move most of Expand_Call here. It has
4997 too many premature 'return' statements, and we want to do the
4998 rewriting on return.
4999 (Insert_Post_Call_Actions): New procedure to insert the post-call
5000 actions in the appropriate place. In the problematic case,
5001 that involves rewriting N as an Expression_With_Actions.
5002 (Expand_Call): Call the new procedures Expand_Call_Helper and
5003 Insert_Post_Call_Actions.
5005 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5007 * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
5008 properly type derived from generic formal types, to handle
5009 properly modified version of ACATS 4.1B B611017.
5011 2017-04-25 Javier Miranda <miranda@adacore.com>
5013 * exp_unst.adb (Subp_Index): Adding missing
5014 support for renamings and functions that return a constrained
5015 array type (i.e. functions for which the frontend built a
5016 procedure with an extra out parameter).
5018 2017-04-25 Pascal Obry <obry@adacore.com>
5020 * s-string.adb: Minor code clean-up.
5022 2017-04-25 Bob Duff <duff@adacore.com>
5024 * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
5026 * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
5027 function for Non_Blocking_Wait_Process.
5029 2017-04-25 Bob Duff <duff@adacore.com>
5031 * prep.adb (Preprocess): Remove incorrect
5032 Assert. Current character can be ASCII.CR.
5034 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5036 * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
5037 convention Stdcall, which has a number of exceptions. Convention
5038 is legal on a component declaration whose type is an anonymous
5039 access to subprogram.
5041 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5043 * sem_ch4.adb: sem_ch4.adb Various reformattings.
5044 (Try_One_Prefix_Interpretation): Use the base type when dealing
5045 with a subtype created for purposes of constraining a private
5046 type with discriminants.
5048 2017-04-25 Javier Miranda <miranda@adacore.com>
5050 * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
5051 * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
5052 dispatching primitives (Restore_Warnings): Restore warning on
5053 late dispatching primitives (Save_Warnings): Save warning on late
5054 dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
5055 to enable/disable this warning.
5056 (WA_Warnings): Set warning on late dispatching primitives.
5057 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
5058 that its parent type has a private extension.
5059 * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
5061 * usage.adb: Document -gnatw.j and -gnatw.J.
5063 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5065 * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
5068 2017-04-25 Bob Duff <duff@adacore.com>
5070 * binde.adb (Validate): Do not pass dynamic strings
5071 to pragma Assert, because older compilers do not support that.
5073 2017-04-25 Bob Duff <duff@adacore.com>
5075 * s-fileio.adb (Close): When a temp file is
5076 closed, delete it and clean up its Temp_File_Record immediately,
5077 rather than waiting until later.
5078 (Temp_File_Record): Add File
5079 component, so Close can know which Temp_File_Record corresponds
5080 to the file being closed.
5081 (Delete): Don't delete temp files,
5082 because they are deleted by Close.
5083 (Open): Set the File component
5084 of Temp_File_Record. This requires moving the creation of the
5085 Temp_File_Record to the end, after the AFCB has been created.
5087 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5089 * checks.adb (Insert_Valid_Check): Do not generate
5090 a validity check when inside a generic.
5092 2017-04-25 Yannick Moy <moy@adacore.com>
5094 * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
5096 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5098 * snames.ads-tmpl (Snames): More names for detecting predefined
5099 potentially blocking subprograms.
5101 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5103 * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
5104 concerning inheritance of class-wide preconditions do not apply
5107 2017-04-25 Bob Duff <duff@adacore.com>
5109 * s-ficobl.ads: Minor comment fix.
5111 2017-04-25 Yannick Moy <moy@adacore.com>
5113 * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
5114 conversions from float to integer in GNATprove mode.
5115 (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
5116 to call Apply_Type_Conversion_Checks, so that range checks
5117 are properly positioned when needed on conversions, including
5118 when converting from float to integer. (Determine_Range): In
5119 GNATprove mode, take into account the possibility of conversion
5120 from float to integer.
5121 * sem_res.adb (Resolve_Type_Conversion): Only enforce range
5122 check on conversions from fixed-point to integer, not anymore
5123 on conversions from floating-point to integer, when in GNATprove
5126 2017-04-25 Yannick Moy <moy@adacore.com>
5128 * checks.adb (Determine_Range_R): Special case type conversions
5129 from integer to float in order to get bounds in that case too.
5130 * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
5131 mode, for computations involved in interval checking.
5133 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5135 * checks.adb (Insert_Valid_Check): Partially reimplement validity
5137 * einfo.adb Node36 is now used as Validated_Object.
5138 (Validated_Object): New routine.
5139 (Set_Validated_Object): New routine.
5140 (Write_Field36_Name): Add an entry for Validated_Object.
5141 * einfo.ads Add new attribute Validated_Object along with
5143 (Validated_Object): New routine along with pragma Inline.
5144 (Set_Validated_Object): New routine along with pragma Inline.
5145 * exp_attr.adb (Make_Range_Test): Add processing for validation
5146 variables to avoid extra reads and copies of the prefix.
5147 * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
5148 variables in order to reflect any changes done in the variable
5149 back into the original object.
5150 * sem_util.adb (Is_Validation_Variable_Reference): New routine.
5151 * sem_util.ads (Is_Validation_Variable_Reference): New routine.
5153 2017-04-25 Steve Baird <baird@adacore.com>
5155 * exp_ch7.adb (Build_Array_Deep_Procs,
5156 Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
5157 generate Finalize_Address routines for CodePeer.
5159 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5161 * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
5162 Analyze_Pre_Post_Condition, to implement the legality checks
5163 mandated by AI12-0131: Pre'Class shall not be specified for an
5164 overriding primitive subprogram of a tagged type T unless the
5165 Pre'Class aspect is specified for the corresponding primitive
5166 subprogram of some ancestor of T.
5168 2017-04-25 Bob Duff <duff@adacore.com>
5170 * sem_ch8.adb (Use_One_Type): If a use_type_clause
5171 is redundant, set its Used_Operations to empty. This is only
5172 necessary for use clauses that appear in the parent of a generic
5173 child unit, because those use clauses get reanalyzed when we
5174 instantiate the generic, and we don't want the Used_Operations
5175 carried over from the original context (where it was probably
5178 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5180 * exp_ch6.adb: Minor reformatting.
5182 2017-04-25 Bob Duff <duff@adacore.com>
5184 * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
5185 Use Source_Index (Current_Sem_Unit) to find the correct casing.
5186 * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
5187 (Current_Sem_Unit) to find the correct casing.
5188 * par.adb (Par): Null out Current_Source_File, to ensure that
5189 the above bugs won't rear their ugly heads again.
5191 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5193 * sem_ch8.adb (Find_Type): For an attribute reference
5194 'Class, if prefix type is synchronized and previous errors
5195 have suppressed the creation of the corresponding record type,
5196 create a spurious class-wide for the synchonized type itself,
5197 to catch other misuses of the attribute
5199 2017-04-25 Steve Baird <baird@adacore.com>
5201 * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
5202 is True, then don't generate the accessibility check for the
5203 tag of a tagged result.
5204 * exp_intr.adb (Expand_Dispatching_Constructor_Call):
5205 if CodePeer_Mode is True, then don't generate the
5206 tag checks for the result of call to an instance of
5207 Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
5208 descendant of" check and the accessibility check).
5210 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5212 * sem_ch13.adb: Code cleanups.
5213 * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
5214 * sem_ch8.ads: Minor comment fix.
5216 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5218 * exp_ch4.adb (Library_Level_Target): New function.
5219 (Expand_Concatenate): When optimization is enabled, also expand
5220 the operation out-of-line if the concatenation is present within
5221 the expression of the declaration of a library-level object and
5222 not only if it is the expression of the declaration.
5224 2017-04-25 Bob Duff <duff@adacore.com>
5226 * freeze.adb (Freeze_Object_Declaration): Do
5227 not Remove_Side_Effects if there is a pragma Linker_Section,
5228 because in that case we want static initialization in the
5229 appropriate section.
5231 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5233 * exp_dbug.adb: Minor rewording and reformatting.
5235 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5237 * sem_attr.adb (Statically_Denotes_Object): New predicate, to
5238 handle the proposed changes to rules concerning potentially
5239 unevaluated expressions, to include selected components that
5240 do not depend on discriminants, and indexed components with
5242 * sem_util.adb (Is_Potentially_Unevaluated): Add check for
5243 predicate in quantified expression, and fix bugs in the handling
5244 of case expressions and membership test.
5245 (Analyze_Attribute_Old_Result): use new predicate.
5246 (Analyze_Attribute, case Loop_Entry): ditto.
5248 2017-04-25 Bob Duff <duff@adacore.com>
5250 * s-secsta.adb (SS_Info): Add a comment
5251 explaining why we don't need to walk all the chunks in order to
5252 compute the total size.
5254 2017-04-25 Bob Duff <duff@adacore.com>
5256 * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
5257 of the global name buffer to 4*Max_Line_Length.
5259 2017-04-25 Javier Miranda <miranda@adacore.com>
5261 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
5262 renaming entity for debug information, mark the entity as needing debug
5263 info if it comes from sources.
5265 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5267 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
5268 restriction converning the use of 'Address where the prefix is
5269 of a controlled type.
5271 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
5273 * exp_dbug.adb: In Debug_Renaming_Declaration,
5274 skip slices that are made redundant by an indexed component
5276 * atree.h: New definition for Original_Node.
5278 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5280 * sem_prag.adb, sem_prag.ads: Minor reformatting.
5282 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5284 * sem_ch3.adb (Check_Entry_Contract): Call
5285 Preanalyze_Spec_Expression so that resolution takes place as well.
5286 * sem_util.adb (Check_Internal_Protected_Use): Reject properly
5287 internal calls that appear in preconditions of protected
5288 operations, in default values for same, and in contract guards
5289 for contract cases in SPARK.
5291 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5293 * a-numaux.ads: Fix description of a-numaux-darwin
5295 (Double): Define to Long_Float.
5296 * a-numaux-vxworks.ads (Double): Likewise.
5297 * a-numaux-darwin.ads
5299 * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
5300 * a-numaux-x86.ads: Fix package description.
5301 * a-numaux-x86.adb (Is_Nan): Minor tweak.
5302 (Reduce): Adjust and complete description. Call Is_Nan instead of
5303 testing manually. Use an integer temporary to hold rounded value.
5304 * a-numaux-darwin.adb (Reduce): Likewise.
5305 (Is_Nan): New function.
5307 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5309 * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
5310 on analysis of prefix whose type is a current instance of a
5311 synchronized type, but where the prefix itself is an entity that
5314 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5316 * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
5317 the identity of callable entities therein, because they have been
5318 properly resolved, and prefixed calls may have been rewritten
5321 2017-04-25 Patrick Bernardi <bernardi@adacore.com>
5323 * exp_ch3.adb (Build_Init_Statements): Convert
5324 the expression of the pragma/aspect Secondary_Stack_Size to
5325 internal type System.Parameters.Size_Type before assigning
5326 it to the Secondary_Stack_Size component of the task type's
5327 corresponding record.
5329 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5331 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
5332 (etc) optimizations when the type is modular and the offsets
5335 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5337 * s-osinte-freebsd.ads: Minor comment tweaks
5339 2017-04-25 Javier Miranda <miranda@adacore.com>
5341 * urealp.adb (UR_Write): Reverse previous patch
5342 adding documentation on why we generate multiplications instead
5343 of divisions (needed to avoid expressions whose computation with
5344 large numbers may cause division by 0).
5346 2017-04-25 Bob Duff <duff@adacore.com>
5348 * erroutc.adb (Set_Specific_Warning_Off,
5349 Set_Warnings_Mode_Off): Use the correct source file for
5350 Stop. Was using Current_Source_File, which is only valid during
5351 parsing. Current_Source_File will have a leftover value from
5352 whatever file happened to be parsed last, because of a with_clause
5355 2017-04-25 Bob Duff <duff@adacore.com>
5357 * lib.ads, lib.adb (In_Internal_Unit): New functions similar
5358 to In_Predefined_Unit, but including GNAT units.
5359 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
5360 with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
5361 because Should_Ignore_Pragma was not working reliably outside
5362 the parser, because Current_Source_File is not valid.
5363 * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
5364 * par-prag.adb: Call Should_Ignore_Pragma_Par.
5366 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5368 * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
5371 2017-04-25 Javier Miranda <miranda@adacore.com>
5373 * urealp.adb (UR_Write): Fix output of constants with a base other
5376 2017-04-25 Justin Squirek <squirek@adacore.com>
5378 * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
5379 * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
5380 Add extra parameter for Process_Interface_Name.
5381 (Process_Interface_Name): Add parameter for pragma to analyze
5382 corresponding aspect.
5383 * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
5386 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5388 * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
5391 2017-04-25 Yannick Moy <moy@adacore.com>
5393 * sem_res.adb (Resolve_Comparison_Op): Do not
5394 attempt evaluation of relational operations inside assertions.
5396 2017-04-25 Justin Squirek <squirek@adacore.com>
5398 * exp_util.adb (Add_Interface_Invariants):
5399 Restored, code moved back from Build_Invariant_Procedure_Body.
5400 (Add_Parent_Invariants): Restored, code moved back from
5401 Build_Invariant_Procedure_Body.
5402 (Build_Invariant_Procedure_Body):
5403 Remove refactored calls and integrated code from
5404 Add_Parent_Invariants and Add_Interface_Invariants.
5406 2017-04-25 Johannes Kanig <kanig@adacore.com>
5408 * errout.adb (Output_Messages): Adjust computation of total
5410 * erroutc.adb (Error_Msg): In statistics counts, deal
5411 correctly with informational messages that are not warnings.
5412 * errutil.adb (Finalize): adjust computation of total errors.
5414 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5416 * terminals.c (__gnat_terminate_pid): New.
5417 * g-exptty.ads (Terminate_Process): New. Update comments.
5419 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5421 * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
5423 2017-04-25 Justin Squirek <squirek@adacore.com>
5425 * sem_ch3.adb (Analyze_Declarations): Minor
5426 correction to comments, move out large conditional and scope
5427 traversal into a predicate.
5428 (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
5431 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5433 * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
5434 of prefix whose type is a current instance of a synchronized
5435 type. If the prefix is an object this is an external call (or
5436 requeue) that can only access public operations of the object. The
5437 previous predicate was too restrictive, and did not allow public
5438 protected operations, only task entries.
5440 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5442 * sem_ch5.adb, fname.adb: Minor reformatting.
5444 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5446 * einfo.adb (Is_Anonymous_Access_Type): New routine.
5447 * einfo.ads Update the placement of
5448 E_Anonymous_Access_Subprogram_Type along with all subtypes that
5450 (Is_Anonymous_Access_Type): New routine.
5451 * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
5452 master for an access type subject to pragma No_Heap_Finalization.
5453 * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
5454 allocated or deallocated does not finalization actions if the
5455 associated access type is subject to pragma No_Heap_Finalization.
5456 * opt.ads Add new global variable No_Heap_Finalization_Pragma.
5457 * par-prag.adb Pragma No_Heap_Finalization does not need special
5458 processing from the parser.
5459 * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
5460 ??? comments. Use the new predicate Is_Anonymous_Access_Type.
5461 * sem_prag.adb Add an entry in table Sig_Flags for pragma
5462 No_Heap_Finalization.
5463 (Analyze_Pragma): Add processing for
5464 pragma No_Heap_Finalization. Update various error messages to
5465 use Duplication_Error.
5466 * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
5467 * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
5468 and corresponding pragma id.
5470 2017-04-25 Bob Duff <duff@adacore.com>
5472 * freeze.adb (Freeze_Record_Type): Use the
5473 underlying type of the component type to determine whether it's
5474 elementary. For representation clause purposes, a private type
5475 should behave the same as its full type.
5476 * fname.ads, fname.adb (Is_Predefined_File_Name):
5477 Make sure things like "system.ali" are recognized as predefined.
5479 2017-04-25 Javier Miranda <miranda@adacore.com>
5481 * debug.adb: Update documentation of -gnatd.6.
5483 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5485 * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
5486 element iterator when the name is an overloaded function call,
5487 one of whose interpretations yields an array.
5489 2017-04-25 Bob Duff <duff@adacore.com>
5491 * uname.ads, uname.adb (Is_Predefined_Unit_Name,
5492 Is_Internal_Unit_Name): New functions for operating on unit
5493 names, as opposed to file names. There's some duplicated code
5494 with fname.adb, which is unfortunate, but it seems like we don't
5495 want to add dependencies here.
5496 * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
5497 to Is_Predefined_Unit_Name; the former was wrong, because Uname
5498 is not a file name at all.
5499 * fname.ads, fname.adb: Document the fact that
5500 Is_Predefined_File_Name and Is_Internal_File_Name can be called
5501 for ALI files, and fix the code so it works properly for ALI
5502 files. E.g. these should return True for "system.ali".
5504 2017-04-25 Justin Squirek <squirek@adacore.com>
5506 * exp_util.adb (Add_Invariant): Removed,
5507 code moved to Add_Invariant_Check, Add_Inherited_Invariant,
5508 and Add_Own_Invariant. (Add_Invariant_Check): Used
5509 for adding runtime checks from any kind of invariant.
5510 (Add_Inherited_Invariant): Generates invariant checks for
5511 class-wide invariants (Add_Interface_Invariants): Removed, code
5512 moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
5513 Create a types own invariant procedure (Add_Parent_Invariants):
5514 Removed, code moved to Build_Invariant_Procedure_Body
5515 (Build_Invariant_Procedure_Body): Add refactored calls
5516 and integrated code from Add_Parent_Invariants and
5517 Add_Interface_Invariants.
5518 (Process_Type): Removed, the
5519 relavant code was inlined into both Add_Own_Invariant and
5520 Add_Inherited_Invariant.
5522 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5524 * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
5525 scn.adb, osint.adb, fname.adb: Minor reformatting.
5527 2017-04-25 Pascal Obry <obry@adacore.com>
5529 * s-taprop-mingw.adb: Do not check for CloseHandle in
5532 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5534 * sem_util.adb (Check_Part_Of_Reference):
5535 Continue to examine the context if the reference appears within
5536 an expression function.
5538 2017-04-25 Justin Squirek <squirek@adacore.com>
5540 * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
5541 and Build_Invariant_Procedure_Declaration.
5542 * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
5543 and Build_Invariant_Procedure_Declaration from exp_ch7
5544 and break-out Is_Untagged_Private_Derivation from
5545 Build_Invariant_Procedure_Body.
5546 (Replace_Type_References):
5547 Append an extra parameter to allow for dispatching replacements
5548 and add the corrasponding logic.
5549 (Type_Invariant): Remove
5550 Replace_Typ_Refs and replace its references with calls to
5551 Replace_Type_References.
5552 * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
5554 2017-04-25 Bob Duff <duff@adacore.com>
5556 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
5557 that returns True when appropriate.
5558 * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
5559 when compiling predefined files.
5560 * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
5561 "gnat.adc" should not be considered a predefined file name.
5562 That required (or at least encouraged) a lot of cleanup of global
5563 variable usage. We shouldn't be communicating information via
5564 the global name buffer.
5565 * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
5566 * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
5567 required by the above-mentioned cleanup.
5569 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5571 * osint.adb (Find_File): Handle properly a request for a
5572 configuration file whose name is a directory.
5574 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5576 * sem_attr.adb, sem_ch5.adb: Minor reformatting.
5578 2017-04-25 Bob Duff <duff@adacore.com>
5580 * types.ads: Minor: Fix '???' comment.
5581 * sem_ch8.adb: Minor comment fix.
5583 2017-04-25 Bob Duff <duff@adacore.com>
5585 * sem_prag.adb: Remove suspicious uses of Name_Buf.
5586 * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
5587 Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
5588 Add String_To_Name with no side effects.
5590 2017-04-25 Justin Squirek <squirek@adacore.com>
5592 * sem_ch3.adb (Analyze_Declarations): Add
5593 additional condition for edge case.
5595 2017-04-25 Bob Duff <duff@adacore.com>
5597 * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
5598 reserved words inside pragmas. This is necessary to allow the
5599 pragma name Interface to be used in pragma Ignore_Pragma.
5600 * par.adb: Minor comment fix.
5602 2017-04-25 Javier Miranda <miranda@adacore.com>
5604 * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
5605 * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
5606 * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
5607 * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
5608 occurrences of RE_Type_Is_Abstract
5610 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5612 * exp_util.adb (Build_Chain): Account for ancestor
5613 subtypes while traversing the derivation chain.
5615 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5617 * sem_attr.adb: minor reformatting.
5619 2017-04-25 Doug Rupp <rupp@adacore.com>
5621 * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
5623 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5625 * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
5626 the first pass over an assignment statement with target names,
5627 to prevent the generation of subtypes (such as discriminated
5628 record components)that may carry the target name outside of the
5629 tree for the assignment. The subtypes will be generated when
5630 the assignment is reanalyzed in full.
5631 (Analyze_Target_Name): Handle properly class-wide types.
5633 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5635 * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
5636 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5637 the purposes of freezing.
5638 * exp_util.adb Update the documentation and structure of the
5639 type map used in class-wide semantics of assertion expressions.
5640 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5641 and resolve the triaged expression because all substitutions
5642 refer to the proper entities. Update the replacement of
5644 (Build_DIC_Procedure_Body): Add formal parameter
5645 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5646 are now only processed when freezing occurs. Build a body only
5648 (Entity_Hash): Removed.
5649 (Map_Types): New routine.
5650 (Replace_Object_And_Primitive_References): Removed.
5651 (Replace_References): New routine.
5652 (Replace_Type_References): Moved to the library level of Exp_Util.
5653 (Type_Map_Hash): New routine.
5654 (Update_Primitives_Mapping): Update the mapping call.
5655 (Update_Primitives_Mapping_Of_Types): Removed.
5656 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5657 parameter For_Freeze and update the comment on usage.
5658 (Map_Types): New routine.
5659 (Replace_References): New routine.
5660 (Replace_Type_References): Moved to the library level of Exp_Util.
5661 (Update_Primitives_Mapping_Of_Types): Removed.
5662 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
5663 properties of the private type to the full view in case the full
5664 view derives from a parent type and inherits a DIC pragma.
5665 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
5666 DIC pragma is placed at the top of a declarative region.
5668 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5670 * a-tasatt.adb: Complete previous change and use an unsigned
5671 int to avoid overflow checks.
5673 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5675 * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
5676 the error message when the attribute reference is an actual in
5677 a call to a subprogram inherited from a generic formal type with
5678 unknown discriminants, which makes the subprogram and its formal
5679 parameters intrinsic (see RM 6.3.1 (8) and (13)).
5681 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5683 * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
5684 sem_prag.adb: Minor reformatting.
5686 2017-04-25 Bob Duff <duff@adacore.com>
5688 * sem_attr.adb (Type_Key): Add code in the
5689 recursive Compute_Type_Key to protect against fetching the source
5690 code for Standard, in case a component of the type is declared
5691 in Standard. There was already code to do this for the original
5692 type, but not for its components.
5694 2017-04-25 Javier Miranda <miranda@adacore.com>
5696 * exp_ch3.adb (Build_Initialization_Call): Handle
5697 subtypes of private types when searching for the underlying full
5698 view of a private type.
5700 2017-04-25 Javier Miranda <miranda@adacore.com>
5702 * sem_res.adb (Set_Mixed_Mode_Operand): A universal
5703 real conditional expression can appear in a fixed-type context
5704 and must be resolved with that context to facilitate the code
5705 generation to the backend.
5707 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5709 * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
5710 to indicate whether during inline processing, when some unit U1
5711 appears in the context of a unit U2 compiled for instantiation
5712 or inlining purposes, the body of U1 needs to be compiled as well.
5713 * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
5714 context is a package declaration.
5715 * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
5716 Analyze_Generic_Package_Declaration): ditto.
5717 * inline.adb (Analyze_Inlined_Bodies): Check
5718 Body_Needed_For_Inlining.
5720 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5722 * par.adb (Current_Assign_Node): Global variable use to record
5723 the presence of a target_name in the right hand side of the
5724 assignment being parsed.
5725 * par-ch4.adb (P_Name): If the name is a target_name, mark the
5726 enclosing assignment node accordingly.
5727 * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
5729 * sem_ch5.adb (Analyze_Assignment): Disable expansion before
5730 analyzing RHS if the statement has target_names.
5731 * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
5732 properly choices that are subtype marks.
5733 * exp_ch5.adb: Code cleanup.
5735 2017-04-25 Bob Duff <duff@adacore.com>
5737 * s-memory.adb: Add a comment regarding efficiency.
5738 * atree.adb: Fix the assertion, and combine 2 assertions into one,
5739 "the source has an extension if and only if the destination does."
5740 * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
5742 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5744 * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
5747 2017-04-25 Doug Rupp <rupp@adacore.com>
5749 * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
5750 handling for ppc64-vx7.
5751 * sigtramp-vxworks-target.inc
5752 [SIGTRAMP_BODY]: Add section for ppc64-vx7.
5754 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5756 * ada_get_targ.adb: New file.
5758 2017-04-25 Bob Duff <duff@adacore.com>
5760 * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
5761 Direct_Val (Right), instead of the incorrect Direct_Val (Left).
5762 (UI_GCD): Remove ??? comment involving possible efficiency
5763 improvements. This just isn't important after all these years.
5765 * uintp.ads: Minor cleanup.
5767 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5769 * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
5770 Revert previous changes.
5771 * scng.adb: Minor reformatting.
5772 * s-stratt.ads: Fix unbalanced parens in comment.
5774 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5776 * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
5779 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5781 * scng.adb (Scan): Handle '@' appropriately.
5782 * sem_ch5.adb: Code cleanup.
5784 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5786 * freeze.adb (Check_Expression_Function): Do not check for the
5787 use of deferred constants if the freezing of the expression
5788 function is triggered by its generated body, rather than a
5791 2017-04-25 Javier Miranda <miranda@adacore.com>
5793 * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
5794 subtypes of private types when performing the view conversion.
5796 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5798 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5799 the purposes of freezing.
5800 * exp_util.adb Update the documentation and structure of the
5801 type map used in class-wide semantics of assertion expressions.
5802 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5803 and resolve the triaged expression because all substitutions
5804 refer to the proper entities. Update the replacement of
5806 (Build_DIC_Procedure_Body): Add formal parameter
5807 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5808 are now only processed when freezing occurs. Build a body only
5810 (Entity_Hash): Removed.
5811 (Map_Types): New routine.
5812 (Replace_Object_And_Primitive_References): Removed.
5813 (Replace_References): New routine.
5814 (Replace_Type_References): Moved to the library level of Exp_Util.
5815 (Type_Map_Hash): New routine.
5816 (Update_Primitives_Mapping): Update the mapping call.
5817 (Update_Primitives_Mapping_Of_Types): Removed.
5818 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5819 parameter For_Freeze and update the comment on usage.
5820 (Map_Types): New routine.
5821 (Replace_References): New routine.
5822 (Replace_Type_References): Moved to the library level of Exp_Util.
5823 (Update_Primitives_Mapping_Of_Types): Removed.
5824 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
5825 properties of the private type to the full view in case the full
5826 view derives from a parent type and inherits a DIC pragma.
5827 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
5828 DIC pragma is placed at the top of a declarative region.
5830 2017-04-25 Tristan Gingold <gingold@adacore.com>
5832 * s-mmap.ads (Data): Add pragma Inline.
5834 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5836 * checks.adb (Insert_Valid_Check): Do not use
5837 a renaming to alias a volatile name because this will lead to
5838 multiple evaluations of the volatile name. Use a constant to
5839 capture the value instead.
5841 2017-04-25 Doug Rupp <rupp@adacore.com>
5843 * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
5845 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5847 * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
5848 Add out parameter to indicate to caller that a wrapper must
5849 be constructed for an inherited primitive whose inherited
5850 pre/postcondition has called to overridden primitives.
5851 * freeze.adb (Check_Inherited_Conditions): Build wrapper body
5852 for inherited primitive that requires it.
5853 * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
5854 legal primitive operations and belong to the list of bodies
5855 generated after the freeze point of a type.
5856 * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
5857 of Build_Class_Wide_Expression.
5858 * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
5859 to construct the specification of the wrapper subprogram created
5860 for an inherited operation.
5862 2017-04-25 Bob Duff <duff@adacore.com>
5864 * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
5865 pthread_mutexattr_setprioceiling): Add new interfaces for these
5867 * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
5868 protocols as appropriate for Locking_Policy 'C' and 'I'.
5869 * s-taprop-posix.adb: Minor reformatting to make it more similar
5870 to s-taprop-linux.adb.
5872 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5874 * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
5875 Handle properly a multi- level derivation involving both renamed
5876 and constrained parent discriminants, when the type to be
5877 constrained has fewer discriminants that the ultimate ancestor.
5879 2017-04-25 Bob Duff <duff@adacore.com>
5881 * sem_util.adb (Is_Object_Reference): In the
5882 case of N_Explicit_Dereference, return False if it came from a
5883 conditional expression.
5885 2017-04-25 Bob Duff <duff@adacore.com>
5887 * par-ch4.adb (P_Case_Expression): If a semicolon
5888 is followed by "when", assume that ";" was meant to be ",".
5890 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5892 * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
5895 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5897 * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
5898 loading of an entity.
5899 * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
5900 previously repeated in the analysis.
5901 * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
5902 procedure SPARK_Implicit_Load. (Analyze_Task_Type_Declaration):
5903 use new procedure SPARK_Implicit_Load.
5904 * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
5905 SPARK_Implicit_Load.
5907 2017-04-25 Javier Miranda <miranda@adacore.com>
5909 * sem_util.adb (New_Copy_Tree): By default
5910 copying of defining identifiers is prohibited because
5911 this would introduce an entirely new entity into the
5912 tree. This patch introduces an exception to this general
5913 rule: the declaration of constants and variables located in
5914 Expression_With_Action nodes.
5915 (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
5916 (In_Map): New subprogram.
5917 (Visit_Entity): New subprogram.
5918 (Visit_Node): Handle EWA_Level,
5919 EWA_Inner_Scope_Level, and take care of defining entities defined
5920 in Expression_With_Action nodes.
5922 2017-04-25 Thomas Quinot <quinot@adacore.com>
5924 * exp_ch6.adb: minor comment edit.
5925 * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
5926 procedure specifications that come from source.
5927 * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
5928 Null_Statement attribute.
5929 * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
5930 procedure, generate statement SCO for the generated NULL statement.
5931 * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
5932 parser, if available.
5934 2017-04-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
5936 * system-linux-s390.ads: Use Long_Integer'Size to define
5939 2017-04-04 Eric Botcazou <ebotcazou@adacore.com>
5941 * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
5943 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
5945 * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
5946 * g-socket.adb (To_Host_Entry): Fix typo in comment.
5947 * gnat_ugn.texi: Fix typo.
5948 * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
5949 * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
5950 * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
5951 * sem_util.adb (Mark_Coextensions): Likewise.
5952 * sem_util.ads (Available_Full_View_Of_Component): Likewise.
5954 2017-03-28 Andreas Schwab <schwab@suse.de>
5957 * system-linux-aarch64-ilp32.ads: New file.
5958 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
5959 from LIBGNAT_TARGET_PAIRS.
5960 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
5961 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
5962 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
5963 or -mabi=ilp32, resp.
5965 2017-03-14 James Cowgill <James.Cowgill@imgtec.com>
5967 * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
5969 2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
5972 * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
5974 2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
5977 * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
5979 * system-linux-arm.ads (Default_Bit_Order): Likewise.
5980 * system-linux-mips.ads (Default_Bit_Order): Likewise.
5981 * system-linux-armeb.ads: Delete.
5982 * system-linux-mipsel.ads: Likewise.
5983 * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
5984 (ARM/Linux): Likewise.
5986 2017-02-24 Jakub Jelinek <jakub@redhat.com>
5989 * gcc-interface/misc.c (gnat_handle_option): Pass true to
5990 handle_generated_option GENERATED_P.
5992 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5994 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
5995 around a justified modular type if it doesn't have the same scalar
5996 storage order as the enclosing record type.
5998 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6000 * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
6001 of boolean rvalues to function calls.
6003 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6005 * gcc-interface/utils.c (fold_bit_position): New function.
6006 (rest_of_record_type_compilation): Call it instead of bit_position to
6007 compute the field position and remove the call to remove_conversions.
6008 (compute_related_constant): Factor out the multiplication in both
6009 operands, if any, and streamline the final test.
6011 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6013 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
6015 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6017 * gcc-interface/decl.c: Include demangle.h.
6018 (is_cplusplus_method): Return again true for a primitive operation
6019 only if it is dispatching. For a subprogram with an interface name,
6020 call the demangler to get the number of C++ parameters and compare it
6021 with the number of Ada parameters.
6023 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6025 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
6026 there is no end label, put the location of the At_End procedure on
6027 the call to the procedure.
6029 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6031 * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
6032 value for array types with TYPE_INDEX_TYPE set on their domain type.
6033 * gcc-interface/utils.c (max_size): For operations and expressions, do
6034 not build a new node if the operands have not changed or are missing.
6036 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6038 * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
6039 argument when recursing on TRUTH_NOT_EXPR.
6041 2017-02-12 John Marino <gnugcc@marino.st>
6043 * system-freebsd-x86.ads: Rename into...
6044 * system-freebsd.ads: ...this.
6045 (Default_Bit_Order): Define using Standard'Default_Bit_Order.
6046 * gcc-interface/Makefile.in: Support aarch64-freebsd.
6047 (x86-64/FreeBSD): Adjust to above renaming.
6048 (i386/FreeBSD): Likewise.
6050 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
6052 * comperr.adb: Update FSF bug reporting URL.
6054 2017-02-01 Eric Botcazou <ebotcazou@adacore.com>
6055 Jakub Jelinek <jakub@redhat.com>
6058 * adaint.c (__gnat_killprocesstree): Fix broken string handling.
6060 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
6063 * gcc-interface/utils.c (get_global_context): Pass main_input_filename
6064 to build_translation_unit_decl.
6066 2017-01-23 Javier Miranda <miranda@adacore.com>
6068 * sem_util.adb (New_Copy_Tree): Code cleanup:
6069 removal of the internal map (ie. variable Actual_Map, its
6070 associated local variables, and all the code handling it).
6071 * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
6072 force loading of the System package when processing a task type.
6073 (Analyze_Protected_Type_Declaration): in GNATprove mode force
6074 loading of the System package when processing a protected type.
6075 * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
6076 force loading of the System package when processing compilation
6077 unit with a main-like subprogram.
6078 * frontend.adb (Frontend): remove forced loading of the System
6081 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6083 * sem_prag.adb (Default_Initial_Condition): If the desired type
6084 declaration is a derived type declaration with discriminants,
6085 it is rewritten as a private type declaration.
6086 * sem_ch13.adb (Replace_Type_References_Generic,
6087 Visible_Component): A discriminated private type with descriminnts
6088 has components that must be rewritten as selected components
6089 if they appear as identifiers in an aspect expression such as
6090 a Default_Initial_Condition.
6091 * sem_util.adb (Defining_Entity): support N_Iterator_Specification
6094 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6096 * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
6097 * gnat1drv.adb Generate an empty object file for an ignored
6098 Ghost compilation unit.
6099 * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
6101 2017-01-23 Yannick Moy <moy@adacore.com>
6103 * sem_ch4.adb (Analyze_Indexed_Component_Form):
6104 Adapt to inlined prefix with string literal subtype.
6105 * inline.adb (Expand_Inlined_Call): Keep unchecked
6106 conversion inside inlined call when formal type is constrained.
6108 2017-01-23 Javier Miranda <miranda@adacore.com>
6110 * sem_util.adb (New_Copy_Tree): Code cleanup:
6111 removal of global variables. All the global variables, global
6112 functions and tables of this subprogram are now declared locally.
6114 2017-01-23 Gary Dismukes <dismukes@adacore.com>
6116 * exp_strm.ads: Minor reformatting and typo fixes.
6118 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6120 * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
6121 exp_aggr.adb: Minor reformatting.
6122 * g-diopit.adb: minor grammar/punctuation fix in comment.
6123 * g-byorma.ads: minor fix of unbalanced parens in comment.
6125 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6127 * par.adb: Update the documentation of component Labl.
6128 * par-ch6.adb (P_Return_Statement): Set the expected label of
6129 an extended return statement to Error.
6131 2017-01-23 Tristan Gingold <gingold@adacore.com>
6133 * s-boustr.ads, s-boustr.adb (Is_Full): New function.
6135 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6137 * expander.adb: Handle N_Delta_Aggregate.
6139 2017-01-23 Javier Miranda <miranda@adacore.com>
6141 * exp_ch6.adb (Expand_Call): Improve the code that
6142 checks if some formal of the called subprogram is a class-wide
6143 interface, to handle subtypes of class-wide interfaces.
6145 2017-01-23 Javier Miranda <miranda@adacore.com>
6147 * checks.adb (Apply_Parameter_Aliasing_Checks):
6148 Remove side effects of the actuals before generating the overlap
6151 2017-01-23 Justin Squirek <squirek@adacore.com>
6153 * exp_strm.ads, exp_strm.ads
6154 (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
6155 as to avoid getting the underlying type by default.
6156 * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
6157 underlying type in the Iiput and output attribute cases when
6158 building their respective functions.
6160 2017-01-23 Gary Dismukes <dismukes@adacore.com>
6162 * scng.adb: Minor reformatting of error message.
6164 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6166 * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
6167 to freeze the return type of an expression funxtion that is a
6168 completion, if the type is a limited view and the non-limited
6171 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6173 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
6174 aggregate construct.
6175 (P_Record_Or_Array_Component_Association): An array aggregate
6176 can start with an Iterated_Component_Association.
6177 * scng.adb: Modify error message on improper use of @ in earlier
6178 versions of the language.
6179 * sinfo.ads: New node kind N_Delta_Aggregate.
6180 * sinfo.adb: An N_Delta_Aggregate has component associations and
6182 * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
6183 * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
6184 Create a new index for each one of the choices in the association,
6185 to prevent spurious homonyms in the scope.
6186 (Resolve_Delta_Aggregate): New.
6187 * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
6188 * exp_util.adb (Insert_Actions): Take into account
6190 * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
6191 * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
6192 and local procedures Expand_Delta_Array_Aggregate and
6193 expand_Delta_Record_Aggregate.
6194 * sprint.adb: Handle N_Delta_Aggregate.
6196 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6198 * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
6199 empty name when the exception declaration is subject to pragma
6201 (Null_String): New routine.
6203 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6205 * par-ch9.adb (P_Protected_Definition): Parse
6206 any optional and potentially illegal pragmas which appear in
6207 a protected operation declaration list.
6208 (P_Task_Items): Parse
6209 any optional and potentially illegal pragmas which appear in a
6212 2017-01-23 Pascal Obry <obry@adacore.com>
6214 * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
6215 is needed when a foreign thread call a Win32 API using a thread handle
6216 like GetThreadTimes() for example.
6218 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6220 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6221 allow an 'Address clause to be specified on a prefix of a
6224 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6226 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6227 attribute 'Valid is a renaming of the original expression when
6228 the expression denotes a name. For all other kinds of expression,
6229 use a constant to capture the value.
6230 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6231 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6233 2017-01-23 Justin Squirek <squirek@adacore.com>
6235 * sem_eval.adb (Eval_Integer_Literal): Add special
6236 case to avoid optimizing out check if the literal appears in
6239 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6241 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6242 allow an 'Address clause to be specified on a prefix of a
6245 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6247 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6248 attribute 'Valid is a renaming of the original expression when
6249 the expression denotes a name. For all other kinds of expression,
6250 use a constant to capture the value.
6251 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6252 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6254 2017-01-23 Justin Squirek <squirek@adacore.com>
6256 * sem_eval.adb (Eval_Integer_Literal): Add special
6257 case to avoid optimizing out check if the literal appears in
6260 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6262 * sem_ch4.adb (Try_Primitive_Operations,
6263 Is_Valid_First_Argument_Of): argument is valid if it is a derived
6264 type with unknown discriminants that matches its underlying
6266 * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
6267 expression if its type is derived from a limited type with
6268 unknown discriminants, because the expansion (which is a call)
6269 must be expanded in the enclosing context to add the proper build-
6270 in-place parameters to the call.
6271 * lib.ads, exp_ch9.adb: Minor fixes in comments.
6273 2017-01-23 Yannick Moy <moy@adacore.com>
6275 * frontend.adb (Frontend): Do not load runtime
6276 unit for GNATprove when parsing failed.
6277 * exp_ch9.adb: minor removal of extra whitespace
6278 * exp_ch6.adb: minor typo in comment
6279 * sem_util.adb: Code cleanup.
6280 * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
6281 * a-ngcefu.adb: minor style fix in whitespace
6283 2017-01-23 Thomas Quinot <quinot@adacore.com>
6285 * scos.ads: Document usage of 'd' as default SCO kind for
6287 * par_sco.adb (Traverse_Declarations_Or_Statements.
6288 Traverse_Degenerate_Subprogram): New supporting routine for expression
6289 functions and null procedures.
6290 (Traverse_Declarations_Or_Statements.Traverse_One): Add
6291 N_Expression_Function to the subprogram case; add required
6292 support for null procedures and expression functions.
6294 2017-01-23 Bob Duff <duff@adacore.com>
6296 * namet.ads (Bounded_String): Decrease the size of type
6297 Bounded_String to avoid running out of stack space.
6298 * namet.ads (Append): Don't ignore buffer overflow; raise
6299 Program_Error instead.
6301 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6303 * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
6304 sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
6306 * exp_ch9.adb: minor style fix in comment.
6308 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6310 * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
6311 for a limited record extension with unknown discriminants whose
6312 full view has no discriminants.
6314 2017-01-23 Yannick Moy <moy@adacore.com>
6316 * exp_spark.adb: Alphabetize with clauses.
6318 2017-01-23 Yannick Moy <moy@adacore.com>
6320 * sem_util.adb (Has_Enabled_Property): Treat
6321 protected objects and variables differently from other variables.
6323 2017-01-23 Thomas Quinot <quinot@adacore.com>
6325 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
6326 Split original Ada 95 part off into new subprogram
6327 below. Call that subprogram (instead of proceeding with
6328 AI95-0133 behaviour) if debug switch -gnatd.p is in use.
6329 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
6330 * debug.adb Document new switch -gnatd.p
6331 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
6332 record for reverse bit order if an error has already been posted
6333 on the record type. This avoids generating extraneous "info:"
6334 messages for illegal code.
6336 2017-01-23 Justin Squirek <squirek@adacore.com>
6338 * sem_ch3.adb (Analyze_Declarations): Correct comments
6339 * freeze.adb (Find_Constant): Add detection of deferred constants
6340 so they are not incorrectly flagged as premature.
6342 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6344 * scans.ads: New token At_Sign. Remove '@' from list of illegal
6345 characters for future version of the language. '@' is legal name.
6346 * scng.ads, scng.adb (Scan): Handle '@' appropriately.
6347 * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
6348 denotes a Target_Name.
6349 * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
6350 * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
6351 (Has_Target_Names): New flag on N_Assignment_Statement, to
6352 indicate that RHS has occurrences of N_Target_Name.
6353 * sem.adb: Call Analyze_Target_Name.
6354 * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
6355 (urrent_LHS): Global variable that denotes LHS of assignment,
6356 used in the analysis of Target_Name nodes.
6357 * sem_res.adb (Resolve_Target_Name): New procedure.
6358 * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
6359 N is an assignment statement whose RHS contains occurences of @
6360 that designate the value of the LHS of the assignment. If the
6361 LHS is side-effect free the target names can be replaced with
6362 a copy of the LHS; otherwise the semantics of the assignment
6363 is described in terms of a procedure with an in-out parameter,
6364 and expanded as such.
6365 (Expand_N_Assignment_Statement): Call
6366 Expand_Assign_With_Target_Names when needed.
6367 * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
6368 * sprint.adb: Handle N_Target_Name.
6370 2017-01-23 Eric Botcazou <ebotcazou@adacore.com>
6372 * checks.adb: Minor fix in comment.
6374 2017-01-23 Philippe Gil <gil@adacore.com>
6376 * g-debpoo.adb (Do_Report) remove freed chunks from chunks
6377 count in Sort = Memory_Usage or Allocations_Count
6379 2017-01-23 Justin Squirek <squirek@adacore.com>
6381 * sem_ch3.adb: Code cleanup.
6383 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6385 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
6386 variables to the local variable section. Update the profile
6387 of various nested routine that previously had visibility
6388 of those globals. One the matching phase has completed,
6389 remove certain classes of clauses which are considered noise.
6390 (Check_Dependency_Clause): Properly detect a match between two
6391 'Result attributes. Update the various post-match cases to use
6392 Is_Already_Matched as this routine now automatically recognizes
6393 a previously matched 'Result attribute.
6394 (Is_Already_Matched): New routine.
6395 (Remove_Extra_Clauses): New routine.
6396 (Report_Extra_Clauses): Remove the detection of ... => null
6397 clauses as this is now done in Remove_Extra_Clauses.
6399 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6401 * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
6402 report on spurious overlaps between values involving a subtype
6403 with a static predicate, because the expansion of such a subtype
6404 into individual ranges in inhibited in ASIS mode.
6406 2017-01-23 Justin Squirek <squirek@adacore.com>
6408 * sem_ch3.adb (Analyze_Declarations): Add detection
6409 of an edge case and delay freezing if it is present.
6411 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6413 * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
6414 sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
6416 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6418 * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
6419 access-to-subprogram types inherit the convention of the
6420 associated subprogram. (Set_Profile_Convention): New routine.
6421 * sem_ch6.adb (Check_Conformance): Do not compare the conventions
6422 of the two entities directly, use Conventions_Match to account
6423 for anonymous access-to-subprogram and subprogram types.
6424 (Conventions_Match): New routine.
6426 2017-01-23 Claire Dross <dross@adacore.com>
6428 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
6429 which return Universal_Integer, force the overflow check flag for
6430 Length and Range_Length for types as big as Long_Long_Integer.
6432 2017-01-23 Claire Dross <dross@adacore.com>
6434 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For
6435 attributes which return Universal_Integer, introduce a conversion
6436 to the expected type with the appropriate check flags set.
6437 * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
6438 base type if the range is null. It may still be invalid if it
6439 is higher than the lower bound. This is checked later in the
6440 context in which the range appears.
6442 2017-01-23 Pierre-Marie de Rodat <derodat@adacore.com>
6444 * scos.ads: Introduce a constant to represent ignored
6445 dependencies in SCO_Unit_Table_Entry.
6447 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6449 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
6450 spaces from error messages.
6452 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6454 * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
6455 subsidiary to Expand_N_Object_ Declaration, to compute a guard on
6456 an object declaration for an array type with a modular index type
6457 with the size of Long_Long_Integer. Special processing is needed
6458 in this case to compute reliably the size of the object, and
6459 eventually to raise Storage_Error, when wrap-around arithmetic
6460 might compute a meangingless size for the object.
6462 2017-01-23 Justin Squirek <squirek@adacore.com>
6464 * a-wtenau.adb, par-endh.adb, sem_prag.adb,
6465 sem_type.adb: Code cleanups.
6467 2017-01-23 Bob Duff <duff@adacore.com>
6469 * sem_res.adb (Resolve_Call): In the part of the code where
6470 it is deciding whether to turn the call into an indexed
6471 component, avoid doing so if the call is to an instance of
6472 Unchecked_Conversion. Otherwise, the compiler turns it into an
6473 indexed component, and resolution of that turns it back into a
6474 function call, and so on, resulting in infinite recursion.
6475 * sem_util.adb (Needs_One_Actual): If the first formal has a
6476 default, then return False.
6478 2017-01-21 Eric Botcazou <ebotcazou@adacore.com>
6480 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
6481 optimizations when the type is modular and the offsets are equal.
6483 2017-01-20 Thomas Quinot <quinot@adacore.com>
6485 * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
6488 2017-01-20 Nicolas Roche <roche@adacore.com>
6490 * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
6492 2017-01-20 Bob Duff <duff@adacore.com>
6494 * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
6495 (etc) optimizations when the type is modular.
6497 2017-01-20 Yannick Moy <moy@adacore.com>
6499 * sem_ch6.adb (Move_Pragmas): move some pragmas,
6500 but copy the SPARK_Mode pragma instead of moving it.
6501 (Build_Subprogram_Declaration): Ensure that the generated spec
6502 and original body share the same SPARK_Pragma aspect/pragma.
6503 * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
6504 procedure to copy SPARK_Mode aspect.
6506 2017-01-20 Bob Duff <duff@adacore.com>
6508 * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
6510 * sem_ch13.adb (Resolve_Name): Enable setting the entity to
6511 Empty even in ASIS mode.
6513 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6515 * exp_ch9.adb: minor style fixes in comments.
6516 * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
6517 relative statement introduces an implicit dependency on
6518 Ada.Real_Time.Clock_Time.
6519 * sem_util.adb: Minor reformatting.
6521 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6523 * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
6524 must be treated as delayed aspect even if the expression is
6525 a literal, because the aspect affects the freezing and the
6526 elaboration of the object to which it applies.
6528 2017-01-20 Tristan Gingold <gingold@adacore.com>
6530 * s-osinte-vxworks.ads (Interrup_Range): New subtype.
6532 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6534 * lib-xref.adb (Generate_Reference): Do not warn about the
6535 presence of a pragma Unreferenced if the entity appears as the
6536 actual in a procedure call that does not come from source.
6538 2017-01-20 Pascal Obry <obry@adacore.com>
6540 * expect.c, terminals.c: Fix some warnings about unused variables.
6541 * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
6544 2017-01-20 Bob Duff <duff@adacore.com>
6546 * exp_attr.adb (Constrained): Apply an access check (check that
6547 the prefix is not null) when the prefix denotes an object of an
6548 access type; that is, when there is an implicit dereference.
6550 2017-01-20 Gary Dismukes <dismukes@adacore.com>
6552 * s-rident.ads (constant Profile_Info): Remove
6553 No_Calendar from GNAT_Extended_Ravenscar restrictions.
6555 2017-01-20 Tristan Gingold <gingold@adacore.com>
6557 * s-maccod.ads: Add pragma No_Elaboration_Code_All
6559 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6561 * ghost.adb (Mark_Ghost_Clause): New routine.
6562 (Prune_Node): Do not prune compilation unit nodes.
6563 (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
6564 This does not touch the node itself, but does prune all its fields.
6565 * ghost.ads (Mark_Ghost_Clause): New routine.
6566 * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
6567 package clause mentions Ghost and non-Ghost packages. Mark a
6568 use package clause as Ghost when it mentions a Ghost package.
6569 (Analyze_Use_Type): Emit an error when a use type clause mentions
6570 Ghost and non-Ghost types. Mark a use type clause as Ghost when
6571 it mentions a Ghost type.
6572 * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
6573 Ghost when it withs a Ghost unit.
6575 2017-01-20 Javier Miranda <miranda@adacore.com>
6577 * sem_res.adb (Resolve_Call): If a function call
6578 returns a limited view of a type and at the point of the call the
6579 function is not declared in the extended main unit then replace
6580 it with the non-limited view, which must be available. If the
6581 called function is in the extended main unit then no action is
6582 needed since the back-end handles this case.
6584 2017-01-20 Eric Botcazou <ebotcazou@adacore.com>
6586 * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
6587 (Contains_Subprograms_Refs): ...this. Adjust comment
6588 for constants. (Is_Subp_Or_Const_Ref): Rename into...
6589 (Is_Subprogram_Ref): ...this.
6590 (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
6591 Has_Non_Subprograms_Referencer and adjust comment. Remove
6592 incorrect shortcut for package declarations and bodies.
6594 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6596 * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
6597 base type differs from that of the completion and the private
6598 subtype is an itype (created for a constraint on an access
6599 type e.g.), set Delayed_Freeze on both to prevent out-of-scope
6602 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6604 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
6605 When inheriting the SPARK_Mode of a prior expression function,
6606 look at the properly resolved entity rather than the initial
6607 candidate which may denote a homonym.
6609 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6611 * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
6612 Precondition or Postcondition, and the context is pragma
6613 Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
6614 and suggest the standard names Assertion_Policy /Pre /Post
6617 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6619 * sem_ch10.adb, sem_cat.adb: Minor reformatting.
6621 2017-01-20 Javier Miranda <miranda@adacore.com>
6623 * sem_ch3.adb (Access_Type_Declaration): Protect access to the
6625 * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
6626 * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
6629 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6631 * sem_ch13.adb (Analyze_Aspect_Specification, case
6632 Dynamic_Predicate): If the entity E is a subtype that inherits
6633 a static predicate for its parent P,, the inherited and the
6634 new predicate combine in the generated predicate function,
6635 and E only has a dynamic predicate.
6637 2017-01-20 Tristan Gingold <gingold@adacore.com>
6639 * s-boustr.ads, s-boustr.adb: New package.
6640 * Makefile.rtl: Add s-boustr.
6642 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6644 * inline.adb (Process_Formals): Qualify the
6645 expression of a return statement when it yields a universal type.
6647 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6649 * freeze.adb (Freeze_All): Freeze the default
6650 expressions of all eligible formal parameters that appear in
6651 entries, entry families, and protected subprograms.
6653 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6655 * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
6656 for illegal inherited Implicit_Dereference aspects with renamed
6659 2017-01-20 Javier Miranda <miranda@adacore.com>
6661 * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
6662 * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
6663 * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
6664 (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
6665 Set_Prev, Tree_Read): Adding assertion.
6666 * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
6667 * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
6668 (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
6669 Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
6670 Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
6671 Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
6672 Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
6673 Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
6674 Set_ListN_With_Parent): Adding assertion.
6676 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6678 * sem_prag.adb (Process_Convention): Diagnose properly a pragma
6679 import that applies to several homograph subprograms. when one
6680 of them is declared by a subprogram body.
6682 2017-01-20 Justin Squirek <squirek@adacore.com>
6684 * exp_ch6.adb (Expand_Call): Remove optimization
6685 that nulls out calls to null procedures.
6687 2017-01-20 Yannick Moy <moy@adacore.com>
6689 * inline.adb (Expand_Inlined_Call): Keep more
6690 precise type of actual for inlining whenever possible. In
6691 particular, do not switch to the formal type in GNATprove mode in
6692 some case where the GNAT backend might require it for visibility.
6694 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6696 * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
6697 aspect Implicit_Dereference can be inherited by a full view if
6698 the partial view has no discriminants, because there is no way
6699 to apply the aspect to the partial view.
6700 (Build_Derived_Record_Type): If derived type renames discriminants
6701 of the parent, the new discriminant inherits the aspect from
6703 * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
6704 call through an access discriminant designating a subprogram.
6705 * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
6706 properly a parameterless call through an access discriminant on
6707 the left-hand side of an assignment.
6708 * sem_res.adb (resolve): If an interpreation involves a
6709 discriminant with an implicit dereference and the expression is an
6710 entity, resolution takes place later in the appropriate routine.
6711 * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
6712 access discriminants that designate a subprogram type.
6714 2017-01-20 Pascal Obry <obry@adacore.com>
6716 * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
6718 2017-01-20 Yannick Moy <moy@adacore.com>
6720 * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
6721 on implicitly with'ed units in GNATprove mode.
6722 * sinfo.ads (Implicit_With): Document use of flag for implicitly
6723 with'ed units in GNATprove mode.
6725 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6727 * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
6728 unit Do not report an error on a non-static entity that appears
6729 in the context of a spec expression, such as an aspect expression.
6731 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6733 * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
6734 (Is_Underlying_Full_View): New routine.
6735 (Set_Is_Underlying_Full_View): New routine.
6736 (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
6737 * einfo.ads Add new attribute Is_Underlying_Full_View.
6738 (Is_Underlying_Full_View): New routine along with pragma Inline.
6739 (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
6740 * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
6741 class-wide types and underlying full views. The first subtype
6742 is used as the working type for all Itypes, not just array base types.
6743 (Build_DIC_Procedure_Declaration): Do not consider
6744 class-wide types and underlying full views. The first subtype
6745 is used as the working type for all Itypes, not just array
6747 * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
6748 view or an underlying full view without clobbering the attributes
6749 of a previous freeze node.
6750 (Inherit_Freeze_Node): New routine.
6751 * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
6753 (Build_Underlying_Full_View): Mark an underlying full view as such.
6754 * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
6757 2017-01-20 Yannick Moy <moy@adacore.com>
6759 * sinfo.ads: Document lack of Do_Division_Check flag
6760 on float exponentiation.
6762 2017-01-19 Javier Miranda <miranda@adacore.com>
6764 * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
6765 identifier attribute of a block-statement node. Required to avoid
6766 assertion failure when building the new containers library.
6768 2017-01-19 Bob Duff <duff@adacore.com>
6770 * exp_ch3.adb: Update comment.
6772 2017-01-19 Vincent Celier <celier@adacore.com>
6774 * gprep.adb (Gnatprep): Parse the definition file without
6775 "replace in comments" even when switch -C is used.
6777 2017-01-19 Justin Squirek <squirek@adacore.com>
6779 * exp_ch9.adb (Is_Pure_Barrier): Create function
6780 Is_Count_Attribute to identify an expansion of the 'Count
6783 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6785 * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
6786 statements within an element iterator loop are only analyzed
6787 agter the loop is rewritten. Within a generic the analysis must
6788 be performed in any case to complete name capture.
6790 2017-01-19 Bob Duff <duff@adacore.com>
6792 * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
6793 before checking for unrecognized pragmas.
6794 Initialize Pname on its declarations; that's always good style.
6796 2017-01-19 Claire Dross <dross@adacore.com>
6798 * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
6799 body into the tree for GNATprove by setting its Parent field. The
6800 components invariants of composite types are not checked by
6801 the composite type's invariant procedure in GNATprove mode.
6802 (Build_Invariant_Procedure_Declaration): Semi-insert the
6803 declaration into the tree for GNATprove by setting its Parent
6805 * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
6806 the component invariants to the array type invariant procedure
6807 so that the procedure can be used to check the array type
6809 (Freeze_Record_Type): In GNATprove mode, do
6810 not add the component invariants to the record type invariant
6811 procedure so that the procedure can be used to check the record
6812 type invariants if any.
6814 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6816 * lib-xref-spark_specific.adb: Minor reformatting.
6817 * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
6819 2017-01-19 Javier Miranda <miranda@adacore.com>
6821 * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
6822 Build_Back_End_Aggregate.
6823 (Generate_Aggregate_For_Derived_Type): Code cleanup.
6824 (Prepend_Stored_Values): Code cleanup.
6826 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6828 * sem_ch6.adb (Analyze_Expression_Function): Check for an
6829 incomplete return type after attempting to freeze it, so that
6830 other freeze actiona are generated in the proper order.
6832 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6834 * sem_aggr.adb (Resolve_Aggregate): If the type is a string
6835 type, ie. a type whose component is a character type, and the
6836 aggregate is positional, do not convert into a string literal
6837 if the index type is not an integer type, because the original
6838 type may be required in an enclosing operation.
6840 2017-01-19 Bob Duff <duff@adacore.com>
6842 * binde.adb, debug.adb: Enable new elaboration order algorithm
6843 by default. -dp switch reverts to the old algorithm.
6845 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6847 * sem_ch3.adb Add with and use clauses for Exp_Ch7.
6848 (Analyze_Declarations): Create the DIC and Invariant
6849 procedure bodies s after all freezing has taken place.
6850 (Build_Assertion_Bodies): New routine.
6851 * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
6853 (Analyze_Package_Specification): Remove the
6854 generation of the DIC and Invariant procedure bodies. This is
6855 now done by Analyze_Declarations.
6856 * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
6857 procedures are never treated as primitives.
6859 2017-01-19 Yannick Moy <moy@adacore.com>
6861 * frontend.adb: Analyze inlined bodies and check elaboration
6862 rules in GNATprove mode too.
6863 * sem_elab.adb (Delay_Element): Add Boolean component to save
6864 indication that call is in SPARK code. (Check_Elab_Calls):
6865 Check elaboration rules in GNATprove mode, and correctly set
6866 the current value of SPARK_Mode.
6867 * lib-xref-spark_specific.adb
6868 (Add_SPARK_Xrefs): Simplify iteration over dereferences.
6870 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6872 * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
6873 checks on the expression for the high bound of concatenation
6874 when checks are disabled, to suppress warnings about potential
6875 constraint errors in restricted runtimes.
6877 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6879 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
6880 representation-to-position function as inlined.
6881 * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
6882 the purity of an internally generated entity if it has been
6883 explicitly marked as pure for optimization purposes.
6884 * exp_aggr.adb: Minor reformatting.
6886 2017-01-19 Javier Miranda <miranda@adacore.com>
6888 * exp_ch6.adb (Expand_Call): Remove side effects on
6889 actuals that are allocators with qualified expression since the
6890 initialization of the object is performed by means of individual
6891 statements (and hence it must be done before the call).
6893 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6895 * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
6896 (Build_Derived_Enumeration_Type): If the derived type inherits a
6897 dynamic predicate from its parent, the bounds of the type must
6898 freeze because an explicit constraint is constructed for the
6899 type and the corresponding range is elaborated now.
6901 2017-01-19 Arnaud Charlet <charlet@adacore.com>
6903 * sem_attr.ads: minor fix of inconsistent casing in comment
6904 * lib-writ.ads: minor align comments in columns
6905 * sem_ch3.adb: Minor reformatting.
6906 * spark_xrefs.ads: minor fix typo in SPARK-related comment
6907 * table.ads: minor style fix in comment
6908 * lib-xref-spark_specific.adb
6909 (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
6910 * sem_ch12.adb: minor whitespace fix
6911 * freeze.adb: Add comment.
6912 * sem_util.adb (Unique_Name): for instances of
6913 generic subprograms ignore the name of the wrapper package.
6915 2017-01-19 Javier Miranda <miranda@adacore.com>
6917 * exp_aggr.adb (Resolve_Record_Aggregate):
6918 Factorize code needed for aggregates of limited and unlimited
6919 types in a new routine.
6920 (Pass_Aggregate_To_Back_End): New subprogram.
6922 2017-01-19 Yannick Moy <moy@adacore.com>
6924 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
6926 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6928 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
6929 public, for use elsewhere.
6930 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
6931 an Inlined_body, recognize a call that uses object notation
6932 and has not been rewritten as a regular call because regular
6933 expansion has not taken place.
6935 2017-01-19 Bob Duff <duff@adacore.com>
6937 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
6938 in case of generic formal discrete types, because it causes crashes in
6939 the compiler when built with assertions on.
6941 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6943 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
6944 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
6946 2017-01-19 Bob Duff <duff@adacore.com>
6948 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
6949 Increment Warnings_Detected. It was decrementing, which is
6950 wrong since we just issued a warning message.
6951 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
6952 these variables to be of subtype Nat instead of Int, because
6953 they should never be negative.
6955 2017-01-19 Javier Miranda <miranda@adacore.com>
6957 * contracts.adb (Build_Postconditions_Procedure): Replace
6958 Generate_C_Code by Modify_Tree_For_C.
6959 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
6960 Replace Generate_C_Code by Modify_Tree_For_C.
6961 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
6963 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
6964 Generate_C_Code by Modify_Tree_For_C.
6965 * exp_ch4.adb (Expand_Allocator_Expression): Replace
6966 Generate_C_Code by Modify_Tree_For_C.
6967 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
6968 by Modify_Tree_For_C.
6969 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
6970 Generate_C_Code by Modify_Tree_For_C.
6971 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
6972 by Modify_Tree_For_C.
6973 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
6975 2017-01-19 Javier Miranda <miranda@adacore.com>
6977 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
6979 (Is_Inlinable_Expression_Function): New subprogram.
6980 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
6982 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
6984 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6986 * sem_ch4.adb (Diagnose_Call): Improve error message when a
6987 selected component has a prefix that might be interpreted
6988 as a parameterless function call, but none of the candidate
6989 interpretations is parameterless, and there is a hidden homonym
6990 of the prefix that is a package.
6991 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
6992 interpreted as a parameterless function call and its analysis
6993 fails, do not call Analyze_Selected_Component.
6995 2017-01-19 Steve Baird <baird@adacore.com>
6997 * sem_util.ads: Add new Use_Full_View Boolean parameter to
6999 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
7000 calls to a newly-defined Scalar_Range_Of_Right_View function.
7002 2017-01-19 Arnaud Charlet <charlet@adacore.com>
7004 * gnat1drv.adb: minor fix of unbalanced parens in comment
7005 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
7006 to visible part of the package to allow re-use in GNATprove.
7007 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
7008 from repeated code of Traverse_Compilation_Unit.
7009 (Traverse_Declaration_Or_Statement): fixed detection of
7010 generic subprograms and packages; also, iteration over case
7011 statement alternatives rewritten to avoid testing if the first
7012 alternative is present (since it must be present due to Ada
7013 syntax restrictions).
7015 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
7017 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
7018 returning by reference not just for subprogram body stubs,
7019 but for all subprogram cases.
7020 * sem_util.adb: Code reformatting.
7021 (Requires_Transient_Scope): Update the call to Results_Differ.
7022 (Results_Differ): Update the parameter profile and the associated
7025 2017-01-19 Ed Schonberg <schonberg@adacore.com>
7027 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
7028 identifier nodes that do not come from source, to handle properly
7029 dimensionality check within an inlined body which inclddes both
7030 original operands and rewritten operands. This removes spurious
7031 dimensionality errors in the presence of front-end inlining,
7032 as well as in SPARK mode.
7034 2017-01-16 Jakub Jelinek <jakub@redhat.com>
7037 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
7039 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7041 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
7043 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7045 * doc/gnat_ugn/getting_started_with_gnat.rst,
7046 doc/gnat_ugn/inline_assembler.rst,
7047 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
7048 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
7049 doc/gnat_ugn/about_this_guide.rst,
7050 doc/gnat_ugn/platform_specific_information.rst,
7051 doc/gnat_ugn/example_of_binder_output.rst,
7052 doc/gnat_ugn/gnat_and_program_execution.rst,
7053 doc/gnat_ugn/gnat_utility_programs.rst,
7054 doc/gnat_ugn/the_gnat_compilation_model.rst,
7055 doc/gnat_rm/implementation_defined_attributes.rst,
7056 doc/gnat_rm/compatibility_and_porting_guide.rst,
7057 doc/gnat_rm/standard_library_routines.rst,
7058 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
7059 doc/gnat_rm/implementation_defined_pragmas.rst,
7060 doc/gnat_rm/the_gnat_library.rst,
7061 doc/gnat_rm/obsolescent_features.rst,
7062 doc/gnat_rm/about_this_guide.rst,
7063 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
7064 doc/gnat_rm/implementation_of_ada_2012_features.rst,
7065 doc/gnat_rm/interfacing_to_other_languages.rst,
7066 doc/gnat_rm/implementation_defined_aspects.rst,
7067 doc/gnat_rm.rst: Update documentation.
7068 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
7070 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7072 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
7073 * scil_ll.adb: Minor style fix in comment.
7074 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
7075 even if entity is already set, because the node may be renalyzed
7076 after inlining transformations.
7078 2017-01-13 Javier Miranda <miranda@adacore.com>
7080 * sem_res.adb (Resolve_Call): Do not establish a transient scope
7081 for a call to inlinable expression function (since the call will
7082 be replaced by its returned object).
7083 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
7084 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
7085 (Expand_Call): For inlinable expression function call replace the
7086 call by its returned object.
7087 (Is_Inlinable_Expression_Function): New subprogram.
7089 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7091 * checks.adb: Minor typo fix and reformatting.
7093 2017-01-13 Javier Miranda <miranda@adacore.com>
7095 * contracts.adb (Contract_Only_Subprograms): Remove formal.
7096 (Copy_Original_Specification): Removed.
7097 (Skip_Contract_Only_Subprogram): Move here checks previously
7098 located in the caller of this routine (to leave the code more clean).
7099 (Build_Contract_Only_Subprogram): Code cleanup.
7100 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
7101 (Get_Contract_Only_Missing_Body_Name): Removed.
7103 2017-01-13 Javier Miranda <miranda@adacore.com>
7105 * sem_ch6.adb (Cloned_Expression): New subprogram.
7106 (Freeze_Expr_Types): Complete previous patch since the expression
7107 of an expression-function may have iterators and loops with
7108 defining identifiers which, as part of the preanalysis of the
7109 expression, may be left decorated with itypes that will not be
7110 available in the tree passed to the backend.
7112 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7114 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
7115 conversion to Integer of an expression that is an attribute
7116 reference 'Pos on an enumeration type.
7118 2017-01-13 Bob Duff <duff@adacore.com>
7120 * atree.ads: Minor comment fix.
7122 2017-01-13 Justin Squirek <squirek@adacore.com>
7124 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
7125 calls in accessibility check on return statement.
7127 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7129 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
7130 Ensure that the input body is a subprogram body before trying to
7131 determine whether it denoted an expression function. Note that
7132 subprogram body stubs cannot denote expression functions.
7134 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7136 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
7139 2017-01-13 Javier Miranda <miranda@adacore.com>
7141 * einfo.ads (Component_Bit_Offset): Fix documentation.
7142 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
7143 on record holes for components with unknown compile-time offsets.
7145 2017-01-13 Bob Duff <duff@adacore.com>
7147 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
7148 * g-locfil.ads: Minor comment fix.
7150 2017-01-13 Bob Duff <duff@adacore.com>
7152 * binde.adb (Elab_New): New elaboration order algorithm
7153 that is expected to cause fewer ABE issues. This is a work in
7154 progress. The new algorithm is currently disabled, and can be
7155 enable by the -dp switch, or by modifying the Do_Old and Do_New
7156 etc. flags and rebuilding. Experimental code is included to
7157 compare the results of the old and new algorithms.
7158 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
7159 can have multiple of these tables, so the old and new algorithms
7161 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
7162 parameter of type array. This avoids the global variable, and
7163 allows bounds checking (which is normally defeated by the tables
7164 packages). It also ensures that the Elab_Order is read-only
7166 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
7167 subprograms that need it, as above.
7168 * debug.adb: Document new -dp switch. Modify doc of old -do
7170 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
7171 and Bindgen. Move writing of closure (-R and -Ra switches)
7172 to Binde; that's more convenient.
7174 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7176 * sem_ch6.adb (Analyze_Expression_Function): If the expression
7177 function is a completion, all entities referenced in the
7178 expression are frozen. As a consequence, a reference to an
7179 uncompleted private type from an enclosing scope is illegal.
7181 2017-01-13 Javier Miranda <miranda@adacore.com>
7183 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
7184 (Analyze_Subprogram_Body_Helper): At the occurrence of an
7185 expression function declaration that is a completion, its
7186 expression causes freezing (AI12-0103).
7188 2017-01-13 Vadim Godunko <godunko@adacore.com>
7190 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
7191 Reference functions of Ada.Containers.Indefinite_Holders.
7193 2017-01-13 Bob Duff <duff@adacore.com>
7195 * s-os_lib.ads: Minor comment fixes.
7197 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7199 * exp_ch3.adb (Default_Initialize_Object): Do not default
7200 initialize an object when it is of a task type and restriction
7201 No_Tasking is in effect because the initialization is obsolete.
7202 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
7203 restriction No_Tasking is in effect.
7204 (Build_Master_Renaming): Do not rename a master when restriction
7205 No_Tasking is in effect.
7207 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7209 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
7210 the legality of An others clause applies as well to a choice in
7211 an Iterated_component_ association.
7212 (Resolve_Iterated_Component_Association): An others choice
7214 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
7215 Iterated_Component_Association is not static.
7217 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7219 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
7220 control is passed to the expresion handler before the new mode
7222 * sem_ch12.adb (Analyze_Package_Instantiation,
7223 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
7224 in case control is passed to the expresion handler before the
7227 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7229 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
7230 exp_aggr.adb: Minor reformatting.
7232 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7234 * inline.adb: Minor reformatting and typo fix.
7236 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7238 * sem_util.ads, sem_util.adb (Choice_List): Move function here
7239 from sem_aggr.adb, for use elsewhere.
7240 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
7241 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
7242 Iterated_Component_Present.
7243 * exp_aggr.adb: Use Choice_List throughout, to handle
7244 Iterated_Component_Associations.
7245 (Gen_Loop): Generate proper loop for an
7246 Iterated_Component_Association: loop variable has the identifier
7247 of the original association. Generate a loop even for a single
7248 component choice, in order to make loop parameter visible in
7250 (Flatten): An Iterated_Component_Association is not static.
7252 2017-01-13 Yannick Moy <moy@adacore.com>
7254 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
7255 float exponentiation for statically known small negative values
7256 is the reciprocal of the exponentiation for the opposite value
7258 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
7259 Ensure that the value of float exponentiation for negative values
7260 is the reciprocal of the exponentiation for the opposite value
7262 * inline.adb (Expand_Inlined_Call): Fix the count
7263 for the number of generated gotos.
7265 2017-01-13 Yannick Moy <moy@adacore.com>
7267 * inline.adb: Code cleanup.
7268 * sem_util.adb (Is_OK_Volatile_Context): Add
7269 expression in delay statement as OK for volatile context.
7271 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7273 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
7274 mode a choice that is a subtype with a static predicate is
7275 replaced by the values it covers. This transformation must not
7276 be performed in ASIS mode, to preserve the source for analysis.
7278 2017-01-13 Justin Squirek <squirek@adacore.com>
7280 * nlists.ads: Correct minor typo.
7282 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7284 * sem_ch13.adb: Minor reformatting and typo fix.
7286 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7288 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
7289 Iterated_Component_Association is a named association in an
7291 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
7292 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
7293 and resolve the discrete choices and the expression of the
7295 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
7296 Loop_Actions and Box_Present are attributes of
7297 N_Iterated_Component_Association nodes. Box_Present is always
7299 * sprint.adb (Sprint_Node): An Iterated_Component_Association
7300 has a Discrete_Choices list, as specified in the RM. A
7301 Component_Association for aggregate uses instead a Choices list.
7302 We have to live with this small inconsistency because the new
7303 construct also has a defining identifier, and there is no way
7304 to merge the two node structures.
7306 2017-01-13 Yannick Moy <moy@adacore.com>
7308 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
7309 list of pragmas to remove. Remove pragmas from the list of
7310 statements in the body to inline.
7311 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
7313 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7315 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
7316 Analyze_Declarations, to analyze and resolve the expressions of
7317 aspect specifications in the current declarative list, so that
7318 the expressions have proper entity and type info. This is needed
7319 for ASIS when there is no subsequent expansion to generate this
7320 semantic information.
7321 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
7322 original expression, to suppress cascaded errors when expression
7323 has been constant-folded.
7324 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
7325 ASIS mode, because there is no subsequent expansion to decorate
7328 2017-01-13 Yannick Moy <moy@adacore.com>
7330 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
7331 New function to detect when a call may be inlined or not in
7333 (Expand_Inlined_Call): Ensure that a temporary
7334 is always created in the cases where a type conversion may be
7335 needed on an input parameter in GNATprove mode, so that GNATprove
7336 sees the check to perform.
7337 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
7338 when not applicable due to actual requiring type conversion
7339 with possible check but no temporary value can be copied for
7340 GNATprove to see the check.
7342 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7344 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
7345 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
7346 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
7347 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
7348 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
7349 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
7350 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
7351 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
7352 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
7353 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
7354 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
7355 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
7356 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
7357 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
7358 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
7359 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
7360 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
7361 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
7362 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
7363 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
7364 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
7365 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
7366 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
7367 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
7368 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
7369 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
7370 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
7371 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
7372 statements to reflect the new style for case alternatives. Various
7373 code clean up and reformatting.
7375 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7377 * exp_util.adb: Minor reformatting.
7379 2017-01-13 Yannick Moy <moy@adacore.com>
7381 * exp_spark.adb: Code cleanup.
7382 * sem_ch9.adb (Analyze_Delay_Until): Resolve
7383 expression so that calls are identified as such inside delay
7386 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7388 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
7389 * par-ch3.adb (P_Discrete_Choice_List): An
7390 Iterated_Component_Association is an array aggregate component.
7391 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
7392 (Is_Quantified_Expression): New function that performs a lookahead
7393 to distinguish quantified expressions from iterated component
7395 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
7397 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
7398 * sem.adb (Analyze): Handle Iterated_Component_Association.
7399 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
7400 component associations.
7401 * sinfo.ads, sinfo.adb: Entries for for
7402 N_Iterated_Component_Association and its fields.
7403 * sprint.adb (Sprint_Node_Actual): Handle
7404 N_Iterated_Component_Association.
7406 2017-01-13 Justin Squirek <squirek@adacore.com>
7408 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
7409 of the style check until after preanalysis of acutals.
7411 2017-01-13 Yannick Moy <moy@adacore.com>
7413 * sem_ch13.adb: Minor reformatting.
7414 * par-ch11.adb: minor style fix in whitespace
7415 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
7416 reduced to Add_Artificial_ALI_File; style fix in declaration of
7417 Text; grammar fix in comment.
7418 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
7419 * freeze.adb: Cleanup to pass pragma instead of
7421 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
7422 replace System'To_Address by equivalent call.
7424 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7426 * bindusg.adb: Improve usage output for -f switch.
7428 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7430 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
7433 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7435 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
7436 treat comparisons on strings as legal in a Static_Predicate.
7437 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
7438 a function call that is the expansion of a string comparison.The
7439 function call is built when compiling the corresponding predicate
7440 function, but the expression has been found legal as a static
7441 predicate during earlier analysis.
7442 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
7443 properly a function call that is the expansion of a string
7444 comparison operation, in order to recover the Static_Predicate
7445 expression and apply it to a static argument when needed.
7447 2017-01-13 Tristan Gingold <gingold@adacore.com>
7449 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
7450 (Open_Read): Re-implement using Open_Read_No_Exception.
7451 (Open_Write): Raise exception in case of error.
7452 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
7453 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
7455 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
7457 2017-01-13 Yannick Moy <moy@adacore.com>
7459 * checks.adb: Code cleanup.
7461 2017-01-13 Yannick Moy <moy@adacore.com>
7463 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
7464 expression instead of unanalyzed aspect expression for checking
7465 the validity of inheriting an operation. Also copy the expression
7466 being passing it to Build_Class_Wide_Expression, as this call
7467 modifies its argument.
7468 * sem_util.ads Fix comment to reference correct function name
7471 2017-01-13 Javier Miranda <miranda@adacore.com>
7473 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
7474 when we propagate information about the indexes back to the original
7475 indexing mode and the prefix of the index is a function call, do not
7476 remove any parameter from such call.
7478 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7480 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
7481 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
7482 a build-in-place function whose result type is tagged.
7484 2017-01-13 Yannick Moy <moy@adacore.com>
7486 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7487 Do not generate a wrapper when the only candidate is a class-wide
7489 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
7490 inside a generic context.
7492 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7494 * exp_util.adb (Add_Inherited_Tagged_DIC):
7495 Pass the object parameters of both the parent and the derived
7496 type DIC procedure to the reference replacement circuitry.
7497 (Find_DIC_Type): Modify the circuitry to present the partial
7498 view of a private type in case the private type defines its own
7500 (Replace_Object_And_Primitive_References): Add two
7501 optional formal parameters. Update the comment on usage. Update
7502 the replacement of references to object parameters.
7504 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7506 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
7508 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7510 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
7511 an out parameter that is a type conversion, independently of th
7512 range check that may apply to the expression of the conversion,
7513 for use in GNATProve.
7515 2017-01-13 Yannick Moy <moy@adacore.com>
7517 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
7518 GNATprove_Mode here to Frontend.
7519 * frontend.adb (Frontend): Move the implicit with for System
7520 in GNATprove_Mode here as it ismore correct this way; the old
7521 place only worked by chance, since there were no overloaded names.
7522 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
7523 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
7524 four attributes identified in SRM 9(18), add an implicit with
7525 to Ada.Task_Identification.
7526 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7527 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
7529 * checks.adb (Apply_Discriminant_Check,
7530 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
7531 In GNATprove mode, we do not apply the checks, but we still
7532 analyze the expression to possibly issue errors on SPARK
7533 code when a run-time error can be detected at compile time.
7534 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
7537 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7539 * expander.adb (Expand): Add a warning about using return
7540 statements in Ghost management code.
7541 * exp_ch3.adb (Freeze_Type): Add a warning about using return
7542 statements in Ghost management code.
7543 * exp_ch7.adb (Build_Invariant_Procedure_Body,
7544 Build_Invariant_Procedure_Declaration): Add a warning about
7545 using return statements in Ghost management code.
7546 * exp_disp.adb (Make_DT): Add a warning about using return
7547 statements in Ghost management code.
7548 * exp_util.adb (Build_DIC_Procedure_Body,
7549 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
7550 warning about using return statements in Ghost management code.
7551 * freeze.adb (Freeze_Entity): Add a warning about using return
7552 statements in Ghost management code.
7553 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
7554 statements in Ghost management code.
7555 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
7556 a warning about using return statements in Ghost management code.
7557 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
7558 return statements in Ghost management code.
7559 * sem_ch6.adb (Analyze_Procedure_Call,
7560 Analyze_Subprogram_Body_Helper): Add a warning about using return
7561 statements in Ghost management code.
7562 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
7563 using return statements in Ghost management code.
7564 * sem_ch12.adb (Analyze_Package_Instantiation,
7565 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
7566 Instantiate_Subprogram_Body): Add a warning about using return
7567 statements in Ghost management code.
7568 * sem_ch13.adb (Build_Predicate_Functions,
7569 Build_Predicate_Function_Declarations): Add a warning about
7570 using return statements in Ghost management code.
7571 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
7572 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
7573 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
7574 using return statements in Ghost management code.
7576 2017-01-13 Tristan Gingold <gingold@adacore.com>
7578 * s-mmosin-mingw.adb: Fix pragma import.
7580 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7582 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
7585 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7587 * atree.adb (Allocate_Initialize_Node): A newly created node is
7588 no longer marked as Ghost at this level.
7589 (Mark_New_Ghost_Node): New routine.
7590 (New_Copy): Mark the copy as Ghost.
7591 (New_Entity): Mark the entity as Ghost.
7592 (New_Node): Mark the node as Ghost.
7593 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
7594 apply to unanalyzed entities.
7595 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
7597 (Set_Is_Checked_Ghost_Entity): This attribute now
7598 applies to all entities as well as unanalyzed entities.
7599 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
7600 all entities as well as unanalyzed entities.
7601 * expander.adb Add with and use clauses for Ghost.
7602 (Expand): Install and revert the Ghost region associated with the node
7604 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
7605 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
7606 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
7607 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
7608 (Freeze_Type): Install and revert the Ghost region associated
7609 with the type being frozen.
7610 * exp_ch5.adb Remove with and use clauses for Ghost.
7611 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
7612 * exp_ch6.adb Remove with and use clauses for Ghost.
7613 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
7614 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
7615 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
7616 Ghost region of the working type.
7617 (Build_Invariant_Procedure_Declaration): Install and revert
7618 the Ghost region of the working type.
7619 (Expand_N_Package_Body): Remove all Ghost-related code.
7620 * exp_ch8.adb Remove with and use clauses for Ghost.
7621 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
7623 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
7624 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
7625 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
7627 * exp_ch13.adb Remove with and use clauses for Ghost.
7628 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
7629 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
7630 the tagged type. Move the generation of various entities within
7631 the Ghost region of the type.
7632 * exp_prag.adb Remove with and use clauses for Ghost.
7633 (Expand_Pragma_Check): Remove all Ghost-related code.
7634 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
7635 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
7636 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
7637 * exp_util.adb (Build_DIC_Procedure_Body): Install
7638 and revert the Ghost region of the working types.
7639 (Build_DIC_Procedure_Declaration): Install and revert the
7640 Ghost region of the working type.
7641 (Make_Invariant_Call): Install and revert the Ghost region of the
7643 (Make_Predicate_Call): Reimplemented. Install and revert the
7644 Ghost region of the associated type.
7645 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
7646 of the entity being frozen.
7647 (New_Freeze_Node): Removed.
7648 * ghost.adb Remove with and use clauses for Opt.
7649 (Check_Ghost_Completion): Update the parameter profile
7650 and all references to formal parameters.
7651 (Ghost_Entity): Update the comment on usage.
7652 (Install_Ghost_Mode): New routines.
7653 (Is_Ghost_Assignment): New routine.
7654 (Is_Ghost_Declaration): New routine.
7655 (Is_Ghost_Pragma): New routine.
7656 (Is_Ghost_Procedure_Call): New routine.
7657 (Is_Ghost_Renaming): Removed.
7658 (Is_OK_Declaration): Reimplemented.
7659 (Is_OK_Pragma): Reimplemented.
7660 (Is_OK_Statement): Reimplemented.
7661 (Is_Subject_To_Ghost): Update the comment on usage.
7662 (Mark_And_Set_Ghost_Assignment): New routine.
7663 (Mark_And_Set_Ghost_Body): New routine.
7664 (Mark_And_Set_Ghost_Completion): New routine.
7665 (Mark_And_Set_Ghost_Declaration): New routine.
7666 (Mark_And_Set_Ghost_Instantiation): New routine.
7667 (Mark_And_Set_Ghost_Procedure_Call): New routine.
7668 (Mark_Full_View_As_Ghost): Removed.
7669 (Mark_Ghost_Declaration_Or_Body): New routine.
7670 (Mark_Ghost_Pragma): New routine.
7671 (Mark_Ghost_Renaming): New routine.
7672 (Mark_Pragma_As_Ghost): Removed.
7673 (Mark_Renaming_As_Ghost): Removed.
7674 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
7675 (Prune_Node): Freeze nodes no longer need special pruning, they
7676 are processed by the general ignored Ghost code mechanism.
7677 (Restore_Ghost_Mode): New routine.
7678 (Set_Ghost_Mode): Reimplemented.
7679 (Set_Ghost_Mode_From_Entity): Removed.
7680 * ghost.ads Add with and use clauses for Ghost.
7681 (Check_Ghost_Completion): Update the parameter profile
7682 along with the comment on usage.
7683 (Install_Ghost_Mode): New routine.
7684 (Is_Ghost_Assignment): New routine.
7685 (Is_Ghost_Declaration): New routine.
7686 (Is_Ghost_Pragma): New routine.
7687 (Is_Ghost_Procedure_Call): New routine.
7688 (Mark_And_Set_Ghost_Assignment): New routine.
7689 (Mark_And_Set_Ghost_Body): New routine.
7690 (Mark_And_Set_Ghost_Completion): New routine.
7691 (Mark_And_Set_Ghost_Declaration): New routine.
7692 (Mark_And_Set_Ghost_Instantiation): New routine.
7693 (Mark_And_Set_Ghost_Procedure_Call): New routine.
7694 (Mark_Full_View_As_Ghost): Removed.
7695 (Mark_Ghost_Pragma): New routine.
7696 (Mark_Ghost_Renaming): New routine.
7697 (Mark_Pragma_As_Ghost): Removed.
7698 (Mark_Renaming_As_Ghost): Removed.
7699 (Restore_Ghost_Mode): New routine.
7700 (Set_Ghost_Mode): Redefined.
7701 (Set_Ghost_Mode_From_Entity): Removed.
7702 * sem.adb (Analyze): Install and revert the Ghost region of the
7703 node being analyzed.
7704 (Do_Analyze): Change the way a clean Ghost
7705 region is installed and reverted.
7706 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
7707 all Ghost-related code.
7708 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
7709 (Analyze_Number_Declaration): Remove all Ghost-related code.
7710 (Analyze_Object_Declaration): Install and revert the Ghost region of
7711 a deferred object declaration's completion.
7712 (Array_Type_Declaration): Remove all Ghost-related code.
7713 (Build_Derived_Type): Update the comment on
7714 the propagation of Ghost attributes from a parent to a derived type.
7715 (Derive_Subprogram): Remove all Ghost-related code.
7716 (Make_Class_Wide_Type): Remove all Ghost-related code.
7717 (Make_Implicit_Base): Remove all Ghost-related code.
7718 (Process_Full_View): Install and revert the Ghost region of
7719 the partial view. There is no longer need to check the Ghost
7721 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
7722 region of the left hand side.
7723 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
7724 all Ghost-related code.
7725 (Analyze_Expression_Function): Remove all Ghost-related code.
7726 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
7727 (Analyze_Procedure_Call): Install and revert the Ghost region of
7728 the procedure being called.
7729 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
7730 region of the spec or body.
7731 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
7732 (Build_Subprogram_Declaration): Remove all Ghost-related code.
7733 (Find_Corresponding_Spec): Remove all Ghost-related code.
7734 (Process_Formals): Remove all Ghost-related code.
7735 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
7736 the Ghost region of the spec.
7737 (Analyze_Package_Declaration): Remove all Ghost-related code.
7738 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
7739 Ghost when it aliases a Ghost entity.
7740 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
7742 (Analyze_Object_Renaming): Mark a renaming as Ghost when
7743 it aliases a Ghost entity.
7744 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
7746 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
7747 aliases a Ghost entity.
7748 * sem_ch11.adb Remove with and use clauses for Ghost.
7749 (Analyze_Exception_Declaration): Remove all Ghost-related code.
7750 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
7752 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
7754 (Analyze_Package_Instantiation): Install and revert the Ghost region
7755 of the package instantiation.
7756 (Analyze_Subprogram_Instantiation): Install
7757 and revert the Ghost region of the subprogram instantiation.
7758 (Instantiate_Package_Body): Code clean up. Install and revert the
7759 Ghost region of the package body.
7760 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
7761 Ghost region of the subprogram body.
7762 * sem_ch13.adb (Build_Predicate_Functions): Install
7763 and revert the Ghost region of the related type.
7764 (Build_Predicate_Function_Declaration): Code clean up. Install
7765 and rever the Ghost region of the related type.
7766 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
7767 Install and revert the Ghost region of the pragma.
7768 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
7769 Ghost region of the pragma.
7770 (Analyze_Pragma): Install and revert the Ghost region of various
7771 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
7772 or encloses a Ghost entity.
7773 (Analyze_Pre_Post_Condition): Install and revert the Ghost
7774 region of the pragma.
7775 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
7776 Ghost region of the pragma.
7777 * sem_res.adb (Resolve): Remove all Ghost-related code.
7778 * sem_util.adb (Is_Declaration): Reimplemented.
7779 (Is_Declaration_Other_Than_Renaming): New routine.
7780 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
7781 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
7782 (Is_Ghost_Pragma): Removed.
7783 (Is_Ignored_Ghost_Pragma): New routine.
7784 (Set_Is_Checked_Ghost_Pragma): New routine.
7785 (Set_Is_Ghost_Pragma): Removed.
7786 (Set_Is_Ignored_Ghost_Pragma): New routine.
7787 * sinfo.ads: Update the documentation on Ghost mode and
7788 Ghost regions. New attributes Is_Checked_Ghost_Pragma
7789 and Is_Ignored_Ghost_Pragma along with usages in nodes.
7790 Remove attribute Is_Ghost_Pragma along with usages in nodes.
7791 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
7792 (Is_Ghost_Pragma): Removed along with pragma Inline.
7793 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
7794 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
7795 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
7796 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
7798 2017-01-12 Tristan Gingold <gingold@adacore.com>
7800 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
7801 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
7803 2017-01-12 Yannick Moy <moy@adacore.com>
7805 * errout.adb, errout.ads (Initialize): Factor common treatment
7807 (Reset_Warnings): New procedure to reset counts related to warnings.
7808 (Record_Compilation_Errors): New variable to store the presence of an
7809 error, used in gnat2why to allow changing the Warning_Mode.
7810 (Compilation_Errors): Use new variable Record_Compilation_Errors to
7811 store the presence of an error.
7813 2017-01-12 Javier Miranda <miranda@adacore.com>
7815 * sem_ch13.adb (Analyze_Aspect_Specifications):
7816 For Interrupt_Handler and Attach_ Handler aspects, decorate the
7817 internally built reference to the protected procedure as coming
7818 from sources and force its analysis.
7820 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7822 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
7823 inherit predicates if any from the first_subtype of the parent,
7824 not from the anonymous parent type.
7825 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
7826 predicate is not a static subtype.
7828 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7830 * freeze.adb (Check_Suspicious_Convention): New procedure
7831 performing a warning check on discriminated record types with
7832 convention C or C++. Factored out of procedure Freeze_Record_Type,
7833 and changed to only apply to base types (to avoid spurious
7834 warnings on subtypes). Minor improvement of warning messages
7835 to refer to discriminated rather than variant record types.
7836 (Freeze_Record_Type): Remove code for performing a suspicious
7838 (Freeze_Entity): Only call Freeze_Record_Type
7839 on types that aren't declared within any enclosing generic units
7840 (rather than just excluding the type when the innermost scope
7841 is generic). Call Check_Suspicious_Convention whether or not
7842 the type is declared within a generic unit.
7843 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
7844 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
7847 2017-01-12 Tristan Gingold <gingold@adacore.com>
7849 * sysdep.c, adaint.c, rtinit.c, ming32.h:
7850 (__gnat_current_codepage): Renamed from CurrentCodePage
7851 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
7853 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7855 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
7856 quantified expressions, following AI12-050: the loop parameters
7857 of two quantified expressions are conformant if they have the
7860 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7862 * gcc-interface/Makefile.in: Clean up VxWorks targets.
7864 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7866 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
7867 Hnadle properly the attribute reference when it appears as part
7868 of an expression in another loop aspect.
7870 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7872 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
7873 subsidiary of Build_Initialization_Call, to complete generation
7874 of predicate checks on discriminants whose (sub)types have
7875 predicates, and to add checks on variants that do not have an
7877 * sem_util.adb (Gather_Components): A missing Others alternative is
7878 not an error when the type of the discriminant is a static predicate
7879 (and coverage has been checked when analyzing the case statement). A
7880 runtime check is generated to verify that a given discriminant
7881 satisfies the predicate (RM 3.8.1. (21.1/2)).
7883 2017-01-12 Yannick Moy <moy@adacore.com>
7885 * gnat1drv.adb (Adjust_Global_Switches): Only
7886 perform checking of exception mechanism when generating code.
7888 2017-01-12 Justin Squirek <squirek@adacore.com>
7890 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
7891 Remove handling of access component with invariant.
7892 (Build_Invariant_Procedure_Declaration): Remove return on class
7894 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
7895 conditional exception for component or array so Has_Own_Invariants
7896 flag is not falsly set.
7897 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
7898 wide type to have no invariant flags.
7900 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
7902 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
7903 sem_ch13.adb: Minor reformatting.
7905 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
7907 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
7908 adjustment primitive when the ancestor type was not properly frozen.
7909 (Gen_Assign): Guard against a missing initialization
7910 primitive when the component type was not properly frozen.
7911 (Initialize_Array_Component): Guard against a missing adjustment
7912 primitive when the component type was not properly frozen.
7913 (Initialize_Record_Component): Guard against a missing adjustment
7914 primitive when the component type was not properly frozen.
7915 (Process_Transient_Component_Completion): The transient object may
7916 not be finalized when its associated type was not properly frozen.
7917 * exp_ch3.adb (Build_Assignment): Guard against a missing
7918 adjustment primitive when the component type was not properly frozen.
7919 (Build_Initialization_Call): Guard against a missing
7920 initialization primitive when the associated type was not properly
7922 (Expand_N_Object_Declaration): Guard against a missing
7923 adjustment primitive when the base type was not properly frozen.
7924 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
7925 body when there is no adjustment primitive available. Create an
7926 empty Deep_Finalize body when there is no finalization primitive
7928 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
7929 missing finalization primitive when the designated type was
7930 not properly frozen.
7931 (Expand_N_Allocator): Guard against a missing initialization primitive
7932 when the designated type was not properly frozen.
7933 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
7934 only when the corresponding adjustment primitive is available.
7935 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
7936 adjustment/finalization statements only when there is an available
7937 primitive to carry out the action.
7938 (Build_Initialize_Statements): Generate the initialization/finalization
7939 statements only when there is an available primitive to carry out the
7941 (Make_Adjust_Call): Do not generate a call when the underlying
7942 type is not present due to a possible missing full view.
7943 (Make_Final_Call): Do not generate a call when the underlying
7944 type is not present due to a possible missing full view.
7945 (Make_Finalize_Address_Stmts): Generate an empty body when the
7946 designated type lacks a finalization primitive.
7947 (Make_Init_Call): Do not generate a call when the underlying type is
7948 not present due to a possible missing full view.
7949 (Process_Component_For_Adjust): Add the adjustment call only when the
7950 corresponding adjustment primitive is available.
7951 (Process_Component_For_Finalize): Add the finalization call only when
7952 the corresponding finalization primitive is available.
7953 (Process_Object_Declaration): Use a null statement to emulate a
7954 missing call to the finalization primitive of the object type.
7955 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
7956 (Make_Final_Call): Update the comment on usage.
7957 (Make_Init_Call): Update the comment on usage.
7958 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
7960 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7962 * einfo.ads: Update documentation of Address_Taken.
7963 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
7964 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
7965 for subprograms when setting Address_Taken flag.
7967 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
7969 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
7970 Configurable_Run_Time_Mode off when analysing with'ed predefined
7973 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7975 * sem_prag.adb: Minor reformatting.
7976 * sem_util.adb (Unique_Entity): fix result for
7977 bodies of entry families.
7979 2017-01-12 Justin Squirek <squirek@adacore.com>
7981 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
7982 Resolve_Suppressible in the pragma Assertion_Policy case.
7983 (Resolve_Suppressible): Created this function to factor out
7984 common code used to resolve Suppress to either Ignore or Check
7985 * snames.ads-tmpl: Add name for Suppressible.
7987 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7989 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
7991 * debug.adb: Minor comment fixes.
7993 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7995 * sem_util.adb (Unique_Entity): For concurrent
7996 bodies that are defined with stubs and complete a declaration
7997 of a single concurrent object return the entity of an implicit
7998 concurrent type, not the entity of the anonymous concurrent
8000 * debug.adb: -gnatd.J is no longer used.
8001 * make.adb (Globalize): Removed, no longer used.
8002 * sem_ch9.adb: minor typo in comment for entry index
8004 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
8006 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8007 * exp_ch3.adb (Build_Init_Statements): As part of initialising
8008 the value record of a task, set its _Secondary_Stack_Size field
8010 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8011 a _Secondary_Stack_Size field in the value record of
8012 the task if a Secondary_Stack_Size rep item is present.
8013 (Make_Task_Create_Call): Include secondary stack size
8014 parameter. If No_Secondary_Stack restriction is in place, passes
8016 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8017 Secondary_Stack_Size.
8018 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8019 function to define the overhead of the secondary stack.
8020 * s-tarest.adb (Create_Restricted_Task,
8021 Create_Restricted_Task_Sequential): Functions now include
8022 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8023 * s-tarest.adb (Create_Restricted_Task,
8024 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
8025 include Secondary_Stack_Size parameter.
8026 (Task_Wrapper): Secondary stack now allocated to the size specified by
8027 the Secondary_Stack_Size parameter in the task's ATCB.
8028 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
8029 Secondary_Stack_Size component.
8030 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8031 Create_Restricted_Task_Sequential): Function now include
8032 Secondary_Stack_Size parameter.
8033 (Task_Wrapper): Secondary stack now allocated to the size
8034 specified by the Secondary_Stack_Size parameter in the task's
8036 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
8037 to include Secondary_Stack_Size parameter.
8038 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
8039 Secondary_Stack_Size aspect, turning the aspect into its corresponding
8041 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
8042 * snames.adb-tmpl, snames.ads-tmpl: Added names
8043 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8044 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8046 2017-01-12 Yannick Moy <moy@adacore.com>
8048 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
8051 2017-01-12 Justin Squirek <squirek@adacore.com>
8053 * exp_attr.adb (Expand_N_Attribute_Reference):
8054 Fix Finalization_Size case by properly resolving the type after
8055 rewritting the node.
8057 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8059 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
8061 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
8062 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
8063 exp_sel.ads: Minor reformatting.
8065 2017-01-12 Justin Squirek <squirek@adacore.com>
8067 * exp_ch6.adb (Expand_Call): Add guard to prevent
8068 invariant checks from being created for internally generated
8071 2017-01-12 Bob Duff <duff@adacore.com>
8073 * lib-writ.ads: Remove incorrect comment.
8075 2017-01-12 Javier Miranda <miranda@adacore.com>
8077 * debug.adb (-gnatd.K): Enable generation of contract-only
8078 procedures in CodePeer mode.
8079 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
8081 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
8083 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
8085 (Get_Contract_Only_Missing_Body_Name): New subprogram.
8086 (Get_Contract_Only_Body): New subprogram.
8087 (Set_Contract_Only_Body): New subprogram.
8088 (Is_Contract_Only_Body): New subprogram.
8089 (Set_Is_Contract_Only_Body): New subprogram.
8090 (SCIL_Nodes): Replace table by hash-table.
8092 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8094 * exp_ch6.adb: Minor reformatting.
8095 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
8097 2017-01-12 Bob Duff <duff@adacore.com>
8099 * binde.adb (Forced): New reason for a dependence.
8100 (Force_Elab_Order): Implementation of the new switch.
8101 * binde.ads: Minor comment fixes.
8102 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
8103 long ago that is no longer supported; removed comment about that.
8104 * opt.ads (Force_Elab_Order_File): Name of file specified for
8106 * switch-b.adb: Parse -f switch.
8108 2017-01-12 Justin Squirek <squirek@adacore.com>
8110 * exp_ch6.adb (Check_View_Conversion): Created this function
8111 to properly chain calls to check type invariants that may be
8112 present in a subprogram call after the subprogram.
8113 (Expand_Call): Add a conditional to identify when a view conversion
8114 needs to be checked.
8115 * nlists.adb, nlists.ads (Prepend_New): New routine.
8116 (Prepend_New_To): New routine.
8118 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8120 * sinfo.ads: Minor reformatting.
8122 2017-01-12 Gary Dismukes <dismukes@adacore.com>
8124 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
8127 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8129 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
8130 variable Definite. Create a local object and pass its 'Access to the
8131 BIP function when the result type is either definite or it does not
8132 require any finalization or secondary stack management.
8134 2017-01-12 Bob Duff <duff@adacore.com>
8136 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
8137 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
8138 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
8139 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
8140 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
8141 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
8142 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8143 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
8144 Change name to Pragma_Name_Unmapped.
8145 (Pragma_Name_Mapped): Change name to Pragma_Name.
8146 This is because the "mapped" version should be the usual case.
8148 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
8150 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
8151 Is_Default_Init_Cond_Procedure, and
8152 Has_Inherited_Default_Init_Cond. Add uses of flags
8153 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
8154 (Default_Init_Cond_Procedure): Removed.
8155 (DIC_Procedure): New routine.
8156 (Has_Default_Init_Cond): Removed.
8157 (Has_DIC): New routine.
8158 (Has_Inheritable_Invariants): The attribute applies to the base type.
8159 (Has_Inherited_Default_Init_Cond): Removed.
8160 (Has_Inherited_DIC): New routine.
8161 (Has_Inherited_Invariants): The attribute applies to the base type.
8162 (Has_Own_DIC): New routine.
8163 (Has_Own_Invariants): The attribute applies to the base type.
8164 (Is_Default_Init_Cond_Procedure): Removed.
8165 (Is_DIC_Procedure): New routine.
8166 (Set_Default_Init_Cond_Procedure): Removed.
8167 (Set_DIC_Procedure): New routine.
8168 (Set_Has_Default_Init_Cond): Removed.
8169 (Set_Has_Inheritable_Invariants): The attribute applies
8171 (Set_Has_Inherited_Default_Init_Cond): Removed.
8172 (Set_Has_Inherited_DIC): New routine.
8173 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
8174 (Set_Has_Own_DIC): New routine.
8175 (Set_Has_Own_Invariants): The attribute applies to the base type.
8176 (Set_Is_Default_Init_Cond_Procedure): Removed.
8177 (Set_Is_DIC_Procedure): New routine.
8178 (Write_Entity_Flags): Update the output of all flags related to
8179 default initial condition.
8180 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
8181 of the call to the DIC procedure.
8182 (Freeze_Type): Generate the body of the DIC procedure.
8183 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
8184 all occurrences of Create_Append with Append_New_To. Do
8185 not generate an invariant procedure for a class-wide type.
8186 The generated body acts as a freeze action of the working type.
8187 (Build_Invariant_Procedure_Declaration): Do not generate an
8188 invariant procedure for a class-wide type.
8189 (Create_Append): Removed.
8190 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
8191 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
8192 class-wide pre/postcondition description and data structures from
8194 (Build_Class_Wide_Expression): Moved from Sem_Prag.
8195 (Build_DIC_Call): New routine.
8196 (Build_DIC_Procedure_Body): New routine.
8197 (Build_DIC_Procedure_Declaration): New routine.
8198 (Entity_Hash): Moved from Sem_Prag.
8199 (Find_DIC_Type): New routine.
8200 (Update_Primitives_Mapping): Reimplemented.
8201 (Update_Primitives_Mapping_Of_Types): New routine.
8202 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
8203 (Build_DIC_Call): New routine.
8204 (Build_DIC_Procedure_Body): New routine.
8205 (Build_DIC_Procedure_Declaration): New routine.
8206 (Update_Primitives_Mapping): Moved from Sem_Prag.
8207 (Update_Primitives_Mapping_Of_Types): New routine.
8208 * nlists.adb (Append_New): New routine.
8209 (Append_New_To): New routine.
8210 * nlists.ads (Append_New): New routine.
8211 (Append_New_To): New routine.
8212 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
8213 of DIC procedures here. This is now done at the end of the
8214 visible declarations, private declarations, and at the freeze
8216 (Analyze_Private_Extension_Declaration):
8217 A private extension inherits the DIC pragma of a parent type.
8218 (Analyze_Subtype_Declaration): No need to propagate invariant
8219 attributes to a subtype as those apply to the base type.
8220 (Build_Derived_Record_Type): No need to inherit invariants here
8221 as this is now done in Build_Derived_Type.
8222 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
8224 (Process_Full_View): Update the propagation of DIC attributes.
8225 (Propagate_Default_Init_Cond_Attributes): Removed.
8226 * sem_ch7.adb Add with and use clauses for Exp_Util.
8227 (Analyze_Package_Specification): Create the body of the DIC
8228 procedure at the end of the visible and private declarations.
8229 (Preserve_Full_Attributes): Propagate DIC attributes.
8230 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
8232 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
8233 * sem_elab.adb (Check_A_Call): Update the call to
8234 Is_Nontrivial_Default_Init_Cond_Procedure.
8235 * sem_prag.adb Remove the with and use clauses for
8236 GNAT.HTable. Move the handling of class- wide pre/postcondition
8237 description and data structures to Exp_Util.
8238 (Analyze_Pragma): Create the declaration of the DIC procedure. There
8239 is no need to propagate invariant-related attributes at this point
8240 as this is done in Build_Invariant_Procedure_Declaration.
8241 (Build_Class_Wide_Expression): Moved to Exp_Util.
8242 (Entity_Hash): Moved to Exp_Util.
8243 (Update_Primitives_Mapping): Moved to Exp_Util.
8244 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
8245 (Update_Primitives_Mapping): Moved to Exp_Util.
8246 * sem_util.adb: Remove with and use clauses for Ghost
8248 (Build_Default_Init_Cond_Call): Removed.
8249 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8250 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8251 (Get_Views): Reimplemented.
8252 (Has_Full_Default_Initialization): Reimplement the section on DIC.
8253 (Inherit_Default_Init_Cond_Procedure): Removed.
8254 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8255 (Is_Nontrivial_DIC_Procedure): New routine.
8256 (Is_Verifiable_DIC_Pragma): New routine.
8257 (Propagate_DIC_Attributes): New routine.
8258 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
8259 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8260 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8261 (Inherit_Default_Init_Cond_Procedure): Removed.
8262 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8263 (Is_Nontrivial_DIC_Procedure): New routine.
8264 (Is_Verifiable_DIC_Pragma): New routine.
8265 (Propagate_DIC_Attributes): New routine.
8266 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
8268 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
8270 (Expression_Copy): New routine along with pragma Inline.
8271 (Set_Expression_Copy): New routine along with pragma Inline.
8273 2017-01-06 Bob Duff <duff@adacore.com>
8275 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
8276 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
8277 we won't generate the call to s_stalib_adafinal when the main
8278 is not written in Ada.
8280 2017-01-06 Bob Duff <duff@adacore.com>
8282 * sem_prag.adb: Minor: remove pragma Warnings.
8284 2017-01-06 Tristan Gingold <gingold@adacore.com>
8286 * Makefile.rtl: Do not compile s-stchop by default.
8288 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
8290 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
8291 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
8292 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
8293 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
8294 Reverted previous change for now.
8296 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8298 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
8299 check to default discriminant value if checks are enabled.
8300 (Build_Assignment): If type of component has static predicate,
8301 apply check to its default value, if any.
8303 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
8305 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8306 * exp_ch3.adb (Build_Init_Statements): As part of initialising
8307 the value record of a task, set its _Secondary_Stack_Size field
8309 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8310 a _Secondary_Stack_Size field in the value record of
8311 the task if a Secondary_Stack_Size rep item is present.
8312 (Make_Task_Create_Call): Include secondary stack size
8313 parameter. If No_Secondary_Stack restriction is in place, passes
8315 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8316 Secondary_Stack_Size.
8317 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8318 function to define the overhead of the secondary stack.
8319 * s-tarest.adb (Create_Restricted_Task,
8320 Create_Restricted_Task_Sequential): Functions now include
8321 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8322 * s-tarest.adb (Create_Restricted_Task,
8323 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
8324 now include Secondary_Stack_Size parameter.
8326 Secondary stack now allocated to the size specified by the
8327 Secondary_Stack_Size parameter in the task's ATCB.
8328 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
8329 Secondary_Stack_Size component.
8330 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8331 Create_Restricted_Task_Sequential): Function now include
8332 Secondary_Stack_Size parameter.
8333 (Task_Wrapper): Secondary stack
8334 now allocated to the size specified by the Secondary_Stack_Size
8335 parameter in the task's ATCB.
8336 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
8337 for Secondary_Stack_Size aspect, turning the aspect into its
8338 corresponding internal attribute.
8339 (Analyze_Attribute_Definition):
8340 Process Secondary_Stack_Size attribute.
8341 * snames.adb-tmpl, snames.ads-tmpl: Added names
8342 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8343 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8345 2017-01-06 Pascal Obry <obry@adacore.com>
8347 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
8348 Sequential_IO and Direct_IO.
8350 2017-01-06 Bob Duff <duff@adacore.com>
8352 * snames.ads-tmpl (Renamed): New name for the pragma argument.
8353 * par-ch2.adb: Allow the new pragma (with analysis deferred
8355 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
8356 Keep a mapping from new pragma names to old names.
8357 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
8358 implement it by calling Map_Pragma_Name.
8359 * checks.adb, contracts.adb, einfo.adb, errout.adb,
8360 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
8361 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
8362 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
8363 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
8364 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8365 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
8368 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8370 * exp_ch9.adb: Minor reformatting.
8372 2017-01-06 Tristan Gingold <gingold@adacore.com>
8374 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
8375 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
8376 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
8378 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
8379 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
8380 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
8381 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
8383 2017-01-06 Bob Duff <duff@adacore.com>
8385 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
8386 dummy implementation of Map_Pragma_Name.
8388 2017-01-06 Tristan Gingold <gingold@adacore.com>
8390 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
8391 entry_body variable constant.
8392 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
8393 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
8395 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
8396 now access to constant.
8398 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8400 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
8401 reformatting and typo fixes.
8403 2017-01-06 Bob Duff <duff@adacore.com>
8405 * snames.ads-tmpl: New names for pragma renaming.
8406 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
8407 * par-prag.adb: Add new pragma name to case statement.
8408 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
8410 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
8411 Dummy implementation of Pragma_Name_Mapped.
8413 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8415 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
8416 better detect call within an entry_wrapper.
8417 * sem_res.adb (Resolve_Call): A protected call within an
8418 entity_wrapper is analyzed in the context of the protected
8419 object but corresponds to a pre-analysis and is not an access
8421 * sem_attr.adb: Minor reformatting.
8423 2017-01-06 Justin Squirek <squirek@adacore.com>
8425 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
8426 Finalization_Size to allow a prefix of any non-class-wide type.
8427 * sem_attr.ads Modify comment for Finalization_Size to include
8428 definite type use case.
8430 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8432 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
8433 on procedures that are wrappers created for entries that have
8435 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
8436 body is an entry_wrapper, compile it in the context of the
8437 synchronized type, because a precondition may refer to funtions
8439 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
8441 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
8442 within an Entry_Wrapper this is an external call whose target
8443 is the synchronized object that is the actual in the call to
8446 2017-01-06 Yannick Moy <moy@adacore.com>
8448 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
8449 in tree, which means not analyzing the previous prefix if the node has
8450 been rewritten into its prefix.
8452 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8454 * s-tpobop.adb: Minor reformatting.
8456 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8458 * checks.adb (Ensure_Valid): Do not generate a validity check
8459 within a generated predicate function, validity checks will have
8460 been applied earlier when required.
8462 2017-01-06 Tristan Gingold <gingold@adacore.com>
8464 * s-tpoben.ads (Protection_Entries): Add comment and reorder
8465 components for performances.
8466 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
8469 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8471 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
8472 If expression is compile-time known and obeys a static predicate
8473 it must be labelled as static, to prevent spurious warnings and
8474 run-time errors, e.g. in case statements. This is relevant when
8475 the expression is the result of constant-folding a type conversion
8476 whose expression is a variable with a known static value.
8478 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8480 * exp_attr.adb, sem_attr.ads: Minor reformatting.
8482 2017-01-06 Justin Squirek <squirek@adacore.com>
8484 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
8485 expansion of Finalization_Size attribute.
8486 * sem_attr.adb (Analyze_Attribute): Add entry to check the
8487 semantics of Finalization_Size.
8488 (Eval_Attribute): Add null entry for Finalization_Size.
8489 * sem_attr.ads: Add Finalization_Size to the implementation
8490 dependent attribute list.
8491 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
8493 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8495 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
8496 iterator specification with a serious syntactic error, transform
8497 construct into an infinite loop in order to continue analysis
8498 and prevent a compiler abort.
8500 2017-01-06 Tristan Gingold <gingold@adacore.com>
8502 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
8503 max_queue_lengths_array if unused.
8505 2017-01-06 Bob Duff <duff@adacore.com>
8507 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
8508 array access, in case "\" is at the end of Text.
8509 * stylesw.adb (Set_Style_Check_Options): Don't include input
8510 characters in the error message template, because they could
8511 be control characters such as "\", which Errout will try to
8514 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8516 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
8517 For a private type examine the visible declarations that follow
8518 the partial view, not just the private declarations that follow
8521 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8523 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
8526 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8528 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
8529 alias of the inherited op is the parent iterator, no need to
8530 examine dispatch table positions which might not be established
8531 yet if type is not frozen.
8532 * sem_disp.adb (Check_Controlling_Formals): The formal of a
8533 predicate function may be a subtype of a tagged type.
8534 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
8535 of representation items for the completion of a type extension
8536 where a predicate applies to the partial view.
8537 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
8538 parameter that designates function whose actual receives a
8539 predicate check, to improve warning message when the check will
8540 lead to infinite recursion.
8541 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
8542 Apply_Predicate_Check.
8544 2017-01-06 Tristan Gingold <gingold@adacore.com>
8546 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
8547 Gnat_Extended_Ravenscar.
8548 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
8550 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8552 * sem_util.ads: Minor typo fix and reformatting.
8554 2017-01-06 Yannick Moy <moy@adacore.com>
8556 * ghost.adb Minor fixing of references to SPARK RM.
8557 (Check_Ghost_Context): Check whether reference is to a lvalue
8558 before issuing an error about violation of SPARK RM 6.9(13)
8559 when declaration has Ghost policy Check and reference has Ghost
8561 * sem_util.adb Minor indentation.
8562 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
8563 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
8564 * sem_util.ads (Unique_Defining_Entity): Document the result
8565 for package body stubs.
8567 2017-01-06 Tristan Gingold <gingold@adacore.com>
8569 * raise-gcc.c (abort): Macro to call Abort_Propagation.
8570 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
8572 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8573 Do not generate the Entry_Max_Queue_Lengths_Array if all default
8575 * exp_util.adb (Corresponding_Runtime_Package): Consider
8576 Max_Queue_Length pragma.
8578 2017-01-06 Justin Squirek <squirek@adacore.com>
8580 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8581 Remove declaration generation in the case of
8582 System_Tasking_Protected_Objects_Single_Entry being used,
8583 and add a warning message when this is detected to occur.
8584 (Make_Initialize_Protection): Remove reference pass in the case
8585 of System_Tasking_Protected_Objects_Single_Entry.
8586 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
8587 * s-tposen.adb (Initialize_Protection_Entry): Remove
8588 Entry_Queue_Max parameter.
8589 * s-tposen.ads: Remove the types use to store the entry queue
8591 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
8593 2017-01-06 Yannick Moy <moy@adacore.com>
8595 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
8596 behavior of function, to also accept out of range positions
8597 and raise Constraint_Error in such case, and to copy sloc from
8598 literal if No_Location passed as location.
8599 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
8600 of functions to raise Constraint_Error in case of value not in
8603 2017-01-06 Tristan Gingold <gingold@adacore.com>
8605 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
8606 Invalidate_Stack_Cache.
8608 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
8610 * s-os_lib.adb: Minor fix to the signature of Readlink.
8612 2017-01-06 Javier Miranda <miranda@adacore.com>
8614 * sem_ch6.adb (Conforming_Types): Handle another
8615 confusion between views in a nested instance with an actual
8616 private type whose full view is not in scope.
8618 2017-01-06 Arnaud Charlet <charlet@adacore.com>
8620 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
8621 mark a rewritten if statement as explicit (Comes_From_Source).
8623 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8625 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
8627 2017-01-06 Tristan Gingold <gingold@adacore.com>
8629 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
8631 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8633 * sem_case.adb: Minor reformatting.
8635 2017-01-06 Thomas Quinot <quinot@adacore.com>
8637 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
8639 2017-01-06 Justin Squirek <squirek@adacore.com>
8641 * aspects.adb: Register aspect in Canonical_Aspect.
8642 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
8643 into respective tables.
8644 * einfo.ads, einfo.adb: Add a new attribute for
8645 handling the parameters for Pragma_Max_Entry_Queue
8646 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
8647 for accessing and setting were added as well.
8648 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
8649 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
8650 declaration for pramga arguments and store them in the protected
8652 (Make_Initialize_Protection): Pass a reference to
8653 the Entry_Max_Queue_Lengths_Array in the protected type node to
8655 * rtsfind.adb: Minor grammar fix.
8656 * rtsfind.ads: Register new types taken from the
8657 runtime libraries RE_Protected_Entry_Queue_Max and
8658 RE_Protected_Entry_Queue_Max_Array
8659 * s-tposen.adb, s-tpoben.adb
8660 (Initialize_Protection_Entry/Initialize_Protection_Entries):
8661 Add extra parameter and add assignment to local object.
8662 * s-tposen.ads, s-tpoben.ads: Add new types to
8663 store entry queue maximums and a field to the entry object record.
8664 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
8665 for Aspect_Max_Queue_Length.
8666 (Check_Aspect_At_Freeze_Point):
8667 Add aspect to list of aspects that don't require delayed analysis.
8668 * sem_prag.adb (Analyze_Pragma): Add case statement for
8669 Pragma_Max_Queue_Length, check semantics, and register arugments
8670 in the respective entry nodes.
8671 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
8672 and Has_Max_Queue_Length
8673 * snames.ads-tmpl: Add constant for the new aspect-name
8674 Name_Max_Queue_Length and corrasponding pragma.
8676 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8678 * exp_util.adb (Is_Controlled_Function_Call):
8679 Reimplemented. Consider any node which has an entity as the
8680 function call may appear in various ways.
8682 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8684 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
8685 an unchecked type conversion when performing a view conversion
8686 to/from a private type. In all other cases use a regular type
8687 conversion to ensure that any relevant checks are properly
8690 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8692 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
8694 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8696 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
8697 error on case expression that is an entity, when coverage is
8698 incomplete and entity has a static value obtained by local
8700 (Handle_Static_Predicate): New procedure, subsidiary of
8701 Check_Choices, to handle case alternatives that are either
8702 subtype names or subtype indications involving subtypes that
8703 have static predicates.
8705 2017-01-06 Thomas Quinot <quinot@adacore.com>
8707 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
8708 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
8710 2017-01-06 Bob Duff <duff@adacore.com>
8712 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
8713 Elaborate_All(P) to P itself. That could happen in obscure cases,
8714 and always introduced a cycle (P body must be elaborated before
8716 * lib-writ.ads: Comment clarification.
8717 * ali-util.ads: Minor comment fix.
8718 * ali.adb: Minor reformatting.
8720 2017-01-06 Tristan Gingold <gingold@adacore.com>
8722 * a-exexpr-gcc.adb: Improve comment.
8724 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
8726 * s-linux-mips.ads: Use correct signal and errno constants.
8727 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
8729 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
8731 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
8732 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
8735 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
8737 * gnatvsn.ads: Bump copyright year.
8739 2017-01-01 Jakub Jelinek <jakub@redhat.com>
8741 * gnat_ugn.texi: Bump @copying's copyright year.
8742 * gnat_rm.texi: Likewise.
8744 Copyright (C) 2017 Free Software Foundation, Inc.
8746 Copying and distribution of this file, with or without modification,
8747 are permitted in any medium without royalty provided the copyright
8748 notice and this notice are preserved.