1 2016-06-22 Arnaud Charlet <charlet@adacore.com>
3 * spark_xrefs.ads (Scope_Num): type refined to positive integers.
4 * lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope):
5 moved into scope of Collect_SPARK_Xrefs.
6 (Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs;
7 now uses Dspec and Scope_Id from Collect_SPARK_Xrefs.
8 (Collect_SPARK_Xrefs): refactored to avoid retraversing the list
10 (Traverse_Compilation_Unit): refactored as a generic procedure.
11 * types.ads (Unit_Number_Type): range refined.
13 2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
15 * lib-xref-spark_specific.adb, a-cuprqu.ads, sem_ch6.adb: Minor
18 2016-06-22 Eric Botcazou <ebotcazou@adacore.com>
20 * sem_util.ads (Address_Value): Declare new function.
21 * sem_util.adb (Address_Value): New function extracted
22 unmodified from Apply_Address_Clause_Check, which returns the
23 underlying value of the expression of an address clause.
24 * checks.adb (Compile_Time_Bad_Alignment): Delete.
25 (Apply_Address_Clause_Check): Call Address_Value on
26 the expression. Do not issue the main warning here and
27 issue the secondary warning only when the value of the
28 expression is not known at compile time.
29 * sem_ch13.adb (Address_Clause_Check_Record): Add A component and
30 adjust the description.
31 (Analyze_Attribute_Definition_Clause): In the case
32 of an address, move up the code creating an entry in the table of
33 address clauses. Also create an entry for an absolute address.
34 (Validate_Address_Clauses): Issue the warning for absolute
35 addresses here too. Tweak condition associated with overlays
38 2016-06-22 Ed Schonberg <schonberg@adacore.com>
40 * sem_ch13.adb (Is_Predicate_Static): An inherited predicate
41 can be static only if it applies to a scalar type.
43 2016-06-22 Ed Schonberg <schonberg@adacore.com>
45 * exp_util.adb (Adjust_Result_Type): Convert operand to base
46 type to prevent spurious constraint checks on subtypes of Boolean.
48 2016-06-22 Bob Duff <duff@adacore.com>
50 * debug.adb: Document debug switch -gnatd.o.
51 * sem_elab.adb (Check_Internal_Call): Debug switch -gnatd.o
52 now causes a more conservative treatment of indirect calls,
53 treating P'Access as a call to P in more cases. We Can't make
54 this the default, because it breaks common idioms, for example
56 * sem_util.adb: Add an Assert.
58 2016-06-22 Bob Duff <duff@adacore.com>
60 * a-cuprqu.ads, a-cuprqu.adb: Completely rewrite this package. Use
61 red-black trees, which gives O(lg N) worst-case performance on
62 Enqueue and Dequeue. The previous version had O(N) Enqueue in
65 2016-06-22 Arnaud Charlet <charlet@adacore.com>
67 * sem_warn.adb: minor style fix in comment.
68 * spark_xrefs.ads (Scope_Num): type refined to positive integers.
69 * lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope):
70 moved into scope of Collect_SPARK_Xrefs.
71 (Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs;
72 now uses Dspec and Scope_Id from Collect_SPARK_Xrefs.
73 (Collect_SPARK_Xrefs): refactored to avoid retraversing the list
75 * sem_ch3.adb (Build_Discriminal): Set Parent of the discriminal.
77 2016-06-22 Arnaud Charlet <charlet@adacore.com>
79 * lib-xref-spark_specific.adb (Generate_Dereference): Assignment to not
80 commented local variables replaced with direct uses of their values.
82 2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
84 * exp_ch7.adb (Add_Invariant): Replace the
85 current type instance with the _object parameter even in ASIS mode.
86 (Build_Invariant_Procedure_Body): Do not insert the
87 invariant procedure body into the tree for ASIS and GNATprove.
88 (Build_Invariant_Procedure_Declaration): Do not insert the
89 invariant procedure declaration into the tree for ASIS and
91 * lib-xref-spark_specific.adb (Add_SPARK_Scope): Update comment.
93 2016-06-22 Ed Schonberg <schonberg@adacore.com>
95 * sem_ch6.adb (Set_Actual_Subtypes): If the type of the actual
96 has predicates, the actual subtype must be frozen properly
97 because of the generated tests that may follow. The predicate
98 may be specified by an explicit aspect, or may be inherited in
101 2016-06-22 Ed Schonberg <schonberg@adacore.com>
103 * exp_ch4.adb (In_Range_Chec)): New predicate, subsidiary of
104 Expand_N_In: within an expanded range check that might raise
105 Constraint_Error do not generate a predicate check as well. It
106 is redundant because the context will add an explicit predicate
107 check, and it will raise the wrong exception if it fails.
108 * lib-xref-spark_specific.adb (Add_SPARK_File): Remove useless checks
109 since dependency units always have an associated compilation unit.
111 2016-06-22 Arnaud Charlet <charlet@adacore.com>
113 * lib.ads: Code cleanup.
114 * inline.adb: Type refinement for a counter variable.
115 * lib-xref-spark_specific.adb (Add_SPARK_File): removal of no-op code.
118 2016-06-21 Eric Botcazou <ebotcazou@adacore.com>
120 * gcc-interface/decl.c (set_nonaliased_component_on_array_type): New
122 (set_reverse_storage_order_on_array_type): Likewise.
123 (gnat_to_gnu_entity) <E_Array_Type>: Call them to set the flags.
124 <E_Array_Subtype>: Likewise.
125 <E_String_Literal_Subtype>: Likewise.
126 (substitute_in_type) <ARRAY_TYPE>: Likewise.
127 * gcc-interface/utils.c (gnat_pushdecl): Always create a variant for
128 the DECL_ORIGINAL_TYPE of a type.
130 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
132 * make.adb, gnatbind.adb, g-socket.adb, sem_ch13.adb: Minor
134 * lib.ads, sem_util.adb: Minor typo in comment.
136 2016-06-20 Yannick Moy <moy@adacore.com>
138 * sem_prag.adb, sem_prag.ads (Build_Pragma_Check_Equivalent):
139 Add parameter Keep_Pragma_Id to optionally keep
140 the identifier of the pragma instead of converting
141 to pragma Check. Also set type of new function call
142 appropriately. (Collect_Inherited_Class_Wide_Conditions):
143 Call Build_Pragma_Check_Equivalent with the new parameter
144 Keep_Pragma_Id set to True to keep the identifier of the copied
146 * sinfo.ads: Add comment.
148 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
150 * exp_ch7.adb (Build_Invariant_Procedure_Body):
151 Always install the scope of the invariant procedure
152 in order to produce better error messages. Do not
153 insert the body when the context is a generic unit.
154 (Build_Invariant_Procedure_Declaration): Perform minimal
155 decoration of the invariant procedure and its formal parameter
156 in case they are not analyzed. Do not insert the declaration
157 when the context is a generic unit.
159 2016-06-20 Ed Schonberg <schonberg@adacore.com>
161 * sem_ch13.adb (Visible_Component): New procedure, subsidiary
162 of Replace_Type_References_ Generic, to determine whether an
163 identifier in a predicate or invariant expression is a visible
164 component of the type to which the predicate or invariant
165 applies. Implements the visibility rule stated in RM 13.1.1
168 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
170 * s-regpat.adb, sem_prag.adb, pprint.adb, sem_ch13.adb: Minor
173 2016-06-20 Tristan Gingold <gingold@adacore.com>
175 * make.adb (Check_Standard_Library): Consider system.ads
176 if s-stalib.adb is not available.
177 * gnatbind.adb (Add_Artificial_ALI_File): New procedure extracted from
180 2016-06-20 Thomas Quinot <quinot@adacore.com>
182 * g-socket.adb (Is_IP_Address): A string consisting in digits only is
185 2016-06-20 Arnaud Charlet <charlet@adacore.com>
187 * exp_ch7.adb (Build_Invariant_Procedure_Body):
188 decorate invariant procedure body with typical properties of
191 2016-06-20 Arnaud Charlet <charlet@adacore.com>
193 * a-exetim-darwin.adb: New file.
195 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
197 * atree.ads, atree.adb (Elist29): New routine.
198 (Set_Elist29): New routine.
199 * atree.h New definition for Elist29.
200 * einfo.adb Subprograms_For_Type is now an Elist rather than
201 a node. Has_Invariants is now a synthesized attribute
202 and does not require a flag. Has_Own_Invariants
203 is now Flag232. Has_Inherited_Invariants is
204 Flag291. Is_Partial_Invariant_Procedure is Flag292.
205 (Default_Init_Cond_Procedure): Reimplemented.
206 (Has_Inherited_Invariants): New routine.
207 (Has_Invariants): Reimplemented.
208 (Has_Own_Invariants): New routine.
209 (Invariant_Procedure): Reimplemented.
210 (Is_Partial_Invariant_Procedure): New routine.
211 (Partial_Invariant_Procedure): Reimplemented.
212 (Predicate_Function): Reimplemented.
213 (Predicate_Function_M): Reimplemented.
214 (Set_Default_Init_Cond_Procedure): Reimplemented.
215 (Set_Has_Inherited_Invariants): New routine.
216 (Set_Has_Invariants): Removed.
217 (Set_Has_Own_Invariants): New routine.
218 (Set_Invariant_Procedure): Reimplemented.
219 (Set_Is_Partial_Invariant_Procedure): New routine.
220 (Set_Partial_Invariant_Procedure): Reimplemented.
221 (Set_Predicate_Function): Reimplemented.
222 (Set_Predicate_Function_M): Reimplemented.
223 (Set_Subprograms_For_Type): Reimplemented.
224 (Subprograms_For_Type): Reimplemented.
225 (Write_Entity_Flags): Output Flag232 and Flag291.
226 * einfo.ads Add new attributes Has_Inherited_Invariants
227 Has_Own_Invariants Is_Partial_Invariant_Procedure
228 Partial_Invariant_Procedure Change the documentation
229 of attributes Has_Inheritable_Invariants Has_Invariants
230 Invariant_Procedure Is_Invariant_Procedure Subprograms_For_Type
231 (Has_Inherited_Invariants): New routine along with pragma Inline.
232 (Has_Own_Invariants): New routine along with pragma Inline.
233 (Is_Partial_Invariant_Procedure): New routine along with pragma Inline.
234 (Partial_Invariant_Procedure): New routine.
235 (Set_Has_Inherited_Invariants): New routine along with pragma Inline.
236 (Set_Has_Invariants): Removed along with pragma Inline.
237 (Set_Has_Own_Invariants): New routine along with pragma Inline.
238 (Set_Is_Partial_Invariant_Procedure): New routine
239 along with pragma Inline.
240 (Set_Partial_Invariant_Procedure): New routine.
241 (Set_Subprograms_For_Type): Update the signature.
242 (Subprograms_For_Type): Update the signature.
243 * exp_ch3.adb Remove with and use clauses for Sem_Ch13.
244 (Build_Array_Invariant_Proc): Removed.
245 (Build_Record_Invariant_Proc): Removed.
246 (Freeze_Type): Build the body of the invariant procedure.
247 (Insert_Component_Invariant_Checks): Removed.
248 * exp_ch7.adb Add with and use clauses for Sem_Ch6, Sem_Ch13,
250 (Build_Invariant_Procedure_Body): New routine.
251 (Build_Invariant_Procedure_Declaration): New routine.
252 * exp_ch7.ads (Build_Invariant_Procedure_Body): New routine.
253 (Build_Invariant_Procedure_Declaration): New routine.
254 * exp_ch9.adb (Build_Corresponding_Record): Do not propagate
255 attributes related to invariants to the corresponding record
256 when building the corresponding record. This is done by
257 Build_Invariant_Procedure_Declaration.
258 * exp_util.adb (Make_Invariant_Call): Reimplemented.
259 * freeze.adb (Freeze_Array_Type): An array type requires an
260 invariant procedure when its component type has invariants.
261 (Freeze_Record_Type): A record type requires an invariant
262 procedure when at least one of its components has an invariant.
263 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Inherit
264 invariant-related attributes.
265 (Analyze_Subtype_Declaration):
266 Inherit invariant-related attributes.
267 (Build_Derived_Record_Type): Inherit invariant-related attributes.
268 (Check_Duplicate_Aspects): Reimplemented.
269 (Get_Partial_View_Aspect): New routine.
270 (Process_Full_View): Inherit invariant-related attributes. Reimplement
271 the check on hidden inheritance of class-wide invariants.
272 (Remove_Default_Init_Cond_Procedure): Reimplemented.
273 * sem_ch6.adb (Analyze_Subprogram_Specification): Do not modify
274 the controlling type for an invariant procedure declaration
276 (Is_Invariant_Procedure_Or_Body): New routine.
277 * sem_ch7.adb (Analyze_Package_Specification): Build the partial
278 invariant body in order to preanalyze and resolve all invariants
279 of a private type at the end of the visible declarations. Build
280 the full invariant body in order to preanalyze and resolve
281 all invariants of a private type's full view at the end of
282 the private declarations.
283 (Preserve_Full_Attributes): Inherit invariant-related attributes.
284 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Ensure that
285 aspects are analyzed with the proper view when the protected type
286 is a completion of a private type. Inherit invariant-related attributes.
287 (Analyze_Task_Type_Declaration): Ensure that
288 aspects are analyzed with the proper view when the task type
289 is a completion of a private type. Inherit invariant-related
291 * sem_ch13.adb Remove with and use clauses for Stringt.
292 (Build_Invariant_Procedure_Declaration): Removed.
293 (Build_Invariant_Procedure): Removed.
294 (Freeze_Entity_Checks): Do not build the body of the invariant
296 The body is built when the type is frozen in Freeze_Type.
297 (Inherit_Aspects_At_Freeze_Point): Do not inherit any attributes
298 related to invariants here because this leads to erroneous
300 (Replace_Node): Rename to Replace_Type_Ref.
301 * sem_ch13.ads (Build_Invariant_Procedure_Declaration): Removed.
302 (Build_Invariant_Procedure): Removed.
303 * sem_prag.adb Add with and use clauses for Exp_Ch7.
304 (Analyze_Pragma): Reimplement the analysis of pragma Invariant.
305 * sem_res.adb (Resolve_Actuals): Emit a specialized error when
306 the context is an invariant.
307 * sem_util.adb (Get_Views): New routine.
308 (Incomplete_Or_Partial_View): Consider generic packages when
309 examining declarations.
310 (Inspect_Decls): Consider full type
311 declarations because they may denote a derivation from a
313 (Propagate_Invariant_Attributes): New routine.
314 * sem_util.ads (Get_Views): New routine.
315 (Propagate_Invariant_Attributes): New routine.
317 2016-06-16 Arnaud Charlet <charlet@adacore.com>
319 * pprint.adb (Expression_Image): Add better handling of UCs,
320 we don't want to strip them all for clarity.
323 2016-06-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
325 * exp_util.adb (Safe_Unchecked_Type_Conversion): Use "alignment"
326 instead of "alignement".
328 2016-06-16 Gary Dismukes <dismukes@adacore.com>
330 * sem_util.adb: Minor typo fix.
332 2016-06-16 Emmanuel Briot <briot@adacore.com>
334 * s-regpat.adb: Further fix for invalid index in GNAT.Regexp.
336 2016-06-16 Eric Botcazou <ebotcazou@adacore.com>
338 * sem_ch13.adb (Validate_Address_Clauses): Use the same logic to
339 issue the warning on the offset for the size as for the alignment
340 and tweak the wording for the sake of consistency.
342 2016-06-16 Ed Schonberg <schonberg@adacore.com>
344 * sem_prag.adb (Check_Class_Wide_COndition): New procedure,
345 subsidiary of Analyze_Pre_Post_ Condition_In_Decl_Part, to
346 check legality rules that follow from the revised semantics of
347 class-wide pre/postconditions described in AI12-0113.
348 (Build_Pragma_Check_Equivalent): Abstract subprogram declarations
349 must be included in list of overriding primitives of a derived
352 2016-06-16 Ed Schonberg <schonberg@adacore.com>
354 * sem_util.adb (May_Be_Lvalue): An actual in an unexpanded
355 attribute reference 'Read is an assignment and must be considered
356 a modification of the object.
358 2016-06-16 Gary Dismukes <dismukes@adacore.com>
360 * einfo.adb: Minor editorial.
362 2016-06-16 Ed Schonberg <schonberg@adacore.com>
364 * sem_prag.adb (Overridden_Ancestor): Clean up code to use
365 controlling type of desired primitive rather than its scope,
366 because the primitive that inherits the classwide condition may
367 comes from several derivation steps.
369 2016-06-16 Javier Miranda <miranda@adacore.com>
371 * einfo.adb (Set_Default_Init_Cond_Procedure): Allow calls setting
372 this attribute to Empty (only if the attribute has not been set).
373 * sem_util.adb (Build_Default_Init_Cond_Procedure_Body):
374 No action needed if the spec was not built.
375 (Build_Default_Init_Cond_Procedure_Declaration): The spec is
376 not built if DIC is set to NULL or no condition was specified.
377 * exp_ch3.adb (Expand_N_Object_Declaration): Check availability
378 of the Init_Cond procedure before generating code to call it.
380 2016-06-16 Emmanuel Briot <briot@adacore.com>
382 * s-regpat.adb: Fix invalid index check when matching end-of-line
385 2016-06-16 Arnaud Charlet <charlet@adacore.com>
387 * gnat1drv.adb: Minor reformatting.
389 2016-06-16 Ed Schonberg <schonberg@adacore.com>
391 * sem_ch3.adb (Check_Entry_Contracts): New procedure, subsidiary
392 of Analyze_Declarations, that performs pre-analysis of
393 pre/postconditions on entry declarations before full analysis
394 is performed after entries have been converted into procedures.
395 Done solely to capture semantic errors.
396 * sem_attr.adb (Analyze_Attribute, case 'Result): Add guard to
397 call to Denote_Same_Function.
399 2016-06-16 Emmanuel Briot <briot@adacore.com>
401 * g-comlin.adb: Fix minor memory leak in GNAT.Command_Line.
403 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
405 * exp_ch7.adb (Find_Last_Init): Remove obsolete code. The
406 logic is now performed by Process_Object_Declaration.
407 (Process_Declarations): Recognize a controlled deferred
408 constant which is in fact initialized by means of a
409 build-in-place function call as needing finalization actions.
410 (Process_Object_Declaration): Insert the counter after the
411 build-in-place initialization call for a controlled object. This
412 was previously done in Find_Last_Init.
413 * exp_util.adb (Requires_Cleanup_Actions): Recognize a controlled
414 deferred constant which is in fact initialized by means of a
415 build-in-place function call as needing finalization actions.
417 2016-06-16 Justin Squirek <squirek@adacore.com>
419 * exp_aggr.adb (Expand_Array_Aggregate): Minor comment changes and
420 additional style fixes.
421 * exp_ch7.adb: Minor typo fixes and reformatting.
423 2016-06-16 Justin Squirek <squirek@adacore.com>
425 * sem_ch3.adb (Analyze_Object_Declaration): Add a missing check
426 for optimized aggregate arrays with qualified expressions.
427 * exp_aggr.adb (Expand_Array_Aggregate): Fix block and
428 conditional statement in charge of deciding whether to perform
429 in-place expansion. Specifically, use Parent_Node to jump over
430 the qualified expression to the object declaration node. Also,
431 a check has been inserted to skip the optimization if SPARK 2005
432 is being used in strict adherence to RM 4.3(5).
434 2016-06-16 Tristan Gingold <gingold@adacore.com>
436 * sem_prag.adb (Analyze_Pragma): Simplify code
439 2016-06-16 Eric Botcazou <ebotcazou@adacore.com>
441 * sem_util.ads (Indexed_Component_Bit_Offset): Declare.
442 * sem_util.adb (Indexed_Component_Bit_Offset): New
443 function returning the offset of an indexed component.
444 (Has_Compatible_Alignment_Internal): Call it.
445 * sem_ch13.adb (Offset_Value): New function returning the offset of an
446 Address attribute reference from the underlying entity.
447 (Validate_Address_Clauses): Call it and take the offset into
448 account for the size warning.
450 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
452 * bindgen.adb, exp_util.adb, sem_ch9.adb, sem_util.adb: Minor
455 2016-06-16 Gary Dismukes <dismukes@adacore.com>
457 * sem_ch9.adb, sem_util.ads, sem_res.adb: Minor reformatting and typo
460 2016-06-16 Javier Miranda <miranda@adacore.com>
462 * sem_res.adb (Resolve): Under relaxed RM semantics silently
463 replace occurrences of null by System.Null_Address.
464 * sem_ch4.adb (Analyze_One_Call, Operator_Check): Under
465 relaxed RM semantics silently replace occurrences of null by
467 * sem_util.ad[sb] (Null_To_Null_Address_Convert_OK): New subprogram.
468 (Replace_Null_By_Null_Address): New subprogram.
470 2016-06-16 Bob Duff <duff@adacore.com>
472 * exp_util.adb (Is_Controlled_Function_Call):
473 This was missing the case where the call is in prefix format,
474 with named notation, as in Obj.Func (Formal => Actual).
476 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
478 * exp_attr.adb, inline.adb, sem_attr.adb, sem_elab.adb: Minor
481 2016-06-16 Bob Duff <duff@adacore.com>
483 * sem_util.adb (Collect): Avoid Empty Full_T. Otherwise Etype
484 (Full_T) crashes when assertions are on.
485 * sem_ch12.adb (Matching_Actual): Correctly handle the case where
486 "others => <>" appears in a generic formal package, other than
489 2016-06-16 Arnaud Charlet <charlet@adacore.com>
491 * usage.adb: Remove confusing comment in usage line.
492 * bindgen.adb: Fix binder generated file in codepeer mode wrt
495 2016-06-16 Javier Miranda <miranda@adacore.com>
497 * restrict.adb (Check_Restriction_No_Use_Of_Entity): Avoid
498 never-ending loop, code cleanup; adding also support for Text_IO.
499 * sem_ch8.adb (Find_Expanded_Name): Invoke
500 Check_Restriction_No_Use_Entity.
502 2016-06-16 Tristan Gingold <gingold@adacore.com>
504 * exp_ch9.adb: Minor comment fix.
505 * einfo.ads (Has_Protected): Clarify comment.
506 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Do not
507 consider private protected types declared in the runtime for
508 the No_Local_Protected_Types restriction.
510 2016-06-14 Ed Schonberg <schonberg@adacore.com>
512 * sem_ch6.adb (Set_Actual_Subtypes): Do not generate actual
513 subtypes for unconstrained formals when analyzing the generated
514 body of an expression function, because it may lead to premature
515 and misplaced freezing of the types of formals.
517 2016-06-14 Gary Dismukes <dismukes@adacore.com>
519 * sem_elab.adb, sem_ch4.adb: Minor reformatting and typo fix.
521 2016-06-14 Tristan Gingold <gingold@adacore.com>
523 * einfo.adb (Set_Has_Timing_Event): Add assertion.
524 * sem_util.ads, sem_util.adb (Propagate_Concurrent_Flags): New
525 name for Propagate_Type_Has_Flags.
526 * exp_ch3.adb, sem_ch3.adb, sem_ch7.adb, sem_ch9.adb: Adjust after
529 2016-06-14 Bob Duff <duff@adacore.com>
531 * sem_elab.adb (Check_A_Call): Do nothing if the callee is
532 (or is in) an instance, and the caller is outside. Misc cleanup.
534 2016-06-14 Javier Miranda <miranda@adacore.com>
536 * sem_ch4.adb (Analyze_Quantified_Expression):
537 Generating C code avoid spurious warning on loop variable of
538 inlinined postconditions.
540 2016-06-14 Javier Miranda <miranda@adacore.com>
542 * sem_attr.adb (Analyze_Attribute_Old_Result): Adding assertion.
543 (Analyze_Attribute [Attribute_Old]): Generating C handle
544 analysis of 'old in inlined postconditions.
545 (Analyze_Attribute [Attribute_Result]): Generating C handle analysis
546 of 'result in inlined postconditions.
547 * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Old]):
548 Generating C handle expansion of 'old in inlined postconditions.
549 * inline.adb (Declare_Postconditions_Result): New subprogram.
550 * sem_ch12.adb (Copy_Generic_Node): Copy pragmas generated from
551 aspects when generating C code since pre/post conditions are
552 inlined and the frontend inlining relies on this routine to
554 * exp_ch6.adb (Inlined_Subprogram): Replace Generate_C_Code
555 by Modify_Tree_For_C.
556 * exp_unst.adb (Visit_Node): Searching for up-level references
557 skip entities defined in inlined subprograms.
559 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
561 * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb:
564 2016-06-14 Bob Duff <duff@adacore.com>
566 * sem_elab.adb: Do nothing if the callee is intrinsic.
567 * sinfo.ads, einfo.ads: Minor comment fixes.
569 2016-06-14 Ed Schonberg <schonberg@adacore.com>
571 * contracts.adb (Has_Null_Body): Move to sem_util, for general
573 * sem_util.ads, sem_util.adb (Has_Null_Body): Predicate to
574 determine when an internal procedure created for some assertion
575 checking (e.g. type invariant) is a null procedure. Used to
576 eliminate redundant calls to such procedures when they apply to
577 components of composite types.
578 * exp_ch3.adb (Build_Component_Invariant_Call): Do not add call
579 if invariant procedure has a null body.
581 2016-06-14 Thomas Quinot <quinot@adacore.com>
583 * g-socket.ads (Check_Selector): Clarify effect on IN OUT socket
586 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
588 * exp_ch4.adb (Process_Action): Pass the action
589 list to Process_Transient_Object.
590 (Process_If_Case_Statements): Pass the action list to
591 Process_Transient_Object.
592 (Process_Transient_Object): Add new parameter Stmts and update the
593 comment on usage. When the context is a Boolean evaluation, insert
594 any finalization calls after the last statement of the construct.
596 2016-06-14 Tristan Gingold <gingold@adacore.com>
598 * einfo.adb, einfo.ads (Has_Timing_Event,
599 Set_Has_Timing_Event): Add Has_Timing_Event flag.
600 (Write_Entity_Flags): Display * sem_util.ads, sem_util.adb:
601 (Propagate_Type_Has_Flags): New procedure to factorize code.
602 * exp_ch3.adb (Expand_Freeze_Array_Type,
603 Expand_Freeze_Record_Type): Call Propagate_Type_Has_Flags.
604 * sem_ch3.adb (Access_Type_Decalaration): Initialize
605 Has_Timing_Event flag. (Analyze_Object_Declaration):
606 Move code that check No_Local_Timing_Events near
607 the code that check No_Local_Protected_Objects.
608 (Analyze_Private_Extension_Declaration, Array_Type_Declaration)
609 (Build_Derived_Type, Copy_Array_Base_Type_Attributes,
610 Process_Full_View) (Record_Type_Definition): Call
611 Propagate_Type_Has_Flags.
612 * sem_ch4.adb (Analyze_Allocator): Check No_Local_Timing_Events.
613 * sem_ch7.adb (New_Private_Type): Set Has_Timing_Event on the
615 (Uninstall_Declaration): Call Propagate_Type_Has_Flags.
616 * sem_ch9.adb (Analyze_Protected_Definition): Call
617 Propagate_Type_Has_Flags.
619 2016-06-14 Arnaud Charlet <charlet@adacore.com>
621 * sem.ads: Minor style fix.
623 2016-06-14 Ed Schonberg <schonberg@adacore.com>
625 * sem_ch12.adb (Analyze_Associations): An actual parameter
626 with a box must be included in the count of actuals, to detect
627 possible superfluous named actuals that do not match any of the
628 formals of the generic unit in a formal package declaration.
630 2016-06-14 Justin Squirek <squirek@adacore.com>
632 * sem_ch3.adb (Analyze_Object_Declaration): Fix formatting
633 of error output related to SPARK RM 6.1.7(3) and pragma
635 * sem_ch4.adb (Analyze_Type_Conversion): Fix formatting of error
636 output related to SPARK RM 6.1.7(3) and pragma Extensions_Visible.
637 * sem_prag.adb (Analyze_Pragma): Fix formatting of error output
638 related to SPARK RM 7.1.2(15) and pragma Volatile_Function
639 so that the values True and False are no longer surrounded by
641 * sem_res.adb (Resolve_Actuals): Fix formatting of error output
642 related to SPARK RM 6.1.7(3) and pragma Extensions_Visible.
644 2016-06-14 Arnaud Charlet <charlet@adacore.com>
646 * gnat1drv.adb (Adjust_Global_Switches): Enable access checks
648 * freeze.adb: Minor grammar fix in comment.
649 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
651 * lib.adb: Minor reformatting.
652 * sem_util.adb (Is_OK_Volatile_Context): Do
653 include Address in the supported attributes.
655 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
657 * exp_ch4.adb (Expand_N_Case_Expression):
658 Code cleanup. Finalize any transient controlled
659 objects on exit from a case expression alternative.
660 (Expand_N_If_Expression): Code cleanup.
661 (Process_Actions): Removed.
662 (Process_If_Case_Statements): New routine.
663 (Process_Transient_Object): Change the name of formal Rel_Node to
664 N and update all occurrences. Update the comment on usage. When
665 the type of the context is Boolean, the proper insertion point
666 for the finalization call is after the last declaration.
668 2016-06-14 Ed Schonberg <schonberg@adacore.com>
670 * lib-xref.ads, lib-xref.adb (Has_Deferred_Reference): new
671 predicate to determine whether an entity appears in a context
672 for which a Deferred_Reference was created, because it is not
673 possible to determine when reference is analyzed whether it
674 appears in a context in which the entity is modified.
675 * sem_ch5.adb (Analyze_Statement): Do not emit a useless warning
676 on assignment for an entity that has a deferred_reference.
678 2016-06-14 Javier Miranda <miranda@adacore.com>
680 * sem_res.adb (Resolve_Actuals): Generate a reference to actuals that
681 come from source. Previously the reference was generated only if the
682 call comes from source but the call may be rewritten by the expander
683 thus causing the notification of spurious warnings.
685 2016-06-14 Arnaud Charlet <charlet@adacore.com>
687 * gnat1drv.adb: Remove further references to AAMP.
688 * checks.adb (Apply_Scalar_Range_Check): Take
689 Check_Float_Overflow info account.
690 * live.ads, live.adb Added subprogram headers and
691 start-of-processing-for comments.
692 * sem_ch12.adb (Instantiate_Package_Body): Do not suppress
693 checks when instantiating runtime units in CodePeer mode.
695 2016-06-14 Arnaud Charlet <charlet@adacore.com>
697 * exp_ch3.adb (Expand_N_Object_Declaration): Only consider
700 2016-06-14 Arnaud Charlet <charlet@adacore.com>
702 * switch-c.adb, gnat1drv.adb (Adjust_Global_Switches): Only disable
703 simple value propagation in CodePeer mode when warnings are disabled.
704 (Scan_Front_End_Switches): Enable relevant front-end switches
707 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
709 * sem_util.adb (Is_OK_Volatile_Context): A
710 reference to a volatile object is considered OK if appears as
711 the prefix of attributes Address, Alignment, Component_Size,
712 First_Bit, Last_Bit, Position, Size, Storage_Size.
714 2016-06-14 Yannick Moy <moy@adacore.com>
716 * lib-xref-spark_specific.adb (Add_SPARK_File): Do not traverse
717 subunits directly, as they are already traversed as part of the
718 top-level unit to which they belong.
719 (Add_SPARK_Xrefs): Add assertions to ensure correct sorting.
720 (Generate_Dereference): Use unique definition place for special
721 variable __HEAP, to ensure correct sorting of references.
722 * lib-xref.adb (Generate_Reference): Use top-level unit in case
724 * lib.adb, lib.ads (Get_Top_Level_Code_Unit): New functions that
725 compute the top-level code unit for a source location of AST node,
726 that go past subunits.
728 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
730 * gcc-interface/decl.c (gnat_to_gnu_subprog_type): Build only a minimal
731 PARM_DECL when the parameter type is dummy.
732 * gcc-interface/trans.c (Call_to_gnu): Translate formal types before
735 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
737 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
738 PLUS_EXPR in the expression of a renaming.
740 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
742 * gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Deal specially
743 with calls to malloc.
745 2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
747 * gcc-interface/trans.c (build_binary_op_trapv): If no operand is a
748 constant, use the generic implementation of the middle-end; otherwise
749 turn the dynamic conditions into static conditions and simplify.
751 2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
753 * gcc-interface/trans.c (Case_Statement_to_gnu): Deal with characters.
755 2016-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
757 * gcc-interface/decl.c (gnat_to_gnu_entity): Do not clobber
758 gnat_entity_name with temporary names for XUP and XUT types.
760 2016-06-10 Martin Sebor <msebor@redhat.com>
763 * gcc/ada/gcc-interface/utils.c (handle_nonnull_attribute): Accept
764 the nonnull attribute in type-generic builtins.
766 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
768 * gcc-interface/decl.c (Gigi_Equivalent_Type): Make sure equivalent
769 types are present before returning them. Remove final assertion.
770 (gnat_to_gnu_entity) <E_Access_Protected_Subprogram_Type>: Adjust to
772 <E_Protected_Type>: Likewise.
774 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
776 * gcc-interface/trans.c (elaborate_all_entities_for_package): Also do
777 not elaborate Itypes.
779 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
781 * gcc-interface/utils.c (gnat_internal_attribute_table): Add support
782 for noinline and noclone attributes.
783 (handle_noinline_attribute): New handler.
784 (handle_noclone_attribute): Likewise.
786 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
788 * gcc-interface/trans.c (process_type): Beef up comment.
790 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
792 * gcc-interface/utils2.c (build_call_alloc_dealloc): Do not substitute
793 placeholder expressions here but...
794 * gcc-interface/trans.c (gnat_to_gnu) <N_Free_Statement>: ...here.
795 Make an exception to the protection of a CALL_EXPR result with an
796 unconstrained type only in the same cases as Call_to_gnu.
798 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
800 * gcc-interface/trans.c (gnat_to_gnu): Rework special code dealing
801 with boolean rvalues and set the location directly. Do not set the
802 location in the other cases for a simple name.
803 (gnat_to_gnu_external): Clear the location on the expression.
805 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
807 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Component>: Remove
808 useless 'else' statements and tidy up.
809 <E_Array_Subtype>: Fully deal with the declaration here.
810 <E_Incomplete_Type>: Use properly-typed constant.
811 Assert that we don't apply the special type treatment to dummy types.
812 Separate this treatment from the final back-annotation and simplify
813 the condition for the RM size.
814 (gnat_to_gnu_param): Add GNU_PARAM_TYPE parameter and adjust.
815 (gnat_to_gnu_subprog_type): Ajust call to gnat_to_gnu_param.
816 * gcc-interface/trans.c (gnat_to_gnu) <N_Subprogram_Declaration>: Add
818 (process_freeze_entity): Remove obsolete code.
819 (process_type): Minor tweaks.
821 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
823 * einfo.ads (Returns_Limited_View): Remove.
824 (Set_Returns_Limited_View ): Likewise.
825 * einfo.adb (Returns_Limited_View): Likewise.
826 (Set_Returns_Limited_View ): Likewise.
827 * freeze.adb (Late_Freeze_Subprogram): Remove.
828 (Freeze_Entity): Do not defer the freezing of functions returning an
829 incomplete type coming from a limited context.
831 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
833 * gcc-interface/gigi.h (finish_subprog_decl): Add ASM_NAME parameter.
834 * gcc-interface/decl.c (gnu_ext_name_for_subprog): New function.
835 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not check compatibility
836 of profiles for builtins here... Call gnu_ext_name_for_subprog.
837 Also update profiles if pointers to limited_with'ed types are
839 (gnat_to_gnu_param): Restore the correct source location information
840 for vector ABI warnings.
841 (associate_subprog_with_dummy_type): Add comment about AI05-019.
842 Set TYPE_DUMMY_IN_PROFILE_P flag unconditionally.
843 (update_profile): Deal with builtin declarations.
844 Call gnu_ext_name_for_subprog. Adjust call to finish_subprog_decl.
845 (update_profiles_with): Add comment.
846 (gnat_to_gnu_subprog_type): Reuse the return type if it is complete.
847 Likewise for parameter declarations in most cases. Do not change
848 the return type for the CICO mechanism if the profile is incomplete.
849 ...but here instead. Always reset the slot for the parameters.
850 * gcc-interface/utils.c (create_subprog_decl): Call
851 gnu_ext_name_for_subprog. Do not set the assembler name here but...
852 (finish_subprog_decl): ...but here instead. Add ASM_NAME parameter.
854 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
856 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Insert the
857 declaration of the corresponding record type before that of the
858 unprotected version of the subprograms that operate on it.
859 (Expand_Access_Protected_Subprogram_Type): Declare the Equivalent_Type
860 just before the original type.
861 * sem_ch3.adb (Handle_Late_Controlled_Primitive): Point the current
862 declaration to the newly created declaration for the primitive.
863 (Analyze_Subtype_Declaration): Remove obsolete code forcing the
864 freezing of the subtype before its declaration.
865 (Replace_Anonymous_Access_To_Protected_Subprogram): Insert the new
866 declaration in the nearest enclosing scope for formal parameters too.
867 (Build_Derived_Access_Type): Restore the status of the created Itype
868 after it is erased by Copy_Node.
869 * sem_ch6.adb (Exchange_Limited_Views): Remove guard on entry.
870 (Analyze_Subprogram_Body_Helper): Call Exchange_Limited_Views only if
871 the specification is present.
872 Move around the code changing the designated view of the return type
873 and save the original view. Restore it on exit.
874 * sem_ch13.adb (Build_Predicate_Function_Declaration): Always insert
875 the declaration right after that of the type.
877 2016-06-01 Simon Wright <simon@pushface.org>
880 * g-comlin.adb (Display_Section_Help): Do not dereference
881 Config.Switches if it's null.
884 2016-05-31 Eric Botcazou <ebotcazou@adacore.com>
886 * s-osinte-kfreebsd-gnu.ads (clock_getres): Define.
887 (Get_Page_Size): Remove duplicate and return int.
889 2016-05-31 Jan Sommer <soja-lists@aries.uberspace.de>
892 * s-osinte-rtems.ads (clock_getres): Define.
893 (Get_Page_Size): Remove duplicate and return int.
895 2016-05-20 Eric Botcazou <ebotcazou@adacore.com>
897 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
898 Make same-sized subtypes of signed base types signed.
899 * gcc-interface/utils.c (make_type_from_size): Adjust to above change.
900 (unchecked_convert): Likewise.
902 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
904 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Do not build
905 a specific type for the object if it is deemed a constant.
907 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
909 * freeze.adb (Freeze_Record_Type): Extend pragma Implicit_Packing to
910 components of any elementary types and of composite types.
912 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
914 * freeze.adb (Freeze_Array_Type): Call Addressable predicate instead
915 of testing for individual sizes.
916 (Freeze_Entity): Rework implementation of pragma Implicit_Packing for
917 array types, in particular test for suitable sizes upfront and do not
918 mimic the processing that will be redone later in Freeze_Array_Type.
920 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
922 * gcc-interface/trans.c (elaborate_all_entities_for_package): Also skip
925 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
927 * doc/gnat_rm/implementation_defined_attributes.rst
928 (Scalar_Storage_Order): Adjust restriction for packed array types.
929 * einfo.ads (Is_Bit_Packed_Array): Adjust description.
930 (Is_Packed): Likewise.
931 (Is_Packed_Array_Impl_Type): Likewise.
932 (Packed_Array_Impl_Type): Likewise.
933 * exp_ch4.adb (Expand_N_Indexed_Component): Do not do anything special
934 if the prefix is not a packed array implemented specially.
935 * exp_ch6.adb (Expand_Actuals): Expand indexed components only for
936 bit-packed array types.
937 * exp_pakd.adb (Install_PAT): Set Is_Packed_Array_Impl_Type flag on
938 the PAT before analyzing its declaration.
939 (Create_Packed_Array_Impl_Type): Remove redundant statements.
940 * freeze.adb (Check_Component_Storage_Order): Reject packed array
941 components only if they are bit packed.
942 (Freeze_Array_Type): Fix logic detecting bit packing and do not bit
943 pack for composite types whose size is multiple of a byte.
944 Create the implementation type for packed array types only when it is
945 needed, i.e. bit packing or packing because of holes in index types.
946 Make sure the Has_Non_Standard_Rep and Is_Packed flags agree.
947 * gcc-interface/gigi.h (make_packable_type): Add MAX_ALIGN parameter.
948 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
949 Call maybe_pad_type instead of building the padding type manually.
950 (gnat_to_gnu_entity) <E_Array_Subtype>: Do not assert that
951 Packed_Array_Impl_Type is present for packed arrays.
952 (gnat_to_gnu_component_type): Also handle known alignment for packed
953 types by passing it to make_packable_type.
954 * gcc-interface/utils.c (make_packable_type): Add MAX_ALIGN parameter
955 and deal with it in the array case. Adjust recursive call. Simplify
956 computation of new size and cap the alignment to BIGGEST_ALIGNMENT.
958 2016-05-16 Thomas Quinot <quinot@adacore.com>
960 * freeze.adb (Check_Component_Storage_Order): Also get full view of
963 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
965 * exp_util.adb (Remove_Side_Effects): Also make a constant if we need
966 to capture the value for a small not by-reference record type.
967 * freeze.ads (Check_Compile_Time_Size): Adjust comment.
968 * freeze.adb (Set_Small_Size): Likewise. Accept a size in the range
970 (Check_Compile_Time_Size): Merge scalar and access type cases. Change
971 variable name in array type case. For the computation of the packed
972 size, deal with record components and remove redundant test.
973 (Freeze_Array_Type): Also adjust packing status when the size of the
974 component type is in the range 33 .. 64 bits.
975 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Turn primitive
976 into elementary type throughout. Minor tweaks.
977 (Alignment Clauses): Document actual alignment of packed array types.
978 (Pragma Pack for Arrays): List only the 3 main cases and adjust. Add
979 "simple" to the record case. Document effect on non packable types.
980 (Pragma Pack for Records): Likewise. Add record case and adjust.
982 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
984 * gcc-interface/Make-lang.in (GNATMAKE_FOR_HOST): In the canadian
985 cross case, use host_noncanonical instead of host as prefix.
986 (GNATBIND_FOR_HOST): Likewise.
987 (GNATLINK_FOR_HOST): Likewise.
988 (GNATLS_FOR_HOST): Likewise.
990 2016-05-06 Eric Botcazou <ebotcazou@adacore.com>
993 * system-darwin-ppc64.ads: Add pragma No_Elaboration_Code_All.
994 * system-linux-armeb.ads: Likewise.
995 * system-linux-mips64el.ads: Likewise.
996 * system-linux-mips.ads: Likewise.
997 * system-linux-mipsel.ads: Likewise.
998 * system-linux-ppc64.ads: Likewise.
999 * system-linux-sparcv9.ads: Likewise.
1000 * system-rtems.ads: Likewise.
1002 2016-05-04 Samuel Thibault <samuel.thibault@ens-lyon.org>
1004 * s-osinte-gnu.ads (Get_Page_Size): Return int and use getpagesize
1005 instead of __getpagesize.
1007 2016-05-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1009 * gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
1012 2016-05-02 Tristan Gingold <gingold@adacore.com>
1014 * fname.adb (Is_Predefined_File_Name): Also consider non-krunched
1017 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1019 * sem_util.adb (Aggregate_Constraint_Checks): Separate
1020 accessibility checks and non-null checks for aggregate components,
1021 to prevent spurious accessibility errors.
1023 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1025 * sem_ch3.adb (OK_For_Limited_Init): A type conversion is not
1026 always legal in the in-place initialization of a limited entity
1027 (e.g. an allocator).
1028 * sem_res.adb (Resolve_Allocator): Improve error message with RM
1029 reference when allocator expression is illegal.
1031 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1033 * exp_ch6.adb (Expand_Call): When inlining a call to a function
1034 declared in a package instance, locate the instance node of the
1035 package after the actual package declaration. skipping over
1036 pragmas that may have been introduced when the generic unit
1037 carries aspects that are transformed into pragmas.
1039 2016-05-02 Bob Duff <duff@adacore.com>
1041 * s-memory.adb (Alloc, Realloc): Move checks
1042 for Size = 0 or size_t'Last into the Result = System.Null_Address
1043 path for efficiency. Improve comments (based on actual C language
1044 requirements for malloc).
1045 * exp_util.adb (Build_Allocate_Deallocate_Proc): Optimize the
1046 case where we are using the default Global_Pool_Object, and we
1047 don't need the heavy finalization machinery.
1049 2016-05-02 Gary Dismukes <dismukes@adacore.com>
1051 * exp_util.ads, sem_ch12.adb: Minor reformatting.
1053 2016-05-02 Javier Miranda <miranda@adacore.com>
1055 * exp_util.ads, exp_util.adb (Force_Evaluation): Adding new formal.
1056 (Remove_Side_Effects): Adding a new formal.
1057 * exp_ch6.adb (Expand_Simple_Function_Return): Generating the
1058 call to the _Postconditions procedure ensure that side-effects
1059 are unconditionally removed.
1061 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1063 * sem_ch12.adb (Check_Formal_Package_Instance, Check_Mismatch):
1064 Use original node to determine whether the declaration is for
1065 a formal type declaration, to take into account that formwl
1066 private types are rewritten as private extension declarations
1067 to simplify semantic analysis.
1069 2016-05-02 Gary Dismukes <dismukes@adacore.com>
1071 * exp_ch9.adb, sem_ch6.adb, sem_ch6.ads: Minor reformatting and typo
1074 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1076 * sem_ch3.adb, exp_ch9.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb: Minor
1079 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1081 * exp_ch4.adb (Expand_N_Allocator): If the designated type
1082 is a private derived type with no discriminants, examine its
1083 underlying_full_view to determine whether the full view has
1084 defaulted discriminants, so their defaults can be used in the
1085 call to the initialization procedure for the designated object.
1087 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1089 * exp_prag.adb, comperr.adb: Minor reformatting.
1091 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1093 * exp_pakd.adb (Rj_Unchecked_Convert_To): Do not perform an
1094 unchecked conversion if the source size is 0 (indicating that
1095 its RM size is unknown). This will happen with packed arrays of
1096 non-discrete types, in which case the component type is known
1099 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1101 * debug.adb: Reserve -gnatd.V.
1103 2016-05-02 Javier Miranda <miranda@adacore.com>
1105 * sem_ch3.adb (Process_Full_View): Remove from visibility
1106 wrappers of synchronized types to avoid spurious errors with
1107 their wrapped entity.
1108 * exp_ch9.adb (Build_Wrapper_Spec): Do not generate the wrapper
1109 if no interface primitive is covered by the subprogram and this is
1110 not a primitive declared between two views; see Process_Full_View.
1111 (Build_Protected_Sub_Specification): Link the dispatching
1112 subprogram with its original non-dispatching protected subprogram
1113 since their names differ.
1114 (Expand_N_Protected_Type_Declaration):
1115 If a protected subprogram overrides an interface primitive then
1116 do not build a wrapper if it was already built.
1117 * einfo.ads, einfo.adb (Original_Protected_Subprogram): New attribute.
1118 * sem_ch4.adb (Names_Match): New subprogram.
1119 * sem_ch6.adb (Check_Synchronized_Overriding): Moved
1120 to library level and defined in the public part of the
1121 package to invoke it from Exp_Ch9.Build_Wrapper_Spec
1122 (Has_Matching_Entry_Or_Subprogram): New subprogram.
1123 (Report_Conflict): New subprogram.
1125 2016-05-02 Jerome Lambourg <lambourg@adacore.com>
1127 * s-unstyp.ads: Code cleanups.
1129 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1131 * sem_ch13.adb (Size_Too_Small_Error): Fix the error message format.
1133 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1135 * exp_prag.adb (Expand_attributes_In_Consequence,
1136 Expand_Attributes): If the prefix of'Old is an unconstrained type,
1137 for example an unconstrained formal of the enclosing subprogram,
1138 create an object declaration with an expression to obtain the
1139 actual subtype of the temporary.
1141 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1143 * comperr.adb (Delete_SCIL_Files): Add missing handling of
1144 N_Subprogram_Declaration.
1146 2016-05-02 Gary Dismukes <dismukes@adacore.com>
1148 * exp_ch5.adb, exp_ch7.adb, exp_ch7.ads, checks.adb, sem_attr.adb,
1149 gnat1drv.adb, sem_ch4.adb, sem_ch13.adb: Minor reformatting and typo
1151 * sem_prag.adb, sem_ch12.adb: Minor typo fixes.
1153 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1155 * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): The
1156 function call may be wrapped in an explicit type conversion.
1158 2016-05-02 Jerome Lambourg <lambourg@adacore.com>
1160 * interfac.ads: use pragma No_Elaboration_Code_All.
1161 * s-unstyp.ads: s-unstyp.ads: use pragma No_Elaboration_Code_All.
1163 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1165 * sem.adb (Analyze: If node is an error node previously created
1166 by the parser, disable expansion to prevent subsequent glitches
1169 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1171 * sem_ch13.adb (Alignment_Error): Removed.
1172 (Get_Alignment_Value): Code cleanup.
1174 2016-05-02 Tristan Gingold <gingold@adacore.com>
1176 * sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected
1177 to check for the no local protected objects restriction.
1179 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1181 * einfo.adb Anonymous_Master now uses Node35.
1182 (Anonymous_Master): Update the assertion and node reference.
1183 (Set_Anonymous_Master): Update the assertion and node reference.
1184 (Write_Field35_Name): Add output for Anonymous_Master.
1185 (Write_Field36_Name): The output is now undefined.
1186 * einfo.ads Update the node and description of attribute
1187 Anonymous_Master. Remove prior occurrences in entities as this
1188 is now a type attribute.
1189 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove local variable
1190 Ins_Node. Anonymous access- to-controlled component types no
1191 longer need finalization masters. The master is now built when
1192 a related allocator is expanded.
1193 (Expand_Freeze_Record_Type): Remove local variable Has_AACC. Do not
1194 detect whether the record type has at least one component of anonymous
1195 access-to- controlled type. These types no longer need finalization
1196 masters. The master is now built when a related allocator is expanded.
1197 * exp_ch4.adb Remove with and use clauses for Lib and Sem_Ch8.
1198 (Current_Anonymous_Master): Removed.
1199 (Expand_N_Allocator): Call Build_Anonymous_Master to create a
1200 finalization master for an anonymous access-to-controlled type.
1201 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
1202 Call routine Build_Anonymous_Master to create a finalization master
1203 for an anonymous access-to-controlled type.
1204 * exp_ch7.adb (Allows_Finalization_Master): New routine.
1205 (Build_Anonymous_Master): New routine.
1206 (Build_Finalization_Master): Remove formal parameter
1207 For_Anonymous. Use Allows_Finalization_Master to determine whether
1208 circumstances warrant a finalization master. This routine no
1209 longer creates masters for anonymous access-to-controlled types.
1210 (In_Deallocation_Instance): Removed.
1211 * exp_ch7.ads (Build_Anonymous_Master): New routine.
1212 (Build_Finalization_Master): Remove formal parameter For_Anonymous
1213 and update the comment on usage.
1214 * sem_util.adb (Get_Qualified_Name): New routines.
1215 (Output_Name): Reimplemented.
1216 (Output_Scope): Removed.
1217 * sem_util.ads (Get_Qualified_Name): New routines.
1219 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1221 * debug.adb: Document the use of switch -gnatd.H.
1222 * gnat1drv.adb (Adjust_Global_Switches): Set ASIS_GNSA mode when
1223 -gnatd.H is present.
1224 (Gnat1drv): Suppress the call to gigi when ASIS_GNSA mode is active.
1225 * opt.ads: Add new option ASIS_GNSA_Mode.
1226 * sem_ch13.adb (Alignment_Error): New routine.
1227 (Analyze_Attribute_Definition_Clause): Suppress certain errors in
1228 ASIS mode for attribute clause Alignment, Machine_Radix, Size, and
1230 (Check_Size): Use routine Size_Too_Small_Error to
1231 suppress certain errors in ASIS mode.
1232 (Get_Alignment_Value): Use routine Alignment_Error to suppress certain
1233 errors in ASIS mode.
1234 (Size_Too_Small_Error): New routine.
1236 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1238 * spark_xrefs.ads Description of the spark cross-references
1239 clarified; small style fixes.
1240 * lib-xref-spark_specific.adb (Add_SPARK_Scope,
1241 Detect_And_Add_SPARK_Scope): consider protected types and bodies
1242 as yet another scopes.
1243 (Enclosing_Subprogram_Or_Library_Package): refactored using
1244 Hristian's suggestions; added support for scopes of protected
1245 types and bodies; fix for entries to return the scope of the
1246 enclosing concurrent type, which is consistent with what is
1247 returned for protected subprograms.
1248 * sem_intr.adb: Minor style fix in comment.
1250 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1252 * lib-xref.ads, lib-xref-spark_specific.adb, get_spark_xrefs.adb,
1253 put_spark_xrefs.adb: Minor reformatting.
1255 2016-05-02 Doug Rupp <rupp@adacore.com>
1257 * g-traceb.ads: Document traceback for ARM.
1259 2016-05-02 Javier Miranda <miranda@adacore.com>
1261 * exp_disp.adb (Make_Tags): Do not generate the
1262 external name of interface tags adding the suffix counter since
1263 it causes problems at link time when the IP routines are inlined
1264 across units with optimization.
1266 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1268 * einfo.ads, einfo.adb (Predicates_Ignared): new flag to indicate
1269 that predicate checking is disabled for predicated subtypes in
1270 the context of an Assertion_Policy pragma.
1271 * checks.adb (Apply_Predicate_Check): Do nothing if
1272 Predicates_Ignored is true.
1273 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): If
1274 Predicates_Ignores is true, the function Rep_To_Pos does raise
1275 an exception for invalid data.
1276 * exp_ch4.adb (Expand_N_Type_Conversion): IF target is a predicated
1277 type do not apply check if Predicates_Ignored is true.
1278 * exp_ch5.adb (Expand_N_Case_Statement): If Predicates_Ignored
1279 is true, sem_prag.adb:
1280 * sem_ch3.adb (Analyze_Object_Declaration): If Predicates_Ignored
1281 is true do not emit predicate check on initializing expression.
1283 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1285 * get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when
1286 they are declared; refine type of a counter from Integer to Natural.
1287 * sem_ch5.adb, gnatcmd.adb, s-intman-posix.adb, eval_fat.adb,
1288 prj.adb, sem_util.adb, s-intman-android.adb, prj-nmsc.adb, sem_ch8.adb,
1289 exp_ch3.adb: Minor editing.
1291 2016-05-02 Yannick Moy <moy@adacore.com>
1293 * a-tigeli.adb (Get_Line): Always set Last prior to returning.
1295 2016-05-02 Yannick Moy <moy@adacore.com>
1297 * lib-xref.adb: Minor style fix in whitespace of declarations.
1298 * put_spark_xrefs.adb (Put_SPARK_Xrefs): printing of strings
1299 refactored without loops.
1300 * put_spark_xrefs.ads (Write_Info_Str): new formal argument of
1302 * spark_xrefs.adb (Write_Info_Str): new actual in instantiation
1303 of generic procedure.
1305 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1307 * lib-xref-spark_specific.adb (Add_SPARK_Scope): add task type scope.
1308 (Detect_And_Add_SPARK_Scope): detect and add task type scope.
1309 (Enclosing_Subprogram_Or_Package): Respect boundaries of task
1310 and entry declarations.
1311 * spark_xrefs.ads: minor typo in comment.
1313 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1315 * make.adb: Minor: avoid an exception when calling gnatmake with
1316 no argument and gnatmake is built with checks on.
1317 * lib-xref-spark_specific.adb: Minor code cleanup.
1319 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1321 * sem_util.adb (Normalize_Actuals): Take into account extra
1322 actuals that may have been introduced previously. Normally extra
1323 actuals are introduced when a call is expanded, but a validity
1324 check may copy and reanalyze a call that carries an extra actual
1325 (e.g. an accessibility parameter) before the call itself is
1326 marked Analzyed, and the analysis of the copy has to be able to
1327 cope with the added actual.
1329 2016-05-02 Bob Duff <duff@adacore.com>
1331 * sem_ch10.adb (Analyze_Compilation_Unit): Preserve
1332 treeishness. Previous version had Context_Items shared between
1335 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1337 * sem_aggr.adb (Resolve_Aggr_Expression): For both array and
1338 record cases, apply predicate check on component for expression
1339 only if expression has been analyzed already. For expressions
1340 that need to be duplicated when they cover multiple components,
1341 resolution and predicate checking take place later.
1343 2016-05-02 Olivier Hainque <hainque@adacore.com>
1345 * a-direct.adb (Delete_Tree): Use full names to designate subdirs
1346 and files therein, instead of local names after a change of
1349 2016-05-02 Thomas Quinot <quinot@adacore.com>
1351 * freeze.adb (Check_Component_Storage_Order): Get full view of
1354 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1356 * checks.adb, freeze.adb, sem_res.adb, s-stposu.adb, repinfo.adb:
1359 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1361 * sem_ch4.adb (Find_Indexing_Operations): Use the underlying type
1362 of the container base type in case the container is a subtype.
1363 * sem_ch5.adb (Analyze_Iterator_Specification): Ensure that
1364 the selector has an entity when checking for a component of a
1367 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1370 * opt.ads (Latest_Ada_Only): New flag.
1371 * sem_prag.adb, par-prag.adb: Ignore pragma Ada_xx under this flag.
1372 * usage.adb, switch-c.adb: Disable support for -gnatxx under this flag.
1373 * einfo.ads (Has_Predicates, Predicate_Function):
1374 Clarify that Has_Predicates does not imply that Predicate_Function
1375 will return a non-empty entity.
1377 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1379 * sem_res.adb (Resolve_Qualified_Expression): Generate a predicate
1380 check if type requires it.
1381 * checks.adb (Apply_Predicate_Check): Disable checks in the
1382 object declaration created for an expression with side-effects
1383 that requires a predicate check to prevent infinite recursion
1386 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1388 * sem_ch6.adb (Process_Formals): Check properly the type of a
1389 formal to determine whether a given convention applies to it.
1391 2016-05-02 Doug Rupp <rupp@adacore.com>
1393 * tracebak.c: Add incantations for arm-vxworks[67] traceback.
1395 2016-05-02 Thomas Quinot <quinot@adacore.com>
1397 * freeze.adb (Check_Component_Storage_Order): Make it a warning, not an
1398 error, to have a component with implicit SSO within a composite type
1399 that has explicit SSO.
1401 2016-05-02 Bob Duff <duff@adacore.com>
1403 * s-stposu.adb (Allocate_Any_Controlled): Don't lock/unlock twice.
1405 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1407 * repinfo.adb (List_Entities): Make procedure recursive, to
1408 provide representation information for subprograms declared
1409 within subprogram bodies.
1411 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1413 * exp_ch5.adb, layout.adb, gnatcmd.adb exp_attr.adb, make.adb,
1414 bindgen.adb, debug.adb, exp_pakd.adb, freeze.adb, sem_util.adb,
1415 gnatlink.adb, switch-m.adb, exp_ch4.adb, repinfo.adb, adabkend.adb,
1416 osint.adb: Remove dead code.
1418 2016-05-02 Yannick Moy <moy@adacore.com>
1420 * a-tigeli.adb (Get_Line): Fix bound for test to
1421 decide when to compensate for character 0 added by call to fgets.
1423 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1425 * sem_ch4.adb (Analyze_Allocator): If the expression does not
1426 have a subtype indication and the type is an unconstrained tagged
1427 type with defaulted discriminants, create an explicit constraint
1428 for it during analysis to prevent out-of-order freezing actions
1429 on generated classwide types.
1431 2016-05-02 Javier Miranda <miranda@adacore.com>
1433 * exp_ch5.adb (Expand_N_Assignment_Statement):
1434 In the runtime check that ensures that the tags of source an
1435 target match, add missing displacement of the pointer to the
1436 objects if they cover interface types.
1438 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1440 * sem_attr.adb (Analyze_Attribute, case 'Old): Do not use
1441 base type for attribute when type is discrete: transformation
1442 is not needed for such types, and leads to spurious errors if
1443 the context is a case construct.
1445 2016-05-02 Eric Botcazou <ebotcazou@adacore.com>
1447 * gcc-interface/decl.c (elaborate_reference_1): Do not bother about
1448 operand #2 for COMPONENT_REF.
1449 * gcc-interface/utils2.c (gnat_save_expr): Likewise.
1450 (gnat_protect_expr): Likewise.
1451 (gnat_stabilize_reference_1): Likewise.
1452 (gnat_rewrite_reference): Do not bother about operand #3 for ARRAY_REF.
1453 (get_inner_constant_reference): Likewise.
1454 (gnat_invariant_expr): Likewise.
1455 * gcc-interface/trans.c (fold_constant_decl_in_expr): Likewise.
1457 2016-05-02 Eric Botcazou <ebotcazou@adacore.com>
1459 * gcc-interface/trans.c (Range_to_gnu): New static function.
1460 (Raise_Error_to_gnu) <N_In>: Call it to translate the range.
1461 (gnat_to_gnu) <N_In>: Likewise.
1463 2016-04-30 Eric Botcazou <ebotcazou@adacore.com>
1465 * gcc-interface/Make-lang.in (ACATSCMD): New variable.
1466 (check-acats): Use it.
1467 (check_acats_targets): Likewise.
1469 2016-04-28 Eric Botcazou <ebotcazou@adacore.com>
1472 * a-textio.adb (Get_Immediate): Add missing 'not' in expression.
1474 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1476 * sem_aux.adb (Is_By_Reference_Type): Also return true for a tagged
1477 incomplete type without full view.
1478 * sem_ch6.adb (Exchange_Limited_Views): Change into a function and
1479 return the list of changes.
1480 (Restore_Limited_Views): New procedure to undo the transformation made
1481 by Exchange_Limited_Views.
1482 (Analyze_Subprogram_Body_Helper): Adjust call to Exchange_Limited_Views
1483 and call Restore_Limited_Views at the end, if need be.
1484 (Possible_Freeze): Do not delay freezing because of incomplete types.
1485 (Process_Formals): Remove kludges for class-wide types.
1486 * types.h (By_Copy_Return): Delete.
1487 * gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): Move around.
1488 (TYPE_DUMMY_IN_PROFILE_P): New macro.
1489 * gcc-interface/gigi.h (update_profiles_with): Declare.
1490 (finish_subprog_decl): Likewise.
1491 (get_minimal_subprog_decl): Delete.
1492 (create_subprog_type): Likewise.
1493 (create_param_decl): Adjust prototype.
1494 (create_subprog_decl): Likewise.
1495 * gcc-interface/decl.c (defer_limited_with): Rename into...
1496 (defer_limited_with_list): ...this.
1497 (gnat_to_gnu_entity): Adjust to above renaming.
1498 (finalize_from_limited_with): Likewise.
1499 (tree_entity_vec_map): New structure.
1500 (gt_pch_nx): New helpers.
1501 (dummy_to_subprog_map): New hash table.
1502 (gnat_to_gnu_param): Set the SLOC here. Remove MECH parameter and
1503 add FIRST parameter. Deal with the mechanism here instead of...
1504 Do not make read-only variant of types. Simplify expressions.
1505 In the by-ref case, test the mechanism before must_pass_by_ref
1506 and also TYPE_IS_BY_REFERENCE_P before building the reference type.
1507 (gnat_to_gnu_subprog_type): New static function extracted from...
1508 Do not special-case the type_annotate_only mode. Call
1509 gnat_to_gnu_profile_type instead of gnat_to_gnu_type on return type.
1510 Deal with dummy return types. Likewise for parameter types. Deal
1511 with by-reference types explicitly and add a kludge for null procedures
1512 with untagged incomplete types. Remove assertion on the types and be
1513 prepared for multiple elaboration of the declarations. Skip the whole
1514 CICO processing if the profile is incomplete. Handle the completion of
1515 a previously incomplete profile.
1516 (gnat_to_gnu_entity) <E_Variable>: Rename local variable.
1517 Adjust couple of calls to create_param_decl.
1518 <E_Access_Subprogram_Type, E_Anonymous_Access_Subprogram_Type>:
1519 Remove specific deferring code.
1520 <E_Access_Type>: Also deal with E_Subprogram_Type designated type.
1521 Simplify handling of dummy types and remove obsolete comment.
1522 Constify a couple of variables. Do not set TYPE_UNIVERSAL_ALIASING_P
1524 <E_Access_Subtype>: Tweak comment and simplify condition.
1525 <E_Subprogram_Type>: ...here. Call it and clean up handling. Remove
1526 obsolete comment and adjust call to gnat_to_gnu_param. Adjust call to
1527 create_subprog_decl.
1528 <E_Incomplete_Type>: Add a couple of 'const' qualifiers and get rid of
1529 inner break statements. Tidy up condition guarding direct use of the
1531 (get_minimal_subprog_decl): Delete.
1532 (finalize_from_limited_with): Call update_profiles_with on dummy types
1533 with TYPE_DUMMY_IN_PROFILE_P set.
1534 (is_from_limited_with_of_main): Delete.
1535 (associate_subprog_with_dummy_type): New function.
1536 (update_profile): Likewise.
1537 (update_profiles_with): Likewise.
1538 (gnat_to_gnu_profile_type): Likewise.
1539 (init_gnat_decl): Initialize dummy_to_subprog_map.
1540 (destroy_gnat_decl): Destroy dummy_to_subprog_map.
1541 * gcc-interface/misc.c (gnat_get_alias_set): Add guard for accessing
1542 TYPE_UNIVERSAL_ALIASING_P.
1543 (gnat_get_array_descr_info): Minor tweak.
1544 * gcc-interface/trans.c (gigi): Adjust calls to create_subprog_decl.
1545 (build_raise_check): Likewise.
1546 (Compilation_Unit_to_gnu): Likewise.
1547 (Identifier_to_gnu): Accept mismatches coming from a limited context.
1548 (Attribute_to_gnu): Remove kludge for dispatch table entities.
1549 (process_freeze_entity): Do not retrieve old definition if there is an
1550 address clause on the entity. Call update_profiles_with on dummy types
1551 with TYPE_DUMMY_IN_PROFILE_P set.
1552 * gcc-interface/utils.c (build_dummy_unc_pointer_types): Also set
1553 TYPE_REFERENCE_TO to the fat pointer type.
1554 (create_subprog_type): Delete.
1555 (create_param_decl): Remove READONLY parameter.
1556 (finish_subprog_decl): New function extracted from...
1557 (create_subprog_decl): ...here. Call it. Remove CONST_FLAG and
1558 VOLATILE_FLAG parameters and adjust.
1559 (update_pointer_to): Also clear TYPE_REFERENCE_TO in the unconstrained
1562 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1564 * aa_util.adb, aa_util.ads: Removed, no longer used.
1566 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1568 * sem_prag.adb (Analyze_Pragma): An object
1569 renaming declaration resulting from the expansion of an object
1570 declaration is a suitable context for pragma Ghost.
1572 2016-04-27 Doug Rupp <rupp@adacore.com>
1574 * init.c: Refine last checkin so the only requirement is the
1575 signaling compilation unit is compiled with the same mode as
1576 the compilation unit containing the initial landing pad.
1578 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1580 * sem_ch13.adb (Valid_Default_Iterator): Better filter of illegal
1581 specifications for Default_Iterator, including overloaded cases
1582 where no interpretations are legal, and return types that are
1585 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1587 * exp_ch5.adb (Expand_N_Assignment_Statement): Do not install
1588 an accessibility check when the left hand side of the assignment
1589 denotes a container cursor.
1590 * exp_util.ads, exp_util.adb (Find_Primitive_Operations): Removed.
1591 * sem_ch4.adb (Find_Indexing_Operations): New routine.
1592 (Try_Container_Indexing): Code cleanup.
1594 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1596 * sem_ch10.adb, sem_case.adb: Mark messages udner -gnatwr when needed.
1598 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1600 * errout.adb, errutil.adb: Minor reformatting.
1602 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1604 * sem_ch13.adb (Analyze_Aspect_Specifications, case Pre/Post):
1605 Check that the classwide version is illegal when the prefix is
1606 an operation of an untagged synchronized type.
1608 2016-04-27 Arnaud Charlet <charleT@adacore.com>
1610 * sinput-l.ads, sem_ch13.adb: Minor editing.
1612 2016-04-27 Doug Rupp <rupp@adacore.com>
1614 * init.c (__gnat_adjust_context_for_raise) [arm-linux thumb]:
1615 Bump the pc so the lower order bit is set.
1617 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1619 * sem_case.adb, sem_case.ads (NO_Op): If appropriate warning is
1620 enabled, report an empty range in a case construct.
1622 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1624 * sinput.ads, a-cfdlli.adb, a-crbtgo.adb, a-chtgop.adb, a-cbhama.adb,
1625 a-rbtgbo.adb, a-crdlli.adb, a-chtgbo.adb: Minor editing.
1627 2016-04-27 Bob Duff <duff@adacore.com>
1629 * a-chtgop.adb (Adjust): Zero the tampering counts on assignment,
1630 as is done for the other containers.
1632 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1634 * ghost.adb (In_Subprogram_Body_Profile): New routine.
1635 (Is_OK_Declaration): Treat an unanalyzed expression
1636 function as an OK context. Treat a reference to a Ghost entity
1637 as OK when it appears within the profile of a subprogram body.
1639 2016-04-27 Bob Duff <duff@adacore.com>
1641 * errout.ads: Document the fact that informational messages
1642 don't have to be warnings.
1643 * errout.adb (Error_Msg_Internal): In statistics counts, deal
1644 correctly with informational messages that are not warnings.
1645 (Error_Msg_NEL): Remove useless 'if' aroung Set_Posted, because
1646 Set_Posted already checks for errors and ignores others.
1647 * erroutc.adb (Prescan_Message): Set Is_Serious_Error to False
1648 if Is_Info_Msg; the previous code was assuming that Is_Info_Msg
1649 implies Is_Warning_Msg.
1650 * errutil.adb (Error_Msg): In statistics counts, deal correctly
1651 with informational messages that are not warnings.
1653 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1655 * sem_util.ads, sem_util.adb (Is_Null_Record_Type): New predicate
1656 to determine whether a record type is a null record.
1657 * sem_ch3.adb (Analyze_Object_Declaration): If the type is a
1658 null record and there is no expression in the declaration,
1659 no predicate check applies to the object.
1661 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1663 * sem_ch7.adb (Analyze_Package_Body_Helper): The body of an
1664 instantiated package should not cause freezing of previous contracts.
1666 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1668 * sem_dim.adb (Analyze_Dimension): Handle subtype declarations
1669 that do not come from source.
1670 (Analyze_Dimension_Subtype_Declaration): Allow confirming
1671 dimensions on subtype entity, either inherited from base type
1672 or provided by aspect specification.
1674 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1676 * s-gearop.ads (Matrix_Vector_Solution, Matrix_Matrix_Solution):
1677 Add scalar formal object Zero, to allow detection and report
1678 when the matrix is singular.
1679 * s-gearop.adb (Matrix_Vector_Solution, Matrix_Matrix_Solution):
1680 Raise Constraint_Error if the Forward_Eliminate pass has
1681 determined that determinant is Zero.o
1682 * s-ngrear.adb (Solve): Add actual for Zero in corresponding
1684 * s-ngcoar.adb (Solve): Ditto.
1686 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1688 * sem_ch3.adb: Minor reformatting.
1690 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1692 * sem_dim.adb (Analyze_Dimension, case N_Identifier): Check
1693 that identifier has a usable type before analysis, to handle
1694 properly identifiers introduced after some lexical/syntactic
1695 recovery that created new identifiers.
1697 2016-04-27 Bob Duff <duff@adacore.com>
1699 * a-coinve.adb, a-comutr.adb, a-conhel.adb, a-convec.adb,
1700 exp_util.adb: Remove assertions that can fail in obscure cases when
1701 assertions are turned on but tampering checks are turned off.
1703 2016-04-27 Javier Miranda <miranda@adacore.com>
1705 * exp_ch6.adb (Add_Call_By_Copy_Code,
1706 Add_Simple_Call_By_Copy_Code, Expand_Actuals): Handle formals
1707 whose type comes from the limited view.
1709 2016-04-27 Yannick Moy <moy@adacore.com>
1711 * a-textio.adb: Complete previous patch.
1713 2016-04-27 Yannick Moy <moy@adacore.com>
1715 * inline.adb (Expand_Inlined_Call): Use Cannot_Inline instead of
1716 Error_Msg_N to issue message about impossibility to inline call,
1717 with slight change of message.
1719 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1721 * exp_spark.adb (Expand_Potential_Renaming): Removed.
1722 (Expand_SPARK): Update the call to expand a potential renaming.
1723 (Expand_SPARK_Potential_Renaming): New routine.
1724 * exp_spark.ads (Expand_SPARK_Potential_Renaming): New routine.
1725 * sem.adb Add with and use clauses for Exp_SPARK.
1726 (Analyze): Expand a non-overloaded potential renaming for SPARK.
1728 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1730 * sem_ch3.adb (Constrain_Discriminated_Type): In an instance,
1731 check full view for the presence of defaulted discriminants,
1732 even when the partial view of a private type has no visible and
1733 no unknown discriminants.
1735 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1737 * lib-xref.adb, exp_ch3.adb: Minor reformatting.
1739 2016-04-27 Nicolas Roche <roche@adacore.com>
1741 * rtinit.c: Add weak symbol __gnat_do_argv_expansion.
1743 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1745 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Code
1746 cleanup. Check the original node when trying to determine the node kind
1747 of pragma Volatile's argument to account for untagged derivations
1748 where the type is transformed into a constrained subtype.
1750 2016-04-27 Olivier Hainque <hainque@adacore.com>
1752 * mkdir.c (__gnat_mkdir): Rework the vxworks section to use a
1753 consistent posix interface on the caller side.
1755 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1757 * sem_ch10.adb (Build_Limited_View, Decorate_Type): If this
1758 is a limited view of a type, initialize the Limited_Dependents
1759 field to catch misuses of the type in a client unit.
1761 2016-04-27 Thomas Quinot <quinot@adacore.com>
1763 * a-strunb-shared.adb (Finalize): add missing Reference call.
1764 * s-strhas.adb: minor grammar fix and extension of comment
1765 * sem_ch8.adb: minor whitespace fixes
1767 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1769 * lib-xref.adb (Get_Type_Reference): Handle properly the case
1770 of an object declaration whose type definition is a class-wide
1771 subtype and whose expression is a function call that returns a
1774 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1776 * sem_util.ads, sem_util.adb (Output_Entity): New routine.
1777 (Output_Name): New routine.
1779 2016-04-27 Bob Duff <duff@adacore.com>
1781 * exp_ch3.adb (Rewrite_As_Renaming): Disable previous change for now.
1783 2016-04-27 Vincent Celier <celier@adacore.com>
1785 * gnatcmd.adb: For "gnat ls -V -P", recognize switch
1786 --unchecked-shared-lib-imports and set the flag
1787 Opt.Unchecked_Shared_Lib_Imports accordingly.
1789 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1791 * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part):
1792 A generic subprogram is never a primitive operation, and thus
1793 a classwide condition for it is not legal.
1795 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1797 * sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor
1800 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1802 * sem_res.adb (Flag_Effectively_Volatile_Objects): New routine.
1803 (Resolve_Actuals): Flag effectively volatile objects with enabled
1804 property Async_Writers or Effective_Reads as illegal.
1805 * sem_util.adb (Is_OK_Volatile_Context): Comment reformatting.
1807 2016-04-27 Javier Miranda <miranda@adacore.com>
1809 * exp_ch3.adb (Make_Predefined_Primitive_Specs):
1810 Do not generate the profile of the equality operator if it has
1811 been explicitly defined as abstract in the parent type. Required
1812 to avoid reporting an spurious error.
1814 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1816 * sem_dim.ads, sem_dim.adb (Check_Expression_Dimensions): New
1817 procedure to compute the dimension vector of a scalar expression
1818 and compare it with the dimensions if its expected subtype. Used
1819 for the ultimate components of a multidimensional aggregate,
1820 whose components typically are themselves aggregates that are
1821 expanded separately. Previous to this patch, dimensionality
1822 checking on such aggregates generated spurious errors.
1823 * sem_aggr.adb (Resolve_Array_Aggregate): Use
1824 Check_Expression_Dimensions when needed.
1826 2016-04-27 Javier Miranda <miranda@adacore.com>
1828 * einfo.ads, einfo.adb (Corresponding_Function): New attribute
1829 (applicable to E_Procedure).
1830 (Corresponding_Procedure): New attribute (applicable to E_Function).
1831 * exp_util.adb (Build_Procedure_Form): Link the function with
1832 its internally built proc and viceversa.
1833 * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
1834 attribute Rewritten_For_C and Corresponding_Procedure to the body.
1835 * exp_ch6.adb (Rewritten_For_C_Func_Id): Removed.
1836 (Rewritten_For_C_Proc_Id): Removed.
1837 * exp_unst.adb (Note_Uplevel_Ref): Use the new attribute to
1838 locate the corresponding procedure.
1840 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1842 * sem_ch13.adb (Analyze_Aspect_Export_Import): Signal that there is no
1843 corresponding pragma.
1845 2016-04-27 Bob Duff <duff@adacore.com>
1847 * exp_ch3.adb: Minor comment improvement.
1849 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1851 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): If the
1852 return type is an untagged limited record with only access
1853 discriminants and no controlled components, the return value does not
1854 need to use the secondary stack.
1856 2016-04-27 Javier Miranda <miranda@adacore.com>
1858 * exp_util.adb (Remove_Side_Effects): When
1859 generating C code handle object declarations that have
1860 discriminants and are initialized by means of a call to a
1863 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1865 * a-textio.adb (Get_Line function): Handle properly the case of
1866 a line that has the same length as the buffer (or a multiple
1867 thereof) and there is no line terminator.
1868 * a-tigeli.adb (Get_Line procedure): Do not store an end_of_file
1869 in the string when there is no previous line terminator and we
1870 need at most one additional character.
1872 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1874 * s-rident.ads: Make No_Implicit_Loops non partition wide.
1876 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1878 * sem_ch11.adb (Analyze_Handled_Statements): check useless
1879 assignments also in entries and task bodies, not only in
1880 procedures and declaration blocks.
1881 * sem_ch5.adb (Analyze_Block_Statement): check useless
1882 assignements in declaration blocks as part of processing their
1883 handled statement sequence, just like it was done for procedures
1884 and now is also done for entries and task bodies.
1885 * sem_warn.adb (Warn_On_Useless_Assignment): detect boundries
1886 of entries and task bodies just like of procedures.
1888 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1890 * sem_util.adb (Is_Volatile_Function): Recognize
1891 a function declared within a protected type as well as the
1892 protected/unprotected version of a function.
1894 2016-04-27 Bob Duff <duff@adacore.com>
1896 * exp_ch3.adb (Expand_N_Object_Declaration): Rewrite an object
1897 declaration of the form "X : T := Func (...);", where T is
1898 controlled, as a renaming.
1899 * a-strunb-shared.adb (Finalize): Set the Unbounded_String Object
1900 to be an empty string, instead of null-ing out the Reference.
1901 * exp_util.adb (Needs_Finalization): Remove redundant code.
1903 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1905 * aspects.ads Aspects Export and Import do not require delay. They
1906 were classified as delayed aspects, but treated as non-delayed
1907 by the analysis of aspects.
1908 * freeze.adb (Copy_Import_Pragma): New routine.
1909 (Wrap_Imported_Subprogram): Copy the import pragma by first
1910 resetting all semantic fields to avoid an infinite loop when
1911 performing the copy.
1912 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add
1913 comment on the processing of aspects Export and Import
1914 at the freeze point.
1915 (Analyze_Aspect_Convention: New routine.
1916 (Analyze_Aspect_Export_Import): New routine.
1917 (Analyze_Aspect_External_Link_Name): New routine.
1918 (Analyze_Aspect_External_Or_Link_Name): Removed.
1919 (Analyze_Aspect_Specifications): Factor out the analysis of
1920 aspects Convention, Export, External_Name, Import, and Link_Name
1921 in their respective routines. Aspects Export and Import should
1922 not generate a Boolean pragma because their corresponding pragmas
1923 have a very different syntax.
1924 (Build_Export_Import_Pragma): New routine.
1925 (Get_Interfacing_Aspects): New routine.
1927 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1929 * inline.adb (Add_Inlined_Body): Overhaul implementation,
1930 robustify handling of -gnatn1, add special treatment for
1931 expression functions.
1933 2016-04-27 Doug Rupp <rupp@adacore.com>
1935 * g-traceb.ads: Update comment.
1936 * exp_ch2.adb: minor style fix in object declaration
1938 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1940 * sem_elab.adb (Check_Internal_Call): Do not
1941 consider a call when it appears within pragma Initial_Condition
1942 since the pragma is part of the elaboration statements of a
1943 package body and may only call external subprograms or subprograms
1944 whose body is already available.
1945 (Within_Initial_Condition): New routine.
1947 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1949 * exp_util.adb (Build_Procedure_Form): Prevent double generation
1950 of the procedure form when dealing with an expression function
1951 whose return type is an array.
1952 * sem_ch3.adb: Fix out-of order Has_Predicates setting.
1953 * exp_ch6.adb: Proper conversion for inherited operation in C.
1954 * sem_ch6.adb: Code cleanup.
1956 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1958 * lib-xref.ads, sem_ch10.adb: minor style fix in comment
1959 * g-socket.adb: Minor reformatting.
1960 * sinfo.ads: Minor comment correction.
1961 * sem_warn.ads: minor grammar fix in comment
1963 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1965 * gcc-interface/gigi.h (gnat_to_gnu_entity): Adjust prototype.
1966 (maybe_pad_type): Adjust comment.
1967 (finish_record_type): Likewise.
1968 (rest_of_record_type_compilation): Likewise.
1969 * gcc-interface/decl.c (gnat_to_gnu_entity): Change DEFINITION type
1970 parameter from integer to boolean. Adjust recursive calls.
1971 <E_Subprogram_Type>: Use copy_type and remove redundant assignments.
1972 <E_Signed_Integer_Subtype>: Adjust comment. Remove call to
1973 rest_of_record_type_compilation. Set TYPE_PADDING_P flag earlier.
1974 Pass false to finish_record_type. Set the debug type later.
1975 <E_Record_Subtype>: Remove call to rest_of_record_type_compilation.
1976 (gnat_to_gnu_component_type): Fix formatting.
1977 (gnat_to_gnu_field_decl): Adjust call to gnat_to_gnu_entity.
1978 (gnat_to_gnu_type): Likewise.
1979 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
1980 (Loop_Statement_to_gnu): Likewise.
1981 (Subprogram_Body_to_gnu): Likewise.
1982 (Exception_Handler_to_gnu_fe_sjlj): Likewise.
1983 (Exception_Handler_to_gnu_gcc): Likewise.
1984 (Compilation_Unit_to_gnu): Likewise.
1985 (gnat_to_gnu): Likewise.
1986 (push_exception_label_stack): Likewise.
1987 (elaborate_all_entities_for_package): Likewise.
1988 (process_freeze_entity): Likewise.
1989 (process_decls): Likewise.
1990 (process_type): Likewise.
1991 * gcc-interface/utils.c (struct deferred_decl_context_node): Tweak.
1992 (maybe_pad_type): Adjust comments. Set the debug type later. Remove
1993 call to rest_of_record_type_compilation.
1994 (rest_of_record_type_compilation): Use copy_type.
1995 (copy_type): Use correctly typed constants.
1996 (gnat_signed_or_unsigned_type_for): Use copy_type.
1997 * gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
1998 (build_goto_raise): Adjust call tognat_to_gnu_entity.
2000 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
2002 * gcc-interface/misc.c (gnat_init): Do not call
2003 internal_reference_types.
2005 2016-04-27 Svante Signell <svante.signell@gmail.com>
2007 * gcc-interface/Makefile.in (x86 GNU/Hurd): Use s-osinte-gnu.adb.
2008 * s-osinte-gnu.ads: Small tweaks.
2009 * s-osinte-gnu.adb: New file.
2011 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2013 * sem_prag.adb (Match_Constituent): Treat a constant as a legal
2014 constituent even if it is not to prevent spurious errors.
2016 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2018 * sem_ch4.adb: Minor typo fixes and reformatting.
2020 2016-04-21 Dmitriy Anisimkov <anisimko@adacore.com>
2022 * g-calend.ads (No_Time): The same value in any timezone.
2023 * g-socket.adb (Raise_Host_Error): Remove ending
2024 dot from original error message before append colon delimited
2027 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2029 * sem_ch3.adb: Code cleanup.
2030 * sem_ch6.adb: Code cleanup.
2031 (Is_Matching_Limited_View): New routine.
2032 (Matches_Limited_With_View): Reimplemented.
2033 * sem_ch10.adb (Decorate_Type): Code cleanup.
2035 2016-04-21 Doug Rupp <rupp@adacore.com>
2037 * tracebak.c (PPC ELF): Add macro defs for lynxos178e.
2039 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2041 * sem_ch4.adb (Try_Container_Indexing): If there are overloaded
2042 indexing functions, collect all overloadings of the call firts,
2043 and then transfer them to indexing node, to prevent interleaving
2044 of the set of interpretations of the nodes involved.
2045 * sem_res.adb (Resolve): Suppress cascaded errors that report
2046 ambiguities when one of the actuals in an overloaded generatlized
2047 indexing operation is illegal and has type Any_Type, as is done
2048 for similar cascaded errors in subprogram calls.
2049 (Valid_Tagged_Conversion): Cleanup conversion checks when one
2050 of the types involved is a class-wide subtype.
2052 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2054 * sem_ch12.adb (Load_Parent_Of_Generic): When looking for the
2055 subprogram declaration within a wrapper package, skip pragmas
2056 that may have been generated by aspect specifications on the
2059 2016-04-21 Javier Miranda <miranda@adacore.com>
2061 * exp_aggr.adb (Component_Not_OK_For_Backend): Generating C
2062 code return True for array identifiers since the backend needs
2063 to initialize such component by means of memcpy().
2065 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2067 * a-tasatt.adb, a-tasatt.ads (Fast_Path): Rewritten to avoid reading
2068 potentially uninitialized memory.
2069 * sem_ch3.adb: Minor style fix in comment.
2071 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2073 * gnat_rm.texi, gnat_ugn.texi,
2074 doc/gnat_ugn/gnat_project_manager.rst,
2075 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
2076 doc/gnat_ugn/gnat_and_program_execution.rst,
2077 doc/gnat_ugn/gnat_utility_programs.rst,
2078 doc/gnat_ugn/the_gnat_compilation_model.rst,
2079 doc/gnat_rm/implementation_defined_attributes.rst,
2080 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
2081 doc/gnat_rm/implementation_defined_pragmas.rst,
2082 doc/gnat_rm/the_gnat_library.rst,
2083 doc/gnat_rm/implementation_defined_aspects.rst: Update doc.
2084 * doc/Makefile: Cleanups.
2086 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2088 * exp_pakd.adb, sem_ch13.adb: Minor reformatting.
2090 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2092 * exp_dbug.adb, exp_dbug.ads (Qualify_Entity_Name): Add suffixes to
2093 disambiguate local variables that may be hidden from inner visibility
2094 by nested block declarations or loop variables.
2096 2016-04-21 Jerome Lambourg <lambourg@adacore.com>
2098 * s-soflin.adb: Initialize the Stack_Limit global variable.
2100 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2102 * lib-writ.adb: Minor reformatting.
2104 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2106 * exp_pakd.adb (Compute_Number_Components): New function to
2107 build an expression that computes the number of a components of
2108 an array that may be multidimensional.
2109 (Expan_Packed_Eq): Use it.
2111 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2113 * g-traceb.ads: Update list of supported platforms.
2115 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2117 * sem_ch13.adb (Add_Predicates): if the type is declared in
2118 an inner package it may be frozen outside of the package, and
2119 the generated pragma has not been analyzed yet, the expression
2120 for the predicate must be captured and added to the predicate
2121 function at this point.
2123 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2125 * contracts.adb (Analyze_Package_Body_Contract): Do not check
2126 for a missing package refinement because 1) packages do not have
2127 "refinement" and 2) the check for proper state refinement is
2128 performed in a different place.
2129 * einfo.adb (Has_Non_Null_Visible_Refinement): Reimplemented.
2130 (Has_Null_Visible_Refinement): Reimplemented.
2131 * sem_ch3.adb (Analyze_Declarations): Determine whether all
2132 abstract states have received a refinement and if not, emit
2134 * sem_ch7.adb (Analyze_Package_Declaration): Code
2135 cleanup. Determine whether all abstract states of the
2136 package and any nested packages have received a refinement
2137 and if not, emit errors.
2138 (Requires_Completion_In_Body): Add new formal parameter
2139 Do_Abstract_States. Update the comment on usage. Propagate the
2140 Do_Abstract_States flag to all Unit_Requires_Body calls.
2141 (Unit_Requires_Body): Remove formal
2142 parameter Ignore_Abstract_States. Add new formal paramter
2143 Do_Abstract_States. Propagate the Do_Abstract_States flag to
2144 all Requires_Completion_In calls.
2145 * sem_ch7.ads (Unit_Requires_Body): Remove formal
2146 parameter Ignore_Abstract_States. Add new formal paramter
2147 Do_Abstract_States. Update the comment on usage.
2148 * sem_ch9.adb (Analyze_Single_Protected_Declaration): Do
2149 not initialize the constituent list as this is now done on a
2150 need-to-add-element basis.
2151 (Analyze_Single_Task_Declaration):
2152 Do not initialize the constituent list as this is now done on
2153 a need-to-add-element basis.
2154 * sem_ch10.adb (Decorate_State): Do not initialize the constituent
2155 lists as this is now done on a need-to-add-element basis.
2156 * sem_prag.adb (Analyze_Constituent): Set the
2157 refinement constituents when adding a new element.
2158 (Analyze_Part_Of_In_Decl_Part): Set the Part_Of constituents when
2159 adding a new element.
2160 (Analyze_Part_Of_Option): Set the Part_Of
2161 constituents when adding a new element.
2162 (Analyze_Pragma): Set the Part_Of constituents when adding a new
2164 (Check_Constituent_Usage (all versions)): Reimplemented.
2165 (Collect_Constituent): Set the refinement constituents when adding
2167 (Create_Abstract_State): Do not initialize the
2168 constituent lists as this is now done on a need-to-add-element basis.
2169 (Propagate_Part_Of): Set the Part_Of constituents when
2170 adding a new element.
2171 * sem_util.adb (Check_State_Refinements): New routine.
2172 (Has_Non_Null_Refinement): Reimplemented.
2173 (Has_Null_Refinement): Reimplemented.
2174 (Requires_State_Refinement): Removed.
2175 * sem_util.ads (Check_State_Refinements): New routine.
2176 (Requires_State_Refinement): Removed.
2178 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2180 * lib-writ.adb, sem_ch6.adb: Minor reformatting and code cleanup.
2181 * sem.adb: Fix comment.
2183 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2185 * sem_ch3.adb (Analyze_Subtype_Declaration): A subtype
2186 declaration with no aspects, whose subtype_mark is a subtype
2187 with predicates, inherits the list of subprograms for the type.
2189 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2191 * exp_aggr.adb (Has_Per_Object_Constraint): Refine previous
2194 2016-04-21 Thomas Quinot <quinot@adacore.com>
2196 * g-socket.adb (Raise_Host_Error): Include additional Name parameter.
2198 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2200 * lib-writ.adb (Write_ALI): Do not record in ali file units
2201 that are present in the files table but not analyzed. These
2202 units are present because they appear in the context of units
2203 named in limited_with clauses, and the unit being compiled does
2204 not depend semantically on them.
2206 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2208 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Simplify code to
2209 create the procedure body for an function returning an array type,
2210 when generating C code. Reuse the subprogram body rather than
2211 creating a new one, both as an efficiency measure and because
2212 in an instance the body may contain global references that must
2215 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2217 * sem_ch3.adb, exp_attr.adb, exp_ch6.adb, exp_aggr.adb: Minor
2220 2016-04-21 Javier Miranda <miranda@adacore.com>
2222 * exp_aggr.adb (Component_Check): Extend
2223 the check that verifies that the aggregate has no function
2224 calls to handle transformations performed by the frontend.
2225 (Ultimate_Original_Expression): New subprogram.
2227 2016-04-21 Philippe Gil <gil@adacore.com>
2229 * krunch.adb (Krunch): Fix krunching of i-java.
2231 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2233 * exp_ch8.adb (Evaluation_Required): Always return
2234 True when Modify_Tree_For_C.
2236 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2238 * gnatlink.adb (Gnatlink): Robustify detection of Windows target.
2239 * alloc.ads: Minor comment fixes.
2240 * einfo.ads: Fix typo.
2242 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2244 * exp_aggr.adb (Component_Not_OK_For_Backend): Redo previous
2245 changes to handle all cases of components depending on the
2246 discriminant, not just string literals.
2248 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2250 * sem_ch3.adb (Analyze_Subtype_Declaration): If the subtype
2251 declaration is the generated declaration for a generic actual,
2252 inherit predicates from the actual if it is a predicated subtype.
2254 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2256 * exp_ch6.adb (Rewrite_Function_Call_For_C): If the function is
2257 inherited and its result is controlling, introduce a conversion
2258 on the actual for the corresponding procedure call, to avoid
2259 spurious type errors.
2261 2016-04-21 Jerome Lambourg <lambourg@adacore.com>
2263 * krunch.adb (Krunch): Fix krunching of i-vxworks.
2265 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2267 * exp_aggr.adb: Minor reformatting and code cleanup.
2269 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2271 * sem_ch13.adb (Resolve_Name): Omit quantified expressions from
2272 resolution, because they introduce local names. Full resolution
2273 will take place when predicate function is constructed.
2275 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2277 * exp_aggr.adb (Component_Not_OK_For_Backend): Refine previous
2278 change to take into account Per_Object_Constraint field rather
2279 than special casing strings.
2280 * exp_ch6.adb: Fix typo in Replace_Returns.
2282 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2284 * sem_ch5.adb: Minor reformatting.
2286 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2288 * exp_aggr.adb (Backend_Processing_Possible): Return False
2289 when generating C and aggregate contains function calls.
2291 2016-04-21 Tristan Gingold <gingold@adacore.com>
2293 * krunch.adb (Krunch): Only partially krunch children of
2294 Interfaces that aren't known.
2296 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2298 * sem_prag.adb (Make_Inline): Handle properly the instantiation
2299 of a generic subpprogram that carries an Inline aspect. Place
2300 inline info on the anonymous subprogram that is constructed in
2301 the wrapper package.
2302 (Analyze_Pragma, case Pure): Do not check placement if pragma
2303 appears within an instantiation, which can be nested at any level.
2304 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not copy Freeze
2305 node from anonymous subprogram to its visible renaming. The
2306 freeze node will be constructed if the subprogram carries
2308 (Set_Global): Preserve dimension information if present (from
2311 2016-04-21 Vasiliy Fofanov <fofanov@adacore.com>
2313 * gnatlink.adb: Change wording of the warning message on
2314 problematic filenames to be more neutral. Add a new substring
2315 "patch" introduced on Windows 10.
2317 2016-04-21 Philippe Gil <gil@adacore.com>
2319 * tracebak.c (__gnat_backtrace): handle bad RIP values (win64 only)
2321 2016-04-21 Javier Miranda <miranda@adacore.com>
2323 * exp_aggr.adb (Component_Not_OK_For_Backend): Return true for string
2326 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2328 * einfo.adb (Has_Non_Null_Abstract_State): New routine.
2329 * einfo.ads New synthesized attribute
2330 Has_Non_Null_Abstract_State along with occurrences in entities.
2331 (Has_Non_Null_Abstract_State): New routine.
2332 * sem_ch7.adb (Unit_Requires_Body): Add local variable
2333 Requires_Body. A package declaring an abstract state requires
2334 a body only when the state is non-null and the package contains
2335 at least one other construct that requires completion in a body.
2336 * sem_util.adb (Mode_Is_Off): Removed.
2337 (Requires_State_Refinement): Remove an obsolete check. Code
2340 2016-04-21 Bob Duff <duff@adacore.com>
2342 * sem_attr.adb (Analyze_Attribute): In processing
2343 the 'Old attribute, a warning is given for infinite recursion. Fix
2344 the code to not crash when the prefix of 'Old denotes a protected
2346 * sem_ch5.adb (Analyze_Iterator_Specification):
2347 Avoid calling Is_Dependent_Component_Of_Mutable_Object in cases
2348 where the parameter would not be an object.
2350 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2352 * sem_eval.adb (Compile_Time_Compare): Be prepared for an empty
2353 Etype or Underlying_Type of the operands.
2355 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2357 * atree.adb (Print_Statistics): Protect against overflows and
2358 print the memory consumption in bytes.
2359 * table.adb (Reallocate): Do the intermediate calculation of the new
2360 size using the Memory.size_t type.
2362 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2364 * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
2365 expansion of Attribute_Machine and Attribute_Model for AAMP.
2367 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2369 * freeze.adb: Disable previous change for now.
2371 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2373 * sem_ch8.adb (Find_Selected_Component): If prefix has an
2374 access type and designated type is a limited view, introduce
2375 an explicit dereference before continuing the analysis, and
2376 set its type to the non-limited view of the designated type,
2377 if we are in context where it is available.
2379 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2381 * freeze.adb: Freeze profile in ASIS mode.
2383 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2385 * sem_aux.ads, sem_aux.adb (Has_Rep_Item): New variant.
2386 * sem_util.adb (Inherit_Rep_Item_Chain): Reimplemented.
2388 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2390 * exp_ch6.adb: Minor reformatting.
2392 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2394 * sem_ch13.adb: Minor comment update.
2396 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2398 * freeze.ads, freeze.adb (Freeze_Entity, Freeze_Before): Add
2399 boolean parameter to determine whether freezing an overloadable
2400 entity freezes its profile as well. This is required by
2401 AI05-019. The call to Freeze_Profile within Freeze_Entity is
2402 conditioned by the value of this flag, whose default is True.
2403 * sem_attr.adb (Resolve_Attribute, case 'Access): The attribute
2404 reference freezes the prefix, but it the prefix is a subprogram
2405 it does not freeze its profile.
2407 2016-04-21 Javier Miranda <miranda@adacore.com>
2409 * exp_util.adb (Build_Procedure_Form): No action needed for
2410 subprogram renamings since the backend can generate the call
2411 using the renamed subprogram. This leaves the tree more clean
2413 * exp_ch6.adb (Expand_Call): Extend previous patch for
2414 rewritten-for-c entities to handle subprogram renamings.
2415 (Rewrite_Function_Call_For_C): Handle subprogram renamings.
2417 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2419 * sem_ch13.adb: Code cleanup.
2421 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2423 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If the body is
2424 created for SPARK_To_C, the entity must remain invisible so it
2425 does not overload subsequent references to the original function.
2426 * exp_ch6.adb (Build_Procedure_Body_Form, Replace_Returns):
2427 Handle Extended_Return_Statements by replacing it with a block
2428 with assignments and a simple return statement.
2429 * exp_util.adb (Build_Procedure_Form): Make procedure entity
2430 invisible after analyzing declaration, to prevent improper
2433 2016-04-21 Javier Miranda <miranda@adacore.com>
2435 * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
2436 attribute Rewritten_For_C to the body since since the expander
2437 may generate calls using that entity.
2438 * exp_ch6.adb (Expand_Call): For internally generated
2439 calls ensure that they reference the entity of the spec
2440 of the called function.
2441 (Rewritten_For_C_Func_Id): New subprogram.
2442 (Rewritten_For_C_Proc_Id): New subprogram.
2443 (Rewrite_Function_Call_For_C): Invoke the new subprogram to
2444 ensure that we skip freezing entities.
2445 * exp_util.adb (Build_Procedure_Form): No action needed if the
2446 procedure was already built.
2448 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2450 * sem_ch3.adb, exp_util.adb, sem_ch13.adb, exp_unst.adb: Minor
2453 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2455 * sem_util.adb (Denotes_Iterator): Use root type to determine
2456 whether the ultimate ancestor is the predefined iterator
2458 * exp_ch5.adb (Expand_Iterator_Over_Container): simplify code
2459 and avoid reuse of Pack local variable.
2461 2016-04-21 Olivier Hainque <hainque@adacore.com>
2463 * system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
2464 system-vxworks-ppc.ads, system-vxworks-m68k.ads,
2465 system-vxworks-mips.ads, system-vxworks-x86.ads: Define
2466 Executable_Extension to ".out".
2468 2016-04-21 Javier Miranda <miranda@adacore.com>
2470 * frontend.adb: Update call to Unnest_Subprograms.
2471 * exp_ch6.ads, exp_ch6.adb, exp_unst.ads, exp_unst.adb
2472 (Unnest_Subprograms): Moved to package exp_unst.
2473 * exp_unst.ads (Unnest_Subprogram): Moved to the body of the
2475 * exp_dbug.adb (Qualify_Entity_Name): Enable qualification of
2476 enumeration literals when generating C code.
2478 2016-04-21 Javier Miranda <miranda@adacore.com>
2480 * frontend.adb: Remove call to initialize Exp_Ch6.
2481 * exp_ch6.ads, exp_ch6.adb (Initialize): removed.
2482 (Unest_Entry/Unest_Bodies): Removed.
2483 (Unnest_Subprograms): Code cleanup.
2485 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2487 * set_targ.adb (Read_Target_Dependent_Values):
2488 close target description file once its contents is read.
2489 * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File
2490 and Stderr_File): Close local file descriptors before spawning
2492 * exp_util.adb (Containing_Package_With_Ext_Axioms): Limit scope of
2493 local variables to make the code easier to understand and avoid
2494 duplicated calls to Parent and Generic_Parent.
2496 2016-04-20 Bob Duff <duff@adacore.com>
2498 * s-os_lib.ads: Minor comment fix.
2500 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2502 * exp_ch5.adb (Expand_N_Assignment_Statement): Do no generate
2503 a discriminant check for a type whose partial view has unknown
2504 discriminants when the full view has discriminants with defaults.
2506 2016-04-20 Javier Miranda <miranda@adacore.com>
2508 * exp_util.adb (Remove_Side_Effects): When generating C code
2509 remove side effect of type conversion of access to unconstrained
2511 (Side_Effect_Free): Return false for the type
2512 conversion of access to unconstrained array type when generating
2514 * sem_res.adb (Resolved_Type_Conversion): Remove side effects
2515 of access to unconstrained array type conversion when generating
2518 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2520 * sem_ch13.adb (Build_Predicate_Function_Declaration): New
2521 function, to construct the declaration of a predicate function
2522 at the end of the current declarative part rather than at the
2523 (possibly later) freeze point of the type. This also allows uses
2524 of a type with predicates in instantiations elsewhere.
2525 (Resolve_Aspect_Expression): New procedure to detect visiblity
2526 errors in aspect expressions, at the end of the declarative part
2527 that includes the type declaration.
2528 * sem_ch3.adb (Complete_Private_Subtype): Propagate properly the
2529 predicate function from private to full view.
2530 * einfo.adb (Predicate_Function): Refine search for predicate
2531 function when type has a full view and predicate function may
2532 be defined on either view.
2534 2016-04-20 Javier Miranda <miranda@adacore.com>
2536 * frontend.adb: Passing the root of the tree to
2537 Unnest_Subprograms().
2538 * exp_ch6.adb (Expand_N_Subprogram_Body): Remove code that
2539 took care of adding subprograms to the Unest_Bodies table since
2540 performing such action too early disables the ability to process
2541 generic instantiations.
2542 (Unnest_Subprograms): Adding parameter.
2543 (Search_Unnesting_Subprograms): New subprogram.
2544 * exp_ch6.ads (Unnest_Subrograms): Update documentation.
2546 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2548 * exp_util.adb, freeze.adb, sem_util.adb: Minor reformatting.
2550 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2552 * exp_unst.adb (Check_Static_Type): For a private type, check
2555 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2557 * sem_attr.adb (Check_Type): Reject an attribute reference in
2558 an aspect expression, when the prefix of the reference is the
2559 current instance of the type to which the aspect applies.
2561 2016-04-20 Bob Duff <duff@adacore.com>
2563 * sem_ch6.adb (Enter_Overloaded_Entity): Do not warn about
2564 hiding unless we're actually hiding something. The previous
2565 code would (for example) warn about a "<" on a record type
2566 because it incorrectly thought it was hiding the "<" on Boolean
2567 in Standard. We need to check that the homonym S is in fact a
2568 homograph of a predefined operator.
2570 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2572 * exp_util.ads, exp_util.adb (Build_Procedure_Form): Moved here
2573 from exp_ch6.adb, for use in SPARK_To_C mode when creating the
2574 procedure equivalent to a function returning an array, when this
2575 construction is deferred to the freeze point of the function.
2576 * sem_util.adb (Is_Unchecked_Conversion_Instance): Include a
2577 function that renames an instance of Unchecked_Conversion.
2578 * freeze.adb (Freeze_Subprogram): Generate the proper procedure
2579 declaration for a function returning an array.
2580 * exp_ch6.adb (Build_Procedure_Form): Moved to exp_util.
2582 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2584 * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute):
2585 New predicate to determine that in a context with full run-time,
2586 a function call is an expansion of a reference to attribute
2588 * sem_ch5.adb (Analyze_Function_Call): use it.
2589 * exp_ch5.adb (Expand_N_Subprogram_Call): use it.
2591 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2593 * einfo.adb Flag286 is now used as Is_Exception_Handler.
2594 (Is_Exception_Handler): New routine.
2595 (Set_Is_Exception_Handler): New routine.
2596 (Write_Entity_Flags): Output the status of Is_Exception_Handler.
2597 * einfo.ads New attribute Is_Exception_Handler along with
2598 occurrences in entities.
2599 (Is_Exception_Handler): New routine along with pragma Inline.
2600 (Set_Is_Exception_Handler): New routine along with pragma Inline.
2601 * exp_ch7.adb (Make_Transient_Block): Ignore blocks generated
2602 for exception handlers with a choice parameter.
2603 * sem_ch11.adb (Analyze_Exception_Handlers): Mark the scope
2604 generated for a choice parameter as an exception handler.
2606 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2608 * sem_ch3.adb (Build_Derived_Access_Type): Remove dead code.
2609 (Constrain_Discriminated_Type): In an instance, if the type has
2610 unknown discriminants, use its full view.
2611 (Process_Subtype): Check that the base type is private before
2612 adding subtype to Private_Dependents list.
2614 2016-04-20 Bob Duff <duff@adacore.com>
2616 * sem_ch13.adb: Minor comment fix.
2618 2016-04-20 Yannick Moy <moy@adacore.com>
2620 * sem_ch4.adb: Fix typos in comments.
2621 * sem_res.adb (Resolve_Case_Expression): Fix type of case alternatives.
2623 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2625 * sem_ch4.adb (Analyze_Selected_Component): A reference to the
2626 current instance of a task type is legal if the prefix is an
2627 expression of that task type and the selector is an entry or
2630 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2632 * a-cfdlli.ads (List): Type is no longer tagged, not needed. Move
2633 varsize field at the end for efficiency.
2635 2016-04-20 Vincent Celier <celier@adacore.com>
2637 * gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
2638 ls" includes the switch -V.
2639 * clean.adb: "<target>-gnatclean -P" now calls "gprclean
2641 * make.adb: "<target>-gnatmake -P" now calls "gprbuild
2644 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2646 * sem_ch12.adb (Qualify_Type): Do not perform
2647 partial qualification when the immediate scope is a generic unit.
2649 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2651 * exp_unst.adb: Minor reformatting.
2653 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2655 * exp_ch4.adb (Expand_Allocator_Expression): Ensure that the
2656 tag assignment and adjustment preceed the accessibility check.
2657 * exp_ch7.adb (Is_Subprogram_Call): Reimplemented.
2659 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2661 * exp_prag.adb (Expand_Attributes): Ensure that
2662 the temporary used to capture the value of attribute 'Old's
2663 prefix is properly initialized.
2665 2016-04-20 Javier Miranda <miranda@adacore.com>
2667 * exp_unst.ads, exp_unst.adb (Get_Level, Subp_Index): Moved to library
2670 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2672 * sem_ch9.adb (Analyze_Task_Type_Declaration): Shut down warning
2675 2016-04-20 Vincent Celier <celier@adacore.com>
2677 * make.adb: Code cleanup.
2679 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2681 * exp_ch4.adb (Expand_Allocator_Expression): Help C code
2684 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2686 * sem_ch12.adb (Copy_Generic_Node): Handle the special
2687 qualification installed for universal literals that act as
2688 operands in binary or unary operators. (Qualify_Operand): Mark
2689 the qualification to signal the instantiation mechanism how to
2690 handle global reference propagation.
2691 * sinfo.adb (Is_Qualified_Universal_Literal): New routine.
2692 (Set_Is_Qualified_Universal_Literal): New routine.
2693 * sinfo.ads New attribute Is_Qualified_Universal_Literal along
2694 with occurrences in nodes.
2695 (Is_Qualified_Universal_Literal):
2696 New routine along with pragma Inline.
2697 (Set_Is_Qualified_Universal_Literal): New routine along with
2700 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2702 * sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length
2703 so that the corresponding checks are preserved across compilations
2704 that include System.Constants in their context.
2706 2016-04-20 Gary Dismukes <dismukes@adacore.com>
2708 * sem_type.adb: Minor typo fix and reformatting.
2709 * a-conhel.ads: Update comment.
2711 2016-04-20 Bob Duff <duff@adacore.com>
2713 * a-cihama.adb, a-cihase.adb, a-coinve.adb (Copy): Rewrite the
2714 code so it doesn't trigger an "uninit var" warning.
2716 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2718 * sem_attr.ads Add new table Universal_Type_Attribute.
2719 * sem_util.adb (Yields_Universal_Type): Use a table lookup when
2720 checking attributes.
2722 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2724 * exp_aggr.adb (Init_Stored_Discriminants,
2725 Init_Visible_Discriminants): New procedures, subsidiary of
2726 Build_Record_Aggr_Code, to handle properly the construction
2727 of aggregates for a derived type that constrains some parent
2728 discriminants and renames others.
2730 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2732 * sem_ch12.adb (Qualify_Universal_Operands): New routine.
2733 (Save_References_In_Operator): Add explicit qualifications in
2734 the generic template for all operands of universal type.
2735 * sem_type.adb (Disambiguate): Update the call to Matches.
2736 (Matches): Reimplemented.
2737 * sem_util.ads, sem_util.adb (Yields_Universal_Type): New routine.
2739 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2741 * sem_ch13.adb (Rep_Item_Too_Late): Better error message for
2742 an illegal aspect that freezes the entity to which it applies.
2744 2016-04-20 Bob Duff <duff@adacore.com>
2746 * a-stwibo.ads, a-stzbou.ads
2747 ("="): Add overriding keyword before function to avoid crash when
2748 compiler is called with -gnatyO (check overriding indicators).
2750 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2752 * sem_prag.adb (Analyze_Pragma, case Check_Policy): If this
2753 is a configuration pragma and it uses the ARG syntax, insert
2754 the rewritten pragma after the current one rather than using
2757 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2759 * exp_aggr.adb (Backend_Processing_Possible): Add handling of
2762 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2764 * s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb,
2765 s-imglli.adb: Minor reformatting.
2767 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2769 * sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the
2770 renamed operator when the associated node appears within a
2772 * sem_util.ads, sem_util.adb (In_Pre_Post_Condition): New routine.
2774 2016-04-20 Yannick Moy <moy@adacore.com>
2776 * osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix.
2777 * einfo.adb (Set_Overridden_Operation): Add assertion.
2778 * sem_util.adb (Unique_Entity): for renaming-as-body return the spec
2781 2016-04-20 Javier Miranda <miranda@adacore.com>
2783 * exp_unst.adb (Append_Unique_Call): New subprogram.
2784 (Unnest_Subprogram): Replace the unique occurrence
2785 of Call.Append() by Append_Unique_Call() which protects us from
2786 adding to the Calls table duplicated entries.
2788 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2790 * exp_attr.adb (Is_GCC_Target): Fix for C backend.
2791 * xref_lib.ads (Dependencies_Tables): instantiate
2792 Table package with types that guarantee its safe use.
2793 * s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested
2796 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2798 * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]):
2799 Disable expansion when generating C code.
2800 * sinfo.ads, inline.ads: Minor editing.
2802 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2804 * sem_util.adb, contracts.adb, ghost.adb, exp_ch6.adb: Minor
2807 2016-04-20 Javier Miranda <miranda@adacore.com>
2809 * contracts.adb (Build_Postconditions_Procedure): Code cleanup.
2810 * ghost.adb (Os_OK_Ghost_Context.Is_OK_Declaration): Handle the
2811 declaration of the internally built _postcondition procedure.
2813 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2815 * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
2817 * sem_util.adb (Is_Unchecked_Conversion_Instance):
2818 defense against library-level renamings of other functions,
2819 which are never instances of Unchecked_Conversion.
2820 * einfo.ads: minor fix of casing in comment
2822 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2824 * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
2825 that has been analyzed and expanded already. Qualify the names
2826 in the proper body for use in the generation of C code.
2828 2016-04-20 Javier Miranda <miranda@adacore.com>
2830 * contracts.adb (Build_Postconditions_Procedure): Force its
2831 inlining when generating C code.
2832 * sem_attr.adb (Analyze_Attribute_Old_Result): Handle inlined
2833 _postconditions when generating C code.
2834 * exp_ch6.adb (Inlined_Subprogram): Inline calls to
2835 _postconditions when generating C code.
2836 * sinfo.ads, sinfo.adb (Corresponding_Spec, Set_Corresponding_Spec):
2837 types of return value and argument changed from Node_Id to
2840 2016-04-20 Vincent Celier <celier@adacore.com>
2842 * make.adb, clean.adb, gnatname.adb: Revert previous change for now.
2844 2016-04-20 Eric Botcazou <ebotcazou@adacore.com>
2846 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
2847 the Has_Delayed_Freeze flag on the anonymous instance node.
2849 2016-04-20 Javier Miranda <miranda@adacore.com>
2851 * sem_ch5.adb (Analyze_Iterator_Specification): Remove transient
2852 scope associated with the renaming object declaration.
2853 * exp_util.adb (Insert_Actions): Remove handling of iterator
2854 loop marked as requiring the secondary stack.
2856 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2858 * sem_attr.adb (Analyze_Attribute, case 'Image): Implement
2859 AI12-0124, which extends the functionality of the attribute so it
2860 reflects the semantics of GNAT 'Img when applied to scalar types.
2861 * lib-xref.adb: minor whitespace layout fix.
2863 2016-04-20 Vincent Celier <celier@adacore.com>
2865 * clean.adb (Gnatclean): Fail if project file specified and
2866 gprclean is not available.
2867 * gnatname.adb: Fail is -P is used and gprname is not available.
2868 * make.adb (Initialize): Fail if project file specified and
2869 gprbuild is not available.
2871 2016-04-20 Bob Duff <duff@adacore.com>
2873 * sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary
2874 stack when possible.
2876 2016-04-20 Gary Dismukes <dismukes@adacore.com>
2878 * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
2881 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2883 * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
2884 If the pragma comes from an aspect specification, verify that
2885 the aspect applies to an entity with a declarative part.
2886 * exp_ch5.adb: Code cleanup.
2888 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2890 * sem_res.adb (Resolve_If_Expression): If first expression is
2891 universal, resolve subsequent ones with the corresponding class
2892 type (Any_Integer or Any_Real).
2894 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2896 * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
2897 disabled, complete the analysis of the iterator name to ensure
2898 that reference for entities within are properly generated.
2900 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2902 * a-dispat.ads (Yield): add Global contract.
2903 * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
2904 * a-taside.adb: Added Initializes => Tasking_State.
2906 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2908 * sem_ch13.adb (Build_Invariant_Procedure):
2909 Reimplement the invariant procedure spec and body insertion.
2911 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2913 * sem_ch13.adb (Add_Invariant): Do not replace
2914 the saved expression of an invariatn aspect when inheriting
2915 a class-wide type invariant as this clobbers the existing
2916 expression. Do not use New_Copy_List as it is unnecessary
2917 and leaves the parent pointers referencing the wrong part of
2918 the tree. Do not replace the type references for ASIS when
2919 inheriting a class-wide type invariant as this clobbers the
2920 existing replacement.
2922 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2924 * sem_util.adb (Build_Explicit_Dereference): If the designated
2925 expression is an entity name, generate reference to the entity
2926 because it will not be resolved again.
2928 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2930 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
2931 gnat_rm.texi: Update documentation.
2933 2016-04-19 Olivier Hainque <hainque@adacore.com>
2935 * par_sco.adb (Traverse_One, case N_Case_Statement):
2936 Skip pragmas before the first alternative.
2937 (Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.
2939 2016-04-19 Tristan Gingold <gingold@adacore.com>
2941 * adaint.c (__gnat_lwp_self): New function (for darwin).
2942 * s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
2945 2016-04-19 Olivier Hainque <hainque@adacore.com>
2947 * sem_util.adb (Build_Elaboration_Entity): Always request an
2948 elab counter when preserving control-flow.
2950 2016-04-19 Olivier Hainque <hainque@adacore.com>
2952 * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set
2953 Needs_Debug_Info when producing SCOs.
2954 * par_sco.adb (Traverse_Aspects): Fix categorization of
2955 Type_Invariant to match actual processing as activated depending
2956 on pragma Assertion_Policy.
2957 * sem_prag.adb (Analyze_Pragma): Remove special case for
2958 Name_Invariant regarding SCO generation, which completely disabled
2959 the production of SCOs for Invariant pragmas and aspects.
2961 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
2963 * checks.adb, sem_util.adb, sem_res.adb, sem_attr.adb: Minor
2966 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2968 * freeze.adb (Freeze_Profile): Refine predicate that checks
2969 whether a function that returns a limited view is declared in
2970 another unit and cannot be frozen at this point.
2972 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2974 * exp_aggr.adb (Component_Count): Handle properly superflat
2975 arrays, i.e. empty arrays where Hi < Lo - 1, to ensure that the
2976 return value of the function is Natural, rather than leaving
2977 the handling of such arrays to the caller of this function.
2979 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2981 * sem_prag.adb, sem_attr.adb, par-prag.adb, exp_aggr.adb, sem_type.adb
2982 sem_ch12.adb, sem_ch3.adb, exp_ch7.adb, exp_ch9.adb: Code cleanup.
2983 * sem_res.adb, sem_util.ads, sem_util.adb (Is_OK_Volatile_Context):
2984 Promoted from being a nested subprogram in Sem_Res.Resolve_Entity_Name
2985 to publicly visible routine in Sem_Util.
2987 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2989 * checks.adb (Apply_Parameter_Aliasing_Checks): Do not apply
2990 the check if the type of the actual is By_Reference.
2992 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2994 * sem_res.adb (Within_Subprogram_Call): Detect
2995 also nodes that appear in entry calls.
2996 (Resolve_Actuals, Insert_Default): Propagate
2997 dimension information if any, from default expression to the
2998 copy that appears in the list of actuals.
2999 * uintp.ads: minor whitespace fix in comment.
3000 * sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
3002 * set_targ.adb (Set_Targ): convert directly from
3003 Natural to Pos, without intermediate conversion to Int.
3005 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3007 * sem_ch6.adb (Process_Formals): Mark suspicious reference to
3008 SPARK RM in comment.
3009 * sem_prag.adb (Analyze_Global_Item): Fix reference to SPARK RM
3011 * sem_res.adb (Property_Error, Resolve_Actuals): Fix reference
3012 to SPARK RM in both comment and error message.
3014 2016-04-19 Eric Botcazou <ebotcazou@adacore.com>
3016 * sem_ch6.adb (Possible_Freeze): If the type is an incomplete
3017 CW type, then the subprogram must have a delayed freeze. This
3018 ensures that the backend can properly recover the full view when
3019 elaborating the access subprogram declaration.
3021 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3023 * sem_attr.adb (Resolve_Attribute, case 'Access): Freeze
3024 overloadable entity if originally overloaded.
3026 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3028 * exp_aggr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_code.adb,
3029 exp_fixd.adb, namet.adb, osint.adb, osint.ads, par-ch2.adb,
3030 sem_ch10.adb, sem_ch12.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb
3031 sem_util.adb, styleg.adb, styleg.ads, stylesw.ads: Minor code
3034 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3036 * sem_util.adb (Copy_Node_With_Replacement):
3037 use Set_Comes_From_Source instead of directly manipulating
3038 internals of the node table.
3039 * sem_util.adb (Within_Scope): refactored to remove duplicated code.
3040 * sem_aux.adb (Get_Rep_Pragma,
3041 Subprogram_Body_Entity, Subprogram_Spec): declare variables that
3042 do not change as constants and initialize them in the declaration.
3043 (Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare
3044 variables that do not change as constants and initialize them
3047 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3049 * sem_res.adb (Resolve_Entry_Call): If the entry has
3050 preconditions it is rewritten by means of a wrapper that
3051 incorporates the original call. Before rewriting generate a
3052 reference to the entry being called to prevent spurious warnings
3053 and provide correct cross-reference information.
3055 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
3057 * sem_disp.adb (Check_Dispatching_Context): Code cleanup. Add
3058 local constant Scop. Ignore any internally generated loops when
3059 performing the check concerning an abstract subprogram call
3060 without a controlling argument.
3061 * sem_util.ads, sem_util.adb (Current_Scope_No_Loops): New routine.
3063 2016-04-19 Bob Duff <duff@adacore.com>
3065 * sem_elab.adb (Check_A_Call): There are cases where we have No
3066 (Ent) after the Alias loop, even when there was no previous error,
3067 so we can't assert that there was an error.
3069 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3071 * sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
3072 Reject use of type name as a prefix to 'access within an aggregate
3073 in a context that is not the declarative region of a type.
3075 2016-04-19 Vincent Celier <celier@adacore.com>
3077 * gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
3078 -P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
3079 -l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
3080 Remove anything related to project files
3081 * g-mbdira.adb: minor whitespace cleanup
3082 * g-spipat.adb: minor removal of extra spaces after closing paren
3084 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3086 * exp_ch6.adb (Expand_Actuals): If post-statements are present
3087 and the enclosing context is a function call or indexing, build
3088 an Expression_With_Actions for the call.
3090 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
3092 * lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
3093 a with line for an ignored Ghost unit.
3094 * sem_ch7.adb (Analyze_Package_Declaration): Add local constant
3095 Par. A child package is Ghost when its parent is Ghost.
3096 * sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
3097 a subprogram declaration that acts as a compilation unit.
3099 2016-04-18 Michael Matz <matz@suse.de>
3101 * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
3102 (gnat_to_gnu_field): Ditto.
3103 (components_to_record): Ditto.
3104 (create_variant_part_from): Ditto.
3105 (copy_and_substitute_in_size): Ditto.
3106 (substitute_in_type): Ditto.
3107 * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
3108 (make_packable_type): Ditto.
3109 (maybe_pad_type): Ditto.
3110 (finish_fat_pointer_type): Ditto.
3111 (finish_record_type): Ditto and use SET_DECL_ALIGN.
3112 (rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
3113 (create_field_decl): Use SET_DECL_ALIGN.
3115 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3117 * einfo.adb (Overridden_Operation): assert that
3118 function is called for valid arguments.
3119 * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb,
3120 s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads,
3121 sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb,
3122 sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb,
3123 s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb:
3124 No space after closing parenthesis except where required for
3126 * sem_res.adb: Minor reformatting.
3128 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3130 * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case
3131 statement when relevant.
3133 2016-04-18 Bob Duff <duff@adacore.com>
3135 * a-cuprqu.adb (Enqueue): Properly handle the
3136 case where the new element has a unique priority.
3138 2016-04-18 Tristan Gingold <gingold@adacore.com>
3140 * adaint.h: Define stat structures and functions for iOS
3143 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3145 * sem_res.adb (Resolve_Entry_Call): reset
3146 Is_Overloaded flag after resolving calls to overloaded protected
3148 * exp_spark.adb (Expand_SPARK): call
3149 Qualify_Entity_Names for tasking nodes, i.e. protected types,
3150 task types and entries.
3151 * exp_ch4.adb (Expand_N_If_Expression): Refine previous change
3152 in case of an unconstrained type.
3154 2016-04-18 Yannick Moy <moy@adacore.com>
3156 * sem_eval.adb, sem_eval.ads (Check_Non_Static_Context): Add
3157 comment to document usage of subprogram in GNATprove.
3159 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3161 * sem_prag.adb (Analyze_Pragma, case Test_Case): Improve error
3162 message for wrong placement of aspect Test_Case.
3164 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3166 * einfo.ads: Update the documentation of attribute Renamed_Object.
3167 * exp_spark.adb (Expand_Potential_Renaming): Reimplemented.
3169 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3171 * exp_ch4.adb (Optimize_Length_Comparison): Return immediately
3172 in the case of AAMP (same as for use of the -gnatd.P switch) to
3173 suppress this optimization, which avoids creating a dependence
3174 on the 64-bit arithmetic package.
3176 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3178 * exp_ch4.adb: Update comment.
3180 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3182 * exp_ch6.adb (Expand_Call): Make sure instantiations are
3183 registered only once as pending here.
3185 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3187 * exp_ch4.adb, gnat1drv.adb, opt.ads, sem_res.adb
3188 (Minimize_Expression_With_Actions): New flag.
3189 (Adjust_Global_Switches): Set Minimize_Expression_With_Actions
3191 (Resolve_Short_Circuit): Redo previous change
3192 using Minimize_Expression_With_Actions.
3193 (Expand_N_If_Expression,
3194 Expand_Short_Circuit_Operator): Restore old code to avoid
3195 Expression_With_Actions when Minimize_Expression_With_Actions
3198 2016-04-18 Vincent Celier <celier@adacore.com>
3200 * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File and
3201 Stderr_File): Close local file descriptors when no longer needed.
3203 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3205 * sem_ch5.adb (Analyze_Iterator_Specification): Remove SPARK
3206 mode check that the type of the cursor in an iteration over
3207 a formal container is not volatile. The proper check on the
3208 element type is done elsewhere.
3210 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3212 * sem_ch6.adb (Process_Formals): Do not set a delay freeze on
3213 a subprogram that returns a class-wide type, if the subprogram
3214 is a compilation unit, because otherwise gigi will treat the
3215 subprogram as external, leading to link errors.
3217 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3219 * sem_res.adb (Resolve_Short_Circuit): Do not use
3220 expression-with-actions when generating C.
3222 2016-04-18 Yannick Moy <moy@adacore.com>
3224 * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate
3225 raise node in GNATprove mode.
3227 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3229 * s-fileio.adb: Minor reformatting.
3230 * sem_prag.adb (Analyze_Input_Item): Add local
3231 variable Input_OK. Do not consider mappings of generic formal
3232 parameters to actuals.
3234 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3236 * sem_ch5.adb (Get_Cursor_Type): If iterator type is a derived
3237 type, the cursor is declared in the scope of the parent type.
3238 (Analyze_Parameter_Specification): A qualified expression with an
3239 iterator type indicates an iteration over a container (explicit
3242 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3244 * osint-c.ads, osint-c.adb (Delete_C_File, Delete_H_File): New.
3245 * gnat1drv.adb (Gnat1drv): Delete old C files before regenerating them.
3246 * debug.adb: Reserve -gnatd.4 to force generation of C files.
3248 2016-04-18 Yannick Moy <moy@adacore.com>
3250 * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static
3251 division by zero, instead possibly issue a warning.
3252 * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on
3253 static division by zero, instead add check flag on original
3255 * sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error):
3256 Only issue error when both SPARK_Mode is On and Warn is False.
3258 2016-04-18 Yannick Moy <moy@adacore.com>
3260 * checks.adb (Apply_Scalar_Range_Check): Force
3261 warning instead of error when SPARK_Mode is On, on index out of
3262 bounds, and set check flag for GNATprove.
3264 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3266 * sem_prag.adb (Check_In_Out_States.Check_Constituent_Usage):
3267 Update the comment on usage. Reimplemented.
3268 (Check_Input_States.Check_Constituent_Usage): Update the comment
3269 on usage. A Proof_In constituent can now refine an Input state
3270 as long as there is at least one Input constituent present.
3272 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3274 * sem_ch6.adb (Check_Inline_Pragma): Use the Sloc of the
3275 body id as the sloc of the entity in the generated subprogram
3276 declaration, to avoid spurious conformance errors when style
3279 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3281 * sem_ch4.adb (Analyze_Selected_Component, Has_Dereference):
3282 Refine check on illegal calls to entities within a task body,
3283 when the entity is declared in an object of the same type. In
3284 a generic context there might be no explicit dereference but if
3285 the prefix includes an access type the construct is legal.
3287 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3289 * rtsfind.ads, rtsfind.adb (RE_Id, RE_Unit_Table): add
3290 RE_Default_Priority.
3292 2016-04-18 Bob Duff <duff@adacore.com>
3294 * sem_prag.adb (Check_Arg_Is_Local_Name): Don't do the check
3295 if the pragma came from an aspect specification.
3297 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3299 * gnat1drv.adb, contracts.adb: Minor reformatting and wording fixes.
3301 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3303 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): To suppress
3304 superfluous conformance check on an inlined body with a previous
3305 spec, use the fact that the generated declaration does not come
3306 from source. We must treat the entity as coming from source to
3307 enable some back-end inlining when pragma appears after the body.
3309 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3311 * lib-xref-spark_specific.adb, par-ch2.adb, errout.ads,
3312 exp_intr.adb: Minor reformatting and typo corrections.
3314 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3316 * sem_ch6.adb: Code cleanup.
3318 2016-04-18 Thomas Quinot <quinot@adacore.com>
3320 * sem_ch13.adb: Minor reformatting and error message tweaking
3321 (remove extraneous spaces).
3323 2016-04-18 Johannes Kanig <kanig@adacore.com>
3325 * gnat1drv.adb (Gnat1drv): Force loading of System unit for SPARK.
3327 2016-04-18 Bob Duff <duff@adacore.com>
3329 * s-fileio.adb (Fopen_Mode): If Mode = Out_File, and the file
3330 exists, and it's a fifo, we use "w" as the open string instead of
3331 "r+". This is necessary to make a write to the fifo block until
3334 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3336 * sem_attr.adb (Denote_Same_Function): Account
3337 for a special case where a primitive of a tagged type inherits
3338 a class-wide postcondition from a parent type.
3340 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3342 * par-ch2.adb (P_Expression_Or_Reserved_Word): New routine.
3343 (P_Pragma): Signal Scan_Pragma_Argument_Association when the use
3344 of reserved words is OK.
3345 (Scan_Pragma_Argument_Association):
3346 Add new formal Reserved_Words_OK and update the comment on
3347 usage. Code cleanup. Parse an expression or a reserved word in
3348 identifier form for pragmas Restriction_Warnings and Restrictions
3349 No_Use_Of_Attribute.
3350 * restrict.adb (Check_Restriction_No_Use_Of_Attribute):
3351 Reimplemented. (Check_Restriction_No_Use_Of_Pragma): Code cleanup.
3352 (Set_Restriction_No_Specification_Of_Aspect): Properly set the warning
3354 (Set_Restriction_No_Use_Of_Attribute): Properly set the warning
3355 flag for an attribute. (Set_Restriction_No_Use_Of_Entity):
3356 Update the parameter profile.
3357 (Set_Restriction_No_Use_Of_Pragma): Properly set the warning flag for
3359 * restrict.ads (Check_Restriction_No_Use_Of_Attribute): Update
3360 the comment on usage.
3361 (Set_Restriction_No_Use_Of_Entity): Update the parameter profile.
3362 * sem_attr.adb (Analyze_Attribute): Check restriction
3363 No_Use_Of_Attribute.
3364 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Check
3365 restriction No_Use_Of_Attribute before any rewritings have
3367 * sem_prag.adb (Analyze_Pragma): Check restriction
3368 No_Use_Of_Pragma before any rewritings have taken place.
3370 2016-04-18 Bob Duff <duff@adacore.com>
3372 * sem_ch6.adb (Is_Inline_Pragma): The pragma
3373 argument can be a selected component, which has no Chars field,
3374 so we need to deal with that case (use the Selector_Name).
3375 (Check_Inline_Pragma): We need to test Is_List_Member before
3376 calling In_Same_List, because in case of a library unit, they're
3377 not in lists, so In_Same_List fails an assertion.
3379 2016-04-18 Bob Duff <duff@adacore.com>
3381 * namet.ads, namet.adb: Add an Append that appends a
3382 Bounded_String onto a Bounded_String. Probably a little more
3383 efficient than "Append(X, +Y);". Also minor cleanup.
3384 (Append_Decoded, Append_Decoded_With_Brackets, Append_Unqualified,
3385 Append_Unqualified_Decoded): Make sure these work with non-empty
3387 * casing.ads, casing.adb (Set_Casing): Pass a Bounded_String
3388 parameter, defaulting to Global_Name_Buffer.
3389 * errout.ads, errout.adb (Adjust_Name_Case): Pass a
3390 Bounded_String parameter, no default.
3391 * exp_ch11.adb (Expand_N_Raise_Statement): Use local
3392 Bounded_String instead of Global_Name_Buffer.
3393 * exp_intr.ads, exp_intr.adb (Write_Entity_Name): Rename it
3394 to Append_Entity_Name, and pass a Bounded_String parameter,
3395 instead of using globals.
3396 (Add_Source_Info): Pass a Bounded_String parameter, instead of
3398 (Expand_Source_Info): Use local instead of globals.
3399 * stringt.ads, stringt.adb (Append): Add an Append procedure
3400 for appending a String_Id onto a Bounded_String.
3401 (String_To_Name_Buffer, Add_String_To_Name_Buffer): Rewrite in
3403 * sem_prag.adb (Set_Error_Msg_To_Profile_Name): Adjust for new
3404 Adjust_Name_Case parameter.
3405 * erroutc.adb, uname.adb: Don't pass D => Mixed_Case to
3406 Set_Casing; that's the default.
3407 * lib-xref-spark_specific.adb (Add_SPARK_Scope): Pretend that calls to
3408 protected subprograms are entry calls; otherwise it is not possible to
3409 distinguish them from regular subprogram calls.
3411 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3413 * sem_ch13.adb (Has_Good_Profile): Improvement
3414 of error message. Now indicates subtype_mark of formal parameter
3415 rather than the formal's name, plus minor rewording.
3417 2016-04-18 Pascal Obry <obry@adacore.com>
3419 * adaint.c, adaint.h, s-os_lib.ads: Add new routine Current_Process_Id.
3421 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3423 * stringt.adb, exp_ch6.adb, sem_ch13.adb: Minor reformatting.
3425 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3427 * par-ch4.adb, sem_prag.adb: Minor reformatting.
3429 2016-04-18 Bob Duff <duff@adacore.com>
3431 * sinput.ads, sinput.adb (Build_Location_String): Take a
3432 parameter instead of using a global variable. The function
3433 version no longer destroys the Name_Buffer.
3434 * stringt.ads, stringt.adb (String_From_Name_Buffer): Take a
3435 parameter, which defaults to the Global_Name_Buffer, so some
3436 calls can avoid the global.
3437 * exp_ch11.adb, exp_intr.adb: Use new interfaces above
3438 to avoid using globals. All but one call to Build_Location_String
3439 avoids the global. Only one call to String_From_Name_Buffer
3442 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3444 * namet.adb, namet.ads, exp_unst.adb: Minor reformatting.
3446 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3448 * sem_eval.adb (Choice_Matches): Check the expression
3449 against the predicate values when the choice denotes a
3450 subtype with a static predicate.
3451 (Eval_Membership_Op): Code cleanup. Remove the suspicious guard which
3452 tests for predicates.
3453 (Is_OK_Static_Subtype): A subtype with a dynamic predicate
3454 is not static. (Is_Static_Subtype): A subtype with a dynamic
3455 predicate is not static.
3456 * sem_eval.ads (Is_OK_Static_Subtype): Update the comment on usage.
3457 (Is_Static_Subtype): Update the comment on usage.
3459 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3461 * sem_prag.adb (Analyze_Input_Item): Allow
3462 generic formals to appear as initialization items.
3464 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3466 * sem_ch13.adb (Analyze_Stream_TSS_Definition,
3467 Has_Good_Profile): Additional error message to indicate that
3468 the second parameter of the subprogram must be a first subtype.
3470 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3472 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Is_Inline_Pragma):
3473 Use the pragma lookahead that determines whether a subprogram
3474 is to be inlined, when some level of backend optimization is
3476 * sem_ch12.ads, sem_ch12.adb (Add_Pending_Instantiation): Factorize
3477 code used to create an instance body when needed for inlining.
3478 * exp_ch6.adb (Expand_Call): When a call is to be inlined, and the
3479 call appears within an instantiation that is not a compilation
3480 unit, add a pending instantiation for the enclosing instance,
3481 so the backend can inline in turn the calls contained in the
3484 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3486 * sem_prag.adb (Build_Pragma_Check_Equivalent): The mapping
3487 that relates operations of the parent type to the operations of
3488 the derived type has three distinct sources:
3489 a) explicit operations of the derived type carry an
3490 Overridden_Operation that designates the operation in the
3492 b) Implicit operations that are inherited by the derived type
3493 carry an alias that may be an explicit subprogram (in which case
3494 it may have an Overridden_ Operation indicator) or may also be
3495 inherited and carry its own alias.
3496 c) If the parent type is an interface, the operation of the
3497 derived type does not override, but the interface operation
3498 indicates the operation that implements it.
3499 * sem_prag.adb: Minor reformatting.
3500 * sem_prag.adb (Check_External_Property): Update
3501 the comment on usage. Reimplement.
3503 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3505 * exp_ch5.adb (Expand_Assignment_Statement): In restricted
3506 profiles such as ZFP, ceiling priority is not available.
3508 2016-04-18 Bob Duff <duff@adacore.com>
3510 * namet-sp.ads: Minor typo fix, ironically in 'Spelling_Checker'.
3512 2016-04-18 Bob Duff <duff@adacore.com>
3514 * sem_elab.adb (Output_Calls): Use
3515 Get_Name_String, to clearly indicate that the global Name_Buffer
3516 is being used. The previous code used Is_Internal_Name, which
3517 returns a Boolean, but also has a side effect of setting the
3518 Name_Buffer. Then it called the other Is_Internal_Name, which uses
3519 the Name_Buffer for its input. And then it called Error_Msg_N,
3520 again using the Name_Buffer. We haven't eliminated the global
3521 usage here, but we've made it a bit clearer.
3522 This also allows us to have a side-effect-free version of
3524 * namet.ads, namet.adb: Provide a type Bounded_String, along with
3525 routines that can be used without using global variables. Provide
3526 Global_Name_Buffer so existing code can continue to use the
3527 global. Mark the routines that use globals as obsolete. New code
3528 shouldn't call the obsolete ones, and we should clean up existing
3529 code from time to time.
3530 Name_Find_Str is renamed as Name_Find.
3531 * namet.h: Changed as necessary to interface to the new version
3533 * bindgen.adb, exp_unst.adb: Name_Find_Str is renamed as
3536 2016-04-18 Yannick Moy <moy@adacore.com>
3538 * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization): used
3539 outside of GNATprove, hence it should not be removed.
3541 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3543 * sem_prag.adb (Analyze_Refinement_Clause):
3544 The refinement of an external abstract state can now mention
3545 non-external constituents.
3546 (Check_External_Property): Update all SPARK RM references.
3548 2016-04-18 Bob Duff <duff@adacore.com>
3550 * exp_intr.adb: Remove some duplicated code.
3552 2016-04-18 Yannick Moy <moy@adacore.com>
3554 * a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-nuflra.ads: Mark
3555 package spec and body out of SPARK.
3557 2016-04-18 Johannes Kanig <kanig@adacore.com>
3559 * spark_xrefs.ads: Minor comment update.
3561 2016-04-18 Johannes Kanig <kanig@adacore.com>
3563 * gnat1drv.adb (Gnat1drv): Force loading of System
3566 2016-04-18 Bob Duff <duff@adacore.com>
3568 * a-cuprqu.adb: Correction to previous change. If a new node
3569 is inserted at the front of the queue (because it is higher
3570 priority than the previous front node), we need to update
3571 Header.Next_Unequal -- not just in the case where the queue was
3574 2016-04-18 Bob Duff <duff@adacore.com>
3576 * a-cuprqu.ads: Change the representation of List_Type from a
3577 singly-linked list to a doubly-linked list. In addition, add a
3578 pointer Next_Unequal, which points past a possibly-long chain
3579 of equal-priority items. This increases efficiency, especially
3580 in the case of many equal-priority items.
3581 * a-cuprqu.adb (Dequeue, Enqueue): Rewrite algorithms to take
3582 advantage of new data structure.
3583 (Finalize): Rewrite in terms of Dequeue, for simplicity.
3585 2016-04-18 Yannick Moy <moy@adacore.com>
3587 * contracts.adb (Analyze_Object_Contract,
3588 Analyze_Protected_Contract): Remove tests performed in GNATprove.
3589 * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization):
3590 Remove query for tests performed in GNATprove.
3592 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3594 * sem_aggr.adb (Resolve_Record_Aggregate): If
3595 Warn_On_Redundant_Constructs is enabled, report a redundant box
3596 association that does not cover any components, as it done for
3597 redundant others associations in case statements.
3599 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3601 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions):
3602 Analyze the generated Check pragma for an inherited condition so
3603 that it does not freeze the dispatching type of the primitive
3604 operation, because it is pre-analyzed at the point of the
3605 subprogram declaration (and not in the subprogram body, as is
3606 done during regular expansion).
3608 2016-04-18 Vincent Celier <celier@adacore.com>
3610 * ali.ads: Increase the range of all _Id types to 100 millions.
3612 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3614 * sem_warn.adb (Check_References): Change warning to suggest
3615 using pragma Export rather than saying "volatile has no effect".
3617 2016-04-18 Bob Duff <duff@adacore.com>
3619 * g-souinf.ads (Compilation_ISO_Date): New function to return
3620 the current date in ISO form.
3621 * exp_intr.adb (Expand_Source_Info, Add_Source_Info): Expand
3622 a call to Compilation_ISO_Date into a string literal containing
3623 the current date in ISO form.
3624 * exp_intr.ads (Add_Source_Info): Improve documentation.
3625 * sem_intr.adb (Check_Intrinsic_Subprogram): Recognize
3626 Compilation_ISO_Date.
3627 * snames.ads-tmpl (Name_Compilation_ISO_Date): New Name_Id.
3629 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3631 * layout.adb (Set_Elem_Alignment): Extend setting of alignment
3632 to subtypes that are not first subtypes.
3634 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3636 * sem_prag.ads (Collect_Inherited_Class_Wide_Conditions):
3638 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Insert
3639 generated pragmas after subprogram declaration, rather than in
3640 the corresponding subprogram body.
3641 * sem_ch6.adb (New_Overloaded_Entity): In GNATProve
3642 mode, if the operation is overridding, call
3643 Collect_Inherited_Class_Wide_Conditions to generate the
3644 corresponding pragmas immediately after the corresponding
3645 subprogram declaration.
3647 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3649 * spark_xrefs.ads (Xref_Index, Scope_Index, File_Index): restrict
3650 type to natural numbers.
3651 (Stype): document code characters for concurrent entities.
3653 2016-04-18 Olivier Hainque <hainque@adacore.com>
3655 * targparm.ads: Update the Frontend_Exceptions default internal
3657 (Frontend_Exceptions_On_Target): Change default value to True.
3659 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3661 * sem_ch4.adb (Analyze_Selected_Component): Refine error
3662 detection when a selected component in the body of a synchronized
3663 type is a reference to an object of the same type declared
3664 elsewhere. The construct is legal if the prefix of the selected
3665 component includes an explicit dereference at any point.
3667 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3669 * sem_ch3.adb (Analyze_Object_Declaration): Do not consider
3670 internally generated expressions when trying to determine whether
3671 a formal parameter of a tagged type subject to Extensions_Visible
3672 False is used to initialize an object.
3673 * sem_ch4.adb (Analyze_Type_Conversion): Do not consider
3674 internally generated expressions when trying to determine whether
3675 a formal parameter of a tagged type subject to Extensions_Visible
3676 False is used in a type conversion.
3678 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3680 * sem_res.adb (Is_Protected_Operation_Call):
3681 Add guards to account for a non-decorated selected component.
3683 2016-04-18 Yannick Moy <moy@adacore.com>
3685 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve
3686 implementation of Body_Has_SPARK_Mode_On.
3687 * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_From_Annotation):
3688 New function replacing previous Get_SPARK_Mode_From_Pragma, that
3689 deals also with aspects.
3690 (Get_SPARK_Mode_Type): Make function internal again.
3691 * inline.adb, sem_ch7.adb, sem_util.adb: Use new
3692 Get_SPARK_Mode_From_Annotation.
3694 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3696 * contracts.adb (Analyze_Object_Contract): Update references to
3698 * freeze.adb (Freeze_Entity): Update references to SPARK RM.
3699 * ghost.adb Add with and use clauses for Sem_Disp.
3700 (Check_Ghost_Derivation): Removed.
3701 (Check_Ghost_Overriding):
3702 Reimplemented. (Check_Ghost_Policy): Update references to SPARK RM.
3703 (Check_Ghost_Primitive): New routine.
3704 (Check_Ghost_Refinement): New routine. (Is_OK_Ghost_Context):
3705 Update references to SPARK RM. (Is_OK_Pragma): Update references
3706 to SPARK RM. Predicates are now a valid context for references
3708 * ghost.ads (Check_Ghost_Derivation): Removed.
3709 (Check_Ghost_Overriding): Update the comment on usage.
3710 (Check_Ghost_Primitive): New routine.
3711 (Check_Ghost_Refinement): New routine.
3712 (Remove_Ignored_Ghost_Code): Update references to SPARK RM.
3713 * sem_ch3.adb (Process_Full_View): Remove the now obsolete check
3714 related to Ghost derivations
3715 * sem_ch6.adb (Check_Conformance): Remove now obsolete check
3716 related to the convention-like behavior of pragma Ghost.
3717 (Check_For_Primitive_Subprogram): Verify that the Ghost policy
3718 of a tagged type and its primitive agree.
3719 * sem_prag.adb (Analyze_Pragma): Update references to SPARK
3720 RM. Move the verification of pragma Assertion_Policy Ghost
3721 to the proper place. Remove the now obsolete check related
3722 to Ghost derivations.
3723 (Collect_Constituent): Add a call to Check_Ghost_Refinement.
3724 * sem_res.adb (Resolve_Actuals): Update references to SPARK RM.
3726 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3728 * layout.adb: Fix more minor typos in comments.
3730 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3732 * a-calend.ads, sem_prag.adb, sem_ch6.adb: Minor reformatting.
3734 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3736 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): In GNATprove
3737 mode, collect inherited class-wide conditions to generate the
3738 corresponding pragmas.
3739 * sem_prag.ads (Build_Pragma_Check_Equivalent): Moved from contracts
3740 * contracts.adb (Collect_Inherited_Class_Wide_Conditions): New
3741 procedure for overriding subprograms, used to generate the pragmas
3742 corresponding to an inherited class- wide pre- or postcondition.
3743 * sem_prag.adb (Build_Pragma_Check_Equivalent): moved here
3744 from contracts.adb (Replace_Condition_Entities): Subsidiary
3745 Build_Pragma_Check_Equivalent, to implement the proper semantics
3746 of inherited class-wide conditions, as given in AI12-0113.
3747 (Process_Class_Wide_Condition): Removed.
3748 (Collect_Inherited_Class_Wide_Conditions): Iterate over pragmas
3749 in contract of subprogram, to collect inherited class-wide
3751 (Build_Pragma_Check_Equivalent): Moved to sem_prag.adb
3753 2016-04-18 Yannick Moy <moy@adacore.com>
3755 * a-calend.adb (Ada.Calendar): Mark package body as SPARK_Mode Off.
3756 * a-calend.ads (Ada.Calendar): Mark package spec as
3757 SPARK_Mode and add synchronous external abstract state Clock_Time.
3759 2016-04-18 Yannick Moy <moy@adacore.com>
3761 * sem_res.adb (Resolve_Call): Prevent inlining of
3762 calls inside expression functions. Factor previous code issuing
3763 errors to call Cannot_Inline instead, which does appropriate
3764 processing of message for GNATprove.
3766 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3768 * einfo.ads, sem_ch3.adb, sem_ch8.adb, osint-l.adb, rtsfind.adb,
3769 osint-b.adb: Cleanups.
3771 2016-04-18 Yannick Moy <moy@adacore.com>
3773 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Only create
3774 body to inline in GNATprove mode when SPARK_Mode On applies to
3776 * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_Type): Make function
3779 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3781 * layout.adb: Fix minor typo in comment.
3782 * inline.adb: Fix minor pasto.
3783 * sem_ch12.ads: Fix minor typos in comments.
3785 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3787 * sem_disp.adb (Check_Dispatching_Call): Major rewriting to
3788 handle some complex cases of tag indeterminate calls that are
3789 actuals in other dispatching calls that are themselves tag
3791 (Check_Dispatching_Context): Add parameter to support recursive
3792 check for an enclosing construct that may provide a tag for a
3793 tag-indeterminate call.
3795 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3797 * sem_prag.adb (Analyze_Depends_In_Decl_Part):
3798 Add global variables Task_Input_Seen and Task_Output_Seen.
3799 (Analyze_Global_Item): Detect an illegal use of the current
3800 instance of a single protected/task type in a global annotation.
3801 (Analyze_Input_Output): Inputs and output related to the current
3802 instance of a task unit are now tracked.
3803 (Check_Usage): Require
3804 the presence of the current instance of a task unit only when
3805 one input/output is available. (Current_Task_Instance_Seen):
3807 (Is_CCT_Instance): New parameter profile. Update
3808 the comment on usage. The routine now properly recognizes several
3809 cases related to single protected/task types.
3811 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3813 * freeze.adb (Freeze_Entity): Use New_Freeze_Node
3814 to create a brand new freeze node. This handles a case where an
3815 ignored Ghost context is freezing something which is not ignored
3816 Ghost and whose freeze node should not be removed from the tree.
3817 (New_Freeze_Node): New routine.
3819 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
3821 * sigtramp.h (__gnat_set_is_vxsim) New function to
3822 tell sigtramp-vxworks to handle vxsim signal contexts. *
3823 sigtramp-vxworks.c (__gnat_sigtramp) Take into account the
3824 differences in the sigcontext structure between the expected
3825 regular x86 or x86_64 ones and the ones received in case of
3826 exexution on the vxworks simulator.
3827 * init.c: also compute is_vxsim in case of x86_64-vx7 target. Provide
3828 this information to sigtramp-vxworks.c. Remove the old mechanism for
3830 * init-vxsim.c, sigtramp-vxworks-vxsim.c: remove, now obsolete.
3832 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3834 * exp_ch3.adb (Inline_Init_Proc): New function returning
3835 whether the initialization procedure of a type should be
3836 inlined. Return again True for controlled type themselves.
3837 (Build_Array_Init_Proc): Call it to set Set_Is_Inlined on Init_Proc.
3838 (Build_Record_Init_Proc): Likewise.
3840 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3842 * gnatvsn.ads (Library_Version): Bump to 7.
3844 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3846 * sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag
3847 on the entity of a subprogram declaration that is completed by
3848 an expression function.
3850 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3852 * sem_util.adb (Is_Current_Instance): A entity given by a subtype
3853 declaration can appear in an aspect specification for a dynamic
3854 predicate, and a pragma for aspect Predicate_Failure.
3855 * exp_util.adb (Replace_Subtype_References): Replace current
3856 occurrences of the subtype to which a dynamic predicate applies,
3857 byt the expression that triggers a predicate check. Needed to
3858 implement new aspect Predicate_Failure.
3860 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3862 * a-intsig.ads, a-intsig.adb: Removed, no longer used.
3863 * Makefile.rtl: update accordingly.
3865 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3867 * sem_type.adb (Disambiguate): Call Covers only when necessary
3868 for standard operators.
3870 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3872 * atree.ads (Num_Extension_Nodes): Add couple of figures
3874 * atree.adb: Add GNAT.Heap_Sort_G dependency.
3875 (Print_Statistics): New exported procedure to print statistics.
3877 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3879 * exp_ch3.adb (Build_Record_Init_Proc): Do not mark the procedure
3880 as to be inlined if the type needs finalization.
3882 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
3884 * sigtramp-vxworks-target.inc: sigtramp-vxworks: force the stack
3885 alignment for x86_64.
3886 * init.c: Better fix for guard page reset on x86_64-vx7.
3887 Do not try to retrieve the page that actually raised
3888 the signal as the probing mechanism used on x86_64 do not allow
3889 such retrieval. We thus just test if the guard page is active,
3890 and re-activate it if not.
3892 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3894 * a-sytaco.adb (Suspension_Object): Aspect Default_Initial_Condition
3897 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
3899 * affinity.c: Use the proper type for task id.
3900 * init.c (__gnat_inum_to_ivec): ivec is a pointer.
3902 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3904 * sem_prag.adb (Process_Convention): Relax rule on exporting
3905 Intrinsic types if Relaxed_RM_Semantics is True.
3907 2016-04-18 Vincent Celier <celier@adacore.com>
3909 * sem_ch3.adb, lib.ads, sinfo.ads, sem_ch10.adb, einfo.adb, einfo.ads,
3910 checks.ads, sem_ch12.adb, sem.adb, sem_util.adb, sem_util.ads,
3911 sem_res.adb, sem_attr.adb, par.adb, exp_ch4.adb, errout.ads,
3912 sem_ch4.adb, atree.adb, atree.ads, sem_warn.adb, treepr.adb,
3913 exp_ch3.ads, exp_unst.adb: Change "descendent" to
3914 "descendant" in comments, error messages and identifiers.
3915 * gcc-interface/decl.c: Ditto.
3917 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3919 * sem_type.adb (Operator_Matches_Spec): Call First_Formal on
3920 New_S only once at the beginning of the function.
3922 2016-04-02 Eric Botcazou <ebotcazou@adacore.com>
3924 * gcc-interface/decl.c (components_to_record): Restrict the previous
3925 change to fields with variable size.
3927 2016-03-27 Eric Botcazou <ebotcazou@adacore.com>
3929 * gcc-interface/decl.c (components_to_record): Add special case for
3930 single field with representation clause at offset 0.
3932 2016-03-16 Svante Signell <svante.signell@gmail.com>
3934 * gcc-interface/Makefile.in: Add support for x86 GNU/Hurd.
3935 * s-osinte-gnu.ads: New file.
3937 2016-03-13 Eric Botcazou <ebotcazou@adacore.com>
3939 * system-vxworks-m68k.ads (Stack_Check_Probes): Set to True.
3940 (Stack_Check_Limits): Set to False.
3941 * system-vxworks-mips.ads (Stack_Check_Probes): Set to True.
3942 (Stack_Check_Limits): Set to False.
3943 * system-vxworks-ppc.ads (Stack_Check_Probes): Set to True.
3944 (Stack_Check_Limits): Set to False.
3945 * system-vxworks-sparcv9.ads (Stack_Check_Probes): Set to True.
3946 (Stack_Check_Limits): Set to False.
3947 * system-vxworks-x86.ads (Stack_Check_Probes): Set to True.
3948 (Stack_Check_Limits): Set to False.
3950 2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
3952 * gcc-interface/trans.c (statement_node_p): New predicate.
3953 (gnat_to_gnu): Invoke it to detect statement nodes. In ASIS mode, do
3954 not return dummy results for expressions attached to packed array
3955 implementation types.
3957 2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
3959 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always mark
3960 the expression of a renaming manually in case #3.
3962 2016-03-02 Dominik Vogt <vogt@linux.vnet.ibm.com>
3964 * system-linux-s390.ads: Enable Stack_Check_Probes.
3965 * system-linux-s390.ads: Likewise.
3967 2016-02-29 Martin Liska <mliska@suse.cz>
3969 * gcc-interface/utils.c (set_reverse_storage_order_on_pad_type):
3970 Replace ENABLE_CHECKING macro with flag_checking.
3972 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3974 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Retrofit
3975 handling of unconstrained array types as designated types into common
3976 processing. Also handle array types as incomplete designated types.
3978 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3980 * gcc-interface/decl.c (gnat_to_gnu_entity) <Concurrent types>: In
3981 ASIS mode, fully lay out the minimal record type.
3983 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3985 * gcc-interface/trans.c (finalize_nrv_r): Remove obsolete code.
3986 (build_return_expr): Likewise.
3987 (Call_to_gnu): If this is a function call and there is no target,
3988 create a temporary for the return value for all aggregate types,
3989 but never create it for a return statement. Push a binding level
3990 around the call in more cases. Remove obsolete code.
3992 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3994 * gcc-interface/ada-tree.h (DECL_RETURN_VALUE_P): New macro.
3995 * gcc-interface/gigi.h (gigi): Remove useless attribute.
3996 (gnat_gimplify_expr): Likewise.
3997 (gnat_to_gnu_external): Declare.
3998 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Factor out
3999 code dealing with the expression of external constants into...
4000 Invoke gnat_to_gnu_external instead.
4001 <E_Variable>: Invoke gnat_to_gnu_external to translate renamed objects
4002 when not for a definition. Deal with COMPOUND_EXPR and variables with
4003 DECL_RETURN_VALUE_P set for renamings and with the case of a dangling
4004 'reference to a function call in a renaming. Remove obsolete test and
4005 adjust associated comment.
4006 * gcc-interface/trans.c (Call_to_gnu): Set DECL_RETURN_VALUE_P on the
4007 temporaries created to hold the return value, if any.
4008 (gnat_to_gnu_external): ...this. New function.
4009 * gcc-interface/utils.c (create_var_decl): Detect a constant created
4010 to hold 'reference to function call.
4011 * gcc-interface/utils2.c (build_unary_op) <ADDR_EXPR>: Add folding
4012 for COMPOUND_EXPR in the DECL_RETURN_VALUE_P case.
4014 2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
4016 * exp_ch4.adb (Expand_N_Indexed_Component): Activate synchronization if
4017 the prefix denotes an entity which Has_Atomic_Components.
4018 * gcc-interface/trans.c (node_is_atomic): Return true if the prefix
4019 denotes an entity which Has_Atomic_Components.
4021 2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
4023 * gcc-interface/utils2.c (gnat_protect_expr): Make a SAVE_EXPR only
4024 for fat pointer or scalar types.
4026 2016-02-16 Eric Botcazou <ebotcazou@adacore.com>
4028 * gcc-interface/gigi.h (maybe_debug_type): New inline function.
4029 * gcc-interface/misc.c (gnat_get_array_descr_info): Use it.
4030 Call maybe_character_value on the array bounds. Get to the base type
4031 of the index type and call maybe_debug_type on it.
4032 * gcc-interface/utils.c (finish_character_type): Add special treatment
4035 2016-02-16 Eric Botcazou <ebotcazou@adacore.com>
4037 * gcc-interface/misc.c (gnat_enum_underlying_base_type): New function.
4038 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define to above.
4040 2016-02-12 Jakub Jelinek <jakub@redhat.com>
4042 * prj-tree.ads: Spelling fixes - behaviour -> behavior and
4043 neighbour -> neighbor.
4044 * prep.adb: Likewise.
4045 * prj.ads: Likewise.
4046 * prepcomp.adb: Likewise.
4047 * g-socket.ads: Likewise.
4048 * s-imgrea.adb: Likewise.
4049 * a-calend.adb: Likewise.
4050 * exp_disp.adb: Likewise.
4051 * doc/gnat_ugn/gnat_utility_programs.rst: Likewise.
4052 * g-socket.adb: Likewise.
4053 * sem_ch12.adb: Likewise.
4054 * terminals.c: Likewise.
4056 2016-02-08 Bernd Schmidt <bschmidt@redhat.com>
4058 * gcc-interface/misc.c (gnat_init): Remove second argument in call to
4059 build_common_tree_nodes.
4061 2016-02-08 Eric Botcazou <ebotcazou@adacore.com>
4063 * gcc-interface/utils.c (create_var_decl): Set again DECL_COMMON and
4064 DECL_IGNORED_P last.
4066 2016-01-28 Eric Botcazou <ebotcazou@adacore.com>
4068 * gcc-interface/gigi.h (enum attr_type): Rename into...
4069 (enum attrib_type): ...this.
4070 (struct attrib): Adjust.
4071 * gcc-interface/decl.c (prepend_one_attribute): Likewise.
4073 2016-01-20 Eric Botcazou <ebotcazou@adacore.com>
4075 * exp_ch2.adb (Expand_Current_Value): Make an appropriate character
4076 literal if the entity is of a character type.
4077 * gcc-interface/lang.opt (fsigned-char): New option.
4078 * gcc-interface/misc.c (gnat_handle_option): Accept it.
4079 (gnat_init): Adjust comment.
4080 * gcc-interface/gigi.h (finish_character_type): New prototype.
4081 (maybe_character_type): New inline function.
4082 (maybe_character_value): Likewise.
4083 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>: For
4084 a character of CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
4085 Set TYPE_ARTIFICIAL early and call finish_character_type on the type.
4086 <E_Enumeration_Subtype>: For a subtype of character with RM_Size and
4087 Esize equal to CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
4088 Copy TYPE_STRING_FLAG from type to subtype.
4089 <E_Array_Type>: Deal with character index types.
4090 <E_Array_Subtype>: Likewise.
4091 * gcc-interface/trans.c (gigi): Replace unsigned_char_type_node with
4092 char_type_node throughout.
4093 (build_raise_check): Likewise.
4094 (get_type_length): Deal with character types.
4095 (Attribute_to_gnu) <Attr_Pos>: Likewise. Remove obsolete range check
4097 <Attr_Pred>: Likewise.
4098 (Loop_Statement_to_gnu): Likewise.
4099 (Raise_Error_to_gnu): Likewise.
4100 <N_Indexed_Component>: Deal with character index types. Remove
4102 <N_Slice>: Likewise.
4103 <N_Type_Conversion>: Deal with character types. Minor tweak.
4104 <N_Unchecked_Type_Conversion>: Likewise.
4106 <N_Op_Eq>: Likewise.
4107 (emit_index_check): Delete.
4108 * gcc-interface/utils.c (finish_character_type): New function.
4109 (gnat_signed_or_unsigned_type_for): Deal with built-in character types.
4110 * gcc-interface/utils2.c (expand_sloc): Replace unsigned_char_type_node
4111 with char_type_node.
4112 (build_call_raise): Likewise.
4113 (build_call_raise_column): Likewise.
4114 (build_call_raise_range): Likewise.
4116 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4118 * gcc-interface/gigi.h (build_call_raise_column): Adjust prototype.
4119 (build_call_raise_range): Likewise.
4120 (gnat_unsigned_type): Delete.
4121 (gnat_signed_type): Likewise.
4122 (gnat_signed_or_unsigned_type_for): New prototype.
4123 (gnat_unsigned_type_for): New inline function.
4124 (gnat_signed_type_for): Likewise.
4125 * gcc-interface/cuintp.c (build_cst_from_int): Call build_int_cst.
4126 * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
4127 (gnat_to_gnu_entity) <E_Array_Type>: Always translate the index types
4128 and compute their base type from that.
4129 <E_Array_Subtype>: Remove duplicate declaration.
4130 * gcc-interface/misc.c (get_array_bit_stride): Call build_int_cst.
4131 * gcc-interface/trans.c (get_type_length): Likewise.
4132 (Attribute_to_gnu): Likewise.
4133 (Loop_Statement_to_gnu): Likewise.
4134 (Call_to_gnu): Likewise.
4135 (gnat_to_gnu): Call build_real, build_int_cst, gnat_unsigned_type_for
4136 and gnat_signed_type_for. Minor tweaks.
4137 (build_binary_op_trapv): Likewise.
4138 (emit_check): Likewise.
4139 (convert_with_check): Likewise.
4140 (Raise_Error_to_gnu): Adjust calls to the build_call_raise family of
4141 functions. Minor tweaks.
4142 (Case_Statement_to_gnu): Remove dead code.
4143 (gnat_to_gnu): Call gnat_unsigned_type_for and gnat_signed_type_for.
4144 (init_code_table): Minor reordering.
4145 * gcc-interface/utils.c (gnat_unsigned_type): Delete.
4146 (gnat_signed_type): Likewise.
4147 (gnat_signed_or_unsigned_type_for): New function.
4148 (unchecked_convert): Use directly the size in the test for precision
4149 vs size adjustments.
4150 (install_builtin_elementary_types): Call gnat_signed_type_for.
4151 * gcc-interface/utils2.c (nonbinary_modular_operation): Call
4153 (build_goto_raise): New function taken from...
4154 (build_call_raise): ...here. Call it.
4155 (build_call_raise_column): Add KIND parameter and call it.
4156 (build_call_raise_range): Likewise.
4158 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4160 * gcc-interface/ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename to
4161 (TYPE_IMPL_PACKED_ARRAY_P): ...this.
4162 (TYPE_CAN_HAVE_DEBUG_TYPE_P): Do not test TYPE_DEBUG_TYPE.
4163 * gcc-interface/decl.c (gnat_to_gnu_entity): Simplify NULL_TREE tests
4164 and tweak gnat_encodings tests throughout.
4165 (initial_value_needs_conversion): Likewise.
4166 (intrin_arglists_compatible_p): Likewise.
4167 * gcc-interface/misc.c (gnat_print_type): Likewise.
4168 (gnat_get_debug_type): Likewise.
4169 (gnat_get_fixed_point_type_info): Likewise.
4170 (gnat_get_array_descr_info): Likewise.
4171 (get_array_bit_stride): Likewise.
4172 (gnat_get_type_bias): Fix formatting.
4173 (enumerate_modes): Likewise.
4174 * gcc-interface/trans.c (gnat_to_gnu): Likewise.
4175 (add_decl_expr): Simplify NULL_TREE test.
4176 (end_stmt_group): Likewise.
4177 (build_binary_op_trapv): Fix formatting.
4178 (get_exception_label): Use switch statement.
4179 (init_code_table): Move around.
4180 * gcc-interface/utils.c (global_bindings_p): Simplify NULL_TREE test.
4181 (gnat_poplevel): Likewise.
4182 (gnat_set_type_context): Likewise.
4183 (defer_or_set_type_context): Fix formatting.
4184 (gnat_pushdecl): Simplify NULL_TREE test.
4185 (maybe_pad_type): Likewise.
4186 (add_parallel_type): Likewise.
4187 (create_range_type): Likewise.
4188 (process_deferred_decl_context): Likewise.
4189 (convert): Likewise.
4190 (def_builtin_1): Likewise.
4191 * gcc-interface/utils2.c (find_common_type): Likewise.
4192 (build_binary_op): Likewise.
4193 (gnat_rewrite_reference): Likewise.
4194 (get_inner_constant_reference): Likewise.
4196 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4199 * gcc-interface/trans.c (check_inlining_for_nested_subprog): Consider
4200 the parent function instead of the current function in order to issue
4201 the warning or the error. Add guard for ignored functions.
4203 2016-01-17 Jakub Jelinek <jakub@redhat.com>
4205 * adaint.c (__gnat_killprocesstree): Avoid -Wparentheses warning.
4207 2016-01-15 Jakub Jelinek <jakub@redhat.com>
4209 * adaint.c (__gnat_locate_exec_on_path): Use const char * instead
4210 of char * for path_val to avoid warnings.
4212 2016-01-06 Pierre-Marie de Rodat <derodat@adacore.com>
4214 * gcc-interface/utils.c: Bump copyright year.
4215 (rest_of_record_type_compilation): Add XVE/XVU parallel types to
4216 the current lexical scope.
4218 2016-01-04 Jakub Jelinek <jakub@redhat.com>
4220 * gnat_ugn.texi: Bump @copying's copyright year.
4221 * gnat_rm.texi: Likewise.
4223 2016-01-02 Eric Botcazou <ebotcazou@adacore.com>
4225 * gnatvsn.ads: Bump copyright year.
4228 Copyright (C) 2016 Free Software Foundation, Inc.
4230 Copying and distribution of this file, with or without modification,
4231 are permitted in any medium without royalty provided the copyright
4232 notice and this notice are preserved.