re PR ada/88191 (ada bootstrap failure on alpha-linux-gnu ("SIGSYS" not declared...
[official-gcc.git] / gcc / ada / ChangeLog
blob160ca997e8ee7e53475574672640fd69da696c0b
1 2018-11-26  Matthias Klose <doko@ubuntu.com>
3         PR ada/88191
4         * libgnarl/s-linux__alpha.ads: Define SIGSYS.
6 2018-11-19  Alexandre Oliva <oliva@adacore.com>
8         PR ada/81878
9         * gcc-interface/config-lang.in (lang_requires): Set to "c c++"
10         when gnattools wants it.
12 2018-11-19  Eric Botcazou  <ebotcazou@adacore.com>
14         * gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
16 2018-11-15  Eric Botcazou  <ebotcazou@adacore.com>
18         * gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
19         -fnon-call-exceptions passed on the command line in -gnatp mode.
21 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
23         * exp_util.ads, exp_util.adb: Change the profile of
24         Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
25         of the right opersnd. This prevents unnesting anomalies when
26         that operand contains uplevel references.
27         * exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
28         * exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.
30 2018-11-14  Patrick Bernardi  <bernardi@adacore.com>
32         * libgnarl/a-intnam__linux.ads: Add SIGSYS.
33         * libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
34         libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
35         libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
36         libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
37         SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
38         implementation specific.
39         * libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
40         SIGSYS.  Move SIG32, SIG33 and SIG34 from the unmasked list to
41         the reserved list.
43 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
45         * exp_aggr.adb (Is_Static_Element): New predicate extracted
46         from...
47         (Check_Static_Components): ...here.  Call Is_Static_Element on
48         each element of the component association list, if any.
49         (Flatten): Duplicate the expression of an others choice only if
50         it is static or is an aggregate which can itself be flattened.
52 2018-11-14  Olivier Hainque  <hainque@adacore.com>
54         * sigtramp-vxworks-target.inc: Fix stack checking test errors in
55         ACATS, now that GCC can emit CFI rules referring to sp in
56         absence of a frame pointer.
58 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
60         * exp_aggr.adb (Check_Static_Components): Remove dead test.
61         (Flatten): Likewise.  Move comment around.
63 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
65         * sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
66         SPARK-related global state at the start of the routine. Set the
67         Ghost mode of the completed spec if any.  Restore the saved
68         Ghost and SPARK-related global state on exit from the routine.
70 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
72         * doc/gnat_ugn/building_executable_programs_with_gnat.rst
73         (-gnatR): Document new -gnatR4 level.
74         * gnat_ugn.texi: Regenerate.
75         * opt.ads (List_Representation_Info): Bump upper bound to 4.
76         * repinfo.adb: Add with clause for GNAT.HTable.
77         (Relevant_Entities_Size): New constant.
78         (Entity_Header_Num): New type.
79         (Entity_Hash): New function.
80         (Relevant_Entities): New set implemented with GNAT.HTable.
81         (List_Entities): Also list compiled-generated entities present
82         in the Relevant_Entities set. Consider that the Component_Type
83         of an array type is relevant.
84         (List_Rep_Info): Reset Relevant_Entities for each unit.
85         * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4.
86         * switch-m.adb (Normalize_Compiler_Switches): Likewise
87         * usage.adb (Usage): Likewise.
89 2018-11-14  Javier Miranda  <miranda@adacore.com>
91         * exp_disp.adb (Expand_Interface_Thunk): Extend handling of
92         renamings of the predefined equality primitive.
93         (Make_Secondary_DT): When calling Expand_Interface_Thunk() pass
94         it the primitive, instead of its Ultimate_Alias; required to
95         allow the called routine to identify renamings of the predefined
96         equality operation.
98 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
100         * freeze.adb (Check_Pragma_Thread_Local_Storage): New routine. A
101         variable with suppressed initialization has no initialization
102         for purposes of the pragma.
103         (Freeze_Object_Declaration): Remove variable
104         Has_Default_Initialization as it is no longer used. Use routine
105         Check_Pragma_Thread_Local_Storage to verify the semantics of
106         pragma Thread_Local_Storage.
108 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
110         * sem_res.adb (Resolve_If_Expression): Verify that the subtypes
111         of all dependent expressions obey the constraints of the
112         expected type for the if-expression.
113         (Analyze_Expression): Only add qualificiation to the dependent
114         expressions when the context type is constrained. Small
115         adjustment to previous patch.
117 2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
119         * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't
120         register a compile-time warning or error for 'Alignment or 'Size
121         of an entity declared in a generic unit.
123 2018-11-14  Justin Squirek  <squirek@adacore.com>
125         * sem_ch8.adb (Use_One_Package): Add test for out-of-scope
126         homonyms.
128 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
130         * exp_ch3.adb: (Expand_N_Object_Declaration): If the expression
131         is a limited aggregate its resolution is delayed until the
132         object declaration is expanded.
133         * sem_ch3.adb: (Analyze_Object_Declaration): If the expression
134         is a limited aggregate and the declaration has a following
135         address clause indicate that resolution of the aggregate (which
136         must be built in place) must be delayed.
138 2018-11-14  Bob Duff  <duff@adacore.com>
140         * sem_attr.adb (To_Address): Simplify setting of
141         Is_Static_Expression. Remove second (unconditional) call to
142         Set_Is_Static_Expression -- surely it's not static if the
143         operand is not.  Initialize Static on declaration.  Do not try
144         to fold 'To_Address, even though it's static.
145         * exp_attr.adb (To_Address): Preserve Is_Static_Expression.
146         * sinfo.ads, sem_eval.ads, sem_eval.adb (Is_Static_Expression,
147         Is_OK_Static_Expression, Raises_Constraint_Error): Simplify
148         documentation.  There was too much repetition and redundancy.
150 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
152         * sem_ch3.adb (Analyze_Object_Declaration): Use the
153         Actual_Subtype to preserve information about a constant
154         initialized with a non-static entity that is known to be valid,
155         when the type of the entity has a narrower range than that of
156         the nominal subtype of the constant.
157         * checks.adb (Determine_Range): If the expression is a constant
158         entity that is known-valid and has a defined Actual_Subtype, use
159         it to determine the actual bounds of the value, to enable
160         additional optimizations.
162 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
164         * back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
165         exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
166         freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
167         sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.
169 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
171         * exp_ch4.adb (Find_Aliased_Equality): New routine.
172         (Find_Equality): Reimplemented.
173         (Is_Equality): New routine.
175 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
177         * ghost.adb (Ghost_Entity): New routine.
178         (Mark_And_Set_Ghost_Assignment): Reimplemented.
179         * sem_ch5.adb (Analyze_Assignment): Assess whether the target of
180         the assignment is an ignored Ghost entity before analyzing the
181         left hand side.
182         * sem_ch8.adb (Find_Direct_Name): Update the subprogram
183         signature. Do not generate markers and references when they are
184         not desired.
185         (Nvis_Messages): Do not execute when errors are not desired.
186         (Undefined): Do not emit errors when they are not desired.
187         * sem_ch8.ads (Find_Direct_Name): Update the subprogram
188         signature and comment on usage.
189         * sem_util.adb (Ultimate_Prefix): New routine.
190         * sem_util.ads (Ultimate_Prefix): New routine.
192 2018-11-14  Justin Squirek  <squirek@adacore.com>
194         * sem_ch7.adb (Uninstall_Declarations): Add conditional to avoid
195         uninstalling potential visibility during freezing on enumeration
196         literals.
198 2018-11-14  Jerome Lambourg  <lambourg@adacore.com>
200         * env.c: Do not include crt_externs.h on iOS, as it does not
201         exist there. This is also true for the iPhone Simulator SDK.
203 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
205         * exp_ch7.adb (Check_Unnesting_In_Declarations): New procedure
206         to transform blocks that appear in the declarative part of a
207         package body into subprograms if they contain generated
208         subprograms (such as finalization routines). Needed to generate
209         the proper upward references in unnesting mode.
211 2018-11-14  Ed Schonberg  <schonberg@adacore.com>
213         * freeze.adb (Freeze_Fixed_Point_Type): If the given low bound
214         of the type is less than the nearest model number, do not expand
215         the range of the type to include the model number below the
216         bound. Similar adjustment if the upper bound is larger than the
217         nearest model number.
219 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
221         * checks.adb (Install_Primitive_Elaboration_Check): Do not
222         create the check when exceptions cannot be used.
223         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not raise
224         Program_Errror when exceptions cannot be used. Analyze the
225         generated code with all checks suppressed.
226         * exp_ch7.adb (Build_Finalizer): Remove the declaration of
227         Exceptions_OK.
228         (Make_Deep_Array_Body): Remove the declaration of Exceptions_OK.
229         (Make_Deep_Record_Body): Remove the declaration of
230         Exceptions_OK.
231         (Process_Transients_In_Scope): Remove the declaration of
232         Exceptions_OK.
233         * exp_util.adb (Exceptions_In_Finalization_OK): Renamed to
234         Exceptions_OK.
235         * exp_util.ads (Exceptions_In_Finalization_OK): Renamed to
236         Exceptions_OK.
238 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
240         * exp_ch4.adb (Expand_N_Op_Eq): Remove duplicated code and use
241         routine Find_Equality instead.
242         (Find_Equality): New routine.
244 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
246         * sem_util.adb (First_From_Global_List): Do not expect
247         N_Selected_Component in the Global contract; simplify assertion
248         with Nam_In.
250 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
252         * sem_ch12.adb (Instantiate_Object): Set
253         Corresponding_Generic_Association on generic actuals with
254         default expression.
255         * sinfo.ads (Corresponding_Generic_Association): Update comment.
257 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
259         * exp_ch4.adb (Expand_Concatenate): Use the proper routine to
260         set the need for debug info.
261         * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Use the
262         proper routine to set the need for debug info.
263         * exp_prag.adb (Expand_Pragma_Initial_Condition): Use the proper
264         routine to set the need for debug info.
265         * exp_util.adb (Build_DIC_Procedure_Declaration): Use the proper
266         routine to set the need for debug info.
267         (Build_Invariant_Procedure_Declaration): Use the proper routine
268         to set the need for debug info.
269         * ghost.adb (Record_Ignored_Ghost_Node): Add statements as a
270         whole class to the list of top level ignored Ghost nodes.
271         * sem_util.adb (Set_Debug_Info_Needed): Do not generate debug
272         info for an ignored Ghost entity.
274 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
276         * bindgen.adb, exp_cg.adb, repinfo.adb, sprint.adb: Minor reuse
277         Cancel_Special_Output where possible.
279 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
281         * exp_dbug.ads, sem_util.ads: Minor fixes in comments.
283 2018-11-14  Arnaud Charlet  <charlet@adacore.com>
285         * adabkend.adb (Scan_Back_End_Switches): Handle -gx switches
286         explicitly.
288 2018-11-13  Eric Botcazou  <ebotcazou@adacore.com>
290         * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
291         for the runtime on platforms where System.Machine_Overflow is true.
293 2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>
295         * fe.h (Suppress_Checks): Declare.
296         * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
297         only if checks are not suppressed and -faggressive-loop-optimizations
298         only if they are.
299         * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
300         warned_aggressive_loop_optimizations fields.
301         (gigi): Do not clear warn_aggressive_loop_optimizations here.
302         (Raise_Error_to_gnu): Do not set has_checks.
303         (gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
304         loop optimizations.
306 2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>
308         * gcc-interface/decl.c (components_to_record): Remove obsolete kludge.
309         * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the
310         new type but do not take into account the setting on the old type for
311         the new fields.  Rename a local variable.
312         (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at
313         offset 0, if any.
314         (create_field_decl): Tweak comment.
316 2018-10-22  Eric Botcazou  <ebotcazou@adacore.com>
318         * gcc-interface/utils.c (unchecked_convert): Use local variables for
319         the biased and reverse SSO attributes of both types.
320         Further extend the processing of integral types in the presence of
321         reverse SSO to all scalar types.
323 2018-10-22  Eric Botcazou  <ebotcazou@adacore.com>
325         * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
326         a simple memory constraint in all cases.
328         * gcc-interface/lang-specs.h: Bump copyright year.
330 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
332         * gcc-interface/Make-lang.in (selftest-ada): New.
334 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
336         * exp_ch3.adb (Is_Null_Statement_List): New predicate.
337         (Build_Array_Init_Proc): Use it to find out whether the
338         initialization procedure Is_Null_Init_Proc; if so, set
339         Warnings_Off on the parameter.
340         (Build_Init_Procedure): Likewise.
341         (Init_Formals): Use an in/out first parameter only for
342         unconstrained arrays and for records either containing or built
343         for proteced types or task types; use an out parameter in all
344         the other cases.
345         * fe.h (Is_Init_Proc): Declare.
346         * gcc-interface/decl.c (type_requires_init_of_formal): Do not
347         return true for a discriminant in an unchecked union.
348         (gnat_to_gnu_param): Do not create a PARM_DECL for the Out
349         parameter of an initialization procedure.
351 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
353         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If
354         this is not a definition, retrieve the expression in all cases
355         even if we are just annotating types.
356         * gcc-interface/trans.c (gnat_to_gnu): Also translate Size
357         attribute for constrained types in this mode.
359 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
361         * adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
362         (__gnat_locate_exec): Check that HOST_EXECUTABLE_SUFFIX is not
363         empty before doing a string search for it.
364         * socket.c (ATTRIBUTE_UNUSED): Define.
365         (__gnat_disable_sigpipe): Add ATTRIBUTE_UNUSED on parameter.
366         * terminals.c (ATTRIBUTE_UNUSED): Move around.
367         (__gnat_setup_child_communication): Add ATTRIBUTE_UNUSED on
368         parameter.
369         (__gnat_send_header): Add ATTRIBUTE_UNUSED on parameters.
371 2018-10-09  Yannick Moy  <moy@adacore.com>
373         * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
374         pragmas as null statements in GNATprove mode.
376 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
378         * exp_ch6.adb (Add_Call_By_Copy_Code): Initialize the temporary
379         made for an Out parameter if the formal type has discriminants.
381 2018-10-09  Maroua Maalej  <maalej@adacore.com>
383         * sem_spark.adb (Check_Declaration): fix bug related to non
384         access object permissions.
386 2018-10-09  Doug Rupp  <rupp@adacore.com>
388         * libgnat/a-ncelfu.ads: Fix name in header to match package.
390 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
392         * exp_disp.adb (Make_Disp_Asynchronous_Select_Spec): Set
393         Warnings_Off on the B out parameter.
395 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
397         * einfo.ads: Small comment fix.
399 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
401         * sem_ch7.adb (Has_Referencer): Add comment for the
402         N_Freeze_Entity case.  Do not rely on
403         Has_Referencer_Of_Non_Subprograms to clear the Is_Public flag on
404         subprogram entities.
406 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
408         * exp_unst.adb (In_Synchronized_Call): Handle properly private
409         types whose full views are synchronized types, in order to
410         recognize generated subprograms whose bodies must be considered
411         reachable even if no direct calls to them are visible in the
412         source.
414 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
416         * exp_ch4.adb (Expand_Modular_Op): When expanding an operation
417         on nonbinary modular types, convert the opersnds to an integer
418         type that is large enough to hold the modulus of the type, which
419         may be larger than Integer'Last.
421 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
423         * exp_unst.adb (Unnest_Subprogram):  When an uplevel reference
424         is to an unconstrained formal, the 'Access reference that is
425         created to initialize the corresponding component of the
426         activation record must be wrapped in an unchecked conversion to
427         the generated type of the component. Otherwise, spurious suvtype
428         conformance errors will be generated when the code is within an
429         instantiation and the type of the formal is a formal type of the
430         enclosing generic. Note that during unnesting there is no simple
431         way to determine that the code appears within an instance
432         because ther is no scope stack.
434 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
436         * gcc-interface/decl.c (type_requires_init_of_formal): New
437         predicate.
438         (gnat_to_gnu_param): Use it to determine whether a PARM_DECL
439         must be created for an Out parameter passed by copy.
441 2018-10-09  Arnaud Charlet  <charlet@adacore.com>
443         * libgnat/a-coboho.ads (Storage_Element): Fix a typo.
445 2018-10-09  Claire Dross  <dross@adacore.com>
447         * libgnat/a-cfinve.ads: Remove default value for
448         Max_Size_In_Storage_Elements as it was not supported in SPARK.
450 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
452         * exp_ch6.adb (Add_Call_By_Copy_Node,
453         Add_Simple_Call_By_Copy_Node, Expand_Call_Helper): Reset
454         Is_True_Constant on entities used as Out or In_Out parameters in
455         calls.
457 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
459         * exp_unst.adb (Unnest_Subprogram): Do not load System to obtain
460         the Address entity unless an activation record is being built.
461         Removes useless with_clauses for System when nested subprograms
462         do not have uplevel references, and therefore do not need
463         activation records.
465 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
467         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
468         the conformance check on an aspect expression that includes a
469         call to an instance of Unchecked_Conversion, or more generally a
470         call to an intrinsic operation.
472 2018-10-09  Eric Botcazou  <ebotcazou@adacore.com>
474         * repinfo.adb: Remove with/use clause for Stand.
475         (List_Mechanisms): List the mechanism of functions only.
477 2018-10-09  Bob Duff  <duff@adacore.com>
479         * doc/gnat_ugn/gnat_utility_programs.rst: Correct spelling of
480         --eol switch.  Document the language-version switches.  Update
481         description for --no-exception.
483 2018-10-09  Vasiliy Fofanov  <fofanov@adacore.com>
485         * libgnat/s-os_lib.ads (Normalize_Pathname): Fix incorrect
486         comment.
488 2018-10-09  Arnaud Charlet  <charlet@adacore.com>
490         * vxlink.adb: Remove pragma Annotate, no longer needed.
492 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
494         * checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
495         rather than SPARK_mode in order to preserve the Do_Range_Check
496         flag for verification purposes.
498 2018-10-09  Ed Schonberg  <schonberg@adacore.com>
500         * exp_aggr.adb (Expand_Array_Aggregate): If it is not possible
501         to build in place an aggregate with component associations, set
502         the Warnings_Off flag on the generated temporary, to prevent
503         spurious warnings from the backend when compiling with the
504         -Wuninitialized gcc flag.
506 2018-09-30  Alexandre Oliva <oliva@adacore.com>
508         * gcc-interface/lang-specs.h (default_compilers): When given
509         fcompare-debug-second, adjust auxbase like cc1, and pass
510         gnatd_A.
511         * gcc-interface/misc.c (flag_compare_debug): Remove variable.
512         (gnat_post_options): Do not set it.
513         * lib-writ.adb (flag_compare_debug): Remove import.
514         (Write_ALI): Do not test it.
516 2018-09-28  Eric Botcazou  <ebotcazou@adacore.com>
517             Pierre-Marie de Rodat  <derodat@adacore.com>
519         * gcc-interface/decl.c (is_cplusplus_method): Do not require C++
520         convention on Interfaces.
521         * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a
522         bona-fide thunk and hand it over to the middle-end.
523         (get_controlling_type): New function.
524         (use_alias_for_thunk_p): Likewise.
525         (thunk_labelno): New static variable.
526         (make_covariant_thunk): New function.
527         (maybe_make_gnu_thunk): Likewise.
528         * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the
529         result DECL here instead of...
530         (end_subprog_body): ...here.
532 2018-09-27  Martin Sebor  <msebor@redhat.com>
534         * gcc-interface/utils.c (make_packable_type): Introduce a temporary
535         to avoid -Wnonnull.
536         (unchecked_convert): Same.
538 2018-09-26  Elisa Barboni  <barboni@adacore.com>
540         * sem_prag.adb (Check_Refined_Global_Item): Improve error
541         message.
543 2018-09-26  Thomas Quinot  <quinot@adacore.com>
545         * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a
546         representation item that is an N_Aspect_Definition, retrieve the
547         entity it applies to using the Entity attribute.
549 2018-09-26  Justin Squirek  <squirek@adacore.com>
551         * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition
552         to check for unmarked subprogram references coming from
553         renamings.
555 2018-09-26  Arnaud Charlet  <charlet@adacore.com>
557         * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches.
559 2018-09-26  Yannick Moy  <moy@adacore.com>
561         * errout.ads: Update comment for insertion character '?'.
562         * inline.adb: Use simple insertion character '?' for GNATprove
563         info messages.
564         * sem_res.adb (Resolve_Call): Issue an info message on inlining
565         in GNATprove mode.
567 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
569         * checks.adb (Apply_Type_Conversion_Checks): Do not generate a
570         range check on the expression of the conversion if it involves a
571         fixed-point type, as such conversions are handled specially
572         during expansion.
573         * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from
574         Fixed to Integer, use the base type of the expression to ensure
575         that the caller will generate the proper constraint check when
576         needed.
578 2018-09-26  Maroua Maalej  <maalej@adacore.com>
580         * sem_spark.adb (Check_Loop_Statement): Fix a bug related to
581         loop exit environment.
582         (Check_Statement): fixing a bug when comparing the source and
583         target in an assignment statement.
585 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
587         * sem_ch12.adb (Instantiate_Package_Body): Capture and restore
588         the full compilation context.
589         (Instantiate_Subprogram_Body): Capture and restore the full
590         compilation context.
592 2018-09-26  Yannick Moy  <moy@adacore.com>
594         * debug.adb: Add use for -gnatd_f switch.
595         * inline.adb (Cannot_Inline): Only issue info message for
596         failure to inline in GNATprove mode when switch -gnatd_f is
597         used.
599 2018-09-26  Javier Miranda  <miranda@adacore.com>
601         * exp_disp.adb (Expand_Interface_Conversion): No displacement of
602         the pointer needed when the type of the operand is an interface
603         type that maches the target type and we are compiling under
604         configurable runtime. Adding also documentation explaining why
605         this cannot be done when compiling with the full runtime.
606         * exp_intr.adb: Update comment.
608 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
610         * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return.
612 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
614         * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when
615         applying a predicate check to prevent spurious errors when
616         private ancestors are involved.
618 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
620         * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the
621         secondary stack does not clash with restriction
622         No_Secondary_Stack.
623         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that
624         the use of the secondary stack does not clash with restriction
625         No_Secondary_Stack.
626         * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block
627         prior to analysis in order to either provide a local scope for
628         an iterator, or ensure that the secondary stack is properly
629         managed.
630         (Check_Call): Account for the case where the tree may be
631         unanalyzed or contain prior errors.
632         (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call.
633         Update all uses of the subprogram.
634         (Prepare_Loop_Statement): New routine.
636 2018-09-26  Javier Miranda  <miranda@adacore.com>
638         * sem_res.adb (Resolve_Actuals): If the formal is a class-wide
639         type conversion then do not skip resolving and expanding the
640         conversion; required to displace the pointer to the object and
641         reference the dispatch table associated with the target
642         interface type.
644 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
646         * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number
647         of key-value pairs in the hash table only when adding a brand
648         new pair.
650 2018-09-26  Sergey Rybin  <rybin@adacore.com>
652         * doc/gnat_ugn/gnat_utility_programs.rst: Add note about
653         processing of aggregate projects in gnatmetric and gnatstub.
655 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
657         * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
658         opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
659         sinfo.ads, snames.ads-tmpl: Minor reformatting.
661 2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>
663         * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of
664         front end sources.
665         * impunit.adb: Add unit GNAT.Sets to the list of predefined
666         units.
667         * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking
668         units.
669         * libgnat/g-sets.adb: New unit.
670         * libgnat/g-sets.ads: New unit.
671         * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to
672         allow for small sets.  Update all occurrences of Table_Locked to
673         Iterated.
674         (Ensure_Unlocked): Query the number of iterators.
675         (Find_Node): Use the supplied equality.
676         (Is_Empty): New routine.
677         (Lock): Update the number of iterators.
678         (Prepend_Or_Replace): Use the supplied equality.
679         (Size): Update the return type.
680         (Unlock): Update the number of iterators.
681         * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked
682         to Iterated.  Rename formal subprogram Equivalent_Keys to "=".
683         (Bucket_Range_Type, Pair_Count_Type): Remove types.
684         (Not_Created, Table_Locked, Iterator_Exhausted): Remove
685         exceptions.
686         (Hash_Table): Update to store the number of iterators rather
687         than locks.
688         (Is_Empty): New routine.
689         (Size): Update the return type.
690         * libgnat/g-lists.adb: Update all occurrences of List_Locked to
691         Iterated.
692         (Ensure_Unlocked): Query the number of iterators.
693         (Length): Remove.
694         (Lock): Update the number of iterators.
695         (Size): New routine.
696         (Unlock): Update the number of iterators.
697         * libgnat/g-lists.ads: Update all occurrences of List_Locked to
698         Iterated.
699         (Element_Count_Type): Remove type.
700         (Not_Created, Table_Locked, Iterator_Exhausted): Remove
701         exceptions.
702         (Linked_List): Update type to store the number of iterators
703         rather than locks.
704         (Length): Remove.
705         (Size): New routine.
706         * libgnat/gnat.ads (Bucket_Range_Type): New type.
707         (Iterated, Iterator_Exhausted, and Not_Created): New exceptions.
709 2018-09-26  Javier Miranda  <miranda@adacore.com>
711         * checks.adb (Install_Null_Excluding_Check): Do not add
712         null-excluding checks when the tree may not be fully decorated.
713         This patch cascade errors.
715 2018-09-26  Gary Dismukes  <dismukes@adacore.com>
717         * sem_ch3.adb (Analyze_Object_Declaration): Remove test for
718         Comes_From_Source, which prevented implicit conversions from
719         being applied to anonymous access-to-subprogram formals in
720         constant declartions that arise from instance associations for
721         generic formal objects.  Add RM and AARM references to comment.
723 2018-09-26  Olivier Hainque  <hainque@adacore.com>
725         * opt.ads (OpenAcc_Enabled): New flag. False by default. True
726         when OpenACC pragmas are requested to be honored, when -fopenacc
727         is found on the command line.
728         * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if
729         -fopenacc is seen on the command line.
730         * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New
731         flag/predicate on Loop statements which embed an Acc_Kernels,
732         Acc_Parallel or Acc_Data pragma.
733         (Is_OpenAcc_Loop): New flag/predicate on Loop statements which
734         embed an Acc_Loop pragma.
735         (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for
736         the new flags.
737         * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel
738         and Acc_Kernels pragmas.  Nothing to do here, all handled by
739         sem_prag.
740         * sem_prag.adb (Acc_First, Acc_Next,
741         Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause,
742         Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause,
743         Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang,
744         Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker,
745         Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New
746         helper for Analyze_Pragma, to handle OpenACC pragmas.
747         (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and
748         Acc_Kernels pragmas.
749         * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on
750         variable entity, action for ...
751         (Disable_Constants): Helper for Analyze_Loop_Statement, to ...
752         (Analyze_Loop_Statement): Disable True_Constant on variables
753         referenced within an OpenACC environment.
754         * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives
755         and clauses we can handle. Remove an exraneous whitespace before
756         columns, preventing line length overflow in the generated spec
757         with Ids now reaching beyond 999.
758         * doc/gnat_rm/implementation_defined_pragmas.rst: Document
759         pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data.
760         * gnat_rm.texi: Regenerate.
762 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
764         * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P
765         is a derived limited record is not itself limited if P is a
766         derived limited interface.
768 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
770         * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and
771         add In_Nested_Instance and
772         Has_Outer_Referencer_Of_Non_Subprograms parameters.  Rename
773         Has_Non_Subprograms_Referencer variable into
774         Has_Referencer_Of_Non_Subprograms and initialize it with the new
775         third parameter.  Adjust recursive calls and to the renaming.
776         Replace test on Top_Level with test on In_Nested_Instance to
777         decide whether to clear the Is_Public flag on entities.
778         (Hide_Public_Entities): Adjust call to Has_Referencer.
780 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
782         * exp_disp.adb (Expand_Interface_Conversion): Use Present test.
783         (Expand_Interface_Thunk): Propagate debug info setting from
784         target.
785         * exp_util.ads (Find_Interface_Tag): Adjust comment.
786         * exp_util.adb (Find_Interface_Tag): Remove assertions of
787         success.
788         * sem_util.adb (Is_Variable_Size_Record): Only look at
789         components and robustify the implementation.
790         * fe.h (Find_Interface_Tag): Declare.
791         (Is_Variable_Size_Record): Likewise.
793 2018-09-26  Thomas Quinot  <quinot@adacore.com>
795         * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order
796         and scalar storage order from root type to classwide equivalent
797         type, to prevent rejection of the equivalent type by the
798         freezing circuitry.
800 2018-09-26  Justin Squirek  <squirek@adacore.com>
802         * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional
803         to freeze called functions within iterator specifications during
804         full analysis.
805         (Preanalyze_Range): Minor typo fix.
807 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
809         * sem_ch6.adb (Analyze_Function_Return): If the return type has
810         a dynamic_predicate, apply a Predicate_Check to the expression,
811         given that it is implicitly converted to the return type.
812         Exclude case expressions from the check, because in this context
813         the expression is expanded into individual return statements.
815 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
817         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: In
818         -gnatct mode, process the discriminants only for a definition.
820 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
822         * repinfo.adb (List_Record_Layout): Be prepared for JSON output.
823         (List_Record_Info): Use the flat representation for record
824         subtypes in the JSON format.
826 2018-09-26  Justin Squirek  <squirek@adacore.com>
828         * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
829         documentation and an extra conditional check for RCI units so
830         that generated ali files will list the spec only instead of a
831         body when a body is not found.
833 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
835         * gcc-interface/gigi.h (error_gnat_node): Delete.
836         * gcc-interface/trans.c (error_gnat_node): Likewise.
837         (gigi): Replace it with Current_Error_Node.
838         (gnat_to_gnu): Likewise.
839         * gcc-interface/utils.c (rest_of_subprog_body_compilation):
840         Likewise.
841         * gcc-interface/misc.c (internal_error_function): Do not set it.
843 2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>
845         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
846         code retrieving the address when a clause has already been
847         processed.
848         * gcc-interface/trans.c (gnat_to_gnu)
849         <N_Attribute_Definition_Clause>: For an object with a Freeze
850         node, build a meaningful expression.
852 2018-09-26  Arnaud Charlet  <charlet@adacore.com>
854         * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets
855         Opt.Disable_ALI_File.
856         * debug.adb: Update debug flags documentation.
858 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
860         * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
861         analysis of preconditions specified by pragmas (rather than
862         aspects) is not delayed, and therefore expressions functions
863         that are completions do not need special handling during
864         expansion.
866 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
868         * exp_unst.adb: Fix handling of up level references for entries.
870 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
872         * contracts.adb (Expand_Subprogram_Contract,
873         Process_Preconditions_For): Apply Freeze_Expr_Types to the
874         expression for a precondition of an expression function that is
875         a completion, when the completion appears in the private part
876         and the declaration it completes is in the visible part of the
877         same package.
878         * freeze.adb (Freeze_Expr_Types): Do not establish the scope of
879         the operation if it is already installed, as will be the case
880         when called to analyze the contract oc the subprogram (which
881         happens when generating code inside the subprogram body).
883 2018-09-26  Maroua Maalej  <maalej@adacore.com>
885         * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global):
886         Change the operation associated to assigning to an IN parameter.
887         In SPARK, IN access-to-variable is an observe operation for a
888         function, and borrow operation for a procedure.
890 2018-09-26  Arnaud Charlet  <charlet@adacore.com>
892         * vxlink.adb: Minor reformatting.
894 2018-09-26  Gary Dismukes  <dismukes@adacore.com>
896         * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
897         miscellaneous typos.
899 2018-09-26  Jerome Lambourg  <lambourg@adacore.com>
901         * vxlink.adb: Kill a CodePeer warning.
903 2018-09-24  Eric Botcazou  <ebotcazou@adacore.com>
905         PR ada/87396
906         * fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
907         of 'char' as the type of the second parameter.
909 2018-09-13  Eric Botcazou  <ebotcazou@adacore.com>
911         * Makefile.rtl (arm% linux-gnueabi%): Always set EH_MECHANISM to -arm.
913 2018-09-13  Eric Botcazou  <ebotcazou@adacore.com>
915         PR ada/81103
916         * terminals.c: Do not include termio.h.
918 2018-08-27  Martin Liska  <mliska@suse.cz>
920         * gcc-interface/decl.c (update_profile): Use new function
921         fndecl_built_in_p and remove check for FUNCTION_DECL if
922         possible.
923         * gcc-interface/gigi.h (call_is_atomic_load): Likewise.
924         * gcc-interface/utils.c (gnat_pushdecl): Likewise.
926 2018-08-23  Giuliano Belinassi  <giuliano.belinassi@usp.br>
928         * exp_unst.ads: Fix typo 'exapnded' to 'expanded'.
930 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
932         * checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
933         exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
934         exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
935         lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
936         sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
937         sprint.adb: Minor reformatting.
939 2018-08-21  Jerome Lambourg  <lambourg@adacore.com>
941         * vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
942         vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
943         new tool vxlink to handle VxWorks constructors in DKMs.
944         * gcc-interface/Makefile.in: add rules to build vxlink
946 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
948         * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
949         Refine the handling of freezing types for expression functions
950         that are not completions, when analyzing the generated body for
951         the function: the body is inserted at the end of the enclosing
952         declarative part, and its analysis may freeze types declared in
953         the same scope that have not been frozen yet.
955 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
957         * sem_ch6.adb: Remove Freeze_Expr_Types.
958         * freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
959         sem_ch6.adb, and extended to handle other expressions that may
960         contain unfrozen types that must be frozen in their proper
961         scopes.
962         * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
963         contract is for the generated body of an expression function
964         that is a completion, traverse the expressions for pre- and
965         postconditions to freeze all types before adding the contract
966         code within the subprogram body.
968 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
970         * sem_ch10.adb: Remove the with and use clause for unit Ghost.
971         (Analyze_With_Clause): Do not mark a with clause which mentions
972         an ignored Ghost code for elimination.
974 2018-08-21  Javier Miranda  <miranda@adacore.com>
976         * lib-writ.adb (Write_Unit_Information): Handle pragmas removed
977         by the expander.
979 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
981         * sem_ch6.adb (Check_Synchronized_Overriding): The conformance
982         between an overriding protected operation and the overridden
983         abstract progenitor operation requires subtype conformance;
984         requiring equality of return types in the case of a function is
985         too restrictive and leads to spurious errors when the return
986         type is a generic actual.
988 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
990         * exp_ch9.adb (Expand_N_Timed_Entry_Call,
991         Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
992         properly the scope of all entities created in blocks generated
993         by the expansion of these constructs.
995 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
997         * sem_ch13.adb (Build_Predicate_Functioss): Apply
998         Reset_Quantified_Variables_Scope after predicate function has
999         been analyzed, so that the scope can be reset on the generated
1000         loop statements that have replaced the quantified expressions.
1002 2018-08-21  Bob Duff  <duff@adacore.com>
1004         * einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
1005         obsolete code.
1007 2018-08-21  Maroua Maalej  <maalej@adacore.com>
1009         * sem_spark.adb (Check_Call_Statement): Check global and formal
1010         parameter permissions at call sites.
1011         (Check_Callable_Body): Assume permissions on globals and
1012         parameters depending on their modes then analyse the body
1013         operations.
1014         (Check_Declaration): Consider both deep (including elementary
1015         access) object declarations and normal variables. First check
1016         whether the deep object is of Ownership Aspec True or not, then,
1017         depending on its initialization, assign the appropriate state.
1018         Check related to non access type variables deal with
1019         initialization value permissions.
1020         (Check_Expression): Check nodes used in the expression being
1021         analyzed.
1022         (Check_Globals): Call by Check_Call_Statement to perform the
1023         check on globals.
1024         (Check_List): Call Check_Node on each element of the list.
1025         (Check_Loop_Statement): Check the Iteration_Scheme and loop
1026         statements.
1027         (Check_Node): Main traversal procedure to check safe pointer usage.
1028         (Check_Package_Body): Check subprogram's body.
1029         (Check_Param_In): Take a formal and an actual parameter and
1030         Check the permission of every in-mode parameter.
1031         (Check_Param_Out): Take a formal and an actual parameter and
1032         check the state of out-mode and in out-mode parameters.
1033         (Check_Statement): Check statements other than procedure call.
1034         (Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
1035         related to the given name.
1036         (Is_Deep): Return True if an object is of access type or has
1037         subfields of access type.
1038         (Perm_Error, Perm_Error_Subprogram_End): Add an error message
1039         whenever the found state on the given name is different from the
1040         one expected (in the statement being analyzed).
1041         (Process_Path): Given an operation and a current state, call
1042         Perm_Error if there is any mismatch.
1043         (Return_Declarations, Return_Globals, Return_The_Global): Check
1044         the state of a given name at the end of the subprogram. These
1045         procedures may change depending on how we shall finally deal
1046         with globals and the rhs state in a move operation.
1047         (Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
1048         Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
1049         Setup_Parameters): Set up the new states to the given node and
1050         up and down the tree after an operation.
1051         (Has_Ownership_Aspect_True): This function may disappear later
1052         when the Ownership Aspect will be implemented in the FE.
1054 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1056         * sem_res.adb (Resolve_Call): Resolve correctly a parameterless
1057         call that returns an access type whose designated type is the
1058         component type of an array, when the function has no defaulted
1059         parameters.
1061 2018-08-21  Yannick Moy  <moy@adacore.com>
1063         * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1064         Document entries of the target parametrization file.
1065         * gnat_ugn.texi: Regenerate.
1067 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1069         * sem_attr.adb: Set scope of elaboration flag for 'Access.
1071 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1073         * sprint.adb: Add guard on printing aspects.
1075 2018-08-21  Javier Miranda  <miranda@adacore.com>
1077         * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
1078         expander.
1080 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1082         * layout.adb: Do not set size of access subprogram if unnesting.
1084 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1086         * freeze.adb: Remove warnings for access to subprograms when
1087         unnesting is active.
1089 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1091         * exp_aggr.adb (Expand_Array_Aggregate): If the component type
1092         is limited, the array must be constructed in place, so set flag
1093         In_Place_Assign_OK_For_Declaration accordingly. This prevents
1094         improper copying of an array of tasks during initialization.
1096 2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>
1098         * gcc-interface/trans.c (Call_to_gnu): Always suppress an
1099         unchecked conversion around the actual for an In parameter
1100         passed by copy.
1102 2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>
1104         * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
1105         selected component inherited in a record extension and subject
1106         to a representation clause, retrieve the position and size from
1107         the original record component.
1109 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1111         * sem_util.ads, sem_util.adb (New_External_Entity): Type of
1112         Suffix_Index must be Int, not Nat, so that a negative value can
1113         be used to generate a unique name for an external object, as
1114         specified in Tbuild.New_External_Name.
1115         (Scope_Within): Handle private type whose completion is a
1116         synchronized type (For unnesting).
1117         * itypes.ads, itypes.adb (Create_Itype): Ditto
1118         * sem_ch3.adb (Constrain_Corresponding_Record): Generate a
1119         unique name for the created subtype, because there may be
1120         several discriminated tasks present in the same scope, and each
1121         needs its distinct corresponding record subtype.
1123 2018-08-21  Yannick Moy  <moy@adacore.com>
1125         * doc/gnat_ugn/gnat_and_program_execution.rst: Update
1126         documentation of dimensionality analysis.
1127         * gnat_ugn.texi: Regenerate.
1128         * Makefile.rtl, impunit.adb: Consider the new units.
1129         * libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
1130         libgnat/s-diflmk.ads: New units based on Float.
1131         * libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
1132         libgnat/s-dlmopr.ads: New units based on Long_Float.
1133         * libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
1134         into an instance of
1135         System.Dim.Generic_Mks.Generic_Other_Prefixes.
1136         * libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
1137         into an instance of System.Dim.Generic_Mks.
1139 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1141         * impunit.adb: Add g-lists to the set of non-implementation
1142         units.
1143         * libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
1144         * Makefile.rtl: Add g-lists to the set of non-tasking units.
1145         * gcc-interface/Make-lang.in: Add g-lists to the set of files
1146         used by gnat1.
1148 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1150         * exp_ch9.adb (Reset_Scopes): Do not recurse into type
1151         declarations when resetting the scope of entities declared the
1152         procedures generated for entry bodies and accept alternatives.
1153         Use the entity of the procedure declaration, not its body, as
1154         the new scope.
1156 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1158         * einfo.adb (Elaboration_Entity): Include entries and entry
1159         families in the set of legal entities.
1160         (Elaboration_Entity_Required): Include entries and entry
1161         families in the set of legal entities.
1162         (Set_Elaboration_Entity): Include entries and entry families in
1163         the set of legal entities.
1164         (Set_Elaboration_Entity_Required): Include entries and entry
1165         families in the set of legal entities.
1166         (Write_Field13_Name): Update the output of attribute
1167         Elaboration_Entity.
1168         * einfo.ads: Attributes Elaboration_Entity and
1169         Elaboration_Entity_Required now apply to entries and entry
1170         families.
1172 2018-08-21  Arnaud Charlet  <charlet@adacore.com>
1174         * set_targ.adb: Mark some CodePeer message as Intentional.
1176 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
1178         * sem_res.adb (Resolve_Call): Force the freezing of an
1179         expression function that is called to provide a default value
1180         for a defaulted discriminant in an object initialization.
1182 2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>
1184         * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
1185         Dynamic_HTable.
1187 2018-08-21  Javier Miranda  <miranda@adacore.com>
1189         * checks.ads (Determine_Range): Adding documentation.
1190         * checks.adb (Determine_Range): Don't deal with enumerated types
1191         with non-standard representation.
1192         (Convert_And_Check_Range): For conversion of enumeration types
1193         with non standard representation to an integer type perform a
1194         direct conversion to the target integer type.
1196 2018-08-21  Piotr Trojanek  <trojanek@adacore.com>
1198         * lib-xref.ads, lib-xref-spark_specific.adb
1199         (Enclosing_Subprogram_Or_Library_Package): Now roughtly works
1200         for pragmas that come from aspect specifications.
1202 2018-08-21  Pierre-Marie de Rodat  <derodat@adacore.com>
1204         * sa_messages.ads, sa_messages.adb: New source files.
1206 2018-08-03  Pierre-Marie de Rodat  <derodat@adacore.com>
1208         Reverts
1209         2018-07-06  Jim Wilson  <jimw@sifive.com>
1211         * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
1212         (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
1213         * gcc-interface/Makefile.in (xoscons): Likewise.
1215 2018-07-31  Alexandre Oliva  <oliva@adacore.com>
1216             Olivier Hainque  <hainque@adacore.com>
1218         * gcc-interface/trans.c: Include debug.h.
1219         (file_map): New static variable.
1220         (gigi): Set it.  Create decl_to_instance_map when needed.
1221         (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
1222         (Sloc_to_locus): ... this.  Add decl parm, map it to instance.
1223         * gcc-interface/gigi.h (Sloc_to_locus): Adjust declaration.
1225 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1227         * clean.adb, gnatchop.adb, gnatfind.adb, gnatls.adb,
1228         gnatmake.ads, gnatxref.adb, make.adb, make.ads, make_util.ads,
1229         sfn_scan.adb, vxaddr2line.adb, xeinfo.adb, xoscons.adb,
1230         xr_tabls.adb, xref_lib.adb: Address CodePeer messages.
1232 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1234         * gnatlink.adb: Fix potential Constraint_Error if
1235         Library_Version is too long.
1237 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1239         * sem_elab.adb: Remove duplicate condition detected by CodePeer.
1241 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1243         * exp_unst.adb (Subp_Index): In the case of a protected
1244         operation, the relevant entry is the generated
1245         protected_subprogram_body into which the original body is
1246         rewritten. Assorted cleanup and optimizations.
1248 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1250         * exp_attr.adb (Expand_Attribute, case Fixed_Value): Set the
1251         base type of the result to ensure that proper overflow and range
1252         checks are generated.  If the target is a fixed-point tyoe,
1253         generate the required overflow and range checks explicitly,
1254         rather than relying on Apply_Type_Conversion_Checks, which might
1255         simply set the Do_Range_Check flag and rely on the backend to
1256         add the check.
1258 2018-07-31  Hristian Kirtchev  <kirtchev@adacore.com>
1260         * sem_res.adb (Resolve_Call): Establish a transient scope to
1261         manage the secondary stack when the designated type of an
1262         access-to-subprogram requires it.
1264 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1266         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): To find local
1267         subprograms in the elaboration code for a package body, recurse
1268         through nested statement sequences because a compiler-generated
1269         procedure may appear within a condition statement.
1271 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1273         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Handle
1274         properly a protected call that includes a default parameter that
1275         is a call to a protected function of the same type.
1277 2018-07-31  Justin Squirek  <squirek@adacore.com>
1279         * lib-writ.adb (Write_With_Lines): Modfiy the generation of
1280         dependencies within ali files so that source unit bodies are
1281         properly listed even if said bodies are missing.  Perform legacy
1282         behavior in GNATprove mode.
1283         * lib-writ.ads: Modify documentation to reflect current behavior.
1285 2018-07-31  Eric Botcazou  <ebotcazou@adacore.com>
1287         * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.
1288         (mutex_t): Use it for 'lock' and 'data' components.
1289         (cond_t): Likewise for 'data' and use single 'flags' component.
1291 2018-07-31  Justin Squirek  <squirek@adacore.com>
1293         * exp_ch5.adb (Make_Field_Assign): Force temporarily generated
1294         objects for assignment of overlaid user objects to be renamings
1295         instead of constant declarations.
1297 2018-07-31  Hristian Kirtchev  <kirtchev@adacore.com>
1299         * exp_ch9.adb (Analyze_Pragmas): New routine.
1300         (Build_Private_Protected_Declaration): Code clean up. Relocate
1301         relevant aspects and pragmas from the stand-alone body to the
1302         newly created spec.  Explicitly analyze any pragmas that have
1303         been either relocated or produced by the analysis of the
1304         aspects.
1305         (Move_Pragmas): New routine.
1306         * sem_prag.adb (Find_Related_Declaration_Or_Body): Recognize the
1307         case where a pragma applies to the internally created spec for a
1308         stand-along subprogram body declared in a protected body.
1310 2018-07-31  Gary Dismukes  <dismukes@adacore.com>
1312         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
1313         calls to Current_Scope in three assertions with calls to
1314         Current_Subprogram.
1316 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1318         * sem_eval.adb (Check_Non_Static_Context): Do not warn on an
1319         integer literal greater than the upper bound of
1320         Universal_Integer'Last when expansion is disabled, to avoid a
1321         spurious warning over ranges involving 64-bit modular types.
1323 2018-07-31  Arnaud Charlet  <charlet@adacore.com>
1325         * einfo.adb (Write_Entity_Flags): Also print
1326         Is_Activation_Record flag.
1328 2018-07-31  Piotr Trojanek  <trojanek@adacore.com>
1330         * exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb,
1331         repinfo.adb, sem_ch9.adb: Minor replace Ekind membership tests
1332         with a wrapper routine.
1334 2018-07-31  Piotr Trojanek  <trojanek@adacore.com>
1336         * ali.adb (Known_ALI_Lines): Remove 'F' as a prefix for lines
1337         related to the FORMAL analysis done by GNATprove.
1339 2018-07-31  Javier Miranda  <miranda@adacore.com>
1341         * sem.ads (Inside_Preanalysis_Without_Freezing): New global
1342         counter.
1343         * sem.adb (Semantics): This subprogram has now the
1344         responsibility of resetting the counter before analyzing a unit,
1345         and restoring its previous value before returning.
1346         * freeze.adb (Freeze_Entity): Do not freeze if we are
1347         preanalyzing without freezing.
1348         * sem_res.adb (Preanalyze_And_Resolve): Set & restore
1349         In_Preanalysis_Without_Freezing.
1351 2018-07-31  Ed Schonberg  <schonberg@adacore.com>
1353         * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
1354         may rename a matching class-wide operation only if the renaming
1355         declaration for that actual is in an enclosing scope (i.e.
1356         within the corrresponding instance).
1358 2018-07-31  Hristian Kirtchev  <kirtchev@adacore.com>
1360         * checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
1361         exp_disp.adb, make.adb, sem_ch4.adb, sem_eval.adb, sem_res.adb,
1362         usage.adb: Minor reformatting.
1364 2018-07-31  Bob Duff  <duff@adacore.com>
1366         * sem_res.adb (Resolve_Allocator): Do not complain about the
1367         implicit allocator that occurs in the expansion of a return
1368         statement for a build-in-place function.
1370 2018-07-20  Martin Sebor  <msebor@redhat.com>
1372         PR middle-end/82063
1373         * gcc-interface/misc.c (gnat_handle_option): Change function argument
1374         to HOST_WIDE_INT.
1376 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1378         * gcc-interface/decl.c (choices_to_gnu): Rename parameters.  Deal with
1379         an operand of Character type.  Factor out range generation to the end.
1380         Check that the bounds are literals and convert them to the type of the
1381         operand before building the ranges.
1382         * gcc-interface/utils.c (make_dummy_type): Minor tweak.
1383         (make_packable_type): Propagate TYPE_DEBUG_TYPE.
1384         (maybe_pad_type): Likewise.
1386 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1388         * sem_ch4.adb (Try_Object_Operation): Handle properly a prefixed call
1389         in an instance, when the generic parameters include an interface type
1390         and a abstract operation of that type, and the actuals in the instance
1391         include an interface type and a corresponding abstract operation of it,
1392         with a different name than the corresponding generic subprogram
1393         parameter.
1395 2018-07-17  Arnaud Charlet  <charlet@adacore.com>
1397         * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
1398         cases.
1400 2018-07-17  Arnaud Charlet  <charlet@adacore.com>
1402         * checks.adb (Apply_Division_Check): Add provision for floating-point
1403         checks.
1405 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1407         * exp_aggr.adb (Component_OK_For_Backend): If an array component of the
1408         enclosing record has a bound that is out of range (and that has been
1409         rewritten as a raise statement) the aggregate is not OK for any back
1410         end, and should be expanded into individual assignments.
1412 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1414         * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
1416 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1418         * sem_util.ads (Denotes_Same_Object): Likewise.
1419         * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
1421 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1423         * exp_disp.adb (Make_Tags): When the type has user-defined primitives,
1424         build the access type that is later used by Build_Get_Prim_Op_Address
1425         as pointing to a subtype of Ada.Tags.Address_Array.
1427 2018-07-17  Patrick Bernardi  <bernardi@adacore.com>
1429         * libgnat/s-memory__mingw.adb: Remove.
1430         * Makefile.rtl: Remove s-memory.adb target pair from the Cygwin/Mingw32
1431         section.
1433 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1435         * frontend.adb (Frontend): The removal of ignored Ghost code must be
1436         the last semantic operation performed on the tree.
1438 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1440         * frontend.adb (Frontend): Update the call to Register_Config_Switches.
1441         * inline.ads: Add new component Config_Switches to record
1442         Pending_Body_Info which captures the configuration state of the pending
1443         body.  Remove components Version, Version_Pragma, SPARK_Mode, and
1444         SPARK_Mode_Pragma from record Pending_Body_Info because they are
1445         already captured in component Config_Switches.
1446         * opt.adb (Register_Opt_Config_Switches): Rename to
1447         Register_Config_Switches.
1448         (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1449         (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1450         routine is now a function, and returns the saved configuration state as
1451         an aggregate to avoid missing an attribute.
1452         (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1453         * opt.ads (Register_Opt_Config_Switches): Rename to
1454         Register_Config_Switches.
1455         (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
1456         (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
1457         routine is now a function.
1458         (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
1459         * par.adb (Par): Update the calls to configuration switch-related
1460         subprograms.
1461         * sem.adb (Semantics): Update the calls to configuration switch-related
1462         subprograms.
1463         * sem_ch10.adb (Analyze_Package_Body_Stub): Update the calls to
1464         configuration switch-related subprograms.
1465         (Analyze_Protected_Body_Stub): Update the calls to configuration
1466         switch-related subprograms.
1467         (Analyze_Subprogram_Body_Stub): Update calls to configuration
1468         switch-related subprograms.
1469         * sem_ch12.adb (Add_Pending_Instantiation): Update the capture of
1470         pending instantiation attributes.
1471         (Inline_Instance_Body): Update the capture of pending instantiation
1472         attributes.  It is no longer needed to explicitly manipulate the SPARK
1473         mode.
1474         (Instantiate_Package_Body): Update the restoration of the context
1475         attributes.
1476         (Instantiate_Subprogram_Body): Update the restoration of context
1477         attributes.
1478         (Load_Parent_Of_Generic): Update the capture of pending instantiation
1479         attributes.
1480         (Set_Instance_Env): Update the way relevant configuration attributes
1481         are saved and restored.
1483 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1485         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
1486         more rvalues in the expression of a renaming.
1488 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1490         * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
1491         METHOD_TYPE too.
1492         (TYPE_RETURN_UNCONSTRAINED_P): Likewise.
1493         (TYPE_CI_CO_LIST): Likewise.
1494         * gcc-interface/gigi.h (is_cplusplus_method): Delete.
1495         (fntype_same_flags_p): Adjust comment.
1496         * gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
1497         (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
1498         attribute directly.
1499         (is_cplusplus_method): Make static and adjust head comment.
1500         (gnat_to_gnu_param): Return a pointer for the "this" parameter of
1501         C++ constructors.
1502         (gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
1503         callable form.  Generate a METHOD_TYPE node for imported C++ methods.
1504         Set param_list at the very end of the processing.
1505         (substitute_in_type) <METHOD_TYPE>: New case.
1506         * gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
1507         (gnat_type_hash_eq): Accept METHOD_TYPE.
1508         * gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
1509         (Attribute_to_gnu): Likewise.
1510         (Call_to_gnu): Likewise.
1511         (process_freeze_entity): Likewise.
1512         * gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
1513         (fntype_same_flags_p): Likewise.
1515 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1517         * inline.adb (Expand_Inlined_Call): Remove extra parentheses.
1519 2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>
1521         * exp_disp.adb (Gen_Parameters_Profile): Make the _Init parameter an
1522         In/Out parameter.
1523         (Set_CPP_Constructors): Adjust comment accordingly.
1525 2018-07-17  Bob Duff  <duff@adacore.com>
1527         * exp_disp.adb (Build_Class_Wide_Check): Return early if the
1528         precondition is supposed to be ignored.
1530 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1532         * sem_ch6.adb (Check_Untagged_Equality): Extend check to operations
1533         declared in the same scope as the operand type, when that scope is a
1534         procedure.
1536 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1538         * exp_unst.adb (Unnest_Subprograms): Do nothing if the expander is not
1539         active.  Don't use Get_Actual_Subtype for record subtypes.  Ignore
1540         rewritten identifiers and uplevel references to bounds of types that
1541         come from the original type reference.
1543 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1545         * exp_ch13.adb, exp_ch7.adb, exp_unst.adb, freeze.adb,
1546         libgnat/s-os_lib.adb, sem_ch3.adb, sem_ch3.ads, sem_ch5.adb,
1547         sem_eval.adb, sem_res.adb, sem_util.adb: Minor reformatting.
1549 2018-07-17  Javier Miranda  <miranda@adacore.com>
1551         * exp_ch13.adb (Expand_N_Freeze_Entity): Handle subtype declared for an
1552         iterator.
1553         * freeze.adb (Freeze_Expression): Handle freeze of an entity defined
1554         outside of a subprogram body. This case was previously handled during
1555         preanalysis; the frozen entities were remembered and left pending until
1556         we continued freezeing entities outside of the subprogram. Now, when
1557         climbing the parents chain to locate the correct placement for the
1558         freezeing node, we check if the entity can be frozen and only when no
1559         enclosing node is marked as Must_Not_Freeze the entity is frozen.
1560         * sem_ch3.ads (Preanalyze_Default_Expression): Declaration moved to the
1561         package body.
1562         * sem_ch3.adb (Preanalyze_Default_Expression): Code adjusted to invoke
1563         the new subprogram Preanalyze_With_Freezing_And_Resolve.
1564         * sem_ch6.adb (Preanalyze_Formal_Expression): New subprogram.
1565         (Analyze_Expression_Function, Process_Formals): Invoke
1566         Preanalyze_Formal_Expression instead of Preanalyze_Spec_Expression
1567         since the analysis of the formals may freeze entities.
1568         (Analyze_Subprogram_Body_Helper): Skip building the body of the
1569         class-wide clone for eliminated subprograms.
1570         * sem_res.ads, sem_res.adb (Preanalyze_And_Resolve): New subprogram.
1571         Its code is basically the previous version of this routine but extended
1572         with an additional parameter which is used to specify if during
1573         preanalysis we are allowed to freeze entities.  If the new parameter is
1574         True then the subtree root node is marked as Must_Not_Freeze and no
1575         entities are frozen during preanalysis.
1576         (Preanalyze_And_Resolve): Invokes the internal version of
1577         Preanalyze_And_Resolve without entity freezing.
1578         (Preanalyze_With_Freezing_And_Resolve): Invokes the internal version of
1579         Prenalyze_And_Resolve with freezing enabled.
1581 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1583         * einfo.ads, libgnat/g-comlin.ads: Minor change "ie" to "i.e." in docs
1584         and comments.
1586 2018-07-17  Justin Squirek  <squirek@adacore.com>
1588         * libgnat/s-os_lib.adb (Argument_String_To_List): Fix trimming of
1589         whitespace.
1591 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1593         * sem_prag.adb (Has_Visible_State): Do not consider constants as
1594         visible state because it is not possible to determine whether a
1595         constant depends on variable input.
1596         (Propagate_Part_Of): Add comment clarifying the behavior with respect
1597         to constant.
1599 2018-07-17  Yannick Moy  <moy@adacore.com>
1601         * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
1602         being propagated in GNATprove mode.
1604 2018-07-17  Dmitriy Anisimkov  <anisimko@adacore.com>
1606         * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
1607         public components of Inet_Addr_Type. Introduce public binary
1608         operations.
1610 2018-07-17  Javier Miranda  <miranda@adacore.com>
1612         * exp_ch7.adb (Make_Transient_Block): When determining whether an
1613         enclosing scope already handles the secondary stack, take into account
1614         transient blocks nested in a block that do not manage the secondary
1615         stack and are located within a loop.
1617 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1619         * sem_util.adb (Enclosing_Subprogram): Protected entries and task
1620         entries must be treated separately: task entries are within the
1621         enclosing subprogram of the task type, while protected entries are
1622         transformed into the corresponding Protected_Body_Subprogram, which is
1623         the enclosing_subprogram of any subprogram declared within the entry
1624         body.
1626 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1628         * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
1629         sections on -gnatH and -gnatJ compiler switches.
1630         * gnat_ugn.texi: Regenerate.
1632 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1634         * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
1635         table.
1636         * atree.adb: Add a soft link for a procedure which is invoked whenever
1637         an ignored Ghost node or entity is created.
1638         (Change_Node): Preserve relevant attributes which come from the Flags
1639         table.
1640         (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
1641         entity.
1642         (Rewrite): Preserve relevant attributes which come from the Flags
1643         table.
1644         (Set_Ignored_Ghost_Recording_Proc): New routine.
1645         * atree.ads: Define an access-to-suprogram type for a soft link which
1646         records a newly created ignored Ghost node or entity.
1647         (Set_Ignored_Ghost_Recording_Proc): New routine.
1648         * ghost.adb: Remove with and use clause for Lib.  Remove table
1649         Ignored_Ghost_Units.  Add new table Ignored_Ghost_Nodes.
1650         (Add_Ignored_Ghost_Unit): Removed.
1651         (Initialize): Initialize the table which stores ignored Ghost nodes.
1652         Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
1653         ignored Ghost node.
1654         (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
1655         an eliminated ignored Ghost unit.
1656         (Lock): Release and lock the table which stores ignored Ghost nodes.
1657         (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
1658         Ghost nodes.
1659         (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
1660         ignored Ghost nodes.
1661         (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
1662         (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
1663         Ghost nodes.
1664         (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
1665         (Propagate_Ignored_Ghost_Code): Removed.
1666         (Record_Ignored_Ghost_Node): New routine.
1667         (Remove_Ignored_Ghost_Code): Reimplemented.
1668         (Remove_Ignored_Ghost_Node): New routine.
1669         (Ultimate_Original_Node): New routine.
1670         * ghost.ads (Check_Ghost_Completion): Removed.
1671         * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
1672         package clause as ignored Ghost if applicable.
1673         * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
1675 2018-07-17  Javier Miranda  <miranda@adacore.com>
1677         * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
1678         to reuse it.
1679         (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
1680         of the loop iterator relies on the secondary stack.
1682 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1684         * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
1685         which happens for inlined calls, then fetch the next actual from the
1686         original AST.
1688 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1690         * einfo.ads: Update documentation for Scalar_Range.
1692 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1694         * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
1695         the Standard package.
1697 2018-07-17  Piotr Trojanek  <trojanek@adacore.com>
1699         * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
1701 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1703         * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
1704         synchronized types that are completions of limited types or private
1705         extensions.
1706         (Scope_Within): Handle properly accept statements in task bodies.
1708 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1710         * sem_prag.adb (Has_Visible_State): Do not consider generic formals
1711         because they are not part of the visible state space. Add constants to
1712         the list of acceptable visible states.
1713         (Propagate_Part_Of): Do not consider generic formals when propagating
1714         the Part_Of indicator.
1715         * sem_util.adb (Entity_Of): Do not follow renaming chains which go
1716         through a generic formal because they are not visible for SPARK
1717         purposes.
1718         * sem_util.ads (Entity_Of): Update the comment on usage.
1720 2018-07-17  Ed Schonberg  <schonberg@adacore.com>
1722         * sem_util.adb (Gather_Components): A discriminant of an ancestor may
1723         have been constrained by a later ancestor, so when looking for the
1724         value of that hidden discriminant we must examine the stored constraint
1725         of other ancestors than the immediate parent type.
1727 2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
1729         * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
1730         constructs and entities within receive new entities when replicating a
1731         tree.
1732         (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
1733         and entities within receive new entities when replicating a tree.
1734         * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
1735         (Visit_Entity): Visit entities within scoping constructs inside
1736         expression with actions nodes when requested by the caller. Add blocks,
1737         labels, and procedures to the list of entities which need replication.
1738         * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
1739         the comment on usage.
1741 2018-07-17  Arnaud Charlet  <charlet@adacore.com>
1743         * doc/gnat_ugn/about_this_guide.rst,
1744         doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
1745         * gnat_ugn.texi: Regenerate.
1747 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1749         * contracts.adb (Analyze_Contracts): Add specialized processing for
1750         package instantiation contracts.
1751         (Analyze_Package_Contract): Remove the verification of a missing
1752         Part_Of indicator.
1753         (Analyze_Package_Instantiation_Contract): New routine.
1754         * contracts.ads (Analyze_Package_Contract): Update the comment on
1755         usage.
1756         * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
1757         instance is being examined when trying to determine whether a package
1758         instantiation needs a Part_Of indicator.
1760 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1762         * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
1763         sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
1764         sem_util.adb: Minor reformatting.
1766 2018-07-16  Arnaud Charlet  <charlet@adacore.com>
1768         * frontend.adb: Only unnest subprograms if no previous errors were
1769          detected.
1771 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1773         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
1774         contain blocks in the elaboration code for a package body. Create the
1775         elaboration subprogram wrapper only if there is a subprogram
1776         declaration in a block or loop.
1778 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1780         * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
1781         deep copy of the left operand when building each conjuct of the
1782         expanded membership operation, to avoid sharing nodes between them.
1783         This sharing interferes with the unnesting machinery and is generally
1784         undesirable.
1786 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1788         * exp_unst.adb (Visit_Node): Handle 'Address references that are
1789         calls.
1791 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1793         * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
1794         in relevant nodes: Allocate, Free, and return statements.
1796 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1798         * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
1799         instance that carries an aspect Default_Storage_Pool that overrides a
1800         default storage pool that applies to the generic unit. The aspect in
1801         the generic unit was removed before copying it in the instance, rather
1802         than removing it from the copy of the aspects that are appended to the
1803         aspects in the instance.
1805 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1807         * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
1808         loop parameters.
1809         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
1810         bodies.
1811         * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
1812         entry body to be the corresponding generated subprogram, for correct
1813         analysis of uplevel references.
1814         * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
1815         Ignore pragmas, fix component associations.
1816         (Register_Subprograms): Subprograms in synchronized types must be
1817         treated as reachable.
1819 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1821         * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
1822         states and variables.
1824 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1826         * sinfo.ads, sinfo.adb (Withed_Body): Remove.
1827         (Set_Withed_Body): Remove.
1829 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1831         * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
1832         when printing debug info.
1834 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1836         * sem.adb (Walk_Library_Items): Reuse local constant.
1837         (Is_Subunit_Of_Main): Turn condition to positive and flip the
1838         IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
1839         Lib variable.
1841 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1843         * sem.adb (Walk_Library_Items): Deconstruct dead code.
1845 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1847         * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
1848         Expand_Nonbinary_Modular_Op.  Needed for unnesting.
1850 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
1852         * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
1853         static predicate (for example True) but has no
1854         static_discrete_predicate.
1856 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1858         * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
1859         class-wide types and record extensions.
1861 2018-07-16  Justin Squirek  <squirek@adacore.com>
1863         * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
1864         checks on expanded literals within if and case expressions.
1866 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1868         * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
1869         longest sequence factor. Code clean up.
1870         (Wide_Wide_String_To_String): Use the appropriate longest sequence
1871         factor.  Code clean up.
1873 2018-07-16  Javier Miranda  <miranda@adacore.com>
1875         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
1876         on Bit_Order when defined for a record extension.
1878 2018-07-16  Arnaud Charlet  <charlet@adacore.com>
1880         * libgnat/s-objrea.ads: Minor code clean up.
1882 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
1884         * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
1885         rule.
1887 2018-07-16  Arnaud Charlet  <charlet@adacore.com>
1889         * adaint.c (__gnat_set_file_time_name): Code clean up.
1891 2018-07-16  Javier Miranda  <miranda@adacore.com>
1893         * inline.adb (Build_Body_To_Inline): Minor code reorganization that
1894         ensures that calls to function Has_Single_Return() pass a decorated
1895         tree.
1896         (Has_Single_Return.Check_Return): Peform checks on entities (instead on
1897         relying on their characters).
1899 2018-07-16  Javier Miranda  <miranda@adacore.com>
1901         * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
1902         to avoid generating an ill-formed tree that confuses gnatprove causing
1903         it to blowup.
1905 2018-07-16  Yannick Moy  <moy@adacore.com>
1907         * inline.adb (Has_Single_Return): Rewrap comment.
1909 2018-07-16  Eric Botcazou  <ebotcazou@adacore.com>
1911         * einfo.ads: Minor tweak in comment.
1913 2018-07-16  Javier Miranda  <miranda@adacore.com>
1915         * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
1917 2018-07-16  Javier Miranda  <miranda@adacore.com>
1919         * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
1920         transform 'Count into a function call if the current scope has been
1921         eliminated.
1923 2018-07-16  Javier Miranda  <miranda@adacore.com>
1925         * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
1926         public part of this package.
1928 2018-07-16  Yannick Moy  <moy@adacore.com>
1930         * sem_res.adb (Resolve_Call): Do not inline calls inside
1931         compiler-generated functions translated as predicates in GNATprove.
1933 2018-07-16  Gary Dismukes  <dismukes@adacore.com>
1935         * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
1936         addition to the existing test for no Storage_Pool as a condition
1937         enabling generation of the call to Check_Standard_Allocator when the
1938         restriction No_Standard_Allocators_After_Elaboration is active.
1939         * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
1940         say that Storage_Error will be raised (rather than Program_Error).
1941         * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
1942         rather than Program_Error when Elaboration_In_Progress is False.
1944 2018-07-16  Gary Dismukes  <dismukes@adacore.com>
1946         * sem_eval.adb: Fix spelling for compile-time-known.
1948 2018-07-16  Hristian Kirtchev  <kirtchev@adacore.com>
1950         * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
1951         the compiler from entering infinite recursion when trying to determine
1952         whether a deferred constant has a compile time known value, and the
1953         initialization expression of the constant is a reference to the
1954         constant itself.
1956 2018-07-16  Nicolas Roche  <roche@adacore.com>
1958         * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
1959         factor from 1/32 to 1/2 for Unbounded_String.
1961 2018-07-13  Eric Botcazou  <ebotcazou@adacore.com>
1963         * gcc-interface/lang.opt (funsigned-char): New option.
1964         * gcc-interface/misc.c (gnat_handle_option): Accept it.
1965         * gcc-interface/utils.c (finish_character_type): Tweak comment.
1967 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
1969         * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
1970         variable and use it throughout.
1971         <E_Variable>: If the nominal subtype of the object is unconstrained,
1972         compute the Ada size separately and put in on the padding type if the
1973         size is not fixed.
1974         <E_Record_Type>: Minor tweak.
1975         * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
1976         into max_size_unit throughout.
1978 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
1980         * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
1981         * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
1982         * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
1983         (add_decl_expr): Change type of second parameter and rename it.
1984         (renaming_from_instantiation_p): New function moved from...
1985         (set_expr_location_from_node): Test for exceptions here and add one
1986         for actual subtypes built for unconstrained composite actuals.
1987         * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
1989 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
1991         * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
1992         and adjust recursive calls.
1993         (Identifier_to_gnu): Adjust calls to lvalue_required_p.
1994         (gnat_to_gnu): Likewise.
1996 2018-07-07  Eric Botcazou  <ebotcazou@adacore.com>
1998         * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
1999         (gnat_to_gnu_subprog_type): New pure_flag local variable.  Set it for
2000         a pure Ada function with a by-ref In parameter.  Propagate it onto the
2001         function type by means of the TYPE_QUAL_RESTRICT flag.
2002         * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
2003         function type has the TYPE_QUAL_RESTRICT flag set.
2005 2018-07-06  Jim Wilson  <jimw@sifive.com>
2007         * Makefile.rtl: Add riscv*-linux* support.
2008         * libgnarl/s-linux__riscv.ads: New.
2009         * libgnat/system-linux-riscv.ads: New.
2011         * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
2012         (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
2013         * gcc-interface/Makefile.in (xoscons): Likewise.
2015 2018-07-06  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2017         * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
2018         (ZCX_By_Default): Set to True.
2020 2018-07-02  Martin Liska  <mliska@suse.cz>
2022         * gnatvsn.ads: Bump Library_Version to 9.
2024 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2026         * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
2027         using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
2028         (TYPE_ALIGN_OK): Move around.
2029         (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
2030         * gcc-interface/decl.c (change_qualified_type): Move to...
2031         (gnat_to_gnu_entity): Adjust comment.
2032         * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
2033         (ceil_pow2): Use ceil_log2.
2034         * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
2035         and do not set TREE_SIDE_EFFECTS.
2036         (handle_noreturn_attribute): Use change_qualified_type.
2038 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2040         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
2041         the expression of a dispatch table that is not being defined.
2042         <E_Record_Subtype>: Remove obsolete kludge.
2044 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2046         * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
2047         for discriminants.
2048         (warn_on_list_placement): New static function.
2049         (components_to_record): Use it to warn on multiple fields in list.
2051 2018-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2053         * gcc-interface/decl.c (variant_desc): Add AUX field.
2054         (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
2055         directly.
2056         (reverse_sort_field_list): New static function.
2057         (components_to_record): Place the variant part at the beginning of the
2058         field list when there is an obvious order of increasing position.
2059         (build_variant_list): Initialize it.
2060         (create_variant_part_from): Do not call compute_record_mode directly.
2061         (copy_and_substitute_in_layout): Likewise.  Always sort the fields with
2062         fixed position in order of increasing position, in the record and all
2063         the variants, in any.  Call reverse_sort_field_list.
2064         * gcc-interface/utils.c (make_packable_type): Compute the sizes before
2065         calling finish_record_type.  Do not call compute_record_mode directly.
2066         (finish_record_type): Overhaul final processing depending on REP_LEVEL
2067         and call finish_bitfield_layout if it is equal to one or two.
2069 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2071         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
2072         existing fields of a dummy fat pointer type, if any.  Clear the
2073         TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
2075 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2077         * contracts.adb (Process_Body_Postconditions): Expand only checked
2078         postconditions.
2079         (Process_Contract_Cases_For): Expand only checked contract cases.
2080         (Process_Inherited_Preconditions): Ignored class-wide preconditions are
2081         partially expanded because some of their semantic checks are tied to
2082         the expansion.
2083         (Process_Preconditions_For): Expand only checked preconditions.
2084         (Process_Spec_Postconditions): Expand only checked preconditions.
2085         Ignored class-wide preconditions are partially expanded because some of
2086         their semantic checks are tied to the expansion.
2087         * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
2088         assertion pragmas.
2089         * exp_util.adb (Add_Inherited_Invariants): Code clean up.
2090         * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
2092 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2094         * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
2095         libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
2096         libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
2097         reformatting.
2099 2018-06-11  Gary Dismukes  <dismukes@adacore.com>
2101         * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
2103 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2105         * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
2106         not add any actuals when the size of the object is known, and the
2107         caller will allocate it.
2108         (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
2109         better illustrate its functionality. Update the comment on the
2110         generated code.  Generate a branch for the heap and pool cases where
2111         the object is not necessarity controlled.
2112         (Expand_N_Extended_Return_Statement): Expand the extended return
2113         statement into four branches depending the requested mode if the caller
2114         will not allocate the object on its side.
2115         (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
2116         object on the caller side because this will violate the semantics of
2117         finalizable types. Instead notify the function to allocate the object
2118         on the heap or a user-defined storage pool.
2119         (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
2120         which of the four modes to employ when returning a limited controlled
2121         result.
2122         * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
2123         guard which is already covered in Needs_Finalization.
2125 2018-06-11  Olivier Hainque  <hainque@adacore.com>
2127         * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
2128         * libgnat/a-exexpr.adb: ... Here, then add comments describing the
2129         major datastructures associated with the current exception raised.
2130         (Setup_Current_Excep): Accept a "Phase" argument conveying the
2131         unwinding phase during which this subprogram is called.  For an Ada
2132         exception, don't update the current exception buffer from the raised
2133         exception object during SEARCH_PHASE, as this is redundant with the
2134         call now issued just before propagation starts.
2135         (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
2136         the unwinding start, conveying Phase 0.
2137         (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
2138         the call to Setup_Current_Excep.
2139         * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
2140         on calls to Setup_Current_Excep.
2142 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2144         * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
2145         Build_Access_Type_Decl): New subprograms to handle uplevel references
2146         to formals of an unconstrained array type. The activation record
2147         component for these is an access type, and the reference is rewritten
2148         as an explicit derefenrence of that component.
2150 2018-06-11  Bob Duff  <duff@adacore.com>
2152         * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
2153         libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
2154         (Element): Add code to detect dangling cursors in some cases.
2156 2018-06-11  Yannick Moy  <moy@adacore.com>
2158         * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
2159         from source.
2161 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2163         * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
2164         that its parent is already frozen so that its predicate function, if
2165         any, has already been constructed.
2167 2018-06-11  Yannick Moy  <moy@adacore.com>
2169         * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
2170         possible task unit as the enclosing context.
2172 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2174         * gnat1drv.adb: Remove use clause for Repinfo.
2175         (Gnat1drv): Beef up comment about the interplay between -gnatc and
2176         back-end annotations.  Use full qualified name for List_Rep_Info.
2178 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2180         * libgnat/g-arrspl.ads: Add pragma Preelaborate.
2182 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2184         * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
2185         then" and general logical "ada" in codepeer mode.
2187 2018-06-11  Javier Miranda  <miranda@adacore.com>
2189         * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
2190         N_Call_Marker nodes.
2192 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2194         * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
2195         reformatting.
2197 2018-06-11  Yannick Moy  <moy@adacore.com>
2199         * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
2200         argument to Assertion_Policy
2201         * gnat_rm.texi: Regenerate.
2203 2018-06-11  Yannick Moy  <moy@adacore.com>
2205         * gnat1drv.adb: Do not check representation information in CodePeer and
2206         GNATprove modes, as these modes call a special backend instead of gigi,
2207         so do not have the information.
2209 2018-06-11  Yannick Moy  <moy@adacore.com>
2211         * inline.adb (Build_Body_To_Inline): Consider case of extended return
2212         of unconstrained type as one case where inlining is not supported.
2213         (Expand_Inlined_Call): Remove special case for body as extended return
2214         of unconstrained type.
2216 2018-06-11  Yannick Moy  <moy@adacore.com>
2218         * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
2219         unit.
2220         (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
2222 2018-06-11  Piotr Trojanek  <trojanek@adacore.com>
2224         * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
2225         expressions in Pre/Post contracts while in GNATprove_Mode.
2227 2018-06-11  Piotr Trojanek  <trojanek@adacore.com>
2229         * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
2230         with AND THEN expressions broken down into individual conjuncts.
2232 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2234         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
2236 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2238         * exp_unst.adb (Visit_Node): Skip generic associations.
2240 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2242         * libgnat/memtrack.adb (fwrite): Remove second definition.
2244 2018-06-11  Javier Miranda  <miranda@adacore.com>
2246         * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
2247         (Is_Static_Coextension): Adding documentation.
2248         * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
2249         (Is_Static_Coextension): Extending the assertion.
2250         * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
2251         setting flag Is_Dynamic_Coextension (and vice versa).
2253 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2255         * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
2256         level of a compilation unit, becuase they may contain nested
2257         subprograms that need an activation record.
2259 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2261         * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
2263 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2265         * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
2266         Minor reformatting.
2267         * sinfo.ads: Fix a typo.
2269 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2271         * inline.adb (Expand_Inlined_Call): If no optimization level is
2272         specified, the expansion of a call to an Inline_Always function is
2273         fully performed in the front-end even on a target that support back-end
2274         inlining.
2276 2018-06-11  Arnaud Charlet  <charlet@adacore.com>
2278         * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
2279         with Sec_Stack_Used.
2281 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
2283         * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
2284         Is_Assignment_LHS further in. Use predicate
2285         Needs_Variable_Reference_Marker to determine whether to create a
2286         variable marker.
2287         (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
2288         in.  Use predicate Needs_Variable_Reference_Marker to determine whether
2289         to create a variable marker.
2290         * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
2291         checks that determine whether the identifier or expanded name is a
2292         suitable variable reference.  The checks are now performed by
2293         Needs_Variable_Reference_Marker.
2294         * sem_res.adb (Resolve_Actuals): Use predicate
2295         Needs_Variable_Reference_Marker to determine whether to create a
2296         variable marker.
2297         * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
2298         * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
2300 2018-06-11  Valentine Reboul  <reboul@adacore.com>
2302         * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
2303         "Community Edition".
2305 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2307         * sem_ch12.adb (Install_Body): In order to determine the placement of
2308         the freeze node for an instance of a generic nested within another
2309         instance, take into account that the outer instance may be declared in
2310         the visible part of a package and the inner intance may be in the
2311         private part of the same package.
2313 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2315         * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
2317 2018-06-11  Nicolas Roche  <roche@adacore.com>
2319         * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
2320         stack overflow while raising a constraint error.
2322 2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>
2324         * repinfo.ads (Rep_Value): Use a single line.
2325         * repinfo.adb (Rep_Value): Likewise.
2326         (List_Attr): Do not use string concatenation.
2328 2018-06-11  Ed Schonberg  <schonberg@adacore.com>
2330         * exp_unst.adb (Visit_Node): Check reference to formal parameter of
2331         current procedure, because the bounds of its type may be uplevel
2332         references.
2334 2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>
2336         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
2337         not a definition, retrieve the expression only if it's a compile-time
2338         known value if we are just annotating types.
2340         * gcc-interface/utils.c (convert): Do not try to upcast properly for a
2341         conversion between tagged types in type_annotate_only mode.
2343 2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>
2345         * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
2346         * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
2347         type built for an aliased component with variable size.
2349 2018-05-31  Pierre-Marie de Rodat  <derodat@adacore.com>
2351         * doc/gnat_ugn/project-manager-figure.png: Delete.
2353 2018-05-31  Pierre-Marie de Rodat  <derodat@adacore.com>
2355         * vxworks-arm-link.spec, vxworks-e500-link.spec,
2356         vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
2357         vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
2358         vxworks-smp-x86-link.spec: New files.
2360 2018-05-31  Pierre-Marie de Rodat  <derodat@adacore.com>
2362         * gnatvsn.adb: Re-center the copyright header.
2363         * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
2365 2018-05-31  Fedor Rybin  <frybin@adacore.com>
2367         * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
2368         gnattest section on user guide.
2370 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2372         * sem_res.adb (Resolve_String_Literal): If the type is a string type
2373         whose component subtype has a static predicate, ensure that the
2374         predicate is applied to each character by expanding the string into the
2375         equivalent aggregate. This is also done if the component subtype is
2376         constrained.
2378 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2380         * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
2382 2018-05-31  Piotr Trojanek  <trojanek@adacore.com>
2384         * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
2385         explicit spec.
2387 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2389         * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
2390         the type of the parameter is an unconstrained array type, convert
2391         to the type of the actual before the type of the formal only if the
2392         conversion was suppressed earlier.  Use in_param and gnu_actual_type
2393         local variables throughout, and uniform spelling for In Out or Out.
2394         Also remove dead code in the component-by-reference case.
2396 2018-05-31  Frederic Konrad  <konrad@adacore.com>
2398         * tracebak.c (STOP_FRAME): Harden condition.
2399         (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
2400         mode.
2402 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2404         * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
2405         check to a call to a build-in-place function, given that the return
2406         object is limited and cannot be copied.
2408 2018-05-31  Olivier Hainque  <hainque@adacore.com>
2410         * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
2411         builtins.
2413 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2415         * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2416         there is no target, also create a temporary for the return value for
2417         an allocator if the type is an unconstrained record type with default
2418         discriminant.
2420 2018-05-31  Hristian Kirtchev  <kirtchev@adacore.com>
2422         * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
2423         boudary for a transient scope.
2425 2018-05-31  Valentine Reboul  <reboul@adacore.com>
2427         * gnatvsn.ads: Rename "GPL" version to "Community".
2429 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2431         * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
2432         flag.
2434 2018-05-31  Piotr Trojanek  <trojanek@adacore.com>
2436         * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
2437         with a semantically equivalent call to Defining_Entity.
2439 2018-05-31  Piotr Trojanek  <trojanek@adacore.com>
2441         * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
2442         Max_Queue_Length expression.
2444 2018-05-31  Sergey Rybin  <rybin@adacore.com>
2446         * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
2447         that the main unit to be built before the call, now it computes the
2448         closure of the main unit itself.
2449         * gnat_ugn.texi: Regenerate.
2451 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2453         * repinfo.adb (List_Structural_Record_Layout): Set First to false
2454         after having listed the fields of the parent type, if any.
2456 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2458         * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
2459         deal with the ___XP suffix for packed array types here...
2460         <E_Array_Subtype>: ...or here when processing the implementation type
2461         but when processing the original type instead.  Do not reuse the DECL
2462         of the implementation type for the original type.  Tidy up.
2464 2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>
2466         * einfo.ads (Object_Size_Clause): Declare.
2467         * einfo.adb (Object_Size_Clause): New function.
2468         * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
2469         retrieving Size_Clause and post the warning on the object size clause
2470         if Has_Object_Size_Clause is true.
2472 2018-05-31  Javier Miranda  <miranda@adacore.com>
2474         * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
2475         * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
2476         Find_Primitive_Eq to search for the primitive of types whose underlying
2477         type is a tagged type.
2479 2018-05-31  Yannick Moy  <moy@adacore.com>
2481         * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
2482         order of treatment between nodes recognized as loop pragmas (or
2483         generated from one) and block statements.
2485 2018-05-31  Doug Rupp  <rupp@adacore.com>
2487         * libgnat/s-osprim__posix2008.adb (Clock): Implement using
2488         clock_gettime.
2490 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2492         * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
2493         mark subprograms that cannot be eliminated because they must be treated
2494         as reachable from outside the current unit. This includes entry bodies
2495         and protected operations.
2497 2018-05-31  Ed Schonberg  <schonberg@adacore.com>
2499         * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
2500         Convert all operands of the generated code to Standard.Unsigned, to
2501         prevent spurious visibility errors. This is needed when the generated
2502         expansion involves a modular index type of an array type, and the index
2503         type is not immediately visible.
2505 2018-05-30  Piotr Trojanek  <trojanek@adacore.com>
2507         * einfo.ads (Package_Instantiation): Update comment after a routine
2508         that uses this field has been renamed.
2510 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2512         * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
2513         if the local raise statement includes a string expression. This
2514         expression might be picked up by an outer handler or discarded, but
2515         plays no role in this transformation.
2517 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2519         * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
2520         reformatting.
2522 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2524         * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
2525         field in relevant nodes: Allocate, Free, and return statements.
2527 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2529         * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
2530         that has not been analyzed, as will be the case for a nested aggregate
2531         that is expanded into individual assignments.
2533 2018-05-30  Justin Squirek  <squirek@adacore.com>
2535         * aspects.adb, aspects.ads: Register new aspect.
2536         * par-prag.adb (Prag): Register new pragma.
2537         * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
2538         aspect similar to Aspect_Max_Queue_Length.
2539         * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
2540         set it to use the same processing as Pragma_Max_Queue_Length.
2541         * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
2542         that it can be processed as a pragma in addition to a restriction and
2543         add an entry for the pragma itself.
2545 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2547         * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
2548         is now legal on a variable of composite type initialized with an
2549         aggregate that is fully static and requires no elaboration code.
2550         * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
2551         nested aggregates that are compile-time static, so they can be used to
2552         initialize variables declared with Threqd_Local_Storage.
2553         * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
2554         Thread_Local_Storage.
2555         * gnat_rm.texi: Regenerate.
2557 2018-05-30  Yannick Moy  <moy@adacore.com>
2559         * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
2560         GNATprove modes.
2562 2018-05-30  Justin Squirek  <squirek@adacore.com>
2564         * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
2565         Add implementation.
2566         (Start_Search): Modify to use Start_Search_Internal
2567         (Start_Search_Internal): Add to break out an extra flag for searching
2568         case insensative due to the potential for directories within the same
2569         OS to allow different casing schemes.
2570         * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
2571         for when the more precise solution fails.
2573 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2575         * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
2576         Minor reformatting.
2578 2018-05-30  Pascal Obry  <obry@adacore.com>
2580         * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
2581         * libgnat/g-comlin.adb: Add corresponding implementation.
2583 2018-05-30  Gary Dismukes  <dismukes@adacore.com>
2585         * sem_res.adb, sem_util.adb: Fix several typos.
2587 2018-05-30  Olivier Hainque  <hainque@adacore.com>
2589         * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
2590         (eh_registration_ctors, eh_registration_tors): New static variables,
2591         forced in a .ctors/.dtors section, respectively, with priority.
2593 2018-05-30  Bob Duff  <duff@adacore.com>
2595         * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
2596         freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
2597         sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
2598         sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
2599         sinfo.ads: Spell preanalysis, preanalyze correctly.
2601 2018-05-30  Bob Duff  <duff@adacore.com>
2603         * libgnat/g-sestin.ads: Rework documentation comments.
2605 2018-05-30  Piotr Trojanek  <trojanek@adacore.com>
2607         * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
2608         sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
2609         (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
2611 2018-05-30  Piotr Trojanek  <trojanek@adacore.com>
2613         * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
2615 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2617         * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
2618         in a separate routine.
2619         (Is_Atomic_Object_Entity): New routine.
2620         (Is_Atomic_Prefix): Cleaned up.
2621         (Is_Synchronized_Object): Check that the object is atomic, or its type
2622         is atomic.
2623         (Object_Has_Atomic_Components): Removed.
2624         * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
2625         (Is_Atomic_Object_Entity): New routine.
2627 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2629         * sem_ch3.adb (Access_Subprogram_Declaration): The flag
2630         Needs_Activation_Record is only needed on a subprogram type, not on a
2631         pointer to such.
2632         * sem_res.adb (Resolve_Selected_Component): If the context type and the
2633         component type are anonymous access to subprograms, use the component
2634         type to obtain the proper value of Needs_Activation_Record flag for the
2635         expression.
2637 2018-05-30  Eric Botcazou  <ebotcazou@adacore.com>
2639         * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
2640         comment about the memset case.
2642 2018-05-30  Bob Duff  <duff@adacore.com>
2644         * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
2645         to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
2646         We need to analyze it as part of analyzing the block, so that if the
2647         call to Element that initializes Elmt_Decl returns on the secondary
2648         stack, the block will ss_mark/ss_release. This block is inside the
2649         loop; we don't want to leak memory until the loop exits.  The purpose
2650         of analyzing Elmt_Decl first was to catch the error of modifying it,
2651         which is illegal because it's a loop parameter. The above causes us to
2652         miss that error.  Therefore, we add a flag Is_Loop_Parameter, and set
2653         it on the Element entity, so we end up with an E_Variable node with the
2654         flag set.
2655         * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
2656         * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
2657         parameter not allowed" error if Is_Loop_Parameter.
2658         * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
2659         trigger the call to Diagnose_Non_Variable_Lhs.
2661 2018-05-30  Arnaud Charlet  <charlet@adacore.com>
2663         * checks.adb (Apply_Scalar_Range_Check):
2664         * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
2665         range values for System.Priority in CodePeer mode since the actual
2666         target compiler may provide a wider range.
2668 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2670         * exp_unst.adb: Search specification of main unit as well, for
2671         unnesting.
2673 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2675         * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
2676         a package body that is a compilation unit may contain blocks that
2677         declare local subprograms.  In Subprogram_Unnesting Mode such
2678         subprograms must be handled as nested inside the (implicit) elaboration
2679         procedure that executes that statement part. To handle properly uplevel
2680         references we construct that subprogram explicitly, to contain blocks
2681         and inner subprograms, The statement part of the compilation unit
2682         becomes a call to this subprogram. This is only done if blocks are
2683         present in the statement list of the body.
2685 2018-05-30  Bob Duff  <duff@adacore.com>
2687         * exp_ch7.adb: Minor comment fix.
2689 2018-05-30  Ed Schonberg  <schonberg@adacore.com>
2691         * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
2692         that have no corresponding body and appear as attributes of the
2693         corresponding wrapper package declaration.
2694         (Register_Subprogram): New subprogram, used for subprogram bodies and
2695         for subprogram instantiations to enter callable entity into Subp table.
2697 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2699         * libgnat/s-secsta.adb: Reimplement the secondary stack support.
2700         * libgnat/s-secsta.ads: Update the documentation of all routines in the
2701         public part of the package.  Reimplement the private part of the
2702         package to account for the new secondary stack structure.  Add types
2703         and subprograms for testing purposes.  Add several documentation
2704         sections.
2706 2018-05-30  Hristian Kirtchev  <kirtchev@adacore.com>
2708         * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
2709         exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
2710         libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
2711         sem_disp.ads, sem_util.adb: Minor reformatting.
2713 2018-05-30  Arnaud Charlet  <charlet@adacore.com>
2715         * gcc-interface/Makefile.in: Move special flags for Ada runtime files
2716         from here...
2717         * Makefile.rtl: ... to here.  Update comments.  Protect call to
2718         "GCC_FOR_TARGET" in case target_os isn't defined.
2720 2018-05-30  Arnaud Charlet  <charlet@adacore.com>
2722         * gcc-interface/Makefile.in: Move target pair settings from here...
2723         * Makefile.rtl: ... to here.
2724         (setup-rts): New target.
2726 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2728         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
2729         List of All Switches): Replace "modules" with "units".
2730         (Subprogram Inlining Control): Likewise.
2731         * gnat_ugn.texi: Regenerate.
2732         * usage.adb (Usage): Fix description of -gnatn switch.
2734 2018-05-29  Arnaud Charlet  <charlet@adacore.com>
2736         * gcc-interface/Makefile.in: Fix typos.
2738 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2740         * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
2741         the finalizer procedure in the At_End handler, for use in LLVM
2742         generation.
2744 2018-05-29  Javier Miranda  <miranda@adacore.com>
2746         * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
2747         subprogram Inherits_From_Tagged_Full_View to identify more reliably
2748         untagged private types completed with a derivation of an untagged
2749         private whose full view is a tagged type.
2750         * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
2751         subprogram.
2752         (Collect_Primitive_Operations): Handle untagged private types completed
2753         with a derivation of an untagged private type whose full view is a
2754         tagged type. In such case, collecting the list of primitives we may
2755         find two equality primitives: one associated with the untagged private
2756         and another associated with the ultimate tagged type (and we must
2757         remove from the returned list this latter one).
2759 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2761         * exp_unst.adb (Visit_Node): Handle statement sequences that include an
2762         At_End handler.
2764 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2766         * repinfo.adb (List_Entities): Also recurse into blocks without label.
2768 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2770         * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
2771         exceptions if subprogram unnesting is in effect, because these branch
2772         nodes are relevant only in the presence of nested subprograms.
2774 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2776         * libgnat/s-fatgen.adb (Succ, Pred):  Raise Constraint_Error
2777         unconditionally when applied to the largest positive (resp. largest
2778         negative) value of a floating-point type.
2780 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2782         * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
2783         discriminants and exceptions are never components of such.  The flag
2784         Needs_Activation_Record is set on subprogram types, not on access to
2785         them.
2787 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2789         * sem_ch3.adb: Set scope of component of subtype.
2791 2018-05-29  Ed Schonberg  <schonberg@adacore.com>
2793         * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
2794         carry no type. Such selected components appear in unit names that are
2795         child units, both in the specification and possibly in an end label for
2796         the unit, and they do not contain any relevant uplevel references.
2798 2018-05-29  Arnaud Charlet  <charlet@adacore.com>
2800         * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
2801         function.
2803 2018-05-29  Olivier Hainque  <hainque@adacore.com>
2805         * libgnat/system-vxworks7-ppc-rtp.ads: New file.
2806         * libgnat/system-vxworks7-ppc-kernel.ads: New file.
2807         * libgnat/system-vxworks7-e500-rtp.ads: New file.
2808         * libgnat/system-vxworks7-e500-kernel.ads: New file.
2809         * libgnat/system-vxworks7-x86-rtp.ads: New file.
2810         * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
2811         * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
2812         gnat-crtbe link spec to use the vx7 variant.
2814 2018-05-29  Olivier Hainque  <hainque@adacore.com>
2816         * vx_crtbegin.inc: Use a consistent naming convention for the
2817         registration/deregistration functions across RTP or kernel.  Remove the
2818         ctor/dtor attribute setting based on RTP/kernel, expect the optional
2819         attribute extension to be provided by includers instead.
2820         * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
2821         extension for the registration/deregistration functions.
2822         * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
2823         constructor/destructor attribute extensions.
2824         * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
2825         attribute extensions and declare _ctors/_dtors arrays.
2826         * vx_crtbegin_auto.c: Remove.
2827         * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
2828         vxworks7-gnat-crtbe-link.spec.
2829         * libgnat/system-vxworks7-aarch64.ads: Likewise.
2830         * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
2831         * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
2832         * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
2833         * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
2834         * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
2835         * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
2836         * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
2838 2018-05-29  Piotr Trojanek  <trojanek@adacore.com>
2840         * ali.adb: Minor reformatting.
2842 2018-05-29  Joel Brobecker  <brobecker@adacore.com>
2844         * doc/gnat_ugn/platform_specific_information.rst: Update package
2845         requirements for 32bit GNAT on x86_64-linux.
2846         * gnat_ugn.texi: Regenerate.
2848 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2850         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
2851         Control): Adjust description of -gnatRj.
2852         * gnat_ugn.texi: Regenerate.
2853         * opt.ads (List_Representation_Info_To_JSON): Likewise.
2854         * repinfo.adb (List_Rep_Info): Do not automatically create a file
2855         if List_Representation_Info_To_JSON is true.
2856         * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
2857         check between -gnatRj and -gnatRs.
2858         * usage.adb (Usage): Adjust description of -gnatRj.
2860 2018-05-29  Pascal Obry  <obry@adacore.com>
2862         * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
2863         the root directory.
2865 2018-05-29  Pascal Obry  <obry@adacore.com>
2867         * libgnat/s-os_lib.adb: Minor reformatting.
2869 2018-05-29  Doug Rupp  <rupp@adacore.com>
2871         * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
2872         * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
2873         * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
2874         * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
2876 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2878         * repinfo.ads (JSON format): Document new pair for components.
2879         * repinfo.adb (Derived_Discriminant): New function.
2880         (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
2881         in recursive calls. If the record type is the parent of an extension,
2882         find and list the derived discriminant from the extension, if any.
2883         (List_Component_Layout): List the Discriminant_Number in JSON mode.
2884         (List_Record_Info): Adjust call to List_Structural_Record_Layout.
2886 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2888         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
2889         List of All Switches): Document -gnatRj.
2890         (Debugging Control): Likewise.
2891         * gnat_ugn.texi: Regenerate.
2892         * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
2893         * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
2894         extension if List_Representation_Info_To_JSON is true.
2895         * repinfo.ads: Document the JSON output format.
2896         * repinfo.adb (List_Location): New procedure.
2897         (List_Array_Info): Add support for JSON output.
2898         (List_Entities): Likewise.
2899         (Unop): Likewise.
2900         (Binop): Likewise.
2901         (Print_Expr): Likewise.
2902         (List_Linker_Section): Likewise.
2903         (List_Mechanisms): Likewise.
2904         (List_Name): Likewise.
2905         (List_Object_Info): Likewise.
2906         (List_Record_Info): Likewise.
2907         (List_Component_Layout): Likewise.  Add Indent parameter.
2908         (List_Structural_Record_Layout): New procedure.
2909         (List_Attr): Add support for JSON output.
2910         (List_Type_Info): Likewise.
2911         (Write_Unknown_Val): Likewise.
2912         * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
2913         * usage.adb (Usage): List -gnatRj.
2915 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2917         * repinfo.adb (List_Component_Layout): New procedure extracted from...
2918         (List_Record_Layout): ...here.  Invoke it.
2920 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2922         * repinfo.adb (Write_Unknown_Val): New procedure.
2923         (List_GCC_Expression): Call it.
2924         (List_Record_Layout): Likewise.
2925         (Write_Val): Likewise.
2927 2018-05-29  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2929         * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
2930         code to do check.
2932 2018-05-29  Arnaud Charlet  <charlet@adacore.com>
2934         * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
2935         This breaks build of cross compilers with older versions of GNAT, so
2936         better avoid it.
2938 2018-05-29  Doug Rupp  <rupp@adacore.com>
2940         * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
2941         reflect reality.
2943 2018-05-29  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2945         * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
2947 2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>
2949         * repinfo.adb (List_Entities): Do not list the Linker_Section for
2950         subprograms here...
2951         (List_Mechanisms): ...but here instead.  Use consistent name output
2952         and formatting conventions.
2954 2018-05-29  Bob Duff  <duff@adacore.com>
2956         * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
2957         To_Lower function.
2958         * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
2959         To_Mixed): New functions.
2960         * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
2961         allows both '\' and '/' on Windows.
2963 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
2965         * repinfo.ads: Minor fixes and tweaks in comments.
2967 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
2969         * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
2970         it with calls to Unop.
2972 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
2974         * repinfo.ads (TCode): Adjust range.
2975         (Truth_Andif_Expr): Remove.
2976         (Truth_Orif_Expr): Likewise.
2977         (Truth_And_Expr .. Dynamic_Val): Adjust value.
2978         * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
2979         (Rep_Value): Likewise.
2980         * repinfo.h (Truth_Andif_Expr): Remove.
2981         (Truth_Orif_Expr): Likewise.
2982         (Truth_And_Expr .. Dynamic_Val): Adjust value.
2983         * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
2984         through to TRUTH_AND_EXPR case.
2985         <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
2987 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
2989         * exp_unst.adb (Visit_Node): For indexed components and attribute
2990         references, examine index expressions or associated expressions as well
2991         to record uplevel references.
2992         (Vist_Node): For function and procedure calls, if a formal is an
2993         unconstrained array and the actual is constrained, check whether bounds
2994         of actual have uplevel references.
2996 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
2998         * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
2999         they can appear as components of activation records.
3000         * exp_unst.adb (Visit_Node): A reference to an exception may be an
3001         uplevel reference.
3003 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3005         * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
3006         depends on a discriminant manually instead of using the predicate
3007         Size_Depends_On_Discriminant in the array type case.
3009 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3011         * exp_unst.adb (Check_Static_Type): For a record subtype, check
3012         discriminant constraints as well.
3013         (Visit_Node): For a selected component, check type of prefix, as is
3014         done for indexed components and slices.
3016 2018-05-28  Javier Miranda  <miranda@adacore.com>
3018         * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
3019         value when converting a float value to a fixed-point value. This is
3020         required for CCG because it handles fixed-point types by means of
3021         unsigned integer type variables. The range check is now performed using
3022         the integer value stored in this temporary.
3024 2018-05-28  Yannick Moy  <moy@adacore.com>
3026         * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
3027         Length as valid non-interfering contexts for SPARK.
3029 2018-05-28  Claire Dross  <dross@adacore.com>
3031         * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
3032         generic inheritance utilities.
3033         (Generic_Inherited_Subprograms): Generic version of
3034         Inherited_Subprograms, generic in Find_Dispatching_Type function.
3035         (Generic_Is_Overriding_Subprogram): Generic version of
3036         Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
3037         (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
3038         Sem_Disp.Find_Dispatching_Type.
3039         (Is_Overriding_Subprogram): Instance of
3040         Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
3041         (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
3042         with Sem_Disp.Find_Dispatching_Type.
3044 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3046         * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
3047         component type, do not expand array equality using the unconstrained
3048         base type, except for the case where the bounds of the type depend on a
3049         discriminant.
3051 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3053         * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
3054         access-to-subprogram types, to indicate that an indirect call through
3055         such a type requires an activation record when compiling for LLVM.
3056         * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
3058 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3060         * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
3061         when bounds of fixed type are static, to remove some spuerfluous
3062         implicit conversions and provide an accurate result when converting
3063         back and forth between the fixed point type and a floating point type.
3065 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3067         * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
3068         activation records.
3070 2018-05-28  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3072         * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
3073         replaced, if any; all callers changed.
3074         (Note_Uplevel_Ref): Likewise.  Also replace reference to deferred
3075         constant with private view so we take the address of that entity.
3076         (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
3077         any; all callers changed.  Handle N_Indexed_Component like
3078         N_Attribute_Reference.  Add N_Type_Conversion case.
3079         (Visit_Node): Indexed references can be uplevel if the type isn't
3080         static.
3081         (Unnest_Subprograms): Don't rewrite if no reference given.  If call has
3082         been relocated, set first_named pointer in original node as well.
3084 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3086         * exp_aggr.adb (Flatten): Copy tree of expression in a component
3087         association with a range or a set of discrete choices, rather than
3088         relocating the node. This avoids inconsistencies in the tree when
3089         handling nested subprograms with uplevel references for LLVM.
3091 2018-05-28  Arnaud Charlet  <charlet@adacore.com>
3093         * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
3094         codepeer mode.
3096 2018-05-28  Arnaud Charlet  <charlet@adacore.com>
3098         * exp_unst.adb: Fix typo.
3100 2018-05-28  Bob Duff  <duff@adacore.com>
3102         * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
3103         unnecessary use of 'Unrestricted_Access.
3105 2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>
3107         * repinfo.adb (Expr_Value_S): New routine.
3108         (List_Linker_Section): Properly extract the value of the section
3109         argument.
3111 2018-05-28  Patrick Bernardi  <bernardi@adacore.com>
3113         * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
3114         description of the -D binder switch to reflect current usage.
3115         * gnat_ugn.texi: Regenerate.
3117 2018-05-28  Gary Dismukes  <dismukes@adacore.com>
3119         * exp_ch3.adb: Minor reformatting
3121 2018-05-28  Justin Squirek  <squirek@adacore.com>
3123         * exp_ch3.adb
3124         (Build_Initialization_Call): Add logic to pass the appropriate actual to match
3125          new formal.
3126         (Init_Formals): Add new formal *_skip_null_excluding_check
3127         * exp_util.adb, exp_util.ads
3128         (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
3129          scope.
3130         (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
3131         (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
3132          used to determine how to generate an Init_Proc for a given type.
3133         (Needs_Constant_Address): Minor reformatting
3134         * sem_res.adb
3135         (Resolve_Null): Add logic to generate a conditional check in certain cases
3137 2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>
3139         * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
3140         Minor reformatting.
3142 2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>
3144         * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
3145         the declarations of single concurrent types because they fall in the
3146         category of full type and object declarations.
3148 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3150         * repinfo.adb (Compute_Max_Length): Skip _Parent component.
3151         (List_Record_Layout): Likewise.
3153 2018-05-28  Ed Schonberg  <schonberg@adacore.com>
3155         * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
3156         includes a call to function to which it applies. This may mean an
3157         omission of an attribute reference 'Result, in particular if the
3158         function is pqrameterless.
3160 2018-05-28  Justin Squirek  <squirek@adacore.com>
3162         * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
3163         misresolved package name is not a case of mistaken identity.
3165 2018-05-28  Yannick Moy  <moy@adacore.com>
3167         * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
3168         GNATprove mode, as the order of resolution (low then high) means that
3169         all the information is not available when resolving the low bound the
3170         first time.
3172 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
3174         * repinfo.adb (List_Array_Info): Start with an explicit blank line and
3175         end with the linker section, if any.
3176         (List_Entities): Do not output the linker section for record types,
3177         array types and variables.
3178         (Print_Expr): Factor out common processing for unary operators and
3179         special values.  Adjust and reorder the various cases.
3180         (List_Object_Info): End with the linker section, if any.
3181         (List_Record_Info): Likewise.
3182         (List_Type_Info): Do not start with a blank line.
3184 2018-05-25  Nicolas Roche  <roche@adacore.com>
3186         * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
3187         that the result will be either -infinite or +infinite.
3189 2018-05-25  Patrick Bernardi  <bernardi@adacore.com>
3191         * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
3192         libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
3193         Expand range of type to match the address space of the target.
3194         (Task_Storage_Size): Remove unused type.
3196 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3198         * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
3199         of a fixed point type and the parent is a multiplying operation,
3200         resolve the operand with its own type because the context will impose a
3201         resulting type on the result of the multiplication by means of
3202         approriate conversion.
3204 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
3206         * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
3207         the in-place initialization aggregate created for pragmas
3208         Initialize_Scalars or Normalize_Scalars is performed with checks
3209         suppressed.
3211 2018-05-25  Arnaud Charlet  <charlet@adacore.com>
3213         * exp_aggr.adb (Convert_To_Positional): Bump default for
3214         Max_Others_Replicate to 32. Update comments.
3215         * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
3216         (No_File_Info_Cache): Initialize separately.
3217         * osint.adb (No_File_Info_Cache): Update initializer.
3219 2018-05-25  Javier Miranda  <miranda@adacore.com>
3221         * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
3222         test when the left operand is a class-wide interface and the right
3223         operand is not a class-wide type.
3224         * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
3225         left operand.
3227 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3229         * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
3230         in an others clause to prevent visibility issues with the generated
3231         loop variable.
3232         (Component_OK_For_Backend): Return false for a quantified expression.
3233         (Check_Static_Component): Ditto.
3235 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
3237         * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
3238         (SS_Allocate_Dynamic): New routine. The allocation logic is now split
3239         into three distring cases rather than in one loop which attempts to
3240         handle all three cases. This rewrite eliminates an issue where the last
3241         frame of the stack cannot be freed, thus causing the memory range of a
3242         new frame to approach the overflow point of the memory index type.
3243         Since the overflow is logically treated as a
3244         too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
3245         (SS_Allocate_Static): New routine. The routine factorizes the static
3246         secondary stack-related code from the former SS_Allocate.
3248 2018-05-25  Sergey Rybin  <rybin@adacore.com>
3250         * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
3251         option for gnatelim.
3253 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3255         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
3256         Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
3257         is created when the proper body of the stub is analyzed.
3258         * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
3259         is the proper body of a subunit, the cloned body must be inserted in
3260         the declarative list that contains the stub.
3262 2018-05-25  Justin Squirek  <squirek@adacore.com>
3264         * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
3265         generate code for 6.5(8-10) so that we don't get an assertion error
3266         when dealing with an incomplete return type.
3268 2018-05-25  Arnaud Charlet  <charlet@adacore.com>
3270         * pprint.adb (Expression_Name): Strip too long expressions to avoid
3271         carrying very large strings.
3273 2018-05-25  Patrick Bernardi  <bernardi@adacore.com>
3275         * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
3276         numbers.
3278 2018-05-25  Doug Rupp  <rupp@adacore.com>
3280         * tracebak.c (aarch64-linux): Implement.
3282 2018-05-25  Justin Squirek  <squirek@adacore.com>
3284         * sem_ch8.adb: Minor reformatting.
3286 2018-05-25  Piotr Trojanek  <trojanek@adacore.com>
3288         * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
3289         assertions.
3291 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
3293         * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
3294         pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
3295         Minor reformatting.
3297 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3299         * sem_ch12.adb (Instance_Exists): New function, subsidiary of
3300         Validate_Derived_Type_Instance, to verify that all interfaces
3301         implemented by the formal type are also implemented by the actual. The
3302         verification is complicated when an interface of the formal is declared
3303         in a generic unit and the actual is declared in an instance of it.
3304         There is currently no mechanism to relate an interface declared within
3305         a generic to the corresponding interface in an instance, so we must
3306         traverse the list of interfaces of the actual, looking for a name
3307         match, and verifying that that interface is declared in an instance.
3309 2018-05-25  Piotr Trojanek  <trojanek@adacore.com>
3311         * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
3312         assertions; replace function versions of Next_Formal/Next_Actual with
3313         their procedural versions (which are more concise).
3315 2018-05-25  Doug Rupp  <rupp@adacore.com>
3317         * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
3318         libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
3319         libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
3320         libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
3321         libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
3322         (Relative_Timed_Wait): Remove.
3323         * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
3324         for incremental looping. Remove references to Rel_Time and
3325         Relative_Timed_Wait.
3326         * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
3327         (Timed_Delay): Make separate.
3328         * libgnat/s-optide.adb: New separate procedure.
3329         * libgnat/s-osprim.ads (Max_System_Delay): New constant.
3330         * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
3331         (Max_System_Delay): New constant.
3333 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3335         * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
3336         for a formal derived type implements all the interfaces declared for
3337         the formal.
3339 2018-05-25  Yannick Moy  <moy@adacore.com>
3341         * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
3342         and GNATprove modes when applicable policy is Ignore.
3344 2018-05-25  Eric Botcazou  <ebotcazou@adacore.com>
3346         * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
3347         boolean type with convention C.
3348         * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
3349         * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
3350         FOREIGN and use it throughout the function.
3351         <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
3352         convention.
3353         <E_Enumeration_Subtype>: Likewise for subtypes.
3354         <E_Record_Type>: Force the size of a storage unit on empty classes.
3355         * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
3356         boolean types with precision 1 if the size is the expected one.
3358 2018-05-25  Arnaud Charlet  <charlet@adacore.com>
3360         * pprint.adb (Expression_Name): Do not print non ASCII characters.
3362 2018-05-25  Bob Duff  <duff@adacore.com>
3364         * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
3365         libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
3367 2018-05-25  Bob Duff  <duff@adacore.com>
3369         * sem_util.ads: Minor comment fix.
3371 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3373         * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
3374         prefixes of array attributes, to prefixes that are entity names whose
3375         type is constrained.
3376         (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
3377         subprogram, as itype created for loops in pre/postcondition may appear
3378         in loops at the library level.
3380 2018-05-25  Ed Schonberg  <schonberg@adacore.com>
3382         * sem_ch13.adb (Build_Predicate_Functions): The predicate function
3383         declaration is inserted into the tree and analyzed at that point, so
3384         should not be reinserted when the body is constructed. Inside a
3385         generic, ensure that the body is not inserted twice in the tree.
3387 2018-05-25  Yannick Moy  <moy@adacore.com>
3389         * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
3390         declarations not coming from source.
3392 2018-05-25  Fedor Rybin  <frybin@adacore.com>
3394         * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
3395         --copy-environment for gnattest.
3397 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3399         * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
3400         variable.
3401         * sem_prag.adb (Get_Base_Subprogram): Same as above.
3403 2018-05-24  Eric Botcazou  <ebotcazou@adacore.com>
3405         * fe.h (Set_Normalized_First_Bit): Declare.
3406         (Set_Normalized_Position): Likewise.
3407         * repinfo.adb (List_Record_Layout): Do not use irregular output for a
3408         variable position.  Fix minor spacing issue.
3409         * gcc-interface/decl.c (annotate_rep): If a field has a variable
3410         offset, compute the normalized position and annotate it in addition to
3411         the bit offset.
3413 2018-05-24  Eric Botcazou  <ebotcazou@adacore.com>
3415         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
3416         Constify and rename variables.  Fix formatting.
3417         (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
3418         <N_Raise_Statement>: Likewise.
3420 2018-05-24  Javier Miranda  <miranda@adacore.com>
3422         * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
3423         body of a variant record equality renaming.
3424         (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
3425         implementation of Build_Body_For_Renaming.
3426         * exp_ch3.ads (Build_Variant_Record_Equality): New library level
3427         function that factorizes the functionality needed by
3428         Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
3429         of a variant record equality subprogram.
3430         * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
3431         (Build_Variant_Record_Equality): New local procedure of
3432         Expand_Freeze_Record_Type containing all the code specific for freezing
3433         the record type that cannot be place in the new library level function.
3435 2018-05-24  Ed Schonberg  <schonberg@adacore.com>
3437         * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
3438         in_parameters, used when unesting subprograms for LLVM, to indicate
3439         that a generated parameter carries the activation record from the
3440         enclosing subprogram.
3441         * exp_unst.adb (Check_Static_Type): Handle array attributes of types
3442         whose bounds may contain up-level references that need to be added to
3443         an activation recoord.
3444         (Add_Extra_Formal): Set Is_Activation_Record on new formal.
3446 2018-05-24  Yannick Moy  <moy@adacore.com>
3448         * pprint.adb (Expression_Image): Improve the printing of expressions,
3449         by taking more cases into account, in particular qualified expressions
3450         and aggregates.  Also count more the number of parentheses to close
3451         after the expression.
3453 2018-05-24  Javier Miranda  <miranda@adacore.com>
3455         * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
3456         check for renamed discriminants.
3457         * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
3458         Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
3459         Is_Visible_Component pass the associated selector node to allow
3460         checking renamed discriminants on untagged types.
3462 2018-05-24  Ed Schonberg  <schonberg@adacore.com>
3464         * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
3465         link to a use_type clause if this would cause an infinite loop in the
3466         machinery that detects redundant use clauses. This may happen when the
3467         redundant clauses appear in the context of a child unit and the context
3468         of its parent.
3470 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3472         * sinfo.ads: Fix grammar in comment.
3474 2018-05-24  Justin Squirek  <squirek@adacore.com>
3476         * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
3477         and manage doubly-linked entity chain.
3478         (Nested_Scenarios): Removed entity field used for optimization during
3479          elaboration to make room for the new field Prev_Entity.
3480         (Link_Entities): Added to replace redundant calls to Set_Next_Entity
3481         and Set_Prev_Entity as well as centralize changes to the entity chain.
3482         (Predicated_Parent): Modified to use Node38.
3483         (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
3484         types.
3485         (Remove_Entity): Moved from sem_util.
3486         (Set_Nested_Scenarios): Deleted.
3487         (Set_Predicated_Parent): Modified to use Node38.
3488         (Set_Prev_Entity): Added to set Prev_Entity field.
3489         (Set_Validated_Object): Modified to use Node38.
3490         (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
3491         action is required.
3492         (Validated_Object): Modified to use Node38.
3493         (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
3494         predicated parent cases.
3495         (Write_Field38_Name): Add predicated parent and Validated_Object cases.
3496         * sem_ch3.adb (Process_Subtype): Add guard to protect against
3497         inappropriate marking of Predicated_Parent to non-itype subtypes.
3498         (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
3499         (Copy_And_Swap): Add setting of Prev_Entity.
3500         (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
3501         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
3502         w/ Link_Entities.
3503         (New_Overloaded_Entity): Remove block created to search for previous
3504         entities in the entity chain with relevant calls to Prev_Entity as well
3505         as replace duplicated code from Remove_Entity_And_Homonym with a call
3506         to that subprogram.
3507         * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
3508         Link_Entities.
3509         * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
3510         initial subprogram declarations related to Nested_Scenarios.
3511         (Process_Nested_Scenarios): Deleted.
3512         (Save_Scenario): Deleted.
3513         (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
3514         node space in the entity tree.
3515         * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
3516         (Remove_Entity_And_Homonym): Added to separate functionality of
3517         Remove_Entity from the homonym chain directly.
3518         * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
3519         w/ Link_Entities and Unlink_Next_Entity.
3520         * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
3521         Link_Entities.
3522         * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
3523         Set_Next_Entity w/ Link_Entities.
3524         * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
3525         Link_Entities and Unlink_Next_Entity.
3526         * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
3527         call to Remove_Entity with its new incarnation.
3528         * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
3529         * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
3530         Link_Entities.
3532 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3534         * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
3535         Install_Limited_Withed_Unit.
3536         (Expand_With_Clause): Update the call to Install_Withed_Unit.
3537         (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
3538         (Install_Context_Clauses): Update the call to Install_Withed_Unit.
3539         (Install_Limited_Context_Clauses): Update the calls to
3540          Install_Limited_Withed_Unit.
3541         (Install_Limited_Withed_Unit): Renamed to better illustrate its
3542         purpose.
3543         (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
3544         and Install_Limited_Withed_Unit.
3545         (Install_With_Clause): Uninstall a limited with clause if a [private]
3546         with clause is given for the same package.
3547         (Install_Withed_Unit): Renamed to better illustrate its purpose.
3548         (Remove_Limited_With_Unit): New routine.
3550 2018-05-24  Eric Botcazou  <ebotcazou@adacore.com>
3552         * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
3553         (__gnat_personality_seh0): Adjust and beef up comments, and
3554         fix formatting throughout.
3555         (__gnat_adjust_context): Deal minimally with version 2.
3556         * seh_init.c (__gnat_map_SEH): Fix formatting.
3557         (_gnat_SEH_error_handler): Adjust comments.
3558         (__gnat_install_SEH_handler): Fix formatting.
3560 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3562         * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
3564 2018-05-24  Ed Schonberg  <schonberg@adacore.com>
3566         * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
3567         aggregate with static bounds when named associations cover all index
3568         positions and the others clause is redundant.
3570 2018-05-24  Raphael Amiard  <amiard@adacore.com>
3572         * libgnat/a-cohama.ads: Add documentation.
3574 2018-05-24  Raphael Amiard  <amiard@adacore.com>
3576         * libgnat/a-convec.ads: Add documentation.
3578 2018-05-24  Justin Squirek  <squirek@adacore.com>
3580         * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
3581         expansion for limited tagged types when the node to be expanded is a
3582         raise expression due to it not representing a valid object.
3583         * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
3584         message regarding assignments to limited types to ignore genereated
3585         code.
3587 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3589         * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
3590         Ghost-related attributes of the class-wide subtype because the copy
3591         clobbers them.
3593 2018-05-24  Justin Squirek  <squirek@adacore.com>
3595         * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
3596         marking use clauses as effective when the reference appears within
3597         generated code.
3599 2018-05-24  Cyrille Comar  <comar@adacore.com>
3601         * doc/gnat_rm/the_gnat_library.rst: Fix typos.
3602         * gnat_rm.texi: Regenerate.
3604 2018-05-24  Bob Duff  <duff@adacore.com>
3606         * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
3607         for build-in-place functions with a caller-unknown-size result.
3608         (Create_Finalizer): For build-in-place functions with a
3609         caller-unknown-size result, check at run time whether we need to
3610         release the secondary stack.
3612 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3614         * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
3615         generated incomplete type.
3617 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3619         * expander.adb (Expand): Update the save and restore of the Ghost
3620         region.
3621         * exp_ch3.adb (Freeze_Type): Likewise.
3622         * exp_disp.adb (Make_DT): Likewise.
3623         * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
3624         (Build_DIC_Procedure_Declaration): Likewise.
3625         (Build_Invariant_Procedure_Body): Likewise.
3626         (Build_Invariant_Procedure_Declaration): Likewise.
3627         (Make_Predicate_Call): Likewise.
3628         * freeze.adb (Add_To_Result): Insert the freeze action of a living
3629         entity prior to the start of the enclosing ignored Ghost region.
3630         (Freeze_Entity): Update the save and restore of the Ghost region.
3631         * ghost.adb (Install_Ghost_Mode): Reimplemented.
3632         (Install_Ghost_Region): New routine.
3633         (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
3634         (Mark_And_Set_Ghost_Body): Likewise.
3635         (Mark_And_Set_Ghost_Completion): Likewise.
3636         (Mark_And_Set_Ghost_Declaration): Likewise.
3637         (Mark_And_Set_Ghost_Instantiation): Likewise.
3638         (Mark_And_Set_Ghost_Procedure_Call): Likewise.
3639         (Name_To_Ghost_Mode): New routine.
3640         (Restore_Ghost_Region): New routine.
3641         * ghost.ads (Install_Ghost_Region): New routine.
3642         (Restore_Ghost_Region): New routine.
3643         * opt.ads: Add new global variable Ignored_Ghost_Region.
3644         * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
3645         region. Install a clean region.
3646         * sem.adb (Analyze): Likewise.
3647         (Do_Analyze): Likewise.
3648         * sem_ch3.adb (Analyze_Object_Declaration): Likewise
3649         (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
3650         capture the ultimate alias of the current primitive.
3651         (Process_Full_View): Update the save and restore of the Ghost region.
3652         Do not inherit DIC and invariant procedures.
3653         * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
3654         Ghost region.
3655         * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
3656         (Analyze_Subprogram_Body_Helper): Likewise.
3657         * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
3658         * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
3659         (Analyze_Subprogram_Instantiation): Likewise.
3660         (Instantiate_Package_Body): Likewise.
3661         (Instantiate_Subprogram_Body): Likewise.
3662         * sem_ch13.adb (Build_Predicate_Functions): Likewise.
3663         (Build_Predicate_Function_Declaration): Likewise.
3664         * sem_disp.adb
3665         (Add_Dispatching_Operation): Do not consider DIC and invariant
3666         procedures.
3667         (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
3668         a dispatching subprogram.
3669         (Check_Operation_From_Private_View): Likewise.
3670         (Override_Dispatching_Operation): Likewise.
3671         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
3672         and restore of the Ghost region.
3673         (Analyze_Initial_Condition_In_Decl_Part): Likewise.
3674         (Analyze_Pragma): Update the save and restore of the Ghost region.
3675         (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
3676         * sem_util.adb (Is_Suitable_Primitive): New routine.
3677         * sem_util.ads (Is_Suitable_Primitive): New routine.
3678         * sinfo.ads: Update the section of Ghost regions.
3680 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3682         * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
3683         Change "condition" to "case guard" after renaming in the contract
3684         grammar.
3685         * gnat_rm.texi: Regenerate.
3687 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3689         * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
3690         construct with discrete choices no longer contains a subtype with
3691         predicates since the expansion already handled this case.
3693 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3695         * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
3696         conversion to the return type to avoid a side effect where an imported
3697         relocated function generates a new anonymous access type, whose
3698         accessibility level does not agree with with that of the wrapper.
3700 2018-05-24  Javier Miranda  <miranda@adacore.com>
3702         * sem_util.adb (Abstract_Interface_List): Add missing support for
3703         private types whose full view is a synchronized type.
3704         * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
3705         derivation of a private type parent type is a task type with
3706         discriminants as gigi does not use such type directly.
3708 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
3710         * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
3711         variable marker when the reference appears in the formal part of a
3712         compilation unit instance because there is no place to insert it.
3713         (In_Compilation_Instance_Formal_Part): New routine.
3715 2018-05-24  Piotr Trojanek  <trojanek@adacore.com>
3717         * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
3718         configuration parameter.
3720 2018-05-24  Doug Rupp  <rupp@adacore.com>
3722         * argv-lynxos178-raven-cert.c: New file.
3723         * libgnat/system-lynxos178-x86.ads: New file.
3725 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3727         * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
3728         Minor reformattings.
3730 2018-05-23  Pascal Obry  <obry@adacore.com>
3732         * adaint.c (win32_wait): Properly free the handle/pid lists when
3733         WaitForMultipleObjects fails (return WAIT_FAILED).
3735 2018-05-23  Pascal Obry  <obry@adacore.com>
3737         * adaint.c (win32_wait): Add missing parentheses.
3739 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3741         * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
3742         (Expand_N_Object_Declaration): Do not check for a large modular array
3743         here.
3744         * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
3745         (Freeze_Object_Declaration): Code cleanup. Check for a large modular
3746         array.
3747         * sem_ch3.adb: Minor reformatting.
3749 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3751         * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
3752         retrieval of the applicable predicate function to an itype created for
3753         a constrained array component.
3754         * einfo.adb: Subprograms for Predicated_Parent.
3755         (Predicate_Function): Use new attribute.
3756         * exp_util.adb (Make_Predicate_Call): If the predicate function is not
3757         available for a subtype, retrieve it from the base type, which may have
3758         been frozen after the subtype declaration and not captured by the
3759         subtype declaration.
3760         * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
3761         legal within a generated initiqlization procedure, as may happen with a
3762         predicate check on a component, when the predicate function applies to
3763         the base type of the component.
3764         * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
3765         predicates for subtype declarations and for subtype indications in
3766         other contexts.
3767         (Process_Subtype): Likewise. Handle properly the case of a private type
3768         with unknown discriminants whose full view is an unconstrained array.
3769         Use Predicated_Parent to indicate source of predicate function on an
3770         itype whose parent is itself an itype.
3771         (Complete_Private_Subtype): If the private view has unknown
3772         discriminants and the full view is an unconstrained array, set base
3773         type of completion to the full view of parent.
3774         (Inherit_Predicate_Flags): Prevent double assignment of predicate
3775         function and flags.
3776         (Build_Subtype): For a constrained array component, propagate predicate
3777         information from original component type declaration.
3779 2018-05-23  Boris Yakobowski  <yakobowski@adacore.com>
3781         * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
3783 2018-05-23  Arnaud Charlet  <charlet@adacore.com>
3785         * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
3786         Hi.
3787         * sem_elab.adb: Make "out" parameters instead of "in out" when
3788         relevant.
3790 2018-05-23  Bob Duff  <duff@adacore.com>
3792         * gnatbind.adb (List_Applicable_Restrictions): Add
3793         No_Implementation_Restrictions to the list of restrictions not to list.
3794         Remove double negative "not No_Restriction_List".  Comment the
3795         commentary that is output, so it won't cause errors if used directly in
3796         a gnat.adc.
3798 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3800         * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
3801         class-wide precondition on a type extension when ancestor does not have
3802         a class-wide precondition.  Previously the compiler accepted such a
3803         precondition when the ancestor had a class-wide postcondition.
3805 2018-05-23  Javier Miranda  <miranda@adacore.com>
3807         * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
3808         the warning on occurrences of this attribute whose evaluation is always
3809         true (since that subprogram aborts processing the attribute). In
3810         addition, replace the node by its boolean result 'True' (required
3811         because the backend has no knowledge of this attribute).
3813 2018-05-23  Bob Duff  <duff@adacore.com>
3815         * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
3816         code in question is not reachable in the case where Count_Type'Last is
3817         out of range.
3819 2018-05-23  Yannick Moy  <moy@adacore.com>
3821         * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
3822         local pragma Warnings Off without On.
3823         * gnat_rm.texi: Regenerate.
3825 2018-05-23  Olivier Hainque  <hainque@adacore.com>
3827         * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
3828         * libgnat/g-excact.adb: Implement.
3830 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3832         * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
3833         is present, verify its legality when the domain of iteration is a
3834         GNAT-specific formal container, as is already done for arrays and
3835         predefined containers.
3837 2018-05-23  Yannick Moy  <moy@adacore.com>
3839         * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
3840         declaration, which was not taken into account.
3842 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3844         * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
3845         synchronized suspension.
3846         * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
3847         Ada.Synchronous_Task_Control and routines Suspend_Until_True and
3848         Wait_For_Release.
3849         * sem_elab.adb: Document switch -gnatd_s.
3850         (In_Task_Body): New routine.
3851         (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
3852         body when the current construct denotes a synchronous suspension call,
3853         and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
3854         is in effect.
3855         (Is_Synchronous_Suspension_Call): New routine.
3856         * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
3857         -gnatd_s.
3859 2018-05-23  Javier Miranda  <miranda@adacore.com>
3861         * exp_disp.adb (Make_DT): Restrict the initialization of
3862         External_Tag and Expanded_Name to an empty string to the case where
3863         both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
3864         restricted runtimes are compiled with pragma Discard_Names.
3865         * doc/gnat_rm/implementation_defined_pragmas.rst,
3866         doc/gnat_rm/implementation_defined_characteristics.rst: Add
3867         documentation.
3868         * gnat_rm.texi: Regenerate.
3870 2018-05-23  Maroua Maalej  <maalej@adacore.com>
3872         * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
3874 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3876         * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
3877         iteration of an Ada2012 loop is performed to determine the type of the
3878         domain, but full analysis is performed once the loop is rewritten as a
3879         while-loop during expansion. The pre-analysis suppresses expansion; it
3880         must also suppress the generation of freeze nodes, which may otherwise
3881         appear in the wrong scope before rewritting.
3883 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3885         * sem_elab.adb: Update the section on suppressing elaboration warnings.
3887 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3889         * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
3890         Is_Elaboration_Target.
3891         (Is_Elaboration_Target): New routine.
3892         (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
3893         (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
3894         (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
3895         Is_Elaboration_Target.
3896         * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
3897         with occurrences in nodes.
3898         (Is_Elaboration_Target): New routine.
3899         * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
3900         elaboration target is subject to pragma Warnings (Off, ...).
3902 2018-05-23  Eric Botcazou  <ebotcazou@adacore.com>
3904         * repinfo.adb (List_Type_Info): Remove obsolete stuff.
3906 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
3908         * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
3909         (Is_Elaboration_Warnings_OK_Id): New routine.
3910         (Set_Is_Elaboration_Warnings_OK_Id): New routine.
3911         (Write_Entity_Flags): Output Flag304.
3912         * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
3913         occurrences in entities.
3914         (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
3915         (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
3916         Inline.
3917         * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
3918         elaboration warnings.
3919         * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
3920         elaboration warnings.
3921         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
3922         state of elaboration warnings.
3923         (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
3924         warnings.
3925         (Analyze_Subprogram_Declaration): Capture the state of elaboration
3926         warnings.
3927         * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
3928         elaboration warnings.
3929         (Analyze_Single_Task_Declaration): Capture the state of elaboration
3930         warnings.
3931         (Analyze_Task_Type_Declaration): Capture the state of elaboration
3932         warnings.
3933         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
3934         of elaboration warnings.
3935         (Analyze_Generic_Subprogram_Declaration): Capture the state of
3936         elaboration warnings.
3937         * sem_elab.adb: Add a section on suppressing elaboration warnings.
3938         Type Processing_Attributes includes component Suppress_Warnings
3939         intended to suppress any elaboration warnings along a path in the
3940         graph.  Update Initial_State to include a value for this component.
3941         Types Target_Attributes and Task_Attriutes include component
3942         Elab_Warnings_OK to indicate whether the target or task has elaboration
3943         warnings enabled.  component Elab_Warnings_OK.
3944         (Build_Access_Marker): Propagate attribute
3945         Is_Elaboration_Warnings_OK_Node from the attribute to the generated
3946         call marker.
3947         (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
3948         (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
3949         (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
3950         (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
3951         when already in this mode or when the attribute or target have warnings
3952         suppressed.
3953         (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
3954         if warnings are suppressed.
3955         (Process_Conditional_ABE_Call): Suppress further elaboration warnings
3956         when already in this mode, or the target or call have warnings
3957         suppressed.
3958         (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
3959         warnings are suppressed.
3960         (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
3961         warnings are suppressed.
3962         (Process_Conditional_ABE_Instantiation): Suppress further elaboration
3963         warnings when already in this mode or when the instantiation has
3964         warnings suppressed.
3965         (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
3966         diagnostics if warnings are suppressed.
3967         (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
3968         specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
3969         (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
3970         specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
3971         (Process_Task_Object): Suppress further elaboration warnings when
3972         already in this mode, or when the object, activation call, or task type
3973         have warnings suppressed. Update the processing state to indicate that
3974         the path goes through a task body.
3975         * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
3976         references.
3977         (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
3978         * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
3979         attribute references.
3981 2018-05-23  Piotr Trojanek  <trojanek@adacore.com>
3983         * einfo.ads: Minor reformatting.
3985 2018-05-23  Ed Schonberg  <schonberg@adacore.com>
3987         * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
3988         anonymous_access_to_ subprogram formal, apply a conversion to force an
3989         accsssibility check that will fail statically, enforcing 3.10.2 (13).
3991 2018-05-23  Daniel Mercier  <mercier@adacore.com>
3993         * gnat1drv.adb: Turn off length expansion in CodePeer mode.
3995 2018-05-23  Bob Duff  <duff@adacore.com>
3997         * freeze.adb: (Check_Address_Clause): Deal with build-in-place
3998         aggregates in addition to build-in-place calls.
4000 2018-05-23  Bob Duff  <duff@adacore.com>
4002         * einfo.ads: Minor reformatting.
4003         * sem_ch3.adb: Likewise.
4004         * sinfo.ads: Likewise.
4006 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
4008         * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
4009         initialization when the component type has predicates.
4010         * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
4011         allocation when the component type has predicates.
4013 2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>
4015         * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
4016         Minor reformatting.
4018 2018-05-22  Justin Squirek  <squirek@adacore.com>
4020         * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
4021         original function spec into the generated function spec due to
4022         expansion of expression functions during analysis.
4023         (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
4024         references from the body to the subprogram spec in the case of
4025         expression functions because of inconsistances related to having a
4026         generated body.
4027         * libgnarl/s-osinte__android.ads: Flag parameters as unused.
4028         * libgnarl/s-osinte__lynxos178e.ads: Likewise.
4029         * libgnarl/s-osinte__qnx.adb: Likewise.
4030         * libgnarl/s-osinte__qnx.ads: Likewise.
4032 2018-05-22  Doug Rupp  <rupp@adacore.com>
4034         * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
4035         AArch64.
4037 2018-05-22  Olivier Hainque  <hainque@adacore.com>
4039         * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
4040         Expect an Exception_Occurence object, not an Access.
4041         (Complete_And_Propagate_Occurrence): Adjust accordingly.
4042         (Raise_From_Signal_Handler): Likewise.
4043         (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
4044         available in the provided occurrence object, just re-propagate the
4045         latter as a bare "raise;" would do.
4046         * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
4047         * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
4048         to null, to mark that the occurrence we're crafting from the stream
4049         contents is not being propagated (yet).
4051 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4053         * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
4054         code for a transient component in line with the rest of the
4055         initialization code, rather than before the aggregate. This ensures
4056         that the component has proper visibility of the discriminants.
4058 2018-05-22  Jerome Lambourg  <lambourg@adacore.com>
4060         * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
4061         number of CPUs.
4063 2018-05-22  Jerome Lambourg  <lambourg@adacore.com>
4065         * sigtramp-qnx.c: Properly restore link register in signal trampoline.
4067 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4069         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
4070         conversions before extracting the value of the expression.
4071         * exp_ch3.adb (Default_Initialize_Object): Optimize the default
4072         initialization of an array of scalars.
4073         (Get_Simple_Init_Val): Add processing for array types. Remove the
4074         processing of strings because this case is already handled by the array
4075         case.
4076         (Needs_Simple_Initialization): Moved to Sem_Util.
4077         (Simple_Init_Array_Type): New routine.
4078         (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
4079         facilities from Sem_Util.
4080         (Simple_Initialization_OK): New routine.
4081         * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
4082         * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
4083         an array of scalars.
4084         * sem_prag.adb (Analyze_Float_Value): New routine.
4085         (Analyze_Integer_Value): New routine.
4086         (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
4087         to handled the extended form of the pragma.
4088         (Analyze_Type_Value_Pair): New routine.
4089         * sem_util.adb: Add invalid value-related data structures.
4090         (Examine_Array_Bounds): New routine.
4091         (Has_Static_Array_Bounds): Reimplemented.
4092         (Has_Static_Non_Empty_Array_Bounds): New routine.
4093         (Invalid_Scalar_Value): New routine.
4094         (Needs_Simple_Initialization): Moved from Exp_Ch3.
4095         (Set_Invalid_Scalar_Value): New routines.
4096         * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
4097         (Invalid_Scalar_Value): New routine.
4098         (Needs_Simple_Initialization): Moved from Exp_Ch3.
4099         (Set_Invalid_Scalar_Value): New routines.
4100         * snames.ads-tmpl: Add names for the salar type families used by pragma
4101         Initialize_Scalars.
4103 2018-05-22  Javier Miranda  <miranda@adacore.com>
4105         * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
4106         string when pragma No_Tagged_Streams is applicable to the tagged type,
4107         and initialize the Expanded_Name with an empty string when pragma
4108         Discard_Names is applicable to the tagged type.
4110 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4112         * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
4113         formal subprogram is never subtype conformqnt, and thus cannot be the
4114         prefix of 'Access.  Reject as well the attribute when applied to a
4115         renaming of a formal subprogram.
4117 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4119         * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
4120         Needs_Simple_Initialization.
4121         (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
4122         (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
4123         profile and comment on usage.
4124         (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
4125         Sloc of a value obtained from aspect Default_Value because this could
4126         potentially replicate large trees. The proper Sloc is now set in
4127         Get_Simple_Init_Val.
4128         (Get_Simple_Init_Val): Reorganized by breaking the various cases into
4129         separate routines. Eliminate the use of global variables.
4130         (Init_Component): Update the call to Get_Simple_Init_Val.
4131         (Needs_Simple_Initialization): Update the parameter profile and all
4132         uses of T.
4133         (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
4134         and set the proper Sloc.
4135         * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
4136         comment on usage.
4137         (Needs_Simple_Initialization): Update the parameter profile.
4139 2018-05-22  Patrick Bernardi  <bernardi@adacore.com>
4141         * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
4142         user tries to use a subtype indication as a discriminant constraint.
4144 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4146         * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
4147         of N_Reduction_Expression and N_Reduction_Expression_Parameter.
4148         * par-ch4.adb: Remove parsing routines for reduction expressions.
4149         * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
4150         sem_spark.adb, sprint.adb: Remove analysis routines for reduction
4151         expressions.
4153 2018-05-22  Arnaud Charlet  <charlet@adacore.com>
4155         * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
4156         Relaxed_RM_Semantics mode.
4158 2018-05-22  Arnaud Charlet  <charlet@adacore.com>
4160         * comperr.adb (Delete_SCIL_Files): Take into account
4161         N_Generic_Package_Renaming_Declaration.
4163 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4165         * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
4166         private, use the full view if available, because it may include renamed
4167         discriminants whose values are stored in the corresponding
4168         Stored_Constraint.
4170 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4172         * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
4173         defined on packages that are actuals for formal packages, in order to
4174         set/reset the visibility of the formals of a formal package with given
4175         actuals, when there are subsequent uses of those formals in the
4176         enclosing generic, as required by RN 12.7 (10).
4177         * atree.ads, atree.adb: Add operations for Elist30.
4178         * atree.h: Add Elist30.
4179         * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
4180         that are not defaulted and are thus not visible within the current
4181         instance.
4182         (Check_Formal_Packages): Reset visibility of formals of a formal
4183         package that are not defaulted, on exit from current instance.
4185 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4187         * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
4188         non-'Result output appears in the output list of a function.
4190 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4192         * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
4193         (Build_Record_VS_Func): Reimplemented.
4194         (Expand_N_Attribute): Reimplement the handling of attribute
4195         'Valid_Scalars.
4196         * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
4197         attribute 'Valid_Scalars.
4198         * sem_util.adb (Scalar_Part_Present): Reimplemented.
4199         (Validated_View): New routine.
4200         * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
4201         comment on usage.
4202         (Validated_View): New routine.
4203         * doc/gnat_rm/implementation_defined_attributes.rst: Update the
4204         documentation of attribute 'Valid_Scalars.
4205         * gnat_rm.texi: Regenerate.
4207 2018-05-22  Bob Duff  <duff@adacore.com>
4209         * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
4210         the spec of a SAL_Interface package.
4212 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4214         * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
4215         entity E within a generic unit, indicate that there are no remaining
4216         delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
4217         entity E is not frozen yet but the aspects should not be reanalyzed at
4218         the freeze point, which may be outside of the generic and may not have
4219         the proper visibility.
4221 2018-05-22  Bob Duff  <duff@adacore.com>
4223         * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
4224         the new --split-line-before-record, --indent-named-statements and
4225         --no-align-modes gnatpp switches.
4227 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4229         * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
4230         a second argument that is a constant of a given string value.
4232 2018-05-22  Doug Rupp  <rupp@adacore.com>
4234         * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
4236 2018-05-22  Jerome Lambourg  <lambourg@adacore.com>
4238         * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
4240 2018-05-22  Ed Schonberg  <schonberg@adacore.com>
4242         * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
4243         delayed aspects, analyze them now, os that the representation of the
4244         type (size, bounds) can be computed and validated.
4246 2018-05-22  Olivier Hainque  <hainque@adacore.com>
4248         * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
4249         executable code section boundaries.
4251 2018-05-22  Javier Miranda  <miranda@adacore.com>
4253         * locales.c: New implementation for the Ada.Locales package.
4254         * libgnat/a-locale.ads: Remove comment indicating that this is not
4255         implemented.
4256         * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
4257         that this is not implemented.
4258         * gnat_rm.texi: Regenerate.
4260 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4262         * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
4263         reformattings.
4265 2018-05-22  Justin Squirek  <squirek@adacore.com>
4267         * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
4268         (Freeze_Subprogram_Body, Install_Body): Modify calls to
4269         In_Same_Declarative_Part.
4270         * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
4271         verify pragma declaration is within the same declarative list with
4272         corresponding error message.
4273         * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
4274         sem_ch12.adb and generalized to be useful outside the scope of
4275         freezing.
4277 2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>
4279         * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
4280         categorization of the unit after processing the aspects in case one of
4281         its aspects is converted into a categorization pragma.
4283 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4285         * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
4286         declaration with an explicit address clause and a type with default
4287         initialization, if the declaration carries an aspect
4288         Suppress_Initialization.
4290 2018-05-21  Daniel Mercier  <mercier@adacore.com>
4292         * pprint.adb: Use mixed case for attribute names.
4294 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4296         * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
4297         Analyze_Aspect_Specifications_On_Body_Or_Stub.
4298         (Analyze_Subprogram_Body_Helper): Rename the calls to
4299         Analyze_Aspect_Specifications_On_Body_Or_Stub.
4300         * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
4301         Analyze_Aspect_Specifications_On_Body_Or_Stub.
4302         * sem_ch10.adb: Add with and use clause for Sem_Ch13.
4303         (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
4304         prior to analyzing its aspects.
4305         (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
4306         stub prior to analyzing its aspects. Save and restore the configuration
4307         switches.
4308         (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
4309         prior to analyzing its aspects.
4310         * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4311         to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4312         * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4313         to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4314         * sem_prag.adb: Code reformatting.
4315         (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
4317 2018-05-21  Jerome Lambourg  <lambourg@adacore.com>
4319         * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
4320         for QNX.
4322 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4324         * exp_cg.adb: Remove with and use clause for Exp_Disp.
4325         * exp_ch9.adb: Remove with and use clause for Exp_Disp.
4326         * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4327         (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4328         (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4329         * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4330         (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4331         (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4332         * exp_dist.adb: Remove with and use clause for Exp_Disp.
4333         * freeze.adb: Remove with and use clause for Exp_Disp.
4334         * sem_cat.adb: Remove with and use clause for Exp_Disp.
4335         * sem_ch6.adb: Remove with and use clause for Exp_Disp.
4336         * sem_ch12.adb: Remove with and use clause for Exp_Disp.
4337         * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
4338         primitives.
4339         * sem_util.adb: Remove with and use clause for Exp_Disp.
4340         (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
4341         (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4342         (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4343         * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
4344         Exp_Disp.
4345         (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4346         (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4348 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4350         * sem_res.adb (Valid_Conversion): Improve error message on an illegal
4351         type conversion whose expression has a limited view of a type.
4353 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4355         * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
4356         explicit name for iterator loop, preserve that name in expanded
4357         construct, for possible use in exit statements.
4359 2018-05-21  Javier Miranda  <miranda@adacore.com>
4361         * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
4362         spec of a unit has Ada 2012 membership tests with multiple choices and
4363         the unit body is not compiled under Ada 2012 mode.
4365 2018-05-21  Doug Rupp  <rupp@adacore.com>
4367         * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
4368         pregs.
4369         (CFI_COMMON_REGS): Restore LR jic probed from prologue.
4370         (REGNO_PC_OFFSET): Change to correct value for Aarch64.
4372 2018-05-21  Jose Ruiz  <ruiz@adacore.com>
4374         * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
4375         libgnarl/s-tassta.adb: Minor typo fixes
4377 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4379         * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
4380         indexed call originally in prefix forn is itself the prefix of a
4381         further call.
4383 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4385         * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
4386         type.
4387         (Not_Null_Range): Same as above.
4389 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4391         * exp_ch3.adb: Minor reformatting.
4392         * exp_ch6.adb: Likewise.
4393         * freeze.adb: Likewise.
4394         * inline.adb: Likewise.
4395         * sem_util.adb: Likewise.
4397 2018-05-21  Yannick Moy  <moy@adacore.com>
4399         * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
4400         conversion instead of an unchecked type conversion when inlining a
4401         return statement, unless type qualification is required (for character
4402         and string literal) or no check can result from the conversion (for
4403         access types).
4404         * opt.ads: Update comment.
4406 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4408         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
4409         model of the compilation unit spec, if any.
4410         * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
4411         model of the compilation unit spec, if any.
4412         * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
4413         parent compilation unit spec, if any.
4414         * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
4415         model of the main unit.
4416         (Is_Same_Unit): The routine now uses Unit_Entity.
4417         (Is_Subunit): Removed.
4418         (Normalize_Unit): Removed.
4419         (Unit_Entity): New routine.
4420         * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
4421         Elaboration_Checks. The analysis now ensures that the pragma appears at
4422         the configuration level, and on the initial declaration of a unit.
4423         Other placements are either flagged as illegal, or ignored.
4424         (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
4425         (Ignore_Elaboration_Checks_Pragma): New routine.
4426         * sem_util.adb (Install_Elaboration_Model): New routine.
4427         * sem_util.ads (Install_Elaboration_Model): New routine.
4428         * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
4429         documentation of pragma Elaboration_Checks.
4430         * gnat_rm.texi: Regenerate.
4432 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4434         * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
4435         of empty string when argv[0] couldn't be found on PATH.
4436         (Enable_Cache): Raise Program_Error instead of attempting a null
4437         pointer dereference when the Exec_Module initialization failed.
4439 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4441         * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
4442         * libgnarl/a-taside.ads (Tasking_State): Likewise.
4443         * libgnat/a-calend.ads (Clock_Time): Likewise.
4445 2018-05-21  Yannick Moy  <moy@adacore.com>
4447         * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
4448         call notation in inlined call in GNATprove mode.
4450 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4452         * einfo.adb (Is_External_State): An abstract state is also external
4453         when it is declared with option "synchronous".
4454         * einfo.ads: Update the documentation of synthesized attribute
4455         Is_External_State.
4456         * sem_util.adb (Find_Simple_Properties): New routine.
4457         (Is_Enabled_External_Property): New routine.
4458         (State_Has_Enabled_Property): Reimplemented. The two flavors of option
4459         External have precedence over option Synchronous when determining
4460         whether a property is in effect.
4462 2018-05-21  Yannick Moy  <moy@adacore.com>
4464         * sem_eval.adb (Static_Length): Take into account case of variable of
4465         subtype string literal.
4467 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4469         * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
4470         (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
4471         * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
4472         component name.
4473         (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
4474         * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
4475         change.
4477 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4479         * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
4480         Address, and type of Low, High to Storage_Offset.
4481         (Low): Rename as Low_Address and convey that the return value is a
4482         runtime reference accounting for a load address.
4483         * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
4484         address/offset type changes.
4485         (Aranges_Lookup): Likewise.
4486         (Symbolic_Address): Likewise.
4487         (Symbolic_Traceback): Likewise.
4488         (Dump_Cache): Likewise.
4489         (Is_Inside): Likewise.
4490         (Open): Likewise.
4491         (Set_Load_Address): Likewise.
4492         (Low_Address): Likewise, and account for C.Load_Address.
4493         * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
4494         (Multi_Module_Symbolic_Traceback): Compare address in traceback
4495         with module Low_Address instead of Low.
4497 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4499         * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
4500         Load_Address.
4501         * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
4502         (Set_Load_Address): Likewise.
4503         (Symbolic_Traceback): Likewise.
4505 2018-05-21  Olivier Hainque  <hainque@adacore.com>
4507         * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
4508         Load_Address argument and pass it down to Init_Module.
4509         * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
4510         lm.l_addr as the Load_Address to Add_Module_To_Cache.
4512 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4514         * einfo.adb (Has_Discriminants): Stronger assertion.
4515         (Set_Has_Discriminants): Stronger assertion.
4516         * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
4517         the stronger assertion on Has_Discriminant.
4518         (Uninstall_Discriminants_And_Pop_Scope): Same as above.
4519         * sem_util.adb (New_Copy_Tree): Same as above.
4520         * sem_ch7.adb (Generate_Parent_References): Prevent calls to
4521         Has_Discriminant on non-type entities that might happen when the
4522         compiled code has errors.
4523         * sem_ch3.adb (Derived_Type_Declaration): Only call
4524         Set_Has_Discriminant on type entities.
4526 2018-05-21  Arnaud Charlet  <charlet@adacore.com>
4528         * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
4529         code generation.
4531 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4533         * lib.ads: Fix typo in enumeration in comment.
4535 2018-05-21  Ed Schonberg  <schonberg@adacore.com>
4537         * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
4538         attribute reference is legal within a generic unit when the prefix is a
4539         formal private type.
4541 2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>
4543         * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
4544         delegate the secondary stack management when there is no suitable
4545         transient context, and the transient scope was intended to manage the
4546         secondary stack because this causes premature reclamation. Change the
4547         transient scope creation logic by special casing assignment statements
4548         of controlled components for type initialization procedures.
4549         (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
4550         the comment on usage.
4551         (Find_Transient_Context): Change the initinte loop into a while loop.
4552         Iterations schemes and iterator specifications are not valid transient
4553         contexts because they rely on special processing. Assignment statements
4554         are now treated as a normal transient context, special cases are
4555         handled by the caller. Add special processing for pragma Check.
4556         (Is_OK_Construct): Removed. Its functionality has been merged in
4557         routine Find_Transient_Context.
4558         * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
4559         retrieve the subprogram being invoked. Use a more accurate predicate
4560         (Requires_Transient_Scope) to determine that the function will emply
4561         the secondary stack.
4563 2018-05-21  Piotr Trojanek  <trojanek@adacore.com>
4565         * ada_get_targ.adb: Fix subprogram body headers.
4566         * adabkend.adb: Likewise.
4567         * checks.adb: Likewise.
4568         * exp_ch3.adb: Likewise.
4569         * exp_ch5.adb: Likewise.
4570         * exp_ch9.adb: Likewise.
4571         * exp_dist.adb: Likewise.
4572         * exp_tss.adb: Likewise.
4573         * inline.adb: Likewise.
4574         * lib-writ.adb: Likewise.
4575         * lib-xref-spark_specific.adb: Likewise.
4576         * libgnarl/s-osinte__darwin.adb: Likewise.
4577         * libgnarl/s-stusta.adb: Likewise.
4578         * libgnarl/s-taprop__solaris.adb: Likewise.
4579         * libgnarl/s-tposen.adb: Likewise.
4580         * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
4581         * libgnarl/s-vxwext__kernel.adb: Likewise.
4582         * libgnat/a-btgbso.adb: Likewise.
4583         * libgnat/a-cfdlli.adb: Likewise.
4584         * libgnat/a-cfhama.adb: Likewise.
4585         * libgnat/a-cfinve.adb: Likewise.
4586         * libgnat/a-cimutr.adb: Likewise.
4587         * libgnat/a-coboho.adb: Likewise.
4588         * libgnat/a-cofove.adb: Likewise.
4589         * libgnat/a-cofuve.adb: Likewise.
4590         * libgnat/a-comutr.adb: Likewise.
4591         * libgnat/a-exexda.adb: Likewise.
4592         * libgnat/a-tags.adb: Likewise.
4593         * libgnat/a-tideau.adb: Likewise.
4594         * libgnat/a-wtdeau.adb: Likewise.
4595         * libgnat/a-ztdeau.adb: Likewise.
4596         * libgnat/g-alleve.adb: Likewise.
4597         * libgnat/s-excdeb.adb: Likewise.
4598         * libgnat/s-parint.adb: Likewise.
4599         * libgnat/s-shasto.adb: Likewise.
4600         * libgnat/s-traceb__hpux.adb: Likewise.
4601         * prepcomp.adb: Likewise.
4602         * sem_ch4.adb: Likewise.
4603         * sem_ch6.adb: Likewise.
4604         * sem_dist.adb: Likewise.
4605         * sem_prag.adb: Likewise.
4606         * sem_util.adb: Likewise.
4607         * sinfo.adb: Likewise.
4608         * switch.adb: Likewise.
4610 2018-05-04  John Marino  <gnugcc@marino.st>
4612         PR ada/85635
4613         * link.c (BSD platforms): Add missing backslash.
4615 2018-04-27  Eric Botcazou  <ebotcazou@adacore.com>
4617         PR ada/85540
4618         * init.c (__gnat_handle_vms_condition): Add missing parentheses.
4620 2018-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4622         PR ada/85007
4623         * gnat_ugn.texi: Regenerate.
4625 2018-03-23  Eric Botcazou  <ebotcazou@adacore.com>
4627         PR ada/85007
4628         * gnatlink.adb (Gnatlink): Remove handling of -b switch.
4629         * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
4630         Remove documentation of -b switch.
4632 2018-03-23  Eric Botcazou  <ebotcazou@adacore.com>
4634         PR ada/85036
4635         * gnatlink.adb (Process_Args): Drop existing link switches if multiple
4636         switches are passed for --LINK.
4638 2018-03-12  Eric Botcazou  <ebotcazou@adacore.com>
4640         PR ada/82813
4641         * gcc-interface/misc.c (gnat_post_options): Disable string overflow
4642         warnings.
4644 2018-03-10  Eric Botcazou  <ebotcazou@adacore.com>
4646         * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
4647         Consider only entities for objects.
4649 2018-03-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
4651         * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
4652         $(GNATLIBCFLAGS).
4653         (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
4655 2018-03-06  Eric Botcazou  <ebotcazou@adacore.com>
4657         * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
4658         guarding the overflow check emitted for the upper bound of a floating-
4659         point conversion.
4661 2018-03-06  Eric Botcazou  <ebotcazou@adacore.com>
4663         * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
4665 2018-02-28  Eric Botcazou  <ebotcazou@adacore.com>
4667         * libgnat/i-cexten.ads (Float_128): New type.
4669 2018-02-02  Eric Botcazou  <ebotcazou@adacore.com>
4671         * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
4672         false if the component type is a pointer.
4674 2018-01-11  Gary Dismukes  <dismukes@adacore.com>
4676         * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
4677         result of Get_Simple_Init_Value and pass the source location of the
4678         object declaration's object_definition.
4680 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4682         * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
4683         properly object declarations with initializations that are
4684         build-in-place function calls, when there is an address specification,
4685         either as an aspect specification or an explicit attribute
4686         specification clause, for the initialized object.
4687         * freeze.adb (Check_Address_Clause): Do not remove side-effects from
4688         initial expressions in the case of a build-in-place call.
4690 2018-01-11  Piotr Trojanek  <trojanek@adacore.com>
4692         * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
4693         private (sub)type; refactor to avoid early return statement.
4694         (Not_Null_Range): Same as above.
4696 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4698         * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
4699         concurrent, nor effectively volatile.
4700         * ghost.adb (Check_Ghost_Type): New routine.
4701         * ghost.ads (Check_Ghost_Type): New routine.
4702         * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
4703         consider specific subsets of declarations.
4704         (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
4705         replicated by Is_Declaration.
4706         * sem_util.ads (Is_Declaration): New parameter profile. Update the
4707         comment on usage.
4708         (Is_Declaration_Other_Than_Renaming): Removed.
4710 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4712         * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
4713         as Part_Of consituents of single protected types are illegal when they
4714         take place inside a protected function.
4715         (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
4716         enclosing function.
4717         (Is_Protected_Part_Of_Constituent): New routine.
4718         (Within_Function): New routine.
4720 2018-01-11  Arnaud Charlet  <charlet@adacore.com>
4722         Bump copyright notices to 2018.
4724 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4726         * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
4727         Minor reformatting.
4729 2018-01-11  Justin Squirek  <squirek@adacore.com>
4731         * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
4732         to make sure a given expression function is properly parenthesized.
4734 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4736         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
4737         categorization of a subprogram body which does not complete a previous
4738         declaration.
4740 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4742         * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
4743         scope of package Ada is Standard.
4745 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4747         * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
4748         subcomponent of the current entity when building the body for a dynamic
4749         predicate function for a record with composite subcomponents.
4751 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4753         * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
4754         Establish_Transient_Scope.
4755         (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
4756         (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
4757         * exp_ch6.adb (Expand_Call_Helper): Update the call to
4758         Establish_Transient_Scope.
4759         (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
4760         Establish_Transient_Scope.
4761         * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
4762         management of the secondary stack to an enclosing scope if there is no
4763         suitable construct to wrap, and the transient scope was intended to
4764         manage the secondary stack.
4765         (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
4766         is a valid boundary for a transient expression which comes from the
4767         statements of the alternative, otherwise alternatives cannot be
4768         wrapped. Assignments of controlled objects which have controlled
4769         actions suppressed now stop the traversal as there is no point in
4770         looking for an enclosing construct. Add several N_xxx_Body choices to
4771         the termination conditions for completeness.
4772         * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
4773         and the associated comment on usage.
4774         * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
4775         Establish_Transient_Scope.
4776         (Add_Write_After): Update the call to Establish_Transient_Scope.
4777         * sem_res.adb (Check_Initialization_Call): Removed.
4778         (Resolve_Actuals): Account for additional cases where finalization
4779         actions are required by utilizing predicate Needs_Finalization rather
4780         than Is_Controlled.
4781         (Resolve_Call): Type initialization procedures can now utilize
4782         transient scopes to manage the secondary stack, thus preventing leaks
4783         during initialization.  Remove the previous kludgy algorithm which
4784         attempts to manage the secondary stack at the object creation site.
4786 2018-01-11  Jerome Lambourg  <lambourg@adacore.com>
4788         * libgnat/g-soliop__qnx.ads: New.
4789         * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
4790         for QNX.
4792 2018-01-11  Bob Duff  <duff@adacore.com>
4794         * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
4795         a null procedure occurs in a protected definition.
4797 2018-01-11  Bob Duff  <duff@adacore.com>
4799         * binderr.ads, namet.ads: Minor reformatting.
4801 2018-01-11  Bob Duff  <duff@adacore.com>
4803         * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
4804         xml2gnat.
4806 2018-01-11  Bob Duff  <duff@adacore.com>
4808         * binde.adb (Force_Elab_Order): Give an error if there are duplicate
4809         unit names.
4811 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4813         * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
4814         controlling argument of a dispatching call. freeze the corresponding
4815         designated type.
4817 2018-01-11  Ben Brosgol  <brosgol@adacore.com>
4819         * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
4821 2018-01-11  Ben Brosgol  <brosgol@adacore.com>
4823         * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
4824         corrections.
4825         * gnat_rm.texi: Regenerate.
4827 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4829         * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
4830         formsl type corresponding to the actual fixed point type is private,
4831         because in this case there can be no suspicious arithmetic operations
4832         in the generic unless they reference a formal subprogram.  Clarify
4833         warning.
4835 2018-01-11  Javier Miranda  <miranda@adacore.com>
4837         * exp_util.adb (Remove_Side_Effects): No action done for functions
4838         returning class-wide types since it requires generating code using
4839         'reference and the CCG target has no secondary stack.
4840         * gnat1drv.adb: Disable building static dispatch tables when generating
4841         C code.
4843 2018-01-11  Piotr Trojanek  <trojanek@adacore.com>
4845         * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
4846         libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
4847         (File_Type): Add Default_Initial_Condition aspect.
4849 2018-01-11  Pascal Obry  <obry@adacore.com>
4851         * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
4853 2018-01-11  Bob Duff  <duff@adacore.com>
4855         * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
4856         to match what the Libadalang-based version does.
4857         * doc/gnat_ugn/about_this_guide.rst: Update reference.
4859 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4861         * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
4862         if it contains at least one component declaration employing a function
4863         call returning on the secondary stack.
4865 2018-01-11  Yannick Moy  <moy@adacore.com>
4867         * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
4868         Update description of restriction SPARK_05 with SPARK 2014.
4869         * gnat_rm.texi: Regenerate.
4871 2018-01-11  Vasiliy Fofanov  <fofanov@adacore.com>
4873         * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
4875 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4877         * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
4878         sem_res.adb, sem_util.adb: Minor reformatting.
4880 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4882         * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
4883         has a delayed aspect which must be processed at the point the type is
4884         frozen. This mimics what is done when the predicate is provided by a
4885         source aspect.
4887 2018-01-11  Doug Rupp  <rupp@adacore.com>
4889         * init.c (vxworks): Add macro checks for __aarch64__.
4891 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4893         * exp_util.adb (Add_Failure_Expression): New routine.
4894         (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
4895         * sem_util.adb (Is_Current_Instance): Code cleanup.
4897 2018-01-11  Patrick Bernardi  <bernardi@adacore.com>
4899         * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
4900         Default_Sec_Stack_Size.
4901         * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
4902         limit check so that the integer index does not overflow. Check the
4903         dynamic stack allocation does not cause the secondary stack pointer to
4904         overflow.
4905         (SS_Info): Align colons.
4906         (SS_Init): Cover the case when bootstraping with an old compiler that
4907         does not set Default_SS_Size.
4909 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4911         * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
4912         legality of an inherited operation that may require overriding, ignore
4913         primitive_wrappers that correspond to explicit operations that override
4914         an interface primitive.
4915         * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
4916         operation to which the class-wide expression applies is a protected op.
4917         with a primitive_wrapper, verify that the updated inherited expression
4918         does not contain an internal call to a protected function.  This
4919         completes the implementation of AI12-0166.
4921 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4923         * ali.adb: Document the remaining letters available for ALI lines.
4924         (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
4925         * ali.ads: Update type With_Record. Field
4926         Implicit_With_From_Instantiation is no longer in use. Add field
4927         Implicit_With.
4928         * csinfo.adb (CSinfo): Remove the setup for attribute
4929         Implicit_With_From_Instantiation.
4930         * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
4931         either implicitly or explicitly withed.
4932         (Is_Implicit_With_Clause): New routine.
4933         (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
4934         confusion with the with clause attribute by the same name.
4935         (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
4936         * rtsfind.adb (Maybe_Add_With): Code cleanup.
4937         * sem_ch8.adb (Present_System_Aux): Code cleanup.
4938         * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
4939         for a parent unit.
4940         (Implicit_With_On_Parent): Mark the with clause as generated for a
4941         parent unit.
4942         * sem_ch12.adb (Inherit_Context): With clauses inherited by an
4943         instantiation are no longer marked as Implicit_With_From_Instantiation
4944         because they are already marked as implicit.
4945         * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
4946         which marks implicit with clauses as related to an instantiation.
4947         * sinfo.adb (Implicit_With_From_Instantiation): Removed.
4948         (Parent_With): New routine.
4949         (Set_Implicit_With_From_Instantiation): Removed.
4950         (Set_Parent_With): New routine.
4951         * sinfo.ads: Update the documentation of attribute Implicit_With.
4952         Remove attribute Implicit_With_From_Instantiation along with
4953         occurrences in nodes.  Add attribute Parent_With along with occurrences
4954         in nodes.
4955         (Implicit_With_From_Instantiation): Removed along with pragma Inline.
4956         (Parent_With): New routine along with pragma Inline.
4957         (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
4958         (Set_Parent_With): New routine along with pragma Inline.
4960 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4962         * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
4963         entity when the enclosing construct is a body.
4965 2018-01-11  Patrick Bernardi  <bernardi@adacore.com>
4967         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
4968         Secondary_Stack_Size handling as a pragma is now generated for the
4969         corresponding aspect instead of an attribute.  Pragma expression is
4970         relocated instead of evaluated. Discriminant of the corresponding
4971         record type is referenced rather than the type discriminant.
4972         (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
4973         Secondary_Stack_Size rep item checks to only look for the pragma rep.
4974         * sem_ch13.adb (Analyze_One_Aspect): Transform
4975         Aspect_Secondary_Stack_Size into a pragma instead of an attribute
4976         because the attribute does not have visibility on a task type's
4977         discriminants when the type's definition is expanded.
4978         (Analyze_Attribute_Definition_Clause): Remove handling of
4979         Attribute_Secondary_Stack_Size.
4980         * snames.adb-tmpl, snames.ads-tmpl: Remove
4981         Attribute_Secondary_Stack_Size, no longer used.
4983 2018-01-11  Justin Squirek  <squirek@adacore.com>
4985         * sem_ch8.adb: Minor comment fix.
4987 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
4989         * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
4990         individual action because the action may denote a complex expression,
4991         such as a case statement, which in turn may contain additional
4992         transient objects.
4994 2018-01-11  Ed Schonberg  <schonberg@adacore.com>
4996         * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
4997         analysis on a copy of the expression with a copy of the index variable,
4998         because full expansion will rewrite construct into a loop with the
4999         original loop variable.
5000         * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
5001         expression is an iterated component association. Full analysis takes
5002         place when construct is rewritten as a loop.
5003         (In_Place_Assign_OK, Safe_Component): An iterated_component_association
5004         is not safe for in-place assignment.
5005         * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
5006         entity with no homonym and no other entity in the scope.
5008 2018-01-11  Justin Squirek  <squirek@adacore.com>
5010         * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
5011         message to be printed on the pragma argument identifier.
5013 2018-01-11  Hristian Kirtchev  <kirtchev@adacore.com>
5015         * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
5016         entity of the generated invariant procedure in order to construct a
5017         proper entity chain.
5019 2018-01-11  Piotr Trojanek  <trojanek@adacore.com>
5021         * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
5022         comment.
5024 2018-01-11  Arnaud Charlet  <charlet@adacore.com>
5026         * einfo.ads, einfo.adb (Activation_Record_Component,
5027         Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
5028         Allow E_Discriminant.
5030 2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
5032         * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
5033         for atomic access once the component size is taken into account and
5034         also do it if the component type is Atomic or Volatile_Full_Access.
5036 2018-01-04  Eric Botcazou  <ebotcazou@adacore.com>
5038         * gnatvsn.ads: Bump copyright year.
5040 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5041             Alan Hayward  <alan.hayward@arm.com>
5042             David Sherwood  <david.sherwood@arm.com>
5044         * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
5045         as polynomial.
5047 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5048             Alan Hayward  <alan.hayward@arm.com>
5049             David Sherwood  <david.sherwood@arm.com>
5051         * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
5052         as polynomial.
5054 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5055             Alan Hayward  <alan.hayward@arm.com>
5056             David Sherwood  <david.sherwood@arm.com>
5058         * gcc-interface/utils.c (gnat_types_compatible_p): Handle
5059         polynomial TYPE_VECTOR_SUBPARTS.
5061 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5062             Alan Hayward  <alan.hayward@arm.com>
5063             David Sherwood  <david.sherwood@arm.com>
5065         * gcc-interface/misc.c (enumerate_modes): Handle polynomial
5066         GET_MODE_NUNITS.
5068 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
5070         Update copyright years.
5072         * gnat_ugn.texi: Bump @copying's copyright year.
5073         * gnat_rm.texi: Likewise.
5075 Copyright (C) 2018 Free Software Foundation, Inc.
5077 Copying and distribution of this file, with or without modification,
5078 are permitted in any medium without royalty provided the copyright
5079 notice and this notice are preserved.