1 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
3 * exp_aggr.adb (Expand_Array_Aggregate): Use New_Copy_Tree instead
4 of New_Copy because the latter leaves the syntactic structure of
5 the tree inconsistent (a child is accessible through two parents)
6 and prevents proper replication of itypes by subsequent calls
8 * exp_ch4.adb (Expand_Concatenate): Use New_Copy_Tree instead of
9 New_Copy because the latter leaves the syntactic structure of the
10 tree inconsistent (a child is accessible through two parents)
11 and prevents proper replication of itypes by subsequent calls
13 * sem_util.adb (In_Subtree): New routine.
14 (New_Copy_Tree): Reimplemented.
15 * sem_util.ads (In_Subtree): New routine.
16 (New_Copy_Tree): Reimplemented.
18 2017-09-08 Ed Schonberg <schonberg@adacore.com>
20 * sem_ch13.adb (Resolve_Aspect_Expressions): The expression
21 for aspect Default_Value is a static scalar value, but it does
22 not freeze the type. Yhis allows for subsequent representation
25 2017-09-08 Javier Miranda <miranda@adacore.com>
27 * sem_ch8.adb (Find_Direct_Name.Undefined): Do
28 not add entries into the undefined reference table when we are
29 compiling with errors ignored.
31 2017-09-08 Ed Schonberg <schonberg@adacore.com>
33 * sem_ch12.adb (Check_Formal_Packages): Do not apply conformance
34 check if the instance is within an enclosing instance body. The
35 formal package was legal in the enclosing generic, and is
36 legal in the enclosing instantiation. This optimisation may be
37 applicable elsewhere, and it also removes spurious errors that
38 may arise with on-the-fly processing of instantiations that
39 contain Inline_Always subprograms.
41 2017-09-08 Vincent Celier <celier@adacore.com>
43 * gnatcmd.adb: Disregard empty argument of GNAT driver.
45 2017-09-08 Justin Squirek <squirek@adacore.com>
47 * checks.adb (Insert_Valid_Check): Manually decorate
48 the generated temporary for range valdity checks.
50 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
52 * usage.adb (Usage): Document new -gnatw.q/-gnatw.Q switches.
54 2017-09-08 Justin Squirek <squirek@adacore.com>
56 * switch-c.adb (Scan_Front_End_Switches): Add new warning switch
57 case to handle underscore flags.
58 * warnsw.adb, warnsw.ads (Set_Underscore_Warning_Switch): Create
59 new procedure to handle underscores.
61 2017-09-08 Javier Miranda <miranda@adacore.com>
63 * exp_ch4.adb (Expand_N_Op_Divide): Reordering code that handles
64 divisions with fixed point results to avoid generating twice
65 the runtime check on divide by zero.
66 * checks.adb (Apply_Divide_Checks): Ensure that operands are
67 not evaluated twice (once for their runtime checks and once for
68 their regular computation).
70 2017-09-08 Yannick Moy <moy@adacore.com>
72 * sem_prag.adb (Analyze_Part_Of): Add missing
73 return statements after issuing errors. Add detection of
74 out-of-order item and single concurrent type.
76 2017-09-08 Nicolas Roche <roche@adacore.com>
78 * gcc-interface/Makefile.in, a-extiti.ads, s-taprop-linux.adb,
79 s-osinte-solaris.adb, a-intnam.ads, s-osinte-solaris.ads,
80 s-tpobop.adb, s-intman-android.adb, s-tasinf.adb, s-tpobop.ads,
81 s-tasinf.ads, i-vxinco.adb, a-exetim-posix.adb, i-vxinco.ads,
82 a-astaco.adb, a-astaco.ads, s-tporft.adb, s-tpoaal.adb, a-taside.adb,
83 a-taside.ads, s-tpopsp-posix.adb, s-tasdeb.adb, s-tasdeb.ads,
84 s-tpoben.adb, a-dinopr.ads, s-inmaop-vxworks.adb, s-tpoben.ads,
85 s-interr-vxworks.adb, s-interr-dummy.adb, s-tassta.adb,
86 a-intnam-mingw.ads, s-tassta.ads, s-taasde.adb, a-stcoed.ads,
87 s-taasde.ads, s-osinte-darwin.adb, s-proinf.adb, s-taprop-dummy.adb,
88 s-osinte-darwin.ads, s-proinf.ads, s-linux.ads, a-intnam-linux.ads,
89 s-tasren.adb, s-tasren.ads, s-mudido.adb, g-semaph.adb, s-mudido.ads,
90 s-taprop-posix.adb, g-semaph.ads, s-osinte-mingw.ads, s-vxwork-x86.ads,
91 s-tposen.adb, s-linux-sparc.ads, s-taprop-vxworks.adb, s-tasini.adb,
92 s-tposen.ads, s-tasini.ads, a-etgrbu.ads, s-interr-hwint.adb,
93 s-osinte-linux.ads, s-taprop.ads, s-tasque.adb, s-tasque.ads,
94 s-taenca.adb, s-taspri-vxworks.ads, s-taenca.ads, a-dynpri.adb,
95 s-tpopsp-solaris.adb, a-dynpri.ads, s-taprop-hpux-dce.adb,
96 a-interr.adb, a-intnam-freebsd.ads, s-tarest.adb, a-interr.ads,
97 s-intman-susv3.adb, a-synbar.adb, a-intnam-dummy.ads, s-tadeca.adb,
98 s-osinte-vxworks.adb, s-tarest.ads, s-taskin.adb, a-synbar.ads,
99 s-taspri-hpux-dce.ads, s-tadeca.ads, s-osinte-vxworks.ads,
100 s-taskin.ads, s-intman-solaris.adb, a-sytaco.adb, s-vxwext-kernel.adb,
101 s-mudido-affinity.adb, a-sytaco.ads, s-vxwext-kernel.ads, s-taprob.adb,
102 s-intman-mingw.adb, s-taprob.ads, s-osinte-kfreebsd-gnu.ads,
103 s-osinte-dummy.ads, s-osinte-gnu.adb, s-osinte-rtems.adb, s-interr.adb,
104 s-inmaop.ads, s-vxwext-rtp.adb, s-osinte-gnu.ads, s-osinte-rtems.ads,
105 a-synbar-posix.adb, s-interr.ads, s-taspri-posix-noaltstack.ads,
106 s-vxwext-rtp.ads, a-synbar-posix.ads, a-extiin.ads, s-osinte-posix.adb,
107 s-tpinop.adb, s-tasres.ads, s-tpinop.ads, a-disedf.ads, a-diroro.ads,
108 s-linux-alpha.ads, a-tasatt.adb, s-solita.adb, a-intnam-solaris.ads,
109 a-tasatt.ads, s-solita.ads, s-tasinf-solaris.adb, s-tasinf-solaris.ads,
110 s-vxwork-arm.ads, s-tpopsp-posix-foreign.adb, s-intman-dummy.adb,
111 s-intman.ads, s-stusta.adb, s-stusta.ads, s-intman-posix.adb,
112 s-tpopsp-vxworks.adb, s-inmaop-dummy.adb, s-taspri-mingw.ads,
113 a-intnam-darwin.ads, s-osinte-aix.adb, s-osinte-dragonfly.adb,
114 s-osinte-aix.ads, s-tasinf-mingw.adb, s-osinte-dragonfly.ads,
115 s-linux-hppa.ads, s-osinte-x32.adb, s-inmaop-posix.adb,
116 s-tasinf-mingw.ads, s-intman-vxworks.adb, s-linux-mips.ads,
117 s-intman-vxworks.ads, s-osinte-android.adb, s-tasinf-linux.adb,
118 s-osinte-android.ads, s-vxwork-ppc.ads, s-tasinf-linux.ads,
119 a-dispat.adb, a-dispat.ads, s-tadert.adb, g-thread.adb, s-tadert.ads,
120 g-thread.ads, a-intnam-hpux.ads, s-linux-android.ads, s-tataat.adb,
121 a-exetim.ads, s-tataat.ads, a-reatim.adb, a-reatim.ads, thread.c,
122 g-boubuf.adb, s-osinte-freebsd.adb, g-boubuf.ads, s-osinte-freebsd.ads,
123 s-tasuti.adb, s-taspri-dummy.ads, a-exetim-mingw.adb, s-linux-x32.ads,
124 s-tasuti.ads, g-signal.adb, a-exetim-mingw.ads, s-interr-sigaction.adb,
125 g-signal.ads, s-osinte-hpux.ads, a-intnam-vxworks.ads,
126 s-osinte-hpux-dce.adb, s-taspri-posix.ads, s-osinte-hpux-dce.ads,
127 s-tasinf-vxworks.ads, g-tastus.ads, s-tpopsp-tls.adb,
128 s-taprop-solaris.adb, a-retide.adb, a-exetim-darwin.adb, a-retide.ads,
129 s-vxwext.adb, s-vxwext.ads, a-rttiev.adb, a-rttiev.ads, g-boumai.ads,
130 a-exetim-default.ads, s-taprop-mingw.adb, s-taspri-solaris.ads,
131 a-intnam-aix.ads: Move libgnarl sources to libgnarl subdir.
133 2017-09-08 Arnaud Charlet <charlet@adacore.com>
135 * doc/share/conf.py, doc/share/latex_elements.py,
136 doc/share/ada_pygments.py, doc/Makefile: Improve support for Ada
139 2017-09-08 Arnaud Charlet <charlet@adacore.com>
141 * gnat_rm.texi, gnat_ugn.texi,
142 doc/gnat_ugn/the_gnat_compilation_model.rst,
143 doc/gnat_ugn/getting_started_with_gnat.rst,
144 doc/gnat_ugn/inline_assembler.rst,
145 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
146 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
147 doc/gnat_ugn/about_this_guide.rst,
148 doc/gnat_ugn/platform_specific_information.rst,
149 doc/gnat_ugn/example_of_binder_output.rst,
150 doc/gnat_ugn/gnat_and_program_execution.rst,
151 doc/gnat_ugn/gnat_utility_programs.rst,
152 doc/gnat_rm/implementation_of_specific_ada_features.rst,
153 doc/gnat_rm/interfacing_to_other_languages.rst,
154 doc/gnat_rm/implementation_defined_aspects.rst,
155 doc/gnat_rm/intrinsic_subprograms.rst,
156 doc/gnat_rm/implementation_defined_characteristics.rst,
157 doc/gnat_rm/implementation_advice.rst,
158 doc/gnat_rm/implementation_defined_attributes.rst,
159 doc/gnat_rm/compatibility_and_porting_guide.rst,
160 doc/gnat_rm/standard_library_routines.rst,
161 doc/gnat_rm/the_gnat_library.rst,
162 doc/gnat_rm/implementation_defined_pragmas.rst,
163 doc/gnat_rm/representation_clauses_and_pragmas.rst,
164 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
165 doc/gnat_rm/obsolescent_features.rst,
166 doc/gnat_rm/about_this_guide.rst,
167 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
168 doc/gnat_rm/implementation_of_ada_2012_features.rst,
170 doc/gnat_rm.rst: Update documentation.
172 2017-09-08 Arnaud Charlet <charlet@adacore.com>
174 * s-dwalin.ads, s-dwalin.adb, s-trasym-dwarf.adb, s-objrea.ads,
175 s-objrea.adb, s-tsmona-linux.adb, s-tsmona-mingw.adb: New.
176 * gcc-interface/Makefile.in: Enable s-trasym-dwarf.adb on x86*linux.
178 2017-09-08 Bob Duff <duff@adacore.com>
180 * s-ststop.ads, s-ststop.adb, rtsfind.ads (String_Input_Tag):
181 New routine to read the Tag robustly.
182 * exp_attr.adb (Input): Change the expansion of 'Input,
183 in the class-wide case, to call String_Input_Tag instead of
186 2017-09-08 Arnaud Charlet <charlet@adacore.com>
188 * s-rident.ads (Restriction_Id): reorder enum
189 literals, so that Pure_Barriers is no longer in range of the
190 Cunit_Boolean_Restrictions subtype.
192 2017-09-08 Nicolas Roche <roche@adacore.com>
194 * a-taster.ads, a-taster.adb: Move to libgnarl
195 * gcc-interface/Makefile.in: Remove obsolete targets. Code cleanups.
196 Add support for files in libgnarl.
198 2017-09-08 Ed Schonberg <schonberg@adacore.com>
200 * exp_ch4.adb (Expand_N_Type_Conversion): Do not apply
201 accessibility check to an interface conversion, whose purpose
202 is to perform a pointer adjustment in a dispatching call.
203 * exp_ch6.adb (Expand_Call_JHelper): Add accessibility checks
204 when the actual is a construct that involves a dereference of an
205 expression that includes a formal of the enclosing subprogram,
206 In such cases, the accessibility level of the actual is that of
207 the corresponding formal, which is passed in as an additional
208 actual in the outer call.
210 2017-09-08 Bob Duff <duff@adacore.com>
212 * exp_intr.adb (Add_Source_Info): Do not decode
213 file names; they were not encoded in the first place.
215 2017-09-08 Bob Duff <duff@adacore.com>
217 * a-tags.adb (Internal_Tag): Unsuppress checks, so we get
218 exceptions instead of crashes. Check for absurdly long strings
219 and empty strings. Empty strings cause trouble because they can
220 have super-null ranges (e.g. 100..10), which causes Ext_Copy to
221 be empty, which causes an array index out of bounds.
222 * s-ststop.adb (Input): Unsuppress checks, so we get exceptions
225 2017-09-08 Arnaud Charlet <charlet@adacore.com>
227 * sem_util.adb (Is_CCT_Instance): allow use in
228 the context of protected types.
230 2017-09-08 Arnaud Charlet <charlet@adacore.com>
232 * a-tigeli.adb: minor remove extra whitespace.
234 2017-09-08 Gary Dismukes <dismukes@adacore.com>
236 * par-ch4.adb: Reformatting of an error message.
238 2017-09-08 Javier Miranda <miranda@adacore.com>
240 * sem_ch3.adb (Resolve_Name): Under ASIS mode analyze overloaded
241 identifiers to ensure their correct decoration of names on
244 2017-09-08 Yannick Moy <moy@adacore.com>
246 * exp_attr.adb (Expand_Loop_Entry_Attribute): Do
247 not skip a loop coming from source which is rewritten into a loop.
249 2017-09-08 Ed Schonberg <schonberg@adacore.com>
251 * freeze.adb (Wrap_Imported_Subprogram): Indicate that the
252 wrapper has convention Ada, to prevent spurious warnings on
253 unconstrained array parameters.
255 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
257 * sem_prag.adb (Check_Variant): Use First_Non_Pragma/Next_Non_Pragma.
258 (Analyze_Pragma) <Pragma_Unchecked_Union>: Likewise.
260 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
262 * sem_ch6.adb (Freeze_Expr_Types): Rename Spec_Id into Def_Id.
264 2017-09-08 Arnaud Charlet <charlet@adacore.com>
266 * exp_intr.adb (Append_Entity_Name): Move to ...
267 * sem_util.ads, sem_util.adb: ... here to share it.
268 (Subprogram_Name): New subprogram, to compute the name of the enclosing
270 * errutil.adb (Error_Msg): Fill new field Node.
271 * erroutc.ads (Subprogram_Name_Ptr): New.
272 (Error_Msg_Object): New field Node.
273 * erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
274 * errout.adb (Error_Msg): New variant with node id parameter.
275 Fill new parameter Node when emitting messages. Revert previous
276 changes for Include_Subprogram_In_Messages.
277 * sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
278 generating warning message.
280 2017-09-08 Ed Schonberg <schonberg@adacore.com>
282 * par-ch4.adb (P_Iterated_Component_Association): Place construct
283 under -gnat2020 flag, given that it is a future feature of
285 * sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
286 defining identifier as referenced to prevent spurious warnings:
287 corresponding loop is expanded into one or more loops whose
288 variable has the same name, and the expression uses those names
289 and not the original one.
291 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
293 * sem_elab.adb (Check_A_Call): Do not consider
294 references to internal variables for SPARK semantics.
296 2017-09-08 Arnaud Charlet <charlet@adacore.com>
298 * inline.adb (In_Package_Spec): refine type of
299 the parameter from Node_Id to Entity_Id.
301 2017-09-08 Justin Squirek <squirek@adacore.com>
303 * exp_ch5.adb (Expand_Formal_Container_Loop):
304 Reset the scope of the loop parameter after it is reanalyzed.
306 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
308 * sem_util.ads (Set_Rep_Info): New inline procedure.
309 * sem_util.adb (Set_Rep_Info): Implement it.
310 * sem_ch3.adb (Process_Subtype): If the case of a constraint present,
311 always copy the representation aspects onto the subtype.
313 2017-09-08 Georges-Alex Jaloyan <jaloyan@adacore.com>
315 * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_key):
316 Correction of the return type from access type to option type.
317 (Simple_HTable): Moving the Instance_Data to ads file.
319 2017-09-08 Yannick Moy <moy@adacore.com>
321 * sem_prag.adb: Use System.Case_Util.To_Lower to simplify code.
323 2017-09-08 Arnaud Charlet <charlet@adacore.com>
325 * opt.ads (Include_Subprogram_In_Messages): New variable.
326 * errout.ads (Current_Subprogram_Ptr): New variable.
327 * errout.adb (Error_Msg): Prepend current subprogram info
328 in messages if Include_Subprogram_In_Messages is set.
329 * sem_util.adb (elab code): Initialize Current_Subprogram_Ptr to
331 * gnat1drv.adb (Adjust_Global_Switches): Set
332 Include_Subprogram_In_Messages when -gnatdJ is set.
333 * debug.adb: Document and reserve -gnatdJ.
335 2017-09-08 Georges-Axel Jaloyan <jaloyan@adacore.com>
337 * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_Key): New
338 functions to iterate over simple hastables.
339 (Load_Factor_HTable): Remove obsolete and inefficient implementation.
341 2017-09-08 Javier Miranda <miranda@adacore.com>
343 * exp_ch6.adb (Unqual_BIP_Function_Call): Adding
344 missing checks on the presence of Entity() before checking the
347 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
349 * sem_ch6.adb (Analyze_Expression_Function): Reorder some
350 statements, use local variable and remove unnecessary processing.
352 2017-09-08 Javier Miranda <miranda@adacore.com>
354 * exp_ch6.ads (Make_Build_In_Place_Iface_Call_In_Allocator): New
356 (Make_Build_In_Place_Iface_Call_In_Anonymous_Context): New subprogram.
357 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
359 (Unqual_BIP_Iface_Function_Call): New subprogram.
360 * exp_ch6.adb (Replace_Renaming_Declaration_Id): New
361 subprogram containing code that was previously inside
362 Make_Build_In_Place_Call_In_Object_Declaration since it is also
363 required for one of the new subprograms.
365 Invoke Make_Build_In_Place_Iface_Call_In_Anonymous_Context
366 (Expand_N_Extended_Return_Statement): Extend the
367 cases covered by an assertion on expected BIP object
369 (Make_Build_In_Place_Call_In_Assignment):
370 Removing unused code; found working on this ticket.
371 (Make_Build_In_Place_Call_In_Object_Declaration): Move the code
372 that replaces the internal name of the renaming declaration
373 into the new subprogram Replace_Renaming_Declaration_Id.
374 (Make_Build_In_Place_Iface_Call_In_Allocator): New subprogram.
375 (Make_Build_In_Place_Iface_Call_In_Anonymous_Context):
377 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
379 (Unqual_BIP_Iface_Function_Call): New subprogram.
380 * exp_ch3.adb (Expand_N_Object_Declaration): Invoke the new
381 subprogram Make_Build_In_Place_Iface_Call_In_Object_Declaration.
382 * exp_attr.adb (Expand_N_Attribute_Reference): Invoke the new
383 subprogram Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
384 * exp_ch4.adb (Expand_Allocator_Expression): Invoke the new
385 subprogram Make_Build_In_Place_Iface_Call_In_Allocator.
386 (Expand_N_Indexed_Component): Invoke the new subprogram
387 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
388 (Expand_N_Selected_Component): Invoke the new subprogram
389 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
390 (Expand_N_Slice): Invoke the new subprogram
391 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
392 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration):
393 Invoke the new subprogram
394 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
396 2017-09-08 Javier Miranda <miranda@adacore.com>
398 * exp_disp.adb (Expand_Interface_Conversion): Fix handling of
399 access to interface types. Remove also the accessibility check.
401 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
403 * sem_ch6.adb (Freeze_Expr_Types): Really freeze
404 all the types that are referenced by the expression.
405 (Analyze_Expression_Function): Call Freeze_Expr_Types for
406 a completion instead of manually freezing the type of the
408 (Analyze_Subprogram_Body_Helper): Do not call Freeze_Expr_Types here.
410 2017-09-08 Ed Schonberg <schonberg@adacore.com>
412 * exp_prag.adb (Replace_Discriminals_Of_Protected_Op):
413 New procedure, auxiliary to Expand_Pragma_Check, to handle
414 references to the discriminants of a protected type within a
415 precondition of a protected operation. This is needed because
416 the original precondition has been analyzed in the context of
417 the protected declaration, but in the body of the operation
418 references to the discriminants have been replaved by references
419 to the discriminants of the target object, and these references
420 are only created when expanding the protected body.
422 2017-09-08 Yannick Moy <moy@adacore.com>
424 * sem_prag.adb (Analyze_Pragma): Issue more precise error messages on
427 2017-09-08 Ed Schonberg <schonberg@adacore.com>
429 * exp_attr.adb (Build_Record_VS_Func): If the record is an
430 unchecked union, do not emit checks for its (non-existent)
431 discriminants, or for variant parts that depend on them.
433 2017-09-08 Justin Squirek <squirek@adacore.com>
435 * sem_ch4.adb (Find_Equality_Types.Try_One_Interp,
436 Find_Comparison_Type.Try_One_Interp): Add check for generic
439 2017-09-08 Arnaud Charlet <charlet@adacore.com>
441 * sem_ch3.adb, layout.adb, layout.ads, exp_attr.adb, debug.adb,
442 exp_pakd.adb, sem_prag.adb, gnat1drv.adb, targparm.adb, targparm.ads,
443 repinfo.adb, exp_ch6.adb, exp_aggr.adb, sem_eval.adb, sem_ch13.adb,
444 exp_ch3.adb: Remove references to Frontend_Layout_On_Target and
445 remaining references to AAMP_On_Target.
447 2017-09-08 Ed Schonberg <schonberg@adacore.com>
449 * style.adb: Fix typo.
451 2017-09-08 Javier Miranda <miranda@adacore.com>
453 * einfo.adb (Underlying_Type): Add missing support for class-wide
454 types that come from the limited view.
455 * exp_attr.adb (Attribute_Address): Check class-wide type
456 interfaces using the underlying type to handle limited-withed
458 (Attribute_Tag): Check class-wide type interfaces using
459 the underlying type to handle limited-withed types.
461 2017-09-08 Ed Schonberg <schonberg@adacore.com>
463 * exp_ch5.adb (Expand_Predicated_Loop): Handle properly a loop
464 over a subtype of a type with a static predicate, taking into
465 account the predicate function of the parent type and the bounds
466 given in the loop specification.
467 * sem_ch3.adb (Inherit_Predicate_Flags): For qn Itype created for
468 a loop specification that is a subtype indication whose type mark
469 is a type with a static predicate, inherit predicate function,
470 used to build case statement for rewritten loop.
472 2017-09-08 Justin Squirek <squirek@adacore.com>
474 * lib-load.adb: Modify printing of error message to exclude file
477 2017-09-08 Arnaud Charlet <charlet@adacore.com>
479 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode):
480 don't inline subprograms declared in both visible and private
482 (In_Package_Spec): previously In_Package_Visible_Spec; now
483 detects subprograms declared both in visible and private parts
486 2017-09-08 Ed Schonberg <schonberg@adacore.com>
488 * exp_util.adb (Build_Invariant_Procedure_Declaration): If
489 the type is an anonymous array in an object declaration, whose
490 component type has an invariant, use the object declaration
491 as the insertion point for the invariant procedure, given that
492 there is no explicit type declaration for an anonymous array type.
494 2017-09-08 Bob Duff <duff@adacore.com>
496 * a-cbprqu.ads, a-cbdlli.adb: Suppress warnings.
498 2017-09-08 Bob Duff <duff@adacore.com>
500 * a-strfix.adb (Trim): Compute Low and High only if needed.
502 2017-09-08 Justin Squirek <squirek@adacore.com>
504 * lib-load.adb (Load_Main_Source): Add error output in the case a
505 source file is missing.
507 2017-09-08 Bob Duff <duff@adacore.com>
510 * a-textio.adb, a-witeio.adb, a-ztexio.adb (Set_WCEM): Use
511 Default_WCEM by default (i.e. if the encoding is not specified
514 2017-09-08 Bob Duff <duff@adacore.com>
516 * s-trasym.ads (Hexa_Traceback): If
517 Suppress_Hex is True, print "..." instead of a hexadecimal
519 * s-trasym.adb: Ignore No_Hex in this version.
522 2017-09-08 Bob Duff <duff@adacore.com>
524 * debug.adb: Minor reformatting.
526 2017-09-08 Bob Duff <duff@adacore.com>
528 * a-cbdlli.adb, a-cohama.adb, a-cohase.adb (Copy): Rewrite the
529 code so it doesn't trigger an "uninit var" warning.
531 2017-09-08 Nicolas Roche <roche@adacore.com>
533 * s-hibaen.ads: Remove obsolete file.
535 2017-09-08 Arnaud Charlet <charlet@adacore.com>
537 * a-locale.ads: Add comment explaining the state of this package.
539 2017-09-08 Arnaud Charlet <charlet@adacore.com>
541 * sem_util.adb (Is_CCT_Instance): Allow calls in the context
543 * sem_prag.ads, sem_prag.adb (Find_Related_Declaration_Or_Body):
544 allow calls in the context of package spec (for pragma
545 Initializes) and bodies (for pragma Refined_State).
547 2017-09-08 Bob Duff <duff@adacore.com>
549 * checks.adb (Insert_Valid_Check): Copy the Do_Range_Check flag to the
552 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
554 * debug.adb (dA): Adjust comment.
555 * gnat1drv.adb (Gnat1drv): Likewise.
556 * opt.ads (List_Representation_Info_Extended): New variable.
557 * repinfo.adb (List_Record_Info): Split implementation into...
558 (Compute_Max_Length): ...this. Recurse on records if requested.
559 (List_Record_Layout): Likewise.
560 * switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
561 statement, accept '0' and set List_Representation_Info_Extended
563 * usage.adb (Usage): Document new -gnatRe variant.
565 2017-09-08 Ed Schonberg <schonberg@adacore.com>
567 * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
568 Do not save the given entity in the global variable Default_Pool
569 if the pragma appears within a generic unit.
571 2017-09-08 Bob Duff <duff@adacore.com>
573 * errout.adb (Delete_Warning): Do not
574 decrement Warnings_Treated_As_Errors. This is called before
575 Warnings_Treated_As_Errors has been incremented to account for
576 this warning. Decrementing it here can lead to negative values
577 of Warnings_Treated_As_Errors, raising Constraint_Error in
578 checks-on builds, and causing the compiler to return an error
579 code in checks-off builds.
581 2017-09-08 Arnaud Charlet <charlet@adacore.com>
583 * sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
584 entities of named concurrent types as Ref_Id and not of anonymous
585 concurrent objects (because callers already know when a conversion
586 is necessary and can easily do it); also, do not expect protected
587 types or protected objects as Context_Id (because no flow-related
588 SPARK pragmas are attached there); reflect these changes in a
589 more precise comment.
591 2017-09-08 Olivier Hainque <hainque@adacore.com>
593 * g-altive.ads: Add documentation.
595 2017-09-08 Bob Duff <duff@adacore.com>
597 * sem_util.ads, debug.adb: Minor comment fix.
598 * erroutc.ads: Comment fix.
600 2017-09-08 Ed Schonberg <schonberg@adacore.com>
602 * sem_ch12.adb (Validate_Array_Type_Instance): Suppress check
603 for compatibility of component types of formal and actual in an
604 instantiation of a child unit, when the component type of the
605 formal is itself a formal of an enclosing generic.
607 2017-09-08 Arnaud Charlet <charlet@adacore.com>
609 * sem_util.ads, sem_util.adb (Is_CCT_Instance): moved from
610 sem_prag.adb to make it available for GNATprove; for concurrent
611 types replace custom scope climbing with Scope_Same_Or_Within; for
612 single concurrent objects add scope climbing (with Scope_Within),
613 which was not there (that's the primary semantic change of this
614 commit); also, when comparing a single concurrent object with
615 its corresponding concurrent type rely on equality of types,
616 not of objects (because that's simpler to code).
617 * sem_prag.adb (Is_CCT_Instance): lifted to sem_util.ads.
618 (Analyze_Global_Item): adjust special-casing of references to the
619 current instance of a concurrent unit in the Global contracts
620 of task types and single tasks objects; similar for references
621 in the protected operations and entries of protected types and
622 single protected objects (in all these cases the current instance
623 behaves as an implicit parameter and must not be mentioned in
624 the Global contract).
626 2017-09-08 Arnaud Charlet <charlet@adacore.com>
628 * exp_ch6.adb (Expand_Call_Helper): Introduce temporary for
629 function calls returning a record within a subprogram call,
632 2017-09-08 Ed Schonberg <schonberg@adacore.com>
634 * sem_ch8.adb (Find_Expanded_Name): Handle properly an expanded
635 name that designates the current instance of a child unit in its
636 own body and appears as the prefix of a reference to an entity
637 local to the child unit.
638 * exp_ch6.adb, freeze.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
641 2017-09-08 Yannick Moy <moy@adacore.com>
643 * sem_res.adb (Resolve_Equality_Op): Do not warn on comparisons that
646 2017-09-08 Tristan Gingold <gingold@adacore.com>
648 * sem_warn.adb (Check_Unused_Withs): Remove test that disabled
649 warnings on internal units in configurable run time mode.
651 2017-09-08 Bob Duff <duff@adacore.com>
653 * sem_ch3.adb (Build_Derived_Private_Type): Inherit
654 representation items from interfaces that the derived type
655 implements, not just from the parent type.
656 * sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
657 this to return an empty list when there are no interfaces.
658 * einfo.ads, sem_ch13.adb: Minor comment fixes.
659 * sem_attr.adb: Minor comment fix.
661 2017-09-08 Doug Rupp <rupp@adacore.com>
663 * sigtramp-vxworks.c [i386]: Adjust the kernel context for
666 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
668 * exp_ch4.adb (Expand_N_Allocator): Generate a
669 call to Allocate_Any_Controlled when the allocation does not
670 require any initialization.
672 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
674 * sem_util.adb (Copy_Node_With_Replacement):
675 Update the Renamed_Object field of a replicated object renaming
678 2017-09-08 Patrick Bernardi <bernardi@adacore.com>
680 * exp_ch9.adb (Is_Pure_Barrier): Allow type
681 conversions and components of objects. Simplified the detection
682 of the Count attribute by identifying the corresponding run-time
685 2017-09-08 Yannick Moy <moy@adacore.com>
687 * exp_ch9.adb, exp_disp.adb, repinfo.adb, sem_ch12.adb, sem_dim.adb,
688 sem_type.adb, sinfo.ads: Minor reformatting.
690 2017-09-08 Ed Schonberg <schonberg@adacore.com>
692 * freeze.adb (Has_Incomplete_Compoent): New predicate, subsidiary
693 of Freeze_Profile, used to inhibit the freezing of the profile
694 of an expression function declared within a nested package, when
695 some type in the profile depends on a private type declared in
696 an enclosing package.
698 2017-09-08 Bob Duff <duff@adacore.com>
700 * gnat1drv.adb (Gnat1drv): Do not set the Force_ALI_Tree_File flag in
701 the subunit case. It's still OK to set it in the "missing subunits"
702 case, because that won't cause the obsolete .ali files that cause
705 2017-09-08 Bob Duff <duff@adacore.com>
707 * sinput-l.adb: Remove unused "with Unchecked_Conversion;". It's
708 unclear why this didn't cause a warning.
709 * a-uncdea.ads, a-unccon.ads: Add "Ada." to names in the
710 pragmas. It's unclear why this didn't cause an error.
712 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
714 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration):
716 (Expand_SPARK_Potential_Renaming): Code clean up.
717 * sem_prag.adb (Analyze_Initialization_Item): Add a guard in case
718 the item does not have a proper entity.
719 (Analyze_Input_Item): Add a guard in case the item does not have a
721 (Collect_States_And_Objects): Include object renamings in the
722 items being collected.
723 (Resolve_State): Update the documentation of this routine.
724 * sem_util.adb (Entity_Of): Add circuitry to handle
725 renamings of function results.
726 (Remove_Entity): New routine.
727 (Remove_Overloaded_Entity): Take advantage of factorization.
728 * sem_util.ads (Entity_Of): Update the documentation
730 (Remove_Entity): New routine.
731 (Remove_Overloaded_Entity): Update the documentation of this
734 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
736 * repinfo.adb (List_Record_Info): During first loop,
737 do not override the normalized position and first bit
738 if they have already been set. Move fallback code
739 for the packed case to the case where it belongs.
740 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
741 Also adjust the normalized position of components.
742 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): Likewise.
744 2017-09-08 Ed Schonberg <schonberg@adacore.com>
746 * exp_disp.adb (Make_DT, Set_All_DT_Position): Handle properly
747 the placement of a primitive operation O that renames an operation
748 R declared in an inner package, and which is thus not a primitive
749 of the dispatching type of O. In this case O is a new primitive
750 and does not inherit its dispatch table position from R (which
753 2017-09-08 Ed Schonberg <schonberg@adacore.com>
755 * sem_dim.adb (Analyze_Dimension_If_Expression,
756 Analyze_Dimension_Case_Expression): new subprograms to verify
757 the dimensional correctness of Ada2012 conditional expressions,
758 and set properly the dimensions of the construct.
759 * sem_res.adb (Resolve_If_Expression, Resolve_Case_Expression)):
760 call Analyze_Dimension.
762 2017-09-08 Ed Schonberg <schonberg@adacore.com>
764 * sem_type.adb (Expand_Interface_Conversion): Prevent an infinite
765 loop on an interface declared as a private extension of another
766 synchronized interface.
768 2017-09-08 Ed Schonberg <schonberg@adacore.com>
770 * sem_ch12.adb (Check_Generic_Parent): New procedure within
771 Analyze_Associations, to handle actual packages that depend on
772 previous instances. If a package IAP that is an instantiation is
773 used as an actual in a subsequent instantiation SI in the same
774 scope, and IAP has a body, IAP must be frozen before SI. If
775 the generic parent of IAP is itself declared in a previous
776 instantiation in the same scope, that instantiation must also
778 (Install_Body): Prevent double insertion of freeze node for
781 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
783 * sem_prag.adb (Resolve_State): Update the
784 comment on documentation. Generate a reference to the state once
785 resolution takes place.
787 2017-09-08 Ed Schonberg <schonberg@adacore.com>
789 * sem_ch13.adb (Analyze_Aspect_Specifications, case
790 Linker_Section): If the aspect applies to an object declaration
791 with explicit initialization, do not delay the freezing of the
792 object, to prevent access-before-elaboration in the generated
795 2017-09-08 Ed Schonberg <schonberg@adacore.com>
797 * a-wtdeio.adb (Put, all versions): Use Long_Long_Integer
798 (Integer_Value (Item)) when the size of the fixed decimal type
799 is larger than Integer.
801 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
804 * gcc-interface/decl.c (copy_and_substitute_in_layout): Put the fields
805 in order of increasing position in more cases.
807 2017-09-07 Yannick Moy <moy@adacore.com>
809 * a-exetim-mingw.ads: Add contract Global=>null
810 on all operations that are modeled as having no read or write
811 of global variables in SPARK.
813 2017-09-07 Raphael Amiard <amiard@adacore.com>
815 * a-chtgop.adb, a-chtgop.ads (Generic_Iteration_With_Position): Added
816 to Hmaps.Generic_Ops.
817 * a-cohama.adb (Ada.Containers.Hmaps.Iterate): Pass proper position in
819 * a-cihama.adb (Ada.Containers.Indefinite_Hmaps.Iterate): Pass pos in
821 * a-cohase.adb (Ada.Containers.Hashed_Sets.Iterate): Pass proper
824 2017-09-07 Javier Miranda <miranda@adacore.com>
826 * sem_elab.adb (Check_Task_Activation): Adding switch -gnatd.y to
827 allow disabling the generation of implicit pragma Elaborate_All
830 2017-09-07 Javier Miranda <miranda@adacore.com>
832 * exp_disp.adb (Make_Tags): Avoid suffix counter
833 in the external name of the elaboration flag. Required to fix
834 the regressions introduced by the initial version of this patch.
836 2017-09-07 Bob Duff <duff@adacore.com>
838 * sem_ch6.adb (Analyze_Function_Return): Do not
839 insert an explicit conversion to force the displacement of the
840 "this" pointer to reference the secondary dispatch table in the
841 case where the return statement is returning a raise expression,
842 as in "return raise ...".
844 2017-09-07 Arnaud Charlet <charlet@adacore.com>
846 * sem_disp.adb (Is_User_Defined_Equality): Removed procedure.
847 * sem_util.ads, sem_util.adb (Is_User_Defined_Equality): Copied
848 procedure from sem_disp.adb.
849 * sem_ch12.ads (Get_Unit_Instantiation_Node): rename Package
851 * sem_ch12.adb (Get_Unit_Instantiation_Node): function extended to
852 return the instantiation node for subprograms. Update references
853 to Get_Unit_Instantiation_Node.
854 * sem_ch7.adb (Install_Parent_Private_Declarations): update
855 reference to Get_Unit_Instantiation_Node.
856 * exp_dist.adb (Build_Package_Stubs): update reference to
857 Get_Unit_Instantiation_Node.
858 * sem_ch9.adb: minor typo in comment.
859 * lib-xref-spark_specific.adb
860 (Traverse_Declaration_Or_Statement): traverse into task type
863 2017-09-07 Ed Schonberg <schonberg@adacore.com>
865 * sem_dim.adb (Analyze_Dimension_Type_Conversion): New procedure
866 to handle properly various cases of type conversions where the
867 target type and/or the expression carry dimension information.
868 (Dimension_System_Root); If a subtype carries dimension
869 information, obtain the source parent type that carries the
872 2017-09-07 Dmitriy Anisimkov <anisimko@adacore.com>
874 * g-socket.adb, g-socket.ads (GNAT.Sockets.To_Ada): New routine.
876 2017-09-07 Ed Schonberg <schonberg@adacore.com>
878 * exp_attr.adb (Expand_N_Attribute_Reference, case 'Constrained):
879 If the prefix is a reference to an object, rewrite it as an
880 explicit dereference, as required by 3.7.2 (2) and as is done
881 with most other attributes whose prefix is an access value.
883 2017-09-07 Bob Duff <duff@adacore.com>
885 * par-ch13.adb: Set the Inside_Depends flag if we are inside a
886 Refined_Depends aspect.
887 * par-ch2.adb: Set the Inside_Depends flag if we are inside a
888 Refined_Depends pragma.
889 * scans.ads: Fix documentation of Inside_Depends flag.
890 * styleg.adb, styleg.ads: Minor reformatting and comment fixes.
892 2017-09-07 Hristian Kirtchev <kirtchev@adacore.com>
894 * exp_ch7.adb (Insert_Actions_In_Scope_Around):
895 Account for the case where the are no lists to insert, but the
896 secondary stack still requires management.
897 * a-chtgop.adb, a-cihama.adb, a-cohama.adb, a-cohase.adb, a-tags.adb,
898 comperr.adb, einfo.adb, exp_aggr.adb, exp_ch3.adb, exp_disp.adb,
899 lib-xref.adb, lib-xref-spark_specific.adb, sem_ch12.adb, sem_ch13.adb,
900 sem_ch6.adb, sem_dim.adb, sem_dim.ads, sem_elab.adb, sem_prag.adb:
903 2017-09-07 Vincent Celier <celier@adacore.com>
905 * clean.adb: Do not get the target parameters before calling
908 2017-09-07 Nicolas Roche <roche@adacore.com>
910 * s-osinte-solaris-posix.ads: Removed.
912 2017-09-07 Arnaud Charlet <charlet@adacore.com>
914 * sem_prag.adb (Collect_States_And_Objects): Detect also instances of
915 single concurrent objects.
917 2017-09-07 Javier Miranda <miranda@adacore.com>
919 * s-regexp.ads: Fix documentation of the globbing grammar.
921 2017-09-07 Gary Dismukes <dismukes@adacore.com>
923 * a-tags.ads, einfo.ads, exp_disp.ads: Minor reformatting.
925 2017-09-07 Arnaud Charlet <charlet@adacore.com>
927 * gnat1drv.adb (Gnat1drv): Enable pragma Ignore_Pragma (Global)
928 in CodePeer mode, to support more legacy code automatically.
930 2017-09-07 Ed Schonberg <schonberg@adacore.com>
932 * exp_disp.adb (Replace_Formals): If thr formal is classwide,
933 and thus not a controlling argument, preserve its type after
934 rewriting because it may appear in an nested call with a classwide
937 2017-09-07 Arnaud Charlet <charlet@adacore.com>
939 * comperr.adb (Delete_SCIL_Files): Handle case of
940 N_Package_Instantiation.
942 2017-09-07 Ed Schonberg <schonberg@adacore.com>
944 * sem_ch10.adb (Remove_Private_With_Clause): If a private with
945 clause for a unit U appears in a context that includes a regular
946 with_clause on U, rewrite the redundant private clause into a null
947 statement, rather than removing it altogether from the context,
948 so that ASIS tools can reconstruct the original source.
950 2017-09-07 Ed Schonberg <schonberg@adacore.com>
952 * sem_ch13.adb (Check_Aspect_At_Freeze_Point): The expression
953 for aspect Small can be of any real type (not only a universal
954 real literal) as long as it is a static constant.
956 2017-09-07 Thomas Quinot <quinot@adacore.com>
958 * par_sco.adb: Minor reformatting.
960 2017-09-07 Arnaud Charlet <charlet@adacore.com>
962 * s-parame-ae653.ads: Removed.
964 2017-09-07 Nicolas Roche <roche@adacore.com>
966 * s-traces-default.adb, s-trafor-default.adb, s-trafor-default.ads,
967 s-traces.adb, s-traces.ads, s-tratas-default.adb, s-tfsetr-default.adb,
968 s-tfsetr-vxworks.adb, s-tratas.adb, s-tratas.ads, s-tasuti.adb,
969 s-parame-hpux.ads, s-tassta.adb, s-taasde.adb, s-tasren.adb,
970 s-taprob.adb, a-caldel.adb, s-parame.ads, Makefile.rtl, s-tpobop.adb,
971 s-taenca.adb, s-parame-vxworks.ads: Remove support for System.Traces.
973 2017-09-07 Yannick Moy <moy@adacore.com>
975 * a-ngelfu.ads Add preconditions to all functions
976 listed in Ada RM A.5.1(19-33) as having constraints on inputs.
978 2017-09-07 Arnaud Charlet <charlet@adacore.com>
980 * lib-xref.adb (Generate_Reference): ignore
981 references to entities which are Part_Of single concurrent
984 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
986 * sem_ch7.adb (Hide_Public_Entities): Add paragraph to main
989 2017-09-07 Arnaud Charlet <charlet@adacore.com>
991 * a-taside.adb (Activation_Is_Complete): Raise Program_Error if
992 Null_Task_Id is passed.
994 2017-09-07 Javier Miranda <miranda@adacore.com>
996 * einfo.ads, einfo.adb (Access_Disp_Table_Elab_Flag): New
997 attribute. Defined for record types and subtypes.
998 * exp_ch3.ads (Init_Secondary_Tags): Adding new formal
999 (Init_Tags_List) to facilitate generating separate code in the
1000 IP routine to initialize the object components and for completing
1001 the elaboration of dispatch tables.
1002 * exp_ch3.adb (Build_Init_Procedure): Improve the code
1003 generated in the IP routines by means of keeping separate
1004 the initialization of the object components from the
1005 initialization of its dispatch tables. (Init_Secondary_Tags):
1006 Adding new formal (Init_Tags_List) and adjusting calls to
1007 Ada.Tags.Set_Dynamic_Offset_To_Top since it has a new formal;
1008 adjusting also calls to Ada.Tags.Register_Interface_Offset
1009 because the type of one of its formals has been changed.
1010 * a-tags.ads, a-tags.adb (Register_Interface_Offset): Profile
1011 modified. Instead of receiving a pointer to an object this
1012 routine receives now a primary tag.
1013 (Set_Dyanic_Offset_To_Top): Profile modified. This routine receives an
1014 additional formal: the tag of the primary dispatch table.
1015 * exp_disp.ads (Elab_Flag_Needed): New subprogram.
1016 * exp_disp.adb (Elab_Flag_Needed): New subprogram.
1017 (Make_Tags): Adding the declaration of the elaboration flag (if needed).
1018 * exp_aggr.adb (Build_Record_Aggr_Code): Adding actual of new
1019 formal in calls to Init_Secondary_Tags.
1021 2017-09-07 Javier Miranda <miranda@adacore.com>
1023 * ghost.adb (Mark_And_Set_Ghost_Instantiation.Check_Ghost_Actuals): New
1025 * sem_prag.adb (Pragma_Ghost): Add missing support for ghost
1026 applied to generic subprograms.
1028 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1030 * sem_util.adb (Check_Part_Of_Reference): rename Conc_Typ to Conc_Obj
1031 (because it refers to the anonymous concurrent object, not its type);
1032 fix condition for emitting error message about task/protected type,
1034 2017-09-07 Bob Duff <duff@adacore.com>
1036 * binde.adb (Debug_Flag_Old): If both -do and -dp
1037 are specified, behave as if just -do was specified, rather than
1040 2017-09-07 Nicolas Roche <roche@adacore.com>
1042 * system-vxworks-sparcv9.ads, s-vxwork-m68k.ads, s-vxwork-mips.ads,
1043 system-vxworks-m68k.ads, system-vxworks-mips.ads: Removed.
1045 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1047 * sem_prag.adb (Find_Role): The Global_Seen flag
1048 is now consulted not only for abstract states and variables,
1049 but for all kinds of items.
1050 (Collect_Subprogram_Inputs_Outputs): Do not process formal
1051 generic parameters, because unlike ordinary formal parameters,
1052 generic formals only act as input/ outputs if they are explicitly
1053 mentioned in a Global contract.
1055 2017-09-07 Yannick Moy <moy@adacore.com>
1057 * ghost.adb (Check_Ghost_Context): Do not err on ghost code inside
1058 predicate procedure. Check predicate pragma/aspect with Ghost entity.
1059 * exp_ch6.adb, par-ch6.adb, sem_ch13.adb, sem_prag.adb; Minor
1062 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1064 * sem_aggr.adb: Move New_Copy_Tree_And_Dimensions to sem_dim
1066 * sem_ch3.adb (Build_Derived_Record_Type):i Call
1067 Copy_Dimensions_Of_Components after creating the copy of the
1069 * sem_dim.ads, sem_dim.adb (Copy_Dimensions_Of_Components): For a
1070 derived recor type, copy the dikensions if any of each component
1071 of the parent record to the corresponding component declarations
1072 of the derived record. These expressions are used among other
1073 things as default values in aggregates with box associations.
1074 * a-dirval-mingw.adb, g-cgi.adb, gnatcmd.adb, lib-xref.adb,
1075 repinfo.adb, sem_attr.adb, sem_ch10.adb, sem_ch6.adb, sem_prag.adb:
1078 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1080 * sem_util.adb: Remove extra space after THEN.
1082 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1084 * sem_ch7.adb (Has_Referencer): For a subprogram renaming,
1085 also mark the renamed subprogram as referenced.
1087 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1089 * par-ch6.adb (P_Subprogram): Improve error message on null
1090 procedure with misplaced aspect specification, which the parser
1091 first attempts to interpret as a malformed expression function.
1093 2017-09-07 Gary Dismukes <dismukes@adacore.com>
1095 * sem_attr.adb (Analyze_Attribute_Old_Result):
1096 Allow attributes Result and Old in the case of an expression
1099 2017-09-07 Justin Squirek <squirek@adacore.com>
1101 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Propagate
1102 Volatile to subcomponents.
1104 2017-09-07 Bob Duff <duff@adacore.com>
1106 * exp_ch7.adb (Find_Last_Init): Check for the
1107 case where a build-in-place function call has been replaced by a
1108 'Reference attribute reference.
1110 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1112 * sem_ch7.adb (Has_Referencer): Recurse on Actions of freeze
1115 2017-09-07 Bob Duff <duff@adacore.com>
1117 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration,
1118 Make_Build_In_Place_Call_In_Anonymous_Context): Do not use the
1119 secondary stack for all functions that return limited tagged
1120 types -- just do it for dispatching calls. Misc cleanup.
1121 * sem_util.ads, sem_util.adb (Unqual_Conv): New function to
1122 remove qualifications and type conversions. Fix various bugs
1123 where only a single level of qualification or conversion was
1124 removed, so e.g. "T1'(T2'(X))" would incorrectly return "T2'(X)"
1126 * checks.adb, exp_util.ads, exp_util.adb, sem_res.adb: Misc related
1129 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1131 * sem_ch6.adb (setr_Actual_Subtypes): Within a predicate function
1132 do not create actual subtypes that may generate further predicate
1134 * sem_ch13.adb (Build_Predicate_Functions): Indicate that entity
1135 of body is a predicate function as well.
1136 (Resolve_Aspect_Expressions, Resolve_Name): For a component
1137 association, only the expression needs resolution, not the name.
1138 (Resolve_Aspect_Expressions, case Predicates): Construct and
1139 analyze the predicate function declaration in the scope of the
1140 type, before making the type and its discriminants visible.
1142 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1144 * gcc-interface/decl.c (warn_on_field_placement): Issue the warning
1145 only if the record type itself comes from source.
1147 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1149 * sem_ch5.adb: Minor reformatting and a typo fix
1151 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1153 * sinput-l.ads: minor remove extra period at the end of comment
1155 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1157 * sem_prag.adb (Add_Item_To_Name_Buffer): remove support for
1159 (Find_Role): remove support for E_Discriminant.
1161 2017-09-06 Javier Miranda <miranda@adacore.com>
1163 * exp_ch6.adb (Expand_Simple_Function_Return):
1164 Add missing implicit type conversion to force displacement of the
1167 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1169 * sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting.
1171 2017-09-06 Yannick Moy <moy@adacore.com>
1173 * sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set
1174 global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once.
1176 2017-09-06 Bob Duff <duff@adacore.com>
1178 * sem_ch8.adb: Change Assert to be consistent with
1181 2017-09-06 Bob Duff <duff@adacore.com>
1183 * binde.adb (Find_Elab_Order): Do not run Elab_Old unless
1184 requested. Previously, the -do switch meant "run Elab_New and
1185 Elab_Old and use the order chosen by Elab_Old, possibly with
1186 debugging printouts comparing the two orders." Now it means
1187 "do not run Elab_New." This is of use if there are bugs that
1188 cause Elab_New to crash.
1189 (Elab_Position, Num_Chosen): Change type to Nat, to avoid various
1191 * ali.ads (Elab_Position): Change type to Nat, to avoid various
1194 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1196 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix
1197 reference to SPARK RM.
1199 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1201 * layout.adb: Use SSU short hand consistently throughout the file.
1203 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1205 * freeze.adb (Freeze_Record_Type)
1206 <Sized_Component_Total_Round_RM_Size>: New local variable to
1207 accumulate the rounded RM_Size of components. Update it for
1208 every component whose RM_Size is statically known. Add missing
1209 guard to check that bit packing is really required before issuing
1210 the error about packing. Swap condition for clarity's sake.
1211 * sem_prag.adb (Usage_Error): Fix reference to SPARK RM in comment.
1213 2017-09-06 Fedor Rybin <frybin@adacore.com>
1215 * makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb,
1216 mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads,
1217 mlib-tgt-specific.adb, mlib-tgt-specific.ads,
1218 mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
1219 mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb,
1220 mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb,
1221 mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb,
1222 mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads,
1223 prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb,
1224 prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads,
1225 prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb,
1226 prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads,
1227 prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb,
1228 prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads,
1229 prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete
1230 project manager sources.
1232 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1234 * sem_ch5.adb (Analyze_Assigment): If the left-hand side is an
1235 entity of a mutable type and the right-hand side is a conditional
1236 expression, resolve the alternatives of the conditional using
1237 the base type of the target entity, because the alternatives
1238 may have distinct subtypes. This is particularly relevant if
1239 the alternatives are aggregates.
1241 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1243 * checks.adb (Apply_Predicate_Check): If the expression is an
1244 aggregate that is the RHS of an assignment, apply the check to
1245 the LHS after the assignment, rather than to the aggregate. This
1246 is more efficient than creating a temporary for the aggregate,
1247 and prevents back-end crashes when the aggregate includes a
1248 dynamic "others' association.
1250 2017-09-06 Yannick Moy <moy@adacore.com>
1252 * sem_ch12.adb (Analyze_Instance_And_Renamings):
1253 Set variable to ignore SPARK_Mode in instance before the analysis
1254 of the generated package declaration.
1256 2017-09-06 Yannick Moy <moy@adacore.com>
1258 * sem_res.adb (Resolve_Call): Do not issue a
1259 message for calls inside expression function, unless body was
1260 seen and is candidate for inlining.
1262 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1264 * sem_aux.adb (Is_Generic_Formal): Handle properly formal packages.
1265 * sem_ch3.adb (Analyze_Declarations): In a generic subprogram
1266 body. do not freeze the formals of the generic unit.
1268 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1270 * errout.adb (Error_Msg): Separate the
1271 treatment for warning vs. style messages in inlinings and
1272 instantiations. Prevents blowups on calls to Warn_Insertion for
1273 style messages, which should not be called in that case because
1274 Warning_Msg_Char is not set.
1276 2017-09-06 Justin Squirek <squirek@adacore.com>
1278 * sem_prag.adb (Check_VFA_Conflicts): Created
1279 to group all Volatile_Full_Access checks relating to other
1280 representation pragmas (Mark_Component_Or_Object): Created
1281 to centeralize the flagging of attributes for the record type
1282 component case, a pragma applied individually to a component, and
1284 (Process_Atomic_Independent_Shared_Volatile):
1285 Add propagation of certain pragmas to record components and move
1286 evaluation of VFA checks
1288 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1290 * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram):
1291 Do not warn on conditions that are not obeyed for Inline_Always
1292 subprograms, when assertions are not enabled.
1294 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1296 * sem_util.adb (Unique_Entity): For abstract states return their
1299 2017-09-06 Bob Duff <duff@adacore.com>
1301 * sem_ch12.adb (Copy_Generic_Node): When we copy a node
1302 that is a proper body corresponding to a stub, we defer the
1303 adjustment of the sloc until after the correct adjustment has
1304 been computed. Otherwise, Adjust_Instantiation_Sloc will ignore
1305 the adjustment, because it will be outside the range in (the old,
1306 incorrect) S_Adjustment.
1307 * inline.adb: Use named notation for readability and uniformity.
1308 * sinput-l.adb: Minor improvements to debugging output printed
1310 * sinput-l.ads (Create_Instantiation_Source): Minor comment
1313 2017-09-06 Vincent Celier <celier@adacore.com>
1315 * make.adb: Do not invoke gprbuild for -bargs -P.
1317 2017-09-06 Sylvain Dailler <dailler@adacore.com>
1319 * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Adding a
1320 case when Op is of kind N_Qualified_Expression. In this case,
1321 the function is called recursively on the subexpression like in
1323 * make.adb: Minor reformatting
1325 2017-09-06 Justin Squirek <squirek@adacore.com>
1327 * einfo.adb (Set_Linker_Section_Pragma): Modify
1328 Set_Linker_Section_Pragma to be consistant with the "getter"
1329 Linker_Section_Pragma.
1330 * exp_ch5.adb (Expand_Formal_Container_Loop): Add proper error
1331 checking for container loops so that the index cursor is not
1332 directly changable by the user with the use of E_Loop_Parameter.
1333 * sem_ch5.adb (Analyze_Block_Statement): Revert previous change.
1334 * sem_warn.adb (Check_References): Revert previous change.
1336 2017-09-06 Bob Duff <duff@adacore.com>
1338 * exp_util.adb (Is_Displace_Call): Make sure it works for indirect
1341 2017-09-06 Yannick Moy <moy@adacore.com>
1343 * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object
1344 declarations to only consider valid uses of Global/Depends those on
1345 single concurrent objects.
1347 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1349 * sem_ch13.adb (Check_Record_Representation_Clause): Give an
1350 error as soon as one of the specified components overlaps the
1353 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1355 * sem_prag.ads: minor fix typo in comment.
1357 2017-09-06 Justin Squirek <squirek@adacore.com>
1359 * sem_ch5.adb (Analyze_Block_Statement): Verify a block comes
1360 from source before checking source references.
1361 * sem_warn.adb (Check_References): Add check for internal block
1364 2017-09-06 Vincent Celier <celier@adacore.com>
1366 * make.adb, makeusg.adb, switch-m.adb, switch-m.ads, make_util.adb,
1367 make_util.ads, sinput.adb, sinput.ads, clean.adb, gnatls.adb,
1368 gnatname.adb: Remove the Project Manager from the GNAT tools.
1369 * gcc-interface/Makefile.in: ditto.
1371 2017-09-06 Bob Duff <duff@adacore.com>
1373 * sem_util.ads: Minor comment fix.
1375 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1377 * sem_ch12.adb (Analyze_Associations, case of Formal_Package):
1378 Generate a freeze node for the actual of a formal package, if
1379 the actual is declared in the same unit and has a corresponding
1380 body, to prevent the current instance from being frozen before
1383 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1385 * sem_ch7.adb (Entity_Table_Size): Change to nearest prime number.
1387 2017-09-06 Yannick Moy <moy@adacore.com>
1389 * sem_warn.adb: Minor refactoring.
1391 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1393 * einfo.ads, einfo.adb (Get_Classwwide_Pragma): New utility,
1394 to retrieve the inherited classwide precondition/postcondition
1396 * freeze.adb (Freeze_Entity): Use Get_Classwide_Pragma when
1397 freezing a subprogram, to complete the generation of the
1398 corresponding checking code.
1400 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1402 * exp_util.adb (Is_Controlled_Indexing): New routine.
1403 (Is_Displace_Call): Use routine Strip to remove indirections.
1404 (Is_Displacement_Of_Object_Or_Function_Result): Code clean up. Add a
1405 missing case of controlled generalized indexing.
1406 (Is_Source_Object): Use routine Strip to remove indirections.
1407 (Strip): New routine.
1409 2017-09-06 Bob Duff <duff@adacore.com>
1411 * sysdep.c (__gnat_has_cap_sys_nice): If HAVE_CAPABILITY is defined,
1412 we include the proper header. Otherwise, we just declare the necessary
1413 things from the capabilities library. This is so we can build on
1414 machines without that library, while still enabling that library.
1415 At run time, we're using weak symbols, so __gnat_has_cap_sys_nice will
1416 simply return 0 if the library is not present, or not included
1419 2017-09-06 Pierre-Marie de Rodat <derodat@adacore.com>
1421 * exp_dbug.adb (Debug_Renaming_Declaration): Do not create an encoding
1422 for renamings that involve function calls in prefix form.
1424 2017-09-06 Bob Duff <duff@adacore.com>
1426 * sem_ch3.adb (Analyze_Subtype_Declaration):
1427 Set Has_Delayed_Freeze on a subtype of an incomplete type.
1429 2017-09-06 Pierre-Marie de Rodat <derodat@adacore.com>
1431 * par_sco.adb (Extend_Statement_Sequence): When the accept statement
1432 has no parameter specification and no entry index, use the entry name
1433 as the end of the generated SCO statement.
1435 2017-09-06 Steve Baird <baird@adacore.com>
1437 * exp_util.adb (Side_Effect_Free): For CodePeer (only) treat
1438 uses of 'Image and related attributes as having side effects in
1439 order to avoid replicating such uses.
1440 * pprint.ads (Expression_Image) Add new generic formal flag
1441 Hide_Temp_Derefs. The flag defaults to False; CodePeer will
1442 (eventually) override the default.
1443 * pprint.adb (Expression_Image) If the new flag is set, then
1444 suppress the ".all" suffix when displaying a dereference whose
1445 prefix is a use of a value-capturing compiler temp of the sort
1446 generated by Expr_Util.Remove_Side_Effects .
1447 * exp_attr.adb, g-catiio.adb, inline.adb, sem_attr.adb, sem_ch13.adb,
1448 sem_ch7.adb, sem_dim.adb, sem_util.adb, sem_util.ads, sem_warn.adb:
1450 * inline.adb: Minor wording change.
1452 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1454 * sem_ch7.adb: Update comment.
1456 2017-09-06 Yannick Moy <moy@adacore.com>
1458 * einfo.adb, einfo.ads (Is_Subprogram_Or_Entry): New predicate.
1459 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Use new function.
1460 * sem_util.adb, sem_util.ads (Within_Protected_Type): Renaming
1461 with slight modification from Is_Subp_Or_Entry_Inside_Protected,
1462 so that applies to any entity.
1464 2017-09-06 Yannick Moy <moy@adacore.com>
1466 * sem_ch3.adb (Derived_Type_Declaration): Use
1467 Incomplete_Or_Partial_View rather than local Find_Partial_View.
1469 2017-09-06 Javier Miranda <miranda@adacore.com>
1471 * g-catiio.ads, g-catiio.adb (Value): Extended to parse an UTC time
1474 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1476 * sem_dim.adb (Analyze_Dimension): In an instance, a type
1477 conversion takes its dimensions from the expression, not from
1479 (Dimensions_Of_Operand): Ditto.
1481 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1483 * exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
1484 null procedures when GNAT coverage is used, so that their (empty)
1485 bodies are properly covered.
1487 2017-09-06 Bob Duff <duff@adacore.com>
1489 * sem_ch13.adb (Resolve_Aspect_Expressions): If
1490 the entity is a type with discriminants, make the discriminants
1491 directly visible in aspect clauses.
1493 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1495 * sem_res.adb (Resolve_Arithmentic_Op): If both operands are
1496 Universal_Real and the context is a floating-point type, resolve
1497 both operands to the target type.
1499 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1501 * a-comlin.adb, exp_aggr.adb, exp_ch6.adb, frontend.adb, gnatbind.adb,
1502 sem_ch3.adb, sem_util.adb: Minor reformatting.
1504 2017-09-06 Yannick Moy <moy@adacore.com>
1506 * freeze.adb (Check_Inherited_Conditions): Rewriting
1507 of inherited preconditions and postconditions should only occur
1508 in GNATprove mode, that is, when GNATprove_Mode is True, not to
1509 be confused with SPARK_Mode being On.
1511 2017-09-06 Yannick Moy <moy@adacore.com>
1513 * sem_warn.adb (Check_References): Take into
1514 account possibility of attribute reference as original node.
1516 2017-09-06 Yannick Moy <moy@adacore.com>
1518 * exp_attr.adb (Expand_N_Attribute_Reference): Protect against invalid
1521 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1523 * inline.adb (Split_Unconstrained_Function): Also set Is_Inlined
1524 on the procedure created to encapsulate the body.
1525 * sem_ch7.adb: Add with clause for GNAT.HTable.
1526 (Entity_Table_Size): New constant.
1527 (Entity_Hash): New function.
1528 (Subprogram_Table): New instantiation of GNAT.Htable.Simple_HTable.
1529 (Is_Subprogram_Ref): Rename into...
1530 (Scan_Subprogram_Ref): ...this. Record references to subprograms in
1531 the table instead of bailing out on them. Scan the value of constants
1532 if it is not known at compile time.
1533 (Contains_Subprograms_Refs): Rename into...
1534 (Scan_Subprogram_Refs): ...this.
1535 (Has_Referencer): Scan the body of all inlined subprograms. Reset the
1536 Is_Public flag on subprograms if they are not actually referenced.
1537 (Hide_Public_Entities): Beef up comment on the algorithm.
1538 Reset the table of subprograms on entry.
1540 2017-09-06 Yannick Moy <moy@adacore.com>
1542 * inline.adb: Add comments to Can_Be_Inlined_In_GNATprove_Mode.
1544 2017-09-06 Javier Miranda <miranda@adacore.com>
1546 * exp_aggr.adb (Component_Not_OK_For_Backend): The C backend
1547 cannot handle a type conversion of an array as an aggregate
1550 2017-09-06 Bob Duff <duff@adacore.com>
1552 * g-comlin.adb (Try_Help): Remove ".exe" so we
1553 get the same results on windows and unix.
1555 2017-09-06 Justin Squirek <squirek@adacore.com>
1557 * exp_imgv.adb (Expand_Image_Attribute),
1558 (Expand_Wide_Image_Attribute), (Expand_Wide_Wide_Image_Attribute):
1559 Added case to handle new-style 'Image expansion
1560 (Rewrite_Object_Image): Moved from exp_attr.adb
1561 * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1562 attribute cases so that the relevant subprograms in exp_imgv.adb
1563 handle all expansion.
1564 (Rewrite_Object_Reference_Image): Moved to exp_imgv.adb
1565 * sem_attr.adb (Analyze_Attribute): Modified Image attribute
1566 cases to call common function Analyze_Image_Attribute.
1567 (Analyze_Image_Attribute): Created as a common path for all
1568 image attributes (Check_Object_Reference_Image): Removed
1569 * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1570 Removed and refactored into Is_Object_Image (Is_Object_Image):
1571 Created as a replacement for Is_Image_Applied_To_Object
1573 2017-09-06 Yannick Moy <moy@adacore.com>
1575 * sem_prag.adb (Analyze_Depends_In_Decl_Part): Add continuation
1576 message for missing input.
1578 2017-09-06 Yannick Moy <moy@adacore.com>
1580 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Prevent inlining
1581 of protected subprograms and entries.
1582 * sem_util.adb, sem_util.ads (Is_Subp_Or_Entry_Inside_Protected):
1583 New function to detect when a subprogram of entry is defined
1584 inside a protected object.
1586 2017-09-06 Bob Duff <duff@adacore.com>
1588 * sysdep.c (__gnat_has_cap_sys_nice): New function to determine
1589 whether the current process has the CAP_SYS_NICE capability.
1590 * s-taprop-linux.adb (Get_Ceiling_Support): Update this to allow
1591 ceiling priorities if the current process has the CAP_SYS_NICE
1594 2017-09-06 Bob Duff <duff@adacore.com>
1596 * a-comlin.ads, a-comlin.adb (Argument): Move the constraint
1597 check back to the body, because SPARK is not yet ready for
1598 "or else raise Constraint_Error".
1600 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1602 * exp_ch6.adb (Expand_Call_Helper): Replace call to null
1603 procedure by a single null statement, after evaluating the
1604 actuals that require it.
1606 2017-09-06 Javier Miranda <miranda@adacore.com>
1608 * exp_aggr.adb (Backend_Processing_Possible.Component_Check):
1609 Generating C code improve the code that checks the use of nested
1610 aggregates to initialize object declarations.
1612 2017-09-06 Yannick Moy <moy@adacore.com>
1614 * sem_ch3.adb (Derived_Type_Declaration): Detect
1615 violations of new rule SPARK RM 3.4(1). Also refactor existing
1616 check to use the new function Find_Partial_View.
1618 2017-09-06 Vincent Celier <celier@adacore.com>
1620 * gnatcmd.adb: gnat ls -V -P... invokes gprls -V -P... The code
1621 from the Prj hierarchy has been removed from the GNAT driver.
1623 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1625 * sem_type.adb (Interface_Present_In_Ancestor): Within an
1626 expression function, or within a spec expression (default value,
1627 etc) a reference to an incomplete type is legal: legality of
1628 the operation will be checked when some related entity (type,
1629 object or subprogram) is frozen.
1631 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1633 * exp_ch5.adb, s-diinio.ads, sem_ch4.adb, s-diflio.ads: Minor spelling
1634 adjustments and a typo fix.
1636 2017-09-06 Yannick Moy <moy@adacore.com>
1638 * sem_res.adb (Resolve_Call): Do not issue info
1639 message about inlining of calls to functions in assertions,
1640 for functions whose body has not been seen yet.
1642 2017-09-06 Bob Duff <duff@adacore.com>
1644 * a-comlin.ads, a-comlin.adb (Argument): Simplify the code, now that
1645 we can use modern Ada in this package.
1646 * s-resfil.ads, s-resfil.adb, a-clrefi.ads, a-clrefi.adb:
1647 Move Ada.Command_Line.Response_File to System.Response_File,
1648 and make Ada.Command_Line.Response_File into a rename of
1649 System.Response_File. This is to avoid having gnatbind depend
1650 Ada.Command_Line, which would damage the bootstrap process now
1651 that Ada.Command_Line contains modern Ada (the raise expression).
1652 * gnatbind.adb: Avoid dependence on
1653 Ada.Command_Line. Depend on System.Response_File instead
1654 of Ada.Command_Line.Response_File. Change one call to
1655 Ada.Command_Line.Command_Name to use Fill_Arg. Change one call
1656 to Ada.Command_Line.Argument_Count to use Arg_Count.
1657 * gcc-interface/Make-lang.in, Makefile.rtl: Take note of the new files.
1659 2017-09-06 Bob Duff <duff@adacore.com>
1661 * frontend.adb (Frontend): Skip -gnatec=gnat.adc
1662 switch, because we've already read gnat.adc by default.
1664 2017-09-06 Bob Duff <duff@adacore.com>
1666 * exp_ch5.adb (Get_Default_Iterator): Replace
1667 "Assert(False)" with "return Iter", because if an iterable
1668 type is derived from a noniterable one, then we won't find an
1669 overriding or inherited default iterator.
1671 2017-09-06 Yannick Moy <moy@adacore.com>
1673 * sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
1674 literal index used to access a string is null or negative.
1676 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1678 * einfo.adb (Status_Flag_Or_Transient_Decl): The attribute is now
1679 allowed on loop parameters.
1680 (Set_Status_Flag_Or_Transient_Decl): The attribute is now allowed
1682 (Write_Field15_Name): Update the output for
1683 Status_Flag_Or_Transient_Decl.
1684 * einfo.ads: Attribute Status_Flag_Or_Transient_Decl now applies
1685 to loop parameters. Update the documentation of the attribute
1686 and the E_Loop_Parameter entity.
1687 * exp_ch7.adb (Process_Declarations): Remove the bogus guard
1688 which assumes that cursors can never be controlled.
1689 * exp_util.adb (Requires_Cleanup_Actions): Remove the bogus
1690 guard which assumes that cursors can never be controlled.
1692 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1694 * exp_attr.adb, sem_util.adb, sem_attr.adb, sem_ch6.adb, sem_ch8.adb,
1695 sem_warn.adb: Minor reformatting.
1697 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1699 * sem_warn.adb (Warn_On_Overlapping_Actuals): Refine previous
1700 fix and preserve older GNAT warning on overlapping actuals that
1701 are not elementary types.
1703 2017-09-06 Justin Squirek <squirek@adacore.com>
1705 * sem_attr.adb: Comment correction.
1707 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1709 * sem_util.adb: Minor reformatting.
1711 2017-09-06 Yannick Moy <moy@adacore.com>
1713 * a-comlin.ads (Argument): Add precondition for analysis.
1715 2017-09-06 Yannick Moy <moy@adacore.com>
1717 * sem_res.adb (Resolve): Update message for function call as statement.
1719 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1721 * sem_ch6.adb (Check_Returns): Clean up warnings coming from
1722 generated bodies for renamings that are completions, when renamed
1723 procedure is No_Return.
1724 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
1725 rule in 6.5.1 (7/2): if a renaming is a completion of a subprogram
1726 with No_Return, the renamed entity must be No_Return as well.
1728 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1730 * exp_ch5.adb, freeze.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb:
1733 2017-09-06 Justin Squirek <squirek@adacore.com>
1735 * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1736 attribute cases (Rewrite_Object_Reference_Image): Created to
1737 aid the rewriting of new-style 'Image attributes.
1738 * sem_attr.adb (Analyze_Attribute): Modified Image attribute cases
1739 (Check_Object_Reference_Image): Created to handle verification of
1740 'Image with object-references as prefixes.
1741 * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1742 Create predicate to identify cases where an 'Image attribute's
1743 prefix applies to an object reference.
1745 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1747 * freeze.adb (Freeze_Entity): Do not generate a freeze
1748 node for a generic unit, even if it includes delayed aspect
1749 specifications. Freeze nodes for generic entities must never
1750 appear in the tree that reaches the back-end of the compiler.
1752 2017-09-06 Yannick Moy <moy@adacore.com>
1754 * treepr.adb (Print_Entity_Info): Do not print empty Elist.
1756 2017-09-06 Yannick Moy <moy@adacore.com>
1758 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not consider calls
1759 to subprograms in other units as possibly inlined.
1761 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1763 * freeze.adb (Freeze_Entity): For a derived type that has no
1764 explicit delayed aspects but may inherit delayed aspects from its
1765 parent type, analyze aspect at freeze point for proper capture
1766 of an inherited aspect.
1768 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1770 * lib-xref.adb (Get_Through_Renamings): Get through subprogram
1771 renamings; also, avoid repeated calls to Renamed_Object when getting
1772 through object renamings.
1774 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1776 * sem_ch3.adb (Array_Type_Declaration): Handle properly an
1777 array type declaration in a private part, when an index is a
1778 subtype indication of a discrete type with a private partial view.
1780 2017-09-06 Javier Miranda <miranda@adacore.com>
1782 * exp_ch4.adb (Expand_Modular_Op): Force generating
1783 temporary to improve the generated code.
1785 2017-09-06 Tristan Gingold <gingold@adacore.com>
1787 * s-fatgen.adb: Minor typo fix in comment.
1789 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1791 * exp_ch5.adb (Make_Field_Assign): If the type
1792 of the right-hand side has stored constraint, use its values
1793 (except for those that are renamings of parent discriminants)
1794 to produce additional assignments for the discriminants of the
1795 left-hand side, which are invisible in the righ-hand side and
1796 not retrievable as selected components.
1798 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1800 * sem_util.adb (Needs_One_Formal): The first formal of such a
1801 function must be a controlling formal, so that Obj.F (X, Y)
1802 can have the interpretation F(Obj)(X, Y).
1803 * sem_util.ads: Clarify documentation.
1805 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1807 * table.ads, table.adb: Restore original implementation.
1808 * namet.h (Names_Ptr): Adjust back.
1809 (Name_Chars_Ptr): Likewise.
1810 * uintp.h (Uints_Ptr): Likewise.
1811 (Udigits_Ptr): Likewise.
1812 * g-table.ads: Remove pragma Compiler_Unit_Warning.
1813 * par_sco.adb: Do not with GNAT.Table and use Table consistently.
1814 * scos.ads: Replace GNAT.Table with Table and adjust instantiations.
1815 * spark_xrefs.ads: Likewise.
1816 * scos.h: Undo latest changes.
1818 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1820 * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate
1821 No_Return flag to instance if pragma applies to generic unit. This
1822 must be done explicitly because the pragma does not appear
1823 directly in the generic declaration (unlike the corresponding
1824 aspect specification).
1826 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1828 * sem_ch7.adb (Has_Referencer): Move up and expand comment
1829 explaining the test used to detect inlining. Use same test
1830 in second occurrence.
1831 (Analyze_Package_Body_Helper): Minor formatting fixes.
1833 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1835 * exp_ch4.adb (Handle_Changed_Representation): For an untagged
1836 derived type with a mixture of renamed and constrained parent
1837 discriminants, the constraint for the target must obtain the
1838 discriminant values from both the operand and from the stored
1839 constraint for it, given that the constrained discriminants are
1840 not visible in the object.
1841 * exp_ch5.adb (Make_Field_Assign): The type of the right-hand
1842 side may be derived from that of the left-hand side (as in the
1843 case of an assignment with a change of representation) so the
1844 discriminant to be used in the retrieval of the value of the
1845 component must be the entity in the type of the right-hand side.
1847 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1849 * sem_ch3.adb, sem_ch7.adb, sem_util.adb, g-debpoo.adb, sem_ch4.adb,
1850 sem_ch6.adb, sem_ch8.adb: Minor reformatting.
1851 * exp_util.adb (Is_Source_Object): Account for
1852 the cases where the source object may appear as a dereference
1853 or within a type conversion.
1854 * exp_ch6.adb: Fix missing space in error message.
1856 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1858 * sem_prag.adb: Update description of Eliminate.
1860 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1862 * sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
1863 properly an attribute reference 'Loop_Entry that appears in the
1864 list of indices of an indexed expression, to prevent an infinite
1865 loop in the compiler.
1867 2017-09-06 Bob Duff <duff@adacore.com>
1869 * s-fileio.adb (Name): Do not raise Use_Error for temp files.
1871 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1873 * sem_ch4.adb (Analyze_Set_Membership): If an alternative
1874 in a set membership is an overloaded enumeration literal, and
1875 the type of the alternative is resolved from a previous one,
1876 replace the entity of the alternative as well as the type,
1877 to prevent inconsistencies between the entity and the type.
1879 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1881 * ali.ads (ALIs_Record): Add No_Component_Reordering component.
1882 (No_Component_Reordering_Specified): New switch.
1883 * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified.
1884 (Scan_ALI): Set No_Component_Reordering and deal with NC marker.
1885 * bcheck.adb (Check_Consistent_No_Component_Reordering):
1887 (Check_Configuration_Consistency): Invoke it.
1888 * debug.adb (d.r): Toggle the effect of the switch.
1889 (d.v): Change to no-op.
1890 * einfo.ads (Has_Complex_Representation):
1891 Restrict to record types.
1892 (No_Reordering): New alias for Flag239.
1893 (OK_To_Reorder_Components): Delete.
1894 (No_Reordering): Declare.
1895 (Set_No_Reordering): Likewise.
1896 (OK_To_Reorder_Components): Delete.
1897 (Set_OK_To_Reorder_Components): Likewise.
1898 * einfo.adb (Has_Complex_Representation): Expect record types.
1899 (No_Reordering): New function.
1900 (OK_To_Reorder_Components): Delete.
1901 (Set_Has_Complex_Representation): Expect base record types.
1902 (Set_No_Reordering): New procedure.
1903 (Set_OK_To_Reorder_Components): Delete.
1904 (Write_Entity_Flags): Adjust to above change.
1905 * fe.h (Debug_Flag_Dot_R): New macro and declaration.
1906 * freeze.adb (Freeze_Record_Type): Remove conditional code setting
1907 OK_To_Reorder_Components on record types with convention Ada.
1908 * lib-writ.adb (Write_ALI): Deal with NC marker.
1909 * opt.ads (No_Component_Reordering): New flag.
1910 (No_Component_Reordering_Config): Likewise.
1911 (Config_Switches_Type): Add No_Component_Reordering component.
1912 * opt.adb (Register_Opt_Config_Switches): Copy
1913 No_Component_Reordering onto No_Component_Reordering_Config.
1914 (Restore_Opt_Config_Switches): Restore No_Component_Reordering.
1915 (Save_Opt_Config_Switches): Save No_Component_Reordering.
1916 (Set_Opt_Config_Switches): Set No_Component_Reordering.
1917 * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering.
1918 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the
1919 No_Reordering flag from the default.
1920 (Build_Derived_Private_Type): Likewise.
1921 (Build_Derived_Record_Type): Likewise. Then inherit it
1922 for untagged types and clean up handling of similar flags.
1923 (Record_Type_Declaration): Likewise.
1924 * sem_ch13.adb (Same_Representation): Deal with No_Reordering and
1925 remove redundant test on Is_Tagged_Type.
1926 * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering.
1927 (Sig_Flags): Likewise.
1928 * snames.ads-tmpl (Name_No_Component_Reordering): New name.
1929 (Pragma_Id): Add Pragma_No_Component_Reordering value.
1930 * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well.
1931 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>:
1932 Copy the layout of the parent type only if the No_Reordering
1934 (components_to_record): Reorder record types with
1935 convention Ada by default unless No_Reordering is set or -gnatd.r
1936 is specified and do not warn if No_Reordering is set in GNAT mode.
1938 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1940 * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure):
1941 new predicate to reject declarations that can be completions,
1942 when there is a visible prior homograph that is a null procedure.
1943 * sem_ch6.adb (Analyze_Null_Procedure): use it.
1944 * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto.
1946 2017-09-06 Thomas Quinot <quinot@adacore.com>
1948 * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal
1949 run of 253 characters or more.
1951 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1953 * einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
1954 properly incomplete subtypes that may be created by explicit or
1955 implicit declarations.
1956 (Is_Base_Type): Take E_Incomplete_Subtype into account.
1957 (Subtype_Kind): Ditto.
1958 * sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
1959 Ekind of a subtype of a discriminated incomplete type.
1960 (Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
1961 incomplete types, to preserve error reporting.
1962 (Process_Incomplete_Dependents): Do not create a subtype
1963 declaration for an incomplete subtype that is created internally.
1964 * sem_ch7.adb (Analyze_Package_Specification): Handle properly
1965 incomplete subtypes that do not require a completion, either
1966 because they are limited views, of they are generic actuals.
1968 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1970 * checks.adb (Insert_Valid_Check): Remove the
1971 suspicious manipulation of the Do_Range_Check flag as ths is
1972 no linger needed. Suppress validity check when analysing the
1973 validation variable.
1975 2017-09-06 Philippe Gil <gil@adacore.com>
1977 * g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
1980 2017-09-06 Bob Duff <duff@adacore.com>
1982 * sem_elim.adb: Minor comment fix.
1984 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1986 * sem_util.adb (Is_Object_Reference): A function call is an
1987 object reference, and thus attribute references for attributes
1988 that are functions (such as Pred and Succ) as well as predefined
1989 operators are legal in contexts that require an object, such as
1990 the prefix of attribute Img and the Ada2020 version of 'Image.
1992 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1994 * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
1995 exp_ch3.adb, xoscons.adb: Minor reformatting.
1997 2017-09-06 Raphael Amiard <amiard@adacore.com>
1999 * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
2000 Position parameter. If supplied, use it to provide efficient iteration.
2001 * a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
2002 a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
2005 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2007 * exp_util.adb (Build_Allocate_Deallocate_Proc): If the
2008 designated type is class-wide and the expression is an unchecked
2009 conversion, preserve the conversion when checking the tag of the
2010 designated object, to prevent spurious semantic errors when the
2011 expression in the conversion has an untagged type (for example
2012 an address attribute).
2014 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2016 * sem_res.adb (Resolve_Entry_Call): Check whether a protected
2017 operation is subject to a pragma Eliminate.
2019 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2021 * sem_elim.ads, exp_ch4.adb: Minor reformatting.
2023 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
2025 * fe.h (Eliminate_Error_Msg): Remove.
2027 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
2029 * gcc-interface/utils.c (make_packable_type): Update call to
2032 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
2034 * gcc-interface/utils2.c (build_load_modify_store):
2035 Use int_mode_for_size.
2037 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2040 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2041 for Itypes that are E_Record_Subtype with a cloned subtype.
2042 <E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
2044 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2046 * gcc-interface/trans.c (convert_with_check): Use a custom base type
2047 if the base type of the expression has a different machine mode.
2048 Rename a couple of parameters and local variable.
2050 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2052 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Address>: Do not strip
2053 conversions around prefixes that are not references.
2055 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2057 * gcc-interface/utils.c (unchecked_convert): When the result type is a
2058 non-biased integral type with size 0, set the result to 0 directly.
2060 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2062 * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to
2063 (renaming_from_instantiation_p): ...this.
2064 * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate
2065 instead of explicit tests on kind of entities. Adjust for renaming.
2066 (gnat_to_gnu_profile_type): Likewise.
2067 (gnat_to_gnu_subprog_type): Likewise.
2068 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
2069 (Case_Statement_to_gnu): Likewise.
2070 (gnat_to_gnu): Likewise.
2071 (process_freeze_entity): Likewise.
2072 (process_type): Likewise.
2073 (add_stmt_with_node): Adjust for renaming.
2074 * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming.
2075 (renaming_from_generic_instantiation_p): Rename to...
2076 (renaming_from_instantiation_p): ...this. Use inline predicate.
2077 (pad_type_hasher::keep_cache_entry): Fold.
2079 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2081 * gcc-interface/trans.c (adjust_for_implicit_deref): New function.
2082 (gnat_to_gnu) <N_Explicit_Dereference>: Translate result type first.
2083 (N_Indexed_Component): Invoke adjust_for_implicit_deref on the prefix.
2084 (N_Slice): Likewise.
2085 (N_Selected_Component): Likewise. Do not try again to translate it.
2086 (N_Free_Statement): Invoke adjust_for_implicit_deref on the expression.
2088 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2090 * repinfo.ads: Document new treatment of dynamic values.
2091 (TCode): Bump upper bound to 29.
2092 (Dynamic_Val): New constant set to 29.
2093 * repinfo.adb (Print_Expr) <Dynamic_Val>: New case.
2094 (Rep_Value) <Dynamic_Val>: Likewise.
2095 * repinfo.h (Dynamic_Val): New macro.
2096 * gcc-interface/decl.c (annotate_value): Tidy up and cache result for
2098 <INTEGER_CST>: Set TCODE instead of recursing.
2099 <COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
2100 <VAR_DECL>: New case.
2101 <MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
2102 <BIT_AND_EXPR>: Adjust.
2103 <CALL_EXPR>: Do not fall through.
2105 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2107 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2108 there is no target, do not create a temporary for the return value for
2109 an allocator either.
2111 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2113 * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
2114 unconstrained array type.
2116 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2117 Alan Hayward <alan.hayward@arm.com>
2118 David Sherwood <david.sherwood@arm.com>
2120 * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
2121 instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
2123 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2124 Alan Hayward <alan.hayward@arm.com>
2125 David Sherwood <david.sherwood@arm.com>
2127 * gcc-interface/decl.c (check_ok_for_atomic_type): Use
2128 is_a <scalar_int_mode>.
2129 * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
2130 * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
2132 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2133 Alan Hayward <alan.hayward@arm.com>
2134 David Sherwood <david.sherwood@arm.com>
2136 * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
2137 instead of mode_for_size.
2138 (gnat_to_gnu_subprog_type): Likewise.
2139 * gcc-interface/utils.c (make_type_from_size): Likewise.
2141 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2142 Alan Hayward <alan.hayward@arm.com>
2143 David Sherwood <david.sherwood@arm.com>
2145 * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
2146 (fp_size_to_prec): Likewise.
2148 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2149 Alan Hayward <alan.hayward@arm.com>
2150 David Sherwood <david.sherwood@arm.com>
2152 * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
2153 <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
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): Update use of
2160 GET_MODE_WIDER_MODE, forcing a wider mode to exist.
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/misc.c (fp_prec_to_size): Use new mode iterators.
2167 (fp_size_to_prec): Likewise.
2169 2017-08-29 Martin Liska <mliska@suse.cz>
2172 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
2174 2017-08-08 Martin Liska <mliska@suse.cz>
2176 * gcc-interface/trans.c: Include header files.
2178 2017-07-29 Jakub Jelinek <jakub@redhat.com>
2180 * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
2181 as new argument to the imported_module_or_decl debug hook.
2183 2017-07-25 Javier Miranda <miranda@adacore.com>
2185 * checks.adb (Apply_Divide_Checks): Ensure that operands are not
2188 2017-07-19 Jakub Jelinek <jakub@redhat.com>
2190 * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
2191 TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
2192 (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
2194 2017-07-18 Mike Frysinger <vapier@chromium.org>
2196 * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
2197 (../../gnatlink$(exeext)): Likewise.
2199 2017-07-15 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2202 * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
2203 (Backend_Overflow_Checks): Set to True.
2205 2017-06-23 Jakub Jelinek <jakub@redhat.com>
2207 * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
2209 2017-06-21 Pierre-Marie de Rodat <derodat@adacore.com>
2211 * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
2213 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
2215 (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
2217 * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
2218 imported subprograms for the current compilation unit as
2219 definitions. Disable debug info for references to variables.
2220 * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
2221 * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
2222 not built-in functions to their binding scope.
2223 (create_subprog_decl): Add a DEFINITION parameter. If it is true, tag
2224 the function as a definition. Update all callers.
2225 (gnat_write_global_declarations): Emit debug info for imported
2226 functions. Filter out external variables for which debug info
2229 2017-06-15 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
2232 * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
2233 (i[3456]86-pc-gnu): Likewise.
2234 (x86_64 kfreebsd): Likewise.
2236 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
2239 * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
2241 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
2244 * s-interr-hwint.adb: Reinstate.
2245 * gcc-interface/Makefile.in (RTEMS): Use it again.
2247 2017-06-08 Olivier Hainque <hainque@adacore.com>
2249 * vx_crtbegin_auto.c: Update year in copyright notice.
2250 * vx_crtbegin.c: Likewise.
2251 * vx_crtbegin.inc: Likewise.
2252 * vx_crtend.c: Likewise.
2254 2017-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
2256 * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
2257 * s-tpopsp-rtems.adb: Delete.
2259 2017-06-02 Olivier Hainque <hainque@adacore.com>
2261 * vx_crtbegin_auto.c: New file.
2262 * vx_crtbegin.c: New file.
2263 * vx_crtbegin.inc: New file.
2264 * vx_crtend.c: New file.
2266 2017-05-25 Jonathan Wakely <jwakely@redhat.com>
2268 * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
2269 const qualifiers that cause -Wignored-qualifiers warnings.
2271 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
2273 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2274 for Itypes that are E_Access_Subtype.
2275 <E_Access_Subtype>: Use the DECL of the base type directly.
2277 2017-05-22 Ed Schonberg <schonberg@adacore.com>
2278 Eric Botcazou <ebotcazou@adacore.com>
2280 * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
2281 limited view may appear in the profile of a function, and a call to
2282 that function in another unit in which the full view is available must
2283 use this full view to spurious type errors at the point of call.
2284 * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
2285 of parent body with a with clause for the main unit.
2286 * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
2287 (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
2288 types declared in external units like types from limited with clauses.
2289 Adjust final processing of defer_limited_with_list accordingly.
2290 * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
2291 again to translate the prefix after the field if it is incomplete.
2293 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
2295 * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
2296 alignment for simple volatile fields and remove associated errors.
2298 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2300 * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
2301 * gcc-interface/trans.c (get_elaboration_procedure): Make static.
2303 2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
2305 * gcc-interface/utils.c (can_materialize_object_renaming_p):
2306 Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
2307 process Original_Node instead of expanded names.
2309 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2311 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
2312 addressability check in the constrained case.
2314 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2316 * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
2317 types not coming from a limited context.
2319 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2321 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
2322 the inlined list that are not public.
2323 * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
2324 there is a pragma Inline_Always on the subprogram.
2326 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2328 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
2329 <N_Allocator>: Use properly typed constants.
2330 (extract_values): Move around.
2331 (pos_to_constructor): Minor tweaks.
2332 (Sloc_to_locus): Fix formatting.
2333 * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
2334 * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
2335 (Gigi_Equivalent_Type): Adjust head comment.
2336 * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
2338 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2340 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
2341 is a representation clause on an extension, propagate the alignment of
2342 the parent type only if the platform requires strict alignment.
2344 2017-05-12 Eric Botcazou <ebotcazou@adacore.com>
2346 * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
2347 instead of Word_Size.
2350 2017-03-28 Andreas Schwab <schwab@suse.de>
2353 * system-linux-aarch64-ilp32.ads: New file.
2354 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
2355 from LIBGNAT_TARGET_PAIRS.
2356 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
2357 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
2358 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
2359 or -mabi=ilp32, resp.
2361 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2364 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
2365 instead of Word_Size.
2367 2017-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
2369 * raise-gcc.c (exception_class_eq): Make ec parameter const.
2371 2017-05-02 Richard Biener <rguenther@suse.de>
2373 * gcc-interface/misc.c (gnat_post_options): Do not set
2376 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2378 * gcc-interface/trans.c (assoc_to_constructor): Make sure
2379 Corresponding_Discriminant is only called on discriminants.
2380 Skip the saving of the result only for them.
2381 (gnat_to_gnu) <N_Selected_Component>: Likewise.
2382 <N_Unchecked_Type_Conversion>: Translate the result type first.
2383 (gigi): Set TREE_NOTHROW on Begin_Handler.
2384 (stmt_list_cannot_raise_p): New predicate.
2385 (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
2386 a cleanup if the statements of the handler cannot raise.
2387 (process_freeze_entity): Use Is_Record_Type.
2388 (process_type): Likewise.
2390 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2392 * einfo.ads (Corresponding_Record_Component): New alias
2393 for Node21 used for E_Component and E_Discriminant.
2394 * einfo.adb (Corresponding_Record_Component): New function.
2395 (Set_Corresponding_Record_Component): New procedure.
2396 (Write_Field21_Name): Handle Corresponding_Record_Component.
2397 * sem_ch3.adb (Inherit_Component): Set
2398 Corresponding_Record_Component for every component in
2399 the untagged case. Clear it afterwards for non-girder
2401 * gcc-interface/decl.c (gnat_to_gnu_entity)
2402 <E_Record_Type>: For a derived untagged type with discriminants
2403 and constraints, apply the constraints to the layout of the
2404 parent type to deduce the layout.
2405 (field_is_aliased): Delete.
2406 (components_to_record): Test DECL_ALIASED_P directly.
2407 (annotate_rep): Check that fields are present except for
2409 (create_field_decl_from): Add DEBUG_INFO_P
2410 parameter and pass it in recursive and other calls. Add guard
2411 for the manual CSE on the size.
2412 (is_stored_discriminant): New predicate.
2413 (copy_and_substitute_in_layout): Consider only
2414 stored discriminants and check that original fields are present
2415 in the old type. Deal with derived types. Adjust call to
2416 create_variant_part_from.
2418 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2420 * exp_ch6.adb (Expand_Call_Helper): When locating the
2421 accessibility entity created for an access parameter, handle
2422 properly a reference to a formal of an enclosing subprogram. if
2423 the reference appears in an inherited class-wide condition, it
2424 is the rewriting of the reference in the ancestor expression,
2425 but the accessibility entity must be that of the current formal.
2427 2017-05-02 Javier Miranda <miranda@adacore.com>
2429 * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
2430 (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
2431 Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
2432 Call Expand_Non_Binary_Modular_Op.
2434 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2436 * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
2437 has discriminants, do not override the Stored_Constraint list of
2438 the full view of the derived type with that of the derived type.
2440 2017-05-02 Bob Duff <duff@adacore.com>
2442 * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
2444 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2446 * s-os_lib.ads: Minor typo fix.
2448 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2450 * gnatls.adb: Merge and refactor code from Prj.Env and remove
2451 this deprecated dependency.
2453 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2455 * exp_util.ads: minor comment addition.
2457 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2459 * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
2460 pastos in part #3 of the head comment.
2462 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2464 * exp_ch3.adb (Freeze_Type): Do not generate an invariant
2465 procedure body for a local (sub)type declaration within a
2466 predicate function. Invariant checks do not apply to these, and
2467 the expansion of the procedure will happen in the wrong scope,
2468 leading to misplaced freeze nodes.
2470 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2472 * exp_util.adb (Insert_Library_Level_Action): Use proper scope
2473 to analyze generated actions. If the main unit is a body,
2474 the required scope is that of the corresponding unit declaration.
2476 2017-05-02 Arnaud Charlet <charlet@adacore.com>
2478 * einfo.adb (Declaration_Node): flip branches of
2479 an IF statement to avoid repeated negations in its condition;
2480 no change in semantics, only to improve readability.
2482 2017-05-02 Arnaud Charlet <charlet@adacore.com>
2484 * sem_case.adb: Remove extra spaces in parameter declarations.
2486 2017-05-02 Justin Squirek <squirek@adacore.com>
2488 * usage.adb: Replace space with hyphen ("run time" -> "run-time")
2489 in usage line for new -gnatwE switch.
2491 2017-05-02 Claire Dross <dross@adacore.com>
2493 * a-cofuve.ads (Remove): Remove unnecessary
2494 conditions in precondition.
2496 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2498 * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
2499 sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
2501 2017-05-02 Justin Squirek <squirek@adacore.com>
2503 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2504 alternative expression.
2505 * sem_res.adb (Resolve_Case_Expression): Ditto.
2507 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2509 * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
2510 Refine predicate for the case where the primitive operation
2511 is a renaming of equality. An overriding operation that is
2512 a user-defined renaming of predefined equality inherits its
2513 slot from the overridden operation. Otherwise it is treated
2514 as a predefined op and occupies the same predefined slot as
2515 equality. A call to it is transformed into a call to its alias,
2516 which is the predefined equality. A dispatching call thus uses
2517 the proper slot if operation is further inherited and called
2518 with class-wide arguments.
2520 2017-05-02 Justin Squirek <squirek@adacore.com>
2522 * errout.adb (Set_Msg_Text): Add a case to switch the message
2523 type when the character '[' is detected signifying a warning
2524 about a run-time exception.
2525 * opt.ads Add a new Warning_Mode value for new switch
2526 * switch-b.adb (Scan_Binder_Switches): Add case for the binder
2527 to handle new warning mode
2528 * usage.adb (Usage): Add usage entry for -gnatwE
2529 * warnsw.adb (Set_Warning_Switch): Add case for the new switch
2531 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2533 * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
2534 declaration that operates on some fixed point type.
2536 2017-05-02 Justin Squirek <squirek@adacore.com>
2538 * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
2540 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2542 * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
2544 2017-05-02 Justin Squirek <squirek@adacore.com>
2546 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2547 expression (Analyze_If_Expression): Add check for valid condition
2548 * sem_eval.adb (Eval_Case_Expression): Add check for error posted
2550 * sem_res.adb (Resolve_If_Expression): Add check for valid
2551 condition and then-expression.
2553 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2555 * exp_ch3.adb (Build_Initialization_Call): Generate a null
2556 statement if the initialization call is a null procedure, as
2557 can happen with a controlled type with no explicit Initialize
2558 procedure, or an array of such.
2559 * exp_ch7.adb (Process_Object_Declaration): For a type with
2560 controlled components that has a trivial Initialize procedure,
2561 insert declaration for finalization counter after object
2563 (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
2564 finalization block and attendant declarations if component has
2565 a trivial Initialize procedure.
2566 (Make_Init_Call): Do not generate a call if controlled type has
2567 a trivial Initialize procedure.
2569 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2571 * g-forstr.ads (Data): Move Format component last.
2572 * g-forstr.adb ("+"): Adjust for above change.
2573 * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
2574 * g-sechas.ads (Context): Move Key last.
2575 * g-socket.ads (Service_Entry_Type): Move Aliases last.
2576 * s-fileio.adb (Temp_File_Record): Move Name last.
2577 * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
2578 * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
2580 2017-05-02 Jerome Lambourg <lambourg@adacore.com>
2582 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
2583 switch introduced recently. finally not needed.
2585 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2587 * sem_ch6.adb (Analyze_Null_Procedure): Set the
2588 Corresponding_Body link for a null procedure declaration.
2590 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2592 * atree.h (Flag290): Add missing terminating parenthesis.
2593 * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
2594 (Set_Is_Class_Wide_Clone): Likewise.
2595 * einfo.ads (Is_Class_Wide_Clone): Likewise.
2597 2017-05-02 Gary Dismukes <dismukes@adacore.com>
2599 * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
2600 parameter Array_Comp to indicate the case of an array object
2601 with null-excluding components.
2602 * checks.adb (Null_Exclusion_Static_Checks):
2603 Call Compile_Time_Constraint_Error instead of
2604 Apply_Compile_Time_Constraint_Error in the component case. Also
2605 call that when Array_Comp is True, with an appropriate warning for
2606 the array component case. Only create an explicit initialization
2607 by null in the case of an object of a null-excluding access type
2608 (and no longer do that in the component case).
2609 * sem_ch3.adb (Check_Component): Add a Boolean parameter
2610 Array_Comp defaulted to False. Pass Empty for the Comp
2611 actual when calling Null_Exclusion_Static_Checks in the case
2612 where Comp_Decl matches Object_Decl, because we don't have a
2613 component in that case. In the case of an object or component
2614 of an array type, pass True for Array_Comp on the recursive call
2617 2017-05-02 Bob Duff <duff@adacore.com>
2619 * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
2620 compute the linux priority from the Ada priority. Call this everywhere
2621 required. In particular, the previous version was not doing this
2622 computation when setting the ceiling priority in various places. It
2623 was just converting to C.int, which results in a ceiling that is off
2626 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2628 * sem_ch3.adb: Comment predicate inheritance.
2630 2017-05-02 Tristan Gingold <gingold@adacore.com>
2632 * s-trasym.ads: Add comment.
2634 2017-05-02 Bob Duff <duff@adacore.com>
2636 * sem_elab.adb, sem_elab.ads: Minor comment fixes.
2637 * sem_ch4.adb: Minor reformatting.
2638 * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
2639 * s-taspri-posix-noaltstack.ads: Minor refactoring.
2640 * sinput.ads: Minor typo fix.
2642 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2644 * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
2645 * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
2646 here from exp_ch9, to recognize objects whose creation requires
2647 dynamic allocation, so that the proper warning can be emitted
2648 when restriction No_Implicit_Heap_Allocation is in effect.
2649 * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
2650 to emit proper warning when an object that requires dynamic
2651 allocation is declared.
2653 2017-05-02 Tristan Gingold <gingold@adacore.com>
2655 * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
2657 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2659 * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
2660 visibility rules for equality operators that apply within an
2661 instantiation apply within an inlined body.
2662 * sem_type.adb (Add_One_Interp): ditto.
2664 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2666 * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
2669 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2672 (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
2673 Name_No_Tagged_Streams): Move to regular pragmas. Add
2674 placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
2675 and Secondary_Stack_Size.
2676 (Pragma_Id): Move Pragma_Assume,
2677 Pragma_Attribute_Definition, Pragma_Loop_Optimize and
2678 Pragma_No_Tagged_Streams to second part.
2680 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2682 * exp_attr.adb: Minor reformatting.
2684 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2686 * sem_ch4.adb (Analyze_Selected_Component): Improve error
2687 detection for illegal references to private components or
2688 operations of a protected type in the body of the type.
2690 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2692 * opt.ads: Add missing GNAT markers in comments.
2693 * opt.adb (Set_Opt_Config_Switches): Do not override earlier
2694 settings of Optimize_Alignment at the end.
2696 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2698 * checks.adb (Apply_Constraint_Check): Do not apply
2699 a discriminant check when the associated type is a constrained
2700 subtype created for an unconstrained nominal type.
2701 * exp_attr.adb: Minor reformatting.
2703 2017-05-02 Bob Duff <duff@adacore.com>
2705 * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
2706 the N_Raise_Expression case.
2707 * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
2710 2017-05-02 Yannick Moy <moy@adacore.com>
2712 * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
2713 optimize length comparison in GNATprove mode.
2714 * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
2715 operator /= into negation of operator = when needed.
2716 (Expand_SPARK): Call new
2717 function to expand operator /=.
2719 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2721 * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
2722 Simplify the expression for a fixed-fixed division to remove
2723 divisions by constants whenever possible, as an optimization
2724 for restricted targets.
2726 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2728 * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
2730 2017-05-02 Bob Duff <duff@adacore.com>
2732 * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
2733 to find primitive ops, instead of using an Identifier that will
2734 later be looked up. This is necessary because these ops are not
2735 necessarily visible at all places where we need to call them.
2736 * exp_util.ads: Minor comment fix.
2738 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2740 * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
2741 references are fully conformant if they are both expansions
2742 of the discriminant of a protected type, within one of the
2743 protected operations. One occurrence may be expanded into a
2744 constant declaration while the other is an input parameter to
2745 the corresponding generated subprogram.
2747 2017-05-02 Justin Squirek <squirek@adacore.com>
2749 * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
2750 recursivly searching composite-types for null-excluding access
2751 types and verifying them.
2752 (Analyze_Object_Declaration): Add a
2753 call to Check_Null_Excluding_Components for static verification
2754 of non-initialized objects.
2755 * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
2756 a parameter for a composite-type's component and an extra case
2757 for printing component information.
2759 2017-05-02 Yannick Moy <moy@adacore.com>
2761 * sem_ch10.adb (Analyze_Subunit): Take
2762 configuration pragma into account when restoring appropriate
2763 pragma for analysis of subunit.
2765 2017-05-02 Justin Squirek <squirek@adacore.com>
2767 * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
2768 s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
2769 g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
2770 clauses from the runtime.
2772 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2774 * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
2775 array components specially.
2777 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2779 * sem_ch8.adb (Premature_Usage): If the premature usage of
2780 an entity is as the expression in its own object decaration,
2781 rewrite the reference as Any_Id to prevent cascaded errors or
2782 compiler loops when such an entity is used in an address clause.
2784 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
2786 * gcc-interface/decl.c (components_to_record): Add missing guard.
2788 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
2790 * gcc-interface/decl.c (components_to_record): Add more comments.
2791 Put back pending fields onto the regular list if the misalignment
2792 happens to cancel itself.
2794 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2796 * sem_ch4.adb (Complete_Object_Operation): When rewriting the
2797 controlling actual in a prefixed call, preserve the original node
2798 information if the prefix itself has been rewritten, for ASIS use.
2800 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2802 * exp_ch6.adb (Insert_Post_Call_Actions):
2803 Code clean up. Insert the post-call actions after an enclosing
2804 procedure call when N denotes a function call and appears as an
2805 actual parameter in the procedure call.
2807 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2809 * freeze.adb (Check_Component_Storage_Order): If there is a clause
2810 for the component, also reject the attribute if the component
2811 doesn't end on a byte boundary and its scalar storage order is
2812 different from that of the enclosing record type.
2814 2017-04-28 Javier Miranda <miranda@adacore.com>
2816 * atree.ads (Info_Messages): Removed.
2817 (Warning_Info_Messages): New counter.
2818 (Report_Info_Messages): New counter.
2819 * err_vars.ads Update documentation.
2820 * errout.adb (Delete_Warning_And_Continuations): Update
2821 Info_Message occurrences.
2822 (Error_Msg_Internal): Update Info_Message occurrences.
2823 (Delete_Warning): Update Info_Message occurrences.
2824 (Write_Error_Summary): Update Info_Message occurrences.
2825 (Output_Messages): Update Info_Message occurrences.
2826 (To_Be_Removed): Update Info_Message occurrences.
2827 (Reset_Warnings): Update Info_Message occurrences.
2828 * errutil.adb (Error_Msg): Update Info_Message occurrences.
2829 (Finalize): Update Info_Message occurrences.
2830 (Initialize): Update Info_Message occurrences.
2831 * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
2832 (Compilation_Errors): Update Info_Message_Occurences.
2834 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2836 * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
2837 * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
2838 * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
2839 * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
2840 * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
2841 * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
2843 * sem_eval.adb (Why_Not_Static): Initialize Typ.
2844 * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
2846 2017-04-28 Bob Duff <duff@adacore.com>
2848 * sem_util.ads, sem_util.adb (Might_Raise): New function
2849 that replaces Is_Exception_Safe, but has the opposite
2850 sense. Is_Exception_Safe was missing various cases -- calls inside
2851 a pragma Debug, calls inside an 'if' or assignment statement,
2852 etc. Might_Raise now walks the entire subtree looking for things
2854 * exp_ch9.adb (Is_Exception_Safe): Remove.
2855 (Build_Protected_Subprogram_Body): Replace call to
2856 Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
2857 constants where possible).
2858 * exp_ch7.adb: Rename Is_Protected_Body -->
2859 Is_Protected_Subp_Body. A protected_body is something different
2862 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2864 * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
2865 * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
2866 (P_Discrete_Choice_List): Initialize Expr_Node variable.
2867 * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
2868 (P_Protected): Likewise.
2869 * sem_case.adb (Check_Duplicates):
2870 Add pragma Warnings on variable.
2871 * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
2872 * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable.
2873 * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
2874 (Analyze_Exit_Statement): Initialize Scope_Id variable.
2875 (Analyze_Iterator_Specification): Initialize Bas variable.
2876 * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
2877 Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
2878 (Analyze_Accept_Statement): Initialize Task_Nam.
2880 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2882 * checks.adb (Install_Primitive_Elaboration_Check):
2883 Do not generate an elaboration check if all checks have been
2886 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2888 * sem_ch13.adb (Analyze_Aspect_Specifications, case
2889 Interrupt_Handler and Attach_Handler): Generate reference
2890 to protected operation to prevent spurious warnings about
2891 unreferenced entities. Previous scheme failed with style checks
2894 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2896 * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
2897 that follows an expression function must not be relocated to
2898 the generated body, because it applies to the code that follows.
2900 2017-04-28 Gary Dismukes <dismukes@adacore.com>
2902 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
2903 Relaxed_RM_Semantics to avoid having CodePeer issue errors on
2904 code that might violate the more stringent checking for 'Access
2905 introduced in Ada 2005.
2907 2017-04-28 Arnaud Charlet <charlet@adacore.com>
2909 * a-cforse.adb: minor style fix in comment.
2911 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2913 * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
2914 initialize Block_Decls variable.
2915 (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
2916 (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
2917 * exp_disp.adb (Expand_Interface_Actuals): Initialize
2918 Formal_DDT and Actual_DDT variables.
2919 (Expand_Interface_Thunk): Initialize Iface_Formal.
2920 (Make_DT): Initialize Size_Comp.
2921 (Make_Select_Specific_Data_Table): Initialize Decls.
2922 * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
2923 Also initialize more RPC_Receiver_* variables.
2924 (Build_To_Any_Function): Initialize Cstr_Formal.
2925 * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
2927 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2929 * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
2930 node between access types, freeze the designated type as well,
2931 so that dispatch table pointers are created in the proper scope,
2932 and not in the constructed body of the expression function.
2934 2017-04-28 Bob Duff <duff@adacore.com>
2936 * alloc.ads (Nodes_Initial): Go back to previous value. The large
2937 value makes large compilations faster, but small compilations slower.
2939 2017-04-28 Arnaud Charlet <charlet@adacore.com>
2941 * sem_util.adb: minor typos in Is_Child_Or_Sibling.
2943 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2945 * erroutc.adb (Compilation_Errors): Do not consider info messages
2946 as suitable warnings when warnings must be treated as errors.
2947 * sem_ch7.adb (Analyze_Package_Specification): Do not consider
2948 internally-generated packages when outputting completion
2950 * errout.adb (Output_Messages): Do not consider info messages as
2951 suitable warnings when warnings must be treated as errors.
2952 * errutil.adb (Finalize): Do not consider info messages as
2953 suitable warnings when warnings must be treated as errors.
2955 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2957 * warnsw.ads: Minor fix for incorrect wording in comment.
2959 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2961 * sem_res.adb (In_Instance_Code): New predicate in
2962 Valid_Conversion, to determine whether a type conversion appears
2963 as (or within) an actual for a formal object. Type conversions
2964 in instances are not rechecked in Valid_Conversion because
2965 visibility changes between generic location andi instance may
2966 lead to spurious errors, but conversions within an actual must be
2967 fully checked, and they are not fully resolved when pre-analyzing
2970 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2972 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
2973 New_Copy_Tree instead of Relocate_Node as any subsequent copies
2974 of the relocated node will have mangled Parent pointers.
2975 * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
2976 tables used in conjunction with entity and itype replication.
2977 (Visit_Entity): Rewrite the restriction on which entities
2978 require duplication. The restriction now includes all types.
2980 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2982 * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
2983 a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
2984 a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
2987 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2989 * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
2990 gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
2992 2017-04-28 Gary Dismukes <dismukes@adacore.com>
2994 * exp_util.adb: Minor reformatting.
2996 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2998 * sem_ch4.adb: Fix copy/pasto.
3000 2017-04-27 Tristan Gingold <gingold@adacore.com>
3002 * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
3003 raise-gcc.c. Fix include search path for raise-gcc.c
3005 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3007 * fe.h (Warn_On_Questionable_Layout): Declare.
3008 * warnsw.ads (Warn_On_Record_Holes): Move down.
3009 (Warn_On_Questionable_Layout): New boolean variable.
3010 (Warning_Record): Add Warn_On_Questionable_Layout field.
3011 * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
3012 (Restore_Warnings): Likewise.
3013 (Save_Warnings): Likewise.
3014 (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
3015 * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
3016 components_to_record.
3017 (gnu_field_to_gnat): New function.
3018 (warn_on_field_placement): Likewise.
3019 (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
3020 parameters. Rename local variables and adjust recursive call.
3021 Rework final scan of the field list and implement warnings on the
3022 problematic placement of specific sorts of fields.
3024 2017-04-27 Bob Duff <duff@adacore.com>
3026 * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
3027 * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
3028 * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
3029 * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
3030 * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
3031 * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
3032 For efficiency, cache results of Is_Internal_File_Name and
3033 Is_Predefined_File_Name in the Units table. This avoids a lot
3034 of repeated text processing.
3036 2017-04-27 Emmanuel Briot <briot@adacore.com>
3038 * g-comlin.adb (Sort_Sections): remove useless test.
3040 2017-04-27 Claire Dross <dross@adacore.com>
3042 * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
3043 allow the use of regular equality over elements in contracts.
3044 (Formal_Model): Ghost package containing model functions that are
3045 used in subprogram contracts.
3046 (Current_To_Last): Removed, model functions should be used instead.
3047 (First_To_Previous): Removed, model functions should be used instead.
3048 (Strict_Equal): Removed, model functions should be used instead.
3049 (No_Overlap): Removed, model functions should be used instead.
3050 (Equivalent_Keys): Functions over cursors are removed. They were
3051 awkward with explicit container parameters.
3052 * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
3053 allow the use of regular equality over elements in contracts.
3054 (Formal_Model): Ghost package containing model functions that
3055 are used in subprogram contracts.
3056 (Current_To_Last): Removed, model functions should be used instead.
3057 (First_To_Previous): Removed, model functions should be used instead.
3058 (Strict_Equal): Removed, model functions should be used instead.
3059 (No_Overlap): Removed, model functions should be used instead.
3061 2017-04-27 Yannick Moy <moy@adacore.com>
3063 * gnat1drv.adb: Code cleanup.
3065 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3067 * exp_util.adb (Replace_Entity): The prefix of a 'Result
3068 attribute reference in a post- condition is the subprogram to
3069 which the condition applies. If the condition is inherited
3070 by a type extension, the prefix becomes a reference to the
3071 inherited operation, but there is no need to create a wrapper
3072 for this operation, because 'Result is expanded independently
3073 when elaborating the postconditions.
3075 2017-04-27 Bob Duff <duff@adacore.com>
3077 * sinput.adb: Minor code cleanup.
3078 * namet.adb (Append): Create faster versions of
3079 Append(String) and Append(Name_Id) by using slice assignment
3081 * sem_util.adb (In_Instance): Speed this up by removing
3082 unnecessary tests; Is_Generic_Instance is defined for all
3084 * sem_util.ads, sem_util.adb (In_Parameter_Specification):
3085 Remove unused function.
3086 * alloc.ads (Nodes_Initial): Use a much larger value, because
3087 the compiler was spending a lot of time copying the nodes table
3088 when it grows. This number was chosen in 1996, so is rather out
3089 of date with current memory sizes. Anyway, it's virtual memory.
3090 Get rid of Orig_Nodes_...; use Node_... instead.
3091 * atree.adb (Lock): Do not release the Nodes tables; it's a
3093 Orig_Nodes_ ==> Nodes_
3094 * nlists.adb: Orig_Nodes_ ==> Nodes_
3095 * g-table.adb: Remove unused "with" clause.
3096 * g-table.ads, table.ads: Remove Big_Table_Type, which should
3097 not be used by clients.
3098 * g-dyntab.adb (Last_Allocated): New function
3099 to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
3101 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3103 * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
3105 (Subtypes_Statically_Match): Remove duplicate check.
3106 * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
3108 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3110 * exp_aggr.adb (Replace_Type): Remove the special processing
3111 for selected components.
3112 * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
3113 processing for attributes Fixed_Value and Integer_Value.
3114 * exp_util.adb (Side_Effect_Free): Merge the processing for
3115 qualified expressions, type conversions, and unchecked type
3117 * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
3119 * par-ch3.adb (P_Declarative_Items): Merge the processing for
3120 tokens function, not, overriding, and procedure.
3121 * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
3122 for qualified expressions, type conversions, and unchecked
3124 * sem_util.adb (Compile_Time_Constraint_Error): Merge the
3125 processing for Ada 83 and instances.
3126 (Object_Access_Level): Merge the processing for indexed components
3127 and selected components.
3128 * uname.adb (Add_Node_Name): Merge the processing for stubs.
3130 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3132 * checks.adb (Install_Primitive_Elaboration_Check):
3133 Do not generate the check when restriction No_Elaboration_Code
3136 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3138 * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
3139 of Expand_Dispatching_Call. If the denoted subprogram has a
3140 class-wide precondition, this is the only precondition that
3141 applies to the call, rather that the class-wide preconditions
3142 that may apply to the body that is executed. (This is specified
3145 2017-04-27 Yannick Moy <moy@adacore.com>
3147 * gnat1drv.adb (Adjust_Global_Switches): Issue
3148 a warning in GNATprove mode if the runtime library does not
3149 support IEEE-754 floats.
3151 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3153 * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
3154 is itself inherited it does not carry any contract information,
3155 so examine its parent operation which is its Alias.
3157 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3159 * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
3160 prefix can be an object reference in which case Obj'Image (X)
3161 can only be interpreted as an indexing of the parameterless
3162 version of the attribute.
3163 * par-ch4.adb (P_Name): An attribute reference can be the prefix of
3164 an indexing or a slice operation if the attribute does not require
3165 parameters. In Ada2012 'Image also belongs in this category,
3166 and A'Image (lo .. hi) is legal and must be parsed as a slice.
3168 2017-04-27 Yannick Moy <moy@adacore.com>
3170 * exp_ch4.adb: Minor reformatting.
3171 * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
3172 disable the CodePeer and C generation modes. Similar to the
3173 opposite actions done in CodePeer mode.
3175 2017-04-27 Yannick Moy <moy@adacore.com>
3177 * sem_res.adb: Remove duplicate code.
3178 * sem_attr.adb: Delete duplicate code.
3180 2017-04-27 Bob Duff <duff@adacore.com>
3182 * g-dyntab.adb: Reduce the amount of copying in
3183 Release. No need to copy items past Last.
3185 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3187 * checks.adb Add with and use clauses for Sem_Disp.
3188 (Install_Primitive_Elaboration_Check): New routine.
3189 * checks.ads (Install_Primitive_Elaboration_Check): New routine.
3190 * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
3191 processing of 'Elaborated.
3192 * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
3195 2017-04-27 Bob Duff <duff@adacore.com>
3197 * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
3198 If the table grows and then shrinks back to empty, we won't necessarily
3199 point back to the empty array. Code cleanups.
3200 * sinput.ads: Add 'Base to Size clause to match the declared
3203 2017-04-27 Claire Dross <dross@adacore.com>
3205 * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
3206 allow the use of regular equality over elements in contracts.
3207 (Formal_Model): Ghost package containing model functions that
3208 are used in subprogram contracts.
3209 (Current_To_Last): Removed, model functions should be used instead.
3210 (First_To_Previous): Removed, model functions should be used instead.
3211 (Strict_Equal): Removed, model functions should be used instead.
3212 (No_Overlap): Removed, model functions should be used instead.
3213 * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
3214 Boolean generic parameter to disable contracts for equivalence
3216 (Witness): Create a witness of a key that is used for handling of
3217 equivalence between keys.
3218 (Has_Witness): Check whether a witness is contained in a map.
3219 (W_Get): Get the element associated to a witness.
3220 (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
3222 * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
3223 Boolean generic parameter to disable contracts for equivalence
3225 * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
3226 of equivalence on functional maps.
3227 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
3228 of equivalence on functional maps.
3230 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3232 * exp_ch9.adb (Expand_Entry_Barrier): Code
3233 cleanup. Do not perform the optimization which removes the
3234 declarations of the discriminant and component renamings when
3235 validity checks on operands and attributes are in effect.
3237 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3239 * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
3240 freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
3241 a-cfhama.ads, a-cofove.ads: Minor reformatting.
3243 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3245 * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
3246 pointer dereference.
3247 * g-spipat.adb (Dump): Code clean up. Protect against a possible
3248 null pointer dereference.
3250 2017-04-27 Bob Duff <duff@adacore.com>
3252 * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
3253 Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
3254 Free renames Init, since they do the same thing.
3255 * g-table.ads: Default for Table_Low_Bound.
3256 * table.ads: Default for Table_Low_Bound, Table_Initial, and
3259 2017-04-27 Bob Duff <duff@adacore.com>
3261 * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
3263 * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
3264 * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
3265 Reorder code so that above assertions do not fail.
3266 * table.ads: Remove obsolete comment on Locked.
3268 2017-04-27 Claire Dross <dross@adacore.com>
3270 * a-cfdlli.ads: Code cleanup.
3272 2017-04-27 Yannick Moy <moy@adacore.com>
3274 * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
3275 when needed for proof. (Expand_SPARK): Call the new procedure.
3276 * exp_util.ads Fix typo.
3278 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3280 * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
3283 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3285 * sem_elab.adb Add new type Visited_Element
3286 and update the contents of table Elab_Visited. Various code clean up.
3287 (Check_Elab_Call): Determine whether a prior call to
3288 the same subprogram was already examined within the same context.
3289 (Check_Internal_Call_Continue): Register the subprogram being
3290 called as examined within a particular context. Do not suppress
3291 elaboration warnings.
3293 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3295 * xoscons.adb, osint.ads: Minor reformatting.
3297 2017-04-27 Bob Duff <duff@adacore.com>
3299 * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
3300 Table_Count_Type --> Table_Last_Type, because the name
3301 was confusing (a "count" usually starts at zero). Add
3302 functionality supported or needed by other tables packages
3303 (Move, Release_Threshold).
3304 * g-table.ads, g-table.adb: This is now just a thin wrapper
3305 around g-dyntab.ads/g-dyntab.adb. Add functionality supported
3306 or needed by other tables packages (Save, Restore).
3307 * table.ads, table.adb: This is now just a thin wrapper around
3308 * g-table.ads/g-table.adb.
3309 * namet.h, scos.h, uintp.h: These files are reaching into the
3310 private data of some instances of g-table, whose names changed,
3311 so the above change requires some adjustment here. It now uses
3314 2017-04-27 Bob Duff <duff@adacore.com>
3316 * namet.adb, namet.ads: Minor: remove unused procedures.
3318 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3320 * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
3321 (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
3322 Add pragma Warnings on Rtype variable in nested block. *
3323 * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
3324 * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
3325 (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
3326 * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
3327 (Process_Component_List_For_Finalize): Initialize Counter_Id.
3328 (Build_Finalize_Statements): Initialize Bod_Stmts.
3329 * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
3331 2017-04-27 Claire Dross <dross@adacore.com>
3333 * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
3334 allow the use of regular equality over elements in contracts.
3335 (Formal_Model): Ghost package containing model functions that are
3336 used in subprogram contracts.
3337 (Current_To_Last): Removed, model
3338 functions should be used instead.
3339 (First_To_Previous): Removed, model functions should be used instead.
3340 (Strict_Equal): Removed, model functions should be used instead.
3341 (No_Overlap): Removed, model functions should be used instead.
3342 (Equivalent_Keys): Functions over cursors are removed. They were
3343 awkward with explicit container parameters.
3344 * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
3345 (proof only) procedure to help GNATprove when equivalence over
3346 keys is not equality.
3348 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3350 * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
3351 sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
3352 Minor reformatting and code cleanups.
3354 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3356 * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
3357 subsidiary of Check_Inherited_Conditions, to build pragmas for an
3358 operation whose ancestor has classwide pre/postconditions. This
3359 is used both to check the legality of the inheritance in Ada
3360 and in SPARK, and to determine whether a wrapper is needed for
3361 an inherited operation.
3362 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
3363 Improve placement of error message for inherited classwide
3364 conditions that become illegal on type derivation.
3366 2017-04-27 Yannick Moy <moy@adacore.com>
3368 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
3369 SPARK_Mode from context on generic package.
3370 * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
3373 2017-04-27 Claire Dross <dross@adacore.com>
3375 * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
3376 overflows in computations.
3377 * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
3378 overflows in computations.
3379 (Insert): Rewrite precondition to avoid overflows in computations.
3380 * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
3381 overflows in computations.
3382 (Insert): Rewrite precondition to avoid overflows in computations.
3384 2017-04-27 Steve Baird <baird@adacore.com>
3386 * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
3387 flag when it is declared in order to avoid confusing CodePeer about
3388 the possibility of an uninitialized variable read.
3390 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3392 * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
3393 no dimensionality error if the subtype of the expression is
3394 identical to the nominal subtype in the declaration, even though
3395 the expression itself may have been constant-folded and lack a
3397 * sem_dim.ads: Add comments on setting of dimension vectors and
3398 its interaction with node rewritings and side-effect removal.
3400 2017-04-27 Bob Duff <duff@adacore.com>
3402 * debug.adb: Minor comment correction.
3403 * sem_dim.ads: Minor reformatting and typo fixes.
3405 2017-04-27 Bob Duff <duff@adacore.com>
3407 * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
3408 Last of the tables via function calls, rather than relying on layout
3411 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3413 * exp_util.adb: No wrapper in GNATprove mode.
3415 2017-04-27 Yannick Moy <moy@adacore.com>
3417 * sem_res.adb (Resolve_Comparison_Op): Always
3418 evaluate comparisons between values of universal types.
3420 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3422 * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
3423 an elaboration counter nor a check when in GNATprove mode.
3424 * sem_util.adb (Build_Elaboration_Entity): Do not create an
3425 elaboration counter when in GNATprove mode.
3427 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3429 * freeze.adb: copy-paste typo.
3431 2017-04-27 Yannick Moy <moy@adacore.com>
3433 * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
3434 Use correct test to detect call in GNATprove mode instead of
3437 2017-04-27 Claire Dross <dross@adacore.com>
3439 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
3440 New property function expressing that the element of a
3441 sequence are contained in the union of two sequences.
3442 (Formal_Model.M_Elements_Included): New property function
3443 expressing that the element of a sequence are another sequence.
3444 (Generic_Sorting): Use new property functions to state that
3445 elements are preserved by Sort and Merge.
3446 * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
3447 allow the use of regular equality over elements in contracts.
3448 (Formal_Model): Ghost package containing model functions
3449 that are used in subprogram contracts. (Capacity):
3450 On unbounded containers, return the maximal capacity.
3451 (Current_To_Last): Removed, model functions should be used instead.
3452 (First_To_Previous): Removed, model functions should be used instead.
3453 (Append): Default parameter value replaced
3454 by new wrapper to allow more precise contracts.
3455 (Insert): Subprogram restored, it seems it was useful to users even if
3457 (Delete): Subprogram restored, it seems it was useful to users even if
3459 (Prepend): Subprogram restored, it seems it was useful to users even
3460 if it is inefficient.
3461 (Delete_First): Subprogram restored, it seems it
3462 was useful to users even if it is inefficient. (Delete_Last):
3463 Default parameter value replaced by new wrapper to allow more
3465 (Generic_Sorting.Merge): Subprogram restored.
3466 * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
3467 allow the use of regular equality over elements in contracts.
3468 (Formal_Model): Ghost package containing model functions
3469 that are used in subprogram contracts. (Capacity):
3470 On unbounded containers, return the maximal capacity.
3471 (Current_To_Last): Removed, model functions should be used
3473 (First_To_Previous): Removed, model functions should be used instead.
3474 (Append): Default parameter value replaced
3475 by new wrapper to allow more precise contracts.
3476 (Insert): Subprogram restored, it seems it was useful to users even if
3478 (Delete): Subprogram restored, it seems it was useful to users even if
3480 (Prepend): Subprogram restored, it seems it was useful to users even
3481 if it is inefficient.
3482 (Delete_First): Subprogram restored, it seems it
3483 was useful to users even if it is inefficient. (Delete_Last):
3484 Default parameter value replaced by new wrapper to allow more
3486 (Generic_Sorting.Merge): Subprogram restored.
3487 (Vector): Do not reuse formal vectors, as it is no longer possible
3488 to supply them with an equality function over elements.
3490 2017-04-27 Bob Duff <duff@adacore.com>
3492 * g-dyntab.adb (Release): When allocating the new
3493 table, use the correct slice of the old table to initialize it.
3495 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3497 * einfo.ads: Minor fixes in comments.
3499 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3501 * sem_prag.adb: disable clones in SPARK_Mode.
3503 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3505 * sem_util.ads, contracts.adb: Minor reformatting.
3507 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3509 * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
3510 Build body of subprogram that has a class-wide condition that
3511 contains calls to other primitives.
3512 (Build_Class_Wide_Clone_Call); Build a call to the common
3513 class-wide clone of a subprogram with classwide conditions. The
3514 body of the subprogram becomes a wrapper for a call to the
3515 clone. The inherited operation becomes a similar wrapper to which
3516 modified conditions apply, and the call to the clone includes
3517 the proper conversion in a call the parent operation.
3518 (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
3519 subprogram that has a classwide condition that contains calls to
3520 other primitives, build an internal subprogram that is invoked
3521 through a type-specific wrapper for all inherited subprograms
3522 that may have a modified condition.
3523 * sem_prag.adb (Check_References): If subprogram has a classwide
3524 condition, create entity for corresponding clone, to be invoked
3525 through wrapper subprograns.
3526 (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
3527 message about placement if pragma isi internally generated.
3528 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
3529 a classwide clone, build body of clone as copy of original body,
3530 and rewrite original body as a wrapper as a wrapper for a call to
3531 the clone, so that it incorporates the original pre/postconditions
3533 * freeze.adb (Check_Inherited_Conditions): For an inherited
3534 subprogram that inherits a classwide condition, build spec and
3535 body of corresponding wrapper so that call to inherited operation
3536 gets the modified conditions.
3537 * contracts.adb (Analyze_Contracts): If analysis of classwide
3538 condition has created a clone for a primitive operation, analyze
3539 declaration of clone.
3541 2017-04-27 Steve Baird <baird@adacore.com>
3543 * exp_util.adb (Build_Allocate_Deallocate_Proc):
3544 Add "Suppress => All_Checks" to avoid generating unnecessary
3547 2017-04-27 Yannick Moy <moy@adacore.com>
3549 * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
3550 * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
3551 inlining body in GNATprove mode when switch -gnatdm used.
3552 * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
3553 in GNATprove mode when switch -gnatdm used.
3555 2017-04-27 Arnaud Charlet <charlet@adacore.com>
3557 * sem_ch13.adb (Analyze_Attribute_Definition_Clause
3558 [Attribute_Address]): Call Set_Address_Taken when ignoring rep
3559 clauses, so that we keep an indication of the address clause
3560 before removing it from the tree.
3562 2017-04-27 Yannick Moy <moy@adacore.com>
3564 * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
3565 of expression being qualified, when not an object name, or else
3566 evaluate the underlying name.
3568 2017-04-27 Jerome Lambourg <lambourg@adacore.com>
3570 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
3572 2017-04-27 Justin Squirek <squirek@adacore.com>
3574 * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
3575 Process_Component_List_For_Finalization as a local variable.
3576 (Process_Component_For_Finalize): Add an extra parameter to avoid
3578 (Process_Component_List_For_Finalization): Correct calls to
3579 Process_Component_For_Finalize to take Num_Comps as a parameter.
3581 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3583 * sem_ch8.adb (Find_Direct_Name): Account for the case where
3584 a use-visible entity is defined within a nested scope of an
3585 instance when giving priority to entities which were visible in
3586 the original generic.
3587 * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
3589 2017-04-27 Tristan Gingold <gingold@adacore.com>
3591 * raise-gcc.c: Don't use unwind.h while compiling
3592 for the frontend, but mimic host behavior.
3594 2017-04-27 Javier Miranda <miranda@adacore.com>
3596 * sem_ch3.adb (Build_Discriminated_Subtype):
3597 Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
3599 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3601 * sem_prag.adb (Analyze_Global_Item):
3602 Do not consider discriminants because they are not "entire
3603 objects". Remove the discriminant-related checks because they are
3605 (Analyze_Input_Output): Do not consider discriminants
3606 because they are not "entire objects".
3608 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3610 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
3611 perform check if the current scope does not come from source,
3612 as is the case for a rewritten task body, because check has
3613 been performed already, and may not be doable because of changed
3616 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3618 * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
3619 a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
3622 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3624 * sem_ch4.adb (Analyze_Call): If the return type of a function
3625 is incomplete in an context in which the full view is available,
3626 replace the type of the call by the full view, to prevent spurious
3628 * exp_disp.adb (Check_Premature_Freezing): Disable check on an
3629 abstract subprogram so that compiler does not reject a parameter
3630 of a primitive operation of a tagged type being frozen, when
3631 the untagged type of that parameter cannot be frozen.
3633 2017-04-27 Bob Duff <duff@adacore.com>
3635 * sem_attr.adb (Compute_Type_Key): Don't walk
3636 representation items for irrelevant types, which could be in a
3637 different source file.
3639 2017-04-27 Steve Baird <baird@adacore.com>
3641 * exp_attr.adb (Expand_N_Attribute_Reference):
3642 Don't expand Image, Wide_Image, Wide_Wide_Image attributes
3645 2017-04-27 Yannick Moy <moy@adacore.com>
3647 * exp_unst.ads: Fix typos in comments.
3649 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3651 * sem_eval.adb (Choice_Matches): Handle properly a real literal
3652 whose type has a defined static predicate.
3654 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3656 * exp_ch4.adb (Insert_Dereference_Action):
3657 Do not adjust the address of a controlled object when the
3658 associated access type is subject to pragma No_Heap_Finalization.
3661 2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
3663 * gcc-interface/utils.c (gnat_type_for_size): Set
3664 TYPE_ARTIFICIAL on created types.
3666 2017-04-27 Claire Dross <dross@adacore.com>
3668 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
3669 modifications in functional containers.
3670 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
3671 to improve readablity. Subprograms are separated between basic
3672 operations, constructors and properties. Universally quantified
3673 formulas in contracts are factorized in independant functions
3674 with a name and a comment. Names of parameters are improved.
3676 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3678 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
3680 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3682 * sem_res.adb (Resolve_Type_Conversion): Do not
3683 install a predicate check here since this is already done during
3684 the expansion phase. Verify whether the operand satisfies the
3685 static predicate (if any) of the target type.
3686 * sem_ch3.adb (Analyze_Object_Declaration): Do
3687 not install a predicate check if the object is initialized by
3688 means of a type conversion because the conversion is subjected
3691 2017-04-27 Tristan Gingold <gingold@adacore.com>
3693 * raise.c (__gnat_builtin_longjmp): Remove.
3694 (__gnat_bracktrace):
3695 Add a dummy definition for the compiler (__gnat_eh_personality,
3696 __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
3697 __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
3698 __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
3699 * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
3700 * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
3701 and a-except-2005.adb.
3702 * raise-gcc.c: Allow build in compiler, compiled as a C++
3704 (__gnat_Unwind_ForcedUnwind): Adjust prototype.
3705 (db): Constify msg_format.
3706 (get_call_site_action_for): Don't use void arithmetic.
3707 * system.ads (Frontend_Exceptions): Set to False.
3708 (ZCX_By_Default): Set to True.
3709 (GCC_ZC_Support): Set to True.
3710 * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
3712 * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
3713 in gnat1 and gnatbind.
3714 * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
3715 s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
3716 * s-excmac.ads, s-excmac.adb: Copy of variants.
3717 * a-except.o: Adjust preequisites.
3718 Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
3720 2017-04-27 Claire Dross <dross@adacore.com>
3722 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
3723 modifications in functional containers.
3724 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
3725 to improve readablity. Subprograms are separated between basic
3726 operations, constructors and properties. Universally quantified
3727 formulas in contracts are factorized in independant functions
3728 with a name and a comment. Names of parameters are improved.
3730 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3732 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
3734 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3736 * sem_res.adb (Resolve_Type_Conversion): Do not
3737 install a predicate check here since this is already done during
3738 the expansion phase. Verify whether the operand satisfies the
3739 static predicate (if any) of the target type.
3740 * sem_ch3.adb (Analyze_Object_Declaration): Do
3741 not install a predicate check if the object is initialized by
3742 means of a type conversion because the conversion is subjected
3745 2017-04-27 Tristan Gingold <gingold@adacore.com>
3747 * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
3748 replaced by their variants).
3750 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3752 * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
3753 cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
3754 a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
3756 2017-04-27 Tristan Gingold <gingold@adacore.com>
3758 * s-excmac-gcc.ads, s-excmac-gcc.adb,
3759 s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
3762 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3764 * exp_ch7.adb (Establish_Transient_Scope): Rewrite
3765 the loop which detects potential enclosing transient scopes. The
3766 loop now terminates much earlier as transient scopes are bounded
3767 by packages and subprograms.
3769 2017-04-27 Claire Dross <dross@adacore.com>
3771 * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
3772 allow the use of regular equality over elements in contracts.
3773 (Cursor): Type is now public so that it can be used in
3775 (Formal_Model): Ghost package containing
3776 model functions that are used in subprogram contracts.
3777 (Current_To_Last): Removed, model functions should be used
3779 (First_To_Previous): Removed, model functions should
3781 (Strict_Equal): Removed, model functions
3782 should be used instead.
3783 (Append): Default parameter value
3784 replaced by new wrapper to allow more precise contracts.
3785 (Insert): Default parameter value replaced by new wrapper to
3786 allow more precise contracts.
3787 (Delete): Default parameter
3788 value replaced by new wrapper to allow more precise contracts.
3789 (Prepend): Default parameter value replaced by new wrapper to
3790 allow more precise contracts.
3791 (Delete_First): Default parameter
3792 value replaced by new wrapper to allow more precise contracts.
3793 (Delete_Last): Default parameter value replaced by new wrapper
3794 to allow more precise contracts.
3796 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3798 * exp_spark.adb (Expand_SPARK): Perform specialized expansion
3799 for object declarations.
3800 (Expand_SPARK_N_Object_Declaration): New routine.
3801 * sem_elab.adb (Check_A_Call): Include calls to the
3802 Default_Initial_Condition procedure of a type under the SPARK
3803 elaboration checks umbrella.
3805 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3807 * sem.adb (Analyze): Diagnose an illegal iterated component
3809 * sem_util.ads, sem_util.adb
3810 (Diagnose_Iterated_Component_Association): New routine.
3812 2017-04-27 Bob Duff <duff@adacore.com>
3814 * adaint.c (__gnat_get_current_dir): Return 0 in length if
3816 * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
3817 exception if getcwd failed.
3819 2017-04-27 Yannick Moy <moy@adacore.com>
3821 * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
3822 entities with special prefix.
3824 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3826 * debug.adb Change the documentation of switch -gnatd.s.
3827 * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
3828 to manage the secondary stack when an enclosing scope already
3829 performs this functionality (aka relaxed management). Switch
3830 -gnatd.s may be used to force strict management in which case
3831 the block will manage the secondary stack unconditionally. Add
3832 a guard to stop the traversal when encountering a package or a
3835 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3837 * sem_res.adb (Resolve_Call): Refine further the handling of
3838 limited views of return types in function calls. If the function
3839 that returns a limited view appears in the current unit,
3840 we do not replace its type by the non-limited view because
3841 this transformation is performed int the back-end. However,
3842 the type of the call itself must be the non-limited view, to
3843 prevent spurious resolution errors.
3845 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3847 * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
3848 Removed, proposed implementation using generics for class-wide
3849 preconditions proved impractical.
3850 (Class_Wide_Clone): New attribute of subprogram. Designates
3851 subprogram created for primitive operations with class-wide
3852 pre/postconditions that contain calls to other primitives. The
3853 clone holds the body of the original primitive, but the
3854 pre/postonditions do not apply to it. The original body is
3855 rewritten as a wrapper for a call to the clone.
3856 (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
3857 the flag is set, no code for the corresponding pre/postconditions
3858 is inserted into its body.
3860 2017-04-27 Bob Duff <duff@adacore.com>
3862 * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
3863 Scalar_Storage_Order if -gnatI is given.
3864 * sem_prag.adb (Analyze_Pragma): Ignore
3865 Default_Scalar_Storage_Order if -gnatI is given.
3867 2017-04-27 Claire Dross <dross@adacore.com>
3869 * a-cofuba.ads (Add): Take as an additional input parameter
3870 the position where the element should be inserted.
3871 (Remove): New function that removes an element from the container.
3872 * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
3873 * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
3874 (Remove): New function that removes an element from a set.
3875 * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
3876 (Remove): New function that removes an element from a sequence.
3877 (Insert): New function that adds anywhere in a sequence.
3879 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3881 * checks.adb (Generate_Range_Check): Revert previous change.
3883 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3885 * sem_util.adb: Minor reformatting/rewording.
3887 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3889 * lib-xref.adb (Generate_Reference): The use
3890 of attribute 'Result is not considered a violation of pragma
3893 2017-04-27 Justin Squirek <squirek@adacore.com>
3895 * cstand.adb (Create_Standard): Correctly set
3896 Directly_Designated_Type for Any_Access.
3897 * sem_type.adb (Covers): Minor grammar fixes.
3899 2017-04-27 Bob Duff <duff@adacore.com>
3901 * sem_attr.adb: Minor cleanup.
3903 2017-04-27 Claire Dross <dross@adacore.com>
3905 * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
3906 private child of Ada.Containers used to implement all functional
3908 * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
3909 child of Ada.Containers. It provides functional indefinite unbounded
3910 maps which can be used as high level models for specification
3912 * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
3913 child of Ada.Containers. It provides functional indefinite unbounded
3914 sets which can be used as high level models for specification
3916 * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
3917 child of Ada.Containers. It provides functional indefinite unbounded
3918 vectors which can be used as high level models for specification
3920 * Makefile.rtl: Add new packages.
3921 * impunit.adb: Add new packages.
3923 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3925 * sem_ch4.adb: Minor reformatting.
3927 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3929 * sem_ch12.adb (Analyze_Associations): minor reformatting.
3930 (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
3931 point type actual that has user-defined arithmetic primitives,
3932 when there is a previous actual for a formal package that defines
3933 a fixed-point type with the parent user-defined operator.
3935 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3937 * checks.adb (Generate_Range_Check): Reinstate part of previous change.
3938 * sem_attr.adb (Resolve_Attribute): Generate a range check when
3939 the component type allows range checks.
3941 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3943 * sem_aux.adb (Is_Generic_Formal): Use original node to locate
3944 corresponding declaration, because formal derived types are
3945 rewritten as private extensions.
3947 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3949 * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
3950 dimensions of operands if node has been analyzed already, because
3951 previous analysis and dimension checking will have removed the
3952 dimension information from the operands.
3954 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3956 * debug.adb: Document the use of switch -gnatd.s.
3957 * einfo.ads Update the documentation on attribute
3958 Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
3959 the uses of these attributes from certain entities.
3960 * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
3961 which determines whether the block should continue to manage
3962 the secondary stack.
3963 (Manages_Sec_Stack): New routine.
3965 2017-04-27 Bob Duff <duff@adacore.com>
3967 * atree.ads: Minor edit.
3969 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3971 * sinfo.ads: Update the section on Ghost mode. Add
3972 a section on SPARK mode. Update the placement of section on
3973 expression functions.
3975 2017-04-27 Bob Duff <duff@adacore.com>
3977 * sinput.adb (Get_Source_File_Index): Don't
3978 assert that S is in the right range in the case where this is
3979 a .dg file under construction.
3981 2017-04-27 Yannick Moy <moy@adacore.com>
3983 * sem_util.adb (Check_Result_And_Post_State):
3984 Handle more precisely each conjunct in expressions formed by
3985 and'ing sub-expressions.
3987 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3989 * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
3991 2017-04-25 Arnaud Charlet <charlet@adacore.com>
3993 * gnat_rm.texi, gnat_ugn.texi,
3994 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
3995 doc/gnat_ugn/platform_specific_information.rst,
3996 doc/gnat_ugn/gnat_and_program_execution.rst,
3997 doc/gnat_ugn/gnat_utility_programs.rst,
3998 doc/gnat_ugn/the_gnat_compilation_model.rst,
3999 doc/gnat_rm/implementation_defined_attributes.rst,
4000 doc/gnat_rm/the_gnat_library.rst,
4001 doc/gnat_rm/implementation_defined_pragmas.rst,
4002 doc/gnat_rm/representation_clauses_and_pragmas.rst,
4003 doc/gnat_rm/implementation_of_specific_ada_features.rst,
4004 doc/gnat_rm/implementation_defined_aspects.rst,
4005 doc/gnat_rm/implementation_defined_characteristics.rst: Update
4008 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4010 * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
4011 generating C code on complex case expressions.
4013 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4015 * sem_prag.adb (Analyze_Pragma): Generate a warning instead
4016 of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
4017 * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
4018 Ada_2012 instead of Ada_2005 to be compatible with the above
4020 * bindgen.adb: Silence new warning on pragma Ada_95.
4022 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4024 * checks.adb (Generate_Range_Check): Revert part of previous change.
4026 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4028 * sem_ch4.adb (Try_Container_Indexing): Handle properly a
4029 container indexing operation that appears as a an actual in a
4030 parameter association in a procedure call.
4032 2017-04-25 Olivier Ramonat <ramonat@adacore.com>
4034 * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
4035 Fix spelling mistakes.
4037 2017-04-25 Bob Duff <duff@adacore.com>
4039 * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
4040 * sinput-p.adb: Use regular fat pointers, with bounds checking,
4041 for source buffers. Fix misc obscure bugs.
4042 * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
4043 checking, for source buffers. Modify representation clause for
4044 Source_File_Record as appropriate. Move Source_File_Index_Table
4045 from spec to body, because it is not used outside the body.
4046 Move Set_Source_File_Index_Table into the private part, because
4047 it is used only in the body and in children. Use trickery to
4048 modify the dope in the generic instantiation case. It's ugly,
4049 but not as ugly as the previous method. Fix documentation.
4050 Remove obsolete code.
4051 * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
4052 indexing in source buffers.
4053 * fmap.adb: Avoid conversions from one string type to another.
4054 Remove a use of global name buffer.
4055 * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
4058 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4060 * exp_util.adb, exp_ch4.adb: Minor reformatting.
4062 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4064 * checks.adb: Code clean up in various routines.
4065 (Generate_Range_Check): Do not generate a range check when the
4066 expander is not active or when index/range checks are suppressed
4068 (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
4069 Remove variants that include a Supress parameter. These routines
4070 are never used, and were introduced before the current scope-based
4071 check suppression method.
4073 2017-04-25 Vasiliy Fofanov <fofanov@adacore.com>
4075 * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
4076 code and some subprogram calls that are now noop.
4078 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4080 * exp_ch4.adb (Expand_N_Case_Expression): Take
4081 Minimize_Expression_With_Actions into account when possible.
4083 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4085 * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
4086 (Known_Null): Moved to Sem_Util.
4087 * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
4088 (Known_Null): Moved to Sem_Util.
4089 * sem_util.adb Add new enumeration type Null_Status_Kind.
4090 (Known_Non_Null): Moved from Exp_Util. Most of the logic in
4091 this routine is now carried out by Null_Status.
4092 (Known_Null): Moved from Exp_Util. Most of the logic in this routine
4093 is now carried out by Null_Status.
4094 (Null_Status): New routine.
4095 * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
4096 (Known_Null): Moved from Exp_Util.
4098 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4100 * sem_ch6.adb (Analyze_Expression_Function): Do not report an
4101 error on the return type of an expression function that is a
4102 completion, if the type is derived from a generic formal type.
4104 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4106 * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
4107 conversion are those of the target type.
4109 2017-04-25 Bob Duff <duff@adacore.com>
4111 * a-clrefi.adb: Minor cleanup.
4113 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4115 * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
4117 2017-04-25 Bob Duff <duff@adacore.com>
4119 * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
4120 types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
4121 errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
4122 scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
4123 the Internal_Source buffer. This removes the incorrect call to "="
4124 the customer noticed.
4125 Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
4126 eventually need to eliminate them altogether. Or else get rid
4127 of zero-origin addressing.
4129 2017-04-25 Claire Dross <dross@adacore.com>
4131 * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
4132 function used in GNATprove to know if an expression contains
4133 non-dispatching calls on primitives of a tagged type.
4135 2017-04-25 Bob Duff <duff@adacore.com>
4137 * rtsfind.adb (Initialize): Initialize
4138 First_Implicit_With. Building the compiler with Normalize_Scalars
4139 and validity checking finds this being used as an uninitialized
4142 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4144 * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
4145 Add a warning about SPARK mode management. The routine now
4146 saves and restores both the mode and associated pragma.
4147 (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
4148 SPARK mode management. The routine now saves and restores both
4149 the mode and associated pragma.
4150 (Analyze_Object_Contract):
4151 Add a warning about SPARK mode management. The routine
4152 now saves and restores both the mode and associated pragma.
4153 (Analyze_Package_Body_Contract): Add a warning about SPARK mode
4154 management. The routine now saves and restores both the mode
4155 and associated pragma. (Analyze_Package_Contract): Add a warning
4156 about SPARK mode management. The routine now saves and restores
4157 both the mode and associated pragma.
4158 (Analyze_Task_Contract):
4159 Add a warning about SPARK mode management. The routine now saves
4160 and restores both the mode and associated pragma.
4161 * expander.adb (Expand): Change the way the Ghost mode is saved
4163 * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
4165 * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
4167 * exp_util.adb (Build_DIC_Procedure_Body):
4168 Change the way the Ghost mode is saved and restored.
4169 (Build_DIC_Procedure_Declaration): Change the way the Ghost
4170 mode is saved and restored.
4171 (Build_Invariant_Procedure_Body):
4172 Change the way the Ghost mode is saved and restored.
4173 (Build_Invariant_Procedure_Declaration): Change the way the Ghost
4174 mode is saved and restored.
4175 (Make_Predicate_Call): Change the
4176 way the Ghost mode is saved and restored.
4177 * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
4179 * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4181 (Mark_And_Set_Ghost_Body): Remove parameter
4182 Mode and its assignment.
4183 (Mark_And_Set_Ghost_Completion):
4184 Remove parameter Mode and its assignment.
4185 (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
4187 (Mark_And_Set_Ghost_Instantiation): Remove parameter
4188 Mode and its assignment.
4189 (Mark_And_Set_Ghost_Procedure_Call):
4190 Remove parameter Mode and its assignment.
4192 Remove parameter Mode and its assignment.
4193 * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4194 and update the comment on usage.
4195 (Mark_And_Set_Ghost_Body):
4196 Remove parameter Mode and update the comment on usage.
4197 (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
4198 update the comment on usage.
4199 (Mark_And_Set_Ghost_Declaration):
4200 Remove parameter Mode and update the comment on usage.
4201 (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
4202 update the comment on usage.
4203 (Mark_And_Set_Ghost_Procedure_Call):
4204 Remove parameter Mode and update the comment on usage.
4205 (Set_Ghost_Mode): Remove parameter Mode and update the comment
4207 * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
4209 * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
4210 of obsolete field SPARK_Mode_Pragma.
4211 (Load_Main_Source): Remove
4212 the assignment of obsolete field SPARK_Mode_Pragma.
4213 (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
4214 * lib-writ.adb (Add_Preprocessing_Dependency): Remove
4215 the assignment of obsolete field SPARK_Mode_Pragma.
4216 (Ensure_System_Dependency): Remove the assignment of obsolete
4217 field SPARK_Mode_Pragma.
4218 * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
4219 mode management. Change the way Ghost and SPARK modes are saved
4221 * sem.adb (Analyze): Change the way the Ghost mode is saved
4223 * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
4224 Ghost mode is saved and restored.
4225 (Process_Full_View): Change
4226 the way the Ghost mode is saved and restored.
4227 * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
4228 mode is saved and restored.
4229 * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
4230 mode is saved and restored.
4231 (Analyze_Subprogram_Body_Helper):
4232 Change the way the Ghost mode is saved and restored.
4233 * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
4234 Ghost mode is saved and restored.
4235 * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
4236 management. Save the SPARK mode-related data prior to any changes
4237 to the scope stack and contexts. The mode is then reinstalled
4238 before the subunit is analyzed in order to restore the original
4239 view of the subunit.
4240 * sem_ch12.adb (Analyze_Package_Instantiation): Update the
4241 warning on region management. Change the way the Ghost and
4242 SPARK modes are saved and restored.
4243 (Inline_Instance_Body):
4244 Add a warning about SPARK mode management. Code clean up.
4245 (Analyze_Subprogram_Instantiation): Update the warning on region
4246 management. Change the way the Ghost and SPARK modes are saved
4248 (Instantiate_Package_Body): Update the warning
4249 on region management. Change the way the Ghost and SPARK modes
4250 are saved and restored.
4251 (Instantiate_Subprogram_Body): Update
4252 the warning on region management. Change the way the Ghost and
4253 SPARK modes are saved and restored.
4254 (Set_Instance_Env): Add a
4255 warning about SPARK mode management. Change the way SPARK mode
4256 is saved and restored.
4257 * sem_ch13.adb (Build_Predicate_Functions):
4258 Change the way the Ghost mode is saved and restored.
4259 (Build_Predicate_Function_Declaration): Change the way the Ghost
4260 mode is saved and restored.
4261 * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
4262 mode management. Change the way SPARK mode is saved and restored.
4263 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
4264 Change the way the Ghost mode is saved and restored.
4265 (Analyze_Initial_Condition_In_Decl_Part): Change the way
4266 the Ghost mode is saved and restored.
4268 Change the way the Ghost mode is saved and restored.
4269 (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
4270 Ghost mode is saved and restored.
4271 * sem_util.adb (Install_SPARK_Mode): New routine.
4272 (Restore_SPARK_Mode): New routine.
4273 (Save_SPARK_Mode_And_Set): Removed.
4274 (Set_SPARK_Mode): New routine.
4275 * sem_util.ads (Install_SPARK_Mode): New routine.
4276 (Restore_SPARK_Mode): New routine.
4277 (Save_SPARK_Mode_And_Set): Removed.
4278 (Set_SPARK_Mode): New routine.
4280 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4282 * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
4283 to determine whether a type is declared in a local package that
4284 has not yet been frozen.
4285 * freeze.adb (Freeze_Before): Use new predicate to determine
4286 whether a local package must be installed on the scope stack
4287 in order to evaluate in the proper scope actions generated by
4288 aspect specifications, such as Predicate
4289 * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
4290 using new predicate.
4292 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4294 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
4295 comparisons between non- scalar expressions expressions because
4296 their values cannot be invalidated.
4297 * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
4300 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4302 * par_sco.adb: Minor reformatting.
4304 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4306 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
4307 is a type from an unfrozen local package, install package to
4308 complete the analysis of delayed aspects of the type.
4310 2017-04-25 Tristan Gingold <gingold@adacore.com>
4312 * bingen.adb (System_Version_Control_Used): New variable.
4313 (Resolve_Binder_Options): Set the above variable.
4314 (Gen_Output_File_Ada): Conditionally call Gen_Versions.
4315 (Gen_Elab_Order): Emit blank line before.
4317 2017-04-25 Justin Squirek <squirek@adacore.com>
4319 * sem_cat.adb (Validate_RT_RAT_Component): Added
4320 an extra check to ignore incomplete types.
4322 2017-04-25 Thomas Quinot <quinot@adacore.com>
4324 * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
4325 bogus circuitry for the case where Name is Predicate.
4327 2017-04-25 Thomas Quinot <quinot@adacore.com>
4329 * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
4330 Create SCOs for Predicate aspects in disabled
4331 state initially, to be enabled later on by...
4332 * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
4333 SCO for predicate as enabled.
4335 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4337 * comperr.adb (Compiler_Abort): Remove now obsolete pair of
4338 pragmas Warnings Off / On.
4339 * namet.adb (Finalize): Remove now obsolete pair of pragmas
4341 * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
4342 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
4343 consider comparisons between static expressions because their
4344 values cannot be invalidated.
4345 * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
4347 (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
4348 * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
4350 2017-04-25 Bob Duff <duff@adacore.com>
4352 * sem_elab.adb (In_Task_Activation): Trace internal calls in
4355 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4357 * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
4360 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4362 * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
4363 On/Off to defend against a spurious warning in conditional
4365 * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
4366 * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
4367 defend against a spurious warning in conditional compilation.
4368 * output.adb Add a pair of pragma Warnings On/Off to defend
4369 against a spurious warning in conditional compilation.
4370 * sem_eval.adb (Eval_Relational_Op): Major code clean up.
4371 (Fold_General_Op): New routine.
4372 (Fold_Static_Real_Op): New routine.
4373 (Test_Comparison): New routine.
4374 * sem_eval.ads (Test_Comparison): New routine.
4375 * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
4376 (Warn_On_Constant_Valid_Condition): New routine.
4377 (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
4378 to detect a specific case.
4379 * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
4380 * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
4381 to defend against a spurious warning in conditional compilation.
4382 (Tree_Write): Add a pair of pragma Warnings On/Off to defend
4383 against a spurious warning in conditional compilation.
4384 * usage.adb Add a pair of pragma Warnings On/Off to defend
4385 against a spurious warning in conditional compilation.
4387 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4389 * sinfo.ads, sem_ch13.adb: Update comment.
4391 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4393 * sem_util.adb (Is_Post_State): A reference to a
4394 generic in out parameter is considered a change in the post-state
4397 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4399 * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
4400 declaration of a subprogram instance within its wrapper package,
4401 skip over null statements that may result from the rewriting of
4404 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4406 * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
4407 If the type is an unchecked_union, replace the attribute with
4408 a Raise_Program_Error (rather than inserting such before the
4409 attribute reference) to handle properly the case where we are
4410 processing a component of a larger record, and we need to prevent
4411 further expansion for the unchecked union.
4412 (Expand_Attribute_Reference, case 'Write): If the type is
4413 an unchecked_union, check whether enclosing scope is a Write
4414 subprogram. Replace attribute with a Raise_Program_Error if the
4415 discriminants of the unchecked_union type have not default values
4416 because such a use is erroneous..
4418 2017-04-25 Tristan Gingold <gingold@adacore.com>
4420 * exp_ch9.adb (Expand_N_Task_Type_Declaration):
4421 Add relative_deadline to task record on edf profile.
4422 (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
4423 (Make_Task_Create_Call): Pass relative_deadline value.
4424 * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
4425 * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
4426 (Profile_Info): Add info for GNAT_Ravenscar_EDF.
4427 * sem_prag.adb (Set_Ravenscar_Profile): Handle
4428 GNAT_Ravenscar_EDF (set scheduling policy).
4429 (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
4431 (Sig_Flags): Add choice for Pragma_Deadline_Floor.
4432 * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
4434 (Pragma_Deadline_Floor): New pragma.
4435 * targparm.adb (Get_Target_Parameters): Recognize
4436 GNAT_Ravenscar_EDF profile.
4438 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4440 * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
4442 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4444 * sem_aux.adb (Nearest_Ancestor): Use original node of type
4445 declaration to locate nearest ancestor, because derived
4446 type declarations for record types are rewritten as record
4448 * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
4449 properly derivations that are completions of private types.
4450 (Add_Predicates): If type is private, examine rep. items of full
4451 view, which may include inherited predicates.
4452 (Build_Predicate_Functions): Ditto.
4454 2017-04-25 Javier Miranda <miranda@adacore.com>
4456 * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
4457 to generate new entities for subtype declarations located in
4458 Expression_With_Action nodes.
4460 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4462 * sem_elab.adb (Check_A_Call): Remove
4463 local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
4464 need for Elaborate_All when SPARK elaboration checks are
4465 required. Update the checks for instances, variables, and calls
4466 to Default_Initial_Condition procedures.
4468 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4470 * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
4471 into a boolean aspect, in analogy with the Ada aspect No_Return.
4473 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4475 * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
4477 2017-04-25 Bob Duff <duff@adacore.com>
4479 * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
4480 Is_True_Constant for an array variable that is passed to a
4481 foreign function as an 'in' parameter.
4482 * debug.adb: Document -gnatd.q.
4484 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4486 * sem_ch6.adb (Analyze_Expression_Function): If expression function
4487 is completion and return type is an access type do not freeze
4488 designated type: this will be done in the process of freezing
4489 the expression if needed.
4490 (Freeze_Expr_Types): Check whether type is complete before
4491 creating freeze node, to provide a better error message if
4492 reference is premature.
4493 * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
4494 functions created by type derivations.
4496 2017-04-25 Pascal Obry <obry@adacore.com>
4498 * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
4500 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4502 * sem_res.adb (Resolve_Type_Conversion):
4503 When resolving against any fixed type, set the type of the
4504 operand as universal real when the operand is a multiplication
4505 or a division where both operands are of any fixed type.
4506 (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
4507 placement of an error message by pointing to the operand of a
4508 type conversion rather than the conversion itself.
4510 2017-04-25 Thomas Quinot <quinot@adacore.com>
4512 * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
4513 Needs_Debug_Info when producing SCOs.
4515 2017-04-25 Thomas Quinot <quinot@adacore.com>
4517 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
4518 Always pass a null finalization master for a library level named access
4519 type to which a pragme No_Heap_Finalization applies.
4521 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4525 * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
4526 set to A'First(2) and vice versa.
4528 2017-04-25 Yannick Moy <moy@adacore.com>
4530 * freeze.adb (Freeze_Record_Type): Remove obsolete
4531 rule on volatile tagged record restriction on SPARK code.
4533 2017-04-25 Yannick Moy <moy@adacore.com>
4535 * sem_prag.adb (minor) Fix SPARK RM reference.
4537 2017-04-25 Yannick Moy <moy@adacore.com>
4539 * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
4540 comment to reflect which entity is chosen as unique entity.
4541 (Unique_Entity): Return full view instead of private spec for
4542 protected type or task type. Fix possible incorrect access when
4545 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4547 * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
4548 array types only instead of all packed array types.
4550 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4552 * sem_ch6.adb (Conforming_Types): If type of formal as a specified
4553 dimension system, verify that dimensions of both match.
4554 (Check_Conformance): Add error message in case of dimension
4556 * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
4559 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4561 * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
4564 2017-04-25 Yannick Moy <moy@adacore.com>
4566 * sem_util.adb: Minor refactoring.
4567 * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
4569 2017-04-25 Claire Dross <dross@adacore.com>
4571 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
4572 ultimate alias when accessing overridden operation. Indeed, if the
4573 overridden operation is itself inherited, it won't have any explicit
4576 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4578 * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
4579 overlap if the two formals have different types, because formally
4580 the corresponding actuals cannot designate the same objects.
4582 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4584 * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
4585 dimensions are present from context, use them. b) If operand is
4586 a static constant rewritten as a literal, obtain the dimensions
4587 from the original declaration, otherwise use dimensions of type
4588 established from context.
4590 2017-04-25 Yannick Moy <moy@adacore.com>
4592 * sem_util.adb (Is_Effectively_Volatile): Protect against base type
4593 of array that is private.
4595 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4597 * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
4600 2017-04-25 Yannick Moy <moy@adacore.com>
4602 * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
4605 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4607 * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
4608 the check that recognizes a call to a private overridding and
4609 replaces the called subprogram with its alias.
4611 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4613 * exp_util.adb: Minor reformatting.
4615 2017-04-25 Justin Squirek <squirek@adacore.com>
4617 * exp_ch3.adb (Freeze_Type): Add condition to always treat
4618 interface types as a partial view of a private type for the
4619 generation of invariant procedure bodies.
4620 * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
4621 Add a condition to get the Corresponding_Record_Type for
4622 concurrent types, add condition to return in the absence of a
4623 class in the pragma, remove call to Replace_Type_References,
4624 and add call to Replace_References.
4625 (Add_Interface_Invariatns),
4626 (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
4627 to including the working type T.
4628 (Add_Own_Invariants): Remove
4629 legacy condition for separate units, remove dispatching for ASIS
4630 and save a copy of the expression in the pragma expression.
4631 (Build_Invariant_Procedure_Body): Default initalize vars,
4632 remove return condition on interfaces, always use the
4633 private type for interfaces, and move the processing of types
4634 until after the processing of invariants for the full view.
4635 (Build_Invariant_Procedure_Declaration): Remove condition
4636 to return if an interface type is encountered and add
4637 condition to convert the formal parameter to its class-wide
4638 counterpart if Work_Typ is abstract.
4639 (Replace_Type): Add call to Remove_Controlling_Arguments.
4640 (Replace_Type_Ref): Remove class-wide dispatching for the current
4641 instance of the type.
4642 (Replace_Type_References): Remove parameter "Derived"
4643 (Remove_Controlling_Arguments): Created in order to removing
4644 the controlliong argument from calls to primitives in the case
4645 of the formal parameter being an class-wide abstract type.
4646 * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
4647 to the change made to Freeze_Type in exp_ch3. Add a condition
4648 to treat interface types as a partial view.
4649 * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
4650 to Build_Invariant_Procedure_Declaration to properly generate a
4651 "partial" invariant procedure when Typ is an interface.
4653 2017-04-25 Bob Duff <duff@adacore.com>
4655 * a-numeri.ads: Go back to using brackets encoding for the Greek
4658 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4660 * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
4661 (10-15): if derived type T with progenitors is abstract,
4662 and primitive P of this type inherits non-trivial classwide
4663 preconditions from both a parent operation and from an interface
4664 operation, then the inherited operation is abstract if the parent
4665 operation is not null.
4666 * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
4667 with Covered_Interface_Op to yield the actual interface operation
4668 that is implemented by a given inherited operation.
4670 2017-04-25 Javier Miranda <miranda@adacore.com>
4672 * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
4673 and right operands after performing the validity checks. Required
4674 because validity checks may remove side effects from the operands.
4676 2017-04-25 Javier Miranda <miranda@adacore.com>
4678 * exp_attr.adb (Attribute_Unrestricted_Access):
4679 Do not disable implicit type conversion. Required to generate
4680 code that displaces the pointer to reference the secondary
4683 2017-04-25 Pascal Obry <obry@adacore.com>
4685 * prj-attr.adb, snames.ads-tmpl: Add package Install's
4686 Required_Artifacts attribute.
4688 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4690 * sem_util.adb (Same_Value): String literals are compile-time
4691 values, and comparing them must use Expr_Value_S.
4693 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4695 * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
4696 dereference is introduced for the object, and the object is
4697 overloaded, do not check whether it is aliased, because it may
4698 include an implicit dereference.
4699 * sem_type.adb (Disambiguate): If two interpretations are access
4700 attribute types with the same designated type keep either of
4701 them and do not report an ambiguity. A true ambiguity will be
4704 2017-04-25 Bob Duff <duff@adacore.com>
4706 * a-numeri.ads: Change the encoding of Greek letter Pi from
4707 brackets encoding to UTF-8. Use pragma Wide_Character_Encoding
4708 to indicate the encoding. We considered using a byte order mark
4709 (BOM), but that causes various trouble (misc software eats the
4710 BOM, if you have a patch with a BOM, then it's not at the start
4711 of the patch, so it's not a BOM, the BOM affects with-ing files,
4713 * scng.adb, s-wchcnv.adb: Minor.
4715 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4717 * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
4718 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4720 * sem_ch3.adb (Add_Internal_Interface_Entities): Move
4721 Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
4722 Improve error message on operations that inherit non-conforming
4723 classwide preconditions from ancestor and progenitor.
4724 * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
4725 moved here from sem_ch3.
4726 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
4727 check given in RM 6.1.1 (17) concerning renamings of overriding
4728 operations that inherits class-wide preconditions from ancestor
4731 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4733 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
4734 (Build_Adjust_Statements): Code cleanup.
4735 (Build_Finalizer): Update the initialization of
4737 (Build_Finalize_Statements): Code cleanup.
4738 (Build_Initialize_Statements): Code cleanup.
4739 (Make_Deep_Array_Body): Update the initialization of
4741 (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
4742 (Process_Object_Declaration): Generate a null exception handler only
4743 when exceptions are allowed.
4744 (Process_Transients_In_Scope): Update the initialization of
4746 * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
4748 * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
4749 restrictions when the handler is internally generated and the
4752 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4754 * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
4755 enforce legality rule on classwide preconditions inherited from
4756 both an ancestor and a progenitor (RM 6.1.1 (10-13).
4757 * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
4758 subprogram need not be dispatching if it appears in a precondition
4759 for an abstract or null subprogram.
4761 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4763 * sem_ch10.adb: Minor typo fix.
4765 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4767 * gcc-interface/Makefile.in: Cleanup VxWorks targets.
4769 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4771 * fname.adb (Is_Internal_File_Name): Arrange for the slices to
4772 have a length which is a power of 2.
4773 (Is_Predefined_File_Name): Likewise. Adjust comment.
4775 2017-04-25 Bob Duff <duff@adacore.com>
4777 * exp_aggr.adb (Component_Count): Protect the
4778 arithmetic from attempting to convert a value >= 2**31 to Int,
4779 which would otherwise raise Constraint_Error.
4781 2017-04-25 Bob Duff <duff@adacore.com>
4783 * opt.ads (Locking_Policy): Fix incorrect documentation. The
4784 first character of the policy name is not unique.
4786 2017-04-25 Bob Duff <duff@adacore.com>
4788 * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
4789 * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
4790 about this flag not being used. It was already used, and it is
4793 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4795 * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
4796 (Ignore_SPARK_Mode_Pragmas): New routine.
4797 (Set_Ignore_SPARK_Mode_Pragmas): New routine.
4798 (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
4799 * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
4801 (Ignore_SPARK_Mode_Pragmas): New routine
4802 along with pragma Inline.
4803 (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
4804 * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
4805 Ignore_SPARK_Mode_Pragmas_In_Instance.
4806 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4807 Save and restore the value of global flag
4808 Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
4809 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
4810 the corresponding spec or the body must ignore all SPARK_Mode
4811 pragmas found within.
4812 (Analyze_Subprogram_Declaration): Mark
4813 the spec when it needs to ignore all SPARK_Mode pragmas found
4814 within to allow the body to infer this property in case it is
4815 instantiated or inlined later.
4816 * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
4817 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
4818 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
4819 when the corresponding spec also ignored all SPARK_Mode pragmas
4821 (Analyze_Package_Declaration): Mark the spec when
4822 it needs to ignore all SPARK_Mode pragmas found within to allow
4823 the body to infer this property in case it is instantiated or
4825 * sem_ch12.adb (Analyze_Formal_Package_Declaration):
4826 Save and restore the value of flag
4827 Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
4828 formal spec when it needs to ignore all SPARK_Mode
4829 pragmas found within to allow the body to infer this
4830 property in case it is instantiated or inlined later.
4831 (Analyze_Package_Instantiation): Save and restore the value
4832 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
4833 the instance spec when it needs to ignore all SPARK_Mode
4834 pragmas found within to allow the body to infer this
4835 property in case it is instantiated or inlined later.
4836 (Analyze_Subprogram_Instantiation): Save and restore the value
4837 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
4838 instance spec and anonymous package when they need to ignore
4839 all SPARK_Mode pragmas found within to allow the body to infer
4840 this property in case it is instantiated or inlined later.
4841 (Instantiate_Package_Body): Save and restore the value of global
4842 flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
4843 global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
4844 corresponding instance spec also ignored all SPARK_Mode pragmas
4846 (Instantiate_Subprogram_Body): Save and restore the
4847 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
4848 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
4849 when the corresponding instance spec also ignored all SPARK_Mode
4850 pragmas found within.
4851 * sem_prag.adb (Analyze_Pragma): Update the reference to
4852 Ignore_Pragma_SPARK_Mode.
4853 * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
4854 all SPARK_Mode pragmas defined within yields mode "off".
4856 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4858 * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
4860 2017-04-25 Bob Duff <duff@adacore.com>
4862 * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
4863 All_Checks" to avoid generating unnecessary checks.
4864 * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
4866 * sem.ads: Fix comment.
4867 * expander.ads: Fix comment.
4868 * exp_atag.ads: Fix comment: "Index = 0" should be
4871 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4873 * s-taprop-linux.adb: Minor editorial fixes.
4875 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4877 * sem_util.adb (New_Copy_Tree): Put back the declarations of the
4878 hash tables at library level. Reinstate the NCT_Hash_Tables_Used
4879 variable and set it to True whenever the main hash table is
4880 populated. Short- circuit the Assoc function if it is false
4881 and add associated guards.
4883 2017-04-25 Olivier Hainque <hainque@adacore.com>
4885 * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
4886 specs without elaboration code that have an elaboration counter
4887 nevertheless, e.g. when compiled with -fpreserve-control-flow.
4888 * sem_ch10.adb (Analyze_Compilation_Unit):
4889 Set_Elaboration_Entity_Required when requested to preserve
4890 control flow, to ensure the unit elaboration is materialized at
4891 bind time, resulting in the inclusion of the unit object file
4892 in the executable closure at link time.
4894 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
4896 * exp_dbug.adb: In Debug_Renaming_Declaration,
4897 when dealing with indexed component, accept to produce a renaming
4898 symbol when the index is an IN parameter or when it is a name
4899 defined in an outer scope.
4901 2017-04-25 Yannick Moy <moy@adacore.com>
4903 * errout.adb (Error_Msg): Adapt continuation
4904 message in instantiations and inlined bodies for info messages.
4906 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4908 * fname.adb (Has_Internal_Extension): Add pragma Inline.
4909 Use direct 4-character slice comparisons.
4911 pragma Inline. (Has_Suffix): Delete.
4912 (Is_Internal_File_Name):
4913 Test Is_Predefined_File_Name first.
4914 (Is_Predefined_File_Name):
4915 Use direct slice comparisons as much as possible and limit all
4916 comparisons to at most 8 characters.
4918 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4920 * checks.adb (Insert_Valid_Check): Code cleanup.
4921 * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
4922 (Expand_Actuals): Generate proper copy-back for a validation
4923 variable when it acts as the argument of a type conversion.
4924 * sem_util.adb (Is_Validation_Variable_Reference): Augment the
4925 predicate to operate on type qualifications.
4927 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4929 * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
4932 2017-04-25 Bob Duff <duff@adacore.com>
4934 * sem_prag.adb (No_Return): Give an error if the pragma applies
4935 to a body. Specialize the error for the specless body case,
4936 as is done for (e.g.) pragma Convention.
4937 * debug.adb: Add switch -gnatd.J to disable the above legality
4938 checks. This is mainly for use in our test suite, to avoid
4939 rewriting a lot of illegal (but working) code. It might also
4940 be useful to customers. Under this switch, if a pragma No_Return
4941 applies to a body, and the procedure raises an exception (as it
4942 should), the pragma has no effect. If the procedure does return,
4943 execution is erroneous.
4945 2017-04-25 Bob Duff <duff@adacore.com>
4947 * exp_ch6.adb (Expand_Actuals): This is the
4948 root of the problem. It took N as an 'in out' parameter, and in
4949 some cases, rewrote N, but then set N to Original_Node(N). So
4950 the node returned in N had no Parent. The caller continued
4951 processing of this orphaned node. In some cases that caused a
4952 crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
4953 and trips over the Empty Parent). The solution is to make N an
4954 'in' parameter. Instead of rewriting it, return the list of
4955 post-call actions, so the caller can do the rewriting later,
4956 after N has been fully processed.
4957 (Expand_Call_Helper): Move most of Expand_Call here. It has
4958 too many premature 'return' statements, and we want to do the
4959 rewriting on return.
4960 (Insert_Post_Call_Actions): New procedure to insert the post-call
4961 actions in the appropriate place. In the problematic case,
4962 that involves rewriting N as an Expression_With_Actions.
4963 (Expand_Call): Call the new procedures Expand_Call_Helper and
4964 Insert_Post_Call_Actions.
4966 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4968 * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
4969 properly type derived from generic formal types, to handle
4970 properly modified version of ACATS 4.1B B611017.
4972 2017-04-25 Javier Miranda <miranda@adacore.com>
4974 * exp_unst.adb (Subp_Index): Adding missing
4975 support for renamings and functions that return a constrained
4976 array type (i.e. functions for which the frontend built a
4977 procedure with an extra out parameter).
4979 2017-04-25 Pascal Obry <obry@adacore.com>
4981 * s-string.adb: Minor code clean-up.
4983 2017-04-25 Bob Duff <duff@adacore.com>
4985 * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
4987 * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
4988 function for Non_Blocking_Wait_Process.
4990 2017-04-25 Bob Duff <duff@adacore.com>
4992 * prep.adb (Preprocess): Remove incorrect
4993 Assert. Current character can be ASCII.CR.
4995 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4997 * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
4998 convention Stdcall, which has a number of exceptions. Convention
4999 is legal on a component declaration whose type is an anonymous
5000 access to subprogram.
5002 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5004 * sem_ch4.adb: sem_ch4.adb Various reformattings.
5005 (Try_One_Prefix_Interpretation): Use the base type when dealing
5006 with a subtype created for purposes of constraining a private
5007 type with discriminants.
5009 2017-04-25 Javier Miranda <miranda@adacore.com>
5011 * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
5012 * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
5013 dispatching primitives (Restore_Warnings): Restore warning on
5014 late dispatching primitives (Save_Warnings): Save warning on late
5015 dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
5016 to enable/disable this warning.
5017 (WA_Warnings): Set warning on late dispatching primitives.
5018 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
5019 that its parent type has a private extension.
5020 * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
5022 * usage.adb: Document -gnatw.j and -gnatw.J.
5024 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5026 * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
5029 2017-04-25 Bob Duff <duff@adacore.com>
5031 * binde.adb (Validate): Do not pass dynamic strings
5032 to pragma Assert, because older compilers do not support that.
5034 2017-04-25 Bob Duff <duff@adacore.com>
5036 * s-fileio.adb (Close): When a temp file is
5037 closed, delete it and clean up its Temp_File_Record immediately,
5038 rather than waiting until later.
5039 (Temp_File_Record): Add File
5040 component, so Close can know which Temp_File_Record corresponds
5041 to the file being closed.
5042 (Delete): Don't delete temp files,
5043 because they are deleted by Close.
5044 (Open): Set the File component
5045 of Temp_File_Record. This requires moving the creation of the
5046 Temp_File_Record to the end, after the AFCB has been created.
5048 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5050 * checks.adb (Insert_Valid_Check): Do not generate
5051 a validity check when inside a generic.
5053 2017-04-25 Yannick Moy <moy@adacore.com>
5055 * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
5057 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5059 * snames.ads-tmpl (Snames): More names for detecting predefined
5060 potentially blocking subprograms.
5062 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5064 * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
5065 concerning inheritance of class-wide preconditions do not apply
5068 2017-04-25 Bob Duff <duff@adacore.com>
5070 * s-ficobl.ads: Minor comment fix.
5072 2017-04-25 Yannick Moy <moy@adacore.com>
5074 * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
5075 conversions from float to integer in GNATprove mode.
5076 (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
5077 to call Apply_Type_Conversion_Checks, so that range checks
5078 are properly positioned when needed on conversions, including
5079 when converting from float to integer. (Determine_Range): In
5080 GNATprove mode, take into account the possibility of conversion
5081 from float to integer.
5082 * sem_res.adb (Resolve_Type_Conversion): Only enforce range
5083 check on conversions from fixed-point to integer, not anymore
5084 on conversions from floating-point to integer, when in GNATprove
5087 2017-04-25 Yannick Moy <moy@adacore.com>
5089 * checks.adb (Determine_Range_R): Special case type conversions
5090 from integer to float in order to get bounds in that case too.
5091 * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
5092 mode, for computations involved in interval checking.
5094 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5096 * checks.adb (Insert_Valid_Check): Partially reimplement validity
5098 * einfo.adb Node36 is now used as Validated_Object.
5099 (Validated_Object): New routine.
5100 (Set_Validated_Object): New routine.
5101 (Write_Field36_Name): Add an entry for Validated_Object.
5102 * einfo.ads Add new attribute Validated_Object along with
5104 (Validated_Object): New routine along with pragma Inline.
5105 (Set_Validated_Object): New routine along with pragma Inline.
5106 * exp_attr.adb (Make_Range_Test): Add processing for validation
5107 variables to avoid extra reads and copies of the prefix.
5108 * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
5109 variables in order to reflect any changes done in the variable
5110 back into the original object.
5111 * sem_util.adb (Is_Validation_Variable_Reference): New routine.
5112 * sem_util.ads (Is_Validation_Variable_Reference): New routine.
5114 2017-04-25 Steve Baird <baird@adacore.com>
5116 * exp_ch7.adb (Build_Array_Deep_Procs,
5117 Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
5118 generate Finalize_Address routines for CodePeer.
5120 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5122 * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
5123 Analyze_Pre_Post_Condition, to implement the legality checks
5124 mandated by AI12-0131: Pre'Class shall not be specified for an
5125 overriding primitive subprogram of a tagged type T unless the
5126 Pre'Class aspect is specified for the corresponding primitive
5127 subprogram of some ancestor of T.
5129 2017-04-25 Bob Duff <duff@adacore.com>
5131 * sem_ch8.adb (Use_One_Type): If a use_type_clause
5132 is redundant, set its Used_Operations to empty. This is only
5133 necessary for use clauses that appear in the parent of a generic
5134 child unit, because those use clauses get reanalyzed when we
5135 instantiate the generic, and we don't want the Used_Operations
5136 carried over from the original context (where it was probably
5139 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5141 * exp_ch6.adb: Minor reformatting.
5143 2017-04-25 Bob Duff <duff@adacore.com>
5145 * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
5146 Use Source_Index (Current_Sem_Unit) to find the correct casing.
5147 * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
5148 (Current_Sem_Unit) to find the correct casing.
5149 * par.adb (Par): Null out Current_Source_File, to ensure that
5150 the above bugs won't rear their ugly heads again.
5152 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5154 * sem_ch8.adb (Find_Type): For an attribute reference
5155 'Class, if prefix type is synchronized and previous errors
5156 have suppressed the creation of the corresponding record type,
5157 create a spurious class-wide for the synchonized type itself,
5158 to catch other misuses of the attribute
5160 2017-04-25 Steve Baird <baird@adacore.com>
5162 * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
5163 is True, then don't generate the accessibility check for the
5164 tag of a tagged result.
5165 * exp_intr.adb (Expand_Dispatching_Constructor_Call):
5166 if CodePeer_Mode is True, then don't generate the
5167 tag checks for the result of call to an instance of
5168 Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
5169 descendant of" check and the accessibility check).
5171 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5173 * sem_ch13.adb: Code cleanups.
5174 * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
5175 * sem_ch8.ads: Minor comment fix.
5177 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5179 * exp_ch4.adb (Library_Level_Target): New function.
5180 (Expand_Concatenate): When optimization is enabled, also expand
5181 the operation out-of-line if the concatenation is present within
5182 the expression of the declaration of a library-level object and
5183 not only if it is the expression of the declaration.
5185 2017-04-25 Bob Duff <duff@adacore.com>
5187 * freeze.adb (Freeze_Object_Declaration): Do
5188 not Remove_Side_Effects if there is a pragma Linker_Section,
5189 because in that case we want static initialization in the
5190 appropriate section.
5192 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5194 * exp_dbug.adb: Minor rewording and reformatting.
5196 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5198 * sem_attr.adb (Statically_Denotes_Object): New predicate, to
5199 handle the proposed changes to rules concerning potentially
5200 unevaluated expressions, to include selected components that
5201 do not depend on discriminants, and indexed components with
5203 * sem_util.adb (Is_Potentially_Unevaluated): Add check for
5204 predicate in quantified expression, and fix bugs in the handling
5205 of case expressions and membership test.
5206 (Analyze_Attribute_Old_Result): use new predicate.
5207 (Analyze_Attribute, case Loop_Entry): ditto.
5209 2017-04-25 Bob Duff <duff@adacore.com>
5211 * s-secsta.adb (SS_Info): Add a comment
5212 explaining why we don't need to walk all the chunks in order to
5213 compute the total size.
5215 2017-04-25 Bob Duff <duff@adacore.com>
5217 * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
5218 of the global name buffer to 4*Max_Line_Length.
5220 2017-04-25 Javier Miranda <miranda@adacore.com>
5222 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
5223 renaming entity for debug information, mark the entity as needing debug
5224 info if it comes from sources.
5226 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5228 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
5229 restriction converning the use of 'Address where the prefix is
5230 of a controlled type.
5232 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
5234 * exp_dbug.adb: In Debug_Renaming_Declaration,
5235 skip slices that are made redundant by an indexed component
5237 * atree.h: New definition for Original_Node.
5239 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5241 * sem_prag.adb, sem_prag.ads: Minor reformatting.
5243 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5245 * sem_ch3.adb (Check_Entry_Contract): Call
5246 Preanalyze_Spec_Expression so that resolution takes place as well.
5247 * sem_util.adb (Check_Internal_Protected_Use): Reject properly
5248 internal calls that appear in preconditions of protected
5249 operations, in default values for same, and in contract guards
5250 for contract cases in SPARK.
5252 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5254 * a-numaux.ads: Fix description of a-numaux-darwin
5256 (Double): Define to Long_Float.
5257 * a-numaux-vxworks.ads (Double): Likewise.
5258 * a-numaux-darwin.ads
5260 * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
5261 * a-numaux-x86.ads: Fix package description.
5262 * a-numaux-x86.adb (Is_Nan): Minor tweak.
5263 (Reduce): Adjust and complete description. Call Is_Nan instead of
5264 testing manually. Use an integer temporary to hold rounded value.
5265 * a-numaux-darwin.adb (Reduce): Likewise.
5266 (Is_Nan): New function.
5268 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5270 * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
5271 on analysis of prefix whose type is a current instance of a
5272 synchronized type, but where the prefix itself is an entity that
5275 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5277 * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
5278 the identity of callable entities therein, because they have been
5279 properly resolved, and prefixed calls may have been rewritten
5282 2017-04-25 Patrick Bernardi <bernardi@adacore.com>
5284 * exp_ch3.adb (Build_Init_Statements): Convert
5285 the expression of the pragma/aspect Secondary_Stack_Size to
5286 internal type System.Parameters.Size_Type before assigning
5287 it to the Secondary_Stack_Size component of the task type's
5288 corresponding record.
5290 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5292 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
5293 (etc) optimizations when the type is modular and the offsets
5296 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5298 * s-osinte-freebsd.ads: Minor comment tweaks
5300 2017-04-25 Javier Miranda <miranda@adacore.com>
5302 * urealp.adb (UR_Write): Reverse previous patch
5303 adding documentation on why we generate multiplications instead
5304 of divisions (needed to avoid expressions whose computation with
5305 large numbers may cause division by 0).
5307 2017-04-25 Bob Duff <duff@adacore.com>
5309 * erroutc.adb (Set_Specific_Warning_Off,
5310 Set_Warnings_Mode_Off): Use the correct source file for
5311 Stop. Was using Current_Source_File, which is only valid during
5312 parsing. Current_Source_File will have a leftover value from
5313 whatever file happened to be parsed last, because of a with_clause
5316 2017-04-25 Bob Duff <duff@adacore.com>
5318 * lib.ads, lib.adb (In_Internal_Unit): New functions similar
5319 to In_Predefined_Unit, but including GNAT units.
5320 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
5321 with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
5322 because Should_Ignore_Pragma was not working reliably outside
5323 the parser, because Current_Source_File is not valid.
5324 * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
5325 * par-prag.adb: Call Should_Ignore_Pragma_Par.
5327 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5329 * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
5332 2017-04-25 Javier Miranda <miranda@adacore.com>
5334 * urealp.adb (UR_Write): Fix output of constants with a base other
5337 2017-04-25 Justin Squirek <squirek@adacore.com>
5339 * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
5340 * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
5341 Add extra parameter for Process_Interface_Name.
5342 (Process_Interface_Name): Add parameter for pragma to analyze
5343 corresponding aspect.
5344 * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
5347 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5349 * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
5352 2017-04-25 Yannick Moy <moy@adacore.com>
5354 * sem_res.adb (Resolve_Comparison_Op): Do not
5355 attempt evaluation of relational operations inside assertions.
5357 2017-04-25 Justin Squirek <squirek@adacore.com>
5359 * exp_util.adb (Add_Interface_Invariants):
5360 Restored, code moved back from Build_Invariant_Procedure_Body.
5361 (Add_Parent_Invariants): Restored, code moved back from
5362 Build_Invariant_Procedure_Body.
5363 (Build_Invariant_Procedure_Body):
5364 Remove refactored calls and integrated code from
5365 Add_Parent_Invariants and Add_Interface_Invariants.
5367 2017-04-25 Johannes Kanig <kanig@adacore.com>
5369 * errout.adb (Output_Messages): Adjust computation of total
5371 * erroutc.adb (Error_Msg): In statistics counts, deal
5372 correctly with informational messages that are not warnings.
5373 * errutil.adb (Finalize): adjust computation of total errors.
5375 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5377 * terminals.c (__gnat_terminate_pid): New.
5378 * g-exptty.ads (Terminate_Process): New. Update comments.
5380 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5382 * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
5384 2017-04-25 Justin Squirek <squirek@adacore.com>
5386 * sem_ch3.adb (Analyze_Declarations): Minor
5387 correction to comments, move out large conditional and scope
5388 traversal into a predicate.
5389 (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
5392 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5394 * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
5395 of prefix whose type is a current instance of a synchronized
5396 type. If the prefix is an object this is an external call (or
5397 requeue) that can only access public operations of the object. The
5398 previous predicate was too restrictive, and did not allow public
5399 protected operations, only task entries.
5401 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5403 * sem_ch5.adb, fname.adb: Minor reformatting.
5405 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5407 * einfo.adb (Is_Anonymous_Access_Type): New routine.
5408 * einfo.ads Update the placement of
5409 E_Anonymous_Access_Subprogram_Type along with all subtypes that
5411 (Is_Anonymous_Access_Type): New routine.
5412 * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
5413 master for an access type subject to pragma No_Heap_Finalization.
5414 * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
5415 allocated or deallocated does not finalization actions if the
5416 associated access type is subject to pragma No_Heap_Finalization.
5417 * opt.ads Add new global variable No_Heap_Finalization_Pragma.
5418 * par-prag.adb Pragma No_Heap_Finalization does not need special
5419 processing from the parser.
5420 * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
5421 ??? comments. Use the new predicate Is_Anonymous_Access_Type.
5422 * sem_prag.adb Add an entry in table Sig_Flags for pragma
5423 No_Heap_Finalization.
5424 (Analyze_Pragma): Add processing for
5425 pragma No_Heap_Finalization. Update various error messages to
5426 use Duplication_Error.
5427 * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
5428 * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
5429 and corresponding pragma id.
5431 2017-04-25 Bob Duff <duff@adacore.com>
5433 * freeze.adb (Freeze_Record_Type): Use the
5434 underlying type of the component type to determine whether it's
5435 elementary. For representation clause purposes, a private type
5436 should behave the same as its full type.
5437 * fname.ads, fname.adb (Is_Predefined_File_Name):
5438 Make sure things like "system.ali" are recognized as predefined.
5440 2017-04-25 Javier Miranda <miranda@adacore.com>
5442 * debug.adb: Update documentation of -gnatd.6.
5444 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5446 * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
5447 element iterator when the name is an overloaded function call,
5448 one of whose interpretations yields an array.
5450 2017-04-25 Bob Duff <duff@adacore.com>
5452 * uname.ads, uname.adb (Is_Predefined_Unit_Name,
5453 Is_Internal_Unit_Name): New functions for operating on unit
5454 names, as opposed to file names. There's some duplicated code
5455 with fname.adb, which is unfortunate, but it seems like we don't
5456 want to add dependencies here.
5457 * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
5458 to Is_Predefined_Unit_Name; the former was wrong, because Uname
5459 is not a file name at all.
5460 * fname.ads, fname.adb: Document the fact that
5461 Is_Predefined_File_Name and Is_Internal_File_Name can be called
5462 for ALI files, and fix the code so it works properly for ALI
5463 files. E.g. these should return True for "system.ali".
5465 2017-04-25 Justin Squirek <squirek@adacore.com>
5467 * exp_util.adb (Add_Invariant): Removed,
5468 code moved to Add_Invariant_Check, Add_Inherited_Invariant,
5469 and Add_Own_Invariant. (Add_Invariant_Check): Used
5470 for adding runtime checks from any kind of invariant.
5471 (Add_Inherited_Invariant): Generates invariant checks for
5472 class-wide invariants (Add_Interface_Invariants): Removed, code
5473 moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
5474 Create a types own invariant procedure (Add_Parent_Invariants):
5475 Removed, code moved to Build_Invariant_Procedure_Body
5476 (Build_Invariant_Procedure_Body): Add refactored calls
5477 and integrated code from Add_Parent_Invariants and
5478 Add_Interface_Invariants.
5479 (Process_Type): Removed, the
5480 relavant code was inlined into both Add_Own_Invariant and
5481 Add_Inherited_Invariant.
5483 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5485 * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
5486 scn.adb, osint.adb, fname.adb: Minor reformatting.
5488 2017-04-25 Pascal Obry <obry@adacore.com>
5490 * s-taprop-mingw.adb: Do not check for CloseHandle in
5493 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5495 * sem_util.adb (Check_Part_Of_Reference):
5496 Continue to examine the context if the reference appears within
5497 an expression function.
5499 2017-04-25 Justin Squirek <squirek@adacore.com>
5501 * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
5502 and Build_Invariant_Procedure_Declaration.
5503 * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
5504 and Build_Invariant_Procedure_Declaration from exp_ch7
5505 and break-out Is_Untagged_Private_Derivation from
5506 Build_Invariant_Procedure_Body.
5507 (Replace_Type_References):
5508 Append an extra parameter to allow for dispatching replacements
5509 and add the corrasponding logic.
5510 (Type_Invariant): Remove
5511 Replace_Typ_Refs and replace its references with calls to
5512 Replace_Type_References.
5513 * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
5515 2017-04-25 Bob Duff <duff@adacore.com>
5517 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
5518 that returns True when appropriate.
5519 * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
5520 when compiling predefined files.
5521 * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
5522 "gnat.adc" should not be considered a predefined file name.
5523 That required (or at least encouraged) a lot of cleanup of global
5524 variable usage. We shouldn't be communicating information via
5525 the global name buffer.
5526 * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
5527 * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
5528 required by the above-mentioned cleanup.
5530 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5532 * osint.adb (Find_File): Handle properly a request for a
5533 configuration file whose name is a directory.
5535 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5537 * sem_attr.adb, sem_ch5.adb: Minor reformatting.
5539 2017-04-25 Bob Duff <duff@adacore.com>
5541 * types.ads: Minor: Fix '???' comment.
5542 * sem_ch8.adb: Minor comment fix.
5544 2017-04-25 Bob Duff <duff@adacore.com>
5546 * sem_prag.adb: Remove suspicious uses of Name_Buf.
5547 * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
5548 Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
5549 Add String_To_Name with no side effects.
5551 2017-04-25 Justin Squirek <squirek@adacore.com>
5553 * sem_ch3.adb (Analyze_Declarations): Add
5554 additional condition for edge case.
5556 2017-04-25 Bob Duff <duff@adacore.com>
5558 * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
5559 reserved words inside pragmas. This is necessary to allow the
5560 pragma name Interface to be used in pragma Ignore_Pragma.
5561 * par.adb: Minor comment fix.
5563 2017-04-25 Javier Miranda <miranda@adacore.com>
5565 * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
5566 * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
5567 * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
5568 * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
5569 occurrences of RE_Type_Is_Abstract
5571 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5573 * exp_util.adb (Build_Chain): Account for ancestor
5574 subtypes while traversing the derivation chain.
5576 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5578 * sem_attr.adb: minor reformatting.
5580 2017-04-25 Doug Rupp <rupp@adacore.com>
5582 * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
5584 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5586 * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
5587 the first pass over an assignment statement with target names,
5588 to prevent the generation of subtypes (such as discriminated
5589 record components)that may carry the target name outside of the
5590 tree for the assignment. The subtypes will be generated when
5591 the assignment is reanalyzed in full.
5592 (Analyze_Target_Name): Handle properly class-wide types.
5594 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5596 * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
5597 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5598 the purposes of freezing.
5599 * exp_util.adb Update the documentation and structure of the
5600 type map used in class-wide semantics of assertion expressions.
5601 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5602 and resolve the triaged expression because all substitutions
5603 refer to the proper entities. Update the replacement of
5605 (Build_DIC_Procedure_Body): Add formal parameter
5606 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5607 are now only processed when freezing occurs. Build a body only
5609 (Entity_Hash): Removed.
5610 (Map_Types): New routine.
5611 (Replace_Object_And_Primitive_References): Removed.
5612 (Replace_References): New routine.
5613 (Replace_Type_References): Moved to the library level of Exp_Util.
5614 (Type_Map_Hash): New routine.
5615 (Update_Primitives_Mapping): Update the mapping call.
5616 (Update_Primitives_Mapping_Of_Types): Removed.
5617 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5618 parameter For_Freeze and update the comment on usage.
5619 (Map_Types): New routine.
5620 (Replace_References): New routine.
5621 (Replace_Type_References): Moved to the library level of Exp_Util.
5622 (Update_Primitives_Mapping_Of_Types): Removed.
5623 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
5624 properties of the private type to the full view in case the full
5625 view derives from a parent type and inherits a DIC pragma.
5626 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
5627 DIC pragma is placed at the top of a declarative region.
5629 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5631 * a-tasatt.adb: Complete previous change and use an unsigned
5632 int to avoid overflow checks.
5634 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5636 * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
5637 the error message when the attribute reference is an actual in
5638 a call to a subprogram inherited from a generic formal type with
5639 unknown discriminants, which makes the subprogram and its formal
5640 parameters intrinsic (see RM 6.3.1 (8) and (13)).
5642 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5644 * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
5645 sem_prag.adb: Minor reformatting.
5647 2017-04-25 Bob Duff <duff@adacore.com>
5649 * sem_attr.adb (Type_Key): Add code in the
5650 recursive Compute_Type_Key to protect against fetching the source
5651 code for Standard, in case a component of the type is declared
5652 in Standard. There was already code to do this for the original
5653 type, but not for its components.
5655 2017-04-25 Javier Miranda <miranda@adacore.com>
5657 * exp_ch3.adb (Build_Initialization_Call): Handle
5658 subtypes of private types when searching for the underlying full
5659 view of a private type.
5661 2017-04-25 Javier Miranda <miranda@adacore.com>
5663 * sem_res.adb (Set_Mixed_Mode_Operand): A universal
5664 real conditional expression can appear in a fixed-type context
5665 and must be resolved with that context to facilitate the code
5666 generation to the backend.
5668 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5670 * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
5671 to indicate whether during inline processing, when some unit U1
5672 appears in the context of a unit U2 compiled for instantiation
5673 or inlining purposes, the body of U1 needs to be compiled as well.
5674 * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
5675 context is a package declaration.
5676 * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
5677 Analyze_Generic_Package_Declaration): ditto.
5678 * inline.adb (Analyze_Inlined_Bodies): Check
5679 Body_Needed_For_Inlining.
5681 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5683 * par.adb (Current_Assign_Node): Global variable use to record
5684 the presence of a target_name in the right hand side of the
5685 assignment being parsed.
5686 * par-ch4.adb (P_Name): If the name is a target_name, mark the
5687 enclosing assignment node accordingly.
5688 * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
5690 * sem_ch5.adb (Analyze_Assignment): Disable expansion before
5691 analyzing RHS if the statement has target_names.
5692 * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
5693 properly choices that are subtype marks.
5694 * exp_ch5.adb: Code cleanup.
5696 2017-04-25 Bob Duff <duff@adacore.com>
5698 * s-memory.adb: Add a comment regarding efficiency.
5699 * atree.adb: Fix the assertion, and combine 2 assertions into one,
5700 "the source has an extension if and only if the destination does."
5701 * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
5703 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5705 * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
5708 2017-04-25 Doug Rupp <rupp@adacore.com>
5710 * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
5711 handling for ppc64-vx7.
5712 * sigtramp-vxworks-target.inc
5713 [SIGTRAMP_BODY]: Add section for ppc64-vx7.
5715 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5717 * ada_get_targ.adb: New file.
5719 2017-04-25 Bob Duff <duff@adacore.com>
5721 * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
5722 Direct_Val (Right), instead of the incorrect Direct_Val (Left).
5723 (UI_GCD): Remove ??? comment involving possible efficiency
5724 improvements. This just isn't important after all these years.
5726 * uintp.ads: Minor cleanup.
5728 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5730 * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
5731 Revert previous changes.
5732 * scng.adb: Minor reformatting.
5733 * s-stratt.ads: Fix unbalanced parens in comment.
5735 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5737 * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
5740 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5742 * scng.adb (Scan): Handle '@' appropriately.
5743 * sem_ch5.adb: Code cleanup.
5745 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5747 * freeze.adb (Check_Expression_Function): Do not check for the
5748 use of deferred constants if the freezing of the expression
5749 function is triggered by its generated body, rather than a
5752 2017-04-25 Javier Miranda <miranda@adacore.com>
5754 * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
5755 subtypes of private types when performing the view conversion.
5757 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5759 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5760 the purposes of freezing.
5761 * exp_util.adb Update the documentation and structure of the
5762 type map used in class-wide semantics of assertion expressions.
5763 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5764 and resolve the triaged expression because all substitutions
5765 refer to the proper entities. Update the replacement of
5767 (Build_DIC_Procedure_Body): Add formal parameter
5768 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5769 are now only processed when freezing occurs. Build a body only
5771 (Entity_Hash): Removed.
5772 (Map_Types): New routine.
5773 (Replace_Object_And_Primitive_References): Removed.
5774 (Replace_References): New routine.
5775 (Replace_Type_References): Moved to the library level of Exp_Util.
5776 (Type_Map_Hash): New routine.
5777 (Update_Primitives_Mapping): Update the mapping call.
5778 (Update_Primitives_Mapping_Of_Types): Removed.
5779 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5780 parameter For_Freeze and update the comment on usage.
5781 (Map_Types): New routine.
5782 (Replace_References): New routine.
5783 (Replace_Type_References): Moved to the library level of Exp_Util.
5784 (Update_Primitives_Mapping_Of_Types): Removed.
5785 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
5786 properties of the private type to the full view in case the full
5787 view derives from a parent type and inherits a DIC pragma.
5788 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
5789 DIC pragma is placed at the top of a declarative region.
5791 2017-04-25 Tristan Gingold <gingold@adacore.com>
5793 * s-mmap.ads (Data): Add pragma Inline.
5795 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5797 * checks.adb (Insert_Valid_Check): Do not use
5798 a renaming to alias a volatile name because this will lead to
5799 multiple evaluations of the volatile name. Use a constant to
5800 capture the value instead.
5802 2017-04-25 Doug Rupp <rupp@adacore.com>
5804 * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
5806 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5808 * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
5809 Add out parameter to indicate to caller that a wrapper must
5810 be constructed for an inherited primitive whose inherited
5811 pre/postcondition has called to overridden primitives.
5812 * freeze.adb (Check_Inherited_Conditions): Build wrapper body
5813 for inherited primitive that requires it.
5814 * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
5815 legal primitive operations and belong to the list of bodies
5816 generated after the freeze point of a type.
5817 * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
5818 of Build_Class_Wide_Expression.
5819 * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
5820 to construct the specification of the wrapper subprogram created
5821 for an inherited operation.
5823 2017-04-25 Bob Duff <duff@adacore.com>
5825 * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
5826 pthread_mutexattr_setprioceiling): Add new interfaces for these
5828 * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
5829 protocols as appropriate for Locking_Policy 'C' and 'I'.
5830 * s-taprop-posix.adb: Minor reformatting to make it more similar
5831 to s-taprop-linux.adb.
5833 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5835 * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
5836 Handle properly a multi- level derivation involving both renamed
5837 and constrained parent discriminants, when the type to be
5838 constrained has fewer discriminants that the ultimate ancestor.
5840 2017-04-25 Bob Duff <duff@adacore.com>
5842 * sem_util.adb (Is_Object_Reference): In the
5843 case of N_Explicit_Dereference, return False if it came from a
5844 conditional expression.
5846 2017-04-25 Bob Duff <duff@adacore.com>
5848 * par-ch4.adb (P_Case_Expression): If a semicolon
5849 is followed by "when", assume that ";" was meant to be ",".
5851 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5853 * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
5856 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5858 * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
5859 loading of an entity.
5860 * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
5861 previously repeated in the analysis.
5862 * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
5863 procedure SPARK_Implicit_Load. (Analyze_Task_Type_Declaration):
5864 use new procedure SPARK_Implicit_Load.
5865 * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
5866 SPARK_Implicit_Load.
5868 2017-04-25 Javier Miranda <miranda@adacore.com>
5870 * sem_util.adb (New_Copy_Tree): By default
5871 copying of defining identifiers is prohibited because
5872 this would introduce an entirely new entity into the
5873 tree. This patch introduces an exception to this general
5874 rule: the declaration of constants and variables located in
5875 Expression_With_Action nodes.
5876 (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
5877 (In_Map): New subprogram.
5878 (Visit_Entity): New subprogram.
5879 (Visit_Node): Handle EWA_Level,
5880 EWA_Inner_Scope_Level, and take care of defining entities defined
5881 in Expression_With_Action nodes.
5883 2017-04-25 Thomas Quinot <quinot@adacore.com>
5885 * exp_ch6.adb: minor comment edit.
5886 * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
5887 procedure specifications that come from source.
5888 * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
5889 Null_Statement attribute.
5890 * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
5891 procedure, generate statement SCO for the generated NULL statement.
5892 * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
5893 parser, if available.
5895 2017-04-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
5897 * system-linux-s390.ads: Use Long_Integer'Size to define
5900 2017-04-04 Eric Botcazou <ebotcazou@adacore.com>
5902 * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
5904 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
5906 * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
5907 * g-socket.adb (To_Host_Entry): Fix typo in comment.
5908 * gnat_ugn.texi: Fix typo.
5909 * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
5910 * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
5911 * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
5912 * sem_util.adb (Mark_Coextensions): Likewise.
5913 * sem_util.ads (Available_Full_View_Of_Component): Likewise.
5915 2017-03-28 Andreas Schwab <schwab@suse.de>
5918 * system-linux-aarch64-ilp32.ads: New file.
5919 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
5920 from LIBGNAT_TARGET_PAIRS.
5921 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
5922 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
5923 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
5924 or -mabi=ilp32, resp.
5926 2017-03-14 James Cowgill <James.Cowgill@imgtec.com>
5928 * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
5930 2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
5933 * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
5935 2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
5938 * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
5940 * system-linux-arm.ads (Default_Bit_Order): Likewise.
5941 * system-linux-mips.ads (Default_Bit_Order): Likewise.
5942 * system-linux-armeb.ads: Delete.
5943 * system-linux-mipsel.ads: Likewise.
5944 * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
5945 (ARM/Linux): Likewise.
5947 2017-02-24 Jakub Jelinek <jakub@redhat.com>
5950 * gcc-interface/misc.c (gnat_handle_option): Pass true to
5951 handle_generated_option GENERATED_P.
5953 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5955 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
5956 around a justified modular type if it doesn't have the same scalar
5957 storage order as the enclosing record type.
5959 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5961 * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
5962 of boolean rvalues to function calls.
5964 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5966 * gcc-interface/utils.c (fold_bit_position): New function.
5967 (rest_of_record_type_compilation): Call it instead of bit_position to
5968 compute the field position and remove the call to remove_conversions.
5969 (compute_related_constant): Factor out the multiplication in both
5970 operands, if any, and streamline the final test.
5972 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5974 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
5976 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5978 * gcc-interface/decl.c: Include demangle.h.
5979 (is_cplusplus_method): Return again true for a primitive operation
5980 only if it is dispatching. For a subprogram with an interface name,
5981 call the demangler to get the number of C++ parameters and compare it
5982 with the number of Ada parameters.
5984 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5986 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
5987 there is no end label, put the location of the At_End procedure on
5988 the call to the procedure.
5990 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5992 * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
5993 value for array types with TYPE_INDEX_TYPE set on their domain type.
5994 * gcc-interface/utils.c (max_size): For operations and expressions, do
5995 not build a new node if the operands have not changed or are missing.
5997 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
5999 * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
6000 argument when recursing on TRUTH_NOT_EXPR.
6002 2017-02-12 John Marino <gnugcc@marino.st>
6004 * system-freebsd-x86.ads: Rename into...
6005 * system-freebsd.ads: ...this.
6006 (Default_Bit_Order): Define using Standard'Default_Bit_Order.
6007 * gcc-interface/Makefile.in: Support aarch64-freebsd.
6008 (x86-64/FreeBSD): Adjust to above renaming.
6009 (i386/FreeBSD): Likewise.
6011 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
6013 * comperr.adb: Update FSF bug reporting URL.
6015 2017-02-01 Eric Botcazou <ebotcazou@adacore.com>
6016 Jakub Jelinek <jakub@redhat.com>
6019 * adaint.c (__gnat_killprocesstree): Fix broken string handling.
6021 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
6024 * gcc-interface/utils.c (get_global_context): Pass main_input_filename
6025 to build_translation_unit_decl.
6027 2017-01-23 Javier Miranda <miranda@adacore.com>
6029 * sem_util.adb (New_Copy_Tree): Code cleanup:
6030 removal of the internal map (ie. variable Actual_Map, its
6031 associated local variables, and all the code handling it).
6032 * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
6033 force loading of the System package when processing a task type.
6034 (Analyze_Protected_Type_Declaration): in GNATprove mode force
6035 loading of the System package when processing a protected type.
6036 * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
6037 force loading of the System package when processing compilation
6038 unit with a main-like subprogram.
6039 * frontend.adb (Frontend): remove forced loading of the System
6042 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6044 * sem_prag.adb (Default_Initial_Condition): If the desired type
6045 declaration is a derived type declaration with discriminants,
6046 it is rewritten as a private type declaration.
6047 * sem_ch13.adb (Replace_Type_References_Generic,
6048 Visible_Component): A discriminated private type with descriminnts
6049 has components that must be rewritten as selected components
6050 if they appear as identifiers in an aspect expression such as
6051 a Default_Initial_Condition.
6052 * sem_util.adb (Defining_Entity): support N_Iterator_Specification
6055 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6057 * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
6058 * gnat1drv.adb Generate an empty object file for an ignored
6059 Ghost compilation unit.
6060 * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
6062 2017-01-23 Yannick Moy <moy@adacore.com>
6064 * sem_ch4.adb (Analyze_Indexed_Component_Form):
6065 Adapt to inlined prefix with string literal subtype.
6066 * inline.adb (Expand_Inlined_Call): Keep unchecked
6067 conversion inside inlined call when formal type is constrained.
6069 2017-01-23 Javier Miranda <miranda@adacore.com>
6071 * sem_util.adb (New_Copy_Tree): Code cleanup:
6072 removal of global variables. All the global variables, global
6073 functions and tables of this subprogram are now declared locally.
6075 2017-01-23 Gary Dismukes <dismukes@adacore.com>
6077 * exp_strm.ads: Minor reformatting and typo fixes.
6079 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6081 * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
6082 exp_aggr.adb: Minor reformatting.
6083 * g-diopit.adb: minor grammar/punctuation fix in comment.
6084 * g-byorma.ads: minor fix of unbalanced parens in comment.
6086 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6088 * par.adb: Update the documentation of component Labl.
6089 * par-ch6.adb (P_Return_Statement): Set the expected label of
6090 an extended return statement to Error.
6092 2017-01-23 Tristan Gingold <gingold@adacore.com>
6094 * s-boustr.ads, s-boustr.adb (Is_Full): New function.
6096 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6098 * expander.adb: Handle N_Delta_Aggregate.
6100 2017-01-23 Javier Miranda <miranda@adacore.com>
6102 * exp_ch6.adb (Expand_Call): Improve the code that
6103 checks if some formal of the called subprogram is a class-wide
6104 interface, to handle subtypes of class-wide interfaces.
6106 2017-01-23 Javier Miranda <miranda@adacore.com>
6108 * checks.adb (Apply_Parameter_Aliasing_Checks):
6109 Remove side effects of the actuals before generating the overlap
6112 2017-01-23 Justin Squirek <squirek@adacore.com>
6114 * exp_strm.ads, exp_strm.ads
6115 (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
6116 as to avoid getting the underlying type by default.
6117 * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
6118 underlying type in the Iiput and output attribute cases when
6119 building their respective functions.
6121 2017-01-23 Gary Dismukes <dismukes@adacore.com>
6123 * scng.adb: Minor reformatting of error message.
6125 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6127 * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
6128 to freeze the return type of an expression funxtion that is a
6129 completion, if the type is a limited view and the non-limited
6132 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6134 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
6135 aggregate construct.
6136 (P_Record_Or_Array_Component_Association): An array aggregate
6137 can start with an Iterated_Component_Association.
6138 * scng.adb: Modify error message on improper use of @ in earlier
6139 versions of the language.
6140 * sinfo.ads: New node kind N_Delta_Aggregate.
6141 * sinfo.adb: An N_Delta_Aggregate has component associations and
6143 * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
6144 * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
6145 Create a new index for each one of the choices in the association,
6146 to prevent spurious homonyms in the scope.
6147 (Resolve_Delta_Aggregate): New.
6148 * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
6149 * exp_util.adb (Insert_Actions): Take into account
6151 * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
6152 * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
6153 and local procedures Expand_Delta_Array_Aggregate and
6154 expand_Delta_Record_Aggregate.
6155 * sprint.adb: Handle N_Delta_Aggregate.
6157 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6159 * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
6160 empty name when the exception declaration is subject to pragma
6162 (Null_String): New routine.
6164 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6166 * par-ch9.adb (P_Protected_Definition): Parse
6167 any optional and potentially illegal pragmas which appear in
6168 a protected operation declaration list.
6169 (P_Task_Items): Parse
6170 any optional and potentially illegal pragmas which appear in a
6173 2017-01-23 Pascal Obry <obry@adacore.com>
6175 * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
6176 is needed when a foreign thread call a Win32 API using a thread handle
6177 like GetThreadTimes() for example.
6179 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6181 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6182 allow an 'Address clause to be specified on a prefix of a
6185 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6187 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6188 attribute 'Valid is a renaming of the original expression when
6189 the expression denotes a name. For all other kinds of expression,
6190 use a constant to capture the value.
6191 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6192 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6194 2017-01-23 Justin Squirek <squirek@adacore.com>
6196 * sem_eval.adb (Eval_Integer_Literal): Add special
6197 case to avoid optimizing out check if the literal appears in
6200 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6202 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6203 allow an 'Address clause to be specified on a prefix of a
6206 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6208 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6209 attribute 'Valid is a renaming of the original expression when
6210 the expression denotes a name. For all other kinds of expression,
6211 use a constant to capture the value.
6212 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6213 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6215 2017-01-23 Justin Squirek <squirek@adacore.com>
6217 * sem_eval.adb (Eval_Integer_Literal): Add special
6218 case to avoid optimizing out check if the literal appears in
6221 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6223 * sem_ch4.adb (Try_Primitive_Operations,
6224 Is_Valid_First_Argument_Of): argument is valid if it is a derived
6225 type with unknown discriminants that matches its underlying
6227 * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
6228 expression if its type is derived from a limited type with
6229 unknown discriminants, because the expansion (which is a call)
6230 must be expanded in the enclosing context to add the proper build-
6231 in-place parameters to the call.
6232 * lib.ads, exp_ch9.adb: Minor fixes in comments.
6234 2017-01-23 Yannick Moy <moy@adacore.com>
6236 * frontend.adb (Frontend): Do not load runtime
6237 unit for GNATprove when parsing failed.
6238 * exp_ch9.adb: minor removal of extra whitespace
6239 * exp_ch6.adb: minor typo in comment
6240 * sem_util.adb: Code cleanup.
6241 * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
6242 * a-ngcefu.adb: minor style fix in whitespace
6244 2017-01-23 Thomas Quinot <quinot@adacore.com>
6246 * scos.ads: Document usage of 'd' as default SCO kind for
6248 * par_sco.adb (Traverse_Declarations_Or_Statements.
6249 Traverse_Degenerate_Subprogram): New supporting routine for expression
6250 functions and null procedures.
6251 (Traverse_Declarations_Or_Statements.Traverse_One): Add
6252 N_Expression_Function to the subprogram case; add required
6253 support for null procedures and expression functions.
6255 2017-01-23 Bob Duff <duff@adacore.com>
6257 * namet.ads (Bounded_String): Decrease the size of type
6258 Bounded_String to avoid running out of stack space.
6259 * namet.ads (Append): Don't ignore buffer overflow; raise
6260 Program_Error instead.
6262 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6264 * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
6265 sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
6267 * exp_ch9.adb: minor style fix in comment.
6269 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6271 * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
6272 for a limited record extension with unknown discriminants whose
6273 full view has no discriminants.
6275 2017-01-23 Yannick Moy <moy@adacore.com>
6277 * exp_spark.adb: Alphabetize with clauses.
6279 2017-01-23 Yannick Moy <moy@adacore.com>
6281 * sem_util.adb (Has_Enabled_Property): Treat
6282 protected objects and variables differently from other variables.
6284 2017-01-23 Thomas Quinot <quinot@adacore.com>
6286 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
6287 Split original Ada 95 part off into new subprogram
6288 below. Call that subprogram (instead of proceeding with
6289 AI95-0133 behaviour) if debug switch -gnatd.p is in use.
6290 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
6291 * debug.adb Document new switch -gnatd.p
6292 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
6293 record for reverse bit order if an error has already been posted
6294 on the record type. This avoids generating extraneous "info:"
6295 messages for illegal code.
6297 2017-01-23 Justin Squirek <squirek@adacore.com>
6299 * sem_ch3.adb (Analyze_Declarations): Correct comments
6300 * freeze.adb (Find_Constant): Add detection of deferred constants
6301 so they are not incorrectly flagged as premature.
6303 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6305 * scans.ads: New token At_Sign. Remove '@' from list of illegal
6306 characters for future version of the language. '@' is legal name.
6307 * scng.ads, scng.adb (Scan): Handle '@' appropriately.
6308 * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
6309 denotes a Target_Name.
6310 * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
6311 * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
6312 (Has_Target_Names): New flag on N_Assignment_Statement, to
6313 indicate that RHS has occurrences of N_Target_Name.
6314 * sem.adb: Call Analyze_Target_Name.
6315 * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
6316 (urrent_LHS): Global variable that denotes LHS of assignment,
6317 used in the analysis of Target_Name nodes.
6318 * sem_res.adb (Resolve_Target_Name): New procedure.
6319 * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
6320 N is an assignment statement whose RHS contains occurences of @
6321 that designate the value of the LHS of the assignment. If the
6322 LHS is side-effect free the target names can be replaced with
6323 a copy of the LHS; otherwise the semantics of the assignment
6324 is described in terms of a procedure with an in-out parameter,
6325 and expanded as such.
6326 (Expand_N_Assignment_Statement): Call
6327 Expand_Assign_With_Target_Names when needed.
6328 * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
6329 * sprint.adb: Handle N_Target_Name.
6331 2017-01-23 Eric Botcazou <ebotcazou@adacore.com>
6333 * checks.adb: Minor fix in comment.
6335 2017-01-23 Philippe Gil <gil@adacore.com>
6337 * g-debpoo.adb (Do_Report) remove freed chunks from chunks
6338 count in Sort = Memory_Usage or Allocations_Count
6340 2017-01-23 Justin Squirek <squirek@adacore.com>
6342 * sem_ch3.adb: Code cleanup.
6344 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6346 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
6347 variables to the local variable section. Update the profile
6348 of various nested routine that previously had visibility
6349 of those globals. One the matching phase has completed,
6350 remove certain classes of clauses which are considered noise.
6351 (Check_Dependency_Clause): Properly detect a match between two
6352 'Result attributes. Update the various post-match cases to use
6353 Is_Already_Matched as this routine now automatically recognizes
6354 a previously matched 'Result attribute.
6355 (Is_Already_Matched): New routine.
6356 (Remove_Extra_Clauses): New routine.
6357 (Report_Extra_Clauses): Remove the detection of ... => null
6358 clauses as this is now done in Remove_Extra_Clauses.
6360 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6362 * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
6363 report on spurious overlaps between values involving a subtype
6364 with a static predicate, because the expansion of such a subtype
6365 into individual ranges in inhibited in ASIS mode.
6367 2017-01-23 Justin Squirek <squirek@adacore.com>
6369 * sem_ch3.adb (Analyze_Declarations): Add detection
6370 of an edge case and delay freezing if it is present.
6372 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6374 * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
6375 sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
6377 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6379 * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
6380 access-to-subprogram types inherit the convention of the
6381 associated subprogram. (Set_Profile_Convention): New routine.
6382 * sem_ch6.adb (Check_Conformance): Do not compare the conventions
6383 of the two entities directly, use Conventions_Match to account
6384 for anonymous access-to-subprogram and subprogram types.
6385 (Conventions_Match): New routine.
6387 2017-01-23 Claire Dross <dross@adacore.com>
6389 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
6390 which return Universal_Integer, force the overflow check flag for
6391 Length and Range_Length for types as big as Long_Long_Integer.
6393 2017-01-23 Claire Dross <dross@adacore.com>
6395 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For
6396 attributes which return Universal_Integer, introduce a conversion
6397 to the expected type with the appropriate check flags set.
6398 * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
6399 base type if the range is null. It may still be invalid if it
6400 is higher than the lower bound. This is checked later in the
6401 context in which the range appears.
6403 2017-01-23 Pierre-Marie de Rodat <derodat@adacore.com>
6405 * scos.ads: Introduce a constant to represent ignored
6406 dependencies in SCO_Unit_Table_Entry.
6408 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6410 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
6411 spaces from error messages.
6413 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6415 * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
6416 subsidiary to Expand_N_Object_ Declaration, to compute a guard on
6417 an object declaration for an array type with a modular index type
6418 with the size of Long_Long_Integer. Special processing is needed
6419 in this case to compute reliably the size of the object, and
6420 eventually to raise Storage_Error, when wrap-around arithmetic
6421 might compute a meangingless size for the object.
6423 2017-01-23 Justin Squirek <squirek@adacore.com>
6425 * a-wtenau.adb, par-endh.adb, sem_prag.adb,
6426 sem_type.adb: Code cleanups.
6428 2017-01-23 Bob Duff <duff@adacore.com>
6430 * sem_res.adb (Resolve_Call): In the part of the code where
6431 it is deciding whether to turn the call into an indexed
6432 component, avoid doing so if the call is to an instance of
6433 Unchecked_Conversion. Otherwise, the compiler turns it into an
6434 indexed component, and resolution of that turns it back into a
6435 function call, and so on, resulting in infinite recursion.
6436 * sem_util.adb (Needs_One_Actual): If the first formal has a
6437 default, then return False.
6439 2017-01-21 Eric Botcazou <ebotcazou@adacore.com>
6441 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
6442 optimizations when the type is modular and the offsets are equal.
6444 2017-01-20 Thomas Quinot <quinot@adacore.com>
6446 * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
6449 2017-01-20 Nicolas Roche <roche@adacore.com>
6451 * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
6453 2017-01-20 Bob Duff <duff@adacore.com>
6455 * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
6456 (etc) optimizations when the type is modular.
6458 2017-01-20 Yannick Moy <moy@adacore.com>
6460 * sem_ch6.adb (Move_Pragmas): move some pragmas,
6461 but copy the SPARK_Mode pragma instead of moving it.
6462 (Build_Subprogram_Declaration): Ensure that the generated spec
6463 and original body share the same SPARK_Pragma aspect/pragma.
6464 * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
6465 procedure to copy SPARK_Mode aspect.
6467 2017-01-20 Bob Duff <duff@adacore.com>
6469 * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
6471 * sem_ch13.adb (Resolve_Name): Enable setting the entity to
6472 Empty even in ASIS mode.
6474 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6476 * exp_ch9.adb: minor style fixes in comments.
6477 * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
6478 relative statement introduces an implicit dependency on
6479 Ada.Real_Time.Clock_Time.
6480 * sem_util.adb: Minor reformatting.
6482 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6484 * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
6485 must be treated as delayed aspect even if the expression is
6486 a literal, because the aspect affects the freezing and the
6487 elaboration of the object to which it applies.
6489 2017-01-20 Tristan Gingold <gingold@adacore.com>
6491 * s-osinte-vxworks.ads (Interrup_Range): New subtype.
6493 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6495 * lib-xref.adb (Generate_Reference): Do not warn about the
6496 presence of a pragma Unreferenced if the entity appears as the
6497 actual in a procedure call that does not come from source.
6499 2017-01-20 Pascal Obry <obry@adacore.com>
6501 * expect.c, terminals.c: Fix some warnings about unused variables.
6502 * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
6505 2017-01-20 Bob Duff <duff@adacore.com>
6507 * exp_attr.adb (Constrained): Apply an access check (check that
6508 the prefix is not null) when the prefix denotes an object of an
6509 access type; that is, when there is an implicit dereference.
6511 2017-01-20 Gary Dismukes <dismukes@adacore.com>
6513 * s-rident.ads (constant Profile_Info): Remove
6514 No_Calendar from GNAT_Extended_Ravenscar restrictions.
6516 2017-01-20 Tristan Gingold <gingold@adacore.com>
6518 * s-maccod.ads: Add pragma No_Elaboration_Code_All
6520 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6522 * ghost.adb (Mark_Ghost_Clause): New routine.
6523 (Prune_Node): Do not prune compilation unit nodes.
6524 (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
6525 This does not touch the node itself, but does prune all its fields.
6526 * ghost.ads (Mark_Ghost_Clause): New routine.
6527 * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
6528 package clause mentions Ghost and non-Ghost packages. Mark a
6529 use package clause as Ghost when it mentions a Ghost package.
6530 (Analyze_Use_Type): Emit an error when a use type clause mentions
6531 Ghost and non-Ghost types. Mark a use type clause as Ghost when
6532 it mentions a Ghost type.
6533 * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
6534 Ghost when it withs a Ghost unit.
6536 2017-01-20 Javier Miranda <miranda@adacore.com>
6538 * sem_res.adb (Resolve_Call): If a function call
6539 returns a limited view of a type and at the point of the call the
6540 function is not declared in the extended main unit then replace
6541 it with the non-limited view, which must be available. If the
6542 called function is in the extended main unit then no action is
6543 needed since the back-end handles this case.
6545 2017-01-20 Eric Botcazou <ebotcazou@adacore.com>
6547 * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
6548 (Contains_Subprograms_Refs): ...this. Adjust comment
6549 for constants. (Is_Subp_Or_Const_Ref): Rename into...
6550 (Is_Subprogram_Ref): ...this.
6551 (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
6552 Has_Non_Subprograms_Referencer and adjust comment. Remove
6553 incorrect shortcut for package declarations and bodies.
6555 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6557 * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
6558 base type differs from that of the completion and the private
6559 subtype is an itype (created for a constraint on an access
6560 type e.g.), set Delayed_Freeze on both to prevent out-of-scope
6563 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6565 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
6566 When inheriting the SPARK_Mode of a prior expression function,
6567 look at the properly resolved entity rather than the initial
6568 candidate which may denote a homonym.
6570 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6572 * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
6573 Precondition or Postcondition, and the context is pragma
6574 Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
6575 and suggest the standard names Assertion_Policy /Pre /Post
6578 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6580 * sem_ch10.adb, sem_cat.adb: Minor reformatting.
6582 2017-01-20 Javier Miranda <miranda@adacore.com>
6584 * sem_ch3.adb (Access_Type_Declaration): Protect access to the
6586 * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
6587 * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
6590 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6592 * sem_ch13.adb (Analyze_Aspect_Specification, case
6593 Dynamic_Predicate): If the entity E is a subtype that inherits
6594 a static predicate for its parent P,, the inherited and the
6595 new predicate combine in the generated predicate function,
6596 and E only has a dynamic predicate.
6598 2017-01-20 Tristan Gingold <gingold@adacore.com>
6600 * s-boustr.ads, s-boustr.adb: New package.
6601 * Makefile.rtl: Add s-boustr.
6603 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6605 * inline.adb (Process_Formals): Qualify the
6606 expression of a return statement when it yields a universal type.
6608 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6610 * freeze.adb (Freeze_All): Freeze the default
6611 expressions of all eligible formal parameters that appear in
6612 entries, entry families, and protected subprograms.
6614 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6616 * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
6617 for illegal inherited Implicit_Dereference aspects with renamed
6620 2017-01-20 Javier Miranda <miranda@adacore.com>
6622 * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
6623 * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
6624 * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
6625 (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
6626 Set_Prev, Tree_Read): Adding assertion.
6627 * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
6628 * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
6629 (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
6630 Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
6631 Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
6632 Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
6633 Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
6634 Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
6635 Set_ListN_With_Parent): Adding assertion.
6637 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6639 * sem_prag.adb (Process_Convention): Diagnose properly a pragma
6640 import that applies to several homograph subprograms. when one
6641 of them is declared by a subprogram body.
6643 2017-01-20 Justin Squirek <squirek@adacore.com>
6645 * exp_ch6.adb (Expand_Call): Remove optimization
6646 that nulls out calls to null procedures.
6648 2017-01-20 Yannick Moy <moy@adacore.com>
6650 * inline.adb (Expand_Inlined_Call): Keep more
6651 precise type of actual for inlining whenever possible. In
6652 particular, do not switch to the formal type in GNATprove mode in
6653 some case where the GNAT backend might require it for visibility.
6655 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6657 * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
6658 aspect Implicit_Dereference can be inherited by a full view if
6659 the partial view has no discriminants, because there is no way
6660 to apply the aspect to the partial view.
6661 (Build_Derived_Record_Type): If derived type renames discriminants
6662 of the parent, the new discriminant inherits the aspect from
6664 * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
6665 call through an access discriminant designating a subprogram.
6666 * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
6667 properly a parameterless call through an access discriminant on
6668 the left-hand side of an assignment.
6669 * sem_res.adb (resolve): If an interpreation involves a
6670 discriminant with an implicit dereference and the expression is an
6671 entity, resolution takes place later in the appropriate routine.
6672 * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
6673 access discriminants that designate a subprogram type.
6675 2017-01-20 Pascal Obry <obry@adacore.com>
6677 * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
6679 2017-01-20 Yannick Moy <moy@adacore.com>
6681 * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
6682 on implicitly with'ed units in GNATprove mode.
6683 * sinfo.ads (Implicit_With): Document use of flag for implicitly
6684 with'ed units in GNATprove mode.
6686 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6688 * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
6689 unit Do not report an error on a non-static entity that appears
6690 in the context of a spec expression, such as an aspect expression.
6692 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6694 * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
6695 (Is_Underlying_Full_View): New routine.
6696 (Set_Is_Underlying_Full_View): New routine.
6697 (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
6698 * einfo.ads Add new attribute Is_Underlying_Full_View.
6699 (Is_Underlying_Full_View): New routine along with pragma Inline.
6700 (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
6701 * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
6702 class-wide types and underlying full views. The first subtype
6703 is used as the working type for all Itypes, not just array base types.
6704 (Build_DIC_Procedure_Declaration): Do not consider
6705 class-wide types and underlying full views. The first subtype
6706 is used as the working type for all Itypes, not just array
6708 * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
6709 view or an underlying full view without clobbering the attributes
6710 of a previous freeze node.
6711 (Inherit_Freeze_Node): New routine.
6712 * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
6714 (Build_Underlying_Full_View): Mark an underlying full view as such.
6715 * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
6718 2017-01-20 Yannick Moy <moy@adacore.com>
6720 * sinfo.ads: Document lack of Do_Division_Check flag
6721 on float exponentiation.
6723 2017-01-19 Javier Miranda <miranda@adacore.com>
6725 * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
6726 identifier attribute of a block-statement node. Required to avoid
6727 assertion failure when building the new containers library.
6729 2017-01-19 Bob Duff <duff@adacore.com>
6731 * exp_ch3.adb: Update comment.
6733 2017-01-19 Vincent Celier <celier@adacore.com>
6735 * gprep.adb (Gnatprep): Parse the definition file without
6736 "replace in comments" even when switch -C is used.
6738 2017-01-19 Justin Squirek <squirek@adacore.com>
6740 * exp_ch9.adb (Is_Pure_Barrier): Create function
6741 Is_Count_Attribute to identify an expansion of the 'Count
6744 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6746 * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
6747 statements within an element iterator loop are only analyzed
6748 agter the loop is rewritten. Within a generic the analysis must
6749 be performed in any case to complete name capture.
6751 2017-01-19 Bob Duff <duff@adacore.com>
6753 * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
6754 before checking for unrecognized pragmas.
6755 Initialize Pname on its declarations; that's always good style.
6757 2017-01-19 Claire Dross <dross@adacore.com>
6759 * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
6760 body into the tree for GNATprove by setting its Parent field. The
6761 components invariants of composite types are not checked by
6762 the composite type's invariant procedure in GNATprove mode.
6763 (Build_Invariant_Procedure_Declaration): Semi-insert the
6764 declaration into the tree for GNATprove by setting its Parent
6766 * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
6767 the component invariants to the array type invariant procedure
6768 so that the procedure can be used to check the array type
6770 (Freeze_Record_Type): In GNATprove mode, do
6771 not add the component invariants to the record type invariant
6772 procedure so that the procedure can be used to check the record
6773 type invariants if any.
6775 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6777 * lib-xref-spark_specific.adb: Minor reformatting.
6778 * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
6780 2017-01-19 Javier Miranda <miranda@adacore.com>
6782 * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
6783 Build_Back_End_Aggregate.
6784 (Generate_Aggregate_For_Derived_Type): Code cleanup.
6785 (Prepend_Stored_Values): Code cleanup.
6787 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6789 * sem_ch6.adb (Analyze_Expression_Function): Check for an
6790 incomplete return type after attempting to freeze it, so that
6791 other freeze actiona are generated in the proper order.
6793 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6795 * sem_aggr.adb (Resolve_Aggregate): If the type is a string
6796 type, ie. a type whose component is a character type, and the
6797 aggregate is positional, do not convert into a string literal
6798 if the index type is not an integer type, because the original
6799 type may be required in an enclosing operation.
6801 2017-01-19 Bob Duff <duff@adacore.com>
6803 * binde.adb, debug.adb: Enable new elaboration order algorithm
6804 by default. -dp switch reverts to the old algorithm.
6806 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6808 * sem_ch3.adb Add with and use clauses for Exp_Ch7.
6809 (Analyze_Declarations): Create the DIC and Invariant
6810 procedure bodies s after all freezing has taken place.
6811 (Build_Assertion_Bodies): New routine.
6812 * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
6814 (Analyze_Package_Specification): Remove the
6815 generation of the DIC and Invariant procedure bodies. This is
6816 now done by Analyze_Declarations.
6817 * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
6818 procedures are never treated as primitives.
6820 2017-01-19 Yannick Moy <moy@adacore.com>
6822 * frontend.adb: Analyze inlined bodies and check elaboration
6823 rules in GNATprove mode too.
6824 * sem_elab.adb (Delay_Element): Add Boolean component to save
6825 indication that call is in SPARK code. (Check_Elab_Calls):
6826 Check elaboration rules in GNATprove mode, and correctly set
6827 the current value of SPARK_Mode.
6828 * lib-xref-spark_specific.adb
6829 (Add_SPARK_Xrefs): Simplify iteration over dereferences.
6831 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6833 * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
6834 checks on the expression for the high bound of concatenation
6835 when checks are disabled, to suppress warnings about potential
6836 constraint errors in restricted runtimes.
6838 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6840 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
6841 representation-to-position function as inlined.
6842 * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
6843 the purity of an internally generated entity if it has been
6844 explicitly marked as pure for optimization purposes.
6845 * exp_aggr.adb: Minor reformatting.
6847 2017-01-19 Javier Miranda <miranda@adacore.com>
6849 * exp_ch6.adb (Expand_Call): Remove side effects on
6850 actuals that are allocators with qualified expression since the
6851 initialization of the object is performed by means of individual
6852 statements (and hence it must be done before the call).
6854 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6856 * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
6857 (Build_Derived_Enumeration_Type): If the derived type inherits a
6858 dynamic predicate from its parent, the bounds of the type must
6859 freeze because an explicit constraint is constructed for the
6860 type and the corresponding range is elaborated now.
6862 2017-01-19 Arnaud Charlet <charlet@adacore.com>
6864 * sem_attr.ads: minor fix of inconsistent casing in comment
6865 * lib-writ.ads: minor align comments in columns
6866 * sem_ch3.adb: Minor reformatting.
6867 * spark_xrefs.ads: minor fix typo in SPARK-related comment
6868 * table.ads: minor style fix in comment
6869 * lib-xref-spark_specific.adb
6870 (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
6871 * sem_ch12.adb: minor whitespace fix
6872 * freeze.adb: Add comment.
6873 * sem_util.adb (Unique_Name): for instances of
6874 generic subprograms ignore the name of the wrapper package.
6876 2017-01-19 Javier Miranda <miranda@adacore.com>
6878 * exp_aggr.adb (Resolve_Record_Aggregate):
6879 Factorize code needed for aggregates of limited and unlimited
6880 types in a new routine.
6881 (Pass_Aggregate_To_Back_End): New subprogram.
6883 2017-01-19 Yannick Moy <moy@adacore.com>
6885 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
6887 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6889 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
6890 public, for use elsewhere.
6891 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
6892 an Inlined_body, recognize a call that uses object notation
6893 and has not been rewritten as a regular call because regular
6894 expansion has not taken place.
6896 2017-01-19 Bob Duff <duff@adacore.com>
6898 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
6899 in case of generic formal discrete types, because it causes crashes in
6900 the compiler when built with assertions on.
6902 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6904 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
6905 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
6907 2017-01-19 Bob Duff <duff@adacore.com>
6909 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
6910 Increment Warnings_Detected. It was decrementing, which is
6911 wrong since we just issued a warning message.
6912 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
6913 these variables to be of subtype Nat instead of Int, because
6914 they should never be negative.
6916 2017-01-19 Javier Miranda <miranda@adacore.com>
6918 * contracts.adb (Build_Postconditions_Procedure): Replace
6919 Generate_C_Code by Modify_Tree_For_C.
6920 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
6921 Replace Generate_C_Code by Modify_Tree_For_C.
6922 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
6924 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
6925 Generate_C_Code by Modify_Tree_For_C.
6926 * exp_ch4.adb (Expand_Allocator_Expression): Replace
6927 Generate_C_Code by Modify_Tree_For_C.
6928 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
6929 by Modify_Tree_For_C.
6930 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
6931 Generate_C_Code by Modify_Tree_For_C.
6932 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
6933 by Modify_Tree_For_C.
6934 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
6936 2017-01-19 Javier Miranda <miranda@adacore.com>
6938 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
6940 (Is_Inlinable_Expression_Function): New subprogram.
6941 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
6943 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
6945 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6947 * sem_ch4.adb (Diagnose_Call): Improve error message when a
6948 selected component has a prefix that might be interpreted
6949 as a parameterless function call, but none of the candidate
6950 interpretations is parameterless, and there is a hidden homonym
6951 of the prefix that is a package.
6952 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
6953 interpreted as a parameterless function call and its analysis
6954 fails, do not call Analyze_Selected_Component.
6956 2017-01-19 Steve Baird <baird@adacore.com>
6958 * sem_util.ads: Add new Use_Full_View Boolean parameter to
6960 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
6961 calls to a newly-defined Scalar_Range_Of_Right_View function.
6963 2017-01-19 Arnaud Charlet <charlet@adacore.com>
6965 * gnat1drv.adb: minor fix of unbalanced parens in comment
6966 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
6967 to visible part of the package to allow re-use in GNATprove.
6968 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
6969 from repeated code of Traverse_Compilation_Unit.
6970 (Traverse_Declaration_Or_Statement): fixed detection of
6971 generic subprograms and packages; also, iteration over case
6972 statement alternatives rewritten to avoid testing if the first
6973 alternative is present (since it must be present due to Ada
6974 syntax restrictions).
6976 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6978 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
6979 returning by reference not just for subprogram body stubs,
6980 but for all subprogram cases.
6981 * sem_util.adb: Code reformatting.
6982 (Requires_Transient_Scope): Update the call to Results_Differ.
6983 (Results_Differ): Update the parameter profile and the associated
6986 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6988 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
6989 identifier nodes that do not come from source, to handle properly
6990 dimensionality check within an inlined body which inclddes both
6991 original operands and rewritten operands. This removes spurious
6992 dimensionality errors in the presence of front-end inlining,
6993 as well as in SPARK mode.
6995 2017-01-16 Jakub Jelinek <jakub@redhat.com>
6998 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
7000 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7002 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
7004 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7006 * doc/gnat_ugn/getting_started_with_gnat.rst,
7007 doc/gnat_ugn/inline_assembler.rst,
7008 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
7009 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
7010 doc/gnat_ugn/about_this_guide.rst,
7011 doc/gnat_ugn/platform_specific_information.rst,
7012 doc/gnat_ugn/example_of_binder_output.rst,
7013 doc/gnat_ugn/gnat_and_program_execution.rst,
7014 doc/gnat_ugn/gnat_utility_programs.rst,
7015 doc/gnat_ugn/the_gnat_compilation_model.rst,
7016 doc/gnat_rm/implementation_defined_attributes.rst,
7017 doc/gnat_rm/compatibility_and_porting_guide.rst,
7018 doc/gnat_rm/standard_library_routines.rst,
7019 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
7020 doc/gnat_rm/implementation_defined_pragmas.rst,
7021 doc/gnat_rm/the_gnat_library.rst,
7022 doc/gnat_rm/obsolescent_features.rst,
7023 doc/gnat_rm/about_this_guide.rst,
7024 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
7025 doc/gnat_rm/implementation_of_ada_2012_features.rst,
7026 doc/gnat_rm/interfacing_to_other_languages.rst,
7027 doc/gnat_rm/implementation_defined_aspects.rst,
7028 doc/gnat_rm.rst: Update documentation.
7029 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
7031 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7033 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
7034 * scil_ll.adb: Minor style fix in comment.
7035 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
7036 even if entity is already set, because the node may be renalyzed
7037 after inlining transformations.
7039 2017-01-13 Javier Miranda <miranda@adacore.com>
7041 * sem_res.adb (Resolve_Call): Do not establish a transient scope
7042 for a call to inlinable expression function (since the call will
7043 be replaced by its returned object).
7044 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
7045 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
7046 (Expand_Call): For inlinable expression function call replace the
7047 call by its returned object.
7048 (Is_Inlinable_Expression_Function): New subprogram.
7050 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7052 * checks.adb: Minor typo fix and reformatting.
7054 2017-01-13 Javier Miranda <miranda@adacore.com>
7056 * contracts.adb (Contract_Only_Subprograms): Remove formal.
7057 (Copy_Original_Specification): Removed.
7058 (Skip_Contract_Only_Subprogram): Move here checks previously
7059 located in the caller of this routine (to leave the code more clean).
7060 (Build_Contract_Only_Subprogram): Code cleanup.
7061 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
7062 (Get_Contract_Only_Missing_Body_Name): Removed.
7064 2017-01-13 Javier Miranda <miranda@adacore.com>
7066 * sem_ch6.adb (Cloned_Expression): New subprogram.
7067 (Freeze_Expr_Types): Complete previous patch since the expression
7068 of an expression-function may have iterators and loops with
7069 defining identifiers which, as part of the preanalysis of the
7070 expression, may be left decorated with itypes that will not be
7071 available in the tree passed to the backend.
7073 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7075 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
7076 conversion to Integer of an expression that is an attribute
7077 reference 'Pos on an enumeration type.
7079 2017-01-13 Bob Duff <duff@adacore.com>
7081 * atree.ads: Minor comment fix.
7083 2017-01-13 Justin Squirek <squirek@adacore.com>
7085 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
7086 calls in accessibility check on return statement.
7088 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7090 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
7091 Ensure that the input body is a subprogram body before trying to
7092 determine whether it denoted an expression function. Note that
7093 subprogram body stubs cannot denote expression functions.
7095 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7097 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
7100 2017-01-13 Javier Miranda <miranda@adacore.com>
7102 * einfo.ads (Component_Bit_Offset): Fix documentation.
7103 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
7104 on record holes for components with unknown compile-time offsets.
7106 2017-01-13 Bob Duff <duff@adacore.com>
7108 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
7109 * g-locfil.ads: Minor comment fix.
7111 2017-01-13 Bob Duff <duff@adacore.com>
7113 * binde.adb (Elab_New): New elaboration order algorithm
7114 that is expected to cause fewer ABE issues. This is a work in
7115 progress. The new algorithm is currently disabled, and can be
7116 enable by the -dp switch, or by modifying the Do_Old and Do_New
7117 etc. flags and rebuilding. Experimental code is included to
7118 compare the results of the old and new algorithms.
7119 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
7120 can have multiple of these tables, so the old and new algorithms
7122 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
7123 parameter of type array. This avoids the global variable, and
7124 allows bounds checking (which is normally defeated by the tables
7125 packages). It also ensures that the Elab_Order is read-only
7127 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
7128 subprograms that need it, as above.
7129 * debug.adb: Document new -dp switch. Modify doc of old -do
7131 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
7132 and Bindgen. Move writing of closure (-R and -Ra switches)
7133 to Binde; that's more convenient.
7135 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7137 * sem_ch6.adb (Analyze_Expression_Function): If the expression
7138 function is a completion, all entities referenced in the
7139 expression are frozen. As a consequence, a reference to an
7140 uncompleted private type from an enclosing scope is illegal.
7142 2017-01-13 Javier Miranda <miranda@adacore.com>
7144 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
7145 (Analyze_Subprogram_Body_Helper): At the occurrence of an
7146 expression function declaration that is a completion, its
7147 expression causes freezing (AI12-0103).
7149 2017-01-13 Vadim Godunko <godunko@adacore.com>
7151 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
7152 Reference functions of Ada.Containers.Indefinite_Holders.
7154 2017-01-13 Bob Duff <duff@adacore.com>
7156 * s-os_lib.ads: Minor comment fixes.
7158 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7160 * exp_ch3.adb (Default_Initialize_Object): Do not default
7161 initialize an object when it is of a task type and restriction
7162 No_Tasking is in effect because the initialization is obsolete.
7163 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
7164 restriction No_Tasking is in effect.
7165 (Build_Master_Renaming): Do not rename a master when restriction
7166 No_Tasking is in effect.
7168 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7170 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
7171 the legality of An others clause applies as well to a choice in
7172 an Iterated_component_ association.
7173 (Resolve_Iterated_Component_Association): An others choice
7175 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
7176 Iterated_Component_Association is not static.
7178 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7180 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
7181 control is passed to the expresion handler before the new mode
7183 * sem_ch12.adb (Analyze_Package_Instantiation,
7184 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
7185 in case control is passed to the expresion handler before the
7188 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7190 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
7191 exp_aggr.adb: Minor reformatting.
7193 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7195 * inline.adb: Minor reformatting and typo fix.
7197 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7199 * sem_util.ads, sem_util.adb (Choice_List): Move function here
7200 from sem_aggr.adb, for use elsewhere.
7201 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
7202 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
7203 Iterated_Component_Present.
7204 * exp_aggr.adb: Use Choice_List throughout, to handle
7205 Iterated_Component_Associations.
7206 (Gen_Loop): Generate proper loop for an
7207 Iterated_Component_Association: loop variable has the identifier
7208 of the original association. Generate a loop even for a single
7209 component choice, in order to make loop parameter visible in
7211 (Flatten): An Iterated_Component_Association is not static.
7213 2017-01-13 Yannick Moy <moy@adacore.com>
7215 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
7216 float exponentiation for statically known small negative values
7217 is the reciprocal of the exponentiation for the opposite value
7219 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
7220 Ensure that the value of float exponentiation for negative values
7221 is the reciprocal of the exponentiation for the opposite value
7223 * inline.adb (Expand_Inlined_Call): Fix the count
7224 for the number of generated gotos.
7226 2017-01-13 Yannick Moy <moy@adacore.com>
7228 * inline.adb: Code cleanup.
7229 * sem_util.adb (Is_OK_Volatile_Context): Add
7230 expression in delay statement as OK for volatile context.
7232 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7234 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
7235 mode a choice that is a subtype with a static predicate is
7236 replaced by the values it covers. This transformation must not
7237 be performed in ASIS mode, to preserve the source for analysis.
7239 2017-01-13 Justin Squirek <squirek@adacore.com>
7241 * nlists.ads: Correct minor typo.
7243 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7245 * sem_ch13.adb: Minor reformatting and typo fix.
7247 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7249 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
7250 Iterated_Component_Association is a named association in an
7252 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
7253 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
7254 and resolve the discrete choices and the expression of the
7256 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
7257 Loop_Actions and Box_Present are attributes of
7258 N_Iterated_Component_Association nodes. Box_Present is always
7260 * sprint.adb (Sprint_Node): An Iterated_Component_Association
7261 has a Discrete_Choices list, as specified in the RM. A
7262 Component_Association for aggregate uses instead a Choices list.
7263 We have to live with this small inconsistency because the new
7264 construct also has a defining identifier, and there is no way
7265 to merge the two node structures.
7267 2017-01-13 Yannick Moy <moy@adacore.com>
7269 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
7270 list of pragmas to remove. Remove pragmas from the list of
7271 statements in the body to inline.
7272 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
7274 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7276 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
7277 Analyze_Declarations, to analyze and resolve the expressions of
7278 aspect specifications in the current declarative list, so that
7279 the expressions have proper entity and type info. This is needed
7280 for ASIS when there is no subsequent expansion to generate this
7281 semantic information.
7282 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
7283 original expression, to suppress cascaded errors when expression
7284 has been constant-folded.
7285 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
7286 ASIS mode, because there is no subsequent expansion to decorate
7289 2017-01-13 Yannick Moy <moy@adacore.com>
7291 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
7292 New function to detect when a call may be inlined or not in
7294 (Expand_Inlined_Call): Ensure that a temporary
7295 is always created in the cases where a type conversion may be
7296 needed on an input parameter in GNATprove mode, so that GNATprove
7297 sees the check to perform.
7298 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
7299 when not applicable due to actual requiring type conversion
7300 with possible check but no temporary value can be copied for
7301 GNATprove to see the check.
7303 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7305 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
7306 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
7307 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
7308 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
7309 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
7310 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
7311 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
7312 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
7313 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
7314 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
7315 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
7316 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
7317 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
7318 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
7319 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
7320 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
7321 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
7322 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
7323 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
7324 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
7325 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
7326 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
7327 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
7328 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
7329 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
7330 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
7331 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
7332 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
7333 statements to reflect the new style for case alternatives. Various
7334 code clean up and reformatting.
7336 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7338 * exp_util.adb: Minor reformatting.
7340 2017-01-13 Yannick Moy <moy@adacore.com>
7342 * exp_spark.adb: Code cleanup.
7343 * sem_ch9.adb (Analyze_Delay_Until): Resolve
7344 expression so that calls are identified as such inside delay
7347 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7349 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
7350 * par-ch3.adb (P_Discrete_Choice_List): An
7351 Iterated_Component_Association is an array aggregate component.
7352 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
7353 (Is_Quantified_Expression): New function that performs a lookahead
7354 to distinguish quantified expressions from iterated component
7356 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
7358 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
7359 * sem.adb (Analyze): Handle Iterated_Component_Association.
7360 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
7361 component associations.
7362 * sinfo.ads, sinfo.adb: Entries for for
7363 N_Iterated_Component_Association and its fields.
7364 * sprint.adb (Sprint_Node_Actual): Handle
7365 N_Iterated_Component_Association.
7367 2017-01-13 Justin Squirek <squirek@adacore.com>
7369 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
7370 of the style check until after preanalysis of acutals.
7372 2017-01-13 Yannick Moy <moy@adacore.com>
7374 * sem_ch13.adb: Minor reformatting.
7375 * par-ch11.adb: minor style fix in whitespace
7376 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
7377 reduced to Add_Artificial_ALI_File; style fix in declaration of
7378 Text; grammar fix in comment.
7379 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
7380 * freeze.adb: Cleanup to pass pragma instead of
7382 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
7383 replace System'To_Address by equivalent call.
7385 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7387 * bindusg.adb: Improve usage output for -f switch.
7389 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7391 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
7394 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7396 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
7397 treat comparisons on strings as legal in a Static_Predicate.
7398 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
7399 a function call that is the expansion of a string comparison.The
7400 function call is built when compiling the corresponding predicate
7401 function, but the expression has been found legal as a static
7402 predicate during earlier analysis.
7403 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
7404 properly a function call that is the expansion of a string
7405 comparison operation, in order to recover the Static_Predicate
7406 expression and apply it to a static argument when needed.
7408 2017-01-13 Tristan Gingold <gingold@adacore.com>
7410 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
7411 (Open_Read): Re-implement using Open_Read_No_Exception.
7412 (Open_Write): Raise exception in case of error.
7413 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
7414 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
7416 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
7418 2017-01-13 Yannick Moy <moy@adacore.com>
7420 * checks.adb: Code cleanup.
7422 2017-01-13 Yannick Moy <moy@adacore.com>
7424 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
7425 expression instead of unanalyzed aspect expression for checking
7426 the validity of inheriting an operation. Also copy the expression
7427 being passing it to Build_Class_Wide_Expression, as this call
7428 modifies its argument.
7429 * sem_util.ads Fix comment to reference correct function name
7432 2017-01-13 Javier Miranda <miranda@adacore.com>
7434 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
7435 when we propagate information about the indexes back to the original
7436 indexing mode and the prefix of the index is a function call, do not
7437 remove any parameter from such call.
7439 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7441 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
7442 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
7443 a build-in-place function whose result type is tagged.
7445 2017-01-13 Yannick Moy <moy@adacore.com>
7447 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7448 Do not generate a wrapper when the only candidate is a class-wide
7450 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
7451 inside a generic context.
7453 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7455 * exp_util.adb (Add_Inherited_Tagged_DIC):
7456 Pass the object parameters of both the parent and the derived
7457 type DIC procedure to the reference replacement circuitry.
7458 (Find_DIC_Type): Modify the circuitry to present the partial
7459 view of a private type in case the private type defines its own
7461 (Replace_Object_And_Primitive_References): Add two
7462 optional formal parameters. Update the comment on usage. Update
7463 the replacement of references to object parameters.
7465 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7467 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
7469 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7471 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
7472 an out parameter that is a type conversion, independently of th
7473 range check that may apply to the expression of the conversion,
7474 for use in GNATProve.
7476 2017-01-13 Yannick Moy <moy@adacore.com>
7478 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
7479 GNATprove_Mode here to Frontend.
7480 * frontend.adb (Frontend): Move the implicit with for System
7481 in GNATprove_Mode here as it ismore correct this way; the old
7482 place only worked by chance, since there were no overloaded names.
7483 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
7484 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
7485 four attributes identified in SRM 9(18), add an implicit with
7486 to Ada.Task_Identification.
7487 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7488 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
7490 * checks.adb (Apply_Discriminant_Check,
7491 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
7492 In GNATprove mode, we do not apply the checks, but we still
7493 analyze the expression to possibly issue errors on SPARK
7494 code when a run-time error can be detected at compile time.
7495 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
7498 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7500 * expander.adb (Expand): Add a warning about using return
7501 statements in Ghost management code.
7502 * exp_ch3.adb (Freeze_Type): Add a warning about using return
7503 statements in Ghost management code.
7504 * exp_ch7.adb (Build_Invariant_Procedure_Body,
7505 Build_Invariant_Procedure_Declaration): Add a warning about
7506 using return statements in Ghost management code.
7507 * exp_disp.adb (Make_DT): Add a warning about using return
7508 statements in Ghost management code.
7509 * exp_util.adb (Build_DIC_Procedure_Body,
7510 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
7511 warning about using return statements in Ghost management code.
7512 * freeze.adb (Freeze_Entity): Add a warning about using return
7513 statements in Ghost management code.
7514 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
7515 statements in Ghost management code.
7516 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
7517 a warning about using return statements in Ghost management code.
7518 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
7519 return statements in Ghost management code.
7520 * sem_ch6.adb (Analyze_Procedure_Call,
7521 Analyze_Subprogram_Body_Helper): Add a warning about using return
7522 statements in Ghost management code.
7523 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
7524 using return statements in Ghost management code.
7525 * sem_ch12.adb (Analyze_Package_Instantiation,
7526 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
7527 Instantiate_Subprogram_Body): Add a warning about using return
7528 statements in Ghost management code.
7529 * sem_ch13.adb (Build_Predicate_Functions,
7530 Build_Predicate_Function_Declarations): Add a warning about
7531 using return statements in Ghost management code.
7532 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
7533 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
7534 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
7535 using return statements in Ghost management code.
7537 2017-01-13 Tristan Gingold <gingold@adacore.com>
7539 * s-mmosin-mingw.adb: Fix pragma import.
7541 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7543 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
7546 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7548 * atree.adb (Allocate_Initialize_Node): A newly created node is
7549 no longer marked as Ghost at this level.
7550 (Mark_New_Ghost_Node): New routine.
7551 (New_Copy): Mark the copy as Ghost.
7552 (New_Entity): Mark the entity as Ghost.
7553 (New_Node): Mark the node as Ghost.
7554 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
7555 apply to unanalyzed entities.
7556 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
7558 (Set_Is_Checked_Ghost_Entity): This attribute now
7559 applies to all entities as well as unanalyzed entities.
7560 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
7561 all entities as well as unanalyzed entities.
7562 * expander.adb Add with and use clauses for Ghost.
7563 (Expand): Install and revert the Ghost region associated with the node
7565 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
7566 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
7567 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
7568 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
7569 (Freeze_Type): Install and revert the Ghost region associated
7570 with the type being frozen.
7571 * exp_ch5.adb Remove with and use clauses for Ghost.
7572 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
7573 * exp_ch6.adb Remove with and use clauses for Ghost.
7574 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
7575 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
7576 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
7577 Ghost region of the working type.
7578 (Build_Invariant_Procedure_Declaration): Install and revert
7579 the Ghost region of the working type.
7580 (Expand_N_Package_Body): Remove all Ghost-related code.
7581 * exp_ch8.adb Remove with and use clauses for Ghost.
7582 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
7584 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
7585 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
7586 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
7588 * exp_ch13.adb Remove with and use clauses for Ghost.
7589 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
7590 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
7591 the tagged type. Move the generation of various entities within
7592 the Ghost region of the type.
7593 * exp_prag.adb Remove with and use clauses for Ghost.
7594 (Expand_Pragma_Check): Remove all Ghost-related code.
7595 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
7596 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
7597 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
7598 * exp_util.adb (Build_DIC_Procedure_Body): Install
7599 and revert the Ghost region of the working types.
7600 (Build_DIC_Procedure_Declaration): Install and revert the
7601 Ghost region of the working type.
7602 (Make_Invariant_Call): Install and revert the Ghost region of the
7604 (Make_Predicate_Call): Reimplemented. Install and revert the
7605 Ghost region of the associated type.
7606 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
7607 of the entity being frozen.
7608 (New_Freeze_Node): Removed.
7609 * ghost.adb Remove with and use clauses for Opt.
7610 (Check_Ghost_Completion): Update the parameter profile
7611 and all references to formal parameters.
7612 (Ghost_Entity): Update the comment on usage.
7613 (Install_Ghost_Mode): New routines.
7614 (Is_Ghost_Assignment): New routine.
7615 (Is_Ghost_Declaration): New routine.
7616 (Is_Ghost_Pragma): New routine.
7617 (Is_Ghost_Procedure_Call): New routine.
7618 (Is_Ghost_Renaming): Removed.
7619 (Is_OK_Declaration): Reimplemented.
7620 (Is_OK_Pragma): Reimplemented.
7621 (Is_OK_Statement): Reimplemented.
7622 (Is_Subject_To_Ghost): Update the comment on usage.
7623 (Mark_And_Set_Ghost_Assignment): New routine.
7624 (Mark_And_Set_Ghost_Body): New routine.
7625 (Mark_And_Set_Ghost_Completion): New routine.
7626 (Mark_And_Set_Ghost_Declaration): New routine.
7627 (Mark_And_Set_Ghost_Instantiation): New routine.
7628 (Mark_And_Set_Ghost_Procedure_Call): New routine.
7629 (Mark_Full_View_As_Ghost): Removed.
7630 (Mark_Ghost_Declaration_Or_Body): New routine.
7631 (Mark_Ghost_Pragma): New routine.
7632 (Mark_Ghost_Renaming): New routine.
7633 (Mark_Pragma_As_Ghost): Removed.
7634 (Mark_Renaming_As_Ghost): Removed.
7635 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
7636 (Prune_Node): Freeze nodes no longer need special pruning, they
7637 are processed by the general ignored Ghost code mechanism.
7638 (Restore_Ghost_Mode): New routine.
7639 (Set_Ghost_Mode): Reimplemented.
7640 (Set_Ghost_Mode_From_Entity): Removed.
7641 * ghost.ads Add with and use clauses for Ghost.
7642 (Check_Ghost_Completion): Update the parameter profile
7643 along with the comment on usage.
7644 (Install_Ghost_Mode): New routine.
7645 (Is_Ghost_Assignment): New routine.
7646 (Is_Ghost_Declaration): New routine.
7647 (Is_Ghost_Pragma): New routine.
7648 (Is_Ghost_Procedure_Call): New routine.
7649 (Mark_And_Set_Ghost_Assignment): New routine.
7650 (Mark_And_Set_Ghost_Body): New routine.
7651 (Mark_And_Set_Ghost_Completion): New routine.
7652 (Mark_And_Set_Ghost_Declaration): New routine.
7653 (Mark_And_Set_Ghost_Instantiation): New routine.
7654 (Mark_And_Set_Ghost_Procedure_Call): New routine.
7655 (Mark_Full_View_As_Ghost): Removed.
7656 (Mark_Ghost_Pragma): New routine.
7657 (Mark_Ghost_Renaming): New routine.
7658 (Mark_Pragma_As_Ghost): Removed.
7659 (Mark_Renaming_As_Ghost): Removed.
7660 (Restore_Ghost_Mode): New routine.
7661 (Set_Ghost_Mode): Redefined.
7662 (Set_Ghost_Mode_From_Entity): Removed.
7663 * sem.adb (Analyze): Install and revert the Ghost region of the
7664 node being analyzed.
7665 (Do_Analyze): Change the way a clean Ghost
7666 region is installed and reverted.
7667 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
7668 all Ghost-related code.
7669 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
7670 (Analyze_Number_Declaration): Remove all Ghost-related code.
7671 (Analyze_Object_Declaration): Install and revert the Ghost region of
7672 a deferred object declaration's completion.
7673 (Array_Type_Declaration): Remove all Ghost-related code.
7674 (Build_Derived_Type): Update the comment on
7675 the propagation of Ghost attributes from a parent to a derived type.
7676 (Derive_Subprogram): Remove all Ghost-related code.
7677 (Make_Class_Wide_Type): Remove all Ghost-related code.
7678 (Make_Implicit_Base): Remove all Ghost-related code.
7679 (Process_Full_View): Install and revert the Ghost region of
7680 the partial view. There is no longer need to check the Ghost
7682 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
7683 region of the left hand side.
7684 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
7685 all Ghost-related code.
7686 (Analyze_Expression_Function): Remove all Ghost-related code.
7687 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
7688 (Analyze_Procedure_Call): Install and revert the Ghost region of
7689 the procedure being called.
7690 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
7691 region of the spec or body.
7692 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
7693 (Build_Subprogram_Declaration): Remove all Ghost-related code.
7694 (Find_Corresponding_Spec): Remove all Ghost-related code.
7695 (Process_Formals): Remove all Ghost-related code.
7696 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
7697 the Ghost region of the spec.
7698 (Analyze_Package_Declaration): Remove all Ghost-related code.
7699 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
7700 Ghost when it aliases a Ghost entity.
7701 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
7703 (Analyze_Object_Renaming): Mark a renaming as Ghost when
7704 it aliases a Ghost entity.
7705 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
7707 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
7708 aliases a Ghost entity.
7709 * sem_ch11.adb Remove with and use clauses for Ghost.
7710 (Analyze_Exception_Declaration): Remove all Ghost-related code.
7711 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
7713 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
7715 (Analyze_Package_Instantiation): Install and revert the Ghost region
7716 of the package instantiation.
7717 (Analyze_Subprogram_Instantiation): Install
7718 and revert the Ghost region of the subprogram instantiation.
7719 (Instantiate_Package_Body): Code clean up. Install and revert the
7720 Ghost region of the package body.
7721 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
7722 Ghost region of the subprogram body.
7723 * sem_ch13.adb (Build_Predicate_Functions): Install
7724 and revert the Ghost region of the related type.
7725 (Build_Predicate_Function_Declaration): Code clean up. Install
7726 and rever the Ghost region of the related type.
7727 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
7728 Install and revert the Ghost region of the pragma.
7729 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
7730 Ghost region of the pragma.
7731 (Analyze_Pragma): Install and revert the Ghost region of various
7732 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
7733 or encloses a Ghost entity.
7734 (Analyze_Pre_Post_Condition): Install and revert the Ghost
7735 region of the pragma.
7736 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
7737 Ghost region of the pragma.
7738 * sem_res.adb (Resolve): Remove all Ghost-related code.
7739 * sem_util.adb (Is_Declaration): Reimplemented.
7740 (Is_Declaration_Other_Than_Renaming): New routine.
7741 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
7742 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
7743 (Is_Ghost_Pragma): Removed.
7744 (Is_Ignored_Ghost_Pragma): New routine.
7745 (Set_Is_Checked_Ghost_Pragma): New routine.
7746 (Set_Is_Ghost_Pragma): Removed.
7747 (Set_Is_Ignored_Ghost_Pragma): New routine.
7748 * sinfo.ads: Update the documentation on Ghost mode and
7749 Ghost regions. New attributes Is_Checked_Ghost_Pragma
7750 and Is_Ignored_Ghost_Pragma along with usages in nodes.
7751 Remove attribute Is_Ghost_Pragma along with usages in nodes.
7752 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
7753 (Is_Ghost_Pragma): Removed along with pragma Inline.
7754 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
7755 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
7756 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
7757 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
7759 2017-01-12 Tristan Gingold <gingold@adacore.com>
7761 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
7762 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
7764 2017-01-12 Yannick Moy <moy@adacore.com>
7766 * errout.adb, errout.ads (Initialize): Factor common treatment
7768 (Reset_Warnings): New procedure to reset counts related to warnings.
7769 (Record_Compilation_Errors): New variable to store the presence of an
7770 error, used in gnat2why to allow changing the Warning_Mode.
7771 (Compilation_Errors): Use new variable Record_Compilation_Errors to
7772 store the presence of an error.
7774 2017-01-12 Javier Miranda <miranda@adacore.com>
7776 * sem_ch13.adb (Analyze_Aspect_Specifications):
7777 For Interrupt_Handler and Attach_ Handler aspects, decorate the
7778 internally built reference to the protected procedure as coming
7779 from sources and force its analysis.
7781 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7783 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
7784 inherit predicates if any from the first_subtype of the parent,
7785 not from the anonymous parent type.
7786 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
7787 predicate is not a static subtype.
7789 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7791 * freeze.adb (Check_Suspicious_Convention): New procedure
7792 performing a warning check on discriminated record types with
7793 convention C or C++. Factored out of procedure Freeze_Record_Type,
7794 and changed to only apply to base types (to avoid spurious
7795 warnings on subtypes). Minor improvement of warning messages
7796 to refer to discriminated rather than variant record types.
7797 (Freeze_Record_Type): Remove code for performing a suspicious
7799 (Freeze_Entity): Only call Freeze_Record_Type
7800 on types that aren't declared within any enclosing generic units
7801 (rather than just excluding the type when the innermost scope
7802 is generic). Call Check_Suspicious_Convention whether or not
7803 the type is declared within a generic unit.
7804 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
7805 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
7808 2017-01-12 Tristan Gingold <gingold@adacore.com>
7810 * sysdep.c, adaint.c, rtinit.c, ming32.h:
7811 (__gnat_current_codepage): Renamed from CurrentCodePage
7812 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
7814 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7816 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
7817 quantified expressions, following AI12-050: the loop parameters
7818 of two quantified expressions are conformant if they have the
7821 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7823 * gcc-interface/Makefile.in: Clean up VxWorks targets.
7825 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7827 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
7828 Hnadle properly the attribute reference when it appears as part
7829 of an expression in another loop aspect.
7831 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7833 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
7834 subsidiary of Build_Initialization_Call, to complete generation
7835 of predicate checks on discriminants whose (sub)types have
7836 predicates, and to add checks on variants that do not have an
7838 * sem_util.adb (Gather_Components): A missing Others alternative is
7839 not an error when the type of the discriminant is a static predicate
7840 (and coverage has been checked when analyzing the case statement). A
7841 runtime check is generated to verify that a given discriminant
7842 satisfies the predicate (RM 3.8.1. (21.1/2)).
7844 2017-01-12 Yannick Moy <moy@adacore.com>
7846 * gnat1drv.adb (Adjust_Global_Switches): Only
7847 perform checking of exception mechanism when generating code.
7849 2017-01-12 Justin Squirek <squirek@adacore.com>
7851 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
7852 Remove handling of access component with invariant.
7853 (Build_Invariant_Procedure_Declaration): Remove return on class
7855 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
7856 conditional exception for component or array so Has_Own_Invariants
7857 flag is not falsly set.
7858 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
7859 wide type to have no invariant flags.
7861 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
7863 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
7864 sem_ch13.adb: Minor reformatting.
7866 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
7868 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
7869 adjustment primitive when the ancestor type was not properly frozen.
7870 (Gen_Assign): Guard against a missing initialization
7871 primitive when the component type was not properly frozen.
7872 (Initialize_Array_Component): Guard against a missing adjustment
7873 primitive when the component type was not properly frozen.
7874 (Initialize_Record_Component): Guard against a missing adjustment
7875 primitive when the component type was not properly frozen.
7876 (Process_Transient_Component_Completion): The transient object may
7877 not be finalized when its associated type was not properly frozen.
7878 * exp_ch3.adb (Build_Assignment): Guard against a missing
7879 adjustment primitive when the component type was not properly frozen.
7880 (Build_Initialization_Call): Guard against a missing
7881 initialization primitive when the associated type was not properly
7883 (Expand_N_Object_Declaration): Guard against a missing
7884 adjustment primitive when the base type was not properly frozen.
7885 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
7886 body when there is no adjustment primitive available. Create an
7887 empty Deep_Finalize body when there is no finalization primitive
7889 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
7890 missing finalization primitive when the designated type was
7891 not properly frozen.
7892 (Expand_N_Allocator): Guard against a missing initialization primitive
7893 when the designated type was not properly frozen.
7894 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
7895 only when the corresponding adjustment primitive is available.
7896 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
7897 adjustment/finalization statements only when there is an available
7898 primitive to carry out the action.
7899 (Build_Initialize_Statements): Generate the initialization/finalization
7900 statements only when there is an available primitive to carry out the
7902 (Make_Adjust_Call): Do not generate a call when the underlying
7903 type is not present due to a possible missing full view.
7904 (Make_Final_Call): Do not generate a call when the underlying
7905 type is not present due to a possible missing full view.
7906 (Make_Finalize_Address_Stmts): Generate an empty body when the
7907 designated type lacks a finalization primitive.
7908 (Make_Init_Call): Do not generate a call when the underlying type is
7909 not present due to a possible missing full view.
7910 (Process_Component_For_Adjust): Add the adjustment call only when the
7911 corresponding adjustment primitive is available.
7912 (Process_Component_For_Finalize): Add the finalization call only when
7913 the corresponding finalization primitive is available.
7914 (Process_Object_Declaration): Use a null statement to emulate a
7915 missing call to the finalization primitive of the object type.
7916 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
7917 (Make_Final_Call): Update the comment on usage.
7918 (Make_Init_Call): Update the comment on usage.
7919 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
7921 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7923 * einfo.ads: Update documentation of Address_Taken.
7924 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
7925 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
7926 for subprograms when setting Address_Taken flag.
7928 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
7930 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
7931 Configurable_Run_Time_Mode off when analysing with'ed predefined
7934 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7936 * sem_prag.adb: Minor reformatting.
7937 * sem_util.adb (Unique_Entity): fix result for
7938 bodies of entry families.
7940 2017-01-12 Justin Squirek <squirek@adacore.com>
7942 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
7943 Resolve_Suppressible in the pragma Assertion_Policy case.
7944 (Resolve_Suppressible): Created this function to factor out
7945 common code used to resolve Suppress to either Ignore or Check
7946 * snames.ads-tmpl: Add name for Suppressible.
7948 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7950 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
7952 * debug.adb: Minor comment fixes.
7954 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7956 * sem_util.adb (Unique_Entity): For concurrent
7957 bodies that are defined with stubs and complete a declaration
7958 of a single concurrent object return the entity of an implicit
7959 concurrent type, not the entity of the anonymous concurrent
7961 * debug.adb: -gnatd.J is no longer used.
7962 * make.adb (Globalize): Removed, no longer used.
7963 * sem_ch9.adb: minor typo in comment for entry index
7965 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
7967 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
7968 * exp_ch3.adb (Build_Init_Statements): As part of initialising
7969 the value record of a task, set its _Secondary_Stack_Size field
7971 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
7972 a _Secondary_Stack_Size field in the value record of
7973 the task if a Secondary_Stack_Size rep item is present.
7974 (Make_Task_Create_Call): Include secondary stack size
7975 parameter. If No_Secondary_Stack restriction is in place, passes
7977 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
7978 Secondary_Stack_Size.
7979 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
7980 function to define the overhead of the secondary stack.
7981 * s-tarest.adb (Create_Restricted_Task,
7982 Create_Restricted_Task_Sequential): Functions now include
7983 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
7984 * s-tarest.adb (Create_Restricted_Task,
7985 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
7986 include Secondary_Stack_Size parameter.
7987 (Task_Wrapper): Secondary stack now allocated to the size specified by
7988 the Secondary_Stack_Size parameter in the task's ATCB.
7989 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
7990 Secondary_Stack_Size component.
7991 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
7992 Create_Restricted_Task_Sequential): Function now include
7993 Secondary_Stack_Size parameter.
7994 (Task_Wrapper): Secondary stack now allocated to the size
7995 specified by the Secondary_Stack_Size parameter in the task's
7997 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
7998 to include Secondary_Stack_Size parameter.
7999 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
8000 Secondary_Stack_Size aspect, turning the aspect into its corresponding
8002 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
8003 * snames.adb-tmpl, snames.ads-tmpl: Added names
8004 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8005 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8007 2017-01-12 Yannick Moy <moy@adacore.com>
8009 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
8012 2017-01-12 Justin Squirek <squirek@adacore.com>
8014 * exp_attr.adb (Expand_N_Attribute_Reference):
8015 Fix Finalization_Size case by properly resolving the type after
8016 rewritting the node.
8018 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8020 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
8022 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
8023 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
8024 exp_sel.ads: Minor reformatting.
8026 2017-01-12 Justin Squirek <squirek@adacore.com>
8028 * exp_ch6.adb (Expand_Call): Add guard to prevent
8029 invariant checks from being created for internally generated
8032 2017-01-12 Bob Duff <duff@adacore.com>
8034 * lib-writ.ads: Remove incorrect comment.
8036 2017-01-12 Javier Miranda <miranda@adacore.com>
8038 * debug.adb (-gnatd.K): Enable generation of contract-only
8039 procedures in CodePeer mode.
8040 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
8042 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
8044 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
8046 (Get_Contract_Only_Missing_Body_Name): New subprogram.
8047 (Get_Contract_Only_Body): New subprogram.
8048 (Set_Contract_Only_Body): New subprogram.
8049 (Is_Contract_Only_Body): New subprogram.
8050 (Set_Is_Contract_Only_Body): New subprogram.
8051 (SCIL_Nodes): Replace table by hash-table.
8053 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8055 * exp_ch6.adb: Minor reformatting.
8056 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
8058 2017-01-12 Bob Duff <duff@adacore.com>
8060 * binde.adb (Forced): New reason for a dependence.
8061 (Force_Elab_Order): Implementation of the new switch.
8062 * binde.ads: Minor comment fixes.
8063 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
8064 long ago that is no longer supported; removed comment about that.
8065 * opt.ads (Force_Elab_Order_File): Name of file specified for
8067 * switch-b.adb: Parse -f switch.
8069 2017-01-12 Justin Squirek <squirek@adacore.com>
8071 * exp_ch6.adb (Check_View_Conversion): Created this function
8072 to properly chain calls to check type invariants that may be
8073 present in a subprogram call after the subprogram.
8074 (Expand_Call): Add a conditional to identify when a view conversion
8075 needs to be checked.
8076 * nlists.adb, nlists.ads (Prepend_New): New routine.
8077 (Prepend_New_To): New routine.
8079 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8081 * sinfo.ads: Minor reformatting.
8083 2017-01-12 Gary Dismukes <dismukes@adacore.com>
8085 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
8088 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8090 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
8091 variable Definite. Create a local object and pass its 'Access to the
8092 BIP function when the result type is either definite or it does not
8093 require any finalization or secondary stack management.
8095 2017-01-12 Bob Duff <duff@adacore.com>
8097 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
8098 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
8099 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
8100 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
8101 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
8102 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
8103 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8104 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
8105 Change name to Pragma_Name_Unmapped.
8106 (Pragma_Name_Mapped): Change name to Pragma_Name.
8107 This is because the "mapped" version should be the usual case.
8109 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
8111 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
8112 Is_Default_Init_Cond_Procedure, and
8113 Has_Inherited_Default_Init_Cond. Add uses of flags
8114 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
8115 (Default_Init_Cond_Procedure): Removed.
8116 (DIC_Procedure): New routine.
8117 (Has_Default_Init_Cond): Removed.
8118 (Has_DIC): New routine.
8119 (Has_Inheritable_Invariants): The attribute applies to the base type.
8120 (Has_Inherited_Default_Init_Cond): Removed.
8121 (Has_Inherited_DIC): New routine.
8122 (Has_Inherited_Invariants): The attribute applies to the base type.
8123 (Has_Own_DIC): New routine.
8124 (Has_Own_Invariants): The attribute applies to the base type.
8125 (Is_Default_Init_Cond_Procedure): Removed.
8126 (Is_DIC_Procedure): New routine.
8127 (Set_Default_Init_Cond_Procedure): Removed.
8128 (Set_DIC_Procedure): New routine.
8129 (Set_Has_Default_Init_Cond): Removed.
8130 (Set_Has_Inheritable_Invariants): The attribute applies
8132 (Set_Has_Inherited_Default_Init_Cond): Removed.
8133 (Set_Has_Inherited_DIC): New routine.
8134 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
8135 (Set_Has_Own_DIC): New routine.
8136 (Set_Has_Own_Invariants): The attribute applies to the base type.
8137 (Set_Is_Default_Init_Cond_Procedure): Removed.
8138 (Set_Is_DIC_Procedure): New routine.
8139 (Write_Entity_Flags): Update the output of all flags related to
8140 default initial condition.
8141 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
8142 of the call to the DIC procedure.
8143 (Freeze_Type): Generate the body of the DIC procedure.
8144 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
8145 all occurrences of Create_Append with Append_New_To. Do
8146 not generate an invariant procedure for a class-wide type.
8147 The generated body acts as a freeze action of the working type.
8148 (Build_Invariant_Procedure_Declaration): Do not generate an
8149 invariant procedure for a class-wide type.
8150 (Create_Append): Removed.
8151 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
8152 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
8153 class-wide pre/postcondition description and data structures from
8155 (Build_Class_Wide_Expression): Moved from Sem_Prag.
8156 (Build_DIC_Call): New routine.
8157 (Build_DIC_Procedure_Body): New routine.
8158 (Build_DIC_Procedure_Declaration): New routine.
8159 (Entity_Hash): Moved from Sem_Prag.
8160 (Find_DIC_Type): New routine.
8161 (Update_Primitives_Mapping): Reimplemented.
8162 (Update_Primitives_Mapping_Of_Types): New routine.
8163 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
8164 (Build_DIC_Call): New routine.
8165 (Build_DIC_Procedure_Body): New routine.
8166 (Build_DIC_Procedure_Declaration): New routine.
8167 (Update_Primitives_Mapping): Moved from Sem_Prag.
8168 (Update_Primitives_Mapping_Of_Types): New routine.
8169 * nlists.adb (Append_New): New routine.
8170 (Append_New_To): New routine.
8171 * nlists.ads (Append_New): New routine.
8172 (Append_New_To): New routine.
8173 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
8174 of DIC procedures here. This is now done at the end of the
8175 visible declarations, private declarations, and at the freeze
8177 (Analyze_Private_Extension_Declaration):
8178 A private extension inherits the DIC pragma of a parent type.
8179 (Analyze_Subtype_Declaration): No need to propagate invariant
8180 attributes to a subtype as those apply to the base type.
8181 (Build_Derived_Record_Type): No need to inherit invariants here
8182 as this is now done in Build_Derived_Type.
8183 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
8185 (Process_Full_View): Update the propagation of DIC attributes.
8186 (Propagate_Default_Init_Cond_Attributes): Removed.
8187 * sem_ch7.adb Add with and use clauses for Exp_Util.
8188 (Analyze_Package_Specification): Create the body of the DIC
8189 procedure at the end of the visible and private declarations.
8190 (Preserve_Full_Attributes): Propagate DIC attributes.
8191 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
8193 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
8194 * sem_elab.adb (Check_A_Call): Update the call to
8195 Is_Nontrivial_Default_Init_Cond_Procedure.
8196 * sem_prag.adb Remove the with and use clauses for
8197 GNAT.HTable. Move the handling of class- wide pre/postcondition
8198 description and data structures to Exp_Util.
8199 (Analyze_Pragma): Create the declaration of the DIC procedure. There
8200 is no need to propagate invariant-related attributes at this point
8201 as this is done in Build_Invariant_Procedure_Declaration.
8202 (Build_Class_Wide_Expression): Moved to Exp_Util.
8203 (Entity_Hash): Moved to Exp_Util.
8204 (Update_Primitives_Mapping): Moved to Exp_Util.
8205 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
8206 (Update_Primitives_Mapping): Moved to Exp_Util.
8207 * sem_util.adb: Remove with and use clauses for Ghost
8209 (Build_Default_Init_Cond_Call): Removed.
8210 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8211 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8212 (Get_Views): Reimplemented.
8213 (Has_Full_Default_Initialization): Reimplement the section on DIC.
8214 (Inherit_Default_Init_Cond_Procedure): Removed.
8215 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8216 (Is_Nontrivial_DIC_Procedure): New routine.
8217 (Is_Verifiable_DIC_Pragma): New routine.
8218 (Propagate_DIC_Attributes): New routine.
8219 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
8220 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8221 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8222 (Inherit_Default_Init_Cond_Procedure): Removed.
8223 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8224 (Is_Nontrivial_DIC_Procedure): New routine.
8225 (Is_Verifiable_DIC_Pragma): New routine.
8226 (Propagate_DIC_Attributes): New routine.
8227 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
8229 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
8231 (Expression_Copy): New routine along with pragma Inline.
8232 (Set_Expression_Copy): New routine along with pragma Inline.
8234 2017-01-06 Bob Duff <duff@adacore.com>
8236 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
8237 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
8238 we won't generate the call to s_stalib_adafinal when the main
8239 is not written in Ada.
8241 2017-01-06 Bob Duff <duff@adacore.com>
8243 * sem_prag.adb: Minor: remove pragma Warnings.
8245 2017-01-06 Tristan Gingold <gingold@adacore.com>
8247 * Makefile.rtl: Do not compile s-stchop by default.
8249 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
8251 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
8252 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
8253 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
8254 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
8255 Reverted previous change for now.
8257 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8259 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
8260 check to default discriminant value if checks are enabled.
8261 (Build_Assignment): If type of component has static predicate,
8262 apply check to its default value, if any.
8264 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
8266 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8267 * exp_ch3.adb (Build_Init_Statements): As part of initialising
8268 the value record of a task, set its _Secondary_Stack_Size field
8270 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8271 a _Secondary_Stack_Size field in the value record of
8272 the task if a Secondary_Stack_Size rep item is present.
8273 (Make_Task_Create_Call): Include secondary stack size
8274 parameter. If No_Secondary_Stack restriction is in place, passes
8276 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8277 Secondary_Stack_Size.
8278 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8279 function to define the overhead of the secondary stack.
8280 * s-tarest.adb (Create_Restricted_Task,
8281 Create_Restricted_Task_Sequential): Functions now include
8282 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8283 * s-tarest.adb (Create_Restricted_Task,
8284 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
8285 now include Secondary_Stack_Size parameter.
8287 Secondary stack now allocated to the size specified by the
8288 Secondary_Stack_Size parameter in the task's ATCB.
8289 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
8290 Secondary_Stack_Size component.
8291 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8292 Create_Restricted_Task_Sequential): Function now include
8293 Secondary_Stack_Size parameter.
8294 (Task_Wrapper): Secondary stack
8295 now allocated to the size specified by the Secondary_Stack_Size
8296 parameter in the task's ATCB.
8297 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
8298 for Secondary_Stack_Size aspect, turning the aspect into its
8299 corresponding internal attribute.
8300 (Analyze_Attribute_Definition):
8301 Process Secondary_Stack_Size attribute.
8302 * snames.adb-tmpl, snames.ads-tmpl: Added names
8303 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8304 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8306 2017-01-06 Pascal Obry <obry@adacore.com>
8308 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
8309 Sequential_IO and Direct_IO.
8311 2017-01-06 Bob Duff <duff@adacore.com>
8313 * snames.ads-tmpl (Renamed): New name for the pragma argument.
8314 * par-ch2.adb: Allow the new pragma (with analysis deferred
8316 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
8317 Keep a mapping from new pragma names to old names.
8318 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
8319 implement it by calling Map_Pragma_Name.
8320 * checks.adb, contracts.adb, einfo.adb, errout.adb,
8321 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
8322 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
8323 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
8324 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
8325 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8326 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
8329 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8331 * exp_ch9.adb: Minor reformatting.
8333 2017-01-06 Tristan Gingold <gingold@adacore.com>
8335 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
8336 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
8337 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
8339 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
8340 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
8341 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
8342 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
8344 2017-01-06 Bob Duff <duff@adacore.com>
8346 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
8347 dummy implementation of Map_Pragma_Name.
8349 2017-01-06 Tristan Gingold <gingold@adacore.com>
8351 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
8352 entry_body variable constant.
8353 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
8354 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
8356 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
8357 now access to constant.
8359 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8361 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
8362 reformatting and typo fixes.
8364 2017-01-06 Bob Duff <duff@adacore.com>
8366 * snames.ads-tmpl: New names for pragma renaming.
8367 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
8368 * par-prag.adb: Add new pragma name to case statement.
8369 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
8371 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
8372 Dummy implementation of Pragma_Name_Mapped.
8374 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8376 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
8377 better detect call within an entry_wrapper.
8378 * sem_res.adb (Resolve_Call): A protected call within an
8379 entity_wrapper is analyzed in the context of the protected
8380 object but corresponds to a pre-analysis and is not an access
8382 * sem_attr.adb: Minor reformatting.
8384 2017-01-06 Justin Squirek <squirek@adacore.com>
8386 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
8387 Finalization_Size to allow a prefix of any non-class-wide type.
8388 * sem_attr.ads Modify comment for Finalization_Size to include
8389 definite type use case.
8391 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8393 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
8394 on procedures that are wrappers created for entries that have
8396 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
8397 body is an entry_wrapper, compile it in the context of the
8398 synchronized type, because a precondition may refer to funtions
8400 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
8402 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
8403 within an Entry_Wrapper this is an external call whose target
8404 is the synchronized object that is the actual in the call to
8407 2017-01-06 Yannick Moy <moy@adacore.com>
8409 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
8410 in tree, which means not analyzing the previous prefix if the node has
8411 been rewritten into its prefix.
8413 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8415 * s-tpobop.adb: Minor reformatting.
8417 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8419 * checks.adb (Ensure_Valid): Do not generate a validity check
8420 within a generated predicate function, validity checks will have
8421 been applied earlier when required.
8423 2017-01-06 Tristan Gingold <gingold@adacore.com>
8425 * s-tpoben.ads (Protection_Entries): Add comment and reorder
8426 components for performances.
8427 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
8430 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8432 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
8433 If expression is compile-time known and obeys a static predicate
8434 it must be labelled as static, to prevent spurious warnings and
8435 run-time errors, e.g. in case statements. This is relevant when
8436 the expression is the result of constant-folding a type conversion
8437 whose expression is a variable with a known static value.
8439 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8441 * exp_attr.adb, sem_attr.ads: Minor reformatting.
8443 2017-01-06 Justin Squirek <squirek@adacore.com>
8445 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
8446 expansion of Finalization_Size attribute.
8447 * sem_attr.adb (Analyze_Attribute): Add entry to check the
8448 semantics of Finalization_Size.
8449 (Eval_Attribute): Add null entry for Finalization_Size.
8450 * sem_attr.ads: Add Finalization_Size to the implementation
8451 dependent attribute list.
8452 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
8454 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8456 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
8457 iterator specification with a serious syntactic error, transform
8458 construct into an infinite loop in order to continue analysis
8459 and prevent a compiler abort.
8461 2017-01-06 Tristan Gingold <gingold@adacore.com>
8463 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
8464 max_queue_lengths_array if unused.
8466 2017-01-06 Bob Duff <duff@adacore.com>
8468 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
8469 array access, in case "\" is at the end of Text.
8470 * stylesw.adb (Set_Style_Check_Options): Don't include input
8471 characters in the error message template, because they could
8472 be control characters such as "\", which Errout will try to
8475 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8477 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
8478 For a private type examine the visible declarations that follow
8479 the partial view, not just the private declarations that follow
8482 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8484 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
8487 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8489 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
8490 alias of the inherited op is the parent iterator, no need to
8491 examine dispatch table positions which might not be established
8492 yet if type is not frozen.
8493 * sem_disp.adb (Check_Controlling_Formals): The formal of a
8494 predicate function may be a subtype of a tagged type.
8495 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
8496 of representation items for the completion of a type extension
8497 where a predicate applies to the partial view.
8498 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
8499 parameter that designates function whose actual receives a
8500 predicate check, to improve warning message when the check will
8501 lead to infinite recursion.
8502 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
8503 Apply_Predicate_Check.
8505 2017-01-06 Tristan Gingold <gingold@adacore.com>
8507 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
8508 Gnat_Extended_Ravenscar.
8509 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
8511 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8513 * sem_util.ads: Minor typo fix and reformatting.
8515 2017-01-06 Yannick Moy <moy@adacore.com>
8517 * ghost.adb Minor fixing of references to SPARK RM.
8518 (Check_Ghost_Context): Check whether reference is to a lvalue
8519 before issuing an error about violation of SPARK RM 6.9(13)
8520 when declaration has Ghost policy Check and reference has Ghost
8522 * sem_util.adb Minor indentation.
8523 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
8524 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
8525 * sem_util.ads (Unique_Defining_Entity): Document the result
8526 for package body stubs.
8528 2017-01-06 Tristan Gingold <gingold@adacore.com>
8530 * raise-gcc.c (abort): Macro to call Abort_Propagation.
8531 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
8533 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8534 Do not generate the Entry_Max_Queue_Lengths_Array if all default
8536 * exp_util.adb (Corresponding_Runtime_Package): Consider
8537 Max_Queue_Length pragma.
8539 2017-01-06 Justin Squirek <squirek@adacore.com>
8541 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8542 Remove declaration generation in the case of
8543 System_Tasking_Protected_Objects_Single_Entry being used,
8544 and add a warning message when this is detected to occur.
8545 (Make_Initialize_Protection): Remove reference pass in the case
8546 of System_Tasking_Protected_Objects_Single_Entry.
8547 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
8548 * s-tposen.adb (Initialize_Protection_Entry): Remove
8549 Entry_Queue_Max parameter.
8550 * s-tposen.ads: Remove the types use to store the entry queue
8552 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
8554 2017-01-06 Yannick Moy <moy@adacore.com>
8556 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
8557 behavior of function, to also accept out of range positions
8558 and raise Constraint_Error in such case, and to copy sloc from
8559 literal if No_Location passed as location.
8560 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
8561 of functions to raise Constraint_Error in case of value not in
8564 2017-01-06 Tristan Gingold <gingold@adacore.com>
8566 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
8567 Invalidate_Stack_Cache.
8569 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
8571 * s-os_lib.adb: Minor fix to the signature of Readlink.
8573 2017-01-06 Javier Miranda <miranda@adacore.com>
8575 * sem_ch6.adb (Conforming_Types): Handle another
8576 confusion between views in a nested instance with an actual
8577 private type whose full view is not in scope.
8579 2017-01-06 Arnaud Charlet <charlet@adacore.com>
8581 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
8582 mark a rewritten if statement as explicit (Comes_From_Source).
8584 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8586 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
8588 2017-01-06 Tristan Gingold <gingold@adacore.com>
8590 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
8592 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8594 * sem_case.adb: Minor reformatting.
8596 2017-01-06 Thomas Quinot <quinot@adacore.com>
8598 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
8600 2017-01-06 Justin Squirek <squirek@adacore.com>
8602 * aspects.adb: Register aspect in Canonical_Aspect.
8603 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
8604 into respective tables.
8605 * einfo.ads, einfo.adb: Add a new attribute for
8606 handling the parameters for Pragma_Max_Entry_Queue
8607 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
8608 for accessing and setting were added as well.
8609 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
8610 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
8611 declaration for pramga arguments and store them in the protected
8613 (Make_Initialize_Protection): Pass a reference to
8614 the Entry_Max_Queue_Lengths_Array in the protected type node to
8616 * rtsfind.adb: Minor grammar fix.
8617 * rtsfind.ads: Register new types taken from the
8618 runtime libraries RE_Protected_Entry_Queue_Max and
8619 RE_Protected_Entry_Queue_Max_Array
8620 * s-tposen.adb, s-tpoben.adb
8621 (Initialize_Protection_Entry/Initialize_Protection_Entries):
8622 Add extra parameter and add assignment to local object.
8623 * s-tposen.ads, s-tpoben.ads: Add new types to
8624 store entry queue maximums and a field to the entry object record.
8625 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
8626 for Aspect_Max_Queue_Length.
8627 (Check_Aspect_At_Freeze_Point):
8628 Add aspect to list of aspects that don't require delayed analysis.
8629 * sem_prag.adb (Analyze_Pragma): Add case statement for
8630 Pragma_Max_Queue_Length, check semantics, and register arugments
8631 in the respective entry nodes.
8632 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
8633 and Has_Max_Queue_Length
8634 * snames.ads-tmpl: Add constant for the new aspect-name
8635 Name_Max_Queue_Length and corrasponding pragma.
8637 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8639 * exp_util.adb (Is_Controlled_Function_Call):
8640 Reimplemented. Consider any node which has an entity as the
8641 function call may appear in various ways.
8643 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8645 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
8646 an unchecked type conversion when performing a view conversion
8647 to/from a private type. In all other cases use a regular type
8648 conversion to ensure that any relevant checks are properly
8651 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8653 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
8655 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8657 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
8658 error on case expression that is an entity, when coverage is
8659 incomplete and entity has a static value obtained by local
8661 (Handle_Static_Predicate): New procedure, subsidiary of
8662 Check_Choices, to handle case alternatives that are either
8663 subtype names or subtype indications involving subtypes that
8664 have static predicates.
8666 2017-01-06 Thomas Quinot <quinot@adacore.com>
8668 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
8669 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
8671 2017-01-06 Bob Duff <duff@adacore.com>
8673 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
8674 Elaborate_All(P) to P itself. That could happen in obscure cases,
8675 and always introduced a cycle (P body must be elaborated before
8677 * lib-writ.ads: Comment clarification.
8678 * ali-util.ads: Minor comment fix.
8679 * ali.adb: Minor reformatting.
8681 2017-01-06 Tristan Gingold <gingold@adacore.com>
8683 * a-exexpr-gcc.adb: Improve comment.
8685 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
8687 * s-linux-mips.ads: Use correct signal and errno constants.
8688 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
8690 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
8692 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
8693 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
8696 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
8698 * gnatvsn.ads: Bump copyright year.
8700 2017-01-01 Jakub Jelinek <jakub@redhat.com>
8702 * gnat_ugn.texi: Bump @copying's copyright year.
8703 * gnat_rm.texi: Likewise.
8705 Copyright (C) 2017 Free Software Foundation, Inc.
8707 Copying and distribution of this file, with or without modification,
8708 are permitted in any medium without royalty provided the copyright
8709 notice and this notice are preserved.