Update ChangeLog and version files for release
[official-gcc.git] / gcc / ada / ChangeLog
blob6d9827b5c6b01c866ef43ae6e7105cf7d131f8cc
1 2017-08-14  Release Manager
3         * GCC 7.2.0 released.
5 2017-07-15  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>
7         PR ada/81446
8         * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
9         (Backend_Overflow_Checks): Set to True.
11 2017-06-15  Nicolas Boulenguez  <nicolas.boulenguez@free.fr>
13         PR ada/81105
14         * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
15         (i[3456]86-pc-gnu): Likewise.
16         (x86_64 kfreebsd): Likewise.
18 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
20         PR ada/81070
21         * s-interr-hwint.adb: Reinstate.
22         * gcc-interface/Makefile.in (RTEMS): Use it again.
24 2017-06-12  Sebastian Huber  <sebastian.huber@embedded-brains.de>
26         Backport from mainline
27         2017-06-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
29         * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
30         * s-tpopsp-rtems.adb: Delete.
32 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
34         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
35         for Itypes that are E_Access_Subtype.
36         <E_Access_Subtype>: Use the DECL of the base type directly.
38 2017-05-17  Eric Botcazou  <ebotcazou@adacore.com>
40         PR ada/80784
41         Backport from mainline
43         2017-05-02  Ed Schonberg  <schonberg@adacore.com>
45         * exp_ch3.adb (Freeze_Type): Do not generate an invariant
46         procedure body for a local (sub)type declaration within a
47         predicate function. Invariant checks do not apply to these, and
48         the expansion of the procedure will happen in the wrong scope,
49         leading to misplaced freeze nodes.
51 2017-05-12  Eric Botcazou  <ebotcazou@adacore.com>
53         * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
54         instead of Word_Size.
56         Revert
57         2017-03-28  Andreas Schwab  <schwab@suse.de>
59         PR ada/80117
60         * system-linux-aarch64-ilp32.ads: New file.
61         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
62         from LIBGNAT_TARGET_PAIRS.
63         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
64         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
65         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
66         or -mabi=ilp32, resp.
68 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
70         Back port from mainline
71         2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
73         PR ada/80626
74         * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
75         instead of Word_Size.
77 2017-05-02  Release Manager
79         * GCC 7.1.0 released.
81 2017-04-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
83         * system-linux-s390.ads: Use Long_Integer'Size to define
84         Memory_Size.
86 2017-04-04  Eric Botcazou  <ebotcazou@adacore.com>
88         * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
90 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
92         * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
93         * g-socket.adb (To_Host_Entry): Fix typo in comment.
94         * gnat_ugn.texi: Fix typo.
95         * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
96         * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
97         * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
98         * sem_util.adb (Mark_Coextensions): Likewise.
99         * sem_util.ads (Available_Full_View_Of_Component): Likewise.
101 2017-03-28  Andreas Schwab  <schwab@suse.de>
103         PR ada/80117
104         * system-linux-aarch64-ilp32.ads: New file.
105         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
106         from LIBGNAT_TARGET_PAIRS.
107         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
108         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
109         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
110         or -mabi=ilp32, resp.
112 2017-03-14  James Cowgill  <James.Cowgill@imgtec.com>
114         * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
116 2017-03-08  Thanassis Tsiodras  <ttsiodras@gmail.com>
118         PR ada/79903
119         * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
121 2017-03-08  Eric Botcazou  <ebotcazou@adacore.com>
123         PR ada/79945
124         * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
126         * system-linux-arm.ads (Default_Bit_Order): Likewise.
127         * system-linux-mips.ads (Default_Bit_Order): Likewise.
128         * system-linux-armeb.ads: Delete.
129         * system-linux-mipsel.ads: Likewise.
130         * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
131         (ARM/Linux): Likewise.
133 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
135         PR c/79677
136         * gcc-interface/misc.c (gnat_handle_option): Pass true to
137         handle_generated_option GENERATED_P.
139 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
141         * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
142         around a justified modular type if it doesn't have the same scalar
143         storage order as the enclosing record type.
145 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
147         * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
148         of boolean rvalues to function calls.
150 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
152         * gcc-interface/utils.c (fold_bit_position): New function.
153         (rest_of_record_type_compilation): Call it instead of bit_position to
154         compute the field position and remove the call to remove_conversions.
155         (compute_related_constant): Factor out the multiplication in both
156         operands, if any, and streamline the final test.
158 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
160         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
162 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
164         * gcc-interface/decl.c: Include demangle.h.
165         (is_cplusplus_method): Return again true for a primitive operation
166         only if it is dispatching.  For a subprogram with an interface name,
167         call the demangler to get the number of C++ parameters and compare it
168         with the number of Ada parameters.
170 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
172         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
173         there is no end label, put the location of the At_End procedure on
174         the call to the procedure.
176 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
178         * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
179         value for array types with TYPE_INDEX_TYPE set on their domain type.
180         * gcc-interface/utils.c (max_size): For operations and expressions, do
181         not build a new node if the operands have not changed or are missing.
183 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
185         * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
186         argument when recursing on TRUTH_NOT_EXPR.
188 2017-02-12  John Marino  <gnugcc@marino.st>
190         * system-freebsd-x86.ads: Rename into...
191         * system-freebsd.ads: ...this.
192         (Default_Bit_Order): Define using Standard'Default_Bit_Order.
193         * gcc-interface/Makefile.in: Support aarch64-freebsd.
194         (x86-64/FreeBSD): Adjust to above renaming.
195         (i386/FreeBSD): Likewise.
197 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
199         * comperr.adb: Update FSF bug reporting URL.
201 2017-02-01  Eric Botcazou  <ebotcazou@adacore.com>
202             Jakub Jelinek  <jakub@redhat.com>
204         PR ada/79309
205         * adaint.c (__gnat_killprocesstree): Fix broken string handling.
207 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
209         PR lto/79061
210         * gcc-interface/utils.c (get_global_context): Pass main_input_filename
211         to build_translation_unit_decl.
213 2017-01-23  Javier Miranda  <miranda@adacore.com>
215         * sem_util.adb (New_Copy_Tree): Code cleanup:
216         removal of the internal map (ie. variable Actual_Map, its
217         associated local variables, and all the code handling it).
218         * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
219         force loading of the System package when processing a task type.
220         (Analyze_Protected_Type_Declaration): in GNATprove mode force
221         loading of the System package when processing a protected type.
222         * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
223         force loading of the System package when processing compilation
224         unit with a main-like subprogram.
225         * frontend.adb (Frontend): remove forced loading of the System
226         package.
228 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
230         * sem_prag.adb (Default_Initial_Condition): If the desired type
231         declaration is a derived type declaration with discriminants,
232         it is rewritten as a private type declaration.
233         * sem_ch13.adb (Replace_Type_References_Generic,
234         Visible_Component): A discriminated private type with descriminnts
235         has components that must be rewritten as selected components
236         if they appear as identifiers in an aspect expression such as
237         a Default_Initial_Condition.
238         * sem_util.adb (Defining_Entity): support N_Iterator_Specification
239         nodes.
241 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
243         * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
244         * gnat1drv.adb Generate an empty object file for an ignored
245         Ghost compilation unit.
246         * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
248 2017-01-23  Yannick Moy  <moy@adacore.com>
250         * sem_ch4.adb (Analyze_Indexed_Component_Form):
251         Adapt to inlined prefix with string literal subtype.
252         * inline.adb (Expand_Inlined_Call): Keep unchecked
253         conversion inside inlined call when formal type is constrained.
255 2017-01-23  Javier Miranda  <miranda@adacore.com>
257         * sem_util.adb (New_Copy_Tree): Code cleanup:
258         removal of global variables. All the global variables, global
259         functions and tables of this subprogram are now declared locally.
261 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
263         * exp_strm.ads: Minor reformatting and typo fixes.
265 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
267         * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
268         exp_aggr.adb: Minor reformatting.
269         * g-diopit.adb: minor grammar/punctuation fix in comment.
270         * g-byorma.ads: minor fix of unbalanced parens in comment.
272 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
274         * par.adb: Update the documentation of component Labl.
275         * par-ch6.adb (P_Return_Statement): Set the expected label of
276         an extended return statement to Error.
278 2017-01-23  Tristan Gingold  <gingold@adacore.com>
280         * s-boustr.ads, s-boustr.adb (Is_Full): New function.
282 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
284         * expander.adb: Handle N_Delta_Aggregate.
286 2017-01-23  Javier Miranda  <miranda@adacore.com>
288         * exp_ch6.adb (Expand_Call): Improve the code that
289         checks if some formal of the called subprogram is a class-wide
290         interface, to handle subtypes of class-wide interfaces.
292 2017-01-23  Javier Miranda  <miranda@adacore.com>
294         * checks.adb (Apply_Parameter_Aliasing_Checks):
295         Remove side effects of the actuals before generating the overlap
296         check.
298 2017-01-23  Justin Squirek  <squirek@adacore.com>
300         * exp_strm.ads, exp_strm.ads
301         (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
302         as to avoid getting the underlying type by default.
303         * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
304         underlying type in the Iiput and output attribute cases when
305         building their respective functions.
307 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
309         * scng.adb: Minor reformatting of error message.
311 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
313         * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
314         to freeze the return type of an expression funxtion that is a
315         completion, if the type is a limited view and the non-limited
316         view is available.
318 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
320         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
321         aggregate construct.
322         (P_Record_Or_Array_Component_Association): An array aggregate
323         can start with an Iterated_Component_Association.
324         * scng.adb: Modify error message on improper use of @ in earlier
325         versions of the language.
326         * sinfo.ads: New node kind N_Delta_Aggregate.
327         * sinfo.adb: An N_Delta_Aggregate has component associations and
328         an expression.
329         * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
330         * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
331         Create a new index for each one of the choices in the association,
332         to prevent spurious homonyms in the scope.
333         (Resolve_Delta_Aggregate): New.
334         * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
335         * exp_util.adb (Insert_Actions): Take into account
336         N_Delta_Aggregate.
337         * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
338         * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
339         and local procedures Expand_Delta_Array_Aggregate and
340         expand_Delta_Record_Aggregate.
341         * sprint.adb: Handle N_Delta_Aggregate.
343 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
345         * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
346         empty name when the exception declaration is subject to pragma
347         Discard_Names.
348         (Null_String): New routine.
350 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
352         * par-ch9.adb (P_Protected_Definition): Parse
353         any optional and potentially illegal pragmas which appear in
354         a protected operation declaration list.
355         (P_Task_Items): Parse
356         any optional and potentially illegal pragmas which appear in a
357         task item list.
359 2017-01-23  Pascal Obry  <obry@adacore.com>
361         * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
362         is needed when a foreign thread call a Win32 API using a thread handle
363         like GetThreadTimes() for example.
365 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
367         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
368         allow an 'Address clause to be specified on a prefix of a
369         class-wide type.
371 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
373         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
374         attribute 'Valid is a renaming of the original expression when
375         the expression denotes a name. For all other kinds of expression,
376         use a constant to capture the value.
377         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
378         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
380 2017-01-23  Justin Squirek  <squirek@adacore.com>
382         * sem_eval.adb (Eval_Integer_Literal): Add special
383         case to avoid optimizing out check if the literal appears in
384         an if-expression.
386 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
388         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
389         allow an 'Address clause to be specified on a prefix of a
390         class-wide type.
392 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
394         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
395         attribute 'Valid is a renaming of the original expression when
396         the expression denotes a name. For all other kinds of expression,
397         use a constant to capture the value.
398         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
399         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
401 2017-01-23  Justin Squirek  <squirek@adacore.com>
403         * sem_eval.adb (Eval_Integer_Literal): Add special
404         case to avoid optimizing out check if the literal appears in
405         an if-expression.
407 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
409         * sem_ch4.adb (Try_Primitive_Operations,
410         Is_Valid_First_Argument_Of): argument is valid if it is a derived
411         type with unknown discriminants that matches its underlying
412         record view.
413         * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
414         expression if its type is derived from a limited type with
415         unknown discriminants, because the expansion (which is a call)
416         must be expanded in the enclosing context to add the proper build-
417         in-place parameters to the call.
418         * lib.ads, exp_ch9.adb: Minor fixes in comments.
420 2017-01-23  Yannick Moy  <moy@adacore.com>
422         * frontend.adb (Frontend): Do not load runtime
423         unit for GNATprove when parsing failed.
424         * exp_ch9.adb: minor removal of extra whitespace
425         * exp_ch6.adb: minor typo in comment
426         * sem_util.adb: Code cleanup.
427         * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
428         * a-ngcefu.adb: minor style fix in whitespace
430 2017-01-23  Thomas Quinot  <quinot@adacore.com>
432         * scos.ads: Document usage of 'd' as default SCO kind for
433         declarations.
434         * par_sco.adb (Traverse_Declarations_Or_Statements.
435         Traverse_Degenerate_Subprogram): New supporting routine for expression
436         functions and null procedures.
437         (Traverse_Declarations_Or_Statements.Traverse_One): Add
438         N_Expression_Function to the subprogram case; add required
439         support for null procedures and expression functions.
441 2017-01-23  Bob Duff  <duff@adacore.com>
443         * namet.ads (Bounded_String): Decrease the size of type
444         Bounded_String to avoid running out of stack space.
445         * namet.ads (Append): Don't ignore buffer overflow; raise
446         Program_Error instead.
448 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
450         * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
451         sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
452         reformatting.
453         * exp_ch9.adb: minor style fix in comment.
455 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
457         * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
458         for a limited record extension with unknown discriminants whose
459         full view has no discriminants.
461 2017-01-23  Yannick Moy  <moy@adacore.com>
463         * exp_spark.adb: Alphabetize with clauses.
465 2017-01-23  Yannick Moy  <moy@adacore.com>
467         * sem_util.adb (Has_Enabled_Property): Treat
468         protected objects and variables differently from other variables.
470 2017-01-23  Thomas Quinot  <quinot@adacore.com>
472         * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
473         Split original Ada 95 part off into new subprogram
474         below. Call that subprogram (instead of proceeding with
475         AI95-0133 behaviour) if debug switch -gnatd.p is in use.
476         (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
477         * debug.adb Document new switch -gnatd.p
478         * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
479         record for reverse bit order if an error has already been posted
480         on the record type.  This avoids generating extraneous "info:"
481         messages for illegal code.
483 2017-01-23  Justin Squirek  <squirek@adacore.com>
485         * sem_ch3.adb (Analyze_Declarations): Correct comments
486         * freeze.adb (Find_Constant): Add detection of deferred constants
487         so they are not incorrectly flagged as premature.
489 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
491         * scans.ads: New token At_Sign. Remove '@' from list of illegal
492         characters for future version of the language. '@' is legal name.
493         * scng.ads, scng.adb (Scan):  Handle '@' appropriately.
494         * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
495         denotes a Target_Name.
496         * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
497         * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
498         (Has_Target_Names): New flag on N_Assignment_Statement, to
499         indicate that RHS has occurrences of N_Target_Name.
500         * sem.adb: Call Analyze_Target_Name.
501         * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
502         (urrent_LHS): Global variable that denotes LHS of assignment,
503         used in the analysis of Target_Name nodes.
504         * sem_res.adb (Resolve_Target_Name): New procedure.
505         * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
506         N is an assignment statement whose RHS contains occurences of @
507         that designate the value of the LHS of the assignment. If the
508         LHS is side-effect free the target names can be replaced with
509         a copy of the LHS; otherwise the semantics of the assignment
510         is described in terms of a procedure with an in-out parameter,
511         and expanded as such.
512         (Expand_N_Assignment_Statement): Call
513         Expand_Assign_With_Target_Names when needed.
514         * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
515         * sprint.adb: Handle N_Target_Name.
517 2017-01-23  Eric Botcazou  <ebotcazou@adacore.com>
519         * checks.adb: Minor fix in comment.
521 2017-01-23  Philippe Gil  <gil@adacore.com>
523         * g-debpoo.adb (Do_Report) remove freed chunks from chunks
524         count in Sort = Memory_Usage or Allocations_Count
526 2017-01-23  Justin Squirek  <squirek@adacore.com>
528         * sem_ch3.adb: Code cleanup.
530 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
532         * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
533         variables to the local variable section. Update the profile
534         of various nested routine that previously had visibility
535         of those globals. One the matching phase has completed,
536         remove certain classes of clauses which are considered noise.
537         (Check_Dependency_Clause): Properly detect a match between two
538         'Result attributes. Update the various post-match cases to use
539         Is_Already_Matched as this routine now automatically recognizes
540         a previously matched 'Result attribute.
541         (Is_Already_Matched): New routine.
542         (Remove_Extra_Clauses): New routine.
543         (Report_Extra_Clauses): Remove the detection of ... => null
544         clauses as this is now done in Remove_Extra_Clauses.
546 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
548         * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
549         report on spurious overlaps between values involving a subtype
550         with a static predicate, because the expansion of such a subtype
551         into individual ranges in inhibited in ASIS mode.
553 2017-01-23  Justin Squirek  <squirek@adacore.com>
555         * sem_ch3.adb (Analyze_Declarations): Add detection
556         of an edge case and delay freezing if it is present.
558 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
560         * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
561         sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
563 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
565         * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
566         access-to-subprogram types inherit the convention of the
567         associated subprogram.  (Set_Profile_Convention): New routine.
568         * sem_ch6.adb (Check_Conformance): Do not compare the conventions
569         of the two entities directly, use Conventions_Match to account
570         for anonymous access-to-subprogram and subprogram types.
571         (Conventions_Match): New routine.
573 2017-01-23  Claire Dross  <dross@adacore.com>
575         * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
576         which return Universal_Integer, force the overflow check flag for
577         Length and Range_Length for types as big as Long_Long_Integer.
579 2017-01-23  Claire Dross  <dross@adacore.com>
581         * exp_spark.adb (Expand_SPARK_Attribute_Reference):  For
582         attributes which return Universal_Integer, introduce a conversion
583         to the expected type with the appropriate check flags set.
584         * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
585         base type if the range is null. It may still be invalid if it
586         is higher than the lower bound. This is checked later in the
587         context in which the range appears.
589 2017-01-23  Pierre-Marie de Rodat  <derodat@adacore.com>
591         * scos.ads: Introduce a constant to represent ignored
592         dependencies in SCO_Unit_Table_Entry.
594 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
596         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
597         spaces from error messages.
599 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
601         * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
602         subsidiary to Expand_N_Object_ Declaration, to compute a guard on
603         an object declaration for an array type with a modular index type
604         with the size of Long_Long_Integer. Special processing is needed
605         in this case to compute reliably the size of the object, and
606         eventually  to raise Storage_Error, when wrap-around arithmetic
607         might compute a meangingless size for the object.
609 2017-01-23  Justin Squirek  <squirek@adacore.com>
611         * a-wtenau.adb, par-endh.adb, sem_prag.adb,
612         sem_type.adb: Code cleanups.
614 2017-01-23  Bob Duff  <duff@adacore.com>
616         * sem_res.adb (Resolve_Call): In the part of the code where
617         it is deciding whether to turn the call into an indexed
618         component, avoid doing so if the call is to an instance of
619         Unchecked_Conversion. Otherwise, the compiler turns it into an
620         indexed component, and resolution of that turns it back into a
621         function call, and so on, resulting in infinite recursion.
622         * sem_util.adb (Needs_One_Actual): If the first formal has a
623         default, then return False.
625 2017-01-21  Eric Botcazou  <ebotcazou@adacore.com>
627         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
628         optimizations when the type is modular and the offsets are equal.
630 2017-01-20  Thomas Quinot  <quinot@adacore.com>
632         * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
633         message.
635 2017-01-20  Nicolas Roche  <roche@adacore.com>
637         * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
639 2017-01-20  Bob Duff  <duff@adacore.com>
641         * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
642         (etc) optimizations when the type is modular.
644 2017-01-20  Yannick Moy  <moy@adacore.com>
646         * sem_ch6.adb (Move_Pragmas): move some pragmas,
647         but copy the SPARK_Mode pragma instead of moving it.
648         (Build_Subprogram_Declaration): Ensure that the generated spec
649         and original body share the same SPARK_Pragma aspect/pragma.
650         * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
651         procedure to copy SPARK_Mode aspect.
653 2017-01-20  Bob Duff  <duff@adacore.com>
655         * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
656         even in ASIS mode.
657         * sem_ch13.adb (Resolve_Name): Enable setting the entity to
658         Empty even in ASIS mode.
660 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
662         * exp_ch9.adb: minor style fixes in comments.
663         * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
664         relative statement introduces an implicit dependency on
665         Ada.Real_Time.Clock_Time.
666         * sem_util.adb: Minor reformatting.
668 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
670         * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
671         must be treated as delayed aspect even if the expression is
672         a literal, because the aspect affects the freezing and the
673         elaboration of the object to which it applies.
675 2017-01-20  Tristan Gingold  <gingold@adacore.com>
677         * s-osinte-vxworks.ads (Interrup_Range): New subtype.
679 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
681         * lib-xref.adb (Generate_Reference): Do not warn about the
682         presence of a pragma Unreferenced if the entity appears as the
683         actual in a procedure call that does not come from source.
685 2017-01-20  Pascal Obry  <obry@adacore.com>
687         * expect.c, terminals.c: Fix some warnings about unused variables.
688         * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
689         of the runtime.
691 2017-01-20  Bob Duff  <duff@adacore.com>
693         * exp_attr.adb (Constrained): Apply an access check (check that
694         the prefix is not null) when the prefix denotes an object of an
695         access type; that is, when there is an implicit dereference.
697 2017-01-20  Gary Dismukes  <dismukes@adacore.com>
699         * s-rident.ads (constant Profile_Info): Remove
700         No_Calendar from GNAT_Extended_Ravenscar restrictions.
702 2017-01-20  Tristan Gingold  <gingold@adacore.com>
704         *  s-maccod.ads: Add pragma No_Elaboration_Code_All
706 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
708         * ghost.adb (Mark_Ghost_Clause): New routine.
709         (Prune_Node): Do not prune compilation unit nodes.
710         (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
711         This does not touch the node itself, but does prune all its fields.
712         * ghost.ads (Mark_Ghost_Clause): New routine.
713         * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
714         package clause mentions Ghost and non-Ghost packages. Mark a
715         use package clause as Ghost when it mentions a Ghost package.
716         (Analyze_Use_Type): Emit an error when a use type clause mentions
717         Ghost and non-Ghost types. Mark a use type clause as Ghost when
718         it mentions a Ghost type.
719         * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
720         Ghost when it withs a Ghost unit.
722 2017-01-20  Javier Miranda  <miranda@adacore.com>
724         * sem_res.adb (Resolve_Call): If a function call
725         returns a limited view of a type and at the point of the call the
726         function is not declared in the extended main unit then replace
727         it with the non-limited view, which must be available. If the
728         called function is in the extended main unit then no action is
729         needed since the back-end handles this case.
731 2017-01-20  Eric Botcazou  <ebotcazou@adacore.com>
733         * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
734         (Contains_Subprograms_Refs): ...this.  Adjust comment
735         for constants.  (Is_Subp_Or_Const_Ref): Rename into...
736         (Is_Subprogram_Ref): ...this.
737         (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
738         Has_Non_Subprograms_Referencer and adjust comment.  Remove
739         incorrect shortcut for package declarations and bodies.
741 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
743         * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
744         base type differs from that of the completion and the private
745         subtype is an itype (created for a constraint on an access
746         type e.g.), set Delayed_Freeze on both to prevent out-of-scope
747         anomalies in gigi.
749 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
751         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
752         When inheriting the SPARK_Mode of a prior expression function,
753         look at the properly resolved entity rather than the initial
754         candidate which may denote a homonym.
756 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
758         * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
759         Precondition or Postcondition, and the context is pragma
760         Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
761         and suggest the standard names Assertion_Policy /Pre /Post
762         instead.
764 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
766         * sem_ch10.adb, sem_cat.adb: Minor reformatting.
768 2017-01-20  Javier Miranda  <miranda@adacore.com>
770         * sem_ch3.adb (Access_Type_Declaration): Protect access to the
771         Entity attribute.
772         * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
773         * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
774         malformed trees.
776 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
778         * sem_ch13.adb (Analyze_Aspect_Specification, case
779         Dynamic_Predicate): If the entity E is a subtype that inherits
780         a static predicate for its parent P,, the inherited and the
781         new predicate combine in the generated predicate function,
782         and E only has a dynamic predicate.
784 2017-01-20  Tristan Gingold  <gingold@adacore.com>
786         * s-boustr.ads, s-boustr.adb: New package.
787         * Makefile.rtl: Add s-boustr.
789 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
791         * inline.adb (Process_Formals): Qualify the
792         expression of a return statement when it yields a universal type.
794 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
796         * freeze.adb (Freeze_All): Freeze the default
797         expressions of all eligible formal parameters that appear in
798         entries, entry families, and protected subprograms.
800 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
802         * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
803         for illegal inherited Implicit_Dereference aspects with renamed
804         discriminants.
806 2017-01-20  Javier Miranda  <miranda@adacore.com>
808         * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
809         * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
810         * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
811         (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
812         Set_Prev, Tree_Read): Adding assertion.
813         * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
814         * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
815         (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
816         Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
817         Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
818         Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
819         Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
820         Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
821         Set_ListN_With_Parent): Adding assertion.
823 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
825         * sem_prag.adb (Process_Convention): Diagnose properly a pragma
826         import that applies to several homograph subprograms. when one
827         of them is declared by a subprogram body.
829 2017-01-20  Justin Squirek  <squirek@adacore.com>
831         * exp_ch6.adb (Expand_Call): Remove optimization
832         that nulls out calls to null procedures.
834 2017-01-20  Yannick Moy  <moy@adacore.com>
836         * inline.adb (Expand_Inlined_Call): Keep more
837         precise type of actual for inlining whenever possible. In
838         particular, do not switch to the formal type in GNATprove mode in
839         some case where the GNAT backend might require it for visibility.
841 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
843         * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
844         aspect Implicit_Dereference can be inherited by a full view if
845         the partial view has no discriminants, because there is no way
846         to apply the aspect to the partial view.
847         (Build_Derived_Record_Type): If derived type renames discriminants
848         of the parent, the new discriminant inherits the aspect from
849         the old one.
850         * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
851         call through an access discriminant designating a subprogram.
852         * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
853         properly a parameterless call through an access discriminant on
854         the left-hand side of an assignment.
855         * sem_res.adb (resolve): If an interpreation involves a
856         discriminant with an implicit dereference and the expression is an
857         entity, resolution takes place later in the appropriate routine.
858         * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
859         access discriminants that designate a subprogram type.
861 2017-01-20  Pascal Obry  <obry@adacore.com>
863         * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
865 2017-01-20  Yannick Moy  <moy@adacore.com>
867         * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
868         on implicitly with'ed units in GNATprove mode.
869         * sinfo.ads (Implicit_With): Document use of flag for implicitly
870         with'ed units in GNATprove mode.
872 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
874         * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
875         unit Do not report an error on a non-static entity that appears
876         in the context of a spec expression, such as an aspect expression.
878 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
880         * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
881         (Is_Underlying_Full_View): New routine.
882         (Set_Is_Underlying_Full_View): New routine.
883         (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
884         * einfo.ads Add new attribute Is_Underlying_Full_View.
885         (Is_Underlying_Full_View): New routine along with pragma Inline.
886         (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
887         * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
888         class-wide types and underlying full views. The first subtype
889         is used as the working type for all Itypes, not just array base types.
890         (Build_DIC_Procedure_Declaration): Do not consider
891         class-wide types and underlying full views. The first subtype
892         is used as the working type for all Itypes, not just array
893         base types.
894         * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
895         view or an underlying full view without clobbering the attributes
896         of a previous freeze node.
897         (Inherit_Freeze_Node): New routine.
898         * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
899         full view as such.
900         (Build_Underlying_Full_View): Mark an underlying full view as such.
901         * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
902         full view as such.
904 2017-01-20  Yannick Moy  <moy@adacore.com>
906         * sinfo.ads: Document lack of Do_Division_Check flag
907         on float exponentiation.
909 2017-01-19  Javier Miranda  <miranda@adacore.com>
911         * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
912         identifier attribute of a block-statement node. Required to avoid
913         assertion failure when building the new containers library.
915 2017-01-19  Bob Duff  <duff@adacore.com>
917         * exp_ch3.adb: Update comment.
919 2017-01-19  Vincent Celier  <celier@adacore.com>
921         * gprep.adb (Gnatprep): Parse the definition file without
922         "replace in comments" even when switch -C is used.
924 2017-01-19  Justin Squirek  <squirek@adacore.com>
926         * exp_ch9.adb (Is_Pure_Barrier): Create function
927         Is_Count_Attribute to identify an expansion of the 'Count
928         attribute.
930 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
932         * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
933         statements within an element iterator loop are only analyzed
934         agter the loop is rewritten. Within a generic the analysis must
935         be performed in any case to complete name capture.
937 2017-01-19  Bob Duff  <duff@adacore.com>
939         * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
940         before checking for unrecognized pragmas.
941         Initialize Pname on its declarations; that's always good style.
943 2017-01-19  Claire Dross  <dross@adacore.com>
945         * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
946         body into the tree for GNATprove by setting its Parent field. The
947         components invariants of composite types are not checked by
948         the composite type's invariant procedure in GNATprove mode.
949         (Build_Invariant_Procedure_Declaration): Semi-insert the
950         declaration into the tree for GNATprove by setting its Parent
951         field.
952         * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
953         the component invariants to the array type  invariant procedure
954         so that the procedure can be used to  check the array type
955         invariants if any.
956         (Freeze_Record_Type): In GNATprove mode, do
957         not add the component invariants to the record type  invariant
958         procedure so that the procedure can be used to  check the record
959         type invariants if any.
961 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
963         * lib-xref-spark_specific.adb: Minor reformatting.
964         * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
966 2017-01-19  Javier Miranda  <miranda@adacore.com>
968         * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
969         Build_Back_End_Aggregate.
970         (Generate_Aggregate_For_Derived_Type): Code cleanup.
971         (Prepend_Stored_Values): Code cleanup.
973 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
975         * sem_ch6.adb (Analyze_Expression_Function): Check for an
976         incomplete return type after attempting to freeze it, so that
977         other freeze actiona are generated in the proper order.
979 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
981         * sem_aggr.adb (Resolve_Aggregate): If the type is a string
982         type, ie. a type whose component is a character type, and the
983         aggregate is positional, do not convert into a string literal
984         if the index type is not an integer type, because the original
985         type may be required in an enclosing operation.
987 2017-01-19  Bob Duff  <duff@adacore.com>
989         * binde.adb, debug.adb: Enable new elaboration order algorithm
990         by default. -dp switch reverts to the old algorithm.
992 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
994         * sem_ch3.adb Add with and use clauses for Exp_Ch7.
995         (Analyze_Declarations): Create the DIC and Invariant
996         procedure bodies s after all freezing has taken place.
997         (Build_Assertion_Bodies): New routine.
998         * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
999         and Exp_Util.
1000         (Analyze_Package_Specification): Remove the
1001         generation of the DIC and Invariant procedure bodies. This is
1002         now done by Analyze_Declarations.
1003         * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
1004         procedures are never treated as primitives.
1006 2017-01-19  Yannick Moy  <moy@adacore.com>
1008         * frontend.adb: Analyze inlined bodies and check elaboration
1009         rules in GNATprove mode too.
1010         * sem_elab.adb (Delay_Element): Add Boolean component to save
1011         indication that call is in SPARK code.  (Check_Elab_Calls):
1012         Check elaboration rules in GNATprove mode, and correctly set
1013         the current value of SPARK_Mode.
1014         * lib-xref-spark_specific.adb
1015         (Add_SPARK_Xrefs): Simplify iteration over dereferences.
1017 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
1019         * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
1020         checks on the expression for the high bound of concatenation
1021         when checks are disabled, to suppress warnings about potential
1022         constraint errors in restricted runtimes.
1024 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
1026         * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
1027         representation-to-position function as inlined.
1028         * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
1029         the purity of an internally generated entity if it has been
1030         explicitly marked as pure for optimization purposes.
1031         * exp_aggr.adb: Minor reformatting.
1033 2017-01-19  Javier Miranda  <miranda@adacore.com>
1035         * exp_ch6.adb (Expand_Call): Remove side effects on
1036         actuals that are allocators with qualified expression since the
1037         initialization of the object is performed by means of individual
1038         statements (and hence it must be done before the call).
1040 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
1042         * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
1043         (Build_Derived_Enumeration_Type): If the derived type inherits a
1044         dynamic predicate from its parent, the bounds of the type must
1045         freeze because an explicit constraint is constructed for the
1046         type and the corresponding range is elaborated now.
1048 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
1050         * sem_attr.ads: minor fix of inconsistent casing in comment
1051         * lib-writ.ads: minor align comments in columns
1052         * sem_ch3.adb: Minor reformatting.
1053         * spark_xrefs.ads: minor fix typo in SPARK-related comment
1054         * table.ads: minor style fix in comment
1055         * lib-xref-spark_specific.adb
1056         (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
1057         * sem_ch12.adb: minor whitespace fix
1058         * freeze.adb: Add comment.
1059         * sem_util.adb (Unique_Name): for instances of
1060         generic subprograms ignore the name of the wrapper package.
1062 2017-01-19  Javier Miranda  <miranda@adacore.com>
1064         * exp_aggr.adb (Resolve_Record_Aggregate):
1065         Factorize code needed for aggregates of limited and unlimited
1066         types in a new routine.
1067         (Pass_Aggregate_To_Back_End): New subprogram.
1069 2017-01-19  Yannick Moy  <moy@adacore.com>
1071         * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
1073 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
1075         * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
1076         public, for use elsewhere.
1077         * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
1078         an Inlined_body, recognize a call that uses object notation
1079         and has not been rewritten as a regular call because regular
1080         expansion has not taken place.
1082 2017-01-19  Bob Duff  <duff@adacore.com>
1084         * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
1085         in case of generic formal discrete types, because it causes crashes in
1086         the compiler when built with assertions on.
1088 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
1090         * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
1091         sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
1093 2017-01-19  Bob Duff  <duff@adacore.com>
1095         * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
1096         Increment Warnings_Detected.  It was decrementing, which is
1097         wrong since we just issued a warning message.
1098         * binderr.ads (Errors_Detected, Warnings_Detected): Declare
1099         these variables to be of subtype Nat instead of Int, because
1100         they should never be negative.
1102 2017-01-19  Javier Miranda  <miranda@adacore.com>
1104         * contracts.adb (Build_Postconditions_Procedure): Replace
1105         Generate_C_Code by Modify_Tree_For_C.
1106         * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
1107         Replace Generate_C_Code by Modify_Tree_For_C.
1108         * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
1109         Modify_Tree_For_C.
1110         * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
1111         Generate_C_Code by Modify_Tree_For_C.
1112         * exp_ch4.adb (Expand_Allocator_Expression): Replace
1113         Generate_C_Code by Modify_Tree_For_C.
1114         * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
1115         by Modify_Tree_For_C.
1116         * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
1117         Generate_C_Code by Modify_Tree_For_C.
1118         * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
1119         by Modify_Tree_For_C.
1120         * sinfo.ads (Modify_Tree_For_C): Adding documentation.
1122 2017-01-19  Javier Miranda  <miranda@adacore.com>
1124         * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
1125         subprogram.
1126         (Is_Inlinable_Expression_Function): New subprogram.
1127         * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
1128         to Sem_Util.
1129         (Is_Inlinable_Expression_Function): Moved to Sem_Util.
1131 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
1133         * sem_ch4.adb (Diagnose_Call): Improve error message when a
1134         selected component has a prefix that might be interpreted
1135         as a parameterless function call, but none of the candidate
1136         interpretations is parameterless, and there is a hidden homonym
1137         of the prefix that is a package.
1138         * sem_ch8.adb (Find_Selected_Component): If the prefix might be
1139         interpreted as a parameterless function call and its analysis
1140         fails, do not call Analyze_Selected_Component.
1142 2017-01-19  Steve Baird  <baird@adacore.com>
1144         * sem_util.ads: Add new Use_Full_View Boolean parameter to
1145         Get_Index_Bounds.
1146         * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
1147         calls to a newly-defined Scalar_Range_Of_Right_View function.
1149 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
1151         * gnat1drv.adb: minor fix of unbalanced parens in comment
1152         * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
1153         to visible part of the package to allow re-use in GNATprove.
1154         * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
1155         from repeated code of Traverse_Compilation_Unit.
1156         (Traverse_Declaration_Or_Statement): fixed detection of
1157         generic subprograms and packages; also, iteration over case
1158         statement alternatives rewritten to avoid testing if the first
1159         alternative is present (since it must be present due to Ada
1160         syntax restrictions).
1162 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
1164         * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
1165         returning by reference not just for subprogram body stubs,
1166         but for all subprogram cases.
1167         * sem_util.adb: Code reformatting.
1168         (Requires_Transient_Scope): Update the call to Results_Differ.
1169         (Results_Differ): Update the parameter profile and the associated
1170         comment on usage.
1172 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
1174         * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
1175         identifier nodes that do not come from source, to handle properly
1176         dimensionality check within an inlined body which inclddes both
1177         original operands and rewritten operands. This removes spurious
1178         dimensionality errors in the presence of front-end inlining,
1179         as well as in SPARK mode.
1181 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
1183         PR driver/49726
1184         * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
1186 2017-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1188         * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
1190 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
1192         * doc/gnat_ugn/getting_started_with_gnat.rst,
1193         doc/gnat_ugn/inline_assembler.rst,
1194         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1195         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
1196         doc/gnat_ugn/about_this_guide.rst,
1197         doc/gnat_ugn/platform_specific_information.rst,
1198         doc/gnat_ugn/example_of_binder_output.rst,
1199         doc/gnat_ugn/gnat_and_program_execution.rst,
1200         doc/gnat_ugn/gnat_utility_programs.rst,
1201         doc/gnat_ugn/the_gnat_compilation_model.rst,
1202         doc/gnat_rm/implementation_defined_attributes.rst,
1203         doc/gnat_rm/compatibility_and_porting_guide.rst,
1204         doc/gnat_rm/standard_library_routines.rst,
1205         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
1206         doc/gnat_rm/implementation_defined_pragmas.rst,
1207         doc/gnat_rm/the_gnat_library.rst,
1208         doc/gnat_rm/obsolescent_features.rst,
1209         doc/gnat_rm/about_this_guide.rst,
1210         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
1211         doc/gnat_rm/implementation_of_ada_2012_features.rst,
1212         doc/gnat_rm/interfacing_to_other_languages.rst,
1213         doc/gnat_rm/implementation_defined_aspects.rst,
1214         doc/gnat_rm.rst: Update documentation.
1215         * gnat_rm.texi, gnat_ugn.texi: Regenerated.
1217 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1219         * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
1220         * scil_ll.adb: Minor style fix in comment.
1221         * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
1222         even if entity is already set, because the node may be renalyzed
1223         after inlining transformations.
1225 2017-01-13  Javier Miranda  <miranda@adacore.com>
1227         * sem_res.adb (Resolve_Call): Do not establish a transient scope
1228         for a call to inlinable expression function (since the call will
1229         be replaced by its returned object).
1230         * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
1231         * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
1232         (Expand_Call): For inlinable expression function call replace the
1233         call by its returned object.
1234         (Is_Inlinable_Expression_Function): New subprogram.
1236 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1238         * checks.adb: Minor typo fix and reformatting.
1240 2017-01-13  Javier Miranda  <miranda@adacore.com>
1242         * contracts.adb (Contract_Only_Subprograms): Remove formal.
1243         (Copy_Original_Specification): Removed.
1244         (Skip_Contract_Only_Subprogram): Move here checks previously
1245         located in the caller of this routine (to leave the code more clean).
1246         (Build_Contract_Only_Subprogram): Code cleanup.
1247         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
1248         (Get_Contract_Only_Missing_Body_Name): Removed.
1250 2017-01-13  Javier Miranda  <miranda@adacore.com>
1252         * sem_ch6.adb (Cloned_Expression): New subprogram.
1253         (Freeze_Expr_Types): Complete previous patch since the expression
1254         of an expression-function may have iterators and loops with
1255         defining identifiers which, as part of the preanalysis of the
1256         expression, may be left decorated with itypes that will not be
1257         available in the tree passed to the backend.
1259 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1261         * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
1262         conversion to Integer of an expression that is an attribute
1263         reference 'Pos on an enumeration type.
1265 2017-01-13  Bob Duff  <duff@adacore.com>
1267         * atree.ads: Minor comment fix.
1269 2017-01-13  Justin Squirek  <squirek@adacore.com>
1271         * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
1272         calls in accessibility check on return statement.
1274 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1276         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
1277         Ensure that the input body is a subprogram body before trying to
1278         determine whether it denoted an expression function.  Note that
1279         subprogram body stubs cannot denote expression functions.
1281 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1283         * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
1284         and typo fixes.
1286 2017-01-13  Javier Miranda  <miranda@adacore.com>
1288         * einfo.ads (Component_Bit_Offset): Fix documentation.
1289         * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
1290         on record holes for components with unknown compile-time offsets.
1292 2017-01-13  Bob Duff  <duff@adacore.com>
1294         * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
1295         * g-locfil.ads: Minor comment fix.
1297 2017-01-13  Bob Duff  <duff@adacore.com>
1299         * binde.adb (Elab_New): New elaboration order algorithm
1300         that is expected to cause fewer ABE issues. This is a work in
1301         progress. The new algorithm is currently disabled, and can be
1302         enable by the -dp switch, or by modifying the Do_Old and Do_New
1303         etc. flags and rebuilding. Experimental code is included to
1304         compare the results of the old and new algorithms.
1305         * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
1306         can have multiple of these tables, so the old and new algorithms
1307         can coexist.
1308         * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
1309         parameter of type array. This avoids the global variable, and
1310         allows bounds checking (which is normally defeated by the tables
1311         packages). It also ensures that the Elab_Order is read-only
1312         to Bindgen.
1313         * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
1314         subprograms that need it, as above.
1315         * debug.adb: Document new -dp switch. Modify doc of old -do
1316         switch.
1317         * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
1318         and Bindgen.  Move writing of closure (-R and -Ra switches)
1319         to Binde; that's more convenient.
1321 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1323         * sem_ch6.adb (Analyze_Expression_Function): If the expression
1324         function is a completion, all entities referenced in the
1325         expression are frozen. As a consequence, a reference to an
1326         uncompleted private type from an enclosing scope is illegal.
1328 2017-01-13  Javier Miranda  <miranda@adacore.com>
1330         * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
1331         (Analyze_Subprogram_Body_Helper): At the occurrence of an
1332         expression function declaration that is a completion, its
1333         expression causes freezing (AI12-0103).
1335 2017-01-13  Vadim Godunko  <godunko@adacore.com>
1337         * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
1338         Reference functions of Ada.Containers.Indefinite_Holders.
1340 2017-01-13  Bob Duff  <duff@adacore.com>
1342         * s-os_lib.ads: Minor comment fixes.
1344 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1346         * exp_ch3.adb (Default_Initialize_Object): Do not default
1347         initialize an object when it is of a task type and restriction
1348         No_Tasking is in effect because the initialization is obsolete.
1349         * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
1350         restriction No_Tasking is in effect.
1351         (Build_Master_Renaming): Do not rename a master when restriction
1352         No_Tasking is in effect.
1354 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1356         * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
1357         the legality of An others clause applies as well to a choice in
1358         an Iterated_component_ association.
1359         (Resolve_Iterated_Component_Association): An others choice
1360         is legal.
1361         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
1362         Iterated_Component_Association is not static.
1364 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1366         * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
1367         control is passed to the expresion handler before the new mode
1368         is set.
1369         * sem_ch12.adb (Analyze_Package_Instantiation,
1370         Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
1371         in case control is passed to the expresion handler before the
1372         new mode is set.
1374 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1376         * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
1377         exp_aggr.adb: Minor reformatting.
1379 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1381         * inline.adb: Minor reformatting and typo fix.
1383 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1385         * sem_util.ads, sem_util.adb (Choice_List): Move function here
1386         from sem_aggr.adb, for use elsewhere.
1387         * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
1388         * sem_aggr.adb (Resolve_Array_Aggregate): Remove
1389         Iterated_Component_Present.
1390         * exp_aggr.adb: Use Choice_List throughout, to handle
1391         Iterated_Component_Associations.
1392         (Gen_Loop): Generate proper loop for an
1393         Iterated_Component_Association: loop variable has the identifier
1394         of the original association. Generate a loop even for a single
1395         component choice, in order to make loop parameter visible in
1396         expression.
1397         (Flatten): An Iterated_Component_Association is not static.
1399 2017-01-13  Yannick Moy  <moy@adacore.com>
1401         * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
1402         float exponentiation for statically known small negative values
1403         is the reciprocal of the exponentiation for the opposite value
1404         of the exponent.
1405         * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
1406         Ensure that the value of float exponentiation for negative values
1407         is the reciprocal of the exponentiation for the opposite value
1408         of the exponent.
1409         * inline.adb (Expand_Inlined_Call): Fix the count
1410         for the number of generated gotos.
1412 2017-01-13  Yannick Moy  <moy@adacore.com>
1414         * inline.adb: Code cleanup.
1415         * sem_util.adb (Is_OK_Volatile_Context): Add
1416         expression in delay statement as OK for volatile context.
1418 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1420         * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
1421         mode a choice that is a subtype with a static predicate is
1422         replaced by the values it covers. This transformation must not
1423         be performed in ASIS mode, to preserve the source for analysis.
1425 2017-01-13  Justin Squirek  <squirek@adacore.com>
1427         * nlists.ads: Correct minor typo.
1429 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1431         * sem_ch13.adb: Minor reformatting and typo fix.
1433 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1435         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
1436         Iterated_Component_Association is a named association in an
1437         array aggregate.
1438         * sem_aggr.adb (Resolve_Iterated_Component_Association): New
1439         procedure, subsidiary of Resolve_Array_Aggregate, to analyze
1440         and resolve the discrete choices and the expression of the
1441         new construct.
1442         * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
1443         Loop_Actions and Box_Present are attributes of
1444         N_Iterated_Component_Association nodes. Box_Present is always
1445         False in this case.
1446         * sprint.adb (Sprint_Node): An Iterated_Component_Association
1447         has a Discrete_Choices list, as specified in the RM. A
1448         Component_Association for aggregate uses instead a Choices list.
1449         We have to live with this small inconsistency because the new
1450         construct also has a defining identifier, and there is no way
1451         to merge the two node structures.
1453 2017-01-13  Yannick Moy  <moy@adacore.com>
1455         * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
1456         list of pragmas to remove.  Remove pragmas from the list of
1457         statements in the body to inline.
1458         * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
1460 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1462         * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
1463         Analyze_Declarations, to analyze and resolve the expressions of
1464         aspect specifications in the current declarative list, so that
1465         the expressions have proper entity and type info.  This is needed
1466         for ASIS when there is no subsequent expansion to generate this
1467         semantic information.
1468         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
1469         original expression, to suppress cascaded errors when expression
1470         has been constant-folded.
1471         (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
1472         ASIS mode, because there is no subsequent expansion to decorate
1473         the tree.
1475 2017-01-13  Yannick Moy  <moy@adacore.com>
1477         * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
1478         New function to detect when a call may be inlined or not in
1479         GNATprove mode.
1480         (Expand_Inlined_Call): Ensure that a temporary
1481         is always created in the cases where a type conversion may be
1482         needed on an input parameter in GNATprove mode, so that GNATprove
1483         sees the check to perform.
1484         * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
1485         when not applicable due to actual requiring type conversion
1486         with possible check but no temporary value can be copied for
1487         GNATprove to see the check.
1489 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1491         * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
1492         exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
1493         layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
1494         exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
1495         exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
1496         g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
1497         sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
1498         prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
1499         a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
1500         get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
1501         g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
1502         sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
1503         s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
1504         contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
1505         g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
1506         g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
1507         a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
1508         ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
1509         get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
1510         prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
1511         exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
1512         s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
1513         a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
1514         a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
1515         g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
1516         par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
1517         uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
1518         a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
1519         statements to reflect the new style for case alternatives. Various
1520         code clean up and reformatting.
1522 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1524         * exp_util.adb: Minor reformatting.
1526 2017-01-13  Yannick Moy  <moy@adacore.com>
1528         * exp_spark.adb: Code cleanup.
1529         * sem_ch9.adb (Analyze_Delay_Until): Resolve
1530         expression so that calls are identified as such inside delay
1531         until.
1533 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1535         * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
1536         * par-ch3.adb (P_Discrete_Choice_List): An
1537         Iterated_Component_Association is an array aggregate component.
1538         * par-ch4.adb (P_Iterated_Component_Association): New procedure.
1539         (Is_Quantified_Expression): New function that performs a lookahead
1540         to distinguish quantified expressions from iterated component
1541         associations.
1542         (P_Aggregate_Or_Paren_Expr): Recognize iterated component
1543         associations.
1544         (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
1545         * sem.adb (Analyze): Handle Iterated_Component_Association.
1546         * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
1547         component associations.
1548         * sinfo.ads, sinfo.adb: Entries for for
1549         N_Iterated_Component_Association and its fields.
1550         * sprint.adb (Sprint_Node_Actual): Handle
1551         N_Iterated_Component_Association.
1553 2017-01-13  Justin Squirek  <squirek@adacore.com>
1555         * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
1556         of the style check until after preanalysis of acutals.
1558 2017-01-13  Yannick Moy  <moy@adacore.com>
1560         * sem_ch13.adb: Minor reformatting.
1561         * par-ch11.adb: minor style fix in whitespace
1562         * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
1563         reduced to Add_Artificial_ALI_File; style fix in declaration of
1564         Text; grammar fix in comment.
1565         * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
1566         * freeze.adb: Cleanup to pass pragma instead of
1567         expression to call.
1568         * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
1569         replace System'To_Address by equivalent call.
1571 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
1573         * bindusg.adb: Improve usage output for -f switch.
1575 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1577         * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
1578         Minor reformatting.
1580 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1582         * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
1583         treat comparisons on strings as legal in a Static_Predicate.
1584         (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
1585         a function call that is the expansion of a string comparison.The
1586         function call is built when compiling the corresponding predicate
1587         function, but the expression has been found legal as a static
1588         predicate during earlier analysis.
1589         * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
1590         properly a function call that is the expansion of a string
1591         comparison operation, in order to recover the Static_Predicate
1592         expression and apply it to a static argument when needed.
1594 2017-01-13  Tristan Gingold  <gingold@adacore.com>
1596         * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
1597         (Open_Read): Re-implement using Open_Read_No_Exception.
1598         (Open_Write): Raise exception in case of error.
1599         * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
1600         * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
1601         reaise exception.
1602         * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
1604 2017-01-13  Yannick Moy  <moy@adacore.com>
1606         * checks.adb: Code cleanup.
1608 2017-01-13  Yannick Moy  <moy@adacore.com>
1610         * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
1611         expression instead of unanalyzed aspect expression for checking
1612         the validity of inheriting an operation. Also copy the expression
1613         being passing it to Build_Class_Wide_Expression, as this call
1614         modifies its argument.
1615         * sem_util.ads Fix comment to reference correct function name
1616         New_Copy_Tree.
1618 2017-01-13  Javier Miranda  <miranda@adacore.com>
1620         * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
1621         when we propagate information about the indexes back to the original
1622         indexing mode and the prefix of the index is a function call, do not
1623         remove any parameter from such call.
1625 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1627         * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
1628         * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
1629         a build-in-place function whose result type is tagged.
1631 2017-01-13  Yannick Moy  <moy@adacore.com>
1633         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
1634         Do not generate a wrapper when the only candidate is a class-wide
1635         subprogram.
1636         (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
1637         inside a generic context.
1639 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1641         * exp_util.adb (Add_Inherited_Tagged_DIC):
1642         Pass the object parameters of both the parent and the derived
1643         type DIC procedure to the reference replacement circuitry.
1644         (Find_DIC_Type): Modify the circuitry to present the partial
1645         view of a private type in case the private type defines its own
1646         DIC pragma.
1647         (Replace_Object_And_Primitive_References): Add two
1648         optional formal parameters.  Update the comment on usage. Update
1649         the replacement of references to object parameters.
1651 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
1653         * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
1655 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
1657         * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
1658         an out parameter that is a type conversion, independently of th
1659         range check that may apply to the expression of the conversion,
1660         for use in GNATProve.
1662 2017-01-13  Yannick Moy  <moy@adacore.com>
1664         * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
1665         GNATprove_Mode here to Frontend.
1666         * frontend.adb (Frontend): Move the implicit with for System
1667         in GNATprove_Mode here as it ismore correct this way; the old
1668         place only worked by chance, since there were no overloaded names.
1669         * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
1670         * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
1671         four attributes identified in SRM 9(18), add an implicit with
1672         to Ada.Task_Identification.
1673         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
1674         Deal specially with the wrapper introduced for AI05-0071 in GNATprove
1675         mode.
1676         * checks.adb (Apply_Discriminant_Check,
1677         Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
1678         In GNATprove mode, we do not apply the checks, but we still
1679         analyze the expression to possibly issue errors on SPARK
1680         code when a run-time error can be detected at compile time.
1681         (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
1682         in GNATprove mode.
1684 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1686         * expander.adb (Expand): Add a warning about using return
1687         statements in Ghost management code.
1688         * exp_ch3.adb (Freeze_Type): Add a warning about using return
1689         statements in Ghost management code.
1690         * exp_ch7.adb (Build_Invariant_Procedure_Body,
1691         Build_Invariant_Procedure_Declaration): Add a warning about
1692         using return statements in Ghost management code.
1693         * exp_disp.adb (Make_DT): Add a warning about using return
1694         statements in Ghost management code.
1695         * exp_util.adb (Build_DIC_Procedure_Body,
1696         Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
1697         warning about using return statements in Ghost management code.
1698         * freeze.adb (Freeze_Entity): Add a warning about using return
1699         statements in Ghost management code.
1700         * sem.adb (Analyze, Do_Analyze): Add a warning about using return
1701         statements in Ghost management code.
1702         * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
1703         a warning about using return statements in Ghost management code.
1704         * sem_ch5.adb (Analyze_Assignment): Add a warning about using
1705         return statements in Ghost management code.
1706         * sem_ch6.adb (Analyze_Procedure_Call,
1707         Analyze_Subprogram_Body_Helper): Add a warning about using return
1708         statements in Ghost management code.
1709         * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
1710         using return statements in Ghost management code.
1711         * sem_ch12.adb (Analyze_Package_Instantiation,
1712         Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
1713         Instantiate_Subprogram_Body): Add a warning about using return
1714         statements in Ghost management code.
1715         * sem_ch13.adb (Build_Predicate_Functions,
1716         Build_Predicate_Function_Declarations): Add a warning about
1717         using return statements in Ghost management code.
1718         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
1719         Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
1720         Analyze_Pre_Post_Condition_In_Decl_Part):  Add a warning about
1721         using return statements in Ghost management code.
1723 2017-01-13  Tristan Gingold  <gingold@adacore.com>
1725         * s-mmosin-mingw.adb: Fix pragma import.
1727 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
1729         * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
1730         codepeer mode.
1732 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
1734         * atree.adb (Allocate_Initialize_Node): A newly created node is
1735         no longer marked as Ghost at this level.
1736         (Mark_New_Ghost_Node): New routine.
1737         (New_Copy): Mark the copy as Ghost.
1738         (New_Entity): Mark the entity as Ghost.
1739         (New_Node): Mark the node as Ghost.
1740         * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
1741         apply to unanalyzed entities.
1742         (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
1743         entities.
1744         (Set_Is_Checked_Ghost_Entity): This attribute now
1745         applies to all entities as well as unanalyzed entities.
1746         (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
1747         all entities as well as unanalyzed entities.
1748         * expander.adb Add with and use clauses for Ghost.
1749         (Expand): Install and revert the Ghost region associated with the node
1750         being expanded.
1751         * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
1752         (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
1753         (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
1754         (Expand_Freeze_Record_Type): Remove all Ghost-related code.
1755         (Freeze_Type): Install and revert the Ghost region associated
1756         with the type being frozen.
1757         * exp_ch5.adb Remove with and use clauses for Ghost.
1758         (Expand_N_Assignment_Statement): Remove all Ghost-related code.
1759         * exp_ch6.adb Remove with and use clauses for Ghost.
1760         (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
1761         (Expand_N_Subprogram_Body): Remove all Ghost-related code.
1762         * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
1763         Ghost region of the working type.
1764         (Build_Invariant_Procedure_Declaration): Install and revert
1765         the Ghost region of the working type.
1766         (Expand_N_Package_Body): Remove all Ghost-related code.
1767         * exp_ch8.adb Remove with and use clauses for Ghost.
1768         (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
1769         code.
1770         (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
1771         (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
1772         (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
1773         code.
1774         * exp_ch13.adb Remove with and use clauses for Ghost.
1775         (Expand_N_Freeze_Entity): Remove all Ghost-related code.
1776         * exp_disp.adb (Make_DT): Install and revert the Ghost region of
1777         the tagged type. Move the generation of various entities within
1778         the Ghost region of the type.
1779         * exp_prag.adb Remove with and use clauses for Ghost.
1780         (Expand_Pragma_Check): Remove all Ghost-related code.
1781         (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
1782         (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
1783         (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
1784         * exp_util.adb (Build_DIC_Procedure_Body): Install
1785         and revert the Ghost region of the working types.
1786         (Build_DIC_Procedure_Declaration): Install and revert the
1787         Ghost region of the working type.
1788         (Make_Invariant_Call): Install and revert the Ghost region of the
1789         associated type.
1790         (Make_Predicate_Call): Reimplemented. Install and revert the
1791         Ghost region of the associated type.
1792         * freeze.adb (Freeze_Entity): Install and revert the Ghost region
1793         of the entity being frozen.
1794         (New_Freeze_Node): Removed.
1795         * ghost.adb Remove with and use clauses for Opt.
1796         (Check_Ghost_Completion): Update the parameter profile
1797         and all references to formal parameters.
1798         (Ghost_Entity): Update the comment on usage.
1799         (Install_Ghost_Mode): New routines.
1800         (Is_Ghost_Assignment): New routine.
1801         (Is_Ghost_Declaration): New routine.
1802         (Is_Ghost_Pragma): New routine.
1803         (Is_Ghost_Procedure_Call): New routine.
1804         (Is_Ghost_Renaming): Removed.
1805         (Is_OK_Declaration): Reimplemented.
1806         (Is_OK_Pragma): Reimplemented.
1807         (Is_OK_Statement): Reimplemented.
1808         (Is_Subject_To_Ghost): Update the comment on usage.
1809         (Mark_And_Set_Ghost_Assignment): New routine.
1810         (Mark_And_Set_Ghost_Body): New routine.
1811         (Mark_And_Set_Ghost_Completion): New routine.
1812         (Mark_And_Set_Ghost_Declaration): New routine.
1813         (Mark_And_Set_Ghost_Instantiation): New routine.
1814         (Mark_And_Set_Ghost_Procedure_Call): New routine.
1815         (Mark_Full_View_As_Ghost): Removed.
1816         (Mark_Ghost_Declaration_Or_Body): New routine.
1817         (Mark_Ghost_Pragma): New routine.
1818         (Mark_Ghost_Renaming): New routine.
1819         (Mark_Pragma_As_Ghost): Removed.
1820         (Mark_Renaming_As_Ghost): Removed.
1821         (Propagate_Ignored_Ghost_Code): Update the comment on usage.
1822         (Prune_Node): Freeze nodes no longer need special pruning, they
1823         are processed by the general ignored Ghost code mechanism.
1824         (Restore_Ghost_Mode): New routine.
1825         (Set_Ghost_Mode): Reimplemented.
1826         (Set_Ghost_Mode_From_Entity): Removed.
1827         * ghost.ads Add with and use clauses for Ghost.
1828         (Check_Ghost_Completion): Update the parameter profile
1829         along with the comment on usage.
1830         (Install_Ghost_Mode): New routine.
1831         (Is_Ghost_Assignment): New routine.
1832         (Is_Ghost_Declaration): New routine.
1833         (Is_Ghost_Pragma): New routine.
1834         (Is_Ghost_Procedure_Call): New routine.
1835         (Mark_And_Set_Ghost_Assignment): New routine.
1836         (Mark_And_Set_Ghost_Body): New routine.
1837         (Mark_And_Set_Ghost_Completion): New routine.
1838         (Mark_And_Set_Ghost_Declaration): New routine.
1839         (Mark_And_Set_Ghost_Instantiation): New routine.
1840         (Mark_And_Set_Ghost_Procedure_Call): New routine.
1841         (Mark_Full_View_As_Ghost): Removed.
1842         (Mark_Ghost_Pragma): New routine.
1843         (Mark_Ghost_Renaming): New routine.
1844         (Mark_Pragma_As_Ghost): Removed.
1845         (Mark_Renaming_As_Ghost): Removed.
1846         (Restore_Ghost_Mode): New routine.
1847         (Set_Ghost_Mode): Redefined.
1848         (Set_Ghost_Mode_From_Entity): Removed.
1849         * sem.adb (Analyze): Install and revert the Ghost region of the
1850         node being analyzed.
1851         (Do_Analyze): Change the way a clean Ghost
1852         region is installed and reverted.
1853         * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
1854         all Ghost-related code.
1855         (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
1856         (Analyze_Number_Declaration): Remove all Ghost-related code.
1857         (Analyze_Object_Declaration): Install and revert the Ghost region of
1858         a deferred object declaration's completion.
1859         (Array_Type_Declaration): Remove all Ghost-related code.
1860         (Build_Derived_Type): Update the comment on
1861         the propagation of Ghost attributes from a parent to a derived type.
1862         (Derive_Subprogram): Remove all Ghost-related code.
1863         (Make_Class_Wide_Type): Remove all Ghost-related code.
1864         (Make_Implicit_Base): Remove all Ghost-related code.
1865         (Process_Full_View): Install and revert the Ghost region of
1866         the partial view.  There is no longer need to check the Ghost
1867         completion here.
1868         * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
1869         region of the left hand side.
1870         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
1871         all Ghost-related code.
1872         (Analyze_Expression_Function): Remove all Ghost-related code.
1873         (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
1874         (Analyze_Procedure_Call): Install and revert the Ghost region of
1875         the procedure being called.
1876         (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
1877         region of the spec or body.
1878         (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
1879         (Build_Subprogram_Declaration): Remove all Ghost-related code.
1880         (Find_Corresponding_Spec): Remove all Ghost-related code.
1881         (Process_Formals): Remove all Ghost-related code.
1882         * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
1883         the Ghost region of the spec.
1884         (Analyze_Package_Declaration): Remove all Ghost-related code.
1885         * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
1886         Ghost when it aliases a Ghost entity.
1887         (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
1888         a Ghost entity.
1889         (Analyze_Object_Renaming): Mark a renaming as Ghost when
1890         it aliases a Ghost entity.
1891         (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
1892         a Ghost entity.
1893         (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
1894         aliases a Ghost entity.
1895         * sem_ch11.adb Remove with and use clauses for Ghost.
1896         (Analyze_Exception_Declaration): Remove all Ghost-related code.
1897         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
1898         Ghost-related code.
1899         (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
1900         code.
1901         (Analyze_Package_Instantiation): Install and revert the Ghost region
1902         of the package instantiation.
1903         (Analyze_Subprogram_Instantiation): Install
1904         and revert the Ghost region of the subprogram instantiation.
1905         (Instantiate_Package_Body): Code clean up. Install and revert the
1906         Ghost region of the package body.
1907         (Instantiate_Subprogram_Body): Code clean up. Install and revert the
1908         Ghost region of the subprogram body.
1909         * sem_ch13.adb (Build_Predicate_Functions): Install
1910         and revert the Ghost region of the related type.
1911         (Build_Predicate_Function_Declaration): Code clean up. Install
1912         and rever the Ghost region of the related type.
1913         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
1914         Install and revert the Ghost region of the pragma.
1915         (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
1916         Ghost region of the pragma.
1917         (Analyze_Pragma): Install and revert the Ghost region of various
1918         pragmas.  Mark a pragma as Ghost when it is related to a Ghost entity
1919         or encloses a Ghost entity.
1920         (Analyze_Pre_Post_Condition): Install and revert the Ghost
1921         region of the pragma.
1922         (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
1923         Ghost region of the pragma.
1924         * sem_res.adb (Resolve): Remove all Ghost-related code.
1925         * sem_util.adb (Is_Declaration): Reimplemented.
1926         (Is_Declaration_Other_Than_Renaming): New routine.
1927         * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
1928         * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
1929         (Is_Ghost_Pragma): Removed.
1930         (Is_Ignored_Ghost_Pragma): New routine.
1931         (Set_Is_Checked_Ghost_Pragma): New routine.
1932         (Set_Is_Ghost_Pragma): Removed.
1933         (Set_Is_Ignored_Ghost_Pragma): New routine.
1934         * sinfo.ads: Update the documentation on Ghost mode and
1935         Ghost regions.  New attributes Is_Checked_Ghost_Pragma
1936         and Is_Ignored_Ghost_Pragma along with usages in nodes.
1937         Remove attribute Is_Ghost_Pragma along with usages in nodes.
1938         (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
1939         (Is_Ghost_Pragma): Removed along with pragma Inline.
1940         (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
1941         (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
1942         (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
1943         (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
1945 2017-01-12  Tristan Gingold  <gingold@adacore.com>
1947         * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
1948         s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
1950 2017-01-12  Yannick Moy  <moy@adacore.com>
1952         * errout.adb, errout.ads (Initialize): Factor common treatment
1953         in Reset_Warnings.
1954         (Reset_Warnings): New procedure to reset counts related to warnings.
1955         (Record_Compilation_Errors): New variable to store the presence of an
1956         error, used in gnat2why to allow changing the Warning_Mode.
1957         (Compilation_Errors): Use new variable Record_Compilation_Errors to
1958         store the presence of an error.
1960 2017-01-12  Javier Miranda  <miranda@adacore.com>
1962         * sem_ch13.adb (Analyze_Aspect_Specifications):
1963         For Interrupt_Handler and Attach_ Handler aspects, decorate the
1964         internally built reference to the protected procedure as coming
1965         from sources and force its analysis.
1967 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
1969         * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
1970         inherit predicates if any from the first_subtype of the parent,
1971         not from the anonymous parent type.
1972         * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
1973         predicate is not a static subtype.
1975 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
1977         * freeze.adb (Check_Suspicious_Convention): New procedure
1978         performing a warning check on discriminated record types with
1979         convention C or C++. Factored out of procedure Freeze_Record_Type,
1980         and changed to only apply to base types (to avoid spurious
1981         warnings on subtypes). Minor improvement of warning messages
1982         to refer to discriminated rather than variant record types.
1983         (Freeze_Record_Type): Remove code for performing a suspicious
1984         convention check.
1985         (Freeze_Entity): Only call Freeze_Record_Type
1986         on types that aren't declared within any enclosing generic units
1987         (rather than just excluding the type when the innermost scope
1988         is generic). Call Check_Suspicious_Convention whether or not
1989         the type is declared within a generic unit.
1990         * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
1991         * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
1992         from Sem_Ch8).
1994 2017-01-12  Tristan Gingold  <gingold@adacore.com>
1996         * sysdep.c, adaint.c, rtinit.c, ming32.h:
1997         (__gnat_current_codepage): Renamed from CurrentCodePage
1998         (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
2000 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
2002         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
2003         quantified expressions, following AI12-050: the loop parameters
2004         of two quantified expressions are conformant if they have the
2005         same identifier.
2007 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
2009         * gcc-interface/Makefile.in: Clean up VxWorks targets.
2011 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
2013         * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
2014         Hnadle properly the attribute reference when it appears as part
2015         of an expression in another loop aspect.
2017 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
2019         * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
2020         subsidiary of Build_Initialization_Call, to complete generation
2021         of predicate checks on discriminants whose (sub)types have
2022         predicates, and to add checks on variants that do not have an
2023         others clause.
2024         * sem_util.adb (Gather_Components): A missing Others alternative is
2025         not an error when the type of the discriminant is a static predicate
2026         (and coverage has been checked when analyzing the case statement). A
2027         runtime check is generated to verify that a given discriminant
2028         satisfies the predicate (RM 3.8.1. (21.1/2)).
2030 2017-01-12  Yannick Moy  <moy@adacore.com>
2032         * gnat1drv.adb (Adjust_Global_Switches): Only
2033         perform checking of exception mechanism when generating code.
2035 2017-01-12  Justin Squirek  <squirek@adacore.com>
2037         * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
2038         Remove handling of access component with invariant.
2039         (Build_Invariant_Procedure_Declaration): Remove return on class
2040         wide type.
2041         * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
2042         conditional exception for component or array so Has_Own_Invariants
2043         flag is not falsly set.
2044         * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
2045         wide type to have no invariant flags.
2047 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
2049         * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
2050         sem_ch13.adb: Minor reformatting.
2052 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
2054         * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
2055         adjustment primitive when the ancestor type was not properly frozen.
2056         (Gen_Assign): Guard against a missing initialization
2057         primitive when the component type was not properly frozen.
2058         (Initialize_Array_Component): Guard against a missing adjustment
2059         primitive when the component type was not properly frozen.
2060         (Initialize_Record_Component): Guard against a missing adjustment
2061         primitive when the component type was not properly frozen.
2062         (Process_Transient_Component_Completion): The transient object may
2063         not be finalized when its associated type was not properly frozen.
2064         * exp_ch3.adb (Build_Assignment): Guard against a missing
2065         adjustment primitive when the component type was not properly frozen.
2066         (Build_Initialization_Call): Guard against a missing
2067         initialization primitive when the associated type was not properly
2068         frozen.
2069         (Expand_N_Object_Declaration): Guard against a missing
2070         adjustment primitive when the base type was not properly frozen.
2071         (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
2072         body when there is no adjustment primitive available. Create an
2073         empty Deep_Finalize body when there is no finalization primitive
2074         available.
2075         * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
2076         missing finalization primitive when the designated type was
2077         not properly frozen.
2078         (Expand_N_Allocator): Guard against a missing initialization primitive
2079         when the designated type was not properly frozen.
2080         * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
2081         only when the corresponding adjustment primitive is available.
2082         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
2083         adjustment/finalization statements only when there is an available
2084         primitive to carry out the action.
2085         (Build_Initialize_Statements): Generate the initialization/finalization
2086         statements only when there is an available primitive to carry out the
2087         action.
2088         (Make_Adjust_Call): Do not generate a call when the underlying
2089         type is not present due to a possible missing full view.
2090         (Make_Final_Call): Do not generate a call when the underlying
2091         type is not present due to a possible missing full view.
2092         (Make_Finalize_Address_Stmts): Generate an empty body when the
2093         designated type lacks a finalization primitive.
2094         (Make_Init_Call): Do not generate a call when the underlying type is
2095         not present due to a possible missing full view.
2096         (Process_Component_For_Adjust): Add the adjustment call only when the
2097         corresponding adjustment primitive is available.
2098         (Process_Component_For_Finalize): Add the finalization call only when
2099         the corresponding finalization primitive is available.
2100         (Process_Object_Declaration): Use a null statement to emulate a
2101         missing call to the finalization primitive of the object type.
2102         * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
2103         (Make_Final_Call): Update the comment on usage.
2104         (Make_Init_Call): Update the comment on usage.
2105         * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
2107 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
2109         * einfo.ads: Update documentation of Address_Taken.
2110         * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
2111         [Access_Attribute]): Only consider 'Access/'Unchecked_Access
2112         for subprograms when setting Address_Taken flag.
2114 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
2116         * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
2117         Configurable_Run_Time_Mode off when analysing with'ed predefined
2118         libraries.
2120 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
2122         * sem_prag.adb: Minor reformatting.
2123         * sem_util.adb (Unique_Entity): fix result for
2124         bodies of entry families.
2126 2017-01-12  Justin Squirek  <squirek@adacore.com>
2128         * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
2129         Resolve_Suppressible in the pragma Assertion_Policy case.
2130         (Resolve_Suppressible): Created this function to factor out
2131         common code used to resolve Suppress to either Ignore or Check
2132         * snames.ads-tmpl: Add name for Suppressible.
2134 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
2136         * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
2137         reformatting.
2138         * debug.adb: Minor comment fixes.
2140 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
2142         * sem_util.adb (Unique_Entity): For concurrent
2143         bodies that are defined with stubs and complete a declaration
2144         of a single concurrent object return the entity of an implicit
2145         concurrent type, not the entity of the anonymous concurrent
2146         object.
2147         * debug.adb: -gnatd.J is no longer used.
2148         * make.adb (Globalize): Removed, no longer used.
2149         * sem_ch9.adb: minor typo in comment for entry index
2151 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
2153         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
2154         * exp_ch3.adb (Build_Init_Statements): As part of initialising
2155         the value record of a task, set its _Secondary_Stack_Size field
2156         if present.
2157         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
2158         a _Secondary_Stack_Size field in the value record of
2159         the task if a Secondary_Stack_Size rep item is present.
2160         (Make_Task_Create_Call): Include secondary stack size
2161         parameter. If No_Secondary_Stack restriction is in place, passes
2162         stack size of 0.
2163         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
2164         Secondary_Stack_Size.
2165         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
2166         function to define the overhead of the secondary stack.
2167         * s-tarest.adb (Create_Restricted_Task,
2168         Create_Restricted_Task_Sequential): Functions now include
2169         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
2170         * s-tarest.adb (Create_Restricted_Task,
2171         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
2172         include Secondary_Stack_Size parameter.
2173         (Task_Wrapper): Secondary stack now allocated to the size specified by
2174         the Secondary_Stack_Size parameter in the task's ATCB.
2175         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
2176         Secondary_Stack_Size component.
2177         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
2178         Create_Restricted_Task_Sequential): Function now include
2179         Secondary_Stack_Size parameter.
2180         (Task_Wrapper): Secondary stack now allocated to the size
2181         specified by the Secondary_Stack_Size parameter in the task's
2182         ATCB.
2183         * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
2184         to include Secondary_Stack_Size parameter.
2185         * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
2186         Secondary_Stack_Size aspect, turning the aspect into its corresponding
2187         internal attribute.
2188         (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
2189         * snames.adb-tmpl, snames.ads-tmpl: Added names
2190         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
2191         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
2193 2017-01-12  Yannick Moy  <moy@adacore.com>
2195         * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
2196         subtree.
2198 2017-01-12  Justin Squirek  <squirek@adacore.com>
2200         * exp_attr.adb (Expand_N_Attribute_Reference):
2201         Fix Finalization_Size case by properly resolving the type after
2202         rewritting the node.
2204 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
2206         * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
2207         the tree.
2208         (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
2209         * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
2210         exp_sel.ads: Minor reformatting.
2212 2017-01-12  Justin Squirek  <squirek@adacore.com>
2214         * exp_ch6.adb (Expand_Call): Add guard to prevent
2215         invariant checks from being created for internally generated
2216         subprograms.
2218 2017-01-12  Bob Duff  <duff@adacore.com>
2220         * lib-writ.ads: Remove incorrect comment.
2222 2017-01-12  Javier Miranda  <miranda@adacore.com>
2224         * debug.adb (-gnatd.K): Enable generation of contract-only
2225         procedures in CodePeer mode.
2226         * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
2227         New subprogram.
2228         (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
2229         set.
2230         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
2231         subprogram.
2232         (Get_Contract_Only_Missing_Body_Name): New subprogram.
2233         (Get_Contract_Only_Body): New subprogram.
2234         (Set_Contract_Only_Body): New subprogram.
2235         (Is_Contract_Only_Body): New subprogram.
2236         (Set_Is_Contract_Only_Body): New subprogram.
2237         (SCIL_Nodes): Replace table by hash-table.
2239 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
2241         * exp_ch6.adb: Minor reformatting.
2242         * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
2244 2017-01-12  Bob Duff  <duff@adacore.com>
2246         * binde.adb (Forced): New reason for a dependence.
2247         (Force_Elab_Order): Implementation of the new switch.
2248         * binde.ads: Minor comment fixes.
2249         * bindusg.adb: Add -f switch. Apparently, there was an -f switch
2250         long ago that is no longer supported; removed comment about that.
2251         * opt.ads (Force_Elab_Order_File): Name of file specified for
2252         -f switch.
2253         * switch-b.adb: Parse -f switch.
2255 2017-01-12  Justin Squirek  <squirek@adacore.com>
2257         * exp_ch6.adb (Check_View_Conversion): Created this function
2258         to properly chain calls to check type invariants that may be
2259         present in a subprogram call after the subprogram.
2260         (Expand_Call): Add a conditional to identify when a view conversion
2261         needs to be checked.
2262         * nlists.adb, nlists.ads (Prepend_New): New routine.
2263         (Prepend_New_To): New routine.
2265 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
2267         * sinfo.ads: Minor reformatting.
2269 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
2271         * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
2272         reformatting.
2274 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
2276         * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
2277         variable Definite. Create a local object and pass its 'Access to the
2278         BIP function when the result type is either definite or it does not
2279         require any finalization or secondary stack management.
2281 2017-01-12  Bob Duff  <duff@adacore.com>
2283         * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
2284         exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
2285         frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
2286         par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
2287         sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
2288         sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
2289         sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
2290         sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
2291         Change name to Pragma_Name_Unmapped.
2292         (Pragma_Name_Mapped): Change name to Pragma_Name.
2293         This is because the "mapped" version should be the usual case.
2295 2017-01-09  Hristian Kirtchev  <kirtchev@adacore.com>
2297         * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
2298         Is_Default_Init_Cond_Procedure, and
2299         Has_Inherited_Default_Init_Cond.  Add uses of flags
2300         Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
2301         (Default_Init_Cond_Procedure): Removed.
2302         (DIC_Procedure): New routine.
2303         (Has_Default_Init_Cond): Removed.
2304         (Has_DIC): New routine.
2305         (Has_Inheritable_Invariants): The attribute applies to the base type.
2306         (Has_Inherited_Default_Init_Cond): Removed.
2307         (Has_Inherited_DIC): New routine.
2308         (Has_Inherited_Invariants): The attribute applies to the base type.
2309         (Has_Own_DIC): New routine.
2310         (Has_Own_Invariants): The attribute applies to the base type.
2311         (Is_Default_Init_Cond_Procedure): Removed.
2312         (Is_DIC_Procedure): New routine.
2313         (Set_Default_Init_Cond_Procedure): Removed.
2314         (Set_DIC_Procedure): New routine.
2315         (Set_Has_Default_Init_Cond): Removed.
2316         (Set_Has_Inheritable_Invariants): The attribute applies
2317         to the base type.
2318         (Set_Has_Inherited_Default_Init_Cond): Removed.
2319         (Set_Has_Inherited_DIC): New routine.
2320         (Set_Has_Inherited_Invariants): The attribute applies to the base type.
2321         (Set_Has_Own_DIC): New routine.
2322         (Set_Has_Own_Invariants): The attribute applies to the base type.
2323         (Set_Is_Default_Init_Cond_Procedure): Removed.
2324         (Set_Is_DIC_Procedure): New routine.
2325         (Write_Entity_Flags): Update the output of all flags related to
2326         default initial condition.
2327         * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
2328         of the call to the DIC procedure.
2329         (Freeze_Type): Generate the body of the DIC procedure.
2330         * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
2331         all occurrences of Create_Append with Append_New_To. Do
2332         not generate an invariant procedure for a class-wide type.
2333         The generated body acts as a freeze action of the working type.
2334         (Build_Invariant_Procedure_Declaration): Do not generate an
2335         invariant procedure for a class-wide type.
2336         (Create_Append): Removed.
2337         * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
2338         sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
2339         class-wide pre/postcondition description and data structures from
2340         Sem_Prag.
2341         (Build_Class_Wide_Expression): Moved from Sem_Prag.
2342         (Build_DIC_Call): New routine.
2343         (Build_DIC_Procedure_Body): New routine.
2344         (Build_DIC_Procedure_Declaration): New routine.
2345         (Entity_Hash): Moved from Sem_Prag.
2346         (Find_DIC_Type): New routine.
2347         (Update_Primitives_Mapping): Reimplemented.
2348         (Update_Primitives_Mapping_Of_Types): New routine.
2349         * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
2350         (Build_DIC_Call): New routine.
2351         (Build_DIC_Procedure_Body): New routine.
2352         (Build_DIC_Procedure_Declaration): New routine.
2353         (Update_Primitives_Mapping): Moved from Sem_Prag.
2354         (Update_Primitives_Mapping_Of_Types): New routine.
2355         * nlists.adb (Append_New): New routine.
2356         (Append_New_To): New routine.
2357         * nlists.ads (Append_New): New routine.
2358         (Append_New_To): New routine.
2359         * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
2360         of DIC procedures here. This is now done at the end of the
2361         visible declarations, private declarations, and at the freeze
2362         point of a type.
2363         (Analyze_Private_Extension_Declaration):
2364         A private extension inherits the DIC pragma of a parent type.
2365         (Analyze_Subtype_Declaration): No need to propagate invariant
2366         attributes to a subtype as those apply to the base type.
2367         (Build_Derived_Record_Type): No need to inherit invariants here
2368         as this is now done in Build_Derived_Type.
2369         (Build_Derived_Type): Inherit both the DIC pragma and invariants from
2370         a parent type.
2371         (Process_Full_View): Update the propagation of DIC attributes.
2372         (Propagate_Default_Init_Cond_Attributes): Removed.
2373         * sem_ch7.adb Add with and use clauses for Exp_Util.
2374         (Analyze_Package_Specification): Create the body of the DIC
2375         procedure at the end of the visible and private declarations.
2376         (Preserve_Full_Attributes): Propagate DIC attributes.
2377         * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
2378         DIC attributes.
2379         (Analyze_Task_Type_Declaration): Propagate DIC attributes.
2380         * sem_elab.adb (Check_A_Call): Update the call to
2381         Is_Nontrivial_Default_Init_Cond_Procedure.
2382         * sem_prag.adb Remove the with and use clauses for
2383         GNAT.HTable. Move the handling of class- wide pre/postcondition
2384         description and data structures to Exp_Util.
2385         (Analyze_Pragma): Create the declaration of the DIC procedure. There
2386         is no need to propagate invariant-related attributes at this point
2387         as this is done in Build_Invariant_Procedure_Declaration.
2388         (Build_Class_Wide_Expression): Moved to Exp_Util.
2389         (Entity_Hash): Moved to Exp_Util.
2390         (Update_Primitives_Mapping): Moved to Exp_Util.
2391         * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
2392         (Update_Primitives_Mapping): Moved to Exp_Util.
2393         * sem_util.adb: Remove with and use clauses for Ghost
2394         and Sem_Ch13.
2395         (Build_Default_Init_Cond_Call): Removed.
2396         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
2397         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
2398         (Get_Views): Reimplemented.
2399         (Has_Full_Default_Initialization): Reimplement the section on DIC.
2400         (Inherit_Default_Init_Cond_Procedure): Removed.
2401         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
2402         (Is_Nontrivial_DIC_Procedure): New routine.
2403         (Is_Verifiable_DIC_Pragma): New routine.
2404         (Propagate_DIC_Attributes): New routine.
2405         * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
2406         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
2407         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
2408         (Inherit_Default_Init_Cond_Procedure): Removed.
2409         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
2410         (Is_Nontrivial_DIC_Procedure): New routine.
2411         (Is_Verifiable_DIC_Pragma): New routine.
2412         (Propagate_DIC_Attributes): New routine.
2413         * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
2414         on DIC.
2415         * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
2416         usage in nodes.
2417         (Expression_Copy): New routine along with pragma Inline.
2418         (Set_Expression_Copy): New routine along with pragma Inline.
2420 2017-01-06  Bob Duff  <duff@adacore.com>
2422         * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
2423         "Bind_Main_Program" to "not Bind_For_Library", because otherwise
2424         we won't generate the call to s_stalib_adafinal when the main
2425         is not written in Ada.
2427 2017-01-06  Bob Duff  <duff@adacore.com>
2429         * sem_prag.adb: Minor: remove pragma Warnings.
2431 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2433         * Makefile.rtl: Do not compile s-stchop by default.
2435 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
2437         * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
2438         sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
2439         snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
2440         s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
2441         Reverted previous change for now.
2443 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2445         * exp_ch3.adb (Build_Initialization_Call): Apply predicate
2446         check to default discriminant value if checks are enabled.
2447         (Build_Assignment): If type of component has static predicate,
2448         apply check to its default value, if any.
2450 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
2452         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
2453         * exp_ch3.adb (Build_Init_Statements): As part of initialising
2454         the value record of a task, set its _Secondary_Stack_Size field
2455         if present.
2456         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
2457         a _Secondary_Stack_Size field in the value record of
2458         the task if a Secondary_Stack_Size rep item is present.
2459         (Make_Task_Create_Call): Include secondary stack size
2460         parameter. If No_Secondary_Stack restriction is in place, passes
2461         stack size of 0.
2462         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
2463         Secondary_Stack_Size.
2464         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
2465         function to define the overhead of the secondary stack.
2466         * s-tarest.adb (Create_Restricted_Task,
2467         Create_Restricted_Task_Sequential): Functions now include
2468         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
2469         * s-tarest.adb (Create_Restricted_Task,
2470         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
2471         now include Secondary_Stack_Size parameter.
2472         (Task_Wrapper):
2473         Secondary stack now allocated to the size specified by the
2474         Secondary_Stack_Size parameter in the task's ATCB.
2475         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
2476         Secondary_Stack_Size component.
2477         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
2478         Create_Restricted_Task_Sequential): Function now include
2479         Secondary_Stack_Size parameter.
2480         (Task_Wrapper): Secondary stack
2481         now allocated to the size specified by the Secondary_Stack_Size
2482         parameter in the task's ATCB.
2483         * sem_ch13.adb (Analyze_Aspect_Specification): Add support
2484         for Secondary_Stack_Size aspect, turning the aspect into its
2485         corresponding internal attribute.
2486         (Analyze_Attribute_Definition):
2487         Process Secondary_Stack_Size attribute.
2488         * snames.adb-tmpl, snames.ads-tmpl: Added names
2489         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
2490         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
2492 2017-01-06  Pascal Obry  <obry@adacore.com>
2494         * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
2495         Sequential_IO and Direct_IO.
2497 2017-01-06  Bob Duff  <duff@adacore.com>
2499         * snames.ads-tmpl (Renamed): New name for the pragma argument.
2500         * par-ch2.adb: Allow the new pragma (with analysis deferred
2501         to Sem_Prag).
2502         * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
2503         Keep a mapping from new pragma names to old names.
2504         * sem_prag.adb: Check legality of pragma Rename_Pragma, and
2505         implement it by calling Map_Pragma_Name.
2506         * checks.adb, contracts.adb, einfo.adb, errout.adb,
2507         * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
2508         * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
2509         * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
2510         * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
2511         * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
2512         * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
2513         as appropriate.
2515 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2517         * exp_ch9.adb: Minor reformatting.
2519 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2521         * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
2522         * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
2523         (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
2524         (unused).
2525         * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
2526         Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
2527         * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
2528         Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
2530 2017-01-06  Bob Duff  <duff@adacore.com>
2532         * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
2533         dummy implementation of Map_Pragma_Name.
2535 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2537         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
2538         entry_body variable constant.
2539         * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
2540         * s-tpoben.ads (Protected_Entry_Body_Access): Now access
2541         to constant.
2542         * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
2543         now access to constant.
2545 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
2547         * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
2548         reformatting and typo fixes.
2550 2017-01-06  Bob Duff  <duff@adacore.com>
2552         * snames.ads-tmpl: New names for pragma renaming.
2553         * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
2554         * par-prag.adb: Add new pragma name to case statement.
2555         * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
2556         of the pragma.
2557         * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
2558         Dummy implementation of Pragma_Name_Mapped.
2560 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2562         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
2563         better detect call within an entry_wrapper.
2564         * sem_res.adb (Resolve_Call): A protected call within an
2565         entity_wrapper is analyzed in the context of the protected
2566         object but corresponds to a pre-analysis and is not an access
2567         before elaboration.
2568         * sem_attr.adb: Minor reformatting.
2570 2017-01-06  Justin Squirek  <squirek@adacore.com>
2572         * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
2573         Finalization_Size to allow a prefix of any non-class-wide type.
2574         * sem_attr.ads Modify comment for Finalization_Size to include
2575         definite type use case.
2577 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2579         * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
2580         on procedures that are wrappers created for entries that have
2581         preconditions.
2582         * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
2583         body is an entry_wrapper, compile it in the context of the
2584         synchronized type, because a precondition may refer to funtions
2585         of the type.
2586         * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
2587         body entity.
2588         * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
2589         within an Entry_Wrapper this is an external call whose target
2590         is the synchronized object that is the actual in the call to
2591         the wrapper.
2593 2017-01-06  Yannick Moy  <moy@adacore.com>
2595         * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
2596         in tree, which means not analyzing the previous prefix if the node has
2597         been rewritten into its prefix.
2599 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
2601         * s-tpobop.adb: Minor reformatting.
2603 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2605         * checks.adb (Ensure_Valid): Do not generate a validity check
2606         within a generated predicate function, validity checks will have
2607         been applied earlier when required.
2609 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2611         * s-tpoben.ads (Protection_Entries): Add comment and reorder
2612         components for performances.
2613         * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
2614         semantic.
2616 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2618         * sem_eval.adb (Check_Expression_Against_Static_Predicate):
2619         If expression is compile-time known and obeys a static predicate
2620         it must be labelled as static, to prevent spurious warnings and
2621         run-time errors, e.g. in case statements. This is relevant when
2622         the expression is the result of constant-folding a type conversion
2623         whose expression is a variable with a known static value.
2625 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2627         * exp_attr.adb, sem_attr.ads: Minor reformatting.
2629 2017-01-06  Justin Squirek  <squirek@adacore.com>
2631         * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
2632         expansion of Finalization_Size attribute.
2633         * sem_attr.adb (Analyze_Attribute): Add entry to check the
2634         semantics of Finalization_Size.
2635         (Eval_Attribute): Add null entry for Finalization_Size.
2636         * sem_attr.ads: Add Finalization_Size to the implementation
2637         dependent attribute list.
2638         * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
2640 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2642         * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
2643         iterator specification with a serious syntactic error, transform
2644         construct into an infinite loop in order to continue analysis
2645         and prevent a compiler abort.
2647 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2649         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
2650         max_queue_lengths_array if unused.
2652 2017-01-06  Bob Duff  <duff@adacore.com>
2654         * errout.adb (Set_Msg_Text): Protect against out-of-bounds
2655         array access, in case "\" is at the end of Text.
2656         * stylesw.adb (Set_Style_Check_Options): Don't include input
2657         characters in the error message template, because they could
2658         be control characters such as "\", which Errout will try to
2659         interpret.
2661 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2663         * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
2664         For a private type examine the visible declarations that follow
2665         the partial view, not just the private declarations that follow
2666         the full view.
2668 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2670         * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
2671         code cleanup.
2673 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2675         * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
2676         alias of the inherited op is the parent iterator, no need to
2677         examine dispatch table positions which might not be established
2678         yet if type is not frozen.
2679         * sem_disp.adb (Check_Controlling_Formals): The formal of a
2680         predicate function may be a subtype of a tagged type.
2681         * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
2682         of representation items for the completion of a type extension
2683         where a predicate applies to the partial view.
2684         * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
2685         parameter that designates function whose actual receives a
2686         predicate check, to improve warning message when the check will
2687         lead to infinite recursion.
2688         * sem_res.adb (Resolve_Actuals): Pass additional parameter to
2689         Apply_Predicate_Check.
2691 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2693         * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
2694         Gnat_Extended_Ravenscar.
2695         * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
2697 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
2699         * sem_util.ads: Minor typo fix and reformatting.
2701 2017-01-06  Yannick Moy  <moy@adacore.com>
2703         * ghost.adb Minor fixing of references to SPARK RM.
2704         (Check_Ghost_Context): Check whether reference is to a lvalue
2705         before issuing an error about violation of SPARK RM 6.9(13)
2706         when declaration has Ghost policy Check and reference has Ghost
2707         policy Ignore.
2708         * sem_util.adb Minor indentation.
2709         * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
2710         Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
2711         * sem_util.ads (Unique_Defining_Entity): Document the result
2712         for package body stubs.
2714 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2716         * raise-gcc.c (abort): Macro to call Abort_Propagation.
2717         * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
2718         constant.
2719         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
2720         Do not generate the Entry_Max_Queue_Lengths_Array if all default
2721         values.
2722         * exp_util.adb (Corresponding_Runtime_Package): Consider
2723         Max_Queue_Length pragma.
2725 2017-01-06  Justin Squirek  <squirek@adacore.com>
2727         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
2728         Remove declaration generation in the case of
2729         System_Tasking_Protected_Objects_Single_Entry being used,
2730         and add a warning message when this is detected to occur.
2731         (Make_Initialize_Protection): Remove reference pass in the case
2732         of System_Tasking_Protected_Objects_Single_Entry.
2733         * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
2734         * s-tposen.adb (Initialize_Protection_Entry): Remove
2735         Entry_Queue_Max parameter.
2736         * s-tposen.ads: Remove the types use to store the entry queue
2737         maximum.
2738         * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
2740 2017-01-06  Yannick Moy  <moy@adacore.com>
2742         * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
2743         behavior of function, to also accept out of range positions
2744         and raise Constraint_Error in such case, and to copy sloc from
2745         literal if No_Location passed as location.
2746         * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
2747         of functions to raise Constraint_Error in case of value not in
2748         appropriate range.
2750 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2752         * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
2753         Invalidate_Stack_Cache.
2755 2017-01-06  Eric Botcazou  <ebotcazou@adacore.com>
2757         * s-os_lib.adb: Minor fix to the signature of Readlink.
2759 2017-01-06  Javier Miranda  <miranda@adacore.com>
2761         * sem_ch6.adb (Conforming_Types): Handle another
2762         confusion between views in a nested instance with an actual
2763         private type whose full view is not in scope.
2765 2017-01-06  Arnaud Charlet  <charlet@adacore.com>
2767         * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
2768         mark a rewritten if statement as explicit (Comes_From_Source).
2770 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
2772         * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
2774 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2776         * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
2778 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2780         * sem_case.adb: Minor reformatting.
2782 2017-01-06  Thomas Quinot  <quinot@adacore.com>
2784         * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
2786 2017-01-06  Justin Squirek  <squirek@adacore.com>
2788         * aspects.adb: Register aspect in Canonical_Aspect.
2789         * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
2790         into respective tables.
2791         * einfo.ads, einfo.adb: Add a new attribute for
2792         handling the parameters for Pragma_Max_Entry_Queue
2793         (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
2794         for accessing and setting were added as well.
2795         * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
2796         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
2797         declaration for pramga arguments and store them in the protected
2798         type node.
2799         (Make_Initialize_Protection): Pass a reference to
2800         the Entry_Max_Queue_Lengths_Array in the protected type node to
2801         the runtime.
2802         * rtsfind.adb: Minor grammar fix.
2803         * rtsfind.ads: Register new types taken from the
2804         runtime libraries RE_Protected_Entry_Queue_Max and
2805         RE_Protected_Entry_Queue_Max_Array
2806         * s-tposen.adb, s-tpoben.adb
2807         (Initialize_Protection_Entry/Initialize_Protection_Entries):
2808         Add extra parameter and add assignment to local object.
2809         * s-tposen.ads, s-tpoben.ads: Add new types to
2810         store entry queue maximums and a field to the entry object record.
2811         * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
2812         for Aspect_Max_Queue_Length.
2813         (Check_Aspect_At_Freeze_Point):
2814         Add aspect to list of aspects that don't require delayed analysis.
2815         * sem_prag.adb (Analyze_Pragma): Add case statement for
2816         Pragma_Max_Queue_Length, check semantics, and register arugments
2817         in the respective entry nodes.
2818         * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
2819         and Has_Max_Queue_Length
2820         * snames.ads-tmpl: Add constant for the new aspect-name
2821         Name_Max_Queue_Length and corrasponding pragma.
2823 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2825         * exp_util.adb (Is_Controlled_Function_Call):
2826         Reimplemented. Consider any node which has an entity as the
2827         function call may appear in various ways.
2829 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2831         * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
2832         an unchecked type conversion when performing a view conversion
2833         to/from a private type. In all other cases use a regular type
2834         conversion to ensure that any relevant checks are properly
2835         installed.
2837 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
2839         * sem_prag.adb, sem_ch8.adb: Minor reformatting.
2841 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
2843         * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
2844         error on case expression that is an entity, when coverage is
2845         incomplete and entity has a static value obtained by local
2846         propagation.
2847         (Handle_Static_Predicate): New procedure, subsidiary of
2848         Check_Choices, to handle case alternatives that are either
2849         subtype names or subtype indications involving subtypes that
2850         have static predicates.
2852 2017-01-06  Thomas Quinot  <quinot@adacore.com>
2854         * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
2855         (GNAT.Socket): Add support for Busy_Polling and Generic_Option
2857 2017-01-06  Bob Duff  <duff@adacore.com>
2859         * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
2860         Elaborate_All(P) to P itself. That could happen in obscure cases,
2861         and always introduced a cycle (P body must be elaborated before
2862         P body).
2863         * lib-writ.ads: Comment clarification.
2864         * ali-util.ads: Minor comment fix.
2865         * ali.adb: Minor reformatting.
2867 2017-01-06  Tristan Gingold  <gingold@adacore.com>
2869         * a-exexpr-gcc.adb: Improve comment.
2871 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
2873         * s-linux-mips.ads: Use correct signal and errno constants.
2874         (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
2876 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
2878         * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
2879         * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
2880         sections.
2882 2017-01-01  Eric Botcazou  <ebotcazou@adacore.com>
2884         * gnatvsn.ads: Bump copyright year.
2886 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
2888         * gnat_ugn.texi: Bump @copying's copyright year.
2889         * gnat_rm.texi: Likewise.
2891 Copyright (C) 2017 Free Software Foundation, Inc.
2893 Copying and distribution of this file, with or without modification,
2894 are permitted in any medium without royalty provided the copyright
2895 notice and this notice are preserved.