1 2018-12-11 Dmitriy Anisimkov <anisimko@adacore.com>
3 * libgnat/g-socket.ads, libgnat/g-socket.adb: Fix duration
4 computations to be compatible with the type for socket timeouts
7 2018-12-11 Gary Dismukes <dismukes@adacore.com>
9 * exp_util.ads: Use preferred U.S. spelling of "honored".
10 * sem_spark.adb: Remove extra whitespace.
12 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
14 * exp_util.adb (Insert_Action): Add new formal parameter
16 (Insert_Actions): Add new formal parameter Spec_Expr_OK. Update
17 all calls to Insert_Actions where relevant. Honour an insertion
18 from a spec expression context when requested by the caller.
19 * exp_util.ads (Insert_Action): Add new formal parameter
21 (Insert_Actions): Add new formal parameter Spec_Expr_OK.
22 * freeze.adb (Add_To_Result): Force the insertion of the freeze
23 node even when the context is a spec expression.
25 2018-12-11 Jerome Lambourg <lambourg@adacore.com>
27 * vxaddr2line.adb, vxlink-bind.adb, vxlink-bind.ads,
28 vxlink-link.adb, vxlink-link.ads, vxlink-main.adb, vxlink.adb,
30 * gcc-interface/Make-lang.in, gcc-interface/Makefile.in: Remove
33 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
35 * exp_aggr.adb, exp_ch7.adb, gnat1drv.adb, sem_ch10.adb,
36 sem_ch13.adb, sem_ch6.adb, sem_ch7.adb, sem_util.adb: Minor
39 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
41 * fe.h (Is_Atomic_Object): Declare.
42 (Is_Volatile_Object): Likewise.
43 * gcc-interface/trans.c (atomic_or_volatile_copy_required_p):
45 (Call_to_gnu): Generate a copy for an actual parameter passed by
46 reference if the conditions set forth by RM C.6(19) are met and
47 specificially deal with an atomic actual parameter.
49 2018-12-11 Piotr Trojanek <trojanek@adacore.com>
51 * sem_util.adb (Is_Subprogram_Stub_Without_Prior_Declaration):
52 Return False on stubs that complete a generic subprogram.
53 * sem_util.ads: Update corresponding comment.
55 2018-12-11 Ed Schonberg <schonberg@adacore.com>
57 * sem_ch4.adb (Analyze_Allocator): In GNATprove mode build a
58 subtype declaration if the allocator has a subtype indication
59 with a constraint. This allows additional proofs to be applied
60 to allocators that designate uninitialized constrained objects.
62 2018-12-11 Yannick Moy <moy@adacore.com>
64 * sem_util.adb (Has_Full_Default_Initialization): Consider
65 access types as having full default initialization.
67 2018-12-11 Yannick Moy <moy@adacore.com>
69 * gnat1drv.adb (Gnat1drv): Issue specific error message in
70 GNATprove mode when multiple file names on the command line.
71 * osint.adb, osint.ads (Dump_Command_Line_Source_File_Names):
72 New procedure to print file names on the command line.
74 2018-12-11 Javier Miranda <miranda@adacore.com>
76 * exp_aggr.adb (Convert_To_Assignments): When gnerating C, do
77 not declare a temporary to initialize an aggregate assigned to
78 Out or In_Out parameters whose type has no discriminants. This
79 avoids stack overflow errors at runtime.
81 2018-12-11 Ed Schonberg <schonberg@adacore.com>
83 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Extend
84 algorithm to cover subprograms generated in nested loops and in
85 exception handlers, in order to build an explicit elaboration
86 procedure in more complex cases.
88 2018-12-11 Jerome Lambourg <lambourg@adacore.com>
90 * Makefile.rtl, gcc-interface/Makefile.in: Remove crtbe bits for
92 * libgnat/system-vxworks-arm-rtp-smp.ads,
93 libgnat/system-vxworks-arm-rtp.ads,
94 libgnat/system-vxworks-arm.ads,
95 libgnat/system-vxworks-e500-kernel.ads,
96 libgnat/system-vxworks-e500-rtp-smp.ads,
97 libgnat/system-vxworks-e500-rtp.ads,
98 libgnat/system-vxworks-ppc-kernel.ads,
99 libgnat/system-vxworks-ppc-rtp-smp.ads,
100 libgnat/system-vxworks-ppc-rtp.ads,
101 libgnat/system-vxworks-ppc.ads,
102 libgnat/system-vxworks-x86-kernel.ads,
103 libgnat/system-vxworks-x86-rtp-smp.ads,
104 libgnat/system-vxworks-x86-rtp.ads,
105 libgnat/system-vxworks7-aarch64-rtp-smp.ads,
106 libgnat/system-vxworks7-aarch64.ads,
107 libgnat/system-vxworks7-arm-rtp-smp.ads,
108 libgnat/system-vxworks7-e500-kernel.ads,
109 libgnat/system-vxworks7-e500-rtp-smp.ads,
110 libgnat/system-vxworks7-e500-rtp.ads,
111 libgnat/system-vxworks7-ppc-kernel.ads,
112 libgnat/system-vxworks7-ppc-rtp-smp.ads,
113 libgnat/system-vxworks7-ppc-rtp.ads,
114 libgnat/system-vxworks7-ppc64-kernel.ads,
115 libgnat/system-vxworks7-ppc64-rtp-smp.ads,
116 libgnat/system-vxworks7-x86-kernel.ads,
117 libgnat/system-vxworks7-x86-rtp-smp.ads,
118 libgnat/system-vxworks7-x86-rtp.ads,
119 libgnat/system-vxworks7-x86_64-kernel.ads,
120 libgnat/system-vxworks7-x86_64-rtp-smp.ads: Remove pragma
121 Linker_Options for --specs.
122 * vx_crtbegin.c, vx_crtbegin.inc, vx_crtbegin_array.c,
123 vx_crtbegin_attr.c, vx_crtend.c, vxworks-gnat-crtbe-link.spec:
126 2018-12-11 Ed Schonberg <schonberg@adacore.com>
128 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations,
129 Freeze_Entity_Checks): Process aspect Predicate in the same
130 fashion as aspect Dynamic_Predicate.
132 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
134 * gcc-interface/trans.c (elaborate_all_entities_for_package):
135 Skip aliasing subprograms.
137 2018-12-11 Bob Duff <duff@adacore.com>
139 * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatmetric
140 documentation for the Libadalang-based version.
142 2018-12-11 Javier Miranda <miranda@adacore.com>
144 * exp_aggr.adb (In_Object_Declaration): Removed.
145 (Is_CCG_Supported_Aggregate): New subprogram that replaces
146 In_Object_Declaration extending its functionality to indicate if
147 an aggregate is in a context supported by the CCG backend.
149 2018-12-11 Bob Duff <duff@adacore.com>
151 * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatstub
152 documentation for the Libadalang-based version.
153 * gnat_ugn.texi: Regenerate.
155 2018-12-11 Ed Schonberg <schonberg@adacore.com>
157 * sem_ch13.adb (Push_Type, Pop_Type): New procedures, used for
158 analysis of aspect expressions for record types, whose
159 components (not only discriminants) may be referenced in aspect
161 (Analyze_Aspect_Specifications, Analyze_Aspects_At_Freeze_Point,
162 Analyze_Aspect_At_End-Of_Declarations,
163 Resolve_Aspect_Expressions): Use the new subprograms.
164 (Check_Aspect_At_End_Of_Declarations): Improve error message.
165 (Build_Predicate_Functions): Do not build their bodies in a
167 (Is_Derived_Type_With_Constraint): New subprogram to uncover and
168 reject aspect specificationss on types that appear after the
170 * sem_ch13.ads (Push_Scope_And_Install_Discriminants,
171 Uninstall_Discriminants_And_Pop_Scope): Remove.
172 * sem_ch6.adb, sem_ch6.ads (Fully_Conformant_Expressions):
173 Additional parameter to improve error message on illegal aspect
174 specifications whose resolution differ between aspect
175 specification and freeze point.
176 * freeze.adb: Remove references to
177 Install/Uninstall_Discriminants.
179 2018-12-11 Pierre-Marie de Rodat <derodat@adacore.com>
181 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
182 Document the -fgnat-encodings switch.
183 * gnat_ugn.texi: Regenerate.
185 2018-12-11 Justin Squirek <squirek@adacore.com>
187 * sem_ch10.adb (Analyze_Subunit): Modify conditional to fully
188 remove parent contexts from library-level subprogram bodies in
189 addition to package bodies.
191 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
193 * exp_prag.adb (Expand_Pragma_Initial_Condition): Do not
194 generate an Initial_Condition procedure and a call to it when
195 the associated pragma is ignored.
196 * sem_ch10.adb (Analyze_Compilation_Unit): Minor cleanup.
198 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
200 * fe.h (Debug_Generated_Code): Declare.
201 * gcc-interface/gigi.h (enum inline_status_t): Rename
202 is_disabled to is_default, is_enabled to is_requested and add
204 * gcc-interface/decl.c (inline_status_for_subprog): New function.
205 (gnat_to_gnu_entity) <E_Subprogram_Type>: Use it to get the
206 inlining status of the subprogram.
207 * gcc-interface/trans.c (gigi): Adjust to above renaming.
208 (build_raise_check): Likewise.
209 (Compilation_Unit_to_gnu): Likewise.
210 (gnat_to_gnu): Likewise.
211 * gcc-interface/utils.c (create_subprog_decl): Likewise. Deal
212 with is_prescribed status by setting
213 DECL_DISREGARD_INLINE_LIMITS. Do not set the
214 DECL_NO_INLINE_WARNING_P flag if Debug_Generated_Code is true.
216 2018-12-03 Gary Dismukes <dismukes@adacore.com>
218 * sem_aux.adb (Object_Type_Has_Constrained_Partial_View): Return
219 True for an untagged discriminated formal derived type when
220 referenced within a generic body (augments existing test for
221 formal private types).
222 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Type): If the
223 prefix of the name is a qualified expression, retrieve the
224 operand of that. Add a test of whether the (possible)
225 dereference prefix is a variable, and also test whether that
226 prefix might just be of an access type (occurs in some implicit
227 dereference cases) rather than being an explicit dereference.
228 Retrieve the Original_Node of the object name's main prefix and
229 handle the possibility of that being a qualified expression.
230 Remove special-case code for explicit dereferences that don't
231 come from source. Add test for the renaming not being within a
232 generic body for proper determination of whether a formal access
233 type is known to be constrained (it is within a generic spec,
234 but not in the body). Fix an existing incorrect test for
235 renaming of a discriminant-dependent component of a untagged
236 generic formal type being within a generic body, adding test of
237 taggedness and calling In_Generic_Body (now properly checks for
238 cases where the renaming is in a nongeneric body nested within a
239 generic). Return False in cases where the selector is not a
240 component (or discriminant), which can occur for
241 prefixed-notation calls.
243 2018-12-03 Ed Schonberg <schonberg@adacore.com>
245 * sem_res.adb (Apply_Check): For array types, apply a length
246 check rather than a qualification, to avoid spurious errors when
247 the value of a dependend expression has a matching length but
248 different bounds from those of the type of the contect.
250 2018-12-03 Hristian Kirtchev <kirtchev@adacore.com>
252 * libgnat/a-calend.adb: Update the number of leap seconds. Add
253 the hard time values for year 2015 and 2016.
255 2018-12-03 Gary Dismukes <dismukes@adacore.com>
257 * exp_ch3.adb, libgnarl/s-taasde.adb, libgnarl/s-taenca.adb,
258 libgnarl/s-tarest.adb, libgnarl/s-tasini.adb,
259 libgnarl/s-taskin.ads, libgnarl/s-tasren.adb,
260 libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb: Spelling fixes and
263 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
265 * exp_aggr.adb (Convert_To_Positional): Use
266 Static_Array_Aggregate to decide whether to set
267 Compile_Time_Known_Aggregate on an already flat aggregate.
268 (Expand_Array_Aggregate): Remove test on
269 Compile_Time_Known_Aggregate that turns out to be dead and
271 (Is_Static_Component): New predicate extracted from...
272 (Static_Array_Aggregate): ...here. Test neither Is_Tagged_Type
273 nor Is_Controlled for the type, but test whether the component
274 type has discriminants. Use the Is_Static_Component predicate
275 consistently for the positional and named cases.
277 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
279 * freeze.adb (Freeze_Entity): Do not freeze the partial view of
280 a private subtype if its base type is also private with delayed
281 freeze before the full type declaration of the base type has
283 * sem_ch7.adb (Preserve_Full_Attributes): Add assertion on
286 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
288 * exp_ch3.adb (Build_Record_Init_Proc): Inherit an
289 initialization procedure if it is present, even if it is null.
291 2018-12-03 Patrick Bernardi <bernardi@adacore.com>
293 * libgnarl/s-taskin.ads (ATC_Level_Base): Redefine to span from
294 -1 to Max_ATC_Nesting so that 0 represents no ATC nesting and -1
295 represented a completed task. To increase readability, new
296 constants are introduced to represent key ATC nesting levels.
297 Consequently, Level_No_Pending_Abort replaces
298 ATC_Level_Infinity. ATC_Level related definitions now
300 (Ada_Task_Control_Block): The default initialization of
301 components ATC_Nesting_Level and Pending_ATC_Level now use new
302 ATC_Level_Base constants. Comments improved
303 * libgnarl/s-taskin.adb (Initialize): Improve the initialisation
304 of the first element of the Entry_Calls array to facilitate
306 * libgnarl/s-taasde.ads: Update comment.
307 * libgnarl/s-taasde.adb, libgnarl/s-taenca.adb,
308 libgnarl/s-tasren.adb, libgnarl/s-tassta.adb,
309 libgnarl/s-tasuti.ads, libgnarl/s-tasuti.adb: Use new
310 ATC_Level_Base constants.
311 * libgnarl/s-tarest.adb (Create_Restricted_Task): Improve the
312 initialisation of the first element of the task's Entry_Calls
313 array to facilitate better maintenance.
314 * libgnarl/s-tasini.ads (Locked_Abort_To_Level): Update
315 signature to accept ATC_Level_Base.
316 * libgnarl/s-tasini.adb (Locked_Abort_To_Level): Update
317 signature to accept ATC_Level_Base. Use new ATC_Level_Base
318 constants and only modify the aborting task's Entry_Calls array
319 if any entry call is happening.
320 * libgnarl/s-tposen.adb (Protected_Single_Entry_Call): Reference
321 the first element of the task's Entry_Calls array via 'First
322 attribute to facilitate better maintenance.
324 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
326 * einfo.adb (Write_Entity_Info): Don't take Scope of Standard
328 * sem_ch4.adb (Remove_Abstract_Operations): Add missing blank
329 lines to -gnatdv output.
330 * sem_type.adb (Write_Overloads): Take Entity of entity names
333 2018-12-03 Hristian Kirtchev <kirtchev@adacore.com>
335 * checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch3.adb,
336 exp_util.adb, exp_util.ads, repinfo.adb, sem_attr.adb,
337 sem_ch3.adb, sem_res.adb, sem_util.adb: Minor reformatting.
339 2018-12-03 Ed Schonberg <schonberg@adacore.com>
341 * sem_ch3.adb (Complete_Private_Subtype): Enhance comment.
343 2018-12-03 Olivier Hainque <hainque@adacore.com>
345 * gcc-interface/lang.opt (fopenacc): New option for Ada.
346 * gcc-interface/misc.c (gnat_handle_option): Handle it.
347 * gcc-interface/trans.c (struct loop_info_d): Add OMP
349 (Iterate_Acc_Clause_Arg, Acc_gnat_to_gnu): New functions,
350 helpers for OpenACC pragmas processing in Pragma_to_gnu.
351 (Acc_Var_to_gnu, Acc_Reduc_Var_to_gnu, Acc_Reduc_to_gnu):
353 (Acc_Size_Expr_to_gnu, Acc_Size_List_to_gnu): Likewise.
354 (Pragma_Acc_Data_to_gnu): Likewise.
355 (Pragma_to_gnu): Handle Pragma_Acc_Loop, Pragma_Acc_Data,
356 Pragma_Acc_Kernels and Pragma_Acc_Parallel.
357 (Acc_Loop_to_gnu, Regular_Loop_to_gnu): New functions. Helpers
359 (Loop_Statement_to_gnu): Rework to handle OpenACC loops.
361 2018-12-03 Olivier Hainque <hainque@adacore.com>
363 * gcc-interface/targtyps.c (MALLOC_OBSERVABLE_ALIGNMENT): Set to
366 2018-12-03 Ed Schonberg <schonberg@adacore.com>
368 * sem_res.adb (Set_Slice_Subtype): The index type of a slice is
371 2018-11-26 Matthias Klose <doko@ubuntu.com>
374 * libgnarl/s-linux__alpha.ads: Define SIGSYS.
376 2018-11-19 Alexandre Oliva <oliva@adacore.com>
379 * gcc-interface/config-lang.in (lang_requires): Set to "c c++"
380 when gnattools wants it.
382 2018-11-19 Eric Botcazou <ebotcazou@adacore.com>
384 * gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
386 2018-11-15 Eric Botcazou <ebotcazou@adacore.com>
388 * gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
389 -fnon-call-exceptions passed on the command line in -gnatp mode.
391 2018-11-14 Ed Schonberg <schonberg@adacore.com>
393 * exp_util.ads, exp_util.adb: Change the profile of
394 Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
395 of the right opersnd. This prevents unnesting anomalies when
396 that operand contains uplevel references.
397 * exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
398 * exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.
400 2018-11-14 Patrick Bernardi <bernardi@adacore.com>
402 * libgnarl/a-intnam__linux.ads: Add SIGSYS.
403 * libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
404 libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
405 libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
406 libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
407 SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
408 implementation specific.
409 * libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
410 SIGSYS. Move SIG32, SIG33 and SIG34 from the unmasked list to
413 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
415 * exp_aggr.adb (Is_Static_Element): New predicate extracted
417 (Check_Static_Components): ...here. Call Is_Static_Element on
418 each element of the component association list, if any.
419 (Flatten): Duplicate the expression of an others choice only if
420 it is static or is an aggregate which can itself be flattened.
422 2018-11-14 Olivier Hainque <hainque@adacore.com>
424 * sigtramp-vxworks-target.inc: Fix stack checking test errors in
425 ACATS, now that GCC can emit CFI rules referring to sp in
426 absence of a frame pointer.
428 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
430 * exp_aggr.adb (Check_Static_Components): Remove dead test.
431 (Flatten): Likewise. Move comment around.
433 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
435 * sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
436 SPARK-related global state at the start of the routine. Set the
437 Ghost mode of the completed spec if any. Restore the saved
438 Ghost and SPARK-related global state on exit from the routine.
440 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
442 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
443 (-gnatR): Document new -gnatR4 level.
444 * gnat_ugn.texi: Regenerate.
445 * opt.ads (List_Representation_Info): Bump upper bound to 4.
446 * repinfo.adb: Add with clause for GNAT.HTable.
447 (Relevant_Entities_Size): New constant.
448 (Entity_Header_Num): New type.
449 (Entity_Hash): New function.
450 (Relevant_Entities): New set implemented with GNAT.HTable.
451 (List_Entities): Also list compiled-generated entities present
452 in the Relevant_Entities set. Consider that the Component_Type
453 of an array type is relevant.
454 (List_Rep_Info): Reset Relevant_Entities for each unit.
455 * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4.
456 * switch-m.adb (Normalize_Compiler_Switches): Likewise
457 * usage.adb (Usage): Likewise.
459 2018-11-14 Javier Miranda <miranda@adacore.com>
461 * exp_disp.adb (Expand_Interface_Thunk): Extend handling of
462 renamings of the predefined equality primitive.
463 (Make_Secondary_DT): When calling Expand_Interface_Thunk() pass
464 it the primitive, instead of its Ultimate_Alias; required to
465 allow the called routine to identify renamings of the predefined
468 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
470 * freeze.adb (Check_Pragma_Thread_Local_Storage): New routine. A
471 variable with suppressed initialization has no initialization
472 for purposes of the pragma.
473 (Freeze_Object_Declaration): Remove variable
474 Has_Default_Initialization as it is no longer used. Use routine
475 Check_Pragma_Thread_Local_Storage to verify the semantics of
476 pragma Thread_Local_Storage.
478 2018-11-14 Ed Schonberg <schonberg@adacore.com>
480 * sem_res.adb (Resolve_If_Expression): Verify that the subtypes
481 of all dependent expressions obey the constraints of the
482 expected type for the if-expression.
483 (Analyze_Expression): Only add qualificiation to the dependent
484 expressions when the context type is constrained. Small
485 adjustment to previous patch.
487 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
489 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't
490 register a compile-time warning or error for 'Alignment or 'Size
491 of an entity declared in a generic unit.
493 2018-11-14 Justin Squirek <squirek@adacore.com>
495 * sem_ch8.adb (Use_One_Package): Add test for out-of-scope
498 2018-11-14 Ed Schonberg <schonberg@adacore.com>
500 * exp_ch3.adb: (Expand_N_Object_Declaration): If the expression
501 is a limited aggregate its resolution is delayed until the
502 object declaration is expanded.
503 * sem_ch3.adb: (Analyze_Object_Declaration): If the expression
504 is a limited aggregate and the declaration has a following
505 address clause indicate that resolution of the aggregate (which
506 must be built in place) must be delayed.
508 2018-11-14 Bob Duff <duff@adacore.com>
510 * sem_attr.adb (To_Address): Simplify setting of
511 Is_Static_Expression. Remove second (unconditional) call to
512 Set_Is_Static_Expression -- surely it's not static if the
513 operand is not. Initialize Static on declaration. Do not try
514 to fold 'To_Address, even though it's static.
515 * exp_attr.adb (To_Address): Preserve Is_Static_Expression.
516 * sinfo.ads, sem_eval.ads, sem_eval.adb (Is_Static_Expression,
517 Is_OK_Static_Expression, Raises_Constraint_Error): Simplify
518 documentation. There was too much repetition and redundancy.
520 2018-11-14 Ed Schonberg <schonberg@adacore.com>
522 * sem_ch3.adb (Analyze_Object_Declaration): Use the
523 Actual_Subtype to preserve information about a constant
524 initialized with a non-static entity that is known to be valid,
525 when the type of the entity has a narrower range than that of
526 the nominal subtype of the constant.
527 * checks.adb (Determine_Range): If the expression is a constant
528 entity that is known-valid and has a defined Actual_Subtype, use
529 it to determine the actual bounds of the value, to enable
530 additional optimizations.
532 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
534 * back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
535 exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
536 freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
537 sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.
539 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
541 * exp_ch4.adb (Find_Aliased_Equality): New routine.
542 (Find_Equality): Reimplemented.
543 (Is_Equality): New routine.
545 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
547 * ghost.adb (Ghost_Entity): New routine.
548 (Mark_And_Set_Ghost_Assignment): Reimplemented.
549 * sem_ch5.adb (Analyze_Assignment): Assess whether the target of
550 the assignment is an ignored Ghost entity before analyzing the
552 * sem_ch8.adb (Find_Direct_Name): Update the subprogram
553 signature. Do not generate markers and references when they are
555 (Nvis_Messages): Do not execute when errors are not desired.
556 (Undefined): Do not emit errors when they are not desired.
557 * sem_ch8.ads (Find_Direct_Name): Update the subprogram
558 signature and comment on usage.
559 * sem_util.adb (Ultimate_Prefix): New routine.
560 * sem_util.ads (Ultimate_Prefix): New routine.
562 2018-11-14 Justin Squirek <squirek@adacore.com>
564 * sem_ch7.adb (Uninstall_Declarations): Add conditional to avoid
565 uninstalling potential visibility during freezing on enumeration
568 2018-11-14 Jerome Lambourg <lambourg@adacore.com>
570 * env.c: Do not include crt_externs.h on iOS, as it does not
571 exist there. This is also true for the iPhone Simulator SDK.
573 2018-11-14 Ed Schonberg <schonberg@adacore.com>
575 * exp_ch7.adb (Check_Unnesting_In_Declarations): New procedure
576 to transform blocks that appear in the declarative part of a
577 package body into subprograms if they contain generated
578 subprograms (such as finalization routines). Needed to generate
579 the proper upward references in unnesting mode.
581 2018-11-14 Ed Schonberg <schonberg@adacore.com>
583 * freeze.adb (Freeze_Fixed_Point_Type): If the given low bound
584 of the type is less than the nearest model number, do not expand
585 the range of the type to include the model number below the
586 bound. Similar adjustment if the upper bound is larger than the
587 nearest model number.
589 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
591 * checks.adb (Install_Primitive_Elaboration_Check): Do not
592 create the check when exceptions cannot be used.
593 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not raise
594 Program_Errror when exceptions cannot be used. Analyze the
595 generated code with all checks suppressed.
596 * exp_ch7.adb (Build_Finalizer): Remove the declaration of
598 (Make_Deep_Array_Body): Remove the declaration of Exceptions_OK.
599 (Make_Deep_Record_Body): Remove the declaration of
601 (Process_Transients_In_Scope): Remove the declaration of
603 * exp_util.adb (Exceptions_In_Finalization_OK): Renamed to
605 * exp_util.ads (Exceptions_In_Finalization_OK): Renamed to
608 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
610 * exp_ch4.adb (Expand_N_Op_Eq): Remove duplicated code and use
611 routine Find_Equality instead.
612 (Find_Equality): New routine.
614 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
616 * sem_util.adb (First_From_Global_List): Do not expect
617 N_Selected_Component in the Global contract; simplify assertion
620 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
622 * sem_ch12.adb (Instantiate_Object): Set
623 Corresponding_Generic_Association on generic actuals with
625 * sinfo.ads (Corresponding_Generic_Association): Update comment.
627 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
629 * exp_ch4.adb (Expand_Concatenate): Use the proper routine to
630 set the need for debug info.
631 * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Use the
632 proper routine to set the need for debug info.
633 * exp_prag.adb (Expand_Pragma_Initial_Condition): Use the proper
634 routine to set the need for debug info.
635 * exp_util.adb (Build_DIC_Procedure_Declaration): Use the proper
636 routine to set the need for debug info.
637 (Build_Invariant_Procedure_Declaration): Use the proper routine
638 to set the need for debug info.
639 * ghost.adb (Record_Ignored_Ghost_Node): Add statements as a
640 whole class to the list of top level ignored Ghost nodes.
641 * sem_util.adb (Set_Debug_Info_Needed): Do not generate debug
642 info for an ignored Ghost entity.
644 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
646 * bindgen.adb, exp_cg.adb, repinfo.adb, sprint.adb: Minor reuse
647 Cancel_Special_Output where possible.
649 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
651 * exp_dbug.ads, sem_util.ads: Minor fixes in comments.
653 2018-11-14 Arnaud Charlet <charlet@adacore.com>
655 * adabkend.adb (Scan_Back_End_Switches): Handle -gx switches
658 2018-11-13 Eric Botcazou <ebotcazou@adacore.com>
660 * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
661 for the runtime on platforms where System.Machine_Overflow is true.
663 2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
665 * fe.h (Suppress_Checks): Declare.
666 * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
667 only if checks are not suppressed and -faggressive-loop-optimizations
669 * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
670 warned_aggressive_loop_optimizations fields.
671 (gigi): Do not clear warn_aggressive_loop_optimizations here.
672 (Raise_Error_to_gnu): Do not set has_checks.
673 (gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
676 2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
678 * gcc-interface/decl.c (components_to_record): Remove obsolete kludge.
679 * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the
680 new type but do not take into account the setting on the old type for
681 the new fields. Rename a local variable.
682 (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at
684 (create_field_decl): Tweak comment.
686 2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
688 * gcc-interface/utils.c (unchecked_convert): Use local variables for
689 the biased and reverse SSO attributes of both types.
690 Further extend the processing of integral types in the presence of
691 reverse SSO to all scalar types.
693 2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
695 * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
696 a simple memory constraint in all cases.
698 * gcc-interface/lang-specs.h: Bump copyright year.
700 2018-10-17 David Malcolm <dmalcolm@redhat.com>
702 * gcc-interface/Make-lang.in (selftest-ada): New.
704 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
706 * exp_ch3.adb (Is_Null_Statement_List): New predicate.
707 (Build_Array_Init_Proc): Use it to find out whether the
708 initialization procedure Is_Null_Init_Proc; if so, set
709 Warnings_Off on the parameter.
710 (Build_Init_Procedure): Likewise.
711 (Init_Formals): Use an in/out first parameter only for
712 unconstrained arrays and for records either containing or built
713 for proteced types or task types; use an out parameter in all
715 * fe.h (Is_Init_Proc): Declare.
716 * gcc-interface/decl.c (type_requires_init_of_formal): Do not
717 return true for a discriminant in an unchecked union.
718 (gnat_to_gnu_param): Do not create a PARM_DECL for the Out
719 parameter of an initialization procedure.
721 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
723 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If
724 this is not a definition, retrieve the expression in all cases
725 even if we are just annotating types.
726 * gcc-interface/trans.c (gnat_to_gnu): Also translate Size
727 attribute for constrained types in this mode.
729 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
731 * adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
732 (__gnat_locate_exec): Check that HOST_EXECUTABLE_SUFFIX is not
733 empty before doing a string search for it.
734 * socket.c (ATTRIBUTE_UNUSED): Define.
735 (__gnat_disable_sigpipe): Add ATTRIBUTE_UNUSED on parameter.
736 * terminals.c (ATTRIBUTE_UNUSED): Move around.
737 (__gnat_setup_child_communication): Add ATTRIBUTE_UNUSED on
739 (__gnat_send_header): Add ATTRIBUTE_UNUSED on parameters.
741 2018-10-09 Yannick Moy <moy@adacore.com>
743 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
744 pragmas as null statements in GNATprove mode.
746 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
748 * exp_ch6.adb (Add_Call_By_Copy_Code): Initialize the temporary
749 made for an Out parameter if the formal type has discriminants.
751 2018-10-09 Maroua Maalej <maalej@adacore.com>
753 * sem_spark.adb (Check_Declaration): fix bug related to non
754 access object permissions.
756 2018-10-09 Doug Rupp <rupp@adacore.com>
758 * libgnat/a-ncelfu.ads: Fix name in header to match package.
760 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
762 * exp_disp.adb (Make_Disp_Asynchronous_Select_Spec): Set
763 Warnings_Off on the B out parameter.
765 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
767 * einfo.ads: Small comment fix.
769 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
771 * sem_ch7.adb (Has_Referencer): Add comment for the
772 N_Freeze_Entity case. Do not rely on
773 Has_Referencer_Of_Non_Subprograms to clear the Is_Public flag on
776 2018-10-09 Ed Schonberg <schonberg@adacore.com>
778 * exp_unst.adb (In_Synchronized_Call): Handle properly private
779 types whose full views are synchronized types, in order to
780 recognize generated subprograms whose bodies must be considered
781 reachable even if no direct calls to them are visible in the
784 2018-10-09 Ed Schonberg <schonberg@adacore.com>
786 * exp_ch4.adb (Expand_Modular_Op): When expanding an operation
787 on nonbinary modular types, convert the opersnds to an integer
788 type that is large enough to hold the modulus of the type, which
789 may be larger than Integer'Last.
791 2018-10-09 Ed Schonberg <schonberg@adacore.com>
793 * exp_unst.adb (Unnest_Subprogram): When an uplevel reference
794 is to an unconstrained formal, the 'Access reference that is
795 created to initialize the corresponding component of the
796 activation record must be wrapped in an unchecked conversion to
797 the generated type of the component. Otherwise, spurious suvtype
798 conformance errors will be generated when the code is within an
799 instantiation and the type of the formal is a formal type of the
800 enclosing generic. Note that during unnesting there is no simple
801 way to determine that the code appears within an instance
802 because ther is no scope stack.
804 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
806 * gcc-interface/decl.c (type_requires_init_of_formal): New
808 (gnat_to_gnu_param): Use it to determine whether a PARM_DECL
809 must be created for an Out parameter passed by copy.
811 2018-10-09 Arnaud Charlet <charlet@adacore.com>
813 * libgnat/a-coboho.ads (Storage_Element): Fix a typo.
815 2018-10-09 Claire Dross <dross@adacore.com>
817 * libgnat/a-cfinve.ads: Remove default value for
818 Max_Size_In_Storage_Elements as it was not supported in SPARK.
820 2018-10-09 Ed Schonberg <schonberg@adacore.com>
822 * exp_ch6.adb (Add_Call_By_Copy_Node,
823 Add_Simple_Call_By_Copy_Node, Expand_Call_Helper): Reset
824 Is_True_Constant on entities used as Out or In_Out parameters in
827 2018-10-09 Ed Schonberg <schonberg@adacore.com>
829 * exp_unst.adb (Unnest_Subprogram): Do not load System to obtain
830 the Address entity unless an activation record is being built.
831 Removes useless with_clauses for System when nested subprograms
832 do not have uplevel references, and therefore do not need
835 2018-10-09 Ed Schonberg <schonberg@adacore.com>
837 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
838 the conformance check on an aspect expression that includes a
839 call to an instance of Unchecked_Conversion, or more generally a
840 call to an intrinsic operation.
842 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
844 * repinfo.adb: Remove with/use clause for Stand.
845 (List_Mechanisms): List the mechanism of functions only.
847 2018-10-09 Bob Duff <duff@adacore.com>
849 * doc/gnat_ugn/gnat_utility_programs.rst: Correct spelling of
850 --eol switch. Document the language-version switches. Update
851 description for --no-exception.
853 2018-10-09 Vasiliy Fofanov <fofanov@adacore.com>
855 * libgnat/s-os_lib.ads (Normalize_Pathname): Fix incorrect
858 2018-10-09 Arnaud Charlet <charlet@adacore.com>
860 * vxlink.adb: Remove pragma Annotate, no longer needed.
862 2018-10-09 Ed Schonberg <schonberg@adacore.com>
864 * checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
865 rather than SPARK_mode in order to preserve the Do_Range_Check
866 flag for verification purposes.
868 2018-10-09 Ed Schonberg <schonberg@adacore.com>
870 * exp_aggr.adb (Expand_Array_Aggregate): If it is not possible
871 to build in place an aggregate with component associations, set
872 the Warnings_Off flag on the generated temporary, to prevent
873 spurious warnings from the backend when compiling with the
874 -Wuninitialized gcc flag.
876 2018-09-30 Alexandre Oliva <oliva@adacore.com>
878 * gcc-interface/lang-specs.h (default_compilers): When given
879 fcompare-debug-second, adjust auxbase like cc1, and pass
881 * gcc-interface/misc.c (flag_compare_debug): Remove variable.
882 (gnat_post_options): Do not set it.
883 * lib-writ.adb (flag_compare_debug): Remove import.
884 (Write_ALI): Do not test it.
886 2018-09-28 Eric Botcazou <ebotcazou@adacore.com>
887 Pierre-Marie de Rodat <derodat@adacore.com>
889 * gcc-interface/decl.c (is_cplusplus_method): Do not require C++
890 convention on Interfaces.
891 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a
892 bona-fide thunk and hand it over to the middle-end.
893 (get_controlling_type): New function.
894 (use_alias_for_thunk_p): Likewise.
895 (thunk_labelno): New static variable.
896 (make_covariant_thunk): New function.
897 (maybe_make_gnu_thunk): Likewise.
898 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the
899 result DECL here instead of...
900 (end_subprog_body): ...here.
902 2018-09-27 Martin Sebor <msebor@redhat.com>
904 * gcc-interface/utils.c (make_packable_type): Introduce a temporary
906 (unchecked_convert): Same.
908 2018-09-26 Elisa Barboni <barboni@adacore.com>
910 * sem_prag.adb (Check_Refined_Global_Item): Improve error
913 2018-09-26 Thomas Quinot <quinot@adacore.com>
915 * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a
916 representation item that is an N_Aspect_Definition, retrieve the
917 entity it applies to using the Entity attribute.
919 2018-09-26 Justin Squirek <squirek@adacore.com>
921 * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition
922 to check for unmarked subprogram references coming from
925 2018-09-26 Arnaud Charlet <charlet@adacore.com>
927 * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches.
929 2018-09-26 Yannick Moy <moy@adacore.com>
931 * errout.ads: Update comment for insertion character '?'.
932 * inline.adb: Use simple insertion character '?' for GNATprove
934 * sem_res.adb (Resolve_Call): Issue an info message on inlining
937 2018-09-26 Ed Schonberg <schonberg@adacore.com>
939 * checks.adb (Apply_Type_Conversion_Checks): Do not generate a
940 range check on the expression of the conversion if it involves a
941 fixed-point type, as such conversions are handled specially
943 * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from
944 Fixed to Integer, use the base type of the expression to ensure
945 that the caller will generate the proper constraint check when
948 2018-09-26 Maroua Maalej <maalej@adacore.com>
950 * sem_spark.adb (Check_Loop_Statement): Fix a bug related to
951 loop exit environment.
952 (Check_Statement): fixing a bug when comparing the source and
953 target in an assignment statement.
955 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
957 * sem_ch12.adb (Instantiate_Package_Body): Capture and restore
958 the full compilation context.
959 (Instantiate_Subprogram_Body): Capture and restore the full
962 2018-09-26 Yannick Moy <moy@adacore.com>
964 * debug.adb: Add use for -gnatd_f switch.
965 * inline.adb (Cannot_Inline): Only issue info message for
966 failure to inline in GNATprove mode when switch -gnatd_f is
969 2018-09-26 Javier Miranda <miranda@adacore.com>
971 * exp_disp.adb (Expand_Interface_Conversion): No displacement of
972 the pointer needed when the type of the operand is an interface
973 type that maches the target type and we are compiling under
974 configurable runtime. Adding also documentation explaining why
975 this cannot be done when compiling with the full runtime.
976 * exp_intr.adb: Update comment.
978 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
980 * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return.
982 2018-09-26 Ed Schonberg <schonberg@adacore.com>
984 * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when
985 applying a predicate check to prevent spurious errors when
986 private ancestors are involved.
988 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
990 * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the
991 secondary stack does not clash with restriction
993 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that
994 the use of the secondary stack does not clash with restriction
996 * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block
997 prior to analysis in order to either provide a local scope for
998 an iterator, or ensure that the secondary stack is properly
1000 (Check_Call): Account for the case where the tree may be
1001 unanalyzed or contain prior errors.
1002 (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call.
1003 Update all uses of the subprogram.
1004 (Prepare_Loop_Statement): New routine.
1006 2018-09-26 Javier Miranda <miranda@adacore.com>
1008 * sem_res.adb (Resolve_Actuals): If the formal is a class-wide
1009 type conversion then do not skip resolving and expanding the
1010 conversion; required to displace the pointer to the object and
1011 reference the dispatch table associated with the target
1014 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1016 * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number
1017 of key-value pairs in the hash table only when adding a brand
1020 2018-09-26 Sergey Rybin <rybin@adacore.com>
1022 * doc/gnat_ugn/gnat_utility_programs.rst: Add note about
1023 processing of aggregate projects in gnatmetric and gnatstub.
1025 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1027 * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
1028 opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
1029 sinfo.ads, snames.ads-tmpl: Minor reformatting.
1031 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1033 * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of
1035 * impunit.adb: Add unit GNAT.Sets to the list of predefined
1037 * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking
1039 * libgnat/g-sets.adb: New unit.
1040 * libgnat/g-sets.ads: New unit.
1041 * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to
1042 allow for small sets. Update all occurrences of Table_Locked to
1044 (Ensure_Unlocked): Query the number of iterators.
1045 (Find_Node): Use the supplied equality.
1046 (Is_Empty): New routine.
1047 (Lock): Update the number of iterators.
1048 (Prepend_Or_Replace): Use the supplied equality.
1049 (Size): Update the return type.
1050 (Unlock): Update the number of iterators.
1051 * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked
1052 to Iterated. Rename formal subprogram Equivalent_Keys to "=".
1053 (Bucket_Range_Type, Pair_Count_Type): Remove types.
1054 (Not_Created, Table_Locked, Iterator_Exhausted): Remove
1056 (Hash_Table): Update to store the number of iterators rather
1058 (Is_Empty): New routine.
1059 (Size): Update the return type.
1060 * libgnat/g-lists.adb: Update all occurrences of List_Locked to
1062 (Ensure_Unlocked): Query the number of iterators.
1064 (Lock): Update the number of iterators.
1065 (Size): New routine.
1066 (Unlock): Update the number of iterators.
1067 * libgnat/g-lists.ads: Update all occurrences of List_Locked to
1069 (Element_Count_Type): Remove type.
1070 (Not_Created, Table_Locked, Iterator_Exhausted): Remove
1072 (Linked_List): Update type to store the number of iterators
1075 (Size): New routine.
1076 * libgnat/gnat.ads (Bucket_Range_Type): New type.
1077 (Iterated, Iterator_Exhausted, and Not_Created): New exceptions.
1079 2018-09-26 Javier Miranda <miranda@adacore.com>
1081 * checks.adb (Install_Null_Excluding_Check): Do not add
1082 null-excluding checks when the tree may not be fully decorated.
1083 This patch cascade errors.
1085 2018-09-26 Gary Dismukes <dismukes@adacore.com>
1087 * sem_ch3.adb (Analyze_Object_Declaration): Remove test for
1088 Comes_From_Source, which prevented implicit conversions from
1089 being applied to anonymous access-to-subprogram formals in
1090 constant declartions that arise from instance associations for
1091 generic formal objects. Add RM and AARM references to comment.
1093 2018-09-26 Olivier Hainque <hainque@adacore.com>
1095 * opt.ads (OpenAcc_Enabled): New flag. False by default. True
1096 when OpenACC pragmas are requested to be honored, when -fopenacc
1097 is found on the command line.
1098 * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if
1099 -fopenacc is seen on the command line.
1100 * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New
1101 flag/predicate on Loop statements which embed an Acc_Kernels,
1102 Acc_Parallel or Acc_Data pragma.
1103 (Is_OpenAcc_Loop): New flag/predicate on Loop statements which
1104 embed an Acc_Loop pragma.
1105 (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for
1107 * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel
1108 and Acc_Kernels pragmas. Nothing to do here, all handled by
1110 * sem_prag.adb (Acc_First, Acc_Next,
1111 Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause,
1112 Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause,
1113 Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang,
1114 Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker,
1115 Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New
1116 helper for Analyze_Pragma, to handle OpenACC pragmas.
1117 (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and
1118 Acc_Kernels pragmas.
1119 * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on
1120 variable entity, action for ...
1121 (Disable_Constants): Helper for Analyze_Loop_Statement, to ...
1122 (Analyze_Loop_Statement): Disable True_Constant on variables
1123 referenced within an OpenACC environment.
1124 * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives
1125 and clauses we can handle. Remove an exraneous whitespace before
1126 columns, preventing line length overflow in the generated spec
1127 with Ids now reaching beyond 999.
1128 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
1129 pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data.
1130 * gnat_rm.texi: Regenerate.
1132 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1134 * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P
1135 is a derived limited record is not itself limited if P is a
1136 derived limited interface.
1138 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1140 * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and
1141 add In_Nested_Instance and
1142 Has_Outer_Referencer_Of_Non_Subprograms parameters. Rename
1143 Has_Non_Subprograms_Referencer variable into
1144 Has_Referencer_Of_Non_Subprograms and initialize it with the new
1145 third parameter. Adjust recursive calls and to the renaming.
1146 Replace test on Top_Level with test on In_Nested_Instance to
1147 decide whether to clear the Is_Public flag on entities.
1148 (Hide_Public_Entities): Adjust call to Has_Referencer.
1150 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1152 * exp_disp.adb (Expand_Interface_Conversion): Use Present test.
1153 (Expand_Interface_Thunk): Propagate debug info setting from
1155 * exp_util.ads (Find_Interface_Tag): Adjust comment.
1156 * exp_util.adb (Find_Interface_Tag): Remove assertions of
1158 * sem_util.adb (Is_Variable_Size_Record): Only look at
1159 components and robustify the implementation.
1160 * fe.h (Find_Interface_Tag): Declare.
1161 (Is_Variable_Size_Record): Likewise.
1163 2018-09-26 Thomas Quinot <quinot@adacore.com>
1165 * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order
1166 and scalar storage order from root type to classwide equivalent
1167 type, to prevent rejection of the equivalent type by the
1170 2018-09-26 Justin Squirek <squirek@adacore.com>
1172 * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional
1173 to freeze called functions within iterator specifications during
1175 (Preanalyze_Range): Minor typo fix.
1177 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1179 * sem_ch6.adb (Analyze_Function_Return): If the return type has
1180 a dynamic_predicate, apply a Predicate_Check to the expression,
1181 given that it is implicitly converted to the return type.
1182 Exclude case expressions from the check, because in this context
1183 the expression is expanded into individual return statements.
1185 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1187 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: In
1188 -gnatct mode, process the discriminants only for a definition.
1190 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1192 * repinfo.adb (List_Record_Layout): Be prepared for JSON output.
1193 (List_Record_Info): Use the flat representation for record
1194 subtypes in the JSON format.
1196 2018-09-26 Justin Squirek <squirek@adacore.com>
1198 * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
1199 documentation and an extra conditional check for RCI units so
1200 that generated ali files will list the spec only instead of a
1201 body when a body is not found.
1203 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1205 * gcc-interface/gigi.h (error_gnat_node): Delete.
1206 * gcc-interface/trans.c (error_gnat_node): Likewise.
1207 (gigi): Replace it with Current_Error_Node.
1208 (gnat_to_gnu): Likewise.
1209 * gcc-interface/utils.c (rest_of_subprog_body_compilation):
1211 * gcc-interface/misc.c (internal_error_function): Do not set it.
1213 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1215 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
1216 code retrieving the address when a clause has already been
1218 * gcc-interface/trans.c (gnat_to_gnu)
1219 <N_Attribute_Definition_Clause>: For an object with a Freeze
1220 node, build a meaningful expression.
1222 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1224 * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets
1225 Opt.Disable_ALI_File.
1226 * debug.adb: Update debug flags documentation.
1228 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1230 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
1231 analysis of preconditions specified by pragmas (rather than
1232 aspects) is not delayed, and therefore expressions functions
1233 that are completions do not need special handling during
1236 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1238 * exp_unst.adb: Fix handling of up level references for entries.
1240 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1242 * contracts.adb (Expand_Subprogram_Contract,
1243 Process_Preconditions_For): Apply Freeze_Expr_Types to the
1244 expression for a precondition of an expression function that is
1245 a completion, when the completion appears in the private part
1246 and the declaration it completes is in the visible part of the
1248 * freeze.adb (Freeze_Expr_Types): Do not establish the scope of
1249 the operation if it is already installed, as will be the case
1250 when called to analyze the contract oc the subprogram (which
1251 happens when generating code inside the subprogram body).
1253 2018-09-26 Maroua Maalej <maalej@adacore.com>
1255 * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global):
1256 Change the operation associated to assigning to an IN parameter.
1257 In SPARK, IN access-to-variable is an observe operation for a
1258 function, and borrow operation for a procedure.
1260 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1262 * vxlink.adb: Minor reformatting.
1264 2018-09-26 Gary Dismukes <dismukes@adacore.com>
1266 * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
1267 miscellaneous typos.
1269 2018-09-26 Jerome Lambourg <lambourg@adacore.com>
1271 * vxlink.adb: Kill a CodePeer warning.
1273 2018-09-24 Eric Botcazou <ebotcazou@adacore.com>
1276 * fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
1277 of 'char' as the type of the second parameter.
1279 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
1281 * Makefile.rtl (arm% linux-gnueabi%): Always set EH_MECHANISM to -arm.
1283 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
1286 * terminals.c: Do not include termio.h.
1288 2018-08-27 Martin Liska <mliska@suse.cz>
1290 * gcc-interface/decl.c (update_profile): Use new function
1291 fndecl_built_in_p and remove check for FUNCTION_DECL if
1293 * gcc-interface/gigi.h (call_is_atomic_load): Likewise.
1294 * gcc-interface/utils.c (gnat_pushdecl): Likewise.
1296 2018-08-23 Giuliano Belinassi <giuliano.belinassi@usp.br>
1298 * exp_unst.ads: Fix typo 'exapnded' to 'expanded'.
1300 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1302 * checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
1303 exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
1304 exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
1305 lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
1306 sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
1307 sprint.adb: Minor reformatting.
1309 2018-08-21 Jerome Lambourg <lambourg@adacore.com>
1311 * vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
1312 vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
1313 new tool vxlink to handle VxWorks constructors in DKMs.
1314 * gcc-interface/Makefile.in: add rules to build vxlink
1316 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1318 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
1319 Refine the handling of freezing types for expression functions
1320 that are not completions, when analyzing the generated body for
1321 the function: the body is inserted at the end of the enclosing
1322 declarative part, and its analysis may freeze types declared in
1323 the same scope that have not been frozen yet.
1325 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1327 * sem_ch6.adb: Remove Freeze_Expr_Types.
1328 * freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
1329 sem_ch6.adb, and extended to handle other expressions that may
1330 contain unfrozen types that must be frozen in their proper
1332 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
1333 contract is for the generated body of an expression function
1334 that is a completion, traverse the expressions for pre- and
1335 postconditions to freeze all types before adding the contract
1336 code within the subprogram body.
1338 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1340 * sem_ch10.adb: Remove the with and use clause for unit Ghost.
1341 (Analyze_With_Clause): Do not mark a with clause which mentions
1342 an ignored Ghost code for elimination.
1344 2018-08-21 Javier Miranda <miranda@adacore.com>
1346 * lib-writ.adb (Write_Unit_Information): Handle pragmas removed
1349 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1351 * sem_ch6.adb (Check_Synchronized_Overriding): The conformance
1352 between an overriding protected operation and the overridden
1353 abstract progenitor operation requires subtype conformance;
1354 requiring equality of return types in the case of a function is
1355 too restrictive and leads to spurious errors when the return
1356 type is a generic actual.
1358 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1360 * exp_ch9.adb (Expand_N_Timed_Entry_Call,
1361 Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
1362 properly the scope of all entities created in blocks generated
1363 by the expansion of these constructs.
1365 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1367 * sem_ch13.adb (Build_Predicate_Functioss): Apply
1368 Reset_Quantified_Variables_Scope after predicate function has
1369 been analyzed, so that the scope can be reset on the generated
1370 loop statements that have replaced the quantified expressions.
1372 2018-08-21 Bob Duff <duff@adacore.com>
1374 * einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
1377 2018-08-21 Maroua Maalej <maalej@adacore.com>
1379 * sem_spark.adb (Check_Call_Statement): Check global and formal
1380 parameter permissions at call sites.
1381 (Check_Callable_Body): Assume permissions on globals and
1382 parameters depending on their modes then analyse the body
1384 (Check_Declaration): Consider both deep (including elementary
1385 access) object declarations and normal variables. First check
1386 whether the deep object is of Ownership Aspec True or not, then,
1387 depending on its initialization, assign the appropriate state.
1388 Check related to non access type variables deal with
1389 initialization value permissions.
1390 (Check_Expression): Check nodes used in the expression being
1392 (Check_Globals): Call by Check_Call_Statement to perform the
1394 (Check_List): Call Check_Node on each element of the list.
1395 (Check_Loop_Statement): Check the Iteration_Scheme and loop
1397 (Check_Node): Main traversal procedure to check safe pointer usage.
1398 (Check_Package_Body): Check subprogram's body.
1399 (Check_Param_In): Take a formal and an actual parameter and
1400 Check the permission of every in-mode parameter.
1401 (Check_Param_Out): Take a formal and an actual parameter and
1402 check the state of out-mode and in out-mode parameters.
1403 (Check_Statement): Check statements other than procedure call.
1404 (Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
1405 related to the given name.
1406 (Is_Deep): Return True if an object is of access type or has
1407 subfields of access type.
1408 (Perm_Error, Perm_Error_Subprogram_End): Add an error message
1409 whenever the found state on the given name is different from the
1410 one expected (in the statement being analyzed).
1411 (Process_Path): Given an operation and a current state, call
1412 Perm_Error if there is any mismatch.
1413 (Return_Declarations, Return_Globals, Return_The_Global): Check
1414 the state of a given name at the end of the subprogram. These
1415 procedures may change depending on how we shall finally deal
1416 with globals and the rhs state in a move operation.
1417 (Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
1418 Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
1419 Setup_Parameters): Set up the new states to the given node and
1420 up and down the tree after an operation.
1421 (Has_Ownership_Aspect_True): This function may disappear later
1422 when the Ownership Aspect will be implemented in the FE.
1424 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1426 * sem_res.adb (Resolve_Call): Resolve correctly a parameterless
1427 call that returns an access type whose designated type is the
1428 component type of an array, when the function has no defaulted
1431 2018-08-21 Yannick Moy <moy@adacore.com>
1433 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1434 Document entries of the target parametrization file.
1435 * gnat_ugn.texi: Regenerate.
1437 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1439 * sem_attr.adb: Set scope of elaboration flag for 'Access.
1441 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1443 * sprint.adb: Add guard on printing aspects.
1445 2018-08-21 Javier Miranda <miranda@adacore.com>
1447 * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
1450 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1452 * layout.adb: Do not set size of access subprogram if unnesting.
1454 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1456 * freeze.adb: Remove warnings for access to subprograms when
1457 unnesting is active.
1459 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1461 * exp_aggr.adb (Expand_Array_Aggregate): If the component type
1462 is limited, the array must be constructed in place, so set flag
1463 In_Place_Assign_OK_For_Declaration accordingly. This prevents
1464 improper copying of an array of tasks during initialization.
1466 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
1468 * gcc-interface/trans.c (Call_to_gnu): Always suppress an
1469 unchecked conversion around the actual for an In parameter
1472 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
1474 * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
1475 selected component inherited in a record extension and subject
1476 to a representation clause, retrieve the position and size from
1477 the original record component.
1479 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1481 * sem_util.ads, sem_util.adb (New_External_Entity): Type of
1482 Suffix_Index must be Int, not Nat, so that a negative value can
1483 be used to generate a unique name for an external object, as
1484 specified in Tbuild.New_External_Name.
1485 (Scope_Within): Handle private type whose completion is a
1486 synchronized type (For unnesting).
1487 * itypes.ads, itypes.adb (Create_Itype): Ditto
1488 * sem_ch3.adb (Constrain_Corresponding_Record): Generate a
1489 unique name for the created subtype, because there may be
1490 several discriminated tasks present in the same scope, and each
1491 needs its distinct corresponding record subtype.
1493 2018-08-21 Yannick Moy <moy@adacore.com>
1495 * doc/gnat_ugn/gnat_and_program_execution.rst: Update
1496 documentation of dimensionality analysis.
1497 * gnat_ugn.texi: Regenerate.
1498 * Makefile.rtl, impunit.adb: Consider the new units.
1499 * libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
1500 libgnat/s-diflmk.ads: New units based on Float.
1501 * libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
1502 libgnat/s-dlmopr.ads: New units based on Long_Float.
1503 * libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
1505 System.Dim.Generic_Mks.Generic_Other_Prefixes.
1506 * libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
1507 into an instance of System.Dim.Generic_Mks.
1509 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1511 * impunit.adb: Add g-lists to the set of non-implementation
1513 * libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
1514 * Makefile.rtl: Add g-lists to the set of non-tasking units.
1515 * gcc-interface/Make-lang.in: Add g-lists to the set of files
1518 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1520 * exp_ch9.adb (Reset_Scopes): Do not recurse into type
1521 declarations when resetting the scope of entities declared the
1522 procedures generated for entry bodies and accept alternatives.
1523 Use the entity of the procedure declaration, not its body, as
1526 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1528 * einfo.adb (Elaboration_Entity): Include entries and entry
1529 families in the set of legal entities.
1530 (Elaboration_Entity_Required): Include entries and entry
1531 families in the set of legal entities.
1532 (Set_Elaboration_Entity): Include entries and entry families in
1533 the set of legal entities.
1534 (Set_Elaboration_Entity_Required): Include entries and entry
1535 families in the set of legal entities.
1536 (Write_Field13_Name): Update the output of attribute
1538 * einfo.ads: Attributes Elaboration_Entity and
1539 Elaboration_Entity_Required now apply to entries and entry
1542 2018-08-21 Arnaud Charlet <charlet@adacore.com>
1544 * set_targ.adb: Mark some CodePeer message as Intentional.
1546 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1548 * sem_res.adb (Resolve_Call): Force the freezing of an
1549 expression function that is called to provide a default value
1550 for a defaulted discriminant in an object initialization.
1552 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1554 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
1557 2018-08-21 Javier Miranda <miranda@adacore.com>
1559 * checks.ads (Determine_Range): Adding documentation.
1560 * checks.adb (Determine_Range): Don't deal with enumerated types
1561 with non-standard representation.
1562 (Convert_And_Check_Range): For conversion of enumeration types
1563 with non standard representation to an integer type perform a
1564 direct conversion to the target integer type.
1566 2018-08-21 Piotr Trojanek <trojanek@adacore.com>
1568 * lib-xref.ads, lib-xref-spark_specific.adb
1569 (Enclosing_Subprogram_Or_Library_Package): Now roughtly works
1570 for pragmas that come from aspect specifications.
1572 2018-08-21 Pierre-Marie de Rodat <derodat@adacore.com>
1574 * sa_messages.ads, sa_messages.adb: New source files.
1576 2018-08-03 Pierre-Marie de Rodat <derodat@adacore.com>
1579 2018-07-06 Jim Wilson <jimw@sifive.com>
1581 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
1582 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
1583 * gcc-interface/Makefile.in (xoscons): Likewise.
1585 2018-07-31 Alexandre Oliva <oliva@adacore.com>
1586 Olivier Hainque <hainque@adacore.com>
1588 * gcc-interface/trans.c: Include debug.h.
1589 (file_map): New static variable.
1590 (gigi): Set it. Create decl_to_instance_map when needed.
1591 (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
1592 (Sloc_to_locus): ... this. Add decl parm, map it to instance.
1593 * gcc-interface/gigi.h (Sloc_to_locus): Adjust declaration.
1595 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1597 * clean.adb, gnatchop.adb, gnatfind.adb, gnatls.adb,
1598 gnatmake.ads, gnatxref.adb, make.adb, make.ads, make_util.ads,
1599 sfn_scan.adb, vxaddr2line.adb, xeinfo.adb, xoscons.adb,
1600 xr_tabls.adb, xref_lib.adb: Address CodePeer messages.
1602 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1604 * gnatlink.adb: Fix potential Constraint_Error if
1605 Library_Version is too long.
1607 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1609 * sem_elab.adb: Remove duplicate condition detected by CodePeer.
1611 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1613 * exp_unst.adb (Subp_Index): In the case of a protected
1614 operation, the relevant entry is the generated
1615 protected_subprogram_body into which the original body is
1616 rewritten. Assorted cleanup and optimizations.
1618 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1620 * exp_attr.adb (Expand_Attribute, case Fixed_Value): Set the
1621 base type of the result to ensure that proper overflow and range
1622 checks are generated. If the target is a fixed-point tyoe,
1623 generate the required overflow and range checks explicitly,
1624 rather than relying on Apply_Type_Conversion_Checks, which might
1625 simply set the Do_Range_Check flag and rely on the backend to
1628 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1630 * sem_res.adb (Resolve_Call): Establish a transient scope to
1631 manage the secondary stack when the designated type of an
1632 access-to-subprogram requires it.
1634 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1636 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): To find local
1637 subprograms in the elaboration code for a package body, recurse
1638 through nested statement sequences because a compiler-generated
1639 procedure may appear within a condition statement.
1641 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1643 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Handle
1644 properly a protected call that includes a default parameter that
1645 is a call to a protected function of the same type.
1647 2018-07-31 Justin Squirek <squirek@adacore.com>
1649 * lib-writ.adb (Write_With_Lines): Modfiy the generation of
1650 dependencies within ali files so that source unit bodies are
1651 properly listed even if said bodies are missing. Perform legacy
1652 behavior in GNATprove mode.
1653 * lib-writ.ads: Modify documentation to reflect current behavior.
1655 2018-07-31 Eric Botcazou <ebotcazou@adacore.com>
1657 * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.
1658 (mutex_t): Use it for 'lock' and 'data' components.
1659 (cond_t): Likewise for 'data' and use single 'flags' component.
1661 2018-07-31 Justin Squirek <squirek@adacore.com>
1663 * exp_ch5.adb (Make_Field_Assign): Force temporarily generated
1664 objects for assignment of overlaid user objects to be renamings
1665 instead of constant declarations.
1667 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1669 * exp_ch9.adb (Analyze_Pragmas): New routine.
1670 (Build_Private_Protected_Declaration): Code clean up. Relocate
1671 relevant aspects and pragmas from the stand-alone body to the
1672 newly created spec. Explicitly analyze any pragmas that have
1673 been either relocated or produced by the analysis of the
1675 (Move_Pragmas): New routine.
1676 * sem_prag.adb (Find_Related_Declaration_Or_Body): Recognize the
1677 case where a pragma applies to the internally created spec for a
1678 stand-along subprogram body declared in a protected body.
1680 2018-07-31 Gary Dismukes <dismukes@adacore.com>
1682 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
1683 calls to Current_Scope in three assertions with calls to
1686 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1688 * sem_eval.adb (Check_Non_Static_Context): Do not warn on an
1689 integer literal greater than the upper bound of
1690 Universal_Integer'Last when expansion is disabled, to avoid a
1691 spurious warning over ranges involving 64-bit modular types.
1693 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1695 * einfo.adb (Write_Entity_Flags): Also print
1696 Is_Activation_Record flag.
1698 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
1700 * exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb,
1701 repinfo.adb, sem_ch9.adb: Minor replace Ekind membership tests
1702 with a wrapper routine.
1704 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
1706 * ali.adb (Known_ALI_Lines): Remove 'F' as a prefix for lines
1707 related to the FORMAL analysis done by GNATprove.
1709 2018-07-31 Javier Miranda <miranda@adacore.com>
1711 * sem.ads (Inside_Preanalysis_Without_Freezing): New global
1713 * sem.adb (Semantics): This subprogram has now the
1714 responsibility of resetting the counter before analyzing a unit,
1715 and restoring its previous value before returning.
1716 * freeze.adb (Freeze_Entity): Do not freeze if we are
1717 preanalyzing without freezing.
1718 * sem_res.adb (Preanalyze_And_Resolve): Set & restore
1719 In_Preanalysis_Without_Freezing.
1721 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1723 * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
1724 may rename a matching class-wide operation only if the renaming
1725 declaration for that actual is in an enclosing scope (i.e.
1726 within the corrresponding instance).
1728 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1730 * checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
1731 exp_disp.adb, make.adb, sem_ch4.adb, sem_eval.adb, sem_res.adb,
1732 usage.adb: Minor reformatting.
1734 2018-07-31 Bob Duff <duff@adacore.com>
1736 * sem_res.adb (Resolve_Allocator): Do not complain about the
1737 implicit allocator that occurs in the expansion of a return
1738 statement for a build-in-place function.
1740 2018-07-20 Martin Sebor <msebor@redhat.com>
1743 * gcc-interface/misc.c (gnat_handle_option): Change function argument
1746 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1748 * gcc-interface/decl.c (choices_to_gnu): Rename parameters. Deal with
1749 an operand of Character type. Factor out range generation to the end.
1750 Check that the bounds are literals and convert them to the type of the
1751 operand before building the ranges.
1752 * gcc-interface/utils.c (make_dummy_type): Minor tweak.
1753 (make_packable_type): Propagate TYPE_DEBUG_TYPE.
1754 (maybe_pad_type): Likewise.
1756 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1758 * sem_ch4.adb (Try_Object_Operation): Handle properly a prefixed call
1759 in an instance, when the generic parameters include an interface type
1760 and a abstract operation of that type, and the actuals in the instance
1761 include an interface type and a corresponding abstract operation of it,
1762 with a different name than the corresponding generic subprogram
1765 2018-07-17 Arnaud Charlet <charlet@adacore.com>
1767 * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
1770 2018-07-17 Arnaud Charlet <charlet@adacore.com>
1772 * checks.adb (Apply_Division_Check): Add provision for floating-point
1775 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1777 * exp_aggr.adb (Component_OK_For_Backend): If an array component of the
1778 enclosing record has a bound that is out of range (and that has been
1779 rewritten as a raise statement) the aggregate is not OK for any back
1780 end, and should be expanded into individual assignments.
1782 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1784 * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
1786 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1788 * sem_util.ads (Denotes_Same_Object): Likewise.
1789 * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
1791 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1793 * exp_disp.adb (Make_Tags): When the type has user-defined primitives,
1794 build the access type that is later used by Build_Get_Prim_Op_Address
1795 as pointing to a subtype of Ada.Tags.Address_Array.
1797 2018-07-17 Patrick Bernardi <bernardi@adacore.com>
1799 * libgnat/s-memory__mingw.adb: Remove.
1800 * Makefile.rtl: Remove s-memory.adb target pair from the Cygwin/Mingw32
1803 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1805 * frontend.adb (Frontend): The removal of ignored Ghost code must be
1806 the last semantic operation performed on the tree.
1808 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1810 * frontend.adb (Frontend): Update the call to Register_Config_Switches.
1811 * inline.ads: Add new component Config_Switches to record
1812 Pending_Body_Info which captures the configuration state of the pending
1813 body. Remove components Version, Version_Pragma, SPARK_Mode, and
1814 SPARK_Mode_Pragma from record Pending_Body_Info because they are
1815 already captured in component Config_Switches.
1816 * opt.adb (Register_Opt_Config_Switches): Rename to
1817 Register_Config_Switches.
1818 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1819 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1820 routine is now a function, and returns the saved configuration state as
1821 an aggregate to avoid missing an attribute.
1822 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1823 * opt.ads (Register_Opt_Config_Switches): Rename to
1824 Register_Config_Switches.
1825 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1826 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1827 routine is now a function.
1828 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1829 * par.adb (Par): Update the calls to configuration switch-related
1831 * sem.adb (Semantics): Update the calls to configuration switch-related
1833 * sem_ch10.adb (Analyze_Package_Body_Stub): Update the calls to
1834 configuration switch-related subprograms.
1835 (Analyze_Protected_Body_Stub): Update the calls to configuration
1836 switch-related subprograms.
1837 (Analyze_Subprogram_Body_Stub): Update calls to configuration
1838 switch-related subprograms.
1839 * sem_ch12.adb (Add_Pending_Instantiation): Update the capture of
1840 pending instantiation attributes.
1841 (Inline_Instance_Body): Update the capture of pending instantiation
1842 attributes. It is no longer needed to explicitly manipulate the SPARK
1844 (Instantiate_Package_Body): Update the restoration of the context
1846 (Instantiate_Subprogram_Body): Update the restoration of context
1848 (Load_Parent_Of_Generic): Update the capture of pending instantiation
1850 (Set_Instance_Env): Update the way relevant configuration attributes
1851 are saved and restored.
1853 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1855 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
1856 more rvalues in the expression of a renaming.
1858 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1860 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
1862 (TYPE_RETURN_UNCONSTRAINED_P): Likewise.
1863 (TYPE_CI_CO_LIST): Likewise.
1864 * gcc-interface/gigi.h (is_cplusplus_method): Delete.
1865 (fntype_same_flags_p): Adjust comment.
1866 * gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
1867 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
1869 (is_cplusplus_method): Make static and adjust head comment.
1870 (gnat_to_gnu_param): Return a pointer for the "this" parameter of
1872 (gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
1873 callable form. Generate a METHOD_TYPE node for imported C++ methods.
1874 Set param_list at the very end of the processing.
1875 (substitute_in_type) <METHOD_TYPE>: New case.
1876 * gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
1877 (gnat_type_hash_eq): Accept METHOD_TYPE.
1878 * gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
1879 (Attribute_to_gnu): Likewise.
1880 (Call_to_gnu): Likewise.
1881 (process_freeze_entity): Likewise.
1882 * gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
1883 (fntype_same_flags_p): Likewise.
1885 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1887 * inline.adb (Expand_Inlined_Call): Remove extra parentheses.
1889 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1891 * exp_disp.adb (Gen_Parameters_Profile): Make the _Init parameter an
1893 (Set_CPP_Constructors): Adjust comment accordingly.
1895 2018-07-17 Bob Duff <duff@adacore.com>
1897 * exp_disp.adb (Build_Class_Wide_Check): Return early if the
1898 precondition is supposed to be ignored.
1900 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1902 * sem_ch6.adb (Check_Untagged_Equality): Extend check to operations
1903 declared in the same scope as the operand type, when that scope is a
1906 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1908 * exp_unst.adb (Unnest_Subprograms): Do nothing if the expander is not
1909 active. Don't use Get_Actual_Subtype for record subtypes. Ignore
1910 rewritten identifiers and uplevel references to bounds of types that
1911 come from the original type reference.
1913 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1915 * exp_ch13.adb, exp_ch7.adb, exp_unst.adb, freeze.adb,
1916 libgnat/s-os_lib.adb, sem_ch3.adb, sem_ch3.ads, sem_ch5.adb,
1917 sem_eval.adb, sem_res.adb, sem_util.adb: Minor reformatting.
1919 2018-07-17 Javier Miranda <miranda@adacore.com>
1921 * exp_ch13.adb (Expand_N_Freeze_Entity): Handle subtype declared for an
1923 * freeze.adb (Freeze_Expression): Handle freeze of an entity defined
1924 outside of a subprogram body. This case was previously handled during
1925 preanalysis; the frozen entities were remembered and left pending until
1926 we continued freezeing entities outside of the subprogram. Now, when
1927 climbing the parents chain to locate the correct placement for the
1928 freezeing node, we check if the entity can be frozen and only when no
1929 enclosing node is marked as Must_Not_Freeze the entity is frozen.
1930 * sem_ch3.ads (Preanalyze_Default_Expression): Declaration moved to the
1932 * sem_ch3.adb (Preanalyze_Default_Expression): Code adjusted to invoke
1933 the new subprogram Preanalyze_With_Freezing_And_Resolve.
1934 * sem_ch6.adb (Preanalyze_Formal_Expression): New subprogram.
1935 (Analyze_Expression_Function, Process_Formals): Invoke
1936 Preanalyze_Formal_Expression instead of Preanalyze_Spec_Expression
1937 since the analysis of the formals may freeze entities.
1938 (Analyze_Subprogram_Body_Helper): Skip building the body of the
1939 class-wide clone for eliminated subprograms.
1940 * sem_res.ads, sem_res.adb (Preanalyze_And_Resolve): New subprogram.
1941 Its code is basically the previous version of this routine but extended
1942 with an additional parameter which is used to specify if during
1943 preanalysis we are allowed to freeze entities. If the new parameter is
1944 True then the subtree root node is marked as Must_Not_Freeze and no
1945 entities are frozen during preanalysis.
1946 (Preanalyze_And_Resolve): Invokes the internal version of
1947 Preanalyze_And_Resolve without entity freezing.
1948 (Preanalyze_With_Freezing_And_Resolve): Invokes the internal version of
1949 Prenalyze_And_Resolve with freezing enabled.
1951 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1953 * einfo.ads, libgnat/g-comlin.ads: Minor change "ie" to "i.e." in docs
1956 2018-07-17 Justin Squirek <squirek@adacore.com>
1958 * libgnat/s-os_lib.adb (Argument_String_To_List): Fix trimming of
1961 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1963 * sem_prag.adb (Has_Visible_State): Do not consider constants as
1964 visible state because it is not possible to determine whether a
1965 constant depends on variable input.
1966 (Propagate_Part_Of): Add comment clarifying the behavior with respect
1969 2018-07-17 Yannick Moy <moy@adacore.com>
1971 * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
1972 being propagated in GNATprove mode.
1974 2018-07-17 Dmitriy Anisimkov <anisimko@adacore.com>
1976 * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
1977 public components of Inet_Addr_Type. Introduce public binary
1980 2018-07-17 Javier Miranda <miranda@adacore.com>
1982 * exp_ch7.adb (Make_Transient_Block): When determining whether an
1983 enclosing scope already handles the secondary stack, take into account
1984 transient blocks nested in a block that do not manage the secondary
1985 stack and are located within a loop.
1987 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1989 * sem_util.adb (Enclosing_Subprogram): Protected entries and task
1990 entries must be treated separately: task entries are within the
1991 enclosing subprogram of the task type, while protected entries are
1992 transformed into the corresponding Protected_Body_Subprogram, which is
1993 the enclosing_subprogram of any subprogram declared within the entry
1996 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1998 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
1999 sections on -gnatH and -gnatJ compiler switches.
2000 * gnat_ugn.texi: Regenerate.
2002 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2004 * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
2006 * atree.adb: Add a soft link for a procedure which is invoked whenever
2007 an ignored Ghost node or entity is created.
2008 (Change_Node): Preserve relevant attributes which come from the Flags
2010 (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
2012 (Rewrite): Preserve relevant attributes which come from the Flags
2014 (Set_Ignored_Ghost_Recording_Proc): New routine.
2015 * atree.ads: Define an access-to-suprogram type for a soft link which
2016 records a newly created ignored Ghost node or entity.
2017 (Set_Ignored_Ghost_Recording_Proc): New routine.
2018 * ghost.adb: Remove with and use clause for Lib. Remove table
2019 Ignored_Ghost_Units. Add new table Ignored_Ghost_Nodes.
2020 (Add_Ignored_Ghost_Unit): Removed.
2021 (Initialize): Initialize the table which stores ignored Ghost nodes.
2022 Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
2024 (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
2025 an eliminated ignored Ghost unit.
2026 (Lock): Release and lock the table which stores ignored Ghost nodes.
2027 (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
2029 (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
2030 ignored Ghost nodes.
2031 (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
2032 (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
2034 (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
2035 (Propagate_Ignored_Ghost_Code): Removed.
2036 (Record_Ignored_Ghost_Node): New routine.
2037 (Remove_Ignored_Ghost_Code): Reimplemented.
2038 (Remove_Ignored_Ghost_Node): New routine.
2039 (Ultimate_Original_Node): New routine.
2040 * ghost.ads (Check_Ghost_Completion): Removed.
2041 * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
2042 package clause as ignored Ghost if applicable.
2043 * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
2045 2018-07-17 Javier Miranda <miranda@adacore.com>
2047 * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
2049 (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
2050 of the loop iterator relies on the secondary stack.
2052 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2054 * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
2055 which happens for inlined calls, then fetch the next actual from the
2058 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2060 * einfo.ads: Update documentation for Scalar_Range.
2062 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2064 * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
2065 the Standard package.
2067 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2069 * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
2071 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2073 * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
2074 synchronized types that are completions of limited types or private
2076 (Scope_Within): Handle properly accept statements in task bodies.
2078 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2080 * sem_prag.adb (Has_Visible_State): Do not consider generic formals
2081 because they are not part of the visible state space. Add constants to
2082 the list of acceptable visible states.
2083 (Propagate_Part_Of): Do not consider generic formals when propagating
2084 the Part_Of indicator.
2085 * sem_util.adb (Entity_Of): Do not follow renaming chains which go
2086 through a generic formal because they are not visible for SPARK
2088 * sem_util.ads (Entity_Of): Update the comment on usage.
2090 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2092 * sem_util.adb (Gather_Components): A discriminant of an ancestor may
2093 have been constrained by a later ancestor, so when looking for the
2094 value of that hidden discriminant we must examine the stored constraint
2095 of other ancestors than the immediate parent type.
2097 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2099 * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
2100 constructs and entities within receive new entities when replicating a
2102 (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
2103 and entities within receive new entities when replicating a tree.
2104 * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
2105 (Visit_Entity): Visit entities within scoping constructs inside
2106 expression with actions nodes when requested by the caller. Add blocks,
2107 labels, and procedures to the list of entities which need replication.
2108 * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
2109 the comment on usage.
2111 2018-07-17 Arnaud Charlet <charlet@adacore.com>
2113 * doc/gnat_ugn/about_this_guide.rst,
2114 doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
2115 * gnat_ugn.texi: Regenerate.
2117 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2119 * contracts.adb (Analyze_Contracts): Add specialized processing for
2120 package instantiation contracts.
2121 (Analyze_Package_Contract): Remove the verification of a missing
2123 (Analyze_Package_Instantiation_Contract): New routine.
2124 * contracts.ads (Analyze_Package_Contract): Update the comment on
2126 * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
2127 instance is being examined when trying to determine whether a package
2128 instantiation needs a Part_Of indicator.
2130 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2132 * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
2133 sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
2134 sem_util.adb: Minor reformatting.
2136 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2138 * frontend.adb: Only unnest subprograms if no previous errors were
2141 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2143 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
2144 contain blocks in the elaboration code for a package body. Create the
2145 elaboration subprogram wrapper only if there is a subprogram
2146 declaration in a block or loop.
2148 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2150 * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
2151 deep copy of the left operand when building each conjuct of the
2152 expanded membership operation, to avoid sharing nodes between them.
2153 This sharing interferes with the unnesting machinery and is generally
2156 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2158 * exp_unst.adb (Visit_Node): Handle 'Address references that are
2161 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2163 * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
2164 in relevant nodes: Allocate, Free, and return statements.
2166 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2168 * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
2169 instance that carries an aspect Default_Storage_Pool that overrides a
2170 default storage pool that applies to the generic unit. The aspect in
2171 the generic unit was removed before copying it in the instance, rather
2172 than removing it from the copy of the aspects that are appended to the
2173 aspects in the instance.
2175 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2177 * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
2179 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
2181 * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
2182 entry body to be the corresponding generated subprogram, for correct
2183 analysis of uplevel references.
2184 * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
2185 Ignore pragmas, fix component associations.
2186 (Register_Subprograms): Subprograms in synchronized types must be
2187 treated as reachable.
2189 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2191 * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
2192 states and variables.
2194 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2196 * sinfo.ads, sinfo.adb (Withed_Body): Remove.
2197 (Set_Withed_Body): Remove.
2199 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2201 * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
2202 when printing debug info.
2204 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2206 * sem.adb (Walk_Library_Items): Reuse local constant.
2207 (Is_Subunit_Of_Main): Turn condition to positive and flip the
2208 IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
2211 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2213 * sem.adb (Walk_Library_Items): Deconstruct dead code.
2215 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2217 * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
2218 Expand_Nonbinary_Modular_Op. Needed for unnesting.
2220 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2222 * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
2223 static predicate (for example True) but has no
2224 static_discrete_predicate.
2226 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2228 * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
2229 class-wide types and record extensions.
2231 2018-07-16 Justin Squirek <squirek@adacore.com>
2233 * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
2234 checks on expanded literals within if and case expressions.
2236 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2238 * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
2239 longest sequence factor. Code clean up.
2240 (Wide_Wide_String_To_String): Use the appropriate longest sequence
2241 factor. Code clean up.
2243 2018-07-16 Javier Miranda <miranda@adacore.com>
2245 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
2246 on Bit_Order when defined for a record extension.
2248 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2250 * libgnat/s-objrea.ads: Minor code clean up.
2252 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2254 * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
2257 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2259 * adaint.c (__gnat_set_file_time_name): Code clean up.
2261 2018-07-16 Javier Miranda <miranda@adacore.com>
2263 * inline.adb (Build_Body_To_Inline): Minor code reorganization that
2264 ensures that calls to function Has_Single_Return() pass a decorated
2266 (Has_Single_Return.Check_Return): Peform checks on entities (instead on
2267 relying on their characters).
2269 2018-07-16 Javier Miranda <miranda@adacore.com>
2271 * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
2272 to avoid generating an ill-formed tree that confuses gnatprove causing
2275 2018-07-16 Yannick Moy <moy@adacore.com>
2277 * inline.adb (Has_Single_Return): Rewrap comment.
2279 2018-07-16 Eric Botcazou <ebotcazou@adacore.com>
2281 * einfo.ads: Minor tweak in comment.
2283 2018-07-16 Javier Miranda <miranda@adacore.com>
2285 * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
2287 2018-07-16 Javier Miranda <miranda@adacore.com>
2289 * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
2290 transform 'Count into a function call if the current scope has been
2293 2018-07-16 Javier Miranda <miranda@adacore.com>
2295 * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
2296 public part of this package.
2298 2018-07-16 Yannick Moy <moy@adacore.com>
2300 * sem_res.adb (Resolve_Call): Do not inline calls inside
2301 compiler-generated functions translated as predicates in GNATprove.
2303 2018-07-16 Gary Dismukes <dismukes@adacore.com>
2305 * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
2306 addition to the existing test for no Storage_Pool as a condition
2307 enabling generation of the call to Check_Standard_Allocator when the
2308 restriction No_Standard_Allocators_After_Elaboration is active.
2309 * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
2310 say that Storage_Error will be raised (rather than Program_Error).
2311 * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
2312 rather than Program_Error when Elaboration_In_Progress is False.
2314 2018-07-16 Gary Dismukes <dismukes@adacore.com>
2316 * sem_eval.adb: Fix spelling for compile-time-known.
2318 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2320 * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
2321 the compiler from entering infinite recursion when trying to determine
2322 whether a deferred constant has a compile time known value, and the
2323 initialization expression of the constant is a reference to the
2326 2018-07-16 Nicolas Roche <roche@adacore.com>
2328 * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
2329 factor from 1/32 to 1/2 for Unbounded_String.
2331 2018-07-13 Eric Botcazou <ebotcazou@adacore.com>
2333 * gcc-interface/lang.opt (funsigned-char): New option.
2334 * gcc-interface/misc.c (gnat_handle_option): Accept it.
2335 * gcc-interface/utils.c (finish_character_type): Tweak comment.
2337 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2339 * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
2340 variable and use it throughout.
2341 <E_Variable>: If the nominal subtype of the object is unconstrained,
2342 compute the Ada size separately and put in on the padding type if the
2344 <E_Record_Type>: Minor tweak.
2345 * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
2346 into max_size_unit throughout.
2348 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2350 * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
2351 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
2352 * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
2353 (add_decl_expr): Change type of second parameter and rename it.
2354 (renaming_from_instantiation_p): New function moved from...
2355 (set_expr_location_from_node): Test for exceptions here and add one
2356 for actual subtypes built for unconstrained composite actuals.
2357 * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
2359 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2361 * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
2362 and adjust recursive calls.
2363 (Identifier_to_gnu): Adjust calls to lvalue_required_p.
2364 (gnat_to_gnu): Likewise.
2366 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2368 * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
2369 (gnat_to_gnu_subprog_type): New pure_flag local variable. Set it for
2370 a pure Ada function with a by-ref In parameter. Propagate it onto the
2371 function type by means of the TYPE_QUAL_RESTRICT flag.
2372 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
2373 function type has the TYPE_QUAL_RESTRICT flag set.
2375 2018-07-06 Jim Wilson <jimw@sifive.com>
2377 * Makefile.rtl: Add riscv*-linux* support.
2378 * libgnarl/s-linux__riscv.ads: New.
2379 * libgnat/system-linux-riscv.ads: New.
2381 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
2382 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
2383 * gcc-interface/Makefile.in (xoscons): Likewise.
2385 2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
2387 * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
2388 (ZCX_By_Default): Set to True.
2390 2018-07-02 Martin Liska <mliska@suse.cz>
2392 * gnatvsn.ads: Bump Library_Version to 9.
2394 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2396 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
2397 using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
2398 (TYPE_ALIGN_OK): Move around.
2399 (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
2400 * gcc-interface/decl.c (change_qualified_type): Move to...
2401 (gnat_to_gnu_entity): Adjust comment.
2402 * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
2403 (ceil_pow2): Use ceil_log2.
2404 * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
2405 and do not set TREE_SIDE_EFFECTS.
2406 (handle_noreturn_attribute): Use change_qualified_type.
2408 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2410 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
2411 the expression of a dispatch table that is not being defined.
2412 <E_Record_Subtype>: Remove obsolete kludge.
2414 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2416 * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
2418 (warn_on_list_placement): New static function.
2419 (components_to_record): Use it to warn on multiple fields in list.
2421 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2423 * gcc-interface/decl.c (variant_desc): Add AUX field.
2424 (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
2426 (reverse_sort_field_list): New static function.
2427 (components_to_record): Place the variant part at the beginning of the
2428 field list when there is an obvious order of increasing position.
2429 (build_variant_list): Initialize it.
2430 (create_variant_part_from): Do not call compute_record_mode directly.
2431 (copy_and_substitute_in_layout): Likewise. Always sort the fields with
2432 fixed position in order of increasing position, in the record and all
2433 the variants, in any. Call reverse_sort_field_list.
2434 * gcc-interface/utils.c (make_packable_type): Compute the sizes before
2435 calling finish_record_type. Do not call compute_record_mode directly.
2436 (finish_record_type): Overhaul final processing depending on REP_LEVEL
2437 and call finish_bitfield_layout if it is equal to one or two.
2439 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2441 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
2442 existing fields of a dummy fat pointer type, if any. Clear the
2443 TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
2445 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2447 * contracts.adb (Process_Body_Postconditions): Expand only checked
2449 (Process_Contract_Cases_For): Expand only checked contract cases.
2450 (Process_Inherited_Preconditions): Ignored class-wide preconditions are
2451 partially expanded because some of their semantic checks are tied to
2453 (Process_Preconditions_For): Expand only checked preconditions.
2454 (Process_Spec_Postconditions): Expand only checked preconditions.
2455 Ignored class-wide preconditions are partially expanded because some of
2456 their semantic checks are tied to the expansion.
2457 * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
2459 * exp_util.adb (Add_Inherited_Invariants): Code clean up.
2460 * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
2462 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2464 * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
2465 libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
2466 libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
2469 2018-06-11 Gary Dismukes <dismukes@adacore.com>
2471 * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
2473 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2475 * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
2476 not add any actuals when the size of the object is known, and the
2477 caller will allocate it.
2478 (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
2479 better illustrate its functionality. Update the comment on the
2480 generated code. Generate a branch for the heap and pool cases where
2481 the object is not necessarity controlled.
2482 (Expand_N_Extended_Return_Statement): Expand the extended return
2483 statement into four branches depending the requested mode if the caller
2484 will not allocate the object on its side.
2485 (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
2486 object on the caller side because this will violate the semantics of
2487 finalizable types. Instead notify the function to allocate the object
2488 on the heap or a user-defined storage pool.
2489 (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
2490 which of the four modes to employ when returning a limited controlled
2492 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
2493 guard which is already covered in Needs_Finalization.
2495 2018-06-11 Olivier Hainque <hainque@adacore.com>
2497 * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
2498 * libgnat/a-exexpr.adb: ... Here, then add comments describing the
2499 major datastructures associated with the current exception raised.
2500 (Setup_Current_Excep): Accept a "Phase" argument conveying the
2501 unwinding phase during which this subprogram is called. For an Ada
2502 exception, don't update the current exception buffer from the raised
2503 exception object during SEARCH_PHASE, as this is redundant with the
2504 call now issued just before propagation starts.
2505 (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
2506 the unwinding start, conveying Phase 0.
2507 (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
2508 the call to Setup_Current_Excep.
2509 * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
2510 on calls to Setup_Current_Excep.
2512 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2514 * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
2515 Build_Access_Type_Decl): New subprograms to handle uplevel references
2516 to formals of an unconstrained array type. The activation record
2517 component for these is an access type, and the reference is rewritten
2518 as an explicit derefenrence of that component.
2520 2018-06-11 Bob Duff <duff@adacore.com>
2522 * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
2523 libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
2524 (Element): Add code to detect dangling cursors in some cases.
2526 2018-06-11 Yannick Moy <moy@adacore.com>
2528 * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
2531 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2533 * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
2534 that its parent is already frozen so that its predicate function, if
2535 any, has already been constructed.
2537 2018-06-11 Yannick Moy <moy@adacore.com>
2539 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
2540 possible task unit as the enclosing context.
2542 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2544 * gnat1drv.adb: Remove use clause for Repinfo.
2545 (Gnat1drv): Beef up comment about the interplay between -gnatc and
2546 back-end annotations. Use full qualified name for List_Rep_Info.
2548 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2550 * libgnat/g-arrspl.ads: Add pragma Preelaborate.
2552 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2554 * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
2555 then" and general logical "ada" in codepeer mode.
2557 2018-06-11 Javier Miranda <miranda@adacore.com>
2559 * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
2560 N_Call_Marker nodes.
2562 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2564 * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
2567 2018-06-11 Yannick Moy <moy@adacore.com>
2569 * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
2570 argument to Assertion_Policy
2571 * gnat_rm.texi: Regenerate.
2573 2018-06-11 Yannick Moy <moy@adacore.com>
2575 * gnat1drv.adb: Do not check representation information in CodePeer and
2576 GNATprove modes, as these modes call a special backend instead of gigi,
2577 so do not have the information.
2579 2018-06-11 Yannick Moy <moy@adacore.com>
2581 * inline.adb (Build_Body_To_Inline): Consider case of extended return
2582 of unconstrained type as one case where inlining is not supported.
2583 (Expand_Inlined_Call): Remove special case for body as extended return
2584 of unconstrained type.
2586 2018-06-11 Yannick Moy <moy@adacore.com>
2588 * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
2590 (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
2592 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
2594 * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
2595 expressions in Pre/Post contracts while in GNATprove_Mode.
2597 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
2599 * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
2600 with AND THEN expressions broken down into individual conjuncts.
2602 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2604 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
2606 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2608 * exp_unst.adb (Visit_Node): Skip generic associations.
2610 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2612 * libgnat/memtrack.adb (fwrite): Remove second definition.
2614 2018-06-11 Javier Miranda <miranda@adacore.com>
2616 * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
2617 (Is_Static_Coextension): Adding documentation.
2618 * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
2619 (Is_Static_Coextension): Extending the assertion.
2620 * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
2621 setting flag Is_Dynamic_Coextension (and vice versa).
2623 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2625 * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
2626 level of a compilation unit, becuase they may contain nested
2627 subprograms that need an activation record.
2629 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2631 * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
2633 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2635 * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
2637 * sinfo.ads: Fix a typo.
2639 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2641 * inline.adb (Expand_Inlined_Call): If no optimization level is
2642 specified, the expansion of a call to an Inline_Always function is
2643 fully performed in the front-end even on a target that support back-end
2646 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2648 * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
2649 with Sec_Stack_Used.
2651 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2653 * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
2654 Is_Assignment_LHS further in. Use predicate
2655 Needs_Variable_Reference_Marker to determine whether to create a
2657 (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
2658 in. Use predicate Needs_Variable_Reference_Marker to determine whether
2659 to create a variable marker.
2660 * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
2661 checks that determine whether the identifier or expanded name is a
2662 suitable variable reference. The checks are now performed by
2663 Needs_Variable_Reference_Marker.
2664 * sem_res.adb (Resolve_Actuals): Use predicate
2665 Needs_Variable_Reference_Marker to determine whether to create a
2667 * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
2668 * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
2670 2018-06-11 Valentine Reboul <reboul@adacore.com>
2672 * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
2673 "Community Edition".
2675 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2677 * sem_ch12.adb (Install_Body): In order to determine the placement of
2678 the freeze node for an instance of a generic nested within another
2679 instance, take into account that the outer instance may be declared in
2680 the visible part of a package and the inner intance may be in the
2681 private part of the same package.
2683 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2685 * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
2687 2018-06-11 Nicolas Roche <roche@adacore.com>
2689 * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
2690 stack overflow while raising a constraint error.
2692 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2694 * repinfo.ads (Rep_Value): Use a single line.
2695 * repinfo.adb (Rep_Value): Likewise.
2696 (List_Attr): Do not use string concatenation.
2698 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2700 * exp_unst.adb (Visit_Node): Check reference to formal parameter of
2701 current procedure, because the bounds of its type may be uplevel
2704 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
2706 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
2707 not a definition, retrieve the expression only if it's a compile-time
2708 known value if we are just annotating types.
2710 * gcc-interface/utils.c (convert): Do not try to upcast properly for a
2711 conversion between tagged types in type_annotate_only mode.
2713 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
2715 * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
2716 * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
2717 type built for an aliased component with variable size.
2719 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2721 * doc/gnat_ugn/project-manager-figure.png: Delete.
2723 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2725 * vxworks-arm-link.spec, vxworks-e500-link.spec,
2726 vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
2727 vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
2728 vxworks-smp-x86-link.spec: New files.
2730 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2732 * gnatvsn.adb: Re-center the copyright header.
2733 * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
2735 2018-05-31 Fedor Rybin <frybin@adacore.com>
2737 * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
2738 gnattest section on user guide.
2740 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2742 * sem_res.adb (Resolve_String_Literal): If the type is a string type
2743 whose component subtype has a static predicate, ensure that the
2744 predicate is applied to each character by expanding the string into the
2745 equivalent aggregate. This is also done if the component subtype is
2748 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2750 * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
2752 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
2754 * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
2757 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2759 * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
2760 the type of the parameter is an unconstrained array type, convert
2761 to the type of the actual before the type of the formal only if the
2762 conversion was suppressed earlier. Use in_param and gnu_actual_type
2763 local variables throughout, and uniform spelling for In Out or Out.
2764 Also remove dead code in the component-by-reference case.
2766 2018-05-31 Frederic Konrad <konrad@adacore.com>
2768 * tracebak.c (STOP_FRAME): Harden condition.
2769 (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
2772 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2774 * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
2775 check to a call to a build-in-place function, given that the return
2776 object is limited and cannot be copied.
2778 2018-05-31 Olivier Hainque <hainque@adacore.com>
2780 * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
2783 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2785 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2786 there is no target, also create a temporary for the return value for
2787 an allocator if the type is an unconstrained record type with default
2790 2018-05-31 Hristian Kirtchev <kirtchev@adacore.com>
2792 * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
2793 boudary for a transient scope.
2795 2018-05-31 Valentine Reboul <reboul@adacore.com>
2797 * gnatvsn.ads: Rename "GPL" version to "Community".
2799 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2801 * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
2804 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
2806 * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
2807 with a semantically equivalent call to Defining_Entity.
2809 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
2811 * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
2812 Max_Queue_Length expression.
2814 2018-05-31 Sergey Rybin <rybin@adacore.com>
2816 * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
2817 that the main unit to be built before the call, now it computes the
2818 closure of the main unit itself.
2819 * gnat_ugn.texi: Regenerate.
2821 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2823 * repinfo.adb (List_Structural_Record_Layout): Set First to false
2824 after having listed the fields of the parent type, if any.
2826 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2828 * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
2829 deal with the ___XP suffix for packed array types here...
2830 <E_Array_Subtype>: ...or here when processing the implementation type
2831 but when processing the original type instead. Do not reuse the DECL
2832 of the implementation type for the original type. Tidy up.
2834 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2836 * einfo.ads (Object_Size_Clause): Declare.
2837 * einfo.adb (Object_Size_Clause): New function.
2838 * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
2839 retrieving Size_Clause and post the warning on the object size clause
2840 if Has_Object_Size_Clause is true.
2842 2018-05-31 Javier Miranda <miranda@adacore.com>
2844 * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
2845 * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
2846 Find_Primitive_Eq to search for the primitive of types whose underlying
2847 type is a tagged type.
2849 2018-05-31 Yannick Moy <moy@adacore.com>
2851 * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
2852 order of treatment between nodes recognized as loop pragmas (or
2853 generated from one) and block statements.
2855 2018-05-31 Doug Rupp <rupp@adacore.com>
2857 * libgnat/s-osprim__posix2008.adb (Clock): Implement using
2860 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2862 * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
2863 mark subprograms that cannot be eliminated because they must be treated
2864 as reachable from outside the current unit. This includes entry bodies
2865 and protected operations.
2867 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2869 * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
2870 Convert all operands of the generated code to Standard.Unsigned, to
2871 prevent spurious visibility errors. This is needed when the generated
2872 expansion involves a modular index type of an array type, and the index
2873 type is not immediately visible.
2875 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
2877 * einfo.ads (Package_Instantiation): Update comment after a routine
2878 that uses this field has been renamed.
2880 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2882 * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
2883 if the local raise statement includes a string expression. This
2884 expression might be picked up by an outer handler or discarded, but
2885 plays no role in this transformation.
2887 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2889 * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
2892 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2894 * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
2895 field in relevant nodes: Allocate, Free, and return statements.
2897 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2899 * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
2900 that has not been analyzed, as will be the case for a nested aggregate
2901 that is expanded into individual assignments.
2903 2018-05-30 Justin Squirek <squirek@adacore.com>
2905 * aspects.adb, aspects.ads: Register new aspect.
2906 * par-prag.adb (Prag): Register new pragma.
2907 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
2908 aspect similar to Aspect_Max_Queue_Length.
2909 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
2910 set it to use the same processing as Pragma_Max_Queue_Length.
2911 * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
2912 that it can be processed as a pragma in addition to a restriction and
2913 add an entry for the pragma itself.
2915 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2917 * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
2918 is now legal on a variable of composite type initialized with an
2919 aggregate that is fully static and requires no elaboration code.
2920 * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
2921 nested aggregates that are compile-time static, so they can be used to
2922 initialize variables declared with Threqd_Local_Storage.
2923 * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
2924 Thread_Local_Storage.
2925 * gnat_rm.texi: Regenerate.
2927 2018-05-30 Yannick Moy <moy@adacore.com>
2929 * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
2932 2018-05-30 Justin Squirek <squirek@adacore.com>
2934 * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
2936 (Start_Search): Modify to use Start_Search_Internal
2937 (Start_Search_Internal): Add to break out an extra flag for searching
2938 case insensative due to the potential for directories within the same
2939 OS to allow different casing schemes.
2940 * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
2941 for when the more precise solution fails.
2943 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2945 * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
2948 2018-05-30 Pascal Obry <obry@adacore.com>
2950 * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
2951 * libgnat/g-comlin.adb: Add corresponding implementation.
2953 2018-05-30 Gary Dismukes <dismukes@adacore.com>
2955 * sem_res.adb, sem_util.adb: Fix several typos.
2957 2018-05-30 Olivier Hainque <hainque@adacore.com>
2959 * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
2960 (eh_registration_ctors, eh_registration_tors): New static variables,
2961 forced in a .ctors/.dtors section, respectively, with priority.
2963 2018-05-30 Bob Duff <duff@adacore.com>
2965 * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
2966 freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
2967 sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
2968 sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
2969 sinfo.ads: Spell preanalysis, preanalyze correctly.
2971 2018-05-30 Bob Duff <duff@adacore.com>
2973 * libgnat/g-sestin.ads: Rework documentation comments.
2975 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
2977 * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
2978 sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
2979 (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
2981 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
2983 * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
2985 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2987 * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
2988 in a separate routine.
2989 (Is_Atomic_Object_Entity): New routine.
2990 (Is_Atomic_Prefix): Cleaned up.
2991 (Is_Synchronized_Object): Check that the object is atomic, or its type
2993 (Object_Has_Atomic_Components): Removed.
2994 * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
2995 (Is_Atomic_Object_Entity): New routine.
2997 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2999 * sem_ch3.adb (Access_Subprogram_Declaration): The flag
3000 Needs_Activation_Record is only needed on a subprogram type, not on a
3002 * sem_res.adb (Resolve_Selected_Component): If the context type and the
3003 component type are anonymous access to subprograms, use the component
3004 type to obtain the proper value of Needs_Activation_Record flag for the
3007 2018-05-30 Eric Botcazou <ebotcazou@adacore.com>
3009 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
3010 comment about the memset case.
3012 2018-05-30 Bob Duff <duff@adacore.com>
3014 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
3015 to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
3016 We need to analyze it as part of analyzing the block, so that if the
3017 call to Element that initializes Elmt_Decl returns on the secondary
3018 stack, the block will ss_mark/ss_release. This block is inside the
3019 loop; we don't want to leak memory until the loop exits. The purpose
3020 of analyzing Elmt_Decl first was to catch the error of modifying it,
3021 which is illegal because it's a loop parameter. The above causes us to
3022 miss that error. Therefore, we add a flag Is_Loop_Parameter, and set
3023 it on the Element entity, so we end up with an E_Variable node with the
3025 * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
3026 * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
3027 parameter not allowed" error if Is_Loop_Parameter.
3028 * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
3029 trigger the call to Diagnose_Non_Variable_Lhs.
3031 2018-05-30 Arnaud Charlet <charlet@adacore.com>
3033 * checks.adb (Apply_Scalar_Range_Check):
3034 * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
3035 range values for System.Priority in CodePeer mode since the actual
3036 target compiler may provide a wider range.
3038 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3040 * exp_unst.adb: Search specification of main unit as well, for
3043 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3045 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
3046 a package body that is a compilation unit may contain blocks that
3047 declare local subprograms. In Subprogram_Unnesting Mode such
3048 subprograms must be handled as nested inside the (implicit) elaboration
3049 procedure that executes that statement part. To handle properly uplevel
3050 references we construct that subprogram explicitly, to contain blocks
3051 and inner subprograms, The statement part of the compilation unit
3052 becomes a call to this subprogram. This is only done if blocks are
3053 present in the statement list of the body.
3055 2018-05-30 Bob Duff <duff@adacore.com>
3057 * exp_ch7.adb: Minor comment fix.
3059 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3061 * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
3062 that have no corresponding body and appear as attributes of the
3063 corresponding wrapper package declaration.
3064 (Register_Subprogram): New subprogram, used for subprogram bodies and
3065 for subprogram instantiations to enter callable entity into Subp table.
3067 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3069 * libgnat/s-secsta.adb: Reimplement the secondary stack support.
3070 * libgnat/s-secsta.ads: Update the documentation of all routines in the
3071 public part of the package. Reimplement the private part of the
3072 package to account for the new secondary stack structure. Add types
3073 and subprograms for testing purposes. Add several documentation
3076 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3078 * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
3079 exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
3080 libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
3081 sem_disp.ads, sem_util.adb: Minor reformatting.
3083 2018-05-30 Arnaud Charlet <charlet@adacore.com>
3085 * gcc-interface/Makefile.in: Move special flags for Ada runtime files
3087 * Makefile.rtl: ... to here. Update comments. Protect call to
3088 "GCC_FOR_TARGET" in case target_os isn't defined.
3090 2018-05-30 Arnaud Charlet <charlet@adacore.com>
3092 * gcc-interface/Makefile.in: Move target pair settings from here...
3093 * Makefile.rtl: ... to here.
3094 (setup-rts): New target.
3096 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3098 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
3099 List of All Switches): Replace "modules" with "units".
3100 (Subprogram Inlining Control): Likewise.
3101 * gnat_ugn.texi: Regenerate.
3102 * usage.adb (Usage): Fix description of -gnatn switch.
3104 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3106 * gcc-interface/Makefile.in: Fix typos.
3108 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3110 * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
3111 the finalizer procedure in the At_End handler, for use in LLVM
3114 2018-05-29 Javier Miranda <miranda@adacore.com>
3116 * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
3117 subprogram Inherits_From_Tagged_Full_View to identify more reliably
3118 untagged private types completed with a derivation of an untagged
3119 private whose full view is a tagged type.
3120 * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
3122 (Collect_Primitive_Operations): Handle untagged private types completed
3123 with a derivation of an untagged private type whose full view is a
3124 tagged type. In such case, collecting the list of primitives we may
3125 find two equality primitives: one associated with the untagged private
3126 and another associated with the ultimate tagged type (and we must
3127 remove from the returned list this latter one).
3129 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3131 * exp_unst.adb (Visit_Node): Handle statement sequences that include an
3134 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3136 * repinfo.adb (List_Entities): Also recurse into blocks without label.
3138 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3140 * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
3141 exceptions if subprogram unnesting is in effect, because these branch
3142 nodes are relevant only in the presence of nested subprograms.
3144 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3146 * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
3147 unconditionally when applied to the largest positive (resp. largest
3148 negative) value of a floating-point type.
3150 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3152 * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
3153 discriminants and exceptions are never components of such. The flag
3154 Needs_Activation_Record is set on subprogram types, not on access to
3157 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3159 * sem_ch3.adb: Set scope of component of subtype.
3161 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3163 * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
3164 carry no type. Such selected components appear in unit names that are
3165 child units, both in the specification and possibly in an end label for
3166 the unit, and they do not contain any relevant uplevel references.
3168 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3170 * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
3173 2018-05-29 Olivier Hainque <hainque@adacore.com>
3175 * libgnat/system-vxworks7-ppc-rtp.ads: New file.
3176 * libgnat/system-vxworks7-ppc-kernel.ads: New file.
3177 * libgnat/system-vxworks7-e500-rtp.ads: New file.
3178 * libgnat/system-vxworks7-e500-kernel.ads: New file.
3179 * libgnat/system-vxworks7-x86-rtp.ads: New file.
3180 * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
3181 * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
3182 gnat-crtbe link spec to use the vx7 variant.
3184 2018-05-29 Olivier Hainque <hainque@adacore.com>
3186 * vx_crtbegin.inc: Use a consistent naming convention for the
3187 registration/deregistration functions across RTP or kernel. Remove the
3188 ctor/dtor attribute setting based on RTP/kernel, expect the optional
3189 attribute extension to be provided by includers instead.
3190 * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
3191 extension for the registration/deregistration functions.
3192 * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
3193 constructor/destructor attribute extensions.
3194 * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
3195 attribute extensions and declare _ctors/_dtors arrays.
3196 * vx_crtbegin_auto.c: Remove.
3197 * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
3198 vxworks7-gnat-crtbe-link.spec.
3199 * libgnat/system-vxworks7-aarch64.ads: Likewise.
3200 * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
3201 * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
3202 * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
3203 * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
3204 * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
3205 * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
3206 * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
3208 2018-05-29 Piotr Trojanek <trojanek@adacore.com>
3210 * ali.adb: Minor reformatting.
3212 2018-05-29 Joel Brobecker <brobecker@adacore.com>
3214 * doc/gnat_ugn/platform_specific_information.rst: Update package
3215 requirements for 32bit GNAT on x86_64-linux.
3216 * gnat_ugn.texi: Regenerate.
3218 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3220 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
3221 Control): Adjust description of -gnatRj.
3222 * gnat_ugn.texi: Regenerate.
3223 * opt.ads (List_Representation_Info_To_JSON): Likewise.
3224 * repinfo.adb (List_Rep_Info): Do not automatically create a file
3225 if List_Representation_Info_To_JSON is true.
3226 * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
3227 check between -gnatRj and -gnatRs.
3228 * usage.adb (Usage): Adjust description of -gnatRj.
3230 2018-05-29 Pascal Obry <obry@adacore.com>
3232 * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
3235 2018-05-29 Pascal Obry <obry@adacore.com>
3237 * libgnat/s-os_lib.adb: Minor reformatting.
3239 2018-05-29 Doug Rupp <rupp@adacore.com>
3241 * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
3242 * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
3243 * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
3244 * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
3246 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3248 * repinfo.ads (JSON format): Document new pair for components.
3249 * repinfo.adb (Derived_Discriminant): New function.
3250 (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
3251 in recursive calls. If the record type is the parent of an extension,
3252 find and list the derived discriminant from the extension, if any.
3253 (List_Component_Layout): List the Discriminant_Number in JSON mode.
3254 (List_Record_Info): Adjust call to List_Structural_Record_Layout.
3256 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3258 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
3259 List of All Switches): Document -gnatRj.
3260 (Debugging Control): Likewise.
3261 * gnat_ugn.texi: Regenerate.
3262 * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
3263 * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
3264 extension if List_Representation_Info_To_JSON is true.
3265 * repinfo.ads: Document the JSON output format.
3266 * repinfo.adb (List_Location): New procedure.
3267 (List_Array_Info): Add support for JSON output.
3268 (List_Entities): Likewise.
3271 (Print_Expr): Likewise.
3272 (List_Linker_Section): Likewise.
3273 (List_Mechanisms): Likewise.
3274 (List_Name): Likewise.
3275 (List_Object_Info): Likewise.
3276 (List_Record_Info): Likewise.
3277 (List_Component_Layout): Likewise. Add Indent parameter.
3278 (List_Structural_Record_Layout): New procedure.
3279 (List_Attr): Add support for JSON output.
3280 (List_Type_Info): Likewise.
3281 (Write_Unknown_Val): Likewise.
3282 * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
3283 * usage.adb (Usage): List -gnatRj.
3285 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3287 * repinfo.adb (List_Component_Layout): New procedure extracted from...
3288 (List_Record_Layout): ...here. Invoke it.
3290 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3292 * repinfo.adb (Write_Unknown_Val): New procedure.
3293 (List_GCC_Expression): Call it.
3294 (List_Record_Layout): Likewise.
3295 (Write_Val): Likewise.
3297 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3299 * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
3302 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3304 * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
3305 This breaks build of cross compilers with older versions of GNAT, so
3308 2018-05-29 Doug Rupp <rupp@adacore.com>
3310 * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
3313 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3315 * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
3317 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3319 * repinfo.adb (List_Entities): Do not list the Linker_Section for
3321 (List_Mechanisms): ...but here instead. Use consistent name output
3322 and formatting conventions.
3324 2018-05-29 Bob Duff <duff@adacore.com>
3326 * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
3328 * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
3329 To_Mixed): New functions.
3330 * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
3331 allows both '\' and '/' on Windows.
3333 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3335 * repinfo.ads: Minor fixes and tweaks in comments.
3337 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3339 * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
3340 it with calls to Unop.
3342 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3344 * repinfo.ads (TCode): Adjust range.
3345 (Truth_Andif_Expr): Remove.
3346 (Truth_Orif_Expr): Likewise.
3347 (Truth_And_Expr .. Dynamic_Val): Adjust value.
3348 * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
3349 (Rep_Value): Likewise.
3350 * repinfo.h (Truth_Andif_Expr): Remove.
3351 (Truth_Orif_Expr): Likewise.
3352 (Truth_And_Expr .. Dynamic_Val): Adjust value.
3353 * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
3354 through to TRUTH_AND_EXPR case.
3355 <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
3357 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3359 * exp_unst.adb (Visit_Node): For indexed components and attribute
3360 references, examine index expressions or associated expressions as well
3361 to record uplevel references.
3362 (Vist_Node): For function and procedure calls, if a formal is an
3363 unconstrained array and the actual is constrained, check whether bounds
3364 of actual have uplevel references.
3366 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3368 * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
3369 they can appear as components of activation records.
3370 * exp_unst.adb (Visit_Node): A reference to an exception may be an
3373 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3375 * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
3376 depends on a discriminant manually instead of using the predicate
3377 Size_Depends_On_Discriminant in the array type case.
3379 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3381 * exp_unst.adb (Check_Static_Type): For a record subtype, check
3382 discriminant constraints as well.
3383 (Visit_Node): For a selected component, check type of prefix, as is
3384 done for indexed components and slices.
3386 2018-05-28 Javier Miranda <miranda@adacore.com>
3388 * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
3389 value when converting a float value to a fixed-point value. This is
3390 required for CCG because it handles fixed-point types by means of
3391 unsigned integer type variables. The range check is now performed using
3392 the integer value stored in this temporary.
3394 2018-05-28 Yannick Moy <moy@adacore.com>
3396 * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
3397 Length as valid non-interfering contexts for SPARK.
3399 2018-05-28 Claire Dross <dross@adacore.com>
3401 * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
3402 generic inheritance utilities.
3403 (Generic_Inherited_Subprograms): Generic version of
3404 Inherited_Subprograms, generic in Find_Dispatching_Type function.
3405 (Generic_Is_Overriding_Subprogram): Generic version of
3406 Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
3407 (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
3408 Sem_Disp.Find_Dispatching_Type.
3409 (Is_Overriding_Subprogram): Instance of
3410 Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
3411 (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
3412 with Sem_Disp.Find_Dispatching_Type.
3414 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3416 * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
3417 component type, do not expand array equality using the unconstrained
3418 base type, except for the case where the bounds of the type depend on a
3421 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3423 * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
3424 access-to-subprogram types, to indicate that an indirect call through
3425 such a type requires an activation record when compiling for LLVM.
3426 * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
3428 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3430 * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
3431 when bounds of fixed type are static, to remove some spuerfluous
3432 implicit conversions and provide an accurate result when converting
3433 back and forth between the fixed point type and a floating point type.
3435 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3437 * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
3440 2018-05-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3442 * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
3443 replaced, if any; all callers changed.
3444 (Note_Uplevel_Ref): Likewise. Also replace reference to deferred
3445 constant with private view so we take the address of that entity.
3446 (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
3447 any; all callers changed. Handle N_Indexed_Component like
3448 N_Attribute_Reference. Add N_Type_Conversion case.
3449 (Visit_Node): Indexed references can be uplevel if the type isn't
3451 (Unnest_Subprograms): Don't rewrite if no reference given. If call has
3452 been relocated, set first_named pointer in original node as well.
3454 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3456 * exp_aggr.adb (Flatten): Copy tree of expression in a component
3457 association with a range or a set of discrete choices, rather than
3458 relocating the node. This avoids inconsistencies in the tree when
3459 handling nested subprograms with uplevel references for LLVM.
3461 2018-05-28 Arnaud Charlet <charlet@adacore.com>
3463 * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
3466 2018-05-28 Arnaud Charlet <charlet@adacore.com>
3468 * exp_unst.adb: Fix typo.
3470 2018-05-28 Bob Duff <duff@adacore.com>
3472 * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
3473 unnecessary use of 'Unrestricted_Access.
3475 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3477 * repinfo.adb (Expr_Value_S): New routine.
3478 (List_Linker_Section): Properly extract the value of the section
3481 2018-05-28 Patrick Bernardi <bernardi@adacore.com>
3483 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
3484 description of the -D binder switch to reflect current usage.
3485 * gnat_ugn.texi: Regenerate.
3487 2018-05-28 Gary Dismukes <dismukes@adacore.com>
3489 * exp_ch3.adb: Minor reformatting
3491 2018-05-28 Justin Squirek <squirek@adacore.com>
3494 (Build_Initialization_Call): Add logic to pass the appropriate actual to match
3496 (Init_Formals): Add new formal *_skip_null_excluding_check
3497 * exp_util.adb, exp_util.ads
3498 (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
3500 (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
3501 (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
3502 used to determine how to generate an Init_Proc for a given type.
3503 (Needs_Constant_Address): Minor reformatting
3505 (Resolve_Null): Add logic to generate a conditional check in certain cases
3507 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3509 * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
3512 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3514 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
3515 the declarations of single concurrent types because they fall in the
3516 category of full type and object declarations.
3518 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3520 * repinfo.adb (Compute_Max_Length): Skip _Parent component.
3521 (List_Record_Layout): Likewise.
3523 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3525 * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
3526 includes a call to function to which it applies. This may mean an
3527 omission of an attribute reference 'Result, in particular if the
3528 function is pqrameterless.
3530 2018-05-28 Justin Squirek <squirek@adacore.com>
3532 * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
3533 misresolved package name is not a case of mistaken identity.
3535 2018-05-28 Yannick Moy <moy@adacore.com>
3537 * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
3538 GNATprove mode, as the order of resolution (low then high) means that
3539 all the information is not available when resolving the low bound the
3542 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3544 * repinfo.adb (List_Array_Info): Start with an explicit blank line and
3545 end with the linker section, if any.
3546 (List_Entities): Do not output the linker section for record types,
3547 array types and variables.
3548 (Print_Expr): Factor out common processing for unary operators and
3549 special values. Adjust and reorder the various cases.
3550 (List_Object_Info): End with the linker section, if any.
3551 (List_Record_Info): Likewise.
3552 (List_Type_Info): Do not start with a blank line.
3554 2018-05-25 Nicolas Roche <roche@adacore.com>
3556 * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
3557 that the result will be either -infinite or +infinite.
3559 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
3561 * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
3562 libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
3563 Expand range of type to match the address space of the target.
3564 (Task_Storage_Size): Remove unused type.
3566 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3568 * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
3569 of a fixed point type and the parent is a multiplying operation,
3570 resolve the operand with its own type because the context will impose a
3571 resulting type on the result of the multiplication by means of
3572 approriate conversion.
3574 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3576 * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
3577 the in-place initialization aggregate created for pragmas
3578 Initialize_Scalars or Normalize_Scalars is performed with checks
3581 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3583 * exp_aggr.adb (Convert_To_Positional): Bump default for
3584 Max_Others_Replicate to 32. Update comments.
3585 * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
3586 (No_File_Info_Cache): Initialize separately.
3587 * osint.adb (No_File_Info_Cache): Update initializer.
3589 2018-05-25 Javier Miranda <miranda@adacore.com>
3591 * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
3592 test when the left operand is a class-wide interface and the right
3593 operand is not a class-wide type.
3594 * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
3597 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3599 * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
3600 in an others clause to prevent visibility issues with the generated
3602 (Component_OK_For_Backend): Return false for a quantified expression.
3603 (Check_Static_Component): Ditto.
3605 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3607 * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
3608 (SS_Allocate_Dynamic): New routine. The allocation logic is now split
3609 into three distring cases rather than in one loop which attempts to
3610 handle all three cases. This rewrite eliminates an issue where the last
3611 frame of the stack cannot be freed, thus causing the memory range of a
3612 new frame to approach the overflow point of the memory index type.
3613 Since the overflow is logically treated as a
3614 too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
3615 (SS_Allocate_Static): New routine. The routine factorizes the static
3616 secondary stack-related code from the former SS_Allocate.
3618 2018-05-25 Sergey Rybin <rybin@adacore.com>
3620 * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
3621 option for gnatelim.
3623 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3625 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
3626 Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
3627 is created when the proper body of the stub is analyzed.
3628 * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
3629 is the proper body of a subunit, the cloned body must be inserted in
3630 the declarative list that contains the stub.
3632 2018-05-25 Justin Squirek <squirek@adacore.com>
3634 * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
3635 generate code for 6.5(8-10) so that we don't get an assertion error
3636 when dealing with an incomplete return type.
3638 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3640 * pprint.adb (Expression_Name): Strip too long expressions to avoid
3641 carrying very large strings.
3643 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
3645 * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
3648 2018-05-25 Doug Rupp <rupp@adacore.com>
3650 * tracebak.c (aarch64-linux): Implement.
3652 2018-05-25 Justin Squirek <squirek@adacore.com>
3654 * sem_ch8.adb: Minor reformatting.
3656 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
3658 * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
3661 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3663 * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
3664 pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
3667 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3669 * sem_ch12.adb (Instance_Exists): New function, subsidiary of
3670 Validate_Derived_Type_Instance, to verify that all interfaces
3671 implemented by the formal type are also implemented by the actual. The
3672 verification is complicated when an interface of the formal is declared
3673 in a generic unit and the actual is declared in an instance of it.
3674 There is currently no mechanism to relate an interface declared within
3675 a generic to the corresponding interface in an instance, so we must
3676 traverse the list of interfaces of the actual, looking for a name
3677 match, and verifying that that interface is declared in an instance.
3679 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
3681 * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
3682 assertions; replace function versions of Next_Formal/Next_Actual with
3683 their procedural versions (which are more concise).
3685 2018-05-25 Doug Rupp <rupp@adacore.com>
3687 * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
3688 libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
3689 libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
3690 libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
3691 libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
3692 (Relative_Timed_Wait): Remove.
3693 * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
3694 for incremental looping. Remove references to Rel_Time and
3695 Relative_Timed_Wait.
3696 * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
3697 (Timed_Delay): Make separate.
3698 * libgnat/s-optide.adb: New separate procedure.
3699 * libgnat/s-osprim.ads (Max_System_Delay): New constant.
3700 * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
3701 (Max_System_Delay): New constant.
3703 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3705 * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
3706 for a formal derived type implements all the interfaces declared for
3709 2018-05-25 Yannick Moy <moy@adacore.com>
3711 * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
3712 and GNATprove modes when applicable policy is Ignore.
3714 2018-05-25 Eric Botcazou <ebotcazou@adacore.com>
3716 * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
3717 boolean type with convention C.
3718 * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
3719 * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
3720 FOREIGN and use it throughout the function.
3721 <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
3723 <E_Enumeration_Subtype>: Likewise for subtypes.
3724 <E_Record_Type>: Force the size of a storage unit on empty classes.
3725 * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
3726 boolean types with precision 1 if the size is the expected one.
3728 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3730 * pprint.adb (Expression_Name): Do not print non ASCII characters.
3732 2018-05-25 Bob Duff <duff@adacore.com>
3734 * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
3735 libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
3737 2018-05-25 Bob Duff <duff@adacore.com>
3739 * sem_util.ads: Minor comment fix.
3741 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3743 * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
3744 prefixes of array attributes, to prefixes that are entity names whose
3745 type is constrained.
3746 (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
3747 subprogram, as itype created for loops in pre/postcondition may appear
3748 in loops at the library level.
3750 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3752 * sem_ch13.adb (Build_Predicate_Functions): The predicate function
3753 declaration is inserted into the tree and analyzed at that point, so
3754 should not be reinserted when the body is constructed. Inside a
3755 generic, ensure that the body is not inserted twice in the tree.
3757 2018-05-25 Yannick Moy <moy@adacore.com>
3759 * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
3760 declarations not coming from source.
3762 2018-05-25 Fedor Rybin <frybin@adacore.com>
3764 * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
3765 --copy-environment for gnattest.
3767 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
3769 * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
3771 * sem_prag.adb (Get_Base_Subprogram): Same as above.
3773 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
3775 * fe.h (Set_Normalized_First_Bit): Declare.
3776 (Set_Normalized_Position): Likewise.
3777 * repinfo.adb (List_Record_Layout): Do not use irregular output for a
3778 variable position. Fix minor spacing issue.
3779 * gcc-interface/decl.c (annotate_rep): If a field has a variable
3780 offset, compute the normalized position and annotate it in addition to
3783 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
3785 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
3786 Constify and rename variables. Fix formatting.
3787 (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
3788 <N_Raise_Statement>: Likewise.
3790 2018-05-24 Javier Miranda <miranda@adacore.com>
3792 * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
3793 body of a variant record equality renaming.
3794 (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
3795 implementation of Build_Body_For_Renaming.
3796 * exp_ch3.ads (Build_Variant_Record_Equality): New library level
3797 function that factorizes the functionality needed by
3798 Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
3799 of a variant record equality subprogram.
3800 * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
3801 (Build_Variant_Record_Equality): New local procedure of
3802 Expand_Freeze_Record_Type containing all the code specific for freezing
3803 the record type that cannot be place in the new library level function.
3805 2018-05-24 Ed Schonberg <schonberg@adacore.com>
3807 * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
3808 in_parameters, used when unesting subprograms for LLVM, to indicate
3809 that a generated parameter carries the activation record from the
3810 enclosing subprogram.
3811 * exp_unst.adb (Check_Static_Type): Handle array attributes of types
3812 whose bounds may contain up-level references that need to be added to
3813 an activation recoord.
3814 (Add_Extra_Formal): Set Is_Activation_Record on new formal.
3816 2018-05-24 Yannick Moy <moy@adacore.com>
3818 * pprint.adb (Expression_Image): Improve the printing of expressions,
3819 by taking more cases into account, in particular qualified expressions
3820 and aggregates. Also count more the number of parentheses to close
3821 after the expression.
3823 2018-05-24 Javier Miranda <miranda@adacore.com>
3825 * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
3826 check for renamed discriminants.
3827 * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
3828 Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
3829 Is_Visible_Component pass the associated selector node to allow
3830 checking renamed discriminants on untagged types.
3832 2018-05-24 Ed Schonberg <schonberg@adacore.com>
3834 * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
3835 link to a use_type clause if this would cause an infinite loop in the
3836 machinery that detects redundant use clauses. This may happen when the
3837 redundant clauses appear in the context of a child unit and the context
3840 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
3842 * sinfo.ads: Fix grammar in comment.
3844 2018-05-24 Justin Squirek <squirek@adacore.com>
3846 * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
3847 and manage doubly-linked entity chain.
3848 (Nested_Scenarios): Removed entity field used for optimization during
3849 elaboration to make room for the new field Prev_Entity.
3850 (Link_Entities): Added to replace redundant calls to Set_Next_Entity
3851 and Set_Prev_Entity as well as centralize changes to the entity chain.
3852 (Predicated_Parent): Modified to use Node38.
3853 (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
3855 (Remove_Entity): Moved from sem_util.
3856 (Set_Nested_Scenarios): Deleted.
3857 (Set_Predicated_Parent): Modified to use Node38.
3858 (Set_Prev_Entity): Added to set Prev_Entity field.
3859 (Set_Validated_Object): Modified to use Node38.
3860 (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
3862 (Validated_Object): Modified to use Node38.
3863 (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
3864 predicated parent cases.
3865 (Write_Field38_Name): Add predicated parent and Validated_Object cases.
3866 * sem_ch3.adb (Process_Subtype): Add guard to protect against
3867 inappropriate marking of Predicated_Parent to non-itype subtypes.
3868 (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
3869 (Copy_And_Swap): Add setting of Prev_Entity.
3870 (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
3871 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
3873 (New_Overloaded_Entity): Remove block created to search for previous
3874 entities in the entity chain with relevant calls to Prev_Entity as well
3875 as replace duplicated code from Remove_Entity_And_Homonym with a call
3877 * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
3879 * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
3880 initial subprogram declarations related to Nested_Scenarios.
3881 (Process_Nested_Scenarios): Deleted.
3882 (Save_Scenario): Deleted.
3883 (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
3884 node space in the entity tree.
3885 * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
3886 (Remove_Entity_And_Homonym): Added to separate functionality of
3887 Remove_Entity from the homonym chain directly.
3888 * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
3889 w/ Link_Entities and Unlink_Next_Entity.
3890 * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
3892 * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
3893 Set_Next_Entity w/ Link_Entities.
3894 * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
3895 Link_Entities and Unlink_Next_Entity.
3896 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
3897 call to Remove_Entity with its new incarnation.
3898 * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
3899 * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
3902 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3904 * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
3905 Install_Limited_Withed_Unit.
3906 (Expand_With_Clause): Update the call to Install_Withed_Unit.
3907 (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
3908 (Install_Context_Clauses): Update the call to Install_Withed_Unit.
3909 (Install_Limited_Context_Clauses): Update the calls to
3910 Install_Limited_Withed_Unit.
3911 (Install_Limited_Withed_Unit): Renamed to better illustrate its
3913 (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
3914 and Install_Limited_Withed_Unit.
3915 (Install_With_Clause): Uninstall a limited with clause if a [private]
3916 with clause is given for the same package.
3917 (Install_Withed_Unit): Renamed to better illustrate its purpose.
3918 (Remove_Limited_With_Unit): New routine.
3920 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
3922 * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
3923 (__gnat_personality_seh0): Adjust and beef up comments, and
3924 fix formatting throughout.
3925 (__gnat_adjust_context): Deal minimally with version 2.
3926 * seh_init.c (__gnat_map_SEH): Fix formatting.
3927 (_gnat_SEH_error_handler): Adjust comments.
3928 (__gnat_install_SEH_handler): Fix formatting.
3930 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3932 * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
3934 2018-05-24 Ed Schonberg <schonberg@adacore.com>
3936 * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
3937 aggregate with static bounds when named associations cover all index
3938 positions and the others clause is redundant.
3940 2018-05-24 Raphael Amiard <amiard@adacore.com>
3942 * libgnat/a-cohama.ads: Add documentation.
3944 2018-05-24 Raphael Amiard <amiard@adacore.com>
3946 * libgnat/a-convec.ads: Add documentation.
3948 2018-05-24 Justin Squirek <squirek@adacore.com>
3950 * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
3951 expansion for limited tagged types when the node to be expanded is a
3952 raise expression due to it not representing a valid object.
3953 * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
3954 message regarding assignments to limited types to ignore genereated
3957 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3959 * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
3960 Ghost-related attributes of the class-wide subtype because the copy
3963 2018-05-24 Justin Squirek <squirek@adacore.com>
3965 * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
3966 marking use clauses as effective when the reference appears within
3969 2018-05-24 Cyrille Comar <comar@adacore.com>
3971 * doc/gnat_rm/the_gnat_library.rst: Fix typos.
3972 * gnat_rm.texi: Regenerate.
3974 2018-05-24 Bob Duff <duff@adacore.com>
3976 * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
3977 for build-in-place functions with a caller-unknown-size result.
3978 (Create_Finalizer): For build-in-place functions with a
3979 caller-unknown-size result, check at run time whether we need to
3980 release the secondary stack.
3982 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3984 * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
3985 generated incomplete type.
3987 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3989 * expander.adb (Expand): Update the save and restore of the Ghost
3991 * exp_ch3.adb (Freeze_Type): Likewise.
3992 * exp_disp.adb (Make_DT): Likewise.
3993 * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
3994 (Build_DIC_Procedure_Declaration): Likewise.
3995 (Build_Invariant_Procedure_Body): Likewise.
3996 (Build_Invariant_Procedure_Declaration): Likewise.
3997 (Make_Predicate_Call): Likewise.
3998 * freeze.adb (Add_To_Result): Insert the freeze action of a living
3999 entity prior to the start of the enclosing ignored Ghost region.
4000 (Freeze_Entity): Update the save and restore of the Ghost region.
4001 * ghost.adb (Install_Ghost_Mode): Reimplemented.
4002 (Install_Ghost_Region): New routine.
4003 (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
4004 (Mark_And_Set_Ghost_Body): Likewise.
4005 (Mark_And_Set_Ghost_Completion): Likewise.
4006 (Mark_And_Set_Ghost_Declaration): Likewise.
4007 (Mark_And_Set_Ghost_Instantiation): Likewise.
4008 (Mark_And_Set_Ghost_Procedure_Call): Likewise.
4009 (Name_To_Ghost_Mode): New routine.
4010 (Restore_Ghost_Region): New routine.
4011 * ghost.ads (Install_Ghost_Region): New routine.
4012 (Restore_Ghost_Region): New routine.
4013 * opt.ads: Add new global variable Ignored_Ghost_Region.
4014 * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
4015 region. Install a clean region.
4016 * sem.adb (Analyze): Likewise.
4017 (Do_Analyze): Likewise.
4018 * sem_ch3.adb (Analyze_Object_Declaration): Likewise
4019 (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
4020 capture the ultimate alias of the current primitive.
4021 (Process_Full_View): Update the save and restore of the Ghost region.
4022 Do not inherit DIC and invariant procedures.
4023 * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
4025 * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
4026 (Analyze_Subprogram_Body_Helper): Likewise.
4027 * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
4028 * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
4029 (Analyze_Subprogram_Instantiation): Likewise.
4030 (Instantiate_Package_Body): Likewise.
4031 (Instantiate_Subprogram_Body): Likewise.
4032 * sem_ch13.adb (Build_Predicate_Functions): Likewise.
4033 (Build_Predicate_Function_Declaration): Likewise.
4035 (Add_Dispatching_Operation): Do not consider DIC and invariant
4037 (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
4038 a dispatching subprogram.
4039 (Check_Operation_From_Private_View): Likewise.
4040 (Override_Dispatching_Operation): Likewise.
4041 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
4042 and restore of the Ghost region.
4043 (Analyze_Initial_Condition_In_Decl_Part): Likewise.
4044 (Analyze_Pragma): Update the save and restore of the Ghost region.
4045 (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
4046 * sem_util.adb (Is_Suitable_Primitive): New routine.
4047 * sem_util.ads (Is_Suitable_Primitive): New routine.
4048 * sinfo.ads: Update the section of Ghost regions.
4050 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
4052 * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
4053 Change "condition" to "case guard" after renaming in the contract
4055 * gnat_rm.texi: Regenerate.
4057 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4059 * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
4060 construct with discrete choices no longer contains a subtype with
4061 predicates since the expansion already handled this case.
4063 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4065 * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
4066 conversion to the return type to avoid a side effect where an imported
4067 relocated function generates a new anonymous access type, whose
4068 accessibility level does not agree with with that of the wrapper.
4070 2018-05-24 Javier Miranda <miranda@adacore.com>
4072 * sem_util.adb (Abstract_Interface_List): Add missing support for
4073 private types whose full view is a synchronized type.
4074 * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
4075 derivation of a private type parent type is a task type with
4076 discriminants as gigi does not use such type directly.
4078 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4080 * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
4081 variable marker when the reference appears in the formal part of a
4082 compilation unit instance because there is no place to insert it.
4083 (In_Compilation_Instance_Formal_Part): New routine.
4085 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
4087 * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
4088 configuration parameter.
4090 2018-05-24 Doug Rupp <rupp@adacore.com>
4092 * argv-lynxos178-raven-cert.c: New file.
4093 * libgnat/system-lynxos178-x86.ads: New file.
4095 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4097 * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
4098 Minor reformattings.
4100 2018-05-23 Pascal Obry <obry@adacore.com>
4102 * adaint.c (win32_wait): Properly free the handle/pid lists when
4103 WaitForMultipleObjects fails (return WAIT_FAILED).
4105 2018-05-23 Pascal Obry <obry@adacore.com>
4107 * adaint.c (win32_wait): Add missing parentheses.
4109 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4111 * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
4112 (Expand_N_Object_Declaration): Do not check for a large modular array
4114 * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
4115 (Freeze_Object_Declaration): Code cleanup. Check for a large modular
4117 * sem_ch3.adb: Minor reformatting.
4119 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4121 * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
4122 retrieval of the applicable predicate function to an itype created for
4123 a constrained array component.
4124 * einfo.adb: Subprograms for Predicated_Parent.
4125 (Predicate_Function): Use new attribute.
4126 * exp_util.adb (Make_Predicate_Call): If the predicate function is not
4127 available for a subtype, retrieve it from the base type, which may have
4128 been frozen after the subtype declaration and not captured by the
4129 subtype declaration.
4130 * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
4131 legal within a generated initiqlization procedure, as may happen with a
4132 predicate check on a component, when the predicate function applies to
4133 the base type of the component.
4134 * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
4135 predicates for subtype declarations and for subtype indications in
4137 (Process_Subtype): Likewise. Handle properly the case of a private type
4138 with unknown discriminants whose full view is an unconstrained array.
4139 Use Predicated_Parent to indicate source of predicate function on an
4140 itype whose parent is itself an itype.
4141 (Complete_Private_Subtype): If the private view has unknown
4142 discriminants and the full view is an unconstrained array, set base
4143 type of completion to the full view of parent.
4144 (Inherit_Predicate_Flags): Prevent double assignment of predicate
4146 (Build_Subtype): For a constrained array component, propagate predicate
4147 information from original component type declaration.
4149 2018-05-23 Boris Yakobowski <yakobowski@adacore.com>
4151 * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
4153 2018-05-23 Arnaud Charlet <charlet@adacore.com>
4155 * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
4157 * sem_elab.adb: Make "out" parameters instead of "in out" when
4160 2018-05-23 Bob Duff <duff@adacore.com>
4162 * gnatbind.adb (List_Applicable_Restrictions): Add
4163 No_Implementation_Restrictions to the list of restrictions not to list.
4164 Remove double negative "not No_Restriction_List". Comment the
4165 commentary that is output, so it won't cause errors if used directly in
4168 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4170 * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
4171 class-wide precondition on a type extension when ancestor does not have
4172 a class-wide precondition. Previously the compiler accepted such a
4173 precondition when the ancestor had a class-wide postcondition.
4175 2018-05-23 Javier Miranda <miranda@adacore.com>
4177 * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
4178 the warning on occurrences of this attribute whose evaluation is always
4179 true (since that subprogram aborts processing the attribute). In
4180 addition, replace the node by its boolean result 'True' (required
4181 because the backend has no knowledge of this attribute).
4183 2018-05-23 Bob Duff <duff@adacore.com>
4185 * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
4186 code in question is not reachable in the case where Count_Type'Last is
4189 2018-05-23 Yannick Moy <moy@adacore.com>
4191 * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
4192 local pragma Warnings Off without On.
4193 * gnat_rm.texi: Regenerate.
4195 2018-05-23 Olivier Hainque <hainque@adacore.com>
4197 * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
4198 * libgnat/g-excact.adb: Implement.
4200 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4202 * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
4203 is present, verify its legality when the domain of iteration is a
4204 GNAT-specific formal container, as is already done for arrays and
4205 predefined containers.
4207 2018-05-23 Yannick Moy <moy@adacore.com>
4209 * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
4210 declaration, which was not taken into account.
4212 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4214 * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
4215 synchronized suspension.
4216 * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
4217 Ada.Synchronous_Task_Control and routines Suspend_Until_True and
4219 * sem_elab.adb: Document switch -gnatd_s.
4220 (In_Task_Body): New routine.
4221 (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
4222 body when the current construct denotes a synchronous suspension call,
4223 and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
4225 (Is_Synchronous_Suspension_Call): New routine.
4226 * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
4229 2018-05-23 Javier Miranda <miranda@adacore.com>
4231 * exp_disp.adb (Make_DT): Restrict the initialization of
4232 External_Tag and Expanded_Name to an empty string to the case where
4233 both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
4234 restricted runtimes are compiled with pragma Discard_Names.
4235 * doc/gnat_rm/implementation_defined_pragmas.rst,
4236 doc/gnat_rm/implementation_defined_characteristics.rst: Add
4238 * gnat_rm.texi: Regenerate.
4240 2018-05-23 Maroua Maalej <maalej@adacore.com>
4242 * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
4244 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4246 * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
4247 iteration of an Ada2012 loop is performed to determine the type of the
4248 domain, but full analysis is performed once the loop is rewritten as a
4249 while-loop during expansion. The pre-analysis suppresses expansion; it
4250 must also suppress the generation of freeze nodes, which may otherwise
4251 appear in the wrong scope before rewritting.
4253 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4255 * sem_elab.adb: Update the section on suppressing elaboration warnings.
4257 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4259 * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
4260 Is_Elaboration_Target.
4261 (Is_Elaboration_Target): New routine.
4262 (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
4263 (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
4264 (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
4265 Is_Elaboration_Target.
4266 * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
4267 with occurrences in nodes.
4268 (Is_Elaboration_Target): New routine.
4269 * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
4270 elaboration target is subject to pragma Warnings (Off, ...).
4272 2018-05-23 Eric Botcazou <ebotcazou@adacore.com>
4274 * repinfo.adb (List_Type_Info): Remove obsolete stuff.
4276 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4278 * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
4279 (Is_Elaboration_Warnings_OK_Id): New routine.
4280 (Set_Is_Elaboration_Warnings_OK_Id): New routine.
4281 (Write_Entity_Flags): Output Flag304.
4282 * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
4283 occurrences in entities.
4284 (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
4285 (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
4287 * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
4288 elaboration warnings.
4289 * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
4290 elaboration warnings.
4291 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
4292 state of elaboration warnings.
4293 (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
4295 (Analyze_Subprogram_Declaration): Capture the state of elaboration
4297 * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
4298 elaboration warnings.
4299 (Analyze_Single_Task_Declaration): Capture the state of elaboration
4301 (Analyze_Task_Type_Declaration): Capture the state of elaboration
4303 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
4304 of elaboration warnings.
4305 (Analyze_Generic_Subprogram_Declaration): Capture the state of
4306 elaboration warnings.
4307 * sem_elab.adb: Add a section on suppressing elaboration warnings.
4308 Type Processing_Attributes includes component Suppress_Warnings
4309 intended to suppress any elaboration warnings along a path in the
4310 graph. Update Initial_State to include a value for this component.
4311 Types Target_Attributes and Task_Attriutes include component
4312 Elab_Warnings_OK to indicate whether the target or task has elaboration
4313 warnings enabled. component Elab_Warnings_OK.
4314 (Build_Access_Marker): Propagate attribute
4315 Is_Elaboration_Warnings_OK_Node from the attribute to the generated
4317 (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
4318 (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
4319 (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
4320 (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
4321 when already in this mode or when the attribute or target have warnings
4323 (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
4324 if warnings are suppressed.
4325 (Process_Conditional_ABE_Call): Suppress further elaboration warnings
4326 when already in this mode, or the target or call have warnings
4328 (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
4329 warnings are suppressed.
4330 (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
4331 warnings are suppressed.
4332 (Process_Conditional_ABE_Instantiation): Suppress further elaboration
4333 warnings when already in this mode or when the instantiation has
4334 warnings suppressed.
4335 (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
4336 diagnostics if warnings are suppressed.
4337 (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
4338 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4339 (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
4340 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4341 (Process_Task_Object): Suppress further elaboration warnings when
4342 already in this mode, or when the object, activation call, or task type
4343 have warnings suppressed. Update the processing state to indicate that
4344 the path goes through a task body.
4345 * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
4347 (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
4348 * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
4349 attribute references.
4351 2018-05-23 Piotr Trojanek <trojanek@adacore.com>
4353 * einfo.ads: Minor reformatting.
4355 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4357 * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
4358 anonymous_access_to_ subprogram formal, apply a conversion to force an
4359 accsssibility check that will fail statically, enforcing 3.10.2 (13).
4361 2018-05-23 Daniel Mercier <mercier@adacore.com>
4363 * gnat1drv.adb: Turn off length expansion in CodePeer mode.
4365 2018-05-23 Bob Duff <duff@adacore.com>
4367 * freeze.adb: (Check_Address_Clause): Deal with build-in-place
4368 aggregates in addition to build-in-place calls.
4370 2018-05-23 Bob Duff <duff@adacore.com>
4372 * einfo.ads: Minor reformatting.
4373 * sem_ch3.adb: Likewise.
4374 * sinfo.ads: Likewise.
4376 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4378 * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
4379 initialization when the component type has predicates.
4380 * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
4381 allocation when the component type has predicates.
4383 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4385 * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
4388 2018-05-22 Justin Squirek <squirek@adacore.com>
4390 * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
4391 original function spec into the generated function spec due to
4392 expansion of expression functions during analysis.
4393 (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
4394 references from the body to the subprogram spec in the case of
4395 expression functions because of inconsistances related to having a
4397 * libgnarl/s-osinte__android.ads: Flag parameters as unused.
4398 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
4399 * libgnarl/s-osinte__qnx.adb: Likewise.
4400 * libgnarl/s-osinte__qnx.ads: Likewise.
4402 2018-05-22 Doug Rupp <rupp@adacore.com>
4404 * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
4407 2018-05-22 Olivier Hainque <hainque@adacore.com>
4409 * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
4410 Expect an Exception_Occurence object, not an Access.
4411 (Complete_And_Propagate_Occurrence): Adjust accordingly.
4412 (Raise_From_Signal_Handler): Likewise.
4413 (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
4414 available in the provided occurrence object, just re-propagate the
4415 latter as a bare "raise;" would do.
4416 * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
4417 * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
4418 to null, to mark that the occurrence we're crafting from the stream
4419 contents is not being propagated (yet).
4421 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4423 * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
4424 code for a transient component in line with the rest of the
4425 initialization code, rather than before the aggregate. This ensures
4426 that the component has proper visibility of the discriminants.
4428 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4430 * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
4433 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4435 * sigtramp-qnx.c: Properly restore link register in signal trampoline.
4437 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4439 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
4440 conversions before extracting the value of the expression.
4441 * exp_ch3.adb (Default_Initialize_Object): Optimize the default
4442 initialization of an array of scalars.
4443 (Get_Simple_Init_Val): Add processing for array types. Remove the
4444 processing of strings because this case is already handled by the array
4446 (Needs_Simple_Initialization): Moved to Sem_Util.
4447 (Simple_Init_Array_Type): New routine.
4448 (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
4449 facilities from Sem_Util.
4450 (Simple_Initialization_OK): New routine.
4451 * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
4452 * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
4453 an array of scalars.
4454 * sem_prag.adb (Analyze_Float_Value): New routine.
4455 (Analyze_Integer_Value): New routine.
4456 (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
4457 to handled the extended form of the pragma.
4458 (Analyze_Type_Value_Pair): New routine.
4459 * sem_util.adb: Add invalid value-related data structures.
4460 (Examine_Array_Bounds): New routine.
4461 (Has_Static_Array_Bounds): Reimplemented.
4462 (Has_Static_Non_Empty_Array_Bounds): New routine.
4463 (Invalid_Scalar_Value): New routine.
4464 (Needs_Simple_Initialization): Moved from Exp_Ch3.
4465 (Set_Invalid_Scalar_Value): New routines.
4466 * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
4467 (Invalid_Scalar_Value): New routine.
4468 (Needs_Simple_Initialization): Moved from Exp_Ch3.
4469 (Set_Invalid_Scalar_Value): New routines.
4470 * snames.ads-tmpl: Add names for the salar type families used by pragma
4473 2018-05-22 Javier Miranda <miranda@adacore.com>
4475 * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
4476 string when pragma No_Tagged_Streams is applicable to the tagged type,
4477 and initialize the Expanded_Name with an empty string when pragma
4478 Discard_Names is applicable to the tagged type.
4480 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4482 * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
4483 formal subprogram is never subtype conformqnt, and thus cannot be the
4484 prefix of 'Access. Reject as well the attribute when applied to a
4485 renaming of a formal subprogram.
4487 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4489 * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
4490 Needs_Simple_Initialization.
4491 (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
4492 (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
4493 profile and comment on usage.
4494 (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
4495 Sloc of a value obtained from aspect Default_Value because this could
4496 potentially replicate large trees. The proper Sloc is now set in
4497 Get_Simple_Init_Val.
4498 (Get_Simple_Init_Val): Reorganized by breaking the various cases into
4499 separate routines. Eliminate the use of global variables.
4500 (Init_Component): Update the call to Get_Simple_Init_Val.
4501 (Needs_Simple_Initialization): Update the parameter profile and all
4503 (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
4504 and set the proper Sloc.
4505 * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
4507 (Needs_Simple_Initialization): Update the parameter profile.
4509 2018-05-22 Patrick Bernardi <bernardi@adacore.com>
4511 * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
4512 user tries to use a subtype indication as a discriminant constraint.
4514 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4516 * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
4517 of N_Reduction_Expression and N_Reduction_Expression_Parameter.
4518 * par-ch4.adb: Remove parsing routines for reduction expressions.
4519 * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
4520 sem_spark.adb, sprint.adb: Remove analysis routines for reduction
4523 2018-05-22 Arnaud Charlet <charlet@adacore.com>
4525 * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
4526 Relaxed_RM_Semantics mode.
4528 2018-05-22 Arnaud Charlet <charlet@adacore.com>
4530 * comperr.adb (Delete_SCIL_Files): Take into account
4531 N_Generic_Package_Renaming_Declaration.
4533 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4535 * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
4536 private, use the full view if available, because it may include renamed
4537 discriminants whose values are stored in the corresponding
4540 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4542 * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
4543 defined on packages that are actuals for formal packages, in order to
4544 set/reset the visibility of the formals of a formal package with given
4545 actuals, when there are subsequent uses of those formals in the
4546 enclosing generic, as required by RN 12.7 (10).
4547 * atree.ads, atree.adb: Add operations for Elist30.
4548 * atree.h: Add Elist30.
4549 * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
4550 that are not defaulted and are thus not visible within the current
4552 (Check_Formal_Packages): Reset visibility of formals of a formal
4553 package that are not defaulted, on exit from current instance.
4555 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4557 * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
4558 non-'Result output appears in the output list of a function.
4560 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4562 * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
4563 (Build_Record_VS_Func): Reimplemented.
4564 (Expand_N_Attribute): Reimplement the handling of attribute
4566 * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
4567 attribute 'Valid_Scalars.
4568 * sem_util.adb (Scalar_Part_Present): Reimplemented.
4569 (Validated_View): New routine.
4570 * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
4572 (Validated_View): New routine.
4573 * doc/gnat_rm/implementation_defined_attributes.rst: Update the
4574 documentation of attribute 'Valid_Scalars.
4575 * gnat_rm.texi: Regenerate.
4577 2018-05-22 Bob Duff <duff@adacore.com>
4579 * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
4580 the spec of a SAL_Interface package.
4582 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4584 * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
4585 entity E within a generic unit, indicate that there are no remaining
4586 delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
4587 entity E is not frozen yet but the aspects should not be reanalyzed at
4588 the freeze point, which may be outside of the generic and may not have
4589 the proper visibility.
4591 2018-05-22 Bob Duff <duff@adacore.com>
4593 * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
4594 the new --split-line-before-record, --indent-named-statements and
4595 --no-align-modes gnatpp switches.
4597 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4599 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
4600 a second argument that is a constant of a given string value.
4602 2018-05-22 Doug Rupp <rupp@adacore.com>
4604 * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
4606 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4608 * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
4610 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4612 * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
4613 delayed aspects, analyze them now, os that the representation of the
4614 type (size, bounds) can be computed and validated.
4616 2018-05-22 Olivier Hainque <hainque@adacore.com>
4618 * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
4619 executable code section boundaries.
4621 2018-05-22 Javier Miranda <miranda@adacore.com>
4623 * locales.c: New implementation for the Ada.Locales package.
4624 * libgnat/a-locale.ads: Remove comment indicating that this is not
4626 * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
4627 that this is not implemented.
4628 * gnat_rm.texi: Regenerate.
4630 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4632 * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
4635 2018-05-22 Justin Squirek <squirek@adacore.com>
4637 * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
4638 (Freeze_Subprogram_Body, Install_Body): Modify calls to
4639 In_Same_Declarative_Part.
4640 * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
4641 verify pragma declaration is within the same declarative list with
4642 corresponding error message.
4643 * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
4644 sem_ch12.adb and generalized to be useful outside the scope of
4647 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4649 * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
4650 categorization of the unit after processing the aspects in case one of
4651 its aspects is converted into a categorization pragma.
4653 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4655 * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
4656 declaration with an explicit address clause and a type with default
4657 initialization, if the declaration carries an aspect
4658 Suppress_Initialization.
4660 2018-05-21 Daniel Mercier <mercier@adacore.com>
4662 * pprint.adb: Use mixed case for attribute names.
4664 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4666 * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
4667 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4668 (Analyze_Subprogram_Body_Helper): Rename the calls to
4669 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4670 * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
4671 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4672 * sem_ch10.adb: Add with and use clause for Sem_Ch13.
4673 (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
4674 prior to analyzing its aspects.
4675 (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
4676 stub prior to analyzing its aspects. Save and restore the configuration
4678 (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
4679 prior to analyzing its aspects.
4680 * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4681 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4682 * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4683 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4684 * sem_prag.adb: Code reformatting.
4685 (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
4687 2018-05-21 Jerome Lambourg <lambourg@adacore.com>
4689 * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
4692 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4694 * exp_cg.adb: Remove with and use clause for Exp_Disp.
4695 * exp_ch9.adb: Remove with and use clause for Exp_Disp.
4696 * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4697 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4698 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4699 * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4700 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4701 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4702 * exp_dist.adb: Remove with and use clause for Exp_Disp.
4703 * freeze.adb: Remove with and use clause for Exp_Disp.
4704 * sem_cat.adb: Remove with and use clause for Exp_Disp.
4705 * sem_ch6.adb: Remove with and use clause for Exp_Disp.
4706 * sem_ch12.adb: Remove with and use clause for Exp_Disp.
4707 * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
4709 * sem_util.adb: Remove with and use clause for Exp_Disp.
4710 (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
4711 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4712 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4713 * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
4715 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4716 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4718 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4720 * sem_res.adb (Valid_Conversion): Improve error message on an illegal
4721 type conversion whose expression has a limited view of a type.
4723 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4725 * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
4726 explicit name for iterator loop, preserve that name in expanded
4727 construct, for possible use in exit statements.
4729 2018-05-21 Javier Miranda <miranda@adacore.com>
4731 * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
4732 spec of a unit has Ada 2012 membership tests with multiple choices and
4733 the unit body is not compiled under Ada 2012 mode.
4735 2018-05-21 Doug Rupp <rupp@adacore.com>
4737 * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
4739 (CFI_COMMON_REGS): Restore LR jic probed from prologue.
4740 (REGNO_PC_OFFSET): Change to correct value for Aarch64.
4742 2018-05-21 Jose Ruiz <ruiz@adacore.com>
4744 * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
4745 libgnarl/s-tassta.adb: Minor typo fixes
4747 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4749 * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
4750 indexed call originally in prefix forn is itself the prefix of a
4753 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4755 * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
4757 (Not_Null_Range): Same as above.
4759 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4761 * exp_ch3.adb: Minor reformatting.
4762 * exp_ch6.adb: Likewise.
4763 * freeze.adb: Likewise.
4764 * inline.adb: Likewise.
4765 * sem_util.adb: Likewise.
4767 2018-05-21 Yannick Moy <moy@adacore.com>
4769 * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
4770 conversion instead of an unchecked type conversion when inlining a
4771 return statement, unless type qualification is required (for character
4772 and string literal) or no check can result from the conversion (for
4774 * opt.ads: Update comment.
4776 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4778 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
4779 model of the compilation unit spec, if any.
4780 * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
4781 model of the compilation unit spec, if any.
4782 * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
4783 parent compilation unit spec, if any.
4784 * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
4785 model of the main unit.
4786 (Is_Same_Unit): The routine now uses Unit_Entity.
4787 (Is_Subunit): Removed.
4788 (Normalize_Unit): Removed.
4789 (Unit_Entity): New routine.
4790 * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
4791 Elaboration_Checks. The analysis now ensures that the pragma appears at
4792 the configuration level, and on the initial declaration of a unit.
4793 Other placements are either flagged as illegal, or ignored.
4794 (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
4795 (Ignore_Elaboration_Checks_Pragma): New routine.
4796 * sem_util.adb (Install_Elaboration_Model): New routine.
4797 * sem_util.ads (Install_Elaboration_Model): New routine.
4798 * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
4799 documentation of pragma Elaboration_Checks.
4800 * gnat_rm.texi: Regenerate.
4802 2018-05-21 Olivier Hainque <hainque@adacore.com>
4804 * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
4805 of empty string when argv[0] couldn't be found on PATH.
4806 (Enable_Cache): Raise Program_Error instead of attempting a null
4807 pointer dereference when the Exec_Module initialization failed.
4809 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4811 * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
4812 * libgnarl/a-taside.ads (Tasking_State): Likewise.
4813 * libgnat/a-calend.ads (Clock_Time): Likewise.
4815 2018-05-21 Yannick Moy <moy@adacore.com>
4817 * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
4818 call notation in inlined call in GNATprove mode.
4820 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4822 * einfo.adb (Is_External_State): An abstract state is also external
4823 when it is declared with option "synchronous".
4824 * einfo.ads: Update the documentation of synthesized attribute
4826 * sem_util.adb (Find_Simple_Properties): New routine.
4827 (Is_Enabled_External_Property): New routine.
4828 (State_Has_Enabled_Property): Reimplemented. The two flavors of option
4829 External have precedence over option Synchronous when determining
4830 whether a property is in effect.
4832 2018-05-21 Yannick Moy <moy@adacore.com>
4834 * sem_eval.adb (Static_Length): Take into account case of variable of
4835 subtype string literal.
4837 2018-05-21 Olivier Hainque <hainque@adacore.com>
4839 * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
4840 (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
4841 * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
4843 (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
4844 * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
4847 2018-05-21 Olivier Hainque <hainque@adacore.com>
4849 * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
4850 Address, and type of Low, High to Storage_Offset.
4851 (Low): Rename as Low_Address and convey that the return value is a
4852 runtime reference accounting for a load address.
4853 * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
4854 address/offset type changes.
4855 (Aranges_Lookup): Likewise.
4856 (Symbolic_Address): Likewise.
4857 (Symbolic_Traceback): Likewise.
4858 (Dump_Cache): Likewise.
4859 (Is_Inside): Likewise.
4861 (Set_Load_Address): Likewise.
4862 (Low_Address): Likewise, and account for C.Load_Address.
4863 * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
4864 (Multi_Module_Symbolic_Traceback): Compare address in traceback
4865 with module Low_Address instead of Low.
4867 2018-05-21 Olivier Hainque <hainque@adacore.com>
4869 * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
4871 * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
4872 (Set_Load_Address): Likewise.
4873 (Symbolic_Traceback): Likewise.
4875 2018-05-21 Olivier Hainque <hainque@adacore.com>
4877 * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
4878 Load_Address argument and pass it down to Init_Module.
4879 * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
4880 lm.l_addr as the Load_Address to Add_Module_To_Cache.
4882 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4884 * einfo.adb (Has_Discriminants): Stronger assertion.
4885 (Set_Has_Discriminants): Stronger assertion.
4886 * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
4887 the stronger assertion on Has_Discriminant.
4888 (Uninstall_Discriminants_And_Pop_Scope): Same as above.
4889 * sem_util.adb (New_Copy_Tree): Same as above.
4890 * sem_ch7.adb (Generate_Parent_References): Prevent calls to
4891 Has_Discriminant on non-type entities that might happen when the
4892 compiled code has errors.
4893 * sem_ch3.adb (Derived_Type_Declaration): Only call
4894 Set_Has_Discriminant on type entities.
4896 2018-05-21 Arnaud Charlet <charlet@adacore.com>
4898 * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
4901 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4903 * lib.ads: Fix typo in enumeration in comment.
4905 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4907 * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
4908 attribute reference is legal within a generic unit when the prefix is a
4909 formal private type.
4911 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4913 * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
4914 delegate the secondary stack management when there is no suitable
4915 transient context, and the transient scope was intended to manage the
4916 secondary stack because this causes premature reclamation. Change the
4917 transient scope creation logic by special casing assignment statements
4918 of controlled components for type initialization procedures.
4919 (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
4920 the comment on usage.
4921 (Find_Transient_Context): Change the initinte loop into a while loop.
4922 Iterations schemes and iterator specifications are not valid transient
4923 contexts because they rely on special processing. Assignment statements
4924 are now treated as a normal transient context, special cases are
4925 handled by the caller. Add special processing for pragma Check.
4926 (Is_OK_Construct): Removed. Its functionality has been merged in
4927 routine Find_Transient_Context.
4928 * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
4929 retrieve the subprogram being invoked. Use a more accurate predicate
4930 (Requires_Transient_Scope) to determine that the function will emply
4931 the secondary stack.
4933 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4935 * ada_get_targ.adb: Fix subprogram body headers.
4936 * adabkend.adb: Likewise.
4937 * checks.adb: Likewise.
4938 * exp_ch3.adb: Likewise.
4939 * exp_ch5.adb: Likewise.
4940 * exp_ch9.adb: Likewise.
4941 * exp_dist.adb: Likewise.
4942 * exp_tss.adb: Likewise.
4943 * inline.adb: Likewise.
4944 * lib-writ.adb: Likewise.
4945 * lib-xref-spark_specific.adb: Likewise.
4946 * libgnarl/s-osinte__darwin.adb: Likewise.
4947 * libgnarl/s-stusta.adb: Likewise.
4948 * libgnarl/s-taprop__solaris.adb: Likewise.
4949 * libgnarl/s-tposen.adb: Likewise.
4950 * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
4951 * libgnarl/s-vxwext__kernel.adb: Likewise.
4952 * libgnat/a-btgbso.adb: Likewise.
4953 * libgnat/a-cfdlli.adb: Likewise.
4954 * libgnat/a-cfhama.adb: Likewise.
4955 * libgnat/a-cfinve.adb: Likewise.
4956 * libgnat/a-cimutr.adb: Likewise.
4957 * libgnat/a-coboho.adb: Likewise.
4958 * libgnat/a-cofove.adb: Likewise.
4959 * libgnat/a-cofuve.adb: Likewise.
4960 * libgnat/a-comutr.adb: Likewise.
4961 * libgnat/a-exexda.adb: Likewise.
4962 * libgnat/a-tags.adb: Likewise.
4963 * libgnat/a-tideau.adb: Likewise.
4964 * libgnat/a-wtdeau.adb: Likewise.
4965 * libgnat/a-ztdeau.adb: Likewise.
4966 * libgnat/g-alleve.adb: Likewise.
4967 * libgnat/s-excdeb.adb: Likewise.
4968 * libgnat/s-parint.adb: Likewise.
4969 * libgnat/s-shasto.adb: Likewise.
4970 * libgnat/s-traceb__hpux.adb: Likewise.
4971 * prepcomp.adb: Likewise.
4972 * sem_ch4.adb: Likewise.
4973 * sem_ch6.adb: Likewise.
4974 * sem_dist.adb: Likewise.
4975 * sem_prag.adb: Likewise.
4976 * sem_util.adb: Likewise.
4977 * sinfo.adb: Likewise.
4978 * switch.adb: Likewise.
4980 2018-05-04 John Marino <gnugcc@marino.st>
4983 * link.c (BSD platforms): Add missing backslash.
4985 2018-04-27 Eric Botcazou <ebotcazou@adacore.com>
4988 * init.c (__gnat_handle_vms_condition): Add missing parentheses.
4990 2018-04-25 Eric Botcazou <ebotcazou@adacore.com>
4993 * gnat_ugn.texi: Regenerate.
4995 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
4998 * gnatlink.adb (Gnatlink): Remove handling of -b switch.
4999 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
5000 Remove documentation of -b switch.
5002 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
5005 * gnatlink.adb (Process_Args): Drop existing link switches if multiple
5006 switches are passed for --LINK.
5008 2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
5011 * gcc-interface/misc.c (gnat_post_options): Disable string overflow
5014 2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
5016 * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
5017 Consider only entities for objects.
5019 2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
5021 * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
5023 (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
5025 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
5027 * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
5028 guarding the overflow check emitted for the upper bound of a floating-
5031 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
5033 * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
5035 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
5037 * libgnat/i-cexten.ads (Float_128): New type.
5039 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
5041 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
5042 false if the component type is a pointer.
5044 2018-01-11 Gary Dismukes <dismukes@adacore.com>
5046 * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
5047 result of Get_Simple_Init_Value and pass the source location of the
5048 object declaration's object_definition.
5050 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5052 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
5053 properly object declarations with initializations that are
5054 build-in-place function calls, when there is an address specification,
5055 either as an aspect specification or an explicit attribute
5056 specification clause, for the initialized object.
5057 * freeze.adb (Check_Address_Clause): Do not remove side-effects from
5058 initial expressions in the case of a build-in-place call.
5060 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5062 * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
5063 private (sub)type; refactor to avoid early return statement.
5064 (Not_Null_Range): Same as above.
5066 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5068 * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
5069 concurrent, nor effectively volatile.
5070 * ghost.adb (Check_Ghost_Type): New routine.
5071 * ghost.ads (Check_Ghost_Type): New routine.
5072 * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
5073 consider specific subsets of declarations.
5074 (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
5075 replicated by Is_Declaration.
5076 * sem_util.ads (Is_Declaration): New parameter profile. Update the
5078 (Is_Declaration_Other_Than_Renaming): Removed.
5080 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5082 * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
5083 as Part_Of consituents of single protected types are illegal when they
5084 take place inside a protected function.
5085 (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
5087 (Is_Protected_Part_Of_Constituent): New routine.
5088 (Within_Function): New routine.
5090 2018-01-11 Arnaud Charlet <charlet@adacore.com>
5092 Bump copyright notices to 2018.
5094 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5096 * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
5099 2018-01-11 Justin Squirek <squirek@adacore.com>
5101 * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
5102 to make sure a given expression function is properly parenthesized.
5104 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5106 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
5107 categorization of a subprogram body which does not complete a previous
5110 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5112 * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
5113 scope of package Ada is Standard.
5115 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5117 * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
5118 subcomponent of the current entity when building the body for a dynamic
5119 predicate function for a record with composite subcomponents.
5121 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5123 * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
5124 Establish_Transient_Scope.
5125 (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
5126 (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
5127 * exp_ch6.adb (Expand_Call_Helper): Update the call to
5128 Establish_Transient_Scope.
5129 (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
5130 Establish_Transient_Scope.
5131 * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
5132 management of the secondary stack to an enclosing scope if there is no
5133 suitable construct to wrap, and the transient scope was intended to
5134 manage the secondary stack.
5135 (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
5136 is a valid boundary for a transient expression which comes from the
5137 statements of the alternative, otherwise alternatives cannot be
5138 wrapped. Assignments of controlled objects which have controlled
5139 actions suppressed now stop the traversal as there is no point in
5140 looking for an enclosing construct. Add several N_xxx_Body choices to
5141 the termination conditions for completeness.
5142 * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
5143 and the associated comment on usage.
5144 * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
5145 Establish_Transient_Scope.
5146 (Add_Write_After): Update the call to Establish_Transient_Scope.
5147 * sem_res.adb (Check_Initialization_Call): Removed.
5148 (Resolve_Actuals): Account for additional cases where finalization
5149 actions are required by utilizing predicate Needs_Finalization rather
5151 (Resolve_Call): Type initialization procedures can now utilize
5152 transient scopes to manage the secondary stack, thus preventing leaks
5153 during initialization. Remove the previous kludgy algorithm which
5154 attempts to manage the secondary stack at the object creation site.
5156 2018-01-11 Jerome Lambourg <lambourg@adacore.com>
5158 * libgnat/g-soliop__qnx.ads: New.
5159 * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
5162 2018-01-11 Bob Duff <duff@adacore.com>
5164 * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
5165 a null procedure occurs in a protected definition.
5167 2018-01-11 Bob Duff <duff@adacore.com>
5169 * binderr.ads, namet.ads: Minor reformatting.
5171 2018-01-11 Bob Duff <duff@adacore.com>
5173 * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
5176 2018-01-11 Bob Duff <duff@adacore.com>
5178 * binde.adb (Force_Elab_Order): Give an error if there are duplicate
5181 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5183 * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
5184 controlling argument of a dispatching call. freeze the corresponding
5187 2018-01-11 Ben Brosgol <brosgol@adacore.com>
5189 * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
5191 2018-01-11 Ben Brosgol <brosgol@adacore.com>
5193 * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
5195 * gnat_rm.texi: Regenerate.
5197 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5199 * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
5200 formsl type corresponding to the actual fixed point type is private,
5201 because in this case there can be no suspicious arithmetic operations
5202 in the generic unless they reference a formal subprogram. Clarify
5205 2018-01-11 Javier Miranda <miranda@adacore.com>
5207 * exp_util.adb (Remove_Side_Effects): No action done for functions
5208 returning class-wide types since it requires generating code using
5209 'reference and the CCG target has no secondary stack.
5210 * gnat1drv.adb: Disable building static dispatch tables when generating
5213 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5215 * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
5216 libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
5217 (File_Type): Add Default_Initial_Condition aspect.
5219 2018-01-11 Pascal Obry <obry@adacore.com>
5221 * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
5223 2018-01-11 Bob Duff <duff@adacore.com>
5225 * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
5226 to match what the Libadalang-based version does.
5227 * doc/gnat_ugn/about_this_guide.rst: Update reference.
5229 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5231 * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
5232 if it contains at least one component declaration employing a function
5233 call returning on the secondary stack.
5235 2018-01-11 Yannick Moy <moy@adacore.com>
5237 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
5238 Update description of restriction SPARK_05 with SPARK 2014.
5239 * gnat_rm.texi: Regenerate.
5241 2018-01-11 Vasiliy Fofanov <fofanov@adacore.com>
5243 * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
5245 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5247 * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
5248 sem_res.adb, sem_util.adb: Minor reformatting.
5250 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5252 * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
5253 has a delayed aspect which must be processed at the point the type is
5254 frozen. This mimics what is done when the predicate is provided by a
5257 2018-01-11 Doug Rupp <rupp@adacore.com>
5259 * init.c (vxworks): Add macro checks for __aarch64__.
5261 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5263 * exp_util.adb (Add_Failure_Expression): New routine.
5264 (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
5265 * sem_util.adb (Is_Current_Instance): Code cleanup.
5267 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
5269 * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
5270 Default_Sec_Stack_Size.
5271 * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
5272 limit check so that the integer index does not overflow. Check the
5273 dynamic stack allocation does not cause the secondary stack pointer to
5275 (SS_Info): Align colons.
5276 (SS_Init): Cover the case when bootstraping with an old compiler that
5277 does not set Default_SS_Size.
5279 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5281 * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
5282 legality of an inherited operation that may require overriding, ignore
5283 primitive_wrappers that correspond to explicit operations that override
5284 an interface primitive.
5285 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
5286 operation to which the class-wide expression applies is a protected op.
5287 with a primitive_wrapper, verify that the updated inherited expression
5288 does not contain an internal call to a protected function. This
5289 completes the implementation of AI12-0166.
5291 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5293 * ali.adb: Document the remaining letters available for ALI lines.
5294 (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
5295 * ali.ads: Update type With_Record. Field
5296 Implicit_With_From_Instantiation is no longer in use. Add field
5298 * csinfo.adb (CSinfo): Remove the setup for attribute
5299 Implicit_With_From_Instantiation.
5300 * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
5301 either implicitly or explicitly withed.
5302 (Is_Implicit_With_Clause): New routine.
5303 (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
5304 confusion with the with clause attribute by the same name.
5305 (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
5306 * rtsfind.adb (Maybe_Add_With): Code cleanup.
5307 * sem_ch8.adb (Present_System_Aux): Code cleanup.
5308 * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
5310 (Implicit_With_On_Parent): Mark the with clause as generated for a
5312 * sem_ch12.adb (Inherit_Context): With clauses inherited by an
5313 instantiation are no longer marked as Implicit_With_From_Instantiation
5314 because they are already marked as implicit.
5315 * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
5316 which marks implicit with clauses as related to an instantiation.
5317 * sinfo.adb (Implicit_With_From_Instantiation): Removed.
5318 (Parent_With): New routine.
5319 (Set_Implicit_With_From_Instantiation): Removed.
5320 (Set_Parent_With): New routine.
5321 * sinfo.ads: Update the documentation of attribute Implicit_With.
5322 Remove attribute Implicit_With_From_Instantiation along with
5323 occurrences in nodes. Add attribute Parent_With along with occurrences
5325 (Implicit_With_From_Instantiation): Removed along with pragma Inline.
5326 (Parent_With): New routine along with pragma Inline.
5327 (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
5328 (Set_Parent_With): New routine along with pragma Inline.
5330 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5332 * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
5333 entity when the enclosing construct is a body.
5335 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
5337 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
5338 Secondary_Stack_Size handling as a pragma is now generated for the
5339 corresponding aspect instead of an attribute. Pragma expression is
5340 relocated instead of evaluated. Discriminant of the corresponding
5341 record type is referenced rather than the type discriminant.
5342 (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
5343 Secondary_Stack_Size rep item checks to only look for the pragma rep.
5344 * sem_ch13.adb (Analyze_One_Aspect): Transform
5345 Aspect_Secondary_Stack_Size into a pragma instead of an attribute
5346 because the attribute does not have visibility on a task type's
5347 discriminants when the type's definition is expanded.
5348 (Analyze_Attribute_Definition_Clause): Remove handling of
5349 Attribute_Secondary_Stack_Size.
5350 * snames.adb-tmpl, snames.ads-tmpl: Remove
5351 Attribute_Secondary_Stack_Size, no longer used.
5353 2018-01-11 Justin Squirek <squirek@adacore.com>
5355 * sem_ch8.adb: Minor comment fix.
5357 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5359 * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
5360 individual action because the action may denote a complex expression,
5361 such as a case statement, which in turn may contain additional
5364 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5366 * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
5367 analysis on a copy of the expression with a copy of the index variable,
5368 because full expansion will rewrite construct into a loop with the
5369 original loop variable.
5370 * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
5371 expression is an iterated component association. Full analysis takes
5372 place when construct is rewritten as a loop.
5373 (In_Place_Assign_OK, Safe_Component): An iterated_component_association
5374 is not safe for in-place assignment.
5375 * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
5376 entity with no homonym and no other entity in the scope.
5378 2018-01-11 Justin Squirek <squirek@adacore.com>
5380 * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
5381 message to be printed on the pragma argument identifier.
5383 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5385 * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
5386 entity of the generated invariant procedure in order to construct a
5387 proper entity chain.
5389 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5391 * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
5394 2018-01-11 Arnaud Charlet <charlet@adacore.com>
5396 * einfo.ads, einfo.adb (Activation_Record_Component,
5397 Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
5398 Allow E_Discriminant.
5400 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
5402 * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
5403 for atomic access once the component size is taken into account and
5404 also do it if the component type is Atomic or Volatile_Full_Access.
5406 2018-01-04 Eric Botcazou <ebotcazou@adacore.com>
5408 * gnatvsn.ads: Bump copyright year.
5410 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5411 Alan Hayward <alan.hayward@arm.com>
5412 David Sherwood <david.sherwood@arm.com>
5414 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
5417 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5418 Alan Hayward <alan.hayward@arm.com>
5419 David Sherwood <david.sherwood@arm.com>
5421 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
5424 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5425 Alan Hayward <alan.hayward@arm.com>
5426 David Sherwood <david.sherwood@arm.com>
5428 * gcc-interface/utils.c (gnat_types_compatible_p): Handle
5429 polynomial TYPE_VECTOR_SUBPARTS.
5431 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5432 Alan Hayward <alan.hayward@arm.com>
5433 David Sherwood <david.sherwood@arm.com>
5435 * gcc-interface/misc.c (enumerate_modes): Handle polynomial
5438 2018-01-03 Jakub Jelinek <jakub@redhat.com>
5440 Update copyright years.
5442 * gnat_ugn.texi: Bump @copying's copyright year.
5443 * gnat_rm.texi: Likewise.
5445 Copyright (C) 2018 Free Software Foundation, Inc.
5447 Copying and distribution of this file, with or without modification,
5448 are permitted in any medium without royalty provided the copyright
5449 notice and this notice are preserved.