* gcc-interface/decl.c (warn_on_field_placement): Issue the warning
[official-gcc.git] / gcc / ada / ChangeLog
blob5f7b1bc73a2d25ee3a9116d9bf011d25f6dbdb70
1 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
3         * gcc-interface/decl.c (warn_on_field_placement): Issue the warning
4         only if the record type itself comes from source.
6 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
8         * sem_ch5.adb: Minor reformatting and a typo fix
10 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
12         * sinput-l.ads: minor remove extra period at the end of comment
14 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
16         * sem_prag.adb (Add_Item_To_Name_Buffer): remove support for
17         E_Discriminant.
18         (Find_Role): remove support for E_Discriminant.
20 2017-09-06  Javier Miranda  <miranda@adacore.com>
22         * exp_ch6.adb (Expand_Simple_Function_Return):
23         Add missing implicit type conversion to force displacement of the
24         "this" pointer.
26 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
28         * sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting.
30 2017-09-06  Yannick Moy  <moy@adacore.com>
32         * sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set
33         global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once.
35 2017-09-06  Bob Duff  <duff@adacore.com>
37         * sem_ch8.adb: Change Assert to be consistent with
38         other similar ones.
40 2017-09-06  Bob Duff  <duff@adacore.com>
42         * binde.adb (Find_Elab_Order): Do not run Elab_Old unless
43         requested. Previously, the -do switch meant "run Elab_New and
44         Elab_Old and use the order chosen by Elab_Old, possibly with
45         debugging printouts comparing the two orders."  Now it means
46         "do not run Elab_New." This is of use if there are bugs that
47         cause Elab_New to crash.
48         (Elab_Position, Num_Chosen): Change type to Nat, to avoid various
49         type conversions.
50         * ali.ads (Elab_Position): Change type to Nat, to avoid various
51         type conversions.
53 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
55         * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix
56         reference to SPARK RM.
58 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
60         * layout.adb: Use SSU short hand consistently throughout the file.
62 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
64         * freeze.adb (Freeze_Record_Type)
65         <Sized_Component_Total_Round_RM_Size>: New local variable to
66         accumulate the rounded RM_Size of components.  Update it for
67         every component whose RM_Size is statically known.  Add missing
68         guard to check that bit packing is really required before issuing
69         the error about packing.  Swap condition for clarity's sake.
70         * sem_prag.adb (Usage_Error): Fix reference to SPARK RM in comment.
72 2017-09-06  Fedor Rybin  <frybin@adacore.com>
74         * makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb,
75         mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads,
76         mlib-tgt-specific.adb, mlib-tgt-specific.ads,
77         mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
78         mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb,
79         mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb,
80         mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb,
81         mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads,
82         prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb,
83         prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads,
84         prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb,
85         prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads,
86         prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb,
87         prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads,
88         prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete
89         project manager sources.
91 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
93         * sem_ch5.adb (Analyze_Assigment): If the left-hand side is an
94         entity of a mutable type and the right-hand side is a conditional
95         expression, resolve the alternatives of the conditional using
96         the base type of the target entity, because the alternatives
97         may have distinct subtypes. This is particularly relevant if
98         the alternatives are aggregates.
100 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
102         * checks.adb (Apply_Predicate_Check): If the expression is an
103         aggregate that is the RHS of an assignment, apply the check to
104         the LHS after the assignment, rather than to the aggregate. This
105         is more efficient than creating a temporary for the aggregate,
106         and prevents back-end crashes when the aggregate includes a
107         dynamic "others' association.
109 2017-09-06  Yannick Moy  <moy@adacore.com>
111         * sem_ch12.adb (Analyze_Instance_And_Renamings):
112         Set variable to ignore SPARK_Mode in instance before the analysis
113         of the generated package declaration.
115 2017-09-06  Yannick Moy  <moy@adacore.com>
117         * sem_res.adb (Resolve_Call): Do not issue a
118         message for calls inside expression function, unless body was
119         seen and is candidate for inlining.
121 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
123         * sem_aux.adb (Is_Generic_Formal): Handle properly formal packages.
124         * sem_ch3.adb (Analyze_Declarations): In a generic subprogram
125         body. do not freeze the formals of the generic unit.
127 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
129         * errout.adb (Error_Msg): Separate the
130         treatment for warning vs. style messages in inlinings and
131         instantiations. Prevents blowups on calls to Warn_Insertion for
132         style messages, which should not be called in that case because
133         Warning_Msg_Char is not set.
135 2017-09-06  Justin Squirek  <squirek@adacore.com>
137         * sem_prag.adb (Check_VFA_Conflicts): Created
138         to group all Volatile_Full_Access checks relating to other
139         representation pragmas (Mark_Component_Or_Object): Created
140         to centeralize the flagging of attributes for the record type
141         component case, a pragma applied individually to a component, and
142         the object case.
143         (Process_Atomic_Independent_Shared_Volatile):
144         Add propagation of certain pragmas to record components and move
145         evaluation of VFA checks
147 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
149         * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram):
150         Do not warn on conditions that are not obeyed for Inline_Always
151         subprograms, when assertions are not enabled.
153 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
155         * sem_util.adb (Unique_Entity): For abstract states return their
156         non-limited view.
158 2017-09-06  Bob Duff  <duff@adacore.com>
160         * sem_ch12.adb (Copy_Generic_Node): When we copy a node
161         that is a proper body corresponding to a stub, we defer the
162         adjustment of the sloc until after the correct adjustment has
163         been computed. Otherwise, Adjust_Instantiation_Sloc will ignore
164         the adjustment, because it will be outside the range in (the old,
165         incorrect) S_Adjustment.
166         * inline.adb: Use named notation for readability and uniformity.
167         * sinput-l.adb: Minor improvements to debugging output printed
168         for Debug_Flag_L.
169         * sinput-l.ads (Create_Instantiation_Source): Minor comment
170         correction.
172 2017-09-06  Vincent Celier  <celier@adacore.com>
174         * make.adb: Do not invoke gprbuild for -bargs -P.
176 2017-09-06  Sylvain Dailler  <dailler@adacore.com>
178         * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Adding a
179         case when Op is of kind N_Qualified_Expression. In this case,
180         the function is called recursively on the subexpression like in
181         other cases.
182         * make.adb: Minor reformatting
184 2017-09-06  Justin Squirek  <squirek@adacore.com>
186         * einfo.adb (Set_Linker_Section_Pragma): Modify
187         Set_Linker_Section_Pragma to be consistant with the "getter"
188         Linker_Section_Pragma.
189         * exp_ch5.adb (Expand_Formal_Container_Loop): Add proper error
190         checking for container loops so that the index cursor is not
191         directly changable by the user with the use of E_Loop_Parameter.
192         * sem_ch5.adb (Analyze_Block_Statement): Revert previous change.
193         * sem_warn.adb (Check_References): Revert previous change.
195 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
197         * gcc-interface/trans.c (gnat_to_gnu) <N_Selected_Component>: Try
198         again to translate the prefix after the field if it is incomplete.
200 2017-09-06  Bob Duff  <duff@adacore.com>
202         * exp_util.adb (Is_Displace_Call): Make sure it works for indirect
203         calls and the like.
205 2017-09-06  Yannick Moy  <moy@adacore.com>
207         * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object
208         declarations to only consider valid uses of Global/Depends those on
209         single concurrent objects.
211 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
213         * sem_ch13.adb (Check_Record_Representation_Clause): Give an
214         error as soon as one of the specified components overlaps the
215         parent field.
217 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
219         * sem_prag.ads: minor fix typo in comment.
221 2017-09-06  Justin Squirek  <squirek@adacore.com>
223         * sem_ch5.adb (Analyze_Block_Statement): Verify a block comes
224         from source before checking source references.
225         * sem_warn.adb (Check_References): Add check for internal block
226         before recursing.
228 2017-09-06  Vincent Celier  <celier@adacore.com>
230         * make.adb, makeusg.adb, switch-m.adb, switch-m.ads, make_util.adb,
231         make_util.ads, sinput.adb, sinput.ads, clean.adb, gnatls.adb,
232         gnatname.adb: Remove the Project Manager from the GNAT tools.
233         * gcc-interface/Makefile.in: ditto.
235 2017-09-06  Bob Duff  <duff@adacore.com>
237         * sem_util.ads: Minor comment fix.
239 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
241         * sem_ch12.adb (Analyze_Associations, case of Formal_Package):
242         Generate a freeze node for the actual of a formal package, if
243         the actual is declared in the same unit and has a corresponding
244         body, to prevent the current instance from being frozen before
245         the actual is.
247 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
249         * sem_ch7.adb (Entity_Table_Size): Change to nearest prime number.
251 2017-09-06  Yannick Moy  <moy@adacore.com>
253         * sem_warn.adb: Minor refactoring.
255 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
257         * einfo.ads, einfo.adb (Get_Classwwide_Pragma): New utility,
258         to retrieve the inherited classwide precondition/postcondition
259         of a subprogram.
260         * freeze.adb (Freeze_Entity): Use Get_Classwide_Pragma when
261         freezing a subprogram, to complete the generation of the
262         corresponding checking code.
264 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
266         * exp_util.adb (Is_Controlled_Indexing): New routine.
267         (Is_Displace_Call): Use routine Strip to remove indirections.
268         (Is_Displacement_Of_Object_Or_Function_Result): Code clean up. Add a
269         missing case of controlled generalized indexing.
270         (Is_Source_Object): Use routine Strip to remove indirections.
271         (Strip): New routine.
273 2017-09-06  Bob Duff  <duff@adacore.com>
275         * sysdep.c (__gnat_has_cap_sys_nice): If HAVE_CAPABILITY is defined,
276         we include the proper header. Otherwise, we just declare the necessary
277         things from the capabilities library. This is so we can build on
278         machines without that library, while still enabling that library.
279         At run time, we're using weak symbols, so __gnat_has_cap_sys_nice will
280         simply return 0 if the library is not present, or not included
281         in the link.
283 2017-09-06  Pierre-Marie de Rodat  <derodat@adacore.com>
285         * exp_dbug.adb (Debug_Renaming_Declaration): Do not create an encoding
286         for renamings that involve function calls in prefix form.
288 2017-09-06  Bob Duff  <duff@adacore.com>
290         * sem_ch3.adb (Analyze_Subtype_Declaration):
291         Set Has_Delayed_Freeze on a subtype of an incomplete type.
293 2017-09-06  Pierre-Marie de Rodat  <derodat@adacore.com>
295         * par_sco.adb (Extend_Statement_Sequence): When the accept statement
296         has no parameter specification and no entry index, use the entry name
297         as the end of the generated SCO statement.
299 2017-09-06  Steve Baird  <baird@adacore.com>
301         * exp_util.adb (Side_Effect_Free): For CodePeer (only) treat
302         uses of 'Image and related attributes as having side effects in
303         order to avoid replicating such uses.
304         * pprint.ads (Expression_Image) Add new generic formal flag
305         Hide_Temp_Derefs.  The flag defaults to False; CodePeer will
306         (eventually) override the default.
307         * pprint.adb (Expression_Image) If the new flag is set, then
308         suppress the ".all" suffix when displaying a dereference whose
309         prefix is a use of a value-capturing compiler temp of the sort
310         generated by Expr_Util.Remove_Side_Effects .
311         * exp_attr.adb, g-catiio.adb, inline.adb, sem_attr.adb, sem_ch13.adb,
312         sem_ch7.adb, sem_dim.adb, sem_util.adb, sem_util.ads, sem_warn.adb:
313         Minor reformatting.
314         * inline.adb: Minor wording change.
316 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
318         * sem_ch7.adb: Update comment.
320 2017-09-06  Yannick Moy  <moy@adacore.com>
322         * einfo.adb, einfo.ads (Is_Subprogram_Or_Entry): New predicate.
323         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Use new function.
324         * sem_util.adb, sem_util.ads (Within_Protected_Type): Renaming
325         with slight modification from Is_Subp_Or_Entry_Inside_Protected,
326         so that applies to any entity.
328 2017-09-06  Yannick Moy  <moy@adacore.com>
330         * sem_ch3.adb (Derived_Type_Declaration): Use
331         Incomplete_Or_Partial_View rather than local Find_Partial_View.
333 2017-09-06  Javier Miranda  <miranda@adacore.com>
335         * g-catiio.ads, g-catiio.adb (Value): Extended to parse an UTC time
336         following ISO-8861.
338 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
340         * sem_dim.adb (Analyze_Dimension): In an instance, a type
341         conversion takes its dimensions from the expression, not from
342         the context type.
343         (Dimensions_Of_Operand): Ditto.
345 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
347         * exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
348         null procedures when GNAT coverage is used, so that their (empty)
349         bodies are properly covered.
351 2017-09-06  Bob Duff  <duff@adacore.com>
353         * sem_ch13.adb (Resolve_Aspect_Expressions): If
354         the entity is a type with discriminants, make the discriminants
355         directly visible in aspect clauses.
357 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
359         * sem_res.adb (Resolve_Arithmentic_Op): If both operands are
360         Universal_Real and the context is a floating-point type, resolve
361         both operands to the target type.
363 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
365         * a-comlin.adb, exp_aggr.adb, exp_ch6.adb, frontend.adb, gnatbind.adb,
366         sem_ch3.adb, sem_util.adb: Minor reformatting.
368 2017-09-06  Yannick Moy  <moy@adacore.com>
370         * freeze.adb (Check_Inherited_Conditions): Rewriting
371         of inherited preconditions and postconditions should only occur
372         in GNATprove mode, that is, when GNATprove_Mode is True, not to
373         be confused with SPARK_Mode being On.
375 2017-09-06  Yannick Moy  <moy@adacore.com>
377         * sem_warn.adb (Check_References): Take into
378         account possibility of attribute reference as original node.
380 2017-09-06  Yannick Moy  <moy@adacore.com>
382         * exp_attr.adb (Expand_N_Attribute_Reference): Protect against invalid
383         use of attribute.
385 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
387         * inline.adb (Split_Unconstrained_Function): Also set Is_Inlined
388         on the procedure created to encapsulate the body.
389         * sem_ch7.adb: Add with clause for GNAT.HTable.
390         (Entity_Table_Size): New constant.
391         (Entity_Hash): New function.
392         (Subprogram_Table): New instantiation of GNAT.Htable.Simple_HTable.
393         (Is_Subprogram_Ref): Rename into...
394         (Scan_Subprogram_Ref): ...this. Record references to subprograms in
395         the table instead of bailing out on them. Scan the value of constants
396         if it is not known at compile time.
397         (Contains_Subprograms_Refs): Rename into...
398         (Scan_Subprogram_Refs): ...this.
399         (Has_Referencer): Scan the body of all inlined subprograms. Reset the
400         Is_Public flag on subprograms if they are not actually referenced.
401         (Hide_Public_Entities): Beef up comment on the algorithm.
402         Reset the table of subprograms on entry.
404 2017-09-06  Yannick Moy  <moy@adacore.com>
406         * inline.adb: Add comments to Can_Be_Inlined_In_GNATprove_Mode.
408 2017-09-06  Javier Miranda  <miranda@adacore.com>
410         * exp_aggr.adb (Component_Not_OK_For_Backend): The C backend
411         cannot handle a type conversion of an array as an aggregate
412         component.
414 2017-09-06  Bob Duff  <duff@adacore.com>
416         * g-comlin.adb (Try_Help): Remove ".exe" so we
417         get the same results on windows and unix.
419 2017-09-06  Justin Squirek  <squirek@adacore.com>
421         * exp_imgv.adb (Expand_Image_Attribute),
422         (Expand_Wide_Image_Attribute), (Expand_Wide_Wide_Image_Attribute):
423         Added case to handle new-style 'Image expansion
424         (Rewrite_Object_Image): Moved from exp_attr.adb
425         * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
426         attribute cases so that the relevant subprograms in exp_imgv.adb
427         handle all expansion.
428         (Rewrite_Object_Reference_Image): Moved to exp_imgv.adb
429         * sem_attr.adb (Analyze_Attribute): Modified Image attribute
430         cases to call common function Analyze_Image_Attribute.
431         (Analyze_Image_Attribute): Created as a common path for all
432         image attributes (Check_Object_Reference_Image): Removed
433         * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
434         Removed and refactored into Is_Object_Image (Is_Object_Image):
435         Created as a replacement for Is_Image_Applied_To_Object
437 2017-09-06  Yannick Moy  <moy@adacore.com>
439         * sem_prag.adb (Analyze_Depends_In_Decl_Part): Add continuation
440         message for missing input.
442 2017-09-06  Yannick Moy  <moy@adacore.com>
444         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Prevent inlining
445         of protected subprograms and entries.
446         * sem_util.adb, sem_util.ads (Is_Subp_Or_Entry_Inside_Protected):
447         New function to detect when a subprogram of entry is defined
448         inside a protected object.
450 2017-09-06  Bob Duff  <duff@adacore.com>
452         * sysdep.c (__gnat_has_cap_sys_nice): New function to determine
453         whether the current process has the CAP_SYS_NICE capability.
454         * s-taprop-linux.adb (Get_Ceiling_Support): Update this to allow
455         ceiling priorities if the current process has the CAP_SYS_NICE
456         capability.
458 2017-09-06  Bob Duff  <duff@adacore.com>
460         * a-comlin.ads, a-comlin.adb (Argument): Move the constraint
461         check back to the body, because SPARK is not yet ready for
462         "or else raise Constraint_Error".
464 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
466         * exp_ch6.adb (Expand_Call_Helper): Replace call to null
467         procedure by a single null statement, after evaluating the
468         actuals that require it.
470 2017-09-06  Javier Miranda  <miranda@adacore.com>
472         * exp_aggr.adb (Backend_Processing_Possible.Component_Check):
473         Generating C code improve the code that checks the use of nested
474         aggregates to initialize object declarations.
476 2017-09-06  Yannick Moy  <moy@adacore.com>
478         * sem_ch3.adb (Derived_Type_Declaration): Detect
479         violations of new rule SPARK RM 3.4(1).  Also refactor existing
480         check to use the new function Find_Partial_View.
482 2017-09-06  Vincent Celier  <celier@adacore.com>
484         * gnatcmd.adb: gnat ls -V -P... invokes gprls -V -P...  The code
485         from the Prj hierarchy has been removed from the GNAT driver.
487 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
489         * sem_type.adb (Interface_Present_In_Ancestor): Within an
490         expression function, or within a spec expression (default value,
491         etc) a reference to an incomplete type is legal: legality of
492         the operation will be checked when some related entity (type,
493         object or subprogram) is frozen.
495 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
497         * exp_ch5.adb, s-diinio.ads, sem_ch4.adb, s-diflio.ads: Minor spelling
498         adjustments and a typo fix.
500 2017-09-06  Yannick Moy  <moy@adacore.com>
502         * sem_res.adb (Resolve_Call): Do not issue info
503         message about inlining of calls to functions in assertions,
504         for functions whose body has not been seen yet.
506 2017-09-06  Bob Duff  <duff@adacore.com>
508         * a-comlin.ads, a-comlin.adb (Argument): Simplify the code, now that
509         we can use modern Ada in this package.
510         * s-resfil.ads, s-resfil.adb, a-clrefi.ads, a-clrefi.adb:
511         Move Ada.Command_Line.Response_File to System.Response_File,
512         and make Ada.Command_Line.Response_File into a rename of
513         System.Response_File. This is to avoid having gnatbind depend
514         Ada.Command_Line, which would damage the bootstrap process now
515         that Ada.Command_Line contains modern Ada (the raise expression).
516         * gnatbind.adb: Avoid dependence on
517         Ada.Command_Line. Depend on System.Response_File instead
518         of Ada.Command_Line.Response_File. Change one call to
519         Ada.Command_Line.Command_Name to use Fill_Arg.  Change one call
520         to Ada.Command_Line.Argument_Count to use Arg_Count.
521         * gcc-interface/Make-lang.in, Makefile.rtl: Take note of the new files.
523 2017-09-06  Bob Duff  <duff@adacore.com>
525         * frontend.adb (Frontend): Skip -gnatec=gnat.adc
526         switch, because we've already read gnat.adc by default.
528 2017-09-06  Bob Duff  <duff@adacore.com>
530         * exp_ch5.adb (Get_Default_Iterator): Replace
531         "Assert(False)" with "return Iter", because if an iterable
532         type is derived from a noniterable one, then we won't find an
533         overriding or inherited default iterator.
535 2017-09-06  Yannick Moy  <moy@adacore.com>
537         * sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
538         literal index used to access a string is null or negative.
540 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
542         * einfo.adb (Status_Flag_Or_Transient_Decl): The attribute is now
543         allowed on loop parameters.
544         (Set_Status_Flag_Or_Transient_Decl): The attribute is now allowed
545         on loop parameters.
546         (Write_Field15_Name): Update the output for
547         Status_Flag_Or_Transient_Decl.
548         * einfo.ads: Attribute Status_Flag_Or_Transient_Decl now applies
549         to loop parameters. Update the documentation of the attribute
550         and the E_Loop_Parameter entity.
551         * exp_ch7.adb (Process_Declarations): Remove the bogus guard
552         which assumes that cursors can never be controlled.
553         * exp_util.adb (Requires_Cleanup_Actions): Remove the bogus
554         guard which assumes that cursors can never be controlled.
556 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
558         * exp_attr.adb, sem_util.adb, sem_attr.adb, sem_ch6.adb, sem_ch8.adb,
559         sem_warn.adb: Minor reformatting.
561 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
563         * sem_warn.adb (Warn_On_Overlapping_Actuals): Refine previous
564         fix and preserve older GNAT warning on overlapping actuals that
565         are not elementary types.
567 2017-09-06  Justin Squirek  <squirek@adacore.com>
569         * sem_attr.adb: Comment correction.
571 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
573         * sem_util.adb: Minor reformatting.
575 2017-09-06  Yannick Moy  <moy@adacore.com>
577         * a-comlin.ads (Argument): Add precondition for analysis.
579 2017-09-06  Yannick Moy  <moy@adacore.com>
581         * sem_res.adb (Resolve): Update message for function call as statement.
583 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
585         * sem_ch6.adb (Check_Returns): Clean up warnings coming from
586         generated bodies for renamings that are completions, when renamed
587         procedure is No_Return.
588         * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
589         rule in 6.5.1 (7/2): if a renaming is a completion of a subprogram
590         with No_Return, the renamed entity must be No_Return as well.
592 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
594         * exp_ch5.adb, freeze.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb:
595         Minor reformatting.
597 2017-09-06  Justin Squirek  <squirek@adacore.com>
599         * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
600         attribute cases (Rewrite_Object_Reference_Image): Created to
601         aid the rewriting of new-style 'Image attributes.
602         * sem_attr.adb (Analyze_Attribute): Modified Image attribute cases
603         (Check_Object_Reference_Image): Created to handle verification of
604         'Image with object-references as prefixes.
605         * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
606         Create predicate to identify cases where an 'Image attribute's
607         prefix applies to an object reference.
609 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
611         * freeze.adb (Freeze_Entity): Do not generate a freeze
612         node for a generic unit, even if it includes delayed aspect
613         specifications. Freeze nodes for generic entities must never
614         appear in the tree that reaches the back-end of the compiler.
616 2017-09-06  Yannick Moy  <moy@adacore.com>
618         * treepr.adb (Print_Entity_Info): Do not print empty Elist.
620 2017-09-06  Yannick Moy  <moy@adacore.com>
622         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not consider calls
623         to subprograms in other units as possibly inlined.
625 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
627         * freeze.adb (Freeze_Entity): For a derived type that has no
628         explicit delayed aspects but may inherit delayed aspects from its
629         parent type, analyze aspect at freeze point for proper capture
630         of an inherited aspect.
632 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
634         * lib-xref.adb (Get_Through_Renamings): Get through subprogram
635         renamings; also, avoid repeated calls to Renamed_Object when getting
636         through object renamings.
638 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
640         * sem_ch3.adb (Array_Type_Declaration): Handle properly an
641         array type declaration in a private part, when an index is a
642         subtype indication of a discrete type with a private partial view.
644 2017-09-06  Javier Miranda  <miranda@adacore.com>
646         * exp_ch4.adb (Expand_Modular_Op): Force generating
647         temporary to improve the generated code.
649 2017-09-06  Tristan Gingold  <gingold@adacore.com>
651         * s-fatgen.adb: Minor typo fix in comment.
653 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
655         * exp_ch5.adb (Make_Field_Assign): If the type
656         of the right-hand side has stored constraint, use its values
657         (except for those that are renamings of parent discriminants)
658         to produce additional assignments for the discriminants of the
659         left-hand side, which are invisible in the righ-hand side and
660         not retrievable as selected components.
662 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
664         * sem_util.adb (Needs_One_Formal): The first formal of such a
665         function must be a controlling formal, so that Obj.F (X, Y)
666         can have the interpretation F(Obj)(X, Y).
667         * sem_util.ads: Clarify documentation.
669 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
671         * table.ads, table.adb: Restore original implementation.
672         * namet.h (Names_Ptr): Adjust back.
673         (Name_Chars_Ptr): Likewise.
674         * uintp.h (Uints_Ptr): Likewise.
675         (Udigits_Ptr): Likewise.
676         * g-table.ads: Remove pragma Compiler_Unit_Warning.
677         * par_sco.adb: Do not with GNAT.Table and use Table consistently.
678         * scos.ads: Replace GNAT.Table with Table and adjust instantiations.
679         * spark_xrefs.ads: Likewise.
680         * scos.h: Undo latest changes.
682 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
684         * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate
685         No_Return flag to instance if pragma applies to generic unit. This
686         must be done explicitly because the pragma does not appear
687         directly in the generic declaration (unlike the corresponding
688         aspect specification).
690 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
692         * sem_ch7.adb (Has_Referencer): Move up and expand comment
693         explaining the test used to detect inlining.  Use same test
694         in second occurrence.
695         (Analyze_Package_Body_Helper): Minor formatting fixes.
697 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
699         * exp_ch4.adb (Handle_Changed_Representation): For an untagged
700         derived type with a mixture of renamed and constrained parent
701         discriminants, the constraint for the target must obtain the
702         discriminant values from both the operand and from the stored
703         constraint for it, given that the constrained discriminants are
704         not visible in the object.
705         * exp_ch5.adb (Make_Field_Assign): The type of the right-hand
706         side may be derived from that of the left-hand side (as in the
707         case of an assignment with a change of representation) so the
708         discriminant to be used in the retrieval of the value of the
709         component must be the entity in the type of the right-hand side.
711 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
713         * sem_ch3.adb, sem_ch7.adb, sem_util.adb, g-debpoo.adb, sem_ch4.adb,
714         sem_ch6.adb, sem_ch8.adb: Minor reformatting.
715         * exp_util.adb (Is_Source_Object): Account for
716         the cases where the source object may appear as a dereference
717         or within a type conversion.
718         * exp_ch6.adb: Fix missing space in error message.
720 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
722         * sem_prag.adb: Update description of Eliminate.
724 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
726         * sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
727         properly an attribute reference 'Loop_Entry that appears in the
728         list of indices of an indexed expression, to prevent an infinite
729         loop in the compiler.
731 2017-09-06  Bob Duff  <duff@adacore.com>
733         * s-fileio.adb (Name): Do not raise Use_Error for temp files.
735 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
737         * sem_ch4.adb (Analyze_Set_Membership):  If an alternative
738         in a set membership is an overloaded enumeration literal, and
739         the type of the alternative is resolved from a previous one,
740         replace the entity of the alternative as well as the type,
741         to prevent inconsistencies between the entity and the type.
743 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
745         * ali.ads (ALIs_Record): Add No_Component_Reordering component.
746         (No_Component_Reordering_Specified): New switch.
747         * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified.
748         (Scan_ALI): Set No_Component_Reordering and deal with NC marker.
749         * bcheck.adb (Check_Consistent_No_Component_Reordering):
750         New check.
751         (Check_Configuration_Consistency): Invoke it.
752         * debug.adb (d.r): Toggle the effect of the switch.
753         (d.v): Change to no-op.
754         * einfo.ads (Has_Complex_Representation):
755         Restrict to record types.
756         (No_Reordering): New alias for Flag239.
757         (OK_To_Reorder_Components): Delete.
758         (No_Reordering): Declare.
759         (Set_No_Reordering): Likewise.
760         (OK_To_Reorder_Components): Delete.
761         (Set_OK_To_Reorder_Components): Likewise.
762         * einfo.adb (Has_Complex_Representation): Expect record types.
763         (No_Reordering): New function.
764         (OK_To_Reorder_Components): Delete.
765         (Set_Has_Complex_Representation): Expect base record types.
766         (Set_No_Reordering): New procedure.
767         (Set_OK_To_Reorder_Components): Delete.
768         (Write_Entity_Flags): Adjust to above change.
769         * fe.h (Debug_Flag_Dot_R): New macro and declaration.
770         * freeze.adb (Freeze_Record_Type): Remove conditional code setting
771         OK_To_Reorder_Components on record types with convention Ada.
772         * lib-writ.adb (Write_ALI): Deal with NC marker.
773         * opt.ads (No_Component_Reordering): New flag.
774         (No_Component_Reordering_Config): Likewise.
775         (Config_Switches_Type): Add No_Component_Reordering component.
776         * opt.adb (Register_Opt_Config_Switches): Copy
777         No_Component_Reordering onto No_Component_Reordering_Config.
778         (Restore_Opt_Config_Switches): Restore No_Component_Reordering.
779         (Save_Opt_Config_Switches): Save No_Component_Reordering.
780         (Set_Opt_Config_Switches): Set No_Component_Reordering.
781         * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering.
782         * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the
783         No_Reordering flag from the default.
784         (Build_Derived_Private_Type): Likewise.
785         (Build_Derived_Record_Type): Likewise.  Then inherit it
786         for untagged types and clean up handling of similar flags.
787         (Record_Type_Declaration): Likewise.
788         * sem_ch13.adb (Same_Representation): Deal with No_Reordering and
789         remove redundant test on Is_Tagged_Type.
790         * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering.
791         (Sig_Flags): Likewise.
792         * snames.ads-tmpl (Name_No_Component_Reordering): New name.
793         (Pragma_Id): Add Pragma_No_Component_Reordering value.
794         * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well.
795         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>:
796         Copy the layout of the parent type only if the No_Reordering
797         settings match.
798         (components_to_record): Reorder record types with
799         convention Ada by default unless No_Reordering is set or -gnatd.r
800         is specified and do not warn if No_Reordering is set in GNAT mode.
802 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
804         * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure):
805         new predicate to reject declarations that can be completions,
806         when there is a visible prior homograph that is a null procedure.
807         * sem_ch6.adb (Analyze_Null_Procedure): use it.
808         * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto.
810 2017-09-06  Thomas Quinot  <quinot@adacore.com>
812         * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal
813         run of 253 characters or more.
815 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
817         * einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
818         properly incomplete subtypes that may be created by explicit or
819         implicit declarations.
820         (Is_Base_Type): Take E_Incomplete_Subtype into account.
821         (Subtype_Kind): Ditto.
822         * sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
823         Ekind of a subtype of a discriminated incomplete type.
824         (Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
825         incomplete types, to preserve error reporting.
826         (Process_Incomplete_Dependents): Do not create a subtype
827         declaration for an incomplete subtype that is created internally.
828         * sem_ch7.adb (Analyze_Package_Specification): Handle properly
829         incomplete subtypes that do not require a completion, either
830         because they are limited views, of they are generic actuals.
832 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
834         * checks.adb (Insert_Valid_Check): Remove the
835         suspicious manipulation of the Do_Range_Check flag as ths is
836         no linger needed. Suppress validity check when analysing the
837         validation variable.
839 2017-09-06  Philippe Gil  <gil@adacore.com>
841         * g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
842         GNATCOLL.Memory
844 2017-09-06  Bob Duff  <duff@adacore.com>
846         * sem_elim.adb: Minor comment fix.
848 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
850         * sem_util.adb (Is_Object_Reference): A function call is an
851         object reference, and thus attribute references for attributes
852         that are functions (such as Pred and Succ) as well as predefined
853         operators are legal in contexts that require an object, such as
854         the prefix of attribute Img and the Ada2020 version of 'Image.
856 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
858         * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
859         exp_ch3.adb, xoscons.adb: Minor reformatting.
861 2017-09-06  Raphael Amiard  <amiard@adacore.com>
863         * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
864         Position parameter. If supplied, use it to provide efficient iteration.
865         * a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
866         a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
867         iteration.
869 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
871         * exp_util.adb (Build_Allocate_Deallocate_Proc): If the
872         designated type is class-wide and the expression is an unchecked
873         conversion, preserve the conversion when checking the tag of the
874         designated object, to prevent spurious semantic errors when the
875         expression in the conversion has an untagged type (for example
876         an address attribute).
878 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
880         * sem_res.adb (Resolve_Entry_Call): Check whether a protected
881         operation is subject to a pragma Eliminate.
883 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
885         * sem_elim.ads, exp_ch4.adb: Minor reformatting.
887 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
889         * fe.h (Eliminate_Error_Msg): Remove.
891 2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
893         * gcc-interface/utils.c (make_packable_type): Update call to
894         mode_for_size_tree.
896 2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
898         * gcc-interface/utils2.c (build_load_modify_store):
899         Use int_mode_for_size.
901 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
903         PR ada/62235
904         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
905         for Itypes that are E_Record_Subtype with a cloned subtype.
906         <E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
908 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
910         * gcc-interface/trans.c (convert_with_check): Use a custom base type
911         if the base type of the expression has a different machine mode.
912         Rename a couple of parameters and local variable.
914 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
916         * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Address>: Do not strip
917         conversions around prefixes that are not references.
919 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
921         * gcc-interface/utils.c (unchecked_convert): When the result type is a
922         non-biased integral type with size 0, set the result to 0 directly.
924 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
926         * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to
927         (renaming_from_instantiation_p): ...this.
928         * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate
929         instead of explicit tests on kind of entities.  Adjust for renaming.
930         (gnat_to_gnu_profile_type): Likewise.
931         (gnat_to_gnu_subprog_type): Likewise.
932         * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
933         (Case_Statement_to_gnu): Likewise.
934         (gnat_to_gnu): Likewise.
935         (process_freeze_entity): Likewise.
936         (process_type): Likewise.
937         (add_stmt_with_node): Adjust for renaming.
938         * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming.
939         (renaming_from_generic_instantiation_p): Rename to...
940         (renaming_from_instantiation_p): ...this.  Use inline predicate.
941         (pad_type_hasher::keep_cache_entry): Fold.
943 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
945         * gcc-interface/trans.c (adjust_for_implicit_deref): New function.
946         (gnat_to_gnu) <N_Explicit_Dereference>: Translate result type first.
947         (N_Indexed_Component): Invoke adjust_for_implicit_deref on the prefix.
948         (N_Slice): Likewise.
949         (N_Selected_Component): Likewise.  Do not try again to translate it.
950         (N_Free_Statement): Invoke adjust_for_implicit_deref on the expression.
952 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
954         * repinfo.ads: Document new treatment of dynamic values.
955         (TCode): Bump upper bound to 29.
956         (Dynamic_Val): New constant set to 29.
957         * repinfo.adb (Print_Expr) <Dynamic_Val>: New case.
958         (Rep_Value)  <Dynamic_Val>: Likewise.
959         * repinfo.h (Dynamic_Val): New macro.
960         * gcc-interface/decl.c (annotate_value): Tidy up and cache result for
961         DECL_P nodes too.
962         <INTEGER_CST>: Set TCODE instead of recursing.
963         <COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
964         <VAR_DECL>: New case.
965         <MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
966         <BIT_AND_EXPR>: Adjust.
967         <CALL_EXPR>: Do not fall through.
969 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
971         * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
972         there is no target, do not create a temporary for the return value for
973         an allocator either.
975 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
977         * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
978         unconstrained array type.
980 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
981             Alan Hayward  <alan.hayward@arm.com>
982             David Sherwood  <david.sherwood@arm.com>
984         * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
985         instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
987 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
988             Alan Hayward  <alan.hayward@arm.com>
989             David Sherwood  <david.sherwood@arm.com>
991         * gcc-interface/decl.c (check_ok_for_atomic_type): Use
992         is_a <scalar_int_mode>.
993         * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
994         * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
996 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
997             Alan Hayward  <alan.hayward@arm.com>
998             David Sherwood  <david.sherwood@arm.com>
1000         * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
1001         instead of mode_for_size.
1002         (gnat_to_gnu_subprog_type): Likewise.
1003         * gcc-interface/utils.c (make_type_from_size): Likewise.
1005 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1006             Alan Hayward  <alan.hayward@arm.com>
1007             David Sherwood  <david.sherwood@arm.com>
1009         * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
1010         (fp_size_to_prec): Likewise.
1012 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1013             Alan Hayward  <alan.hayward@arm.com>
1014             David Sherwood  <david.sherwood@arm.com>
1016         * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
1017         <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
1019 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1020             Alan Hayward  <alan.hayward@arm.com>
1021             David Sherwood  <david.sherwood@arm.com>
1023         * gcc-interface/decl.c (validate_size): Update use of
1024         GET_MODE_WIDER_MODE, forcing a wider mode to exist.
1026 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1027             Alan Hayward  <alan.hayward@arm.com>
1028             David Sherwood  <david.sherwood@arm.com>
1030         * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
1031         (fp_size_to_prec): Likewise.
1033 2017-08-29  Martin Liska  <mliska@suse.cz>
1035         PR other/39851
1036         * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
1038 2017-08-08  Martin Liska  <mliska@suse.cz>
1040         * gcc-interface/trans.c: Include header files.
1042 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
1044         * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
1045         as new argument to the imported_module_or_decl debug hook.
1047 2017-07-25  Javier Miranda  <miranda@adacore.com>
1049         * checks.adb (Apply_Divide_Checks): Ensure that operands are not
1050         evaluated twice. 
1052 2017-07-19  Jakub Jelinek  <jakub@redhat.com>
1054         * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
1055         TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
1056         (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
1058 2017-07-18  Mike Frysinger  <vapier@chromium.org>
1060         * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
1061         (../../gnatlink$(exeext)): Likewise.
1063 2017-07-15  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>
1065         PR ada/81446
1066         * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
1067         (Backend_Overflow_Checks): Set to True.
1069 2017-06-23  Jakub Jelinek  <jakub@redhat.com>
1071         * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
1073 2017-06-21  Pierre-Marie de Rodat  <derodat@adacore.com>
1075         * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
1076         notice.  New macro.
1077         * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
1078         as a definition.
1079         (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
1080         definition.
1081         * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
1082         imported subprograms for the current compilation unit as
1083         definitions.  Disable debug info for references to variables.
1084         * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
1085         * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
1086         not built-in functions to their binding scope.
1087         (create_subprog_decl): Add a DEFINITION parameter.  If it is true, tag
1088         the function as a definition.  Update all callers.
1089         (gnat_write_global_declarations): Emit debug info for imported
1090         functions.  Filter out external variables for which debug info
1091         is disabled.
1093 2017-06-15  Nicolas Boulenguez  <nicolas.boulenguez@free.fr>
1095         PR ada/81105
1096         * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
1097         (i[3456]86-pc-gnu): Likewise.
1098         (x86_64 kfreebsd): Likewise.
1100 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
1102         PR bootstrap/80897
1103         * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
1105 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
1107         PR ada/81070
1108         * s-interr-hwint.adb: Reinstate.
1109         * gcc-interface/Makefile.in (RTEMS): Use it again.
1111 2017-06-08  Olivier Hainque  <hainque@adacore.com>
1113         * vx_crtbegin_auto.c: Update year in copyright notice.
1114         * vx_crtbegin.c: Likewise.
1115         * vx_crtbegin.inc: Likewise. 
1116         * vx_crtend.c:  Likewise.
1118 2017-06-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1120         * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
1121         * s-tpopsp-rtems.adb: Delete.
1123 2017-06-02  Olivier Hainque  <hainque@adacore.com>
1125         * vx_crtbegin_auto.c: New file.
1126         * vx_crtbegin.c: New file.
1127         * vx_crtbegin.inc: New file.
1128         * vx_crtend.c: New file.
1130 2017-05-25  Jonathan Wakely  <jwakely@redhat.com>
1132         * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
1133         const qualifiers that cause -Wignored-qualifiers warnings.
1135 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
1137         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
1138         for Itypes that are E_Access_Subtype.
1139         <E_Access_Subtype>: Use the DECL of the base type directly.
1141 2017-05-22  Ed Schonberg  <schonberg@adacore.com>
1142             Eric Botcazou  <ebotcazou@adacore.com>
1144         * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
1145         limited view may appear in the profile of a function, and a call to
1146         that function in another unit in which the full view is available must
1147         use this full view to spurious type errors at the point of call.
1148         * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
1149         of parent body with a with clause for the main unit.
1150         * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
1151         (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
1152         types declared in external units like types from limited with clauses.
1153         Adjust final processing of defer_limited_with_list accordingly.
1154         * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
1155         again to translate the prefix after the field if it is incomplete.
1157 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
1159         * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
1160         alignment for simple volatile fields and remove associated errors.
1162 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
1164         * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
1165         * gcc-interface/trans.c (get_elaboration_procedure): Make static.
1167 2017-05-15  Pierre-Marie de Rodat  <derodat@adacore.com>
1169         * gcc-interface/utils.c (can_materialize_object_renaming_p):
1170         Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
1171         process Original_Node instead of expanded names.
1173 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
1175         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
1176         addressability check in the constrained case.
1178 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
1180         * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
1181         types not coming from a limited context.
1183 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
1185         * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
1186         the inlined list that are not public.
1187         * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
1188         there is a pragma Inline_Always on the subprogram.
1190 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
1192         * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
1193         <N_Allocator>: Use properly typed constants.
1194         (extract_values): Move around.
1195         (pos_to_constructor): Minor tweaks.
1196         (Sloc_to_locus): Fix formatting.
1197         * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
1198         * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
1199         (Gigi_Equivalent_Type): Adjust head comment.
1200         * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
1202 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
1204         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
1205         is a representation clause on an extension, propagate the alignment of
1206         the parent type only if the platform requires strict alignment.
1208 2017-05-12  Eric Botcazou  <ebotcazou@adacore.com>
1210         * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
1211         instead of Word_Size.
1213         Revert
1214         2017-03-28  Andreas Schwab  <schwab@suse.de>
1216         PR ada/80117
1217         * system-linux-aarch64-ilp32.ads: New file.
1218         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
1219         from LIBGNAT_TARGET_PAIRS.
1220         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
1221         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
1222         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
1223         or -mabi=ilp32, resp.
1225 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
1227         PR ada/80626
1228         * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
1229         instead of Word_Size.
1231 2017-05-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1233         * raise-gcc.c (exception_class_eq): Make ec parameter const.
1235 2017-05-02  Richard Biener  <rguenther@suse.de>
1237         * gcc-interface/misc.c (gnat_post_options): Do not set
1238         -fstrict-overflow.
1240 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1242         * gcc-interface/trans.c (assoc_to_constructor): Make sure
1243         Corresponding_Discriminant is only called on discriminants.
1244         Skip the saving of the result only for them.
1245         (gnat_to_gnu) <N_Selected_Component>: Likewise.
1246         <N_Unchecked_Type_Conversion>: Translate the result type first.
1247         (gigi): Set TREE_NOTHROW on Begin_Handler.
1248         (stmt_list_cannot_raise_p): New predicate.
1249         (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
1250         a cleanup if the statements of the handler cannot raise.
1251         (process_freeze_entity): Use Is_Record_Type.
1252         (process_type): Likewise.
1254 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1256         * einfo.ads (Corresponding_Record_Component): New alias
1257         for Node21 used for E_Component and E_Discriminant.
1258         * einfo.adb (Corresponding_Record_Component): New function.
1259         (Set_Corresponding_Record_Component): New procedure.
1260         (Write_Field21_Name): Handle Corresponding_Record_Component.
1261         * sem_ch3.adb (Inherit_Component): Set
1262         Corresponding_Record_Component for every component in
1263         the untagged case.  Clear it afterwards for non-girder
1264         discriminants.
1265         * gcc-interface/decl.c (gnat_to_gnu_entity)
1266         <E_Record_Type>: For a derived untagged type with discriminants
1267         and constraints, apply the constraints to the layout of the
1268         parent type to deduce the layout.
1269         (field_is_aliased): Delete.
1270         (components_to_record): Test DECL_ALIASED_P directly.
1271         (annotate_rep): Check that fields are present except for
1272         an extension.
1273         (create_field_decl_from): Add DEBUG_INFO_P
1274         parameter and pass it in recursive and other calls.  Add guard
1275         for the manual CSE on the size.
1276         (is_stored_discriminant): New predicate.
1277         (copy_and_substitute_in_layout): Consider only
1278         stored discriminants and check that original fields are present
1279         in the old type.  Deal with derived types.  Adjust call to
1280         create_variant_part_from.
1282 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1284         * exp_ch6.adb (Expand_Call_Helper): When locating the
1285         accessibility entity created for an access parameter, handle
1286         properly a reference to a formal of an enclosing subprogram. if
1287         the reference appears in an inherited class-wide condition, it
1288         is the rewriting of the reference in the ancestor expression,
1289         but the accessibility entity must be that of the current formal.
1291 2017-05-02  Javier Miranda  <miranda@adacore.com>
1293         * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
1294         (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
1295         Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
1296         Call Expand_Non_Binary_Modular_Op.
1298 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1300         * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
1301         has discriminants, do not override the Stored_Constraint list of
1302         the full view of the derived type with that of the derived type.
1304 2017-05-02  Bob Duff  <duff@adacore.com>
1306         * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
1308 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
1310         * s-os_lib.ads: Minor typo fix.
1312 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
1314         * gnatls.adb: Merge and refactor code from Prj.Env and remove
1315         this deprecated dependency.
1317 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1319         * exp_util.ads: minor comment addition.
1321 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1323         * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
1324         pastos in part #3 of the head comment.
1326 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1328         * exp_ch3.adb (Freeze_Type): Do not generate an invariant
1329         procedure body for a local (sub)type declaration within a
1330         predicate function. Invariant checks do not apply to these, and
1331         the expansion of the procedure will happen in the wrong scope,
1332         leading to misplaced freeze nodes.
1334 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1336         * exp_util.adb (Insert_Library_Level_Action): Use proper scope
1337         to analyze generated actions.  If the main unit is a body,
1338         the required scope is that of the corresponding unit declaration.
1340 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
1342         * einfo.adb (Declaration_Node): flip branches of
1343         an IF statement to avoid repeated negations in its condition;
1344         no change in semantics, only to improve readability.
1346 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
1348         * sem_case.adb: Remove extra spaces in parameter declarations.
1350 2017-05-02  Justin Squirek  <squirek@adacore.com>
1352         * usage.adb: Replace space with hyphen ("run time" -> "run-time")
1353         in usage line for new -gnatwE switch.
1355 2017-05-02  Claire Dross  <dross@adacore.com>
1357         * a-cofuve.ads (Remove): Remove unnecessary
1358         conditions in precondition.
1360 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
1362         * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
1363         sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
1365 2017-05-02  Justin Squirek  <squirek@adacore.com>
1367         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
1368         alternative expression.
1369         * sem_res.adb (Resolve_Case_Expression): Ditto.
1371 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1373         * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
1374         Refine predicate for the case where the primitive operation
1375         is a renaming of equality.  An overriding operation that is
1376         a user-defined renaming of predefined equality inherits its
1377         slot from the overridden operation. Otherwise it is treated
1378         as a predefined op and occupies the same predefined slot as
1379         equality. A call to it is transformed into a call to its alias,
1380         which is the predefined equality. A dispatching call thus uses
1381         the proper slot if operation is further inherited and called
1382         with class-wide arguments.
1384 2017-05-02  Justin Squirek  <squirek@adacore.com>
1386         * errout.adb (Set_Msg_Text): Add a case to switch the message
1387         type when the character '[' is detected signifying a warning
1388         about a run-time exception.
1389         * opt.ads Add a new Warning_Mode value for new switch
1390         * switch-b.adb (Scan_Binder_Switches): Add case for the binder
1391         to handle new warning mode
1392         * usage.adb (Usage): Add usage entry for -gnatwE
1393         * warnsw.adb (Set_Warning_Switch): Add case for the new switch
1395 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1397         * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
1398         declaration that operates on some fixed point type.
1400 2017-05-02  Justin Squirek  <squirek@adacore.com>
1402         * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
1404 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
1406         * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
1408 2017-05-02  Justin Squirek  <squirek@adacore.com>
1410         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
1411         expression (Analyze_If_Expression): Add check for valid condition
1412         * sem_eval.adb (Eval_Case_Expression): Add check for error posted
1413         on case-expression
1414         * sem_res.adb (Resolve_If_Expression): Add check for valid
1415         condition and then-expression.
1417 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1419         * exp_ch3.adb (Build_Initialization_Call): Generate a null
1420         statement if the initialization call is a null procedure, as
1421         can happen with a controlled type with no explicit Initialize
1422         procedure, or an array of such.
1423         * exp_ch7.adb (Process_Object_Declaration): For a type with
1424         controlled components that has a trivial Initialize procedure,
1425         insert declaration for finalization counter after object
1426         declaration itself.
1427         (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
1428         finalization block and attendant declarations if component has
1429         a trivial Initialize procedure.
1430         (Make_Init_Call): Do not generate a call if controlled type has
1431         a trivial Initialize procedure.
1433 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1435         * g-forstr.ads (Data): Move Format component last.
1436         * g-forstr.adb ("+"): Adjust for above change.
1437         * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
1438         * g-sechas.ads (Context): Move Key last.
1439         * g-socket.ads (Service_Entry_Type): Move Aliases last.
1440         * s-fileio.adb (Temp_File_Record): Move Name last.
1441         * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
1442         * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
1444 2017-05-02  Jerome Lambourg  <lambourg@adacore.com>
1446         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
1447         switch introduced recently. finally not needed.
1449 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
1451         * sem_ch6.adb (Analyze_Null_Procedure): Set the
1452         Corresponding_Body link for a null procedure declaration.
1454 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1456         * atree.h (Flag290): Add missing terminating parenthesis.
1457         * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
1458         (Set_Is_Class_Wide_Clone): Likewise.
1459         * einfo.ads (Is_Class_Wide_Clone): Likewise.
1461 2017-05-02  Gary Dismukes  <dismukes@adacore.com>
1463         * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
1464         parameter Array_Comp to indicate the case of an array object
1465         with null-excluding components.
1466         * checks.adb (Null_Exclusion_Static_Checks):
1467         Call Compile_Time_Constraint_Error instead of
1468         Apply_Compile_Time_Constraint_Error in the component case. Also
1469         call that when Array_Comp is True, with an appropriate warning for
1470         the array component case. Only create an explicit initialization
1471         by null in the case of an object of a null-excluding access type
1472         (and no longer do that in the component case).
1473         * sem_ch3.adb (Check_Component): Add a Boolean parameter
1474         Array_Comp defaulted to False.  Pass Empty for the Comp
1475         actual when calling Null_Exclusion_Static_Checks in the case
1476         where Comp_Decl matches Object_Decl, because we don't have a
1477         component in that case. In the case of an object or component
1478         of an array type, pass True for Array_Comp on the recursive call
1479         to Check_Component.
1481 2017-05-02  Bob Duff  <duff@adacore.com>
1483         * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
1484         compute the linux priority from the Ada priority. Call this everywhere
1485         required. In particular, the previous version was not doing this
1486         computation when setting the ceiling priority in various places. It
1487         was just converting to C.int, which results in a ceiling that is off
1488         by 1.
1490 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1492         * sem_ch3.adb: Comment predicate inheritance.
1494 2017-05-02  Tristan Gingold  <gingold@adacore.com>
1496         * s-trasym.ads: Add comment.
1498 2017-05-02  Bob Duff  <duff@adacore.com>
1500         * sem_elab.adb, sem_elab.ads: Minor comment fixes.
1501         * sem_ch4.adb: Minor reformatting.
1502         * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
1503         * s-taspri-posix-noaltstack.ads: Minor refactoring.
1504         * sinput.ads: Minor typo fix.
1506 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1508         * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
1509         * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
1510         here from exp_ch9, to recognize objects whose creation requires
1511         dynamic allocation, so that the proper warning can be emitted
1512         when restriction No_Implicit_Heap_Allocation is in effect.
1513         * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
1514         to emit proper warning when an object that requires dynamic
1515         allocation is declared.
1517 2017-05-02  Tristan Gingold  <gingold@adacore.com>
1519         * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
1521 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1523         * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
1524         visibility rules for equality operators that apply within an
1525         instantiation apply within an inlined body.
1526         * sem_type.adb (Add_One_Interp): ditto.
1528 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
1530         * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
1531         procedures.
1533 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1535         * snames.ads-tmpl
1536         (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
1537         Name_No_Tagged_Streams): Move to regular pragmas.  Add
1538         placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
1539         and Secondary_Stack_Size.
1540         (Pragma_Id): Move Pragma_Assume,
1541         Pragma_Attribute_Definition, Pragma_Loop_Optimize and
1542         Pragma_No_Tagged_Streams to second part.
1544 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
1546         * exp_attr.adb: Minor reformatting.
1548 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1550         * sem_ch4.adb (Analyze_Selected_Component): Improve error
1551         detection for illegal references to private components or
1552         operations of a protected type in the body of the type.
1554 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1556         * opt.ads: Add missing GNAT markers in comments.
1557         * opt.adb (Set_Opt_Config_Switches): Do not override earlier
1558         settings of Optimize_Alignment at the end.
1560 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
1562         * checks.adb (Apply_Constraint_Check): Do not apply
1563         a discriminant check when the associated type is a constrained
1564         subtype created for an unconstrained nominal type.
1565         * exp_attr.adb: Minor reformatting.
1567 2017-05-02  Bob Duff  <duff@adacore.com>
1569         * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
1570         the N_Raise_Expression case.
1571         * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
1572         and add assertions.
1574 2017-05-02  Yannick Moy  <moy@adacore.com>
1576         * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
1577         optimize length comparison in GNATprove mode.
1578         * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
1579         operator /= into negation of operator = when needed.
1580         (Expand_SPARK): Call new
1581         function to expand operator /=.
1583 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1585         * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
1586         Simplify the expression for a fixed-fixed division to remove
1587         divisions by constants whenever possible, as an optimization
1588         for restricted targets.
1590 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
1592         * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
1594 2017-05-02  Bob Duff  <duff@adacore.com>
1596         * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
1597         to find primitive ops, instead of using an Identifier that will
1598         later be looked up. This is necessary because these ops are not
1599         necessarily visible at all places where we need to call them.
1600         * exp_util.ads: Minor comment fix.
1602 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1604         * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
1605         references are fully conformant if they are both expansions
1606         of the discriminant of a protected type, within one of the
1607         protected operations. One occurrence may be expanded into a
1608         constant declaration while the other is an input parameter to
1609         the corresponding generated subprogram.
1611 2017-05-02  Justin Squirek  <squirek@adacore.com>
1613         * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
1614         recursivly searching composite-types for null-excluding access
1615         types and verifying them.
1616         (Analyze_Object_Declaration): Add a
1617         call to Check_Null_Excluding_Components for static verification
1618         of non-initialized objects.
1619         * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
1620         a parameter for a composite-type's component and an extra case
1621         for printing component information.
1623 2017-05-02  Yannick Moy  <moy@adacore.com>
1625         * sem_ch10.adb (Analyze_Subunit): Take
1626         configuration pragma into account when restoring appropriate
1627         pragma for analysis of subunit.
1629 2017-05-02  Justin Squirek  <squirek@adacore.com>
1631         * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
1632         s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
1633         g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
1634         clauses from the runtime.
1636 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
1638         * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
1639         array components specially.
1641 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
1643         * sem_ch8.adb (Premature_Usage): If the premature usage of
1644         an entity is as the expression in its own object decaration,
1645         rewrite the reference as Any_Id to prevent cascaded errors or
1646         compiler loops when such an entity is used in an address clause.
1648 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
1650         * gcc-interface/decl.c (components_to_record): Add missing guard.
1652 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
1654         * gcc-interface/decl.c (components_to_record): Add more comments.
1655         Put back pending fields onto the regular list if the misalignment
1656         happens to cancel itself.
1658 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
1660         * sem_ch4.adb (Complete_Object_Operation): When rewriting the
1661         controlling actual in a prefixed call, preserve the original node
1662         information if the prefix itself has been rewritten, for ASIS use.
1664 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
1666         * exp_ch6.adb (Insert_Post_Call_Actions):
1667         Code clean up. Insert the post-call actions after an enclosing
1668         procedure call when N denotes a function call and appears as an
1669         actual parameter in the procedure call.
1671 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
1673         * freeze.adb (Check_Component_Storage_Order): If there is a clause
1674         for the component, also reject the attribute if the component
1675         doesn't end on a byte boundary and its scalar storage order is
1676         different from that of the enclosing record type.
1678 2017-04-28  Javier Miranda  <miranda@adacore.com>
1680         * atree.ads (Info_Messages): Removed.
1681         (Warning_Info_Messages): New counter.
1682         (Report_Info_Messages): New counter.
1683         * err_vars.ads Update documentation.
1684         * errout.adb (Delete_Warning_And_Continuations): Update
1685         Info_Message occurrences.
1686         (Error_Msg_Internal): Update Info_Message occurrences.
1687         (Delete_Warning): Update Info_Message occurrences.
1688         (Write_Error_Summary): Update Info_Message occurrences.
1689         (Output_Messages): Update Info_Message occurrences.
1690         (To_Be_Removed): Update Info_Message occurrences.
1691         (Reset_Warnings): Update Info_Message occurrences.
1692         * errutil.adb (Error_Msg): Update Info_Message occurrences.
1693         (Finalize): Update Info_Message occurrences.
1694         (Initialize): Update Info_Message occurrences.
1695         * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
1696         (Compilation_Errors): Update Info_Message_Occurences.
1698 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
1700         * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
1701         * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
1702         * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
1703         * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
1704         * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
1705         * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
1706         Y_Size.
1707         * sem_eval.adb (Why_Not_Static): Initialize Typ.
1708         * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
1710 2017-04-28  Bob Duff  <duff@adacore.com>
1712         * sem_util.ads, sem_util.adb (Might_Raise): New function
1713         that replaces Is_Exception_Safe, but has the opposite
1714         sense. Is_Exception_Safe was missing various cases -- calls inside
1715         a pragma Debug, calls inside an 'if' or assignment statement,
1716         etc. Might_Raise now walks the entire subtree looking for things
1717         that can raise.
1718         * exp_ch9.adb (Is_Exception_Safe): Remove.
1719         (Build_Protected_Subprogram_Body): Replace call to
1720         Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
1721         constants where possible).
1722         * exp_ch7.adb: Rename Is_Protected_Body -->
1723         Is_Protected_Subp_Body. A protected_body is something different
1724         in the grammar.
1726 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
1728         * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
1729         * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
1730         (P_Discrete_Choice_List): Initialize Expr_Node variable.
1731         * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
1732         (P_Protected): Likewise.
1733         * sem_case.adb (Check_Duplicates):
1734         Add pragma Warnings on variable.
1735         * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
1736         * sem_ch4.adb (List_Operand_Interps):  Add pragma Warnings on variable.
1737         * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
1738         (Analyze_Exit_Statement): Initialize Scope_Id variable.
1739         (Analyze_Iterator_Specification): Initialize Bas variable.
1740         * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
1741         Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
1742         (Analyze_Accept_Statement): Initialize Task_Nam.
1744 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
1746         * checks.adb (Install_Primitive_Elaboration_Check):
1747         Do not generate an elaboration check if all checks have been
1748         suppressed.
1750 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
1752         * sem_ch13.adb (Analyze_Aspect_Specifications, case
1753         Interrupt_Handler and Attach_Handler): Generate reference
1754         to protected operation to prevent spurious warnings about
1755         unreferenced entities. Previous scheme failed with style checks
1756         enabled.
1758 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
1760         * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
1761         that follows an expression function must not be relocated to
1762         the generated body, because it applies to the code that follows.
1764 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
1766         * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
1767         Relaxed_RM_Semantics to avoid having CodePeer issue errors on
1768         code that might violate the more stringent checking for 'Access
1769         introduced in Ada 2005.
1771 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
1773         * a-cforse.adb: minor style fix in comment.
1775 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
1777         * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
1778         initialize Block_Decls variable.
1779         (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
1780         (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
1781         * exp_disp.adb (Expand_Interface_Actuals): Initialize
1782         Formal_DDT and Actual_DDT variables.
1783         (Expand_Interface_Thunk): Initialize Iface_Formal.
1784         (Make_DT): Initialize Size_Comp.
1785         (Make_Select_Specific_Data_Table): Initialize Decls.
1786         * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
1787         Also initialize more RPC_Receiver_* variables.
1788         (Build_To_Any_Function): Initialize Cstr_Formal.
1789         * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
1791 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
1793         * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
1794         node between access types, freeze the designated type as well,
1795         so that dispatch table pointers are created in the proper scope,
1796         and not in the constructed body of the expression function.
1798 2017-04-28  Bob Duff  <duff@adacore.com>
1800         * alloc.ads (Nodes_Initial): Go back to previous value. The large
1801         value makes large compilations faster, but small compilations slower.
1803 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
1805         * sem_util.adb: minor typos in Is_Child_Or_Sibling.
1807 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
1809         * erroutc.adb (Compilation_Errors): Do not consider info messages
1810         as suitable warnings when warnings must be treated as errors.
1811         * sem_ch7.adb (Analyze_Package_Specification): Do not consider
1812         internally-generated packages when outputting completion
1813         information.
1814         * errout.adb (Output_Messages): Do not consider info messages as
1815         suitable warnings when warnings must be treated as errors.
1816         * errutil.adb (Finalize): Do not consider info messages as
1817         suitable warnings when warnings must be treated as errors.
1819 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
1821         * warnsw.ads: Minor fix for incorrect wording in comment.
1823 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
1825         * sem_res.adb (In_Instance_Code): New predicate in
1826         Valid_Conversion, to determine whether a type conversion appears
1827         as (or within) an actual for a formal object.  Type conversions
1828         in instances are not rechecked in Valid_Conversion because
1829         visibility changes between generic location andi instance may
1830         lead to spurious errors, but conversions within an actual must be
1831         fully checked, and they are not fully resolved when pre-analyzing
1832         the actuals.
1834 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
1836         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
1837         New_Copy_Tree instead of Relocate_Node as any subsequent copies
1838         of the relocated node will have mangled Parent pointers.
1839         * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
1840         tables used in conjunction with entity and itype replication.
1841         (Visit_Entity): Rewrite the restriction on which entities
1842         require duplication.  The restriction now includes all types.
1844 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
1846         * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
1847         a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
1848         a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
1849         cleanups.
1851 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
1853         * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
1854         gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
1856 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
1858         * exp_util.adb: Minor reformatting.
1860 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
1862         * sem_ch4.adb: Fix copy/pasto.
1864 2017-04-27  Tristan Gingold  <gingold@adacore.com>
1866         * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
1867         raise-gcc.c. Fix include search path for raise-gcc.c
1869 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
1871         * fe.h (Warn_On_Questionable_Layout): Declare.
1872         * warnsw.ads (Warn_On_Record_Holes): Move down.
1873         (Warn_On_Questionable_Layout): New boolean variable.
1874         (Warning_Record): Add Warn_On_Questionable_Layout field.
1875         * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
1876         (Restore_Warnings): Likewise.
1877         (Save_Warnings): Likewise.
1878         (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
1879         * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
1880         components_to_record.
1881         (gnu_field_to_gnat): New function.
1882         (warn_on_field_placement): Likewise.
1883         (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
1884         parameters.  Rename local variables and adjust recursive call.
1885         Rework final scan of the field list and implement warnings on the
1886         problematic placement of specific sorts of fields.
1888 2017-04-27  Bob Duff  <duff@adacore.com>
1890         * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
1891         * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
1892         * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
1893         * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
1894         * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
1895         * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
1896         For efficiency, cache results of Is_Internal_File_Name and
1897         Is_Predefined_File_Name in the Units table. This avoids a lot
1898         of repeated text processing.
1900 2017-04-27  Emmanuel Briot  <briot@adacore.com>
1902         * g-comlin.adb (Sort_Sections): remove useless test.
1904 2017-04-27  Claire Dross  <dross@adacore.com>
1906         * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
1907         allow the use of regular equality over elements in contracts.
1908         (Formal_Model): Ghost package containing model functions that are
1909         used in subprogram contracts.
1910         (Current_To_Last): Removed, model functions should be used instead.
1911         (First_To_Previous): Removed, model functions should be used instead.
1912         (Strict_Equal): Removed, model functions should be used instead.
1913         (No_Overlap): Removed, model functions should be used instead.
1914         (Equivalent_Keys): Functions over cursors are removed. They were
1915         awkward with explicit container parameters.
1916         * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
1917         allow the use of regular equality over elements in contracts.
1918         (Formal_Model): Ghost package containing model functions that
1919         are used in subprogram contracts.
1920         (Current_To_Last): Removed, model functions should be used instead.
1921         (First_To_Previous): Removed, model functions should be used instead.
1922         (Strict_Equal): Removed, model functions should be used instead.
1923         (No_Overlap): Removed, model functions should be used instead.
1925 2017-04-27  Yannick Moy  <moy@adacore.com>
1927         * gnat1drv.adb: Code cleanup.
1929 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
1931         * exp_util.adb (Replace_Entity): The prefix of a 'Result
1932         attribute reference in a post- condition is the subprogram to
1933         which the condition applies. If the condition is inherited
1934         by a type extension, the prefix becomes a reference to the
1935         inherited operation, but there is no need to create a wrapper
1936         for this operation, because 'Result is expanded independently
1937         when elaborating the postconditions.
1939 2017-04-27  Bob Duff  <duff@adacore.com>
1941         * sinput.adb: Minor code cleanup.
1942         * namet.adb (Append): Create faster versions of
1943         Append(String) and Append(Name_Id) by using slice assignment
1944         instead of loops.
1945         * sem_util.adb (In_Instance): Speed this up by removing
1946         unnecessary tests; Is_Generic_Instance is defined for all
1947         entities.
1948         * sem_util.ads, sem_util.adb (In_Parameter_Specification):
1949         Remove unused function.
1950         * alloc.ads (Nodes_Initial): Use a much larger value, because
1951         the compiler was spending a lot of time copying the nodes table
1952         when it grows. This number was chosen in 1996, so is rather out
1953         of date with current memory sizes. Anyway, it's virtual memory.
1954         Get rid of Orig_Nodes_...; use Node_... instead.
1955         * atree.adb (Lock): Do not release the Nodes tables; it's a
1956         waste of time.
1957         Orig_Nodes_ ==> Nodes_
1958         * nlists.adb: Orig_Nodes_ ==> Nodes_
1959         * g-table.adb: Remove unused "with" clause.
1960         * g-table.ads, table.ads: Remove Big_Table_Type, which should
1961         not be used by clients.
1962         * g-dyntab.adb (Last_Allocated): New function
1963         to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
1965 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1967         * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
1968         check.
1969         (Subtypes_Statically_Match): Remove duplicate check.
1970         * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
1972 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1974         * exp_aggr.adb (Replace_Type): Remove the special processing
1975         for selected components.
1976         * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
1977         processing for attributes Fixed_Value and Integer_Value.
1978         * exp_util.adb (Side_Effect_Free): Merge the processing for
1979         qualified expressions, type conversions, and unchecked type
1980         conversions.
1981         * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
1982         and Optional.
1983         * par-ch3.adb (P_Declarative_Items): Merge the processing for
1984         tokens function, not, overriding, and procedure.
1985         * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
1986         for qualified expressions, type conversions, and unchecked
1987         type conversions.
1988         * sem_util.adb (Compile_Time_Constraint_Error): Merge the
1989         processing for Ada 83 and instances.
1990         (Object_Access_Level): Merge the processing for indexed components
1991         and selected components.
1992         * uname.adb (Add_Node_Name): Merge the processing for stubs.
1994 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
1996         * checks.adb (Install_Primitive_Elaboration_Check):
1997         Do not generate the check when restriction No_Elaboration_Code
1998         is in effect.
2000 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2002         * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
2003         of Expand_Dispatching_Call. If the denoted subprogram has a
2004         class-wide precondition, this is the only precondition that
2005         applies to the call, rather that the class-wide preconditions
2006         that may apply to the body that is executed. (This is specified
2007         in AI12-0195).
2009 2017-04-27  Yannick Moy  <moy@adacore.com>
2011         * gnat1drv.adb (Adjust_Global_Switches): Issue
2012         a warning in GNATprove mode if the runtime library does not
2013         support IEEE-754 floats.
2015 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2017         * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
2018         is itself inherited it does not carry any contract information,
2019         so examine its parent operation which is its Alias.
2021 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2023         * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
2024         prefix can be an object reference in which case Obj'Image (X)
2025         can only be interpreted as an indexing of the parameterless
2026         version of the attribute.
2027         * par-ch4.adb (P_Name): An attribute reference can be the prefix of
2028         an indexing or a slice operation if the attribute does not require
2029         parameters. In Ada2012 'Image also belongs in this category,
2030         and A'Image (lo .. hi) is legal and must be parsed as a slice.
2032 2017-04-27  Yannick Moy  <moy@adacore.com>
2034         * exp_ch4.adb: Minor reformatting.
2035         * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
2036         disable the CodePeer and C generation modes. Similar to the
2037         opposite actions done in CodePeer mode.
2039 2017-04-27  Yannick Moy  <moy@adacore.com>
2041         * sem_res.adb: Remove duplicate code.
2042         * sem_attr.adb: Delete duplicate code.
2044 2017-04-27  Bob Duff  <duff@adacore.com>
2046         * g-dyntab.adb: Reduce the amount of copying in
2047         Release. No need to copy items past Last.
2049 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2051         * checks.adb Add with and use clauses for Sem_Disp.
2052         (Install_Primitive_Elaboration_Check): New routine.
2053         * checks.ads (Install_Primitive_Elaboration_Check): New routine.
2054         * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
2055         processing of 'Elaborated.
2056         * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
2057         elaboration check.
2059 2017-04-27  Bob Duff  <duff@adacore.com>
2061         * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
2062         If the table grows and then shrinks back to empty, we won't necessarily
2063         point back to the empty array. Code cleanups.
2064         * sinput.ads: Add 'Base to Size clause to match the declared
2065         component subtypes.
2067 2017-04-27  Claire Dross  <dross@adacore.com>
2069         * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
2070         allow the use of regular equality over elements in contracts.
2071         (Formal_Model): Ghost package containing model functions that
2072         are used in subprogram contracts.
2073         (Current_To_Last): Removed, model functions should be used instead.
2074         (First_To_Previous): Removed, model functions should be used instead.
2075         (Strict_Equal): Removed, model functions should be used instead.
2076         (No_Overlap): Removed, model functions should be used instead.
2077         * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
2078         Boolean generic parameter to disable contracts for equivalence
2079         between keys.
2080         (Witness): Create a witness of a key that is used for handling of
2081         equivalence between keys.
2082         (Has_Witness): Check whether a witness is contained in a map.
2083         (W_Get): Get the element associated to a witness.
2084         (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
2085         directly.
2086         * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
2087         Boolean generic parameter to disable contracts for equivalence
2088         between keys.
2089         * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
2090         of equivalence on functional maps.
2091         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
2092         of equivalence on functional maps.
2094 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2096         * exp_ch9.adb (Expand_Entry_Barrier): Code
2097         cleanup. Do not perform the optimization which removes the
2098         declarations of the discriminant and component renamings when
2099         validity checks on operands and attributes are in effect.
2101 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2103         * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
2104         freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
2105         a-cfhama.ads, a-cofove.ads: Minor reformatting.
2107 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2109         * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
2110         pointer dereference.
2111         * g-spipat.adb (Dump): Code clean up. Protect against a possible
2112         null pointer dereference.
2114 2017-04-27  Bob Duff  <duff@adacore.com>
2116         * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
2117         Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
2118         Free renames Init, since they do the same thing.
2119         * g-table.ads: Default for Table_Low_Bound.
2120         * table.ads: Default for Table_Low_Bound, Table_Initial, and
2121         Table_Increment.
2123 2017-04-27  Bob Duff  <duff@adacore.com>
2125         * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
2126         can reallocate.
2127         * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
2128         * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
2129         Reorder code so that above assertions do not fail.
2130         * table.ads: Remove obsolete comment on Locked.
2132 2017-04-27  Claire Dross  <dross@adacore.com>
2134         * a-cfdlli.ads: Code cleanup.
2136 2017-04-27  Yannick Moy  <moy@adacore.com>
2138         * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
2139         when needed for proof.  (Expand_SPARK): Call the new procedure.
2140         * exp_util.ads Fix typo.
2142 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2144         * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
2145         fixes.
2147 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2149         * sem_elab.adb Add new type Visited_Element
2150         and update the contents of table Elab_Visited.  Various code clean up.
2151         (Check_Elab_Call): Determine whether a prior call to
2152         the same subprogram was already examined within the same context.
2153         (Check_Internal_Call_Continue): Register the subprogram being
2154         called as examined within a particular context. Do not suppress
2155         elaboration warnings.
2157 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2159         * xoscons.adb, osint.ads: Minor reformatting.
2161 2017-04-27  Bob Duff  <duff@adacore.com>
2163         * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
2164         Table_Count_Type --> Table_Last_Type, because the name
2165         was confusing (a "count" usually starts at zero).  Add
2166         functionality supported or needed by other tables packages
2167         (Move, Release_Threshold).
2168         * g-table.ads, g-table.adb: This is now just a thin wrapper
2169         around g-dyntab.ads/g-dyntab.adb.  Add functionality supported
2170         or needed by other tables packages (Save, Restore).
2171         * table.ads, table.adb: This is now just a thin wrapper around
2172         * g-table.ads/g-table.adb.
2173         * namet.h, scos.h, uintp.h: These files are reaching into the
2174         private data of some instances of g-table, whose names changed,
2175         so the above change requires some adjustment here. It now uses
2176         public interfaces.
2178 2017-04-27  Bob Duff  <duff@adacore.com>
2180         * namet.adb, namet.ads: Minor: remove unused procedures.
2182 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
2184         * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
2185         (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
2186         Add pragma Warnings on Rtype variable in nested block.  *
2187         * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
2188         * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
2189         (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
2190         * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
2191         (Process_Component_List_For_Finalize): Initialize Counter_Id.
2192         (Build_Finalize_Statements): Initialize Bod_Stmts.
2193         * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
2195 2017-04-27  Claire Dross  <dross@adacore.com>
2197         * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
2198         allow the use of regular equality over elements in contracts.
2199         (Formal_Model): Ghost package containing model functions that are
2200         used in subprogram contracts.
2201         (Current_To_Last): Removed, model
2202         functions should be used instead.
2203         (First_To_Previous): Removed, model functions should be used instead.
2204         (Strict_Equal): Removed, model functions should be used instead.
2205         (No_Overlap): Removed, model functions should be used instead.
2206         (Equivalent_Keys): Functions over cursors are removed. They were
2207         awkward with explicit container parameters.
2208         * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
2209         (proof only) procedure to help GNATprove when equivalence over
2210         keys is not equality.
2212 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2214         * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
2215         sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
2216         Minor reformatting and code cleanups.
2218 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2220         * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
2221         subsidiary of Check_Inherited_Conditions, to build pragmas for an
2222         operation whose ancestor has classwide pre/postconditions. This
2223         is used both to check the legality of the inheritance in Ada
2224         and in SPARK, and to determine whether a wrapper is needed for
2225         an inherited operation.
2226         * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
2227         Improve placement of error message for inherited classwide
2228         conditions that become illegal on type derivation.
2230 2017-04-27  Yannick Moy  <moy@adacore.com>
2232         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
2233         SPARK_Mode from context on generic package.
2234         * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
2235         useless test.
2237 2017-04-27  Claire Dross  <dross@adacore.com>
2239         * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
2240         overflows in computations.
2241         * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
2242         overflows in computations.
2243         (Insert): Rewrite precondition to avoid overflows in computations.
2244         * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
2245         overflows in computations.
2246         (Insert): Rewrite precondition to avoid overflows in computations.
2248 2017-04-27  Steve Baird  <baird@adacore.com>
2250         * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
2251         flag when it is declared in order to avoid confusing CodePeer about
2252         the possibility of an uninitialized variable read.
2254 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2256         * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
2257         no dimensionality error if the subtype of the expression is
2258         identical to the nominal subtype in the declaration, even though
2259         the expression itself may have been constant-folded and lack a
2260         dimension vector.
2261         * sem_dim.ads: Add comments on setting of dimension vectors and
2262         its interaction with node rewritings and side-effect removal.
2264 2017-04-27  Bob Duff  <duff@adacore.com>
2266         * debug.adb: Minor comment correction.
2267         * sem_dim.ads: Minor reformatting and typo fixes.
2269 2017-04-27  Bob Duff  <duff@adacore.com>
2271         * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
2272         Last of the tables via function calls, rather than relying on layout
2273         of data structures.
2275 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2277         * exp_util.adb: No wrapper in GNATprove mode.
2279 2017-04-27  Yannick Moy  <moy@adacore.com>
2281         * sem_res.adb (Resolve_Comparison_Op): Always
2282         evaluate comparisons between values of universal types.
2284 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2286         * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
2287         an elaboration counter nor a check when in GNATprove mode.
2288         * sem_util.adb (Build_Elaboration_Entity): Do not create an
2289         elaboration counter when in GNATprove mode.
2291 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2293         * freeze.adb: copy-paste typo.
2295 2017-04-27  Yannick Moy  <moy@adacore.com>
2297         * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
2298         Use correct test to detect call in GNATprove mode instead of
2299         compilation.
2301 2017-04-27  Claire Dross  <dross@adacore.com>
2303         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
2304         New property function expressing that the element of a
2305         sequence are contained in the union of two sequences.
2306         (Formal_Model.M_Elements_Included): New property function
2307         expressing that the element of a sequence are another sequence.
2308         (Generic_Sorting): Use new property functions to state that
2309         elements are preserved by Sort and Merge.
2310         * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
2311         allow the use of regular equality over elements in contracts.
2312         (Formal_Model): Ghost package containing model functions
2313         that are used in subprogram contracts.  (Capacity):
2314         On unbounded containers, return the maximal capacity.
2315         (Current_To_Last): Removed, model functions should be used instead.
2316         (First_To_Previous): Removed, model functions should be used instead.
2317         (Append): Default parameter value replaced
2318         by new wrapper to allow more precise contracts.
2319         (Insert): Subprogram restored, it seems it was useful to users even if
2320         it is inefficient.
2321         (Delete): Subprogram restored, it seems it was useful to users even if
2322         it is inefficient.
2323         (Prepend): Subprogram restored, it seems it was useful to users even
2324         if it is inefficient.
2325         (Delete_First): Subprogram restored, it seems it
2326         was useful to users even if it is inefficient.  (Delete_Last):
2327         Default parameter value replaced by new wrapper to allow more
2328         precise contracts.
2329         (Generic_Sorting.Merge): Subprogram restored.
2330         * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
2331         allow the use of regular equality over elements in contracts.
2332         (Formal_Model): Ghost package containing model functions
2333         that are used in subprogram contracts.  (Capacity):
2334         On unbounded containers, return the maximal capacity.
2335         (Current_To_Last): Removed, model functions should be used
2336         instead.
2337         (First_To_Previous): Removed, model functions should be used instead.
2338         (Append): Default parameter value replaced
2339         by new wrapper to allow more precise contracts.
2340         (Insert): Subprogram restored, it seems it was useful to users even if
2341         it is inefficient.
2342         (Delete): Subprogram restored, it seems it was useful to users even if
2343         it is inefficient.
2344         (Prepend): Subprogram restored, it seems it was useful to users even
2345         if it is inefficient.
2346         (Delete_First): Subprogram restored, it seems it
2347         was useful to users even if it is inefficient.  (Delete_Last):
2348         Default parameter value replaced by new wrapper to allow more
2349         precise contracts.
2350         (Generic_Sorting.Merge): Subprogram restored.
2351         (Vector): Do not reuse formal vectors, as it is no longer possible
2352         to supply them with an equality function over elements.
2354 2017-04-27  Bob Duff  <duff@adacore.com>
2356         * g-dyntab.adb (Release): When allocating the new
2357         table, use the correct slice of the old table to initialize it.
2359 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
2361         * einfo.ads: Minor fixes in comments.
2363 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2365         * sem_prag.adb: disable clones in SPARK_Mode.
2367 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2369         * sem_util.ads, contracts.adb: Minor reformatting.
2371 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2373         * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
2374         Build body of subprogram that has a class-wide condition that
2375         contains calls to other primitives.
2376         (Build_Class_Wide_Clone_Call); Build a call to the common
2377         class-wide clone of a subprogram with classwide conditions. The
2378         body of the subprogram becomes a wrapper for a call to the
2379         clone. The inherited operation becomes a similar wrapper to which
2380         modified conditions apply, and the call to the clone includes
2381         the proper conversion in a call the parent operation.
2382         (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
2383         subprogram that has a classwide condition that contains calls to
2384         other primitives, build an internal subprogram that is invoked
2385         through a type-specific wrapper for all inherited subprograms
2386         that may have a modified condition.
2387         * sem_prag.adb (Check_References): If subprogram has a classwide
2388         condition, create entity for corresponding clone, to be invoked
2389         through wrapper subprograns.
2390         (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
2391         message about placement if pragma isi internally generated.
2392         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
2393         a classwide clone, build body of clone as copy of original body,
2394         and rewrite original body as a wrapper as a wrapper for a call to
2395         the clone, so that it incorporates the original pre/postconditions
2396         of the subprogram.
2397         * freeze.adb (Check_Inherited_Conditions): For an inherited
2398         subprogram that inherits a classwide condition, build spec and
2399         body of corresponding wrapper so that call to inherited operation
2400         gets the modified conditions.
2401         * contracts.adb (Analyze_Contracts): If analysis of classwide
2402         condition has created a clone for a primitive operation, analyze
2403         declaration of clone.
2405 2017-04-27  Steve Baird  <baird@adacore.com>
2407         * exp_util.adb (Build_Allocate_Deallocate_Proc):
2408         Add "Suppress => All_Checks" to avoid generating unnecessary
2409         checks.
2411 2017-04-27  Yannick Moy  <moy@adacore.com>
2413         * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
2414         * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
2415         inlining body in GNATprove mode when switch -gnatdm used.
2416         * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
2417         in GNATprove mode when switch -gnatdm used.
2419 2017-04-27  Arnaud Charlet  <charlet@adacore.com>
2421         * sem_ch13.adb (Analyze_Attribute_Definition_Clause
2422         [Attribute_Address]): Call Set_Address_Taken when ignoring rep
2423         clauses, so that we keep an indication of the address clause
2424         before removing it from the tree.
2426 2017-04-27  Yannick Moy  <moy@adacore.com>
2428         * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
2429         of expression being qualified, when not an object name, or else
2430         evaluate the underlying name.
2432 2017-04-27  Jerome Lambourg  <lambourg@adacore.com>
2434         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
2436 2017-04-27  Justin Squirek  <squirek@adacore.com>
2438         * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
2439         Process_Component_List_For_Finalization as a local variable.
2440         (Process_Component_For_Finalize): Add an extra parameter to avoid
2441         global references.
2442         (Process_Component_List_For_Finalization): Correct calls to
2443         Process_Component_For_Finalize to take Num_Comps as a parameter.
2445 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2447         * sem_ch8.adb (Find_Direct_Name): Account for the case where
2448         a use-visible entity is defined within a nested scope of an
2449         instance when giving priority to entities which were visible in
2450         the original generic.
2451         * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
2453 2017-04-27  Tristan Gingold  <gingold@adacore.com>
2455         * raise-gcc.c: Don't use unwind.h while compiling
2456         for the frontend, but mimic host behavior.
2458 2017-04-27  Javier Miranda  <miranda@adacore.com>
2460         * sem_ch3.adb (Build_Discriminated_Subtype):
2461         Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
2463 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2465         * sem_prag.adb (Analyze_Global_Item):
2466         Do not consider discriminants because they are not "entire
2467         objects". Remove the discriminant-related checks because they are
2468         obsolete.
2469         (Analyze_Input_Output): Do not consider discriminants
2470         because they are not "entire objects".
2472 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2474         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
2475         perform check if the current scope does not come from source,
2476         as is the case for a rewritten task body, because check has
2477         been performed already, and may not be doable because of changed
2478         visibility.
2480 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2482         * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
2483         a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
2484         Minor reformatting.
2486 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2488         * sem_ch4.adb (Analyze_Call): If the return type of a function
2489         is incomplete in an context in which the full view is available,
2490         replace the type of the call by the full view, to prevent spurious
2491         type errors.
2492         * exp_disp.adb (Check_Premature_Freezing): Disable check on an
2493         abstract subprogram so that compiler does not reject a parameter
2494         of a primitive operation of a tagged type being frozen, when
2495         the untagged type of that parameter cannot be frozen.
2497 2017-04-27  Bob Duff  <duff@adacore.com>
2499         * sem_attr.adb (Compute_Type_Key): Don't walk
2500         representation items for irrelevant types, which could be in a
2501         different source file.
2503 2017-04-27  Steve Baird  <baird@adacore.com>
2505         * exp_attr.adb (Expand_N_Attribute_Reference):
2506         Don't expand Image, Wide_Image, Wide_Wide_Image attributes
2507         for CodePeer.
2509 2017-04-27  Yannick Moy  <moy@adacore.com>
2511         * exp_unst.ads: Fix typos in comments.
2513 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2515         * sem_eval.adb (Choice_Matches): Handle properly a real literal
2516         whose type has a defined static predicate.
2518 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2520         * exp_ch4.adb (Insert_Dereference_Action):
2521         Do not adjust the address of a controlled object when the
2522         associated access type is subject to pragma No_Heap_Finalization.
2523         Code reformatting.
2525 2017-04-27  Pierre-Marie de Rodat  <derodat@adacore.com>
2527         * gcc-interface/utils.c (gnat_type_for_size): Set
2528         TYPE_ARTIFICIAL on created types.
2530 2017-04-27  Claire Dross  <dross@adacore.com>
2532         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
2533         modifications in functional containers.
2534         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
2535         to improve readablity. Subprograms are separated between basic
2536         operations, constructors and properties. Universally quantified
2537         formulas in contracts are factorized in independant functions
2538         with a name and a comment.  Names of parameters are improved.
2540 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2542         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
2544 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2546         * sem_res.adb (Resolve_Type_Conversion): Do not
2547         install a predicate check here since this is already done during
2548         the expansion phase. Verify whether the operand satisfies the
2549         static predicate (if any) of the target type.
2550         * sem_ch3.adb (Analyze_Object_Declaration): Do
2551         not install a predicate check if the object is initialized by
2552         means of a type conversion because the conversion is subjected
2553         to the same check.
2555 2017-04-27  Tristan Gingold  <gingold@adacore.com>
2557         * raise.c (__gnat_builtin_longjmp): Remove.
2558         (__gnat_bracktrace):
2559         Add a dummy definition for the compiler (__gnat_eh_personality,
2560         __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
2561         __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
2562         __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
2563         * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
2564         * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
2565         and a-except-2005.adb.
2566         * raise-gcc.c: Allow build in compiler, compiled as a C++
2567         file.
2568         (__gnat_Unwind_ForcedUnwind): Adjust prototype.
2569         (db): Constify msg_format.
2570         (get_call_site_action_for): Don't use void arithmetic.
2571         * system.ads (Frontend_Exceptions): Set to False.
2572         (ZCX_By_Default): Set to True.
2573         (GCC_ZC_Support): Set to True.
2574         * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
2575         a-except.ad[sb].
2576         * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
2577         in gnat1 and gnatbind.
2578         * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
2579         s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
2580         * s-excmac.ads, s-excmac.adb: Copy of variants.
2581         * a-except.o: Adjust preequisites.
2582         Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
2584 2017-04-27  Claire Dross  <dross@adacore.com>
2586         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
2587         modifications in functional containers.
2588         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
2589         to improve readablity. Subprograms are separated between basic
2590         operations, constructors and properties. Universally quantified
2591         formulas in contracts are factorized in independant functions
2592         with a name and a comment.  Names of parameters are improved.
2594 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2596         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
2598 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2600         * sem_res.adb (Resolve_Type_Conversion): Do not
2601         install a predicate check here since this is already done during
2602         the expansion phase. Verify whether the operand satisfies the
2603         static predicate (if any) of the target type.
2604         * sem_ch3.adb (Analyze_Object_Declaration): Do
2605         not install a predicate check if the object is initialized by
2606         means of a type conversion because the conversion is subjected
2607         to the same check.
2609 2017-04-27  Tristan Gingold  <gingold@adacore.com>
2611         * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
2612         replaced by their variants).
2614 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2616         * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
2617         cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
2618         a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
2620 2017-04-27  Tristan Gingold  <gingold@adacore.com>
2622         * s-excmac-gcc.ads, s-excmac-gcc.adb,
2623         s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
2624         Ada95.
2626 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2628         * exp_ch7.adb (Establish_Transient_Scope): Rewrite
2629         the loop which detects potential enclosing transient scopes. The
2630         loop now terminates much earlier as transient scopes are bounded
2631         by packages and subprograms.
2633 2017-04-27  Claire Dross  <dross@adacore.com>
2635         * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
2636         allow the use of regular equality over elements in contracts.
2637         (Cursor): Type is now public so that it can be used in
2638         model functions.
2639         (Formal_Model): Ghost package containing
2640         model functions that are used in subprogram contracts.
2641         (Current_To_Last): Removed, model functions should be used
2642         instead.
2643         (First_To_Previous): Removed, model functions should
2644         be used instead.
2645         (Strict_Equal): Removed, model functions
2646         should be used instead.
2647         (Append): Default parameter value
2648         replaced by new wrapper to allow more precise contracts.
2649         (Insert): Default parameter value replaced by new wrapper to
2650         allow more precise contracts.
2651         (Delete): Default parameter
2652         value replaced by new wrapper to allow more precise contracts.
2653         (Prepend): Default parameter value replaced by new wrapper to
2654         allow more precise contracts.
2655         (Delete_First): Default parameter
2656         value replaced by new wrapper to allow more precise contracts.
2657         (Delete_Last): Default parameter value replaced by new wrapper
2658         to allow more precise contracts.
2660 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2662         * exp_spark.adb (Expand_SPARK): Perform specialized expansion
2663         for object declarations.
2664         (Expand_SPARK_N_Object_Declaration): New routine.
2665         * sem_elab.adb (Check_A_Call): Include calls to the
2666         Default_Initial_Condition procedure of a type under the SPARK
2667         elaboration checks umbrella.
2669 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2671         * sem.adb (Analyze): Diagnose an illegal iterated component
2672         association.
2673         * sem_util.ads, sem_util.adb
2674         (Diagnose_Iterated_Component_Association): New routine.
2676 2017-04-27  Bob Duff  <duff@adacore.com>
2678         * adaint.c (__gnat_get_current_dir): Return 0 in length if
2679         getcwd fails.
2680         * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
2681         exception if getcwd failed.
2683 2017-04-27  Yannick Moy  <moy@adacore.com>
2685         * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
2686         entities with special prefix.
2688 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2690         * debug.adb Change the documentation of switch -gnatd.s.
2691         * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
2692         to manage the secondary stack when an enclosing scope already
2693         performs this functionality (aka relaxed management). Switch
2694         -gnatd.s may be used to force strict management in which case
2695         the block will manage the secondary stack unconditionally. Add
2696         a guard to stop the traversal when encountering a package or a
2697         subprogram scope.
2699 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2701         * sem_res.adb (Resolve_Call): Refine further the handling of
2702         limited views of return types in function calls. If the function
2703         that returns a limited view appears in the current unit,
2704         we do not replace its type by the non-limited view because
2705         this transformation is performed int the back-end. However,
2706         the type of the call itself must be the non-limited view, to
2707         prevent spurious resolution errors.
2709 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2711         * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
2712         Removed, proposed implementation using generics for class-wide
2713         preconditions proved impractical.
2714         (Class_Wide_Clone): New attribute of subprogram. Designates
2715         subprogram created for primitive operations with class-wide
2716         pre/postconditions that contain calls to other primitives. The
2717         clone holds the body of the original primitive, but the
2718         pre/postonditions do not apply to it. The original body is
2719         rewritten as a wrapper for a call to the clone.
2720         (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
2721         the flag is set, no code for the corresponding pre/postconditions
2722         is inserted into its body.
2724 2017-04-27  Bob Duff  <duff@adacore.com>
2726         * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
2727         Scalar_Storage_Order if -gnatI is given.
2728         * sem_prag.adb (Analyze_Pragma): Ignore
2729         Default_Scalar_Storage_Order if -gnatI is given.
2731 2017-04-27  Claire Dross  <dross@adacore.com>
2733         * a-cofuba.ads (Add): Take as an additional input parameter
2734         the position where the element should be inserted.
2735         (Remove): New function that removes an element from the container.
2736         * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
2737         * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
2738         (Remove): New function that removes an element from a set.
2739         * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
2740         (Remove): New function that removes an element from a sequence.
2741         (Insert): New function that adds anywhere in a sequence.
2743 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2745         * checks.adb (Generate_Range_Check): Revert previous change.
2747 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2749         * sem_util.adb: Minor reformatting/rewording.
2751 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2753         * lib-xref.adb (Generate_Reference): The use
2754         of attribute 'Result is not considered a violation of pragma
2755         Unreferenced.
2757 2017-04-27  Justin Squirek  <squirek@adacore.com>
2759         * cstand.adb (Create_Standard): Correctly set
2760         Directly_Designated_Type for Any_Access.
2761         * sem_type.adb (Covers): Minor grammar fixes.
2763 2017-04-27  Bob Duff  <duff@adacore.com>
2765         * sem_attr.adb: Minor cleanup.
2767 2017-04-27  Claire Dross  <dross@adacore.com>
2769         * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
2770         private child of Ada.Containers used to implement all functional
2771         containers.
2772         * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
2773         child of Ada.Containers. It provides functional indefinite unbounded
2774         maps which can be used as high level models for specification
2775         of data structures.
2776         * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
2777         child of Ada.Containers. It provides functional indefinite unbounded
2778         sets which can be used as high level models for specification
2779         of data structures.
2780         * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
2781         child of Ada.Containers.  It provides functional indefinite unbounded
2782         vectors which can be used as high level models for specification
2783         of data structures.
2784         * Makefile.rtl: Add new packages.
2785         * impunit.adb: Add new packages.
2787 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2789         * sem_ch4.adb: Minor reformatting.
2791 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2793         * sem_ch12.adb (Analyze_Associations): minor reformatting.
2794         (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
2795         point type actual that has user-defined arithmetic primitives,
2796         when there is a previous actual for a formal package that defines
2797         a fixed-point type with the parent user-defined operator.
2799 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2801         * checks.adb (Generate_Range_Check): Reinstate part of previous change.
2802         * sem_attr.adb (Resolve_Attribute): Generate a range check when
2803         the component type allows range checks.
2805 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2807         * sem_aux.adb (Is_Generic_Formal): Use original node to locate
2808         corresponding declaration, because formal derived types are
2809         rewritten as private extensions.
2811 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
2813         * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
2814         dimensions of operands if node has been analyzed already, because
2815         previous analysis and dimension checking will have removed the
2816         dimension information from the operands.
2818 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2820         * debug.adb: Document the use of switch -gnatd.s.
2821         * einfo.ads Update the documentation on attribute
2822         Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
2823         the uses of these attributes from certain entities.
2824         * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
2825         which determines whether the block should continue to manage
2826         the secondary stack.
2827         (Manages_Sec_Stack): New routine.
2829 2017-04-27  Bob Duff  <duff@adacore.com>
2831         * atree.ads: Minor edit.
2833 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
2835         * sinfo.ads: Update the section on Ghost mode. Add
2836         a section on SPARK mode. Update the placement of section on
2837         expression functions.
2839 2017-04-27  Bob Duff  <duff@adacore.com>
2841         * sinput.adb (Get_Source_File_Index): Don't
2842         assert that S is in the right range in the case where this is
2843         a .dg file under construction.
2845 2017-04-27  Yannick Moy  <moy@adacore.com>
2847         * sem_util.adb (Check_Result_And_Post_State):
2848         Handle more precisely each conjunct in expressions formed by
2849         and'ing sub-expressions.
2851 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
2853         * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
2855 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2857         * gnat_rm.texi, gnat_ugn.texi,
2858         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
2859         doc/gnat_ugn/platform_specific_information.rst,
2860         doc/gnat_ugn/gnat_and_program_execution.rst,
2861         doc/gnat_ugn/gnat_utility_programs.rst,
2862         doc/gnat_ugn/the_gnat_compilation_model.rst,
2863         doc/gnat_rm/implementation_defined_attributes.rst,
2864         doc/gnat_rm/the_gnat_library.rst,
2865         doc/gnat_rm/implementation_defined_pragmas.rst,
2866         doc/gnat_rm/representation_clauses_and_pragmas.rst,
2867         doc/gnat_rm/implementation_of_specific_ada_features.rst,
2868         doc/gnat_rm/implementation_defined_aspects.rst,
2869         doc/gnat_rm/implementation_defined_characteristics.rst: Update
2870         documentation.
2872 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2874         * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
2875         generating C code on complex case expressions.
2877 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2879         * sem_prag.adb (Analyze_Pragma): Generate a warning instead
2880         of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
2881         * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
2882         Ada_2012 instead of Ada_2005 to be compatible with the above
2883         change.
2884         * bindgen.adb: Silence new warning on pragma Ada_95.
2886 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2888         * checks.adb (Generate_Range_Check): Revert part of previous change.
2890 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2892         * sem_ch4.adb (Try_Container_Indexing): Handle properly a
2893         container indexing operation that appears as a an actual in a
2894         parameter association in a procedure call.
2896 2017-04-25  Olivier Ramonat  <ramonat@adacore.com>
2898         * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
2899         Fix spelling mistakes.
2901 2017-04-25  Bob Duff  <duff@adacore.com>
2903         * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
2904         * sinput-p.adb: Use regular fat pointers, with bounds checking,
2905         for source buffers.  Fix misc obscure bugs.
2906         * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
2907         checking, for source buffers.  Modify representation clause for
2908         Source_File_Record as appropriate.  Move Source_File_Index_Table
2909         from spec to body, because it is not used outside the body.
2910         Move Set_Source_File_Index_Table into the private part, because
2911         it is used only in the body and in children.  Use trickery to
2912         modify the dope in the generic instantiation case.  It's ugly,
2913         but not as ugly as the previous method.  Fix documentation.
2914         Remove obsolete code.
2915         * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
2916         indexing in source buffers.
2917         * fmap.adb: Avoid conversions from one string type to another.
2918         Remove a use of global name buffer.
2919         * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
2920         fixes.
2922 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2924         * exp_util.adb, exp_ch4.adb: Minor reformatting.
2926 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2928         * checks.adb: Code clean up in various routines.
2929         (Generate_Range_Check): Do not generate a range check when the
2930         expander is not active or when index/range checks are suppressed
2931         on the target type.
2932         (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
2933         Remove variants that include a Supress parameter. These routines
2934         are never used, and were introduced before the current scope-based
2935         check suppression method.
2937 2017-04-25  Vasiliy Fofanov  <fofanov@adacore.com>
2939         * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
2940         code and some subprogram calls that are now noop.
2942 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
2944         * exp_ch4.adb (Expand_N_Case_Expression): Take
2945         Minimize_Expression_With_Actions into account when possible.
2947 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
2949         * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
2950         (Known_Null): Moved to Sem_Util.
2951         * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
2952         (Known_Null): Moved to Sem_Util.
2953         * sem_util.adb Add new enumeration type Null_Status_Kind.
2954         (Known_Non_Null): Moved from Exp_Util. Most of the logic in
2955         this routine is now carried out by Null_Status.
2956         (Known_Null): Moved from Exp_Util. Most of the logic in this routine
2957         is now carried out by Null_Status.
2958         (Null_Status): New routine.
2959         * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
2960         (Known_Null): Moved from Exp_Util.
2962 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2964         * sem_ch6.adb (Analyze_Expression_Function): Do not report an
2965         error on the return type of an expression function that is a
2966         completion, if the type is derived from a generic formal type.
2968 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
2970         * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
2971         conversion are those of the target type.
2973 2017-04-25  Bob Duff  <duff@adacore.com>
2975         * a-clrefi.adb: Minor cleanup.
2977 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
2979         * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
2981 2017-04-25  Bob Duff  <duff@adacore.com>
2983         * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
2984         types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
2985         errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
2986         scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
2987         the Internal_Source buffer. This removes the incorrect call to "="
2988         the customer noticed.
2989         Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
2990         eventually need to eliminate them altogether. Or else get rid
2991         of zero-origin addressing.
2993 2017-04-25  Claire Dross  <dross@adacore.com>
2995         * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
2996         function used in GNATprove to know if an expression contains
2997         non-dispatching calls on primitives of a tagged type.
2999 2017-04-25  Bob Duff  <duff@adacore.com>
3001         * rtsfind.adb (Initialize): Initialize
3002         First_Implicit_With. Building the compiler with Normalize_Scalars
3003         and validity checking finds this being used as an uninitialized
3004         variable.
3006 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3008         * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
3009         Add a warning about SPARK mode management. The routine now
3010         saves and restores both the mode and associated pragma.
3011         (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
3012         SPARK mode management. The routine now saves and restores both
3013         the mode and associated pragma.
3014         (Analyze_Object_Contract):
3015         Add a warning about SPARK mode management. The routine
3016         now saves and restores both the mode and associated pragma.
3017         (Analyze_Package_Body_Contract): Add a warning about SPARK mode
3018         management.  The routine now saves and restores both the mode
3019         and associated pragma.  (Analyze_Package_Contract): Add a warning
3020         about SPARK mode management. The routine now saves and restores
3021         both the mode and associated pragma.
3022         (Analyze_Task_Contract):
3023         Add a warning about SPARK mode management. The routine now saves
3024         and restores both the mode and associated pragma.
3025         * expander.adb (Expand): Change the way the Ghost mode is saved
3026         and restored.
3027         * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
3028         saved and restored.
3029         * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
3030         and restored.
3031         * exp_util.adb (Build_DIC_Procedure_Body):
3032         Change the way the Ghost mode is saved and restored.
3033         (Build_DIC_Procedure_Declaration): Change the way the Ghost
3034         mode is saved and restored.
3035         (Build_Invariant_Procedure_Body):
3036         Change the way the Ghost mode is saved and restored.
3037         (Build_Invariant_Procedure_Declaration): Change the way the Ghost
3038         mode is saved and restored.
3039         (Make_Predicate_Call): Change the
3040         way the Ghost mode is saved and restored.
3041         * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
3042         saved and restored.
3043         * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
3044         and its assignment.
3045         (Mark_And_Set_Ghost_Body): Remove parameter
3046         Mode and its assignment.
3047         (Mark_And_Set_Ghost_Completion):
3048         Remove parameter Mode and its assignment.
3049         (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
3050         assignment.
3051         (Mark_And_Set_Ghost_Instantiation): Remove parameter
3052         Mode and its assignment.
3053         (Mark_And_Set_Ghost_Procedure_Call):
3054         Remove parameter Mode and its assignment.
3055         (Set_Ghost_Mode):
3056         Remove parameter Mode and its assignment.
3057         * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
3058         and update the comment on usage.
3059         (Mark_And_Set_Ghost_Body):
3060         Remove parameter Mode and update the comment on usage.
3061         (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
3062         update the comment on usage.
3063         (Mark_And_Set_Ghost_Declaration):
3064         Remove parameter Mode and update the comment on usage.
3065         (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
3066         update the comment on usage.
3067         (Mark_And_Set_Ghost_Procedure_Call):
3068         Remove parameter Mode and update the comment on usage.
3069         (Set_Ghost_Mode): Remove parameter Mode and update the comment
3070         on usage.
3071         * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
3072         types.
3073         * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
3074         of obsolete field SPARK_Mode_Pragma.
3075         (Load_Main_Source): Remove
3076         the assignment of obsolete field SPARK_Mode_Pragma.
3077         (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
3078         * lib-writ.adb (Add_Preprocessing_Dependency): Remove
3079         the assignment of obsolete field SPARK_Mode_Pragma.
3080         (Ensure_System_Dependency): Remove the assignment of obsolete
3081         field SPARK_Mode_Pragma.
3082         * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
3083         mode management. Change the way Ghost and SPARK modes are saved
3084         and restored.
3085         * sem.adb (Analyze): Change the way the Ghost mode is saved
3086         and restored.
3087         * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
3088         Ghost mode is saved and restored.
3089         (Process_Full_View): Change
3090         the way the Ghost mode is saved and restored.
3091         * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
3092         mode is saved and restored.
3093         * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
3094         mode is saved and restored.
3095         (Analyze_Subprogram_Body_Helper):
3096         Change the way the Ghost mode is saved and restored.
3097         * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
3098         Ghost mode is saved and restored.
3099         * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
3100         management. Save the SPARK mode-related data prior to any changes
3101         to the scope stack and contexts. The mode is then reinstalled
3102         before the subunit is analyzed in order to restore the original
3103         view of the subunit.
3104         * sem_ch12.adb (Analyze_Package_Instantiation): Update the
3105         warning on region management.  Change the way the Ghost and
3106         SPARK modes are saved and restored.
3107         (Inline_Instance_Body):
3108         Add a warning about SPARK mode management. Code clean up.
3109         (Analyze_Subprogram_Instantiation): Update the warning on region
3110         management.  Change the way the Ghost and SPARK modes are saved
3111         and restored.
3112         (Instantiate_Package_Body): Update the warning
3113         on region management. Change the way the Ghost and SPARK modes
3114         are saved and restored.
3115         (Instantiate_Subprogram_Body): Update
3116         the warning on region management. Change the way the Ghost and
3117         SPARK modes are saved and restored.
3118         (Set_Instance_Env): Add a
3119         warning about SPARK mode management. Change the way SPARK mode
3120         is saved and restored.
3121         * sem_ch13.adb (Build_Predicate_Functions):
3122         Change the way the Ghost mode is saved and restored.
3123         (Build_Predicate_Function_Declaration): Change the way the Ghost
3124         mode is saved and restored.
3125         * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
3126         mode management. Change the way SPARK mode is saved and restored.
3127         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
3128         Change the way the Ghost mode is saved and restored.
3129         (Analyze_Initial_Condition_In_Decl_Part): Change the way
3130         the Ghost mode is saved and restored.
3131         (Analyze_Pragma):
3132         Change the way the Ghost mode is saved and restored.
3133         (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
3134         Ghost mode is saved and restored.
3135         * sem_util.adb (Install_SPARK_Mode): New routine.
3136         (Restore_SPARK_Mode): New routine.
3137         (Save_SPARK_Mode_And_Set): Removed.
3138         (Set_SPARK_Mode): New routine.
3139         * sem_util.ads (Install_SPARK_Mode): New routine.
3140         (Restore_SPARK_Mode): New routine.
3141         (Save_SPARK_Mode_And_Set): Removed.
3142         (Set_SPARK_Mode): New routine.
3144 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3146         * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
3147         to determine whether a type is declared in a local package that
3148         has not yet been frozen.
3149         * freeze.adb (Freeze_Before): Use new predicate to determine
3150         whether a local package must be installed on the scope stack
3151         in order to evaluate in the proper scope actions generated by
3152         aspect specifications, such as Predicate
3153         * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
3154         using new predicate.
3156 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3158         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
3159         comparisons between non- scalar expressions expressions because
3160         their values cannot be invalidated.
3161         * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
3162         comment on usage.
3164 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3166         * par_sco.adb: Minor reformatting.
3168 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3170         * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
3171         is a type from an unfrozen local package, install package to
3172         complete the analysis of delayed aspects of the type.
3174 2017-04-25  Tristan Gingold  <gingold@adacore.com>
3176         * bingen.adb (System_Version_Control_Used): New variable.
3177         (Resolve_Binder_Options): Set the above variable.
3178         (Gen_Output_File_Ada): Conditionally call Gen_Versions.
3179         (Gen_Elab_Order): Emit blank line before.
3181 2017-04-25  Justin Squirek  <squirek@adacore.com>
3183         * sem_cat.adb (Validate_RT_RAT_Component): Added
3184         an extra check to ignore incomplete types.
3186 2017-04-25  Thomas Quinot  <quinot@adacore.com>
3188         * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
3189         bogus circuitry for the case where Name is Predicate.
3191 2017-04-25  Thomas Quinot  <quinot@adacore.com>
3193         * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
3194         Create SCOs for Predicate aspects in disabled
3195         state initially, to be enabled later on by...
3196         * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
3197         SCO for predicate as enabled.
3199 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3201         * comperr.adb (Compiler_Abort): Remove now obsolete pair of
3202         pragmas Warnings Off / On.
3203         * namet.adb (Finalize): Remove now obsolete pair of pragmas
3204         Warnings Off / On.
3205         * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
3206         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
3207         consider comparisons between static expressions because their
3208         values cannot be invalidated.
3209         * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
3210         Warnings Off / On.
3211         (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
3212         * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
3214 2017-04-25  Bob Duff  <duff@adacore.com>
3216         * sem_elab.adb (In_Task_Activation): Trace internal calls in
3217         task bodies.
3219 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3221         * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
3222         typo fixes.
3224 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3226         * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
3227         On/Off to defend against a spurious warning in conditional
3228         compilation.
3229         * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
3230         * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
3231         defend against a spurious warning in conditional compilation.
3232         * output.adb Add a pair of pragma Warnings On/Off to defend
3233         against a spurious warning in conditional compilation.
3234         * sem_eval.adb (Eval_Relational_Op): Major code clean up.
3235         (Fold_General_Op): New routine.
3236         (Fold_Static_Real_Op): New routine.
3237         (Test_Comparison): New routine.
3238         * sem_eval.ads (Test_Comparison): New routine.
3239         * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
3240         (Warn_On_Constant_Valid_Condition): New routine.
3241         (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
3242         to detect a specific case.
3243         * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
3244         * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
3245         to defend against a spurious warning in conditional compilation.
3246         (Tree_Write): Add a pair of pragma Warnings On/Off to defend
3247         against a spurious warning in conditional compilation.
3248         * usage.adb Add a pair of pragma Warnings On/Off to defend
3249         against a spurious warning in conditional compilation.
3251 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3253         * sinfo.ads, sem_ch13.adb: Update comment.
3255 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3257         * sem_util.adb (Is_Post_State): A reference to a
3258         generic in out parameter is considered a change in the post-state
3259         of a subprogram.
3261 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3263         * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
3264         declaration of a subprogram instance within its wrapper package,
3265         skip over null statements that may result from the rewriting of
3266         ignored pragmas.
3268 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3270         * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
3271         If the type is an unchecked_union, replace the attribute with
3272         a Raise_Program_Error (rather than inserting such before the
3273         attribute reference) to handle properly the case where we are
3274         processing a component of a larger record, and we need to prevent
3275         further expansion for the unchecked union.
3276         (Expand_Attribute_Reference, case 'Write): If the type is
3277         an unchecked_union, check whether enclosing scope is a Write
3278         subprogram. Replace attribute with a Raise_Program_Error if the
3279         discriminants of the unchecked_union type have not default values
3280         because such a use is erroneous..
3282 2017-04-25  Tristan Gingold  <gingold@adacore.com>
3284         * exp_ch9.adb (Expand_N_Task_Type_Declaration):
3285         Add relative_deadline to task record on edf profile.
3286         (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
3287         (Make_Task_Create_Call): Pass relative_deadline value.
3288         * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
3289         * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
3290         (Profile_Info): Add info for GNAT_Ravenscar_EDF.
3291         * sem_prag.adb (Set_Ravenscar_Profile): Handle
3292         GNAT_Ravenscar_EDF (set scheduling policy).
3293         (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
3294         pragma.
3295         (Sig_Flags): Add choice for Pragma_Deadline_Floor.
3296         * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
3297         New names.
3298         (Pragma_Deadline_Floor): New pragma.
3299         * targparm.adb (Get_Target_Parameters): Recognize
3300         GNAT_Ravenscar_EDF profile.
3302 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3304         * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
3306 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3308         * sem_aux.adb (Nearest_Ancestor): Use original node of type
3309         declaration to locate nearest ancestor, because derived
3310         type declarations for record types are rewritten as record
3311         declarations.
3312         * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
3313         properly derivations that are completions of private types.
3314         (Add_Predicates): If type is private, examine rep. items of full
3315         view, which may include inherited predicates.
3316         (Build_Predicate_Functions): Ditto.
3318 2017-04-25  Javier Miranda  <miranda@adacore.com>
3320         * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
3321         to generate new entities for subtype declarations located in
3322         Expression_With_Action nodes.
3324 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3326         * sem_elab.adb (Check_A_Call): Remove
3327         local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
3328         need for Elaborate_All when SPARK elaboration checks are
3329         required. Update the checks for instances, variables, and calls
3330         to Default_Initial_Condition procedures.
3332 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3334         * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
3335         into a boolean aspect, in analogy with the Ada aspect No_Return.
3337 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3339         * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
3341 2017-04-25  Bob Duff  <duff@adacore.com>
3343         * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
3344         Is_True_Constant for an array variable that is passed to a
3345         foreign function as an 'in' parameter.
3346         * debug.adb: Document -gnatd.q.
3348 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3350         * sem_ch6.adb (Analyze_Expression_Function): If expression function
3351         is completion and return type is an access type do not freeze
3352         designated type: this will be done in the process of freezing
3353         the expression if needed.
3354         (Freeze_Expr_Types): Check whether type is complete before
3355         creating freeze node, to provide a better error message if
3356         reference is premature.
3357         * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
3358         functions created by type derivations.
3360 2017-04-25  Pascal Obry  <obry@adacore.com>
3362         * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
3364 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3366         * sem_res.adb (Resolve_Type_Conversion):
3367         When resolving against any fixed type, set the type of the
3368         operand as universal real when the operand is a multiplication
3369         or a division where both operands are of any fixed type.
3370         (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
3371         placement of an error message by pointing to the operand of a
3372         type conversion rather than the conversion itself.
3374 2017-04-25  Thomas Quinot  <quinot@adacore.com>
3376         * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
3377         Needs_Debug_Info when producing SCOs.
3379 2017-04-25  Thomas Quinot  <quinot@adacore.com>
3381         * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
3382         Always pass a null finalization master for a library level named access
3383         type to which a pragme No_Heap_Finalization applies.
3385 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3387         PR ada/78845
3389         * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
3390         set to A'First(2) and vice versa.
3392 2017-04-25  Yannick Moy  <moy@adacore.com>
3394         * freeze.adb (Freeze_Record_Type): Remove obsolete
3395         rule on volatile tagged record restriction on SPARK code.
3397 2017-04-25  Yannick Moy  <moy@adacore.com>
3399         * sem_prag.adb (minor) Fix SPARK RM reference.
3401 2017-04-25  Yannick Moy  <moy@adacore.com>
3403         * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
3404         comment to reflect which entity is chosen as unique entity.
3405         (Unique_Entity): Return full view instead of private spec for
3406         protected type or task type. Fix possible incorrect access when
3407         called on entry.
3409 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3411         * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
3412         array types only instead of all packed array types.
3414 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3416         * sem_ch6.adb (Conforming_Types): If type of formal as a specified
3417         dimension system, verify that dimensions of both match.
3418         (Check_Conformance): Add error message in case of dimension
3419         mismatch.
3420         * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
3421         predicate.
3423 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
3425         * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
3426         confusing.
3428 2017-04-25  Yannick Moy  <moy@adacore.com>
3430         * sem_util.adb: Minor refactoring.
3431         * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
3433 2017-04-25  Claire Dross  <dross@adacore.com>
3435         * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
3436         ultimate alias when accessing overridden operation. Indeed, if the
3437         overridden operation is itself inherited, it won't have any explicit
3438         contract.
3440 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3442         * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
3443         overlap if the two formals have different types, because formally
3444         the corresponding actuals cannot designate the same objects.
3446 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3448         * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
3449         dimensions are present from context, use them.  b) If operand is
3450         a static constant rewritten as a literal, obtain the dimensions
3451         from the original declaration, otherwise use dimensions of type
3452         established from context.
3454 2017-04-25  Yannick Moy  <moy@adacore.com>
3456         * sem_util.adb (Is_Effectively_Volatile): Protect against base type
3457         of array that is private.
3459 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3461         * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
3462         reformatting.
3464 2017-04-25  Yannick Moy  <moy@adacore.com>
3466         * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
3467         on body.
3469 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3471         * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
3472         the check that recognizes a call to a private overridding and
3473         replaces the called subprogram with its alias.
3475 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3477         * exp_util.adb: Minor reformatting.
3479 2017-04-25  Justin Squirek  <squirek@adacore.com>
3481         * exp_ch3.adb (Freeze_Type): Add condition to always treat
3482         interface types as a partial view of a private type for the
3483         generation of invariant procedure bodies.
3484         * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
3485         Add a condition to get the Corresponding_Record_Type for
3486         concurrent types, add condition to return in the absence of a
3487         class in the pragma, remove call to Replace_Type_References,
3488         and add call to Replace_References.
3489         (Add_Interface_Invariatns),
3490         (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
3491         to including the working type T.
3492         (Add_Own_Invariants): Remove
3493         legacy condition for separate units, remove dispatching for ASIS
3494         and save a copy of the expression in the pragma expression.
3495         (Build_Invariant_Procedure_Body): Default initalize vars,
3496         remove return condition on interfaces, always use the
3497         private type for interfaces, and move the processing of types
3498         until after the processing of invariants for the full view.
3499         (Build_Invariant_Procedure_Declaration): Remove condition
3500         to return if an interface type is encountered and add
3501         condition to convert the formal parameter to its class-wide
3502         counterpart if Work_Typ is abstract.
3503         (Replace_Type): Add call to Remove_Controlling_Arguments.
3504         (Replace_Type_Ref): Remove class-wide dispatching for the current
3505         instance of the type.
3506         (Replace_Type_References): Remove parameter "Derived"
3507         (Remove_Controlling_Arguments): Created in order to removing
3508         the controlliong argument from calls to primitives in the case
3509         of the formal parameter being an class-wide abstract type.
3510         * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
3511         to the change made to Freeze_Type in exp_ch3. Add a condition
3512         to treat interface types as a partial view.
3513         * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
3514         to Build_Invariant_Procedure_Declaration to properly generate a
3515         "partial" invariant procedure when Typ is an interface.
3517 2017-04-25  Bob Duff  <duff@adacore.com>
3519         * a-numeri.ads: Go back to using brackets encoding for the Greek
3520         letter pi.
3522 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3524         * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
3525         (10-15): if derived type T with progenitors is abstract,
3526         and primitive P of this type inherits non-trivial classwide
3527         preconditions from both a parent operation and from an interface
3528         operation, then the inherited operation is abstract if the parent
3529         operation is not null.
3530         * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
3531         with Covered_Interface_Op to yield the actual interface operation
3532         that is implemented by a given inherited operation.
3534 2017-04-25  Javier Miranda  <miranda@adacore.com>
3536         * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
3537         and right operands after performing the validity checks. Required
3538         because validity checks may remove side effects from the operands.
3540 2017-04-25  Javier Miranda  <miranda@adacore.com>
3542         * exp_attr.adb (Attribute_Unrestricted_Access):
3543         Do not disable implicit type conversion.  Required to generate
3544         code that displaces the pointer to reference the secondary
3545         dispatch table.
3547 2017-04-25  Pascal Obry  <obry@adacore.com>
3549         * prj-attr.adb, snames.ads-tmpl: Add package Install's
3550         Required_Artifacts attribute.
3552 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3554         * sem_util.adb (Same_Value): String literals are compile-time
3555         values, and comparing them must use Expr_Value_S.
3557 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3559         * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
3560         dereference is introduced for the object, and the object is
3561         overloaded, do not check whether it is aliased, because it may
3562         include an implicit dereference.
3563         * sem_type.adb (Disambiguate): If two interpretations are access
3564         attribute types with the same designated type keep either of
3565         them and do not report an ambiguity.  A true ambiguity will be
3566         reported elsewhere.
3568 2017-04-25  Bob Duff  <duff@adacore.com>
3570         * a-numeri.ads: Change the encoding of Greek letter Pi from
3571         brackets encoding to UTF-8.  Use pragma Wide_Character_Encoding
3572         to indicate the encoding. We considered using a byte order mark
3573         (BOM), but that causes various trouble (misc software eats the
3574         BOM, if you have a patch with a BOM, then it's not at the start
3575         of the patch, so it's not a BOM, the BOM affects with-ing files,
3576         etc.).
3577         * scng.adb, s-wchcnv.adb: Minor.
3579 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3581         * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
3582 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3584         * sem_ch3.adb (Add_Internal_Interface_Entities): Move
3585         Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
3586         Improve error message on operations that inherit non-conforming
3587         classwide preconditions from ancestor and progenitor.
3588         * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
3589         moved here from sem_ch3.
3590         * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
3591         check given in RM 6.1.1 (17) concerning renamings of overriding
3592         operations that inherits class-wide preconditions from ancestor
3593         or progenitor.
3595 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3597         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
3598         (Build_Adjust_Statements): Code cleanup.
3599         (Build_Finalizer): Update the initialization of
3600         Exceptions_OK.
3601         (Build_Finalize_Statements): Code cleanup.
3602         (Build_Initialize_Statements): Code cleanup.
3603         (Make_Deep_Array_Body): Update the initialization of
3604         Exceptions_OK.
3605         (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
3606         (Process_Object_Declaration): Generate a null exception handler only
3607         when exceptions are allowed.
3608         (Process_Transients_In_Scope): Update the initialization of
3609         Exceptions_OK.
3610         * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
3611         routine.
3612         * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
3613         restrictions when the handler is internally generated and the
3614         mode is warnings.
3616 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3618         * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
3619         enforce legality rule on classwide preconditions inherited from
3620         both an ancestor and a progenitor (RM 6.1.1 (10-13).
3621         * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
3622         subprogram need not be dispatching if it appears in a precondition
3623         for an abstract or null subprogram.
3625 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3627         * sem_ch10.adb: Minor typo fix.
3629 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3631         * gcc-interface/Makefile.in: Cleanup VxWorks targets.
3633 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3635         * fname.adb (Is_Internal_File_Name): Arrange for the slices to
3636         have a length which is a power of 2.
3637         (Is_Predefined_File_Name): Likewise. Adjust comment.
3639 2017-04-25  Bob Duff  <duff@adacore.com>
3641         * exp_aggr.adb (Component_Count): Protect the
3642         arithmetic from attempting to convert a value >= 2**31 to Int,
3643         which would otherwise raise Constraint_Error.
3645 2017-04-25  Bob Duff  <duff@adacore.com>
3647         * opt.ads (Locking_Policy): Fix incorrect documentation. The
3648         first character of the policy name is not unique.
3650 2017-04-25  Bob Duff  <duff@adacore.com>
3652         * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
3653         * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
3654         about this flag not being used. It was already used, and it is
3655         now used more.
3657 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3659         * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
3660         (Ignore_SPARK_Mode_Pragmas): New routine.
3661         (Set_Ignore_SPARK_Mode_Pragmas): New routine.
3662         (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
3663         * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
3664         related entities.
3665         (Ignore_SPARK_Mode_Pragmas): New routine
3666         along with pragma Inline.
3667         (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
3668         * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
3669         Ignore_SPARK_Mode_Pragmas_In_Instance.
3670         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
3671         Save and restore the value of global flag
3672         Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
3673         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
3674         the corresponding spec or the body must ignore all SPARK_Mode
3675         pragmas found within.
3676         (Analyze_Subprogram_Declaration): Mark
3677         the spec when it needs to ignore all SPARK_Mode pragmas found
3678         within to allow the body to infer this property in case it is
3679         instantiated or inlined later.
3680         * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
3681         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
3682         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
3683         when the corresponding spec also ignored all SPARK_Mode pragmas
3684         found within.
3685         (Analyze_Package_Declaration): Mark the spec when
3686         it needs to ignore all SPARK_Mode pragmas found within to allow
3687         the body to infer this property in case it is instantiated or
3688         inlined later.
3689         * sem_ch12.adb (Analyze_Formal_Package_Declaration):
3690         Save and restore the value of flag
3691         Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
3692         formal spec when it needs to ignore all SPARK_Mode
3693         pragmas found within to allow the body to infer this
3694         property in case it is instantiated or inlined later.
3695         (Analyze_Package_Instantiation): Save and restore the value
3696         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
3697         the instance spec when it needs to ignore all SPARK_Mode
3698         pragmas found within to allow the body to infer this
3699         property in case it is instantiated or inlined later.
3700         (Analyze_Subprogram_Instantiation): Save and restore the value
3701         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
3702         instance spec and anonymous package when they need to ignore
3703         all SPARK_Mode pragmas found within to allow the body to infer
3704         this property in case it is instantiated or inlined later.
3705         (Instantiate_Package_Body): Save and restore the value of global
3706         flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
3707         global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
3708         corresponding instance spec also ignored all SPARK_Mode pragmas
3709         found within.
3710         (Instantiate_Subprogram_Body): Save and restore the
3711         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
3712         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
3713         when the corresponding instance spec also ignored all SPARK_Mode
3714         pragmas found within.
3715         * sem_prag.adb (Analyze_Pragma): Update the reference to
3716         Ignore_Pragma_SPARK_Mode.
3717         * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
3718         all SPARK_Mode pragmas defined within yields mode "off".
3720 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3722         * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
3724 2017-04-25  Bob Duff  <duff@adacore.com>
3726         * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
3727         All_Checks" to avoid generating unnecessary checks.
3728         * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
3729         All_Checks".
3730         * sem.ads: Fix comment.
3731         * expander.ads: Fix comment.
3732         * exp_atag.ads: Fix comment: "Index = 0" should be
3733         "Index >= 0".
3735 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
3737         * s-taprop-linux.adb: Minor editorial fixes.
3739 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3741         * sem_util.adb (New_Copy_Tree): Put back the declarations of the
3742         hash tables at library level.  Reinstate the NCT_Hash_Tables_Used
3743         variable and set it to True whenever the main hash table is
3744         populated.  Short- circuit the Assoc function if it is false
3745         and add associated guards.
3747 2017-04-25  Olivier Hainque  <hainque@adacore.com>
3749         * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
3750         specs without elaboration code that have an elaboration counter
3751         nevertheless, e.g.  when compiled with -fpreserve-control-flow.
3752         * sem_ch10.adb (Analyze_Compilation_Unit):
3753         Set_Elaboration_Entity_Required when requested to preserve
3754         control flow, to ensure the unit elaboration is materialized at
3755         bind time, resulting in the inclusion of the unit object file
3756         in the executable closure at link time.
3758 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
3760         * exp_dbug.adb: In Debug_Renaming_Declaration,
3761         when dealing with indexed component, accept to produce a renaming
3762         symbol when the index is an IN parameter or when it is a name
3763         defined in an outer scope.
3765 2017-04-25  Yannick Moy  <moy@adacore.com>
3767         * errout.adb (Error_Msg): Adapt continuation
3768         message in instantiations and inlined bodies for info messages.
3770 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
3772         * fname.adb (Has_Internal_Extension): Add pragma Inline.
3773         Use direct 4-character slice comparisons.
3774         (Has_Prefix): Add
3775         pragma Inline.  (Has_Suffix): Delete.
3776         (Is_Internal_File_Name):
3777         Test Is_Predefined_File_Name first.
3778         (Is_Predefined_File_Name):
3779         Use direct slice comparisons as much as possible and limit all
3780         comparisons to at most 8 characters.
3782 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3784         * checks.adb (Insert_Valid_Check): Code cleanup.
3785         * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
3786         (Expand_Actuals): Generate proper copy-back for a validation
3787         variable when it acts as the argument of a type conversion.
3788         * sem_util.adb (Is_Validation_Variable_Reference): Augment the
3789         predicate to operate on type qualifications.
3791 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3793         * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
3794         Minor reformatting.
3796 2017-04-25  Bob Duff  <duff@adacore.com>
3798         * sem_prag.adb (No_Return): Give an error if the pragma applies
3799         to a body. Specialize the error for the specless body case,
3800         as is done for (e.g.) pragma Convention.
3801         * debug.adb: Add switch -gnatd.J to disable the above legality
3802         checks. This is mainly for use in our test suite, to avoid
3803         rewriting a lot of illegal (but working) code.  It might also
3804         be useful to customers. Under this switch, if a pragma No_Return
3805         applies to a body, and the procedure raises an exception (as it
3806         should), the pragma has no effect. If the procedure does return,
3807         execution is erroneous.
3809 2017-04-25  Bob Duff  <duff@adacore.com>
3811         * exp_ch6.adb (Expand_Actuals): This is the
3812         root of the problem. It took N as an 'in out' parameter, and in
3813         some cases, rewrote N, but then set N to Original_Node(N). So
3814         the node returned in N had no Parent. The caller continued
3815         processing of this orphaned node. In some cases that caused a
3816         crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
3817         and trips over the Empty Parent). The solution is to make N an
3818         'in' parameter.  Instead of rewriting it, return the list of
3819         post-call actions, so the caller can do the rewriting later,
3820         after N has been fully processed.
3821         (Expand_Call_Helper): Move most of Expand_Call here. It has
3822         too many premature 'return' statements, and we want to do the
3823         rewriting on return.
3824         (Insert_Post_Call_Actions): New procedure to insert the post-call
3825         actions in the appropriate place. In the problematic case,
3826         that involves rewriting N as an Expression_With_Actions.
3827         (Expand_Call): Call the new procedures Expand_Call_Helper and
3828         Insert_Post_Call_Actions.
3830 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3832         * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
3833         properly type derived from generic formal types, to handle
3834         properly modified version of ACATS 4.1B B611017.
3836 2017-04-25  Javier Miranda  <miranda@adacore.com>
3838         * exp_unst.adb (Subp_Index): Adding missing
3839         support for renamings and functions that return a constrained
3840         array type (i.e. functions for which the frontend built a
3841         procedure with an extra out parameter).
3843 2017-04-25  Pascal Obry  <obry@adacore.com>
3845         * s-string.adb: Minor code clean-up.
3847 2017-04-25  Bob Duff  <duff@adacore.com>
3849         * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
3850         procedure.
3851         * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
3852         function for Non_Blocking_Wait_Process.
3854 2017-04-25  Bob Duff  <duff@adacore.com>
3856         * prep.adb (Preprocess): Remove incorrect
3857         Assert. Current character can be ASCII.CR.
3859 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3861         * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
3862         convention Stdcall, which has a number of exceptions. Convention
3863         is legal on a component declaration whose type is an anonymous
3864         access to subprogram.
3866 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3868         * sem_ch4.adb: sem_ch4.adb Various reformattings.
3869         (Try_One_Prefix_Interpretation): Use the base type when dealing
3870         with a subtype created for purposes of constraining a private
3871         type with discriminants.
3873 2017-04-25  Javier Miranda  <miranda@adacore.com>
3875         * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
3876         * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
3877         dispatching primitives (Restore_Warnings): Restore warning on
3878         late dispatching primitives (Save_Warnings): Save warning on late
3879         dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
3880         to enable/disable this warning.
3881         (WA_Warnings): Set warning on late dispatching primitives.
3882         * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
3883         that its parent type has a private extension.
3884         * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
3885         New subprogram.
3886         * usage.adb: Document -gnatw.j and -gnatw.J.
3888 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3890         * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
3891         reformatting.
3893 2017-04-25  Bob Duff  <duff@adacore.com>
3895         * binde.adb (Validate): Do not pass dynamic strings
3896         to pragma Assert, because older compilers do not support that.
3898 2017-04-25  Bob Duff  <duff@adacore.com>
3900         * s-fileio.adb (Close): When a temp file is
3901         closed, delete it and clean up its Temp_File_Record immediately,
3902         rather than waiting until later.
3903         (Temp_File_Record): Add File
3904         component, so Close can know which Temp_File_Record corresponds
3905         to the file being closed.
3906         (Delete): Don't delete temp files,
3907         because they are deleted by Close.
3908         (Open): Set the File component
3909         of Temp_File_Record. This requires moving the creation of the
3910         Temp_File_Record to the end, after the AFCB has been created.
3912 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3914         * checks.adb (Insert_Valid_Check): Do not generate
3915         a validity check when inside a generic.
3917 2017-04-25  Yannick Moy  <moy@adacore.com>
3919         * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
3921 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
3923         * snames.ads-tmpl (Snames): More names for detecting predefined
3924         potentially blocking subprograms.
3926 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3928         * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
3929         concerning inheritance of class-wide preconditions do not apply
3930         to postconditions.
3932 2017-04-25  Bob Duff  <duff@adacore.com>
3934         * s-ficobl.ads: Minor comment fix.
3936 2017-04-25  Yannick Moy  <moy@adacore.com>
3938         * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
3939         conversions from float to integer in GNATprove mode.
3940         (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
3941         to call Apply_Type_Conversion_Checks, so that range checks
3942         are properly positioned when needed on conversions, including
3943         when converting from float to integer.  (Determine_Range): In
3944         GNATprove mode, take into account the possibility of conversion
3945         from float to integer.
3946         * sem_res.adb (Resolve_Type_Conversion): Only enforce range
3947         check on conversions from fixed-point to integer, not anymore
3948         on conversions from floating-point to integer, when in GNATprove
3949         mode.
3951 2017-04-25  Yannick Moy  <moy@adacore.com>
3953         * checks.adb (Determine_Range_R): Special case type conversions
3954         from integer to float in order to get bounds in that case too.
3955         * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
3956         mode, for computations involved in interval checking.
3958 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
3960         * checks.adb (Insert_Valid_Check): Partially reimplement validity
3961         checks.
3962         * einfo.adb Node36 is now used as Validated_Object.
3963         (Validated_Object): New routine.
3964         (Set_Validated_Object): New routine.
3965         (Write_Field36_Name): Add an entry for Validated_Object.
3966         * einfo.ads Add new attribute Validated_Object along with
3967         usage in entities.
3968         (Validated_Object): New routine along with pragma Inline.
3969         (Set_Validated_Object): New routine along with pragma Inline.
3970         * exp_attr.adb (Make_Range_Test): Add processing for validation
3971         variables to avoid extra reads and copies of the prefix.
3972         * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
3973         variables in order to reflect any changes done in the variable
3974         back into the original object.
3975         * sem_util.adb (Is_Validation_Variable_Reference): New routine.
3976         * sem_util.ads (Is_Validation_Variable_Reference): New routine.
3978 2017-04-25  Steve Baird  <baird@adacore.com>
3980         * exp_ch7.adb (Build_Array_Deep_Procs,
3981         Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
3982         generate Finalize_Address routines for CodePeer.
3984 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
3986         * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
3987         Analyze_Pre_Post_Condition, to implement the legality checks
3988         mandated by AI12-0131: Pre'Class shall not be specified for an
3989         overriding primitive subprogram of a tagged type T unless the
3990         Pre'Class aspect is specified for the corresponding primitive
3991         subprogram of some ancestor of T.
3993 2017-04-25  Bob Duff  <duff@adacore.com>
3995         * sem_ch8.adb (Use_One_Type): If a use_type_clause
3996         is redundant, set its Used_Operations to empty. This is only
3997         necessary for use clauses that appear in the parent of a generic
3998         child unit, because those use clauses get reanalyzed when we
3999         instantiate the generic, and we don't want the Used_Operations
4000         carried over from the original context (where it was probably
4001         not redundant).
4003 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4005         * exp_ch6.adb: Minor reformatting.
4007 2017-04-25  Bob Duff  <duff@adacore.com>
4009         * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
4010         Use Source_Index (Current_Sem_Unit) to find the correct casing.
4011         * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
4012         (Current_Sem_Unit) to find the correct casing.
4013         * par.adb (Par): Null out Current_Source_File, to ensure that
4014         the above bugs won't rear their ugly heads again.
4016 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4018         * sem_ch8.adb (Find_Type): For an attribute reference
4019         'Class, if prefix type is synchronized and previous errors
4020         have suppressed the creation of the corresponding record type,
4021         create a spurious class-wide for the synchonized type itself,
4022         to catch other misuses of the attribute
4024 2017-04-25  Steve Baird  <baird@adacore.com>
4026         * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
4027         is True, then don't generate the accessibility check for the
4028         tag of a tagged result.
4029         * exp_intr.adb (Expand_Dispatching_Constructor_Call):
4030         if CodePeer_Mode is True, then don't generate the
4031         tag checks for the result of call to an instance of
4032         Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
4033         descendant of" check and the accessibility check).
4035 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4037         * sem_ch13.adb: Code cleanups.
4038         * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
4039         * sem_ch8.ads: Minor comment fix.
4041 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4043         * exp_ch4.adb (Library_Level_Target): New function.
4044         (Expand_Concatenate): When optimization is enabled, also expand
4045         the operation out-of-line if the concatenation is present within
4046         the expression of the declaration of a library-level object and
4047         not only if it is the expression of the declaration.
4049 2017-04-25  Bob Duff  <duff@adacore.com>
4051         * freeze.adb (Freeze_Object_Declaration): Do
4052         not Remove_Side_Effects if there is a pragma Linker_Section,
4053         because in that case we want static initialization in the
4054         appropriate section.
4056 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4058         * exp_dbug.adb: Minor rewording and reformatting.
4060 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4062         * sem_attr.adb (Statically_Denotes_Object): New predicate, to
4063         handle the proposed changes to rules concerning potentially
4064         unevaluated expressions, to include selected components that
4065         do not depend on discriminants, and indexed components with
4066         static indices.
4067         * sem_util.adb (Is_Potentially_Unevaluated): Add check for
4068         predicate in quantified expression, and fix bugs in the handling
4069         of case expressions and membership test.
4070         (Analyze_Attribute_Old_Result): use new predicate.
4071         (Analyze_Attribute, case Loop_Entry): ditto.
4073 2017-04-25  Bob Duff  <duff@adacore.com>
4075         * s-secsta.adb (SS_Info): Add a comment
4076         explaining why we don't need to walk all the chunks in order to
4077         compute the total size.
4079 2017-04-25  Bob Duff  <duff@adacore.com>
4081         * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
4082         of the global name buffer to 4*Max_Line_Length.
4084 2017-04-25  Javier Miranda  <miranda@adacore.com>
4086         * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
4087         renaming entity for debug information, mark the entity as needing debug
4088         info if it comes from sources.
4090 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4092         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
4093         restriction converning the use of 'Address where the prefix is
4094         of a controlled type.
4096 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
4098         * exp_dbug.adb: In Debug_Renaming_Declaration,
4099         skip slices that are made redundant by an indexed component
4100         access.
4101         * atree.h: New definition for Original_Node.
4103 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4105         * sem_prag.adb, sem_prag.ads: Minor reformatting.
4107 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4109         * sem_ch3.adb (Check_Entry_Contract): Call
4110         Preanalyze_Spec_Expression so that resolution takes place as well.
4111         * sem_util.adb (Check_Internal_Protected_Use): Reject properly
4112         internal calls that appear in preconditions of protected
4113         operations, in default values for same, and in contract guards
4114         for contract cases in SPARK.
4116 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4118         * a-numaux.ads: Fix description of a-numaux-darwin
4119         and a-numaux-x86.
4120         (Double): Define to Long_Float.
4121         * a-numaux-vxworks.ads (Double): Likewise.
4122         * a-numaux-darwin.ads
4123         (Double): Likewise.
4124         * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
4125         * a-numaux-x86.ads: Fix package description.
4126         * a-numaux-x86.adb (Is_Nan): Minor tweak.
4127         (Reduce): Adjust and complete description. Call Is_Nan instead of
4128         testing manually. Use an integer temporary to hold rounded value.
4129         * a-numaux-darwin.adb (Reduce): Likewise.
4130         (Is_Nan): New function.
4132 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4134         * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
4135         on analysis of prefix whose type is a current instance of a
4136         synchronized type, but where the prefix itself is an entity that
4137         is an object.
4139 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4141         * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
4142         the identity of callable entities therein, because they have been
4143         properly resolved, and prefixed calls may have been rewritten
4144         as normal calls.
4146 2017-04-25  Patrick Bernardi  <bernardi@adacore.com>
4148         * exp_ch3.adb (Build_Init_Statements): Convert
4149         the expression of the pragma/aspect Secondary_Stack_Size to
4150         internal type System.Parameters.Size_Type before assigning
4151         it to the Secondary_Stack_Size component of the task type's
4152         corresponding record.
4154 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4156         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
4157         (etc) optimizations when the type is modular and the offsets
4158         are equal.
4160 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4162         * s-osinte-freebsd.ads: Minor comment tweaks
4164 2017-04-25  Javier Miranda  <miranda@adacore.com>
4166         * urealp.adb (UR_Write): Reverse previous patch
4167         adding documentation on why we generate multiplications instead
4168         of divisions (needed to avoid expressions whose computation with
4169         large numbers may cause division by 0).
4171 2017-04-25  Bob Duff  <duff@adacore.com>
4173         * erroutc.adb (Set_Specific_Warning_Off,
4174         Set_Warnings_Mode_Off): Use the correct source file for
4175         Stop. Was using Current_Source_File, which is only valid during
4176         parsing. Current_Source_File will have a leftover value from
4177         whatever file happened to be parsed last, because of a with_clause
4178         or something.
4180 2017-04-25  Bob Duff  <duff@adacore.com>
4182         * lib.ads, lib.adb (In_Internal_Unit): New functions similar
4183         to In_Predefined_Unit, but including GNAT units.
4184         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
4185         with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
4186         because Should_Ignore_Pragma was not working reliably outside
4187         the parser, because Current_Source_File is not valid.
4188         * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
4189         * par-prag.adb: Call Should_Ignore_Pragma_Par.
4191 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4193         * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
4194         codepeer mode.
4196 2017-04-25  Javier Miranda  <miranda@adacore.com>
4198         * urealp.adb (UR_Write): Fix output of constants with a base other
4199         that 10.
4201 2017-04-25  Justin Squirek  <squirek@adacore.com>
4203         * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
4204         * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
4205         Add extra parameter for Process_Interface_Name.
4206         (Process_Interface_Name): Add parameter for pragma to analyze
4207         corresponding aspect.
4208         * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
4209         from sem_ch13.adb
4211 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4213         * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
4214         correction.
4216 2017-04-25  Yannick Moy  <moy@adacore.com>
4218         * sem_res.adb (Resolve_Comparison_Op): Do not
4219         attempt evaluation of relational operations inside assertions.
4221 2017-04-25  Justin Squirek  <squirek@adacore.com>
4223         * exp_util.adb (Add_Interface_Invariants):
4224         Restored, code moved back from Build_Invariant_Procedure_Body.
4225         (Add_Parent_Invariants): Restored, code moved back from
4226         Build_Invariant_Procedure_Body.
4227         (Build_Invariant_Procedure_Body):
4228         Remove refactored calls and integrated code from
4229         Add_Parent_Invariants and Add_Interface_Invariants.
4231 2017-04-25  Johannes Kanig  <kanig@adacore.com>
4233         * errout.adb (Output_Messages): Adjust computation of total
4234         errors
4235         * erroutc.adb (Error_Msg): In statistics counts, deal
4236         correctly with informational messages that are not warnings.
4237         * errutil.adb (Finalize): adjust computation of total errors.
4239 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4241         * terminals.c (__gnat_terminate_pid): New.
4242         * g-exptty.ads (Terminate_Process): New. Update comments.
4244 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4246         * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
4248 2017-04-25  Justin Squirek  <squirek@adacore.com>
4250         * sem_ch3.adb (Analyze_Declarations): Minor
4251         correction to comments, move out large conditional and scope
4252         traversal into a predicate.
4253         (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
4254         logic.
4256 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4258         * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
4259         of prefix whose type is a current instance of a synchronized
4260         type. If the prefix is an object this is an external call (or
4261         requeue) that can only access public operations of the object. The
4262         previous predicate was too restrictive, and did not allow public
4263         protected operations, only task entries.
4265 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4267         * sem_ch5.adb, fname.adb: Minor reformatting.
4269 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4271         * einfo.adb (Is_Anonymous_Access_Type): New routine.
4272         * einfo.ads Update the placement of
4273         E_Anonymous_Access_Subprogram_Type along with all subtypes that
4274         mention the ekind.
4275         (Is_Anonymous_Access_Type): New routine.
4276         * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
4277         master for an access type subject to pragma No_Heap_Finalization.
4278         * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
4279         allocated or deallocated does not finalization actions if the
4280         associated access type is subject to pragma No_Heap_Finalization.
4281         * opt.ads Add new global variable No_Heap_Finalization_Pragma.
4282         * par-prag.adb Pragma No_Heap_Finalization does not need special
4283         processing from the parser.
4284         * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
4285         ??? comments. Use the new predicate Is_Anonymous_Access_Type.
4286         * sem_prag.adb Add an entry in table Sig_Flags for pragma
4287         No_Heap_Finalization.
4288         (Analyze_Pragma): Add processing for
4289         pragma No_Heap_Finalization. Update various error messages to
4290         use Duplication_Error.
4291         * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
4292         * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
4293         and corresponding pragma id.
4295 2017-04-25  Bob Duff  <duff@adacore.com>
4297         * freeze.adb (Freeze_Record_Type): Use the
4298         underlying type of the component type to determine whether it's
4299         elementary. For representation clause purposes, a private type
4300         should behave the same as its full type.
4301         * fname.ads, fname.adb (Is_Predefined_File_Name):
4302         Make sure things like "system.ali" are recognized as predefined.
4304 2017-04-25  Javier Miranda  <miranda@adacore.com>
4306         * debug.adb: Update documentation of -gnatd.6.
4308 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4310         * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
4311         element iterator when the name is an overloaded function call,
4312         one of whose interpretations yields an array.
4314 2017-04-25  Bob Duff  <duff@adacore.com>
4316         * uname.ads, uname.adb (Is_Predefined_Unit_Name,
4317         Is_Internal_Unit_Name): New functions for operating on unit
4318         names, as opposed to file names. There's some duplicated code
4319         with fname.adb, which is unfortunate, but it seems like we don't
4320         want to add dependencies here.
4321         * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
4322         to Is_Predefined_Unit_Name; the former was wrong, because Uname
4323         is not a file name at all.
4324         * fname.ads, fname.adb: Document the fact that
4325         Is_Predefined_File_Name and Is_Internal_File_Name can be called
4326         for ALI files, and fix the code so it works properly for ALI
4327         files. E.g. these should return True for "system.ali".
4329 2017-04-25  Justin Squirek  <squirek@adacore.com>
4331         * exp_util.adb (Add_Invariant): Removed,
4332         code moved to Add_Invariant_Check, Add_Inherited_Invariant,
4333         and Add_Own_Invariant.  (Add_Invariant_Check): Used
4334         for adding runtime checks from any kind of invariant.
4335         (Add_Inherited_Invariant): Generates invariant checks for
4336         class-wide invariants (Add_Interface_Invariants): Removed, code
4337         moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
4338         Create a types own invariant procedure (Add_Parent_Invariants):
4339         Removed, code moved to Build_Invariant_Procedure_Body
4340         (Build_Invariant_Procedure_Body): Add refactored calls
4341         and integrated code from Add_Parent_Invariants and
4342         Add_Interface_Invariants.
4343         (Process_Type): Removed, the
4344         relavant code was inlined into both Add_Own_Invariant and
4345         Add_Inherited_Invariant.
4347 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4349         * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
4350         scn.adb, osint.adb, fname.adb: Minor reformatting.
4352 2017-04-25  Pascal Obry  <obry@adacore.com>
4354         * s-taprop-mingw.adb: Do not check for CloseHandle in
4355         Finalize_TCB.
4357 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4359         * sem_util.adb (Check_Part_Of_Reference):
4360         Continue to examine the context if the reference appears within
4361         an expression function.
4363 2017-04-25  Justin Squirek  <squirek@adacore.com>
4365         * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
4366         and Build_Invariant_Procedure_Declaration.
4367         * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
4368         and Build_Invariant_Procedure_Declaration from exp_ch7
4369         and break-out Is_Untagged_Private_Derivation from
4370         Build_Invariant_Procedure_Body.
4371         (Replace_Type_References):
4372         Append an extra parameter to allow for dispatching replacements
4373         and add the corrasponding logic.
4374         (Type_Invariant): Remove
4375         Replace_Typ_Refs and replace its references with calls to
4376         Replace_Type_References.
4377         * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
4379 2017-04-25  Bob Duff  <duff@adacore.com>
4381         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
4382         that returns True when appropriate.
4383         * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
4384         when compiling predefined files.
4385         * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
4386         "gnat.adc" should not be considered a predefined file name.
4387         That required (or at least encouraged) a lot of cleanup of global
4388         variable usage. We shouldn't be communicating information via
4389         the global name buffer.
4390         * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
4391         * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
4392         required by the above-mentioned cleanup.
4394 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4396         * osint.adb (Find_File): Handle properly a request for a
4397         configuration file whose name is a directory.
4399 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4401         * sem_attr.adb, sem_ch5.adb: Minor reformatting.
4403 2017-04-25  Bob Duff  <duff@adacore.com>
4405         * types.ads: Minor: Fix '???' comment.
4406         * sem_ch8.adb: Minor comment fix.
4408 2017-04-25  Bob Duff  <duff@adacore.com>
4410         * sem_prag.adb: Remove suspicious uses of Name_Buf.
4411         * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
4412         Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
4413         Add String_To_Name with no side effects.
4415 2017-04-25  Justin Squirek  <squirek@adacore.com>
4417         * sem_ch3.adb (Analyze_Declarations): Add
4418         additional condition for edge case.
4420 2017-04-25  Bob Duff  <duff@adacore.com>
4422         * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
4423         reserved words inside pragmas. This is necessary to allow the
4424         pragma name Interface to be used in pragma Ignore_Pragma.
4425         * par.adb: Minor comment fix.
4427 2017-04-25  Javier Miranda  <miranda@adacore.com>
4429         * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
4430         * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
4431         * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
4432         * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
4433         occurrences of RE_Type_Is_Abstract
4435 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4437         * exp_util.adb (Build_Chain): Account for ancestor
4438         subtypes while traversing the derivation chain.
4440 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4442         * sem_attr.adb: minor reformatting.
4444 2017-04-25  Doug Rupp  <rupp@adacore.com>
4446         * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
4448 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4450         * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
4451         the first pass over an assignment statement with target names,
4452         to prevent the generation of subtypes (such as discriminated
4453         record components)that may carry the target name outside of the
4454         tree for the assignment. The subtypes will be generated when
4455         the assignment is reanalyzed in full.
4456         (Analyze_Target_Name): Handle properly class-wide types.
4458 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4460         * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
4461         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
4462         the purposes of freezing.
4463         * exp_util.adb Update the documentation and structure of the
4464         type map used in class-wide semantics of assertion expressions.
4465         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
4466         and resolve the triaged expression because all substitutions
4467         refer to the proper entities.  Update the replacement of
4468         references.
4469         (Build_DIC_Procedure_Body): Add formal parameter
4470         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
4471         are now only processed when freezing occurs.  Build a body only
4472         when one is needed.
4473         (Entity_Hash): Removed.
4474         (Map_Types): New routine.
4475         (Replace_Object_And_Primitive_References): Removed.
4476         (Replace_References): New routine.
4477         (Replace_Type_References): Moved to the library level of Exp_Util.
4478         (Type_Map_Hash): New routine.
4479         (Update_Primitives_Mapping): Update the mapping call.
4480         (Update_Primitives_Mapping_Of_Types): Removed.
4481         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
4482         parameter For_Freeze and update the comment on usage.
4483         (Map_Types): New routine.
4484         (Replace_References): New routine.
4485         (Replace_Type_References): Moved to the library level of Exp_Util.
4486         (Update_Primitives_Mapping_Of_Types): Removed.
4487         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
4488         properties of the private type to the full view in case the full
4489         view derives from a parent type and inherits a DIC pragma.
4490         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
4491         DIC pragma is placed at the top of a declarative region.
4493 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4495         * a-tasatt.adb: Complete previous change and use an unsigned
4496         int to avoid overflow checks.
4498 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4500         * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
4501         the error message when the attribute reference is an actual in
4502         a call to a subprogram inherited from a generic formal type with
4503         unknown discriminants, which makes the subprogram and its formal
4504         parameters intrinsic (see RM 6.3.1 (8) and (13)).
4506 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4508         * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
4509         sem_prag.adb: Minor reformatting.
4511 2017-04-25  Bob Duff  <duff@adacore.com>
4513         * sem_attr.adb (Type_Key): Add code in the
4514         recursive Compute_Type_Key to protect against fetching the source
4515         code for Standard, in case a component of the type is declared
4516         in Standard. There was already code to do this for the original
4517         type, but not for its components.
4519 2017-04-25  Javier Miranda  <miranda@adacore.com>
4521         * exp_ch3.adb (Build_Initialization_Call): Handle
4522         subtypes of private types when searching for the underlying full
4523         view of a private type.
4525 2017-04-25  Javier Miranda  <miranda@adacore.com>
4527         * sem_res.adb (Set_Mixed_Mode_Operand): A universal
4528         real conditional expression can appear in a fixed-type context
4529         and must be resolved with that context to facilitate the code
4530         generation to the backend.
4532 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4534         * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
4535         to indicate whether during inline processing, when some unit U1
4536         appears in the context of a unit U2 compiled for instantiation
4537         or inlining purposes, the body of U1 needs to be compiled as well.
4538         * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
4539         context is a package declaration.
4540         * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
4541         Analyze_Generic_Package_Declaration): ditto.
4542         * inline.adb (Analyze_Inlined_Bodies): Check
4543         Body_Needed_For_Inlining.
4545 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4547         * par.adb (Current_Assign_Node): Global variable use to record
4548         the presence of a target_name in the right hand side of the
4549         assignment being parsed.
4550         * par-ch4.adb (P_Name): If the name is a target_name, mark the
4551         enclosing assignment node accordingly.
4552         * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
4553         appropriately.
4554         * sem_ch5.adb (Analyze_Assignment): Disable expansion before
4555         analyzing RHS if the statement has target_names.
4556         * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
4557         properly choices that are subtype marks.
4558         * exp_ch5.adb: Code cleanup.
4560 2017-04-25  Bob Duff  <duff@adacore.com>
4562         * s-memory.adb: Add a comment regarding efficiency.
4563         * atree.adb: Fix the assertion, and combine 2 assertions into one,
4564         "the source has an extension if and only if the destination does."
4565         * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
4567 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4569         * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
4570         conversion.
4572 2017-04-25  Doug Rupp  <rupp@adacore.com>
4574         * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
4575         handling for ppc64-vx7.
4576         * sigtramp-vxworks-target.inc
4577         [SIGTRAMP_BODY]: Add section for ppc64-vx7.
4579 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4581         * ada_get_targ.adb: New file.
4583 2017-04-25  Bob Duff  <duff@adacore.com>
4585         * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
4586         Direct_Val (Right), instead of the incorrect Direct_Val (Left).
4587         (UI_GCD): Remove ??? comment involving possible efficiency
4588         improvements. This just isn't important after all these years.
4589         Also minor cleanup.
4590         * uintp.ads: Minor cleanup.
4592 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4594         * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
4595         Revert previous changes.
4596         * scng.adb: Minor reformatting.
4597         * s-stratt.ads: Fix unbalanced parens in comment.
4599 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4601         * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
4602         Minor reformatting.
4604 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4606         * scng.adb (Scan): Handle '@' appropriately.
4607         * sem_ch5.adb: Code cleanup.
4609 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4611         * freeze.adb (Check_Expression_Function): Do not check for the
4612         use of deferred constants if the freezing of the expression
4613         function is triggered by its generated body, rather than a
4614         premature use.
4616 2017-04-25  Javier Miranda  <miranda@adacore.com>
4618         * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
4619         subtypes of private types when performing the view conversion.
4621 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4623         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
4624         the purposes of freezing.
4625         * exp_util.adb Update the documentation and structure of the
4626         type map used in class-wide semantics of assertion expressions.
4627         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
4628         and resolve the triaged expression because all substitutions
4629         refer to the proper entities.  Update the replacement of
4630         references.
4631         (Build_DIC_Procedure_Body): Add formal parameter
4632         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
4633         are now only processed when freezing occurs.  Build a body only
4634         when one is needed.
4635         (Entity_Hash): Removed.
4636         (Map_Types): New routine.
4637         (Replace_Object_And_Primitive_References): Removed.
4638         (Replace_References): New routine.
4639         (Replace_Type_References): Moved to the library level of Exp_Util.
4640         (Type_Map_Hash): New routine.
4641         (Update_Primitives_Mapping): Update the mapping call.
4642         (Update_Primitives_Mapping_Of_Types): Removed.
4643         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
4644         parameter For_Freeze and update the comment on usage.
4645         (Map_Types): New routine.
4646         (Replace_References): New routine.
4647         (Replace_Type_References): Moved to the library level of Exp_Util.
4648         (Update_Primitives_Mapping_Of_Types): Removed.
4649         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
4650         properties of the private type to the full view in case the full
4651         view derives from a parent type and inherits a DIC pragma.
4652         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
4653         DIC pragma is placed at the top of a declarative region.
4655 2017-04-25  Tristan Gingold  <gingold@adacore.com>
4657         * s-mmap.ads (Data): Add pragma Inline.
4659 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4661         * checks.adb (Insert_Valid_Check): Do not use
4662         a renaming to alias a volatile name because this will lead to
4663         multiple evaluations of the volatile name. Use a constant to
4664         capture the value instead.
4666 2017-04-25  Doug Rupp  <rupp@adacore.com>
4668         * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
4670 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4672         * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
4673         Add out parameter to indicate to caller that a wrapper must
4674         be constructed for an inherited primitive whose inherited
4675         pre/postcondition has called to overridden primitives.
4676         * freeze.adb (Check_Inherited_Conditions): Build wrapper body
4677         for inherited primitive that requires it.
4678         * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
4679         legal primitive operations and belong to the list of bodies
4680         generated after the freeze point of a type.
4681         * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
4682         of Build_Class_Wide_Expression.
4683         * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
4684         to construct the specification of the wrapper subprogram created
4685         for an inherited operation.
4687 2017-04-25  Bob Duff  <duff@adacore.com>
4689         * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
4690         pthread_mutexattr_setprioceiling): Add new interfaces for these
4691         pthread operations.
4692         * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
4693         protocols as appropriate for Locking_Policy 'C' and 'I'.
4694         * s-taprop-posix.adb: Minor reformatting to make it more similar
4695         to s-taprop-linux.adb.
4697 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4699         * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
4700         Handle properly a multi- level derivation involving both renamed
4701         and constrained parent discriminants, when the type to be
4702         constrained has fewer discriminants that the ultimate ancestor.
4704 2017-04-25  Bob Duff  <duff@adacore.com>
4706         * sem_util.adb (Is_Object_Reference): In the
4707         case of N_Explicit_Dereference, return False if it came from a
4708         conditional expression.
4710 2017-04-25  Bob Duff  <duff@adacore.com>
4712         * par-ch4.adb (P_Case_Expression): If a semicolon
4713         is followed by "when", assume that ";" was meant to be ",".
4715 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4717         * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
4718         fixes.
4720 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4722         * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
4723         loading of an entity.
4724         * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
4725         previously repeated in the analysis.
4726         * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
4727         procedure SPARK_Implicit_Load.  (Analyze_Task_Type_Declaration):
4728         use new procedure SPARK_Implicit_Load.
4729         * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
4730         SPARK_Implicit_Load.
4732 2017-04-25  Javier Miranda  <miranda@adacore.com>
4734         * sem_util.adb (New_Copy_Tree): By default
4735         copying of defining identifiers is prohibited because
4736         this would introduce an entirely new entity into the
4737         tree. This patch introduces an exception to this general
4738         rule: the declaration of constants and variables located in
4739         Expression_With_Action nodes.
4740         (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
4741         (In_Map): New subprogram.
4742         (Visit_Entity): New subprogram.
4743         (Visit_Node): Handle EWA_Level,
4744         EWA_Inner_Scope_Level, and take care of defining entities defined
4745         in Expression_With_Action nodes.
4747 2017-04-25  Thomas Quinot  <quinot@adacore.com>
4749         * exp_ch6.adb: minor comment edit.
4750         * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
4751         procedure specifications that come from source.
4752         * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
4753         Null_Statement attribute.
4754         * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
4755         procedure, generate statement SCO for the generated NULL statement.
4756         * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
4757         parser, if available.
4759 2017-04-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
4761         * system-linux-s390.ads: Use Long_Integer'Size to define
4762         Memory_Size.
4764 2017-04-04  Eric Botcazou  <ebotcazou@adacore.com>
4766         * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
4768 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
4770         * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
4771         * g-socket.adb (To_Host_Entry): Fix typo in comment.
4772         * gnat_ugn.texi: Fix typo.
4773         * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
4774         * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
4775         * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
4776         * sem_util.adb (Mark_Coextensions): Likewise.
4777         * sem_util.ads (Available_Full_View_Of_Component): Likewise.
4779 2017-03-28  Andreas Schwab  <schwab@suse.de>
4781         PR ada/80117
4782         * system-linux-aarch64-ilp32.ads: New file.
4783         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
4784         from LIBGNAT_TARGET_PAIRS.
4785         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
4786         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
4787         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
4788         or -mabi=ilp32, resp.
4790 2017-03-14  James Cowgill  <James.Cowgill@imgtec.com>
4792         * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
4794 2017-03-08  Thanassis Tsiodras  <ttsiodras@gmail.com>
4796         PR ada/79903
4797         * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
4799 2017-03-08  Eric Botcazou  <ebotcazou@adacore.com>
4801         PR ada/79945
4802         * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
4804         * system-linux-arm.ads (Default_Bit_Order): Likewise.
4805         * system-linux-mips.ads (Default_Bit_Order): Likewise.
4806         * system-linux-armeb.ads: Delete.
4807         * system-linux-mipsel.ads: Likewise.
4808         * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
4809         (ARM/Linux): Likewise.
4811 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
4813         PR c/79677
4814         * gcc-interface/misc.c (gnat_handle_option): Pass true to
4815         handle_generated_option GENERATED_P.
4817 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4819         * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
4820         around a justified modular type if it doesn't have the same scalar
4821         storage order as the enclosing record type.
4823 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4825         * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
4826         of boolean rvalues to function calls.
4828 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4830         * gcc-interface/utils.c (fold_bit_position): New function.
4831         (rest_of_record_type_compilation): Call it instead of bit_position to
4832         compute the field position and remove the call to remove_conversions.
4833         (compute_related_constant): Factor out the multiplication in both
4834         operands, if any, and streamline the final test.
4836 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4838         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
4840 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4842         * gcc-interface/decl.c: Include demangle.h.
4843         (is_cplusplus_method): Return again true for a primitive operation
4844         only if it is dispatching.  For a subprogram with an interface name,
4845         call the demangler to get the number of C++ parameters and compare it
4846         with the number of Ada parameters.
4848 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4850         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
4851         there is no end label, put the location of the At_End procedure on
4852         the call to the procedure.
4854 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4856         * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
4857         value for array types with TYPE_INDEX_TYPE set on their domain type.
4858         * gcc-interface/utils.c (max_size): For operations and expressions, do
4859         not build a new node if the operands have not changed or are missing.
4861 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
4863         * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
4864         argument when recursing on TRUTH_NOT_EXPR.
4866 2017-02-12  John Marino  <gnugcc@marino.st>
4868         * system-freebsd-x86.ads: Rename into...
4869         * system-freebsd.ads: ...this.
4870         (Default_Bit_Order): Define using Standard'Default_Bit_Order.
4871         * gcc-interface/Makefile.in: Support aarch64-freebsd.
4872         (x86-64/FreeBSD): Adjust to above renaming.
4873         (i386/FreeBSD): Likewise.
4875 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
4877         * comperr.adb: Update FSF bug reporting URL.
4879 2017-02-01  Eric Botcazou  <ebotcazou@adacore.com>
4880             Jakub Jelinek  <jakub@redhat.com>
4882         PR ada/79309
4883         * adaint.c (__gnat_killprocesstree): Fix broken string handling.
4885 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
4887         PR lto/79061
4888         * gcc-interface/utils.c (get_global_context): Pass main_input_filename
4889         to build_translation_unit_decl.
4891 2017-01-23  Javier Miranda  <miranda@adacore.com>
4893         * sem_util.adb (New_Copy_Tree): Code cleanup:
4894         removal of the internal map (ie. variable Actual_Map, its
4895         associated local variables, and all the code handling it).
4896         * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
4897         force loading of the System package when processing a task type.
4898         (Analyze_Protected_Type_Declaration): in GNATprove mode force
4899         loading of the System package when processing a protected type.
4900         * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
4901         force loading of the System package when processing compilation
4902         unit with a main-like subprogram.
4903         * frontend.adb (Frontend): remove forced loading of the System
4904         package.
4906 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4908         * sem_prag.adb (Default_Initial_Condition): If the desired type
4909         declaration is a derived type declaration with discriminants,
4910         it is rewritten as a private type declaration.
4911         * sem_ch13.adb (Replace_Type_References_Generic,
4912         Visible_Component): A discriminated private type with descriminnts
4913         has components that must be rewritten as selected components
4914         if they appear as identifiers in an aspect expression such as
4915         a Default_Initial_Condition.
4916         * sem_util.adb (Defining_Entity): support N_Iterator_Specification
4917         nodes.
4919 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4921         * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
4922         * gnat1drv.adb Generate an empty object file for an ignored
4923         Ghost compilation unit.
4924         * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
4926 2017-01-23  Yannick Moy  <moy@adacore.com>
4928         * sem_ch4.adb (Analyze_Indexed_Component_Form):
4929         Adapt to inlined prefix with string literal subtype.
4930         * inline.adb (Expand_Inlined_Call): Keep unchecked
4931         conversion inside inlined call when formal type is constrained.
4933 2017-01-23  Javier Miranda  <miranda@adacore.com>
4935         * sem_util.adb (New_Copy_Tree): Code cleanup:
4936         removal of global variables. All the global variables, global
4937         functions and tables of this subprogram are now declared locally.
4939 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
4941         * exp_strm.ads: Minor reformatting and typo fixes.
4943 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4945         * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
4946         exp_aggr.adb: Minor reformatting.
4947         * g-diopit.adb: minor grammar/punctuation fix in comment.
4948         * g-byorma.ads: minor fix of unbalanced parens in comment.
4950 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
4952         * par.adb: Update the documentation of component Labl.
4953         * par-ch6.adb (P_Return_Statement): Set the expected label of
4954         an extended return statement to Error.
4956 2017-01-23  Tristan Gingold  <gingold@adacore.com>
4958         * s-boustr.ads, s-boustr.adb (Is_Full): New function.
4960 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4962         * expander.adb: Handle N_Delta_Aggregate.
4964 2017-01-23  Javier Miranda  <miranda@adacore.com>
4966         * exp_ch6.adb (Expand_Call): Improve the code that
4967         checks if some formal of the called subprogram is a class-wide
4968         interface, to handle subtypes of class-wide interfaces.
4970 2017-01-23  Javier Miranda  <miranda@adacore.com>
4972         * checks.adb (Apply_Parameter_Aliasing_Checks):
4973         Remove side effects of the actuals before generating the overlap
4974         check.
4976 2017-01-23  Justin Squirek  <squirek@adacore.com>
4978         * exp_strm.ads, exp_strm.ads
4979         (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
4980         as to avoid getting the underlying type by default.
4981         * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
4982         underlying type in the Iiput and output attribute cases when
4983         building their respective functions.
4985 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
4987         * scng.adb: Minor reformatting of error message.
4989 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4991         * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
4992         to freeze the return type of an expression funxtion that is a
4993         completion, if the type is a limited view and the non-limited
4994         view is available.
4996 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
4998         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
4999         aggregate construct.
5000         (P_Record_Or_Array_Component_Association): An array aggregate
5001         can start with an Iterated_Component_Association.
5002         * scng.adb: Modify error message on improper use of @ in earlier
5003         versions of the language.
5004         * sinfo.ads: New node kind N_Delta_Aggregate.
5005         * sinfo.adb: An N_Delta_Aggregate has component associations and
5006         an expression.
5007         * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
5008         * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
5009         Create a new index for each one of the choices in the association,
5010         to prevent spurious homonyms in the scope.
5011         (Resolve_Delta_Aggregate): New.
5012         * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
5013         * exp_util.adb (Insert_Actions): Take into account
5014         N_Delta_Aggregate.
5015         * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
5016         * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
5017         and local procedures Expand_Delta_Array_Aggregate and
5018         expand_Delta_Record_Aggregate.
5019         * sprint.adb: Handle N_Delta_Aggregate.
5021 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5023         * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
5024         empty name when the exception declaration is subject to pragma
5025         Discard_Names.
5026         (Null_String): New routine.
5028 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5030         * par-ch9.adb (P_Protected_Definition): Parse
5031         any optional and potentially illegal pragmas which appear in
5032         a protected operation declaration list.
5033         (P_Task_Items): Parse
5034         any optional and potentially illegal pragmas which appear in a
5035         task item list.
5037 2017-01-23  Pascal Obry  <obry@adacore.com>
5039         * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
5040         is needed when a foreign thread call a Win32 API using a thread handle
5041         like GetThreadTimes() for example.
5043 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5045         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
5046         allow an 'Address clause to be specified on a prefix of a
5047         class-wide type.
5049 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5051         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
5052         attribute 'Valid is a renaming of the original expression when
5053         the expression denotes a name. For all other kinds of expression,
5054         use a constant to capture the value.
5055         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
5056         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
5058 2017-01-23  Justin Squirek  <squirek@adacore.com>
5060         * sem_eval.adb (Eval_Integer_Literal): Add special
5061         case to avoid optimizing out check if the literal appears in
5062         an if-expression.
5064 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5066         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
5067         allow an 'Address clause to be specified on a prefix of a
5068         class-wide type.
5070 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5072         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
5073         attribute 'Valid is a renaming of the original expression when
5074         the expression denotes a name. For all other kinds of expression,
5075         use a constant to capture the value.
5076         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
5077         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
5079 2017-01-23  Justin Squirek  <squirek@adacore.com>
5081         * sem_eval.adb (Eval_Integer_Literal): Add special
5082         case to avoid optimizing out check if the literal appears in
5083         an if-expression.
5085 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
5087         * sem_ch4.adb (Try_Primitive_Operations,
5088         Is_Valid_First_Argument_Of): argument is valid if it is a derived
5089         type with unknown discriminants that matches its underlying
5090         record view.
5091         * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
5092         expression if its type is derived from a limited type with
5093         unknown discriminants, because the expansion (which is a call)
5094         must be expanded in the enclosing context to add the proper build-
5095         in-place parameters to the call.
5096         * lib.ads, exp_ch9.adb: Minor fixes in comments.
5098 2017-01-23  Yannick Moy  <moy@adacore.com>
5100         * frontend.adb (Frontend): Do not load runtime
5101         unit for GNATprove when parsing failed.
5102         * exp_ch9.adb: minor removal of extra whitespace
5103         * exp_ch6.adb: minor typo in comment
5104         * sem_util.adb: Code cleanup.
5105         * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
5106         * a-ngcefu.adb: minor style fix in whitespace
5108 2017-01-23  Thomas Quinot  <quinot@adacore.com>
5110         * scos.ads: Document usage of 'd' as default SCO kind for
5111         declarations.
5112         * par_sco.adb (Traverse_Declarations_Or_Statements.
5113         Traverse_Degenerate_Subprogram): New supporting routine for expression
5114         functions and null procedures.
5115         (Traverse_Declarations_Or_Statements.Traverse_One): Add
5116         N_Expression_Function to the subprogram case; add required
5117         support for null procedures and expression functions.
5119 2017-01-23  Bob Duff  <duff@adacore.com>
5121         * namet.ads (Bounded_String): Decrease the size of type
5122         Bounded_String to avoid running out of stack space.
5123         * namet.ads (Append): Don't ignore buffer overflow; raise
5124         Program_Error instead.
5126 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5128         * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
5129         sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
5130         reformatting.
5131         * exp_ch9.adb: minor style fix in comment.
5133 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
5135         * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
5136         for a limited record extension with unknown discriminants whose
5137         full view has no discriminants.
5139 2017-01-23  Yannick Moy  <moy@adacore.com>
5141         * exp_spark.adb: Alphabetize with clauses.
5143 2017-01-23  Yannick Moy  <moy@adacore.com>
5145         * sem_util.adb (Has_Enabled_Property): Treat
5146         protected objects and variables differently from other variables.
5148 2017-01-23  Thomas Quinot  <quinot@adacore.com>
5150         * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
5151         Split original Ada 95 part off into new subprogram
5152         below. Call that subprogram (instead of proceeding with
5153         AI95-0133 behaviour) if debug switch -gnatd.p is in use.
5154         (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
5155         * debug.adb Document new switch -gnatd.p
5156         * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
5157         record for reverse bit order if an error has already been posted
5158         on the record type.  This avoids generating extraneous "info:"
5159         messages for illegal code.
5161 2017-01-23  Justin Squirek  <squirek@adacore.com>
5163         * sem_ch3.adb (Analyze_Declarations): Correct comments
5164         * freeze.adb (Find_Constant): Add detection of deferred constants
5165         so they are not incorrectly flagged as premature.
5167 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
5169         * scans.ads: New token At_Sign. Remove '@' from list of illegal
5170         characters for future version of the language. '@' is legal name.
5171         * scng.ads, scng.adb (Scan):  Handle '@' appropriately.
5172         * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
5173         denotes a Target_Name.
5174         * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
5175         * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
5176         (Has_Target_Names): New flag on N_Assignment_Statement, to
5177         indicate that RHS has occurrences of N_Target_Name.
5178         * sem.adb: Call Analyze_Target_Name.
5179         * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
5180         (urrent_LHS): Global variable that denotes LHS of assignment,
5181         used in the analysis of Target_Name nodes.
5182         * sem_res.adb (Resolve_Target_Name): New procedure.
5183         * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
5184         N is an assignment statement whose RHS contains occurences of @
5185         that designate the value of the LHS of the assignment. If the
5186         LHS is side-effect free the target names can be replaced with
5187         a copy of the LHS; otherwise the semantics of the assignment
5188         is described in terms of a procedure with an in-out parameter,
5189         and expanded as such.
5190         (Expand_N_Assignment_Statement): Call
5191         Expand_Assign_With_Target_Names when needed.
5192         * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
5193         * sprint.adb: Handle N_Target_Name.
5195 2017-01-23  Eric Botcazou  <ebotcazou@adacore.com>
5197         * checks.adb: Minor fix in comment.
5199 2017-01-23  Philippe Gil  <gil@adacore.com>
5201         * g-debpoo.adb (Do_Report) remove freed chunks from chunks
5202         count in Sort = Memory_Usage or Allocations_Count
5204 2017-01-23  Justin Squirek  <squirek@adacore.com>
5206         * sem_ch3.adb: Code cleanup.
5208 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5210         * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
5211         variables to the local variable section. Update the profile
5212         of various nested routine that previously had visibility
5213         of those globals. One the matching phase has completed,
5214         remove certain classes of clauses which are considered noise.
5215         (Check_Dependency_Clause): Properly detect a match between two
5216         'Result attributes. Update the various post-match cases to use
5217         Is_Already_Matched as this routine now automatically recognizes
5218         a previously matched 'Result attribute.
5219         (Is_Already_Matched): New routine.
5220         (Remove_Extra_Clauses): New routine.
5221         (Report_Extra_Clauses): Remove the detection of ... => null
5222         clauses as this is now done in Remove_Extra_Clauses.
5224 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
5226         * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
5227         report on spurious overlaps between values involving a subtype
5228         with a static predicate, because the expansion of such a subtype
5229         into individual ranges in inhibited in ASIS mode.
5231 2017-01-23  Justin Squirek  <squirek@adacore.com>
5233         * sem_ch3.adb (Analyze_Declarations): Add detection
5234         of an edge case and delay freezing if it is present.
5236 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5238         * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
5239         sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
5241 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5243         * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
5244         access-to-subprogram types inherit the convention of the
5245         associated subprogram.  (Set_Profile_Convention): New routine.
5246         * sem_ch6.adb (Check_Conformance): Do not compare the conventions
5247         of the two entities directly, use Conventions_Match to account
5248         for anonymous access-to-subprogram and subprogram types.
5249         (Conventions_Match): New routine.
5251 2017-01-23  Claire Dross  <dross@adacore.com>
5253         * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
5254         which return Universal_Integer, force the overflow check flag for
5255         Length and Range_Length for types as big as Long_Long_Integer.
5257 2017-01-23  Claire Dross  <dross@adacore.com>
5259         * exp_spark.adb (Expand_SPARK_Attribute_Reference):  For
5260         attributes which return Universal_Integer, introduce a conversion
5261         to the expected type with the appropriate check flags set.
5262         * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
5263         base type if the range is null. It may still be invalid if it
5264         is higher than the lower bound. This is checked later in the
5265         context in which the range appears.
5267 2017-01-23  Pierre-Marie de Rodat  <derodat@adacore.com>
5269         * scos.ads: Introduce a constant to represent ignored
5270         dependencies in SCO_Unit_Table_Entry.
5272 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
5274         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
5275         spaces from error messages.
5277 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
5279         * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
5280         subsidiary to Expand_N_Object_ Declaration, to compute a guard on
5281         an object declaration for an array type with a modular index type
5282         with the size of Long_Long_Integer. Special processing is needed
5283         in this case to compute reliably the size of the object, and
5284         eventually  to raise Storage_Error, when wrap-around arithmetic
5285         might compute a meangingless size for the object.
5287 2017-01-23  Justin Squirek  <squirek@adacore.com>
5289         * a-wtenau.adb, par-endh.adb, sem_prag.adb,
5290         sem_type.adb: Code cleanups.
5292 2017-01-23  Bob Duff  <duff@adacore.com>
5294         * sem_res.adb (Resolve_Call): In the part of the code where
5295         it is deciding whether to turn the call into an indexed
5296         component, avoid doing so if the call is to an instance of
5297         Unchecked_Conversion. Otherwise, the compiler turns it into an
5298         indexed component, and resolution of that turns it back into a
5299         function call, and so on, resulting in infinite recursion.
5300         * sem_util.adb (Needs_One_Actual): If the first formal has a
5301         default, then return False.
5303 2017-01-21  Eric Botcazou  <ebotcazou@adacore.com>
5305         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
5306         optimizations when the type is modular and the offsets are equal.
5308 2017-01-20  Thomas Quinot  <quinot@adacore.com>
5310         * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
5311         message.
5313 2017-01-20  Nicolas Roche  <roche@adacore.com>
5315         * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
5317 2017-01-20  Bob Duff  <duff@adacore.com>
5319         * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
5320         (etc) optimizations when the type is modular.
5322 2017-01-20  Yannick Moy  <moy@adacore.com>
5324         * sem_ch6.adb (Move_Pragmas): move some pragmas,
5325         but copy the SPARK_Mode pragma instead of moving it.
5326         (Build_Subprogram_Declaration): Ensure that the generated spec
5327         and original body share the same SPARK_Pragma aspect/pragma.
5328         * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
5329         procedure to copy SPARK_Mode aspect.
5331 2017-01-20  Bob Duff  <duff@adacore.com>
5333         * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
5334         even in ASIS mode.
5335         * sem_ch13.adb (Resolve_Name): Enable setting the entity to
5336         Empty even in ASIS mode.
5338 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5340         * exp_ch9.adb: minor style fixes in comments.
5341         * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
5342         relative statement introduces an implicit dependency on
5343         Ada.Real_Time.Clock_Time.
5344         * sem_util.adb: Minor reformatting.
5346 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5348         * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
5349         must be treated as delayed aspect even if the expression is
5350         a literal, because the aspect affects the freezing and the
5351         elaboration of the object to which it applies.
5353 2017-01-20  Tristan Gingold  <gingold@adacore.com>
5355         * s-osinte-vxworks.ads (Interrup_Range): New subtype.
5357 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5359         * lib-xref.adb (Generate_Reference): Do not warn about the
5360         presence of a pragma Unreferenced if the entity appears as the
5361         actual in a procedure call that does not come from source.
5363 2017-01-20  Pascal Obry  <obry@adacore.com>
5365         * expect.c, terminals.c: Fix some warnings about unused variables.
5366         * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
5367         of the runtime.
5369 2017-01-20  Bob Duff  <duff@adacore.com>
5371         * exp_attr.adb (Constrained): Apply an access check (check that
5372         the prefix is not null) when the prefix denotes an object of an
5373         access type; that is, when there is an implicit dereference.
5375 2017-01-20  Gary Dismukes  <dismukes@adacore.com>
5377         * s-rident.ads (constant Profile_Info): Remove
5378         No_Calendar from GNAT_Extended_Ravenscar restrictions.
5380 2017-01-20  Tristan Gingold  <gingold@adacore.com>
5382         *  s-maccod.ads: Add pragma No_Elaboration_Code_All
5384 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5386         * ghost.adb (Mark_Ghost_Clause): New routine.
5387         (Prune_Node): Do not prune compilation unit nodes.
5388         (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
5389         This does not touch the node itself, but does prune all its fields.
5390         * ghost.ads (Mark_Ghost_Clause): New routine.
5391         * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
5392         package clause mentions Ghost and non-Ghost packages. Mark a
5393         use package clause as Ghost when it mentions a Ghost package.
5394         (Analyze_Use_Type): Emit an error when a use type clause mentions
5395         Ghost and non-Ghost types. Mark a use type clause as Ghost when
5396         it mentions a Ghost type.
5397         * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
5398         Ghost when it withs a Ghost unit.
5400 2017-01-20  Javier Miranda  <miranda@adacore.com>
5402         * sem_res.adb (Resolve_Call): If a function call
5403         returns a limited view of a type and at the point of the call the
5404         function is not declared in the extended main unit then replace
5405         it with the non-limited view, which must be available. If the
5406         called function is in the extended main unit then no action is
5407         needed since the back-end handles this case.
5409 2017-01-20  Eric Botcazou  <ebotcazou@adacore.com>
5411         * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
5412         (Contains_Subprograms_Refs): ...this.  Adjust comment
5413         for constants.  (Is_Subp_Or_Const_Ref): Rename into...
5414         (Is_Subprogram_Ref): ...this.
5415         (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
5416         Has_Non_Subprograms_Referencer and adjust comment.  Remove
5417         incorrect shortcut for package declarations and bodies.
5419 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5421         * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
5422         base type differs from that of the completion and the private
5423         subtype is an itype (created for a constraint on an access
5424         type e.g.), set Delayed_Freeze on both to prevent out-of-scope
5425         anomalies in gigi.
5427 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5429         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
5430         When inheriting the SPARK_Mode of a prior expression function,
5431         look at the properly resolved entity rather than the initial
5432         candidate which may denote a homonym.
5434 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5436         * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
5437         Precondition or Postcondition, and the context is pragma
5438         Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
5439         and suggest the standard names Assertion_Policy /Pre /Post
5440         instead.
5442 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5444         * sem_ch10.adb, sem_cat.adb: Minor reformatting.
5446 2017-01-20  Javier Miranda  <miranda@adacore.com>
5448         * sem_ch3.adb (Access_Type_Declaration): Protect access to the
5449         Entity attribute.
5450         * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
5451         * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
5452         malformed trees.
5454 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5456         * sem_ch13.adb (Analyze_Aspect_Specification, case
5457         Dynamic_Predicate): If the entity E is a subtype that inherits
5458         a static predicate for its parent P,, the inherited and the
5459         new predicate combine in the generated predicate function,
5460         and E only has a dynamic predicate.
5462 2017-01-20  Tristan Gingold  <gingold@adacore.com>
5464         * s-boustr.ads, s-boustr.adb: New package.
5465         * Makefile.rtl: Add s-boustr.
5467 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5469         * inline.adb (Process_Formals): Qualify the
5470         expression of a return statement when it yields a universal type.
5472 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5474         * freeze.adb (Freeze_All): Freeze the default
5475         expressions of all eligible formal parameters that appear in
5476         entries, entry families, and protected subprograms.
5478 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5480         * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
5481         for illegal inherited Implicit_Dereference aspects with renamed
5482         discriminants.
5484 2017-01-20  Javier Miranda  <miranda@adacore.com>
5486         * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
5487         * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
5488         * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
5489         (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
5490         Set_Prev, Tree_Read): Adding assertion.
5491         * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
5492         * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
5493         (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
5494         Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
5495         Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
5496         Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
5497         Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
5498         Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
5499         Set_ListN_With_Parent): Adding assertion.
5501 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5503         * sem_prag.adb (Process_Convention): Diagnose properly a pragma
5504         import that applies to several homograph subprograms. when one
5505         of them is declared by a subprogram body.
5507 2017-01-20  Justin Squirek  <squirek@adacore.com>
5509         * exp_ch6.adb (Expand_Call): Remove optimization
5510         that nulls out calls to null procedures.
5512 2017-01-20  Yannick Moy  <moy@adacore.com>
5514         * inline.adb (Expand_Inlined_Call): Keep more
5515         precise type of actual for inlining whenever possible. In
5516         particular, do not switch to the formal type in GNATprove mode in
5517         some case where the GNAT backend might require it for visibility.
5519 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5521         * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
5522         aspect Implicit_Dereference can be inherited by a full view if
5523         the partial view has no discriminants, because there is no way
5524         to apply the aspect to the partial view.
5525         (Build_Derived_Record_Type): If derived type renames discriminants
5526         of the parent, the new discriminant inherits the aspect from
5527         the old one.
5528         * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
5529         call through an access discriminant designating a subprogram.
5530         * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
5531         properly a parameterless call through an access discriminant on
5532         the left-hand side of an assignment.
5533         * sem_res.adb (resolve): If an interpreation involves a
5534         discriminant with an implicit dereference and the expression is an
5535         entity, resolution takes place later in the appropriate routine.
5536         * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
5537         access discriminants that designate a subprogram type.
5539 2017-01-20  Pascal Obry  <obry@adacore.com>
5541         * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
5543 2017-01-20  Yannick Moy  <moy@adacore.com>
5545         * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
5546         on implicitly with'ed units in GNATprove mode.
5547         * sinfo.ads (Implicit_With): Document use of flag for implicitly
5548         with'ed units in GNATprove mode.
5550 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
5552         * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
5553         unit Do not report an error on a non-static entity that appears
5554         in the context of a spec expression, such as an aspect expression.
5556 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
5558         * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
5559         (Is_Underlying_Full_View): New routine.
5560         (Set_Is_Underlying_Full_View): New routine.
5561         (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
5562         * einfo.ads Add new attribute Is_Underlying_Full_View.
5563         (Is_Underlying_Full_View): New routine along with pragma Inline.
5564         (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
5565         * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
5566         class-wide types and underlying full views. The first subtype
5567         is used as the working type for all Itypes, not just array base types.
5568         (Build_DIC_Procedure_Declaration): Do not consider
5569         class-wide types and underlying full views. The first subtype
5570         is used as the working type for all Itypes, not just array
5571         base types.
5572         * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
5573         view or an underlying full view without clobbering the attributes
5574         of a previous freeze node.
5575         (Inherit_Freeze_Node): New routine.
5576         * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
5577         full view as such.
5578         (Build_Underlying_Full_View): Mark an underlying full view as such.
5579         * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
5580         full view as such.
5582 2017-01-20  Yannick Moy  <moy@adacore.com>
5584         * sinfo.ads: Document lack of Do_Division_Check flag
5585         on float exponentiation.
5587 2017-01-19  Javier Miranda  <miranda@adacore.com>
5589         * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
5590         identifier attribute of a block-statement node. Required to avoid
5591         assertion failure when building the new containers library.
5593 2017-01-19  Bob Duff  <duff@adacore.com>
5595         * exp_ch3.adb: Update comment.
5597 2017-01-19  Vincent Celier  <celier@adacore.com>
5599         * gprep.adb (Gnatprep): Parse the definition file without
5600         "replace in comments" even when switch -C is used.
5602 2017-01-19  Justin Squirek  <squirek@adacore.com>
5604         * exp_ch9.adb (Is_Pure_Barrier): Create function
5605         Is_Count_Attribute to identify an expansion of the 'Count
5606         attribute.
5608 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5610         * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
5611         statements within an element iterator loop are only analyzed
5612         agter the loop is rewritten. Within a generic the analysis must
5613         be performed in any case to complete name capture.
5615 2017-01-19  Bob Duff  <duff@adacore.com>
5617         * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
5618         before checking for unrecognized pragmas.
5619         Initialize Pname on its declarations; that's always good style.
5621 2017-01-19  Claire Dross  <dross@adacore.com>
5623         * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
5624         body into the tree for GNATprove by setting its Parent field. The
5625         components invariants of composite types are not checked by
5626         the composite type's invariant procedure in GNATprove mode.
5627         (Build_Invariant_Procedure_Declaration): Semi-insert the
5628         declaration into the tree for GNATprove by setting its Parent
5629         field.
5630         * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
5631         the component invariants to the array type  invariant procedure
5632         so that the procedure can be used to  check the array type
5633         invariants if any.
5634         (Freeze_Record_Type): In GNATprove mode, do
5635         not add the component invariants to the record type  invariant
5636         procedure so that the procedure can be used to  check the record
5637         type invariants if any.
5639 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
5641         * lib-xref-spark_specific.adb: Minor reformatting.
5642         * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
5644 2017-01-19  Javier Miranda  <miranda@adacore.com>
5646         * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
5647         Build_Back_End_Aggregate.
5648         (Generate_Aggregate_For_Derived_Type): Code cleanup.
5649         (Prepend_Stored_Values): Code cleanup.
5651 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5653         * sem_ch6.adb (Analyze_Expression_Function): Check for an
5654         incomplete return type after attempting to freeze it, so that
5655         other freeze actiona are generated in the proper order.
5657 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5659         * sem_aggr.adb (Resolve_Aggregate): If the type is a string
5660         type, ie. a type whose component is a character type, and the
5661         aggregate is positional, do not convert into a string literal
5662         if the index type is not an integer type, because the original
5663         type may be required in an enclosing operation.
5665 2017-01-19  Bob Duff  <duff@adacore.com>
5667         * binde.adb, debug.adb: Enable new elaboration order algorithm
5668         by default. -dp switch reverts to the old algorithm.
5670 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
5672         * sem_ch3.adb Add with and use clauses for Exp_Ch7.
5673         (Analyze_Declarations): Create the DIC and Invariant
5674         procedure bodies s after all freezing has taken place.
5675         (Build_Assertion_Bodies): New routine.
5676         * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
5677         and Exp_Util.
5678         (Analyze_Package_Specification): Remove the
5679         generation of the DIC and Invariant procedure bodies. This is
5680         now done by Analyze_Declarations.
5681         * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
5682         procedures are never treated as primitives.
5684 2017-01-19  Yannick Moy  <moy@adacore.com>
5686         * frontend.adb: Analyze inlined bodies and check elaboration
5687         rules in GNATprove mode too.
5688         * sem_elab.adb (Delay_Element): Add Boolean component to save
5689         indication that call is in SPARK code.  (Check_Elab_Calls):
5690         Check elaboration rules in GNATprove mode, and correctly set
5691         the current value of SPARK_Mode.
5692         * lib-xref-spark_specific.adb
5693         (Add_SPARK_Xrefs): Simplify iteration over dereferences.
5695 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5697         * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
5698         checks on the expression for the high bound of concatenation
5699         when checks are disabled, to suppress warnings about potential
5700         constraint errors in restricted runtimes.
5702 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
5704         * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
5705         representation-to-position function as inlined.
5706         * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
5707         the purity of an internally generated entity if it has been
5708         explicitly marked as pure for optimization purposes.
5709         * exp_aggr.adb: Minor reformatting.
5711 2017-01-19  Javier Miranda  <miranda@adacore.com>
5713         * exp_ch6.adb (Expand_Call): Remove side effects on
5714         actuals that are allocators with qualified expression since the
5715         initialization of the object is performed by means of individual
5716         statements (and hence it must be done before the call).
5718 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5720         * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
5721         (Build_Derived_Enumeration_Type): If the derived type inherits a
5722         dynamic predicate from its parent, the bounds of the type must
5723         freeze because an explicit constraint is constructed for the
5724         type and the corresponding range is elaborated now.
5726 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
5728         * sem_attr.ads: minor fix of inconsistent casing in comment
5729         * lib-writ.ads: minor align comments in columns
5730         * sem_ch3.adb: Minor reformatting.
5731         * spark_xrefs.ads: minor fix typo in SPARK-related comment
5732         * table.ads: minor style fix in comment
5733         * lib-xref-spark_specific.adb
5734         (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
5735         * sem_ch12.adb: minor whitespace fix
5736         * freeze.adb: Add comment.
5737         * sem_util.adb (Unique_Name): for instances of
5738         generic subprograms ignore the name of the wrapper package.
5740 2017-01-19  Javier Miranda  <miranda@adacore.com>
5742         * exp_aggr.adb (Resolve_Record_Aggregate):
5743         Factorize code needed for aggregates of limited and unlimited
5744         types in a new routine.
5745         (Pass_Aggregate_To_Back_End): New subprogram.
5747 2017-01-19  Yannick Moy  <moy@adacore.com>
5749         * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
5751 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5753         * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
5754         public, for use elsewhere.
5755         * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
5756         an Inlined_body, recognize a call that uses object notation
5757         and has not been rewritten as a regular call because regular
5758         expansion has not taken place.
5760 2017-01-19  Bob Duff  <duff@adacore.com>
5762         * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
5763         in case of generic formal discrete types, because it causes crashes in
5764         the compiler when built with assertions on.
5766 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
5768         * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
5769         sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
5771 2017-01-19  Bob Duff  <duff@adacore.com>
5773         * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
5774         Increment Warnings_Detected.  It was decrementing, which is
5775         wrong since we just issued a warning message.
5776         * binderr.ads (Errors_Detected, Warnings_Detected): Declare
5777         these variables to be of subtype Nat instead of Int, because
5778         they should never be negative.
5780 2017-01-19  Javier Miranda  <miranda@adacore.com>
5782         * contracts.adb (Build_Postconditions_Procedure): Replace
5783         Generate_C_Code by Modify_Tree_For_C.
5784         * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
5785         Replace Generate_C_Code by Modify_Tree_For_C.
5786         * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
5787         Modify_Tree_For_C.
5788         * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
5789         Generate_C_Code by Modify_Tree_For_C.
5790         * exp_ch4.adb (Expand_Allocator_Expression): Replace
5791         Generate_C_Code by Modify_Tree_For_C.
5792         * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
5793         by Modify_Tree_For_C.
5794         * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
5795         Generate_C_Code by Modify_Tree_For_C.
5796         * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
5797         by Modify_Tree_For_C.
5798         * sinfo.ads (Modify_Tree_For_C): Adding documentation.
5800 2017-01-19  Javier Miranda  <miranda@adacore.com>
5802         * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
5803         subprogram.
5804         (Is_Inlinable_Expression_Function): New subprogram.
5805         * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
5806         to Sem_Util.
5807         (Is_Inlinable_Expression_Function): Moved to Sem_Util.
5809 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5811         * sem_ch4.adb (Diagnose_Call): Improve error message when a
5812         selected component has a prefix that might be interpreted
5813         as a parameterless function call, but none of the candidate
5814         interpretations is parameterless, and there is a hidden homonym
5815         of the prefix that is a package.
5816         * sem_ch8.adb (Find_Selected_Component): If the prefix might be
5817         interpreted as a parameterless function call and its analysis
5818         fails, do not call Analyze_Selected_Component.
5820 2017-01-19  Steve Baird  <baird@adacore.com>
5822         * sem_util.ads: Add new Use_Full_View Boolean parameter to
5823         Get_Index_Bounds.
5824         * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
5825         calls to a newly-defined Scalar_Range_Of_Right_View function.
5827 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
5829         * gnat1drv.adb: minor fix of unbalanced parens in comment
5830         * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
5831         to visible part of the package to allow re-use in GNATprove.
5832         * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
5833         from repeated code of Traverse_Compilation_Unit.
5834         (Traverse_Declaration_Or_Statement): fixed detection of
5835         generic subprograms and packages; also, iteration over case
5836         statement alternatives rewritten to avoid testing if the first
5837         alternative is present (since it must be present due to Ada
5838         syntax restrictions).
5840 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
5842         * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
5843         returning by reference not just for subprogram body stubs,
5844         but for all subprogram cases.
5845         * sem_util.adb: Code reformatting.
5846         (Requires_Transient_Scope): Update the call to Results_Differ.
5847         (Results_Differ): Update the parameter profile and the associated
5848         comment on usage.
5850 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
5852         * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
5853         identifier nodes that do not come from source, to handle properly
5854         dimensionality check within an inlined body which inclddes both
5855         original operands and rewritten operands. This removes spurious
5856         dimensionality errors in the presence of front-end inlining,
5857         as well as in SPARK mode.
5859 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
5861         PR driver/49726
5862         * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
5864 2017-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
5866         * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
5868 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
5870         * doc/gnat_ugn/getting_started_with_gnat.rst,
5871         doc/gnat_ugn/inline_assembler.rst,
5872         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
5873         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
5874         doc/gnat_ugn/about_this_guide.rst,
5875         doc/gnat_ugn/platform_specific_information.rst,
5876         doc/gnat_ugn/example_of_binder_output.rst,
5877         doc/gnat_ugn/gnat_and_program_execution.rst,
5878         doc/gnat_ugn/gnat_utility_programs.rst,
5879         doc/gnat_ugn/the_gnat_compilation_model.rst,
5880         doc/gnat_rm/implementation_defined_attributes.rst,
5881         doc/gnat_rm/compatibility_and_porting_guide.rst,
5882         doc/gnat_rm/standard_library_routines.rst,
5883         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
5884         doc/gnat_rm/implementation_defined_pragmas.rst,
5885         doc/gnat_rm/the_gnat_library.rst,
5886         doc/gnat_rm/obsolescent_features.rst,
5887         doc/gnat_rm/about_this_guide.rst,
5888         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
5889         doc/gnat_rm/implementation_of_ada_2012_features.rst,
5890         doc/gnat_rm/interfacing_to_other_languages.rst,
5891         doc/gnat_rm/implementation_defined_aspects.rst,
5892         doc/gnat_rm.rst: Update documentation.
5893         * gnat_rm.texi, gnat_ugn.texi: Regenerated.
5895 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5897         * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
5898         * scil_ll.adb: Minor style fix in comment.
5899         * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
5900         even if entity is already set, because the node may be renalyzed
5901         after inlining transformations.
5903 2017-01-13  Javier Miranda  <miranda@adacore.com>
5905         * sem_res.adb (Resolve_Call): Do not establish a transient scope
5906         for a call to inlinable expression function (since the call will
5907         be replaced by its returned object).
5908         * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
5909         * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
5910         (Expand_Call): For inlinable expression function call replace the
5911         call by its returned object.
5912         (Is_Inlinable_Expression_Function): New subprogram.
5914 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5916         * checks.adb: Minor typo fix and reformatting.
5918 2017-01-13  Javier Miranda  <miranda@adacore.com>
5920         * contracts.adb (Contract_Only_Subprograms): Remove formal.
5921         (Copy_Original_Specification): Removed.
5922         (Skip_Contract_Only_Subprogram): Move here checks previously
5923         located in the caller of this routine (to leave the code more clean).
5924         (Build_Contract_Only_Subprogram): Code cleanup.
5925         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
5926         (Get_Contract_Only_Missing_Body_Name): Removed.
5928 2017-01-13  Javier Miranda  <miranda@adacore.com>
5930         * sem_ch6.adb (Cloned_Expression): New subprogram.
5931         (Freeze_Expr_Types): Complete previous patch since the expression
5932         of an expression-function may have iterators and loops with
5933         defining identifiers which, as part of the preanalysis of the
5934         expression, may be left decorated with itypes that will not be
5935         available in the tree passed to the backend.
5937 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
5939         * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
5940         conversion to Integer of an expression that is an attribute
5941         reference 'Pos on an enumeration type.
5943 2017-01-13  Bob Duff  <duff@adacore.com>
5945         * atree.ads: Minor comment fix.
5947 2017-01-13  Justin Squirek  <squirek@adacore.com>
5949         * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
5950         calls in accessibility check on return statement.
5952 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
5954         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
5955         Ensure that the input body is a subprogram body before trying to
5956         determine whether it denoted an expression function.  Note that
5957         subprogram body stubs cannot denote expression functions.
5959 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
5961         * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
5962         and typo fixes.
5964 2017-01-13  Javier Miranda  <miranda@adacore.com>
5966         * einfo.ads (Component_Bit_Offset): Fix documentation.
5967         * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
5968         on record holes for components with unknown compile-time offsets.
5970 2017-01-13  Bob Duff  <duff@adacore.com>
5972         * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
5973         * g-locfil.ads: Minor comment fix.
5975 2017-01-13  Bob Duff  <duff@adacore.com>
5977         * binde.adb (Elab_New): New elaboration order algorithm
5978         that is expected to cause fewer ABE issues. This is a work in
5979         progress. The new algorithm is currently disabled, and can be
5980         enable by the -dp switch, or by modifying the Do_Old and Do_New
5981         etc. flags and rebuilding. Experimental code is included to
5982         compare the results of the old and new algorithms.
5983         * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
5984         can have multiple of these tables, so the old and new algorithms
5985         can coexist.
5986         * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
5987         parameter of type array. This avoids the global variable, and
5988         allows bounds checking (which is normally defeated by the tables
5989         packages). It also ensures that the Elab_Order is read-only
5990         to Bindgen.
5991         * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
5992         subprograms that need it, as above.
5993         * debug.adb: Document new -dp switch. Modify doc of old -do
5994         switch.
5995         * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
5996         and Bindgen.  Move writing of closure (-R and -Ra switches)
5997         to Binde; that's more convenient.
5999 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6001         * sem_ch6.adb (Analyze_Expression_Function): If the expression
6002         function is a completion, all entities referenced in the
6003         expression are frozen. As a consequence, a reference to an
6004         uncompleted private type from an enclosing scope is illegal.
6006 2017-01-13  Javier Miranda  <miranda@adacore.com>
6008         * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
6009         (Analyze_Subprogram_Body_Helper): At the occurrence of an
6010         expression function declaration that is a completion, its
6011         expression causes freezing (AI12-0103).
6013 2017-01-13  Vadim Godunko  <godunko@adacore.com>
6015         * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
6016         Reference functions of Ada.Containers.Indefinite_Holders.
6018 2017-01-13  Bob Duff  <duff@adacore.com>
6020         * s-os_lib.ads: Minor comment fixes.
6022 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6024         * exp_ch3.adb (Default_Initialize_Object): Do not default
6025         initialize an object when it is of a task type and restriction
6026         No_Tasking is in effect because the initialization is obsolete.
6027         * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
6028         restriction No_Tasking is in effect.
6029         (Build_Master_Renaming): Do not rename a master when restriction
6030         No_Tasking is in effect.
6032 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6034         * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
6035         the legality of An others clause applies as well to a choice in
6036         an Iterated_component_ association.
6037         (Resolve_Iterated_Component_Association): An others choice
6038         is legal.
6039         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
6040         Iterated_Component_Association is not static.
6042 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6044         * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
6045         control is passed to the expresion handler before the new mode
6046         is set.
6047         * sem_ch12.adb (Analyze_Package_Instantiation,
6048         Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
6049         in case control is passed to the expresion handler before the
6050         new mode is set.
6052 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6054         * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
6055         exp_aggr.adb: Minor reformatting.
6057 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
6059         * inline.adb: Minor reformatting and typo fix.
6061 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6063         * sem_util.ads, sem_util.adb (Choice_List): Move function here
6064         from sem_aggr.adb, for use elsewhere.
6065         * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
6066         * sem_aggr.adb (Resolve_Array_Aggregate): Remove
6067         Iterated_Component_Present.
6068         * exp_aggr.adb: Use Choice_List throughout, to handle
6069         Iterated_Component_Associations.
6070         (Gen_Loop): Generate proper loop for an
6071         Iterated_Component_Association: loop variable has the identifier
6072         of the original association. Generate a loop even for a single
6073         component choice, in order to make loop parameter visible in
6074         expression.
6075         (Flatten): An Iterated_Component_Association is not static.
6077 2017-01-13  Yannick Moy  <moy@adacore.com>
6079         * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
6080         float exponentiation for statically known small negative values
6081         is the reciprocal of the exponentiation for the opposite value
6082         of the exponent.
6083         * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
6084         Ensure that the value of float exponentiation for negative values
6085         is the reciprocal of the exponentiation for the opposite value
6086         of the exponent.
6087         * inline.adb (Expand_Inlined_Call): Fix the count
6088         for the number of generated gotos.
6090 2017-01-13  Yannick Moy  <moy@adacore.com>
6092         * inline.adb: Code cleanup.
6093         * sem_util.adb (Is_OK_Volatile_Context): Add
6094         expression in delay statement as OK for volatile context.
6096 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6098         * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
6099         mode a choice that is a subtype with a static predicate is
6100         replaced by the values it covers. This transformation must not
6101         be performed in ASIS mode, to preserve the source for analysis.
6103 2017-01-13  Justin Squirek  <squirek@adacore.com>
6105         * nlists.ads: Correct minor typo.
6107 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
6109         * sem_ch13.adb: Minor reformatting and typo fix.
6111 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6113         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
6114         Iterated_Component_Association is a named association in an
6115         array aggregate.
6116         * sem_aggr.adb (Resolve_Iterated_Component_Association): New
6117         procedure, subsidiary of Resolve_Array_Aggregate, to analyze
6118         and resolve the discrete choices and the expression of the
6119         new construct.
6120         * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
6121         Loop_Actions and Box_Present are attributes of
6122         N_Iterated_Component_Association nodes. Box_Present is always
6123         False in this case.
6124         * sprint.adb (Sprint_Node): An Iterated_Component_Association
6125         has a Discrete_Choices list, as specified in the RM. A
6126         Component_Association for aggregate uses instead a Choices list.
6127         We have to live with this small inconsistency because the new
6128         construct also has a defining identifier, and there is no way
6129         to merge the two node structures.
6131 2017-01-13  Yannick Moy  <moy@adacore.com>
6133         * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
6134         list of pragmas to remove.  Remove pragmas from the list of
6135         statements in the body to inline.
6136         * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
6138 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6140         * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
6141         Analyze_Declarations, to analyze and resolve the expressions of
6142         aspect specifications in the current declarative list, so that
6143         the expressions have proper entity and type info.  This is needed
6144         for ASIS when there is no subsequent expansion to generate this
6145         semantic information.
6146         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
6147         original expression, to suppress cascaded errors when expression
6148         has been constant-folded.
6149         (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
6150         ASIS mode, because there is no subsequent expansion to decorate
6151         the tree.
6153 2017-01-13  Yannick Moy  <moy@adacore.com>
6155         * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
6156         New function to detect when a call may be inlined or not in
6157         GNATprove mode.
6158         (Expand_Inlined_Call): Ensure that a temporary
6159         is always created in the cases where a type conversion may be
6160         needed on an input parameter in GNATprove mode, so that GNATprove
6161         sees the check to perform.
6162         * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
6163         when not applicable due to actual requiring type conversion
6164         with possible check but no temporary value can be copied for
6165         GNATprove to see the check.
6167 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6169         * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
6170         exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
6171         layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
6172         exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
6173         exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
6174         g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
6175         sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
6176         prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
6177         a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
6178         get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
6179         g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
6180         sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
6181         s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
6182         contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
6183         g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
6184         g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
6185         a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
6186         ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
6187         get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
6188         prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
6189         exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
6190         s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
6191         a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
6192         a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
6193         g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
6194         par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
6195         uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
6196         a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
6197         statements to reflect the new style for case alternatives. Various
6198         code clean up and reformatting.
6200 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
6202         * exp_util.adb: Minor reformatting.
6204 2017-01-13  Yannick Moy  <moy@adacore.com>
6206         * exp_spark.adb: Code cleanup.
6207         * sem_ch9.adb (Analyze_Delay_Until): Resolve
6208         expression so that calls are identified as such inside delay
6209         until.
6211 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6213         * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
6214         * par-ch3.adb (P_Discrete_Choice_List): An
6215         Iterated_Component_Association is an array aggregate component.
6216         * par-ch4.adb (P_Iterated_Component_Association): New procedure.
6217         (Is_Quantified_Expression): New function that performs a lookahead
6218         to distinguish quantified expressions from iterated component
6219         associations.
6220         (P_Aggregate_Or_Paren_Expr): Recognize iterated component
6221         associations.
6222         (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
6223         * sem.adb (Analyze): Handle Iterated_Component_Association.
6224         * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
6225         component associations.
6226         * sinfo.ads, sinfo.adb: Entries for for
6227         N_Iterated_Component_Association and its fields.
6228         * sprint.adb (Sprint_Node_Actual): Handle
6229         N_Iterated_Component_Association.
6231 2017-01-13  Justin Squirek  <squirek@adacore.com>
6233         * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
6234         of the style check until after preanalysis of acutals.
6236 2017-01-13  Yannick Moy  <moy@adacore.com>
6238         * sem_ch13.adb: Minor reformatting.
6239         * par-ch11.adb: minor style fix in whitespace
6240         * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
6241         reduced to Add_Artificial_ALI_File; style fix in declaration of
6242         Text; grammar fix in comment.
6243         * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
6244         * freeze.adb: Cleanup to pass pragma instead of
6245         expression to call.
6246         * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
6247         replace System'To_Address by equivalent call.
6249 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
6251         * bindusg.adb: Improve usage output for -f switch.
6253 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6255         * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
6256         Minor reformatting.
6258 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6260         * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
6261         treat comparisons on strings as legal in a Static_Predicate.
6262         (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
6263         a function call that is the expansion of a string comparison.The
6264         function call is built when compiling the corresponding predicate
6265         function, but the expression has been found legal as a static
6266         predicate during earlier analysis.
6267         * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
6268         properly a function call that is the expansion of a string
6269         comparison operation, in order to recover the Static_Predicate
6270         expression and apply it to a static argument when needed.
6272 2017-01-13  Tristan Gingold  <gingold@adacore.com>
6274         * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
6275         (Open_Read): Re-implement using Open_Read_No_Exception.
6276         (Open_Write): Raise exception in case of error.
6277         * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
6278         * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
6279         reaise exception.
6280         * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
6282 2017-01-13  Yannick Moy  <moy@adacore.com>
6284         * checks.adb: Code cleanup.
6286 2017-01-13  Yannick Moy  <moy@adacore.com>
6288         * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
6289         expression instead of unanalyzed aspect expression for checking
6290         the validity of inheriting an operation. Also copy the expression
6291         being passing it to Build_Class_Wide_Expression, as this call
6292         modifies its argument.
6293         * sem_util.ads Fix comment to reference correct function name
6294         New_Copy_Tree.
6296 2017-01-13  Javier Miranda  <miranda@adacore.com>
6298         * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
6299         when we propagate information about the indexes back to the original
6300         indexing mode and the prefix of the index is a function call, do not
6301         remove any parameter from such call.
6303 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
6305         * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
6306         * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
6307         a build-in-place function whose result type is tagged.
6309 2017-01-13  Yannick Moy  <moy@adacore.com>
6311         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
6312         Do not generate a wrapper when the only candidate is a class-wide
6313         subprogram.
6314         (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
6315         inside a generic context.
6317 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6319         * exp_util.adb (Add_Inherited_Tagged_DIC):
6320         Pass the object parameters of both the parent and the derived
6321         type DIC procedure to the reference replacement circuitry.
6322         (Find_DIC_Type): Modify the circuitry to present the partial
6323         view of a private type in case the private type defines its own
6324         DIC pragma.
6325         (Replace_Object_And_Primitive_References): Add two
6326         optional formal parameters.  Update the comment on usage. Update
6327         the replacement of references to object parameters.
6329 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
6331         * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
6333 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
6335         * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
6336         an out parameter that is a type conversion, independently of th
6337         range check that may apply to the expression of the conversion,
6338         for use in GNATProve.
6340 2017-01-13  Yannick Moy  <moy@adacore.com>
6342         * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
6343         GNATprove_Mode here to Frontend.
6344         * frontend.adb (Frontend): Move the implicit with for System
6345         in GNATprove_Mode here as it ismore correct this way; the old
6346         place only worked by chance, since there were no overloaded names.
6347         * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
6348         * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
6349         four attributes identified in SRM 9(18), add an implicit with
6350         to Ada.Task_Identification.
6351         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
6352         Deal specially with the wrapper introduced for AI05-0071 in GNATprove
6353         mode.
6354         * checks.adb (Apply_Discriminant_Check,
6355         Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
6356         In GNATprove mode, we do not apply the checks, but we still
6357         analyze the expression to possibly issue errors on SPARK
6358         code when a run-time error can be detected at compile time.
6359         (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
6360         in GNATprove mode.
6362 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6364         * expander.adb (Expand): Add a warning about using return
6365         statements in Ghost management code.
6366         * exp_ch3.adb (Freeze_Type): Add a warning about using return
6367         statements in Ghost management code.
6368         * exp_ch7.adb (Build_Invariant_Procedure_Body,
6369         Build_Invariant_Procedure_Declaration): Add a warning about
6370         using return statements in Ghost management code.
6371         * exp_disp.adb (Make_DT): Add a warning about using return
6372         statements in Ghost management code.
6373         * exp_util.adb (Build_DIC_Procedure_Body,
6374         Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
6375         warning about using return statements in Ghost management code.
6376         * freeze.adb (Freeze_Entity): Add a warning about using return
6377         statements in Ghost management code.
6378         * sem.adb (Analyze, Do_Analyze): Add a warning about using return
6379         statements in Ghost management code.
6380         * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
6381         a warning about using return statements in Ghost management code.
6382         * sem_ch5.adb (Analyze_Assignment): Add a warning about using
6383         return statements in Ghost management code.
6384         * sem_ch6.adb (Analyze_Procedure_Call,
6385         Analyze_Subprogram_Body_Helper): Add a warning about using return
6386         statements in Ghost management code.
6387         * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
6388         using return statements in Ghost management code.
6389         * sem_ch12.adb (Analyze_Package_Instantiation,
6390         Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
6391         Instantiate_Subprogram_Body): Add a warning about using return
6392         statements in Ghost management code.
6393         * sem_ch13.adb (Build_Predicate_Functions,
6394         Build_Predicate_Function_Declarations): Add a warning about
6395         using return statements in Ghost management code.
6396         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
6397         Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
6398         Analyze_Pre_Post_Condition_In_Decl_Part):  Add a warning about
6399         using return statements in Ghost management code.
6401 2017-01-13  Tristan Gingold  <gingold@adacore.com>
6403         * s-mmosin-mingw.adb: Fix pragma import.
6405 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
6407         * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
6408         codepeer mode.
6410 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
6412         * atree.adb (Allocate_Initialize_Node): A newly created node is
6413         no longer marked as Ghost at this level.
6414         (Mark_New_Ghost_Node): New routine.
6415         (New_Copy): Mark the copy as Ghost.
6416         (New_Entity): Mark the entity as Ghost.
6417         (New_Node): Mark the node as Ghost.
6418         * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
6419         apply to unanalyzed entities.
6420         (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
6421         entities.
6422         (Set_Is_Checked_Ghost_Entity): This attribute now
6423         applies to all entities as well as unanalyzed entities.
6424         (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
6425         all entities as well as unanalyzed entities.
6426         * expander.adb Add with and use clauses for Ghost.
6427         (Expand): Install and revert the Ghost region associated with the node
6428         being expanded.
6429         * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
6430         (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
6431         (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
6432         (Expand_Freeze_Record_Type): Remove all Ghost-related code.
6433         (Freeze_Type): Install and revert the Ghost region associated
6434         with the type being frozen.
6435         * exp_ch5.adb Remove with and use clauses for Ghost.
6436         (Expand_N_Assignment_Statement): Remove all Ghost-related code.
6437         * exp_ch6.adb Remove with and use clauses for Ghost.
6438         (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
6439         (Expand_N_Subprogram_Body): Remove all Ghost-related code.
6440         * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
6441         Ghost region of the working type.
6442         (Build_Invariant_Procedure_Declaration): Install and revert
6443         the Ghost region of the working type.
6444         (Expand_N_Package_Body): Remove all Ghost-related code.
6445         * exp_ch8.adb Remove with and use clauses for Ghost.
6446         (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
6447         code.
6448         (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
6449         (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
6450         (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
6451         code.
6452         * exp_ch13.adb Remove with and use clauses for Ghost.
6453         (Expand_N_Freeze_Entity): Remove all Ghost-related code.
6454         * exp_disp.adb (Make_DT): Install and revert the Ghost region of
6455         the tagged type. Move the generation of various entities within
6456         the Ghost region of the type.
6457         * exp_prag.adb Remove with and use clauses for Ghost.
6458         (Expand_Pragma_Check): Remove all Ghost-related code.
6459         (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
6460         (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
6461         (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
6462         * exp_util.adb (Build_DIC_Procedure_Body): Install
6463         and revert the Ghost region of the working types.
6464         (Build_DIC_Procedure_Declaration): Install and revert the
6465         Ghost region of the working type.
6466         (Make_Invariant_Call): Install and revert the Ghost region of the
6467         associated type.
6468         (Make_Predicate_Call): Reimplemented. Install and revert the
6469         Ghost region of the associated type.
6470         * freeze.adb (Freeze_Entity): Install and revert the Ghost region
6471         of the entity being frozen.
6472         (New_Freeze_Node): Removed.
6473         * ghost.adb Remove with and use clauses for Opt.
6474         (Check_Ghost_Completion): Update the parameter profile
6475         and all references to formal parameters.
6476         (Ghost_Entity): Update the comment on usage.
6477         (Install_Ghost_Mode): New routines.
6478         (Is_Ghost_Assignment): New routine.
6479         (Is_Ghost_Declaration): New routine.
6480         (Is_Ghost_Pragma): New routine.
6481         (Is_Ghost_Procedure_Call): New routine.
6482         (Is_Ghost_Renaming): Removed.
6483         (Is_OK_Declaration): Reimplemented.
6484         (Is_OK_Pragma): Reimplemented.
6485         (Is_OK_Statement): Reimplemented.
6486         (Is_Subject_To_Ghost): Update the comment on usage.
6487         (Mark_And_Set_Ghost_Assignment): New routine.
6488         (Mark_And_Set_Ghost_Body): New routine.
6489         (Mark_And_Set_Ghost_Completion): New routine.
6490         (Mark_And_Set_Ghost_Declaration): New routine.
6491         (Mark_And_Set_Ghost_Instantiation): New routine.
6492         (Mark_And_Set_Ghost_Procedure_Call): New routine.
6493         (Mark_Full_View_As_Ghost): Removed.
6494         (Mark_Ghost_Declaration_Or_Body): New routine.
6495         (Mark_Ghost_Pragma): New routine.
6496         (Mark_Ghost_Renaming): New routine.
6497         (Mark_Pragma_As_Ghost): Removed.
6498         (Mark_Renaming_As_Ghost): Removed.
6499         (Propagate_Ignored_Ghost_Code): Update the comment on usage.
6500         (Prune_Node): Freeze nodes no longer need special pruning, they
6501         are processed by the general ignored Ghost code mechanism.
6502         (Restore_Ghost_Mode): New routine.
6503         (Set_Ghost_Mode): Reimplemented.
6504         (Set_Ghost_Mode_From_Entity): Removed.
6505         * ghost.ads Add with and use clauses for Ghost.
6506         (Check_Ghost_Completion): Update the parameter profile
6507         along with the comment on usage.
6508         (Install_Ghost_Mode): New routine.
6509         (Is_Ghost_Assignment): New routine.
6510         (Is_Ghost_Declaration): New routine.
6511         (Is_Ghost_Pragma): New routine.
6512         (Is_Ghost_Procedure_Call): New routine.
6513         (Mark_And_Set_Ghost_Assignment): New routine.
6514         (Mark_And_Set_Ghost_Body): New routine.
6515         (Mark_And_Set_Ghost_Completion): New routine.
6516         (Mark_And_Set_Ghost_Declaration): New routine.
6517         (Mark_And_Set_Ghost_Instantiation): New routine.
6518         (Mark_And_Set_Ghost_Procedure_Call): New routine.
6519         (Mark_Full_View_As_Ghost): Removed.
6520         (Mark_Ghost_Pragma): New routine.
6521         (Mark_Ghost_Renaming): New routine.
6522         (Mark_Pragma_As_Ghost): Removed.
6523         (Mark_Renaming_As_Ghost): Removed.
6524         (Restore_Ghost_Mode): New routine.
6525         (Set_Ghost_Mode): Redefined.
6526         (Set_Ghost_Mode_From_Entity): Removed.
6527         * sem.adb (Analyze): Install and revert the Ghost region of the
6528         node being analyzed.
6529         (Do_Analyze): Change the way a clean Ghost
6530         region is installed and reverted.
6531         * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
6532         all Ghost-related code.
6533         (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
6534         (Analyze_Number_Declaration): Remove all Ghost-related code.
6535         (Analyze_Object_Declaration): Install and revert the Ghost region of
6536         a deferred object declaration's completion.
6537         (Array_Type_Declaration): Remove all Ghost-related code.
6538         (Build_Derived_Type): Update the comment on
6539         the propagation of Ghost attributes from a parent to a derived type.
6540         (Derive_Subprogram): Remove all Ghost-related code.
6541         (Make_Class_Wide_Type): Remove all Ghost-related code.
6542         (Make_Implicit_Base): Remove all Ghost-related code.
6543         (Process_Full_View): Install and revert the Ghost region of
6544         the partial view.  There is no longer need to check the Ghost
6545         completion here.
6546         * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
6547         region of the left hand side.
6548         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
6549         all Ghost-related code.
6550         (Analyze_Expression_Function): Remove all Ghost-related code.
6551         (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
6552         (Analyze_Procedure_Call): Install and revert the Ghost region of
6553         the procedure being called.
6554         (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
6555         region of the spec or body.
6556         (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
6557         (Build_Subprogram_Declaration): Remove all Ghost-related code.
6558         (Find_Corresponding_Spec): Remove all Ghost-related code.
6559         (Process_Formals): Remove all Ghost-related code.
6560         * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
6561         the Ghost region of the spec.
6562         (Analyze_Package_Declaration): Remove all Ghost-related code.
6563         * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
6564         Ghost when it aliases a Ghost entity.
6565         (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
6566         a Ghost entity.
6567         (Analyze_Object_Renaming): Mark a renaming as Ghost when
6568         it aliases a Ghost entity.
6569         (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
6570         a Ghost entity.
6571         (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
6572         aliases a Ghost entity.
6573         * sem_ch11.adb Remove with and use clauses for Ghost.
6574         (Analyze_Exception_Declaration): Remove all Ghost-related code.
6575         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
6576         Ghost-related code.
6577         (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
6578         code.
6579         (Analyze_Package_Instantiation): Install and revert the Ghost region
6580         of the package instantiation.
6581         (Analyze_Subprogram_Instantiation): Install
6582         and revert the Ghost region of the subprogram instantiation.
6583         (Instantiate_Package_Body): Code clean up. Install and revert the
6584         Ghost region of the package body.
6585         (Instantiate_Subprogram_Body): Code clean up. Install and revert the
6586         Ghost region of the subprogram body.
6587         * sem_ch13.adb (Build_Predicate_Functions): Install
6588         and revert the Ghost region of the related type.
6589         (Build_Predicate_Function_Declaration): Code clean up. Install
6590         and rever the Ghost region of the related type.
6591         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
6592         Install and revert the Ghost region of the pragma.
6593         (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
6594         Ghost region of the pragma.
6595         (Analyze_Pragma): Install and revert the Ghost region of various
6596         pragmas.  Mark a pragma as Ghost when it is related to a Ghost entity
6597         or encloses a Ghost entity.
6598         (Analyze_Pre_Post_Condition): Install and revert the Ghost
6599         region of the pragma.
6600         (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
6601         Ghost region of the pragma.
6602         * sem_res.adb (Resolve): Remove all Ghost-related code.
6603         * sem_util.adb (Is_Declaration): Reimplemented.
6604         (Is_Declaration_Other_Than_Renaming): New routine.
6605         * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
6606         * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
6607         (Is_Ghost_Pragma): Removed.
6608         (Is_Ignored_Ghost_Pragma): New routine.
6609         (Set_Is_Checked_Ghost_Pragma): New routine.
6610         (Set_Is_Ghost_Pragma): Removed.
6611         (Set_Is_Ignored_Ghost_Pragma): New routine.
6612         * sinfo.ads: Update the documentation on Ghost mode and
6613         Ghost regions.  New attributes Is_Checked_Ghost_Pragma
6614         and Is_Ignored_Ghost_Pragma along with usages in nodes.
6615         Remove attribute Is_Ghost_Pragma along with usages in nodes.
6616         (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
6617         (Is_Ghost_Pragma): Removed along with pragma Inline.
6618         (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
6619         (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
6620         (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
6621         (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
6623 2017-01-12  Tristan Gingold  <gingold@adacore.com>
6625         * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
6626         s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
6628 2017-01-12  Yannick Moy  <moy@adacore.com>
6630         * errout.adb, errout.ads (Initialize): Factor common treatment
6631         in Reset_Warnings.
6632         (Reset_Warnings): New procedure to reset counts related to warnings.
6633         (Record_Compilation_Errors): New variable to store the presence of an
6634         error, used in gnat2why to allow changing the Warning_Mode.
6635         (Compilation_Errors): Use new variable Record_Compilation_Errors to
6636         store the presence of an error.
6638 2017-01-12  Javier Miranda  <miranda@adacore.com>
6640         * sem_ch13.adb (Analyze_Aspect_Specifications):
6641         For Interrupt_Handler and Attach_ Handler aspects, decorate the
6642         internally built reference to the protected procedure as coming
6643         from sources and force its analysis.
6645 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
6647         * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
6648         inherit predicates if any from the first_subtype of the parent,
6649         not from the anonymous parent type.
6650         * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
6651         predicate is not a static subtype.
6653 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
6655         * freeze.adb (Check_Suspicious_Convention): New procedure
6656         performing a warning check on discriminated record types with
6657         convention C or C++. Factored out of procedure Freeze_Record_Type,
6658         and changed to only apply to base types (to avoid spurious
6659         warnings on subtypes). Minor improvement of warning messages
6660         to refer to discriminated rather than variant record types.
6661         (Freeze_Record_Type): Remove code for performing a suspicious
6662         convention check.
6663         (Freeze_Entity): Only call Freeze_Record_Type
6664         on types that aren't declared within any enclosing generic units
6665         (rather than just excluding the type when the innermost scope
6666         is generic). Call Check_Suspicious_Convention whether or not
6667         the type is declared within a generic unit.
6668         * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
6669         * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
6670         from Sem_Ch8).
6672 2017-01-12  Tristan Gingold  <gingold@adacore.com>
6674         * sysdep.c, adaint.c, rtinit.c, ming32.h:
6675         (__gnat_current_codepage): Renamed from CurrentCodePage
6676         (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
6678 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
6680         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
6681         quantified expressions, following AI12-050: the loop parameters
6682         of two quantified expressions are conformant if they have the
6683         same identifier.
6685 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
6687         * gcc-interface/Makefile.in: Clean up VxWorks targets.
6689 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
6691         * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
6692         Hnadle properly the attribute reference when it appears as part
6693         of an expression in another loop aspect.
6695 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
6697         * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
6698         subsidiary of Build_Initialization_Call, to complete generation
6699         of predicate checks on discriminants whose (sub)types have
6700         predicates, and to add checks on variants that do not have an
6701         others clause.
6702         * sem_util.adb (Gather_Components): A missing Others alternative is
6703         not an error when the type of the discriminant is a static predicate
6704         (and coverage has been checked when analyzing the case statement). A
6705         runtime check is generated to verify that a given discriminant
6706         satisfies the predicate (RM 3.8.1. (21.1/2)).
6708 2017-01-12  Yannick Moy  <moy@adacore.com>
6710         * gnat1drv.adb (Adjust_Global_Switches): Only
6711         perform checking of exception mechanism when generating code.
6713 2017-01-12  Justin Squirek  <squirek@adacore.com>
6715         * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
6716         Remove handling of access component with invariant.
6717         (Build_Invariant_Procedure_Declaration): Remove return on class
6718         wide type.
6719         * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
6720         conditional exception for component or array so Has_Own_Invariants
6721         flag is not falsly set.
6722         * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
6723         wide type to have no invariant flags.
6725 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
6727         * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
6728         sem_ch13.adb: Minor reformatting.
6730 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
6732         * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
6733         adjustment primitive when the ancestor type was not properly frozen.
6734         (Gen_Assign): Guard against a missing initialization
6735         primitive when the component type was not properly frozen.
6736         (Initialize_Array_Component): Guard against a missing adjustment
6737         primitive when the component type was not properly frozen.
6738         (Initialize_Record_Component): Guard against a missing adjustment
6739         primitive when the component type was not properly frozen.
6740         (Process_Transient_Component_Completion): The transient object may
6741         not be finalized when its associated type was not properly frozen.
6742         * exp_ch3.adb (Build_Assignment): Guard against a missing
6743         adjustment primitive when the component type was not properly frozen.
6744         (Build_Initialization_Call): Guard against a missing
6745         initialization primitive when the associated type was not properly
6746         frozen.
6747         (Expand_N_Object_Declaration): Guard against a missing
6748         adjustment primitive when the base type was not properly frozen.
6749         (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
6750         body when there is no adjustment primitive available. Create an
6751         empty Deep_Finalize body when there is no finalization primitive
6752         available.
6753         * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
6754         missing finalization primitive when the designated type was
6755         not properly frozen.
6756         (Expand_N_Allocator): Guard against a missing initialization primitive
6757         when the designated type was not properly frozen.
6758         * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
6759         only when the corresponding adjustment primitive is available.
6760         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
6761         adjustment/finalization statements only when there is an available
6762         primitive to carry out the action.
6763         (Build_Initialize_Statements): Generate the initialization/finalization
6764         statements only when there is an available primitive to carry out the
6765         action.
6766         (Make_Adjust_Call): Do not generate a call when the underlying
6767         type is not present due to a possible missing full view.
6768         (Make_Final_Call): Do not generate a call when the underlying
6769         type is not present due to a possible missing full view.
6770         (Make_Finalize_Address_Stmts): Generate an empty body when the
6771         designated type lacks a finalization primitive.
6772         (Make_Init_Call): Do not generate a call when the underlying type is
6773         not present due to a possible missing full view.
6774         (Process_Component_For_Adjust): Add the adjustment call only when the
6775         corresponding adjustment primitive is available.
6776         (Process_Component_For_Finalize): Add the finalization call only when
6777         the corresponding finalization primitive is available.
6778         (Process_Object_Declaration): Use a null statement to emulate a
6779         missing call to the finalization primitive of the object type.
6780         * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
6781         (Make_Final_Call): Update the comment on usage.
6782         (Make_Init_Call): Update the comment on usage.
6783         * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
6785 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
6787         * einfo.ads: Update documentation of Address_Taken.
6788         * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
6789         [Access_Attribute]): Only consider 'Access/'Unchecked_Access
6790         for subprograms when setting Address_Taken flag.
6792 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
6794         * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
6795         Configurable_Run_Time_Mode off when analysing with'ed predefined
6796         libraries.
6798 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
6800         * sem_prag.adb: Minor reformatting.
6801         * sem_util.adb (Unique_Entity): fix result for
6802         bodies of entry families.
6804 2017-01-12  Justin Squirek  <squirek@adacore.com>
6806         * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
6807         Resolve_Suppressible in the pragma Assertion_Policy case.
6808         (Resolve_Suppressible): Created this function to factor out
6809         common code used to resolve Suppress to either Ignore or Check
6810         * snames.ads-tmpl: Add name for Suppressible.
6812 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
6814         * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
6815         reformatting.
6816         * debug.adb: Minor comment fixes.
6818 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
6820         * sem_util.adb (Unique_Entity): For concurrent
6821         bodies that are defined with stubs and complete a declaration
6822         of a single concurrent object return the entity of an implicit
6823         concurrent type, not the entity of the anonymous concurrent
6824         object.
6825         * debug.adb: -gnatd.J is no longer used.
6826         * make.adb (Globalize): Removed, no longer used.
6827         * sem_ch9.adb: minor typo in comment for entry index
6829 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
6831         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
6832         * exp_ch3.adb (Build_Init_Statements): As part of initialising
6833         the value record of a task, set its _Secondary_Stack_Size field
6834         if present.
6835         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
6836         a _Secondary_Stack_Size field in the value record of
6837         the task if a Secondary_Stack_Size rep item is present.
6838         (Make_Task_Create_Call): Include secondary stack size
6839         parameter. If No_Secondary_Stack restriction is in place, passes
6840         stack size of 0.
6841         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
6842         Secondary_Stack_Size.
6843         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
6844         function to define the overhead of the secondary stack.
6845         * s-tarest.adb (Create_Restricted_Task,
6846         Create_Restricted_Task_Sequential): Functions now include
6847         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
6848         * s-tarest.adb (Create_Restricted_Task,
6849         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
6850         include Secondary_Stack_Size parameter.
6851         (Task_Wrapper): Secondary stack now allocated to the size specified by
6852         the Secondary_Stack_Size parameter in the task's ATCB.
6853         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
6854         Secondary_Stack_Size component.
6855         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
6856         Create_Restricted_Task_Sequential): Function now include
6857         Secondary_Stack_Size parameter.
6858         (Task_Wrapper): Secondary stack now allocated to the size
6859         specified by the Secondary_Stack_Size parameter in the task's
6860         ATCB.
6861         * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
6862         to include Secondary_Stack_Size parameter.
6863         * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
6864         Secondary_Stack_Size aspect, turning the aspect into its corresponding
6865         internal attribute.
6866         (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
6867         * snames.adb-tmpl, snames.ads-tmpl: Added names
6868         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
6869         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
6871 2017-01-12  Yannick Moy  <moy@adacore.com>
6873         * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
6874         subtree.
6876 2017-01-12  Justin Squirek  <squirek@adacore.com>
6878         * exp_attr.adb (Expand_N_Attribute_Reference):
6879         Fix Finalization_Size case by properly resolving the type after
6880         rewritting the node.
6882 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
6884         * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
6885         the tree.
6886         (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
6887         * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
6888         exp_sel.ads: Minor reformatting.
6890 2017-01-12  Justin Squirek  <squirek@adacore.com>
6892         * exp_ch6.adb (Expand_Call): Add guard to prevent
6893         invariant checks from being created for internally generated
6894         subprograms.
6896 2017-01-12  Bob Duff  <duff@adacore.com>
6898         * lib-writ.ads: Remove incorrect comment.
6900 2017-01-12  Javier Miranda  <miranda@adacore.com>
6902         * debug.adb (-gnatd.K): Enable generation of contract-only
6903         procedures in CodePeer mode.
6904         * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
6905         New subprogram.
6906         (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
6907         set.
6908         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
6909         subprogram.
6910         (Get_Contract_Only_Missing_Body_Name): New subprogram.
6911         (Get_Contract_Only_Body): New subprogram.
6912         (Set_Contract_Only_Body): New subprogram.
6913         (Is_Contract_Only_Body): New subprogram.
6914         (Set_Is_Contract_Only_Body): New subprogram.
6915         (SCIL_Nodes): Replace table by hash-table.
6917 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
6919         * exp_ch6.adb: Minor reformatting.
6920         * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
6922 2017-01-12  Bob Duff  <duff@adacore.com>
6924         * binde.adb (Forced): New reason for a dependence.
6925         (Force_Elab_Order): Implementation of the new switch.
6926         * binde.ads: Minor comment fixes.
6927         * bindusg.adb: Add -f switch. Apparently, there was an -f switch
6928         long ago that is no longer supported; removed comment about that.
6929         * opt.ads (Force_Elab_Order_File): Name of file specified for
6930         -f switch.
6931         * switch-b.adb: Parse -f switch.
6933 2017-01-12  Justin Squirek  <squirek@adacore.com>
6935         * exp_ch6.adb (Check_View_Conversion): Created this function
6936         to properly chain calls to check type invariants that may be
6937         present in a subprogram call after the subprogram.
6938         (Expand_Call): Add a conditional to identify when a view conversion
6939         needs to be checked.
6940         * nlists.adb, nlists.ads (Prepend_New): New routine.
6941         (Prepend_New_To): New routine.
6943 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
6945         * sinfo.ads: Minor reformatting.
6947 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
6949         * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
6950         reformatting.
6952 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
6954         * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
6955         variable Definite. Create a local object and pass its 'Access to the
6956         BIP function when the result type is either definite or it does not
6957         require any finalization or secondary stack management.
6959 2017-01-12  Bob Duff  <duff@adacore.com>
6961         * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
6962         exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
6963         frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
6964         par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
6965         sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
6966         sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
6967         sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
6968         sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
6969         Change name to Pragma_Name_Unmapped.
6970         (Pragma_Name_Mapped): Change name to Pragma_Name.
6971         This is because the "mapped" version should be the usual case.
6973 2017-01-09  Hristian Kirtchev  <kirtchev@adacore.com>
6975         * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
6976         Is_Default_Init_Cond_Procedure, and
6977         Has_Inherited_Default_Init_Cond.  Add uses of flags
6978         Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
6979         (Default_Init_Cond_Procedure): Removed.
6980         (DIC_Procedure): New routine.
6981         (Has_Default_Init_Cond): Removed.
6982         (Has_DIC): New routine.
6983         (Has_Inheritable_Invariants): The attribute applies to the base type.
6984         (Has_Inherited_Default_Init_Cond): Removed.
6985         (Has_Inherited_DIC): New routine.
6986         (Has_Inherited_Invariants): The attribute applies to the base type.
6987         (Has_Own_DIC): New routine.
6988         (Has_Own_Invariants): The attribute applies to the base type.
6989         (Is_Default_Init_Cond_Procedure): Removed.
6990         (Is_DIC_Procedure): New routine.
6991         (Set_Default_Init_Cond_Procedure): Removed.
6992         (Set_DIC_Procedure): New routine.
6993         (Set_Has_Default_Init_Cond): Removed.
6994         (Set_Has_Inheritable_Invariants): The attribute applies
6995         to the base type.
6996         (Set_Has_Inherited_Default_Init_Cond): Removed.
6997         (Set_Has_Inherited_DIC): New routine.
6998         (Set_Has_Inherited_Invariants): The attribute applies to the base type.
6999         (Set_Has_Own_DIC): New routine.
7000         (Set_Has_Own_Invariants): The attribute applies to the base type.
7001         (Set_Is_Default_Init_Cond_Procedure): Removed.
7002         (Set_Is_DIC_Procedure): New routine.
7003         (Write_Entity_Flags): Update the output of all flags related to
7004         default initial condition.
7005         * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
7006         of the call to the DIC procedure.
7007         (Freeze_Type): Generate the body of the DIC procedure.
7008         * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
7009         all occurrences of Create_Append with Append_New_To. Do
7010         not generate an invariant procedure for a class-wide type.
7011         The generated body acts as a freeze action of the working type.
7012         (Build_Invariant_Procedure_Declaration): Do not generate an
7013         invariant procedure for a class-wide type.
7014         (Create_Append): Removed.
7015         * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
7016         sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
7017         class-wide pre/postcondition description and data structures from
7018         Sem_Prag.
7019         (Build_Class_Wide_Expression): Moved from Sem_Prag.
7020         (Build_DIC_Call): New routine.
7021         (Build_DIC_Procedure_Body): New routine.
7022         (Build_DIC_Procedure_Declaration): New routine.
7023         (Entity_Hash): Moved from Sem_Prag.
7024         (Find_DIC_Type): New routine.
7025         (Update_Primitives_Mapping): Reimplemented.
7026         (Update_Primitives_Mapping_Of_Types): New routine.
7027         * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
7028         (Build_DIC_Call): New routine.
7029         (Build_DIC_Procedure_Body): New routine.
7030         (Build_DIC_Procedure_Declaration): New routine.
7031         (Update_Primitives_Mapping): Moved from Sem_Prag.
7032         (Update_Primitives_Mapping_Of_Types): New routine.
7033         * nlists.adb (Append_New): New routine.
7034         (Append_New_To): New routine.
7035         * nlists.ads (Append_New): New routine.
7036         (Append_New_To): New routine.
7037         * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
7038         of DIC procedures here. This is now done at the end of the
7039         visible declarations, private declarations, and at the freeze
7040         point of a type.
7041         (Analyze_Private_Extension_Declaration):
7042         A private extension inherits the DIC pragma of a parent type.
7043         (Analyze_Subtype_Declaration): No need to propagate invariant
7044         attributes to a subtype as those apply to the base type.
7045         (Build_Derived_Record_Type): No need to inherit invariants here
7046         as this is now done in Build_Derived_Type.
7047         (Build_Derived_Type): Inherit both the DIC pragma and invariants from
7048         a parent type.
7049         (Process_Full_View): Update the propagation of DIC attributes.
7050         (Propagate_Default_Init_Cond_Attributes): Removed.
7051         * sem_ch7.adb Add with and use clauses for Exp_Util.
7052         (Analyze_Package_Specification): Create the body of the DIC
7053         procedure at the end of the visible and private declarations.
7054         (Preserve_Full_Attributes): Propagate DIC attributes.
7055         * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
7056         DIC attributes.
7057         (Analyze_Task_Type_Declaration): Propagate DIC attributes.
7058         * sem_elab.adb (Check_A_Call): Update the call to
7059         Is_Nontrivial_Default_Init_Cond_Procedure.
7060         * sem_prag.adb Remove the with and use clauses for
7061         GNAT.HTable. Move the handling of class- wide pre/postcondition
7062         description and data structures to Exp_Util.
7063         (Analyze_Pragma): Create the declaration of the DIC procedure. There
7064         is no need to propagate invariant-related attributes at this point
7065         as this is done in Build_Invariant_Procedure_Declaration.
7066         (Build_Class_Wide_Expression): Moved to Exp_Util.
7067         (Entity_Hash): Moved to Exp_Util.
7068         (Update_Primitives_Mapping): Moved to Exp_Util.
7069         * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
7070         (Update_Primitives_Mapping): Moved to Exp_Util.
7071         * sem_util.adb: Remove with and use clauses for Ghost
7072         and Sem_Ch13.
7073         (Build_Default_Init_Cond_Call): Removed.
7074         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
7075         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
7076         (Get_Views): Reimplemented.
7077         (Has_Full_Default_Initialization): Reimplement the section on DIC.
7078         (Inherit_Default_Init_Cond_Procedure): Removed.
7079         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
7080         (Is_Nontrivial_DIC_Procedure): New routine.
7081         (Is_Verifiable_DIC_Pragma): New routine.
7082         (Propagate_DIC_Attributes): New routine.
7083         * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
7084         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
7085         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
7086         (Inherit_Default_Init_Cond_Procedure): Removed.
7087         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
7088         (Is_Nontrivial_DIC_Procedure): New routine.
7089         (Is_Verifiable_DIC_Pragma): New routine.
7090         (Propagate_DIC_Attributes): New routine.
7091         * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
7092         on DIC.
7093         * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
7094         usage in nodes.
7095         (Expression_Copy): New routine along with pragma Inline.
7096         (Set_Expression_Copy): New routine along with pragma Inline.
7098 2017-01-06  Bob Duff  <duff@adacore.com>
7100         * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
7101         "Bind_Main_Program" to "not Bind_For_Library", because otherwise
7102         we won't generate the call to s_stalib_adafinal when the main
7103         is not written in Ada.
7105 2017-01-06  Bob Duff  <duff@adacore.com>
7107         * sem_prag.adb: Minor: remove pragma Warnings.
7109 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7111         * Makefile.rtl: Do not compile s-stchop by default.
7113 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
7115         * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
7116         sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
7117         snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
7118         s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
7119         Reverted previous change for now.
7121 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7123         * exp_ch3.adb (Build_Initialization_Call): Apply predicate
7124         check to default discriminant value if checks are enabled.
7125         (Build_Assignment): If type of component has static predicate,
7126         apply check to its default value, if any.
7128 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
7130         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
7131         * exp_ch3.adb (Build_Init_Statements): As part of initialising
7132         the value record of a task, set its _Secondary_Stack_Size field
7133         if present.
7134         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
7135         a _Secondary_Stack_Size field in the value record of
7136         the task if a Secondary_Stack_Size rep item is present.
7137         (Make_Task_Create_Call): Include secondary stack size
7138         parameter. If No_Secondary_Stack restriction is in place, passes
7139         stack size of 0.
7140         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
7141         Secondary_Stack_Size.
7142         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
7143         function to define the overhead of the secondary stack.
7144         * s-tarest.adb (Create_Restricted_Task,
7145         Create_Restricted_Task_Sequential): Functions now include
7146         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
7147         * s-tarest.adb (Create_Restricted_Task,
7148         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
7149         now include Secondary_Stack_Size parameter.
7150         (Task_Wrapper):
7151         Secondary stack now allocated to the size specified by the
7152         Secondary_Stack_Size parameter in the task's ATCB.
7153         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
7154         Secondary_Stack_Size component.
7155         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
7156         Create_Restricted_Task_Sequential): Function now include
7157         Secondary_Stack_Size parameter.
7158         (Task_Wrapper): Secondary stack
7159         now allocated to the size specified by the Secondary_Stack_Size
7160         parameter in the task's ATCB.
7161         * sem_ch13.adb (Analyze_Aspect_Specification): Add support
7162         for Secondary_Stack_Size aspect, turning the aspect into its
7163         corresponding internal attribute.
7164         (Analyze_Attribute_Definition):
7165         Process Secondary_Stack_Size attribute.
7166         * snames.adb-tmpl, snames.ads-tmpl: Added names
7167         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
7168         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
7170 2017-01-06  Pascal Obry  <obry@adacore.com>
7172         * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
7173         Sequential_IO and Direct_IO.
7175 2017-01-06  Bob Duff  <duff@adacore.com>
7177         * snames.ads-tmpl (Renamed): New name for the pragma argument.
7178         * par-ch2.adb: Allow the new pragma (with analysis deferred
7179         to Sem_Prag).
7180         * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
7181         Keep a mapping from new pragma names to old names.
7182         * sem_prag.adb: Check legality of pragma Rename_Pragma, and
7183         implement it by calling Map_Pragma_Name.
7184         * checks.adb, contracts.adb, einfo.adb, errout.adb,
7185         * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
7186         * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
7187         * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
7188         * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
7189         * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
7190         * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
7191         as appropriate.
7193 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7195         * exp_ch9.adb: Minor reformatting.
7197 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7199         * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
7200         * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
7201         (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
7202         (unused).
7203         * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
7204         Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
7205         * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
7206         Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
7208 2017-01-06  Bob Duff  <duff@adacore.com>
7210         * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
7211         dummy implementation of Map_Pragma_Name.
7213 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7215         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
7216         entry_body variable constant.
7217         * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
7218         * s-tpoben.ads (Protected_Entry_Body_Access): Now access
7219         to constant.
7220         * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
7221         now access to constant.
7223 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
7225         * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
7226         reformatting and typo fixes.
7228 2017-01-06  Bob Duff  <duff@adacore.com>
7230         * snames.ads-tmpl: New names for pragma renaming.
7231         * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
7232         * par-prag.adb: Add new pragma name to case statement.
7233         * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
7234         of the pragma.
7235         * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
7236         Dummy implementation of Pragma_Name_Mapped.
7238 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7240         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
7241         better detect call within an entry_wrapper.
7242         * sem_res.adb (Resolve_Call): A protected call within an
7243         entity_wrapper is analyzed in the context of the protected
7244         object but corresponds to a pre-analysis and is not an access
7245         before elaboration.
7246         * sem_attr.adb: Minor reformatting.
7248 2017-01-06  Justin Squirek  <squirek@adacore.com>
7250         * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
7251         Finalization_Size to allow a prefix of any non-class-wide type.
7252         * sem_attr.ads Modify comment for Finalization_Size to include
7253         definite type use case.
7255 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7257         * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
7258         on procedures that are wrappers created for entries that have
7259         preconditions.
7260         * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
7261         body is an entry_wrapper, compile it in the context of the
7262         synchronized type, because a precondition may refer to funtions
7263         of the type.
7264         * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
7265         body entity.
7266         * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
7267         within an Entry_Wrapper this is an external call whose target
7268         is the synchronized object that is the actual in the call to
7269         the wrapper.
7271 2017-01-06  Yannick Moy  <moy@adacore.com>
7273         * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
7274         in tree, which means not analyzing the previous prefix if the node has
7275         been rewritten into its prefix.
7277 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
7279         * s-tpobop.adb: Minor reformatting.
7281 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7283         * checks.adb (Ensure_Valid): Do not generate a validity check
7284         within a generated predicate function, validity checks will have
7285         been applied earlier when required.
7287 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7289         * s-tpoben.ads (Protection_Entries): Add comment and reorder
7290         components for performances.
7291         * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
7292         semantic.
7294 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7296         * sem_eval.adb (Check_Expression_Against_Static_Predicate):
7297         If expression is compile-time known and obeys a static predicate
7298         it must be labelled as static, to prevent spurious warnings and
7299         run-time errors, e.g. in case statements. This is relevant when
7300         the expression is the result of constant-folding a type conversion
7301         whose expression is a variable with a known static value.
7303 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7305         * exp_attr.adb, sem_attr.ads: Minor reformatting.
7307 2017-01-06  Justin Squirek  <squirek@adacore.com>
7309         * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
7310         expansion of Finalization_Size attribute.
7311         * sem_attr.adb (Analyze_Attribute): Add entry to check the
7312         semantics of Finalization_Size.
7313         (Eval_Attribute): Add null entry for Finalization_Size.
7314         * sem_attr.ads: Add Finalization_Size to the implementation
7315         dependent attribute list.
7316         * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
7318 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7320         * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
7321         iterator specification with a serious syntactic error, transform
7322         construct into an infinite loop in order to continue analysis
7323         and prevent a compiler abort.
7325 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7327         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
7328         max_queue_lengths_array if unused.
7330 2017-01-06  Bob Duff  <duff@adacore.com>
7332         * errout.adb (Set_Msg_Text): Protect against out-of-bounds
7333         array access, in case "\" is at the end of Text.
7334         * stylesw.adb (Set_Style_Check_Options): Don't include input
7335         characters in the error message template, because they could
7336         be control characters such as "\", which Errout will try to
7337         interpret.
7339 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7341         * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
7342         For a private type examine the visible declarations that follow
7343         the partial view, not just the private declarations that follow
7344         the full view.
7346 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7348         * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
7349         code cleanup.
7351 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7353         * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
7354         alias of the inherited op is the parent iterator, no need to
7355         examine dispatch table positions which might not be established
7356         yet if type is not frozen.
7357         * sem_disp.adb (Check_Controlling_Formals): The formal of a
7358         predicate function may be a subtype of a tagged type.
7359         * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
7360         of representation items for the completion of a type extension
7361         where a predicate applies to the partial view.
7362         * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
7363         parameter that designates function whose actual receives a
7364         predicate check, to improve warning message when the check will
7365         lead to infinite recursion.
7366         * sem_res.adb (Resolve_Actuals): Pass additional parameter to
7367         Apply_Predicate_Check.
7369 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7371         * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
7372         Gnat_Extended_Ravenscar.
7373         * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
7375 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
7377         * sem_util.ads: Minor typo fix and reformatting.
7379 2017-01-06  Yannick Moy  <moy@adacore.com>
7381         * ghost.adb Minor fixing of references to SPARK RM.
7382         (Check_Ghost_Context): Check whether reference is to a lvalue
7383         before issuing an error about violation of SPARK RM 6.9(13)
7384         when declaration has Ghost policy Check and reference has Ghost
7385         policy Ignore.
7386         * sem_util.adb Minor indentation.
7387         * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
7388         Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
7389         * sem_util.ads (Unique_Defining_Entity): Document the result
7390         for package body stubs.
7392 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7394         * raise-gcc.c (abort): Macro to call Abort_Propagation.
7395         * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
7396         constant.
7397         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
7398         Do not generate the Entry_Max_Queue_Lengths_Array if all default
7399         values.
7400         * exp_util.adb (Corresponding_Runtime_Package): Consider
7401         Max_Queue_Length pragma.
7403 2017-01-06  Justin Squirek  <squirek@adacore.com>
7405         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
7406         Remove declaration generation in the case of
7407         System_Tasking_Protected_Objects_Single_Entry being used,
7408         and add a warning message when this is detected to occur.
7409         (Make_Initialize_Protection): Remove reference pass in the case
7410         of System_Tasking_Protected_Objects_Single_Entry.
7411         * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
7412         * s-tposen.adb (Initialize_Protection_Entry): Remove
7413         Entry_Queue_Max parameter.
7414         * s-tposen.ads: Remove the types use to store the entry queue
7415         maximum.
7416         * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
7418 2017-01-06  Yannick Moy  <moy@adacore.com>
7420         * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
7421         behavior of function, to also accept out of range positions
7422         and raise Constraint_Error in such case, and to copy sloc from
7423         literal if No_Location passed as location.
7424         * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
7425         of functions to raise Constraint_Error in case of value not in
7426         appropriate range.
7428 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7430         * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
7431         Invalidate_Stack_Cache.
7433 2017-01-06  Eric Botcazou  <ebotcazou@adacore.com>
7435         * s-os_lib.adb: Minor fix to the signature of Readlink.
7437 2017-01-06  Javier Miranda  <miranda@adacore.com>
7439         * sem_ch6.adb (Conforming_Types): Handle another
7440         confusion between views in a nested instance with an actual
7441         private type whose full view is not in scope.
7443 2017-01-06  Arnaud Charlet  <charlet@adacore.com>
7445         * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
7446         mark a rewritten if statement as explicit (Comes_From_Source).
7448 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
7450         * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
7452 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7454         * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
7456 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7458         * sem_case.adb: Minor reformatting.
7460 2017-01-06  Thomas Quinot  <quinot@adacore.com>
7462         * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
7464 2017-01-06  Justin Squirek  <squirek@adacore.com>
7466         * aspects.adb: Register aspect in Canonical_Aspect.
7467         * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
7468         into respective tables.
7469         * einfo.ads, einfo.adb: Add a new attribute for
7470         handling the parameters for Pragma_Max_Entry_Queue
7471         (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
7472         for accessing and setting were added as well.
7473         * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
7474         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
7475         declaration for pramga arguments and store them in the protected
7476         type node.
7477         (Make_Initialize_Protection): Pass a reference to
7478         the Entry_Max_Queue_Lengths_Array in the protected type node to
7479         the runtime.
7480         * rtsfind.adb: Minor grammar fix.
7481         * rtsfind.ads: Register new types taken from the
7482         runtime libraries RE_Protected_Entry_Queue_Max and
7483         RE_Protected_Entry_Queue_Max_Array
7484         * s-tposen.adb, s-tpoben.adb
7485         (Initialize_Protection_Entry/Initialize_Protection_Entries):
7486         Add extra parameter and add assignment to local object.
7487         * s-tposen.ads, s-tpoben.ads: Add new types to
7488         store entry queue maximums and a field to the entry object record.
7489         * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
7490         for Aspect_Max_Queue_Length.
7491         (Check_Aspect_At_Freeze_Point):
7492         Add aspect to list of aspects that don't require delayed analysis.
7493         * sem_prag.adb (Analyze_Pragma): Add case statement for
7494         Pragma_Max_Queue_Length, check semantics, and register arugments
7495         in the respective entry nodes.
7496         * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
7497         and Has_Max_Queue_Length
7498         * snames.ads-tmpl: Add constant for the new aspect-name
7499         Name_Max_Queue_Length and corrasponding pragma.
7501 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7503         * exp_util.adb (Is_Controlled_Function_Call):
7504         Reimplemented. Consider any node which has an entity as the
7505         function call may appear in various ways.
7507 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7509         * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
7510         an unchecked type conversion when performing a view conversion
7511         to/from a private type. In all other cases use a regular type
7512         conversion to ensure that any relevant checks are properly
7513         installed.
7515 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
7517         * sem_prag.adb, sem_ch8.adb: Minor reformatting.
7519 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
7521         * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
7522         error on case expression that is an entity, when coverage is
7523         incomplete and entity has a static value obtained by local
7524         propagation.
7525         (Handle_Static_Predicate): New procedure, subsidiary of
7526         Check_Choices, to handle case alternatives that are either
7527         subtype names or subtype indications involving subtypes that
7528         have static predicates.
7530 2017-01-06  Thomas Quinot  <quinot@adacore.com>
7532         * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
7533         (GNAT.Socket): Add support for Busy_Polling and Generic_Option
7535 2017-01-06  Bob Duff  <duff@adacore.com>
7537         * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
7538         Elaborate_All(P) to P itself. That could happen in obscure cases,
7539         and always introduced a cycle (P body must be elaborated before
7540         P body).
7541         * lib-writ.ads: Comment clarification.
7542         * ali-util.ads: Minor comment fix.
7543         * ali.adb: Minor reformatting.
7545 2017-01-06  Tristan Gingold  <gingold@adacore.com>
7547         * a-exexpr-gcc.adb: Improve comment.
7549 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
7551         * s-linux-mips.ads: Use correct signal and errno constants.
7552         (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
7554 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
7556         * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
7557         * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
7558         sections.
7560 2017-01-01  Eric Botcazou  <ebotcazou@adacore.com>
7562         * gnatvsn.ads: Bump copyright year.
7564 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
7566         * gnat_ugn.texi: Bump @copying's copyright year.
7567         * gnat_rm.texi: Likewise.
7569 Copyright (C) 2017 Free Software Foundation, Inc.
7571 Copying and distribution of this file, with or without modification,
7572 are permitted in any medium without royalty provided the copyright
7573 notice and this notice are preserved.