1 2017-09-08 Yannick Moy <moy@adacore.com>
3 * sem_aux.adb, sem_aux.ads (Get_Called_Entity): New function to
4 return the entity associated with the call.
5 * sem_util.adb, sem_util.ads (Check_Function_Writable_Actuals):
6 Replace the internal Get_Function_Id with the new
7 Sem_Aux.Get_Called_Entity.
8 (Iterate_Call_Parameters): New
9 procedure to iterate on formals and actuals at the same time.
10 * sem_ch12.adb (Analyze_Subprogram_Instantiation):
11 Set SPARK_Mode from spec when set, for analysis
12 of instance. Restore after analysis of instance.
13 (Instantiate_Subprogram_Body): Set SPARK_Mode from body when
14 set, for analysis of body instance. Restored automatically at
15 the end of the subprogram.
16 * gnat1drv.adb (Adjust_Global_Switches): Set
17 Check_Validity_Of_Parameters to False in GNATprove mode.
18 * opt.ads (Check_Validity_Of_Parameters): Document switch to
21 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
23 * sem_util.adb (NCT_Tables_In_Use): Move to library level from...
24 (New_Copy_Tree): ...there. Reset the hash tables only if they
25 were used in the previous invocation.
26 * s-htable.adb: Fix typo.
28 2017-09-08 Bob Duff <duff@adacore.com>
30 * a-ssicst.adb (Open): Set File.Last_Op to the appropriate value.
32 2017-09-08 Arnaud Charlet <charlet@adacore.com>
34 * sem_aggr.adb: minor style fix.
36 2017-09-08 Bob Duff <duff@adacore.com>
38 * sprint.adb (Write_Corresponding_Source): Ignore if there is
39 no current source file.
40 (Write_Name_With_Col_Check, Write_Name_With_Col_Check_Sloc):
41 Print something helpful in case N is invalid.
42 * sprint.ads: Minor comment fix.
44 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
46 * exp_aggr.adb: (Aggr_Assignment_OK_For_Backend): Add early return for
49 2017-09-08 Bob Duff <duff@adacore.com>
51 * par-prag.adb, sem_prag.adb, snames.ads-tmpl: Implement pragma
52 Ada_2020, along the same lines as the other Ada version pragmas.
54 2017-09-08 Gary Dismukes <dismukes@adacore.com>
56 * sem_ch12.adb: Minor typo fixes and reformatting.
58 2017-09-08 Yannick Moy <moy@adacore.com>
60 * sem_aggr.adb (Resolve_Record_Aggregate):
61 Rewrite bounds of aggregate subexpressions which may depend on
62 discriminants of the enclosing aggregate.
64 2017-09-08 Yannick Moy <moy@adacore.com>
66 * sem_ch5.adb: Prevent assertion failure on illegal code.
68 2017-09-08 Yannick Moy <moy@adacore.com>
70 * lib-xref-spark_specific.adb (Add_SPARK_Xrefs.Is_SPARK_Scope): Avoid
71 calling Renamed_Entity on an entity which cannot be a renaming.
73 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
75 * exp_aggr.adb: Add with & use clause for Urealp.
76 (Aggr_Assignment_OK_For_Backend): Accept (almost all)
77 elementary types instead of just discrete types.
78 * sem_eval.adb (Expr_Value): Deal with N_Null for access types.
79 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>:
80 Be prepared for the FP zero value in the memset case. Add small
83 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
85 * s-htable.adb (Static_HTable.Reset): Use aggregate instead
88 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
90 * exp_aggr.adb (Expand_Array_Aggregate): Use New_Copy_Tree instead
91 of New_Copy because the latter leaves the syntactic structure of
92 the tree inconsistent (a child is accessible through two parents)
93 and prevents proper replication of itypes by subsequent calls
95 * exp_ch4.adb (Expand_Concatenate): Use New_Copy_Tree instead of
96 New_Copy because the latter leaves the syntactic structure of the
97 tree inconsistent (a child is accessible through two parents)
98 and prevents proper replication of itypes by subsequent calls
100 * sem_util.adb (In_Subtree): New routine.
101 (New_Copy_Tree): Reimplemented.
102 * sem_util.ads (In_Subtree): New routine.
103 (New_Copy_Tree): Reimplemented.
105 2017-09-08 Ed Schonberg <schonberg@adacore.com>
107 * sem_ch13.adb (Resolve_Aspect_Expressions): The expression
108 for aspect Default_Value is a static scalar value, but it does
109 not freeze the type. Yhis allows for subsequent representation
110 clauses for the type.
112 2017-09-08 Javier Miranda <miranda@adacore.com>
114 * sem_ch8.adb (Find_Direct_Name.Undefined): Do
115 not add entries into the undefined reference table when we are
116 compiling with errors ignored.
118 2017-09-08 Ed Schonberg <schonberg@adacore.com>
120 * sem_ch12.adb (Check_Formal_Packages): Do not apply conformance
121 check if the instance is within an enclosing instance body. The
122 formal package was legal in the enclosing generic, and is
123 legal in the enclosing instantiation. This optimisation may be
124 applicable elsewhere, and it also removes spurious errors that
125 may arise with on-the-fly processing of instantiations that
126 contain Inline_Always subprograms.
128 2017-09-08 Vincent Celier <celier@adacore.com>
130 * gnatcmd.adb: Disregard empty argument of GNAT driver.
132 2017-09-08 Justin Squirek <squirek@adacore.com>
134 * checks.adb (Insert_Valid_Check): Manually decorate
135 the generated temporary for range valdity checks.
137 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
139 * usage.adb (Usage): Document new -gnatw.q/-gnatw.Q switches.
141 2017-09-08 Justin Squirek <squirek@adacore.com>
143 * switch-c.adb (Scan_Front_End_Switches): Add new warning switch
144 case to handle underscore flags.
145 * warnsw.adb, warnsw.ads (Set_Underscore_Warning_Switch): Create
146 new procedure to handle underscores.
148 2017-09-08 Javier Miranda <miranda@adacore.com>
150 * exp_ch4.adb (Expand_N_Op_Divide): Reordering code that handles
151 divisions with fixed point results to avoid generating twice
152 the runtime check on divide by zero.
153 * checks.adb (Apply_Divide_Checks): Ensure that operands are
154 not evaluated twice (once for their runtime checks and once for
155 their regular computation).
157 2017-09-08 Yannick Moy <moy@adacore.com>
159 * sem_prag.adb (Analyze_Part_Of): Add missing
160 return statements after issuing errors. Add detection of
161 out-of-order item and single concurrent type.
163 2017-09-08 Nicolas Roche <roche@adacore.com>
165 * gcc-interface/Makefile.in, a-extiti.ads, s-taprop-linux.adb,
166 s-osinte-solaris.adb, a-intnam.ads, s-osinte-solaris.ads,
167 s-tpobop.adb, s-intman-android.adb, s-tasinf.adb, s-tpobop.ads,
168 s-tasinf.ads, i-vxinco.adb, a-exetim-posix.adb, i-vxinco.ads,
169 a-astaco.adb, a-astaco.ads, s-tporft.adb, s-tpoaal.adb, a-taside.adb,
170 a-taside.ads, s-tpopsp-posix.adb, s-tasdeb.adb, s-tasdeb.ads,
171 s-tpoben.adb, a-dinopr.ads, s-inmaop-vxworks.adb, s-tpoben.ads,
172 s-interr-vxworks.adb, s-interr-dummy.adb, s-tassta.adb,
173 a-intnam-mingw.ads, s-tassta.ads, s-taasde.adb, a-stcoed.ads,
174 s-taasde.ads, s-osinte-darwin.adb, s-proinf.adb, s-taprop-dummy.adb,
175 s-osinte-darwin.ads, s-proinf.ads, s-linux.ads, a-intnam-linux.ads,
176 s-tasren.adb, s-tasren.ads, s-mudido.adb, g-semaph.adb, s-mudido.ads,
177 s-taprop-posix.adb, g-semaph.ads, s-osinte-mingw.ads, s-vxwork-x86.ads,
178 s-tposen.adb, s-linux-sparc.ads, s-taprop-vxworks.adb, s-tasini.adb,
179 s-tposen.ads, s-tasini.ads, a-etgrbu.ads, s-interr-hwint.adb,
180 s-osinte-linux.ads, s-taprop.ads, s-tasque.adb, s-tasque.ads,
181 s-taenca.adb, s-taspri-vxworks.ads, s-taenca.ads, a-dynpri.adb,
182 s-tpopsp-solaris.adb, a-dynpri.ads, s-taprop-hpux-dce.adb,
183 a-interr.adb, a-intnam-freebsd.ads, s-tarest.adb, a-interr.ads,
184 s-intman-susv3.adb, a-synbar.adb, a-intnam-dummy.ads, s-tadeca.adb,
185 s-osinte-vxworks.adb, s-tarest.ads, s-taskin.adb, a-synbar.ads,
186 s-taspri-hpux-dce.ads, s-tadeca.ads, s-osinte-vxworks.ads,
187 s-taskin.ads, s-intman-solaris.adb, a-sytaco.adb, s-vxwext-kernel.adb,
188 s-mudido-affinity.adb, a-sytaco.ads, s-vxwext-kernel.ads, s-taprob.adb,
189 s-intman-mingw.adb, s-taprob.ads, s-osinte-kfreebsd-gnu.ads,
190 s-osinte-dummy.ads, s-osinte-gnu.adb, s-osinte-rtems.adb, s-interr.adb,
191 s-inmaop.ads, s-vxwext-rtp.adb, s-osinte-gnu.ads, s-osinte-rtems.ads,
192 a-synbar-posix.adb, s-interr.ads, s-taspri-posix-noaltstack.ads,
193 s-vxwext-rtp.ads, a-synbar-posix.ads, a-extiin.ads, s-osinte-posix.adb,
194 s-tpinop.adb, s-tasres.ads, s-tpinop.ads, a-disedf.ads, a-diroro.ads,
195 s-linux-alpha.ads, a-tasatt.adb, s-solita.adb, a-intnam-solaris.ads,
196 a-tasatt.ads, s-solita.ads, s-tasinf-solaris.adb, s-tasinf-solaris.ads,
197 s-vxwork-arm.ads, s-tpopsp-posix-foreign.adb, s-intman-dummy.adb,
198 s-intman.ads, s-stusta.adb, s-stusta.ads, s-intman-posix.adb,
199 s-tpopsp-vxworks.adb, s-inmaop-dummy.adb, s-taspri-mingw.ads,
200 a-intnam-darwin.ads, s-osinte-aix.adb, s-osinte-dragonfly.adb,
201 s-osinte-aix.ads, s-tasinf-mingw.adb, s-osinte-dragonfly.ads,
202 s-linux-hppa.ads, s-osinte-x32.adb, s-inmaop-posix.adb,
203 s-tasinf-mingw.ads, s-intman-vxworks.adb, s-linux-mips.ads,
204 s-intman-vxworks.ads, s-osinte-android.adb, s-tasinf-linux.adb,
205 s-osinte-android.ads, s-vxwork-ppc.ads, s-tasinf-linux.ads,
206 a-dispat.adb, a-dispat.ads, s-tadert.adb, g-thread.adb, s-tadert.ads,
207 g-thread.ads, a-intnam-hpux.ads, s-linux-android.ads, s-tataat.adb,
208 a-exetim.ads, s-tataat.ads, a-reatim.adb, a-reatim.ads, thread.c,
209 g-boubuf.adb, s-osinte-freebsd.adb, g-boubuf.ads, s-osinte-freebsd.ads,
210 s-tasuti.adb, s-taspri-dummy.ads, a-exetim-mingw.adb, s-linux-x32.ads,
211 s-tasuti.ads, g-signal.adb, a-exetim-mingw.ads, s-interr-sigaction.adb,
212 g-signal.ads, s-osinte-hpux.ads, a-intnam-vxworks.ads,
213 s-osinte-hpux-dce.adb, s-taspri-posix.ads, s-osinte-hpux-dce.ads,
214 s-tasinf-vxworks.ads, g-tastus.ads, s-tpopsp-tls.adb,
215 s-taprop-solaris.adb, a-retide.adb, a-exetim-darwin.adb, a-retide.ads,
216 s-vxwext.adb, s-vxwext.ads, a-rttiev.adb, a-rttiev.ads, g-boumai.ads,
217 a-exetim-default.ads, s-taprop-mingw.adb, s-taspri-solaris.ads,
218 a-intnam-aix.ads: Move libgnarl sources to libgnarl subdir.
220 2017-09-08 Arnaud Charlet <charlet@adacore.com>
222 * doc/share/conf.py, doc/share/latex_elements.py,
223 doc/share/ada_pygments.py, doc/Makefile: Improve support for Ada
226 2017-09-08 Arnaud Charlet <charlet@adacore.com>
228 * gnat_rm.texi, gnat_ugn.texi,
229 doc/gnat_ugn/the_gnat_compilation_model.rst,
230 doc/gnat_ugn/getting_started_with_gnat.rst,
231 doc/gnat_ugn/inline_assembler.rst,
232 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
233 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
234 doc/gnat_ugn/about_this_guide.rst,
235 doc/gnat_ugn/platform_specific_information.rst,
236 doc/gnat_ugn/example_of_binder_output.rst,
237 doc/gnat_ugn/gnat_and_program_execution.rst,
238 doc/gnat_ugn/gnat_utility_programs.rst,
239 doc/gnat_rm/implementation_of_specific_ada_features.rst,
240 doc/gnat_rm/interfacing_to_other_languages.rst,
241 doc/gnat_rm/implementation_defined_aspects.rst,
242 doc/gnat_rm/intrinsic_subprograms.rst,
243 doc/gnat_rm/implementation_defined_characteristics.rst,
244 doc/gnat_rm/implementation_advice.rst,
245 doc/gnat_rm/implementation_defined_attributes.rst,
246 doc/gnat_rm/compatibility_and_porting_guide.rst,
247 doc/gnat_rm/standard_library_routines.rst,
248 doc/gnat_rm/the_gnat_library.rst,
249 doc/gnat_rm/implementation_defined_pragmas.rst,
250 doc/gnat_rm/representation_clauses_and_pragmas.rst,
251 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
252 doc/gnat_rm/obsolescent_features.rst,
253 doc/gnat_rm/about_this_guide.rst,
254 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
255 doc/gnat_rm/implementation_of_ada_2012_features.rst,
257 doc/gnat_rm.rst: Update documentation.
259 2017-09-08 Arnaud Charlet <charlet@adacore.com>
261 * s-dwalin.ads, s-dwalin.adb, s-trasym-dwarf.adb, s-objrea.ads,
262 s-objrea.adb, s-tsmona-linux.adb, s-tsmona-mingw.adb: New.
263 * gcc-interface/Makefile.in: Enable s-trasym-dwarf.adb on x86*linux.
265 2017-09-08 Bob Duff <duff@adacore.com>
267 * s-ststop.ads, s-ststop.adb, rtsfind.ads (String_Input_Tag):
268 New routine to read the Tag robustly.
269 * exp_attr.adb (Input): Change the expansion of 'Input,
270 in the class-wide case, to call String_Input_Tag instead of
273 2017-09-08 Arnaud Charlet <charlet@adacore.com>
275 * s-rident.ads (Restriction_Id): reorder enum
276 literals, so that Pure_Barriers is no longer in range of the
277 Cunit_Boolean_Restrictions subtype.
279 2017-09-08 Nicolas Roche <roche@adacore.com>
281 * a-taster.ads, a-taster.adb: Move to libgnarl
282 * gcc-interface/Makefile.in: Remove obsolete targets. Code cleanups.
283 Add support for files in libgnarl.
285 2017-09-08 Ed Schonberg <schonberg@adacore.com>
287 * exp_ch4.adb (Expand_N_Type_Conversion): Do not apply
288 accessibility check to an interface conversion, whose purpose
289 is to perform a pointer adjustment in a dispatching call.
290 * exp_ch6.adb (Expand_Call_JHelper): Add accessibility checks
291 when the actual is a construct that involves a dereference of an
292 expression that includes a formal of the enclosing subprogram,
293 In such cases, the accessibility level of the actual is that of
294 the corresponding formal, which is passed in as an additional
295 actual in the outer call.
297 2017-09-08 Bob Duff <duff@adacore.com>
299 * exp_intr.adb (Add_Source_Info): Do not decode
300 file names; they were not encoded in the first place.
302 2017-09-08 Bob Duff <duff@adacore.com>
304 * a-tags.adb (Internal_Tag): Unsuppress checks, so we get
305 exceptions instead of crashes. Check for absurdly long strings
306 and empty strings. Empty strings cause trouble because they can
307 have super-null ranges (e.g. 100..10), which causes Ext_Copy to
308 be empty, which causes an array index out of bounds.
309 * s-ststop.adb (Input): Unsuppress checks, so we get exceptions
312 2017-09-08 Arnaud Charlet <charlet@adacore.com>
314 * sem_util.adb (Is_CCT_Instance): allow use in
315 the context of protected types.
317 2017-09-08 Arnaud Charlet <charlet@adacore.com>
319 * a-tigeli.adb: minor remove extra whitespace.
321 2017-09-08 Gary Dismukes <dismukes@adacore.com>
323 * par-ch4.adb: Reformatting of an error message.
325 2017-09-08 Javier Miranda <miranda@adacore.com>
327 * sem_ch3.adb (Resolve_Name): Under ASIS mode analyze overloaded
328 identifiers to ensure their correct decoration of names on
331 2017-09-08 Yannick Moy <moy@adacore.com>
333 * exp_attr.adb (Expand_Loop_Entry_Attribute): Do
334 not skip a loop coming from source which is rewritten into a loop.
336 2017-09-08 Ed Schonberg <schonberg@adacore.com>
338 * freeze.adb (Wrap_Imported_Subprogram): Indicate that the
339 wrapper has convention Ada, to prevent spurious warnings on
340 unconstrained array parameters.
342 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
344 * sem_prag.adb (Check_Variant): Use First_Non_Pragma/Next_Non_Pragma.
345 (Analyze_Pragma) <Pragma_Unchecked_Union>: Likewise.
347 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
349 * sem_ch6.adb (Freeze_Expr_Types): Rename Spec_Id into Def_Id.
351 2017-09-08 Arnaud Charlet <charlet@adacore.com>
353 * exp_intr.adb (Append_Entity_Name): Move to ...
354 * sem_util.ads, sem_util.adb: ... here to share it.
355 (Subprogram_Name): New subprogram, to compute the name of the enclosing
357 * errutil.adb (Error_Msg): Fill new field Node.
358 * erroutc.ads (Subprogram_Name_Ptr): New.
359 (Error_Msg_Object): New field Node.
360 * erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
361 * errout.adb (Error_Msg): New variant with node id parameter.
362 Fill new parameter Node when emitting messages. Revert previous
363 changes for Include_Subprogram_In_Messages.
364 * sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
365 generating warning message.
367 2017-09-08 Ed Schonberg <schonberg@adacore.com>
369 * par-ch4.adb (P_Iterated_Component_Association): Place construct
370 under -gnat2020 flag, given that it is a future feature of
372 * sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
373 defining identifier as referenced to prevent spurious warnings:
374 corresponding loop is expanded into one or more loops whose
375 variable has the same name, and the expression uses those names
376 and not the original one.
378 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
380 * sem_elab.adb (Check_A_Call): Do not consider
381 references to internal variables for SPARK semantics.
383 2017-09-08 Arnaud Charlet <charlet@adacore.com>
385 * inline.adb (In_Package_Spec): refine type of
386 the parameter from Node_Id to Entity_Id.
388 2017-09-08 Justin Squirek <squirek@adacore.com>
390 * exp_ch5.adb (Expand_Formal_Container_Loop):
391 Reset the scope of the loop parameter after it is reanalyzed.
393 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
395 * sem_util.ads (Set_Rep_Info): New inline procedure.
396 * sem_util.adb (Set_Rep_Info): Implement it.
397 * sem_ch3.adb (Process_Subtype): If the case of a constraint present,
398 always copy the representation aspects onto the subtype.
400 2017-09-08 Georges-Alex Jaloyan <jaloyan@adacore.com>
402 * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_key):
403 Correction of the return type from access type to option type.
404 (Simple_HTable): Moving the Instance_Data to ads file.
406 2017-09-08 Yannick Moy <moy@adacore.com>
408 * sem_prag.adb: Use System.Case_Util.To_Lower to simplify code.
410 2017-09-08 Arnaud Charlet <charlet@adacore.com>
412 * opt.ads (Include_Subprogram_In_Messages): New variable.
413 * errout.ads (Current_Subprogram_Ptr): New variable.
414 * errout.adb (Error_Msg): Prepend current subprogram info
415 in messages if Include_Subprogram_In_Messages is set.
416 * sem_util.adb (elab code): Initialize Current_Subprogram_Ptr to
418 * gnat1drv.adb (Adjust_Global_Switches): Set
419 Include_Subprogram_In_Messages when -gnatdJ is set.
420 * debug.adb: Document and reserve -gnatdJ.
422 2017-09-08 Georges-Axel Jaloyan <jaloyan@adacore.com>
424 * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_Key): New
425 functions to iterate over simple hastables.
426 (Load_Factor_HTable): Remove obsolete and inefficient implementation.
428 2017-09-08 Javier Miranda <miranda@adacore.com>
430 * exp_ch6.adb (Unqual_BIP_Function_Call): Adding
431 missing checks on the presence of Entity() before checking the
434 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
436 * sem_ch6.adb (Analyze_Expression_Function): Reorder some
437 statements, use local variable and remove unnecessary processing.
439 2017-09-08 Javier Miranda <miranda@adacore.com>
441 * exp_ch6.ads (Make_Build_In_Place_Iface_Call_In_Allocator): New
443 (Make_Build_In_Place_Iface_Call_In_Anonymous_Context): New subprogram.
444 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
446 (Unqual_BIP_Iface_Function_Call): New subprogram.
447 * exp_ch6.adb (Replace_Renaming_Declaration_Id): New
448 subprogram containing code that was previously inside
449 Make_Build_In_Place_Call_In_Object_Declaration since it is also
450 required for one of the new subprograms.
452 Invoke Make_Build_In_Place_Iface_Call_In_Anonymous_Context
453 (Expand_N_Extended_Return_Statement): Extend the
454 cases covered by an assertion on expected BIP object
456 (Make_Build_In_Place_Call_In_Assignment):
457 Removing unused code; found working on this ticket.
458 (Make_Build_In_Place_Call_In_Object_Declaration): Move the code
459 that replaces the internal name of the renaming declaration
460 into the new subprogram Replace_Renaming_Declaration_Id.
461 (Make_Build_In_Place_Iface_Call_In_Allocator): New subprogram.
462 (Make_Build_In_Place_Iface_Call_In_Anonymous_Context):
464 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
466 (Unqual_BIP_Iface_Function_Call): New subprogram.
467 * exp_ch3.adb (Expand_N_Object_Declaration): Invoke the new
468 subprogram Make_Build_In_Place_Iface_Call_In_Object_Declaration.
469 * exp_attr.adb (Expand_N_Attribute_Reference): Invoke the new
470 subprogram Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
471 * exp_ch4.adb (Expand_Allocator_Expression): Invoke the new
472 subprogram Make_Build_In_Place_Iface_Call_In_Allocator.
473 (Expand_N_Indexed_Component): Invoke the new subprogram
474 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
475 (Expand_N_Selected_Component): Invoke the new subprogram
476 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
477 (Expand_N_Slice): Invoke the new subprogram
478 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
479 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration):
480 Invoke the new subprogram
481 Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
483 2017-09-08 Javier Miranda <miranda@adacore.com>
485 * exp_disp.adb (Expand_Interface_Conversion): Fix handling of
486 access to interface types. Remove also the accessibility check.
488 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
490 * sem_ch6.adb (Freeze_Expr_Types): Really freeze
491 all the types that are referenced by the expression.
492 (Analyze_Expression_Function): Call Freeze_Expr_Types for
493 a completion instead of manually freezing the type of the
495 (Analyze_Subprogram_Body_Helper): Do not call Freeze_Expr_Types here.
497 2017-09-08 Ed Schonberg <schonberg@adacore.com>
499 * exp_prag.adb (Replace_Discriminals_Of_Protected_Op):
500 New procedure, auxiliary to Expand_Pragma_Check, to handle
501 references to the discriminants of a protected type within a
502 precondition of a protected operation. This is needed because
503 the original precondition has been analyzed in the context of
504 the protected declaration, but in the body of the operation
505 references to the discriminants have been replaved by references
506 to the discriminants of the target object, and these references
507 are only created when expanding the protected body.
509 2017-09-08 Yannick Moy <moy@adacore.com>
511 * sem_prag.adb (Analyze_Pragma): Issue more precise error messages on
514 2017-09-08 Ed Schonberg <schonberg@adacore.com>
516 * exp_attr.adb (Build_Record_VS_Func): If the record is an
517 unchecked union, do not emit checks for its (non-existent)
518 discriminants, or for variant parts that depend on them.
520 2017-09-08 Justin Squirek <squirek@adacore.com>
522 * sem_ch4.adb (Find_Equality_Types.Try_One_Interp,
523 Find_Comparison_Type.Try_One_Interp): Add check for generic
526 2017-09-08 Arnaud Charlet <charlet@adacore.com>
528 * sem_ch3.adb, layout.adb, layout.ads, exp_attr.adb, debug.adb,
529 exp_pakd.adb, sem_prag.adb, gnat1drv.adb, targparm.adb, targparm.ads,
530 repinfo.adb, exp_ch6.adb, exp_aggr.adb, sem_eval.adb, sem_ch13.adb,
531 exp_ch3.adb: Remove references to Frontend_Layout_On_Target and
532 remaining references to AAMP_On_Target.
534 2017-09-08 Ed Schonberg <schonberg@adacore.com>
536 * style.adb: Fix typo.
538 2017-09-08 Javier Miranda <miranda@adacore.com>
540 * einfo.adb (Underlying_Type): Add missing support for class-wide
541 types that come from the limited view.
542 * exp_attr.adb (Attribute_Address): Check class-wide type
543 interfaces using the underlying type to handle limited-withed
545 (Attribute_Tag): Check class-wide type interfaces using
546 the underlying type to handle limited-withed types.
548 2017-09-08 Ed Schonberg <schonberg@adacore.com>
550 * exp_ch5.adb (Expand_Predicated_Loop): Handle properly a loop
551 over a subtype of a type with a static predicate, taking into
552 account the predicate function of the parent type and the bounds
553 given in the loop specification.
554 * sem_ch3.adb (Inherit_Predicate_Flags): For qn Itype created for
555 a loop specification that is a subtype indication whose type mark
556 is a type with a static predicate, inherit predicate function,
557 used to build case statement for rewritten loop.
559 2017-09-08 Justin Squirek <squirek@adacore.com>
561 * lib-load.adb: Modify printing of error message to exclude file
564 2017-09-08 Arnaud Charlet <charlet@adacore.com>
566 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode):
567 don't inline subprograms declared in both visible and private
569 (In_Package_Spec): previously In_Package_Visible_Spec; now
570 detects subprograms declared both in visible and private parts
573 2017-09-08 Ed Schonberg <schonberg@adacore.com>
575 * exp_util.adb (Build_Invariant_Procedure_Declaration): If
576 the type is an anonymous array in an object declaration, whose
577 component type has an invariant, use the object declaration
578 as the insertion point for the invariant procedure, given that
579 there is no explicit type declaration for an anonymous array type.
581 2017-09-08 Bob Duff <duff@adacore.com>
583 * a-cbprqu.ads, a-cbdlli.adb: Suppress warnings.
585 2017-09-08 Bob Duff <duff@adacore.com>
587 * a-strfix.adb (Trim): Compute Low and High only if needed.
589 2017-09-08 Justin Squirek <squirek@adacore.com>
591 * lib-load.adb (Load_Main_Source): Add error output in the case a
592 source file is missing.
594 2017-09-08 Bob Duff <duff@adacore.com>
597 * a-textio.adb, a-witeio.adb, a-ztexio.adb (Set_WCEM): Use
598 Default_WCEM by default (i.e. if the encoding is not specified
601 2017-09-08 Bob Duff <duff@adacore.com>
603 * s-trasym.ads (Hexa_Traceback): If
604 Suppress_Hex is True, print "..." instead of a hexadecimal
606 * s-trasym.adb: Ignore No_Hex in this version.
609 2017-09-08 Bob Duff <duff@adacore.com>
611 * debug.adb: Minor reformatting.
613 2017-09-08 Bob Duff <duff@adacore.com>
615 * a-cbdlli.adb, a-cohama.adb, a-cohase.adb (Copy): Rewrite the
616 code so it doesn't trigger an "uninit var" warning.
618 2017-09-08 Nicolas Roche <roche@adacore.com>
620 * s-hibaen.ads: Remove obsolete file.
622 2017-09-08 Arnaud Charlet <charlet@adacore.com>
624 * a-locale.ads: Add comment explaining the state of this package.
626 2017-09-08 Arnaud Charlet <charlet@adacore.com>
628 * sem_util.adb (Is_CCT_Instance): Allow calls in the context
630 * sem_prag.ads, sem_prag.adb (Find_Related_Declaration_Or_Body):
631 allow calls in the context of package spec (for pragma
632 Initializes) and bodies (for pragma Refined_State).
634 2017-09-08 Bob Duff <duff@adacore.com>
636 * checks.adb (Insert_Valid_Check): Copy the Do_Range_Check flag to the
639 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
641 * debug.adb (dA): Adjust comment.
642 * gnat1drv.adb (Gnat1drv): Likewise.
643 * opt.ads (List_Representation_Info_Extended): New variable.
644 * repinfo.adb (List_Record_Info): Split implementation into...
645 (Compute_Max_Length): ...this. Recurse on records if requested.
646 (List_Record_Layout): Likewise.
647 * switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
648 statement, accept '0' and set List_Representation_Info_Extended
650 * usage.adb (Usage): Document new -gnatRe variant.
652 2017-09-08 Ed Schonberg <schonberg@adacore.com>
654 * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
655 Do not save the given entity in the global variable Default_Pool
656 if the pragma appears within a generic unit.
658 2017-09-08 Bob Duff <duff@adacore.com>
660 * errout.adb (Delete_Warning): Do not
661 decrement Warnings_Treated_As_Errors. This is called before
662 Warnings_Treated_As_Errors has been incremented to account for
663 this warning. Decrementing it here can lead to negative values
664 of Warnings_Treated_As_Errors, raising Constraint_Error in
665 checks-on builds, and causing the compiler to return an error
666 code in checks-off builds.
668 2017-09-08 Arnaud Charlet <charlet@adacore.com>
670 * sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
671 entities of named concurrent types as Ref_Id and not of anonymous
672 concurrent objects (because callers already know when a conversion
673 is necessary and can easily do it); also, do not expect protected
674 types or protected objects as Context_Id (because no flow-related
675 SPARK pragmas are attached there); reflect these changes in a
676 more precise comment.
678 2017-09-08 Olivier Hainque <hainque@adacore.com>
680 * g-altive.ads: Add documentation.
682 2017-09-08 Bob Duff <duff@adacore.com>
684 * sem_util.ads, debug.adb: Minor comment fix.
685 * erroutc.ads: Comment fix.
687 2017-09-08 Ed Schonberg <schonberg@adacore.com>
689 * sem_ch12.adb (Validate_Array_Type_Instance): Suppress check
690 for compatibility of component types of formal and actual in an
691 instantiation of a child unit, when the component type of the
692 formal is itself a formal of an enclosing generic.
694 2017-09-08 Arnaud Charlet <charlet@adacore.com>
696 * sem_util.ads, sem_util.adb (Is_CCT_Instance): moved from
697 sem_prag.adb to make it available for GNATprove; for concurrent
698 types replace custom scope climbing with Scope_Same_Or_Within; for
699 single concurrent objects add scope climbing (with Scope_Within),
700 which was not there (that's the primary semantic change of this
701 commit); also, when comparing a single concurrent object with
702 its corresponding concurrent type rely on equality of types,
703 not of objects (because that's simpler to code).
704 * sem_prag.adb (Is_CCT_Instance): lifted to sem_util.ads.
705 (Analyze_Global_Item): adjust special-casing of references to the
706 current instance of a concurrent unit in the Global contracts
707 of task types and single tasks objects; similar for references
708 in the protected operations and entries of protected types and
709 single protected objects (in all these cases the current instance
710 behaves as an implicit parameter and must not be mentioned in
711 the Global contract).
713 2017-09-08 Arnaud Charlet <charlet@adacore.com>
715 * exp_ch6.adb (Expand_Call_Helper): Introduce temporary for
716 function calls returning a record within a subprogram call,
719 2017-09-08 Ed Schonberg <schonberg@adacore.com>
721 * sem_ch8.adb (Find_Expanded_Name): Handle properly an expanded
722 name that designates the current instance of a child unit in its
723 own body and appears as the prefix of a reference to an entity
724 local to the child unit.
725 * exp_ch6.adb, freeze.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
728 2017-09-08 Yannick Moy <moy@adacore.com>
730 * sem_res.adb (Resolve_Equality_Op): Do not warn on comparisons that
733 2017-09-08 Tristan Gingold <gingold@adacore.com>
735 * sem_warn.adb (Check_Unused_Withs): Remove test that disabled
736 warnings on internal units in configurable run time mode.
738 2017-09-08 Bob Duff <duff@adacore.com>
740 * sem_ch3.adb (Build_Derived_Private_Type): Inherit
741 representation items from interfaces that the derived type
742 implements, not just from the parent type.
743 * sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
744 this to return an empty list when there are no interfaces.
745 * einfo.ads, sem_ch13.adb: Minor comment fixes.
746 * sem_attr.adb: Minor comment fix.
748 2017-09-08 Doug Rupp <rupp@adacore.com>
750 * sigtramp-vxworks.c [i386]: Adjust the kernel context for
753 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
755 * exp_ch4.adb (Expand_N_Allocator): Generate a
756 call to Allocate_Any_Controlled when the allocation does not
757 require any initialization.
759 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
761 * sem_util.adb (Copy_Node_With_Replacement):
762 Update the Renamed_Object field of a replicated object renaming
765 2017-09-08 Patrick Bernardi <bernardi@adacore.com>
767 * exp_ch9.adb (Is_Pure_Barrier): Allow type
768 conversions and components of objects. Simplified the detection
769 of the Count attribute by identifying the corresponding run-time
772 2017-09-08 Yannick Moy <moy@adacore.com>
774 * exp_ch9.adb, exp_disp.adb, repinfo.adb, sem_ch12.adb, sem_dim.adb,
775 sem_type.adb, sinfo.ads: Minor reformatting.
777 2017-09-08 Ed Schonberg <schonberg@adacore.com>
779 * freeze.adb (Has_Incomplete_Compoent): New predicate, subsidiary
780 of Freeze_Profile, used to inhibit the freezing of the profile
781 of an expression function declared within a nested package, when
782 some type in the profile depends on a private type declared in
783 an enclosing package.
785 2017-09-08 Bob Duff <duff@adacore.com>
787 * gnat1drv.adb (Gnat1drv): Do not set the Force_ALI_Tree_File flag in
788 the subunit case. It's still OK to set it in the "missing subunits"
789 case, because that won't cause the obsolete .ali files that cause
792 2017-09-08 Bob Duff <duff@adacore.com>
794 * sinput-l.adb: Remove unused "with Unchecked_Conversion;". It's
795 unclear why this didn't cause a warning.
796 * a-uncdea.ads, a-unccon.ads: Add "Ada." to names in the
797 pragmas. It's unclear why this didn't cause an error.
799 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
801 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration):
803 (Expand_SPARK_Potential_Renaming): Code clean up.
804 * sem_prag.adb (Analyze_Initialization_Item): Add a guard in case
805 the item does not have a proper entity.
806 (Analyze_Input_Item): Add a guard in case the item does not have a
808 (Collect_States_And_Objects): Include object renamings in the
809 items being collected.
810 (Resolve_State): Update the documentation of this routine.
811 * sem_util.adb (Entity_Of): Add circuitry to handle
812 renamings of function results.
813 (Remove_Entity): New routine.
814 (Remove_Overloaded_Entity): Take advantage of factorization.
815 * sem_util.ads (Entity_Of): Update the documentation
817 (Remove_Entity): New routine.
818 (Remove_Overloaded_Entity): Update the documentation of this
821 2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
823 * repinfo.adb (List_Record_Info): During first loop,
824 do not override the normalized position and first bit
825 if they have already been set. Move fallback code
826 for the packed case to the case where it belongs.
827 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
828 Also adjust the normalized position of components.
829 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): Likewise.
831 2017-09-08 Ed Schonberg <schonberg@adacore.com>
833 * exp_disp.adb (Make_DT, Set_All_DT_Position): Handle properly
834 the placement of a primitive operation O that renames an operation
835 R declared in an inner package, and which is thus not a primitive
836 of the dispatching type of O. In this case O is a new primitive
837 and does not inherit its dispatch table position from R (which
840 2017-09-08 Ed Schonberg <schonberg@adacore.com>
842 * sem_dim.adb (Analyze_Dimension_If_Expression,
843 Analyze_Dimension_Case_Expression): new subprograms to verify
844 the dimensional correctness of Ada2012 conditional expressions,
845 and set properly the dimensions of the construct.
846 * sem_res.adb (Resolve_If_Expression, Resolve_Case_Expression)):
847 call Analyze_Dimension.
849 2017-09-08 Ed Schonberg <schonberg@adacore.com>
851 * sem_type.adb (Expand_Interface_Conversion): Prevent an infinite
852 loop on an interface declared as a private extension of another
853 synchronized interface.
855 2017-09-08 Ed Schonberg <schonberg@adacore.com>
857 * sem_ch12.adb (Check_Generic_Parent): New procedure within
858 Analyze_Associations, to handle actual packages that depend on
859 previous instances. If a package IAP that is an instantiation is
860 used as an actual in a subsequent instantiation SI in the same
861 scope, and IAP has a body, IAP must be frozen before SI. If
862 the generic parent of IAP is itself declared in a previous
863 instantiation in the same scope, that instantiation must also
865 (Install_Body): Prevent double insertion of freeze node for
868 2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
870 * sem_prag.adb (Resolve_State): Update the
871 comment on documentation. Generate a reference to the state once
872 resolution takes place.
874 2017-09-08 Ed Schonberg <schonberg@adacore.com>
876 * sem_ch13.adb (Analyze_Aspect_Specifications, case
877 Linker_Section): If the aspect applies to an object declaration
878 with explicit initialization, do not delay the freezing of the
879 object, to prevent access-before-elaboration in the generated
882 2017-09-08 Ed Schonberg <schonberg@adacore.com>
884 * a-wtdeio.adb (Put, all versions): Use Long_Long_Integer
885 (Integer_Value (Item)) when the size of the fixed decimal type
886 is larger than Integer.
888 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
891 * gcc-interface/decl.c (copy_and_substitute_in_layout): Put the fields
892 in order of increasing position in more cases.
894 2017-09-07 Yannick Moy <moy@adacore.com>
896 * a-exetim-mingw.ads: Add contract Global=>null
897 on all operations that are modeled as having no read or write
898 of global variables in SPARK.
900 2017-09-07 Raphael Amiard <amiard@adacore.com>
902 * a-chtgop.adb, a-chtgop.ads (Generic_Iteration_With_Position): Added
903 to Hmaps.Generic_Ops.
904 * a-cohama.adb (Ada.Containers.Hmaps.Iterate): Pass proper position in
906 * a-cihama.adb (Ada.Containers.Indefinite_Hmaps.Iterate): Pass pos in
908 * a-cohase.adb (Ada.Containers.Hashed_Sets.Iterate): Pass proper
911 2017-09-07 Javier Miranda <miranda@adacore.com>
913 * sem_elab.adb (Check_Task_Activation): Adding switch -gnatd.y to
914 allow disabling the generation of implicit pragma Elaborate_All
917 2017-09-07 Javier Miranda <miranda@adacore.com>
919 * exp_disp.adb (Make_Tags): Avoid suffix counter
920 in the external name of the elaboration flag. Required to fix
921 the regressions introduced by the initial version of this patch.
923 2017-09-07 Bob Duff <duff@adacore.com>
925 * sem_ch6.adb (Analyze_Function_Return): Do not
926 insert an explicit conversion to force the displacement of the
927 "this" pointer to reference the secondary dispatch table in the
928 case where the return statement is returning a raise expression,
929 as in "return raise ...".
931 2017-09-07 Arnaud Charlet <charlet@adacore.com>
933 * sem_disp.adb (Is_User_Defined_Equality): Removed procedure.
934 * sem_util.ads, sem_util.adb (Is_User_Defined_Equality): Copied
935 procedure from sem_disp.adb.
936 * sem_ch12.ads (Get_Unit_Instantiation_Node): rename Package
938 * sem_ch12.adb (Get_Unit_Instantiation_Node): function extended to
939 return the instantiation node for subprograms. Update references
940 to Get_Unit_Instantiation_Node.
941 * sem_ch7.adb (Install_Parent_Private_Declarations): update
942 reference to Get_Unit_Instantiation_Node.
943 * exp_dist.adb (Build_Package_Stubs): update reference to
944 Get_Unit_Instantiation_Node.
945 * sem_ch9.adb: minor typo in comment.
946 * lib-xref-spark_specific.adb
947 (Traverse_Declaration_Or_Statement): traverse into task type
950 2017-09-07 Ed Schonberg <schonberg@adacore.com>
952 * sem_dim.adb (Analyze_Dimension_Type_Conversion): New procedure
953 to handle properly various cases of type conversions where the
954 target type and/or the expression carry dimension information.
955 (Dimension_System_Root); If a subtype carries dimension
956 information, obtain the source parent type that carries the
959 2017-09-07 Dmitriy Anisimkov <anisimko@adacore.com>
961 * g-socket.adb, g-socket.ads (GNAT.Sockets.To_Ada): New routine.
963 2017-09-07 Ed Schonberg <schonberg@adacore.com>
965 * exp_attr.adb (Expand_N_Attribute_Reference, case 'Constrained):
966 If the prefix is a reference to an object, rewrite it as an
967 explicit dereference, as required by 3.7.2 (2) and as is done
968 with most other attributes whose prefix is an access value.
970 2017-09-07 Bob Duff <duff@adacore.com>
972 * par-ch13.adb: Set the Inside_Depends flag if we are inside a
973 Refined_Depends aspect.
974 * par-ch2.adb: Set the Inside_Depends flag if we are inside a
975 Refined_Depends pragma.
976 * scans.ads: Fix documentation of Inside_Depends flag.
977 * styleg.adb, styleg.ads: Minor reformatting and comment fixes.
979 2017-09-07 Hristian Kirtchev <kirtchev@adacore.com>
981 * exp_ch7.adb (Insert_Actions_In_Scope_Around):
982 Account for the case where the are no lists to insert, but the
983 secondary stack still requires management.
984 * a-chtgop.adb, a-cihama.adb, a-cohama.adb, a-cohase.adb, a-tags.adb,
985 comperr.adb, einfo.adb, exp_aggr.adb, exp_ch3.adb, exp_disp.adb,
986 lib-xref.adb, lib-xref-spark_specific.adb, sem_ch12.adb, sem_ch13.adb,
987 sem_ch6.adb, sem_dim.adb, sem_dim.ads, sem_elab.adb, sem_prag.adb:
990 2017-09-07 Vincent Celier <celier@adacore.com>
992 * clean.adb: Do not get the target parameters before calling
995 2017-09-07 Nicolas Roche <roche@adacore.com>
997 * s-osinte-solaris-posix.ads: Removed.
999 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1001 * sem_prag.adb (Collect_States_And_Objects): Detect also instances of
1002 single concurrent objects.
1004 2017-09-07 Javier Miranda <miranda@adacore.com>
1006 * s-regexp.ads: Fix documentation of the globbing grammar.
1008 2017-09-07 Gary Dismukes <dismukes@adacore.com>
1010 * a-tags.ads, einfo.ads, exp_disp.ads: Minor reformatting.
1012 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1014 * gnat1drv.adb (Gnat1drv): Enable pragma Ignore_Pragma (Global)
1015 in CodePeer mode, to support more legacy code automatically.
1017 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1019 * exp_disp.adb (Replace_Formals): If thr formal is classwide,
1020 and thus not a controlling argument, preserve its type after
1021 rewriting because it may appear in an nested call with a classwide
1024 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1026 * comperr.adb (Delete_SCIL_Files): Handle case of
1027 N_Package_Instantiation.
1029 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1031 * sem_ch10.adb (Remove_Private_With_Clause): If a private with
1032 clause for a unit U appears in a context that includes a regular
1033 with_clause on U, rewrite the redundant private clause into a null
1034 statement, rather than removing it altogether from the context,
1035 so that ASIS tools can reconstruct the original source.
1037 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1039 * sem_ch13.adb (Check_Aspect_At_Freeze_Point): The expression
1040 for aspect Small can be of any real type (not only a universal
1041 real literal) as long as it is a static constant.
1043 2017-09-07 Thomas Quinot <quinot@adacore.com>
1045 * par_sco.adb: Minor reformatting.
1047 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1049 * s-parame-ae653.ads: Removed.
1051 2017-09-07 Nicolas Roche <roche@adacore.com>
1053 * s-traces-default.adb, s-trafor-default.adb, s-trafor-default.ads,
1054 s-traces.adb, s-traces.ads, s-tratas-default.adb, s-tfsetr-default.adb,
1055 s-tfsetr-vxworks.adb, s-tratas.adb, s-tratas.ads, s-tasuti.adb,
1056 s-parame-hpux.ads, s-tassta.adb, s-taasde.adb, s-tasren.adb,
1057 s-taprob.adb, a-caldel.adb, s-parame.ads, Makefile.rtl, s-tpobop.adb,
1058 s-taenca.adb, s-parame-vxworks.ads: Remove support for System.Traces.
1060 2017-09-07 Yannick Moy <moy@adacore.com>
1062 * a-ngelfu.ads Add preconditions to all functions
1063 listed in Ada RM A.5.1(19-33) as having constraints on inputs.
1065 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1067 * lib-xref.adb (Generate_Reference): ignore
1068 references to entities which are Part_Of single concurrent
1071 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1073 * sem_ch7.adb (Hide_Public_Entities): Add paragraph to main
1076 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1078 * a-taside.adb (Activation_Is_Complete): Raise Program_Error if
1079 Null_Task_Id is passed.
1081 2017-09-07 Javier Miranda <miranda@adacore.com>
1083 * einfo.ads, einfo.adb (Access_Disp_Table_Elab_Flag): New
1084 attribute. Defined for record types and subtypes.
1085 * exp_ch3.ads (Init_Secondary_Tags): Adding new formal
1086 (Init_Tags_List) to facilitate generating separate code in the
1087 IP routine to initialize the object components and for completing
1088 the elaboration of dispatch tables.
1089 * exp_ch3.adb (Build_Init_Procedure): Improve the code
1090 generated in the IP routines by means of keeping separate
1091 the initialization of the object components from the
1092 initialization of its dispatch tables. (Init_Secondary_Tags):
1093 Adding new formal (Init_Tags_List) and adjusting calls to
1094 Ada.Tags.Set_Dynamic_Offset_To_Top since it has a new formal;
1095 adjusting also calls to Ada.Tags.Register_Interface_Offset
1096 because the type of one of its formals has been changed.
1097 * a-tags.ads, a-tags.adb (Register_Interface_Offset): Profile
1098 modified. Instead of receiving a pointer to an object this
1099 routine receives now a primary tag.
1100 (Set_Dyanic_Offset_To_Top): Profile modified. This routine receives an
1101 additional formal: the tag of the primary dispatch table.
1102 * exp_disp.ads (Elab_Flag_Needed): New subprogram.
1103 * exp_disp.adb (Elab_Flag_Needed): New subprogram.
1104 (Make_Tags): Adding the declaration of the elaboration flag (if needed).
1105 * exp_aggr.adb (Build_Record_Aggr_Code): Adding actual of new
1106 formal in calls to Init_Secondary_Tags.
1108 2017-09-07 Javier Miranda <miranda@adacore.com>
1110 * ghost.adb (Mark_And_Set_Ghost_Instantiation.Check_Ghost_Actuals): New
1112 * sem_prag.adb (Pragma_Ghost): Add missing support for ghost
1113 applied to generic subprograms.
1115 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1117 * sem_util.adb (Check_Part_Of_Reference): rename Conc_Typ to Conc_Obj
1118 (because it refers to the anonymous concurrent object, not its type);
1119 fix condition for emitting error message about task/protected type,
1121 2017-09-07 Bob Duff <duff@adacore.com>
1123 * binde.adb (Debug_Flag_Old): If both -do and -dp
1124 are specified, behave as if just -do was specified, rather than
1127 2017-09-07 Nicolas Roche <roche@adacore.com>
1129 * system-vxworks-sparcv9.ads, s-vxwork-m68k.ads, s-vxwork-mips.ads,
1130 system-vxworks-m68k.ads, system-vxworks-mips.ads: Removed.
1132 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1134 * sem_prag.adb (Find_Role): The Global_Seen flag
1135 is now consulted not only for abstract states and variables,
1136 but for all kinds of items.
1137 (Collect_Subprogram_Inputs_Outputs): Do not process formal
1138 generic parameters, because unlike ordinary formal parameters,
1139 generic formals only act as input/ outputs if they are explicitly
1140 mentioned in a Global contract.
1142 2017-09-07 Yannick Moy <moy@adacore.com>
1144 * ghost.adb (Check_Ghost_Context): Do not err on ghost code inside
1145 predicate procedure. Check predicate pragma/aspect with Ghost entity.
1146 * exp_ch6.adb, par-ch6.adb, sem_ch13.adb, sem_prag.adb; Minor
1149 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1151 * sem_aggr.adb: Move New_Copy_Tree_And_Dimensions to sem_dim
1153 * sem_ch3.adb (Build_Derived_Record_Type):i Call
1154 Copy_Dimensions_Of_Components after creating the copy of the
1156 * sem_dim.ads, sem_dim.adb (Copy_Dimensions_Of_Components): For a
1157 derived recor type, copy the dikensions if any of each component
1158 of the parent record to the corresponding component declarations
1159 of the derived record. These expressions are used among other
1160 things as default values in aggregates with box associations.
1161 * a-dirval-mingw.adb, g-cgi.adb, gnatcmd.adb, lib-xref.adb,
1162 repinfo.adb, sem_attr.adb, sem_ch10.adb, sem_ch6.adb, sem_prag.adb:
1165 2017-09-07 Arnaud Charlet <charlet@adacore.com>
1167 * sem_util.adb: Remove extra space after THEN.
1169 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1171 * sem_ch7.adb (Has_Referencer): For a subprogram renaming,
1172 also mark the renamed subprogram as referenced.
1174 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1176 * par-ch6.adb (P_Subprogram): Improve error message on null
1177 procedure with misplaced aspect specification, which the parser
1178 first attempts to interpret as a malformed expression function.
1180 2017-09-07 Gary Dismukes <dismukes@adacore.com>
1182 * sem_attr.adb (Analyze_Attribute_Old_Result):
1183 Allow attributes Result and Old in the case of an expression
1186 2017-09-07 Justin Squirek <squirek@adacore.com>
1188 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Propagate
1189 Volatile to subcomponents.
1191 2017-09-07 Bob Duff <duff@adacore.com>
1193 * exp_ch7.adb (Find_Last_Init): Check for the
1194 case where a build-in-place function call has been replaced by a
1195 'Reference attribute reference.
1197 2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
1199 * sem_ch7.adb (Has_Referencer): Recurse on Actions of freeze
1202 2017-09-07 Bob Duff <duff@adacore.com>
1204 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration,
1205 Make_Build_In_Place_Call_In_Anonymous_Context): Do not use the
1206 secondary stack for all functions that return limited tagged
1207 types -- just do it for dispatching calls. Misc cleanup.
1208 * sem_util.ads, sem_util.adb (Unqual_Conv): New function to
1209 remove qualifications and type conversions. Fix various bugs
1210 where only a single level of qualification or conversion was
1211 removed, so e.g. "T1'(T2'(X))" would incorrectly return "T2'(X)"
1213 * checks.adb, exp_util.ads, exp_util.adb, sem_res.adb: Misc related
1216 2017-09-07 Ed Schonberg <schonberg@adacore.com>
1218 * sem_ch6.adb (setr_Actual_Subtypes): Within a predicate function
1219 do not create actual subtypes that may generate further predicate
1221 * sem_ch13.adb (Build_Predicate_Functions): Indicate that entity
1222 of body is a predicate function as well.
1223 (Resolve_Aspect_Expressions, Resolve_Name): For a component
1224 association, only the expression needs resolution, not the name.
1225 (Resolve_Aspect_Expressions, case Predicates): Construct and
1226 analyze the predicate function declaration in the scope of the
1227 type, before making the type and its discriminants visible.
1229 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1231 * gcc-interface/decl.c (warn_on_field_placement): Issue the warning
1232 only if the record type itself comes from source.
1234 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1236 * sem_ch5.adb: Minor reformatting and a typo fix
1238 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1240 * sinput-l.ads: minor remove extra period at the end of comment
1242 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1244 * sem_prag.adb (Add_Item_To_Name_Buffer): remove support for
1246 (Find_Role): remove support for E_Discriminant.
1248 2017-09-06 Javier Miranda <miranda@adacore.com>
1250 * exp_ch6.adb (Expand_Simple_Function_Return):
1251 Add missing implicit type conversion to force displacement of the
1254 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1256 * sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting.
1258 2017-09-06 Yannick Moy <moy@adacore.com>
1260 * sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set
1261 global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once.
1263 2017-09-06 Bob Duff <duff@adacore.com>
1265 * sem_ch8.adb: Change Assert to be consistent with
1268 2017-09-06 Bob Duff <duff@adacore.com>
1270 * binde.adb (Find_Elab_Order): Do not run Elab_Old unless
1271 requested. Previously, the -do switch meant "run Elab_New and
1272 Elab_Old and use the order chosen by Elab_Old, possibly with
1273 debugging printouts comparing the two orders." Now it means
1274 "do not run Elab_New." This is of use if there are bugs that
1275 cause Elab_New to crash.
1276 (Elab_Position, Num_Chosen): Change type to Nat, to avoid various
1278 * ali.ads (Elab_Position): Change type to Nat, to avoid various
1281 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1283 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix
1284 reference to SPARK RM.
1286 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1288 * layout.adb: Use SSU short hand consistently throughout the file.
1290 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1292 * freeze.adb (Freeze_Record_Type)
1293 <Sized_Component_Total_Round_RM_Size>: New local variable to
1294 accumulate the rounded RM_Size of components. Update it for
1295 every component whose RM_Size is statically known. Add missing
1296 guard to check that bit packing is really required before issuing
1297 the error about packing. Swap condition for clarity's sake.
1298 * sem_prag.adb (Usage_Error): Fix reference to SPARK RM in comment.
1300 2017-09-06 Fedor Rybin <frybin@adacore.com>
1302 * makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb,
1303 mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads,
1304 mlib-tgt-specific.adb, mlib-tgt-specific.ads,
1305 mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
1306 mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb,
1307 mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb,
1308 mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb,
1309 mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads,
1310 prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb,
1311 prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads,
1312 prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb,
1313 prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads,
1314 prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb,
1315 prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads,
1316 prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete
1317 project manager sources.
1319 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1321 * sem_ch5.adb (Analyze_Assigment): If the left-hand side is an
1322 entity of a mutable type and the right-hand side is a conditional
1323 expression, resolve the alternatives of the conditional using
1324 the base type of the target entity, because the alternatives
1325 may have distinct subtypes. This is particularly relevant if
1326 the alternatives are aggregates.
1328 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1330 * checks.adb (Apply_Predicate_Check): If the expression is an
1331 aggregate that is the RHS of an assignment, apply the check to
1332 the LHS after the assignment, rather than to the aggregate. This
1333 is more efficient than creating a temporary for the aggregate,
1334 and prevents back-end crashes when the aggregate includes a
1335 dynamic "others' association.
1337 2017-09-06 Yannick Moy <moy@adacore.com>
1339 * sem_ch12.adb (Analyze_Instance_And_Renamings):
1340 Set variable to ignore SPARK_Mode in instance before the analysis
1341 of the generated package declaration.
1343 2017-09-06 Yannick Moy <moy@adacore.com>
1345 * sem_res.adb (Resolve_Call): Do not issue a
1346 message for calls inside expression function, unless body was
1347 seen and is candidate for inlining.
1349 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1351 * sem_aux.adb (Is_Generic_Formal): Handle properly formal packages.
1352 * sem_ch3.adb (Analyze_Declarations): In a generic subprogram
1353 body. do not freeze the formals of the generic unit.
1355 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1357 * errout.adb (Error_Msg): Separate the
1358 treatment for warning vs. style messages in inlinings and
1359 instantiations. Prevents blowups on calls to Warn_Insertion for
1360 style messages, which should not be called in that case because
1361 Warning_Msg_Char is not set.
1363 2017-09-06 Justin Squirek <squirek@adacore.com>
1365 * sem_prag.adb (Check_VFA_Conflicts): Created
1366 to group all Volatile_Full_Access checks relating to other
1367 representation pragmas (Mark_Component_Or_Object): Created
1368 to centeralize the flagging of attributes for the record type
1369 component case, a pragma applied individually to a component, and
1371 (Process_Atomic_Independent_Shared_Volatile):
1372 Add propagation of certain pragmas to record components and move
1373 evaluation of VFA checks
1375 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1377 * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram):
1378 Do not warn on conditions that are not obeyed for Inline_Always
1379 subprograms, when assertions are not enabled.
1381 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1383 * sem_util.adb (Unique_Entity): For abstract states return their
1386 2017-09-06 Bob Duff <duff@adacore.com>
1388 * sem_ch12.adb (Copy_Generic_Node): When we copy a node
1389 that is a proper body corresponding to a stub, we defer the
1390 adjustment of the sloc until after the correct adjustment has
1391 been computed. Otherwise, Adjust_Instantiation_Sloc will ignore
1392 the adjustment, because it will be outside the range in (the old,
1393 incorrect) S_Adjustment.
1394 * inline.adb: Use named notation for readability and uniformity.
1395 * sinput-l.adb: Minor improvements to debugging output printed
1397 * sinput-l.ads (Create_Instantiation_Source): Minor comment
1400 2017-09-06 Vincent Celier <celier@adacore.com>
1402 * make.adb: Do not invoke gprbuild for -bargs -P.
1404 2017-09-06 Sylvain Dailler <dailler@adacore.com>
1406 * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Adding a
1407 case when Op is of kind N_Qualified_Expression. In this case,
1408 the function is called recursively on the subexpression like in
1410 * make.adb: Minor reformatting
1412 2017-09-06 Justin Squirek <squirek@adacore.com>
1414 * einfo.adb (Set_Linker_Section_Pragma): Modify
1415 Set_Linker_Section_Pragma to be consistant with the "getter"
1416 Linker_Section_Pragma.
1417 * exp_ch5.adb (Expand_Formal_Container_Loop): Add proper error
1418 checking for container loops so that the index cursor is not
1419 directly changable by the user with the use of E_Loop_Parameter.
1420 * sem_ch5.adb (Analyze_Block_Statement): Revert previous change.
1421 * sem_warn.adb (Check_References): Revert previous change.
1423 2017-09-06 Bob Duff <duff@adacore.com>
1425 * exp_util.adb (Is_Displace_Call): Make sure it works for indirect
1428 2017-09-06 Yannick Moy <moy@adacore.com>
1430 * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object
1431 declarations to only consider valid uses of Global/Depends those on
1432 single concurrent objects.
1434 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1436 * sem_ch13.adb (Check_Record_Representation_Clause): Give an
1437 error as soon as one of the specified components overlaps the
1440 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1442 * sem_prag.ads: minor fix typo in comment.
1444 2017-09-06 Justin Squirek <squirek@adacore.com>
1446 * sem_ch5.adb (Analyze_Block_Statement): Verify a block comes
1447 from source before checking source references.
1448 * sem_warn.adb (Check_References): Add check for internal block
1451 2017-09-06 Vincent Celier <celier@adacore.com>
1453 * make.adb, makeusg.adb, switch-m.adb, switch-m.ads, make_util.adb,
1454 make_util.ads, sinput.adb, sinput.ads, clean.adb, gnatls.adb,
1455 gnatname.adb: Remove the Project Manager from the GNAT tools.
1456 * gcc-interface/Makefile.in: ditto.
1458 2017-09-06 Bob Duff <duff@adacore.com>
1460 * sem_util.ads: Minor comment fix.
1462 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1464 * sem_ch12.adb (Analyze_Associations, case of Formal_Package):
1465 Generate a freeze node for the actual of a formal package, if
1466 the actual is declared in the same unit and has a corresponding
1467 body, to prevent the current instance from being frozen before
1470 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1472 * sem_ch7.adb (Entity_Table_Size): Change to nearest prime number.
1474 2017-09-06 Yannick Moy <moy@adacore.com>
1476 * sem_warn.adb: Minor refactoring.
1478 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1480 * einfo.ads, einfo.adb (Get_Classwwide_Pragma): New utility,
1481 to retrieve the inherited classwide precondition/postcondition
1483 * freeze.adb (Freeze_Entity): Use Get_Classwide_Pragma when
1484 freezing a subprogram, to complete the generation of the
1485 corresponding checking code.
1487 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1489 * exp_util.adb (Is_Controlled_Indexing): New routine.
1490 (Is_Displace_Call): Use routine Strip to remove indirections.
1491 (Is_Displacement_Of_Object_Or_Function_Result): Code clean up. Add a
1492 missing case of controlled generalized indexing.
1493 (Is_Source_Object): Use routine Strip to remove indirections.
1494 (Strip): New routine.
1496 2017-09-06 Bob Duff <duff@adacore.com>
1498 * sysdep.c (__gnat_has_cap_sys_nice): If HAVE_CAPABILITY is defined,
1499 we include the proper header. Otherwise, we just declare the necessary
1500 things from the capabilities library. This is so we can build on
1501 machines without that library, while still enabling that library.
1502 At run time, we're using weak symbols, so __gnat_has_cap_sys_nice will
1503 simply return 0 if the library is not present, or not included
1506 2017-09-06 Pierre-Marie de Rodat <derodat@adacore.com>
1508 * exp_dbug.adb (Debug_Renaming_Declaration): Do not create an encoding
1509 for renamings that involve function calls in prefix form.
1511 2017-09-06 Bob Duff <duff@adacore.com>
1513 * sem_ch3.adb (Analyze_Subtype_Declaration):
1514 Set Has_Delayed_Freeze on a subtype of an incomplete type.
1516 2017-09-06 Pierre-Marie de Rodat <derodat@adacore.com>
1518 * par_sco.adb (Extend_Statement_Sequence): When the accept statement
1519 has no parameter specification and no entry index, use the entry name
1520 as the end of the generated SCO statement.
1522 2017-09-06 Steve Baird <baird@adacore.com>
1524 * exp_util.adb (Side_Effect_Free): For CodePeer (only) treat
1525 uses of 'Image and related attributes as having side effects in
1526 order to avoid replicating such uses.
1527 * pprint.ads (Expression_Image) Add new generic formal flag
1528 Hide_Temp_Derefs. The flag defaults to False; CodePeer will
1529 (eventually) override the default.
1530 * pprint.adb (Expression_Image) If the new flag is set, then
1531 suppress the ".all" suffix when displaying a dereference whose
1532 prefix is a use of a value-capturing compiler temp of the sort
1533 generated by Expr_Util.Remove_Side_Effects .
1534 * exp_attr.adb, g-catiio.adb, inline.adb, sem_attr.adb, sem_ch13.adb,
1535 sem_ch7.adb, sem_dim.adb, sem_util.adb, sem_util.ads, sem_warn.adb:
1537 * inline.adb: Minor wording change.
1539 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1541 * sem_ch7.adb: Update comment.
1543 2017-09-06 Yannick Moy <moy@adacore.com>
1545 * einfo.adb, einfo.ads (Is_Subprogram_Or_Entry): New predicate.
1546 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Use new function.
1547 * sem_util.adb, sem_util.ads (Within_Protected_Type): Renaming
1548 with slight modification from Is_Subp_Or_Entry_Inside_Protected,
1549 so that applies to any entity.
1551 2017-09-06 Yannick Moy <moy@adacore.com>
1553 * sem_ch3.adb (Derived_Type_Declaration): Use
1554 Incomplete_Or_Partial_View rather than local Find_Partial_View.
1556 2017-09-06 Javier Miranda <miranda@adacore.com>
1558 * g-catiio.ads, g-catiio.adb (Value): Extended to parse an UTC time
1561 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1563 * sem_dim.adb (Analyze_Dimension): In an instance, a type
1564 conversion takes its dimensions from the expression, not from
1566 (Dimensions_Of_Operand): Ditto.
1568 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1570 * exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
1571 null procedures when GNAT coverage is used, so that their (empty)
1572 bodies are properly covered.
1574 2017-09-06 Bob Duff <duff@adacore.com>
1576 * sem_ch13.adb (Resolve_Aspect_Expressions): If
1577 the entity is a type with discriminants, make the discriminants
1578 directly visible in aspect clauses.
1580 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1582 * sem_res.adb (Resolve_Arithmentic_Op): If both operands are
1583 Universal_Real and the context is a floating-point type, resolve
1584 both operands to the target type.
1586 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1588 * a-comlin.adb, exp_aggr.adb, exp_ch6.adb, frontend.adb, gnatbind.adb,
1589 sem_ch3.adb, sem_util.adb: Minor reformatting.
1591 2017-09-06 Yannick Moy <moy@adacore.com>
1593 * freeze.adb (Check_Inherited_Conditions): Rewriting
1594 of inherited preconditions and postconditions should only occur
1595 in GNATprove mode, that is, when GNATprove_Mode is True, not to
1596 be confused with SPARK_Mode being On.
1598 2017-09-06 Yannick Moy <moy@adacore.com>
1600 * sem_warn.adb (Check_References): Take into
1601 account possibility of attribute reference as original node.
1603 2017-09-06 Yannick Moy <moy@adacore.com>
1605 * exp_attr.adb (Expand_N_Attribute_Reference): Protect against invalid
1608 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1610 * inline.adb (Split_Unconstrained_Function): Also set Is_Inlined
1611 on the procedure created to encapsulate the body.
1612 * sem_ch7.adb: Add with clause for GNAT.HTable.
1613 (Entity_Table_Size): New constant.
1614 (Entity_Hash): New function.
1615 (Subprogram_Table): New instantiation of GNAT.Htable.Simple_HTable.
1616 (Is_Subprogram_Ref): Rename into...
1617 (Scan_Subprogram_Ref): ...this. Record references to subprograms in
1618 the table instead of bailing out on them. Scan the value of constants
1619 if it is not known at compile time.
1620 (Contains_Subprograms_Refs): Rename into...
1621 (Scan_Subprogram_Refs): ...this.
1622 (Has_Referencer): Scan the body of all inlined subprograms. Reset the
1623 Is_Public flag on subprograms if they are not actually referenced.
1624 (Hide_Public_Entities): Beef up comment on the algorithm.
1625 Reset the table of subprograms on entry.
1627 2017-09-06 Yannick Moy <moy@adacore.com>
1629 * inline.adb: Add comments to Can_Be_Inlined_In_GNATprove_Mode.
1631 2017-09-06 Javier Miranda <miranda@adacore.com>
1633 * exp_aggr.adb (Component_Not_OK_For_Backend): The C backend
1634 cannot handle a type conversion of an array as an aggregate
1637 2017-09-06 Bob Duff <duff@adacore.com>
1639 * g-comlin.adb (Try_Help): Remove ".exe" so we
1640 get the same results on windows and unix.
1642 2017-09-06 Justin Squirek <squirek@adacore.com>
1644 * exp_imgv.adb (Expand_Image_Attribute),
1645 (Expand_Wide_Image_Attribute), (Expand_Wide_Wide_Image_Attribute):
1646 Added case to handle new-style 'Image expansion
1647 (Rewrite_Object_Image): Moved from exp_attr.adb
1648 * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1649 attribute cases so that the relevant subprograms in exp_imgv.adb
1650 handle all expansion.
1651 (Rewrite_Object_Reference_Image): Moved to exp_imgv.adb
1652 * sem_attr.adb (Analyze_Attribute): Modified Image attribute
1653 cases to call common function Analyze_Image_Attribute.
1654 (Analyze_Image_Attribute): Created as a common path for all
1655 image attributes (Check_Object_Reference_Image): Removed
1656 * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1657 Removed and refactored into Is_Object_Image (Is_Object_Image):
1658 Created as a replacement for Is_Image_Applied_To_Object
1660 2017-09-06 Yannick Moy <moy@adacore.com>
1662 * sem_prag.adb (Analyze_Depends_In_Decl_Part): Add continuation
1663 message for missing input.
1665 2017-09-06 Yannick Moy <moy@adacore.com>
1667 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Prevent inlining
1668 of protected subprograms and entries.
1669 * sem_util.adb, sem_util.ads (Is_Subp_Or_Entry_Inside_Protected):
1670 New function to detect when a subprogram of entry is defined
1671 inside a protected object.
1673 2017-09-06 Bob Duff <duff@adacore.com>
1675 * sysdep.c (__gnat_has_cap_sys_nice): New function to determine
1676 whether the current process has the CAP_SYS_NICE capability.
1677 * s-taprop-linux.adb (Get_Ceiling_Support): Update this to allow
1678 ceiling priorities if the current process has the CAP_SYS_NICE
1681 2017-09-06 Bob Duff <duff@adacore.com>
1683 * a-comlin.ads, a-comlin.adb (Argument): Move the constraint
1684 check back to the body, because SPARK is not yet ready for
1685 "or else raise Constraint_Error".
1687 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1689 * exp_ch6.adb (Expand_Call_Helper): Replace call to null
1690 procedure by a single null statement, after evaluating the
1691 actuals that require it.
1693 2017-09-06 Javier Miranda <miranda@adacore.com>
1695 * exp_aggr.adb (Backend_Processing_Possible.Component_Check):
1696 Generating C code improve the code that checks the use of nested
1697 aggregates to initialize object declarations.
1699 2017-09-06 Yannick Moy <moy@adacore.com>
1701 * sem_ch3.adb (Derived_Type_Declaration): Detect
1702 violations of new rule SPARK RM 3.4(1). Also refactor existing
1703 check to use the new function Find_Partial_View.
1705 2017-09-06 Vincent Celier <celier@adacore.com>
1707 * gnatcmd.adb: gnat ls -V -P... invokes gprls -V -P... The code
1708 from the Prj hierarchy has been removed from the GNAT driver.
1710 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1712 * sem_type.adb (Interface_Present_In_Ancestor): Within an
1713 expression function, or within a spec expression (default value,
1714 etc) a reference to an incomplete type is legal: legality of
1715 the operation will be checked when some related entity (type,
1716 object or subprogram) is frozen.
1718 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1720 * exp_ch5.adb, s-diinio.ads, sem_ch4.adb, s-diflio.ads: Minor spelling
1721 adjustments and a typo fix.
1723 2017-09-06 Yannick Moy <moy@adacore.com>
1725 * sem_res.adb (Resolve_Call): Do not issue info
1726 message about inlining of calls to functions in assertions,
1727 for functions whose body has not been seen yet.
1729 2017-09-06 Bob Duff <duff@adacore.com>
1731 * a-comlin.ads, a-comlin.adb (Argument): Simplify the code, now that
1732 we can use modern Ada in this package.
1733 * s-resfil.ads, s-resfil.adb, a-clrefi.ads, a-clrefi.adb:
1734 Move Ada.Command_Line.Response_File to System.Response_File,
1735 and make Ada.Command_Line.Response_File into a rename of
1736 System.Response_File. This is to avoid having gnatbind depend
1737 Ada.Command_Line, which would damage the bootstrap process now
1738 that Ada.Command_Line contains modern Ada (the raise expression).
1739 * gnatbind.adb: Avoid dependence on
1740 Ada.Command_Line. Depend on System.Response_File instead
1741 of Ada.Command_Line.Response_File. Change one call to
1742 Ada.Command_Line.Command_Name to use Fill_Arg. Change one call
1743 to Ada.Command_Line.Argument_Count to use Arg_Count.
1744 * gcc-interface/Make-lang.in, Makefile.rtl: Take note of the new files.
1746 2017-09-06 Bob Duff <duff@adacore.com>
1748 * frontend.adb (Frontend): Skip -gnatec=gnat.adc
1749 switch, because we've already read gnat.adc by default.
1751 2017-09-06 Bob Duff <duff@adacore.com>
1753 * exp_ch5.adb (Get_Default_Iterator): Replace
1754 "Assert(False)" with "return Iter", because if an iterable
1755 type is derived from a noniterable one, then we won't find an
1756 overriding or inherited default iterator.
1758 2017-09-06 Yannick Moy <moy@adacore.com>
1760 * sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
1761 literal index used to access a string is null or negative.
1763 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1765 * einfo.adb (Status_Flag_Or_Transient_Decl): The attribute is now
1766 allowed on loop parameters.
1767 (Set_Status_Flag_Or_Transient_Decl): The attribute is now allowed
1769 (Write_Field15_Name): Update the output for
1770 Status_Flag_Or_Transient_Decl.
1771 * einfo.ads: Attribute Status_Flag_Or_Transient_Decl now applies
1772 to loop parameters. Update the documentation of the attribute
1773 and the E_Loop_Parameter entity.
1774 * exp_ch7.adb (Process_Declarations): Remove the bogus guard
1775 which assumes that cursors can never be controlled.
1776 * exp_util.adb (Requires_Cleanup_Actions): Remove the bogus
1777 guard which assumes that cursors can never be controlled.
1779 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1781 * exp_attr.adb, sem_util.adb, sem_attr.adb, sem_ch6.adb, sem_ch8.adb,
1782 sem_warn.adb: Minor reformatting.
1784 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1786 * sem_warn.adb (Warn_On_Overlapping_Actuals): Refine previous
1787 fix and preserve older GNAT warning on overlapping actuals that
1788 are not elementary types.
1790 2017-09-06 Justin Squirek <squirek@adacore.com>
1792 * sem_attr.adb: Comment correction.
1794 2017-09-06 Gary Dismukes <dismukes@adacore.com>
1796 * sem_util.adb: Minor reformatting.
1798 2017-09-06 Yannick Moy <moy@adacore.com>
1800 * a-comlin.ads (Argument): Add precondition for analysis.
1802 2017-09-06 Yannick Moy <moy@adacore.com>
1804 * sem_res.adb (Resolve): Update message for function call as statement.
1806 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1808 * sem_ch6.adb (Check_Returns): Clean up warnings coming from
1809 generated bodies for renamings that are completions, when renamed
1810 procedure is No_Return.
1811 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
1812 rule in 6.5.1 (7/2): if a renaming is a completion of a subprogram
1813 with No_Return, the renamed entity must be No_Return as well.
1815 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1817 * exp_ch5.adb, freeze.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb:
1820 2017-09-06 Justin Squirek <squirek@adacore.com>
1822 * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1823 attribute cases (Rewrite_Object_Reference_Image): Created to
1824 aid the rewriting of new-style 'Image attributes.
1825 * sem_attr.adb (Analyze_Attribute): Modified Image attribute cases
1826 (Check_Object_Reference_Image): Created to handle verification of
1827 'Image with object-references as prefixes.
1828 * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1829 Create predicate to identify cases where an 'Image attribute's
1830 prefix applies to an object reference.
1832 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1834 * freeze.adb (Freeze_Entity): Do not generate a freeze
1835 node for a generic unit, even if it includes delayed aspect
1836 specifications. Freeze nodes for generic entities must never
1837 appear in the tree that reaches the back-end of the compiler.
1839 2017-09-06 Yannick Moy <moy@adacore.com>
1841 * treepr.adb (Print_Entity_Info): Do not print empty Elist.
1843 2017-09-06 Yannick Moy <moy@adacore.com>
1845 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not consider calls
1846 to subprograms in other units as possibly inlined.
1848 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1850 * freeze.adb (Freeze_Entity): For a derived type that has no
1851 explicit delayed aspects but may inherit delayed aspects from its
1852 parent type, analyze aspect at freeze point for proper capture
1853 of an inherited aspect.
1855 2017-09-06 Arnaud Charlet <charlet@adacore.com>
1857 * lib-xref.adb (Get_Through_Renamings): Get through subprogram
1858 renamings; also, avoid repeated calls to Renamed_Object when getting
1859 through object renamings.
1861 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1863 * sem_ch3.adb (Array_Type_Declaration): Handle properly an
1864 array type declaration in a private part, when an index is a
1865 subtype indication of a discrete type with a private partial view.
1867 2017-09-06 Javier Miranda <miranda@adacore.com>
1869 * exp_ch4.adb (Expand_Modular_Op): Force generating
1870 temporary to improve the generated code.
1872 2017-09-06 Tristan Gingold <gingold@adacore.com>
1874 * s-fatgen.adb: Minor typo fix in comment.
1876 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1878 * exp_ch5.adb (Make_Field_Assign): If the type
1879 of the right-hand side has stored constraint, use its values
1880 (except for those that are renamings of parent discriminants)
1881 to produce additional assignments for the discriminants of the
1882 left-hand side, which are invisible in the righ-hand side and
1883 not retrievable as selected components.
1885 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1887 * sem_util.adb (Needs_One_Formal): The first formal of such a
1888 function must be a controlling formal, so that Obj.F (X, Y)
1889 can have the interpretation F(Obj)(X, Y).
1890 * sem_util.ads: Clarify documentation.
1892 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1894 * table.ads, table.adb: Restore original implementation.
1895 * namet.h (Names_Ptr): Adjust back.
1896 (Name_Chars_Ptr): Likewise.
1897 * uintp.h (Uints_Ptr): Likewise.
1898 (Udigits_Ptr): Likewise.
1899 * g-table.ads: Remove pragma Compiler_Unit_Warning.
1900 * par_sco.adb: Do not with GNAT.Table and use Table consistently.
1901 * scos.ads: Replace GNAT.Table with Table and adjust instantiations.
1902 * spark_xrefs.ads: Likewise.
1903 * scos.h: Undo latest changes.
1905 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1907 * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate
1908 No_Return flag to instance if pragma applies to generic unit. This
1909 must be done explicitly because the pragma does not appear
1910 directly in the generic declaration (unlike the corresponding
1911 aspect specification).
1913 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1915 * sem_ch7.adb (Has_Referencer): Move up and expand comment
1916 explaining the test used to detect inlining. Use same test
1917 in second occurrence.
1918 (Analyze_Package_Body_Helper): Minor formatting fixes.
1920 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1922 * exp_ch4.adb (Handle_Changed_Representation): For an untagged
1923 derived type with a mixture of renamed and constrained parent
1924 discriminants, the constraint for the target must obtain the
1925 discriminant values from both the operand and from the stored
1926 constraint for it, given that the constrained discriminants are
1927 not visible in the object.
1928 * exp_ch5.adb (Make_Field_Assign): The type of the right-hand
1929 side may be derived from that of the left-hand side (as in the
1930 case of an assignment with a change of representation) so the
1931 discriminant to be used in the retrieval of the value of the
1932 component must be the entity in the type of the right-hand side.
1934 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
1936 * sem_ch3.adb, sem_ch7.adb, sem_util.adb, g-debpoo.adb, sem_ch4.adb,
1937 sem_ch6.adb, sem_ch8.adb: Minor reformatting.
1938 * exp_util.adb (Is_Source_Object): Account for
1939 the cases where the source object may appear as a dereference
1940 or within a type conversion.
1941 * exp_ch6.adb: Fix missing space in error message.
1943 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1945 * sem_prag.adb: Update description of Eliminate.
1947 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1949 * sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
1950 properly an attribute reference 'Loop_Entry that appears in the
1951 list of indices of an indexed expression, to prevent an infinite
1952 loop in the compiler.
1954 2017-09-06 Bob Duff <duff@adacore.com>
1956 * s-fileio.adb (Name): Do not raise Use_Error for temp files.
1958 2017-09-06 Ed Schonberg <schonberg@adacore.com>
1960 * sem_ch4.adb (Analyze_Set_Membership): If an alternative
1961 in a set membership is an overloaded enumeration literal, and
1962 the type of the alternative is resolved from a previous one,
1963 replace the entity of the alternative as well as the type,
1964 to prevent inconsistencies between the entity and the type.
1966 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
1968 * ali.ads (ALIs_Record): Add No_Component_Reordering component.
1969 (No_Component_Reordering_Specified): New switch.
1970 * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified.
1971 (Scan_ALI): Set No_Component_Reordering and deal with NC marker.
1972 * bcheck.adb (Check_Consistent_No_Component_Reordering):
1974 (Check_Configuration_Consistency): Invoke it.
1975 * debug.adb (d.r): Toggle the effect of the switch.
1976 (d.v): Change to no-op.
1977 * einfo.ads (Has_Complex_Representation):
1978 Restrict to record types.
1979 (No_Reordering): New alias for Flag239.
1980 (OK_To_Reorder_Components): Delete.
1981 (No_Reordering): Declare.
1982 (Set_No_Reordering): Likewise.
1983 (OK_To_Reorder_Components): Delete.
1984 (Set_OK_To_Reorder_Components): Likewise.
1985 * einfo.adb (Has_Complex_Representation): Expect record types.
1986 (No_Reordering): New function.
1987 (OK_To_Reorder_Components): Delete.
1988 (Set_Has_Complex_Representation): Expect base record types.
1989 (Set_No_Reordering): New procedure.
1990 (Set_OK_To_Reorder_Components): Delete.
1991 (Write_Entity_Flags): Adjust to above change.
1992 * fe.h (Debug_Flag_Dot_R): New macro and declaration.
1993 * freeze.adb (Freeze_Record_Type): Remove conditional code setting
1994 OK_To_Reorder_Components on record types with convention Ada.
1995 * lib-writ.adb (Write_ALI): Deal with NC marker.
1996 * opt.ads (No_Component_Reordering): New flag.
1997 (No_Component_Reordering_Config): Likewise.
1998 (Config_Switches_Type): Add No_Component_Reordering component.
1999 * opt.adb (Register_Opt_Config_Switches): Copy
2000 No_Component_Reordering onto No_Component_Reordering_Config.
2001 (Restore_Opt_Config_Switches): Restore No_Component_Reordering.
2002 (Save_Opt_Config_Switches): Save No_Component_Reordering.
2003 (Set_Opt_Config_Switches): Set No_Component_Reordering.
2004 * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering.
2005 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the
2006 No_Reordering flag from the default.
2007 (Build_Derived_Private_Type): Likewise.
2008 (Build_Derived_Record_Type): Likewise. Then inherit it
2009 for untagged types and clean up handling of similar flags.
2010 (Record_Type_Declaration): Likewise.
2011 * sem_ch13.adb (Same_Representation): Deal with No_Reordering and
2012 remove redundant test on Is_Tagged_Type.
2013 * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering.
2014 (Sig_Flags): Likewise.
2015 * snames.ads-tmpl (Name_No_Component_Reordering): New name.
2016 (Pragma_Id): Add Pragma_No_Component_Reordering value.
2017 * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well.
2018 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>:
2019 Copy the layout of the parent type only if the No_Reordering
2021 (components_to_record): Reorder record types with
2022 convention Ada by default unless No_Reordering is set or -gnatd.r
2023 is specified and do not warn if No_Reordering is set in GNAT mode.
2025 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2027 * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure):
2028 new predicate to reject declarations that can be completions,
2029 when there is a visible prior homograph that is a null procedure.
2030 * sem_ch6.adb (Analyze_Null_Procedure): use it.
2031 * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto.
2033 2017-09-06 Thomas Quinot <quinot@adacore.com>
2035 * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal
2036 run of 253 characters or more.
2038 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2040 * einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
2041 properly incomplete subtypes that may be created by explicit or
2042 implicit declarations.
2043 (Is_Base_Type): Take E_Incomplete_Subtype into account.
2044 (Subtype_Kind): Ditto.
2045 * sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
2046 Ekind of a subtype of a discriminated incomplete type.
2047 (Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
2048 incomplete types, to preserve error reporting.
2049 (Process_Incomplete_Dependents): Do not create a subtype
2050 declaration for an incomplete subtype that is created internally.
2051 * sem_ch7.adb (Analyze_Package_Specification): Handle properly
2052 incomplete subtypes that do not require a completion, either
2053 because they are limited views, of they are generic actuals.
2055 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
2057 * checks.adb (Insert_Valid_Check): Remove the
2058 suspicious manipulation of the Do_Range_Check flag as ths is
2059 no linger needed. Suppress validity check when analysing the
2060 validation variable.
2062 2017-09-06 Philippe Gil <gil@adacore.com>
2064 * g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
2067 2017-09-06 Bob Duff <duff@adacore.com>
2069 * sem_elim.adb: Minor comment fix.
2071 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2073 * sem_util.adb (Is_Object_Reference): A function call is an
2074 object reference, and thus attribute references for attributes
2075 that are functions (such as Pred and Succ) as well as predefined
2076 operators are legal in contexts that require an object, such as
2077 the prefix of attribute Img and the Ada2020 version of 'Image.
2079 2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
2081 * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
2082 exp_ch3.adb, xoscons.adb: Minor reformatting.
2084 2017-09-06 Raphael Amiard <amiard@adacore.com>
2086 * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
2087 Position parameter. If supplied, use it to provide efficient iteration.
2088 * a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
2089 a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
2092 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2094 * exp_util.adb (Build_Allocate_Deallocate_Proc): If the
2095 designated type is class-wide and the expression is an unchecked
2096 conversion, preserve the conversion when checking the tag of the
2097 designated object, to prevent spurious semantic errors when the
2098 expression in the conversion has an untagged type (for example
2099 an address attribute).
2101 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2103 * sem_res.adb (Resolve_Entry_Call): Check whether a protected
2104 operation is subject to a pragma Eliminate.
2106 2017-09-06 Ed Schonberg <schonberg@adacore.com>
2108 * sem_elim.ads, exp_ch4.adb: Minor reformatting.
2110 2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
2112 * fe.h (Eliminate_Error_Msg): Remove.
2114 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
2116 * gcc-interface/utils.c (make_packable_type): Update call to
2119 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
2121 * gcc-interface/utils2.c (build_load_modify_store):
2122 Use int_mode_for_size.
2124 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2127 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2128 for Itypes that are E_Record_Subtype with a cloned subtype.
2129 <E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
2131 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2133 * gcc-interface/trans.c (convert_with_check): Use a custom base type
2134 if the base type of the expression has a different machine mode.
2135 Rename a couple of parameters and local variable.
2137 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2139 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Address>: Do not strip
2140 conversions around prefixes that are not references.
2142 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2144 * gcc-interface/utils.c (unchecked_convert): When the result type is a
2145 non-biased integral type with size 0, set the result to 0 directly.
2147 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2149 * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to
2150 (renaming_from_instantiation_p): ...this.
2151 * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate
2152 instead of explicit tests on kind of entities. Adjust for renaming.
2153 (gnat_to_gnu_profile_type): Likewise.
2154 (gnat_to_gnu_subprog_type): Likewise.
2155 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
2156 (Case_Statement_to_gnu): Likewise.
2157 (gnat_to_gnu): Likewise.
2158 (process_freeze_entity): Likewise.
2159 (process_type): Likewise.
2160 (add_stmt_with_node): Adjust for renaming.
2161 * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming.
2162 (renaming_from_generic_instantiation_p): Rename to...
2163 (renaming_from_instantiation_p): ...this. Use inline predicate.
2164 (pad_type_hasher::keep_cache_entry): Fold.
2166 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2168 * gcc-interface/trans.c (adjust_for_implicit_deref): New function.
2169 (gnat_to_gnu) <N_Explicit_Dereference>: Translate result type first.
2170 (N_Indexed_Component): Invoke adjust_for_implicit_deref on the prefix.
2171 (N_Slice): Likewise.
2172 (N_Selected_Component): Likewise. Do not try again to translate it.
2173 (N_Free_Statement): Invoke adjust_for_implicit_deref on the expression.
2175 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2177 * repinfo.ads: Document new treatment of dynamic values.
2178 (TCode): Bump upper bound to 29.
2179 (Dynamic_Val): New constant set to 29.
2180 * repinfo.adb (Print_Expr) <Dynamic_Val>: New case.
2181 (Rep_Value) <Dynamic_Val>: Likewise.
2182 * repinfo.h (Dynamic_Val): New macro.
2183 * gcc-interface/decl.c (annotate_value): Tidy up and cache result for
2185 <INTEGER_CST>: Set TCODE instead of recursing.
2186 <COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
2187 <VAR_DECL>: New case.
2188 <MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
2189 <BIT_AND_EXPR>: Adjust.
2190 <CALL_EXPR>: Do not fall through.
2192 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2194 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2195 there is no target, do not create a temporary for the return value for
2196 an allocator either.
2198 2017-09-05 Eric Botcazou <ebotcazou@adacore.com>
2200 * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
2201 unconstrained array type.
2203 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2204 Alan Hayward <alan.hayward@arm.com>
2205 David Sherwood <david.sherwood@arm.com>
2207 * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
2208 instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
2210 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2211 Alan Hayward <alan.hayward@arm.com>
2212 David Sherwood <david.sherwood@arm.com>
2214 * gcc-interface/decl.c (check_ok_for_atomic_type): Use
2215 is_a <scalar_int_mode>.
2216 * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
2217 * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
2219 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2220 Alan Hayward <alan.hayward@arm.com>
2221 David Sherwood <david.sherwood@arm.com>
2223 * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
2224 instead of mode_for_size.
2225 (gnat_to_gnu_subprog_type): Likewise.
2226 * gcc-interface/utils.c (make_type_from_size): Likewise.
2228 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2229 Alan Hayward <alan.hayward@arm.com>
2230 David Sherwood <david.sherwood@arm.com>
2232 * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
2233 (fp_size_to_prec): Likewise.
2235 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2236 Alan Hayward <alan.hayward@arm.com>
2237 David Sherwood <david.sherwood@arm.com>
2239 * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
2240 <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
2242 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2243 Alan Hayward <alan.hayward@arm.com>
2244 David Sherwood <david.sherwood@arm.com>
2246 * gcc-interface/decl.c (validate_size): Update use of
2247 GET_MODE_WIDER_MODE, forcing a wider mode to exist.
2249 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
2250 Alan Hayward <alan.hayward@arm.com>
2251 David Sherwood <david.sherwood@arm.com>
2253 * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
2254 (fp_size_to_prec): Likewise.
2256 2017-08-29 Martin Liska <mliska@suse.cz>
2259 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
2261 2017-08-08 Martin Liska <mliska@suse.cz>
2263 * gcc-interface/trans.c: Include header files.
2265 2017-07-29 Jakub Jelinek <jakub@redhat.com>
2267 * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
2268 as new argument to the imported_module_or_decl debug hook.
2270 2017-07-25 Javier Miranda <miranda@adacore.com>
2272 * checks.adb (Apply_Divide_Checks): Ensure that operands are not
2275 2017-07-19 Jakub Jelinek <jakub@redhat.com>
2277 * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
2278 TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
2279 (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
2281 2017-07-18 Mike Frysinger <vapier@chromium.org>
2283 * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
2284 (../../gnatlink$(exeext)): Likewise.
2286 2017-07-15 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2289 * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
2290 (Backend_Overflow_Checks): Set to True.
2292 2017-06-23 Jakub Jelinek <jakub@redhat.com>
2294 * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
2296 2017-06-21 Pierre-Marie de Rodat <derodat@adacore.com>
2298 * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
2300 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
2302 (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
2304 * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
2305 imported subprograms for the current compilation unit as
2306 definitions. Disable debug info for references to variables.
2307 * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
2308 * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
2309 not built-in functions to their binding scope.
2310 (create_subprog_decl): Add a DEFINITION parameter. If it is true, tag
2311 the function as a definition. Update all callers.
2312 (gnat_write_global_declarations): Emit debug info for imported
2313 functions. Filter out external variables for which debug info
2316 2017-06-15 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
2319 * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
2320 (i[3456]86-pc-gnu): Likewise.
2321 (x86_64 kfreebsd): Likewise.
2323 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
2326 * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
2328 2017-06-12 Eric Botcazou <ebotcazou@adacore.com>
2331 * s-interr-hwint.adb: Reinstate.
2332 * gcc-interface/Makefile.in (RTEMS): Use it again.
2334 2017-06-08 Olivier Hainque <hainque@adacore.com>
2336 * vx_crtbegin_auto.c: Update year in copyright notice.
2337 * vx_crtbegin.c: Likewise.
2338 * vx_crtbegin.inc: Likewise.
2339 * vx_crtend.c: Likewise.
2341 2017-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
2343 * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
2344 * s-tpopsp-rtems.adb: Delete.
2346 2017-06-02 Olivier Hainque <hainque@adacore.com>
2348 * vx_crtbegin_auto.c: New file.
2349 * vx_crtbegin.c: New file.
2350 * vx_crtbegin.inc: New file.
2351 * vx_crtend.c: New file.
2353 2017-05-25 Jonathan Wakely <jwakely@redhat.com>
2355 * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
2356 const qualifiers that cause -Wignored-qualifiers warnings.
2358 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
2360 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2361 for Itypes that are E_Access_Subtype.
2362 <E_Access_Subtype>: Use the DECL of the base type directly.
2364 2017-05-22 Ed Schonberg <schonberg@adacore.com>
2365 Eric Botcazou <ebotcazou@adacore.com>
2367 * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
2368 limited view may appear in the profile of a function, and a call to
2369 that function in another unit in which the full view is available must
2370 use this full view to spurious type errors at the point of call.
2371 * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
2372 of parent body with a with clause for the main unit.
2373 * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
2374 (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
2375 types declared in external units like types from limited with clauses.
2376 Adjust final processing of defer_limited_with_list accordingly.
2377 * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
2378 again to translate the prefix after the field if it is incomplete.
2380 2017-05-22 Eric Botcazou <ebotcazou@adacore.com>
2382 * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
2383 alignment for simple volatile fields and remove associated errors.
2385 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2387 * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
2388 * gcc-interface/trans.c (get_elaboration_procedure): Make static.
2390 2017-05-15 Pierre-Marie de Rodat <derodat@adacore.com>
2392 * gcc-interface/utils.c (can_materialize_object_renaming_p):
2393 Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
2394 process Original_Node instead of expanded names.
2396 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2398 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
2399 addressability check in the constrained case.
2401 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2403 * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
2404 types not coming from a limited context.
2406 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2408 * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
2409 the inlined list that are not public.
2410 * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
2411 there is a pragma Inline_Always on the subprogram.
2413 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2415 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
2416 <N_Allocator>: Use properly typed constants.
2417 (extract_values): Move around.
2418 (pos_to_constructor): Minor tweaks.
2419 (Sloc_to_locus): Fix formatting.
2420 * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
2421 * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
2422 (Gigi_Equivalent_Type): Adjust head comment.
2423 * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
2425 2017-05-15 Eric Botcazou <ebotcazou@adacore.com>
2427 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
2428 is a representation clause on an extension, propagate the alignment of
2429 the parent type only if the platform requires strict alignment.
2431 2017-05-12 Eric Botcazou <ebotcazou@adacore.com>
2433 * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
2434 instead of Word_Size.
2437 2017-03-28 Andreas Schwab <schwab@suse.de>
2440 * system-linux-aarch64-ilp32.ads: New file.
2441 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
2442 from LIBGNAT_TARGET_PAIRS.
2443 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
2444 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
2445 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
2446 or -mabi=ilp32, resp.
2448 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2451 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
2452 instead of Word_Size.
2454 2017-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
2456 * raise-gcc.c (exception_class_eq): Make ec parameter const.
2458 2017-05-02 Richard Biener <rguenther@suse.de>
2460 * gcc-interface/misc.c (gnat_post_options): Do not set
2463 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2465 * gcc-interface/trans.c (assoc_to_constructor): Make sure
2466 Corresponding_Discriminant is only called on discriminants.
2467 Skip the saving of the result only for them.
2468 (gnat_to_gnu) <N_Selected_Component>: Likewise.
2469 <N_Unchecked_Type_Conversion>: Translate the result type first.
2470 (gigi): Set TREE_NOTHROW on Begin_Handler.
2471 (stmt_list_cannot_raise_p): New predicate.
2472 (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
2473 a cleanup if the statements of the handler cannot raise.
2474 (process_freeze_entity): Use Is_Record_Type.
2475 (process_type): Likewise.
2477 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2479 * einfo.ads (Corresponding_Record_Component): New alias
2480 for Node21 used for E_Component and E_Discriminant.
2481 * einfo.adb (Corresponding_Record_Component): New function.
2482 (Set_Corresponding_Record_Component): New procedure.
2483 (Write_Field21_Name): Handle Corresponding_Record_Component.
2484 * sem_ch3.adb (Inherit_Component): Set
2485 Corresponding_Record_Component for every component in
2486 the untagged case. Clear it afterwards for non-girder
2488 * gcc-interface/decl.c (gnat_to_gnu_entity)
2489 <E_Record_Type>: For a derived untagged type with discriminants
2490 and constraints, apply the constraints to the layout of the
2491 parent type to deduce the layout.
2492 (field_is_aliased): Delete.
2493 (components_to_record): Test DECL_ALIASED_P directly.
2494 (annotate_rep): Check that fields are present except for
2496 (create_field_decl_from): Add DEBUG_INFO_P
2497 parameter and pass it in recursive and other calls. Add guard
2498 for the manual CSE on the size.
2499 (is_stored_discriminant): New predicate.
2500 (copy_and_substitute_in_layout): Consider only
2501 stored discriminants and check that original fields are present
2502 in the old type. Deal with derived types. Adjust call to
2503 create_variant_part_from.
2505 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2507 * exp_ch6.adb (Expand_Call_Helper): When locating the
2508 accessibility entity created for an access parameter, handle
2509 properly a reference to a formal of an enclosing subprogram. if
2510 the reference appears in an inherited class-wide condition, it
2511 is the rewriting of the reference in the ancestor expression,
2512 but the accessibility entity must be that of the current formal.
2514 2017-05-02 Javier Miranda <miranda@adacore.com>
2516 * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
2517 (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
2518 Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
2519 Call Expand_Non_Binary_Modular_Op.
2521 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2523 * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
2524 has discriminants, do not override the Stored_Constraint list of
2525 the full view of the derived type with that of the derived type.
2527 2017-05-02 Bob Duff <duff@adacore.com>
2529 * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
2531 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2533 * s-os_lib.ads: Minor typo fix.
2535 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2537 * gnatls.adb: Merge and refactor code from Prj.Env and remove
2538 this deprecated dependency.
2540 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2542 * exp_util.ads: minor comment addition.
2544 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2546 * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
2547 pastos in part #3 of the head comment.
2549 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2551 * exp_ch3.adb (Freeze_Type): Do not generate an invariant
2552 procedure body for a local (sub)type declaration within a
2553 predicate function. Invariant checks do not apply to these, and
2554 the expansion of the procedure will happen in the wrong scope,
2555 leading to misplaced freeze nodes.
2557 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2559 * exp_util.adb (Insert_Library_Level_Action): Use proper scope
2560 to analyze generated actions. If the main unit is a body,
2561 the required scope is that of the corresponding unit declaration.
2563 2017-05-02 Arnaud Charlet <charlet@adacore.com>
2565 * einfo.adb (Declaration_Node): flip branches of
2566 an IF statement to avoid repeated negations in its condition;
2567 no change in semantics, only to improve readability.
2569 2017-05-02 Arnaud Charlet <charlet@adacore.com>
2571 * sem_case.adb: Remove extra spaces in parameter declarations.
2573 2017-05-02 Justin Squirek <squirek@adacore.com>
2575 * usage.adb: Replace space with hyphen ("run time" -> "run-time")
2576 in usage line for new -gnatwE switch.
2578 2017-05-02 Claire Dross <dross@adacore.com>
2580 * a-cofuve.ads (Remove): Remove unnecessary
2581 conditions in precondition.
2583 2017-05-02 Vasiliy Fofanov <fofanov@adacore.com>
2585 * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
2586 sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
2588 2017-05-02 Justin Squirek <squirek@adacore.com>
2590 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2591 alternative expression.
2592 * sem_res.adb (Resolve_Case_Expression): Ditto.
2594 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2596 * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
2597 Refine predicate for the case where the primitive operation
2598 is a renaming of equality. An overriding operation that is
2599 a user-defined renaming of predefined equality inherits its
2600 slot from the overridden operation. Otherwise it is treated
2601 as a predefined op and occupies the same predefined slot as
2602 equality. A call to it is transformed into a call to its alias,
2603 which is the predefined equality. A dispatching call thus uses
2604 the proper slot if operation is further inherited and called
2605 with class-wide arguments.
2607 2017-05-02 Justin Squirek <squirek@adacore.com>
2609 * errout.adb (Set_Msg_Text): Add a case to switch the message
2610 type when the character '[' is detected signifying a warning
2611 about a run-time exception.
2612 * opt.ads Add a new Warning_Mode value for new switch
2613 * switch-b.adb (Scan_Binder_Switches): Add case for the binder
2614 to handle new warning mode
2615 * usage.adb (Usage): Add usage entry for -gnatwE
2616 * warnsw.adb (Set_Warning_Switch): Add case for the new switch
2618 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2620 * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
2621 declaration that operates on some fixed point type.
2623 2017-05-02 Justin Squirek <squirek@adacore.com>
2625 * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
2627 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2629 * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
2631 2017-05-02 Justin Squirek <squirek@adacore.com>
2633 * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2634 expression (Analyze_If_Expression): Add check for valid condition
2635 * sem_eval.adb (Eval_Case_Expression): Add check for error posted
2637 * sem_res.adb (Resolve_If_Expression): Add check for valid
2638 condition and then-expression.
2640 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2642 * exp_ch3.adb (Build_Initialization_Call): Generate a null
2643 statement if the initialization call is a null procedure, as
2644 can happen with a controlled type with no explicit Initialize
2645 procedure, or an array of such.
2646 * exp_ch7.adb (Process_Object_Declaration): For a type with
2647 controlled components that has a trivial Initialize procedure,
2648 insert declaration for finalization counter after object
2650 (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
2651 finalization block and attendant declarations if component has
2652 a trivial Initialize procedure.
2653 (Make_Init_Call): Do not generate a call if controlled type has
2654 a trivial Initialize procedure.
2656 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2658 * g-forstr.ads (Data): Move Format component last.
2659 * g-forstr.adb ("+"): Adjust for above change.
2660 * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
2661 * g-sechas.ads (Context): Move Key last.
2662 * g-socket.ads (Service_Entry_Type): Move Aliases last.
2663 * s-fileio.adb (Temp_File_Record): Move Name last.
2664 * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
2665 * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
2667 2017-05-02 Jerome Lambourg <lambourg@adacore.com>
2669 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
2670 switch introduced recently. finally not needed.
2672 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2674 * sem_ch6.adb (Analyze_Null_Procedure): Set the
2675 Corresponding_Body link for a null procedure declaration.
2677 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2679 * atree.h (Flag290): Add missing terminating parenthesis.
2680 * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
2681 (Set_Is_Class_Wide_Clone): Likewise.
2682 * einfo.ads (Is_Class_Wide_Clone): Likewise.
2684 2017-05-02 Gary Dismukes <dismukes@adacore.com>
2686 * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
2687 parameter Array_Comp to indicate the case of an array object
2688 with null-excluding components.
2689 * checks.adb (Null_Exclusion_Static_Checks):
2690 Call Compile_Time_Constraint_Error instead of
2691 Apply_Compile_Time_Constraint_Error in the component case. Also
2692 call that when Array_Comp is True, with an appropriate warning for
2693 the array component case. Only create an explicit initialization
2694 by null in the case of an object of a null-excluding access type
2695 (and no longer do that in the component case).
2696 * sem_ch3.adb (Check_Component): Add a Boolean parameter
2697 Array_Comp defaulted to False. Pass Empty for the Comp
2698 actual when calling Null_Exclusion_Static_Checks in the case
2699 where Comp_Decl matches Object_Decl, because we don't have a
2700 component in that case. In the case of an object or component
2701 of an array type, pass True for Array_Comp on the recursive call
2704 2017-05-02 Bob Duff <duff@adacore.com>
2706 * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
2707 compute the linux priority from the Ada priority. Call this everywhere
2708 required. In particular, the previous version was not doing this
2709 computation when setting the ceiling priority in various places. It
2710 was just converting to C.int, which results in a ceiling that is off
2713 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2715 * sem_ch3.adb: Comment predicate inheritance.
2717 2017-05-02 Tristan Gingold <gingold@adacore.com>
2719 * s-trasym.ads: Add comment.
2721 2017-05-02 Bob Duff <duff@adacore.com>
2723 * sem_elab.adb, sem_elab.ads: Minor comment fixes.
2724 * sem_ch4.adb: Minor reformatting.
2725 * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
2726 * s-taspri-posix-noaltstack.ads: Minor refactoring.
2727 * sinput.ads: Minor typo fix.
2729 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2731 * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
2732 * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
2733 here from exp_ch9, to recognize objects whose creation requires
2734 dynamic allocation, so that the proper warning can be emitted
2735 when restriction No_Implicit_Heap_Allocation is in effect.
2736 * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
2737 to emit proper warning when an object that requires dynamic
2738 allocation is declared.
2740 2017-05-02 Tristan Gingold <gingold@adacore.com>
2742 * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
2744 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2746 * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
2747 visibility rules for equality operators that apply within an
2748 instantiation apply within an inlined body.
2749 * sem_type.adb (Add_One_Interp): ditto.
2751 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2753 * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
2756 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2759 (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
2760 Name_No_Tagged_Streams): Move to regular pragmas. Add
2761 placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
2762 and Secondary_Stack_Size.
2763 (Pragma_Id): Move Pragma_Assume,
2764 Pragma_Attribute_Definition, Pragma_Loop_Optimize and
2765 Pragma_No_Tagged_Streams to second part.
2767 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2769 * exp_attr.adb: Minor reformatting.
2771 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2773 * sem_ch4.adb (Analyze_Selected_Component): Improve error
2774 detection for illegal references to private components or
2775 operations of a protected type in the body of the type.
2777 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2779 * opt.ads: Add missing GNAT markers in comments.
2780 * opt.adb (Set_Opt_Config_Switches): Do not override earlier
2781 settings of Optimize_Alignment at the end.
2783 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2785 * checks.adb (Apply_Constraint_Check): Do not apply
2786 a discriminant check when the associated type is a constrained
2787 subtype created for an unconstrained nominal type.
2788 * exp_attr.adb: Minor reformatting.
2790 2017-05-02 Bob Duff <duff@adacore.com>
2792 * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
2793 the N_Raise_Expression case.
2794 * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
2797 2017-05-02 Yannick Moy <moy@adacore.com>
2799 * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
2800 optimize length comparison in GNATprove mode.
2801 * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
2802 operator /= into negation of operator = when needed.
2803 (Expand_SPARK): Call new
2804 function to expand operator /=.
2806 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2808 * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
2809 Simplify the expression for a fixed-fixed division to remove
2810 divisions by constants whenever possible, as an optimization
2811 for restricted targets.
2813 2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2815 * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
2817 2017-05-02 Bob Duff <duff@adacore.com>
2819 * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
2820 to find primitive ops, instead of using an Identifier that will
2821 later be looked up. This is necessary because these ops are not
2822 necessarily visible at all places where we need to call them.
2823 * exp_util.ads: Minor comment fix.
2825 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2827 * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
2828 references are fully conformant if they are both expansions
2829 of the discriminant of a protected type, within one of the
2830 protected operations. One occurrence may be expanded into a
2831 constant declaration while the other is an input parameter to
2832 the corresponding generated subprogram.
2834 2017-05-02 Justin Squirek <squirek@adacore.com>
2836 * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
2837 recursivly searching composite-types for null-excluding access
2838 types and verifying them.
2839 (Analyze_Object_Declaration): Add a
2840 call to Check_Null_Excluding_Components for static verification
2841 of non-initialized objects.
2842 * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
2843 a parameter for a composite-type's component and an extra case
2844 for printing component information.
2846 2017-05-02 Yannick Moy <moy@adacore.com>
2848 * sem_ch10.adb (Analyze_Subunit): Take
2849 configuration pragma into account when restoring appropriate
2850 pragma for analysis of subunit.
2852 2017-05-02 Justin Squirek <squirek@adacore.com>
2854 * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
2855 s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
2856 g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
2857 clauses from the runtime.
2859 2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
2861 * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
2862 array components specially.
2864 2017-05-02 Ed Schonberg <schonberg@adacore.com>
2866 * sem_ch8.adb (Premature_Usage): If the premature usage of
2867 an entity is as the expression in its own object decaration,
2868 rewrite the reference as Any_Id to prevent cascaded errors or
2869 compiler loops when such an entity is used in an address clause.
2871 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
2873 * gcc-interface/decl.c (components_to_record): Add missing guard.
2875 2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
2877 * gcc-interface/decl.c (components_to_record): Add more comments.
2878 Put back pending fields onto the regular list if the misalignment
2879 happens to cancel itself.
2881 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2883 * sem_ch4.adb (Complete_Object_Operation): When rewriting the
2884 controlling actual in a prefixed call, preserve the original node
2885 information if the prefix itself has been rewritten, for ASIS use.
2887 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2889 * exp_ch6.adb (Insert_Post_Call_Actions):
2890 Code clean up. Insert the post-call actions after an enclosing
2891 procedure call when N denotes a function call and appears as an
2892 actual parameter in the procedure call.
2894 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2896 * freeze.adb (Check_Component_Storage_Order): If there is a clause
2897 for the component, also reject the attribute if the component
2898 doesn't end on a byte boundary and its scalar storage order is
2899 different from that of the enclosing record type.
2901 2017-04-28 Javier Miranda <miranda@adacore.com>
2903 * atree.ads (Info_Messages): Removed.
2904 (Warning_Info_Messages): New counter.
2905 (Report_Info_Messages): New counter.
2906 * err_vars.ads Update documentation.
2907 * errout.adb (Delete_Warning_And_Continuations): Update
2908 Info_Message occurrences.
2909 (Error_Msg_Internal): Update Info_Message occurrences.
2910 (Delete_Warning): Update Info_Message occurrences.
2911 (Write_Error_Summary): Update Info_Message occurrences.
2912 (Output_Messages): Update Info_Message occurrences.
2913 (To_Be_Removed): Update Info_Message occurrences.
2914 (Reset_Warnings): Update Info_Message occurrences.
2915 * errutil.adb (Error_Msg): Update Info_Message occurrences.
2916 (Finalize): Update Info_Message occurrences.
2917 (Initialize): Update Info_Message occurrences.
2918 * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
2919 (Compilation_Errors): Update Info_Message_Occurences.
2921 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2923 * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
2924 * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
2925 * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
2926 * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
2927 * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
2928 * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
2930 * sem_eval.adb (Why_Not_Static): Initialize Typ.
2931 * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
2933 2017-04-28 Bob Duff <duff@adacore.com>
2935 * sem_util.ads, sem_util.adb (Might_Raise): New function
2936 that replaces Is_Exception_Safe, but has the opposite
2937 sense. Is_Exception_Safe was missing various cases -- calls inside
2938 a pragma Debug, calls inside an 'if' or assignment statement,
2939 etc. Might_Raise now walks the entire subtree looking for things
2941 * exp_ch9.adb (Is_Exception_Safe): Remove.
2942 (Build_Protected_Subprogram_Body): Replace call to
2943 Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
2944 constants where possible).
2945 * exp_ch7.adb: Rename Is_Protected_Body -->
2946 Is_Protected_Subp_Body. A protected_body is something different
2949 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
2951 * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
2952 * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
2953 (P_Discrete_Choice_List): Initialize Expr_Node variable.
2954 * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
2955 (P_Protected): Likewise.
2956 * sem_case.adb (Check_Duplicates):
2957 Add pragma Warnings on variable.
2958 * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
2959 * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable.
2960 * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
2961 (Analyze_Exit_Statement): Initialize Scope_Id variable.
2962 (Analyze_Iterator_Specification): Initialize Bas variable.
2963 * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
2964 Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
2965 (Analyze_Accept_Statement): Initialize Task_Nam.
2967 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
2969 * checks.adb (Install_Primitive_Elaboration_Check):
2970 Do not generate an elaboration check if all checks have been
2973 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2975 * sem_ch13.adb (Analyze_Aspect_Specifications, case
2976 Interrupt_Handler and Attach_Handler): Generate reference
2977 to protected operation to prevent spurious warnings about
2978 unreferenced entities. Previous scheme failed with style checks
2981 2017-04-28 Ed Schonberg <schonberg@adacore.com>
2983 * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
2984 that follows an expression function must not be relocated to
2985 the generated body, because it applies to the code that follows.
2987 2017-04-28 Gary Dismukes <dismukes@adacore.com>
2989 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
2990 Relaxed_RM_Semantics to avoid having CodePeer issue errors on
2991 code that might violate the more stringent checking for 'Access
2992 introduced in Ada 2005.
2994 2017-04-28 Arnaud Charlet <charlet@adacore.com>
2996 * a-cforse.adb: minor style fix in comment.
2998 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
3000 * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
3001 initialize Block_Decls variable.
3002 (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
3003 (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
3004 * exp_disp.adb (Expand_Interface_Actuals): Initialize
3005 Formal_DDT and Actual_DDT variables.
3006 (Expand_Interface_Thunk): Initialize Iface_Formal.
3007 (Make_DT): Initialize Size_Comp.
3008 (Make_Select_Specific_Data_Table): Initialize Decls.
3009 * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
3010 Also initialize more RPC_Receiver_* variables.
3011 (Build_To_Any_Function): Initialize Cstr_Formal.
3012 * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
3014 2017-04-28 Ed Schonberg <schonberg@adacore.com>
3016 * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
3017 node between access types, freeze the designated type as well,
3018 so that dispatch table pointers are created in the proper scope,
3019 and not in the constructed body of the expression function.
3021 2017-04-28 Bob Duff <duff@adacore.com>
3023 * alloc.ads (Nodes_Initial): Go back to previous value. The large
3024 value makes large compilations faster, but small compilations slower.
3026 2017-04-28 Arnaud Charlet <charlet@adacore.com>
3028 * sem_util.adb: minor typos in Is_Child_Or_Sibling.
3030 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3032 * erroutc.adb (Compilation_Errors): Do not consider info messages
3033 as suitable warnings when warnings must be treated as errors.
3034 * sem_ch7.adb (Analyze_Package_Specification): Do not consider
3035 internally-generated packages when outputting completion
3037 * errout.adb (Output_Messages): Do not consider info messages as
3038 suitable warnings when warnings must be treated as errors.
3039 * errutil.adb (Finalize): Do not consider info messages as
3040 suitable warnings when warnings must be treated as errors.
3042 2017-04-28 Eric Botcazou <ebotcazou@adacore.com>
3044 * warnsw.ads: Minor fix for incorrect wording in comment.
3046 2017-04-28 Ed Schonberg <schonberg@adacore.com>
3048 * sem_res.adb (In_Instance_Code): New predicate in
3049 Valid_Conversion, to determine whether a type conversion appears
3050 as (or within) an actual for a formal object. Type conversions
3051 in instances are not rechecked in Valid_Conversion because
3052 visibility changes between generic location andi instance may
3053 lead to spurious errors, but conversions within an actual must be
3054 fully checked, and they are not fully resolved when pre-analyzing
3057 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3059 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
3060 New_Copy_Tree instead of Relocate_Node as any subsequent copies
3061 of the relocated node will have mangled Parent pointers.
3062 * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
3063 tables used in conjunction with entity and itype replication.
3064 (Visit_Entity): Rewrite the restriction on which entities
3065 require duplication. The restriction now includes all types.
3067 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3069 * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
3070 a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
3071 a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
3074 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com>
3076 * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
3077 gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
3079 2017-04-28 Gary Dismukes <dismukes@adacore.com>
3081 * exp_util.adb: Minor reformatting.
3083 2017-04-28 Ed Schonberg <schonberg@adacore.com>
3085 * sem_ch4.adb: Fix copy/pasto.
3087 2017-04-27 Tristan Gingold <gingold@adacore.com>
3089 * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
3090 raise-gcc.c. Fix include search path for raise-gcc.c
3092 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3094 * fe.h (Warn_On_Questionable_Layout): Declare.
3095 * warnsw.ads (Warn_On_Record_Holes): Move down.
3096 (Warn_On_Questionable_Layout): New boolean variable.
3097 (Warning_Record): Add Warn_On_Questionable_Layout field.
3098 * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
3099 (Restore_Warnings): Likewise.
3100 (Save_Warnings): Likewise.
3101 (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
3102 * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
3103 components_to_record.
3104 (gnu_field_to_gnat): New function.
3105 (warn_on_field_placement): Likewise.
3106 (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
3107 parameters. Rename local variables and adjust recursive call.
3108 Rework final scan of the field list and implement warnings on the
3109 problematic placement of specific sorts of fields.
3111 2017-04-27 Bob Duff <duff@adacore.com>
3113 * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
3114 * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
3115 * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
3116 * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
3117 * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
3118 * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
3119 For efficiency, cache results of Is_Internal_File_Name and
3120 Is_Predefined_File_Name in the Units table. This avoids a lot
3121 of repeated text processing.
3123 2017-04-27 Emmanuel Briot <briot@adacore.com>
3125 * g-comlin.adb (Sort_Sections): remove useless test.
3127 2017-04-27 Claire Dross <dross@adacore.com>
3129 * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
3130 allow the use of regular equality over elements in contracts.
3131 (Formal_Model): Ghost package containing model functions that are
3132 used in subprogram contracts.
3133 (Current_To_Last): Removed, model functions should be used instead.
3134 (First_To_Previous): Removed, model functions should be used instead.
3135 (Strict_Equal): Removed, model functions should be used instead.
3136 (No_Overlap): Removed, model functions should be used instead.
3137 (Equivalent_Keys): Functions over cursors are removed. They were
3138 awkward with explicit container parameters.
3139 * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
3140 allow the use of regular equality over elements in contracts.
3141 (Formal_Model): Ghost package containing model functions that
3142 are used in subprogram contracts.
3143 (Current_To_Last): Removed, model functions should be used instead.
3144 (First_To_Previous): Removed, model functions should be used instead.
3145 (Strict_Equal): Removed, model functions should be used instead.
3146 (No_Overlap): Removed, model functions should be used instead.
3148 2017-04-27 Yannick Moy <moy@adacore.com>
3150 * gnat1drv.adb: Code cleanup.
3152 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3154 * exp_util.adb (Replace_Entity): The prefix of a 'Result
3155 attribute reference in a post- condition is the subprogram to
3156 which the condition applies. If the condition is inherited
3157 by a type extension, the prefix becomes a reference to the
3158 inherited operation, but there is no need to create a wrapper
3159 for this operation, because 'Result is expanded independently
3160 when elaborating the postconditions.
3162 2017-04-27 Bob Duff <duff@adacore.com>
3164 * sinput.adb: Minor code cleanup.
3165 * namet.adb (Append): Create faster versions of
3166 Append(String) and Append(Name_Id) by using slice assignment
3168 * sem_util.adb (In_Instance): Speed this up by removing
3169 unnecessary tests; Is_Generic_Instance is defined for all
3171 * sem_util.ads, sem_util.adb (In_Parameter_Specification):
3172 Remove unused function.
3173 * alloc.ads (Nodes_Initial): Use a much larger value, because
3174 the compiler was spending a lot of time copying the nodes table
3175 when it grows. This number was chosen in 1996, so is rather out
3176 of date with current memory sizes. Anyway, it's virtual memory.
3177 Get rid of Orig_Nodes_...; use Node_... instead.
3178 * atree.adb (Lock): Do not release the Nodes tables; it's a
3180 Orig_Nodes_ ==> Nodes_
3181 * nlists.adb: Orig_Nodes_ ==> Nodes_
3182 * g-table.adb: Remove unused "with" clause.
3183 * g-table.ads, table.ads: Remove Big_Table_Type, which should
3184 not be used by clients.
3185 * g-dyntab.adb (Last_Allocated): New function
3186 to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
3188 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3190 * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
3192 (Subtypes_Statically_Match): Remove duplicate check.
3193 * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
3195 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3197 * exp_aggr.adb (Replace_Type): Remove the special processing
3198 for selected components.
3199 * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
3200 processing for attributes Fixed_Value and Integer_Value.
3201 * exp_util.adb (Side_Effect_Free): Merge the processing for
3202 qualified expressions, type conversions, and unchecked type
3204 * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
3206 * par-ch3.adb (P_Declarative_Items): Merge the processing for
3207 tokens function, not, overriding, and procedure.
3208 * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
3209 for qualified expressions, type conversions, and unchecked
3211 * sem_util.adb (Compile_Time_Constraint_Error): Merge the
3212 processing for Ada 83 and instances.
3213 (Object_Access_Level): Merge the processing for indexed components
3214 and selected components.
3215 * uname.adb (Add_Node_Name): Merge the processing for stubs.
3217 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3219 * checks.adb (Install_Primitive_Elaboration_Check):
3220 Do not generate the check when restriction No_Elaboration_Code
3223 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3225 * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
3226 of Expand_Dispatching_Call. If the denoted subprogram has a
3227 class-wide precondition, this is the only precondition that
3228 applies to the call, rather that the class-wide preconditions
3229 that may apply to the body that is executed. (This is specified
3232 2017-04-27 Yannick Moy <moy@adacore.com>
3234 * gnat1drv.adb (Adjust_Global_Switches): Issue
3235 a warning in GNATprove mode if the runtime library does not
3236 support IEEE-754 floats.
3238 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3240 * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
3241 is itself inherited it does not carry any contract information,
3242 so examine its parent operation which is its Alias.
3244 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3246 * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
3247 prefix can be an object reference in which case Obj'Image (X)
3248 can only be interpreted as an indexing of the parameterless
3249 version of the attribute.
3250 * par-ch4.adb (P_Name): An attribute reference can be the prefix of
3251 an indexing or a slice operation if the attribute does not require
3252 parameters. In Ada2012 'Image also belongs in this category,
3253 and A'Image (lo .. hi) is legal and must be parsed as a slice.
3255 2017-04-27 Yannick Moy <moy@adacore.com>
3257 * exp_ch4.adb: Minor reformatting.
3258 * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
3259 disable the CodePeer and C generation modes. Similar to the
3260 opposite actions done in CodePeer mode.
3262 2017-04-27 Yannick Moy <moy@adacore.com>
3264 * sem_res.adb: Remove duplicate code.
3265 * sem_attr.adb: Delete duplicate code.
3267 2017-04-27 Bob Duff <duff@adacore.com>
3269 * g-dyntab.adb: Reduce the amount of copying in
3270 Release. No need to copy items past Last.
3272 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3274 * checks.adb Add with and use clauses for Sem_Disp.
3275 (Install_Primitive_Elaboration_Check): New routine.
3276 * checks.ads (Install_Primitive_Elaboration_Check): New routine.
3277 * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
3278 processing of 'Elaborated.
3279 * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
3282 2017-04-27 Bob Duff <duff@adacore.com>
3284 * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
3285 If the table grows and then shrinks back to empty, we won't necessarily
3286 point back to the empty array. Code cleanups.
3287 * sinput.ads: Add 'Base to Size clause to match the declared
3290 2017-04-27 Claire Dross <dross@adacore.com>
3292 * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
3293 allow the use of regular equality over elements in contracts.
3294 (Formal_Model): Ghost package containing model functions that
3295 are used in subprogram contracts.
3296 (Current_To_Last): Removed, model functions should be used instead.
3297 (First_To_Previous): Removed, model functions should be used instead.
3298 (Strict_Equal): Removed, model functions should be used instead.
3299 (No_Overlap): Removed, model functions should be used instead.
3300 * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
3301 Boolean generic parameter to disable contracts for equivalence
3303 (Witness): Create a witness of a key that is used for handling of
3304 equivalence between keys.
3305 (Has_Witness): Check whether a witness is contained in a map.
3306 (W_Get): Get the element associated to a witness.
3307 (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
3309 * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
3310 Boolean generic parameter to disable contracts for equivalence
3312 * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
3313 of equivalence on functional maps.
3314 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
3315 of equivalence on functional maps.
3317 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3319 * exp_ch9.adb (Expand_Entry_Barrier): Code
3320 cleanup. Do not perform the optimization which removes the
3321 declarations of the discriminant and component renamings when
3322 validity checks on operands and attributes are in effect.
3324 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3326 * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
3327 freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
3328 a-cfhama.ads, a-cofove.ads: Minor reformatting.
3330 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3332 * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
3333 pointer dereference.
3334 * g-spipat.adb (Dump): Code clean up. Protect against a possible
3335 null pointer dereference.
3337 2017-04-27 Bob Duff <duff@adacore.com>
3339 * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
3340 Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
3341 Free renames Init, since they do the same thing.
3342 * g-table.ads: Default for Table_Low_Bound.
3343 * table.ads: Default for Table_Low_Bound, Table_Initial, and
3346 2017-04-27 Bob Duff <duff@adacore.com>
3348 * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
3350 * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
3351 * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
3352 Reorder code so that above assertions do not fail.
3353 * table.ads: Remove obsolete comment on Locked.
3355 2017-04-27 Claire Dross <dross@adacore.com>
3357 * a-cfdlli.ads: Code cleanup.
3359 2017-04-27 Yannick Moy <moy@adacore.com>
3361 * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
3362 when needed for proof. (Expand_SPARK): Call the new procedure.
3363 * exp_util.ads Fix typo.
3365 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3367 * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
3370 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3372 * sem_elab.adb Add new type Visited_Element
3373 and update the contents of table Elab_Visited. Various code clean up.
3374 (Check_Elab_Call): Determine whether a prior call to
3375 the same subprogram was already examined within the same context.
3376 (Check_Internal_Call_Continue): Register the subprogram being
3377 called as examined within a particular context. Do not suppress
3378 elaboration warnings.
3380 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3382 * xoscons.adb, osint.ads: Minor reformatting.
3384 2017-04-27 Bob Duff <duff@adacore.com>
3386 * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
3387 Table_Count_Type --> Table_Last_Type, because the name
3388 was confusing (a "count" usually starts at zero). Add
3389 functionality supported or needed by other tables packages
3390 (Move, Release_Threshold).
3391 * g-table.ads, g-table.adb: This is now just a thin wrapper
3392 around g-dyntab.ads/g-dyntab.adb. Add functionality supported
3393 or needed by other tables packages (Save, Restore).
3394 * table.ads, table.adb: This is now just a thin wrapper around
3395 * g-table.ads/g-table.adb.
3396 * namet.h, scos.h, uintp.h: These files are reaching into the
3397 private data of some instances of g-table, whose names changed,
3398 so the above change requires some adjustment here. It now uses
3401 2017-04-27 Bob Duff <duff@adacore.com>
3403 * namet.adb, namet.ads: Minor: remove unused procedures.
3405 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3407 * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
3408 (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
3409 Add pragma Warnings on Rtype variable in nested block. *
3410 * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
3411 * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
3412 (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
3413 * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
3414 (Process_Component_List_For_Finalize): Initialize Counter_Id.
3415 (Build_Finalize_Statements): Initialize Bod_Stmts.
3416 * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
3418 2017-04-27 Claire Dross <dross@adacore.com>
3420 * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
3421 allow the use of regular equality over elements in contracts.
3422 (Formal_Model): Ghost package containing model functions that are
3423 used in subprogram contracts.
3424 (Current_To_Last): Removed, model
3425 functions should be used instead.
3426 (First_To_Previous): Removed, model functions should be used instead.
3427 (Strict_Equal): Removed, model functions should be used instead.
3428 (No_Overlap): Removed, model functions should be used instead.
3429 (Equivalent_Keys): Functions over cursors are removed. They were
3430 awkward with explicit container parameters.
3431 * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
3432 (proof only) procedure to help GNATprove when equivalence over
3433 keys is not equality.
3435 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3437 * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
3438 sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
3439 Minor reformatting and code cleanups.
3441 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3443 * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
3444 subsidiary of Check_Inherited_Conditions, to build pragmas for an
3445 operation whose ancestor has classwide pre/postconditions. This
3446 is used both to check the legality of the inheritance in Ada
3447 and in SPARK, and to determine whether a wrapper is needed for
3448 an inherited operation.
3449 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
3450 Improve placement of error message for inherited classwide
3451 conditions that become illegal on type derivation.
3453 2017-04-27 Yannick Moy <moy@adacore.com>
3455 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
3456 SPARK_Mode from context on generic package.
3457 * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
3460 2017-04-27 Claire Dross <dross@adacore.com>
3462 * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
3463 overflows in computations.
3464 * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
3465 overflows in computations.
3466 (Insert): Rewrite precondition to avoid overflows in computations.
3467 * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
3468 overflows in computations.
3469 (Insert): Rewrite precondition to avoid overflows in computations.
3471 2017-04-27 Steve Baird <baird@adacore.com>
3473 * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
3474 flag when it is declared in order to avoid confusing CodePeer about
3475 the possibility of an uninitialized variable read.
3477 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3479 * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
3480 no dimensionality error if the subtype of the expression is
3481 identical to the nominal subtype in the declaration, even though
3482 the expression itself may have been constant-folded and lack a
3484 * sem_dim.ads: Add comments on setting of dimension vectors and
3485 its interaction with node rewritings and side-effect removal.
3487 2017-04-27 Bob Duff <duff@adacore.com>
3489 * debug.adb: Minor comment correction.
3490 * sem_dim.ads: Minor reformatting and typo fixes.
3492 2017-04-27 Bob Duff <duff@adacore.com>
3494 * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
3495 Last of the tables via function calls, rather than relying on layout
3498 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3500 * exp_util.adb: No wrapper in GNATprove mode.
3502 2017-04-27 Yannick Moy <moy@adacore.com>
3504 * sem_res.adb (Resolve_Comparison_Op): Always
3505 evaluate comparisons between values of universal types.
3507 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3509 * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
3510 an elaboration counter nor a check when in GNATprove mode.
3511 * sem_util.adb (Build_Elaboration_Entity): Do not create an
3512 elaboration counter when in GNATprove mode.
3514 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3516 * freeze.adb: copy-paste typo.
3518 2017-04-27 Yannick Moy <moy@adacore.com>
3520 * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
3521 Use correct test to detect call in GNATprove mode instead of
3524 2017-04-27 Claire Dross <dross@adacore.com>
3526 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
3527 New property function expressing that the element of a
3528 sequence are contained in the union of two sequences.
3529 (Formal_Model.M_Elements_Included): New property function
3530 expressing that the element of a sequence are another sequence.
3531 (Generic_Sorting): Use new property functions to state that
3532 elements are preserved by Sort and Merge.
3533 * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
3534 allow the use of regular equality over elements in contracts.
3535 (Formal_Model): Ghost package containing model functions
3536 that are used in subprogram contracts. (Capacity):
3537 On unbounded containers, return the maximal capacity.
3538 (Current_To_Last): Removed, model functions should be used instead.
3539 (First_To_Previous): Removed, model functions should be used instead.
3540 (Append): Default parameter value replaced
3541 by new wrapper to allow more precise contracts.
3542 (Insert): Subprogram restored, it seems it was useful to users even if
3544 (Delete): Subprogram restored, it seems it was useful to users even if
3546 (Prepend): Subprogram restored, it seems it was useful to users even
3547 if it is inefficient.
3548 (Delete_First): Subprogram restored, it seems it
3549 was useful to users even if it is inefficient. (Delete_Last):
3550 Default parameter value replaced by new wrapper to allow more
3552 (Generic_Sorting.Merge): Subprogram restored.
3553 * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
3554 allow the use of regular equality over elements in contracts.
3555 (Formal_Model): Ghost package containing model functions
3556 that are used in subprogram contracts. (Capacity):
3557 On unbounded containers, return the maximal capacity.
3558 (Current_To_Last): Removed, model functions should be used
3560 (First_To_Previous): Removed, model functions should be used instead.
3561 (Append): Default parameter value replaced
3562 by new wrapper to allow more precise contracts.
3563 (Insert): Subprogram restored, it seems it was useful to users even if
3565 (Delete): Subprogram restored, it seems it was useful to users even if
3567 (Prepend): Subprogram restored, it seems it was useful to users even
3568 if it is inefficient.
3569 (Delete_First): Subprogram restored, it seems it
3570 was useful to users even if it is inefficient. (Delete_Last):
3571 Default parameter value replaced by new wrapper to allow more
3573 (Generic_Sorting.Merge): Subprogram restored.
3574 (Vector): Do not reuse formal vectors, as it is no longer possible
3575 to supply them with an equality function over elements.
3577 2017-04-27 Bob Duff <duff@adacore.com>
3579 * g-dyntab.adb (Release): When allocating the new
3580 table, use the correct slice of the old table to initialize it.
3582 2017-04-27 Eric Botcazou <ebotcazou@adacore.com>
3584 * einfo.ads: Minor fixes in comments.
3586 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3588 * sem_prag.adb: disable clones in SPARK_Mode.
3590 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3592 * sem_util.ads, contracts.adb: Minor reformatting.
3594 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3596 * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
3597 Build body of subprogram that has a class-wide condition that
3598 contains calls to other primitives.
3599 (Build_Class_Wide_Clone_Call); Build a call to the common
3600 class-wide clone of a subprogram with classwide conditions. The
3601 body of the subprogram becomes a wrapper for a call to the
3602 clone. The inherited operation becomes a similar wrapper to which
3603 modified conditions apply, and the call to the clone includes
3604 the proper conversion in a call the parent operation.
3605 (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
3606 subprogram that has a classwide condition that contains calls to
3607 other primitives, build an internal subprogram that is invoked
3608 through a type-specific wrapper for all inherited subprograms
3609 that may have a modified condition.
3610 * sem_prag.adb (Check_References): If subprogram has a classwide
3611 condition, create entity for corresponding clone, to be invoked
3612 through wrapper subprograns.
3613 (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
3614 message about placement if pragma isi internally generated.
3615 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
3616 a classwide clone, build body of clone as copy of original body,
3617 and rewrite original body as a wrapper as a wrapper for a call to
3618 the clone, so that it incorporates the original pre/postconditions
3620 * freeze.adb (Check_Inherited_Conditions): For an inherited
3621 subprogram that inherits a classwide condition, build spec and
3622 body of corresponding wrapper so that call to inherited operation
3623 gets the modified conditions.
3624 * contracts.adb (Analyze_Contracts): If analysis of classwide
3625 condition has created a clone for a primitive operation, analyze
3626 declaration of clone.
3628 2017-04-27 Steve Baird <baird@adacore.com>
3630 * exp_util.adb (Build_Allocate_Deallocate_Proc):
3631 Add "Suppress => All_Checks" to avoid generating unnecessary
3634 2017-04-27 Yannick Moy <moy@adacore.com>
3636 * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
3637 * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
3638 inlining body in GNATprove mode when switch -gnatdm used.
3639 * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
3640 in GNATprove mode when switch -gnatdm used.
3642 2017-04-27 Arnaud Charlet <charlet@adacore.com>
3644 * sem_ch13.adb (Analyze_Attribute_Definition_Clause
3645 [Attribute_Address]): Call Set_Address_Taken when ignoring rep
3646 clauses, so that we keep an indication of the address clause
3647 before removing it from the tree.
3649 2017-04-27 Yannick Moy <moy@adacore.com>
3651 * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
3652 of expression being qualified, when not an object name, or else
3653 evaluate the underlying name.
3655 2017-04-27 Jerome Lambourg <lambourg@adacore.com>
3657 * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
3659 2017-04-27 Justin Squirek <squirek@adacore.com>
3661 * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
3662 Process_Component_List_For_Finalization as a local variable.
3663 (Process_Component_For_Finalize): Add an extra parameter to avoid
3665 (Process_Component_List_For_Finalization): Correct calls to
3666 Process_Component_For_Finalize to take Num_Comps as a parameter.
3668 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3670 * sem_ch8.adb (Find_Direct_Name): Account for the case where
3671 a use-visible entity is defined within a nested scope of an
3672 instance when giving priority to entities which were visible in
3673 the original generic.
3674 * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
3676 2017-04-27 Tristan Gingold <gingold@adacore.com>
3678 * raise-gcc.c: Don't use unwind.h while compiling
3679 for the frontend, but mimic host behavior.
3681 2017-04-27 Javier Miranda <miranda@adacore.com>
3683 * sem_ch3.adb (Build_Discriminated_Subtype):
3684 Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
3686 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3688 * sem_prag.adb (Analyze_Global_Item):
3689 Do not consider discriminants because they are not "entire
3690 objects". Remove the discriminant-related checks because they are
3692 (Analyze_Input_Output): Do not consider discriminants
3693 because they are not "entire objects".
3695 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3697 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
3698 perform check if the current scope does not come from source,
3699 as is the case for a rewritten task body, because check has
3700 been performed already, and may not be doable because of changed
3703 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3705 * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
3706 a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
3709 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3711 * sem_ch4.adb (Analyze_Call): If the return type of a function
3712 is incomplete in an context in which the full view is available,
3713 replace the type of the call by the full view, to prevent spurious
3715 * exp_disp.adb (Check_Premature_Freezing): Disable check on an
3716 abstract subprogram so that compiler does not reject a parameter
3717 of a primitive operation of a tagged type being frozen, when
3718 the untagged type of that parameter cannot be frozen.
3720 2017-04-27 Bob Duff <duff@adacore.com>
3722 * sem_attr.adb (Compute_Type_Key): Don't walk
3723 representation items for irrelevant types, which could be in a
3724 different source file.
3726 2017-04-27 Steve Baird <baird@adacore.com>
3728 * exp_attr.adb (Expand_N_Attribute_Reference):
3729 Don't expand Image, Wide_Image, Wide_Wide_Image attributes
3732 2017-04-27 Yannick Moy <moy@adacore.com>
3734 * exp_unst.ads: Fix typos in comments.
3736 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3738 * sem_eval.adb (Choice_Matches): Handle properly a real literal
3739 whose type has a defined static predicate.
3741 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3743 * exp_ch4.adb (Insert_Dereference_Action):
3744 Do not adjust the address of a controlled object when the
3745 associated access type is subject to pragma No_Heap_Finalization.
3748 2017-04-27 Pierre-Marie de Rodat <derodat@adacore.com>
3750 * gcc-interface/utils.c (gnat_type_for_size): Set
3751 TYPE_ARTIFICIAL on created types.
3753 2017-04-27 Claire Dross <dross@adacore.com>
3755 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
3756 modifications in functional containers.
3757 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
3758 to improve readablity. Subprograms are separated between basic
3759 operations, constructors and properties. Universally quantified
3760 formulas in contracts are factorized in independant functions
3761 with a name and a comment. Names of parameters are improved.
3763 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3765 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
3767 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3769 * sem_res.adb (Resolve_Type_Conversion): Do not
3770 install a predicate check here since this is already done during
3771 the expansion phase. Verify whether the operand satisfies the
3772 static predicate (if any) of the target type.
3773 * sem_ch3.adb (Analyze_Object_Declaration): Do
3774 not install a predicate check if the object is initialized by
3775 means of a type conversion because the conversion is subjected
3778 2017-04-27 Tristan Gingold <gingold@adacore.com>
3780 * raise.c (__gnat_builtin_longjmp): Remove.
3781 (__gnat_bracktrace):
3782 Add a dummy definition for the compiler (__gnat_eh_personality,
3783 __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
3784 __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
3785 __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
3786 * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
3787 * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
3788 and a-except-2005.adb.
3789 * raise-gcc.c: Allow build in compiler, compiled as a C++
3791 (__gnat_Unwind_ForcedUnwind): Adjust prototype.
3792 (db): Constify msg_format.
3793 (get_call_site_action_for): Don't use void arithmetic.
3794 * system.ads (Frontend_Exceptions): Set to False.
3795 (ZCX_By_Default): Set to True.
3796 (GCC_ZC_Support): Set to True.
3797 * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
3799 * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
3800 in gnat1 and gnatbind.
3801 * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
3802 s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
3803 * s-excmac.ads, s-excmac.adb: Copy of variants.
3804 * a-except.o: Adjust preequisites.
3805 Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
3807 2017-04-27 Claire Dross <dross@adacore.com>
3809 * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
3810 modifications in functional containers.
3811 * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
3812 to improve readablity. Subprograms are separated between basic
3813 operations, constructors and properties. Universally quantified
3814 formulas in contracts are factorized in independant functions
3815 with a name and a comment. Names of parameters are improved.
3817 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3819 * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
3821 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3823 * sem_res.adb (Resolve_Type_Conversion): Do not
3824 install a predicate check here since this is already done during
3825 the expansion phase. Verify whether the operand satisfies the
3826 static predicate (if any) of the target type.
3827 * sem_ch3.adb (Analyze_Object_Declaration): Do
3828 not install a predicate check if the object is initialized by
3829 means of a type conversion because the conversion is subjected
3832 2017-04-27 Tristan Gingold <gingold@adacore.com>
3834 * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
3835 replaced by their variants).
3837 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3839 * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
3840 cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
3841 a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
3843 2017-04-27 Tristan Gingold <gingold@adacore.com>
3845 * s-excmac-gcc.ads, s-excmac-gcc.adb,
3846 s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
3849 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3851 * exp_ch7.adb (Establish_Transient_Scope): Rewrite
3852 the loop which detects potential enclosing transient scopes. The
3853 loop now terminates much earlier as transient scopes are bounded
3854 by packages and subprograms.
3856 2017-04-27 Claire Dross <dross@adacore.com>
3858 * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
3859 allow the use of regular equality over elements in contracts.
3860 (Cursor): Type is now public so that it can be used in
3862 (Formal_Model): Ghost package containing
3863 model functions that are used in subprogram contracts.
3864 (Current_To_Last): Removed, model functions should be used
3866 (First_To_Previous): Removed, model functions should
3868 (Strict_Equal): Removed, model functions
3869 should be used instead.
3870 (Append): Default parameter value
3871 replaced by new wrapper to allow more precise contracts.
3872 (Insert): Default parameter value replaced by new wrapper to
3873 allow more precise contracts.
3874 (Delete): Default parameter
3875 value replaced by new wrapper to allow more precise contracts.
3876 (Prepend): Default parameter value replaced by new wrapper to
3877 allow more precise contracts.
3878 (Delete_First): Default parameter
3879 value replaced by new wrapper to allow more precise contracts.
3880 (Delete_Last): Default parameter value replaced by new wrapper
3881 to allow more precise contracts.
3883 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3885 * exp_spark.adb (Expand_SPARK): Perform specialized expansion
3886 for object declarations.
3887 (Expand_SPARK_N_Object_Declaration): New routine.
3888 * sem_elab.adb (Check_A_Call): Include calls to the
3889 Default_Initial_Condition procedure of a type under the SPARK
3890 elaboration checks umbrella.
3892 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3894 * sem.adb (Analyze): Diagnose an illegal iterated component
3896 * sem_util.ads, sem_util.adb
3897 (Diagnose_Iterated_Component_Association): New routine.
3899 2017-04-27 Bob Duff <duff@adacore.com>
3901 * adaint.c (__gnat_get_current_dir): Return 0 in length if
3903 * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
3904 exception if getcwd failed.
3906 2017-04-27 Yannick Moy <moy@adacore.com>
3908 * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
3909 entities with special prefix.
3911 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3913 * debug.adb Change the documentation of switch -gnatd.s.
3914 * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
3915 to manage the secondary stack when an enclosing scope already
3916 performs this functionality (aka relaxed management). Switch
3917 -gnatd.s may be used to force strict management in which case
3918 the block will manage the secondary stack unconditionally. Add
3919 a guard to stop the traversal when encountering a package or a
3922 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3924 * sem_res.adb (Resolve_Call): Refine further the handling of
3925 limited views of return types in function calls. If the function
3926 that returns a limited view appears in the current unit,
3927 we do not replace its type by the non-limited view because
3928 this transformation is performed int the back-end. However,
3929 the type of the call itself must be the non-limited view, to
3930 prevent spurious resolution errors.
3932 2017-04-27 Ed Schonberg <schonberg@adacore.com>
3934 * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
3935 Removed, proposed implementation using generics for class-wide
3936 preconditions proved impractical.
3937 (Class_Wide_Clone): New attribute of subprogram. Designates
3938 subprogram created for primitive operations with class-wide
3939 pre/postconditions that contain calls to other primitives. The
3940 clone holds the body of the original primitive, but the
3941 pre/postonditions do not apply to it. The original body is
3942 rewritten as a wrapper for a call to the clone.
3943 (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
3944 the flag is set, no code for the corresponding pre/postconditions
3945 is inserted into its body.
3947 2017-04-27 Bob Duff <duff@adacore.com>
3949 * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
3950 Scalar_Storage_Order if -gnatI is given.
3951 * sem_prag.adb (Analyze_Pragma): Ignore
3952 Default_Scalar_Storage_Order if -gnatI is given.
3954 2017-04-27 Claire Dross <dross@adacore.com>
3956 * a-cofuba.ads (Add): Take as an additional input parameter
3957 the position where the element should be inserted.
3958 (Remove): New function that removes an element from the container.
3959 * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
3960 * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
3961 (Remove): New function that removes an element from a set.
3962 * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
3963 (Remove): New function that removes an element from a sequence.
3964 (Insert): New function that adds anywhere in a sequence.
3966 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3968 * checks.adb (Generate_Range_Check): Revert previous change.
3970 2017-04-27 Gary Dismukes <dismukes@adacore.com>
3972 * sem_util.adb: Minor reformatting/rewording.
3974 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
3976 * lib-xref.adb (Generate_Reference): The use
3977 of attribute 'Result is not considered a violation of pragma
3980 2017-04-27 Justin Squirek <squirek@adacore.com>
3982 * cstand.adb (Create_Standard): Correctly set
3983 Directly_Designated_Type for Any_Access.
3984 * sem_type.adb (Covers): Minor grammar fixes.
3986 2017-04-27 Bob Duff <duff@adacore.com>
3988 * sem_attr.adb: Minor cleanup.
3990 2017-04-27 Claire Dross <dross@adacore.com>
3992 * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
3993 private child of Ada.Containers used to implement all functional
3995 * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
3996 child of Ada.Containers. It provides functional indefinite unbounded
3997 maps which can be used as high level models for specification
3999 * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
4000 child of Ada.Containers. It provides functional indefinite unbounded
4001 sets which can be used as high level models for specification
4003 * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
4004 child of Ada.Containers. It provides functional indefinite unbounded
4005 vectors which can be used as high level models for specification
4007 * Makefile.rtl: Add new packages.
4008 * impunit.adb: Add new packages.
4010 2017-04-27 Gary Dismukes <dismukes@adacore.com>
4012 * sem_ch4.adb: Minor reformatting.
4014 2017-04-27 Ed Schonberg <schonberg@adacore.com>
4016 * sem_ch12.adb (Analyze_Associations): minor reformatting.
4017 (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
4018 point type actual that has user-defined arithmetic primitives,
4019 when there is a previous actual for a formal package that defines
4020 a fixed-point type with the parent user-defined operator.
4022 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
4024 * checks.adb (Generate_Range_Check): Reinstate part of previous change.
4025 * sem_attr.adb (Resolve_Attribute): Generate a range check when
4026 the component type allows range checks.
4028 2017-04-27 Ed Schonberg <schonberg@adacore.com>
4030 * sem_aux.adb (Is_Generic_Formal): Use original node to locate
4031 corresponding declaration, because formal derived types are
4032 rewritten as private extensions.
4034 2017-04-27 Ed Schonberg <schonberg@adacore.com>
4036 * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
4037 dimensions of operands if node has been analyzed already, because
4038 previous analysis and dimension checking will have removed the
4039 dimension information from the operands.
4041 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
4043 * debug.adb: Document the use of switch -gnatd.s.
4044 * einfo.ads Update the documentation on attribute
4045 Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
4046 the uses of these attributes from certain entities.
4047 * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
4048 which determines whether the block should continue to manage
4049 the secondary stack.
4050 (Manages_Sec_Stack): New routine.
4052 2017-04-27 Bob Duff <duff@adacore.com>
4054 * atree.ads: Minor edit.
4056 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
4058 * sinfo.ads: Update the section on Ghost mode. Add
4059 a section on SPARK mode. Update the placement of section on
4060 expression functions.
4062 2017-04-27 Bob Duff <duff@adacore.com>
4064 * sinput.adb (Get_Source_File_Index): Don't
4065 assert that S is in the right range in the case where this is
4066 a .dg file under construction.
4068 2017-04-27 Yannick Moy <moy@adacore.com>
4070 * sem_util.adb (Check_Result_And_Post_State):
4071 Handle more precisely each conjunct in expressions formed by
4072 and'ing sub-expressions.
4074 2017-04-27 Gary Dismukes <dismukes@adacore.com>
4076 * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
4078 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4080 * gnat_rm.texi, gnat_ugn.texi,
4081 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4082 doc/gnat_ugn/platform_specific_information.rst,
4083 doc/gnat_ugn/gnat_and_program_execution.rst,
4084 doc/gnat_ugn/gnat_utility_programs.rst,
4085 doc/gnat_ugn/the_gnat_compilation_model.rst,
4086 doc/gnat_rm/implementation_defined_attributes.rst,
4087 doc/gnat_rm/the_gnat_library.rst,
4088 doc/gnat_rm/implementation_defined_pragmas.rst,
4089 doc/gnat_rm/representation_clauses_and_pragmas.rst,
4090 doc/gnat_rm/implementation_of_specific_ada_features.rst,
4091 doc/gnat_rm/implementation_defined_aspects.rst,
4092 doc/gnat_rm/implementation_defined_characteristics.rst: Update
4095 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4097 * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
4098 generating C code on complex case expressions.
4100 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4102 * sem_prag.adb (Analyze_Pragma): Generate a warning instead
4103 of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
4104 * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
4105 Ada_2012 instead of Ada_2005 to be compatible with the above
4107 * bindgen.adb: Silence new warning on pragma Ada_95.
4109 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4111 * checks.adb (Generate_Range_Check): Revert part of previous change.
4113 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4115 * sem_ch4.adb (Try_Container_Indexing): Handle properly a
4116 container indexing operation that appears as a an actual in a
4117 parameter association in a procedure call.
4119 2017-04-25 Olivier Ramonat <ramonat@adacore.com>
4121 * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
4122 Fix spelling mistakes.
4124 2017-04-25 Bob Duff <duff@adacore.com>
4126 * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
4127 * sinput-p.adb: Use regular fat pointers, with bounds checking,
4128 for source buffers. Fix misc obscure bugs.
4129 * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
4130 checking, for source buffers. Modify representation clause for
4131 Source_File_Record as appropriate. Move Source_File_Index_Table
4132 from spec to body, because it is not used outside the body.
4133 Move Set_Source_File_Index_Table into the private part, because
4134 it is used only in the body and in children. Use trickery to
4135 modify the dope in the generic instantiation case. It's ugly,
4136 but not as ugly as the previous method. Fix documentation.
4137 Remove obsolete code.
4138 * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
4139 indexing in source buffers.
4140 * fmap.adb: Avoid conversions from one string type to another.
4141 Remove a use of global name buffer.
4142 * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
4145 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4147 * exp_util.adb, exp_ch4.adb: Minor reformatting.
4149 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4151 * checks.adb: Code clean up in various routines.
4152 (Generate_Range_Check): Do not generate a range check when the
4153 expander is not active or when index/range checks are suppressed
4155 (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
4156 Remove variants that include a Supress parameter. These routines
4157 are never used, and were introduced before the current scope-based
4158 check suppression method.
4160 2017-04-25 Vasiliy Fofanov <fofanov@adacore.com>
4162 * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
4163 code and some subprogram calls that are now noop.
4165 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4167 * exp_ch4.adb (Expand_N_Case_Expression): Take
4168 Minimize_Expression_With_Actions into account when possible.
4170 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4172 * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
4173 (Known_Null): Moved to Sem_Util.
4174 * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
4175 (Known_Null): Moved to Sem_Util.
4176 * sem_util.adb Add new enumeration type Null_Status_Kind.
4177 (Known_Non_Null): Moved from Exp_Util. Most of the logic in
4178 this routine is now carried out by Null_Status.
4179 (Known_Null): Moved from Exp_Util. Most of the logic in this routine
4180 is now carried out by Null_Status.
4181 (Null_Status): New routine.
4182 * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
4183 (Known_Null): Moved from Exp_Util.
4185 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4187 * sem_ch6.adb (Analyze_Expression_Function): Do not report an
4188 error on the return type of an expression function that is a
4189 completion, if the type is derived from a generic formal type.
4191 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4193 * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
4194 conversion are those of the target type.
4196 2017-04-25 Bob Duff <duff@adacore.com>
4198 * a-clrefi.adb: Minor cleanup.
4200 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4202 * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
4204 2017-04-25 Bob Duff <duff@adacore.com>
4206 * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
4207 types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
4208 errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
4209 scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
4210 the Internal_Source buffer. This removes the incorrect call to "="
4211 the customer noticed.
4212 Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
4213 eventually need to eliminate them altogether. Or else get rid
4214 of zero-origin addressing.
4216 2017-04-25 Claire Dross <dross@adacore.com>
4218 * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
4219 function used in GNATprove to know if an expression contains
4220 non-dispatching calls on primitives of a tagged type.
4222 2017-04-25 Bob Duff <duff@adacore.com>
4224 * rtsfind.adb (Initialize): Initialize
4225 First_Implicit_With. Building the compiler with Normalize_Scalars
4226 and validity checking finds this being used as an uninitialized
4229 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4231 * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
4232 Add a warning about SPARK mode management. The routine now
4233 saves and restores both the mode and associated pragma.
4234 (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
4235 SPARK mode management. The routine now saves and restores both
4236 the mode and associated pragma.
4237 (Analyze_Object_Contract):
4238 Add a warning about SPARK mode management. The routine
4239 now saves and restores both the mode and associated pragma.
4240 (Analyze_Package_Body_Contract): Add a warning about SPARK mode
4241 management. The routine now saves and restores both the mode
4242 and associated pragma. (Analyze_Package_Contract): Add a warning
4243 about SPARK mode management. The routine now saves and restores
4244 both the mode and associated pragma.
4245 (Analyze_Task_Contract):
4246 Add a warning about SPARK mode management. The routine now saves
4247 and restores both the mode and associated pragma.
4248 * expander.adb (Expand): Change the way the Ghost mode is saved
4250 * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
4252 * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
4254 * exp_util.adb (Build_DIC_Procedure_Body):
4255 Change the way the Ghost mode is saved and restored.
4256 (Build_DIC_Procedure_Declaration): Change the way the Ghost
4257 mode is saved and restored.
4258 (Build_Invariant_Procedure_Body):
4259 Change the way the Ghost mode is saved and restored.
4260 (Build_Invariant_Procedure_Declaration): Change the way the Ghost
4261 mode is saved and restored.
4262 (Make_Predicate_Call): Change the
4263 way the Ghost mode is saved and restored.
4264 * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
4266 * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4268 (Mark_And_Set_Ghost_Body): Remove parameter
4269 Mode and its assignment.
4270 (Mark_And_Set_Ghost_Completion):
4271 Remove parameter Mode and its assignment.
4272 (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
4274 (Mark_And_Set_Ghost_Instantiation): Remove parameter
4275 Mode and its assignment.
4276 (Mark_And_Set_Ghost_Procedure_Call):
4277 Remove parameter Mode and its assignment.
4279 Remove parameter Mode and its assignment.
4280 * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4281 and update the comment on usage.
4282 (Mark_And_Set_Ghost_Body):
4283 Remove parameter Mode and update the comment on usage.
4284 (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
4285 update the comment on usage.
4286 (Mark_And_Set_Ghost_Declaration):
4287 Remove parameter Mode and update the comment on usage.
4288 (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
4289 update the comment on usage.
4290 (Mark_And_Set_Ghost_Procedure_Call):
4291 Remove parameter Mode and update the comment on usage.
4292 (Set_Ghost_Mode): Remove parameter Mode and update the comment
4294 * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
4296 * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
4297 of obsolete field SPARK_Mode_Pragma.
4298 (Load_Main_Source): Remove
4299 the assignment of obsolete field SPARK_Mode_Pragma.
4300 (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
4301 * lib-writ.adb (Add_Preprocessing_Dependency): Remove
4302 the assignment of obsolete field SPARK_Mode_Pragma.
4303 (Ensure_System_Dependency): Remove the assignment of obsolete
4304 field SPARK_Mode_Pragma.
4305 * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
4306 mode management. Change the way Ghost and SPARK modes are saved
4308 * sem.adb (Analyze): Change the way the Ghost mode is saved
4310 * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
4311 Ghost mode is saved and restored.
4312 (Process_Full_View): Change
4313 the way the Ghost mode is saved and restored.
4314 * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
4315 mode is saved and restored.
4316 * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
4317 mode is saved and restored.
4318 (Analyze_Subprogram_Body_Helper):
4319 Change the way the Ghost mode is saved and restored.
4320 * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
4321 Ghost mode is saved and restored.
4322 * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
4323 management. Save the SPARK mode-related data prior to any changes
4324 to the scope stack and contexts. The mode is then reinstalled
4325 before the subunit is analyzed in order to restore the original
4326 view of the subunit.
4327 * sem_ch12.adb (Analyze_Package_Instantiation): Update the
4328 warning on region management. Change the way the Ghost and
4329 SPARK modes are saved and restored.
4330 (Inline_Instance_Body):
4331 Add a warning about SPARK mode management. Code clean up.
4332 (Analyze_Subprogram_Instantiation): Update the warning on region
4333 management. Change the way the Ghost and SPARK modes are saved
4335 (Instantiate_Package_Body): Update the warning
4336 on region management. Change the way the Ghost and SPARK modes
4337 are saved and restored.
4338 (Instantiate_Subprogram_Body): Update
4339 the warning on region management. Change the way the Ghost and
4340 SPARK modes are saved and restored.
4341 (Set_Instance_Env): Add a
4342 warning about SPARK mode management. Change the way SPARK mode
4343 is saved and restored.
4344 * sem_ch13.adb (Build_Predicate_Functions):
4345 Change the way the Ghost mode is saved and restored.
4346 (Build_Predicate_Function_Declaration): Change the way the Ghost
4347 mode is saved and restored.
4348 * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
4349 mode management. Change the way SPARK mode is saved and restored.
4350 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
4351 Change the way the Ghost mode is saved and restored.
4352 (Analyze_Initial_Condition_In_Decl_Part): Change the way
4353 the Ghost mode is saved and restored.
4355 Change the way the Ghost mode is saved and restored.
4356 (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
4357 Ghost mode is saved and restored.
4358 * sem_util.adb (Install_SPARK_Mode): New routine.
4359 (Restore_SPARK_Mode): New routine.
4360 (Save_SPARK_Mode_And_Set): Removed.
4361 (Set_SPARK_Mode): New routine.
4362 * sem_util.ads (Install_SPARK_Mode): New routine.
4363 (Restore_SPARK_Mode): New routine.
4364 (Save_SPARK_Mode_And_Set): Removed.
4365 (Set_SPARK_Mode): New routine.
4367 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4369 * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
4370 to determine whether a type is declared in a local package that
4371 has not yet been frozen.
4372 * freeze.adb (Freeze_Before): Use new predicate to determine
4373 whether a local package must be installed on the scope stack
4374 in order to evaluate in the proper scope actions generated by
4375 aspect specifications, such as Predicate
4376 * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
4377 using new predicate.
4379 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4381 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
4382 comparisons between non- scalar expressions expressions because
4383 their values cannot be invalidated.
4384 * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
4387 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4389 * par_sco.adb: Minor reformatting.
4391 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4393 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
4394 is a type from an unfrozen local package, install package to
4395 complete the analysis of delayed aspects of the type.
4397 2017-04-25 Tristan Gingold <gingold@adacore.com>
4399 * bingen.adb (System_Version_Control_Used): New variable.
4400 (Resolve_Binder_Options): Set the above variable.
4401 (Gen_Output_File_Ada): Conditionally call Gen_Versions.
4402 (Gen_Elab_Order): Emit blank line before.
4404 2017-04-25 Justin Squirek <squirek@adacore.com>
4406 * sem_cat.adb (Validate_RT_RAT_Component): Added
4407 an extra check to ignore incomplete types.
4409 2017-04-25 Thomas Quinot <quinot@adacore.com>
4411 * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
4412 bogus circuitry for the case where Name is Predicate.
4414 2017-04-25 Thomas Quinot <quinot@adacore.com>
4416 * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
4417 Create SCOs for Predicate aspects in disabled
4418 state initially, to be enabled later on by...
4419 * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
4420 SCO for predicate as enabled.
4422 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4424 * comperr.adb (Compiler_Abort): Remove now obsolete pair of
4425 pragmas Warnings Off / On.
4426 * namet.adb (Finalize): Remove now obsolete pair of pragmas
4428 * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
4429 * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
4430 consider comparisons between static expressions because their
4431 values cannot be invalidated.
4432 * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
4434 (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
4435 * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
4437 2017-04-25 Bob Duff <duff@adacore.com>
4439 * sem_elab.adb (In_Task_Activation): Trace internal calls in
4442 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4444 * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
4447 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4449 * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
4450 On/Off to defend against a spurious warning in conditional
4452 * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
4453 * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
4454 defend against a spurious warning in conditional compilation.
4455 * output.adb Add a pair of pragma Warnings On/Off to defend
4456 against a spurious warning in conditional compilation.
4457 * sem_eval.adb (Eval_Relational_Op): Major code clean up.
4458 (Fold_General_Op): New routine.
4459 (Fold_Static_Real_Op): New routine.
4460 (Test_Comparison): New routine.
4461 * sem_eval.ads (Test_Comparison): New routine.
4462 * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
4463 (Warn_On_Constant_Valid_Condition): New routine.
4464 (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
4465 to detect a specific case.
4466 * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
4467 * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
4468 to defend against a spurious warning in conditional compilation.
4469 (Tree_Write): Add a pair of pragma Warnings On/Off to defend
4470 against a spurious warning in conditional compilation.
4471 * usage.adb Add a pair of pragma Warnings On/Off to defend
4472 against a spurious warning in conditional compilation.
4474 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4476 * sinfo.ads, sem_ch13.adb: Update comment.
4478 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4480 * sem_util.adb (Is_Post_State): A reference to a
4481 generic in out parameter is considered a change in the post-state
4484 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4486 * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
4487 declaration of a subprogram instance within its wrapper package,
4488 skip over null statements that may result from the rewriting of
4491 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4493 * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
4494 If the type is an unchecked_union, replace the attribute with
4495 a Raise_Program_Error (rather than inserting such before the
4496 attribute reference) to handle properly the case where we are
4497 processing a component of a larger record, and we need to prevent
4498 further expansion for the unchecked union.
4499 (Expand_Attribute_Reference, case 'Write): If the type is
4500 an unchecked_union, check whether enclosing scope is a Write
4501 subprogram. Replace attribute with a Raise_Program_Error if the
4502 discriminants of the unchecked_union type have not default values
4503 because such a use is erroneous..
4505 2017-04-25 Tristan Gingold <gingold@adacore.com>
4507 * exp_ch9.adb (Expand_N_Task_Type_Declaration):
4508 Add relative_deadline to task record on edf profile.
4509 (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
4510 (Make_Task_Create_Call): Pass relative_deadline value.
4511 * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
4512 * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
4513 (Profile_Info): Add info for GNAT_Ravenscar_EDF.
4514 * sem_prag.adb (Set_Ravenscar_Profile): Handle
4515 GNAT_Ravenscar_EDF (set scheduling policy).
4516 (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
4518 (Sig_Flags): Add choice for Pragma_Deadline_Floor.
4519 * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
4521 (Pragma_Deadline_Floor): New pragma.
4522 * targparm.adb (Get_Target_Parameters): Recognize
4523 GNAT_Ravenscar_EDF profile.
4525 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4527 * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
4529 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4531 * sem_aux.adb (Nearest_Ancestor): Use original node of type
4532 declaration to locate nearest ancestor, because derived
4533 type declarations for record types are rewritten as record
4535 * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
4536 properly derivations that are completions of private types.
4537 (Add_Predicates): If type is private, examine rep. items of full
4538 view, which may include inherited predicates.
4539 (Build_Predicate_Functions): Ditto.
4541 2017-04-25 Javier Miranda <miranda@adacore.com>
4543 * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
4544 to generate new entities for subtype declarations located in
4545 Expression_With_Action nodes.
4547 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4549 * sem_elab.adb (Check_A_Call): Remove
4550 local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
4551 need for Elaborate_All when SPARK elaboration checks are
4552 required. Update the checks for instances, variables, and calls
4553 to Default_Initial_Condition procedures.
4555 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4557 * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
4558 into a boolean aspect, in analogy with the Ada aspect No_Return.
4560 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4562 * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
4564 2017-04-25 Bob Duff <duff@adacore.com>
4566 * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
4567 Is_True_Constant for an array variable that is passed to a
4568 foreign function as an 'in' parameter.
4569 * debug.adb: Document -gnatd.q.
4571 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4573 * sem_ch6.adb (Analyze_Expression_Function): If expression function
4574 is completion and return type is an access type do not freeze
4575 designated type: this will be done in the process of freezing
4576 the expression if needed.
4577 (Freeze_Expr_Types): Check whether type is complete before
4578 creating freeze node, to provide a better error message if
4579 reference is premature.
4580 * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
4581 functions created by type derivations.
4583 2017-04-25 Pascal Obry <obry@adacore.com>
4585 * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
4587 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4589 * sem_res.adb (Resolve_Type_Conversion):
4590 When resolving against any fixed type, set the type of the
4591 operand as universal real when the operand is a multiplication
4592 or a division where both operands are of any fixed type.
4593 (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
4594 placement of an error message by pointing to the operand of a
4595 type conversion rather than the conversion itself.
4597 2017-04-25 Thomas Quinot <quinot@adacore.com>
4599 * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
4600 Needs_Debug_Info when producing SCOs.
4602 2017-04-25 Thomas Quinot <quinot@adacore.com>
4604 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
4605 Always pass a null finalization master for a library level named access
4606 type to which a pragme No_Heap_Finalization applies.
4608 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4612 * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
4613 set to A'First(2) and vice versa.
4615 2017-04-25 Yannick Moy <moy@adacore.com>
4617 * freeze.adb (Freeze_Record_Type): Remove obsolete
4618 rule on volatile tagged record restriction on SPARK code.
4620 2017-04-25 Yannick Moy <moy@adacore.com>
4622 * sem_prag.adb (minor) Fix SPARK RM reference.
4624 2017-04-25 Yannick Moy <moy@adacore.com>
4626 * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
4627 comment to reflect which entity is chosen as unique entity.
4628 (Unique_Entity): Return full view instead of private spec for
4629 protected type or task type. Fix possible incorrect access when
4632 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4634 * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
4635 array types only instead of all packed array types.
4637 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4639 * sem_ch6.adb (Conforming_Types): If type of formal as a specified
4640 dimension system, verify that dimensions of both match.
4641 (Check_Conformance): Add error message in case of dimension
4643 * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
4646 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
4648 * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
4651 2017-04-25 Yannick Moy <moy@adacore.com>
4653 * sem_util.adb: Minor refactoring.
4654 * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
4656 2017-04-25 Claire Dross <dross@adacore.com>
4658 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
4659 ultimate alias when accessing overridden operation. Indeed, if the
4660 overridden operation is itself inherited, it won't have any explicit
4663 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4665 * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
4666 overlap if the two formals have different types, because formally
4667 the corresponding actuals cannot designate the same objects.
4669 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4671 * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
4672 dimensions are present from context, use them. b) If operand is
4673 a static constant rewritten as a literal, obtain the dimensions
4674 from the original declaration, otherwise use dimensions of type
4675 established from context.
4677 2017-04-25 Yannick Moy <moy@adacore.com>
4679 * sem_util.adb (Is_Effectively_Volatile): Protect against base type
4680 of array that is private.
4682 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4684 * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
4687 2017-04-25 Yannick Moy <moy@adacore.com>
4689 * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
4692 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4694 * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
4695 the check that recognizes a call to a private overridding and
4696 replaces the called subprogram with its alias.
4698 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4700 * exp_util.adb: Minor reformatting.
4702 2017-04-25 Justin Squirek <squirek@adacore.com>
4704 * exp_ch3.adb (Freeze_Type): Add condition to always treat
4705 interface types as a partial view of a private type for the
4706 generation of invariant procedure bodies.
4707 * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
4708 Add a condition to get the Corresponding_Record_Type for
4709 concurrent types, add condition to return in the absence of a
4710 class in the pragma, remove call to Replace_Type_References,
4711 and add call to Replace_References.
4712 (Add_Interface_Invariatns),
4713 (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
4714 to including the working type T.
4715 (Add_Own_Invariants): Remove
4716 legacy condition for separate units, remove dispatching for ASIS
4717 and save a copy of the expression in the pragma expression.
4718 (Build_Invariant_Procedure_Body): Default initalize vars,
4719 remove return condition on interfaces, always use the
4720 private type for interfaces, and move the processing of types
4721 until after the processing of invariants for the full view.
4722 (Build_Invariant_Procedure_Declaration): Remove condition
4723 to return if an interface type is encountered and add
4724 condition to convert the formal parameter to its class-wide
4725 counterpart if Work_Typ is abstract.
4726 (Replace_Type): Add call to Remove_Controlling_Arguments.
4727 (Replace_Type_Ref): Remove class-wide dispatching for the current
4728 instance of the type.
4729 (Replace_Type_References): Remove parameter "Derived"
4730 (Remove_Controlling_Arguments): Created in order to removing
4731 the controlliong argument from calls to primitives in the case
4732 of the formal parameter being an class-wide abstract type.
4733 * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
4734 to the change made to Freeze_Type in exp_ch3. Add a condition
4735 to treat interface types as a partial view.
4736 * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
4737 to Build_Invariant_Procedure_Declaration to properly generate a
4738 "partial" invariant procedure when Typ is an interface.
4740 2017-04-25 Bob Duff <duff@adacore.com>
4742 * a-numeri.ads: Go back to using brackets encoding for the Greek
4745 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4747 * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
4748 (10-15): if derived type T with progenitors is abstract,
4749 and primitive P of this type inherits non-trivial classwide
4750 preconditions from both a parent operation and from an interface
4751 operation, then the inherited operation is abstract if the parent
4752 operation is not null.
4753 * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
4754 with Covered_Interface_Op to yield the actual interface operation
4755 that is implemented by a given inherited operation.
4757 2017-04-25 Javier Miranda <miranda@adacore.com>
4759 * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
4760 and right operands after performing the validity checks. Required
4761 because validity checks may remove side effects from the operands.
4763 2017-04-25 Javier Miranda <miranda@adacore.com>
4765 * exp_attr.adb (Attribute_Unrestricted_Access):
4766 Do not disable implicit type conversion. Required to generate
4767 code that displaces the pointer to reference the secondary
4770 2017-04-25 Pascal Obry <obry@adacore.com>
4772 * prj-attr.adb, snames.ads-tmpl: Add package Install's
4773 Required_Artifacts attribute.
4775 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4777 * sem_util.adb (Same_Value): String literals are compile-time
4778 values, and comparing them must use Expr_Value_S.
4780 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4782 * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
4783 dereference is introduced for the object, and the object is
4784 overloaded, do not check whether it is aliased, because it may
4785 include an implicit dereference.
4786 * sem_type.adb (Disambiguate): If two interpretations are access
4787 attribute types with the same designated type keep either of
4788 them and do not report an ambiguity. A true ambiguity will be
4791 2017-04-25 Bob Duff <duff@adacore.com>
4793 * a-numeri.ads: Change the encoding of Greek letter Pi from
4794 brackets encoding to UTF-8. Use pragma Wide_Character_Encoding
4795 to indicate the encoding. We considered using a byte order mark
4796 (BOM), but that causes various trouble (misc software eats the
4797 BOM, if you have a patch with a BOM, then it's not at the start
4798 of the patch, so it's not a BOM, the BOM affects with-ing files,
4800 * scng.adb, s-wchcnv.adb: Minor.
4802 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4804 * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
4805 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4807 * sem_ch3.adb (Add_Internal_Interface_Entities): Move
4808 Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
4809 Improve error message on operations that inherit non-conforming
4810 classwide preconditions from ancestor and progenitor.
4811 * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
4812 moved here from sem_ch3.
4813 * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
4814 check given in RM 6.1.1 (17) concerning renamings of overriding
4815 operations that inherits class-wide preconditions from ancestor
4818 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4820 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
4821 (Build_Adjust_Statements): Code cleanup.
4822 (Build_Finalizer): Update the initialization of
4824 (Build_Finalize_Statements): Code cleanup.
4825 (Build_Initialize_Statements): Code cleanup.
4826 (Make_Deep_Array_Body): Update the initialization of
4828 (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
4829 (Process_Object_Declaration): Generate a null exception handler only
4830 when exceptions are allowed.
4831 (Process_Transients_In_Scope): Update the initialization of
4833 * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
4835 * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
4836 restrictions when the handler is internally generated and the
4839 2017-04-25 Ed Schonberg <schonberg@adacore.com>
4841 * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
4842 enforce legality rule on classwide preconditions inherited from
4843 both an ancestor and a progenitor (RM 6.1.1 (10-13).
4844 * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
4845 subprogram need not be dispatching if it appears in a precondition
4846 for an abstract or null subprogram.
4848 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4850 * sem_ch10.adb: Minor typo fix.
4852 2017-04-25 Arnaud Charlet <charlet@adacore.com>
4854 * gcc-interface/Makefile.in: Cleanup VxWorks targets.
4856 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4858 * fname.adb (Is_Internal_File_Name): Arrange for the slices to
4859 have a length which is a power of 2.
4860 (Is_Predefined_File_Name): Likewise. Adjust comment.
4862 2017-04-25 Bob Duff <duff@adacore.com>
4864 * exp_aggr.adb (Component_Count): Protect the
4865 arithmetic from attempting to convert a value >= 2**31 to Int,
4866 which would otherwise raise Constraint_Error.
4868 2017-04-25 Bob Duff <duff@adacore.com>
4870 * opt.ads (Locking_Policy): Fix incorrect documentation. The
4871 first character of the policy name is not unique.
4873 2017-04-25 Bob Duff <duff@adacore.com>
4875 * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
4876 * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
4877 about this flag not being used. It was already used, and it is
4880 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4882 * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
4883 (Ignore_SPARK_Mode_Pragmas): New routine.
4884 (Set_Ignore_SPARK_Mode_Pragmas): New routine.
4885 (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
4886 * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
4888 (Ignore_SPARK_Mode_Pragmas): New routine
4889 along with pragma Inline.
4890 (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
4891 * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
4892 Ignore_SPARK_Mode_Pragmas_In_Instance.
4893 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
4894 Save and restore the value of global flag
4895 Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
4896 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
4897 the corresponding spec or the body must ignore all SPARK_Mode
4898 pragmas found within.
4899 (Analyze_Subprogram_Declaration): Mark
4900 the spec when it needs to ignore all SPARK_Mode pragmas found
4901 within to allow the body to infer this property in case it is
4902 instantiated or inlined later.
4903 * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
4904 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
4905 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
4906 when the corresponding spec also ignored all SPARK_Mode pragmas
4908 (Analyze_Package_Declaration): Mark the spec when
4909 it needs to ignore all SPARK_Mode pragmas found within to allow
4910 the body to infer this property in case it is instantiated or
4912 * sem_ch12.adb (Analyze_Formal_Package_Declaration):
4913 Save and restore the value of flag
4914 Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
4915 formal spec when it needs to ignore all SPARK_Mode
4916 pragmas found within to allow the body to infer this
4917 property in case it is instantiated or inlined later.
4918 (Analyze_Package_Instantiation): Save and restore the value
4919 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
4920 the instance spec when it needs to ignore all SPARK_Mode
4921 pragmas found within to allow the body to infer this
4922 property in case it is instantiated or inlined later.
4923 (Analyze_Subprogram_Instantiation): Save and restore the value
4924 of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
4925 instance spec and anonymous package when they need to ignore
4926 all SPARK_Mode pragmas found within to allow the body to infer
4927 this property in case it is instantiated or inlined later.
4928 (Instantiate_Package_Body): Save and restore the value of global
4929 flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
4930 global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
4931 corresponding instance spec also ignored all SPARK_Mode pragmas
4933 (Instantiate_Subprogram_Body): Save and restore the
4934 value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
4935 the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
4936 when the corresponding instance spec also ignored all SPARK_Mode
4937 pragmas found within.
4938 * sem_prag.adb (Analyze_Pragma): Update the reference to
4939 Ignore_Pragma_SPARK_Mode.
4940 * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
4941 all SPARK_Mode pragmas defined within yields mode "off".
4943 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
4945 * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
4947 2017-04-25 Bob Duff <duff@adacore.com>
4949 * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
4950 All_Checks" to avoid generating unnecessary checks.
4951 * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
4953 * sem.ads: Fix comment.
4954 * expander.ads: Fix comment.
4955 * exp_atag.ads: Fix comment: "Index = 0" should be
4958 2017-04-25 Gary Dismukes <dismukes@adacore.com>
4960 * s-taprop-linux.adb: Minor editorial fixes.
4962 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4964 * sem_util.adb (New_Copy_Tree): Put back the declarations of the
4965 hash tables at library level. Reinstate the NCT_Hash_Tables_Used
4966 variable and set it to True whenever the main hash table is
4967 populated. Short- circuit the Assoc function if it is false
4968 and add associated guards.
4970 2017-04-25 Olivier Hainque <hainque@adacore.com>
4972 * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
4973 specs without elaboration code that have an elaboration counter
4974 nevertheless, e.g. when compiled with -fpreserve-control-flow.
4975 * sem_ch10.adb (Analyze_Compilation_Unit):
4976 Set_Elaboration_Entity_Required when requested to preserve
4977 control flow, to ensure the unit elaboration is materialized at
4978 bind time, resulting in the inclusion of the unit object file
4979 in the executable closure at link time.
4981 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
4983 * exp_dbug.adb: In Debug_Renaming_Declaration,
4984 when dealing with indexed component, accept to produce a renaming
4985 symbol when the index is an IN parameter or when it is a name
4986 defined in an outer scope.
4988 2017-04-25 Yannick Moy <moy@adacore.com>
4990 * errout.adb (Error_Msg): Adapt continuation
4991 message in instantiations and inlined bodies for info messages.
4993 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
4995 * fname.adb (Has_Internal_Extension): Add pragma Inline.
4996 Use direct 4-character slice comparisons.
4998 pragma Inline. (Has_Suffix): Delete.
4999 (Is_Internal_File_Name):
5000 Test Is_Predefined_File_Name first.
5001 (Is_Predefined_File_Name):
5002 Use direct slice comparisons as much as possible and limit all
5003 comparisons to at most 8 characters.
5005 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5007 * checks.adb (Insert_Valid_Check): Code cleanup.
5008 * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
5009 (Expand_Actuals): Generate proper copy-back for a validation
5010 variable when it acts as the argument of a type conversion.
5011 * sem_util.adb (Is_Validation_Variable_Reference): Augment the
5012 predicate to operate on type qualifications.
5014 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5016 * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
5019 2017-04-25 Bob Duff <duff@adacore.com>
5021 * sem_prag.adb (No_Return): Give an error if the pragma applies
5022 to a body. Specialize the error for the specless body case,
5023 as is done for (e.g.) pragma Convention.
5024 * debug.adb: Add switch -gnatd.J to disable the above legality
5025 checks. This is mainly for use in our test suite, to avoid
5026 rewriting a lot of illegal (but working) code. It might also
5027 be useful to customers. Under this switch, if a pragma No_Return
5028 applies to a body, and the procedure raises an exception (as it
5029 should), the pragma has no effect. If the procedure does return,
5030 execution is erroneous.
5032 2017-04-25 Bob Duff <duff@adacore.com>
5034 * exp_ch6.adb (Expand_Actuals): This is the
5035 root of the problem. It took N as an 'in out' parameter, and in
5036 some cases, rewrote N, but then set N to Original_Node(N). So
5037 the node returned in N had no Parent. The caller continued
5038 processing of this orphaned node. In some cases that caused a
5039 crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
5040 and trips over the Empty Parent). The solution is to make N an
5041 'in' parameter. Instead of rewriting it, return the list of
5042 post-call actions, so the caller can do the rewriting later,
5043 after N has been fully processed.
5044 (Expand_Call_Helper): Move most of Expand_Call here. It has
5045 too many premature 'return' statements, and we want to do the
5046 rewriting on return.
5047 (Insert_Post_Call_Actions): New procedure to insert the post-call
5048 actions in the appropriate place. In the problematic case,
5049 that involves rewriting N as an Expression_With_Actions.
5050 (Expand_Call): Call the new procedures Expand_Call_Helper and
5051 Insert_Post_Call_Actions.
5053 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5055 * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
5056 properly type derived from generic formal types, to handle
5057 properly modified version of ACATS 4.1B B611017.
5059 2017-04-25 Javier Miranda <miranda@adacore.com>
5061 * exp_unst.adb (Subp_Index): Adding missing
5062 support for renamings and functions that return a constrained
5063 array type (i.e. functions for which the frontend built a
5064 procedure with an extra out parameter).
5066 2017-04-25 Pascal Obry <obry@adacore.com>
5068 * s-string.adb: Minor code clean-up.
5070 2017-04-25 Bob Duff <duff@adacore.com>
5072 * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
5074 * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
5075 function for Non_Blocking_Wait_Process.
5077 2017-04-25 Bob Duff <duff@adacore.com>
5079 * prep.adb (Preprocess): Remove incorrect
5080 Assert. Current character can be ASCII.CR.
5082 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5084 * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
5085 convention Stdcall, which has a number of exceptions. Convention
5086 is legal on a component declaration whose type is an anonymous
5087 access to subprogram.
5089 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5091 * sem_ch4.adb: sem_ch4.adb Various reformattings.
5092 (Try_One_Prefix_Interpretation): Use the base type when dealing
5093 with a subtype created for purposes of constraining a private
5094 type with discriminants.
5096 2017-04-25 Javier Miranda <miranda@adacore.com>
5098 * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
5099 * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
5100 dispatching primitives (Restore_Warnings): Restore warning on
5101 late dispatching primitives (Save_Warnings): Save warning on late
5102 dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
5103 to enable/disable this warning.
5104 (WA_Warnings): Set warning on late dispatching primitives.
5105 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
5106 that its parent type has a private extension.
5107 * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
5109 * usage.adb: Document -gnatw.j and -gnatw.J.
5111 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5113 * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
5116 2017-04-25 Bob Duff <duff@adacore.com>
5118 * binde.adb (Validate): Do not pass dynamic strings
5119 to pragma Assert, because older compilers do not support that.
5121 2017-04-25 Bob Duff <duff@adacore.com>
5123 * s-fileio.adb (Close): When a temp file is
5124 closed, delete it and clean up its Temp_File_Record immediately,
5125 rather than waiting until later.
5126 (Temp_File_Record): Add File
5127 component, so Close can know which Temp_File_Record corresponds
5128 to the file being closed.
5129 (Delete): Don't delete temp files,
5130 because they are deleted by Close.
5131 (Open): Set the File component
5132 of Temp_File_Record. This requires moving the creation of the
5133 Temp_File_Record to the end, after the AFCB has been created.
5135 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5137 * checks.adb (Insert_Valid_Check): Do not generate
5138 a validity check when inside a generic.
5140 2017-04-25 Yannick Moy <moy@adacore.com>
5142 * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
5144 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5146 * snames.ads-tmpl (Snames): More names for detecting predefined
5147 potentially blocking subprograms.
5149 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5151 * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
5152 concerning inheritance of class-wide preconditions do not apply
5155 2017-04-25 Bob Duff <duff@adacore.com>
5157 * s-ficobl.ads: Minor comment fix.
5159 2017-04-25 Yannick Moy <moy@adacore.com>
5161 * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
5162 conversions from float to integer in GNATprove mode.
5163 (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
5164 to call Apply_Type_Conversion_Checks, so that range checks
5165 are properly positioned when needed on conversions, including
5166 when converting from float to integer. (Determine_Range): In
5167 GNATprove mode, take into account the possibility of conversion
5168 from float to integer.
5169 * sem_res.adb (Resolve_Type_Conversion): Only enforce range
5170 check on conversions from fixed-point to integer, not anymore
5171 on conversions from floating-point to integer, when in GNATprove
5174 2017-04-25 Yannick Moy <moy@adacore.com>
5176 * checks.adb (Determine_Range_R): Special case type conversions
5177 from integer to float in order to get bounds in that case too.
5178 * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
5179 mode, for computations involved in interval checking.
5181 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5183 * checks.adb (Insert_Valid_Check): Partially reimplement validity
5185 * einfo.adb Node36 is now used as Validated_Object.
5186 (Validated_Object): New routine.
5187 (Set_Validated_Object): New routine.
5188 (Write_Field36_Name): Add an entry for Validated_Object.
5189 * einfo.ads Add new attribute Validated_Object along with
5191 (Validated_Object): New routine along with pragma Inline.
5192 (Set_Validated_Object): New routine along with pragma Inline.
5193 * exp_attr.adb (Make_Range_Test): Add processing for validation
5194 variables to avoid extra reads and copies of the prefix.
5195 * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
5196 variables in order to reflect any changes done in the variable
5197 back into the original object.
5198 * sem_util.adb (Is_Validation_Variable_Reference): New routine.
5199 * sem_util.ads (Is_Validation_Variable_Reference): New routine.
5201 2017-04-25 Steve Baird <baird@adacore.com>
5203 * exp_ch7.adb (Build_Array_Deep_Procs,
5204 Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
5205 generate Finalize_Address routines for CodePeer.
5207 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5209 * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
5210 Analyze_Pre_Post_Condition, to implement the legality checks
5211 mandated by AI12-0131: Pre'Class shall not be specified for an
5212 overriding primitive subprogram of a tagged type T unless the
5213 Pre'Class aspect is specified for the corresponding primitive
5214 subprogram of some ancestor of T.
5216 2017-04-25 Bob Duff <duff@adacore.com>
5218 * sem_ch8.adb (Use_One_Type): If a use_type_clause
5219 is redundant, set its Used_Operations to empty. This is only
5220 necessary for use clauses that appear in the parent of a generic
5221 child unit, because those use clauses get reanalyzed when we
5222 instantiate the generic, and we don't want the Used_Operations
5223 carried over from the original context (where it was probably
5226 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5228 * exp_ch6.adb: Minor reformatting.
5230 2017-04-25 Bob Duff <duff@adacore.com>
5232 * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
5233 Use Source_Index (Current_Sem_Unit) to find the correct casing.
5234 * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
5235 (Current_Sem_Unit) to find the correct casing.
5236 * par.adb (Par): Null out Current_Source_File, to ensure that
5237 the above bugs won't rear their ugly heads again.
5239 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5241 * sem_ch8.adb (Find_Type): For an attribute reference
5242 'Class, if prefix type is synchronized and previous errors
5243 have suppressed the creation of the corresponding record type,
5244 create a spurious class-wide for the synchonized type itself,
5245 to catch other misuses of the attribute
5247 2017-04-25 Steve Baird <baird@adacore.com>
5249 * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
5250 is True, then don't generate the accessibility check for the
5251 tag of a tagged result.
5252 * exp_intr.adb (Expand_Dispatching_Constructor_Call):
5253 if CodePeer_Mode is True, then don't generate the
5254 tag checks for the result of call to an instance of
5255 Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
5256 descendant of" check and the accessibility check).
5258 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5260 * sem_ch13.adb: Code cleanups.
5261 * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
5262 * sem_ch8.ads: Minor comment fix.
5264 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5266 * exp_ch4.adb (Library_Level_Target): New function.
5267 (Expand_Concatenate): When optimization is enabled, also expand
5268 the operation out-of-line if the concatenation is present within
5269 the expression of the declaration of a library-level object and
5270 not only if it is the expression of the declaration.
5272 2017-04-25 Bob Duff <duff@adacore.com>
5274 * freeze.adb (Freeze_Object_Declaration): Do
5275 not Remove_Side_Effects if there is a pragma Linker_Section,
5276 because in that case we want static initialization in the
5277 appropriate section.
5279 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5281 * exp_dbug.adb: Minor rewording and reformatting.
5283 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5285 * sem_attr.adb (Statically_Denotes_Object): New predicate, to
5286 handle the proposed changes to rules concerning potentially
5287 unevaluated expressions, to include selected components that
5288 do not depend on discriminants, and indexed components with
5290 * sem_util.adb (Is_Potentially_Unevaluated): Add check for
5291 predicate in quantified expression, and fix bugs in the handling
5292 of case expressions and membership test.
5293 (Analyze_Attribute_Old_Result): use new predicate.
5294 (Analyze_Attribute, case Loop_Entry): ditto.
5296 2017-04-25 Bob Duff <duff@adacore.com>
5298 * s-secsta.adb (SS_Info): Add a comment
5299 explaining why we don't need to walk all the chunks in order to
5300 compute the total size.
5302 2017-04-25 Bob Duff <duff@adacore.com>
5304 * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
5305 of the global name buffer to 4*Max_Line_Length.
5307 2017-04-25 Javier Miranda <miranda@adacore.com>
5309 * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
5310 renaming entity for debug information, mark the entity as needing debug
5311 info if it comes from sources.
5313 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5315 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
5316 restriction converning the use of 'Address where the prefix is
5317 of a controlled type.
5319 2017-04-25 Pierre-Marie de Rodat <derodat@adacore.com>
5321 * exp_dbug.adb: In Debug_Renaming_Declaration,
5322 skip slices that are made redundant by an indexed component
5324 * atree.h: New definition for Original_Node.
5326 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5328 * sem_prag.adb, sem_prag.ads: Minor reformatting.
5330 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5332 * sem_ch3.adb (Check_Entry_Contract): Call
5333 Preanalyze_Spec_Expression so that resolution takes place as well.
5334 * sem_util.adb (Check_Internal_Protected_Use): Reject properly
5335 internal calls that appear in preconditions of protected
5336 operations, in default values for same, and in contract guards
5337 for contract cases in SPARK.
5339 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5341 * a-numaux.ads: Fix description of a-numaux-darwin
5343 (Double): Define to Long_Float.
5344 * a-numaux-vxworks.ads (Double): Likewise.
5345 * a-numaux-darwin.ads
5347 * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
5348 * a-numaux-x86.ads: Fix package description.
5349 * a-numaux-x86.adb (Is_Nan): Minor tweak.
5350 (Reduce): Adjust and complete description. Call Is_Nan instead of
5351 testing manually. Use an integer temporary to hold rounded value.
5352 * a-numaux-darwin.adb (Reduce): Likewise.
5353 (Is_Nan): New function.
5355 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5357 * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
5358 on analysis of prefix whose type is a current instance of a
5359 synchronized type, but where the prefix itself is an entity that
5362 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5364 * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
5365 the identity of callable entities therein, because they have been
5366 properly resolved, and prefixed calls may have been rewritten
5369 2017-04-25 Patrick Bernardi <bernardi@adacore.com>
5371 * exp_ch3.adb (Build_Init_Statements): Convert
5372 the expression of the pragma/aspect Secondary_Stack_Size to
5373 internal type System.Parameters.Size_Type before assigning
5374 it to the Secondary_Stack_Size component of the task type's
5375 corresponding record.
5377 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5379 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
5380 (etc) optimizations when the type is modular and the offsets
5383 2017-04-25 Eric Botcazou <ebotcazou@adacore.com>
5385 * s-osinte-freebsd.ads: Minor comment tweaks
5387 2017-04-25 Javier Miranda <miranda@adacore.com>
5389 * urealp.adb (UR_Write): Reverse previous patch
5390 adding documentation on why we generate multiplications instead
5391 of divisions (needed to avoid expressions whose computation with
5392 large numbers may cause division by 0).
5394 2017-04-25 Bob Duff <duff@adacore.com>
5396 * erroutc.adb (Set_Specific_Warning_Off,
5397 Set_Warnings_Mode_Off): Use the correct source file for
5398 Stop. Was using Current_Source_File, which is only valid during
5399 parsing. Current_Source_File will have a leftover value from
5400 whatever file happened to be parsed last, because of a with_clause
5403 2017-04-25 Bob Duff <duff@adacore.com>
5405 * lib.ads, lib.adb (In_Internal_Unit): New functions similar
5406 to In_Predefined_Unit, but including GNAT units.
5407 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
5408 with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
5409 because Should_Ignore_Pragma was not working reliably outside
5410 the parser, because Current_Source_File is not valid.
5411 * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
5412 * par-prag.adb: Call Should_Ignore_Pragma_Par.
5414 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5416 * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
5419 2017-04-25 Javier Miranda <miranda@adacore.com>
5421 * urealp.adb (UR_Write): Fix output of constants with a base other
5424 2017-04-25 Justin Squirek <squirek@adacore.com>
5426 * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
5427 * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
5428 Add extra parameter for Process_Interface_Name.
5429 (Process_Interface_Name): Add parameter for pragma to analyze
5430 corresponding aspect.
5431 * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
5434 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5436 * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
5439 2017-04-25 Yannick Moy <moy@adacore.com>
5441 * sem_res.adb (Resolve_Comparison_Op): Do not
5442 attempt evaluation of relational operations inside assertions.
5444 2017-04-25 Justin Squirek <squirek@adacore.com>
5446 * exp_util.adb (Add_Interface_Invariants):
5447 Restored, code moved back from Build_Invariant_Procedure_Body.
5448 (Add_Parent_Invariants): Restored, code moved back from
5449 Build_Invariant_Procedure_Body.
5450 (Build_Invariant_Procedure_Body):
5451 Remove refactored calls and integrated code from
5452 Add_Parent_Invariants and Add_Interface_Invariants.
5454 2017-04-25 Johannes Kanig <kanig@adacore.com>
5456 * errout.adb (Output_Messages): Adjust computation of total
5458 * erroutc.adb (Error_Msg): In statistics counts, deal
5459 correctly with informational messages that are not warnings.
5460 * errutil.adb (Finalize): adjust computation of total errors.
5462 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5464 * terminals.c (__gnat_terminate_pid): New.
5465 * g-exptty.ads (Terminate_Process): New. Update comments.
5467 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5469 * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
5471 2017-04-25 Justin Squirek <squirek@adacore.com>
5473 * sem_ch3.adb (Analyze_Declarations): Minor
5474 correction to comments, move out large conditional and scope
5475 traversal into a predicate.
5476 (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
5479 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5481 * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
5482 of prefix whose type is a current instance of a synchronized
5483 type. If the prefix is an object this is an external call (or
5484 requeue) that can only access public operations of the object. The
5485 previous predicate was too restrictive, and did not allow public
5486 protected operations, only task entries.
5488 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5490 * sem_ch5.adb, fname.adb: Minor reformatting.
5492 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5494 * einfo.adb (Is_Anonymous_Access_Type): New routine.
5495 * einfo.ads Update the placement of
5496 E_Anonymous_Access_Subprogram_Type along with all subtypes that
5498 (Is_Anonymous_Access_Type): New routine.
5499 * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
5500 master for an access type subject to pragma No_Heap_Finalization.
5501 * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
5502 allocated or deallocated does not finalization actions if the
5503 associated access type is subject to pragma No_Heap_Finalization.
5504 * opt.ads Add new global variable No_Heap_Finalization_Pragma.
5505 * par-prag.adb Pragma No_Heap_Finalization does not need special
5506 processing from the parser.
5507 * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
5508 ??? comments. Use the new predicate Is_Anonymous_Access_Type.
5509 * sem_prag.adb Add an entry in table Sig_Flags for pragma
5510 No_Heap_Finalization.
5511 (Analyze_Pragma): Add processing for
5512 pragma No_Heap_Finalization. Update various error messages to
5513 use Duplication_Error.
5514 * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
5515 * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
5516 and corresponding pragma id.
5518 2017-04-25 Bob Duff <duff@adacore.com>
5520 * freeze.adb (Freeze_Record_Type): Use the
5521 underlying type of the component type to determine whether it's
5522 elementary. For representation clause purposes, a private type
5523 should behave the same as its full type.
5524 * fname.ads, fname.adb (Is_Predefined_File_Name):
5525 Make sure things like "system.ali" are recognized as predefined.
5527 2017-04-25 Javier Miranda <miranda@adacore.com>
5529 * debug.adb: Update documentation of -gnatd.6.
5531 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5533 * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
5534 element iterator when the name is an overloaded function call,
5535 one of whose interpretations yields an array.
5537 2017-04-25 Bob Duff <duff@adacore.com>
5539 * uname.ads, uname.adb (Is_Predefined_Unit_Name,
5540 Is_Internal_Unit_Name): New functions for operating on unit
5541 names, as opposed to file names. There's some duplicated code
5542 with fname.adb, which is unfortunate, but it seems like we don't
5543 want to add dependencies here.
5544 * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
5545 to Is_Predefined_Unit_Name; the former was wrong, because Uname
5546 is not a file name at all.
5547 * fname.ads, fname.adb: Document the fact that
5548 Is_Predefined_File_Name and Is_Internal_File_Name can be called
5549 for ALI files, and fix the code so it works properly for ALI
5550 files. E.g. these should return True for "system.ali".
5552 2017-04-25 Justin Squirek <squirek@adacore.com>
5554 * exp_util.adb (Add_Invariant): Removed,
5555 code moved to Add_Invariant_Check, Add_Inherited_Invariant,
5556 and Add_Own_Invariant. (Add_Invariant_Check): Used
5557 for adding runtime checks from any kind of invariant.
5558 (Add_Inherited_Invariant): Generates invariant checks for
5559 class-wide invariants (Add_Interface_Invariants): Removed, code
5560 moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
5561 Create a types own invariant procedure (Add_Parent_Invariants):
5562 Removed, code moved to Build_Invariant_Procedure_Body
5563 (Build_Invariant_Procedure_Body): Add refactored calls
5564 and integrated code from Add_Parent_Invariants and
5565 Add_Interface_Invariants.
5566 (Process_Type): Removed, the
5567 relavant code was inlined into both Add_Own_Invariant and
5568 Add_Inherited_Invariant.
5570 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5572 * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
5573 scn.adb, osint.adb, fname.adb: Minor reformatting.
5575 2017-04-25 Pascal Obry <obry@adacore.com>
5577 * s-taprop-mingw.adb: Do not check for CloseHandle in
5580 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5582 * sem_util.adb (Check_Part_Of_Reference):
5583 Continue to examine the context if the reference appears within
5584 an expression function.
5586 2017-04-25 Justin Squirek <squirek@adacore.com>
5588 * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
5589 and Build_Invariant_Procedure_Declaration.
5590 * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
5591 and Build_Invariant_Procedure_Declaration from exp_ch7
5592 and break-out Is_Untagged_Private_Derivation from
5593 Build_Invariant_Procedure_Body.
5594 (Replace_Type_References):
5595 Append an extra parameter to allow for dispatching replacements
5596 and add the corrasponding logic.
5597 (Type_Invariant): Remove
5598 Replace_Typ_Refs and replace its references with calls to
5599 Replace_Type_References.
5600 * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
5602 2017-04-25 Bob Duff <duff@adacore.com>
5604 * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
5605 that returns True when appropriate.
5606 * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
5607 when compiling predefined files.
5608 * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
5609 "gnat.adc" should not be considered a predefined file name.
5610 That required (or at least encouraged) a lot of cleanup of global
5611 variable usage. We shouldn't be communicating information via
5612 the global name buffer.
5613 * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
5614 * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
5615 required by the above-mentioned cleanup.
5617 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5619 * osint.adb (Find_File): Handle properly a request for a
5620 configuration file whose name is a directory.
5622 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5624 * sem_attr.adb, sem_ch5.adb: Minor reformatting.
5626 2017-04-25 Bob Duff <duff@adacore.com>
5628 * types.ads: Minor: Fix '???' comment.
5629 * sem_ch8.adb: Minor comment fix.
5631 2017-04-25 Bob Duff <duff@adacore.com>
5633 * sem_prag.adb: Remove suspicious uses of Name_Buf.
5634 * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
5635 Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
5636 Add String_To_Name with no side effects.
5638 2017-04-25 Justin Squirek <squirek@adacore.com>
5640 * sem_ch3.adb (Analyze_Declarations): Add
5641 additional condition for edge case.
5643 2017-04-25 Bob Duff <duff@adacore.com>
5645 * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
5646 reserved words inside pragmas. This is necessary to allow the
5647 pragma name Interface to be used in pragma Ignore_Pragma.
5648 * par.adb: Minor comment fix.
5650 2017-04-25 Javier Miranda <miranda@adacore.com>
5652 * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
5653 * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
5654 * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
5655 * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
5656 occurrences of RE_Type_Is_Abstract
5658 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5660 * exp_util.adb (Build_Chain): Account for ancestor
5661 subtypes while traversing the derivation chain.
5663 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5665 * sem_attr.adb: minor reformatting.
5667 2017-04-25 Doug Rupp <rupp@adacore.com>
5669 * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
5671 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5673 * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
5674 the first pass over an assignment statement with target names,
5675 to prevent the generation of subtypes (such as discriminated
5676 record components)that may carry the target name outside of the
5677 tree for the assignment. The subtypes will be generated when
5678 the assignment is reanalyzed in full.
5679 (Analyze_Target_Name): Handle properly class-wide types.
5681 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5683 * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
5684 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5685 the purposes of freezing.
5686 * exp_util.adb Update the documentation and structure of the
5687 type map used in class-wide semantics of assertion expressions.
5688 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5689 and resolve the triaged expression because all substitutions
5690 refer to the proper entities. Update the replacement of
5692 (Build_DIC_Procedure_Body): Add formal parameter
5693 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5694 are now only processed when freezing occurs. Build a body only
5696 (Entity_Hash): Removed.
5697 (Map_Types): New routine.
5698 (Replace_Object_And_Primitive_References): Removed.
5699 (Replace_References): New routine.
5700 (Replace_Type_References): Moved to the library level of Exp_Util.
5701 (Type_Map_Hash): New routine.
5702 (Update_Primitives_Mapping): Update the mapping call.
5703 (Update_Primitives_Mapping_Of_Types): Removed.
5704 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5705 parameter For_Freeze and update the comment on usage.
5706 (Map_Types): New routine.
5707 (Replace_References): New routine.
5708 (Replace_Type_References): Moved to the library level of Exp_Util.
5709 (Update_Primitives_Mapping_Of_Types): Removed.
5710 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
5711 properties of the private type to the full view in case the full
5712 view derives from a parent type and inherits a DIC pragma.
5713 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
5714 DIC pragma is placed at the top of a declarative region.
5716 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5718 * a-tasatt.adb: Complete previous change and use an unsigned
5719 int to avoid overflow checks.
5721 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5723 * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
5724 the error message when the attribute reference is an actual in
5725 a call to a subprogram inherited from a generic formal type with
5726 unknown discriminants, which makes the subprogram and its formal
5727 parameters intrinsic (see RM 6.3.1 (8) and (13)).
5729 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5731 * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
5732 sem_prag.adb: Minor reformatting.
5734 2017-04-25 Bob Duff <duff@adacore.com>
5736 * sem_attr.adb (Type_Key): Add code in the
5737 recursive Compute_Type_Key to protect against fetching the source
5738 code for Standard, in case a component of the type is declared
5739 in Standard. There was already code to do this for the original
5740 type, but not for its components.
5742 2017-04-25 Javier Miranda <miranda@adacore.com>
5744 * exp_ch3.adb (Build_Initialization_Call): Handle
5745 subtypes of private types when searching for the underlying full
5746 view of a private type.
5748 2017-04-25 Javier Miranda <miranda@adacore.com>
5750 * sem_res.adb (Set_Mixed_Mode_Operand): A universal
5751 real conditional expression can appear in a fixed-type context
5752 and must be resolved with that context to facilitate the code
5753 generation to the backend.
5755 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5757 * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
5758 to indicate whether during inline processing, when some unit U1
5759 appears in the context of a unit U2 compiled for instantiation
5760 or inlining purposes, the body of U1 needs to be compiled as well.
5761 * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
5762 context is a package declaration.
5763 * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
5764 Analyze_Generic_Package_Declaration): ditto.
5765 * inline.adb (Analyze_Inlined_Bodies): Check
5766 Body_Needed_For_Inlining.
5768 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5770 * par.adb (Current_Assign_Node): Global variable use to record
5771 the presence of a target_name in the right hand side of the
5772 assignment being parsed.
5773 * par-ch4.adb (P_Name): If the name is a target_name, mark the
5774 enclosing assignment node accordingly.
5775 * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
5777 * sem_ch5.adb (Analyze_Assignment): Disable expansion before
5778 analyzing RHS if the statement has target_names.
5779 * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
5780 properly choices that are subtype marks.
5781 * exp_ch5.adb: Code cleanup.
5783 2017-04-25 Bob Duff <duff@adacore.com>
5785 * s-memory.adb: Add a comment regarding efficiency.
5786 * atree.adb: Fix the assertion, and combine 2 assertions into one,
5787 "the source has an extension if and only if the destination does."
5788 * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
5790 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
5792 * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
5795 2017-04-25 Doug Rupp <rupp@adacore.com>
5797 * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
5798 handling for ppc64-vx7.
5799 * sigtramp-vxworks-target.inc
5800 [SIGTRAMP_BODY]: Add section for ppc64-vx7.
5802 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5804 * ada_get_targ.adb: New file.
5806 2017-04-25 Bob Duff <duff@adacore.com>
5808 * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
5809 Direct_Val (Right), instead of the incorrect Direct_Val (Left).
5810 (UI_GCD): Remove ??? comment involving possible efficiency
5811 improvements. This just isn't important after all these years.
5813 * uintp.ads: Minor cleanup.
5815 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5817 * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
5818 Revert previous changes.
5819 * scng.adb: Minor reformatting.
5820 * s-stratt.ads: Fix unbalanced parens in comment.
5822 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5824 * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
5827 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5829 * scng.adb (Scan): Handle '@' appropriately.
5830 * sem_ch5.adb: Code cleanup.
5832 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5834 * freeze.adb (Check_Expression_Function): Do not check for the
5835 use of deferred constants if the freezing of the expression
5836 function is triggered by its generated body, rather than a
5839 2017-04-25 Javier Miranda <miranda@adacore.com>
5841 * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
5842 subtypes of private types when performing the view conversion.
5844 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5846 * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5847 the purposes of freezing.
5848 * exp_util.adb Update the documentation and structure of the
5849 type map used in class-wide semantics of assertion expressions.
5850 (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5851 and resolve the triaged expression because all substitutions
5852 refer to the proper entities. Update the replacement of
5854 (Build_DIC_Procedure_Body): Add formal parameter
5855 For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5856 are now only processed when freezing occurs. Build a body only
5858 (Entity_Hash): Removed.
5859 (Map_Types): New routine.
5860 (Replace_Object_And_Primitive_References): Removed.
5861 (Replace_References): New routine.
5862 (Replace_Type_References): Moved to the library level of Exp_Util.
5863 (Type_Map_Hash): New routine.
5864 (Update_Primitives_Mapping): Update the mapping call.
5865 (Update_Primitives_Mapping_Of_Types): Removed.
5866 * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5867 parameter For_Freeze and update the comment on usage.
5868 (Map_Types): New routine.
5869 (Replace_References): New routine.
5870 (Replace_Type_References): Moved to the library level of Exp_Util.
5871 (Update_Primitives_Mapping_Of_Types): Removed.
5872 * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
5873 properties of the private type to the full view in case the full
5874 view derives from a parent type and inherits a DIC pragma.
5875 * sem_prag.adb (Analyze_Pragma): Guard against a case where a
5876 DIC pragma is placed at the top of a declarative region.
5878 2017-04-25 Tristan Gingold <gingold@adacore.com>
5880 * s-mmap.ads (Data): Add pragma Inline.
5882 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
5884 * checks.adb (Insert_Valid_Check): Do not use
5885 a renaming to alias a volatile name because this will lead to
5886 multiple evaluations of the volatile name. Use a constant to
5887 capture the value instead.
5889 2017-04-25 Doug Rupp <rupp@adacore.com>
5891 * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
5893 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5895 * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
5896 Add out parameter to indicate to caller that a wrapper must
5897 be constructed for an inherited primitive whose inherited
5898 pre/postcondition has called to overridden primitives.
5899 * freeze.adb (Check_Inherited_Conditions): Build wrapper body
5900 for inherited primitive that requires it.
5901 * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
5902 legal primitive operations and belong to the list of bodies
5903 generated after the freeze point of a type.
5904 * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
5905 of Build_Class_Wide_Expression.
5906 * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
5907 to construct the specification of the wrapper subprogram created
5908 for an inherited operation.
5910 2017-04-25 Bob Duff <duff@adacore.com>
5912 * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
5913 pthread_mutexattr_setprioceiling): Add new interfaces for these
5915 * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
5916 protocols as appropriate for Locking_Policy 'C' and 'I'.
5917 * s-taprop-posix.adb: Minor reformatting to make it more similar
5918 to s-taprop-linux.adb.
5920 2017-04-25 Ed Schonberg <schonberg@adacore.com>
5922 * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
5923 Handle properly a multi- level derivation involving both renamed
5924 and constrained parent discriminants, when the type to be
5925 constrained has fewer discriminants that the ultimate ancestor.
5927 2017-04-25 Bob Duff <duff@adacore.com>
5929 * sem_util.adb (Is_Object_Reference): In the
5930 case of N_Explicit_Dereference, return False if it came from a
5931 conditional expression.
5933 2017-04-25 Bob Duff <duff@adacore.com>
5935 * par-ch4.adb (P_Case_Expression): If a semicolon
5936 is followed by "when", assume that ";" was meant to be ",".
5938 2017-04-25 Gary Dismukes <dismukes@adacore.com>
5940 * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
5943 2017-04-25 Arnaud Charlet <charlet@adacore.com>
5945 * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
5946 loading of an entity.
5947 * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
5948 previously repeated in the analysis.
5949 * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
5950 procedure SPARK_Implicit_Load. (Analyze_Task_Type_Declaration):
5951 use new procedure SPARK_Implicit_Load.
5952 * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
5953 SPARK_Implicit_Load.
5955 2017-04-25 Javier Miranda <miranda@adacore.com>
5957 * sem_util.adb (New_Copy_Tree): By default
5958 copying of defining identifiers is prohibited because
5959 this would introduce an entirely new entity into the
5960 tree. This patch introduces an exception to this general
5961 rule: the declaration of constants and variables located in
5962 Expression_With_Action nodes.
5963 (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
5964 (In_Map): New subprogram.
5965 (Visit_Entity): New subprogram.
5966 (Visit_Node): Handle EWA_Level,
5967 EWA_Inner_Scope_Level, and take care of defining entities defined
5968 in Expression_With_Action nodes.
5970 2017-04-25 Thomas Quinot <quinot@adacore.com>
5972 * exp_ch6.adb: minor comment edit.
5973 * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
5974 procedure specifications that come from source.
5975 * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
5976 Null_Statement attribute.
5977 * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
5978 procedure, generate statement SCO for the generated NULL statement.
5979 * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
5980 parser, if available.
5982 2017-04-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
5984 * system-linux-s390.ads: Use Long_Integer'Size to define
5987 2017-04-04 Eric Botcazou <ebotcazou@adacore.com>
5989 * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
5991 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
5993 * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
5994 * g-socket.adb (To_Host_Entry): Fix typo in comment.
5995 * gnat_ugn.texi: Fix typo.
5996 * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
5997 * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
5998 * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
5999 * sem_util.adb (Mark_Coextensions): Likewise.
6000 * sem_util.ads (Available_Full_View_Of_Component): Likewise.
6002 2017-03-28 Andreas Schwab <schwab@suse.de>
6005 * system-linux-aarch64-ilp32.ads: New file.
6006 * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
6007 from LIBGNAT_TARGET_PAIRS.
6008 (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
6009 (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
6010 LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
6011 or -mabi=ilp32, resp.
6013 2017-03-14 James Cowgill <James.Cowgill@imgtec.com>
6015 * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
6017 2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
6020 * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
6022 2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
6025 * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
6027 * system-linux-arm.ads (Default_Bit_Order): Likewise.
6028 * system-linux-mips.ads (Default_Bit_Order): Likewise.
6029 * system-linux-armeb.ads: Delete.
6030 * system-linux-mipsel.ads: Likewise.
6031 * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
6032 (ARM/Linux): Likewise.
6034 2017-02-24 Jakub Jelinek <jakub@redhat.com>
6037 * gcc-interface/misc.c (gnat_handle_option): Pass true to
6038 handle_generated_option GENERATED_P.
6040 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6042 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
6043 around a justified modular type if it doesn't have the same scalar
6044 storage order as the enclosing record type.
6046 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6048 * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
6049 of boolean rvalues to function calls.
6051 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6053 * gcc-interface/utils.c (fold_bit_position): New function.
6054 (rest_of_record_type_compilation): Call it instead of bit_position to
6055 compute the field position and remove the call to remove_conversions.
6056 (compute_related_constant): Factor out the multiplication in both
6057 operands, if any, and streamline the final test.
6059 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6061 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
6063 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6065 * gcc-interface/decl.c: Include demangle.h.
6066 (is_cplusplus_method): Return again true for a primitive operation
6067 only if it is dispatching. For a subprogram with an interface name,
6068 call the demangler to get the number of C++ parameters and compare it
6069 with the number of Ada parameters.
6071 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6073 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
6074 there is no end label, put the location of the At_End procedure on
6075 the call to the procedure.
6077 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6079 * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
6080 value for array types with TYPE_INDEX_TYPE set on their domain type.
6081 * gcc-interface/utils.c (max_size): For operations and expressions, do
6082 not build a new node if the operands have not changed or are missing.
6084 2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
6086 * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
6087 argument when recursing on TRUTH_NOT_EXPR.
6089 2017-02-12 John Marino <gnugcc@marino.st>
6091 * system-freebsd-x86.ads: Rename into...
6092 * system-freebsd.ads: ...this.
6093 (Default_Bit_Order): Define using Standard'Default_Bit_Order.
6094 * gcc-interface/Makefile.in: Support aarch64-freebsd.
6095 (x86-64/FreeBSD): Adjust to above renaming.
6096 (i386/FreeBSD): Likewise.
6098 2017-02-09 Gerald Pfeifer <gerald@pfeifer.com>
6100 * comperr.adb: Update FSF bug reporting URL.
6102 2017-02-01 Eric Botcazou <ebotcazou@adacore.com>
6103 Jakub Jelinek <jakub@redhat.com>
6106 * adaint.c (__gnat_killprocesstree): Fix broken string handling.
6108 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
6111 * gcc-interface/utils.c (get_global_context): Pass main_input_filename
6112 to build_translation_unit_decl.
6114 2017-01-23 Javier Miranda <miranda@adacore.com>
6116 * sem_util.adb (New_Copy_Tree): Code cleanup:
6117 removal of the internal map (ie. variable Actual_Map, its
6118 associated local variables, and all the code handling it).
6119 * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
6120 force loading of the System package when processing a task type.
6121 (Analyze_Protected_Type_Declaration): in GNATprove mode force
6122 loading of the System package when processing a protected type.
6123 * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
6124 force loading of the System package when processing compilation
6125 unit with a main-like subprogram.
6126 * frontend.adb (Frontend): remove forced loading of the System
6129 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6131 * sem_prag.adb (Default_Initial_Condition): If the desired type
6132 declaration is a derived type declaration with discriminants,
6133 it is rewritten as a private type declaration.
6134 * sem_ch13.adb (Replace_Type_References_Generic,
6135 Visible_Component): A discriminated private type with descriminnts
6136 has components that must be rewritten as selected components
6137 if they appear as identifiers in an aspect expression such as
6138 a Default_Initial_Condition.
6139 * sem_util.adb (Defining_Entity): support N_Iterator_Specification
6142 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6144 * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
6145 * gnat1drv.adb Generate an empty object file for an ignored
6146 Ghost compilation unit.
6147 * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
6149 2017-01-23 Yannick Moy <moy@adacore.com>
6151 * sem_ch4.adb (Analyze_Indexed_Component_Form):
6152 Adapt to inlined prefix with string literal subtype.
6153 * inline.adb (Expand_Inlined_Call): Keep unchecked
6154 conversion inside inlined call when formal type is constrained.
6156 2017-01-23 Javier Miranda <miranda@adacore.com>
6158 * sem_util.adb (New_Copy_Tree): Code cleanup:
6159 removal of global variables. All the global variables, global
6160 functions and tables of this subprogram are now declared locally.
6162 2017-01-23 Gary Dismukes <dismukes@adacore.com>
6164 * exp_strm.ads: Minor reformatting and typo fixes.
6166 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6168 * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
6169 exp_aggr.adb: Minor reformatting.
6170 * g-diopit.adb: minor grammar/punctuation fix in comment.
6171 * g-byorma.ads: minor fix of unbalanced parens in comment.
6173 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6175 * par.adb: Update the documentation of component Labl.
6176 * par-ch6.adb (P_Return_Statement): Set the expected label of
6177 an extended return statement to Error.
6179 2017-01-23 Tristan Gingold <gingold@adacore.com>
6181 * s-boustr.ads, s-boustr.adb (Is_Full): New function.
6183 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6185 * expander.adb: Handle N_Delta_Aggregate.
6187 2017-01-23 Javier Miranda <miranda@adacore.com>
6189 * exp_ch6.adb (Expand_Call): Improve the code that
6190 checks if some formal of the called subprogram is a class-wide
6191 interface, to handle subtypes of class-wide interfaces.
6193 2017-01-23 Javier Miranda <miranda@adacore.com>
6195 * checks.adb (Apply_Parameter_Aliasing_Checks):
6196 Remove side effects of the actuals before generating the overlap
6199 2017-01-23 Justin Squirek <squirek@adacore.com>
6201 * exp_strm.ads, exp_strm.ads
6202 (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
6203 as to avoid getting the underlying type by default.
6204 * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
6205 underlying type in the Iiput and output attribute cases when
6206 building their respective functions.
6208 2017-01-23 Gary Dismukes <dismukes@adacore.com>
6210 * scng.adb: Minor reformatting of error message.
6212 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6214 * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
6215 to freeze the return type of an expression funxtion that is a
6216 completion, if the type is a limited view and the non-limited
6219 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6221 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
6222 aggregate construct.
6223 (P_Record_Or_Array_Component_Association): An array aggregate
6224 can start with an Iterated_Component_Association.
6225 * scng.adb: Modify error message on improper use of @ in earlier
6226 versions of the language.
6227 * sinfo.ads: New node kind N_Delta_Aggregate.
6228 * sinfo.adb: An N_Delta_Aggregate has component associations and
6230 * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
6231 * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
6232 Create a new index for each one of the choices in the association,
6233 to prevent spurious homonyms in the scope.
6234 (Resolve_Delta_Aggregate): New.
6235 * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
6236 * exp_util.adb (Insert_Actions): Take into account
6238 * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
6239 * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
6240 and local procedures Expand_Delta_Array_Aggregate and
6241 expand_Delta_Record_Aggregate.
6242 * sprint.adb: Handle N_Delta_Aggregate.
6244 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6246 * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
6247 empty name when the exception declaration is subject to pragma
6249 (Null_String): New routine.
6251 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6253 * par-ch9.adb (P_Protected_Definition): Parse
6254 any optional and potentially illegal pragmas which appear in
6255 a protected operation declaration list.
6256 (P_Task_Items): Parse
6257 any optional and potentially illegal pragmas which appear in a
6260 2017-01-23 Pascal Obry <obry@adacore.com>
6262 * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
6263 is needed when a foreign thread call a Win32 API using a thread handle
6264 like GetThreadTimes() for example.
6266 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6268 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6269 allow an 'Address clause to be specified on a prefix of a
6272 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6274 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6275 attribute 'Valid is a renaming of the original expression when
6276 the expression denotes a name. For all other kinds of expression,
6277 use a constant to capture the value.
6278 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6279 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6281 2017-01-23 Justin Squirek <squirek@adacore.com>
6283 * sem_eval.adb (Eval_Integer_Literal): Add special
6284 case to avoid optimizing out check if the literal appears in
6287 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6289 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6290 allow an 'Address clause to be specified on a prefix of a
6293 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6295 * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6296 attribute 'Valid is a renaming of the original expression when
6297 the expression denotes a name. For all other kinds of expression,
6298 use a constant to capture the value.
6299 * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6300 * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6302 2017-01-23 Justin Squirek <squirek@adacore.com>
6304 * sem_eval.adb (Eval_Integer_Literal): Add special
6305 case to avoid optimizing out check if the literal appears in
6308 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6310 * sem_ch4.adb (Try_Primitive_Operations,
6311 Is_Valid_First_Argument_Of): argument is valid if it is a derived
6312 type with unknown discriminants that matches its underlying
6314 * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
6315 expression if its type is derived from a limited type with
6316 unknown discriminants, because the expansion (which is a call)
6317 must be expanded in the enclosing context to add the proper build-
6318 in-place parameters to the call.
6319 * lib.ads, exp_ch9.adb: Minor fixes in comments.
6321 2017-01-23 Yannick Moy <moy@adacore.com>
6323 * frontend.adb (Frontend): Do not load runtime
6324 unit for GNATprove when parsing failed.
6325 * exp_ch9.adb: minor removal of extra whitespace
6326 * exp_ch6.adb: minor typo in comment
6327 * sem_util.adb: Code cleanup.
6328 * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
6329 * a-ngcefu.adb: minor style fix in whitespace
6331 2017-01-23 Thomas Quinot <quinot@adacore.com>
6333 * scos.ads: Document usage of 'd' as default SCO kind for
6335 * par_sco.adb (Traverse_Declarations_Or_Statements.
6336 Traverse_Degenerate_Subprogram): New supporting routine for expression
6337 functions and null procedures.
6338 (Traverse_Declarations_Or_Statements.Traverse_One): Add
6339 N_Expression_Function to the subprogram case; add required
6340 support for null procedures and expression functions.
6342 2017-01-23 Bob Duff <duff@adacore.com>
6344 * namet.ads (Bounded_String): Decrease the size of type
6345 Bounded_String to avoid running out of stack space.
6346 * namet.ads (Append): Don't ignore buffer overflow; raise
6347 Program_Error instead.
6349 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6351 * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
6352 sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
6354 * exp_ch9.adb: minor style fix in comment.
6356 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6358 * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
6359 for a limited record extension with unknown discriminants whose
6360 full view has no discriminants.
6362 2017-01-23 Yannick Moy <moy@adacore.com>
6364 * exp_spark.adb: Alphabetize with clauses.
6366 2017-01-23 Yannick Moy <moy@adacore.com>
6368 * sem_util.adb (Has_Enabled_Property): Treat
6369 protected objects and variables differently from other variables.
6371 2017-01-23 Thomas Quinot <quinot@adacore.com>
6373 * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
6374 Split original Ada 95 part off into new subprogram
6375 below. Call that subprogram (instead of proceeding with
6376 AI95-0133 behaviour) if debug switch -gnatd.p is in use.
6377 (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
6378 * debug.adb Document new switch -gnatd.p
6379 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
6380 record for reverse bit order if an error has already been posted
6381 on the record type. This avoids generating extraneous "info:"
6382 messages for illegal code.
6384 2017-01-23 Justin Squirek <squirek@adacore.com>
6386 * sem_ch3.adb (Analyze_Declarations): Correct comments
6387 * freeze.adb (Find_Constant): Add detection of deferred constants
6388 so they are not incorrectly flagged as premature.
6390 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6392 * scans.ads: New token At_Sign. Remove '@' from list of illegal
6393 characters for future version of the language. '@' is legal name.
6394 * scng.ads, scng.adb (Scan): Handle '@' appropriately.
6395 * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
6396 denotes a Target_Name.
6397 * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
6398 * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
6399 (Has_Target_Names): New flag on N_Assignment_Statement, to
6400 indicate that RHS has occurrences of N_Target_Name.
6401 * sem.adb: Call Analyze_Target_Name.
6402 * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
6403 (urrent_LHS): Global variable that denotes LHS of assignment,
6404 used in the analysis of Target_Name nodes.
6405 * sem_res.adb (Resolve_Target_Name): New procedure.
6406 * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
6407 N is an assignment statement whose RHS contains occurences of @
6408 that designate the value of the LHS of the assignment. If the
6409 LHS is side-effect free the target names can be replaced with
6410 a copy of the LHS; otherwise the semantics of the assignment
6411 is described in terms of a procedure with an in-out parameter,
6412 and expanded as such.
6413 (Expand_N_Assignment_Statement): Call
6414 Expand_Assign_With_Target_Names when needed.
6415 * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
6416 * sprint.adb: Handle N_Target_Name.
6418 2017-01-23 Eric Botcazou <ebotcazou@adacore.com>
6420 * checks.adb: Minor fix in comment.
6422 2017-01-23 Philippe Gil <gil@adacore.com>
6424 * g-debpoo.adb (Do_Report) remove freed chunks from chunks
6425 count in Sort = Memory_Usage or Allocations_Count
6427 2017-01-23 Justin Squirek <squirek@adacore.com>
6429 * sem_ch3.adb: Code cleanup.
6431 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6433 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
6434 variables to the local variable section. Update the profile
6435 of various nested routine that previously had visibility
6436 of those globals. One the matching phase has completed,
6437 remove certain classes of clauses which are considered noise.
6438 (Check_Dependency_Clause): Properly detect a match between two
6439 'Result attributes. Update the various post-match cases to use
6440 Is_Already_Matched as this routine now automatically recognizes
6441 a previously matched 'Result attribute.
6442 (Is_Already_Matched): New routine.
6443 (Remove_Extra_Clauses): New routine.
6444 (Report_Extra_Clauses): Remove the detection of ... => null
6445 clauses as this is now done in Remove_Extra_Clauses.
6447 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6449 * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
6450 report on spurious overlaps between values involving a subtype
6451 with a static predicate, because the expansion of such a subtype
6452 into individual ranges in inhibited in ASIS mode.
6454 2017-01-23 Justin Squirek <squirek@adacore.com>
6456 * sem_ch3.adb (Analyze_Declarations): Add detection
6457 of an edge case and delay freezing if it is present.
6459 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6461 * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
6462 sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
6464 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6466 * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
6467 access-to-subprogram types inherit the convention of the
6468 associated subprogram. (Set_Profile_Convention): New routine.
6469 * sem_ch6.adb (Check_Conformance): Do not compare the conventions
6470 of the two entities directly, use Conventions_Match to account
6471 for anonymous access-to-subprogram and subprogram types.
6472 (Conventions_Match): New routine.
6474 2017-01-23 Claire Dross <dross@adacore.com>
6476 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
6477 which return Universal_Integer, force the overflow check flag for
6478 Length and Range_Length for types as big as Long_Long_Integer.
6480 2017-01-23 Claire Dross <dross@adacore.com>
6482 * exp_spark.adb (Expand_SPARK_Attribute_Reference): For
6483 attributes which return Universal_Integer, introduce a conversion
6484 to the expected type with the appropriate check flags set.
6485 * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
6486 base type if the range is null. It may still be invalid if it
6487 is higher than the lower bound. This is checked later in the
6488 context in which the range appears.
6490 2017-01-23 Pierre-Marie de Rodat <derodat@adacore.com>
6492 * scos.ads: Introduce a constant to represent ignored
6493 dependencies in SCO_Unit_Table_Entry.
6495 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com>
6497 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
6498 spaces from error messages.
6500 2017-01-23 Ed Schonberg <schonberg@adacore.com>
6502 * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
6503 subsidiary to Expand_N_Object_ Declaration, to compute a guard on
6504 an object declaration for an array type with a modular index type
6505 with the size of Long_Long_Integer. Special processing is needed
6506 in this case to compute reliably the size of the object, and
6507 eventually to raise Storage_Error, when wrap-around arithmetic
6508 might compute a meangingless size for the object.
6510 2017-01-23 Justin Squirek <squirek@adacore.com>
6512 * a-wtenau.adb, par-endh.adb, sem_prag.adb,
6513 sem_type.adb: Code cleanups.
6515 2017-01-23 Bob Duff <duff@adacore.com>
6517 * sem_res.adb (Resolve_Call): In the part of the code where
6518 it is deciding whether to turn the call into an indexed
6519 component, avoid doing so if the call is to an instance of
6520 Unchecked_Conversion. Otherwise, the compiler turns it into an
6521 indexed component, and resolution of that turns it back into a
6522 function call, and so on, resulting in infinite recursion.
6523 * sem_util.adb (Needs_One_Actual): If the first formal has a
6524 default, then return False.
6526 2017-01-21 Eric Botcazou <ebotcazou@adacore.com>
6528 * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
6529 optimizations when the type is modular and the offsets are equal.
6531 2017-01-20 Thomas Quinot <quinot@adacore.com>
6533 * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
6536 2017-01-20 Nicolas Roche <roche@adacore.com>
6538 * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
6540 2017-01-20 Bob Duff <duff@adacore.com>
6542 * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
6543 (etc) optimizations when the type is modular.
6545 2017-01-20 Yannick Moy <moy@adacore.com>
6547 * sem_ch6.adb (Move_Pragmas): move some pragmas,
6548 but copy the SPARK_Mode pragma instead of moving it.
6549 (Build_Subprogram_Declaration): Ensure that the generated spec
6550 and original body share the same SPARK_Pragma aspect/pragma.
6551 * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
6552 procedure to copy SPARK_Mode aspect.
6554 2017-01-20 Bob Duff <duff@adacore.com>
6556 * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
6558 * sem_ch13.adb (Resolve_Name): Enable setting the entity to
6559 Empty even in ASIS mode.
6561 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6563 * exp_ch9.adb: minor style fixes in comments.
6564 * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
6565 relative statement introduces an implicit dependency on
6566 Ada.Real_Time.Clock_Time.
6567 * sem_util.adb: Minor reformatting.
6569 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6571 * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
6572 must be treated as delayed aspect even if the expression is
6573 a literal, because the aspect affects the freezing and the
6574 elaboration of the object to which it applies.
6576 2017-01-20 Tristan Gingold <gingold@adacore.com>
6578 * s-osinte-vxworks.ads (Interrup_Range): New subtype.
6580 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6582 * lib-xref.adb (Generate_Reference): Do not warn about the
6583 presence of a pragma Unreferenced if the entity appears as the
6584 actual in a procedure call that does not come from source.
6586 2017-01-20 Pascal Obry <obry@adacore.com>
6588 * expect.c, terminals.c: Fix some warnings about unused variables.
6589 * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
6592 2017-01-20 Bob Duff <duff@adacore.com>
6594 * exp_attr.adb (Constrained): Apply an access check (check that
6595 the prefix is not null) when the prefix denotes an object of an
6596 access type; that is, when there is an implicit dereference.
6598 2017-01-20 Gary Dismukes <dismukes@adacore.com>
6600 * s-rident.ads (constant Profile_Info): Remove
6601 No_Calendar from GNAT_Extended_Ravenscar restrictions.
6603 2017-01-20 Tristan Gingold <gingold@adacore.com>
6605 * s-maccod.ads: Add pragma No_Elaboration_Code_All
6607 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6609 * ghost.adb (Mark_Ghost_Clause): New routine.
6610 (Prune_Node): Do not prune compilation unit nodes.
6611 (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
6612 This does not touch the node itself, but does prune all its fields.
6613 * ghost.ads (Mark_Ghost_Clause): New routine.
6614 * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
6615 package clause mentions Ghost and non-Ghost packages. Mark a
6616 use package clause as Ghost when it mentions a Ghost package.
6617 (Analyze_Use_Type): Emit an error when a use type clause mentions
6618 Ghost and non-Ghost types. Mark a use type clause as Ghost when
6619 it mentions a Ghost type.
6620 * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
6621 Ghost when it withs a Ghost unit.
6623 2017-01-20 Javier Miranda <miranda@adacore.com>
6625 * sem_res.adb (Resolve_Call): If a function call
6626 returns a limited view of a type and at the point of the call the
6627 function is not declared in the extended main unit then replace
6628 it with the non-limited view, which must be available. If the
6629 called function is in the extended main unit then no action is
6630 needed since the back-end handles this case.
6632 2017-01-20 Eric Botcazou <ebotcazou@adacore.com>
6634 * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
6635 (Contains_Subprograms_Refs): ...this. Adjust comment
6636 for constants. (Is_Subp_Or_Const_Ref): Rename into...
6637 (Is_Subprogram_Ref): ...this.
6638 (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
6639 Has_Non_Subprograms_Referencer and adjust comment. Remove
6640 incorrect shortcut for package declarations and bodies.
6642 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6644 * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
6645 base type differs from that of the completion and the private
6646 subtype is an itype (created for a constraint on an access
6647 type e.g.), set Delayed_Freeze on both to prevent out-of-scope
6650 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6652 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
6653 When inheriting the SPARK_Mode of a prior expression function,
6654 look at the properly resolved entity rather than the initial
6655 candidate which may denote a homonym.
6657 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6659 * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
6660 Precondition or Postcondition, and the context is pragma
6661 Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
6662 and suggest the standard names Assertion_Policy /Pre /Post
6665 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6667 * sem_ch10.adb, sem_cat.adb: Minor reformatting.
6669 2017-01-20 Javier Miranda <miranda@adacore.com>
6671 * sem_ch3.adb (Access_Type_Declaration): Protect access to the
6673 * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
6674 * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
6677 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6679 * sem_ch13.adb (Analyze_Aspect_Specification, case
6680 Dynamic_Predicate): If the entity E is a subtype that inherits
6681 a static predicate for its parent P,, the inherited and the
6682 new predicate combine in the generated predicate function,
6683 and E only has a dynamic predicate.
6685 2017-01-20 Tristan Gingold <gingold@adacore.com>
6687 * s-boustr.ads, s-boustr.adb: New package.
6688 * Makefile.rtl: Add s-boustr.
6690 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6692 * inline.adb (Process_Formals): Qualify the
6693 expression of a return statement when it yields a universal type.
6695 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6697 * freeze.adb (Freeze_All): Freeze the default
6698 expressions of all eligible formal parameters that appear in
6699 entries, entry families, and protected subprograms.
6701 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6703 * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
6704 for illegal inherited Implicit_Dereference aspects with renamed
6707 2017-01-20 Javier Miranda <miranda@adacore.com>
6709 * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
6710 * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
6711 * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
6712 (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
6713 Set_Prev, Tree_Read): Adding assertion.
6714 * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
6715 * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
6716 (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
6717 Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
6718 Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
6719 Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
6720 Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
6721 Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
6722 Set_ListN_With_Parent): Adding assertion.
6724 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6726 * sem_prag.adb (Process_Convention): Diagnose properly a pragma
6727 import that applies to several homograph subprograms. when one
6728 of them is declared by a subprogram body.
6730 2017-01-20 Justin Squirek <squirek@adacore.com>
6732 * exp_ch6.adb (Expand_Call): Remove optimization
6733 that nulls out calls to null procedures.
6735 2017-01-20 Yannick Moy <moy@adacore.com>
6737 * inline.adb (Expand_Inlined_Call): Keep more
6738 precise type of actual for inlining whenever possible. In
6739 particular, do not switch to the formal type in GNATprove mode in
6740 some case where the GNAT backend might require it for visibility.
6742 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6744 * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
6745 aspect Implicit_Dereference can be inherited by a full view if
6746 the partial view has no discriminants, because there is no way
6747 to apply the aspect to the partial view.
6748 (Build_Derived_Record_Type): If derived type renames discriminants
6749 of the parent, the new discriminant inherits the aspect from
6751 * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
6752 call through an access discriminant designating a subprogram.
6753 * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
6754 properly a parameterless call through an access discriminant on
6755 the left-hand side of an assignment.
6756 * sem_res.adb (resolve): If an interpreation involves a
6757 discriminant with an implicit dereference and the expression is an
6758 entity, resolution takes place later in the appropriate routine.
6759 * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
6760 access discriminants that designate a subprogram type.
6762 2017-01-20 Pascal Obry <obry@adacore.com>
6764 * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
6766 2017-01-20 Yannick Moy <moy@adacore.com>
6768 * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
6769 on implicitly with'ed units in GNATprove mode.
6770 * sinfo.ads (Implicit_With): Document use of flag for implicitly
6771 with'ed units in GNATprove mode.
6773 2017-01-20 Ed Schonberg <schonberg@adacore.com>
6775 * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
6776 unit Do not report an error on a non-static entity that appears
6777 in the context of a spec expression, such as an aspect expression.
6779 2017-01-20 Hristian Kirtchev <kirtchev@adacore.com>
6781 * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
6782 (Is_Underlying_Full_View): New routine.
6783 (Set_Is_Underlying_Full_View): New routine.
6784 (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
6785 * einfo.ads Add new attribute Is_Underlying_Full_View.
6786 (Is_Underlying_Full_View): New routine along with pragma Inline.
6787 (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
6788 * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
6789 class-wide types and underlying full views. The first subtype
6790 is used as the working type for all Itypes, not just array base types.
6791 (Build_DIC_Procedure_Declaration): Do not consider
6792 class-wide types and underlying full views. The first subtype
6793 is used as the working type for all Itypes, not just array
6795 * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
6796 view or an underlying full view without clobbering the attributes
6797 of a previous freeze node.
6798 (Inherit_Freeze_Node): New routine.
6799 * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
6801 (Build_Underlying_Full_View): Mark an underlying full view as such.
6802 * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
6805 2017-01-20 Yannick Moy <moy@adacore.com>
6807 * sinfo.ads: Document lack of Do_Division_Check flag
6808 on float exponentiation.
6810 2017-01-19 Javier Miranda <miranda@adacore.com>
6812 * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
6813 identifier attribute of a block-statement node. Required to avoid
6814 assertion failure when building the new containers library.
6816 2017-01-19 Bob Duff <duff@adacore.com>
6818 * exp_ch3.adb: Update comment.
6820 2017-01-19 Vincent Celier <celier@adacore.com>
6822 * gprep.adb (Gnatprep): Parse the definition file without
6823 "replace in comments" even when switch -C is used.
6825 2017-01-19 Justin Squirek <squirek@adacore.com>
6827 * exp_ch9.adb (Is_Pure_Barrier): Create function
6828 Is_Count_Attribute to identify an expansion of the 'Count
6831 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6833 * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
6834 statements within an element iterator loop are only analyzed
6835 agter the loop is rewritten. Within a generic the analysis must
6836 be performed in any case to complete name capture.
6838 2017-01-19 Bob Duff <duff@adacore.com>
6840 * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
6841 before checking for unrecognized pragmas.
6842 Initialize Pname on its declarations; that's always good style.
6844 2017-01-19 Claire Dross <dross@adacore.com>
6846 * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
6847 body into the tree for GNATprove by setting its Parent field. The
6848 components invariants of composite types are not checked by
6849 the composite type's invariant procedure in GNATprove mode.
6850 (Build_Invariant_Procedure_Declaration): Semi-insert the
6851 declaration into the tree for GNATprove by setting its Parent
6853 * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
6854 the component invariants to the array type invariant procedure
6855 so that the procedure can be used to check the array type
6857 (Freeze_Record_Type): In GNATprove mode, do
6858 not add the component invariants to the record type invariant
6859 procedure so that the procedure can be used to check the record
6860 type invariants if any.
6862 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6864 * lib-xref-spark_specific.adb: Minor reformatting.
6865 * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
6867 2017-01-19 Javier Miranda <miranda@adacore.com>
6869 * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
6870 Build_Back_End_Aggregate.
6871 (Generate_Aggregate_For_Derived_Type): Code cleanup.
6872 (Prepend_Stored_Values): Code cleanup.
6874 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6876 * sem_ch6.adb (Analyze_Expression_Function): Check for an
6877 incomplete return type after attempting to freeze it, so that
6878 other freeze actiona are generated in the proper order.
6880 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6882 * sem_aggr.adb (Resolve_Aggregate): If the type is a string
6883 type, ie. a type whose component is a character type, and the
6884 aggregate is positional, do not convert into a string literal
6885 if the index type is not an integer type, because the original
6886 type may be required in an enclosing operation.
6888 2017-01-19 Bob Duff <duff@adacore.com>
6890 * binde.adb, debug.adb: Enable new elaboration order algorithm
6891 by default. -dp switch reverts to the old algorithm.
6893 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6895 * sem_ch3.adb Add with and use clauses for Exp_Ch7.
6896 (Analyze_Declarations): Create the DIC and Invariant
6897 procedure bodies s after all freezing has taken place.
6898 (Build_Assertion_Bodies): New routine.
6899 * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
6901 (Analyze_Package_Specification): Remove the
6902 generation of the DIC and Invariant procedure bodies. This is
6903 now done by Analyze_Declarations.
6904 * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
6905 procedures are never treated as primitives.
6907 2017-01-19 Yannick Moy <moy@adacore.com>
6909 * frontend.adb: Analyze inlined bodies and check elaboration
6910 rules in GNATprove mode too.
6911 * sem_elab.adb (Delay_Element): Add Boolean component to save
6912 indication that call is in SPARK code. (Check_Elab_Calls):
6913 Check elaboration rules in GNATprove mode, and correctly set
6914 the current value of SPARK_Mode.
6915 * lib-xref-spark_specific.adb
6916 (Add_SPARK_Xrefs): Simplify iteration over dereferences.
6918 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6920 * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
6921 checks on the expression for the high bound of concatenation
6922 when checks are disabled, to suppress warnings about potential
6923 constraint errors in restricted runtimes.
6925 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6927 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
6928 representation-to-position function as inlined.
6929 * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
6930 the purity of an internally generated entity if it has been
6931 explicitly marked as pure for optimization purposes.
6932 * exp_aggr.adb: Minor reformatting.
6934 2017-01-19 Javier Miranda <miranda@adacore.com>
6936 * exp_ch6.adb (Expand_Call): Remove side effects on
6937 actuals that are allocators with qualified expression since the
6938 initialization of the object is performed by means of individual
6939 statements (and hence it must be done before the call).
6941 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6943 * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
6944 (Build_Derived_Enumeration_Type): If the derived type inherits a
6945 dynamic predicate from its parent, the bounds of the type must
6946 freeze because an explicit constraint is constructed for the
6947 type and the corresponding range is elaborated now.
6949 2017-01-19 Arnaud Charlet <charlet@adacore.com>
6951 * sem_attr.ads: minor fix of inconsistent casing in comment
6952 * lib-writ.ads: minor align comments in columns
6953 * sem_ch3.adb: Minor reformatting.
6954 * spark_xrefs.ads: minor fix typo in SPARK-related comment
6955 * table.ads: minor style fix in comment
6956 * lib-xref-spark_specific.adb
6957 (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
6958 * sem_ch12.adb: minor whitespace fix
6959 * freeze.adb: Add comment.
6960 * sem_util.adb (Unique_Name): for instances of
6961 generic subprograms ignore the name of the wrapper package.
6963 2017-01-19 Javier Miranda <miranda@adacore.com>
6965 * exp_aggr.adb (Resolve_Record_Aggregate):
6966 Factorize code needed for aggregates of limited and unlimited
6967 types in a new routine.
6968 (Pass_Aggregate_To_Back_End): New subprogram.
6970 2017-01-19 Yannick Moy <moy@adacore.com>
6972 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
6974 2017-01-19 Ed Schonberg <schonberg@adacore.com>
6976 * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
6977 public, for use elsewhere.
6978 * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
6979 an Inlined_body, recognize a call that uses object notation
6980 and has not been rewritten as a regular call because regular
6981 expansion has not taken place.
6983 2017-01-19 Bob Duff <duff@adacore.com>
6985 * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
6986 in case of generic formal discrete types, because it causes crashes in
6987 the compiler when built with assertions on.
6989 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
6991 * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
6992 sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
6994 2017-01-19 Bob Duff <duff@adacore.com>
6996 * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
6997 Increment Warnings_Detected. It was decrementing, which is
6998 wrong since we just issued a warning message.
6999 * binderr.ads (Errors_Detected, Warnings_Detected): Declare
7000 these variables to be of subtype Nat instead of Int, because
7001 they should never be negative.
7003 2017-01-19 Javier Miranda <miranda@adacore.com>
7005 * contracts.adb (Build_Postconditions_Procedure): Replace
7006 Generate_C_Code by Modify_Tree_For_C.
7007 * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
7008 Replace Generate_C_Code by Modify_Tree_For_C.
7009 * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
7011 * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
7012 Generate_C_Code by Modify_Tree_For_C.
7013 * exp_ch4.adb (Expand_Allocator_Expression): Replace
7014 Generate_C_Code by Modify_Tree_For_C.
7015 * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
7016 by Modify_Tree_For_C.
7017 * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
7018 Generate_C_Code by Modify_Tree_For_C.
7019 * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
7020 by Modify_Tree_For_C.
7021 * sinfo.ads (Modify_Tree_For_C): Adding documentation.
7023 2017-01-19 Javier Miranda <miranda@adacore.com>
7025 * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
7027 (Is_Inlinable_Expression_Function): New subprogram.
7028 * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
7030 (Is_Inlinable_Expression_Function): Moved to Sem_Util.
7032 2017-01-19 Ed Schonberg <schonberg@adacore.com>
7034 * sem_ch4.adb (Diagnose_Call): Improve error message when a
7035 selected component has a prefix that might be interpreted
7036 as a parameterless function call, but none of the candidate
7037 interpretations is parameterless, and there is a hidden homonym
7038 of the prefix that is a package.
7039 * sem_ch8.adb (Find_Selected_Component): If the prefix might be
7040 interpreted as a parameterless function call and its analysis
7041 fails, do not call Analyze_Selected_Component.
7043 2017-01-19 Steve Baird <baird@adacore.com>
7045 * sem_util.ads: Add new Use_Full_View Boolean parameter to
7047 * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
7048 calls to a newly-defined Scalar_Range_Of_Right_View function.
7050 2017-01-19 Arnaud Charlet <charlet@adacore.com>
7052 * gnat1drv.adb: minor fix of unbalanced parens in comment
7053 * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
7054 to visible part of the package to allow re-use in GNATprove.
7055 * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
7056 from repeated code of Traverse_Compilation_Unit.
7057 (Traverse_Declaration_Or_Statement): fixed detection of
7058 generic subprograms and packages; also, iteration over case
7059 statement alternatives rewritten to avoid testing if the first
7060 alternative is present (since it must be present due to Ada
7061 syntax restrictions).
7063 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
7065 * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
7066 returning by reference not just for subprogram body stubs,
7067 but for all subprogram cases.
7068 * sem_util.adb: Code reformatting.
7069 (Requires_Transient_Scope): Update the call to Results_Differ.
7070 (Results_Differ): Update the parameter profile and the associated
7073 2017-01-19 Ed Schonberg <schonberg@adacore.com>
7075 * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
7076 identifier nodes that do not come from source, to handle properly
7077 dimensionality check within an inlined body which inclddes both
7078 original operands and rewritten operands. This removes spurious
7079 dimensionality errors in the presence of front-end inlining,
7080 as well as in SPARK mode.
7082 2017-01-16 Jakub Jelinek <jakub@redhat.com>
7085 * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
7087 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7089 * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
7091 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7093 * doc/gnat_ugn/getting_started_with_gnat.rst,
7094 doc/gnat_ugn/inline_assembler.rst,
7095 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
7096 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
7097 doc/gnat_ugn/about_this_guide.rst,
7098 doc/gnat_ugn/platform_specific_information.rst,
7099 doc/gnat_ugn/example_of_binder_output.rst,
7100 doc/gnat_ugn/gnat_and_program_execution.rst,
7101 doc/gnat_ugn/gnat_utility_programs.rst,
7102 doc/gnat_ugn/the_gnat_compilation_model.rst,
7103 doc/gnat_rm/implementation_defined_attributes.rst,
7104 doc/gnat_rm/compatibility_and_porting_guide.rst,
7105 doc/gnat_rm/standard_library_routines.rst,
7106 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
7107 doc/gnat_rm/implementation_defined_pragmas.rst,
7108 doc/gnat_rm/the_gnat_library.rst,
7109 doc/gnat_rm/obsolescent_features.rst,
7110 doc/gnat_rm/about_this_guide.rst,
7111 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
7112 doc/gnat_rm/implementation_of_ada_2012_features.rst,
7113 doc/gnat_rm/interfacing_to_other_languages.rst,
7114 doc/gnat_rm/implementation_defined_aspects.rst,
7115 doc/gnat_rm.rst: Update documentation.
7116 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
7118 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7120 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
7121 * scil_ll.adb: Minor style fix in comment.
7122 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
7123 even if entity is already set, because the node may be renalyzed
7124 after inlining transformations.
7126 2017-01-13 Javier Miranda <miranda@adacore.com>
7128 * sem_res.adb (Resolve_Call): Do not establish a transient scope
7129 for a call to inlinable expression function (since the call will
7130 be replaced by its returned object).
7131 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
7132 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
7133 (Expand_Call): For inlinable expression function call replace the
7134 call by its returned object.
7135 (Is_Inlinable_Expression_Function): New subprogram.
7137 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7139 * checks.adb: Minor typo fix and reformatting.
7141 2017-01-13 Javier Miranda <miranda@adacore.com>
7143 * contracts.adb (Contract_Only_Subprograms): Remove formal.
7144 (Copy_Original_Specification): Removed.
7145 (Skip_Contract_Only_Subprogram): Move here checks previously
7146 located in the caller of this routine (to leave the code more clean).
7147 (Build_Contract_Only_Subprogram): Code cleanup.
7148 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
7149 (Get_Contract_Only_Missing_Body_Name): Removed.
7151 2017-01-13 Javier Miranda <miranda@adacore.com>
7153 * sem_ch6.adb (Cloned_Expression): New subprogram.
7154 (Freeze_Expr_Types): Complete previous patch since the expression
7155 of an expression-function may have iterators and loops with
7156 defining identifiers which, as part of the preanalysis of the
7157 expression, may be left decorated with itypes that will not be
7158 available in the tree passed to the backend.
7160 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7162 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
7163 conversion to Integer of an expression that is an attribute
7164 reference 'Pos on an enumeration type.
7166 2017-01-13 Bob Duff <duff@adacore.com>
7168 * atree.ads: Minor comment fix.
7170 2017-01-13 Justin Squirek <squirek@adacore.com>
7172 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
7173 calls in accessibility check on return statement.
7175 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7177 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
7178 Ensure that the input body is a subprogram body before trying to
7179 determine whether it denoted an expression function. Note that
7180 subprogram body stubs cannot denote expression functions.
7182 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7184 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
7187 2017-01-13 Javier Miranda <miranda@adacore.com>
7189 * einfo.ads (Component_Bit_Offset): Fix documentation.
7190 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
7191 on record holes for components with unknown compile-time offsets.
7193 2017-01-13 Bob Duff <duff@adacore.com>
7195 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
7196 * g-locfil.ads: Minor comment fix.
7198 2017-01-13 Bob Duff <duff@adacore.com>
7200 * binde.adb (Elab_New): New elaboration order algorithm
7201 that is expected to cause fewer ABE issues. This is a work in
7202 progress. The new algorithm is currently disabled, and can be
7203 enable by the -dp switch, or by modifying the Do_Old and Do_New
7204 etc. flags and rebuilding. Experimental code is included to
7205 compare the results of the old and new algorithms.
7206 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
7207 can have multiple of these tables, so the old and new algorithms
7209 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
7210 parameter of type array. This avoids the global variable, and
7211 allows bounds checking (which is normally defeated by the tables
7212 packages). It also ensures that the Elab_Order is read-only
7214 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
7215 subprograms that need it, as above.
7216 * debug.adb: Document new -dp switch. Modify doc of old -do
7218 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
7219 and Bindgen. Move writing of closure (-R and -Ra switches)
7220 to Binde; that's more convenient.
7222 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7224 * sem_ch6.adb (Analyze_Expression_Function): If the expression
7225 function is a completion, all entities referenced in the
7226 expression are frozen. As a consequence, a reference to an
7227 uncompleted private type from an enclosing scope is illegal.
7229 2017-01-13 Javier Miranda <miranda@adacore.com>
7231 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
7232 (Analyze_Subprogram_Body_Helper): At the occurrence of an
7233 expression function declaration that is a completion, its
7234 expression causes freezing (AI12-0103).
7236 2017-01-13 Vadim Godunko <godunko@adacore.com>
7238 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
7239 Reference functions of Ada.Containers.Indefinite_Holders.
7241 2017-01-13 Bob Duff <duff@adacore.com>
7243 * s-os_lib.ads: Minor comment fixes.
7245 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7247 * exp_ch3.adb (Default_Initialize_Object): Do not default
7248 initialize an object when it is of a task type and restriction
7249 No_Tasking is in effect because the initialization is obsolete.
7250 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
7251 restriction No_Tasking is in effect.
7252 (Build_Master_Renaming): Do not rename a master when restriction
7253 No_Tasking is in effect.
7255 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7257 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
7258 the legality of An others clause applies as well to a choice in
7259 an Iterated_component_ association.
7260 (Resolve_Iterated_Component_Association): An others choice
7262 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
7263 Iterated_Component_Association is not static.
7265 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7267 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
7268 control is passed to the expresion handler before the new mode
7270 * sem_ch12.adb (Analyze_Package_Instantiation,
7271 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
7272 in case control is passed to the expresion handler before the
7275 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7277 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
7278 exp_aggr.adb: Minor reformatting.
7280 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7282 * inline.adb: Minor reformatting and typo fix.
7284 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7286 * sem_util.ads, sem_util.adb (Choice_List): Move function here
7287 from sem_aggr.adb, for use elsewhere.
7288 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
7289 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
7290 Iterated_Component_Present.
7291 * exp_aggr.adb: Use Choice_List throughout, to handle
7292 Iterated_Component_Associations.
7293 (Gen_Loop): Generate proper loop for an
7294 Iterated_Component_Association: loop variable has the identifier
7295 of the original association. Generate a loop even for a single
7296 component choice, in order to make loop parameter visible in
7298 (Flatten): An Iterated_Component_Association is not static.
7300 2017-01-13 Yannick Moy <moy@adacore.com>
7302 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
7303 float exponentiation for statically known small negative values
7304 is the reciprocal of the exponentiation for the opposite value
7306 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
7307 Ensure that the value of float exponentiation for negative values
7308 is the reciprocal of the exponentiation for the opposite value
7310 * inline.adb (Expand_Inlined_Call): Fix the count
7311 for the number of generated gotos.
7313 2017-01-13 Yannick Moy <moy@adacore.com>
7315 * inline.adb: Code cleanup.
7316 * sem_util.adb (Is_OK_Volatile_Context): Add
7317 expression in delay statement as OK for volatile context.
7319 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7321 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
7322 mode a choice that is a subtype with a static predicate is
7323 replaced by the values it covers. This transformation must not
7324 be performed in ASIS mode, to preserve the source for analysis.
7326 2017-01-13 Justin Squirek <squirek@adacore.com>
7328 * nlists.ads: Correct minor typo.
7330 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7332 * sem_ch13.adb: Minor reformatting and typo fix.
7334 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7336 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
7337 Iterated_Component_Association is a named association in an
7339 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
7340 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
7341 and resolve the discrete choices and the expression of the
7343 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
7344 Loop_Actions and Box_Present are attributes of
7345 N_Iterated_Component_Association nodes. Box_Present is always
7347 * sprint.adb (Sprint_Node): An Iterated_Component_Association
7348 has a Discrete_Choices list, as specified in the RM. A
7349 Component_Association for aggregate uses instead a Choices list.
7350 We have to live with this small inconsistency because the new
7351 construct also has a defining identifier, and there is no way
7352 to merge the two node structures.
7354 2017-01-13 Yannick Moy <moy@adacore.com>
7356 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
7357 list of pragmas to remove. Remove pragmas from the list of
7358 statements in the body to inline.
7359 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
7361 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7363 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
7364 Analyze_Declarations, to analyze and resolve the expressions of
7365 aspect specifications in the current declarative list, so that
7366 the expressions have proper entity and type info. This is needed
7367 for ASIS when there is no subsequent expansion to generate this
7368 semantic information.
7369 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
7370 original expression, to suppress cascaded errors when expression
7371 has been constant-folded.
7372 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
7373 ASIS mode, because there is no subsequent expansion to decorate
7376 2017-01-13 Yannick Moy <moy@adacore.com>
7378 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
7379 New function to detect when a call may be inlined or not in
7381 (Expand_Inlined_Call): Ensure that a temporary
7382 is always created in the cases where a type conversion may be
7383 needed on an input parameter in GNATprove mode, so that GNATprove
7384 sees the check to perform.
7385 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
7386 when not applicable due to actual requiring type conversion
7387 with possible check but no temporary value can be copied for
7388 GNATprove to see the check.
7390 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7392 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
7393 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
7394 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
7395 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
7396 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
7397 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
7398 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
7399 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
7400 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
7401 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
7402 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
7403 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
7404 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
7405 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
7406 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
7407 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
7408 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
7409 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
7410 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
7411 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
7412 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
7413 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
7414 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
7415 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
7416 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
7417 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
7418 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
7419 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
7420 statements to reflect the new style for case alternatives. Various
7421 code clean up and reformatting.
7423 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7425 * exp_util.adb: Minor reformatting.
7427 2017-01-13 Yannick Moy <moy@adacore.com>
7429 * exp_spark.adb: Code cleanup.
7430 * sem_ch9.adb (Analyze_Delay_Until): Resolve
7431 expression so that calls are identified as such inside delay
7434 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7436 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
7437 * par-ch3.adb (P_Discrete_Choice_List): An
7438 Iterated_Component_Association is an array aggregate component.
7439 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
7440 (Is_Quantified_Expression): New function that performs a lookahead
7441 to distinguish quantified expressions from iterated component
7443 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
7445 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
7446 * sem.adb (Analyze): Handle Iterated_Component_Association.
7447 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
7448 component associations.
7449 * sinfo.ads, sinfo.adb: Entries for for
7450 N_Iterated_Component_Association and its fields.
7451 * sprint.adb (Sprint_Node_Actual): Handle
7452 N_Iterated_Component_Association.
7454 2017-01-13 Justin Squirek <squirek@adacore.com>
7456 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
7457 of the style check until after preanalysis of acutals.
7459 2017-01-13 Yannick Moy <moy@adacore.com>
7461 * sem_ch13.adb: Minor reformatting.
7462 * par-ch11.adb: minor style fix in whitespace
7463 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
7464 reduced to Add_Artificial_ALI_File; style fix in declaration of
7465 Text; grammar fix in comment.
7466 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
7467 * freeze.adb: Cleanup to pass pragma instead of
7469 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
7470 replace System'To_Address by equivalent call.
7472 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7474 * bindusg.adb: Improve usage output for -f switch.
7476 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7478 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
7481 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7483 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
7484 treat comparisons on strings as legal in a Static_Predicate.
7485 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
7486 a function call that is the expansion of a string comparison.The
7487 function call is built when compiling the corresponding predicate
7488 function, but the expression has been found legal as a static
7489 predicate during earlier analysis.
7490 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
7491 properly a function call that is the expansion of a string
7492 comparison operation, in order to recover the Static_Predicate
7493 expression and apply it to a static argument when needed.
7495 2017-01-13 Tristan Gingold <gingold@adacore.com>
7497 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
7498 (Open_Read): Re-implement using Open_Read_No_Exception.
7499 (Open_Write): Raise exception in case of error.
7500 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
7501 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
7503 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
7505 2017-01-13 Yannick Moy <moy@adacore.com>
7507 * checks.adb: Code cleanup.
7509 2017-01-13 Yannick Moy <moy@adacore.com>
7511 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
7512 expression instead of unanalyzed aspect expression for checking
7513 the validity of inheriting an operation. Also copy the expression
7514 being passing it to Build_Class_Wide_Expression, as this call
7515 modifies its argument.
7516 * sem_util.ads Fix comment to reference correct function name
7519 2017-01-13 Javier Miranda <miranda@adacore.com>
7521 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
7522 when we propagate information about the indexes back to the original
7523 indexing mode and the prefix of the index is a function call, do not
7524 remove any parameter from such call.
7526 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7528 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
7529 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
7530 a build-in-place function whose result type is tagged.
7532 2017-01-13 Yannick Moy <moy@adacore.com>
7534 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7535 Do not generate a wrapper when the only candidate is a class-wide
7537 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
7538 inside a generic context.
7540 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7542 * exp_util.adb (Add_Inherited_Tagged_DIC):
7543 Pass the object parameters of both the parent and the derived
7544 type DIC procedure to the reference replacement circuitry.
7545 (Find_DIC_Type): Modify the circuitry to present the partial
7546 view of a private type in case the private type defines its own
7548 (Replace_Object_And_Primitive_References): Add two
7549 optional formal parameters. Update the comment on usage. Update
7550 the replacement of references to object parameters.
7552 2017-01-13 Gary Dismukes <dismukes@adacore.com>
7554 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
7556 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7558 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
7559 an out parameter that is a type conversion, independently of th
7560 range check that may apply to the expression of the conversion,
7561 for use in GNATProve.
7563 2017-01-13 Yannick Moy <moy@adacore.com>
7565 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
7566 GNATprove_Mode here to Frontend.
7567 * frontend.adb (Frontend): Move the implicit with for System
7568 in GNATprove_Mode here as it ismore correct this way; the old
7569 place only worked by chance, since there were no overloaded names.
7570 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
7571 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
7572 four attributes identified in SRM 9(18), add an implicit with
7573 to Ada.Task_Identification.
7574 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7575 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
7577 * checks.adb (Apply_Discriminant_Check,
7578 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
7579 In GNATprove mode, we do not apply the checks, but we still
7580 analyze the expression to possibly issue errors on SPARK
7581 code when a run-time error can be detected at compile time.
7582 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
7585 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7587 * expander.adb (Expand): Add a warning about using return
7588 statements in Ghost management code.
7589 * exp_ch3.adb (Freeze_Type): Add a warning about using return
7590 statements in Ghost management code.
7591 * exp_ch7.adb (Build_Invariant_Procedure_Body,
7592 Build_Invariant_Procedure_Declaration): Add a warning about
7593 using return statements in Ghost management code.
7594 * exp_disp.adb (Make_DT): Add a warning about using return
7595 statements in Ghost management code.
7596 * exp_util.adb (Build_DIC_Procedure_Body,
7597 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
7598 warning about using return statements in Ghost management code.
7599 * freeze.adb (Freeze_Entity): Add a warning about using return
7600 statements in Ghost management code.
7601 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
7602 statements in Ghost management code.
7603 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
7604 a warning about using return statements in Ghost management code.
7605 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
7606 return statements in Ghost management code.
7607 * sem_ch6.adb (Analyze_Procedure_Call,
7608 Analyze_Subprogram_Body_Helper): Add a warning about using return
7609 statements in Ghost management code.
7610 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
7611 using return statements in Ghost management code.
7612 * sem_ch12.adb (Analyze_Package_Instantiation,
7613 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
7614 Instantiate_Subprogram_Body): Add a warning about using return
7615 statements in Ghost management code.
7616 * sem_ch13.adb (Build_Predicate_Functions,
7617 Build_Predicate_Function_Declarations): Add a warning about
7618 using return statements in Ghost management code.
7619 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
7620 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
7621 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
7622 using return statements in Ghost management code.
7624 2017-01-13 Tristan Gingold <gingold@adacore.com>
7626 * s-mmosin-mingw.adb: Fix pragma import.
7628 2017-01-13 Arnaud Charlet <charlet@adacore.com>
7630 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
7633 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
7635 * atree.adb (Allocate_Initialize_Node): A newly created node is
7636 no longer marked as Ghost at this level.
7637 (Mark_New_Ghost_Node): New routine.
7638 (New_Copy): Mark the copy as Ghost.
7639 (New_Entity): Mark the entity as Ghost.
7640 (New_Node): Mark the node as Ghost.
7641 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
7642 apply to unanalyzed entities.
7643 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
7645 (Set_Is_Checked_Ghost_Entity): This attribute now
7646 applies to all entities as well as unanalyzed entities.
7647 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
7648 all entities as well as unanalyzed entities.
7649 * expander.adb Add with and use clauses for Ghost.
7650 (Expand): Install and revert the Ghost region associated with the node
7652 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
7653 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
7654 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
7655 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
7656 (Freeze_Type): Install and revert the Ghost region associated
7657 with the type being frozen.
7658 * exp_ch5.adb Remove with and use clauses for Ghost.
7659 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
7660 * exp_ch6.adb Remove with and use clauses for Ghost.
7661 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
7662 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
7663 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
7664 Ghost region of the working type.
7665 (Build_Invariant_Procedure_Declaration): Install and revert
7666 the Ghost region of the working type.
7667 (Expand_N_Package_Body): Remove all Ghost-related code.
7668 * exp_ch8.adb Remove with and use clauses for Ghost.
7669 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
7671 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
7672 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
7673 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
7675 * exp_ch13.adb Remove with and use clauses for Ghost.
7676 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
7677 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
7678 the tagged type. Move the generation of various entities within
7679 the Ghost region of the type.
7680 * exp_prag.adb Remove with and use clauses for Ghost.
7681 (Expand_Pragma_Check): Remove all Ghost-related code.
7682 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
7683 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
7684 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
7685 * exp_util.adb (Build_DIC_Procedure_Body): Install
7686 and revert the Ghost region of the working types.
7687 (Build_DIC_Procedure_Declaration): Install and revert the
7688 Ghost region of the working type.
7689 (Make_Invariant_Call): Install and revert the Ghost region of the
7691 (Make_Predicate_Call): Reimplemented. Install and revert the
7692 Ghost region of the associated type.
7693 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
7694 of the entity being frozen.
7695 (New_Freeze_Node): Removed.
7696 * ghost.adb Remove with and use clauses for Opt.
7697 (Check_Ghost_Completion): Update the parameter profile
7698 and all references to formal parameters.
7699 (Ghost_Entity): Update the comment on usage.
7700 (Install_Ghost_Mode): New routines.
7701 (Is_Ghost_Assignment): New routine.
7702 (Is_Ghost_Declaration): New routine.
7703 (Is_Ghost_Pragma): New routine.
7704 (Is_Ghost_Procedure_Call): New routine.
7705 (Is_Ghost_Renaming): Removed.
7706 (Is_OK_Declaration): Reimplemented.
7707 (Is_OK_Pragma): Reimplemented.
7708 (Is_OK_Statement): Reimplemented.
7709 (Is_Subject_To_Ghost): Update the comment on usage.
7710 (Mark_And_Set_Ghost_Assignment): New routine.
7711 (Mark_And_Set_Ghost_Body): New routine.
7712 (Mark_And_Set_Ghost_Completion): New routine.
7713 (Mark_And_Set_Ghost_Declaration): New routine.
7714 (Mark_And_Set_Ghost_Instantiation): New routine.
7715 (Mark_And_Set_Ghost_Procedure_Call): New routine.
7716 (Mark_Full_View_As_Ghost): Removed.
7717 (Mark_Ghost_Declaration_Or_Body): New routine.
7718 (Mark_Ghost_Pragma): New routine.
7719 (Mark_Ghost_Renaming): New routine.
7720 (Mark_Pragma_As_Ghost): Removed.
7721 (Mark_Renaming_As_Ghost): Removed.
7722 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
7723 (Prune_Node): Freeze nodes no longer need special pruning, they
7724 are processed by the general ignored Ghost code mechanism.
7725 (Restore_Ghost_Mode): New routine.
7726 (Set_Ghost_Mode): Reimplemented.
7727 (Set_Ghost_Mode_From_Entity): Removed.
7728 * ghost.ads Add with and use clauses for Ghost.
7729 (Check_Ghost_Completion): Update the parameter profile
7730 along with the comment on usage.
7731 (Install_Ghost_Mode): New routine.
7732 (Is_Ghost_Assignment): New routine.
7733 (Is_Ghost_Declaration): New routine.
7734 (Is_Ghost_Pragma): New routine.
7735 (Is_Ghost_Procedure_Call): New routine.
7736 (Mark_And_Set_Ghost_Assignment): New routine.
7737 (Mark_And_Set_Ghost_Body): New routine.
7738 (Mark_And_Set_Ghost_Completion): New routine.
7739 (Mark_And_Set_Ghost_Declaration): New routine.
7740 (Mark_And_Set_Ghost_Instantiation): New routine.
7741 (Mark_And_Set_Ghost_Procedure_Call): New routine.
7742 (Mark_Full_View_As_Ghost): Removed.
7743 (Mark_Ghost_Pragma): New routine.
7744 (Mark_Ghost_Renaming): New routine.
7745 (Mark_Pragma_As_Ghost): Removed.
7746 (Mark_Renaming_As_Ghost): Removed.
7747 (Restore_Ghost_Mode): New routine.
7748 (Set_Ghost_Mode): Redefined.
7749 (Set_Ghost_Mode_From_Entity): Removed.
7750 * sem.adb (Analyze): Install and revert the Ghost region of the
7751 node being analyzed.
7752 (Do_Analyze): Change the way a clean Ghost
7753 region is installed and reverted.
7754 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
7755 all Ghost-related code.
7756 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
7757 (Analyze_Number_Declaration): Remove all Ghost-related code.
7758 (Analyze_Object_Declaration): Install and revert the Ghost region of
7759 a deferred object declaration's completion.
7760 (Array_Type_Declaration): Remove all Ghost-related code.
7761 (Build_Derived_Type): Update the comment on
7762 the propagation of Ghost attributes from a parent to a derived type.
7763 (Derive_Subprogram): Remove all Ghost-related code.
7764 (Make_Class_Wide_Type): Remove all Ghost-related code.
7765 (Make_Implicit_Base): Remove all Ghost-related code.
7766 (Process_Full_View): Install and revert the Ghost region of
7767 the partial view. There is no longer need to check the Ghost
7769 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
7770 region of the left hand side.
7771 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
7772 all Ghost-related code.
7773 (Analyze_Expression_Function): Remove all Ghost-related code.
7774 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
7775 (Analyze_Procedure_Call): Install and revert the Ghost region of
7776 the procedure being called.
7777 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
7778 region of the spec or body.
7779 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
7780 (Build_Subprogram_Declaration): Remove all Ghost-related code.
7781 (Find_Corresponding_Spec): Remove all Ghost-related code.
7782 (Process_Formals): Remove all Ghost-related code.
7783 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
7784 the Ghost region of the spec.
7785 (Analyze_Package_Declaration): Remove all Ghost-related code.
7786 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
7787 Ghost when it aliases a Ghost entity.
7788 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
7790 (Analyze_Object_Renaming): Mark a renaming as Ghost when
7791 it aliases a Ghost entity.
7792 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
7794 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
7795 aliases a Ghost entity.
7796 * sem_ch11.adb Remove with and use clauses for Ghost.
7797 (Analyze_Exception_Declaration): Remove all Ghost-related code.
7798 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
7800 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
7802 (Analyze_Package_Instantiation): Install and revert the Ghost region
7803 of the package instantiation.
7804 (Analyze_Subprogram_Instantiation): Install
7805 and revert the Ghost region of the subprogram instantiation.
7806 (Instantiate_Package_Body): Code clean up. Install and revert the
7807 Ghost region of the package body.
7808 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
7809 Ghost region of the subprogram body.
7810 * sem_ch13.adb (Build_Predicate_Functions): Install
7811 and revert the Ghost region of the related type.
7812 (Build_Predicate_Function_Declaration): Code clean up. Install
7813 and rever the Ghost region of the related type.
7814 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
7815 Install and revert the Ghost region of the pragma.
7816 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
7817 Ghost region of the pragma.
7818 (Analyze_Pragma): Install and revert the Ghost region of various
7819 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
7820 or encloses a Ghost entity.
7821 (Analyze_Pre_Post_Condition): Install and revert the Ghost
7822 region of the pragma.
7823 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
7824 Ghost region of the pragma.
7825 * sem_res.adb (Resolve): Remove all Ghost-related code.
7826 * sem_util.adb (Is_Declaration): Reimplemented.
7827 (Is_Declaration_Other_Than_Renaming): New routine.
7828 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
7829 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
7830 (Is_Ghost_Pragma): Removed.
7831 (Is_Ignored_Ghost_Pragma): New routine.
7832 (Set_Is_Checked_Ghost_Pragma): New routine.
7833 (Set_Is_Ghost_Pragma): Removed.
7834 (Set_Is_Ignored_Ghost_Pragma): New routine.
7835 * sinfo.ads: Update the documentation on Ghost mode and
7836 Ghost regions. New attributes Is_Checked_Ghost_Pragma
7837 and Is_Ignored_Ghost_Pragma along with usages in nodes.
7838 Remove attribute Is_Ghost_Pragma along with usages in nodes.
7839 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
7840 (Is_Ghost_Pragma): Removed along with pragma Inline.
7841 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
7842 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
7843 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
7844 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
7846 2017-01-12 Tristan Gingold <gingold@adacore.com>
7848 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
7849 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
7851 2017-01-12 Yannick Moy <moy@adacore.com>
7853 * errout.adb, errout.ads (Initialize): Factor common treatment
7855 (Reset_Warnings): New procedure to reset counts related to warnings.
7856 (Record_Compilation_Errors): New variable to store the presence of an
7857 error, used in gnat2why to allow changing the Warning_Mode.
7858 (Compilation_Errors): Use new variable Record_Compilation_Errors to
7859 store the presence of an error.
7861 2017-01-12 Javier Miranda <miranda@adacore.com>
7863 * sem_ch13.adb (Analyze_Aspect_Specifications):
7864 For Interrupt_Handler and Attach_ Handler aspects, decorate the
7865 internally built reference to the protected procedure as coming
7866 from sources and force its analysis.
7868 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7870 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
7871 inherit predicates if any from the first_subtype of the parent,
7872 not from the anonymous parent type.
7873 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
7874 predicate is not a static subtype.
7876 2017-01-12 Gary Dismukes <dismukes@adacore.com>
7878 * freeze.adb (Check_Suspicious_Convention): New procedure
7879 performing a warning check on discriminated record types with
7880 convention C or C++. Factored out of procedure Freeze_Record_Type,
7881 and changed to only apply to base types (to avoid spurious
7882 warnings on subtypes). Minor improvement of warning messages
7883 to refer to discriminated rather than variant record types.
7884 (Freeze_Record_Type): Remove code for performing a suspicious
7886 (Freeze_Entity): Only call Freeze_Record_Type
7887 on types that aren't declared within any enclosing generic units
7888 (rather than just excluding the type when the innermost scope
7889 is generic). Call Check_Suspicious_Convention whether or not
7890 the type is declared within a generic unit.
7891 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
7892 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
7895 2017-01-12 Tristan Gingold <gingold@adacore.com>
7897 * sysdep.c, adaint.c, rtinit.c, ming32.h:
7898 (__gnat_current_codepage): Renamed from CurrentCodePage
7899 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
7901 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7903 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
7904 quantified expressions, following AI12-050: the loop parameters
7905 of two quantified expressions are conformant if they have the
7908 2017-01-12 Arnaud Charlet <charlet@adacore.com>
7910 * gcc-interface/Makefile.in: Clean up VxWorks targets.
7912 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7914 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
7915 Hnadle properly the attribute reference when it appears as part
7916 of an expression in another loop aspect.
7918 2017-01-12 Ed Schonberg <schonberg@adacore.com>
7920 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
7921 subsidiary of Build_Initialization_Call, to complete generation
7922 of predicate checks on discriminants whose (sub)types have
7923 predicates, and to add checks on variants that do not have an
7925 * sem_util.adb (Gather_Components): A missing Others alternative is
7926 not an error when the type of the discriminant is a static predicate
7927 (and coverage has been checked when analyzing the case statement). A
7928 runtime check is generated to verify that a given discriminant
7929 satisfies the predicate (RM 3.8.1. (21.1/2)).
7931 2017-01-12 Yannick Moy <moy@adacore.com>
7933 * gnat1drv.adb (Adjust_Global_Switches): Only
7934 perform checking of exception mechanism when generating code.
7936 2017-01-12 Justin Squirek <squirek@adacore.com>
7938 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
7939 Remove handling of access component with invariant.
7940 (Build_Invariant_Procedure_Declaration): Remove return on class
7942 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
7943 conditional exception for component or array so Has_Own_Invariants
7944 flag is not falsly set.
7945 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
7946 wide type to have no invariant flags.
7948 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
7950 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
7951 sem_ch13.adb: Minor reformatting.
7953 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
7955 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
7956 adjustment primitive when the ancestor type was not properly frozen.
7957 (Gen_Assign): Guard against a missing initialization
7958 primitive when the component type was not properly frozen.
7959 (Initialize_Array_Component): Guard against a missing adjustment
7960 primitive when the component type was not properly frozen.
7961 (Initialize_Record_Component): Guard against a missing adjustment
7962 primitive when the component type was not properly frozen.
7963 (Process_Transient_Component_Completion): The transient object may
7964 not be finalized when its associated type was not properly frozen.
7965 * exp_ch3.adb (Build_Assignment): Guard against a missing
7966 adjustment primitive when the component type was not properly frozen.
7967 (Build_Initialization_Call): Guard against a missing
7968 initialization primitive when the associated type was not properly
7970 (Expand_N_Object_Declaration): Guard against a missing
7971 adjustment primitive when the base type was not properly frozen.
7972 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
7973 body when there is no adjustment primitive available. Create an
7974 empty Deep_Finalize body when there is no finalization primitive
7976 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
7977 missing finalization primitive when the designated type was
7978 not properly frozen.
7979 (Expand_N_Allocator): Guard against a missing initialization primitive
7980 when the designated type was not properly frozen.
7981 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
7982 only when the corresponding adjustment primitive is available.
7983 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
7984 adjustment/finalization statements only when there is an available
7985 primitive to carry out the action.
7986 (Build_Initialize_Statements): Generate the initialization/finalization
7987 statements only when there is an available primitive to carry out the
7989 (Make_Adjust_Call): Do not generate a call when the underlying
7990 type is not present due to a possible missing full view.
7991 (Make_Final_Call): Do not generate a call when the underlying
7992 type is not present due to a possible missing full view.
7993 (Make_Finalize_Address_Stmts): Generate an empty body when the
7994 designated type lacks a finalization primitive.
7995 (Make_Init_Call): Do not generate a call when the underlying type is
7996 not present due to a possible missing full view.
7997 (Process_Component_For_Adjust): Add the adjustment call only when the
7998 corresponding adjustment primitive is available.
7999 (Process_Component_For_Finalize): Add the finalization call only when
8000 the corresponding finalization primitive is available.
8001 (Process_Object_Declaration): Use a null statement to emulate a
8002 missing call to the finalization primitive of the object type.
8003 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
8004 (Make_Final_Call): Update the comment on usage.
8005 (Make_Init_Call): Update the comment on usage.
8006 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
8008 2017-01-12 Arnaud Charlet <charlet@adacore.com>
8010 * einfo.ads: Update documentation of Address_Taken.
8011 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
8012 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
8013 for subprograms when setting Address_Taken flag.
8015 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
8017 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
8018 Configurable_Run_Time_Mode off when analysing with'ed predefined
8021 2017-01-12 Gary Dismukes <dismukes@adacore.com>
8023 * sem_prag.adb: Minor reformatting.
8024 * sem_util.adb (Unique_Entity): fix result for
8025 bodies of entry families.
8027 2017-01-12 Justin Squirek <squirek@adacore.com>
8029 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
8030 Resolve_Suppressible in the pragma Assertion_Policy case.
8031 (Resolve_Suppressible): Created this function to factor out
8032 common code used to resolve Suppress to either Ignore or Check
8033 * snames.ads-tmpl: Add name for Suppressible.
8035 2017-01-12 Gary Dismukes <dismukes@adacore.com>
8037 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
8039 * debug.adb: Minor comment fixes.
8041 2017-01-12 Arnaud Charlet <charlet@adacore.com>
8043 * sem_util.adb (Unique_Entity): For concurrent
8044 bodies that are defined with stubs and complete a declaration
8045 of a single concurrent object return the entity of an implicit
8046 concurrent type, not the entity of the anonymous concurrent
8048 * debug.adb: -gnatd.J is no longer used.
8049 * make.adb (Globalize): Removed, no longer used.
8050 * sem_ch9.adb: minor typo in comment for entry index
8052 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
8054 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8055 * exp_ch3.adb (Build_Init_Statements): As part of initialising
8056 the value record of a task, set its _Secondary_Stack_Size field
8058 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8059 a _Secondary_Stack_Size field in the value record of
8060 the task if a Secondary_Stack_Size rep item is present.
8061 (Make_Task_Create_Call): Include secondary stack size
8062 parameter. If No_Secondary_Stack restriction is in place, passes
8064 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8065 Secondary_Stack_Size.
8066 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8067 function to define the overhead of the secondary stack.
8068 * s-tarest.adb (Create_Restricted_Task,
8069 Create_Restricted_Task_Sequential): Functions now include
8070 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8071 * s-tarest.adb (Create_Restricted_Task,
8072 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
8073 include Secondary_Stack_Size parameter.
8074 (Task_Wrapper): Secondary stack now allocated to the size specified by
8075 the Secondary_Stack_Size parameter in the task's ATCB.
8076 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
8077 Secondary_Stack_Size component.
8078 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8079 Create_Restricted_Task_Sequential): Function now include
8080 Secondary_Stack_Size parameter.
8081 (Task_Wrapper): Secondary stack now allocated to the size
8082 specified by the Secondary_Stack_Size parameter in the task's
8084 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
8085 to include Secondary_Stack_Size parameter.
8086 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
8087 Secondary_Stack_Size aspect, turning the aspect into its corresponding
8089 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
8090 * snames.adb-tmpl, snames.ads-tmpl: Added names
8091 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8092 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8094 2017-01-12 Yannick Moy <moy@adacore.com>
8096 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
8099 2017-01-12 Justin Squirek <squirek@adacore.com>
8101 * exp_attr.adb (Expand_N_Attribute_Reference):
8102 Fix Finalization_Size case by properly resolving the type after
8103 rewritting the node.
8105 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8107 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
8109 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
8110 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
8111 exp_sel.ads: Minor reformatting.
8113 2017-01-12 Justin Squirek <squirek@adacore.com>
8115 * exp_ch6.adb (Expand_Call): Add guard to prevent
8116 invariant checks from being created for internally generated
8119 2017-01-12 Bob Duff <duff@adacore.com>
8121 * lib-writ.ads: Remove incorrect comment.
8123 2017-01-12 Javier Miranda <miranda@adacore.com>
8125 * debug.adb (-gnatd.K): Enable generation of contract-only
8126 procedures in CodePeer mode.
8127 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
8129 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
8131 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
8133 (Get_Contract_Only_Missing_Body_Name): New subprogram.
8134 (Get_Contract_Only_Body): New subprogram.
8135 (Set_Contract_Only_Body): New subprogram.
8136 (Is_Contract_Only_Body): New subprogram.
8137 (Set_Is_Contract_Only_Body): New subprogram.
8138 (SCIL_Nodes): Replace table by hash-table.
8140 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8142 * exp_ch6.adb: Minor reformatting.
8143 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
8145 2017-01-12 Bob Duff <duff@adacore.com>
8147 * binde.adb (Forced): New reason for a dependence.
8148 (Force_Elab_Order): Implementation of the new switch.
8149 * binde.ads: Minor comment fixes.
8150 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
8151 long ago that is no longer supported; removed comment about that.
8152 * opt.ads (Force_Elab_Order_File): Name of file specified for
8154 * switch-b.adb: Parse -f switch.
8156 2017-01-12 Justin Squirek <squirek@adacore.com>
8158 * exp_ch6.adb (Check_View_Conversion): Created this function
8159 to properly chain calls to check type invariants that may be
8160 present in a subprogram call after the subprogram.
8161 (Expand_Call): Add a conditional to identify when a view conversion
8162 needs to be checked.
8163 * nlists.adb, nlists.ads (Prepend_New): New routine.
8164 (Prepend_New_To): New routine.
8166 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8168 * sinfo.ads: Minor reformatting.
8170 2017-01-12 Gary Dismukes <dismukes@adacore.com>
8172 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
8175 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
8177 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
8178 variable Definite. Create a local object and pass its 'Access to the
8179 BIP function when the result type is either definite or it does not
8180 require any finalization or secondary stack management.
8182 2017-01-12 Bob Duff <duff@adacore.com>
8184 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
8185 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
8186 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
8187 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
8188 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
8189 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
8190 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8191 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
8192 Change name to Pragma_Name_Unmapped.
8193 (Pragma_Name_Mapped): Change name to Pragma_Name.
8194 This is because the "mapped" version should be the usual case.
8196 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
8198 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
8199 Is_Default_Init_Cond_Procedure, and
8200 Has_Inherited_Default_Init_Cond. Add uses of flags
8201 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
8202 (Default_Init_Cond_Procedure): Removed.
8203 (DIC_Procedure): New routine.
8204 (Has_Default_Init_Cond): Removed.
8205 (Has_DIC): New routine.
8206 (Has_Inheritable_Invariants): The attribute applies to the base type.
8207 (Has_Inherited_Default_Init_Cond): Removed.
8208 (Has_Inherited_DIC): New routine.
8209 (Has_Inherited_Invariants): The attribute applies to the base type.
8210 (Has_Own_DIC): New routine.
8211 (Has_Own_Invariants): The attribute applies to the base type.
8212 (Is_Default_Init_Cond_Procedure): Removed.
8213 (Is_DIC_Procedure): New routine.
8214 (Set_Default_Init_Cond_Procedure): Removed.
8215 (Set_DIC_Procedure): New routine.
8216 (Set_Has_Default_Init_Cond): Removed.
8217 (Set_Has_Inheritable_Invariants): The attribute applies
8219 (Set_Has_Inherited_Default_Init_Cond): Removed.
8220 (Set_Has_Inherited_DIC): New routine.
8221 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
8222 (Set_Has_Own_DIC): New routine.
8223 (Set_Has_Own_Invariants): The attribute applies to the base type.
8224 (Set_Is_Default_Init_Cond_Procedure): Removed.
8225 (Set_Is_DIC_Procedure): New routine.
8226 (Write_Entity_Flags): Update the output of all flags related to
8227 default initial condition.
8228 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
8229 of the call to the DIC procedure.
8230 (Freeze_Type): Generate the body of the DIC procedure.
8231 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
8232 all occurrences of Create_Append with Append_New_To. Do
8233 not generate an invariant procedure for a class-wide type.
8234 The generated body acts as a freeze action of the working type.
8235 (Build_Invariant_Procedure_Declaration): Do not generate an
8236 invariant procedure for a class-wide type.
8237 (Create_Append): Removed.
8238 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
8239 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
8240 class-wide pre/postcondition description and data structures from
8242 (Build_Class_Wide_Expression): Moved from Sem_Prag.
8243 (Build_DIC_Call): New routine.
8244 (Build_DIC_Procedure_Body): New routine.
8245 (Build_DIC_Procedure_Declaration): New routine.
8246 (Entity_Hash): Moved from Sem_Prag.
8247 (Find_DIC_Type): New routine.
8248 (Update_Primitives_Mapping): Reimplemented.
8249 (Update_Primitives_Mapping_Of_Types): New routine.
8250 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
8251 (Build_DIC_Call): New routine.
8252 (Build_DIC_Procedure_Body): New routine.
8253 (Build_DIC_Procedure_Declaration): New routine.
8254 (Update_Primitives_Mapping): Moved from Sem_Prag.
8255 (Update_Primitives_Mapping_Of_Types): New routine.
8256 * nlists.adb (Append_New): New routine.
8257 (Append_New_To): New routine.
8258 * nlists.ads (Append_New): New routine.
8259 (Append_New_To): New routine.
8260 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
8261 of DIC procedures here. This is now done at the end of the
8262 visible declarations, private declarations, and at the freeze
8264 (Analyze_Private_Extension_Declaration):
8265 A private extension inherits the DIC pragma of a parent type.
8266 (Analyze_Subtype_Declaration): No need to propagate invariant
8267 attributes to a subtype as those apply to the base type.
8268 (Build_Derived_Record_Type): No need to inherit invariants here
8269 as this is now done in Build_Derived_Type.
8270 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
8272 (Process_Full_View): Update the propagation of DIC attributes.
8273 (Propagate_Default_Init_Cond_Attributes): Removed.
8274 * sem_ch7.adb Add with and use clauses for Exp_Util.
8275 (Analyze_Package_Specification): Create the body of the DIC
8276 procedure at the end of the visible and private declarations.
8277 (Preserve_Full_Attributes): Propagate DIC attributes.
8278 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
8280 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
8281 * sem_elab.adb (Check_A_Call): Update the call to
8282 Is_Nontrivial_Default_Init_Cond_Procedure.
8283 * sem_prag.adb Remove the with and use clauses for
8284 GNAT.HTable. Move the handling of class- wide pre/postcondition
8285 description and data structures to Exp_Util.
8286 (Analyze_Pragma): Create the declaration of the DIC procedure. There
8287 is no need to propagate invariant-related attributes at this point
8288 as this is done in Build_Invariant_Procedure_Declaration.
8289 (Build_Class_Wide_Expression): Moved to Exp_Util.
8290 (Entity_Hash): Moved to Exp_Util.
8291 (Update_Primitives_Mapping): Moved to Exp_Util.
8292 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
8293 (Update_Primitives_Mapping): Moved to Exp_Util.
8294 * sem_util.adb: Remove with and use clauses for Ghost
8296 (Build_Default_Init_Cond_Call): Removed.
8297 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8298 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8299 (Get_Views): Reimplemented.
8300 (Has_Full_Default_Initialization): Reimplement the section on DIC.
8301 (Inherit_Default_Init_Cond_Procedure): Removed.
8302 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8303 (Is_Nontrivial_DIC_Procedure): New routine.
8304 (Is_Verifiable_DIC_Pragma): New routine.
8305 (Propagate_DIC_Attributes): New routine.
8306 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
8307 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8308 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8309 (Inherit_Default_Init_Cond_Procedure): Removed.
8310 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8311 (Is_Nontrivial_DIC_Procedure): New routine.
8312 (Is_Verifiable_DIC_Pragma): New routine.
8313 (Propagate_DIC_Attributes): New routine.
8314 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
8316 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
8318 (Expression_Copy): New routine along with pragma Inline.
8319 (Set_Expression_Copy): New routine along with pragma Inline.
8321 2017-01-06 Bob Duff <duff@adacore.com>
8323 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
8324 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
8325 we won't generate the call to s_stalib_adafinal when the main
8326 is not written in Ada.
8328 2017-01-06 Bob Duff <duff@adacore.com>
8330 * sem_prag.adb: Minor: remove pragma Warnings.
8332 2017-01-06 Tristan Gingold <gingold@adacore.com>
8334 * Makefile.rtl: Do not compile s-stchop by default.
8336 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
8338 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
8339 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
8340 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
8341 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
8342 Reverted previous change for now.
8344 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8346 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
8347 check to default discriminant value if checks are enabled.
8348 (Build_Assignment): If type of component has static predicate,
8349 apply check to its default value, if any.
8351 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
8353 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8354 * exp_ch3.adb (Build_Init_Statements): As part of initialising
8355 the value record of a task, set its _Secondary_Stack_Size field
8357 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8358 a _Secondary_Stack_Size field in the value record of
8359 the task if a Secondary_Stack_Size rep item is present.
8360 (Make_Task_Create_Call): Include secondary stack size
8361 parameter. If No_Secondary_Stack restriction is in place, passes
8363 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8364 Secondary_Stack_Size.
8365 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8366 function to define the overhead of the secondary stack.
8367 * s-tarest.adb (Create_Restricted_Task,
8368 Create_Restricted_Task_Sequential): Functions now include
8369 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8370 * s-tarest.adb (Create_Restricted_Task,
8371 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
8372 now include Secondary_Stack_Size parameter.
8374 Secondary stack now allocated to the size specified by the
8375 Secondary_Stack_Size parameter in the task's ATCB.
8376 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
8377 Secondary_Stack_Size component.
8378 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8379 Create_Restricted_Task_Sequential): Function now include
8380 Secondary_Stack_Size parameter.
8381 (Task_Wrapper): Secondary stack
8382 now allocated to the size specified by the Secondary_Stack_Size
8383 parameter in the task's ATCB.
8384 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
8385 for Secondary_Stack_Size aspect, turning the aspect into its
8386 corresponding internal attribute.
8387 (Analyze_Attribute_Definition):
8388 Process Secondary_Stack_Size attribute.
8389 * snames.adb-tmpl, snames.ads-tmpl: Added names
8390 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8391 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8393 2017-01-06 Pascal Obry <obry@adacore.com>
8395 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
8396 Sequential_IO and Direct_IO.
8398 2017-01-06 Bob Duff <duff@adacore.com>
8400 * snames.ads-tmpl (Renamed): New name for the pragma argument.
8401 * par-ch2.adb: Allow the new pragma (with analysis deferred
8403 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
8404 Keep a mapping from new pragma names to old names.
8405 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
8406 implement it by calling Map_Pragma_Name.
8407 * checks.adb, contracts.adb, einfo.adb, errout.adb,
8408 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
8409 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
8410 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
8411 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
8412 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8413 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
8416 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8418 * exp_ch9.adb: Minor reformatting.
8420 2017-01-06 Tristan Gingold <gingold@adacore.com>
8422 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
8423 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
8424 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
8426 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
8427 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
8428 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
8429 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
8431 2017-01-06 Bob Duff <duff@adacore.com>
8433 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
8434 dummy implementation of Map_Pragma_Name.
8436 2017-01-06 Tristan Gingold <gingold@adacore.com>
8438 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
8439 entry_body variable constant.
8440 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
8441 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
8443 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
8444 now access to constant.
8446 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8448 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
8449 reformatting and typo fixes.
8451 2017-01-06 Bob Duff <duff@adacore.com>
8453 * snames.ads-tmpl: New names for pragma renaming.
8454 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
8455 * par-prag.adb: Add new pragma name to case statement.
8456 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
8458 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
8459 Dummy implementation of Pragma_Name_Mapped.
8461 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8463 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
8464 better detect call within an entry_wrapper.
8465 * sem_res.adb (Resolve_Call): A protected call within an
8466 entity_wrapper is analyzed in the context of the protected
8467 object but corresponds to a pre-analysis and is not an access
8469 * sem_attr.adb: Minor reformatting.
8471 2017-01-06 Justin Squirek <squirek@adacore.com>
8473 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
8474 Finalization_Size to allow a prefix of any non-class-wide type.
8475 * sem_attr.ads Modify comment for Finalization_Size to include
8476 definite type use case.
8478 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8480 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
8481 on procedures that are wrappers created for entries that have
8483 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
8484 body is an entry_wrapper, compile it in the context of the
8485 synchronized type, because a precondition may refer to funtions
8487 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
8489 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
8490 within an Entry_Wrapper this is an external call whose target
8491 is the synchronized object that is the actual in the call to
8494 2017-01-06 Yannick Moy <moy@adacore.com>
8496 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
8497 in tree, which means not analyzing the previous prefix if the node has
8498 been rewritten into its prefix.
8500 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8502 * s-tpobop.adb: Minor reformatting.
8504 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8506 * checks.adb (Ensure_Valid): Do not generate a validity check
8507 within a generated predicate function, validity checks will have
8508 been applied earlier when required.
8510 2017-01-06 Tristan Gingold <gingold@adacore.com>
8512 * s-tpoben.ads (Protection_Entries): Add comment and reorder
8513 components for performances.
8514 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
8517 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8519 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
8520 If expression is compile-time known and obeys a static predicate
8521 it must be labelled as static, to prevent spurious warnings and
8522 run-time errors, e.g. in case statements. This is relevant when
8523 the expression is the result of constant-folding a type conversion
8524 whose expression is a variable with a known static value.
8526 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8528 * exp_attr.adb, sem_attr.ads: Minor reformatting.
8530 2017-01-06 Justin Squirek <squirek@adacore.com>
8532 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
8533 expansion of Finalization_Size attribute.
8534 * sem_attr.adb (Analyze_Attribute): Add entry to check the
8535 semantics of Finalization_Size.
8536 (Eval_Attribute): Add null entry for Finalization_Size.
8537 * sem_attr.ads: Add Finalization_Size to the implementation
8538 dependent attribute list.
8539 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
8541 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8543 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
8544 iterator specification with a serious syntactic error, transform
8545 construct into an infinite loop in order to continue analysis
8546 and prevent a compiler abort.
8548 2017-01-06 Tristan Gingold <gingold@adacore.com>
8550 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
8551 max_queue_lengths_array if unused.
8553 2017-01-06 Bob Duff <duff@adacore.com>
8555 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
8556 array access, in case "\" is at the end of Text.
8557 * stylesw.adb (Set_Style_Check_Options): Don't include input
8558 characters in the error message template, because they could
8559 be control characters such as "\", which Errout will try to
8562 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8564 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
8565 For a private type examine the visible declarations that follow
8566 the partial view, not just the private declarations that follow
8569 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8571 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
8574 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8576 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
8577 alias of the inherited op is the parent iterator, no need to
8578 examine dispatch table positions which might not be established
8579 yet if type is not frozen.
8580 * sem_disp.adb (Check_Controlling_Formals): The formal of a
8581 predicate function may be a subtype of a tagged type.
8582 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
8583 of representation items for the completion of a type extension
8584 where a predicate applies to the partial view.
8585 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
8586 parameter that designates function whose actual receives a
8587 predicate check, to improve warning message when the check will
8588 lead to infinite recursion.
8589 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
8590 Apply_Predicate_Check.
8592 2017-01-06 Tristan Gingold <gingold@adacore.com>
8594 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
8595 Gnat_Extended_Ravenscar.
8596 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
8598 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8600 * sem_util.ads: Minor typo fix and reformatting.
8602 2017-01-06 Yannick Moy <moy@adacore.com>
8604 * ghost.adb Minor fixing of references to SPARK RM.
8605 (Check_Ghost_Context): Check whether reference is to a lvalue
8606 before issuing an error about violation of SPARK RM 6.9(13)
8607 when declaration has Ghost policy Check and reference has Ghost
8609 * sem_util.adb Minor indentation.
8610 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
8611 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
8612 * sem_util.ads (Unique_Defining_Entity): Document the result
8613 for package body stubs.
8615 2017-01-06 Tristan Gingold <gingold@adacore.com>
8617 * raise-gcc.c (abort): Macro to call Abort_Propagation.
8618 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
8620 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8621 Do not generate the Entry_Max_Queue_Lengths_Array if all default
8623 * exp_util.adb (Corresponding_Runtime_Package): Consider
8624 Max_Queue_Length pragma.
8626 2017-01-06 Justin Squirek <squirek@adacore.com>
8628 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8629 Remove declaration generation in the case of
8630 System_Tasking_Protected_Objects_Single_Entry being used,
8631 and add a warning message when this is detected to occur.
8632 (Make_Initialize_Protection): Remove reference pass in the case
8633 of System_Tasking_Protected_Objects_Single_Entry.
8634 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
8635 * s-tposen.adb (Initialize_Protection_Entry): Remove
8636 Entry_Queue_Max parameter.
8637 * s-tposen.ads: Remove the types use to store the entry queue
8639 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
8641 2017-01-06 Yannick Moy <moy@adacore.com>
8643 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
8644 behavior of function, to also accept out of range positions
8645 and raise Constraint_Error in such case, and to copy sloc from
8646 literal if No_Location passed as location.
8647 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
8648 of functions to raise Constraint_Error in case of value not in
8651 2017-01-06 Tristan Gingold <gingold@adacore.com>
8653 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
8654 Invalidate_Stack_Cache.
8656 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
8658 * s-os_lib.adb: Minor fix to the signature of Readlink.
8660 2017-01-06 Javier Miranda <miranda@adacore.com>
8662 * sem_ch6.adb (Conforming_Types): Handle another
8663 confusion between views in a nested instance with an actual
8664 private type whose full view is not in scope.
8666 2017-01-06 Arnaud Charlet <charlet@adacore.com>
8668 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
8669 mark a rewritten if statement as explicit (Comes_From_Source).
8671 2017-01-06 Gary Dismukes <dismukes@adacore.com>
8673 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
8675 2017-01-06 Tristan Gingold <gingold@adacore.com>
8677 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
8679 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8681 * sem_case.adb: Minor reformatting.
8683 2017-01-06 Thomas Quinot <quinot@adacore.com>
8685 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
8687 2017-01-06 Justin Squirek <squirek@adacore.com>
8689 * aspects.adb: Register aspect in Canonical_Aspect.
8690 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
8691 into respective tables.
8692 * einfo.ads, einfo.adb: Add a new attribute for
8693 handling the parameters for Pragma_Max_Entry_Queue
8694 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
8695 for accessing and setting were added as well.
8696 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
8697 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
8698 declaration for pramga arguments and store them in the protected
8700 (Make_Initialize_Protection): Pass a reference to
8701 the Entry_Max_Queue_Lengths_Array in the protected type node to
8703 * rtsfind.adb: Minor grammar fix.
8704 * rtsfind.ads: Register new types taken from the
8705 runtime libraries RE_Protected_Entry_Queue_Max and
8706 RE_Protected_Entry_Queue_Max_Array
8707 * s-tposen.adb, s-tpoben.adb
8708 (Initialize_Protection_Entry/Initialize_Protection_Entries):
8709 Add extra parameter and add assignment to local object.
8710 * s-tposen.ads, s-tpoben.ads: Add new types to
8711 store entry queue maximums and a field to the entry object record.
8712 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
8713 for Aspect_Max_Queue_Length.
8714 (Check_Aspect_At_Freeze_Point):
8715 Add aspect to list of aspects that don't require delayed analysis.
8716 * sem_prag.adb (Analyze_Pragma): Add case statement for
8717 Pragma_Max_Queue_Length, check semantics, and register arugments
8718 in the respective entry nodes.
8719 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
8720 and Has_Max_Queue_Length
8721 * snames.ads-tmpl: Add constant for the new aspect-name
8722 Name_Max_Queue_Length and corrasponding pragma.
8724 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8726 * exp_util.adb (Is_Controlled_Function_Call):
8727 Reimplemented. Consider any node which has an entity as the
8728 function call may appear in various ways.
8730 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8732 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
8733 an unchecked type conversion when performing a view conversion
8734 to/from a private type. In all other cases use a regular type
8735 conversion to ensure that any relevant checks are properly
8738 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
8740 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
8742 2017-01-06 Ed Schonberg <schonberg@adacore.com>
8744 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
8745 error on case expression that is an entity, when coverage is
8746 incomplete and entity has a static value obtained by local
8748 (Handle_Static_Predicate): New procedure, subsidiary of
8749 Check_Choices, to handle case alternatives that are either
8750 subtype names or subtype indications involving subtypes that
8751 have static predicates.
8753 2017-01-06 Thomas Quinot <quinot@adacore.com>
8755 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
8756 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
8758 2017-01-06 Bob Duff <duff@adacore.com>
8760 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
8761 Elaborate_All(P) to P itself. That could happen in obscure cases,
8762 and always introduced a cycle (P body must be elaborated before
8764 * lib-writ.ads: Comment clarification.
8765 * ali-util.ads: Minor comment fix.
8766 * ali.adb: Minor reformatting.
8768 2017-01-06 Tristan Gingold <gingold@adacore.com>
8770 * a-exexpr-gcc.adb: Improve comment.
8772 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
8774 * s-linux-mips.ads: Use correct signal and errno constants.
8775 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
8777 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
8779 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
8780 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
8783 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
8785 * gnatvsn.ads: Bump copyright year.
8787 2017-01-01 Jakub Jelinek <jakub@redhat.com>
8789 * gnat_ugn.texi: Bump @copying's copyright year.
8790 * gnat_rm.texi: Likewise.
8792 Copyright (C) 2017 Free Software Foundation, Inc.
8794 Copying and distribution of this file, with or without modification,
8795 are permitted in any medium without royalty provided the copyright
8796 notice and this notice are preserved.