[Ada] Enhance comment
[official-gcc.git] / gcc / ada / ChangeLog
blob4a4fee49ad19b57ec0fb2e5781ea93578226075c
1 2018-12-03  Ed Schonberg  <schonberg@adacore.com>
3         * sem_ch3.adb (Complete_Private_Subtype): Enhance comment.
5 2018-12-03  Olivier Hainque  <hainque@adacore.com>
7         * gcc-interface/lang.opt (fopenacc): New option for Ada.
8         * gcc-interface/misc.c (gnat_handle_option): Handle it.
9         * gcc-interface/trans.c (struct loop_info_d): Add OMP
10         attributes.
11         (Iterate_Acc_Clause_Arg, Acc_gnat_to_gnu): New functions,
12         helpers for OpenACC pragmas processing in Pragma_to_gnu.
13         (Acc_Var_to_gnu, Acc_Reduc_Var_to_gnu, Acc_Reduc_to_gnu):
14         Likewise.
15         (Acc_Size_Expr_to_gnu, Acc_Size_List_to_gnu): Likewise.
16         (Pragma_Acc_Data_to_gnu): Likewise.
17         (Pragma_to_gnu): Handle Pragma_Acc_Loop, Pragma_Acc_Data,
18         Pragma_Acc_Kernels and Pragma_Acc_Parallel.
19         (Acc_Loop_to_gnu, Regular_Loop_to_gnu): New functions. Helpers
20         for ...
21         (Loop_Statement_to_gnu): Rework to handle OpenACC loops.
23 2018-12-03  Olivier Hainque  <hainque@adacore.com>
25         * gcc-interface/targtyps.c (MALLOC_OBSERVABLE_ALIGNMENT): Set to
26         2 * POINTER_SIZE.
28 2018-12-03  Ed Schonberg  <schonberg@adacore.com>
30         * sem_res.adb (Set_Slice_Subtype): The index type of a slice is
31         constrained.
33 2018-11-26  Matthias Klose <doko@ubuntu.com>
35         PR ada/88191
36         * libgnarl/s-linux__alpha.ads: Define SIGSYS.
38 2018-11-19  Alexandre Oliva <oliva@adacore.com>
40         PR ada/81878
41         * gcc-interface/config-lang.in (lang_requires): Set to "c c++"
42         when gnattools wants it.
44 2018-11-19  Eric Botcazou  <ebotcazou@adacore.com>
46         * gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
48 2018-11-15  Eric Botcazou  <ebotcazou@adacore.com>
50         * gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
51         -fnon-call-exceptions passed on the command line in -gnatp mode.
53 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
55         * exp_util.ads, exp_util.adb: Change the profile of
56         Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
57         of the right opersnd. This prevents unnesting anomalies when
58         that operand contains uplevel references.
59         * exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
60         * exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.
62 2018-11-14  Patrick Bernardi  <bernardi@adacore.com>
64         * libgnarl/a-intnam__linux.ads: Add SIGSYS.
65         * libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
66         libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
67         libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
68         libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
69         SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
70         implementation specific.
71         * libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
72         SIGSYS.  Move SIG32, SIG33 and SIG34 from the unmasked list to
73         the reserved list.
75 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
77         * exp_aggr.adb (Is_Static_Element): New predicate extracted
78         from...
79         (Check_Static_Components): ...here.  Call Is_Static_Element on
80         each element of the component association list, if any.
81         (Flatten): Duplicate the expression of an others choice only if
82         it is static or is an aggregate which can itself be flattened.
84 2018-11-14  Olivier Hainque  <hainque@adacore.com>
86         * sigtramp-vxworks-target.inc: Fix stack checking test errors in
87         ACATS, now that GCC can emit CFI rules referring to sp in
88         absence of a frame pointer.
90 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
92         * exp_aggr.adb (Check_Static_Components): Remove dead test.
93         (Flatten): Likewise.  Move comment around.
95 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
97         * sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
98         SPARK-related global state at the start of the routine. Set the
99         Ghost mode of the completed spec if any.  Restore the saved
100         Ghost and SPARK-related global state on exit from the routine.
102 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
104         * doc/gnat_ugn/building_executable_programs_with_gnat.rst
105         (-gnatR): Document new -gnatR4 level.
106         * gnat_ugn.texi: Regenerate.
107         * opt.ads (List_Representation_Info): Bump upper bound to 4.
108         * repinfo.adb: Add with clause for GNAT.HTable.
109         (Relevant_Entities_Size): New constant.
110         (Entity_Header_Num): New type.
111         (Entity_Hash): New function.
112         (Relevant_Entities): New set implemented with GNAT.HTable.
113         (List_Entities): Also list compiled-generated entities present
114         in the Relevant_Entities set. Consider that the Component_Type
115         of an array type is relevant.
116         (List_Rep_Info): Reset Relevant_Entities for each unit.
117         * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4.
118         * switch-m.adb (Normalize_Compiler_Switches): Likewise
119         * usage.adb (Usage): Likewise.
121 2018-11-14  Javier Miranda  <miranda@adacore.com>
123         * exp_disp.adb (Expand_Interface_Thunk): Extend handling of
124         renamings of the predefined equality primitive.
125         (Make_Secondary_DT): When calling Expand_Interface_Thunk() pass
126         it the primitive, instead of its Ultimate_Alias; required to
127         allow the called routine to identify renamings of the predefined
128         equality operation.
130 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
132         * freeze.adb (Check_Pragma_Thread_Local_Storage): New routine. A
133         variable with suppressed initialization has no initialization
134         for purposes of the pragma.
135         (Freeze_Object_Declaration): Remove variable
136         Has_Default_Initialization as it is no longer used. Use routine
137         Check_Pragma_Thread_Local_Storage to verify the semantics of
138         pragma Thread_Local_Storage.
140 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
142         * sem_res.adb (Resolve_If_Expression): Verify that the subtypes
143         of all dependent expressions obey the constraints of the
144         expected type for the if-expression.
145         (Analyze_Expression): Only add qualificiation to the dependent
146         expressions when the context type is constrained. Small
147         adjustment to previous patch.
149 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
151         * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't
152         register a compile-time warning or error for 'Alignment or 'Size
153         of an entity declared in a generic unit.
155 2018-11-14  Justin Squirek  <squirek@adacore.com>
157         * sem_ch8.adb (Use_One_Package): Add test for out-of-scope
158         homonyms.
160 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
162         * exp_ch3.adb: (Expand_N_Object_Declaration): If the expression
163         is a limited aggregate its resolution is delayed until the
164         object declaration is expanded.
165         * sem_ch3.adb: (Analyze_Object_Declaration): If the expression
166         is a limited aggregate and the declaration has a following
167         address clause indicate that resolution of the aggregate (which
168         must be built in place) must be delayed.
170 2018-11-14  Bob Duff  <duff@adacore.com>
172         * sem_attr.adb (To_Address): Simplify setting of
173         Is_Static_Expression. Remove second (unconditional) call to
174         Set_Is_Static_Expression -- surely it's not static if the
175         operand is not.  Initialize Static on declaration.  Do not try
176         to fold 'To_Address, even though it's static.
177         * exp_attr.adb (To_Address): Preserve Is_Static_Expression.
178         * sinfo.ads, sem_eval.ads, sem_eval.adb (Is_Static_Expression,
179         Is_OK_Static_Expression, Raises_Constraint_Error): Simplify
180         documentation.  There was too much repetition and redundancy.
182 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
184         * sem_ch3.adb (Analyze_Object_Declaration): Use the
185         Actual_Subtype to preserve information about a constant
186         initialized with a non-static entity that is known to be valid,
187         when the type of the entity has a narrower range than that of
188         the nominal subtype of the constant.
189         * checks.adb (Determine_Range): If the expression is a constant
190         entity that is known-valid and has a defined Actual_Subtype, use
191         it to determine the actual bounds of the value, to enable
192         additional optimizations.
194 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
196         * back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
197         exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
198         freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
199         sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.
201 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
203         * exp_ch4.adb (Find_Aliased_Equality): New routine.
204         (Find_Equality): Reimplemented.
205         (Is_Equality): New routine.
207 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
209         * ghost.adb (Ghost_Entity): New routine.
210         (Mark_And_Set_Ghost_Assignment): Reimplemented.
211         * sem_ch5.adb (Analyze_Assignment): Assess whether the target of
212         the assignment is an ignored Ghost entity before analyzing the
213         left hand side.
214         * sem_ch8.adb (Find_Direct_Name): Update the subprogram
215         signature. Do not generate markers and references when they are
216         not desired.
217         (Nvis_Messages): Do not execute when errors are not desired.
218         (Undefined): Do not emit errors when they are not desired.
219         * sem_ch8.ads (Find_Direct_Name): Update the subprogram
220         signature and comment on usage.
221         * sem_util.adb (Ultimate_Prefix): New routine.
222         * sem_util.ads (Ultimate_Prefix): New routine.
224 2018-11-14  Justin Squirek  <squirek@adacore.com>
226         * sem_ch7.adb (Uninstall_Declarations): Add conditional to avoid
227         uninstalling potential visibility during freezing on enumeration
228         literals.
230 2018-11-14  Jerome Lambourg  <lambourg@adacore.com>
232         * env.c: Do not include crt_externs.h on iOS, as it does not
233         exist there. This is also true for the iPhone Simulator SDK.
235 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
237         * exp_ch7.adb (Check_Unnesting_In_Declarations): New procedure
238         to transform blocks that appear in the declarative part of a
239         package body into subprograms if they contain generated
240         subprograms (such as finalization routines). Needed to generate
241         the proper upward references in unnesting mode.
243 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
245         * freeze.adb (Freeze_Fixed_Point_Type): If the given low bound
246         of the type is less than the nearest model number, do not expand
247         the range of the type to include the model number below the
248         bound. Similar adjustment if the upper bound is larger than the
249         nearest model number.
251 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
253         * checks.adb (Install_Primitive_Elaboration_Check): Do not
254         create the check when exceptions cannot be used.
255         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not raise
256         Program_Errror when exceptions cannot be used. Analyze the
257         generated code with all checks suppressed.
258         * exp_ch7.adb (Build_Finalizer): Remove the declaration of
259         Exceptions_OK.
260         (Make_Deep_Array_Body): Remove the declaration of Exceptions_OK.
261         (Make_Deep_Record_Body): Remove the declaration of
262         Exceptions_OK.
263         (Process_Transients_In_Scope): Remove the declaration of
264         Exceptions_OK.
265         * exp_util.adb (Exceptions_In_Finalization_OK): Renamed to
266         Exceptions_OK.
267         * exp_util.ads (Exceptions_In_Finalization_OK): Renamed to
268         Exceptions_OK.
270 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
272         * exp_ch4.adb (Expand_N_Op_Eq): Remove duplicated code and use
273         routine Find_Equality instead.
274         (Find_Equality): New routine.
276 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
278         * sem_util.adb (First_From_Global_List): Do not expect
279         N_Selected_Component in the Global contract; simplify assertion
280         with Nam_In.
282 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
284         * sem_ch12.adb (Instantiate_Object): Set
285         Corresponding_Generic_Association on generic actuals with
286         default expression.
287         * sinfo.ads (Corresponding_Generic_Association): Update comment.
289 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
291         * exp_ch4.adb (Expand_Concatenate): Use the proper routine to
292         set the need for debug info.
293         * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Use the
294         proper routine to set the need for debug info.
295         * exp_prag.adb (Expand_Pragma_Initial_Condition): Use the proper
296         routine to set the need for debug info.
297         * exp_util.adb (Build_DIC_Procedure_Declaration): Use the proper
298         routine to set the need for debug info.
299         (Build_Invariant_Procedure_Declaration): Use the proper routine
300         to set the need for debug info.
301         * ghost.adb (Record_Ignored_Ghost_Node): Add statements as a
302         whole class to the list of top level ignored Ghost nodes.
303         * sem_util.adb (Set_Debug_Info_Needed): Do not generate debug
304         info for an ignored Ghost entity.
306 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
308         * bindgen.adb, exp_cg.adb, repinfo.adb, sprint.adb: Minor reuse
309         Cancel_Special_Output where possible.
311 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
313         * exp_dbug.ads, sem_util.ads: Minor fixes in comments.
315 2018-11-14  Arnaud Charlet  <charlet@adacore.com>
317         * adabkend.adb (Scan_Back_End_Switches): Handle -gx switches
318         explicitly.
320 2018-11-13  Eric Botcazou  <ebotcazou@adacore.com>
322         * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
323         for the runtime on platforms where System.Machine_Overflow is true.
325 2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>
327         * fe.h (Suppress_Checks): Declare.
328         * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
329         only if checks are not suppressed and -faggressive-loop-optimizations
330         only if they are.
331         * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
332         warned_aggressive_loop_optimizations fields.
333         (gigi): Do not clear warn_aggressive_loop_optimizations here.
334         (Raise_Error_to_gnu): Do not set has_checks.
335         (gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
336         loop optimizations.
338 2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>
340         * gcc-interface/decl.c (components_to_record): Remove obsolete kludge.
341         * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the
342         new type but do not take into account the setting on the old type for
343         the new fields.  Rename a local variable.
344         (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at
345         offset 0, if any.
346         (create_field_decl): Tweak comment.
348 2018-10-22  Eric Botcazou  <ebotcazou@adacore.com>
350         * gcc-interface/utils.c (unchecked_convert): Use local variables for
351         the biased and reverse SSO attributes of both types.
352         Further extend the processing of integral types in the presence of
353         reverse SSO to all scalar types.
355 2018-10-22  Eric Botcazou  <ebotcazou@adacore.com>
357         * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
358         a simple memory constraint in all cases.
360         * gcc-interface/lang-specs.h: Bump copyright year.
362 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
364         * gcc-interface/Make-lang.in (selftest-ada): New.
366 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
368         * exp_ch3.adb (Is_Null_Statement_List): New predicate.
369         (Build_Array_Init_Proc): Use it to find out whether the
370         initialization procedure Is_Null_Init_Proc; if so, set
371         Warnings_Off on the parameter.
372         (Build_Init_Procedure): Likewise.
373         (Init_Formals): Use an in/out first parameter only for
374         unconstrained arrays and for records either containing or built
375         for proteced types or task types; use an out parameter in all
376         the other cases.
377         * fe.h (Is_Init_Proc): Declare.
378         * gcc-interface/decl.c (type_requires_init_of_formal): Do not
379         return true for a discriminant in an unchecked union.
380         (gnat_to_gnu_param): Do not create a PARM_DECL for the Out
381         parameter of an initialization procedure.
383 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
385         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If
386         this is not a definition, retrieve the expression in all cases
387         even if we are just annotating types.
388         * gcc-interface/trans.c (gnat_to_gnu): Also translate Size
389         attribute for constrained types in this mode.
391 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
393         * adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
394         (__gnat_locate_exec): Check that HOST_EXECUTABLE_SUFFIX is not
395         empty before doing a string search for it.
396         * socket.c (ATTRIBUTE_UNUSED): Define.
397         (__gnat_disable_sigpipe): Add ATTRIBUTE_UNUSED on parameter.
398         * terminals.c (ATTRIBUTE_UNUSED): Move around.
399         (__gnat_setup_child_communication): Add ATTRIBUTE_UNUSED on
400         parameter.
401         (__gnat_send_header): Add ATTRIBUTE_UNUSED on parameters.
403 2018-10-09  Yannick Moy  <moy@adacore.com>
405         * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
406         pragmas as null statements in GNATprove mode.
408 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
410         * exp_ch6.adb (Add_Call_By_Copy_Code): Initialize the temporary
411         made for an Out parameter if the formal type has discriminants.
413 2018-10-09  Maroua Maalej  <maalej@adacore.com>
415         * sem_spark.adb (Check_Declaration): fix bug related to non
416         access object permissions.
418 2018-10-09  Doug Rupp  <rupp@adacore.com>
420         * libgnat/a-ncelfu.ads: Fix name in header to match package.
422 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
424         * exp_disp.adb (Make_Disp_Asynchronous_Select_Spec): Set
425         Warnings_Off on the B out parameter.
427 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
429         * einfo.ads: Small comment fix.
431 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
433         * sem_ch7.adb (Has_Referencer): Add comment for the
434         N_Freeze_Entity case.  Do not rely on
435         Has_Referencer_Of_Non_Subprograms to clear the Is_Public flag on
436         subprogram entities.
438 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
440         * exp_unst.adb (In_Synchronized_Call): Handle properly private
441         types whose full views are synchronized types, in order to
442         recognize generated subprograms whose bodies must be considered
443         reachable even if no direct calls to them are visible in the
444         source.
446 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
448         * exp_ch4.adb (Expand_Modular_Op): When expanding an operation
449         on nonbinary modular types, convert the opersnds to an integer
450         type that is large enough to hold the modulus of the type, which
451         may be larger than Integer'Last.
453 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
455         * exp_unst.adb (Unnest_Subprogram):  When an uplevel reference
456         is to an unconstrained formal, the 'Access reference that is
457         created to initialize the corresponding component of the
458         activation record must be wrapped in an unchecked conversion to
459         the generated type of the component. Otherwise, spurious suvtype
460         conformance errors will be generated when the code is within an
461         instantiation and the type of the formal is a formal type of the
462         enclosing generic. Note that during unnesting there is no simple
463         way to determine that the code appears within an instance
464         because ther is no scope stack.
466 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
468         * gcc-interface/decl.c (type_requires_init_of_formal): New
469         predicate.
470         (gnat_to_gnu_param): Use it to determine whether a PARM_DECL
471         must be created for an Out parameter passed by copy.
473 2018-10-09  Arnaud Charlet  <charlet@adacore.com>
475         * libgnat/a-coboho.ads (Storage_Element): Fix a typo.
477 2018-10-09  Claire Dross  <dross@adacore.com>
479         * libgnat/a-cfinve.ads: Remove default value for
480         Max_Size_In_Storage_Elements as it was not supported in SPARK.
482 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
484         * exp_ch6.adb (Add_Call_By_Copy_Node,
485         Add_Simple_Call_By_Copy_Node, Expand_Call_Helper): Reset
486         Is_True_Constant on entities used as Out or In_Out parameters in
487         calls.
489 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
491         * exp_unst.adb (Unnest_Subprogram): Do not load System to obtain
492         the Address entity unless an activation record is being built.
493         Removes useless with_clauses for System when nested subprograms
494         do not have uplevel references, and therefore do not need
495         activation records.
497 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
499         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
500         the conformance check on an aspect expression that includes a
501         call to an instance of Unchecked_Conversion, or more generally a
502         call to an intrinsic operation.
504 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
506         * repinfo.adb: Remove with/use clause for Stand.
507         (List_Mechanisms): List the mechanism of functions only.
509 2018-10-09  Bob Duff  <duff@adacore.com>
511         * doc/gnat_ugn/gnat_utility_programs.rst: Correct spelling of
512         --eol switch.  Document the language-version switches.  Update
513         description for --no-exception.
515 2018-10-09  Vasiliy Fofanov  <fofanov@adacore.com>
517         * libgnat/s-os_lib.ads (Normalize_Pathname): Fix incorrect
518         comment.
520 2018-10-09  Arnaud Charlet  <charlet@adacore.com>
522         * vxlink.adb: Remove pragma Annotate, no longer needed.
524 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
526         * checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
527         rather than SPARK_mode in order to preserve the Do_Range_Check
528         flag for verification purposes.
530 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
532         * exp_aggr.adb (Expand_Array_Aggregate): If it is not possible
533         to build in place an aggregate with component associations, set
534         the Warnings_Off flag on the generated temporary, to prevent
535         spurious warnings from the backend when compiling with the
536         -Wuninitialized gcc flag.
538 2018-09-30  Alexandre Oliva <oliva@adacore.com>
540         * gcc-interface/lang-specs.h (default_compilers): When given
541         fcompare-debug-second, adjust auxbase like cc1, and pass
542         gnatd_A.
543         * gcc-interface/misc.c (flag_compare_debug): Remove variable.
544         (gnat_post_options): Do not set it.
545         * lib-writ.adb (flag_compare_debug): Remove import.
546         (Write_ALI): Do not test it.
548 2018-09-28  Eric Botcazou  <ebotcazou@adacore.com>
549             Pierre-Marie de Rodat  <derodat@adacore.com>
551         * gcc-interface/decl.c (is_cplusplus_method): Do not require C++
552         convention on Interfaces.
553         * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a
554         bona-fide thunk and hand it over to the middle-end.
555         (get_controlling_type): New function.
556         (use_alias_for_thunk_p): Likewise.
557         (thunk_labelno): New static variable.
558         (make_covariant_thunk): New function.
559         (maybe_make_gnu_thunk): Likewise.
560         * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the
561         result DECL here instead of...
562         (end_subprog_body): ...here.
564 2018-09-27  Martin Sebor  <msebor@redhat.com>
566         * gcc-interface/utils.c (make_packable_type): Introduce a temporary
567         to avoid -Wnonnull.
568         (unchecked_convert): Same.
570 2018-09-26  Elisa Barboni  <barboni@adacore.com>
572         * sem_prag.adb (Check_Refined_Global_Item): Improve error
573         message.
575 2018-09-26  Thomas Quinot  <quinot@adacore.com>
577         * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a
578         representation item that is an N_Aspect_Definition, retrieve the
579         entity it applies to using the Entity attribute.
581 2018-09-26  Justin Squirek  <squirek@adacore.com>
583         * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition
584         to check for unmarked subprogram references coming from
585         renamings.
587 2018-09-26  Arnaud Charlet  <charlet@adacore.com>
589         * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches.
591 2018-09-26  Yannick Moy  <moy@adacore.com>
593         * errout.ads: Update comment for insertion character '?'.
594         * inline.adb: Use simple insertion character '?' for GNATprove
595         info messages.
596         * sem_res.adb (Resolve_Call): Issue an info message on inlining
597         in GNATprove mode.
599 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
601         * checks.adb (Apply_Type_Conversion_Checks): Do not generate a
602         range check on the expression of the conversion if it involves a
603         fixed-point type, as such conversions are handled specially
604         during expansion.
605         * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from
606         Fixed to Integer, use the base type of the expression to ensure
607         that the caller will generate the proper constraint check when
608         needed.
610 2018-09-26  Maroua Maalej  <maalej@adacore.com>
612         * sem_spark.adb (Check_Loop_Statement): Fix a bug related to
613         loop exit environment.
614         (Check_Statement): fixing a bug when comparing the source and
615         target in an assignment statement.
617 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
619         * sem_ch12.adb (Instantiate_Package_Body): Capture and restore
620         the full compilation context.
621         (Instantiate_Subprogram_Body): Capture and restore the full
622         compilation context.
624 2018-09-26  Yannick Moy  <moy@adacore.com>
626         * debug.adb: Add use for -gnatd_f switch.
627         * inline.adb (Cannot_Inline): Only issue info message for
628         failure to inline in GNATprove mode when switch -gnatd_f is
629         used.
631 2018-09-26  Javier Miranda  <miranda@adacore.com>
633         * exp_disp.adb (Expand_Interface_Conversion): No displacement of
634         the pointer needed when the type of the operand is an interface
635         type that maches the target type and we are compiling under
636         configurable runtime. Adding also documentation explaining why
637         this cannot be done when compiling with the full runtime.
638         * exp_intr.adb: Update comment.
640 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
642         * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return.
644 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
646         * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when
647         applying a predicate check to prevent spurious errors when
648         private ancestors are involved.
650 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
652         * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the
653         secondary stack does not clash with restriction
654         No_Secondary_Stack.
655         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that
656         the use of the secondary stack does not clash with restriction
657         No_Secondary_Stack.
658         * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block
659         prior to analysis in order to either provide a local scope for
660         an iterator, or ensure that the secondary stack is properly
661         managed.
662         (Check_Call): Account for the case where the tree may be
663         unanalyzed or contain prior errors.
664         (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call.
665         Update all uses of the subprogram.
666         (Prepare_Loop_Statement): New routine.
668 2018-09-26  Javier Miranda  <miranda@adacore.com>
670         * sem_res.adb (Resolve_Actuals): If the formal is a class-wide
671         type conversion then do not skip resolving and expanding the
672         conversion; required to displace the pointer to the object and
673         reference the dispatch table associated with the target
674         interface type.
676 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
678         * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number
679         of key-value pairs in the hash table only when adding a brand
680         new pair.
682 2018-09-26  Sergey Rybin  <rybin@adacore.com>
684         * doc/gnat_ugn/gnat_utility_programs.rst: Add note about
685         processing of aggregate projects in gnatmetric and gnatstub.
687 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
689         * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
690         opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
691         sinfo.ads, snames.ads-tmpl: Minor reformatting.
693 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
695         * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of
696         front end sources.
697         * impunit.adb: Add unit GNAT.Sets to the list of predefined
698         units.
699         * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking
700         units.
701         * libgnat/g-sets.adb: New unit.
702         * libgnat/g-sets.ads: New unit.
703         * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to
704         allow for small sets.  Update all occurrences of Table_Locked to
705         Iterated.
706         (Ensure_Unlocked): Query the number of iterators.
707         (Find_Node): Use the supplied equality.
708         (Is_Empty): New routine.
709         (Lock): Update the number of iterators.
710         (Prepend_Or_Replace): Use the supplied equality.
711         (Size): Update the return type.
712         (Unlock): Update the number of iterators.
713         * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked
714         to Iterated.  Rename formal subprogram Equivalent_Keys to "=".
715         (Bucket_Range_Type, Pair_Count_Type): Remove types.
716         (Not_Created, Table_Locked, Iterator_Exhausted): Remove
717         exceptions.
718         (Hash_Table): Update to store the number of iterators rather
719         than locks.
720         (Is_Empty): New routine.
721         (Size): Update the return type.
722         * libgnat/g-lists.adb: Update all occurrences of List_Locked to
723         Iterated.
724         (Ensure_Unlocked): Query the number of iterators.
725         (Length): Remove.
726         (Lock): Update the number of iterators.
727         (Size): New routine.
728         (Unlock): Update the number of iterators.
729         * libgnat/g-lists.ads: Update all occurrences of List_Locked to
730         Iterated.
731         (Element_Count_Type): Remove type.
732         (Not_Created, Table_Locked, Iterator_Exhausted): Remove
733         exceptions.
734         (Linked_List): Update type to store the number of iterators
735         rather than locks.
736         (Length): Remove.
737         (Size): New routine.
738         * libgnat/gnat.ads (Bucket_Range_Type): New type.
739         (Iterated, Iterator_Exhausted, and Not_Created): New exceptions.
741 2018-09-26  Javier Miranda  <miranda@adacore.com>
743         * checks.adb (Install_Null_Excluding_Check): Do not add
744         null-excluding checks when the tree may not be fully decorated.
745         This patch cascade errors.
747 2018-09-26  Gary Dismukes  <dismukes@adacore.com>
749         * sem_ch3.adb (Analyze_Object_Declaration): Remove test for
750         Comes_From_Source, which prevented implicit conversions from
751         being applied to anonymous access-to-subprogram formals in
752         constant declartions that arise from instance associations for
753         generic formal objects.  Add RM and AARM references to comment.
755 2018-09-26  Olivier Hainque  <hainque@adacore.com>
757         * opt.ads (OpenAcc_Enabled): New flag. False by default. True
758         when OpenACC pragmas are requested to be honored, when -fopenacc
759         is found on the command line.
760         * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if
761         -fopenacc is seen on the command line.
762         * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New
763         flag/predicate on Loop statements which embed an Acc_Kernels,
764         Acc_Parallel or Acc_Data pragma.
765         (Is_OpenAcc_Loop): New flag/predicate on Loop statements which
766         embed an Acc_Loop pragma.
767         (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for
768         the new flags.
769         * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel
770         and Acc_Kernels pragmas.  Nothing to do here, all handled by
771         sem_prag.
772         * sem_prag.adb (Acc_First, Acc_Next,
773         Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause,
774         Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause,
775         Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang,
776         Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker,
777         Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New
778         helper for Analyze_Pragma, to handle OpenACC pragmas.
779         (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and
780         Acc_Kernels pragmas.
781         * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on
782         variable entity, action for ...
783         (Disable_Constants): Helper for Analyze_Loop_Statement, to ...
784         (Analyze_Loop_Statement): Disable True_Constant on variables
785         referenced within an OpenACC environment.
786         * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives
787         and clauses we can handle. Remove an exraneous whitespace before
788         columns, preventing line length overflow in the generated spec
789         with Ids now reaching beyond 999.
790         * doc/gnat_rm/implementation_defined_pragmas.rst: Document
791         pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data.
792         * gnat_rm.texi: Regenerate.
794 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
796         * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P
797         is a derived limited record is not itself limited if P is a
798         derived limited interface.
800 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
802         * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and
803         add In_Nested_Instance and
804         Has_Outer_Referencer_Of_Non_Subprograms parameters.  Rename
805         Has_Non_Subprograms_Referencer variable into
806         Has_Referencer_Of_Non_Subprograms and initialize it with the new
807         third parameter.  Adjust recursive calls and to the renaming.
808         Replace test on Top_Level with test on In_Nested_Instance to
809         decide whether to clear the Is_Public flag on entities.
810         (Hide_Public_Entities): Adjust call to Has_Referencer.
812 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
814         * exp_disp.adb (Expand_Interface_Conversion): Use Present test.
815         (Expand_Interface_Thunk): Propagate debug info setting from
816         target.
817         * exp_util.ads (Find_Interface_Tag): Adjust comment.
818         * exp_util.adb (Find_Interface_Tag): Remove assertions of
819         success.
820         * sem_util.adb (Is_Variable_Size_Record): Only look at
821         components and robustify the implementation.
822         * fe.h (Find_Interface_Tag): Declare.
823         (Is_Variable_Size_Record): Likewise.
825 2018-09-26  Thomas Quinot  <quinot@adacore.com>
827         * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order
828         and scalar storage order from root type to classwide equivalent
829         type, to prevent rejection of the equivalent type by the
830         freezing circuitry.
832 2018-09-26  Justin Squirek  <squirek@adacore.com>
834         * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional
835         to freeze called functions within iterator specifications during
836         full analysis.
837         (Preanalyze_Range): Minor typo fix.
839 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
841         * sem_ch6.adb (Analyze_Function_Return): If the return type has
842         a dynamic_predicate, apply a Predicate_Check to the expression,
843         given that it is implicitly converted to the return type.
844         Exclude case expressions from the check, because in this context
845         the expression is expanded into individual return statements.
847 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
849         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: In
850         -gnatct mode, process the discriminants only for a definition.
852 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
854         * repinfo.adb (List_Record_Layout): Be prepared for JSON output.
855         (List_Record_Info): Use the flat representation for record
856         subtypes in the JSON format.
858 2018-09-26  Justin Squirek  <squirek@adacore.com>
860         * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
861         documentation and an extra conditional check for RCI units so
862         that generated ali files will list the spec only instead of a
863         body when a body is not found.
865 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
867         * gcc-interface/gigi.h (error_gnat_node): Delete.
868         * gcc-interface/trans.c (error_gnat_node): Likewise.
869         (gigi): Replace it with Current_Error_Node.
870         (gnat_to_gnu): Likewise.
871         * gcc-interface/utils.c (rest_of_subprog_body_compilation):
872         Likewise.
873         * gcc-interface/misc.c (internal_error_function): Do not set it.
875 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
877         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
878         code retrieving the address when a clause has already been
879         processed.
880         * gcc-interface/trans.c (gnat_to_gnu)
881         <N_Attribute_Definition_Clause>: For an object with a Freeze
882         node, build a meaningful expression.
884 2018-09-26  Arnaud Charlet  <charlet@adacore.com>
886         * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets
887         Opt.Disable_ALI_File.
888         * debug.adb: Update debug flags documentation.
890 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
892         * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
893         analysis of preconditions specified by pragmas (rather than
894         aspects) is not delayed, and therefore expressions functions
895         that are completions do not need special handling during
896         expansion.
898 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
900         * exp_unst.adb: Fix handling of up level references for entries.
902 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
904         * contracts.adb (Expand_Subprogram_Contract,
905         Process_Preconditions_For): Apply Freeze_Expr_Types to the
906         expression for a precondition of an expression function that is
907         a completion, when the completion appears in the private part
908         and the declaration it completes is in the visible part of the
909         same package.
910         * freeze.adb (Freeze_Expr_Types): Do not establish the scope of
911         the operation if it is already installed, as will be the case
912         when called to analyze the contract oc the subprogram (which
913         happens when generating code inside the subprogram body).
915 2018-09-26  Maroua Maalej  <maalej@adacore.com>
917         * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global):
918         Change the operation associated to assigning to an IN parameter.
919         In SPARK, IN access-to-variable is an observe operation for a
920         function, and borrow operation for a procedure.
922 2018-09-26  Arnaud Charlet  <charlet@adacore.com>
924         * vxlink.adb: Minor reformatting.
926 2018-09-26  Gary Dismukes  <dismukes@adacore.com>
928         * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
929         miscellaneous typos.
931 2018-09-26  Jerome Lambourg  <lambourg@adacore.com>
933         * vxlink.adb: Kill a CodePeer warning.
935 2018-09-24  Eric Botcazou  <ebotcazou@adacore.com>
937         PR ada/87396
938         * fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
939         of 'char' as the type of the second parameter.
941 2018-09-13  Eric Botcazou  <ebotcazou@adacore.com>
943         * Makefile.rtl (arm% linux-gnueabi%): Always set EH_MECHANISM to -arm.
945 2018-09-13  Eric Botcazou  <ebotcazou@adacore.com>
947         PR ada/81103
948         * terminals.c: Do not include termio.h.
950 2018-08-27  Martin Liska  <mliska@suse.cz>
952         * gcc-interface/decl.c (update_profile): Use new function
953         fndecl_built_in_p and remove check for FUNCTION_DECL if
954         possible.
955         * gcc-interface/gigi.h (call_is_atomic_load): Likewise.
956         * gcc-interface/utils.c (gnat_pushdecl): Likewise.
958 2018-08-23  Giuliano Belinassi  <giuliano.belinassi@usp.br>
960         * exp_unst.ads: Fix typo 'exapnded' to 'expanded'.
962 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
964         * checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
965         exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
966         exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
967         lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
968         sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
969         sprint.adb: Minor reformatting.
971 2018-08-21  Jerome Lambourg  <lambourg@adacore.com>
973         * vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
974         vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
975         new tool vxlink to handle VxWorks constructors in DKMs.
976         * gcc-interface/Makefile.in: add rules to build vxlink
978 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
980         * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
981         Refine the handling of freezing types for expression functions
982         that are not completions, when analyzing the generated body for
983         the function: the body is inserted at the end of the enclosing
984         declarative part, and its analysis may freeze types declared in
985         the same scope that have not been frozen yet.
987 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
989         * sem_ch6.adb: Remove Freeze_Expr_Types.
990         * freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
991         sem_ch6.adb, and extended to handle other expressions that may
992         contain unfrozen types that must be frozen in their proper
993         scopes.
994         * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
995         contract is for the generated body of an expression function
996         that is a completion, traverse the expressions for pre- and
997         postconditions to freeze all types before adding the contract
998         code within the subprogram body.
1000 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1002         * sem_ch10.adb: Remove the with and use clause for unit Ghost.
1003         (Analyze_With_Clause): Do not mark a with clause which mentions
1004         an ignored Ghost code for elimination.
1006 2018-08-21  Javier Miranda  <miranda@adacore.com>
1008         * lib-writ.adb (Write_Unit_Information): Handle pragmas removed
1009         by the expander.
1011 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1013         * sem_ch6.adb (Check_Synchronized_Overriding): The conformance
1014         between an overriding protected operation and the overridden
1015         abstract progenitor operation requires subtype conformance;
1016         requiring equality of return types in the case of a function is
1017         too restrictive and leads to spurious errors when the return
1018         type is a generic actual.
1020 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1022         * exp_ch9.adb (Expand_N_Timed_Entry_Call,
1023         Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
1024         properly the scope of all entities created in blocks generated
1025         by the expansion of these constructs.
1027 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1029         * sem_ch13.adb (Build_Predicate_Functioss): Apply
1030         Reset_Quantified_Variables_Scope after predicate function has
1031         been analyzed, so that the scope can be reset on the generated
1032         loop statements that have replaced the quantified expressions.
1034 2018-08-21  Bob Duff  <duff@adacore.com>
1036         * einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
1037         obsolete code.
1039 2018-08-21  Maroua Maalej  <maalej@adacore.com>
1041         * sem_spark.adb (Check_Call_Statement): Check global and formal
1042         parameter permissions at call sites.
1043         (Check_Callable_Body): Assume permissions on globals and
1044         parameters depending on their modes then analyse the body
1045         operations.
1046         (Check_Declaration): Consider both deep (including elementary
1047         access) object declarations and normal variables. First check
1048         whether the deep object is of Ownership Aspec True or not, then,
1049         depending on its initialization, assign the appropriate state.
1050         Check related to non access type variables deal with
1051         initialization value permissions.
1052         (Check_Expression): Check nodes used in the expression being
1053         analyzed.
1054         (Check_Globals): Call by Check_Call_Statement to perform the
1055         check on globals.
1056         (Check_List): Call Check_Node on each element of the list.
1057         (Check_Loop_Statement): Check the Iteration_Scheme and loop
1058         statements.
1059         (Check_Node): Main traversal procedure to check safe pointer usage.
1060         (Check_Package_Body): Check subprogram's body.
1061         (Check_Param_In): Take a formal and an actual parameter and
1062         Check the permission of every in-mode parameter.
1063         (Check_Param_Out): Take a formal and an actual parameter and
1064         check the state of out-mode and in out-mode parameters.
1065         (Check_Statement): Check statements other than procedure call.
1066         (Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
1067         related to the given name.
1068         (Is_Deep): Return True if an object is of access type or has
1069         subfields of access type.
1070         (Perm_Error, Perm_Error_Subprogram_End): Add an error message
1071         whenever the found state on the given name is different from the
1072         one expected (in the statement being analyzed).
1073         (Process_Path): Given an operation and a current state, call
1074         Perm_Error if there is any mismatch.
1075         (Return_Declarations, Return_Globals, Return_The_Global): Check
1076         the state of a given name at the end of the subprogram. These
1077         procedures may change depending on how we shall finally deal
1078         with globals and the rhs state in a move operation.
1079         (Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
1080         Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
1081         Setup_Parameters): Set up the new states to the given node and
1082         up and down the tree after an operation.
1083         (Has_Ownership_Aspect_True): This function may disappear later
1084         when the Ownership Aspect will be implemented in the FE.
1086 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1088         * sem_res.adb (Resolve_Call): Resolve correctly a parameterless
1089         call that returns an access type whose designated type is the
1090         component type of an array, when the function has no defaulted
1091         parameters.
1093 2018-08-21  Yannick Moy  <moy@adacore.com>
1095         * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1096         Document entries of the target parametrization file.
1097         * gnat_ugn.texi: Regenerate.
1099 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1101         * sem_attr.adb: Set scope of elaboration flag for 'Access.
1103 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1105         * sprint.adb: Add guard on printing aspects.
1107 2018-08-21  Javier Miranda  <miranda@adacore.com>
1109         * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
1110         expander.
1112 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1114         * layout.adb: Do not set size of access subprogram if unnesting.
1116 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1118         * freeze.adb: Remove warnings for access to subprograms when
1119         unnesting is active.
1121 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1123         * exp_aggr.adb (Expand_Array_Aggregate): If the component type
1124         is limited, the array must be constructed in place, so set flag
1125         In_Place_Assign_OK_For_Declaration accordingly. This prevents
1126         improper copying of an array of tasks during initialization.
1128 2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>
1130         * gcc-interface/trans.c (Call_to_gnu): Always suppress an
1131         unchecked conversion around the actual for an In parameter
1132         passed by copy.
1134 2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>
1136         * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
1137         selected component inherited in a record extension and subject
1138         to a representation clause, retrieve the position and size from
1139         the original record component.
1141 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1143         * sem_util.ads, sem_util.adb (New_External_Entity): Type of
1144         Suffix_Index must be Int, not Nat, so that a negative value can
1145         be used to generate a unique name for an external object, as
1146         specified in Tbuild.New_External_Name.
1147         (Scope_Within): Handle private type whose completion is a
1148         synchronized type (For unnesting).
1149         * itypes.ads, itypes.adb (Create_Itype): Ditto
1150         * sem_ch3.adb (Constrain_Corresponding_Record): Generate a
1151         unique name for the created subtype, because there may be
1152         several discriminated tasks present in the same scope, and each
1153         needs its distinct corresponding record subtype.
1155 2018-08-21  Yannick Moy  <moy@adacore.com>
1157         * doc/gnat_ugn/gnat_and_program_execution.rst: Update
1158         documentation of dimensionality analysis.
1159         * gnat_ugn.texi: Regenerate.
1160         * Makefile.rtl, impunit.adb: Consider the new units.
1161         * libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
1162         libgnat/s-diflmk.ads: New units based on Float.
1163         * libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
1164         libgnat/s-dlmopr.ads: New units based on Long_Float.
1165         * libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
1166         into an instance of
1167         System.Dim.Generic_Mks.Generic_Other_Prefixes.
1168         * libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
1169         into an instance of System.Dim.Generic_Mks.
1171 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1173         * impunit.adb: Add g-lists to the set of non-implementation
1174         units.
1175         * libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
1176         * Makefile.rtl: Add g-lists to the set of non-tasking units.
1177         * gcc-interface/Make-lang.in: Add g-lists to the set of files
1178         used by gnat1.
1180 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1182         * exp_ch9.adb (Reset_Scopes): Do not recurse into type
1183         declarations when resetting the scope of entities declared the
1184         procedures generated for entry bodies and accept alternatives.
1185         Use the entity of the procedure declaration, not its body, as
1186         the new scope.
1188 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1190         * einfo.adb (Elaboration_Entity): Include entries and entry
1191         families in the set of legal entities.
1192         (Elaboration_Entity_Required): Include entries and entry
1193         families in the set of legal entities.
1194         (Set_Elaboration_Entity): Include entries and entry families in
1195         the set of legal entities.
1196         (Set_Elaboration_Entity_Required): Include entries and entry
1197         families in the set of legal entities.
1198         (Write_Field13_Name): Update the output of attribute
1199         Elaboration_Entity.
1200         * einfo.ads: Attributes Elaboration_Entity and
1201         Elaboration_Entity_Required now apply to entries and entry
1202         families.
1204 2018-08-21  Arnaud Charlet  <charlet@adacore.com>
1206         * set_targ.adb: Mark some CodePeer message as Intentional.
1208 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1210         * sem_res.adb (Resolve_Call): Force the freezing of an
1211         expression function that is called to provide a default value
1212         for a defaulted discriminant in an object initialization.
1214 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1216         * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
1217         Dynamic_HTable.
1219 2018-08-21  Javier Miranda  <miranda@adacore.com>
1221         * checks.ads (Determine_Range): Adding documentation.
1222         * checks.adb (Determine_Range): Don't deal with enumerated types
1223         with non-standard representation.
1224         (Convert_And_Check_Range): For conversion of enumeration types
1225         with non standard representation to an integer type perform a
1226         direct conversion to the target integer type.
1228 2018-08-21  Piotr Trojanek  <trojanek@adacore.com>
1230         * lib-xref.ads, lib-xref-spark_specific.adb
1231         (Enclosing_Subprogram_Or_Library_Package): Now roughtly works
1232         for pragmas that come from aspect specifications.
1234 2018-08-21  Pierre-Marie de Rodat  <derodat@adacore.com>
1236         * sa_messages.ads, sa_messages.adb: New source files.
1238 2018-08-03  Pierre-Marie de Rodat  <derodat@adacore.com>
1240         Reverts
1241         2018-07-06  Jim Wilson  <jimw@sifive.com>
1243         * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
1244         (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
1245         * gcc-interface/Makefile.in (xoscons): Likewise.
1247 2018-07-31  Alexandre Oliva  <oliva@adacore.com>
1248             Olivier Hainque  <hainque@adacore.com>
1250         * gcc-interface/trans.c: Include debug.h.
1251         (file_map): New static variable.
1252         (gigi): Set it.  Create decl_to_instance_map when needed.
1253         (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
1254         (Sloc_to_locus): ... this.  Add decl parm, map it to instance.
1255         * gcc-interface/gigi.h (Sloc_to_locus): Adjust declaration.
1257 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1259         * clean.adb, gnatchop.adb, gnatfind.adb, gnatls.adb,
1260         gnatmake.ads, gnatxref.adb, make.adb, make.ads, make_util.ads,
1261         sfn_scan.adb, vxaddr2line.adb, xeinfo.adb, xoscons.adb,
1262         xr_tabls.adb, xref_lib.adb: Address CodePeer messages.
1264 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1266         * gnatlink.adb: Fix potential Constraint_Error if
1267         Library_Version is too long.
1269 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1271         * sem_elab.adb: Remove duplicate condition detected by CodePeer.
1273 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1275         * exp_unst.adb (Subp_Index): In the case of a protected
1276         operation, the relevant entry is the generated
1277         protected_subprogram_body into which the original body is
1278         rewritten. Assorted cleanup and optimizations.
1280 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1282         * exp_attr.adb (Expand_Attribute, case Fixed_Value): Set the
1283         base type of the result to ensure that proper overflow and range
1284         checks are generated.  If the target is a fixed-point tyoe,
1285         generate the required overflow and range checks explicitly,
1286         rather than relying on Apply_Type_Conversion_Checks, which might
1287         simply set the Do_Range_Check flag and rely on the backend to
1288         add the check.
1290 2018-07-31  Hristian Kirtchev  <kirtchev@adacore.com>
1292         * sem_res.adb (Resolve_Call): Establish a transient scope to
1293         manage the secondary stack when the designated type of an
1294         access-to-subprogram requires it.
1296 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1298         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): To find local
1299         subprograms in the elaboration code for a package body, recurse
1300         through nested statement sequences because a compiler-generated
1301         procedure may appear within a condition statement.
1303 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1305         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Handle
1306         properly a protected call that includes a default parameter that
1307         is a call to a protected function of the same type.
1309 2018-07-31  Justin Squirek  <squirek@adacore.com>
1311         * lib-writ.adb (Write_With_Lines): Modfiy the generation of
1312         dependencies within ali files so that source unit bodies are
1313         properly listed even if said bodies are missing.  Perform legacy
1314         behavior in GNATprove mode.
1315         * lib-writ.ads: Modify documentation to reflect current behavior.
1317 2018-07-31  Eric Botcazou  <ebotcazou@adacore.com>
1319         * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.
1320         (mutex_t): Use it for 'lock' and 'data' components.
1321         (cond_t): Likewise for 'data' and use single 'flags' component.
1323 2018-07-31  Justin Squirek  <squirek@adacore.com>
1325         * exp_ch5.adb (Make_Field_Assign): Force temporarily generated
1326         objects for assignment of overlaid user objects to be renamings
1327         instead of constant declarations.
1329 2018-07-31  Hristian Kirtchev  <kirtchev@adacore.com>
1331         * exp_ch9.adb (Analyze_Pragmas): New routine.
1332         (Build_Private_Protected_Declaration): Code clean up. Relocate
1333         relevant aspects and pragmas from the stand-alone body to the
1334         newly created spec.  Explicitly analyze any pragmas that have
1335         been either relocated or produced by the analysis of the
1336         aspects.
1337         (Move_Pragmas): New routine.
1338         * sem_prag.adb (Find_Related_Declaration_Or_Body): Recognize the
1339         case where a pragma applies to the internally created spec for a
1340         stand-along subprogram body declared in a protected body.
1342 2018-07-31  Gary Dismukes  <dismukes@adacore.com>
1344         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
1345         calls to Current_Scope in three assertions with calls to
1346         Current_Subprogram.
1348 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1350         * sem_eval.adb (Check_Non_Static_Context): Do not warn on an
1351         integer literal greater than the upper bound of
1352         Universal_Integer'Last when expansion is disabled, to avoid a
1353         spurious warning over ranges involving 64-bit modular types.
1355 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1357         * einfo.adb (Write_Entity_Flags): Also print
1358         Is_Activation_Record flag.
1360 2018-07-31  Piotr Trojanek  <trojanek@adacore.com>
1362         * exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb,
1363         repinfo.adb, sem_ch9.adb: Minor replace Ekind membership tests
1364         with a wrapper routine.
1366 2018-07-31  Piotr Trojanek  <trojanek@adacore.com>
1368         * ali.adb (Known_ALI_Lines): Remove 'F' as a prefix for lines
1369         related to the FORMAL analysis done by GNATprove.
1371 2018-07-31  Javier Miranda  <miranda@adacore.com>
1373         * sem.ads (Inside_Preanalysis_Without_Freezing): New global
1374         counter.
1375         * sem.adb (Semantics): This subprogram has now the
1376         responsibility of resetting the counter before analyzing a unit,
1377         and restoring its previous value before returning.
1378         * freeze.adb (Freeze_Entity): Do not freeze if we are
1379         preanalyzing without freezing.
1380         * sem_res.adb (Preanalyze_And_Resolve): Set & restore
1381         In_Preanalysis_Without_Freezing.
1383 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1385         * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
1386         may rename a matching class-wide operation only if the renaming
1387         declaration for that actual is in an enclosing scope (i.e.
1388         within the corrresponding instance).
1390 2018-07-31  Hristian Kirtchev  <kirtchev@adacore.com>
1392         * checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
1393         exp_disp.adb, make.adb, sem_ch4.adb, sem_eval.adb, sem_res.adb,
1394         usage.adb: Minor reformatting.
1396 2018-07-31  Bob Duff  <duff@adacore.com>
1398         * sem_res.adb (Resolve_Allocator): Do not complain about the
1399         implicit allocator that occurs in the expansion of a return
1400         statement for a build-in-place function.
1402 2018-07-20  Martin Sebor  <msebor@redhat.com>
1404         PR middle-end/82063
1405         * gcc-interface/misc.c (gnat_handle_option): Change function argument
1406         to HOST_WIDE_INT.
1408 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1410         * gcc-interface/decl.c (choices_to_gnu): Rename parameters.  Deal with
1411         an operand of Character type.  Factor out range generation to the end.
1412         Check that the bounds are literals and convert them to the type of the
1413         operand before building the ranges.
1414         * gcc-interface/utils.c (make_dummy_type): Minor tweak.
1415         (make_packable_type): Propagate TYPE_DEBUG_TYPE.
1416         (maybe_pad_type): Likewise.
1418 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1420         * sem_ch4.adb (Try_Object_Operation): Handle properly a prefixed call
1421         in an instance, when the generic parameters include an interface type
1422         and a abstract operation of that type, and the actuals in the instance
1423         include an interface type and a corresponding abstract operation of it,
1424         with a different name than the corresponding generic subprogram
1425         parameter.
1427 2018-07-17  Arnaud Charlet  <charlet@adacore.com>
1429         * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
1430         cases.
1432 2018-07-17  Arnaud Charlet  <charlet@adacore.com>
1434         * checks.adb (Apply_Division_Check): Add provision for floating-point
1435         checks.
1437 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1439         * exp_aggr.adb (Component_OK_For_Backend): If an array component of the
1440         enclosing record has a bound that is out of range (and that has been
1441         rewritten as a raise statement) the aggregate is not OK for any back
1442         end, and should be expanded into individual assignments.
1444 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1446         * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
1448 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1450         * sem_util.ads (Denotes_Same_Object): Likewise.
1451         * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
1453 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1455         * exp_disp.adb (Make_Tags): When the type has user-defined primitives,
1456         build the access type that is later used by Build_Get_Prim_Op_Address
1457         as pointing to a subtype of Ada.Tags.Address_Array.
1459 2018-07-17  Patrick Bernardi  <bernardi@adacore.com>
1461         * libgnat/s-memory__mingw.adb: Remove.
1462         * Makefile.rtl: Remove s-memory.adb target pair from the Cygwin/Mingw32
1463         section.
1465 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1467         * frontend.adb (Frontend): The removal of ignored Ghost code must be
1468         the last semantic operation performed on the tree.
1470 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1472         * frontend.adb (Frontend): Update the call to Register_Config_Switches.
1473         * inline.ads: Add new component Config_Switches to record
1474         Pending_Body_Info which captures the configuration state of the pending
1475         body.  Remove components Version, Version_Pragma, SPARK_Mode, and
1476         SPARK_Mode_Pragma from record Pending_Body_Info because they are
1477         already captured in component Config_Switches.
1478         * opt.adb (Register_Opt_Config_Switches): Rename to
1479         Register_Config_Switches.
1480         (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1481         (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1482         routine is now a function, and returns the saved configuration state as
1483         an aggregate to avoid missing an attribute.
1484         (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1485         * opt.ads (Register_Opt_Config_Switches): Rename to
1486         Register_Config_Switches.
1487         (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1488         (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1489         routine is now a function.
1490         (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1491         * par.adb (Par): Update the calls to configuration switch-related
1492         subprograms.
1493         * sem.adb (Semantics): Update the calls to configuration switch-related
1494         subprograms.
1495         * sem_ch10.adb (Analyze_Package_Body_Stub): Update the calls to
1496         configuration switch-related subprograms.
1497         (Analyze_Protected_Body_Stub): Update the calls to configuration
1498         switch-related subprograms.
1499         (Analyze_Subprogram_Body_Stub): Update calls to configuration
1500         switch-related subprograms.
1501         * sem_ch12.adb (Add_Pending_Instantiation): Update the capture of
1502         pending instantiation attributes.
1503         (Inline_Instance_Body): Update the capture of pending instantiation
1504         attributes.  It is no longer needed to explicitly manipulate the SPARK
1505         mode.
1506         (Instantiate_Package_Body): Update the restoration of the context
1507         attributes.
1508         (Instantiate_Subprogram_Body): Update the restoration of context
1509         attributes.
1510         (Load_Parent_Of_Generic): Update the capture of pending instantiation
1511         attributes.
1512         (Set_Instance_Env): Update the way relevant configuration attributes
1513         are saved and restored.
1515 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1517         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
1518         more rvalues in the expression of a renaming.
1520 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1522         * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
1523         METHOD_TYPE too.
1524         (TYPE_RETURN_UNCONSTRAINED_P): Likewise.
1525         (TYPE_CI_CO_LIST): Likewise.
1526         * gcc-interface/gigi.h (is_cplusplus_method): Delete.
1527         (fntype_same_flags_p): Adjust comment.
1528         * gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
1529         (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
1530         attribute directly.
1531         (is_cplusplus_method): Make static and adjust head comment.
1532         (gnat_to_gnu_param): Return a pointer for the "this" parameter of
1533         C++ constructors.
1534         (gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
1535         callable form.  Generate a METHOD_TYPE node for imported C++ methods.
1536         Set param_list at the very end of the processing.
1537         (substitute_in_type) <METHOD_TYPE>: New case.
1538         * gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
1539         (gnat_type_hash_eq): Accept METHOD_TYPE.
1540         * gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
1541         (Attribute_to_gnu): Likewise.
1542         (Call_to_gnu): Likewise.
1543         (process_freeze_entity): Likewise.
1544         * gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
1545         (fntype_same_flags_p): Likewise.
1547 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1549         * inline.adb (Expand_Inlined_Call): Remove extra parentheses.
1551 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1553         * exp_disp.adb (Gen_Parameters_Profile): Make the _Init parameter an
1554         In/Out parameter.
1555         (Set_CPP_Constructors): Adjust comment accordingly.
1557 2018-07-17  Bob Duff  <duff@adacore.com>
1559         * exp_disp.adb (Build_Class_Wide_Check): Return early if the
1560         precondition is supposed to be ignored.
1562 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1564         * sem_ch6.adb (Check_Untagged_Equality): Extend check to operations
1565         declared in the same scope as the operand type, when that scope is a
1566         procedure.
1568 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1570         * exp_unst.adb (Unnest_Subprograms): Do nothing if the expander is not
1571         active.  Don't use Get_Actual_Subtype for record subtypes.  Ignore
1572         rewritten identifiers and uplevel references to bounds of types that
1573         come from the original type reference.
1575 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1577         * exp_ch13.adb, exp_ch7.adb, exp_unst.adb, freeze.adb,
1578         libgnat/s-os_lib.adb, sem_ch3.adb, sem_ch3.ads, sem_ch5.adb,
1579         sem_eval.adb, sem_res.adb, sem_util.adb: Minor reformatting.
1581 2018-07-17  Javier Miranda  <miranda@adacore.com>
1583         * exp_ch13.adb (Expand_N_Freeze_Entity): Handle subtype declared for an
1584         iterator.
1585         * freeze.adb (Freeze_Expression): Handle freeze of an entity defined
1586         outside of a subprogram body. This case was previously handled during
1587         preanalysis; the frozen entities were remembered and left pending until
1588         we continued freezeing entities outside of the subprogram. Now, when
1589         climbing the parents chain to locate the correct placement for the
1590         freezeing node, we check if the entity can be frozen and only when no
1591         enclosing node is marked as Must_Not_Freeze the entity is frozen.
1592         * sem_ch3.ads (Preanalyze_Default_Expression): Declaration moved to the
1593         package body.
1594         * sem_ch3.adb (Preanalyze_Default_Expression): Code adjusted to invoke
1595         the new subprogram Preanalyze_With_Freezing_And_Resolve.
1596         * sem_ch6.adb (Preanalyze_Formal_Expression): New subprogram.
1597         (Analyze_Expression_Function, Process_Formals): Invoke
1598         Preanalyze_Formal_Expression instead of Preanalyze_Spec_Expression
1599         since the analysis of the formals may freeze entities.
1600         (Analyze_Subprogram_Body_Helper): Skip building the body of the
1601         class-wide clone for eliminated subprograms.
1602         * sem_res.ads, sem_res.adb (Preanalyze_And_Resolve): New subprogram.
1603         Its code is basically the previous version of this routine but extended
1604         with an additional parameter which is used to specify if during
1605         preanalysis we are allowed to freeze entities.  If the new parameter is
1606         True then the subtree root node is marked as Must_Not_Freeze and no
1607         entities are frozen during preanalysis.
1608         (Preanalyze_And_Resolve): Invokes the internal version of
1609         Preanalyze_And_Resolve without entity freezing.
1610         (Preanalyze_With_Freezing_And_Resolve): Invokes the internal version of
1611         Prenalyze_And_Resolve with freezing enabled.
1613 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1615         * einfo.ads, libgnat/g-comlin.ads: Minor change "ie" to "i.e." in docs
1616         and comments.
1618 2018-07-17  Justin Squirek  <squirek@adacore.com>
1620         * libgnat/s-os_lib.adb (Argument_String_To_List): Fix trimming of
1621         whitespace.
1623 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1625         * sem_prag.adb (Has_Visible_State): Do not consider constants as
1626         visible state because it is not possible to determine whether a
1627         constant depends on variable input.
1628         (Propagate_Part_Of): Add comment clarifying the behavior with respect
1629         to constant.
1631 2018-07-17  Yannick Moy  <moy@adacore.com>
1633         * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
1634         being propagated in GNATprove mode.
1636 2018-07-17  Dmitriy Anisimkov  <anisimko@adacore.com>
1638         * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
1639         public components of Inet_Addr_Type. Introduce public binary
1640         operations.
1642 2018-07-17  Javier Miranda  <miranda@adacore.com>
1644         * exp_ch7.adb (Make_Transient_Block): When determining whether an
1645         enclosing scope already handles the secondary stack, take into account
1646         transient blocks nested in a block that do not manage the secondary
1647         stack and are located within a loop.
1649 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1651         * sem_util.adb (Enclosing_Subprogram): Protected entries and task
1652         entries must be treated separately: task entries are within the
1653         enclosing subprogram of the task type, while protected entries are
1654         transformed into the corresponding Protected_Body_Subprogram, which is
1655         the enclosing_subprogram of any subprogram declared within the entry
1656         body.
1658 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1660         * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
1661         sections on -gnatH and -gnatJ compiler switches.
1662         * gnat_ugn.texi: Regenerate.
1664 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1666         * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
1667         table.
1668         * atree.adb: Add a soft link for a procedure which is invoked whenever
1669         an ignored Ghost node or entity is created.
1670         (Change_Node): Preserve relevant attributes which come from the Flags
1671         table.
1672         (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
1673         entity.
1674         (Rewrite): Preserve relevant attributes which come from the Flags
1675         table.
1676         (Set_Ignored_Ghost_Recording_Proc): New routine.
1677         * atree.ads: Define an access-to-suprogram type for a soft link which
1678         records a newly created ignored Ghost node or entity.
1679         (Set_Ignored_Ghost_Recording_Proc): New routine.
1680         * ghost.adb: Remove with and use clause for Lib.  Remove table
1681         Ignored_Ghost_Units.  Add new table Ignored_Ghost_Nodes.
1682         (Add_Ignored_Ghost_Unit): Removed.
1683         (Initialize): Initialize the table which stores ignored Ghost nodes.
1684         Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
1685         ignored Ghost node.
1686         (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
1687         an eliminated ignored Ghost unit.
1688         (Lock): Release and lock the table which stores ignored Ghost nodes.
1689         (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
1690         Ghost nodes.
1691         (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
1692         ignored Ghost nodes.
1693         (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
1694         (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
1695         Ghost nodes.
1696         (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
1697         (Propagate_Ignored_Ghost_Code): Removed.
1698         (Record_Ignored_Ghost_Node): New routine.
1699         (Remove_Ignored_Ghost_Code): Reimplemented.
1700         (Remove_Ignored_Ghost_Node): New routine.
1701         (Ultimate_Original_Node): New routine.
1702         * ghost.ads (Check_Ghost_Completion): Removed.
1703         * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
1704         package clause as ignored Ghost if applicable.
1705         * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
1707 2018-07-17  Javier Miranda  <miranda@adacore.com>
1709         * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
1710         to reuse it.
1711         (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
1712         of the loop iterator relies on the secondary stack.
1714 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1716         * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
1717         which happens for inlined calls, then fetch the next actual from the
1718         original AST.
1720 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1722         * einfo.ads: Update documentation for Scalar_Range.
1724 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1726         * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
1727         the Standard package.
1729 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1731         * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
1733 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1735         * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
1736         synchronized types that are completions of limited types or private
1737         extensions.
1738         (Scope_Within): Handle properly accept statements in task bodies.
1740 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1742         * sem_prag.adb (Has_Visible_State): Do not consider generic formals
1743         because they are not part of the visible state space. Add constants to
1744         the list of acceptable visible states.
1745         (Propagate_Part_Of): Do not consider generic formals when propagating
1746         the Part_Of indicator.
1747         * sem_util.adb (Entity_Of): Do not follow renaming chains which go
1748         through a generic formal because they are not visible for SPARK
1749         purposes.
1750         * sem_util.ads (Entity_Of): Update the comment on usage.
1752 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1754         * sem_util.adb (Gather_Components): A discriminant of an ancestor may
1755         have been constrained by a later ancestor, so when looking for the
1756         value of that hidden discriminant we must examine the stored constraint
1757         of other ancestors than the immediate parent type.
1759 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1761         * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
1762         constructs and entities within receive new entities when replicating a
1763         tree.
1764         (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
1765         and entities within receive new entities when replicating a tree.
1766         * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
1767         (Visit_Entity): Visit entities within scoping constructs inside
1768         expression with actions nodes when requested by the caller. Add blocks,
1769         labels, and procedures to the list of entities which need replication.
1770         * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
1771         the comment on usage.
1773 2018-07-17  Arnaud Charlet  <charlet@adacore.com>
1775         * doc/gnat_ugn/about_this_guide.rst,
1776         doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
1777         * gnat_ugn.texi: Regenerate.
1779 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1781         * contracts.adb (Analyze_Contracts): Add specialized processing for
1782         package instantiation contracts.
1783         (Analyze_Package_Contract): Remove the verification of a missing
1784         Part_Of indicator.
1785         (Analyze_Package_Instantiation_Contract): New routine.
1786         * contracts.ads (Analyze_Package_Contract): Update the comment on
1787         usage.
1788         * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
1789         instance is being examined when trying to determine whether a package
1790         instantiation needs a Part_Of indicator.
1792 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1794         * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
1795         sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
1796         sem_util.adb: Minor reformatting.
1798 2018-07-16  Arnaud Charlet  <charlet@adacore.com>
1800         * frontend.adb: Only unnest subprograms if no previous errors were
1801          detected.
1803 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1805         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
1806         contain blocks in the elaboration code for a package body. Create the
1807         elaboration subprogram wrapper only if there is a subprogram
1808         declaration in a block or loop.
1810 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1812         * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
1813         deep copy of the left operand when building each conjuct of the
1814         expanded membership operation, to avoid sharing nodes between them.
1815         This sharing interferes with the unnesting machinery and is generally
1816         undesirable.
1818 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1820         * exp_unst.adb (Visit_Node): Handle 'Address references that are
1821         calls.
1823 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1825         * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
1826         in relevant nodes: Allocate, Free, and return statements.
1828 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1830         * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
1831         instance that carries an aspect Default_Storage_Pool that overrides a
1832         default storage pool that applies to the generic unit. The aspect in
1833         the generic unit was removed before copying it in the instance, rather
1834         than removing it from the copy of the aspects that are appended to the
1835         aspects in the instance.
1837 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1839         * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
1840         loop parameters.
1841         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
1842         bodies.
1843         * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
1844         entry body to be the corresponding generated subprogram, for correct
1845         analysis of uplevel references.
1846         * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
1847         Ignore pragmas, fix component associations.
1848         (Register_Subprograms): Subprograms in synchronized types must be
1849         treated as reachable.
1851 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1853         * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
1854         states and variables.
1856 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1858         * sinfo.ads, sinfo.adb (Withed_Body): Remove.
1859         (Set_Withed_Body): Remove.
1861 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1863         * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
1864         when printing debug info.
1866 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1868         * sem.adb (Walk_Library_Items): Reuse local constant.
1869         (Is_Subunit_Of_Main): Turn condition to positive and flip the
1870         IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
1871         Lib variable.
1873 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1875         * sem.adb (Walk_Library_Items): Deconstruct dead code.
1877 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1879         * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
1880         Expand_Nonbinary_Modular_Op.  Needed for unnesting.
1882 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1884         * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
1885         static predicate (for example True) but has no
1886         static_discrete_predicate.
1888 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1890         * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
1891         class-wide types and record extensions.
1893 2018-07-16  Justin Squirek  <squirek@adacore.com>
1895         * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
1896         checks on expanded literals within if and case expressions.
1898 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1900         * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
1901         longest sequence factor. Code clean up.
1902         (Wide_Wide_String_To_String): Use the appropriate longest sequence
1903         factor.  Code clean up.
1905 2018-07-16  Javier Miranda  <miranda@adacore.com>
1907         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
1908         on Bit_Order when defined for a record extension.
1910 2018-07-16  Arnaud Charlet  <charlet@adacore.com>
1912         * libgnat/s-objrea.ads: Minor code clean up.
1914 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1916         * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
1917         rule.
1919 2018-07-16  Arnaud Charlet  <charlet@adacore.com>
1921         * adaint.c (__gnat_set_file_time_name): Code clean up.
1923 2018-07-16  Javier Miranda  <miranda@adacore.com>
1925         * inline.adb (Build_Body_To_Inline): Minor code reorganization that
1926         ensures that calls to function Has_Single_Return() pass a decorated
1927         tree.
1928         (Has_Single_Return.Check_Return): Peform checks on entities (instead on
1929         relying on their characters).
1931 2018-07-16  Javier Miranda  <miranda@adacore.com>
1933         * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
1934         to avoid generating an ill-formed tree that confuses gnatprove causing
1935         it to blowup.
1937 2018-07-16  Yannick Moy  <moy@adacore.com>
1939         * inline.adb (Has_Single_Return): Rewrap comment.
1941 2018-07-16  Eric Botcazou  <ebotcazou@adacore.com>
1943         * einfo.ads: Minor tweak in comment.
1945 2018-07-16  Javier Miranda  <miranda@adacore.com>
1947         * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
1949 2018-07-16  Javier Miranda  <miranda@adacore.com>
1951         * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
1952         transform 'Count into a function call if the current scope has been
1953         eliminated.
1955 2018-07-16  Javier Miranda  <miranda@adacore.com>
1957         * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
1958         public part of this package.
1960 2018-07-16  Yannick Moy  <moy@adacore.com>
1962         * sem_res.adb (Resolve_Call): Do not inline calls inside
1963         compiler-generated functions translated as predicates in GNATprove.
1965 2018-07-16  Gary Dismukes  <dismukes@adacore.com>
1967         * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
1968         addition to the existing test for no Storage_Pool as a condition
1969         enabling generation of the call to Check_Standard_Allocator when the
1970         restriction No_Standard_Allocators_After_Elaboration is active.
1971         * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
1972         say that Storage_Error will be raised (rather than Program_Error).
1973         * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
1974         rather than Program_Error when Elaboration_In_Progress is False.
1976 2018-07-16  Gary Dismukes  <dismukes@adacore.com>
1978         * sem_eval.adb: Fix spelling for compile-time-known.
1980 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1982         * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
1983         the compiler from entering infinite recursion when trying to determine
1984         whether a deferred constant has a compile time known value, and the
1985         initialization expression of the constant is a reference to the
1986         constant itself.
1988 2018-07-16  Nicolas Roche  <roche@adacore.com>
1990         * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
1991         factor from 1/32 to 1/2 for Unbounded_String.
1993 2018-07-13  Eric Botcazou  <ebotcazou@adacore.com>
1995         * gcc-interface/lang.opt (funsigned-char): New option.
1996         * gcc-interface/misc.c (gnat_handle_option): Accept it.
1997         * gcc-interface/utils.c (finish_character_type): Tweak comment.
1999 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
2001         * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
2002         variable and use it throughout.
2003         <E_Variable>: If the nominal subtype of the object is unconstrained,
2004         compute the Ada size separately and put in on the padding type if the
2005         size is not fixed.
2006         <E_Record_Type>: Minor tweak.
2007         * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
2008         into max_size_unit throughout.
2010 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
2012         * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
2013         * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
2014         * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
2015         (add_decl_expr): Change type of second parameter and rename it.
2016         (renaming_from_instantiation_p): New function moved from...
2017         (set_expr_location_from_node): Test for exceptions here and add one
2018         for actual subtypes built for unconstrained composite actuals.
2019         * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
2021 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
2023         * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
2024         and adjust recursive calls.
2025         (Identifier_to_gnu): Adjust calls to lvalue_required_p.
2026         (gnat_to_gnu): Likewise.
2028 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
2030         * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
2031         (gnat_to_gnu_subprog_type): New pure_flag local variable.  Set it for
2032         a pure Ada function with a by-ref In parameter.  Propagate it onto the
2033         function type by means of the TYPE_QUAL_RESTRICT flag.
2034         * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
2035         function type has the TYPE_QUAL_RESTRICT flag set.
2037 2018-07-06  Jim Wilson  <jimw@sifive.com>
2039         * Makefile.rtl: Add riscv*-linux* support.
2040         * libgnarl/s-linux__riscv.ads: New.
2041         * libgnat/system-linux-riscv.ads: New.
2043         * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
2044         (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
2045         * gcc-interface/Makefile.in (xoscons): Likewise.
2047 2018-07-06  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2049         * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
2050         (ZCX_By_Default): Set to True.
2052 2018-07-02  Martin Liska  <mliska@suse.cz>
2054         * gnatvsn.ads: Bump Library_Version to 9.
2056 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2058         * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
2059         using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
2060         (TYPE_ALIGN_OK): Move around.
2061         (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
2062         * gcc-interface/decl.c (change_qualified_type): Move to...
2063         (gnat_to_gnu_entity): Adjust comment.
2064         * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
2065         (ceil_pow2): Use ceil_log2.
2066         * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
2067         and do not set TREE_SIDE_EFFECTS.
2068         (handle_noreturn_attribute): Use change_qualified_type.
2070 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2072         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
2073         the expression of a dispatch table that is not being defined.
2074         <E_Record_Subtype>: Remove obsolete kludge.
2076 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2078         * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
2079         for discriminants.
2080         (warn_on_list_placement): New static function.
2081         (components_to_record): Use it to warn on multiple fields in list.
2083 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2085         * gcc-interface/decl.c (variant_desc): Add AUX field.
2086         (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
2087         directly.
2088         (reverse_sort_field_list): New static function.
2089         (components_to_record): Place the variant part at the beginning of the
2090         field list when there is an obvious order of increasing position.
2091         (build_variant_list): Initialize it.
2092         (create_variant_part_from): Do not call compute_record_mode directly.
2093         (copy_and_substitute_in_layout): Likewise.  Always sort the fields with
2094         fixed position in order of increasing position, in the record and all
2095         the variants, in any.  Call reverse_sort_field_list.
2096         * gcc-interface/utils.c (make_packable_type): Compute the sizes before
2097         calling finish_record_type.  Do not call compute_record_mode directly.
2098         (finish_record_type): Overhaul final processing depending on REP_LEVEL
2099         and call finish_bitfield_layout if it is equal to one or two.
2101 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2103         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
2104         existing fields of a dummy fat pointer type, if any.  Clear the
2105         TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
2107 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2109         * contracts.adb (Process_Body_Postconditions): Expand only checked
2110         postconditions.
2111         (Process_Contract_Cases_For): Expand only checked contract cases.
2112         (Process_Inherited_Preconditions): Ignored class-wide preconditions are
2113         partially expanded because some of their semantic checks are tied to
2114         the expansion.
2115         (Process_Preconditions_For): Expand only checked preconditions.
2116         (Process_Spec_Postconditions): Expand only checked preconditions.
2117         Ignored class-wide preconditions are partially expanded because some of
2118         their semantic checks are tied to the expansion.
2119         * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
2120         assertion pragmas.
2121         * exp_util.adb (Add_Inherited_Invariants): Code clean up.
2122         * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
2124 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2126         * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
2127         libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
2128         libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
2129         reformatting.
2131 2018-06-11  Gary Dismukes  <dismukes@adacore.com>
2133         * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
2135 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2137         * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
2138         not add any actuals when the size of the object is known, and the
2139         caller will allocate it.
2140         (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
2141         better illustrate its functionality. Update the comment on the
2142         generated code.  Generate a branch for the heap and pool cases where
2143         the object is not necessarity controlled.
2144         (Expand_N_Extended_Return_Statement): Expand the extended return
2145         statement into four branches depending the requested mode if the caller
2146         will not allocate the object on its side.
2147         (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
2148         object on the caller side because this will violate the semantics of
2149         finalizable types. Instead notify the function to allocate the object
2150         on the heap or a user-defined storage pool.
2151         (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
2152         which of the four modes to employ when returning a limited controlled
2153         result.
2154         * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
2155         guard which is already covered in Needs_Finalization.
2157 2018-06-11  Olivier Hainque  <hainque@adacore.com>
2159         * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
2160         * libgnat/a-exexpr.adb: ... Here, then add comments describing the
2161         major datastructures associated with the current exception raised.
2162         (Setup_Current_Excep): Accept a "Phase" argument conveying the
2163         unwinding phase during which this subprogram is called.  For an Ada
2164         exception, don't update the current exception buffer from the raised
2165         exception object during SEARCH_PHASE, as this is redundant with the
2166         call now issued just before propagation starts.
2167         (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
2168         the unwinding start, conveying Phase 0.
2169         (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
2170         the call to Setup_Current_Excep.
2171         * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
2172         on calls to Setup_Current_Excep.
2174 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2176         * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
2177         Build_Access_Type_Decl): New subprograms to handle uplevel references
2178         to formals of an unconstrained array type. The activation record
2179         component for these is an access type, and the reference is rewritten
2180         as an explicit derefenrence of that component.
2182 2018-06-11  Bob Duff  <duff@adacore.com>
2184         * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
2185         libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
2186         (Element): Add code to detect dangling cursors in some cases.
2188 2018-06-11  Yannick Moy  <moy@adacore.com>
2190         * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
2191         from source.
2193 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2195         * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
2196         that its parent is already frozen so that its predicate function, if
2197         any, has already been constructed.
2199 2018-06-11  Yannick Moy  <moy@adacore.com>
2201         * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
2202         possible task unit as the enclosing context.
2204 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2206         * gnat1drv.adb: Remove use clause for Repinfo.
2207         (Gnat1drv): Beef up comment about the interplay between -gnatc and
2208         back-end annotations.  Use full qualified name for List_Rep_Info.
2210 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2212         * libgnat/g-arrspl.ads: Add pragma Preelaborate.
2214 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2216         * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
2217         then" and general logical "ada" in codepeer mode.
2219 2018-06-11  Javier Miranda  <miranda@adacore.com>
2221         * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
2222         N_Call_Marker nodes.
2224 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2226         * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
2227         reformatting.
2229 2018-06-11  Yannick Moy  <moy@adacore.com>
2231         * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
2232         argument to Assertion_Policy
2233         * gnat_rm.texi: Regenerate.
2235 2018-06-11  Yannick Moy  <moy@adacore.com>
2237         * gnat1drv.adb: Do not check representation information in CodePeer and
2238         GNATprove modes, as these modes call a special backend instead of gigi,
2239         so do not have the information.
2241 2018-06-11  Yannick Moy  <moy@adacore.com>
2243         * inline.adb (Build_Body_To_Inline): Consider case of extended return
2244         of unconstrained type as one case where inlining is not supported.
2245         (Expand_Inlined_Call): Remove special case for body as extended return
2246         of unconstrained type.
2248 2018-06-11  Yannick Moy  <moy@adacore.com>
2250         * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
2251         unit.
2252         (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
2254 2018-06-11  Piotr Trojanek  <trojanek@adacore.com>
2256         * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
2257         expressions in Pre/Post contracts while in GNATprove_Mode.
2259 2018-06-11  Piotr Trojanek  <trojanek@adacore.com>
2261         * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
2262         with AND THEN expressions broken down into individual conjuncts.
2264 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2266         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
2268 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2270         * exp_unst.adb (Visit_Node): Skip generic associations.
2272 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2274         * libgnat/memtrack.adb (fwrite): Remove second definition.
2276 2018-06-11  Javier Miranda  <miranda@adacore.com>
2278         * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
2279         (Is_Static_Coextension): Adding documentation.
2280         * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
2281         (Is_Static_Coextension): Extending the assertion.
2282         * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
2283         setting flag Is_Dynamic_Coextension (and vice versa).
2285 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2287         * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
2288         level of a compilation unit, becuase they may contain nested
2289         subprograms that need an activation record.
2291 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2293         * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
2295 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2297         * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
2298         Minor reformatting.
2299         * sinfo.ads: Fix a typo.
2301 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2303         * inline.adb (Expand_Inlined_Call): If no optimization level is
2304         specified, the expansion of a call to an Inline_Always function is
2305         fully performed in the front-end even on a target that support back-end
2306         inlining.
2308 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2310         * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
2311         with Sec_Stack_Used.
2313 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2315         * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
2316         Is_Assignment_LHS further in. Use predicate
2317         Needs_Variable_Reference_Marker to determine whether to create a
2318         variable marker.
2319         (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
2320         in.  Use predicate Needs_Variable_Reference_Marker to determine whether
2321         to create a variable marker.
2322         * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
2323         checks that determine whether the identifier or expanded name is a
2324         suitable variable reference.  The checks are now performed by
2325         Needs_Variable_Reference_Marker.
2326         * sem_res.adb (Resolve_Actuals): Use predicate
2327         Needs_Variable_Reference_Marker to determine whether to create a
2328         variable marker.
2329         * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
2330         * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
2332 2018-06-11  Valentine Reboul  <reboul@adacore.com>
2334         * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
2335         "Community Edition".
2337 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2339         * sem_ch12.adb (Install_Body): In order to determine the placement of
2340         the freeze node for an instance of a generic nested within another
2341         instance, take into account that the outer instance may be declared in
2342         the visible part of a package and the inner intance may be in the
2343         private part of the same package.
2345 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2347         * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
2349 2018-06-11  Nicolas Roche  <roche@adacore.com>
2351         * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
2352         stack overflow while raising a constraint error.
2354 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2356         * repinfo.ads (Rep_Value): Use a single line.
2357         * repinfo.adb (Rep_Value): Likewise.
2358         (List_Attr): Do not use string concatenation.
2360 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2362         * exp_unst.adb (Visit_Node): Check reference to formal parameter of
2363         current procedure, because the bounds of its type may be uplevel
2364         references.
2366 2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>
2368         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
2369         not a definition, retrieve the expression only if it's a compile-time
2370         known value if we are just annotating types.
2372         * gcc-interface/utils.c (convert): Do not try to upcast properly for a
2373         conversion between tagged types in type_annotate_only mode.
2375 2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>
2377         * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
2378         * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
2379         type built for an aliased component with variable size.
2381 2018-05-31  Pierre-Marie de Rodat  <derodat@adacore.com>
2383         * doc/gnat_ugn/project-manager-figure.png: Delete.
2385 2018-05-31  Pierre-Marie de Rodat  <derodat@adacore.com>
2387         * vxworks-arm-link.spec, vxworks-e500-link.spec,
2388         vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
2389         vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
2390         vxworks-smp-x86-link.spec: New files.
2392 2018-05-31  Pierre-Marie de Rodat  <derodat@adacore.com>
2394         * gnatvsn.adb: Re-center the copyright header.
2395         * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
2397 2018-05-31  Fedor Rybin  <frybin@adacore.com>
2399         * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
2400         gnattest section on user guide.
2402 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2404         * sem_res.adb (Resolve_String_Literal): If the type is a string type
2405         whose component subtype has a static predicate, ensure that the
2406         predicate is applied to each character by expanding the string into the
2407         equivalent aggregate. This is also done if the component subtype is
2408         constrained.
2410 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2412         * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
2414 2018-05-31  Piotr Trojanek  <trojanek@adacore.com>
2416         * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
2417         explicit spec.
2419 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2421         * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
2422         the type of the parameter is an unconstrained array type, convert
2423         to the type of the actual before the type of the formal only if the
2424         conversion was suppressed earlier.  Use in_param and gnu_actual_type
2425         local variables throughout, and uniform spelling for In Out or Out.
2426         Also remove dead code in the component-by-reference case.
2428 2018-05-31  Frederic Konrad  <konrad@adacore.com>
2430         * tracebak.c (STOP_FRAME): Harden condition.
2431         (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
2432         mode.
2434 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2436         * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
2437         check to a call to a build-in-place function, given that the return
2438         object is limited and cannot be copied.
2440 2018-05-31  Olivier Hainque  <hainque@adacore.com>
2442         * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
2443         builtins.
2445 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2447         * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2448         there is no target, also create a temporary for the return value for
2449         an allocator if the type is an unconstrained record type with default
2450         discriminant.
2452 2018-05-31  Hristian Kirtchev  <kirtchev@adacore.com>
2454         * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
2455         boudary for a transient scope.
2457 2018-05-31  Valentine Reboul  <reboul@adacore.com>
2459         * gnatvsn.ads: Rename "GPL" version to "Community".
2461 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2463         * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
2464         flag.
2466 2018-05-31  Piotr Trojanek  <trojanek@adacore.com>
2468         * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
2469         with a semantically equivalent call to Defining_Entity.
2471 2018-05-31  Piotr Trojanek  <trojanek@adacore.com>
2473         * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
2474         Max_Queue_Length expression.
2476 2018-05-31  Sergey Rybin  <rybin@adacore.com>
2478         * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
2479         that the main unit to be built before the call, now it computes the
2480         closure of the main unit itself.
2481         * gnat_ugn.texi: Regenerate.
2483 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2485         * repinfo.adb (List_Structural_Record_Layout): Set First to false
2486         after having listed the fields of the parent type, if any.
2488 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2490         * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
2491         deal with the ___XP suffix for packed array types here...
2492         <E_Array_Subtype>: ...or here when processing the implementation type
2493         but when processing the original type instead.  Do not reuse the DECL
2494         of the implementation type for the original type.  Tidy up.
2496 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2498         * einfo.ads (Object_Size_Clause): Declare.
2499         * einfo.adb (Object_Size_Clause): New function.
2500         * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
2501         retrieving Size_Clause and post the warning on the object size clause
2502         if Has_Object_Size_Clause is true.
2504 2018-05-31  Javier Miranda  <miranda@adacore.com>
2506         * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
2507         * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
2508         Find_Primitive_Eq to search for the primitive of types whose underlying
2509         type is a tagged type.
2511 2018-05-31  Yannick Moy  <moy@adacore.com>
2513         * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
2514         order of treatment between nodes recognized as loop pragmas (or
2515         generated from one) and block statements.
2517 2018-05-31  Doug Rupp  <rupp@adacore.com>
2519         * libgnat/s-osprim__posix2008.adb (Clock): Implement using
2520         clock_gettime.
2522 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2524         * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
2525         mark subprograms that cannot be eliminated because they must be treated
2526         as reachable from outside the current unit. This includes entry bodies
2527         and protected operations.
2529 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2531         * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
2532         Convert all operands of the generated code to Standard.Unsigned, to
2533         prevent spurious visibility errors. This is needed when the generated
2534         expansion involves a modular index type of an array type, and the index
2535         type is not immediately visible.
2537 2018-05-30  Piotr Trojanek  <trojanek@adacore.com>
2539         * einfo.ads (Package_Instantiation): Update comment after a routine
2540         that uses this field has been renamed.
2542 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2544         * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
2545         if the local raise statement includes a string expression. This
2546         expression might be picked up by an outer handler or discarded, but
2547         plays no role in this transformation.
2549 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2551         * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
2552         reformatting.
2554 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2556         * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
2557         field in relevant nodes: Allocate, Free, and return statements.
2559 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2561         * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
2562         that has not been analyzed, as will be the case for a nested aggregate
2563         that is expanded into individual assignments.
2565 2018-05-30  Justin Squirek  <squirek@adacore.com>
2567         * aspects.adb, aspects.ads: Register new aspect.
2568         * par-prag.adb (Prag): Register new pragma.
2569         * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
2570         aspect similar to Aspect_Max_Queue_Length.
2571         * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
2572         set it to use the same processing as Pragma_Max_Queue_Length.
2573         * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
2574         that it can be processed as a pragma in addition to a restriction and
2575         add an entry for the pragma itself.
2577 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2579         * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
2580         is now legal on a variable of composite type initialized with an
2581         aggregate that is fully static and requires no elaboration code.
2582         * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
2583         nested aggregates that are compile-time static, so they can be used to
2584         initialize variables declared with Threqd_Local_Storage.
2585         * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
2586         Thread_Local_Storage.
2587         * gnat_rm.texi: Regenerate.
2589 2018-05-30  Yannick Moy  <moy@adacore.com>
2591         * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
2592         GNATprove modes.
2594 2018-05-30  Justin Squirek  <squirek@adacore.com>
2596         * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
2597         Add implementation.
2598         (Start_Search): Modify to use Start_Search_Internal
2599         (Start_Search_Internal): Add to break out an extra flag for searching
2600         case insensative due to the potential for directories within the same
2601         OS to allow different casing schemes.
2602         * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
2603         for when the more precise solution fails.
2605 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2607         * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
2608         Minor reformatting.
2610 2018-05-30  Pascal Obry  <obry@adacore.com>
2612         * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
2613         * libgnat/g-comlin.adb: Add corresponding implementation.
2615 2018-05-30  Gary Dismukes  <dismukes@adacore.com>
2617         * sem_res.adb, sem_util.adb: Fix several typos.
2619 2018-05-30  Olivier Hainque  <hainque@adacore.com>
2621         * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
2622         (eh_registration_ctors, eh_registration_tors): New static variables,
2623         forced in a .ctors/.dtors section, respectively, with priority.
2625 2018-05-30  Bob Duff  <duff@adacore.com>
2627         * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
2628         freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
2629         sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
2630         sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
2631         sinfo.ads: Spell preanalysis, preanalyze correctly.
2633 2018-05-30  Bob Duff  <duff@adacore.com>
2635         * libgnat/g-sestin.ads: Rework documentation comments.
2637 2018-05-30  Piotr Trojanek  <trojanek@adacore.com>
2639         * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
2640         sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
2641         (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
2643 2018-05-30  Piotr Trojanek  <trojanek@adacore.com>
2645         * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
2647 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2649         * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
2650         in a separate routine.
2651         (Is_Atomic_Object_Entity): New routine.
2652         (Is_Atomic_Prefix): Cleaned up.
2653         (Is_Synchronized_Object): Check that the object is atomic, or its type
2654         is atomic.
2655         (Object_Has_Atomic_Components): Removed.
2656         * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
2657         (Is_Atomic_Object_Entity): New routine.
2659 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2661         * sem_ch3.adb (Access_Subprogram_Declaration): The flag
2662         Needs_Activation_Record is only needed on a subprogram type, not on a
2663         pointer to such.
2664         * sem_res.adb (Resolve_Selected_Component): If the context type and the
2665         component type are anonymous access to subprograms, use the component
2666         type to obtain the proper value of Needs_Activation_Record flag for the
2667         expression.
2669 2018-05-30  Eric Botcazou  <ebotcazou@adacore.com>
2671         * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
2672         comment about the memset case.
2674 2018-05-30  Bob Duff  <duff@adacore.com>
2676         * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
2677         to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
2678         We need to analyze it as part of analyzing the block, so that if the
2679         call to Element that initializes Elmt_Decl returns on the secondary
2680         stack, the block will ss_mark/ss_release. This block is inside the
2681         loop; we don't want to leak memory until the loop exits.  The purpose
2682         of analyzing Elmt_Decl first was to catch the error of modifying it,
2683         which is illegal because it's a loop parameter. The above causes us to
2684         miss that error.  Therefore, we add a flag Is_Loop_Parameter, and set
2685         it on the Element entity, so we end up with an E_Variable node with the
2686         flag set.
2687         * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
2688         * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
2689         parameter not allowed" error if Is_Loop_Parameter.
2690         * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
2691         trigger the call to Diagnose_Non_Variable_Lhs.
2693 2018-05-30  Arnaud Charlet  <charlet@adacore.com>
2695         * checks.adb (Apply_Scalar_Range_Check):
2696         * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
2697         range values for System.Priority in CodePeer mode since the actual
2698         target compiler may provide a wider range.
2700 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2702         * exp_unst.adb: Search specification of main unit as well, for
2703         unnesting.
2705 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2707         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
2708         a package body that is a compilation unit may contain blocks that
2709         declare local subprograms.  In Subprogram_Unnesting Mode such
2710         subprograms must be handled as nested inside the (implicit) elaboration
2711         procedure that executes that statement part. To handle properly uplevel
2712         references we construct that subprogram explicitly, to contain blocks
2713         and inner subprograms, The statement part of the compilation unit
2714         becomes a call to this subprogram. This is only done if blocks are
2715         present in the statement list of the body.
2717 2018-05-30  Bob Duff  <duff@adacore.com>
2719         * exp_ch7.adb: Minor comment fix.
2721 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2723         * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
2724         that have no corresponding body and appear as attributes of the
2725         corresponding wrapper package declaration.
2726         (Register_Subprogram): New subprogram, used for subprogram bodies and
2727         for subprogram instantiations to enter callable entity into Subp table.
2729 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2731         * libgnat/s-secsta.adb: Reimplement the secondary stack support.
2732         * libgnat/s-secsta.ads: Update the documentation of all routines in the
2733         public part of the package.  Reimplement the private part of the
2734         package to account for the new secondary stack structure.  Add types
2735         and subprograms for testing purposes.  Add several documentation
2736         sections.
2738 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2740         * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
2741         exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
2742         libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
2743         sem_disp.ads, sem_util.adb: Minor reformatting.
2745 2018-05-30  Arnaud Charlet  <charlet@adacore.com>
2747         * gcc-interface/Makefile.in: Move special flags for Ada runtime files
2748         from here...
2749         * Makefile.rtl: ... to here.  Update comments.  Protect call to
2750         "GCC_FOR_TARGET" in case target_os isn't defined.
2752 2018-05-30  Arnaud Charlet  <charlet@adacore.com>
2754         * gcc-interface/Makefile.in: Move target pair settings from here...
2755         * Makefile.rtl: ... to here.
2756         (setup-rts): New target.
2758 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2760         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
2761         List of All Switches): Replace "modules" with "units".
2762         (Subprogram Inlining Control): Likewise.
2763         * gnat_ugn.texi: Regenerate.
2764         * usage.adb (Usage): Fix description of -gnatn switch.
2766 2018-05-29  Arnaud Charlet  <charlet@adacore.com>
2768         * gcc-interface/Makefile.in: Fix typos.
2770 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2772         * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
2773         the finalizer procedure in the At_End handler, for use in LLVM
2774         generation.
2776 2018-05-29  Javier Miranda  <miranda@adacore.com>
2778         * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
2779         subprogram Inherits_From_Tagged_Full_View to identify more reliably
2780         untagged private types completed with a derivation of an untagged
2781         private whose full view is a tagged type.
2782         * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
2783         subprogram.
2784         (Collect_Primitive_Operations): Handle untagged private types completed
2785         with a derivation of an untagged private type whose full view is a
2786         tagged type. In such case, collecting the list of primitives we may
2787         find two equality primitives: one associated with the untagged private
2788         and another associated with the ultimate tagged type (and we must
2789         remove from the returned list this latter one).
2791 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2793         * exp_unst.adb (Visit_Node): Handle statement sequences that include an
2794         At_End handler.
2796 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2798         * repinfo.adb (List_Entities): Also recurse into blocks without label.
2800 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2802         * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
2803         exceptions if subprogram unnesting is in effect, because these branch
2804         nodes are relevant only in the presence of nested subprograms.
2806 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2808         * libgnat/s-fatgen.adb (Succ, Pred):  Raise Constraint_Error
2809         unconditionally when applied to the largest positive (resp. largest
2810         negative) value of a floating-point type.
2812 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2814         * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
2815         discriminants and exceptions are never components of such.  The flag
2816         Needs_Activation_Record is set on subprogram types, not on access to
2817         them.
2819 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2821         * sem_ch3.adb: Set scope of component of subtype.
2823 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2825         * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
2826         carry no type. Such selected components appear in unit names that are
2827         child units, both in the specification and possibly in an end label for
2828         the unit, and they do not contain any relevant uplevel references.
2830 2018-05-29  Arnaud Charlet  <charlet@adacore.com>
2832         * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
2833         function.
2835 2018-05-29  Olivier Hainque  <hainque@adacore.com>
2837         * libgnat/system-vxworks7-ppc-rtp.ads: New file.
2838         * libgnat/system-vxworks7-ppc-kernel.ads: New file.
2839         * libgnat/system-vxworks7-e500-rtp.ads: New file.
2840         * libgnat/system-vxworks7-e500-kernel.ads: New file.
2841         * libgnat/system-vxworks7-x86-rtp.ads: New file.
2842         * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
2843         * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
2844         gnat-crtbe link spec to use the vx7 variant.
2846 2018-05-29  Olivier Hainque  <hainque@adacore.com>
2848         * vx_crtbegin.inc: Use a consistent naming convention for the
2849         registration/deregistration functions across RTP or kernel.  Remove the
2850         ctor/dtor attribute setting based on RTP/kernel, expect the optional
2851         attribute extension to be provided by includers instead.
2852         * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
2853         extension for the registration/deregistration functions.
2854         * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
2855         constructor/destructor attribute extensions.
2856         * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
2857         attribute extensions and declare _ctors/_dtors arrays.
2858         * vx_crtbegin_auto.c: Remove.
2859         * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
2860         vxworks7-gnat-crtbe-link.spec.
2861         * libgnat/system-vxworks7-aarch64.ads: Likewise.
2862         * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
2863         * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
2864         * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
2865         * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
2866         * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
2867         * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
2868         * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
2870 2018-05-29  Piotr Trojanek  <trojanek@adacore.com>
2872         * ali.adb: Minor reformatting.
2874 2018-05-29  Joel Brobecker  <brobecker@adacore.com>
2876         * doc/gnat_ugn/platform_specific_information.rst: Update package
2877         requirements for 32bit GNAT on x86_64-linux.
2878         * gnat_ugn.texi: Regenerate.
2880 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2882         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
2883         Control): Adjust description of -gnatRj.
2884         * gnat_ugn.texi: Regenerate.
2885         * opt.ads (List_Representation_Info_To_JSON): Likewise.
2886         * repinfo.adb (List_Rep_Info): Do not automatically create a file
2887         if List_Representation_Info_To_JSON is true.
2888         * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
2889         check between -gnatRj and -gnatRs.
2890         * usage.adb (Usage): Adjust description of -gnatRj.
2892 2018-05-29  Pascal Obry  <obry@adacore.com>
2894         * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
2895         the root directory.
2897 2018-05-29  Pascal Obry  <obry@adacore.com>
2899         * libgnat/s-os_lib.adb: Minor reformatting.
2901 2018-05-29  Doug Rupp  <rupp@adacore.com>
2903         * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
2904         * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
2905         * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
2906         * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
2908 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2910         * repinfo.ads (JSON format): Document new pair for components.
2911         * repinfo.adb (Derived_Discriminant): New function.
2912         (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
2913         in recursive calls. If the record type is the parent of an extension,
2914         find and list the derived discriminant from the extension, if any.
2915         (List_Component_Layout): List the Discriminant_Number in JSON mode.
2916         (List_Record_Info): Adjust call to List_Structural_Record_Layout.
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): Document -gnatRj.
2922         (Debugging Control): Likewise.
2923         * gnat_ugn.texi: Regenerate.
2924         * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
2925         * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
2926         extension if List_Representation_Info_To_JSON is true.
2927         * repinfo.ads: Document the JSON output format.
2928         * repinfo.adb (List_Location): New procedure.
2929         (List_Array_Info): Add support for JSON output.
2930         (List_Entities): Likewise.
2931         (Unop): Likewise.
2932         (Binop): Likewise.
2933         (Print_Expr): Likewise.
2934         (List_Linker_Section): Likewise.
2935         (List_Mechanisms): Likewise.
2936         (List_Name): Likewise.
2937         (List_Object_Info): Likewise.
2938         (List_Record_Info): Likewise.
2939         (List_Component_Layout): Likewise.  Add Indent parameter.
2940         (List_Structural_Record_Layout): New procedure.
2941         (List_Attr): Add support for JSON output.
2942         (List_Type_Info): Likewise.
2943         (Write_Unknown_Val): Likewise.
2944         * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
2945         * usage.adb (Usage): List -gnatRj.
2947 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2949         * repinfo.adb (List_Component_Layout): New procedure extracted from...
2950         (List_Record_Layout): ...here.  Invoke it.
2952 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2954         * repinfo.adb (Write_Unknown_Val): New procedure.
2955         (List_GCC_Expression): Call it.
2956         (List_Record_Layout): Likewise.
2957         (Write_Val): Likewise.
2959 2018-05-29  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2961         * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
2962         code to do check.
2964 2018-05-29  Arnaud Charlet  <charlet@adacore.com>
2966         * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
2967         This breaks build of cross compilers with older versions of GNAT, so
2968         better avoid it.
2970 2018-05-29  Doug Rupp  <rupp@adacore.com>
2972         * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
2973         reflect reality.
2975 2018-05-29  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2977         * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
2979 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2981         * repinfo.adb (List_Entities): Do not list the Linker_Section for
2982         subprograms here...
2983         (List_Mechanisms): ...but here instead.  Use consistent name output
2984         and formatting conventions.
2986 2018-05-29  Bob Duff  <duff@adacore.com>
2988         * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
2989         To_Lower function.
2990         * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
2991         To_Mixed): New functions.
2992         * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
2993         allows both '\' and '/' on Windows.
2995 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
2997         * repinfo.ads: Minor fixes and tweaks in comments.
2999 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3001         * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
3002         it with calls to Unop.
3004 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3006         * repinfo.ads (TCode): Adjust range.
3007         (Truth_Andif_Expr): Remove.
3008         (Truth_Orif_Expr): Likewise.
3009         (Truth_And_Expr .. Dynamic_Val): Adjust value.
3010         * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
3011         (Rep_Value): Likewise.
3012         * repinfo.h (Truth_Andif_Expr): Remove.
3013         (Truth_Orif_Expr): Likewise.
3014         (Truth_And_Expr .. Dynamic_Val): Adjust value.
3015         * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
3016         through to TRUTH_AND_EXPR case.
3017         <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
3019 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3021         * exp_unst.adb (Visit_Node): For indexed components and attribute
3022         references, examine index expressions or associated expressions as well
3023         to record uplevel references.
3024         (Vist_Node): For function and procedure calls, if a formal is an
3025         unconstrained array and the actual is constrained, check whether bounds
3026         of actual have uplevel references.
3028 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3030         * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
3031         they can appear as components of activation records.
3032         * exp_unst.adb (Visit_Node): A reference to an exception may be an
3033         uplevel reference.
3035 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3037         * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
3038         depends on a discriminant manually instead of using the predicate
3039         Size_Depends_On_Discriminant in the array type case.
3041 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3043         * exp_unst.adb (Check_Static_Type): For a record subtype, check
3044         discriminant constraints as well.
3045         (Visit_Node): For a selected component, check type of prefix, as is
3046         done for indexed components and slices.
3048 2018-05-28  Javier Miranda  <miranda@adacore.com>
3050         * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
3051         value when converting a float value to a fixed-point value. This is
3052         required for CCG because it handles fixed-point types by means of
3053         unsigned integer type variables. The range check is now performed using
3054         the integer value stored in this temporary.
3056 2018-05-28  Yannick Moy  <moy@adacore.com>
3058         * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
3059         Length as valid non-interfering contexts for SPARK.
3061 2018-05-28  Claire Dross  <dross@adacore.com>
3063         * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
3064         generic inheritance utilities.
3065         (Generic_Inherited_Subprograms): Generic version of
3066         Inherited_Subprograms, generic in Find_Dispatching_Type function.
3067         (Generic_Is_Overriding_Subprogram): Generic version of
3068         Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
3069         (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
3070         Sem_Disp.Find_Dispatching_Type.
3071         (Is_Overriding_Subprogram): Instance of
3072         Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
3073         (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
3074         with Sem_Disp.Find_Dispatching_Type.
3076 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3078         * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
3079         component type, do not expand array equality using the unconstrained
3080         base type, except for the case where the bounds of the type depend on a
3081         discriminant.
3083 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3085         * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
3086         access-to-subprogram types, to indicate that an indirect call through
3087         such a type requires an activation record when compiling for LLVM.
3088         * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
3090 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3092         * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
3093         when bounds of fixed type are static, to remove some spuerfluous
3094         implicit conversions and provide an accurate result when converting
3095         back and forth between the fixed point type and a floating point type.
3097 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3099         * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
3100         activation records.
3102 2018-05-28  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3104         * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
3105         replaced, if any; all callers changed.
3106         (Note_Uplevel_Ref): Likewise.  Also replace reference to deferred
3107         constant with private view so we take the address of that entity.
3108         (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
3109         any; all callers changed.  Handle N_Indexed_Component like
3110         N_Attribute_Reference.  Add N_Type_Conversion case.
3111         (Visit_Node): Indexed references can be uplevel if the type isn't
3112         static.
3113         (Unnest_Subprograms): Don't rewrite if no reference given.  If call has
3114         been relocated, set first_named pointer in original node as well.
3116 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3118         * exp_aggr.adb (Flatten): Copy tree of expression in a component
3119         association with a range or a set of discrete choices, rather than
3120         relocating the node. This avoids inconsistencies in the tree when
3121         handling nested subprograms with uplevel references for LLVM.
3123 2018-05-28  Arnaud Charlet  <charlet@adacore.com>
3125         * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
3126         codepeer mode.
3128 2018-05-28  Arnaud Charlet  <charlet@adacore.com>
3130         * exp_unst.adb: Fix typo.
3132 2018-05-28  Bob Duff  <duff@adacore.com>
3134         * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
3135         unnecessary use of 'Unrestricted_Access.
3137 2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>
3139         * repinfo.adb (Expr_Value_S): New routine.
3140         (List_Linker_Section): Properly extract the value of the section
3141         argument.
3143 2018-05-28  Patrick Bernardi  <bernardi@adacore.com>
3145         * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
3146         description of the -D binder switch to reflect current usage.
3147         * gnat_ugn.texi: Regenerate.
3149 2018-05-28  Gary Dismukes  <dismukes@adacore.com>
3151         * exp_ch3.adb: Minor reformatting
3153 2018-05-28  Justin Squirek  <squirek@adacore.com>
3155         * exp_ch3.adb
3156         (Build_Initialization_Call): Add logic to pass the appropriate actual to match
3157          new formal.
3158         (Init_Formals): Add new formal *_skip_null_excluding_check
3159         * exp_util.adb, exp_util.ads
3160         (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
3161          scope.
3162         (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
3163         (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
3164          used to determine how to generate an Init_Proc for a given type.
3165         (Needs_Constant_Address): Minor reformatting
3166         * sem_res.adb
3167         (Resolve_Null): Add logic to generate a conditional check in certain cases
3169 2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>
3171         * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
3172         Minor reformatting.
3174 2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>
3176         * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
3177         the declarations of single concurrent types because they fall in the
3178         category of full type and object declarations.
3180 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3182         * repinfo.adb (Compute_Max_Length): Skip _Parent component.
3183         (List_Record_Layout): Likewise.
3185 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3187         * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
3188         includes a call to function to which it applies. This may mean an
3189         omission of an attribute reference 'Result, in particular if the
3190         function is pqrameterless.
3192 2018-05-28  Justin Squirek  <squirek@adacore.com>
3194         * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
3195         misresolved package name is not a case of mistaken identity.
3197 2018-05-28  Yannick Moy  <moy@adacore.com>
3199         * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
3200         GNATprove mode, as the order of resolution (low then high) means that
3201         all the information is not available when resolving the low bound the
3202         first time.
3204 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3206         * repinfo.adb (List_Array_Info): Start with an explicit blank line and
3207         end with the linker section, if any.
3208         (List_Entities): Do not output the linker section for record types,
3209         array types and variables.
3210         (Print_Expr): Factor out common processing for unary operators and
3211         special values.  Adjust and reorder the various cases.
3212         (List_Object_Info): End with the linker section, if any.
3213         (List_Record_Info): Likewise.
3214         (List_Type_Info): Do not start with a blank line.
3216 2018-05-25  Nicolas Roche  <roche@adacore.com>
3218         * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
3219         that the result will be either -infinite or +infinite.
3221 2018-05-25  Patrick Bernardi  <bernardi@adacore.com>
3223         * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
3224         libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
3225         Expand range of type to match the address space of the target.
3226         (Task_Storage_Size): Remove unused type.
3228 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3230         * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
3231         of a fixed point type and the parent is a multiplying operation,
3232         resolve the operand with its own type because the context will impose a
3233         resulting type on the result of the multiplication by means of
3234         approriate conversion.
3236 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
3238         * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
3239         the in-place initialization aggregate created for pragmas
3240         Initialize_Scalars or Normalize_Scalars is performed with checks
3241         suppressed.
3243 2018-05-25  Arnaud Charlet  <charlet@adacore.com>
3245         * exp_aggr.adb (Convert_To_Positional): Bump default for
3246         Max_Others_Replicate to 32. Update comments.
3247         * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
3248         (No_File_Info_Cache): Initialize separately.
3249         * osint.adb (No_File_Info_Cache): Update initializer.
3251 2018-05-25  Javier Miranda  <miranda@adacore.com>
3253         * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
3254         test when the left operand is a class-wide interface and the right
3255         operand is not a class-wide type.
3256         * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
3257         left operand.
3259 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3261         * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
3262         in an others clause to prevent visibility issues with the generated
3263         loop variable.
3264         (Component_OK_For_Backend): Return false for a quantified expression.
3265         (Check_Static_Component): Ditto.
3267 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
3269         * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
3270         (SS_Allocate_Dynamic): New routine. The allocation logic is now split
3271         into three distring cases rather than in one loop which attempts to
3272         handle all three cases. This rewrite eliminates an issue where the last
3273         frame of the stack cannot be freed, thus causing the memory range of a
3274         new frame to approach the overflow point of the memory index type.
3275         Since the overflow is logically treated as a
3276         too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
3277         (SS_Allocate_Static): New routine. The routine factorizes the static
3278         secondary stack-related code from the former SS_Allocate.
3280 2018-05-25  Sergey Rybin  <rybin@adacore.com>
3282         * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
3283         option for gnatelim.
3285 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3287         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
3288         Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
3289         is created when the proper body of the stub is analyzed.
3290         * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
3291         is the proper body of a subunit, the cloned body must be inserted in
3292         the declarative list that contains the stub.
3294 2018-05-25  Justin Squirek  <squirek@adacore.com>
3296         * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
3297         generate code for 6.5(8-10) so that we don't get an assertion error
3298         when dealing with an incomplete return type.
3300 2018-05-25  Arnaud Charlet  <charlet@adacore.com>
3302         * pprint.adb (Expression_Name): Strip too long expressions to avoid
3303         carrying very large strings.
3305 2018-05-25  Patrick Bernardi  <bernardi@adacore.com>
3307         * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
3308         numbers.
3310 2018-05-25  Doug Rupp  <rupp@adacore.com>
3312         * tracebak.c (aarch64-linux): Implement.
3314 2018-05-25  Justin Squirek  <squirek@adacore.com>
3316         * sem_ch8.adb: Minor reformatting.
3318 2018-05-25  Piotr Trojanek  <trojanek@adacore.com>
3320         * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
3321         assertions.
3323 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
3325         * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
3326         pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
3327         Minor reformatting.
3329 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3331         * sem_ch12.adb (Instance_Exists): New function, subsidiary of
3332         Validate_Derived_Type_Instance, to verify that all interfaces
3333         implemented by the formal type are also implemented by the actual. The
3334         verification is complicated when an interface of the formal is declared
3335         in a generic unit and the actual is declared in an instance of it.
3336         There is currently no mechanism to relate an interface declared within
3337         a generic to the corresponding interface in an instance, so we must
3338         traverse the list of interfaces of the actual, looking for a name
3339         match, and verifying that that interface is declared in an instance.
3341 2018-05-25  Piotr Trojanek  <trojanek@adacore.com>
3343         * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
3344         assertions; replace function versions of Next_Formal/Next_Actual with
3345         their procedural versions (which are more concise).
3347 2018-05-25  Doug Rupp  <rupp@adacore.com>
3349         * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
3350         libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
3351         libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
3352         libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
3353         libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
3354         (Relative_Timed_Wait): Remove.
3355         * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
3356         for incremental looping. Remove references to Rel_Time and
3357         Relative_Timed_Wait.
3358         * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
3359         (Timed_Delay): Make separate.
3360         * libgnat/s-optide.adb: New separate procedure.
3361         * libgnat/s-osprim.ads (Max_System_Delay): New constant.
3362         * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
3363         (Max_System_Delay): New constant.
3365 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3367         * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
3368         for a formal derived type implements all the interfaces declared for
3369         the formal.
3371 2018-05-25  Yannick Moy  <moy@adacore.com>
3373         * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
3374         and GNATprove modes when applicable policy is Ignore.
3376 2018-05-25  Eric Botcazou  <ebotcazou@adacore.com>
3378         * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
3379         boolean type with convention C.
3380         * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
3381         * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
3382         FOREIGN and use it throughout the function.
3383         <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
3384         convention.
3385         <E_Enumeration_Subtype>: Likewise for subtypes.
3386         <E_Record_Type>: Force the size of a storage unit on empty classes.
3387         * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
3388         boolean types with precision 1 if the size is the expected one.
3390 2018-05-25  Arnaud Charlet  <charlet@adacore.com>
3392         * pprint.adb (Expression_Name): Do not print non ASCII characters.
3394 2018-05-25  Bob Duff  <duff@adacore.com>
3396         * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
3397         libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
3399 2018-05-25  Bob Duff  <duff@adacore.com>
3401         * sem_util.ads: Minor comment fix.
3403 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3405         * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
3406         prefixes of array attributes, to prefixes that are entity names whose
3407         type is constrained.
3408         (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
3409         subprogram, as itype created for loops in pre/postcondition may appear
3410         in loops at the library level.
3412 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3414         * sem_ch13.adb (Build_Predicate_Functions): The predicate function
3415         declaration is inserted into the tree and analyzed at that point, so
3416         should not be reinserted when the body is constructed. Inside a
3417         generic, ensure that the body is not inserted twice in the tree.
3419 2018-05-25  Yannick Moy  <moy@adacore.com>
3421         * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
3422         declarations not coming from source.
3424 2018-05-25  Fedor Rybin  <frybin@adacore.com>
3426         * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
3427         --copy-environment for gnattest.
3429 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3431         * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
3432         variable.
3433         * sem_prag.adb (Get_Base_Subprogram): Same as above.
3435 2018-05-24  Eric Botcazou  <ebotcazou@adacore.com>
3437         * fe.h (Set_Normalized_First_Bit): Declare.
3438         (Set_Normalized_Position): Likewise.
3439         * repinfo.adb (List_Record_Layout): Do not use irregular output for a
3440         variable position.  Fix minor spacing issue.
3441         * gcc-interface/decl.c (annotate_rep): If a field has a variable
3442         offset, compute the normalized position and annotate it in addition to
3443         the bit offset.
3445 2018-05-24  Eric Botcazou  <ebotcazou@adacore.com>
3447         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
3448         Constify and rename variables.  Fix formatting.
3449         (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
3450         <N_Raise_Statement>: Likewise.
3452 2018-05-24  Javier Miranda  <miranda@adacore.com>
3454         * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
3455         body of a variant record equality renaming.
3456         (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
3457         implementation of Build_Body_For_Renaming.
3458         * exp_ch3.ads (Build_Variant_Record_Equality): New library level
3459         function that factorizes the functionality needed by
3460         Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
3461         of a variant record equality subprogram.
3462         * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
3463         (Build_Variant_Record_Equality): New local procedure of
3464         Expand_Freeze_Record_Type containing all the code specific for freezing
3465         the record type that cannot be place in the new library level function.
3467 2018-05-24  Ed Schonberg  <schonberg@adacore.com>
3469         * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
3470         in_parameters, used when unesting subprograms for LLVM, to indicate
3471         that a generated parameter carries the activation record from the
3472         enclosing subprogram.
3473         * exp_unst.adb (Check_Static_Type): Handle array attributes of types
3474         whose bounds may contain up-level references that need to be added to
3475         an activation recoord.
3476         (Add_Extra_Formal): Set Is_Activation_Record on new formal.
3478 2018-05-24  Yannick Moy  <moy@adacore.com>
3480         * pprint.adb (Expression_Image): Improve the printing of expressions,
3481         by taking more cases into account, in particular qualified expressions
3482         and aggregates.  Also count more the number of parentheses to close
3483         after the expression.
3485 2018-05-24  Javier Miranda  <miranda@adacore.com>
3487         * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
3488         check for renamed discriminants.
3489         * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
3490         Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
3491         Is_Visible_Component pass the associated selector node to allow
3492         checking renamed discriminants on untagged types.
3494 2018-05-24  Ed Schonberg  <schonberg@adacore.com>
3496         * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
3497         link to a use_type clause if this would cause an infinite loop in the
3498         machinery that detects redundant use clauses. This may happen when the
3499         redundant clauses appear in the context of a child unit and the context
3500         of its parent.
3502 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3504         * sinfo.ads: Fix grammar in comment.
3506 2018-05-24  Justin Squirek  <squirek@adacore.com>
3508         * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
3509         and manage doubly-linked entity chain.
3510         (Nested_Scenarios): Removed entity field used for optimization during
3511          elaboration to make room for the new field Prev_Entity.
3512         (Link_Entities): Added to replace redundant calls to Set_Next_Entity
3513         and Set_Prev_Entity as well as centralize changes to the entity chain.
3514         (Predicated_Parent): Modified to use Node38.
3515         (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
3516         types.
3517         (Remove_Entity): Moved from sem_util.
3518         (Set_Nested_Scenarios): Deleted.
3519         (Set_Predicated_Parent): Modified to use Node38.
3520         (Set_Prev_Entity): Added to set Prev_Entity field.
3521         (Set_Validated_Object): Modified to use Node38.
3522         (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
3523         action is required.
3524         (Validated_Object): Modified to use Node38.
3525         (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
3526         predicated parent cases.
3527         (Write_Field38_Name): Add predicated parent and Validated_Object cases.
3528         * sem_ch3.adb (Process_Subtype): Add guard to protect against
3529         inappropriate marking of Predicated_Parent to non-itype subtypes.
3530         (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
3531         (Copy_And_Swap): Add setting of Prev_Entity.
3532         (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
3533         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
3534         w/ Link_Entities.
3535         (New_Overloaded_Entity): Remove block created to search for previous
3536         entities in the entity chain with relevant calls to Prev_Entity as well
3537         as replace duplicated code from Remove_Entity_And_Homonym with a call
3538         to that subprogram.
3539         * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
3540         Link_Entities.
3541         * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
3542         initial subprogram declarations related to Nested_Scenarios.
3543         (Process_Nested_Scenarios): Deleted.
3544         (Save_Scenario): Deleted.
3545         (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
3546         node space in the entity tree.
3547         * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
3548         (Remove_Entity_And_Homonym): Added to separate functionality of
3549         Remove_Entity from the homonym chain directly.
3550         * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
3551         w/ Link_Entities and Unlink_Next_Entity.
3552         * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
3553         Link_Entities.
3554         * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
3555         Set_Next_Entity w/ Link_Entities.
3556         * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
3557         Link_Entities and Unlink_Next_Entity.
3558         * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
3559         call to Remove_Entity with its new incarnation.
3560         * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
3561         * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
3562         Link_Entities.
3564 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3566         * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
3567         Install_Limited_Withed_Unit.
3568         (Expand_With_Clause): Update the call to Install_Withed_Unit.
3569         (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
3570         (Install_Context_Clauses): Update the call to Install_Withed_Unit.
3571         (Install_Limited_Context_Clauses): Update the calls to
3572          Install_Limited_Withed_Unit.
3573         (Install_Limited_Withed_Unit): Renamed to better illustrate its
3574         purpose.
3575         (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
3576         and Install_Limited_Withed_Unit.
3577         (Install_With_Clause): Uninstall a limited with clause if a [private]
3578         with clause is given for the same package.
3579         (Install_Withed_Unit): Renamed to better illustrate its purpose.
3580         (Remove_Limited_With_Unit): New routine.
3582 2018-05-24  Eric Botcazou  <ebotcazou@adacore.com>
3584         * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
3585         (__gnat_personality_seh0): Adjust and beef up comments, and
3586         fix formatting throughout.
3587         (__gnat_adjust_context): Deal minimally with version 2.
3588         * seh_init.c (__gnat_map_SEH): Fix formatting.
3589         (_gnat_SEH_error_handler): Adjust comments.
3590         (__gnat_install_SEH_handler): Fix formatting.
3592 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3594         * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
3596 2018-05-24  Ed Schonberg  <schonberg@adacore.com>
3598         * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
3599         aggregate with static bounds when named associations cover all index
3600         positions and the others clause is redundant.
3602 2018-05-24  Raphael Amiard  <amiard@adacore.com>
3604         * libgnat/a-cohama.ads: Add documentation.
3606 2018-05-24  Raphael Amiard  <amiard@adacore.com>
3608         * libgnat/a-convec.ads: Add documentation.
3610 2018-05-24  Justin Squirek  <squirek@adacore.com>
3612         * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
3613         expansion for limited tagged types when the node to be expanded is a
3614         raise expression due to it not representing a valid object.
3615         * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
3616         message regarding assignments to limited types to ignore genereated
3617         code.
3619 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3621         * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
3622         Ghost-related attributes of the class-wide subtype because the copy
3623         clobbers them.
3625 2018-05-24  Justin Squirek  <squirek@adacore.com>
3627         * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
3628         marking use clauses as effective when the reference appears within
3629         generated code.
3631 2018-05-24  Cyrille Comar  <comar@adacore.com>
3633         * doc/gnat_rm/the_gnat_library.rst: Fix typos.
3634         * gnat_rm.texi: Regenerate.
3636 2018-05-24  Bob Duff  <duff@adacore.com>
3638         * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
3639         for build-in-place functions with a caller-unknown-size result.
3640         (Create_Finalizer): For build-in-place functions with a
3641         caller-unknown-size result, check at run time whether we need to
3642         release the secondary stack.
3644 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3646         * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
3647         generated incomplete type.
3649 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3651         * expander.adb (Expand): Update the save and restore of the Ghost
3652         region.
3653         * exp_ch3.adb (Freeze_Type): Likewise.
3654         * exp_disp.adb (Make_DT): Likewise.
3655         * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
3656         (Build_DIC_Procedure_Declaration): Likewise.
3657         (Build_Invariant_Procedure_Body): Likewise.
3658         (Build_Invariant_Procedure_Declaration): Likewise.
3659         (Make_Predicate_Call): Likewise.
3660         * freeze.adb (Add_To_Result): Insert the freeze action of a living
3661         entity prior to the start of the enclosing ignored Ghost region.
3662         (Freeze_Entity): Update the save and restore of the Ghost region.
3663         * ghost.adb (Install_Ghost_Mode): Reimplemented.
3664         (Install_Ghost_Region): New routine.
3665         (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
3666         (Mark_And_Set_Ghost_Body): Likewise.
3667         (Mark_And_Set_Ghost_Completion): Likewise.
3668         (Mark_And_Set_Ghost_Declaration): Likewise.
3669         (Mark_And_Set_Ghost_Instantiation): Likewise.
3670         (Mark_And_Set_Ghost_Procedure_Call): Likewise.
3671         (Name_To_Ghost_Mode): New routine.
3672         (Restore_Ghost_Region): New routine.
3673         * ghost.ads (Install_Ghost_Region): New routine.
3674         (Restore_Ghost_Region): New routine.
3675         * opt.ads: Add new global variable Ignored_Ghost_Region.
3676         * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
3677         region. Install a clean region.
3678         * sem.adb (Analyze): Likewise.
3679         (Do_Analyze): Likewise.
3680         * sem_ch3.adb (Analyze_Object_Declaration): Likewise
3681         (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
3682         capture the ultimate alias of the current primitive.
3683         (Process_Full_View): Update the save and restore of the Ghost region.
3684         Do not inherit DIC and invariant procedures.
3685         * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
3686         Ghost region.
3687         * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
3688         (Analyze_Subprogram_Body_Helper): Likewise.
3689         * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
3690         * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
3691         (Analyze_Subprogram_Instantiation): Likewise.
3692         (Instantiate_Package_Body): Likewise.
3693         (Instantiate_Subprogram_Body): Likewise.
3694         * sem_ch13.adb (Build_Predicate_Functions): Likewise.
3695         (Build_Predicate_Function_Declaration): Likewise.
3696         * sem_disp.adb
3697         (Add_Dispatching_Operation): Do not consider DIC and invariant
3698         procedures.
3699         (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
3700         a dispatching subprogram.
3701         (Check_Operation_From_Private_View): Likewise.
3702         (Override_Dispatching_Operation): Likewise.
3703         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
3704         and restore of the Ghost region.
3705         (Analyze_Initial_Condition_In_Decl_Part): Likewise.
3706         (Analyze_Pragma): Update the save and restore of the Ghost region.
3707         (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
3708         * sem_util.adb (Is_Suitable_Primitive): New routine.
3709         * sem_util.ads (Is_Suitable_Primitive): New routine.
3710         * sinfo.ads: Update the section of Ghost regions.
3712 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3714         * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
3715         Change "condition" to "case guard" after renaming in the contract
3716         grammar.
3717         * gnat_rm.texi: Regenerate.
3719 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3721         * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
3722         construct with discrete choices no longer contains a subtype with
3723         predicates since the expansion already handled this case.
3725 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3727         * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
3728         conversion to the return type to avoid a side effect where an imported
3729         relocated function generates a new anonymous access type, whose
3730         accessibility level does not agree with with that of the wrapper.
3732 2018-05-24  Javier Miranda  <miranda@adacore.com>
3734         * sem_util.adb (Abstract_Interface_List): Add missing support for
3735         private types whose full view is a synchronized type.
3736         * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
3737         derivation of a private type parent type is a task type with
3738         discriminants as gigi does not use such type directly.
3740 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3742         * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
3743         variable marker when the reference appears in the formal part of a
3744         compilation unit instance because there is no place to insert it.
3745         (In_Compilation_Instance_Formal_Part): New routine.
3747 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3749         * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
3750         configuration parameter.
3752 2018-05-24  Doug Rupp  <rupp@adacore.com>
3754         * argv-lynxos178-raven-cert.c: New file.
3755         * libgnat/system-lynxos178-x86.ads: New file.
3757 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3759         * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
3760         Minor reformattings.
3762 2018-05-23  Pascal Obry  <obry@adacore.com>
3764         * adaint.c (win32_wait): Properly free the handle/pid lists when
3765         WaitForMultipleObjects fails (return WAIT_FAILED).
3767 2018-05-23  Pascal Obry  <obry@adacore.com>
3769         * adaint.c (win32_wait): Add missing parentheses.
3771 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3773         * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
3774         (Expand_N_Object_Declaration): Do not check for a large modular array
3775         here.
3776         * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
3777         (Freeze_Object_Declaration): Code cleanup. Check for a large modular
3778         array.
3779         * sem_ch3.adb: Minor reformatting.
3781 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3783         * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
3784         retrieval of the applicable predicate function to an itype created for
3785         a constrained array component.
3786         * einfo.adb: Subprograms for Predicated_Parent.
3787         (Predicate_Function): Use new attribute.
3788         * exp_util.adb (Make_Predicate_Call): If the predicate function is not
3789         available for a subtype, retrieve it from the base type, which may have
3790         been frozen after the subtype declaration and not captured by the
3791         subtype declaration.
3792         * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
3793         legal within a generated initiqlization procedure, as may happen with a
3794         predicate check on a component, when the predicate function applies to
3795         the base type of the component.
3796         * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
3797         predicates for subtype declarations and for subtype indications in
3798         other contexts.
3799         (Process_Subtype): Likewise. Handle properly the case of a private type
3800         with unknown discriminants whose full view is an unconstrained array.
3801         Use Predicated_Parent to indicate source of predicate function on an
3802         itype whose parent is itself an itype.
3803         (Complete_Private_Subtype): If the private view has unknown
3804         discriminants and the full view is an unconstrained array, set base
3805         type of completion to the full view of parent.
3806         (Inherit_Predicate_Flags): Prevent double assignment of predicate
3807         function and flags.
3808         (Build_Subtype): For a constrained array component, propagate predicate
3809         information from original component type declaration.
3811 2018-05-23  Boris Yakobowski  <yakobowski@adacore.com>
3813         * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
3815 2018-05-23  Arnaud Charlet  <charlet@adacore.com>
3817         * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
3818         Hi.
3819         * sem_elab.adb: Make "out" parameters instead of "in out" when
3820         relevant.
3822 2018-05-23  Bob Duff  <duff@adacore.com>
3824         * gnatbind.adb (List_Applicable_Restrictions): Add
3825         No_Implementation_Restrictions to the list of restrictions not to list.
3826         Remove double negative "not No_Restriction_List".  Comment the
3827         commentary that is output, so it won't cause errors if used directly in
3828         a gnat.adc.
3830 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3832         * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
3833         class-wide precondition on a type extension when ancestor does not have
3834         a class-wide precondition.  Previously the compiler accepted such a
3835         precondition when the ancestor had a class-wide postcondition.
3837 2018-05-23  Javier Miranda  <miranda@adacore.com>
3839         * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
3840         the warning on occurrences of this attribute whose evaluation is always
3841         true (since that subprogram aborts processing the attribute). In
3842         addition, replace the node by its boolean result 'True' (required
3843         because the backend has no knowledge of this attribute).
3845 2018-05-23  Bob Duff  <duff@adacore.com>
3847         * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
3848         code in question is not reachable in the case where Count_Type'Last is
3849         out of range.
3851 2018-05-23  Yannick Moy  <moy@adacore.com>
3853         * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
3854         local pragma Warnings Off without On.
3855         * gnat_rm.texi: Regenerate.
3857 2018-05-23  Olivier Hainque  <hainque@adacore.com>
3859         * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
3860         * libgnat/g-excact.adb: Implement.
3862 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3864         * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
3865         is present, verify its legality when the domain of iteration is a
3866         GNAT-specific formal container, as is already done for arrays and
3867         predefined containers.
3869 2018-05-23  Yannick Moy  <moy@adacore.com>
3871         * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
3872         declaration, which was not taken into account.
3874 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3876         * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
3877         synchronized suspension.
3878         * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
3879         Ada.Synchronous_Task_Control and routines Suspend_Until_True and
3880         Wait_For_Release.
3881         * sem_elab.adb: Document switch -gnatd_s.
3882         (In_Task_Body): New routine.
3883         (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
3884         body when the current construct denotes a synchronous suspension call,
3885         and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
3886         is in effect.
3887         (Is_Synchronous_Suspension_Call): New routine.
3888         * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
3889         -gnatd_s.
3891 2018-05-23  Javier Miranda  <miranda@adacore.com>
3893         * exp_disp.adb (Make_DT): Restrict the initialization of
3894         External_Tag and Expanded_Name to an empty string to the case where
3895         both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
3896         restricted runtimes are compiled with pragma Discard_Names.
3897         * doc/gnat_rm/implementation_defined_pragmas.rst,
3898         doc/gnat_rm/implementation_defined_characteristics.rst: Add
3899         documentation.
3900         * gnat_rm.texi: Regenerate.
3902 2018-05-23  Maroua Maalej  <maalej@adacore.com>
3904         * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
3906 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3908         * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
3909         iteration of an Ada2012 loop is performed to determine the type of the
3910         domain, but full analysis is performed once the loop is rewritten as a
3911         while-loop during expansion. The pre-analysis suppresses expansion; it
3912         must also suppress the generation of freeze nodes, which may otherwise
3913         appear in the wrong scope before rewritting.
3915 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3917         * sem_elab.adb: Update the section on suppressing elaboration warnings.
3919 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3921         * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
3922         Is_Elaboration_Target.
3923         (Is_Elaboration_Target): New routine.
3924         (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
3925         (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
3926         (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
3927         Is_Elaboration_Target.
3928         * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
3929         with occurrences in nodes.
3930         (Is_Elaboration_Target): New routine.
3931         * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
3932         elaboration target is subject to pragma Warnings (Off, ...).
3934 2018-05-23  Eric Botcazou  <ebotcazou@adacore.com>
3936         * repinfo.adb (List_Type_Info): Remove obsolete stuff.
3938 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3940         * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
3941         (Is_Elaboration_Warnings_OK_Id): New routine.
3942         (Set_Is_Elaboration_Warnings_OK_Id): New routine.
3943         (Write_Entity_Flags): Output Flag304.
3944         * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
3945         occurrences in entities.
3946         (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
3947         (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
3948         Inline.
3949         * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
3950         elaboration warnings.
3951         * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
3952         elaboration warnings.
3953         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
3954         state of elaboration warnings.
3955         (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
3956         warnings.
3957         (Analyze_Subprogram_Declaration): Capture the state of elaboration
3958         warnings.
3959         * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
3960         elaboration warnings.
3961         (Analyze_Single_Task_Declaration): Capture the state of elaboration
3962         warnings.
3963         (Analyze_Task_Type_Declaration): Capture the state of elaboration
3964         warnings.
3965         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
3966         of elaboration warnings.
3967         (Analyze_Generic_Subprogram_Declaration): Capture the state of
3968         elaboration warnings.
3969         * sem_elab.adb: Add a section on suppressing elaboration warnings.
3970         Type Processing_Attributes includes component Suppress_Warnings
3971         intended to suppress any elaboration warnings along a path in the
3972         graph.  Update Initial_State to include a value for this component.
3973         Types Target_Attributes and Task_Attriutes include component
3974         Elab_Warnings_OK to indicate whether the target or task has elaboration
3975         warnings enabled.  component Elab_Warnings_OK.
3976         (Build_Access_Marker): Propagate attribute
3977         Is_Elaboration_Warnings_OK_Node from the attribute to the generated
3978         call marker.
3979         (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
3980         (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
3981         (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
3982         (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
3983         when already in this mode or when the attribute or target have warnings
3984         suppressed.
3985         (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
3986         if warnings are suppressed.
3987         (Process_Conditional_ABE_Call): Suppress further elaboration warnings
3988         when already in this mode, or the target or call have warnings
3989         suppressed.
3990         (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
3991         warnings are suppressed.
3992         (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
3993         warnings are suppressed.
3994         (Process_Conditional_ABE_Instantiation): Suppress further elaboration
3995         warnings when already in this mode or when the instantiation has
3996         warnings suppressed.
3997         (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
3998         diagnostics if warnings are suppressed.
3999         (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
4000         specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4001         (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
4002         specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4003         (Process_Task_Object): Suppress further elaboration warnings when
4004         already in this mode, or when the object, activation call, or task type
4005         have warnings suppressed. Update the processing state to indicate that
4006         the path goes through a task body.
4007         * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
4008         references.
4009         (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
4010         * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
4011         attribute references.
4013 2018-05-23  Piotr Trojanek  <trojanek@adacore.com>
4015         * einfo.ads: Minor reformatting.
4017 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
4019         * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
4020         anonymous_access_to_ subprogram formal, apply a conversion to force an
4021         accsssibility check that will fail statically, enforcing 3.10.2 (13).
4023 2018-05-23  Daniel Mercier  <mercier@adacore.com>
4025         * gnat1drv.adb: Turn off length expansion in CodePeer mode.
4027 2018-05-23  Bob Duff  <duff@adacore.com>
4029         * freeze.adb: (Check_Address_Clause): Deal with build-in-place
4030         aggregates in addition to build-in-place calls.
4032 2018-05-23  Bob Duff  <duff@adacore.com>
4034         * einfo.ads: Minor reformatting.
4035         * sem_ch3.adb: Likewise.
4036         * sinfo.ads: Likewise.
4038 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
4040         * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
4041         initialization when the component type has predicates.
4042         * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
4043         allocation when the component type has predicates.
4045 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
4047         * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
4048         Minor reformatting.
4050 2018-05-22  Justin Squirek  <squirek@adacore.com>
4052         * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
4053         original function spec into the generated function spec due to
4054         expansion of expression functions during analysis.
4055         (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
4056         references from the body to the subprogram spec in the case of
4057         expression functions because of inconsistances related to having a
4058         generated body.
4059         * libgnarl/s-osinte__android.ads: Flag parameters as unused.
4060         * libgnarl/s-osinte__lynxos178e.ads: Likewise.
4061         * libgnarl/s-osinte__qnx.adb: Likewise.
4062         * libgnarl/s-osinte__qnx.ads: Likewise.
4064 2018-05-22  Doug Rupp  <rupp@adacore.com>
4066         * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
4067         AArch64.
4069 2018-05-22  Olivier Hainque  <hainque@adacore.com>
4071         * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
4072         Expect an Exception_Occurence object, not an Access.
4073         (Complete_And_Propagate_Occurrence): Adjust accordingly.
4074         (Raise_From_Signal_Handler): Likewise.
4075         (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
4076         available in the provided occurrence object, just re-propagate the
4077         latter as a bare "raise;" would do.
4078         * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
4079         * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
4080         to null, to mark that the occurrence we're crafting from the stream
4081         contents is not being propagated (yet).
4083 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4085         * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
4086         code for a transient component in line with the rest of the
4087         initialization code, rather than before the aggregate. This ensures
4088         that the component has proper visibility of the discriminants.
4090 2018-05-22  Jerome Lambourg  <lambourg@adacore.com>
4092         * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
4093         number of CPUs.
4095 2018-05-22  Jerome Lambourg  <lambourg@adacore.com>
4097         * sigtramp-qnx.c: Properly restore link register in signal trampoline.
4099 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4101         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
4102         conversions before extracting the value of the expression.
4103         * exp_ch3.adb (Default_Initialize_Object): Optimize the default
4104         initialization of an array of scalars.
4105         (Get_Simple_Init_Val): Add processing for array types. Remove the
4106         processing of strings because this case is already handled by the array
4107         case.
4108         (Needs_Simple_Initialization): Moved to Sem_Util.
4109         (Simple_Init_Array_Type): New routine.
4110         (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
4111         facilities from Sem_Util.
4112         (Simple_Initialization_OK): New routine.
4113         * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
4114         * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
4115         an array of scalars.
4116         * sem_prag.adb (Analyze_Float_Value): New routine.
4117         (Analyze_Integer_Value): New routine.
4118         (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
4119         to handled the extended form of the pragma.
4120         (Analyze_Type_Value_Pair): New routine.
4121         * sem_util.adb: Add invalid value-related data structures.
4122         (Examine_Array_Bounds): New routine.
4123         (Has_Static_Array_Bounds): Reimplemented.
4124         (Has_Static_Non_Empty_Array_Bounds): New routine.
4125         (Invalid_Scalar_Value): New routine.
4126         (Needs_Simple_Initialization): Moved from Exp_Ch3.
4127         (Set_Invalid_Scalar_Value): New routines.
4128         * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
4129         (Invalid_Scalar_Value): New routine.
4130         (Needs_Simple_Initialization): Moved from Exp_Ch3.
4131         (Set_Invalid_Scalar_Value): New routines.
4132         * snames.ads-tmpl: Add names for the salar type families used by pragma
4133         Initialize_Scalars.
4135 2018-05-22  Javier Miranda  <miranda@adacore.com>
4137         * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
4138         string when pragma No_Tagged_Streams is applicable to the tagged type,
4139         and initialize the Expanded_Name with an empty string when pragma
4140         Discard_Names is applicable to the tagged type.
4142 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4144         * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
4145         formal subprogram is never subtype conformqnt, and thus cannot be the
4146         prefix of 'Access.  Reject as well the attribute when applied to a
4147         renaming of a formal subprogram.
4149 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4151         * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
4152         Needs_Simple_Initialization.
4153         (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
4154         (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
4155         profile and comment on usage.
4156         (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
4157         Sloc of a value obtained from aspect Default_Value because this could
4158         potentially replicate large trees. The proper Sloc is now set in
4159         Get_Simple_Init_Val.
4160         (Get_Simple_Init_Val): Reorganized by breaking the various cases into
4161         separate routines. Eliminate the use of global variables.
4162         (Init_Component): Update the call to Get_Simple_Init_Val.
4163         (Needs_Simple_Initialization): Update the parameter profile and all
4164         uses of T.
4165         (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
4166         and set the proper Sloc.
4167         * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
4168         comment on usage.
4169         (Needs_Simple_Initialization): Update the parameter profile.
4171 2018-05-22  Patrick Bernardi  <bernardi@adacore.com>
4173         * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
4174         user tries to use a subtype indication as a discriminant constraint.
4176 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4178         * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
4179         of N_Reduction_Expression and N_Reduction_Expression_Parameter.
4180         * par-ch4.adb: Remove parsing routines for reduction expressions.
4181         * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
4182         sem_spark.adb, sprint.adb: Remove analysis routines for reduction
4183         expressions.
4185 2018-05-22  Arnaud Charlet  <charlet@adacore.com>
4187         * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
4188         Relaxed_RM_Semantics mode.
4190 2018-05-22  Arnaud Charlet  <charlet@adacore.com>
4192         * comperr.adb (Delete_SCIL_Files): Take into account
4193         N_Generic_Package_Renaming_Declaration.
4195 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4197         * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
4198         private, use the full view if available, because it may include renamed
4199         discriminants whose values are stored in the corresponding
4200         Stored_Constraint.
4202 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4204         * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
4205         defined on packages that are actuals for formal packages, in order to
4206         set/reset the visibility of the formals of a formal package with given
4207         actuals, when there are subsequent uses of those formals in the
4208         enclosing generic, as required by RN 12.7 (10).
4209         * atree.ads, atree.adb: Add operations for Elist30.
4210         * atree.h: Add Elist30.
4211         * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
4212         that are not defaulted and are thus not visible within the current
4213         instance.
4214         (Check_Formal_Packages): Reset visibility of formals of a formal
4215         package that are not defaulted, on exit from current instance.
4217 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4219         * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
4220         non-'Result output appears in the output list of a function.
4222 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4224         * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
4225         (Build_Record_VS_Func): Reimplemented.
4226         (Expand_N_Attribute): Reimplement the handling of attribute
4227         'Valid_Scalars.
4228         * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
4229         attribute 'Valid_Scalars.
4230         * sem_util.adb (Scalar_Part_Present): Reimplemented.
4231         (Validated_View): New routine.
4232         * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
4233         comment on usage.
4234         (Validated_View): New routine.
4235         * doc/gnat_rm/implementation_defined_attributes.rst: Update the
4236         documentation of attribute 'Valid_Scalars.
4237         * gnat_rm.texi: Regenerate.
4239 2018-05-22  Bob Duff  <duff@adacore.com>
4241         * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
4242         the spec of a SAL_Interface package.
4244 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4246         * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
4247         entity E within a generic unit, indicate that there are no remaining
4248         delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
4249         entity E is not frozen yet but the aspects should not be reanalyzed at
4250         the freeze point, which may be outside of the generic and may not have
4251         the proper visibility.
4253 2018-05-22  Bob Duff  <duff@adacore.com>
4255         * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
4256         the new --split-line-before-record, --indent-named-statements and
4257         --no-align-modes gnatpp switches.
4259 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4261         * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
4262         a second argument that is a constant of a given string value.
4264 2018-05-22  Doug Rupp  <rupp@adacore.com>
4266         * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
4268 2018-05-22  Jerome Lambourg  <lambourg@adacore.com>
4270         * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
4272 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4274         * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
4275         delayed aspects, analyze them now, os that the representation of the
4276         type (size, bounds) can be computed and validated.
4278 2018-05-22  Olivier Hainque  <hainque@adacore.com>
4280         * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
4281         executable code section boundaries.
4283 2018-05-22  Javier Miranda  <miranda@adacore.com>
4285         * locales.c: New implementation for the Ada.Locales package.
4286         * libgnat/a-locale.ads: Remove comment indicating that this is not
4287         implemented.
4288         * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
4289         that this is not implemented.
4290         * gnat_rm.texi: Regenerate.
4292 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4294         * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
4295         reformattings.
4297 2018-05-22  Justin Squirek  <squirek@adacore.com>
4299         * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
4300         (Freeze_Subprogram_Body, Install_Body): Modify calls to
4301         In_Same_Declarative_Part.
4302         * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
4303         verify pragma declaration is within the same declarative list with
4304         corresponding error message.
4305         * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
4306         sem_ch12.adb and generalized to be useful outside the scope of
4307         freezing.
4309 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4311         * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
4312         categorization of the unit after processing the aspects in case one of
4313         its aspects is converted into a categorization pragma.
4315 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4317         * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
4318         declaration with an explicit address clause and a type with default
4319         initialization, if the declaration carries an aspect
4320         Suppress_Initialization.
4322 2018-05-21  Daniel Mercier  <mercier@adacore.com>
4324         * pprint.adb: Use mixed case for attribute names.
4326 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4328         * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
4329         Analyze_Aspect_Specifications_On_Body_Or_Stub.
4330         (Analyze_Subprogram_Body_Helper): Rename the calls to
4331         Analyze_Aspect_Specifications_On_Body_Or_Stub.
4332         * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
4333         Analyze_Aspect_Specifications_On_Body_Or_Stub.
4334         * sem_ch10.adb: Add with and use clause for Sem_Ch13.
4335         (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
4336         prior to analyzing its aspects.
4337         (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
4338         stub prior to analyzing its aspects. Save and restore the configuration
4339         switches.
4340         (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
4341         prior to analyzing its aspects.
4342         * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4343         to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4344         * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4345         to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4346         * sem_prag.adb: Code reformatting.
4347         (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
4349 2018-05-21  Jerome Lambourg  <lambourg@adacore.com>
4351         * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
4352         for QNX.
4354 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4356         * exp_cg.adb: Remove with and use clause for Exp_Disp.
4357         * exp_ch9.adb: Remove with and use clause for Exp_Disp.
4358         * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4359         (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4360         (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4361         * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4362         (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4363         (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4364         * exp_dist.adb: Remove with and use clause for Exp_Disp.
4365         * freeze.adb: Remove with and use clause for Exp_Disp.
4366         * sem_cat.adb: Remove with and use clause for Exp_Disp.
4367         * sem_ch6.adb: Remove with and use clause for Exp_Disp.
4368         * sem_ch12.adb: Remove with and use clause for Exp_Disp.
4369         * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
4370         primitives.
4371         * sem_util.adb: Remove with and use clause for Exp_Disp.
4372         (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
4373         (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4374         (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4375         * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
4376         Exp_Disp.
4377         (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4378         (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4380 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4382         * sem_res.adb (Valid_Conversion): Improve error message on an illegal
4383         type conversion whose expression has a limited view of a type.
4385 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4387         * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
4388         explicit name for iterator loop, preserve that name in expanded
4389         construct, for possible use in exit statements.
4391 2018-05-21  Javier Miranda  <miranda@adacore.com>
4393         * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
4394         spec of a unit has Ada 2012 membership tests with multiple choices and
4395         the unit body is not compiled under Ada 2012 mode.
4397 2018-05-21  Doug Rupp  <rupp@adacore.com>
4399         * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
4400         pregs.
4401         (CFI_COMMON_REGS): Restore LR jic probed from prologue.
4402         (REGNO_PC_OFFSET): Change to correct value for Aarch64.
4404 2018-05-21  Jose Ruiz  <ruiz@adacore.com>
4406         * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
4407         libgnarl/s-tassta.adb: Minor typo fixes
4409 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4411         * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
4412         indexed call originally in prefix forn is itself the prefix of a
4413         further call.
4415 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4417         * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
4418         type.
4419         (Not_Null_Range): Same as above.
4421 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4423         * exp_ch3.adb: Minor reformatting.
4424         * exp_ch6.adb: Likewise.
4425         * freeze.adb: Likewise.
4426         * inline.adb: Likewise.
4427         * sem_util.adb: Likewise.
4429 2018-05-21  Yannick Moy  <moy@adacore.com>
4431         * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
4432         conversion instead of an unchecked type conversion when inlining a
4433         return statement, unless type qualification is required (for character
4434         and string literal) or no check can result from the conversion (for
4435         access types).
4436         * opt.ads: Update comment.
4438 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4440         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
4441         model of the compilation unit spec, if any.
4442         * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
4443         model of the compilation unit spec, if any.
4444         * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
4445         parent compilation unit spec, if any.
4446         * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
4447         model of the main unit.
4448         (Is_Same_Unit): The routine now uses Unit_Entity.
4449         (Is_Subunit): Removed.
4450         (Normalize_Unit): Removed.
4451         (Unit_Entity): New routine.
4452         * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
4453         Elaboration_Checks. The analysis now ensures that the pragma appears at
4454         the configuration level, and on the initial declaration of a unit.
4455         Other placements are either flagged as illegal, or ignored.
4456         (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
4457         (Ignore_Elaboration_Checks_Pragma): New routine.
4458         * sem_util.adb (Install_Elaboration_Model): New routine.
4459         * sem_util.ads (Install_Elaboration_Model): New routine.
4460         * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
4461         documentation of pragma Elaboration_Checks.
4462         * gnat_rm.texi: Regenerate.
4464 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4466         * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
4467         of empty string when argv[0] couldn't be found on PATH.
4468         (Enable_Cache): Raise Program_Error instead of attempting a null
4469         pointer dereference when the Exec_Module initialization failed.
4471 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4473         * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
4474         * libgnarl/a-taside.ads (Tasking_State): Likewise.
4475         * libgnat/a-calend.ads (Clock_Time): Likewise.
4477 2018-05-21  Yannick Moy  <moy@adacore.com>
4479         * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
4480         call notation in inlined call in GNATprove mode.
4482 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4484         * einfo.adb (Is_External_State): An abstract state is also external
4485         when it is declared with option "synchronous".
4486         * einfo.ads: Update the documentation of synthesized attribute
4487         Is_External_State.
4488         * sem_util.adb (Find_Simple_Properties): New routine.
4489         (Is_Enabled_External_Property): New routine.
4490         (State_Has_Enabled_Property): Reimplemented. The two flavors of option
4491         External have precedence over option Synchronous when determining
4492         whether a property is in effect.
4494 2018-05-21  Yannick Moy  <moy@adacore.com>
4496         * sem_eval.adb (Static_Length): Take into account case of variable of
4497         subtype string literal.
4499 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4501         * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
4502         (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
4503         * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
4504         component name.
4505         (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
4506         * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
4507         change.
4509 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4511         * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
4512         Address, and type of Low, High to Storage_Offset.
4513         (Low): Rename as Low_Address and convey that the return value is a
4514         runtime reference accounting for a load address.
4515         * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
4516         address/offset type changes.
4517         (Aranges_Lookup): Likewise.
4518         (Symbolic_Address): Likewise.
4519         (Symbolic_Traceback): Likewise.
4520         (Dump_Cache): Likewise.
4521         (Is_Inside): Likewise.
4522         (Open): Likewise.
4523         (Set_Load_Address): Likewise.
4524         (Low_Address): Likewise, and account for C.Load_Address.
4525         * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
4526         (Multi_Module_Symbolic_Traceback): Compare address in traceback
4527         with module Low_Address instead of Low.
4529 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4531         * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
4532         Load_Address.
4533         * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
4534         (Set_Load_Address): Likewise.
4535         (Symbolic_Traceback): Likewise.
4537 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4539         * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
4540         Load_Address argument and pass it down to Init_Module.
4541         * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
4542         lm.l_addr as the Load_Address to Add_Module_To_Cache.
4544 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4546         * einfo.adb (Has_Discriminants): Stronger assertion.
4547         (Set_Has_Discriminants): Stronger assertion.
4548         * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
4549         the stronger assertion on Has_Discriminant.
4550         (Uninstall_Discriminants_And_Pop_Scope): Same as above.
4551         * sem_util.adb (New_Copy_Tree): Same as above.
4552         * sem_ch7.adb (Generate_Parent_References): Prevent calls to
4553         Has_Discriminant on non-type entities that might happen when the
4554         compiled code has errors.
4555         * sem_ch3.adb (Derived_Type_Declaration): Only call
4556         Set_Has_Discriminant on type entities.
4558 2018-05-21  Arnaud Charlet  <charlet@adacore.com>
4560         * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
4561         code generation.
4563 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4565         * lib.ads: Fix typo in enumeration in comment.
4567 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4569         * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
4570         attribute reference is legal within a generic unit when the prefix is a
4571         formal private type.
4573 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4575         * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
4576         delegate the secondary stack management when there is no suitable
4577         transient context, and the transient scope was intended to manage the
4578         secondary stack because this causes premature reclamation. Change the
4579         transient scope creation logic by special casing assignment statements
4580         of controlled components for type initialization procedures.
4581         (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
4582         the comment on usage.
4583         (Find_Transient_Context): Change the initinte loop into a while loop.
4584         Iterations schemes and iterator specifications are not valid transient
4585         contexts because they rely on special processing. Assignment statements
4586         are now treated as a normal transient context, special cases are
4587         handled by the caller. Add special processing for pragma Check.
4588         (Is_OK_Construct): Removed. Its functionality has been merged in
4589         routine Find_Transient_Context.
4590         * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
4591         retrieve the subprogram being invoked. Use a more accurate predicate
4592         (Requires_Transient_Scope) to determine that the function will emply
4593         the secondary stack.
4595 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4597         * ada_get_targ.adb: Fix subprogram body headers.
4598         * adabkend.adb: Likewise.
4599         * checks.adb: Likewise.
4600         * exp_ch3.adb: Likewise.
4601         * exp_ch5.adb: Likewise.
4602         * exp_ch9.adb: Likewise.
4603         * exp_dist.adb: Likewise.
4604         * exp_tss.adb: Likewise.
4605         * inline.adb: Likewise.
4606         * lib-writ.adb: Likewise.
4607         * lib-xref-spark_specific.adb: Likewise.
4608         * libgnarl/s-osinte__darwin.adb: Likewise.
4609         * libgnarl/s-stusta.adb: Likewise.
4610         * libgnarl/s-taprop__solaris.adb: Likewise.
4611         * libgnarl/s-tposen.adb: Likewise.
4612         * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
4613         * libgnarl/s-vxwext__kernel.adb: Likewise.
4614         * libgnat/a-btgbso.adb: Likewise.
4615         * libgnat/a-cfdlli.adb: Likewise.
4616         * libgnat/a-cfhama.adb: Likewise.
4617         * libgnat/a-cfinve.adb: Likewise.
4618         * libgnat/a-cimutr.adb: Likewise.
4619         * libgnat/a-coboho.adb: Likewise.
4620         * libgnat/a-cofove.adb: Likewise.
4621         * libgnat/a-cofuve.adb: Likewise.
4622         * libgnat/a-comutr.adb: Likewise.
4623         * libgnat/a-exexda.adb: Likewise.
4624         * libgnat/a-tags.adb: Likewise.
4625         * libgnat/a-tideau.adb: Likewise.
4626         * libgnat/a-wtdeau.adb: Likewise.
4627         * libgnat/a-ztdeau.adb: Likewise.
4628         * libgnat/g-alleve.adb: Likewise.
4629         * libgnat/s-excdeb.adb: Likewise.
4630         * libgnat/s-parint.adb: Likewise.
4631         * libgnat/s-shasto.adb: Likewise.
4632         * libgnat/s-traceb__hpux.adb: Likewise.
4633         * prepcomp.adb: Likewise.
4634         * sem_ch4.adb: Likewise.
4635         * sem_ch6.adb: Likewise.
4636         * sem_dist.adb: Likewise.
4637         * sem_prag.adb: Likewise.
4638         * sem_util.adb: Likewise.
4639         * sinfo.adb: Likewise.
4640         * switch.adb: Likewise.
4642 2018-05-04  John Marino  <gnugcc@marino.st>
4644         PR ada/85635
4645         * link.c (BSD platforms): Add missing backslash.
4647 2018-04-27  Eric Botcazou  <ebotcazou@adacore.com>
4649         PR ada/85540
4650         * init.c (__gnat_handle_vms_condition): Add missing parentheses.
4652 2018-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4654         PR ada/85007
4655         * gnat_ugn.texi: Regenerate.
4657 2018-03-23  Eric Botcazou  <ebotcazou@adacore.com>
4659         PR ada/85007
4660         * gnatlink.adb (Gnatlink): Remove handling of -b switch.
4661         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
4662         Remove documentation of -b switch.
4664 2018-03-23  Eric Botcazou  <ebotcazou@adacore.com>
4666         PR ada/85036
4667         * gnatlink.adb (Process_Args): Drop existing link switches if multiple
4668         switches are passed for --LINK.
4670 2018-03-12  Eric Botcazou  <ebotcazou@adacore.com>
4672         PR ada/82813
4673         * gcc-interface/misc.c (gnat_post_options): Disable string overflow
4674         warnings.
4676 2018-03-10  Eric Botcazou  <ebotcazou@adacore.com>
4678         * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
4679         Consider only entities for objects.
4681 2018-03-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
4683         * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
4684         $(GNATLIBCFLAGS).
4685         (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
4687 2018-03-06  Eric Botcazou  <ebotcazou@adacore.com>
4689         * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
4690         guarding the overflow check emitted for the upper bound of a floating-
4691         point conversion.
4693 2018-03-06  Eric Botcazou  <ebotcazou@adacore.com>
4695         * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
4697 2018-02-28  Eric Botcazou  <ebotcazou@adacore.com>
4699         * libgnat/i-cexten.ads (Float_128): New type.
4701 2018-02-02  Eric Botcazou  <ebotcazou@adacore.com>
4703         * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
4704         false if the component type is a pointer.
4706 2018-01-11  Gary Dismukes  <dismukes@adacore.com>
4708         * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
4709         result of Get_Simple_Init_Value and pass the source location of the
4710         object declaration's object_definition.
4712 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4714         * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
4715         properly object declarations with initializations that are
4716         build-in-place function calls, when there is an address specification,
4717         either as an aspect specification or an explicit attribute
4718         specification clause, for the initialized object.
4719         * freeze.adb (Check_Address_Clause): Do not remove side-effects from
4720         initial expressions in the case of a build-in-place call.
4722 2018-01-11  Piotr Trojanek  <trojanek@adacore.com>
4724         * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
4725         private (sub)type; refactor to avoid early return statement.
4726         (Not_Null_Range): Same as above.
4728 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4730         * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
4731         concurrent, nor effectively volatile.
4732         * ghost.adb (Check_Ghost_Type): New routine.
4733         * ghost.ads (Check_Ghost_Type): New routine.
4734         * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
4735         consider specific subsets of declarations.
4736         (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
4737         replicated by Is_Declaration.
4738         * sem_util.ads (Is_Declaration): New parameter profile. Update the
4739         comment on usage.
4740         (Is_Declaration_Other_Than_Renaming): Removed.
4742 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4744         * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
4745         as Part_Of consituents of single protected types are illegal when they
4746         take place inside a protected function.
4747         (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
4748         enclosing function.
4749         (Is_Protected_Part_Of_Constituent): New routine.
4750         (Within_Function): New routine.
4752 2018-01-11  Arnaud Charlet  <charlet@adacore.com>
4754         Bump copyright notices to 2018.
4756 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4758         * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
4759         Minor reformatting.
4761 2018-01-11  Justin Squirek  <squirek@adacore.com>
4763         * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
4764         to make sure a given expression function is properly parenthesized.
4766 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4768         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
4769         categorization of a subprogram body which does not complete a previous
4770         declaration.
4772 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4774         * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
4775         scope of package Ada is Standard.
4777 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4779         * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
4780         subcomponent of the current entity when building the body for a dynamic
4781         predicate function for a record with composite subcomponents.
4783 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4785         * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
4786         Establish_Transient_Scope.
4787         (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
4788         (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
4789         * exp_ch6.adb (Expand_Call_Helper): Update the call to
4790         Establish_Transient_Scope.
4791         (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
4792         Establish_Transient_Scope.
4793         * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
4794         management of the secondary stack to an enclosing scope if there is no
4795         suitable construct to wrap, and the transient scope was intended to
4796         manage the secondary stack.
4797         (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
4798         is a valid boundary for a transient expression which comes from the
4799         statements of the alternative, otherwise alternatives cannot be
4800         wrapped. Assignments of controlled objects which have controlled
4801         actions suppressed now stop the traversal as there is no point in
4802         looking for an enclosing construct. Add several N_xxx_Body choices to
4803         the termination conditions for completeness.
4804         * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
4805         and the associated comment on usage.
4806         * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
4807         Establish_Transient_Scope.
4808         (Add_Write_After): Update the call to Establish_Transient_Scope.
4809         * sem_res.adb (Check_Initialization_Call): Removed.
4810         (Resolve_Actuals): Account for additional cases where finalization
4811         actions are required by utilizing predicate Needs_Finalization rather
4812         than Is_Controlled.
4813         (Resolve_Call): Type initialization procedures can now utilize
4814         transient scopes to manage the secondary stack, thus preventing leaks
4815         during initialization.  Remove the previous kludgy algorithm which
4816         attempts to manage the secondary stack at the object creation site.
4818 2018-01-11  Jerome Lambourg  <lambourg@adacore.com>
4820         * libgnat/g-soliop__qnx.ads: New.
4821         * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
4822         for QNX.
4824 2018-01-11  Bob Duff  <duff@adacore.com>
4826         * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
4827         a null procedure occurs in a protected definition.
4829 2018-01-11  Bob Duff  <duff@adacore.com>
4831         * binderr.ads, namet.ads: Minor reformatting.
4833 2018-01-11  Bob Duff  <duff@adacore.com>
4835         * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
4836         xml2gnat.
4838 2018-01-11  Bob Duff  <duff@adacore.com>
4840         * binde.adb (Force_Elab_Order): Give an error if there are duplicate
4841         unit names.
4843 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4845         * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
4846         controlling argument of a dispatching call. freeze the corresponding
4847         designated type.
4849 2018-01-11  Ben Brosgol  <brosgol@adacore.com>
4851         * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
4853 2018-01-11  Ben Brosgol  <brosgol@adacore.com>
4855         * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
4856         corrections.
4857         * gnat_rm.texi: Regenerate.
4859 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4861         * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
4862         formsl type corresponding to the actual fixed point type is private,
4863         because in this case there can be no suspicious arithmetic operations
4864         in the generic unless they reference a formal subprogram.  Clarify
4865         warning.
4867 2018-01-11  Javier Miranda  <miranda@adacore.com>
4869         * exp_util.adb (Remove_Side_Effects): No action done for functions
4870         returning class-wide types since it requires generating code using
4871         'reference and the CCG target has no secondary stack.
4872         * gnat1drv.adb: Disable building static dispatch tables when generating
4873         C code.
4875 2018-01-11  Piotr Trojanek  <trojanek@adacore.com>
4877         * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
4878         libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
4879         (File_Type): Add Default_Initial_Condition aspect.
4881 2018-01-11  Pascal Obry  <obry@adacore.com>
4883         * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
4885 2018-01-11  Bob Duff  <duff@adacore.com>
4887         * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
4888         to match what the Libadalang-based version does.
4889         * doc/gnat_ugn/about_this_guide.rst: Update reference.
4891 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4893         * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
4894         if it contains at least one component declaration employing a function
4895         call returning on the secondary stack.
4897 2018-01-11  Yannick Moy  <moy@adacore.com>
4899         * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
4900         Update description of restriction SPARK_05 with SPARK 2014.
4901         * gnat_rm.texi: Regenerate.
4903 2018-01-11  Vasiliy Fofanov  <fofanov@adacore.com>
4905         * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
4907 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4909         * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
4910         sem_res.adb, sem_util.adb: Minor reformatting.
4912 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4914         * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
4915         has a delayed aspect which must be processed at the point the type is
4916         frozen. This mimics what is done when the predicate is provided by a
4917         source aspect.
4919 2018-01-11  Doug Rupp  <rupp@adacore.com>
4921         * init.c (vxworks): Add macro checks for __aarch64__.
4923 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4925         * exp_util.adb (Add_Failure_Expression): New routine.
4926         (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
4927         * sem_util.adb (Is_Current_Instance): Code cleanup.
4929 2018-01-11  Patrick Bernardi  <bernardi@adacore.com>
4931         * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
4932         Default_Sec_Stack_Size.
4933         * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
4934         limit check so that the integer index does not overflow. Check the
4935         dynamic stack allocation does not cause the secondary stack pointer to
4936         overflow.
4937         (SS_Info): Align colons.
4938         (SS_Init): Cover the case when bootstraping with an old compiler that
4939         does not set Default_SS_Size.
4941 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4943         * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
4944         legality of an inherited operation that may require overriding, ignore
4945         primitive_wrappers that correspond to explicit operations that override
4946         an interface primitive.
4947         * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
4948         operation to which the class-wide expression applies is a protected op.
4949         with a primitive_wrapper, verify that the updated inherited expression
4950         does not contain an internal call to a protected function.  This
4951         completes the implementation of AI12-0166.
4953 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4955         * ali.adb: Document the remaining letters available for ALI lines.
4956         (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
4957         * ali.ads: Update type With_Record. Field
4958         Implicit_With_From_Instantiation is no longer in use. Add field
4959         Implicit_With.
4960         * csinfo.adb (CSinfo): Remove the setup for attribute
4961         Implicit_With_From_Instantiation.
4962         * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
4963         either implicitly or explicitly withed.
4964         (Is_Implicit_With_Clause): New routine.
4965         (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
4966         confusion with the with clause attribute by the same name.
4967         (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
4968         * rtsfind.adb (Maybe_Add_With): Code cleanup.
4969         * sem_ch8.adb (Present_System_Aux): Code cleanup.
4970         * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
4971         for a parent unit.
4972         (Implicit_With_On_Parent): Mark the with clause as generated for a
4973         parent unit.
4974         * sem_ch12.adb (Inherit_Context): With clauses inherited by an
4975         instantiation are no longer marked as Implicit_With_From_Instantiation
4976         because they are already marked as implicit.
4977         * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
4978         which marks implicit with clauses as related to an instantiation.
4979         * sinfo.adb (Implicit_With_From_Instantiation): Removed.
4980         (Parent_With): New routine.
4981         (Set_Implicit_With_From_Instantiation): Removed.
4982         (Set_Parent_With): New routine.
4983         * sinfo.ads: Update the documentation of attribute Implicit_With.
4984         Remove attribute Implicit_With_From_Instantiation along with
4985         occurrences in nodes.  Add attribute Parent_With along with occurrences
4986         in nodes.
4987         (Implicit_With_From_Instantiation): Removed along with pragma Inline.
4988         (Parent_With): New routine along with pragma Inline.
4989         (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
4990         (Set_Parent_With): New routine along with pragma Inline.
4992 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4994         * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
4995         entity when the enclosing construct is a body.
4997 2018-01-11  Patrick Bernardi  <bernardi@adacore.com>
4999         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
5000         Secondary_Stack_Size handling as a pragma is now generated for the
5001         corresponding aspect instead of an attribute.  Pragma expression is
5002         relocated instead of evaluated. Discriminant of the corresponding
5003         record type is referenced rather than the type discriminant.
5004         (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
5005         Secondary_Stack_Size rep item checks to only look for the pragma rep.
5006         * sem_ch13.adb (Analyze_One_Aspect): Transform
5007         Aspect_Secondary_Stack_Size into a pragma instead of an attribute
5008         because the attribute does not have visibility on a task type's
5009         discriminants when the type's definition is expanded.
5010         (Analyze_Attribute_Definition_Clause): Remove handling of
5011         Attribute_Secondary_Stack_Size.
5012         * snames.adb-tmpl, snames.ads-tmpl: Remove
5013         Attribute_Secondary_Stack_Size, no longer used.
5015 2018-01-11  Justin Squirek  <squirek@adacore.com>
5017         * sem_ch8.adb: Minor comment fix.
5019 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
5021         * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
5022         individual action because the action may denote a complex expression,
5023         such as a case statement, which in turn may contain additional
5024         transient objects.
5026 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
5028         * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
5029         analysis on a copy of the expression with a copy of the index variable,
5030         because full expansion will rewrite construct into a loop with the
5031         original loop variable.
5032         * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
5033         expression is an iterated component association. Full analysis takes
5034         place when construct is rewritten as a loop.
5035         (In_Place_Assign_OK, Safe_Component): An iterated_component_association
5036         is not safe for in-place assignment.
5037         * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
5038         entity with no homonym and no other entity in the scope.
5040 2018-01-11  Justin Squirek  <squirek@adacore.com>
5042         * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
5043         message to be printed on the pragma argument identifier.
5045 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
5047         * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
5048         entity of the generated invariant procedure in order to construct a
5049         proper entity chain.
5051 2018-01-11  Piotr Trojanek  <trojanek@adacore.com>
5053         * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
5054         comment.
5056 2018-01-11  Arnaud Charlet  <charlet@adacore.com>
5058         * einfo.ads, einfo.adb (Activation_Record_Component,
5059         Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
5060         Allow E_Discriminant.
5062 2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
5064         * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
5065         for atomic access once the component size is taken into account and
5066         also do it if the component type is Atomic or Volatile_Full_Access.
5068 2018-01-04  Eric Botcazou  <ebotcazou@adacore.com>
5070         * gnatvsn.ads: Bump copyright year.
5072 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5073             Alan Hayward  <alan.hayward@arm.com>
5074             David Sherwood  <david.sherwood@arm.com>
5076         * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
5077         as polynomial.
5079 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5080             Alan Hayward  <alan.hayward@arm.com>
5081             David Sherwood  <david.sherwood@arm.com>
5083         * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
5084         as polynomial.
5086 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5087             Alan Hayward  <alan.hayward@arm.com>
5088             David Sherwood  <david.sherwood@arm.com>
5090         * gcc-interface/utils.c (gnat_types_compatible_p): Handle
5091         polynomial TYPE_VECTOR_SUBPARTS.
5093 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5094             Alan Hayward  <alan.hayward@arm.com>
5095             David Sherwood  <david.sherwood@arm.com>
5097         * gcc-interface/misc.c (enumerate_modes): Handle polynomial
5098         GET_MODE_NUNITS.
5100 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
5102         Update copyright years.
5104         * gnat_ugn.texi: Bump @copying's copyright year.
5105         * gnat_rm.texi: Likewise.
5107 Copyright (C) 2018 Free Software Foundation, Inc.
5109 Copying and distribution of this file, with or without modification,
5110 are permitted in any medium without royalty provided the copyright
5111 notice and this notice are preserved.