1 2018-12-11 Pierre-Marie de Rodat <derodat@adacore.com>
3 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
4 Document the -fgnat-encodings switch.
5 * gnat_ugn.texi: Regenerate.
7 2018-12-11 Justin Squirek <squirek@adacore.com>
9 * sem_ch10.adb (Analyze_Subunit): Modify conditional to fully
10 remove parent contexts from library-level subprogram bodies in
11 addition to package bodies.
13 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
15 * exp_prag.adb (Expand_Pragma_Initial_Condition): Do not
16 generate an Initial_Condition procedure and a call to it when
17 the associated pragma is ignored.
18 * sem_ch10.adb (Analyze_Compilation_Unit): Minor cleanup.
20 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
22 * fe.h (Debug_Generated_Code): Declare.
23 * gcc-interface/gigi.h (enum inline_status_t): Rename
24 is_disabled to is_default, is_enabled to is_requested and add
26 * gcc-interface/decl.c (inline_status_for_subprog): New function.
27 (gnat_to_gnu_entity) <E_Subprogram_Type>: Use it to get the
28 inlining status of the subprogram.
29 * gcc-interface/trans.c (gigi): Adjust to above renaming.
30 (build_raise_check): Likewise.
31 (Compilation_Unit_to_gnu): Likewise.
32 (gnat_to_gnu): Likewise.
33 * gcc-interface/utils.c (create_subprog_decl): Likewise. Deal
34 with is_prescribed status by setting
35 DECL_DISREGARD_INLINE_LIMITS. Do not set the
36 DECL_NO_INLINE_WARNING_P flag if Debug_Generated_Code is true.
38 2018-12-03 Gary Dismukes <dismukes@adacore.com>
40 * sem_aux.adb (Object_Type_Has_Constrained_Partial_View): Return
41 True for an untagged discriminated formal derived type when
42 referenced within a generic body (augments existing test for
43 formal private types).
44 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Type): If the
45 prefix of the name is a qualified expression, retrieve the
46 operand of that. Add a test of whether the (possible)
47 dereference prefix is a variable, and also test whether that
48 prefix might just be of an access type (occurs in some implicit
49 dereference cases) rather than being an explicit dereference.
50 Retrieve the Original_Node of the object name's main prefix and
51 handle the possibility of that being a qualified expression.
52 Remove special-case code for explicit dereferences that don't
53 come from source. Add test for the renaming not being within a
54 generic body for proper determination of whether a formal access
55 type is known to be constrained (it is within a generic spec,
56 but not in the body). Fix an existing incorrect test for
57 renaming of a discriminant-dependent component of a untagged
58 generic formal type being within a generic body, adding test of
59 taggedness and calling In_Generic_Body (now properly checks for
60 cases where the renaming is in a nongeneric body nested within a
61 generic). Return False in cases where the selector is not a
62 component (or discriminant), which can occur for
63 prefixed-notation calls.
65 2018-12-03 Ed Schonberg <schonberg@adacore.com>
67 * sem_res.adb (Apply_Check): For array types, apply a length
68 check rather than a qualification, to avoid spurious errors when
69 the value of a dependend expression has a matching length but
70 different bounds from those of the type of the contect.
72 2018-12-03 Hristian Kirtchev <kirtchev@adacore.com>
74 * libgnat/a-calend.adb: Update the number of leap seconds. Add
75 the hard time values for year 2015 and 2016.
77 2018-12-03 Gary Dismukes <dismukes@adacore.com>
79 * exp_ch3.adb, libgnarl/s-taasde.adb, libgnarl/s-taenca.adb,
80 libgnarl/s-tarest.adb, libgnarl/s-tasini.adb,
81 libgnarl/s-taskin.ads, libgnarl/s-tasren.adb,
82 libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb: Spelling fixes and
85 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
87 * exp_aggr.adb (Convert_To_Positional): Use
88 Static_Array_Aggregate to decide whether to set
89 Compile_Time_Known_Aggregate on an already flat aggregate.
90 (Expand_Array_Aggregate): Remove test on
91 Compile_Time_Known_Aggregate that turns out to be dead and
93 (Is_Static_Component): New predicate extracted from...
94 (Static_Array_Aggregate): ...here. Test neither Is_Tagged_Type
95 nor Is_Controlled for the type, but test whether the component
96 type has discriminants. Use the Is_Static_Component predicate
97 consistently for the positional and named cases.
99 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
101 * freeze.adb (Freeze_Entity): Do not freeze the partial view of
102 a private subtype if its base type is also private with delayed
103 freeze before the full type declaration of the base type has
105 * sem_ch7.adb (Preserve_Full_Attributes): Add assertion on
108 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
110 * exp_ch3.adb (Build_Record_Init_Proc): Inherit an
111 initialization procedure if it is present, even if it is null.
113 2018-12-03 Patrick Bernardi <bernardi@adacore.com>
115 * libgnarl/s-taskin.ads (ATC_Level_Base): Redefine to span from
116 -1 to Max_ATC_Nesting so that 0 represents no ATC nesting and -1
117 represented a completed task. To increase readability, new
118 constants are introduced to represent key ATC nesting levels.
119 Consequently, Level_No_Pending_Abort replaces
120 ATC_Level_Infinity. ATC_Level related definitions now
122 (Ada_Task_Control_Block): The default initialization of
123 components ATC_Nesting_Level and Pending_ATC_Level now use new
124 ATC_Level_Base constants. Comments improved
125 * libgnarl/s-taskin.adb (Initialize): Improve the initialisation
126 of the first element of the Entry_Calls array to facilitate
128 * libgnarl/s-taasde.ads: Update comment.
129 * libgnarl/s-taasde.adb, libgnarl/s-taenca.adb,
130 libgnarl/s-tasren.adb, libgnarl/s-tassta.adb,
131 libgnarl/s-tasuti.ads, libgnarl/s-tasuti.adb: Use new
132 ATC_Level_Base constants.
133 * libgnarl/s-tarest.adb (Create_Restricted_Task): Improve the
134 initialisation of the first element of the task's Entry_Calls
135 array to facilitate better maintenance.
136 * libgnarl/s-tasini.ads (Locked_Abort_To_Level): Update
137 signature to accept ATC_Level_Base.
138 * libgnarl/s-tasini.adb (Locked_Abort_To_Level): Update
139 signature to accept ATC_Level_Base. Use new ATC_Level_Base
140 constants and only modify the aborting task's Entry_Calls array
141 if any entry call is happening.
142 * libgnarl/s-tposen.adb (Protected_Single_Entry_Call): Reference
143 the first element of the task's Entry_Calls array via 'First
144 attribute to facilitate better maintenance.
146 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
148 * einfo.adb (Write_Entity_Info): Don't take Scope of Standard
150 * sem_ch4.adb (Remove_Abstract_Operations): Add missing blank
151 lines to -gnatdv output.
152 * sem_type.adb (Write_Overloads): Take Entity of entity names
155 2018-12-03 Hristian Kirtchev <kirtchev@adacore.com>
157 * checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch3.adb,
158 exp_util.adb, exp_util.ads, repinfo.adb, sem_attr.adb,
159 sem_ch3.adb, sem_res.adb, sem_util.adb: Minor reformatting.
161 2018-12-03 Ed Schonberg <schonberg@adacore.com>
163 * sem_ch3.adb (Complete_Private_Subtype): Enhance comment.
165 2018-12-03 Olivier Hainque <hainque@adacore.com>
167 * gcc-interface/lang.opt (fopenacc): New option for Ada.
168 * gcc-interface/misc.c (gnat_handle_option): Handle it.
169 * gcc-interface/trans.c (struct loop_info_d): Add OMP
171 (Iterate_Acc_Clause_Arg, Acc_gnat_to_gnu): New functions,
172 helpers for OpenACC pragmas processing in Pragma_to_gnu.
173 (Acc_Var_to_gnu, Acc_Reduc_Var_to_gnu, Acc_Reduc_to_gnu):
175 (Acc_Size_Expr_to_gnu, Acc_Size_List_to_gnu): Likewise.
176 (Pragma_Acc_Data_to_gnu): Likewise.
177 (Pragma_to_gnu): Handle Pragma_Acc_Loop, Pragma_Acc_Data,
178 Pragma_Acc_Kernels and Pragma_Acc_Parallel.
179 (Acc_Loop_to_gnu, Regular_Loop_to_gnu): New functions. Helpers
181 (Loop_Statement_to_gnu): Rework to handle OpenACC loops.
183 2018-12-03 Olivier Hainque <hainque@adacore.com>
185 * gcc-interface/targtyps.c (MALLOC_OBSERVABLE_ALIGNMENT): Set to
188 2018-12-03 Ed Schonberg <schonberg@adacore.com>
190 * sem_res.adb (Set_Slice_Subtype): The index type of a slice is
193 2018-11-26 Matthias Klose <doko@ubuntu.com>
196 * libgnarl/s-linux__alpha.ads: Define SIGSYS.
198 2018-11-19 Alexandre Oliva <oliva@adacore.com>
201 * gcc-interface/config-lang.in (lang_requires): Set to "c c++"
202 when gnattools wants it.
204 2018-11-19 Eric Botcazou <ebotcazou@adacore.com>
206 * gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
208 2018-11-15 Eric Botcazou <ebotcazou@adacore.com>
210 * gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
211 -fnon-call-exceptions passed on the command line in -gnatp mode.
213 2018-11-14 Ed Schonberg <schonberg@adacore.com>
215 * exp_util.ads, exp_util.adb: Change the profile of
216 Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
217 of the right opersnd. This prevents unnesting anomalies when
218 that operand contains uplevel references.
219 * exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
220 * exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.
222 2018-11-14 Patrick Bernardi <bernardi@adacore.com>
224 * libgnarl/a-intnam__linux.ads: Add SIGSYS.
225 * libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
226 libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
227 libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
228 libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
229 SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
230 implementation specific.
231 * libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
232 SIGSYS. Move SIG32, SIG33 and SIG34 from the unmasked list to
235 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
237 * exp_aggr.adb (Is_Static_Element): New predicate extracted
239 (Check_Static_Components): ...here. Call Is_Static_Element on
240 each element of the component association list, if any.
241 (Flatten): Duplicate the expression of an others choice only if
242 it is static or is an aggregate which can itself be flattened.
244 2018-11-14 Olivier Hainque <hainque@adacore.com>
246 * sigtramp-vxworks-target.inc: Fix stack checking test errors in
247 ACATS, now that GCC can emit CFI rules referring to sp in
248 absence of a frame pointer.
250 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
252 * exp_aggr.adb (Check_Static_Components): Remove dead test.
253 (Flatten): Likewise. Move comment around.
255 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
257 * sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
258 SPARK-related global state at the start of the routine. Set the
259 Ghost mode of the completed spec if any. Restore the saved
260 Ghost and SPARK-related global state on exit from the routine.
262 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
264 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
265 (-gnatR): Document new -gnatR4 level.
266 * gnat_ugn.texi: Regenerate.
267 * opt.ads (List_Representation_Info): Bump upper bound to 4.
268 * repinfo.adb: Add with clause for GNAT.HTable.
269 (Relevant_Entities_Size): New constant.
270 (Entity_Header_Num): New type.
271 (Entity_Hash): New function.
272 (Relevant_Entities): New set implemented with GNAT.HTable.
273 (List_Entities): Also list compiled-generated entities present
274 in the Relevant_Entities set. Consider that the Component_Type
275 of an array type is relevant.
276 (List_Rep_Info): Reset Relevant_Entities for each unit.
277 * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4.
278 * switch-m.adb (Normalize_Compiler_Switches): Likewise
279 * usage.adb (Usage): Likewise.
281 2018-11-14 Javier Miranda <miranda@adacore.com>
283 * exp_disp.adb (Expand_Interface_Thunk): Extend handling of
284 renamings of the predefined equality primitive.
285 (Make_Secondary_DT): When calling Expand_Interface_Thunk() pass
286 it the primitive, instead of its Ultimate_Alias; required to
287 allow the called routine to identify renamings of the predefined
290 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
292 * freeze.adb (Check_Pragma_Thread_Local_Storage): New routine. A
293 variable with suppressed initialization has no initialization
294 for purposes of the pragma.
295 (Freeze_Object_Declaration): Remove variable
296 Has_Default_Initialization as it is no longer used. Use routine
297 Check_Pragma_Thread_Local_Storage to verify the semantics of
298 pragma Thread_Local_Storage.
300 2018-11-14 Ed Schonberg <schonberg@adacore.com>
302 * sem_res.adb (Resolve_If_Expression): Verify that the subtypes
303 of all dependent expressions obey the constraints of the
304 expected type for the if-expression.
305 (Analyze_Expression): Only add qualificiation to the dependent
306 expressions when the context type is constrained. Small
307 adjustment to previous patch.
309 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
311 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't
312 register a compile-time warning or error for 'Alignment or 'Size
313 of an entity declared in a generic unit.
315 2018-11-14 Justin Squirek <squirek@adacore.com>
317 * sem_ch8.adb (Use_One_Package): Add test for out-of-scope
320 2018-11-14 Ed Schonberg <schonberg@adacore.com>
322 * exp_ch3.adb: (Expand_N_Object_Declaration): If the expression
323 is a limited aggregate its resolution is delayed until the
324 object declaration is expanded.
325 * sem_ch3.adb: (Analyze_Object_Declaration): If the expression
326 is a limited aggregate and the declaration has a following
327 address clause indicate that resolution of the aggregate (which
328 must be built in place) must be delayed.
330 2018-11-14 Bob Duff <duff@adacore.com>
332 * sem_attr.adb (To_Address): Simplify setting of
333 Is_Static_Expression. Remove second (unconditional) call to
334 Set_Is_Static_Expression -- surely it's not static if the
335 operand is not. Initialize Static on declaration. Do not try
336 to fold 'To_Address, even though it's static.
337 * exp_attr.adb (To_Address): Preserve Is_Static_Expression.
338 * sinfo.ads, sem_eval.ads, sem_eval.adb (Is_Static_Expression,
339 Is_OK_Static_Expression, Raises_Constraint_Error): Simplify
340 documentation. There was too much repetition and redundancy.
342 2018-11-14 Ed Schonberg <schonberg@adacore.com>
344 * sem_ch3.adb (Analyze_Object_Declaration): Use the
345 Actual_Subtype to preserve information about a constant
346 initialized with a non-static entity that is known to be valid,
347 when the type of the entity has a narrower range than that of
348 the nominal subtype of the constant.
349 * checks.adb (Determine_Range): If the expression is a constant
350 entity that is known-valid and has a defined Actual_Subtype, use
351 it to determine the actual bounds of the value, to enable
352 additional optimizations.
354 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
356 * back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
357 exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
358 freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
359 sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.
361 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
363 * exp_ch4.adb (Find_Aliased_Equality): New routine.
364 (Find_Equality): Reimplemented.
365 (Is_Equality): New routine.
367 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
369 * ghost.adb (Ghost_Entity): New routine.
370 (Mark_And_Set_Ghost_Assignment): Reimplemented.
371 * sem_ch5.adb (Analyze_Assignment): Assess whether the target of
372 the assignment is an ignored Ghost entity before analyzing the
374 * sem_ch8.adb (Find_Direct_Name): Update the subprogram
375 signature. Do not generate markers and references when they are
377 (Nvis_Messages): Do not execute when errors are not desired.
378 (Undefined): Do not emit errors when they are not desired.
379 * sem_ch8.ads (Find_Direct_Name): Update the subprogram
380 signature and comment on usage.
381 * sem_util.adb (Ultimate_Prefix): New routine.
382 * sem_util.ads (Ultimate_Prefix): New routine.
384 2018-11-14 Justin Squirek <squirek@adacore.com>
386 * sem_ch7.adb (Uninstall_Declarations): Add conditional to avoid
387 uninstalling potential visibility during freezing on enumeration
390 2018-11-14 Jerome Lambourg <lambourg@adacore.com>
392 * env.c: Do not include crt_externs.h on iOS, as it does not
393 exist there. This is also true for the iPhone Simulator SDK.
395 2018-11-14 Ed Schonberg <schonberg@adacore.com>
397 * exp_ch7.adb (Check_Unnesting_In_Declarations): New procedure
398 to transform blocks that appear in the declarative part of a
399 package body into subprograms if they contain generated
400 subprograms (such as finalization routines). Needed to generate
401 the proper upward references in unnesting mode.
403 2018-11-14 Ed Schonberg <schonberg@adacore.com>
405 * freeze.adb (Freeze_Fixed_Point_Type): If the given low bound
406 of the type is less than the nearest model number, do not expand
407 the range of the type to include the model number below the
408 bound. Similar adjustment if the upper bound is larger than the
409 nearest model number.
411 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
413 * checks.adb (Install_Primitive_Elaboration_Check): Do not
414 create the check when exceptions cannot be used.
415 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not raise
416 Program_Errror when exceptions cannot be used. Analyze the
417 generated code with all checks suppressed.
418 * exp_ch7.adb (Build_Finalizer): Remove the declaration of
420 (Make_Deep_Array_Body): Remove the declaration of Exceptions_OK.
421 (Make_Deep_Record_Body): Remove the declaration of
423 (Process_Transients_In_Scope): Remove the declaration of
425 * exp_util.adb (Exceptions_In_Finalization_OK): Renamed to
427 * exp_util.ads (Exceptions_In_Finalization_OK): Renamed to
430 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
432 * exp_ch4.adb (Expand_N_Op_Eq): Remove duplicated code and use
433 routine Find_Equality instead.
434 (Find_Equality): New routine.
436 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
438 * sem_util.adb (First_From_Global_List): Do not expect
439 N_Selected_Component in the Global contract; simplify assertion
442 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
444 * sem_ch12.adb (Instantiate_Object): Set
445 Corresponding_Generic_Association on generic actuals with
447 * sinfo.ads (Corresponding_Generic_Association): Update comment.
449 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
451 * exp_ch4.adb (Expand_Concatenate): Use the proper routine to
452 set the need for debug info.
453 * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Use the
454 proper routine to set the need for debug info.
455 * exp_prag.adb (Expand_Pragma_Initial_Condition): Use the proper
456 routine to set the need for debug info.
457 * exp_util.adb (Build_DIC_Procedure_Declaration): Use the proper
458 routine to set the need for debug info.
459 (Build_Invariant_Procedure_Declaration): Use the proper routine
460 to set the need for debug info.
461 * ghost.adb (Record_Ignored_Ghost_Node): Add statements as a
462 whole class to the list of top level ignored Ghost nodes.
463 * sem_util.adb (Set_Debug_Info_Needed): Do not generate debug
464 info for an ignored Ghost entity.
466 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
468 * bindgen.adb, exp_cg.adb, repinfo.adb, sprint.adb: Minor reuse
469 Cancel_Special_Output where possible.
471 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
473 * exp_dbug.ads, sem_util.ads: Minor fixes in comments.
475 2018-11-14 Arnaud Charlet <charlet@adacore.com>
477 * adabkend.adb (Scan_Back_End_Switches): Handle -gx switches
480 2018-11-13 Eric Botcazou <ebotcazou@adacore.com>
482 * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
483 for the runtime on platforms where System.Machine_Overflow is true.
485 2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
487 * fe.h (Suppress_Checks): Declare.
488 * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
489 only if checks are not suppressed and -faggressive-loop-optimizations
491 * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
492 warned_aggressive_loop_optimizations fields.
493 (gigi): Do not clear warn_aggressive_loop_optimizations here.
494 (Raise_Error_to_gnu): Do not set has_checks.
495 (gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
498 2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
500 * gcc-interface/decl.c (components_to_record): Remove obsolete kludge.
501 * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the
502 new type but do not take into account the setting on the old type for
503 the new fields. Rename a local variable.
504 (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at
506 (create_field_decl): Tweak comment.
508 2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
510 * gcc-interface/utils.c (unchecked_convert): Use local variables for
511 the biased and reverse SSO attributes of both types.
512 Further extend the processing of integral types in the presence of
513 reverse SSO to all scalar types.
515 2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
517 * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
518 a simple memory constraint in all cases.
520 * gcc-interface/lang-specs.h: Bump copyright year.
522 2018-10-17 David Malcolm <dmalcolm@redhat.com>
524 * gcc-interface/Make-lang.in (selftest-ada): New.
526 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
528 * exp_ch3.adb (Is_Null_Statement_List): New predicate.
529 (Build_Array_Init_Proc): Use it to find out whether the
530 initialization procedure Is_Null_Init_Proc; if so, set
531 Warnings_Off on the parameter.
532 (Build_Init_Procedure): Likewise.
533 (Init_Formals): Use an in/out first parameter only for
534 unconstrained arrays and for records either containing or built
535 for proteced types or task types; use an out parameter in all
537 * fe.h (Is_Init_Proc): Declare.
538 * gcc-interface/decl.c (type_requires_init_of_formal): Do not
539 return true for a discriminant in an unchecked union.
540 (gnat_to_gnu_param): Do not create a PARM_DECL for the Out
541 parameter of an initialization procedure.
543 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
545 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If
546 this is not a definition, retrieve the expression in all cases
547 even if we are just annotating types.
548 * gcc-interface/trans.c (gnat_to_gnu): Also translate Size
549 attribute for constrained types in this mode.
551 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
553 * adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
554 (__gnat_locate_exec): Check that HOST_EXECUTABLE_SUFFIX is not
555 empty before doing a string search for it.
556 * socket.c (ATTRIBUTE_UNUSED): Define.
557 (__gnat_disable_sigpipe): Add ATTRIBUTE_UNUSED on parameter.
558 * terminals.c (ATTRIBUTE_UNUSED): Move around.
559 (__gnat_setup_child_communication): Add ATTRIBUTE_UNUSED on
561 (__gnat_send_header): Add ATTRIBUTE_UNUSED on parameters.
563 2018-10-09 Yannick Moy <moy@adacore.com>
565 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
566 pragmas as null statements in GNATprove mode.
568 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
570 * exp_ch6.adb (Add_Call_By_Copy_Code): Initialize the temporary
571 made for an Out parameter if the formal type has discriminants.
573 2018-10-09 Maroua Maalej <maalej@adacore.com>
575 * sem_spark.adb (Check_Declaration): fix bug related to non
576 access object permissions.
578 2018-10-09 Doug Rupp <rupp@adacore.com>
580 * libgnat/a-ncelfu.ads: Fix name in header to match package.
582 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
584 * exp_disp.adb (Make_Disp_Asynchronous_Select_Spec): Set
585 Warnings_Off on the B out parameter.
587 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
589 * einfo.ads: Small comment fix.
591 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
593 * sem_ch7.adb (Has_Referencer): Add comment for the
594 N_Freeze_Entity case. Do not rely on
595 Has_Referencer_Of_Non_Subprograms to clear the Is_Public flag on
598 2018-10-09 Ed Schonberg <schonberg@adacore.com>
600 * exp_unst.adb (In_Synchronized_Call): Handle properly private
601 types whose full views are synchronized types, in order to
602 recognize generated subprograms whose bodies must be considered
603 reachable even if no direct calls to them are visible in the
606 2018-10-09 Ed Schonberg <schonberg@adacore.com>
608 * exp_ch4.adb (Expand_Modular_Op): When expanding an operation
609 on nonbinary modular types, convert the opersnds to an integer
610 type that is large enough to hold the modulus of the type, which
611 may be larger than Integer'Last.
613 2018-10-09 Ed Schonberg <schonberg@adacore.com>
615 * exp_unst.adb (Unnest_Subprogram): When an uplevel reference
616 is to an unconstrained formal, the 'Access reference that is
617 created to initialize the corresponding component of the
618 activation record must be wrapped in an unchecked conversion to
619 the generated type of the component. Otherwise, spurious suvtype
620 conformance errors will be generated when the code is within an
621 instantiation and the type of the formal is a formal type of the
622 enclosing generic. Note that during unnesting there is no simple
623 way to determine that the code appears within an instance
624 because ther is no scope stack.
626 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
628 * gcc-interface/decl.c (type_requires_init_of_formal): New
630 (gnat_to_gnu_param): Use it to determine whether a PARM_DECL
631 must be created for an Out parameter passed by copy.
633 2018-10-09 Arnaud Charlet <charlet@adacore.com>
635 * libgnat/a-coboho.ads (Storage_Element): Fix a typo.
637 2018-10-09 Claire Dross <dross@adacore.com>
639 * libgnat/a-cfinve.ads: Remove default value for
640 Max_Size_In_Storage_Elements as it was not supported in SPARK.
642 2018-10-09 Ed Schonberg <schonberg@adacore.com>
644 * exp_ch6.adb (Add_Call_By_Copy_Node,
645 Add_Simple_Call_By_Copy_Node, Expand_Call_Helper): Reset
646 Is_True_Constant on entities used as Out or In_Out parameters in
649 2018-10-09 Ed Schonberg <schonberg@adacore.com>
651 * exp_unst.adb (Unnest_Subprogram): Do not load System to obtain
652 the Address entity unless an activation record is being built.
653 Removes useless with_clauses for System when nested subprograms
654 do not have uplevel references, and therefore do not need
657 2018-10-09 Ed Schonberg <schonberg@adacore.com>
659 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
660 the conformance check on an aspect expression that includes a
661 call to an instance of Unchecked_Conversion, or more generally a
662 call to an intrinsic operation.
664 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
666 * repinfo.adb: Remove with/use clause for Stand.
667 (List_Mechanisms): List the mechanism of functions only.
669 2018-10-09 Bob Duff <duff@adacore.com>
671 * doc/gnat_ugn/gnat_utility_programs.rst: Correct spelling of
672 --eol switch. Document the language-version switches. Update
673 description for --no-exception.
675 2018-10-09 Vasiliy Fofanov <fofanov@adacore.com>
677 * libgnat/s-os_lib.ads (Normalize_Pathname): Fix incorrect
680 2018-10-09 Arnaud Charlet <charlet@adacore.com>
682 * vxlink.adb: Remove pragma Annotate, no longer needed.
684 2018-10-09 Ed Schonberg <schonberg@adacore.com>
686 * checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
687 rather than SPARK_mode in order to preserve the Do_Range_Check
688 flag for verification purposes.
690 2018-10-09 Ed Schonberg <schonberg@adacore.com>
692 * exp_aggr.adb (Expand_Array_Aggregate): If it is not possible
693 to build in place an aggregate with component associations, set
694 the Warnings_Off flag on the generated temporary, to prevent
695 spurious warnings from the backend when compiling with the
696 -Wuninitialized gcc flag.
698 2018-09-30 Alexandre Oliva <oliva@adacore.com>
700 * gcc-interface/lang-specs.h (default_compilers): When given
701 fcompare-debug-second, adjust auxbase like cc1, and pass
703 * gcc-interface/misc.c (flag_compare_debug): Remove variable.
704 (gnat_post_options): Do not set it.
705 * lib-writ.adb (flag_compare_debug): Remove import.
706 (Write_ALI): Do not test it.
708 2018-09-28 Eric Botcazou <ebotcazou@adacore.com>
709 Pierre-Marie de Rodat <derodat@adacore.com>
711 * gcc-interface/decl.c (is_cplusplus_method): Do not require C++
712 convention on Interfaces.
713 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a
714 bona-fide thunk and hand it over to the middle-end.
715 (get_controlling_type): New function.
716 (use_alias_for_thunk_p): Likewise.
717 (thunk_labelno): New static variable.
718 (make_covariant_thunk): New function.
719 (maybe_make_gnu_thunk): Likewise.
720 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the
721 result DECL here instead of...
722 (end_subprog_body): ...here.
724 2018-09-27 Martin Sebor <msebor@redhat.com>
726 * gcc-interface/utils.c (make_packable_type): Introduce a temporary
728 (unchecked_convert): Same.
730 2018-09-26 Elisa Barboni <barboni@adacore.com>
732 * sem_prag.adb (Check_Refined_Global_Item): Improve error
735 2018-09-26 Thomas Quinot <quinot@adacore.com>
737 * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a
738 representation item that is an N_Aspect_Definition, retrieve the
739 entity it applies to using the Entity attribute.
741 2018-09-26 Justin Squirek <squirek@adacore.com>
743 * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition
744 to check for unmarked subprogram references coming from
747 2018-09-26 Arnaud Charlet <charlet@adacore.com>
749 * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches.
751 2018-09-26 Yannick Moy <moy@adacore.com>
753 * errout.ads: Update comment for insertion character '?'.
754 * inline.adb: Use simple insertion character '?' for GNATprove
756 * sem_res.adb (Resolve_Call): Issue an info message on inlining
759 2018-09-26 Ed Schonberg <schonberg@adacore.com>
761 * checks.adb (Apply_Type_Conversion_Checks): Do not generate a
762 range check on the expression of the conversion if it involves a
763 fixed-point type, as such conversions are handled specially
765 * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from
766 Fixed to Integer, use the base type of the expression to ensure
767 that the caller will generate the proper constraint check when
770 2018-09-26 Maroua Maalej <maalej@adacore.com>
772 * sem_spark.adb (Check_Loop_Statement): Fix a bug related to
773 loop exit environment.
774 (Check_Statement): fixing a bug when comparing the source and
775 target in an assignment statement.
777 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
779 * sem_ch12.adb (Instantiate_Package_Body): Capture and restore
780 the full compilation context.
781 (Instantiate_Subprogram_Body): Capture and restore the full
784 2018-09-26 Yannick Moy <moy@adacore.com>
786 * debug.adb: Add use for -gnatd_f switch.
787 * inline.adb (Cannot_Inline): Only issue info message for
788 failure to inline in GNATprove mode when switch -gnatd_f is
791 2018-09-26 Javier Miranda <miranda@adacore.com>
793 * exp_disp.adb (Expand_Interface_Conversion): No displacement of
794 the pointer needed when the type of the operand is an interface
795 type that maches the target type and we are compiling under
796 configurable runtime. Adding also documentation explaining why
797 this cannot be done when compiling with the full runtime.
798 * exp_intr.adb: Update comment.
800 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
802 * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return.
804 2018-09-26 Ed Schonberg <schonberg@adacore.com>
806 * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when
807 applying a predicate check to prevent spurious errors when
808 private ancestors are involved.
810 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
812 * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the
813 secondary stack does not clash with restriction
815 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that
816 the use of the secondary stack does not clash with restriction
818 * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block
819 prior to analysis in order to either provide a local scope for
820 an iterator, or ensure that the secondary stack is properly
822 (Check_Call): Account for the case where the tree may be
823 unanalyzed or contain prior errors.
824 (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call.
825 Update all uses of the subprogram.
826 (Prepare_Loop_Statement): New routine.
828 2018-09-26 Javier Miranda <miranda@adacore.com>
830 * sem_res.adb (Resolve_Actuals): If the formal is a class-wide
831 type conversion then do not skip resolving and expanding the
832 conversion; required to displace the pointer to the object and
833 reference the dispatch table associated with the target
836 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
838 * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number
839 of key-value pairs in the hash table only when adding a brand
842 2018-09-26 Sergey Rybin <rybin@adacore.com>
844 * doc/gnat_ugn/gnat_utility_programs.rst: Add note about
845 processing of aggregate projects in gnatmetric and gnatstub.
847 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
849 * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
850 opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
851 sinfo.ads, snames.ads-tmpl: Minor reformatting.
853 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
855 * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of
857 * impunit.adb: Add unit GNAT.Sets to the list of predefined
859 * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking
861 * libgnat/g-sets.adb: New unit.
862 * libgnat/g-sets.ads: New unit.
863 * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to
864 allow for small sets. Update all occurrences of Table_Locked to
866 (Ensure_Unlocked): Query the number of iterators.
867 (Find_Node): Use the supplied equality.
868 (Is_Empty): New routine.
869 (Lock): Update the number of iterators.
870 (Prepend_Or_Replace): Use the supplied equality.
871 (Size): Update the return type.
872 (Unlock): Update the number of iterators.
873 * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked
874 to Iterated. Rename formal subprogram Equivalent_Keys to "=".
875 (Bucket_Range_Type, Pair_Count_Type): Remove types.
876 (Not_Created, Table_Locked, Iterator_Exhausted): Remove
878 (Hash_Table): Update to store the number of iterators rather
880 (Is_Empty): New routine.
881 (Size): Update the return type.
882 * libgnat/g-lists.adb: Update all occurrences of List_Locked to
884 (Ensure_Unlocked): Query the number of iterators.
886 (Lock): Update the number of iterators.
888 (Unlock): Update the number of iterators.
889 * libgnat/g-lists.ads: Update all occurrences of List_Locked to
891 (Element_Count_Type): Remove type.
892 (Not_Created, Table_Locked, Iterator_Exhausted): Remove
894 (Linked_List): Update type to store the number of iterators
898 * libgnat/gnat.ads (Bucket_Range_Type): New type.
899 (Iterated, Iterator_Exhausted, and Not_Created): New exceptions.
901 2018-09-26 Javier Miranda <miranda@adacore.com>
903 * checks.adb (Install_Null_Excluding_Check): Do not add
904 null-excluding checks when the tree may not be fully decorated.
905 This patch cascade errors.
907 2018-09-26 Gary Dismukes <dismukes@adacore.com>
909 * sem_ch3.adb (Analyze_Object_Declaration): Remove test for
910 Comes_From_Source, which prevented implicit conversions from
911 being applied to anonymous access-to-subprogram formals in
912 constant declartions that arise from instance associations for
913 generic formal objects. Add RM and AARM references to comment.
915 2018-09-26 Olivier Hainque <hainque@adacore.com>
917 * opt.ads (OpenAcc_Enabled): New flag. False by default. True
918 when OpenACC pragmas are requested to be honored, when -fopenacc
919 is found on the command line.
920 * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if
921 -fopenacc is seen on the command line.
922 * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New
923 flag/predicate on Loop statements which embed an Acc_Kernels,
924 Acc_Parallel or Acc_Data pragma.
925 (Is_OpenAcc_Loop): New flag/predicate on Loop statements which
926 embed an Acc_Loop pragma.
927 (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for
929 * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel
930 and Acc_Kernels pragmas. Nothing to do here, all handled by
932 * sem_prag.adb (Acc_First, Acc_Next,
933 Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause,
934 Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause,
935 Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang,
936 Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker,
937 Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New
938 helper for Analyze_Pragma, to handle OpenACC pragmas.
939 (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and
941 * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on
942 variable entity, action for ...
943 (Disable_Constants): Helper for Analyze_Loop_Statement, to ...
944 (Analyze_Loop_Statement): Disable True_Constant on variables
945 referenced within an OpenACC environment.
946 * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives
947 and clauses we can handle. Remove an exraneous whitespace before
948 columns, preventing line length overflow in the generated spec
949 with Ids now reaching beyond 999.
950 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
951 pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data.
952 * gnat_rm.texi: Regenerate.
954 2018-09-26 Ed Schonberg <schonberg@adacore.com>
956 * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P
957 is a derived limited record is not itself limited if P is a
958 derived limited interface.
960 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
962 * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and
963 add In_Nested_Instance and
964 Has_Outer_Referencer_Of_Non_Subprograms parameters. Rename
965 Has_Non_Subprograms_Referencer variable into
966 Has_Referencer_Of_Non_Subprograms and initialize it with the new
967 third parameter. Adjust recursive calls and to the renaming.
968 Replace test on Top_Level with test on In_Nested_Instance to
969 decide whether to clear the Is_Public flag on entities.
970 (Hide_Public_Entities): Adjust call to Has_Referencer.
972 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
974 * exp_disp.adb (Expand_Interface_Conversion): Use Present test.
975 (Expand_Interface_Thunk): Propagate debug info setting from
977 * exp_util.ads (Find_Interface_Tag): Adjust comment.
978 * exp_util.adb (Find_Interface_Tag): Remove assertions of
980 * sem_util.adb (Is_Variable_Size_Record): Only look at
981 components and robustify the implementation.
982 * fe.h (Find_Interface_Tag): Declare.
983 (Is_Variable_Size_Record): Likewise.
985 2018-09-26 Thomas Quinot <quinot@adacore.com>
987 * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order
988 and scalar storage order from root type to classwide equivalent
989 type, to prevent rejection of the equivalent type by the
992 2018-09-26 Justin Squirek <squirek@adacore.com>
994 * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional
995 to freeze called functions within iterator specifications during
997 (Preanalyze_Range): Minor typo fix.
999 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1001 * sem_ch6.adb (Analyze_Function_Return): If the return type has
1002 a dynamic_predicate, apply a Predicate_Check to the expression,
1003 given that it is implicitly converted to the return type.
1004 Exclude case expressions from the check, because in this context
1005 the expression is expanded into individual return statements.
1007 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1009 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: In
1010 -gnatct mode, process the discriminants only for a definition.
1012 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1014 * repinfo.adb (List_Record_Layout): Be prepared for JSON output.
1015 (List_Record_Info): Use the flat representation for record
1016 subtypes in the JSON format.
1018 2018-09-26 Justin Squirek <squirek@adacore.com>
1020 * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
1021 documentation and an extra conditional check for RCI units so
1022 that generated ali files will list the spec only instead of a
1023 body when a body is not found.
1025 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1027 * gcc-interface/gigi.h (error_gnat_node): Delete.
1028 * gcc-interface/trans.c (error_gnat_node): Likewise.
1029 (gigi): Replace it with Current_Error_Node.
1030 (gnat_to_gnu): Likewise.
1031 * gcc-interface/utils.c (rest_of_subprog_body_compilation):
1033 * gcc-interface/misc.c (internal_error_function): Do not set it.
1035 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1037 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
1038 code retrieving the address when a clause has already been
1040 * gcc-interface/trans.c (gnat_to_gnu)
1041 <N_Attribute_Definition_Clause>: For an object with a Freeze
1042 node, build a meaningful expression.
1044 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1046 * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets
1047 Opt.Disable_ALI_File.
1048 * debug.adb: Update debug flags documentation.
1050 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1052 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
1053 analysis of preconditions specified by pragmas (rather than
1054 aspects) is not delayed, and therefore expressions functions
1055 that are completions do not need special handling during
1058 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1060 * exp_unst.adb: Fix handling of up level references for entries.
1062 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1064 * contracts.adb (Expand_Subprogram_Contract,
1065 Process_Preconditions_For): Apply Freeze_Expr_Types to the
1066 expression for a precondition of an expression function that is
1067 a completion, when the completion appears in the private part
1068 and the declaration it completes is in the visible part of the
1070 * freeze.adb (Freeze_Expr_Types): Do not establish the scope of
1071 the operation if it is already installed, as will be the case
1072 when called to analyze the contract oc the subprogram (which
1073 happens when generating code inside the subprogram body).
1075 2018-09-26 Maroua Maalej <maalej@adacore.com>
1077 * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global):
1078 Change the operation associated to assigning to an IN parameter.
1079 In SPARK, IN access-to-variable is an observe operation for a
1080 function, and borrow operation for a procedure.
1082 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1084 * vxlink.adb: Minor reformatting.
1086 2018-09-26 Gary Dismukes <dismukes@adacore.com>
1088 * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
1089 miscellaneous typos.
1091 2018-09-26 Jerome Lambourg <lambourg@adacore.com>
1093 * vxlink.adb: Kill a CodePeer warning.
1095 2018-09-24 Eric Botcazou <ebotcazou@adacore.com>
1098 * fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
1099 of 'char' as the type of the second parameter.
1101 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
1103 * Makefile.rtl (arm% linux-gnueabi%): Always set EH_MECHANISM to -arm.
1105 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
1108 * terminals.c: Do not include termio.h.
1110 2018-08-27 Martin Liska <mliska@suse.cz>
1112 * gcc-interface/decl.c (update_profile): Use new function
1113 fndecl_built_in_p and remove check for FUNCTION_DECL if
1115 * gcc-interface/gigi.h (call_is_atomic_load): Likewise.
1116 * gcc-interface/utils.c (gnat_pushdecl): Likewise.
1118 2018-08-23 Giuliano Belinassi <giuliano.belinassi@usp.br>
1120 * exp_unst.ads: Fix typo 'exapnded' to 'expanded'.
1122 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1124 * checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
1125 exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
1126 exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
1127 lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
1128 sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
1129 sprint.adb: Minor reformatting.
1131 2018-08-21 Jerome Lambourg <lambourg@adacore.com>
1133 * vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
1134 vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
1135 new tool vxlink to handle VxWorks constructors in DKMs.
1136 * gcc-interface/Makefile.in: add rules to build vxlink
1138 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1140 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
1141 Refine the handling of freezing types for expression functions
1142 that are not completions, when analyzing the generated body for
1143 the function: the body is inserted at the end of the enclosing
1144 declarative part, and its analysis may freeze types declared in
1145 the same scope that have not been frozen yet.
1147 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1149 * sem_ch6.adb: Remove Freeze_Expr_Types.
1150 * freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
1151 sem_ch6.adb, and extended to handle other expressions that may
1152 contain unfrozen types that must be frozen in their proper
1154 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
1155 contract is for the generated body of an expression function
1156 that is a completion, traverse the expressions for pre- and
1157 postconditions to freeze all types before adding the contract
1158 code within the subprogram body.
1160 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1162 * sem_ch10.adb: Remove the with and use clause for unit Ghost.
1163 (Analyze_With_Clause): Do not mark a with clause which mentions
1164 an ignored Ghost code for elimination.
1166 2018-08-21 Javier Miranda <miranda@adacore.com>
1168 * lib-writ.adb (Write_Unit_Information): Handle pragmas removed
1171 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1173 * sem_ch6.adb (Check_Synchronized_Overriding): The conformance
1174 between an overriding protected operation and the overridden
1175 abstract progenitor operation requires subtype conformance;
1176 requiring equality of return types in the case of a function is
1177 too restrictive and leads to spurious errors when the return
1178 type is a generic actual.
1180 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1182 * exp_ch9.adb (Expand_N_Timed_Entry_Call,
1183 Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
1184 properly the scope of all entities created in blocks generated
1185 by the expansion of these constructs.
1187 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1189 * sem_ch13.adb (Build_Predicate_Functioss): Apply
1190 Reset_Quantified_Variables_Scope after predicate function has
1191 been analyzed, so that the scope can be reset on the generated
1192 loop statements that have replaced the quantified expressions.
1194 2018-08-21 Bob Duff <duff@adacore.com>
1196 * einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
1199 2018-08-21 Maroua Maalej <maalej@adacore.com>
1201 * sem_spark.adb (Check_Call_Statement): Check global and formal
1202 parameter permissions at call sites.
1203 (Check_Callable_Body): Assume permissions on globals and
1204 parameters depending on their modes then analyse the body
1206 (Check_Declaration): Consider both deep (including elementary
1207 access) object declarations and normal variables. First check
1208 whether the deep object is of Ownership Aspec True or not, then,
1209 depending on its initialization, assign the appropriate state.
1210 Check related to non access type variables deal with
1211 initialization value permissions.
1212 (Check_Expression): Check nodes used in the expression being
1214 (Check_Globals): Call by Check_Call_Statement to perform the
1216 (Check_List): Call Check_Node on each element of the list.
1217 (Check_Loop_Statement): Check the Iteration_Scheme and loop
1219 (Check_Node): Main traversal procedure to check safe pointer usage.
1220 (Check_Package_Body): Check subprogram's body.
1221 (Check_Param_In): Take a formal and an actual parameter and
1222 Check the permission of every in-mode parameter.
1223 (Check_Param_Out): Take a formal and an actual parameter and
1224 check the state of out-mode and in out-mode parameters.
1225 (Check_Statement): Check statements other than procedure call.
1226 (Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
1227 related to the given name.
1228 (Is_Deep): Return True if an object is of access type or has
1229 subfields of access type.
1230 (Perm_Error, Perm_Error_Subprogram_End): Add an error message
1231 whenever the found state on the given name is different from the
1232 one expected (in the statement being analyzed).
1233 (Process_Path): Given an operation and a current state, call
1234 Perm_Error if there is any mismatch.
1235 (Return_Declarations, Return_Globals, Return_The_Global): Check
1236 the state of a given name at the end of the subprogram. These
1237 procedures may change depending on how we shall finally deal
1238 with globals and the rhs state in a move operation.
1239 (Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
1240 Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
1241 Setup_Parameters): Set up the new states to the given node and
1242 up and down the tree after an operation.
1243 (Has_Ownership_Aspect_True): This function may disappear later
1244 when the Ownership Aspect will be implemented in the FE.
1246 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1248 * sem_res.adb (Resolve_Call): Resolve correctly a parameterless
1249 call that returns an access type whose designated type is the
1250 component type of an array, when the function has no defaulted
1253 2018-08-21 Yannick Moy <moy@adacore.com>
1255 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1256 Document entries of the target parametrization file.
1257 * gnat_ugn.texi: Regenerate.
1259 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1261 * sem_attr.adb: Set scope of elaboration flag for 'Access.
1263 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1265 * sprint.adb: Add guard on printing aspects.
1267 2018-08-21 Javier Miranda <miranda@adacore.com>
1269 * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
1272 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1274 * layout.adb: Do not set size of access subprogram if unnesting.
1276 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1278 * freeze.adb: Remove warnings for access to subprograms when
1279 unnesting is active.
1281 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1283 * exp_aggr.adb (Expand_Array_Aggregate): If the component type
1284 is limited, the array must be constructed in place, so set flag
1285 In_Place_Assign_OK_For_Declaration accordingly. This prevents
1286 improper copying of an array of tasks during initialization.
1288 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
1290 * gcc-interface/trans.c (Call_to_gnu): Always suppress an
1291 unchecked conversion around the actual for an In parameter
1294 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
1296 * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
1297 selected component inherited in a record extension and subject
1298 to a representation clause, retrieve the position and size from
1299 the original record component.
1301 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1303 * sem_util.ads, sem_util.adb (New_External_Entity): Type of
1304 Suffix_Index must be Int, not Nat, so that a negative value can
1305 be used to generate a unique name for an external object, as
1306 specified in Tbuild.New_External_Name.
1307 (Scope_Within): Handle private type whose completion is a
1308 synchronized type (For unnesting).
1309 * itypes.ads, itypes.adb (Create_Itype): Ditto
1310 * sem_ch3.adb (Constrain_Corresponding_Record): Generate a
1311 unique name for the created subtype, because there may be
1312 several discriminated tasks present in the same scope, and each
1313 needs its distinct corresponding record subtype.
1315 2018-08-21 Yannick Moy <moy@adacore.com>
1317 * doc/gnat_ugn/gnat_and_program_execution.rst: Update
1318 documentation of dimensionality analysis.
1319 * gnat_ugn.texi: Regenerate.
1320 * Makefile.rtl, impunit.adb: Consider the new units.
1321 * libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
1322 libgnat/s-diflmk.ads: New units based on Float.
1323 * libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
1324 libgnat/s-dlmopr.ads: New units based on Long_Float.
1325 * libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
1327 System.Dim.Generic_Mks.Generic_Other_Prefixes.
1328 * libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
1329 into an instance of System.Dim.Generic_Mks.
1331 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1333 * impunit.adb: Add g-lists to the set of non-implementation
1335 * libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
1336 * Makefile.rtl: Add g-lists to the set of non-tasking units.
1337 * gcc-interface/Make-lang.in: Add g-lists to the set of files
1340 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1342 * exp_ch9.adb (Reset_Scopes): Do not recurse into type
1343 declarations when resetting the scope of entities declared the
1344 procedures generated for entry bodies and accept alternatives.
1345 Use the entity of the procedure declaration, not its body, as
1348 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1350 * einfo.adb (Elaboration_Entity): Include entries and entry
1351 families in the set of legal entities.
1352 (Elaboration_Entity_Required): Include entries and entry
1353 families in the set of legal entities.
1354 (Set_Elaboration_Entity): Include entries and entry families in
1355 the set of legal entities.
1356 (Set_Elaboration_Entity_Required): Include entries and entry
1357 families in the set of legal entities.
1358 (Write_Field13_Name): Update the output of attribute
1360 * einfo.ads: Attributes Elaboration_Entity and
1361 Elaboration_Entity_Required now apply to entries and entry
1364 2018-08-21 Arnaud Charlet <charlet@adacore.com>
1366 * set_targ.adb: Mark some CodePeer message as Intentional.
1368 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1370 * sem_res.adb (Resolve_Call): Force the freezing of an
1371 expression function that is called to provide a default value
1372 for a defaulted discriminant in an object initialization.
1374 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1376 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
1379 2018-08-21 Javier Miranda <miranda@adacore.com>
1381 * checks.ads (Determine_Range): Adding documentation.
1382 * checks.adb (Determine_Range): Don't deal with enumerated types
1383 with non-standard representation.
1384 (Convert_And_Check_Range): For conversion of enumeration types
1385 with non standard representation to an integer type perform a
1386 direct conversion to the target integer type.
1388 2018-08-21 Piotr Trojanek <trojanek@adacore.com>
1390 * lib-xref.ads, lib-xref-spark_specific.adb
1391 (Enclosing_Subprogram_Or_Library_Package): Now roughtly works
1392 for pragmas that come from aspect specifications.
1394 2018-08-21 Pierre-Marie de Rodat <derodat@adacore.com>
1396 * sa_messages.ads, sa_messages.adb: New source files.
1398 2018-08-03 Pierre-Marie de Rodat <derodat@adacore.com>
1401 2018-07-06 Jim Wilson <jimw@sifive.com>
1403 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
1404 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
1405 * gcc-interface/Makefile.in (xoscons): Likewise.
1407 2018-07-31 Alexandre Oliva <oliva@adacore.com>
1408 Olivier Hainque <hainque@adacore.com>
1410 * gcc-interface/trans.c: Include debug.h.
1411 (file_map): New static variable.
1412 (gigi): Set it. Create decl_to_instance_map when needed.
1413 (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
1414 (Sloc_to_locus): ... this. Add decl parm, map it to instance.
1415 * gcc-interface/gigi.h (Sloc_to_locus): Adjust declaration.
1417 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1419 * clean.adb, gnatchop.adb, gnatfind.adb, gnatls.adb,
1420 gnatmake.ads, gnatxref.adb, make.adb, make.ads, make_util.ads,
1421 sfn_scan.adb, vxaddr2line.adb, xeinfo.adb, xoscons.adb,
1422 xr_tabls.adb, xref_lib.adb: Address CodePeer messages.
1424 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1426 * gnatlink.adb: Fix potential Constraint_Error if
1427 Library_Version is too long.
1429 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1431 * sem_elab.adb: Remove duplicate condition detected by CodePeer.
1433 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1435 * exp_unst.adb (Subp_Index): In the case of a protected
1436 operation, the relevant entry is the generated
1437 protected_subprogram_body into which the original body is
1438 rewritten. Assorted cleanup and optimizations.
1440 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1442 * exp_attr.adb (Expand_Attribute, case Fixed_Value): Set the
1443 base type of the result to ensure that proper overflow and range
1444 checks are generated. If the target is a fixed-point tyoe,
1445 generate the required overflow and range checks explicitly,
1446 rather than relying on Apply_Type_Conversion_Checks, which might
1447 simply set the Do_Range_Check flag and rely on the backend to
1450 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1452 * sem_res.adb (Resolve_Call): Establish a transient scope to
1453 manage the secondary stack when the designated type of an
1454 access-to-subprogram requires it.
1456 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1458 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): To find local
1459 subprograms in the elaboration code for a package body, recurse
1460 through nested statement sequences because a compiler-generated
1461 procedure may appear within a condition statement.
1463 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1465 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Handle
1466 properly a protected call that includes a default parameter that
1467 is a call to a protected function of the same type.
1469 2018-07-31 Justin Squirek <squirek@adacore.com>
1471 * lib-writ.adb (Write_With_Lines): Modfiy the generation of
1472 dependencies within ali files so that source unit bodies are
1473 properly listed even if said bodies are missing. Perform legacy
1474 behavior in GNATprove mode.
1475 * lib-writ.ads: Modify documentation to reflect current behavior.
1477 2018-07-31 Eric Botcazou <ebotcazou@adacore.com>
1479 * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.
1480 (mutex_t): Use it for 'lock' and 'data' components.
1481 (cond_t): Likewise for 'data' and use single 'flags' component.
1483 2018-07-31 Justin Squirek <squirek@adacore.com>
1485 * exp_ch5.adb (Make_Field_Assign): Force temporarily generated
1486 objects for assignment of overlaid user objects to be renamings
1487 instead of constant declarations.
1489 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1491 * exp_ch9.adb (Analyze_Pragmas): New routine.
1492 (Build_Private_Protected_Declaration): Code clean up. Relocate
1493 relevant aspects and pragmas from the stand-alone body to the
1494 newly created spec. Explicitly analyze any pragmas that have
1495 been either relocated or produced by the analysis of the
1497 (Move_Pragmas): New routine.
1498 * sem_prag.adb (Find_Related_Declaration_Or_Body): Recognize the
1499 case where a pragma applies to the internally created spec for a
1500 stand-along subprogram body declared in a protected body.
1502 2018-07-31 Gary Dismukes <dismukes@adacore.com>
1504 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
1505 calls to Current_Scope in three assertions with calls to
1508 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1510 * sem_eval.adb (Check_Non_Static_Context): Do not warn on an
1511 integer literal greater than the upper bound of
1512 Universal_Integer'Last when expansion is disabled, to avoid a
1513 spurious warning over ranges involving 64-bit modular types.
1515 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1517 * einfo.adb (Write_Entity_Flags): Also print
1518 Is_Activation_Record flag.
1520 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
1522 * exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb,
1523 repinfo.adb, sem_ch9.adb: Minor replace Ekind membership tests
1524 with a wrapper routine.
1526 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
1528 * ali.adb (Known_ALI_Lines): Remove 'F' as a prefix for lines
1529 related to the FORMAL analysis done by GNATprove.
1531 2018-07-31 Javier Miranda <miranda@adacore.com>
1533 * sem.ads (Inside_Preanalysis_Without_Freezing): New global
1535 * sem.adb (Semantics): This subprogram has now the
1536 responsibility of resetting the counter before analyzing a unit,
1537 and restoring its previous value before returning.
1538 * freeze.adb (Freeze_Entity): Do not freeze if we are
1539 preanalyzing without freezing.
1540 * sem_res.adb (Preanalyze_And_Resolve): Set & restore
1541 In_Preanalysis_Without_Freezing.
1543 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1545 * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
1546 may rename a matching class-wide operation only if the renaming
1547 declaration for that actual is in an enclosing scope (i.e.
1548 within the corrresponding instance).
1550 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1552 * checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
1553 exp_disp.adb, make.adb, sem_ch4.adb, sem_eval.adb, sem_res.adb,
1554 usage.adb: Minor reformatting.
1556 2018-07-31 Bob Duff <duff@adacore.com>
1558 * sem_res.adb (Resolve_Allocator): Do not complain about the
1559 implicit allocator that occurs in the expansion of a return
1560 statement for a build-in-place function.
1562 2018-07-20 Martin Sebor <msebor@redhat.com>
1565 * gcc-interface/misc.c (gnat_handle_option): Change function argument
1568 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1570 * gcc-interface/decl.c (choices_to_gnu): Rename parameters. Deal with
1571 an operand of Character type. Factor out range generation to the end.
1572 Check that the bounds are literals and convert them to the type of the
1573 operand before building the ranges.
1574 * gcc-interface/utils.c (make_dummy_type): Minor tweak.
1575 (make_packable_type): Propagate TYPE_DEBUG_TYPE.
1576 (maybe_pad_type): Likewise.
1578 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1580 * sem_ch4.adb (Try_Object_Operation): Handle properly a prefixed call
1581 in an instance, when the generic parameters include an interface type
1582 and a abstract operation of that type, and the actuals in the instance
1583 include an interface type and a corresponding abstract operation of it,
1584 with a different name than the corresponding generic subprogram
1587 2018-07-17 Arnaud Charlet <charlet@adacore.com>
1589 * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
1592 2018-07-17 Arnaud Charlet <charlet@adacore.com>
1594 * checks.adb (Apply_Division_Check): Add provision for floating-point
1597 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1599 * exp_aggr.adb (Component_OK_For_Backend): If an array component of the
1600 enclosing record has a bound that is out of range (and that has been
1601 rewritten as a raise statement) the aggregate is not OK for any back
1602 end, and should be expanded into individual assignments.
1604 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1606 * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
1608 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1610 * sem_util.ads (Denotes_Same_Object): Likewise.
1611 * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
1613 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1615 * exp_disp.adb (Make_Tags): When the type has user-defined primitives,
1616 build the access type that is later used by Build_Get_Prim_Op_Address
1617 as pointing to a subtype of Ada.Tags.Address_Array.
1619 2018-07-17 Patrick Bernardi <bernardi@adacore.com>
1621 * libgnat/s-memory__mingw.adb: Remove.
1622 * Makefile.rtl: Remove s-memory.adb target pair from the Cygwin/Mingw32
1625 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1627 * frontend.adb (Frontend): The removal of ignored Ghost code must be
1628 the last semantic operation performed on the tree.
1630 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1632 * frontend.adb (Frontend): Update the call to Register_Config_Switches.
1633 * inline.ads: Add new component Config_Switches to record
1634 Pending_Body_Info which captures the configuration state of the pending
1635 body. Remove components Version, Version_Pragma, SPARK_Mode, and
1636 SPARK_Mode_Pragma from record Pending_Body_Info because they are
1637 already captured in component Config_Switches.
1638 * opt.adb (Register_Opt_Config_Switches): Rename to
1639 Register_Config_Switches.
1640 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1641 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1642 routine is now a function, and returns the saved configuration state as
1643 an aggregate to avoid missing an attribute.
1644 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1645 * opt.ads (Register_Opt_Config_Switches): Rename to
1646 Register_Config_Switches.
1647 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1648 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1649 routine is now a function.
1650 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1651 * par.adb (Par): Update the calls to configuration switch-related
1653 * sem.adb (Semantics): Update the calls to configuration switch-related
1655 * sem_ch10.adb (Analyze_Package_Body_Stub): Update the calls to
1656 configuration switch-related subprograms.
1657 (Analyze_Protected_Body_Stub): Update the calls to configuration
1658 switch-related subprograms.
1659 (Analyze_Subprogram_Body_Stub): Update calls to configuration
1660 switch-related subprograms.
1661 * sem_ch12.adb (Add_Pending_Instantiation): Update the capture of
1662 pending instantiation attributes.
1663 (Inline_Instance_Body): Update the capture of pending instantiation
1664 attributes. It is no longer needed to explicitly manipulate the SPARK
1666 (Instantiate_Package_Body): Update the restoration of the context
1668 (Instantiate_Subprogram_Body): Update the restoration of context
1670 (Load_Parent_Of_Generic): Update the capture of pending instantiation
1672 (Set_Instance_Env): Update the way relevant configuration attributes
1673 are saved and restored.
1675 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1677 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
1678 more rvalues in the expression of a renaming.
1680 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1682 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
1684 (TYPE_RETURN_UNCONSTRAINED_P): Likewise.
1685 (TYPE_CI_CO_LIST): Likewise.
1686 * gcc-interface/gigi.h (is_cplusplus_method): Delete.
1687 (fntype_same_flags_p): Adjust comment.
1688 * gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
1689 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
1691 (is_cplusplus_method): Make static and adjust head comment.
1692 (gnat_to_gnu_param): Return a pointer for the "this" parameter of
1694 (gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
1695 callable form. Generate a METHOD_TYPE node for imported C++ methods.
1696 Set param_list at the very end of the processing.
1697 (substitute_in_type) <METHOD_TYPE>: New case.
1698 * gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
1699 (gnat_type_hash_eq): Accept METHOD_TYPE.
1700 * gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
1701 (Attribute_to_gnu): Likewise.
1702 (Call_to_gnu): Likewise.
1703 (process_freeze_entity): Likewise.
1704 * gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
1705 (fntype_same_flags_p): Likewise.
1707 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1709 * inline.adb (Expand_Inlined_Call): Remove extra parentheses.
1711 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
1713 * exp_disp.adb (Gen_Parameters_Profile): Make the _Init parameter an
1715 (Set_CPP_Constructors): Adjust comment accordingly.
1717 2018-07-17 Bob Duff <duff@adacore.com>
1719 * exp_disp.adb (Build_Class_Wide_Check): Return early if the
1720 precondition is supposed to be ignored.
1722 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1724 * sem_ch6.adb (Check_Untagged_Equality): Extend check to operations
1725 declared in the same scope as the operand type, when that scope is a
1728 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1730 * exp_unst.adb (Unnest_Subprograms): Do nothing if the expander is not
1731 active. Don't use Get_Actual_Subtype for record subtypes. Ignore
1732 rewritten identifiers and uplevel references to bounds of types that
1733 come from the original type reference.
1735 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1737 * exp_ch13.adb, exp_ch7.adb, exp_unst.adb, freeze.adb,
1738 libgnat/s-os_lib.adb, sem_ch3.adb, sem_ch3.ads, sem_ch5.adb,
1739 sem_eval.adb, sem_res.adb, sem_util.adb: Minor reformatting.
1741 2018-07-17 Javier Miranda <miranda@adacore.com>
1743 * exp_ch13.adb (Expand_N_Freeze_Entity): Handle subtype declared for an
1745 * freeze.adb (Freeze_Expression): Handle freeze of an entity defined
1746 outside of a subprogram body. This case was previously handled during
1747 preanalysis; the frozen entities were remembered and left pending until
1748 we continued freezeing entities outside of the subprogram. Now, when
1749 climbing the parents chain to locate the correct placement for the
1750 freezeing node, we check if the entity can be frozen and only when no
1751 enclosing node is marked as Must_Not_Freeze the entity is frozen.
1752 * sem_ch3.ads (Preanalyze_Default_Expression): Declaration moved to the
1754 * sem_ch3.adb (Preanalyze_Default_Expression): Code adjusted to invoke
1755 the new subprogram Preanalyze_With_Freezing_And_Resolve.
1756 * sem_ch6.adb (Preanalyze_Formal_Expression): New subprogram.
1757 (Analyze_Expression_Function, Process_Formals): Invoke
1758 Preanalyze_Formal_Expression instead of Preanalyze_Spec_Expression
1759 since the analysis of the formals may freeze entities.
1760 (Analyze_Subprogram_Body_Helper): Skip building the body of the
1761 class-wide clone for eliminated subprograms.
1762 * sem_res.ads, sem_res.adb (Preanalyze_And_Resolve): New subprogram.
1763 Its code is basically the previous version of this routine but extended
1764 with an additional parameter which is used to specify if during
1765 preanalysis we are allowed to freeze entities. If the new parameter is
1766 True then the subtree root node is marked as Must_Not_Freeze and no
1767 entities are frozen during preanalysis.
1768 (Preanalyze_And_Resolve): Invokes the internal version of
1769 Preanalyze_And_Resolve without entity freezing.
1770 (Preanalyze_With_Freezing_And_Resolve): Invokes the internal version of
1771 Prenalyze_And_Resolve with freezing enabled.
1773 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1775 * einfo.ads, libgnat/g-comlin.ads: Minor change "ie" to "i.e." in docs
1778 2018-07-17 Justin Squirek <squirek@adacore.com>
1780 * libgnat/s-os_lib.adb (Argument_String_To_List): Fix trimming of
1783 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1785 * sem_prag.adb (Has_Visible_State): Do not consider constants as
1786 visible state because it is not possible to determine whether a
1787 constant depends on variable input.
1788 (Propagate_Part_Of): Add comment clarifying the behavior with respect
1791 2018-07-17 Yannick Moy <moy@adacore.com>
1793 * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
1794 being propagated in GNATprove mode.
1796 2018-07-17 Dmitriy Anisimkov <anisimko@adacore.com>
1798 * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
1799 public components of Inet_Addr_Type. Introduce public binary
1802 2018-07-17 Javier Miranda <miranda@adacore.com>
1804 * exp_ch7.adb (Make_Transient_Block): When determining whether an
1805 enclosing scope already handles the secondary stack, take into account
1806 transient blocks nested in a block that do not manage the secondary
1807 stack and are located within a loop.
1809 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1811 * sem_util.adb (Enclosing_Subprogram): Protected entries and task
1812 entries must be treated separately: task entries are within the
1813 enclosing subprogram of the task type, while protected entries are
1814 transformed into the corresponding Protected_Body_Subprogram, which is
1815 the enclosing_subprogram of any subprogram declared within the entry
1818 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1820 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
1821 sections on -gnatH and -gnatJ compiler switches.
1822 * gnat_ugn.texi: Regenerate.
1824 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1826 * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
1828 * atree.adb: Add a soft link for a procedure which is invoked whenever
1829 an ignored Ghost node or entity is created.
1830 (Change_Node): Preserve relevant attributes which come from the Flags
1832 (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
1834 (Rewrite): Preserve relevant attributes which come from the Flags
1836 (Set_Ignored_Ghost_Recording_Proc): New routine.
1837 * atree.ads: Define an access-to-suprogram type for a soft link which
1838 records a newly created ignored Ghost node or entity.
1839 (Set_Ignored_Ghost_Recording_Proc): New routine.
1840 * ghost.adb: Remove with and use clause for Lib. Remove table
1841 Ignored_Ghost_Units. Add new table Ignored_Ghost_Nodes.
1842 (Add_Ignored_Ghost_Unit): Removed.
1843 (Initialize): Initialize the table which stores ignored Ghost nodes.
1844 Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
1846 (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
1847 an eliminated ignored Ghost unit.
1848 (Lock): Release and lock the table which stores ignored Ghost nodes.
1849 (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
1851 (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
1852 ignored Ghost nodes.
1853 (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
1854 (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
1856 (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
1857 (Propagate_Ignored_Ghost_Code): Removed.
1858 (Record_Ignored_Ghost_Node): New routine.
1859 (Remove_Ignored_Ghost_Code): Reimplemented.
1860 (Remove_Ignored_Ghost_Node): New routine.
1861 (Ultimate_Original_Node): New routine.
1862 * ghost.ads (Check_Ghost_Completion): Removed.
1863 * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
1864 package clause as ignored Ghost if applicable.
1865 * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
1867 2018-07-17 Javier Miranda <miranda@adacore.com>
1869 * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
1871 (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
1872 of the loop iterator relies on the secondary stack.
1874 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1876 * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
1877 which happens for inlined calls, then fetch the next actual from the
1880 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1882 * einfo.ads: Update documentation for Scalar_Range.
1884 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1886 * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
1887 the Standard package.
1889 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
1891 * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
1893 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1895 * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
1896 synchronized types that are completions of limited types or private
1898 (Scope_Within): Handle properly accept statements in task bodies.
1900 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1902 * sem_prag.adb (Has_Visible_State): Do not consider generic formals
1903 because they are not part of the visible state space. Add constants to
1904 the list of acceptable visible states.
1905 (Propagate_Part_Of): Do not consider generic formals when propagating
1906 the Part_Of indicator.
1907 * sem_util.adb (Entity_Of): Do not follow renaming chains which go
1908 through a generic formal because they are not visible for SPARK
1910 * sem_util.ads (Entity_Of): Update the comment on usage.
1912 2018-07-17 Ed Schonberg <schonberg@adacore.com>
1914 * sem_util.adb (Gather_Components): A discriminant of an ancestor may
1915 have been constrained by a later ancestor, so when looking for the
1916 value of that hidden discriminant we must examine the stored constraint
1917 of other ancestors than the immediate parent type.
1919 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
1921 * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
1922 constructs and entities within receive new entities when replicating a
1924 (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
1925 and entities within receive new entities when replicating a tree.
1926 * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
1927 (Visit_Entity): Visit entities within scoping constructs inside
1928 expression with actions nodes when requested by the caller. Add blocks,
1929 labels, and procedures to the list of entities which need replication.
1930 * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
1931 the comment on usage.
1933 2018-07-17 Arnaud Charlet <charlet@adacore.com>
1935 * doc/gnat_ugn/about_this_guide.rst,
1936 doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
1937 * gnat_ugn.texi: Regenerate.
1939 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
1941 * contracts.adb (Analyze_Contracts): Add specialized processing for
1942 package instantiation contracts.
1943 (Analyze_Package_Contract): Remove the verification of a missing
1945 (Analyze_Package_Instantiation_Contract): New routine.
1946 * contracts.ads (Analyze_Package_Contract): Update the comment on
1948 * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
1949 instance is being examined when trying to determine whether a package
1950 instantiation needs a Part_Of indicator.
1952 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
1954 * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
1955 sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
1956 sem_util.adb: Minor reformatting.
1958 2018-07-16 Arnaud Charlet <charlet@adacore.com>
1960 * frontend.adb: Only unnest subprograms if no previous errors were
1963 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1965 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
1966 contain blocks in the elaboration code for a package body. Create the
1967 elaboration subprogram wrapper only if there is a subprogram
1968 declaration in a block or loop.
1970 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1972 * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
1973 deep copy of the left operand when building each conjuct of the
1974 expanded membership operation, to avoid sharing nodes between them.
1975 This sharing interferes with the unnesting machinery and is generally
1978 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1980 * exp_unst.adb (Visit_Node): Handle 'Address references that are
1983 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1985 * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
1986 in relevant nodes: Allocate, Free, and return statements.
1988 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1990 * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
1991 instance that carries an aspect Default_Storage_Pool that overrides a
1992 default storage pool that applies to the generic unit. The aspect in
1993 the generic unit was removed before copying it in the instance, rather
1994 than removing it from the copy of the aspects that are appended to the
1995 aspects in the instance.
1997 2018-07-16 Ed Schonberg <schonberg@adacore.com>
1999 * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
2001 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
2003 * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
2004 entry body to be the corresponding generated subprogram, for correct
2005 analysis of uplevel references.
2006 * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
2007 Ignore pragmas, fix component associations.
2008 (Register_Subprograms): Subprograms in synchronized types must be
2009 treated as reachable.
2011 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2013 * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
2014 states and variables.
2016 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2018 * sinfo.ads, sinfo.adb (Withed_Body): Remove.
2019 (Set_Withed_Body): Remove.
2021 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2023 * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
2024 when printing debug info.
2026 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2028 * sem.adb (Walk_Library_Items): Reuse local constant.
2029 (Is_Subunit_Of_Main): Turn condition to positive and flip the
2030 IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
2033 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2035 * sem.adb (Walk_Library_Items): Deconstruct dead code.
2037 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2039 * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
2040 Expand_Nonbinary_Modular_Op. Needed for unnesting.
2042 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2044 * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
2045 static predicate (for example True) but has no
2046 static_discrete_predicate.
2048 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2050 * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
2051 class-wide types and record extensions.
2053 2018-07-16 Justin Squirek <squirek@adacore.com>
2055 * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
2056 checks on expanded literals within if and case expressions.
2058 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2060 * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
2061 longest sequence factor. Code clean up.
2062 (Wide_Wide_String_To_String): Use the appropriate longest sequence
2063 factor. Code clean up.
2065 2018-07-16 Javier Miranda <miranda@adacore.com>
2067 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
2068 on Bit_Order when defined for a record extension.
2070 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2072 * libgnat/s-objrea.ads: Minor code clean up.
2074 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2076 * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
2079 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2081 * adaint.c (__gnat_set_file_time_name): Code clean up.
2083 2018-07-16 Javier Miranda <miranda@adacore.com>
2085 * inline.adb (Build_Body_To_Inline): Minor code reorganization that
2086 ensures that calls to function Has_Single_Return() pass a decorated
2088 (Has_Single_Return.Check_Return): Peform checks on entities (instead on
2089 relying on their characters).
2091 2018-07-16 Javier Miranda <miranda@adacore.com>
2093 * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
2094 to avoid generating an ill-formed tree that confuses gnatprove causing
2097 2018-07-16 Yannick Moy <moy@adacore.com>
2099 * inline.adb (Has_Single_Return): Rewrap comment.
2101 2018-07-16 Eric Botcazou <ebotcazou@adacore.com>
2103 * einfo.ads: Minor tweak in comment.
2105 2018-07-16 Javier Miranda <miranda@adacore.com>
2107 * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
2109 2018-07-16 Javier Miranda <miranda@adacore.com>
2111 * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
2112 transform 'Count into a function call if the current scope has been
2115 2018-07-16 Javier Miranda <miranda@adacore.com>
2117 * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
2118 public part of this package.
2120 2018-07-16 Yannick Moy <moy@adacore.com>
2122 * sem_res.adb (Resolve_Call): Do not inline calls inside
2123 compiler-generated functions translated as predicates in GNATprove.
2125 2018-07-16 Gary Dismukes <dismukes@adacore.com>
2127 * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
2128 addition to the existing test for no Storage_Pool as a condition
2129 enabling generation of the call to Check_Standard_Allocator when the
2130 restriction No_Standard_Allocators_After_Elaboration is active.
2131 * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
2132 say that Storage_Error will be raised (rather than Program_Error).
2133 * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
2134 rather than Program_Error when Elaboration_In_Progress is False.
2136 2018-07-16 Gary Dismukes <dismukes@adacore.com>
2138 * sem_eval.adb: Fix spelling for compile-time-known.
2140 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2142 * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
2143 the compiler from entering infinite recursion when trying to determine
2144 whether a deferred constant has a compile time known value, and the
2145 initialization expression of the constant is a reference to the
2148 2018-07-16 Nicolas Roche <roche@adacore.com>
2150 * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
2151 factor from 1/32 to 1/2 for Unbounded_String.
2153 2018-07-13 Eric Botcazou <ebotcazou@adacore.com>
2155 * gcc-interface/lang.opt (funsigned-char): New option.
2156 * gcc-interface/misc.c (gnat_handle_option): Accept it.
2157 * gcc-interface/utils.c (finish_character_type): Tweak comment.
2159 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2161 * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
2162 variable and use it throughout.
2163 <E_Variable>: If the nominal subtype of the object is unconstrained,
2164 compute the Ada size separately and put in on the padding type if the
2166 <E_Record_Type>: Minor tweak.
2167 * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
2168 into max_size_unit throughout.
2170 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2172 * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
2173 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
2174 * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
2175 (add_decl_expr): Change type of second parameter and rename it.
2176 (renaming_from_instantiation_p): New function moved from...
2177 (set_expr_location_from_node): Test for exceptions here and add one
2178 for actual subtypes built for unconstrained composite actuals.
2179 * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
2181 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2183 * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
2184 and adjust recursive calls.
2185 (Identifier_to_gnu): Adjust calls to lvalue_required_p.
2186 (gnat_to_gnu): Likewise.
2188 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2190 * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
2191 (gnat_to_gnu_subprog_type): New pure_flag local variable. Set it for
2192 a pure Ada function with a by-ref In parameter. Propagate it onto the
2193 function type by means of the TYPE_QUAL_RESTRICT flag.
2194 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
2195 function type has the TYPE_QUAL_RESTRICT flag set.
2197 2018-07-06 Jim Wilson <jimw@sifive.com>
2199 * Makefile.rtl: Add riscv*-linux* support.
2200 * libgnarl/s-linux__riscv.ads: New.
2201 * libgnat/system-linux-riscv.ads: New.
2203 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
2204 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
2205 * gcc-interface/Makefile.in (xoscons): Likewise.
2207 2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
2209 * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
2210 (ZCX_By_Default): Set to True.
2212 2018-07-02 Martin Liska <mliska@suse.cz>
2214 * gnatvsn.ads: Bump Library_Version to 9.
2216 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2218 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
2219 using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
2220 (TYPE_ALIGN_OK): Move around.
2221 (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
2222 * gcc-interface/decl.c (change_qualified_type): Move to...
2223 (gnat_to_gnu_entity): Adjust comment.
2224 * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
2225 (ceil_pow2): Use ceil_log2.
2226 * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
2227 and do not set TREE_SIDE_EFFECTS.
2228 (handle_noreturn_attribute): Use change_qualified_type.
2230 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2232 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
2233 the expression of a dispatch table that is not being defined.
2234 <E_Record_Subtype>: Remove obsolete kludge.
2236 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2238 * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
2240 (warn_on_list_placement): New static function.
2241 (components_to_record): Use it to warn on multiple fields in list.
2243 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2245 * gcc-interface/decl.c (variant_desc): Add AUX field.
2246 (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
2248 (reverse_sort_field_list): New static function.
2249 (components_to_record): Place the variant part at the beginning of the
2250 field list when there is an obvious order of increasing position.
2251 (build_variant_list): Initialize it.
2252 (create_variant_part_from): Do not call compute_record_mode directly.
2253 (copy_and_substitute_in_layout): Likewise. Always sort the fields with
2254 fixed position in order of increasing position, in the record and all
2255 the variants, in any. Call reverse_sort_field_list.
2256 * gcc-interface/utils.c (make_packable_type): Compute the sizes before
2257 calling finish_record_type. Do not call compute_record_mode directly.
2258 (finish_record_type): Overhaul final processing depending on REP_LEVEL
2259 and call finish_bitfield_layout if it is equal to one or two.
2261 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2263 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
2264 existing fields of a dummy fat pointer type, if any. Clear the
2265 TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
2267 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2269 * contracts.adb (Process_Body_Postconditions): Expand only checked
2271 (Process_Contract_Cases_For): Expand only checked contract cases.
2272 (Process_Inherited_Preconditions): Ignored class-wide preconditions are
2273 partially expanded because some of their semantic checks are tied to
2275 (Process_Preconditions_For): Expand only checked preconditions.
2276 (Process_Spec_Postconditions): Expand only checked preconditions.
2277 Ignored class-wide preconditions are partially expanded because some of
2278 their semantic checks are tied to the expansion.
2279 * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
2281 * exp_util.adb (Add_Inherited_Invariants): Code clean up.
2282 * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
2284 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2286 * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
2287 libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
2288 libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
2291 2018-06-11 Gary Dismukes <dismukes@adacore.com>
2293 * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
2295 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2297 * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
2298 not add any actuals when the size of the object is known, and the
2299 caller will allocate it.
2300 (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
2301 better illustrate its functionality. Update the comment on the
2302 generated code. Generate a branch for the heap and pool cases where
2303 the object is not necessarity controlled.
2304 (Expand_N_Extended_Return_Statement): Expand the extended return
2305 statement into four branches depending the requested mode if the caller
2306 will not allocate the object on its side.
2307 (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
2308 object on the caller side because this will violate the semantics of
2309 finalizable types. Instead notify the function to allocate the object
2310 on the heap or a user-defined storage pool.
2311 (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
2312 which of the four modes to employ when returning a limited controlled
2314 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
2315 guard which is already covered in Needs_Finalization.
2317 2018-06-11 Olivier Hainque <hainque@adacore.com>
2319 * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
2320 * libgnat/a-exexpr.adb: ... Here, then add comments describing the
2321 major datastructures associated with the current exception raised.
2322 (Setup_Current_Excep): Accept a "Phase" argument conveying the
2323 unwinding phase during which this subprogram is called. For an Ada
2324 exception, don't update the current exception buffer from the raised
2325 exception object during SEARCH_PHASE, as this is redundant with the
2326 call now issued just before propagation starts.
2327 (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
2328 the unwinding start, conveying Phase 0.
2329 (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
2330 the call to Setup_Current_Excep.
2331 * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
2332 on calls to Setup_Current_Excep.
2334 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2336 * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
2337 Build_Access_Type_Decl): New subprograms to handle uplevel references
2338 to formals of an unconstrained array type. The activation record
2339 component for these is an access type, and the reference is rewritten
2340 as an explicit derefenrence of that component.
2342 2018-06-11 Bob Duff <duff@adacore.com>
2344 * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
2345 libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
2346 (Element): Add code to detect dangling cursors in some cases.
2348 2018-06-11 Yannick Moy <moy@adacore.com>
2350 * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
2353 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2355 * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
2356 that its parent is already frozen so that its predicate function, if
2357 any, has already been constructed.
2359 2018-06-11 Yannick Moy <moy@adacore.com>
2361 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
2362 possible task unit as the enclosing context.
2364 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2366 * gnat1drv.adb: Remove use clause for Repinfo.
2367 (Gnat1drv): Beef up comment about the interplay between -gnatc and
2368 back-end annotations. Use full qualified name for List_Rep_Info.
2370 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2372 * libgnat/g-arrspl.ads: Add pragma Preelaborate.
2374 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2376 * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
2377 then" and general logical "ada" in codepeer mode.
2379 2018-06-11 Javier Miranda <miranda@adacore.com>
2381 * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
2382 N_Call_Marker nodes.
2384 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2386 * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
2389 2018-06-11 Yannick Moy <moy@adacore.com>
2391 * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
2392 argument to Assertion_Policy
2393 * gnat_rm.texi: Regenerate.
2395 2018-06-11 Yannick Moy <moy@adacore.com>
2397 * gnat1drv.adb: Do not check representation information in CodePeer and
2398 GNATprove modes, as these modes call a special backend instead of gigi,
2399 so do not have the information.
2401 2018-06-11 Yannick Moy <moy@adacore.com>
2403 * inline.adb (Build_Body_To_Inline): Consider case of extended return
2404 of unconstrained type as one case where inlining is not supported.
2405 (Expand_Inlined_Call): Remove special case for body as extended return
2406 of unconstrained type.
2408 2018-06-11 Yannick Moy <moy@adacore.com>
2410 * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
2412 (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
2414 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
2416 * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
2417 expressions in Pre/Post contracts while in GNATprove_Mode.
2419 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
2421 * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
2422 with AND THEN expressions broken down into individual conjuncts.
2424 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2426 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
2428 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2430 * exp_unst.adb (Visit_Node): Skip generic associations.
2432 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2434 * libgnat/memtrack.adb (fwrite): Remove second definition.
2436 2018-06-11 Javier Miranda <miranda@adacore.com>
2438 * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
2439 (Is_Static_Coextension): Adding documentation.
2440 * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
2441 (Is_Static_Coextension): Extending the assertion.
2442 * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
2443 setting flag Is_Dynamic_Coextension (and vice versa).
2445 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2447 * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
2448 level of a compilation unit, becuase they may contain nested
2449 subprograms that need an activation record.
2451 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2453 * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
2455 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2457 * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
2459 * sinfo.ads: Fix a typo.
2461 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2463 * inline.adb (Expand_Inlined_Call): If no optimization level is
2464 specified, the expansion of a call to an Inline_Always function is
2465 fully performed in the front-end even on a target that support back-end
2468 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2470 * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
2471 with Sec_Stack_Used.
2473 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2475 * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
2476 Is_Assignment_LHS further in. Use predicate
2477 Needs_Variable_Reference_Marker to determine whether to create a
2479 (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
2480 in. Use predicate Needs_Variable_Reference_Marker to determine whether
2481 to create a variable marker.
2482 * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
2483 checks that determine whether the identifier or expanded name is a
2484 suitable variable reference. The checks are now performed by
2485 Needs_Variable_Reference_Marker.
2486 * sem_res.adb (Resolve_Actuals): Use predicate
2487 Needs_Variable_Reference_Marker to determine whether to create a
2489 * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
2490 * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
2492 2018-06-11 Valentine Reboul <reboul@adacore.com>
2494 * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
2495 "Community Edition".
2497 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2499 * sem_ch12.adb (Install_Body): In order to determine the placement of
2500 the freeze node for an instance of a generic nested within another
2501 instance, take into account that the outer instance may be declared in
2502 the visible part of a package and the inner intance may be in the
2503 private part of the same package.
2505 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2507 * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
2509 2018-06-11 Nicolas Roche <roche@adacore.com>
2511 * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
2512 stack overflow while raising a constraint error.
2514 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2516 * repinfo.ads (Rep_Value): Use a single line.
2517 * repinfo.adb (Rep_Value): Likewise.
2518 (List_Attr): Do not use string concatenation.
2520 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2522 * exp_unst.adb (Visit_Node): Check reference to formal parameter of
2523 current procedure, because the bounds of its type may be uplevel
2526 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
2528 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
2529 not a definition, retrieve the expression only if it's a compile-time
2530 known value if we are just annotating types.
2532 * gcc-interface/utils.c (convert): Do not try to upcast properly for a
2533 conversion between tagged types in type_annotate_only mode.
2535 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
2537 * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
2538 * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
2539 type built for an aliased component with variable size.
2541 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2543 * doc/gnat_ugn/project-manager-figure.png: Delete.
2545 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2547 * vxworks-arm-link.spec, vxworks-e500-link.spec,
2548 vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
2549 vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
2550 vxworks-smp-x86-link.spec: New files.
2552 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2554 * gnatvsn.adb: Re-center the copyright header.
2555 * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
2557 2018-05-31 Fedor Rybin <frybin@adacore.com>
2559 * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
2560 gnattest section on user guide.
2562 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2564 * sem_res.adb (Resolve_String_Literal): If the type is a string type
2565 whose component subtype has a static predicate, ensure that the
2566 predicate is applied to each character by expanding the string into the
2567 equivalent aggregate. This is also done if the component subtype is
2570 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2572 * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
2574 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
2576 * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
2579 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2581 * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
2582 the type of the parameter is an unconstrained array type, convert
2583 to the type of the actual before the type of the formal only if the
2584 conversion was suppressed earlier. Use in_param and gnu_actual_type
2585 local variables throughout, and uniform spelling for In Out or Out.
2586 Also remove dead code in the component-by-reference case.
2588 2018-05-31 Frederic Konrad <konrad@adacore.com>
2590 * tracebak.c (STOP_FRAME): Harden condition.
2591 (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
2594 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2596 * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
2597 check to a call to a build-in-place function, given that the return
2598 object is limited and cannot be copied.
2600 2018-05-31 Olivier Hainque <hainque@adacore.com>
2602 * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
2605 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2607 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2608 there is no target, also create a temporary for the return value for
2609 an allocator if the type is an unconstrained record type with default
2612 2018-05-31 Hristian Kirtchev <kirtchev@adacore.com>
2614 * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
2615 boudary for a transient scope.
2617 2018-05-31 Valentine Reboul <reboul@adacore.com>
2619 * gnatvsn.ads: Rename "GPL" version to "Community".
2621 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2623 * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
2626 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
2628 * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
2629 with a semantically equivalent call to Defining_Entity.
2631 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
2633 * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
2634 Max_Queue_Length expression.
2636 2018-05-31 Sergey Rybin <rybin@adacore.com>
2638 * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
2639 that the main unit to be built before the call, now it computes the
2640 closure of the main unit itself.
2641 * gnat_ugn.texi: Regenerate.
2643 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2645 * repinfo.adb (List_Structural_Record_Layout): Set First to false
2646 after having listed the fields of the parent type, if any.
2648 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2650 * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
2651 deal with the ___XP suffix for packed array types here...
2652 <E_Array_Subtype>: ...or here when processing the implementation type
2653 but when processing the original type instead. Do not reuse the DECL
2654 of the implementation type for the original type. Tidy up.
2656 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
2658 * einfo.ads (Object_Size_Clause): Declare.
2659 * einfo.adb (Object_Size_Clause): New function.
2660 * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
2661 retrieving Size_Clause and post the warning on the object size clause
2662 if Has_Object_Size_Clause is true.
2664 2018-05-31 Javier Miranda <miranda@adacore.com>
2666 * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
2667 * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
2668 Find_Primitive_Eq to search for the primitive of types whose underlying
2669 type is a tagged type.
2671 2018-05-31 Yannick Moy <moy@adacore.com>
2673 * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
2674 order of treatment between nodes recognized as loop pragmas (or
2675 generated from one) and block statements.
2677 2018-05-31 Doug Rupp <rupp@adacore.com>
2679 * libgnat/s-osprim__posix2008.adb (Clock): Implement using
2682 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2684 * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
2685 mark subprograms that cannot be eliminated because they must be treated
2686 as reachable from outside the current unit. This includes entry bodies
2687 and protected operations.
2689 2018-05-31 Ed Schonberg <schonberg@adacore.com>
2691 * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
2692 Convert all operands of the generated code to Standard.Unsigned, to
2693 prevent spurious visibility errors. This is needed when the generated
2694 expansion involves a modular index type of an array type, and the index
2695 type is not immediately visible.
2697 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
2699 * einfo.ads (Package_Instantiation): Update comment after a routine
2700 that uses this field has been renamed.
2702 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2704 * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
2705 if the local raise statement includes a string expression. This
2706 expression might be picked up by an outer handler or discarded, but
2707 plays no role in this transformation.
2709 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2711 * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
2714 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2716 * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
2717 field in relevant nodes: Allocate, Free, and return statements.
2719 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2721 * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
2722 that has not been analyzed, as will be the case for a nested aggregate
2723 that is expanded into individual assignments.
2725 2018-05-30 Justin Squirek <squirek@adacore.com>
2727 * aspects.adb, aspects.ads: Register new aspect.
2728 * par-prag.adb (Prag): Register new pragma.
2729 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
2730 aspect similar to Aspect_Max_Queue_Length.
2731 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
2732 set it to use the same processing as Pragma_Max_Queue_Length.
2733 * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
2734 that it can be processed as a pragma in addition to a restriction and
2735 add an entry for the pragma itself.
2737 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2739 * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
2740 is now legal on a variable of composite type initialized with an
2741 aggregate that is fully static and requires no elaboration code.
2742 * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
2743 nested aggregates that are compile-time static, so they can be used to
2744 initialize variables declared with Threqd_Local_Storage.
2745 * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
2746 Thread_Local_Storage.
2747 * gnat_rm.texi: Regenerate.
2749 2018-05-30 Yannick Moy <moy@adacore.com>
2751 * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
2754 2018-05-30 Justin Squirek <squirek@adacore.com>
2756 * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
2758 (Start_Search): Modify to use Start_Search_Internal
2759 (Start_Search_Internal): Add to break out an extra flag for searching
2760 case insensative due to the potential for directories within the same
2761 OS to allow different casing schemes.
2762 * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
2763 for when the more precise solution fails.
2765 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2767 * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
2770 2018-05-30 Pascal Obry <obry@adacore.com>
2772 * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
2773 * libgnat/g-comlin.adb: Add corresponding implementation.
2775 2018-05-30 Gary Dismukes <dismukes@adacore.com>
2777 * sem_res.adb, sem_util.adb: Fix several typos.
2779 2018-05-30 Olivier Hainque <hainque@adacore.com>
2781 * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
2782 (eh_registration_ctors, eh_registration_tors): New static variables,
2783 forced in a .ctors/.dtors section, respectively, with priority.
2785 2018-05-30 Bob Duff <duff@adacore.com>
2787 * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
2788 freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
2789 sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
2790 sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
2791 sinfo.ads: Spell preanalysis, preanalyze correctly.
2793 2018-05-30 Bob Duff <duff@adacore.com>
2795 * libgnat/g-sestin.ads: Rework documentation comments.
2797 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
2799 * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
2800 sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
2801 (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
2803 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
2805 * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
2807 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2809 * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
2810 in a separate routine.
2811 (Is_Atomic_Object_Entity): New routine.
2812 (Is_Atomic_Prefix): Cleaned up.
2813 (Is_Synchronized_Object): Check that the object is atomic, or its type
2815 (Object_Has_Atomic_Components): Removed.
2816 * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
2817 (Is_Atomic_Object_Entity): New routine.
2819 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2821 * sem_ch3.adb (Access_Subprogram_Declaration): The flag
2822 Needs_Activation_Record is only needed on a subprogram type, not on a
2824 * sem_res.adb (Resolve_Selected_Component): If the context type and the
2825 component type are anonymous access to subprograms, use the component
2826 type to obtain the proper value of Needs_Activation_Record flag for the
2829 2018-05-30 Eric Botcazou <ebotcazou@adacore.com>
2831 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
2832 comment about the memset case.
2834 2018-05-30 Bob Duff <duff@adacore.com>
2836 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
2837 to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
2838 We need to analyze it as part of analyzing the block, so that if the
2839 call to Element that initializes Elmt_Decl returns on the secondary
2840 stack, the block will ss_mark/ss_release. This block is inside the
2841 loop; we don't want to leak memory until the loop exits. The purpose
2842 of analyzing Elmt_Decl first was to catch the error of modifying it,
2843 which is illegal because it's a loop parameter. The above causes us to
2844 miss that error. Therefore, we add a flag Is_Loop_Parameter, and set
2845 it on the Element entity, so we end up with an E_Variable node with the
2847 * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
2848 * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
2849 parameter not allowed" error if Is_Loop_Parameter.
2850 * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
2851 trigger the call to Diagnose_Non_Variable_Lhs.
2853 2018-05-30 Arnaud Charlet <charlet@adacore.com>
2855 * checks.adb (Apply_Scalar_Range_Check):
2856 * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
2857 range values for System.Priority in CodePeer mode since the actual
2858 target compiler may provide a wider range.
2860 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2862 * exp_unst.adb: Search specification of main unit as well, for
2865 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2867 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
2868 a package body that is a compilation unit may contain blocks that
2869 declare local subprograms. In Subprogram_Unnesting Mode such
2870 subprograms must be handled as nested inside the (implicit) elaboration
2871 procedure that executes that statement part. To handle properly uplevel
2872 references we construct that subprogram explicitly, to contain blocks
2873 and inner subprograms, The statement part of the compilation unit
2874 becomes a call to this subprogram. This is only done if blocks are
2875 present in the statement list of the body.
2877 2018-05-30 Bob Duff <duff@adacore.com>
2879 * exp_ch7.adb: Minor comment fix.
2881 2018-05-30 Ed Schonberg <schonberg@adacore.com>
2883 * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
2884 that have no corresponding body and appear as attributes of the
2885 corresponding wrapper package declaration.
2886 (Register_Subprogram): New subprogram, used for subprogram bodies and
2887 for subprogram instantiations to enter callable entity into Subp table.
2889 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2891 * libgnat/s-secsta.adb: Reimplement the secondary stack support.
2892 * libgnat/s-secsta.ads: Update the documentation of all routines in the
2893 public part of the package. Reimplement the private part of the
2894 package to account for the new secondary stack structure. Add types
2895 and subprograms for testing purposes. Add several documentation
2898 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
2900 * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
2901 exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
2902 libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
2903 sem_disp.ads, sem_util.adb: Minor reformatting.
2905 2018-05-30 Arnaud Charlet <charlet@adacore.com>
2907 * gcc-interface/Makefile.in: Move special flags for Ada runtime files
2909 * Makefile.rtl: ... to here. Update comments. Protect call to
2910 "GCC_FOR_TARGET" in case target_os isn't defined.
2912 2018-05-30 Arnaud Charlet <charlet@adacore.com>
2914 * gcc-interface/Makefile.in: Move target pair settings from here...
2915 * Makefile.rtl: ... to here.
2916 (setup-rts): New target.
2918 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2920 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
2921 List of All Switches): Replace "modules" with "units".
2922 (Subprogram Inlining Control): Likewise.
2923 * gnat_ugn.texi: Regenerate.
2924 * usage.adb (Usage): Fix description of -gnatn switch.
2926 2018-05-29 Arnaud Charlet <charlet@adacore.com>
2928 * gcc-interface/Makefile.in: Fix typos.
2930 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2932 * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
2933 the finalizer procedure in the At_End handler, for use in LLVM
2936 2018-05-29 Javier Miranda <miranda@adacore.com>
2938 * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
2939 subprogram Inherits_From_Tagged_Full_View to identify more reliably
2940 untagged private types completed with a derivation of an untagged
2941 private whose full view is a tagged type.
2942 * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
2944 (Collect_Primitive_Operations): Handle untagged private types completed
2945 with a derivation of an untagged private type whose full view is a
2946 tagged type. In such case, collecting the list of primitives we may
2947 find two equality primitives: one associated with the untagged private
2948 and another associated with the ultimate tagged type (and we must
2949 remove from the returned list this latter one).
2951 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2953 * exp_unst.adb (Visit_Node): Handle statement sequences that include an
2956 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
2958 * repinfo.adb (List_Entities): Also recurse into blocks without label.
2960 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2962 * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
2963 exceptions if subprogram unnesting is in effect, because these branch
2964 nodes are relevant only in the presence of nested subprograms.
2966 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2968 * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
2969 unconditionally when applied to the largest positive (resp. largest
2970 negative) value of a floating-point type.
2972 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2974 * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
2975 discriminants and exceptions are never components of such. The flag
2976 Needs_Activation_Record is set on subprogram types, not on access to
2979 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2981 * sem_ch3.adb: Set scope of component of subtype.
2983 2018-05-29 Ed Schonberg <schonberg@adacore.com>
2985 * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
2986 carry no type. Such selected components appear in unit names that are
2987 child units, both in the specification and possibly in an end label for
2988 the unit, and they do not contain any relevant uplevel references.
2990 2018-05-29 Arnaud Charlet <charlet@adacore.com>
2992 * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
2995 2018-05-29 Olivier Hainque <hainque@adacore.com>
2997 * libgnat/system-vxworks7-ppc-rtp.ads: New file.
2998 * libgnat/system-vxworks7-ppc-kernel.ads: New file.
2999 * libgnat/system-vxworks7-e500-rtp.ads: New file.
3000 * libgnat/system-vxworks7-e500-kernel.ads: New file.
3001 * libgnat/system-vxworks7-x86-rtp.ads: New file.
3002 * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
3003 * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
3004 gnat-crtbe link spec to use the vx7 variant.
3006 2018-05-29 Olivier Hainque <hainque@adacore.com>
3008 * vx_crtbegin.inc: Use a consistent naming convention for the
3009 registration/deregistration functions across RTP or kernel. Remove the
3010 ctor/dtor attribute setting based on RTP/kernel, expect the optional
3011 attribute extension to be provided by includers instead.
3012 * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
3013 extension for the registration/deregistration functions.
3014 * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
3015 constructor/destructor attribute extensions.
3016 * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
3017 attribute extensions and declare _ctors/_dtors arrays.
3018 * vx_crtbegin_auto.c: Remove.
3019 * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
3020 vxworks7-gnat-crtbe-link.spec.
3021 * libgnat/system-vxworks7-aarch64.ads: Likewise.
3022 * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
3023 * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
3024 * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
3025 * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
3026 * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
3027 * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
3028 * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
3030 2018-05-29 Piotr Trojanek <trojanek@adacore.com>
3032 * ali.adb: Minor reformatting.
3034 2018-05-29 Joel Brobecker <brobecker@adacore.com>
3036 * doc/gnat_ugn/platform_specific_information.rst: Update package
3037 requirements for 32bit GNAT on x86_64-linux.
3038 * gnat_ugn.texi: Regenerate.
3040 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3042 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
3043 Control): Adjust description of -gnatRj.
3044 * gnat_ugn.texi: Regenerate.
3045 * opt.ads (List_Representation_Info_To_JSON): Likewise.
3046 * repinfo.adb (List_Rep_Info): Do not automatically create a file
3047 if List_Representation_Info_To_JSON is true.
3048 * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
3049 check between -gnatRj and -gnatRs.
3050 * usage.adb (Usage): Adjust description of -gnatRj.
3052 2018-05-29 Pascal Obry <obry@adacore.com>
3054 * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
3057 2018-05-29 Pascal Obry <obry@adacore.com>
3059 * libgnat/s-os_lib.adb: Minor reformatting.
3061 2018-05-29 Doug Rupp <rupp@adacore.com>
3063 * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
3064 * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
3065 * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
3066 * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
3068 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3070 * repinfo.ads (JSON format): Document new pair for components.
3071 * repinfo.adb (Derived_Discriminant): New function.
3072 (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
3073 in recursive calls. If the record type is the parent of an extension,
3074 find and list the derived discriminant from the extension, if any.
3075 (List_Component_Layout): List the Discriminant_Number in JSON mode.
3076 (List_Record_Info): Adjust call to List_Structural_Record_Layout.
3078 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3080 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
3081 List of All Switches): Document -gnatRj.
3082 (Debugging Control): Likewise.
3083 * gnat_ugn.texi: Regenerate.
3084 * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
3085 * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
3086 extension if List_Representation_Info_To_JSON is true.
3087 * repinfo.ads: Document the JSON output format.
3088 * repinfo.adb (List_Location): New procedure.
3089 (List_Array_Info): Add support for JSON output.
3090 (List_Entities): Likewise.
3093 (Print_Expr): Likewise.
3094 (List_Linker_Section): Likewise.
3095 (List_Mechanisms): Likewise.
3096 (List_Name): Likewise.
3097 (List_Object_Info): Likewise.
3098 (List_Record_Info): Likewise.
3099 (List_Component_Layout): Likewise. Add Indent parameter.
3100 (List_Structural_Record_Layout): New procedure.
3101 (List_Attr): Add support for JSON output.
3102 (List_Type_Info): Likewise.
3103 (Write_Unknown_Val): Likewise.
3104 * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
3105 * usage.adb (Usage): List -gnatRj.
3107 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3109 * repinfo.adb (List_Component_Layout): New procedure extracted from...
3110 (List_Record_Layout): ...here. Invoke it.
3112 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3114 * repinfo.adb (Write_Unknown_Val): New procedure.
3115 (List_GCC_Expression): Call it.
3116 (List_Record_Layout): Likewise.
3117 (Write_Val): Likewise.
3119 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3121 * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
3124 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3126 * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
3127 This breaks build of cross compilers with older versions of GNAT, so
3130 2018-05-29 Doug Rupp <rupp@adacore.com>
3132 * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
3135 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3137 * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
3139 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3141 * repinfo.adb (List_Entities): Do not list the Linker_Section for
3143 (List_Mechanisms): ...but here instead. Use consistent name output
3144 and formatting conventions.
3146 2018-05-29 Bob Duff <duff@adacore.com>
3148 * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
3150 * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
3151 To_Mixed): New functions.
3152 * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
3153 allows both '\' and '/' on Windows.
3155 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3157 * repinfo.ads: Minor fixes and tweaks in comments.
3159 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3161 * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
3162 it with calls to Unop.
3164 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3166 * repinfo.ads (TCode): Adjust range.
3167 (Truth_Andif_Expr): Remove.
3168 (Truth_Orif_Expr): Likewise.
3169 (Truth_And_Expr .. Dynamic_Val): Adjust value.
3170 * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
3171 (Rep_Value): Likewise.
3172 * repinfo.h (Truth_Andif_Expr): Remove.
3173 (Truth_Orif_Expr): Likewise.
3174 (Truth_And_Expr .. Dynamic_Val): Adjust value.
3175 * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
3176 through to TRUTH_AND_EXPR case.
3177 <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
3179 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3181 * exp_unst.adb (Visit_Node): For indexed components and attribute
3182 references, examine index expressions or associated expressions as well
3183 to record uplevel references.
3184 (Vist_Node): For function and procedure calls, if a formal is an
3185 unconstrained array and the actual is constrained, check whether bounds
3186 of actual have uplevel references.
3188 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3190 * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
3191 they can appear as components of activation records.
3192 * exp_unst.adb (Visit_Node): A reference to an exception may be an
3195 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3197 * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
3198 depends on a discriminant manually instead of using the predicate
3199 Size_Depends_On_Discriminant in the array type case.
3201 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3203 * exp_unst.adb (Check_Static_Type): For a record subtype, check
3204 discriminant constraints as well.
3205 (Visit_Node): For a selected component, check type of prefix, as is
3206 done for indexed components and slices.
3208 2018-05-28 Javier Miranda <miranda@adacore.com>
3210 * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
3211 value when converting a float value to a fixed-point value. This is
3212 required for CCG because it handles fixed-point types by means of
3213 unsigned integer type variables. The range check is now performed using
3214 the integer value stored in this temporary.
3216 2018-05-28 Yannick Moy <moy@adacore.com>
3218 * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
3219 Length as valid non-interfering contexts for SPARK.
3221 2018-05-28 Claire Dross <dross@adacore.com>
3223 * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
3224 generic inheritance utilities.
3225 (Generic_Inherited_Subprograms): Generic version of
3226 Inherited_Subprograms, generic in Find_Dispatching_Type function.
3227 (Generic_Is_Overriding_Subprogram): Generic version of
3228 Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
3229 (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
3230 Sem_Disp.Find_Dispatching_Type.
3231 (Is_Overriding_Subprogram): Instance of
3232 Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
3233 (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
3234 with Sem_Disp.Find_Dispatching_Type.
3236 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3238 * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
3239 component type, do not expand array equality using the unconstrained
3240 base type, except for the case where the bounds of the type depend on a
3243 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3245 * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
3246 access-to-subprogram types, to indicate that an indirect call through
3247 such a type requires an activation record when compiling for LLVM.
3248 * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
3250 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3252 * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
3253 when bounds of fixed type are static, to remove some spuerfluous
3254 implicit conversions and provide an accurate result when converting
3255 back and forth between the fixed point type and a floating point type.
3257 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3259 * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
3262 2018-05-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3264 * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
3265 replaced, if any; all callers changed.
3266 (Note_Uplevel_Ref): Likewise. Also replace reference to deferred
3267 constant with private view so we take the address of that entity.
3268 (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
3269 any; all callers changed. Handle N_Indexed_Component like
3270 N_Attribute_Reference. Add N_Type_Conversion case.
3271 (Visit_Node): Indexed references can be uplevel if the type isn't
3273 (Unnest_Subprograms): Don't rewrite if no reference given. If call has
3274 been relocated, set first_named pointer in original node as well.
3276 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3278 * exp_aggr.adb (Flatten): Copy tree of expression in a component
3279 association with a range or a set of discrete choices, rather than
3280 relocating the node. This avoids inconsistencies in the tree when
3281 handling nested subprograms with uplevel references for LLVM.
3283 2018-05-28 Arnaud Charlet <charlet@adacore.com>
3285 * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
3288 2018-05-28 Arnaud Charlet <charlet@adacore.com>
3290 * exp_unst.adb: Fix typo.
3292 2018-05-28 Bob Duff <duff@adacore.com>
3294 * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
3295 unnecessary use of 'Unrestricted_Access.
3297 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3299 * repinfo.adb (Expr_Value_S): New routine.
3300 (List_Linker_Section): Properly extract the value of the section
3303 2018-05-28 Patrick Bernardi <bernardi@adacore.com>
3305 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
3306 description of the -D binder switch to reflect current usage.
3307 * gnat_ugn.texi: Regenerate.
3309 2018-05-28 Gary Dismukes <dismukes@adacore.com>
3311 * exp_ch3.adb: Minor reformatting
3313 2018-05-28 Justin Squirek <squirek@adacore.com>
3316 (Build_Initialization_Call): Add logic to pass the appropriate actual to match
3318 (Init_Formals): Add new formal *_skip_null_excluding_check
3319 * exp_util.adb, exp_util.ads
3320 (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
3322 (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
3323 (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
3324 used to determine how to generate an Init_Proc for a given type.
3325 (Needs_Constant_Address): Minor reformatting
3327 (Resolve_Null): Add logic to generate a conditional check in certain cases
3329 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3331 * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
3334 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3336 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
3337 the declarations of single concurrent types because they fall in the
3338 category of full type and object declarations.
3340 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3342 * repinfo.adb (Compute_Max_Length): Skip _Parent component.
3343 (List_Record_Layout): Likewise.
3345 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3347 * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
3348 includes a call to function to which it applies. This may mean an
3349 omission of an attribute reference 'Result, in particular if the
3350 function is pqrameterless.
3352 2018-05-28 Justin Squirek <squirek@adacore.com>
3354 * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
3355 misresolved package name is not a case of mistaken identity.
3357 2018-05-28 Yannick Moy <moy@adacore.com>
3359 * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
3360 GNATprove mode, as the order of resolution (low then high) means that
3361 all the information is not available when resolving the low bound the
3364 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3366 * repinfo.adb (List_Array_Info): Start with an explicit blank line and
3367 end with the linker section, if any.
3368 (List_Entities): Do not output the linker section for record types,
3369 array types and variables.
3370 (Print_Expr): Factor out common processing for unary operators and
3371 special values. Adjust and reorder the various cases.
3372 (List_Object_Info): End with the linker section, if any.
3373 (List_Record_Info): Likewise.
3374 (List_Type_Info): Do not start with a blank line.
3376 2018-05-25 Nicolas Roche <roche@adacore.com>
3378 * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
3379 that the result will be either -infinite or +infinite.
3381 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
3383 * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
3384 libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
3385 Expand range of type to match the address space of the target.
3386 (Task_Storage_Size): Remove unused type.
3388 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3390 * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
3391 of a fixed point type and the parent is a multiplying operation,
3392 resolve the operand with its own type because the context will impose a
3393 resulting type on the result of the multiplication by means of
3394 approriate conversion.
3396 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3398 * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
3399 the in-place initialization aggregate created for pragmas
3400 Initialize_Scalars or Normalize_Scalars is performed with checks
3403 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3405 * exp_aggr.adb (Convert_To_Positional): Bump default for
3406 Max_Others_Replicate to 32. Update comments.
3407 * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
3408 (No_File_Info_Cache): Initialize separately.
3409 * osint.adb (No_File_Info_Cache): Update initializer.
3411 2018-05-25 Javier Miranda <miranda@adacore.com>
3413 * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
3414 test when the left operand is a class-wide interface and the right
3415 operand is not a class-wide type.
3416 * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
3419 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3421 * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
3422 in an others clause to prevent visibility issues with the generated
3424 (Component_OK_For_Backend): Return false for a quantified expression.
3425 (Check_Static_Component): Ditto.
3427 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3429 * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
3430 (SS_Allocate_Dynamic): New routine. The allocation logic is now split
3431 into three distring cases rather than in one loop which attempts to
3432 handle all three cases. This rewrite eliminates an issue where the last
3433 frame of the stack cannot be freed, thus causing the memory range of a
3434 new frame to approach the overflow point of the memory index type.
3435 Since the overflow is logically treated as a
3436 too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
3437 (SS_Allocate_Static): New routine. The routine factorizes the static
3438 secondary stack-related code from the former SS_Allocate.
3440 2018-05-25 Sergey Rybin <rybin@adacore.com>
3442 * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
3443 option for gnatelim.
3445 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3447 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
3448 Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
3449 is created when the proper body of the stub is analyzed.
3450 * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
3451 is the proper body of a subunit, the cloned body must be inserted in
3452 the declarative list that contains the stub.
3454 2018-05-25 Justin Squirek <squirek@adacore.com>
3456 * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
3457 generate code for 6.5(8-10) so that we don't get an assertion error
3458 when dealing with an incomplete return type.
3460 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3462 * pprint.adb (Expression_Name): Strip too long expressions to avoid
3463 carrying very large strings.
3465 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
3467 * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
3470 2018-05-25 Doug Rupp <rupp@adacore.com>
3472 * tracebak.c (aarch64-linux): Implement.
3474 2018-05-25 Justin Squirek <squirek@adacore.com>
3476 * sem_ch8.adb: Minor reformatting.
3478 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
3480 * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
3483 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3485 * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
3486 pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
3489 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3491 * sem_ch12.adb (Instance_Exists): New function, subsidiary of
3492 Validate_Derived_Type_Instance, to verify that all interfaces
3493 implemented by the formal type are also implemented by the actual. The
3494 verification is complicated when an interface of the formal is declared
3495 in a generic unit and the actual is declared in an instance of it.
3496 There is currently no mechanism to relate an interface declared within
3497 a generic to the corresponding interface in an instance, so we must
3498 traverse the list of interfaces of the actual, looking for a name
3499 match, and verifying that that interface is declared in an instance.
3501 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
3503 * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
3504 assertions; replace function versions of Next_Formal/Next_Actual with
3505 their procedural versions (which are more concise).
3507 2018-05-25 Doug Rupp <rupp@adacore.com>
3509 * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
3510 libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
3511 libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
3512 libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
3513 libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
3514 (Relative_Timed_Wait): Remove.
3515 * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
3516 for incremental looping. Remove references to Rel_Time and
3517 Relative_Timed_Wait.
3518 * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
3519 (Timed_Delay): Make separate.
3520 * libgnat/s-optide.adb: New separate procedure.
3521 * libgnat/s-osprim.ads (Max_System_Delay): New constant.
3522 * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
3523 (Max_System_Delay): New constant.
3525 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3527 * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
3528 for a formal derived type implements all the interfaces declared for
3531 2018-05-25 Yannick Moy <moy@adacore.com>
3533 * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
3534 and GNATprove modes when applicable policy is Ignore.
3536 2018-05-25 Eric Botcazou <ebotcazou@adacore.com>
3538 * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
3539 boolean type with convention C.
3540 * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
3541 * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
3542 FOREIGN and use it throughout the function.
3543 <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
3545 <E_Enumeration_Subtype>: Likewise for subtypes.
3546 <E_Record_Type>: Force the size of a storage unit on empty classes.
3547 * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
3548 boolean types with precision 1 if the size is the expected one.
3550 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3552 * pprint.adb (Expression_Name): Do not print non ASCII characters.
3554 2018-05-25 Bob Duff <duff@adacore.com>
3556 * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
3557 libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
3559 2018-05-25 Bob Duff <duff@adacore.com>
3561 * sem_util.ads: Minor comment fix.
3563 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3565 * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
3566 prefixes of array attributes, to prefixes that are entity names whose
3567 type is constrained.
3568 (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
3569 subprogram, as itype created for loops in pre/postcondition may appear
3570 in loops at the library level.
3572 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3574 * sem_ch13.adb (Build_Predicate_Functions): The predicate function
3575 declaration is inserted into the tree and analyzed at that point, so
3576 should not be reinserted when the body is constructed. Inside a
3577 generic, ensure that the body is not inserted twice in the tree.
3579 2018-05-25 Yannick Moy <moy@adacore.com>
3581 * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
3582 declarations not coming from source.
3584 2018-05-25 Fedor Rybin <frybin@adacore.com>
3586 * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
3587 --copy-environment for gnattest.
3589 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
3591 * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
3593 * sem_prag.adb (Get_Base_Subprogram): Same as above.
3595 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
3597 * fe.h (Set_Normalized_First_Bit): Declare.
3598 (Set_Normalized_Position): Likewise.
3599 * repinfo.adb (List_Record_Layout): Do not use irregular output for a
3600 variable position. Fix minor spacing issue.
3601 * gcc-interface/decl.c (annotate_rep): If a field has a variable
3602 offset, compute the normalized position and annotate it in addition to
3605 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
3607 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
3608 Constify and rename variables. Fix formatting.
3609 (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
3610 <N_Raise_Statement>: Likewise.
3612 2018-05-24 Javier Miranda <miranda@adacore.com>
3614 * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
3615 body of a variant record equality renaming.
3616 (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
3617 implementation of Build_Body_For_Renaming.
3618 * exp_ch3.ads (Build_Variant_Record_Equality): New library level
3619 function that factorizes the functionality needed by
3620 Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
3621 of a variant record equality subprogram.
3622 * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
3623 (Build_Variant_Record_Equality): New local procedure of
3624 Expand_Freeze_Record_Type containing all the code specific for freezing
3625 the record type that cannot be place in the new library level function.
3627 2018-05-24 Ed Schonberg <schonberg@adacore.com>
3629 * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
3630 in_parameters, used when unesting subprograms for LLVM, to indicate
3631 that a generated parameter carries the activation record from the
3632 enclosing subprogram.
3633 * exp_unst.adb (Check_Static_Type): Handle array attributes of types
3634 whose bounds may contain up-level references that need to be added to
3635 an activation recoord.
3636 (Add_Extra_Formal): Set Is_Activation_Record on new formal.
3638 2018-05-24 Yannick Moy <moy@adacore.com>
3640 * pprint.adb (Expression_Image): Improve the printing of expressions,
3641 by taking more cases into account, in particular qualified expressions
3642 and aggregates. Also count more the number of parentheses to close
3643 after the expression.
3645 2018-05-24 Javier Miranda <miranda@adacore.com>
3647 * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
3648 check for renamed discriminants.
3649 * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
3650 Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
3651 Is_Visible_Component pass the associated selector node to allow
3652 checking renamed discriminants on untagged types.
3654 2018-05-24 Ed Schonberg <schonberg@adacore.com>
3656 * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
3657 link to a use_type clause if this would cause an infinite loop in the
3658 machinery that detects redundant use clauses. This may happen when the
3659 redundant clauses appear in the context of a child unit and the context
3662 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
3664 * sinfo.ads: Fix grammar in comment.
3666 2018-05-24 Justin Squirek <squirek@adacore.com>
3668 * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
3669 and manage doubly-linked entity chain.
3670 (Nested_Scenarios): Removed entity field used for optimization during
3671 elaboration to make room for the new field Prev_Entity.
3672 (Link_Entities): Added to replace redundant calls to Set_Next_Entity
3673 and Set_Prev_Entity as well as centralize changes to the entity chain.
3674 (Predicated_Parent): Modified to use Node38.
3675 (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
3677 (Remove_Entity): Moved from sem_util.
3678 (Set_Nested_Scenarios): Deleted.
3679 (Set_Predicated_Parent): Modified to use Node38.
3680 (Set_Prev_Entity): Added to set Prev_Entity field.
3681 (Set_Validated_Object): Modified to use Node38.
3682 (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
3684 (Validated_Object): Modified to use Node38.
3685 (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
3686 predicated parent cases.
3687 (Write_Field38_Name): Add predicated parent and Validated_Object cases.
3688 * sem_ch3.adb (Process_Subtype): Add guard to protect against
3689 inappropriate marking of Predicated_Parent to non-itype subtypes.
3690 (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
3691 (Copy_And_Swap): Add setting of Prev_Entity.
3692 (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
3693 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
3695 (New_Overloaded_Entity): Remove block created to search for previous
3696 entities in the entity chain with relevant calls to Prev_Entity as well
3697 as replace duplicated code from Remove_Entity_And_Homonym with a call
3699 * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
3701 * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
3702 initial subprogram declarations related to Nested_Scenarios.
3703 (Process_Nested_Scenarios): Deleted.
3704 (Save_Scenario): Deleted.
3705 (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
3706 node space in the entity tree.
3707 * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
3708 (Remove_Entity_And_Homonym): Added to separate functionality of
3709 Remove_Entity from the homonym chain directly.
3710 * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
3711 w/ Link_Entities and Unlink_Next_Entity.
3712 * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
3714 * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
3715 Set_Next_Entity w/ Link_Entities.
3716 * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
3717 Link_Entities and Unlink_Next_Entity.
3718 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
3719 call to Remove_Entity with its new incarnation.
3720 * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
3721 * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
3724 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3726 * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
3727 Install_Limited_Withed_Unit.
3728 (Expand_With_Clause): Update the call to Install_Withed_Unit.
3729 (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
3730 (Install_Context_Clauses): Update the call to Install_Withed_Unit.
3731 (Install_Limited_Context_Clauses): Update the calls to
3732 Install_Limited_Withed_Unit.
3733 (Install_Limited_Withed_Unit): Renamed to better illustrate its
3735 (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
3736 and Install_Limited_Withed_Unit.
3737 (Install_With_Clause): Uninstall a limited with clause if a [private]
3738 with clause is given for the same package.
3739 (Install_Withed_Unit): Renamed to better illustrate its purpose.
3740 (Remove_Limited_With_Unit): New routine.
3742 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
3744 * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
3745 (__gnat_personality_seh0): Adjust and beef up comments, and
3746 fix formatting throughout.
3747 (__gnat_adjust_context): Deal minimally with version 2.
3748 * seh_init.c (__gnat_map_SEH): Fix formatting.
3749 (_gnat_SEH_error_handler): Adjust comments.
3750 (__gnat_install_SEH_handler): Fix formatting.
3752 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3754 * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
3756 2018-05-24 Ed Schonberg <schonberg@adacore.com>
3758 * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
3759 aggregate with static bounds when named associations cover all index
3760 positions and the others clause is redundant.
3762 2018-05-24 Raphael Amiard <amiard@adacore.com>
3764 * libgnat/a-cohama.ads: Add documentation.
3766 2018-05-24 Raphael Amiard <amiard@adacore.com>
3768 * libgnat/a-convec.ads: Add documentation.
3770 2018-05-24 Justin Squirek <squirek@adacore.com>
3772 * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
3773 expansion for limited tagged types when the node to be expanded is a
3774 raise expression due to it not representing a valid object.
3775 * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
3776 message regarding assignments to limited types to ignore genereated
3779 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3781 * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
3782 Ghost-related attributes of the class-wide subtype because the copy
3785 2018-05-24 Justin Squirek <squirek@adacore.com>
3787 * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
3788 marking use clauses as effective when the reference appears within
3791 2018-05-24 Cyrille Comar <comar@adacore.com>
3793 * doc/gnat_rm/the_gnat_library.rst: Fix typos.
3794 * gnat_rm.texi: Regenerate.
3796 2018-05-24 Bob Duff <duff@adacore.com>
3798 * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
3799 for build-in-place functions with a caller-unknown-size result.
3800 (Create_Finalizer): For build-in-place functions with a
3801 caller-unknown-size result, check at run time whether we need to
3802 release the secondary stack.
3804 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3806 * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
3807 generated incomplete type.
3809 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3811 * expander.adb (Expand): Update the save and restore of the Ghost
3813 * exp_ch3.adb (Freeze_Type): Likewise.
3814 * exp_disp.adb (Make_DT): Likewise.
3815 * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
3816 (Build_DIC_Procedure_Declaration): Likewise.
3817 (Build_Invariant_Procedure_Body): Likewise.
3818 (Build_Invariant_Procedure_Declaration): Likewise.
3819 (Make_Predicate_Call): Likewise.
3820 * freeze.adb (Add_To_Result): Insert the freeze action of a living
3821 entity prior to the start of the enclosing ignored Ghost region.
3822 (Freeze_Entity): Update the save and restore of the Ghost region.
3823 * ghost.adb (Install_Ghost_Mode): Reimplemented.
3824 (Install_Ghost_Region): New routine.
3825 (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
3826 (Mark_And_Set_Ghost_Body): Likewise.
3827 (Mark_And_Set_Ghost_Completion): Likewise.
3828 (Mark_And_Set_Ghost_Declaration): Likewise.
3829 (Mark_And_Set_Ghost_Instantiation): Likewise.
3830 (Mark_And_Set_Ghost_Procedure_Call): Likewise.
3831 (Name_To_Ghost_Mode): New routine.
3832 (Restore_Ghost_Region): New routine.
3833 * ghost.ads (Install_Ghost_Region): New routine.
3834 (Restore_Ghost_Region): New routine.
3835 * opt.ads: Add new global variable Ignored_Ghost_Region.
3836 * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
3837 region. Install a clean region.
3838 * sem.adb (Analyze): Likewise.
3839 (Do_Analyze): Likewise.
3840 * sem_ch3.adb (Analyze_Object_Declaration): Likewise
3841 (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
3842 capture the ultimate alias of the current primitive.
3843 (Process_Full_View): Update the save and restore of the Ghost region.
3844 Do not inherit DIC and invariant procedures.
3845 * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
3847 * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
3848 (Analyze_Subprogram_Body_Helper): Likewise.
3849 * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
3850 * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
3851 (Analyze_Subprogram_Instantiation): Likewise.
3852 (Instantiate_Package_Body): Likewise.
3853 (Instantiate_Subprogram_Body): Likewise.
3854 * sem_ch13.adb (Build_Predicate_Functions): Likewise.
3855 (Build_Predicate_Function_Declaration): Likewise.
3857 (Add_Dispatching_Operation): Do not consider DIC and invariant
3859 (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
3860 a dispatching subprogram.
3861 (Check_Operation_From_Private_View): Likewise.
3862 (Override_Dispatching_Operation): Likewise.
3863 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
3864 and restore of the Ghost region.
3865 (Analyze_Initial_Condition_In_Decl_Part): Likewise.
3866 (Analyze_Pragma): Update the save and restore of the Ghost region.
3867 (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
3868 * sem_util.adb (Is_Suitable_Primitive): New routine.
3869 * sem_util.ads (Is_Suitable_Primitive): New routine.
3870 * sinfo.ads: Update the section of Ghost regions.
3872 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
3874 * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
3875 Change "condition" to "case guard" after renaming in the contract
3877 * gnat_rm.texi: Regenerate.
3879 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3881 * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
3882 construct with discrete choices no longer contains a subtype with
3883 predicates since the expansion already handled this case.
3885 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3887 * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
3888 conversion to the return type to avoid a side effect where an imported
3889 relocated function generates a new anonymous access type, whose
3890 accessibility level does not agree with with that of the wrapper.
3892 2018-05-24 Javier Miranda <miranda@adacore.com>
3894 * sem_util.adb (Abstract_Interface_List): Add missing support for
3895 private types whose full view is a synchronized type.
3896 * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
3897 derivation of a private type parent type is a task type with
3898 discriminants as gigi does not use such type directly.
3900 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
3902 * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
3903 variable marker when the reference appears in the formal part of a
3904 compilation unit instance because there is no place to insert it.
3905 (In_Compilation_Instance_Formal_Part): New routine.
3907 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
3909 * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
3910 configuration parameter.
3912 2018-05-24 Doug Rupp <rupp@adacore.com>
3914 * argv-lynxos178-raven-cert.c: New file.
3915 * libgnat/system-lynxos178-x86.ads: New file.
3917 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3919 * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
3920 Minor reformattings.
3922 2018-05-23 Pascal Obry <obry@adacore.com>
3924 * adaint.c (win32_wait): Properly free the handle/pid lists when
3925 WaitForMultipleObjects fails (return WAIT_FAILED).
3927 2018-05-23 Pascal Obry <obry@adacore.com>
3929 * adaint.c (win32_wait): Add missing parentheses.
3931 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
3933 * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
3934 (Expand_N_Object_Declaration): Do not check for a large modular array
3936 * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
3937 (Freeze_Object_Declaration): Code cleanup. Check for a large modular
3939 * sem_ch3.adb: Minor reformatting.
3941 2018-05-23 Ed Schonberg <schonberg@adacore.com>
3943 * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
3944 retrieval of the applicable predicate function to an itype created for
3945 a constrained array component.
3946 * einfo.adb: Subprograms for Predicated_Parent.
3947 (Predicate_Function): Use new attribute.
3948 * exp_util.adb (Make_Predicate_Call): If the predicate function is not
3949 available for a subtype, retrieve it from the base type, which may have
3950 been frozen after the subtype declaration and not captured by the
3951 subtype declaration.
3952 * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
3953 legal within a generated initiqlization procedure, as may happen with a
3954 predicate check on a component, when the predicate function applies to
3955 the base type of the component.
3956 * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
3957 predicates for subtype declarations and for subtype indications in
3959 (Process_Subtype): Likewise. Handle properly the case of a private type
3960 with unknown discriminants whose full view is an unconstrained array.
3961 Use Predicated_Parent to indicate source of predicate function on an
3962 itype whose parent is itself an itype.
3963 (Complete_Private_Subtype): If the private view has unknown
3964 discriminants and the full view is an unconstrained array, set base
3965 type of completion to the full view of parent.
3966 (Inherit_Predicate_Flags): Prevent double assignment of predicate
3968 (Build_Subtype): For a constrained array component, propagate predicate
3969 information from original component type declaration.
3971 2018-05-23 Boris Yakobowski <yakobowski@adacore.com>
3973 * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
3975 2018-05-23 Arnaud Charlet <charlet@adacore.com>
3977 * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
3979 * sem_elab.adb: Make "out" parameters instead of "in out" when
3982 2018-05-23 Bob Duff <duff@adacore.com>
3984 * gnatbind.adb (List_Applicable_Restrictions): Add
3985 No_Implementation_Restrictions to the list of restrictions not to list.
3986 Remove double negative "not No_Restriction_List". Comment the
3987 commentary that is output, so it won't cause errors if used directly in
3990 2018-05-23 Ed Schonberg <schonberg@adacore.com>
3992 * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
3993 class-wide precondition on a type extension when ancestor does not have
3994 a class-wide precondition. Previously the compiler accepted such a
3995 precondition when the ancestor had a class-wide postcondition.
3997 2018-05-23 Javier Miranda <miranda@adacore.com>
3999 * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
4000 the warning on occurrences of this attribute whose evaluation is always
4001 true (since that subprogram aborts processing the attribute). In
4002 addition, replace the node by its boolean result 'True' (required
4003 because the backend has no knowledge of this attribute).
4005 2018-05-23 Bob Duff <duff@adacore.com>
4007 * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
4008 code in question is not reachable in the case where Count_Type'Last is
4011 2018-05-23 Yannick Moy <moy@adacore.com>
4013 * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
4014 local pragma Warnings Off without On.
4015 * gnat_rm.texi: Regenerate.
4017 2018-05-23 Olivier Hainque <hainque@adacore.com>
4019 * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
4020 * libgnat/g-excact.adb: Implement.
4022 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4024 * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
4025 is present, verify its legality when the domain of iteration is a
4026 GNAT-specific formal container, as is already done for arrays and
4027 predefined containers.
4029 2018-05-23 Yannick Moy <moy@adacore.com>
4031 * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
4032 declaration, which was not taken into account.
4034 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4036 * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
4037 synchronized suspension.
4038 * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
4039 Ada.Synchronous_Task_Control and routines Suspend_Until_True and
4041 * sem_elab.adb: Document switch -gnatd_s.
4042 (In_Task_Body): New routine.
4043 (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
4044 body when the current construct denotes a synchronous suspension call,
4045 and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
4047 (Is_Synchronous_Suspension_Call): New routine.
4048 * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
4051 2018-05-23 Javier Miranda <miranda@adacore.com>
4053 * exp_disp.adb (Make_DT): Restrict the initialization of
4054 External_Tag and Expanded_Name to an empty string to the case where
4055 both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
4056 restricted runtimes are compiled with pragma Discard_Names.
4057 * doc/gnat_rm/implementation_defined_pragmas.rst,
4058 doc/gnat_rm/implementation_defined_characteristics.rst: Add
4060 * gnat_rm.texi: Regenerate.
4062 2018-05-23 Maroua Maalej <maalej@adacore.com>
4064 * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
4066 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4068 * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
4069 iteration of an Ada2012 loop is performed to determine the type of the
4070 domain, but full analysis is performed once the loop is rewritten as a
4071 while-loop during expansion. The pre-analysis suppresses expansion; it
4072 must also suppress the generation of freeze nodes, which may otherwise
4073 appear in the wrong scope before rewritting.
4075 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4077 * sem_elab.adb: Update the section on suppressing elaboration warnings.
4079 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4081 * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
4082 Is_Elaboration_Target.
4083 (Is_Elaboration_Target): New routine.
4084 (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
4085 (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
4086 (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
4087 Is_Elaboration_Target.
4088 * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
4089 with occurrences in nodes.
4090 (Is_Elaboration_Target): New routine.
4091 * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
4092 elaboration target is subject to pragma Warnings (Off, ...).
4094 2018-05-23 Eric Botcazou <ebotcazou@adacore.com>
4096 * repinfo.adb (List_Type_Info): Remove obsolete stuff.
4098 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4100 * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
4101 (Is_Elaboration_Warnings_OK_Id): New routine.
4102 (Set_Is_Elaboration_Warnings_OK_Id): New routine.
4103 (Write_Entity_Flags): Output Flag304.
4104 * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
4105 occurrences in entities.
4106 (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
4107 (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
4109 * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
4110 elaboration warnings.
4111 * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
4112 elaboration warnings.
4113 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
4114 state of elaboration warnings.
4115 (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
4117 (Analyze_Subprogram_Declaration): Capture the state of elaboration
4119 * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
4120 elaboration warnings.
4121 (Analyze_Single_Task_Declaration): Capture the state of elaboration
4123 (Analyze_Task_Type_Declaration): Capture the state of elaboration
4125 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
4126 of elaboration warnings.
4127 (Analyze_Generic_Subprogram_Declaration): Capture the state of
4128 elaboration warnings.
4129 * sem_elab.adb: Add a section on suppressing elaboration warnings.
4130 Type Processing_Attributes includes component Suppress_Warnings
4131 intended to suppress any elaboration warnings along a path in the
4132 graph. Update Initial_State to include a value for this component.
4133 Types Target_Attributes and Task_Attriutes include component
4134 Elab_Warnings_OK to indicate whether the target or task has elaboration
4135 warnings enabled. component Elab_Warnings_OK.
4136 (Build_Access_Marker): Propagate attribute
4137 Is_Elaboration_Warnings_OK_Node from the attribute to the generated
4139 (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
4140 (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
4141 (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
4142 (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
4143 when already in this mode or when the attribute or target have warnings
4145 (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
4146 if warnings are suppressed.
4147 (Process_Conditional_ABE_Call): Suppress further elaboration warnings
4148 when already in this mode, or the target or call have warnings
4150 (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
4151 warnings are suppressed.
4152 (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
4153 warnings are suppressed.
4154 (Process_Conditional_ABE_Instantiation): Suppress further elaboration
4155 warnings when already in this mode or when the instantiation has
4156 warnings suppressed.
4157 (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
4158 diagnostics if warnings are suppressed.
4159 (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
4160 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4161 (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
4162 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4163 (Process_Task_Object): Suppress further elaboration warnings when
4164 already in this mode, or when the object, activation call, or task type
4165 have warnings suppressed. Update the processing state to indicate that
4166 the path goes through a task body.
4167 * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
4169 (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
4170 * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
4171 attribute references.
4173 2018-05-23 Piotr Trojanek <trojanek@adacore.com>
4175 * einfo.ads: Minor reformatting.
4177 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4179 * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
4180 anonymous_access_to_ subprogram formal, apply a conversion to force an
4181 accsssibility check that will fail statically, enforcing 3.10.2 (13).
4183 2018-05-23 Daniel Mercier <mercier@adacore.com>
4185 * gnat1drv.adb: Turn off length expansion in CodePeer mode.
4187 2018-05-23 Bob Duff <duff@adacore.com>
4189 * freeze.adb: (Check_Address_Clause): Deal with build-in-place
4190 aggregates in addition to build-in-place calls.
4192 2018-05-23 Bob Duff <duff@adacore.com>
4194 * einfo.ads: Minor reformatting.
4195 * sem_ch3.adb: Likewise.
4196 * sinfo.ads: Likewise.
4198 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4200 * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
4201 initialization when the component type has predicates.
4202 * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
4203 allocation when the component type has predicates.
4205 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4207 * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
4210 2018-05-22 Justin Squirek <squirek@adacore.com>
4212 * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
4213 original function spec into the generated function spec due to
4214 expansion of expression functions during analysis.
4215 (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
4216 references from the body to the subprogram spec in the case of
4217 expression functions because of inconsistances related to having a
4219 * libgnarl/s-osinte__android.ads: Flag parameters as unused.
4220 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
4221 * libgnarl/s-osinte__qnx.adb: Likewise.
4222 * libgnarl/s-osinte__qnx.ads: Likewise.
4224 2018-05-22 Doug Rupp <rupp@adacore.com>
4226 * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
4229 2018-05-22 Olivier Hainque <hainque@adacore.com>
4231 * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
4232 Expect an Exception_Occurence object, not an Access.
4233 (Complete_And_Propagate_Occurrence): Adjust accordingly.
4234 (Raise_From_Signal_Handler): Likewise.
4235 (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
4236 available in the provided occurrence object, just re-propagate the
4237 latter as a bare "raise;" would do.
4238 * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
4239 * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
4240 to null, to mark that the occurrence we're crafting from the stream
4241 contents is not being propagated (yet).
4243 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4245 * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
4246 code for a transient component in line with the rest of the
4247 initialization code, rather than before the aggregate. This ensures
4248 that the component has proper visibility of the discriminants.
4250 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4252 * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
4255 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4257 * sigtramp-qnx.c: Properly restore link register in signal trampoline.
4259 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4261 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
4262 conversions before extracting the value of the expression.
4263 * exp_ch3.adb (Default_Initialize_Object): Optimize the default
4264 initialization of an array of scalars.
4265 (Get_Simple_Init_Val): Add processing for array types. Remove the
4266 processing of strings because this case is already handled by the array
4268 (Needs_Simple_Initialization): Moved to Sem_Util.
4269 (Simple_Init_Array_Type): New routine.
4270 (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
4271 facilities from Sem_Util.
4272 (Simple_Initialization_OK): New routine.
4273 * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
4274 * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
4275 an array of scalars.
4276 * sem_prag.adb (Analyze_Float_Value): New routine.
4277 (Analyze_Integer_Value): New routine.
4278 (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
4279 to handled the extended form of the pragma.
4280 (Analyze_Type_Value_Pair): New routine.
4281 * sem_util.adb: Add invalid value-related data structures.
4282 (Examine_Array_Bounds): New routine.
4283 (Has_Static_Array_Bounds): Reimplemented.
4284 (Has_Static_Non_Empty_Array_Bounds): New routine.
4285 (Invalid_Scalar_Value): New routine.
4286 (Needs_Simple_Initialization): Moved from Exp_Ch3.
4287 (Set_Invalid_Scalar_Value): New routines.
4288 * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
4289 (Invalid_Scalar_Value): New routine.
4290 (Needs_Simple_Initialization): Moved from Exp_Ch3.
4291 (Set_Invalid_Scalar_Value): New routines.
4292 * snames.ads-tmpl: Add names for the salar type families used by pragma
4295 2018-05-22 Javier Miranda <miranda@adacore.com>
4297 * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
4298 string when pragma No_Tagged_Streams is applicable to the tagged type,
4299 and initialize the Expanded_Name with an empty string when pragma
4300 Discard_Names is applicable to the tagged type.
4302 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4304 * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
4305 formal subprogram is never subtype conformqnt, and thus cannot be the
4306 prefix of 'Access. Reject as well the attribute when applied to a
4307 renaming of a formal subprogram.
4309 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4311 * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
4312 Needs_Simple_Initialization.
4313 (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
4314 (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
4315 profile and comment on usage.
4316 (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
4317 Sloc of a value obtained from aspect Default_Value because this could
4318 potentially replicate large trees. The proper Sloc is now set in
4319 Get_Simple_Init_Val.
4320 (Get_Simple_Init_Val): Reorganized by breaking the various cases into
4321 separate routines. Eliminate the use of global variables.
4322 (Init_Component): Update the call to Get_Simple_Init_Val.
4323 (Needs_Simple_Initialization): Update the parameter profile and all
4325 (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
4326 and set the proper Sloc.
4327 * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
4329 (Needs_Simple_Initialization): Update the parameter profile.
4331 2018-05-22 Patrick Bernardi <bernardi@adacore.com>
4333 * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
4334 user tries to use a subtype indication as a discriminant constraint.
4336 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4338 * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
4339 of N_Reduction_Expression and N_Reduction_Expression_Parameter.
4340 * par-ch4.adb: Remove parsing routines for reduction expressions.
4341 * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
4342 sem_spark.adb, sprint.adb: Remove analysis routines for reduction
4345 2018-05-22 Arnaud Charlet <charlet@adacore.com>
4347 * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
4348 Relaxed_RM_Semantics mode.
4350 2018-05-22 Arnaud Charlet <charlet@adacore.com>
4352 * comperr.adb (Delete_SCIL_Files): Take into account
4353 N_Generic_Package_Renaming_Declaration.
4355 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4357 * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
4358 private, use the full view if available, because it may include renamed
4359 discriminants whose values are stored in the corresponding
4362 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4364 * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
4365 defined on packages that are actuals for formal packages, in order to
4366 set/reset the visibility of the formals of a formal package with given
4367 actuals, when there are subsequent uses of those formals in the
4368 enclosing generic, as required by RN 12.7 (10).
4369 * atree.ads, atree.adb: Add operations for Elist30.
4370 * atree.h: Add Elist30.
4371 * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
4372 that are not defaulted and are thus not visible within the current
4374 (Check_Formal_Packages): Reset visibility of formals of a formal
4375 package that are not defaulted, on exit from current instance.
4377 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4379 * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
4380 non-'Result output appears in the output list of a function.
4382 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4384 * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
4385 (Build_Record_VS_Func): Reimplemented.
4386 (Expand_N_Attribute): Reimplement the handling of attribute
4388 * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
4389 attribute 'Valid_Scalars.
4390 * sem_util.adb (Scalar_Part_Present): Reimplemented.
4391 (Validated_View): New routine.
4392 * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
4394 (Validated_View): New routine.
4395 * doc/gnat_rm/implementation_defined_attributes.rst: Update the
4396 documentation of attribute 'Valid_Scalars.
4397 * gnat_rm.texi: Regenerate.
4399 2018-05-22 Bob Duff <duff@adacore.com>
4401 * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
4402 the spec of a SAL_Interface package.
4404 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4406 * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
4407 entity E within a generic unit, indicate that there are no remaining
4408 delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
4409 entity E is not frozen yet but the aspects should not be reanalyzed at
4410 the freeze point, which may be outside of the generic and may not have
4411 the proper visibility.
4413 2018-05-22 Bob Duff <duff@adacore.com>
4415 * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
4416 the new --split-line-before-record, --indent-named-statements and
4417 --no-align-modes gnatpp switches.
4419 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4421 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
4422 a second argument that is a constant of a given string value.
4424 2018-05-22 Doug Rupp <rupp@adacore.com>
4426 * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
4428 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4430 * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
4432 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4434 * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
4435 delayed aspects, analyze them now, os that the representation of the
4436 type (size, bounds) can be computed and validated.
4438 2018-05-22 Olivier Hainque <hainque@adacore.com>
4440 * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
4441 executable code section boundaries.
4443 2018-05-22 Javier Miranda <miranda@adacore.com>
4445 * locales.c: New implementation for the Ada.Locales package.
4446 * libgnat/a-locale.ads: Remove comment indicating that this is not
4448 * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
4449 that this is not implemented.
4450 * gnat_rm.texi: Regenerate.
4452 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4454 * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
4457 2018-05-22 Justin Squirek <squirek@adacore.com>
4459 * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
4460 (Freeze_Subprogram_Body, Install_Body): Modify calls to
4461 In_Same_Declarative_Part.
4462 * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
4463 verify pragma declaration is within the same declarative list with
4464 corresponding error message.
4465 * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
4466 sem_ch12.adb and generalized to be useful outside the scope of
4469 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4471 * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
4472 categorization of the unit after processing the aspects in case one of
4473 its aspects is converted into a categorization pragma.
4475 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4477 * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
4478 declaration with an explicit address clause and a type with default
4479 initialization, if the declaration carries an aspect
4480 Suppress_Initialization.
4482 2018-05-21 Daniel Mercier <mercier@adacore.com>
4484 * pprint.adb: Use mixed case for attribute names.
4486 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4488 * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
4489 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4490 (Analyze_Subprogram_Body_Helper): Rename the calls to
4491 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4492 * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
4493 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4494 * sem_ch10.adb: Add with and use clause for Sem_Ch13.
4495 (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
4496 prior to analyzing its aspects.
4497 (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
4498 stub prior to analyzing its aspects. Save and restore the configuration
4500 (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
4501 prior to analyzing its aspects.
4502 * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4503 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4504 * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4505 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4506 * sem_prag.adb: Code reformatting.
4507 (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
4509 2018-05-21 Jerome Lambourg <lambourg@adacore.com>
4511 * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
4514 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4516 * exp_cg.adb: Remove with and use clause for Exp_Disp.
4517 * exp_ch9.adb: Remove with and use clause for Exp_Disp.
4518 * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4519 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4520 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4521 * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4522 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4523 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4524 * exp_dist.adb: Remove with and use clause for Exp_Disp.
4525 * freeze.adb: Remove with and use clause for Exp_Disp.
4526 * sem_cat.adb: Remove with and use clause for Exp_Disp.
4527 * sem_ch6.adb: Remove with and use clause for Exp_Disp.
4528 * sem_ch12.adb: Remove with and use clause for Exp_Disp.
4529 * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
4531 * sem_util.adb: Remove with and use clause for Exp_Disp.
4532 (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
4533 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4534 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4535 * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
4537 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4538 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4540 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4542 * sem_res.adb (Valid_Conversion): Improve error message on an illegal
4543 type conversion whose expression has a limited view of a type.
4545 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4547 * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
4548 explicit name for iterator loop, preserve that name in expanded
4549 construct, for possible use in exit statements.
4551 2018-05-21 Javier Miranda <miranda@adacore.com>
4553 * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
4554 spec of a unit has Ada 2012 membership tests with multiple choices and
4555 the unit body is not compiled under Ada 2012 mode.
4557 2018-05-21 Doug Rupp <rupp@adacore.com>
4559 * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
4561 (CFI_COMMON_REGS): Restore LR jic probed from prologue.
4562 (REGNO_PC_OFFSET): Change to correct value for Aarch64.
4564 2018-05-21 Jose Ruiz <ruiz@adacore.com>
4566 * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
4567 libgnarl/s-tassta.adb: Minor typo fixes
4569 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4571 * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
4572 indexed call originally in prefix forn is itself the prefix of a
4575 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4577 * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
4579 (Not_Null_Range): Same as above.
4581 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4583 * exp_ch3.adb: Minor reformatting.
4584 * exp_ch6.adb: Likewise.
4585 * freeze.adb: Likewise.
4586 * inline.adb: Likewise.
4587 * sem_util.adb: Likewise.
4589 2018-05-21 Yannick Moy <moy@adacore.com>
4591 * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
4592 conversion instead of an unchecked type conversion when inlining a
4593 return statement, unless type qualification is required (for character
4594 and string literal) or no check can result from the conversion (for
4596 * opt.ads: Update comment.
4598 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4600 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
4601 model of the compilation unit spec, if any.
4602 * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
4603 model of the compilation unit spec, if any.
4604 * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
4605 parent compilation unit spec, if any.
4606 * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
4607 model of the main unit.
4608 (Is_Same_Unit): The routine now uses Unit_Entity.
4609 (Is_Subunit): Removed.
4610 (Normalize_Unit): Removed.
4611 (Unit_Entity): New routine.
4612 * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
4613 Elaboration_Checks. The analysis now ensures that the pragma appears at
4614 the configuration level, and on the initial declaration of a unit.
4615 Other placements are either flagged as illegal, or ignored.
4616 (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
4617 (Ignore_Elaboration_Checks_Pragma): New routine.
4618 * sem_util.adb (Install_Elaboration_Model): New routine.
4619 * sem_util.ads (Install_Elaboration_Model): New routine.
4620 * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
4621 documentation of pragma Elaboration_Checks.
4622 * gnat_rm.texi: Regenerate.
4624 2018-05-21 Olivier Hainque <hainque@adacore.com>
4626 * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
4627 of empty string when argv[0] couldn't be found on PATH.
4628 (Enable_Cache): Raise Program_Error instead of attempting a null
4629 pointer dereference when the Exec_Module initialization failed.
4631 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4633 * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
4634 * libgnarl/a-taside.ads (Tasking_State): Likewise.
4635 * libgnat/a-calend.ads (Clock_Time): Likewise.
4637 2018-05-21 Yannick Moy <moy@adacore.com>
4639 * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
4640 call notation in inlined call in GNATprove mode.
4642 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4644 * einfo.adb (Is_External_State): An abstract state is also external
4645 when it is declared with option "synchronous".
4646 * einfo.ads: Update the documentation of synthesized attribute
4648 * sem_util.adb (Find_Simple_Properties): New routine.
4649 (Is_Enabled_External_Property): New routine.
4650 (State_Has_Enabled_Property): Reimplemented. The two flavors of option
4651 External have precedence over option Synchronous when determining
4652 whether a property is in effect.
4654 2018-05-21 Yannick Moy <moy@adacore.com>
4656 * sem_eval.adb (Static_Length): Take into account case of variable of
4657 subtype string literal.
4659 2018-05-21 Olivier Hainque <hainque@adacore.com>
4661 * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
4662 (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
4663 * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
4665 (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
4666 * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
4669 2018-05-21 Olivier Hainque <hainque@adacore.com>
4671 * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
4672 Address, and type of Low, High to Storage_Offset.
4673 (Low): Rename as Low_Address and convey that the return value is a
4674 runtime reference accounting for a load address.
4675 * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
4676 address/offset type changes.
4677 (Aranges_Lookup): Likewise.
4678 (Symbolic_Address): Likewise.
4679 (Symbolic_Traceback): Likewise.
4680 (Dump_Cache): Likewise.
4681 (Is_Inside): Likewise.
4683 (Set_Load_Address): Likewise.
4684 (Low_Address): Likewise, and account for C.Load_Address.
4685 * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
4686 (Multi_Module_Symbolic_Traceback): Compare address in traceback
4687 with module Low_Address instead of Low.
4689 2018-05-21 Olivier Hainque <hainque@adacore.com>
4691 * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
4693 * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
4694 (Set_Load_Address): Likewise.
4695 (Symbolic_Traceback): Likewise.
4697 2018-05-21 Olivier Hainque <hainque@adacore.com>
4699 * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
4700 Load_Address argument and pass it down to Init_Module.
4701 * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
4702 lm.l_addr as the Load_Address to Add_Module_To_Cache.
4704 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4706 * einfo.adb (Has_Discriminants): Stronger assertion.
4707 (Set_Has_Discriminants): Stronger assertion.
4708 * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
4709 the stronger assertion on Has_Discriminant.
4710 (Uninstall_Discriminants_And_Pop_Scope): Same as above.
4711 * sem_util.adb (New_Copy_Tree): Same as above.
4712 * sem_ch7.adb (Generate_Parent_References): Prevent calls to
4713 Has_Discriminant on non-type entities that might happen when the
4714 compiled code has errors.
4715 * sem_ch3.adb (Derived_Type_Declaration): Only call
4716 Set_Has_Discriminant on type entities.
4718 2018-05-21 Arnaud Charlet <charlet@adacore.com>
4720 * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
4723 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4725 * lib.ads: Fix typo in enumeration in comment.
4727 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4729 * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
4730 attribute reference is legal within a generic unit when the prefix is a
4731 formal private type.
4733 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4735 * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
4736 delegate the secondary stack management when there is no suitable
4737 transient context, and the transient scope was intended to manage the
4738 secondary stack because this causes premature reclamation. Change the
4739 transient scope creation logic by special casing assignment statements
4740 of controlled components for type initialization procedures.
4741 (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
4742 the comment on usage.
4743 (Find_Transient_Context): Change the initinte loop into a while loop.
4744 Iterations schemes and iterator specifications are not valid transient
4745 contexts because they rely on special processing. Assignment statements
4746 are now treated as a normal transient context, special cases are
4747 handled by the caller. Add special processing for pragma Check.
4748 (Is_OK_Construct): Removed. Its functionality has been merged in
4749 routine Find_Transient_Context.
4750 * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
4751 retrieve the subprogram being invoked. Use a more accurate predicate
4752 (Requires_Transient_Scope) to determine that the function will emply
4753 the secondary stack.
4755 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
4757 * ada_get_targ.adb: Fix subprogram body headers.
4758 * adabkend.adb: Likewise.
4759 * checks.adb: Likewise.
4760 * exp_ch3.adb: Likewise.
4761 * exp_ch5.adb: Likewise.
4762 * exp_ch9.adb: Likewise.
4763 * exp_dist.adb: Likewise.
4764 * exp_tss.adb: Likewise.
4765 * inline.adb: Likewise.
4766 * lib-writ.adb: Likewise.
4767 * lib-xref-spark_specific.adb: Likewise.
4768 * libgnarl/s-osinte__darwin.adb: Likewise.
4769 * libgnarl/s-stusta.adb: Likewise.
4770 * libgnarl/s-taprop__solaris.adb: Likewise.
4771 * libgnarl/s-tposen.adb: Likewise.
4772 * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
4773 * libgnarl/s-vxwext__kernel.adb: Likewise.
4774 * libgnat/a-btgbso.adb: Likewise.
4775 * libgnat/a-cfdlli.adb: Likewise.
4776 * libgnat/a-cfhama.adb: Likewise.
4777 * libgnat/a-cfinve.adb: Likewise.
4778 * libgnat/a-cimutr.adb: Likewise.
4779 * libgnat/a-coboho.adb: Likewise.
4780 * libgnat/a-cofove.adb: Likewise.
4781 * libgnat/a-cofuve.adb: Likewise.
4782 * libgnat/a-comutr.adb: Likewise.
4783 * libgnat/a-exexda.adb: Likewise.
4784 * libgnat/a-tags.adb: Likewise.
4785 * libgnat/a-tideau.adb: Likewise.
4786 * libgnat/a-wtdeau.adb: Likewise.
4787 * libgnat/a-ztdeau.adb: Likewise.
4788 * libgnat/g-alleve.adb: Likewise.
4789 * libgnat/s-excdeb.adb: Likewise.
4790 * libgnat/s-parint.adb: Likewise.
4791 * libgnat/s-shasto.adb: Likewise.
4792 * libgnat/s-traceb__hpux.adb: Likewise.
4793 * prepcomp.adb: Likewise.
4794 * sem_ch4.adb: Likewise.
4795 * sem_ch6.adb: Likewise.
4796 * sem_dist.adb: Likewise.
4797 * sem_prag.adb: Likewise.
4798 * sem_util.adb: Likewise.
4799 * sinfo.adb: Likewise.
4800 * switch.adb: Likewise.
4802 2018-05-04 John Marino <gnugcc@marino.st>
4805 * link.c (BSD platforms): Add missing backslash.
4807 2018-04-27 Eric Botcazou <ebotcazou@adacore.com>
4810 * init.c (__gnat_handle_vms_condition): Add missing parentheses.
4812 2018-04-25 Eric Botcazou <ebotcazou@adacore.com>
4815 * gnat_ugn.texi: Regenerate.
4817 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
4820 * gnatlink.adb (Gnatlink): Remove handling of -b switch.
4821 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
4822 Remove documentation of -b switch.
4824 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
4827 * gnatlink.adb (Process_Args): Drop existing link switches if multiple
4828 switches are passed for --LINK.
4830 2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
4833 * gcc-interface/misc.c (gnat_post_options): Disable string overflow
4836 2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
4838 * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
4839 Consider only entities for objects.
4841 2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
4843 * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
4845 (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
4847 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
4849 * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
4850 guarding the overflow check emitted for the upper bound of a floating-
4853 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
4855 * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
4857 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
4859 * libgnat/i-cexten.ads (Float_128): New type.
4861 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
4863 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
4864 false if the component type is a pointer.
4866 2018-01-11 Gary Dismukes <dismukes@adacore.com>
4868 * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
4869 result of Get_Simple_Init_Value and pass the source location of the
4870 object declaration's object_definition.
4872 2018-01-11 Ed Schonberg <schonberg@adacore.com>
4874 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
4875 properly object declarations with initializations that are
4876 build-in-place function calls, when there is an address specification,
4877 either as an aspect specification or an explicit attribute
4878 specification clause, for the initialized object.
4879 * freeze.adb (Check_Address_Clause): Do not remove side-effects from
4880 initial expressions in the case of a build-in-place call.
4882 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
4884 * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
4885 private (sub)type; refactor to avoid early return statement.
4886 (Not_Null_Range): Same as above.
4888 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4890 * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
4891 concurrent, nor effectively volatile.
4892 * ghost.adb (Check_Ghost_Type): New routine.
4893 * ghost.ads (Check_Ghost_Type): New routine.
4894 * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
4895 consider specific subsets of declarations.
4896 (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
4897 replicated by Is_Declaration.
4898 * sem_util.ads (Is_Declaration): New parameter profile. Update the
4900 (Is_Declaration_Other_Than_Renaming): Removed.
4902 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4904 * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
4905 as Part_Of consituents of single protected types are illegal when they
4906 take place inside a protected function.
4907 (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
4909 (Is_Protected_Part_Of_Constituent): New routine.
4910 (Within_Function): New routine.
4912 2018-01-11 Arnaud Charlet <charlet@adacore.com>
4914 Bump copyright notices to 2018.
4916 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4918 * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
4921 2018-01-11 Justin Squirek <squirek@adacore.com>
4923 * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
4924 to make sure a given expression function is properly parenthesized.
4926 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4928 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
4929 categorization of a subprogram body which does not complete a previous
4932 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4934 * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
4935 scope of package Ada is Standard.
4937 2018-01-11 Ed Schonberg <schonberg@adacore.com>
4939 * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
4940 subcomponent of the current entity when building the body for a dynamic
4941 predicate function for a record with composite subcomponents.
4943 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
4945 * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
4946 Establish_Transient_Scope.
4947 (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
4948 (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
4949 * exp_ch6.adb (Expand_Call_Helper): Update the call to
4950 Establish_Transient_Scope.
4951 (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
4952 Establish_Transient_Scope.
4953 * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
4954 management of the secondary stack to an enclosing scope if there is no
4955 suitable construct to wrap, and the transient scope was intended to
4956 manage the secondary stack.
4957 (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
4958 is a valid boundary for a transient expression which comes from the
4959 statements of the alternative, otherwise alternatives cannot be
4960 wrapped. Assignments of controlled objects which have controlled
4961 actions suppressed now stop the traversal as there is no point in
4962 looking for an enclosing construct. Add several N_xxx_Body choices to
4963 the termination conditions for completeness.
4964 * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
4965 and the associated comment on usage.
4966 * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
4967 Establish_Transient_Scope.
4968 (Add_Write_After): Update the call to Establish_Transient_Scope.
4969 * sem_res.adb (Check_Initialization_Call): Removed.
4970 (Resolve_Actuals): Account for additional cases where finalization
4971 actions are required by utilizing predicate Needs_Finalization rather
4973 (Resolve_Call): Type initialization procedures can now utilize
4974 transient scopes to manage the secondary stack, thus preventing leaks
4975 during initialization. Remove the previous kludgy algorithm which
4976 attempts to manage the secondary stack at the object creation site.
4978 2018-01-11 Jerome Lambourg <lambourg@adacore.com>
4980 * libgnat/g-soliop__qnx.ads: New.
4981 * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
4984 2018-01-11 Bob Duff <duff@adacore.com>
4986 * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
4987 a null procedure occurs in a protected definition.
4989 2018-01-11 Bob Duff <duff@adacore.com>
4991 * binderr.ads, namet.ads: Minor reformatting.
4993 2018-01-11 Bob Duff <duff@adacore.com>
4995 * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
4998 2018-01-11 Bob Duff <duff@adacore.com>
5000 * binde.adb (Force_Elab_Order): Give an error if there are duplicate
5003 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5005 * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
5006 controlling argument of a dispatching call. freeze the corresponding
5009 2018-01-11 Ben Brosgol <brosgol@adacore.com>
5011 * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
5013 2018-01-11 Ben Brosgol <brosgol@adacore.com>
5015 * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
5017 * gnat_rm.texi: Regenerate.
5019 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5021 * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
5022 formsl type corresponding to the actual fixed point type is private,
5023 because in this case there can be no suspicious arithmetic operations
5024 in the generic unless they reference a formal subprogram. Clarify
5027 2018-01-11 Javier Miranda <miranda@adacore.com>
5029 * exp_util.adb (Remove_Side_Effects): No action done for functions
5030 returning class-wide types since it requires generating code using
5031 'reference and the CCG target has no secondary stack.
5032 * gnat1drv.adb: Disable building static dispatch tables when generating
5035 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5037 * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
5038 libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
5039 (File_Type): Add Default_Initial_Condition aspect.
5041 2018-01-11 Pascal Obry <obry@adacore.com>
5043 * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
5045 2018-01-11 Bob Duff <duff@adacore.com>
5047 * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
5048 to match what the Libadalang-based version does.
5049 * doc/gnat_ugn/about_this_guide.rst: Update reference.
5051 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5053 * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
5054 if it contains at least one component declaration employing a function
5055 call returning on the secondary stack.
5057 2018-01-11 Yannick Moy <moy@adacore.com>
5059 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
5060 Update description of restriction SPARK_05 with SPARK 2014.
5061 * gnat_rm.texi: Regenerate.
5063 2018-01-11 Vasiliy Fofanov <fofanov@adacore.com>
5065 * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
5067 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5069 * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
5070 sem_res.adb, sem_util.adb: Minor reformatting.
5072 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5074 * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
5075 has a delayed aspect which must be processed at the point the type is
5076 frozen. This mimics what is done when the predicate is provided by a
5079 2018-01-11 Doug Rupp <rupp@adacore.com>
5081 * init.c (vxworks): Add macro checks for __aarch64__.
5083 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5085 * exp_util.adb (Add_Failure_Expression): New routine.
5086 (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
5087 * sem_util.adb (Is_Current_Instance): Code cleanup.
5089 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
5091 * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
5092 Default_Sec_Stack_Size.
5093 * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
5094 limit check so that the integer index does not overflow. Check the
5095 dynamic stack allocation does not cause the secondary stack pointer to
5097 (SS_Info): Align colons.
5098 (SS_Init): Cover the case when bootstraping with an old compiler that
5099 does not set Default_SS_Size.
5101 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5103 * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
5104 legality of an inherited operation that may require overriding, ignore
5105 primitive_wrappers that correspond to explicit operations that override
5106 an interface primitive.
5107 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
5108 operation to which the class-wide expression applies is a protected op.
5109 with a primitive_wrapper, verify that the updated inherited expression
5110 does not contain an internal call to a protected function. This
5111 completes the implementation of AI12-0166.
5113 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5115 * ali.adb: Document the remaining letters available for ALI lines.
5116 (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
5117 * ali.ads: Update type With_Record. Field
5118 Implicit_With_From_Instantiation is no longer in use. Add field
5120 * csinfo.adb (CSinfo): Remove the setup for attribute
5121 Implicit_With_From_Instantiation.
5122 * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
5123 either implicitly or explicitly withed.
5124 (Is_Implicit_With_Clause): New routine.
5125 (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
5126 confusion with the with clause attribute by the same name.
5127 (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
5128 * rtsfind.adb (Maybe_Add_With): Code cleanup.
5129 * sem_ch8.adb (Present_System_Aux): Code cleanup.
5130 * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
5132 (Implicit_With_On_Parent): Mark the with clause as generated for a
5134 * sem_ch12.adb (Inherit_Context): With clauses inherited by an
5135 instantiation are no longer marked as Implicit_With_From_Instantiation
5136 because they are already marked as implicit.
5137 * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
5138 which marks implicit with clauses as related to an instantiation.
5139 * sinfo.adb (Implicit_With_From_Instantiation): Removed.
5140 (Parent_With): New routine.
5141 (Set_Implicit_With_From_Instantiation): Removed.
5142 (Set_Parent_With): New routine.
5143 * sinfo.ads: Update the documentation of attribute Implicit_With.
5144 Remove attribute Implicit_With_From_Instantiation along with
5145 occurrences in nodes. Add attribute Parent_With along with occurrences
5147 (Implicit_With_From_Instantiation): Removed along with pragma Inline.
5148 (Parent_With): New routine along with pragma Inline.
5149 (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
5150 (Set_Parent_With): New routine along with pragma Inline.
5152 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5154 * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
5155 entity when the enclosing construct is a body.
5157 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
5159 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
5160 Secondary_Stack_Size handling as a pragma is now generated for the
5161 corresponding aspect instead of an attribute. Pragma expression is
5162 relocated instead of evaluated. Discriminant of the corresponding
5163 record type is referenced rather than the type discriminant.
5164 (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
5165 Secondary_Stack_Size rep item checks to only look for the pragma rep.
5166 * sem_ch13.adb (Analyze_One_Aspect): Transform
5167 Aspect_Secondary_Stack_Size into a pragma instead of an attribute
5168 because the attribute does not have visibility on a task type's
5169 discriminants when the type's definition is expanded.
5170 (Analyze_Attribute_Definition_Clause): Remove handling of
5171 Attribute_Secondary_Stack_Size.
5172 * snames.adb-tmpl, snames.ads-tmpl: Remove
5173 Attribute_Secondary_Stack_Size, no longer used.
5175 2018-01-11 Justin Squirek <squirek@adacore.com>
5177 * sem_ch8.adb: Minor comment fix.
5179 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5181 * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
5182 individual action because the action may denote a complex expression,
5183 such as a case statement, which in turn may contain additional
5186 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5188 * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
5189 analysis on a copy of the expression with a copy of the index variable,
5190 because full expansion will rewrite construct into a loop with the
5191 original loop variable.
5192 * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
5193 expression is an iterated component association. Full analysis takes
5194 place when construct is rewritten as a loop.
5195 (In_Place_Assign_OK, Safe_Component): An iterated_component_association
5196 is not safe for in-place assignment.
5197 * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
5198 entity with no homonym and no other entity in the scope.
5200 2018-01-11 Justin Squirek <squirek@adacore.com>
5202 * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
5203 message to be printed on the pragma argument identifier.
5205 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5207 * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
5208 entity of the generated invariant procedure in order to construct a
5209 proper entity chain.
5211 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5213 * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
5216 2018-01-11 Arnaud Charlet <charlet@adacore.com>
5218 * einfo.ads, einfo.adb (Activation_Record_Component,
5219 Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
5220 Allow E_Discriminant.
5222 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
5224 * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
5225 for atomic access once the component size is taken into account and
5226 also do it if the component type is Atomic or Volatile_Full_Access.
5228 2018-01-04 Eric Botcazou <ebotcazou@adacore.com>
5230 * gnatvsn.ads: Bump copyright year.
5232 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5233 Alan Hayward <alan.hayward@arm.com>
5234 David Sherwood <david.sherwood@arm.com>
5236 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
5239 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5240 Alan Hayward <alan.hayward@arm.com>
5241 David Sherwood <david.sherwood@arm.com>
5243 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
5246 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5247 Alan Hayward <alan.hayward@arm.com>
5248 David Sherwood <david.sherwood@arm.com>
5250 * gcc-interface/utils.c (gnat_types_compatible_p): Handle
5251 polynomial TYPE_VECTOR_SUBPARTS.
5253 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5254 Alan Hayward <alan.hayward@arm.com>
5255 David Sherwood <david.sherwood@arm.com>
5257 * gcc-interface/misc.c (enumerate_modes): Handle polynomial
5260 2018-01-03 Jakub Jelinek <jakub@redhat.com>
5262 Update copyright years.
5264 * gnat_ugn.texi: Bump @copying's copyright year.
5265 * gnat_rm.texi: Likewise.
5267 Copyright (C) 2018 Free Software Foundation, Inc.
5269 Copying and distribution of this file, with or without modification,
5270 are permitted in any medium without royalty provided the copyright
5271 notice and this notice are preserved.