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