1 2016-06-20 Ed Schonberg <schonberg@adacore.com>
3 * sem_ch13.adb (Visible_Component): New procedure, subsidiary
4 of Replace_Type_References_ Generic, to determine whether an
5 identifier in a predicate or invariant expression is a visible
6 component of the type to which the predicate or invariant
7 applies. Implements the visibility rule stated in RM 13.1.1
10 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
12 * s-regpat.adb, sem_prag.adb, pprint.adb, sem_ch13.adb: Minor
15 2016-06-20 Tristan Gingold <gingold@adacore.com>
17 * make.adb (Check_Standard_Library): Consider system.ads
18 if s-stalib.adb is not available.
19 * gnatbind.adb (Add_Artificial_ALI_File): New procedure extracted from
22 2016-06-20 Thomas Quinot <quinot@adacore.com>
24 * g-socket.adb (Is_IP_Address): A string consisting in digits only is
27 2016-06-20 Arnaud Charlet <charlet@adacore.com>
29 * exp_ch7.adb (Build_Invariant_Procedure_Body):
30 decorate invariant procedure body with typical properties of
33 2016-06-20 Arnaud Charlet <charlet@adacore.com>
35 * a-exetim-darwin.adb: New file.
37 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
39 * atree.ads, atree.adb (Elist29): New routine.
40 (Set_Elist29): New routine.
41 * atree.h New definition for Elist29.
42 * einfo.adb Subprograms_For_Type is now an Elist rather than
43 a node. Has_Invariants is now a synthesized attribute
44 and does not require a flag. Has_Own_Invariants
45 is now Flag232. Has_Inherited_Invariants is
46 Flag291. Is_Partial_Invariant_Procedure is Flag292.
47 (Default_Init_Cond_Procedure): Reimplemented.
48 (Has_Inherited_Invariants): New routine.
49 (Has_Invariants): Reimplemented.
50 (Has_Own_Invariants): New routine.
51 (Invariant_Procedure): Reimplemented.
52 (Is_Partial_Invariant_Procedure): New routine.
53 (Partial_Invariant_Procedure): Reimplemented.
54 (Predicate_Function): Reimplemented.
55 (Predicate_Function_M): Reimplemented.
56 (Set_Default_Init_Cond_Procedure): Reimplemented.
57 (Set_Has_Inherited_Invariants): New routine.
58 (Set_Has_Invariants): Removed.
59 (Set_Has_Own_Invariants): New routine.
60 (Set_Invariant_Procedure): Reimplemented.
61 (Set_Is_Partial_Invariant_Procedure): New routine.
62 (Set_Partial_Invariant_Procedure): Reimplemented.
63 (Set_Predicate_Function): Reimplemented.
64 (Set_Predicate_Function_M): Reimplemented.
65 (Set_Subprograms_For_Type): Reimplemented.
66 (Subprograms_For_Type): Reimplemented.
67 (Write_Entity_Flags): Output Flag232 and Flag291.
68 * einfo.ads Add new attributes Has_Inherited_Invariants
69 Has_Own_Invariants Is_Partial_Invariant_Procedure
70 Partial_Invariant_Procedure Change the documentation
71 of attributes Has_Inheritable_Invariants Has_Invariants
72 Invariant_Procedure Is_Invariant_Procedure Subprograms_For_Type
73 (Has_Inherited_Invariants): New routine along with pragma Inline.
74 (Has_Own_Invariants): New routine along with pragma Inline.
75 (Is_Partial_Invariant_Procedure): New routine along with pragma Inline.
76 (Partial_Invariant_Procedure): New routine.
77 (Set_Has_Inherited_Invariants): New routine along with pragma Inline.
78 (Set_Has_Invariants): Removed along with pragma Inline.
79 (Set_Has_Own_Invariants): New routine along with pragma Inline.
80 (Set_Is_Partial_Invariant_Procedure): New routine
81 along with pragma Inline.
82 (Set_Partial_Invariant_Procedure): New routine.
83 (Set_Subprograms_For_Type): Update the signature.
84 (Subprograms_For_Type): Update the signature.
85 * exp_ch3.adb Remove with and use clauses for Sem_Ch13.
86 (Build_Array_Invariant_Proc): Removed.
87 (Build_Record_Invariant_Proc): Removed.
88 (Freeze_Type): Build the body of the invariant procedure.
89 (Insert_Component_Invariant_Checks): Removed.
90 * exp_ch7.adb Add with and use clauses for Sem_Ch6, Sem_Ch13,
92 (Build_Invariant_Procedure_Body): New routine.
93 (Build_Invariant_Procedure_Declaration): New routine.
94 * exp_ch7.ads (Build_Invariant_Procedure_Body): New routine.
95 (Build_Invariant_Procedure_Declaration): New routine.
96 * exp_ch9.adb (Build_Corresponding_Record): Do not propagate
97 attributes related to invariants to the corresponding record
98 when building the corresponding record. This is done by
99 Build_Invariant_Procedure_Declaration.
100 * exp_util.adb (Make_Invariant_Call): Reimplemented.
101 * freeze.adb (Freeze_Array_Type): An array type requires an
102 invariant procedure when its component type has invariants.
103 (Freeze_Record_Type): A record type requires an invariant
104 procedure when at least one of its components has an invariant.
105 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Inherit
106 invariant-related attributes.
107 (Analyze_Subtype_Declaration):
108 Inherit invariant-related attributes.
109 (Build_Derived_Record_Type): Inherit invariant-related attributes.
110 (Check_Duplicate_Aspects): Reimplemented.
111 (Get_Partial_View_Aspect): New routine.
112 (Process_Full_View): Inherit invariant-related attributes. Reimplement
113 the check on hidden inheritance of class-wide invariants.
114 (Remove_Default_Init_Cond_Procedure): Reimplemented.
115 * sem_ch6.adb (Analyze_Subprogram_Specification): Do not modify
116 the controlling type for an invariant procedure declaration
118 (Is_Invariant_Procedure_Or_Body): New routine.
119 * sem_ch7.adb (Analyze_Package_Specification): Build the partial
120 invariant body in order to preanalyze and resolve all invariants
121 of a private type at the end of the visible declarations. Build
122 the full invariant body in order to preanalyze and resolve
123 all invariants of a private type's full view at the end of
124 the private declarations.
125 (Preserve_Full_Attributes): Inherit invariant-related attributes.
126 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Ensure that
127 aspects are analyzed with the proper view when the protected type
128 is a completion of a private type. Inherit invariant-related attributes.
129 (Analyze_Task_Type_Declaration): Ensure that
130 aspects are analyzed with the proper view when the task type
131 is a completion of a private type. Inherit invariant-related
133 * sem_ch13.adb Remove with and use clauses for Stringt.
134 (Build_Invariant_Procedure_Declaration): Removed.
135 (Build_Invariant_Procedure): Removed.
136 (Freeze_Entity_Checks): Do not build the body of the invariant
138 The body is built when the type is frozen in Freeze_Type.
139 (Inherit_Aspects_At_Freeze_Point): Do not inherit any attributes
140 related to invariants here because this leads to erroneous
142 (Replace_Node): Rename to Replace_Type_Ref.
143 * sem_ch13.ads (Build_Invariant_Procedure_Declaration): Removed.
144 (Build_Invariant_Procedure): Removed.
145 * sem_prag.adb Add with and use clauses for Exp_Ch7.
146 (Analyze_Pragma): Reimplement the analysis of pragma Invariant.
147 * sem_res.adb (Resolve_Actuals): Emit a specialized error when
148 the context is an invariant.
149 * sem_util.adb (Get_Views): New routine.
150 (Incomplete_Or_Partial_View): Consider generic packages when
151 examining declarations.
152 (Inspect_Decls): Consider full type
153 declarations because they may denote a derivation from a
155 (Propagate_Invariant_Attributes): New routine.
156 * sem_util.ads (Get_Views): New routine.
157 (Propagate_Invariant_Attributes): New routine.
159 2016-06-16 Arnaud Charlet <charlet@adacore.com>
161 * pprint.adb (Expression_Image): Add better handling of UCs,
162 we don't want to strip them all for clarity.
165 2016-06-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
167 * exp_util.adb (Safe_Unchecked_Type_Conversion): Use "alignment"
168 instead of "alignement".
170 2016-06-16 Gary Dismukes <dismukes@adacore.com>
172 * sem_util.adb: Minor typo fix.
174 2016-06-16 Emmanuel Briot <briot@adacore.com>
176 * s-regpat.adb: Further fix for invalid index in GNAT.Regexp.
178 2016-06-16 Eric Botcazou <ebotcazou@adacore.com>
180 * sem_ch13.adb (Validate_Address_Clauses): Use the same logic to
181 issue the warning on the offset for the size as for the alignment
182 and tweak the wording for the sake of consistency.
184 2016-06-16 Ed Schonberg <schonberg@adacore.com>
186 * sem_prag.adb (Check_Class_Wide_COndition): New procedure,
187 subsidiary of Analyze_Pre_Post_ Condition_In_Decl_Part, to
188 check legality rules that follow from the revised semantics of
189 class-wide pre/postconditions described in AI12-0113.
190 (Build_Pragma_Check_Equivalent): Abstract subprogram declarations
191 must be included in list of overriding primitives of a derived
194 2016-06-16 Ed Schonberg <schonberg@adacore.com>
196 * sem_util.adb (May_Be_Lvalue): An actual in an unexpanded
197 attribute reference 'Read is an assignment and must be considered
198 a modification of the object.
200 2016-06-16 Gary Dismukes <dismukes@adacore.com>
202 * einfo.adb: Minor editorial.
204 2016-06-16 Ed Schonberg <schonberg@adacore.com>
206 * sem_prag.adb (Overridden_Ancestor): Clean up code to use
207 controlling type of desired primitive rather than its scope,
208 because the primitive that inherits the classwide condition may
209 comes from several derivation steps.
211 2016-06-16 Javier Miranda <miranda@adacore.com>
213 * einfo.adb (Set_Default_Init_Cond_Procedure): Allow calls setting
214 this attribute to Empty (only if the attribute has not been set).
215 * sem_util.adb (Build_Default_Init_Cond_Procedure_Body):
216 No action needed if the spec was not built.
217 (Build_Default_Init_Cond_Procedure_Declaration): The spec is
218 not built if DIC is set to NULL or no condition was specified.
219 * exp_ch3.adb (Expand_N_Object_Declaration): Check availability
220 of the Init_Cond procedure before generating code to call it.
222 2016-06-16 Emmanuel Briot <briot@adacore.com>
224 * s-regpat.adb: Fix invalid index check when matching end-of-line
227 2016-06-16 Arnaud Charlet <charlet@adacore.com>
229 * gnat1drv.adb: Minor reformatting.
231 2016-06-16 Ed Schonberg <schonberg@adacore.com>
233 * sem_ch3.adb (Check_Entry_Contracts): New procedure, subsidiary
234 of Analyze_Declarations, that performs pre-analysis of
235 pre/postconditions on entry declarations before full analysis
236 is performed after entries have been converted into procedures.
237 Done solely to capture semantic errors.
238 * sem_attr.adb (Analyze_Attribute, case 'Result): Add guard to
239 call to Denote_Same_Function.
241 2016-06-16 Emmanuel Briot <briot@adacore.com>
243 * g-comlin.adb: Fix minor memory leak in GNAT.Command_Line.
245 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
247 * exp_ch7.adb (Find_Last_Init): Remove obsolete code. The
248 logic is now performed by Process_Object_Declaration.
249 (Process_Declarations): Recognize a controlled deferred
250 constant which is in fact initialized by means of a
251 build-in-place function call as needing finalization actions.
252 (Process_Object_Declaration): Insert the counter after the
253 build-in-place initialization call for a controlled object. This
254 was previously done in Find_Last_Init.
255 * exp_util.adb (Requires_Cleanup_Actions): Recognize a controlled
256 deferred constant which is in fact initialized by means of a
257 build-in-place function call as needing finalization actions.
259 2016-06-16 Justin Squirek <squirek@adacore.com>
261 * exp_aggr.adb (Expand_Array_Aggregate): Minor comment changes and
262 additional style fixes.
263 * exp_ch7.adb: Minor typo fixes and reformatting.
265 2016-06-16 Justin Squirek <squirek@adacore.com>
267 * sem_ch3.adb (Analyze_Object_Declaration): Add a missing check
268 for optimized aggregate arrays with qualified expressions.
269 * exp_aggr.adb (Expand_Array_Aggregate): Fix block and
270 conditional statement in charge of deciding whether to perform
271 in-place expansion. Specifically, use Parent_Node to jump over
272 the qualified expression to the object declaration node. Also,
273 a check has been inserted to skip the optimization if SPARK 2005
274 is being used in strict adherence to RM 4.3(5).
276 2016-06-16 Tristan Gingold <gingold@adacore.com>
278 * sem_prag.adb (Analyze_Pragma): Simplify code
281 2016-06-16 Eric Botcazou <ebotcazou@adacore.com>
283 * sem_util.ads (Indexed_Component_Bit_Offset): Declare.
284 * sem_util.adb (Indexed_Component_Bit_Offset): New
285 function returning the offset of an indexed component.
286 (Has_Compatible_Alignment_Internal): Call it.
287 * sem_ch13.adb (Offset_Value): New function returning the offset of an
288 Address attribute reference from the underlying entity.
289 (Validate_Address_Clauses): Call it and take the offset into
290 account for the size warning.
292 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
294 * bindgen.adb, exp_util.adb, sem_ch9.adb, sem_util.adb: Minor
297 2016-06-16 Gary Dismukes <dismukes@adacore.com>
299 * sem_ch9.adb, sem_util.ads, sem_res.adb: Minor reformatting and typo
302 2016-06-16 Javier Miranda <miranda@adacore.com>
304 * sem_res.adb (Resolve): Under relaxed RM semantics silently
305 replace occurrences of null by System.Null_Address.
306 * sem_ch4.adb (Analyze_One_Call, Operator_Check): Under
307 relaxed RM semantics silently replace occurrences of null by
309 * sem_util.ad[sb] (Null_To_Null_Address_Convert_OK): New subprogram.
310 (Replace_Null_By_Null_Address): New subprogram.
312 2016-06-16 Bob Duff <duff@adacore.com>
314 * exp_util.adb (Is_Controlled_Function_Call):
315 This was missing the case where the call is in prefix format,
316 with named notation, as in Obj.Func (Formal => Actual).
318 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
320 * exp_attr.adb, inline.adb, sem_attr.adb, sem_elab.adb: Minor
323 2016-06-16 Bob Duff <duff@adacore.com>
325 * sem_util.adb (Collect): Avoid Empty Full_T. Otherwise Etype
326 (Full_T) crashes when assertions are on.
327 * sem_ch12.adb (Matching_Actual): Correctly handle the case where
328 "others => <>" appears in a generic formal package, other than
331 2016-06-16 Arnaud Charlet <charlet@adacore.com>
333 * usage.adb: Remove confusing comment in usage line.
334 * bindgen.adb: Fix binder generated file in codepeer mode wrt
337 2016-06-16 Javier Miranda <miranda@adacore.com>
339 * restrict.adb (Check_Restriction_No_Use_Of_Entity): Avoid
340 never-ending loop, code cleanup; adding also support for Text_IO.
341 * sem_ch8.adb (Find_Expanded_Name): Invoke
342 Check_Restriction_No_Use_Entity.
344 2016-06-16 Tristan Gingold <gingold@adacore.com>
346 * exp_ch9.adb: Minor comment fix.
347 * einfo.ads (Has_Protected): Clarify comment.
348 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Do not
349 consider private protected types declared in the runtime for
350 the No_Local_Protected_Types restriction.
352 2016-06-14 Ed Schonberg <schonberg@adacore.com>
354 * sem_ch6.adb (Set_Actual_Subtypes): Do not generate actual
355 subtypes for unconstrained formals when analyzing the generated
356 body of an expression function, because it may lead to premature
357 and misplaced freezing of the types of formals.
359 2016-06-14 Gary Dismukes <dismukes@adacore.com>
361 * sem_elab.adb, sem_ch4.adb: Minor reformatting and typo fix.
363 2016-06-14 Tristan Gingold <gingold@adacore.com>
365 * einfo.adb (Set_Has_Timing_Event): Add assertion.
366 * sem_util.ads, sem_util.adb (Propagate_Concurrent_Flags): New
367 name for Propagate_Type_Has_Flags.
368 * exp_ch3.adb, sem_ch3.adb, sem_ch7.adb, sem_ch9.adb: Adjust after
371 2016-06-14 Bob Duff <duff@adacore.com>
373 * sem_elab.adb (Check_A_Call): Do nothing if the callee is
374 (or is in) an instance, and the caller is outside. Misc cleanup.
376 2016-06-14 Javier Miranda <miranda@adacore.com>
378 * sem_ch4.adb (Analyze_Quantified_Expression):
379 Generating C code avoid spurious warning on loop variable of
380 inlinined postconditions.
382 2016-06-14 Javier Miranda <miranda@adacore.com>
384 * sem_attr.adb (Analyze_Attribute_Old_Result): Adding assertion.
385 (Analyze_Attribute [Attribute_Old]): Generating C handle
386 analysis of 'old in inlined postconditions.
387 (Analyze_Attribute [Attribute_Result]): Generating C handle analysis
388 of 'result in inlined postconditions.
389 * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Old]):
390 Generating C handle expansion of 'old in inlined postconditions.
391 * inline.adb (Declare_Postconditions_Result): New subprogram.
392 * sem_ch12.adb (Copy_Generic_Node): Copy pragmas generated from
393 aspects when generating C code since pre/post conditions are
394 inlined and the frontend inlining relies on this routine to
396 * exp_ch6.adb (Inlined_Subprogram): Replace Generate_C_Code
397 by Modify_Tree_For_C.
398 * exp_unst.adb (Visit_Node): Searching for up-level references
399 skip entities defined in inlined subprograms.
401 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
403 * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb:
406 2016-06-14 Bob Duff <duff@adacore.com>
408 * sem_elab.adb: Do nothing if the callee is intrinsic.
409 * sinfo.ads, einfo.ads: Minor comment fixes.
411 2016-06-14 Ed Schonberg <schonberg@adacore.com>
413 * contracts.adb (Has_Null_Body): Move to sem_util, for general
415 * sem_util.ads, sem_util.adb (Has_Null_Body): Predicate to
416 determine when an internal procedure created for some assertion
417 checking (e.g. type invariant) is a null procedure. Used to
418 eliminate redundant calls to such procedures when they apply to
419 components of composite types.
420 * exp_ch3.adb (Build_Component_Invariant_Call): Do not add call
421 if invariant procedure has a null body.
423 2016-06-14 Thomas Quinot <quinot@adacore.com>
425 * g-socket.ads (Check_Selector): Clarify effect on IN OUT socket
428 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
430 * exp_ch4.adb (Process_Action): Pass the action
431 list to Process_Transient_Object.
432 (Process_If_Case_Statements): Pass the action list to
433 Process_Transient_Object.
434 (Process_Transient_Object): Add new parameter Stmts and update the
435 comment on usage. When the context is a Boolean evaluation, insert
436 any finalization calls after the last statement of the construct.
438 2016-06-14 Tristan Gingold <gingold@adacore.com>
440 * einfo.adb, einfo.ads (Has_Timing_Event,
441 Set_Has_Timing_Event): Add Has_Timing_Event flag.
442 (Write_Entity_Flags): Display * sem_util.ads, sem_util.adb:
443 (Propagate_Type_Has_Flags): New procedure to factorize code.
444 * exp_ch3.adb (Expand_Freeze_Array_Type,
445 Expand_Freeze_Record_Type): Call Propagate_Type_Has_Flags.
446 * sem_ch3.adb (Access_Type_Decalaration): Initialize
447 Has_Timing_Event flag. (Analyze_Object_Declaration):
448 Move code that check No_Local_Timing_Events near
449 the code that check No_Local_Protected_Objects.
450 (Analyze_Private_Extension_Declaration, Array_Type_Declaration)
451 (Build_Derived_Type, Copy_Array_Base_Type_Attributes,
452 Process_Full_View) (Record_Type_Definition): Call
453 Propagate_Type_Has_Flags.
454 * sem_ch4.adb (Analyze_Allocator): Check No_Local_Timing_Events.
455 * sem_ch7.adb (New_Private_Type): Set Has_Timing_Event on the
457 (Uninstall_Declaration): Call Propagate_Type_Has_Flags.
458 * sem_ch9.adb (Analyze_Protected_Definition): Call
459 Propagate_Type_Has_Flags.
461 2016-06-14 Arnaud Charlet <charlet@adacore.com>
463 * sem.ads: Minor style fix.
465 2016-06-14 Ed Schonberg <schonberg@adacore.com>
467 * sem_ch12.adb (Analyze_Associations): An actual parameter
468 with a box must be included in the count of actuals, to detect
469 possible superfluous named actuals that do not match any of the
470 formals of the generic unit in a formal package declaration.
472 2016-06-14 Justin Squirek <squirek@adacore.com>
474 * sem_ch3.adb (Analyze_Object_Declaration): Fix formatting
475 of error output related to SPARK RM 6.1.7(3) and pragma
477 * sem_ch4.adb (Analyze_Type_Conversion): Fix formatting of error
478 output related to SPARK RM 6.1.7(3) and pragma Extensions_Visible.
479 * sem_prag.adb (Analyze_Pragma): Fix formatting of error output
480 related to SPARK RM 7.1.2(15) and pragma Volatile_Function
481 so that the values True and False are no longer surrounded by
483 * sem_res.adb (Resolve_Actuals): Fix formatting of error output
484 related to SPARK RM 6.1.7(3) and pragma Extensions_Visible.
486 2016-06-14 Arnaud Charlet <charlet@adacore.com>
488 * gnat1drv.adb (Adjust_Global_Switches): Enable access checks
490 * freeze.adb: Minor grammar fix in comment.
491 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
493 * lib.adb: Minor reformatting.
494 * sem_util.adb (Is_OK_Volatile_Context): Do
495 include Address in the supported attributes.
497 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
499 * exp_ch4.adb (Expand_N_Case_Expression):
500 Code cleanup. Finalize any transient controlled
501 objects on exit from a case expression alternative.
502 (Expand_N_If_Expression): Code cleanup.
503 (Process_Actions): Removed.
504 (Process_If_Case_Statements): New routine.
505 (Process_Transient_Object): Change the name of formal Rel_Node to
506 N and update all occurrences. Update the comment on usage. When
507 the type of the context is Boolean, the proper insertion point
508 for the finalization call is after the last declaration.
510 2016-06-14 Ed Schonberg <schonberg@adacore.com>
512 * lib-xref.ads, lib-xref.adb (Has_Deferred_Reference): new
513 predicate to determine whether an entity appears in a context
514 for which a Deferred_Reference was created, because it is not
515 possible to determine when reference is analyzed whether it
516 appears in a context in which the entity is modified.
517 * sem_ch5.adb (Analyze_Statement): Do not emit a useless warning
518 on assignment for an entity that has a deferred_reference.
520 2016-06-14 Javier Miranda <miranda@adacore.com>
522 * sem_res.adb (Resolve_Actuals): Generate a reference to actuals that
523 come from source. Previously the reference was generated only if the
524 call comes from source but the call may be rewritten by the expander
525 thus causing the notification of spurious warnings.
527 2016-06-14 Arnaud Charlet <charlet@adacore.com>
529 * gnat1drv.adb: Remove further references to AAMP.
530 * checks.adb (Apply_Scalar_Range_Check): Take
531 Check_Float_Overflow info account.
532 * live.ads, live.adb Added subprogram headers and
533 start-of-processing-for comments.
534 * sem_ch12.adb (Instantiate_Package_Body): Do not suppress
535 checks when instantiating runtime units in CodePeer mode.
537 2016-06-14 Arnaud Charlet <charlet@adacore.com>
539 * exp_ch3.adb (Expand_N_Object_Declaration): Only consider
542 2016-06-14 Arnaud Charlet <charlet@adacore.com>
544 * switch-c.adb, gnat1drv.adb (Adjust_Global_Switches): Only disable
545 simple value propagation in CodePeer mode when warnings are disabled.
546 (Scan_Front_End_Switches): Enable relevant front-end switches
549 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
551 * sem_util.adb (Is_OK_Volatile_Context): A
552 reference to a volatile object is considered OK if appears as
553 the prefix of attributes Address, Alignment, Component_Size,
554 First_Bit, Last_Bit, Position, Size, Storage_Size.
556 2016-06-14 Yannick Moy <moy@adacore.com>
558 * lib-xref-spark_specific.adb (Add_SPARK_File): Do not traverse
559 subunits directly, as they are already traversed as part of the
560 top-level unit to which they belong.
561 (Add_SPARK_Xrefs): Add assertions to ensure correct sorting.
562 (Generate_Dereference): Use unique definition place for special
563 variable __HEAP, to ensure correct sorting of references.
564 * lib-xref.adb (Generate_Reference): Use top-level unit in case
566 * lib.adb, lib.ads (Get_Top_Level_Code_Unit): New functions that
567 compute the top-level code unit for a source location of AST node,
568 that go past subunits.
570 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
572 * gcc-interface/decl.c (gnat_to_gnu_subprog_type): Build only a minimal
573 PARM_DECL when the parameter type is dummy.
574 * gcc-interface/trans.c (Call_to_gnu): Translate formal types before
577 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
579 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
580 PLUS_EXPR in the expression of a renaming.
582 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
584 * gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Deal specially
585 with calls to malloc.
587 2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
589 * gcc-interface/trans.c (build_binary_op_trapv): If no operand is a
590 constant, use the generic implementation of the middle-end; otherwise
591 turn the dynamic conditions into static conditions and simplify.
593 2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
595 * gcc-interface/trans.c (Case_Statement_to_gnu): Deal with characters.
597 2016-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
599 * gcc-interface/decl.c (gnat_to_gnu_entity): Do not clobber
600 gnat_entity_name with temporary names for XUP and XUT types.
602 2016-06-10 Martin Sebor <msebor@redhat.com>
605 * gcc/ada/gcc-interface/utils.c (handle_nonnull_attribute): Accept
606 the nonnull attribute in type-generic builtins.
608 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
610 * gcc-interface/decl.c (Gigi_Equivalent_Type): Make sure equivalent
611 types are present before returning them. Remove final assertion.
612 (gnat_to_gnu_entity) <E_Access_Protected_Subprogram_Type>: Adjust to
614 <E_Protected_Type>: Likewise.
616 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
618 * gcc-interface/trans.c (elaborate_all_entities_for_package): Also do
619 not elaborate Itypes.
621 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
623 * gcc-interface/utils.c (gnat_internal_attribute_table): Add support
624 for noinline and noclone attributes.
625 (handle_noinline_attribute): New handler.
626 (handle_noclone_attribute): Likewise.
628 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
630 * gcc-interface/trans.c (process_type): Beef up comment.
632 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
634 * gcc-interface/utils2.c (build_call_alloc_dealloc): Do not substitute
635 placeholder expressions here but...
636 * gcc-interface/trans.c (gnat_to_gnu) <N_Free_Statement>: ...here.
637 Make an exception to the protection of a CALL_EXPR result with an
638 unconstrained type only in the same cases as Call_to_gnu.
640 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
642 * gcc-interface/trans.c (gnat_to_gnu): Rework special code dealing
643 with boolean rvalues and set the location directly. Do not set the
644 location in the other cases for a simple name.
645 (gnat_to_gnu_external): Clear the location on the expression.
647 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
649 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Component>: Remove
650 useless 'else' statements and tidy up.
651 <E_Array_Subtype>: Fully deal with the declaration here.
652 <E_Incomplete_Type>: Use properly-typed constant.
653 Assert that we don't apply the special type treatment to dummy types.
654 Separate this treatment from the final back-annotation and simplify
655 the condition for the RM size.
656 (gnat_to_gnu_param): Add GNU_PARAM_TYPE parameter and adjust.
657 (gnat_to_gnu_subprog_type): Ajust call to gnat_to_gnu_param.
658 * gcc-interface/trans.c (gnat_to_gnu) <N_Subprogram_Declaration>: Add
660 (process_freeze_entity): Remove obsolete code.
661 (process_type): Minor tweaks.
663 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
665 * einfo.ads (Returns_Limited_View): Remove.
666 (Set_Returns_Limited_View ): Likewise.
667 * einfo.adb (Returns_Limited_View): Likewise.
668 (Set_Returns_Limited_View ): Likewise.
669 * freeze.adb (Late_Freeze_Subprogram): Remove.
670 (Freeze_Entity): Do not defer the freezing of functions returning an
671 incomplete type coming from a limited context.
673 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
675 * gcc-interface/gigi.h (finish_subprog_decl): Add ASM_NAME parameter.
676 * gcc-interface/decl.c (gnu_ext_name_for_subprog): New function.
677 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not check compatibility
678 of profiles for builtins here... Call gnu_ext_name_for_subprog.
679 Also update profiles if pointers to limited_with'ed types are
681 (gnat_to_gnu_param): Restore the correct source location information
682 for vector ABI warnings.
683 (associate_subprog_with_dummy_type): Add comment about AI05-019.
684 Set TYPE_DUMMY_IN_PROFILE_P flag unconditionally.
685 (update_profile): Deal with builtin declarations.
686 Call gnu_ext_name_for_subprog. Adjust call to finish_subprog_decl.
687 (update_profiles_with): Add comment.
688 (gnat_to_gnu_subprog_type): Reuse the return type if it is complete.
689 Likewise for parameter declarations in most cases. Do not change
690 the return type for the CICO mechanism if the profile is incomplete.
691 ...but here instead. Always reset the slot for the parameters.
692 * gcc-interface/utils.c (create_subprog_decl): Call
693 gnu_ext_name_for_subprog. Do not set the assembler name here but...
694 (finish_subprog_decl): ...but here instead. Add ASM_NAME parameter.
696 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
698 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Insert the
699 declaration of the corresponding record type before that of the
700 unprotected version of the subprograms that operate on it.
701 (Expand_Access_Protected_Subprogram_Type): Declare the Equivalent_Type
702 just before the original type.
703 * sem_ch3.adb (Handle_Late_Controlled_Primitive): Point the current
704 declaration to the newly created declaration for the primitive.
705 (Analyze_Subtype_Declaration): Remove obsolete code forcing the
706 freezing of the subtype before its declaration.
707 (Replace_Anonymous_Access_To_Protected_Subprogram): Insert the new
708 declaration in the nearest enclosing scope for formal parameters too.
709 (Build_Derived_Access_Type): Restore the status of the created Itype
710 after it is erased by Copy_Node.
711 * sem_ch6.adb (Exchange_Limited_Views): Remove guard on entry.
712 (Analyze_Subprogram_Body_Helper): Call Exchange_Limited_Views only if
713 the specification is present.
714 Move around the code changing the designated view of the return type
715 and save the original view. Restore it on exit.
716 * sem_ch13.adb (Build_Predicate_Function_Declaration): Always insert
717 the declaration right after that of the type.
719 2016-06-01 Simon Wright <simon@pushface.org>
722 * g-comlin.adb (Display_Section_Help): Do not dereference
723 Config.Switches if it's null.
726 2016-05-31 Eric Botcazou <ebotcazou@adacore.com>
728 * s-osinte-kfreebsd-gnu.ads (clock_getres): Define.
729 (Get_Page_Size): Remove duplicate and return int.
731 2016-05-31 Jan Sommer <soja-lists@aries.uberspace.de>
734 * s-osinte-rtems.ads (clock_getres): Define.
735 (Get_Page_Size): Remove duplicate and return int.
737 2016-05-20 Eric Botcazou <ebotcazou@adacore.com>
739 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
740 Make same-sized subtypes of signed base types signed.
741 * gcc-interface/utils.c (make_type_from_size): Adjust to above change.
742 (unchecked_convert): Likewise.
744 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
746 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Do not build
747 a specific type for the object if it is deemed a constant.
749 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
751 * freeze.adb (Freeze_Record_Type): Extend pragma Implicit_Packing to
752 components of any elementary types and of composite types.
754 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
756 * freeze.adb (Freeze_Array_Type): Call Addressable predicate instead
757 of testing for individual sizes.
758 (Freeze_Entity): Rework implementation of pragma Implicit_Packing for
759 array types, in particular test for suitable sizes upfront and do not
760 mimic the processing that will be redone later in Freeze_Array_Type.
762 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
764 * gcc-interface/trans.c (elaborate_all_entities_for_package): Also skip
767 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
769 * doc/gnat_rm/implementation_defined_attributes.rst
770 (Scalar_Storage_Order): Adjust restriction for packed array types.
771 * einfo.ads (Is_Bit_Packed_Array): Adjust description.
772 (Is_Packed): Likewise.
773 (Is_Packed_Array_Impl_Type): Likewise.
774 (Packed_Array_Impl_Type): Likewise.
775 * exp_ch4.adb (Expand_N_Indexed_Component): Do not do anything special
776 if the prefix is not a packed array implemented specially.
777 * exp_ch6.adb (Expand_Actuals): Expand indexed components only for
778 bit-packed array types.
779 * exp_pakd.adb (Install_PAT): Set Is_Packed_Array_Impl_Type flag on
780 the PAT before analyzing its declaration.
781 (Create_Packed_Array_Impl_Type): Remove redundant statements.
782 * freeze.adb (Check_Component_Storage_Order): Reject packed array
783 components only if they are bit packed.
784 (Freeze_Array_Type): Fix logic detecting bit packing and do not bit
785 pack for composite types whose size is multiple of a byte.
786 Create the implementation type for packed array types only when it is
787 needed, i.e. bit packing or packing because of holes in index types.
788 Make sure the Has_Non_Standard_Rep and Is_Packed flags agree.
789 * gcc-interface/gigi.h (make_packable_type): Add MAX_ALIGN parameter.
790 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
791 Call maybe_pad_type instead of building the padding type manually.
792 (gnat_to_gnu_entity) <E_Array_Subtype>: Do not assert that
793 Packed_Array_Impl_Type is present for packed arrays.
794 (gnat_to_gnu_component_type): Also handle known alignment for packed
795 types by passing it to make_packable_type.
796 * gcc-interface/utils.c (make_packable_type): Add MAX_ALIGN parameter
797 and deal with it in the array case. Adjust recursive call. Simplify
798 computation of new size and cap the alignment to BIGGEST_ALIGNMENT.
800 2016-05-16 Thomas Quinot <quinot@adacore.com>
802 * freeze.adb (Check_Component_Storage_Order): Also get full view of
805 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
807 * exp_util.adb (Remove_Side_Effects): Also make a constant if we need
808 to capture the value for a small not by-reference record type.
809 * freeze.ads (Check_Compile_Time_Size): Adjust comment.
810 * freeze.adb (Set_Small_Size): Likewise. Accept a size in the range
812 (Check_Compile_Time_Size): Merge scalar and access type cases. Change
813 variable name in array type case. For the computation of the packed
814 size, deal with record components and remove redundant test.
815 (Freeze_Array_Type): Also adjust packing status when the size of the
816 component type is in the range 33 .. 64 bits.
817 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Turn primitive
818 into elementary type throughout. Minor tweaks.
819 (Alignment Clauses): Document actual alignment of packed array types.
820 (Pragma Pack for Arrays): List only the 3 main cases and adjust. Add
821 "simple" to the record case. Document effect on non packable types.
822 (Pragma Pack for Records): Likewise. Add record case and adjust.
824 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
826 * gcc-interface/Make-lang.in (GNATMAKE_FOR_HOST): In the canadian
827 cross case, use host_noncanonical instead of host as prefix.
828 (GNATBIND_FOR_HOST): Likewise.
829 (GNATLINK_FOR_HOST): Likewise.
830 (GNATLS_FOR_HOST): Likewise.
832 2016-05-06 Eric Botcazou <ebotcazou@adacore.com>
835 * system-darwin-ppc64.ads: Add pragma No_Elaboration_Code_All.
836 * system-linux-armeb.ads: Likewise.
837 * system-linux-mips64el.ads: Likewise.
838 * system-linux-mips.ads: Likewise.
839 * system-linux-mipsel.ads: Likewise.
840 * system-linux-ppc64.ads: Likewise.
841 * system-linux-sparcv9.ads: Likewise.
842 * system-rtems.ads: Likewise.
844 2016-05-04 Samuel Thibault <samuel.thibault@ens-lyon.org>
846 * s-osinte-gnu.ads (Get_Page_Size): Return int and use getpagesize
847 instead of __getpagesize.
849 2016-05-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
851 * gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
854 2016-05-02 Tristan Gingold <gingold@adacore.com>
856 * fname.adb (Is_Predefined_File_Name): Also consider non-krunched
859 2016-05-02 Ed Schonberg <schonberg@adacore.com>
861 * sem_util.adb (Aggregate_Constraint_Checks): Separate
862 accessibility checks and non-null checks for aggregate components,
863 to prevent spurious accessibility errors.
865 2016-05-02 Ed Schonberg <schonberg@adacore.com>
867 * sem_ch3.adb (OK_For_Limited_Init): A type conversion is not
868 always legal in the in-place initialization of a limited entity
870 * sem_res.adb (Resolve_Allocator): Improve error message with RM
871 reference when allocator expression is illegal.
873 2016-05-02 Ed Schonberg <schonberg@adacore.com>
875 * exp_ch6.adb (Expand_Call): When inlining a call to a function
876 declared in a package instance, locate the instance node of the
877 package after the actual package declaration. skipping over
878 pragmas that may have been introduced when the generic unit
879 carries aspects that are transformed into pragmas.
881 2016-05-02 Bob Duff <duff@adacore.com>
883 * s-memory.adb (Alloc, Realloc): Move checks
884 for Size = 0 or size_t'Last into the Result = System.Null_Address
885 path for efficiency. Improve comments (based on actual C language
886 requirements for malloc).
887 * exp_util.adb (Build_Allocate_Deallocate_Proc): Optimize the
888 case where we are using the default Global_Pool_Object, and we
889 don't need the heavy finalization machinery.
891 2016-05-02 Gary Dismukes <dismukes@adacore.com>
893 * exp_util.ads, sem_ch12.adb: Minor reformatting.
895 2016-05-02 Javier Miranda <miranda@adacore.com>
897 * exp_util.ads, exp_util.adb (Force_Evaluation): Adding new formal.
898 (Remove_Side_Effects): Adding a new formal.
899 * exp_ch6.adb (Expand_Simple_Function_Return): Generating the
900 call to the _Postconditions procedure ensure that side-effects
901 are unconditionally removed.
903 2016-05-02 Ed Schonberg <schonberg@adacore.com>
905 * sem_ch12.adb (Check_Formal_Package_Instance, Check_Mismatch):
906 Use original node to determine whether the declaration is for
907 a formal type declaration, to take into account that formwl
908 private types are rewritten as private extension declarations
909 to simplify semantic analysis.
911 2016-05-02 Gary Dismukes <dismukes@adacore.com>
913 * exp_ch9.adb, sem_ch6.adb, sem_ch6.ads: Minor reformatting and typo
916 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
918 * sem_ch3.adb, exp_ch9.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb: Minor
921 2016-05-02 Ed Schonberg <schonberg@adacore.com>
923 * exp_ch4.adb (Expand_N_Allocator): If the designated type
924 is a private derived type with no discriminants, examine its
925 underlying_full_view to determine whether the full view has
926 defaulted discriminants, so their defaults can be used in the
927 call to the initialization procedure for the designated object.
929 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
931 * exp_prag.adb, comperr.adb: Minor reformatting.
933 2016-05-02 Ed Schonberg <schonberg@adacore.com>
935 * exp_pakd.adb (Rj_Unchecked_Convert_To): Do not perform an
936 unchecked conversion if the source size is 0 (indicating that
937 its RM size is unknown). This will happen with packed arrays of
938 non-discrete types, in which case the component type is known
941 2016-05-02 Arnaud Charlet <charlet@adacore.com>
943 * debug.adb: Reserve -gnatd.V.
945 2016-05-02 Javier Miranda <miranda@adacore.com>
947 * sem_ch3.adb (Process_Full_View): Remove from visibility
948 wrappers of synchronized types to avoid spurious errors with
949 their wrapped entity.
950 * exp_ch9.adb (Build_Wrapper_Spec): Do not generate the wrapper
951 if no interface primitive is covered by the subprogram and this is
952 not a primitive declared between two views; see Process_Full_View.
953 (Build_Protected_Sub_Specification): Link the dispatching
954 subprogram with its original non-dispatching protected subprogram
955 since their names differ.
956 (Expand_N_Protected_Type_Declaration):
957 If a protected subprogram overrides an interface primitive then
958 do not build a wrapper if it was already built.
959 * einfo.ads, einfo.adb (Original_Protected_Subprogram): New attribute.
960 * sem_ch4.adb (Names_Match): New subprogram.
961 * sem_ch6.adb (Check_Synchronized_Overriding): Moved
962 to library level and defined in the public part of the
963 package to invoke it from Exp_Ch9.Build_Wrapper_Spec
964 (Has_Matching_Entry_Or_Subprogram): New subprogram.
965 (Report_Conflict): New subprogram.
967 2016-05-02 Jerome Lambourg <lambourg@adacore.com>
969 * s-unstyp.ads: Code cleanups.
971 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
973 * sem_ch13.adb (Size_Too_Small_Error): Fix the error message format.
975 2016-05-02 Ed Schonberg <schonberg@adacore.com>
977 * exp_prag.adb (Expand_attributes_In_Consequence,
978 Expand_Attributes): If the prefix of'Old is an unconstrained type,
979 for example an unconstrained formal of the enclosing subprogram,
980 create an object declaration with an expression to obtain the
981 actual subtype of the temporary.
983 2016-05-02 Arnaud Charlet <charlet@adacore.com>
985 * comperr.adb (Delete_SCIL_Files): Add missing handling of
986 N_Subprogram_Declaration.
988 2016-05-02 Gary Dismukes <dismukes@adacore.com>
990 * exp_ch5.adb, exp_ch7.adb, exp_ch7.ads, checks.adb, sem_attr.adb,
991 gnat1drv.adb, sem_ch4.adb, sem_ch13.adb: Minor reformatting and typo
993 * sem_prag.adb, sem_ch12.adb: Minor typo fixes.
995 2016-05-02 Ed Schonberg <schonberg@adacore.com>
997 * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): The
998 function call may be wrapped in an explicit type conversion.
1000 2016-05-02 Jerome Lambourg <lambourg@adacore.com>
1002 * interfac.ads: use pragma No_Elaboration_Code_All.
1003 * s-unstyp.ads: s-unstyp.ads: use pragma No_Elaboration_Code_All.
1005 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1007 * sem.adb (Analyze: If node is an error node previously created
1008 by the parser, disable expansion to prevent subsequent glitches
1011 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1013 * sem_ch13.adb (Alignment_Error): Removed.
1014 (Get_Alignment_Value): Code cleanup.
1016 2016-05-02 Tristan Gingold <gingold@adacore.com>
1018 * sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected
1019 to check for the no local protected objects restriction.
1021 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1023 * einfo.adb Anonymous_Master now uses Node35.
1024 (Anonymous_Master): Update the assertion and node reference.
1025 (Set_Anonymous_Master): Update the assertion and node reference.
1026 (Write_Field35_Name): Add output for Anonymous_Master.
1027 (Write_Field36_Name): The output is now undefined.
1028 * einfo.ads Update the node and description of attribute
1029 Anonymous_Master. Remove prior occurrences in entities as this
1030 is now a type attribute.
1031 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove local variable
1032 Ins_Node. Anonymous access- to-controlled component types no
1033 longer need finalization masters. The master is now built when
1034 a related allocator is expanded.
1035 (Expand_Freeze_Record_Type): Remove local variable Has_AACC. Do not
1036 detect whether the record type has at least one component of anonymous
1037 access-to- controlled type. These types no longer need finalization
1038 masters. The master is now built when a related allocator is expanded.
1039 * exp_ch4.adb Remove with and use clauses for Lib and Sem_Ch8.
1040 (Current_Anonymous_Master): Removed.
1041 (Expand_N_Allocator): Call Build_Anonymous_Master to create a
1042 finalization master for an anonymous access-to-controlled type.
1043 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
1044 Call routine Build_Anonymous_Master to create a finalization master
1045 for an anonymous access-to-controlled type.
1046 * exp_ch7.adb (Allows_Finalization_Master): New routine.
1047 (Build_Anonymous_Master): New routine.
1048 (Build_Finalization_Master): Remove formal parameter
1049 For_Anonymous. Use Allows_Finalization_Master to determine whether
1050 circumstances warrant a finalization master. This routine no
1051 longer creates masters for anonymous access-to-controlled types.
1052 (In_Deallocation_Instance): Removed.
1053 * exp_ch7.ads (Build_Anonymous_Master): New routine.
1054 (Build_Finalization_Master): Remove formal parameter For_Anonymous
1055 and update the comment on usage.
1056 * sem_util.adb (Get_Qualified_Name): New routines.
1057 (Output_Name): Reimplemented.
1058 (Output_Scope): Removed.
1059 * sem_util.ads (Get_Qualified_Name): New routines.
1061 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1063 * debug.adb: Document the use of switch -gnatd.H.
1064 * gnat1drv.adb (Adjust_Global_Switches): Set ASIS_GNSA mode when
1065 -gnatd.H is present.
1066 (Gnat1drv): Suppress the call to gigi when ASIS_GNSA mode is active.
1067 * opt.ads: Add new option ASIS_GNSA_Mode.
1068 * sem_ch13.adb (Alignment_Error): New routine.
1069 (Analyze_Attribute_Definition_Clause): Suppress certain errors in
1070 ASIS mode for attribute clause Alignment, Machine_Radix, Size, and
1072 (Check_Size): Use routine Size_Too_Small_Error to
1073 suppress certain errors in ASIS mode.
1074 (Get_Alignment_Value): Use routine Alignment_Error to suppress certain
1075 errors in ASIS mode.
1076 (Size_Too_Small_Error): New routine.
1078 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1080 * spark_xrefs.ads Description of the spark cross-references
1081 clarified; small style fixes.
1082 * lib-xref-spark_specific.adb (Add_SPARK_Scope,
1083 Detect_And_Add_SPARK_Scope): consider protected types and bodies
1084 as yet another scopes.
1085 (Enclosing_Subprogram_Or_Library_Package): refactored using
1086 Hristian's suggestions; added support for scopes of protected
1087 types and bodies; fix for entries to return the scope of the
1088 enclosing concurrent type, which is consistent with what is
1089 returned for protected subprograms.
1090 * sem_intr.adb: Minor style fix in comment.
1092 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1094 * lib-xref.ads, lib-xref-spark_specific.adb, get_spark_xrefs.adb,
1095 put_spark_xrefs.adb: Minor reformatting.
1097 2016-05-02 Doug Rupp <rupp@adacore.com>
1099 * g-traceb.ads: Document traceback for ARM.
1101 2016-05-02 Javier Miranda <miranda@adacore.com>
1103 * exp_disp.adb (Make_Tags): Do not generate the
1104 external name of interface tags adding the suffix counter since
1105 it causes problems at link time when the IP routines are inlined
1106 across units with optimization.
1108 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1110 * einfo.ads, einfo.adb (Predicates_Ignared): new flag to indicate
1111 that predicate checking is disabled for predicated subtypes in
1112 the context of an Assertion_Policy pragma.
1113 * checks.adb (Apply_Predicate_Check): Do nothing if
1114 Predicates_Ignored is true.
1115 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): If
1116 Predicates_Ignores is true, the function Rep_To_Pos does raise
1117 an exception for invalid data.
1118 * exp_ch4.adb (Expand_N_Type_Conversion): IF target is a predicated
1119 type do not apply check if Predicates_Ignored is true.
1120 * exp_ch5.adb (Expand_N_Case_Statement): If Predicates_Ignored
1121 is true, sem_prag.adb:
1122 * sem_ch3.adb (Analyze_Object_Declaration): If Predicates_Ignored
1123 is true do not emit predicate check on initializing expression.
1125 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1127 * get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when
1128 they are declared; refine type of a counter from Integer to Natural.
1129 * sem_ch5.adb, gnatcmd.adb, s-intman-posix.adb, eval_fat.adb,
1130 prj.adb, sem_util.adb, s-intman-android.adb, prj-nmsc.adb, sem_ch8.adb,
1131 exp_ch3.adb: Minor editing.
1133 2016-05-02 Yannick Moy <moy@adacore.com>
1135 * a-tigeli.adb (Get_Line): Always set Last prior to returning.
1137 2016-05-02 Yannick Moy <moy@adacore.com>
1139 * lib-xref.adb: Minor style fix in whitespace of declarations.
1140 * put_spark_xrefs.adb (Put_SPARK_Xrefs): printing of strings
1141 refactored without loops.
1142 * put_spark_xrefs.ads (Write_Info_Str): new formal argument of
1144 * spark_xrefs.adb (Write_Info_Str): new actual in instantiation
1145 of generic procedure.
1147 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1149 * lib-xref-spark_specific.adb (Add_SPARK_Scope): add task type scope.
1150 (Detect_And_Add_SPARK_Scope): detect and add task type scope.
1151 (Enclosing_Subprogram_Or_Package): Respect boundaries of task
1152 and entry declarations.
1153 * spark_xrefs.ads: minor typo in comment.
1155 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1157 * make.adb: Minor: avoid an exception when calling gnatmake with
1158 no argument and gnatmake is built with checks on.
1159 * lib-xref-spark_specific.adb: Minor code cleanup.
1161 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1163 * sem_util.adb (Normalize_Actuals): Take into account extra
1164 actuals that may have been introduced previously. Normally extra
1165 actuals are introduced when a call is expanded, but a validity
1166 check may copy and reanalyze a call that carries an extra actual
1167 (e.g. an accessibility parameter) before the call itself is
1168 marked Analzyed, and the analysis of the copy has to be able to
1169 cope with the added actual.
1171 2016-05-02 Bob Duff <duff@adacore.com>
1173 * sem_ch10.adb (Analyze_Compilation_Unit): Preserve
1174 treeishness. Previous version had Context_Items shared between
1177 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1179 * sem_aggr.adb (Resolve_Aggr_Expression): For both array and
1180 record cases, apply predicate check on component for expression
1181 only if expression has been analyzed already. For expressions
1182 that need to be duplicated when they cover multiple components,
1183 resolution and predicate checking take place later.
1185 2016-05-02 Olivier Hainque <hainque@adacore.com>
1187 * a-direct.adb (Delete_Tree): Use full names to designate subdirs
1188 and files therein, instead of local names after a change of
1191 2016-05-02 Thomas Quinot <quinot@adacore.com>
1193 * freeze.adb (Check_Component_Storage_Order): Get full view of
1196 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1198 * checks.adb, freeze.adb, sem_res.adb, s-stposu.adb, repinfo.adb:
1201 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1203 * sem_ch4.adb (Find_Indexing_Operations): Use the underlying type
1204 of the container base type in case the container is a subtype.
1205 * sem_ch5.adb (Analyze_Iterator_Specification): Ensure that
1206 the selector has an entity when checking for a component of a
1209 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1212 * opt.ads (Latest_Ada_Only): New flag.
1213 * sem_prag.adb, par-prag.adb: Ignore pragma Ada_xx under this flag.
1214 * usage.adb, switch-c.adb: Disable support for -gnatxx under this flag.
1215 * einfo.ads (Has_Predicates, Predicate_Function):
1216 Clarify that Has_Predicates does not imply that Predicate_Function
1217 will return a non-empty entity.
1219 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1221 * sem_res.adb (Resolve_Qualified_Expression): Generate a predicate
1222 check if type requires it.
1223 * checks.adb (Apply_Predicate_Check): Disable checks in the
1224 object declaration created for an expression with side-effects
1225 that requires a predicate check to prevent infinite recursion
1228 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1230 * sem_ch6.adb (Process_Formals): Check properly the type of a
1231 formal to determine whether a given convention applies to it.
1233 2016-05-02 Doug Rupp <rupp@adacore.com>
1235 * tracebak.c: Add incantations for arm-vxworks[67] traceback.
1237 2016-05-02 Thomas Quinot <quinot@adacore.com>
1239 * freeze.adb (Check_Component_Storage_Order): Make it a warning, not an
1240 error, to have a component with implicit SSO within a composite type
1241 that has explicit SSO.
1243 2016-05-02 Bob Duff <duff@adacore.com>
1245 * s-stposu.adb (Allocate_Any_Controlled): Don't lock/unlock twice.
1247 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1249 * repinfo.adb (List_Entities): Make procedure recursive, to
1250 provide representation information for subprograms declared
1251 within subprogram bodies.
1253 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1255 * exp_ch5.adb, layout.adb, gnatcmd.adb exp_attr.adb, make.adb,
1256 bindgen.adb, debug.adb, exp_pakd.adb, freeze.adb, sem_util.adb,
1257 gnatlink.adb, switch-m.adb, exp_ch4.adb, repinfo.adb, adabkend.adb,
1258 osint.adb: Remove dead code.
1260 2016-05-02 Yannick Moy <moy@adacore.com>
1262 * a-tigeli.adb (Get_Line): Fix bound for test to
1263 decide when to compensate for character 0 added by call to fgets.
1265 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1267 * sem_ch4.adb (Analyze_Allocator): If the expression does not
1268 have a subtype indication and the type is an unconstrained tagged
1269 type with defaulted discriminants, create an explicit constraint
1270 for it during analysis to prevent out-of-order freezing actions
1271 on generated classwide types.
1273 2016-05-02 Javier Miranda <miranda@adacore.com>
1275 * exp_ch5.adb (Expand_N_Assignment_Statement):
1276 In the runtime check that ensures that the tags of source an
1277 target match, add missing displacement of the pointer to the
1278 objects if they cover interface types.
1280 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1282 * sem_attr.adb (Analyze_Attribute, case 'Old): Do not use
1283 base type for attribute when type is discrete: transformation
1284 is not needed for such types, and leads to spurious errors if
1285 the context is a case construct.
1287 2016-05-02 Eric Botcazou <ebotcazou@adacore.com>
1289 * gcc-interface/decl.c (elaborate_reference_1): Do not bother about
1290 operand #2 for COMPONENT_REF.
1291 * gcc-interface/utils2.c (gnat_save_expr): Likewise.
1292 (gnat_protect_expr): Likewise.
1293 (gnat_stabilize_reference_1): Likewise.
1294 (gnat_rewrite_reference): Do not bother about operand #3 for ARRAY_REF.
1295 (get_inner_constant_reference): Likewise.
1296 (gnat_invariant_expr): Likewise.
1297 * gcc-interface/trans.c (fold_constant_decl_in_expr): Likewise.
1299 2016-05-02 Eric Botcazou <ebotcazou@adacore.com>
1301 * gcc-interface/trans.c (Range_to_gnu): New static function.
1302 (Raise_Error_to_gnu) <N_In>: Call it to translate the range.
1303 (gnat_to_gnu) <N_In>: Likewise.
1305 2016-04-30 Eric Botcazou <ebotcazou@adacore.com>
1307 * gcc-interface/Make-lang.in (ACATSCMD): New variable.
1308 (check-acats): Use it.
1309 (check_acats_targets): Likewise.
1311 2016-04-28 Eric Botcazou <ebotcazou@adacore.com>
1314 * a-textio.adb (Get_Immediate): Add missing 'not' in expression.
1316 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1318 * sem_aux.adb (Is_By_Reference_Type): Also return true for a tagged
1319 incomplete type without full view.
1320 * sem_ch6.adb (Exchange_Limited_Views): Change into a function and
1321 return the list of changes.
1322 (Restore_Limited_Views): New procedure to undo the transformation made
1323 by Exchange_Limited_Views.
1324 (Analyze_Subprogram_Body_Helper): Adjust call to Exchange_Limited_Views
1325 and call Restore_Limited_Views at the end, if need be.
1326 (Possible_Freeze): Do not delay freezing because of incomplete types.
1327 (Process_Formals): Remove kludges for class-wide types.
1328 * types.h (By_Copy_Return): Delete.
1329 * gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): Move around.
1330 (TYPE_DUMMY_IN_PROFILE_P): New macro.
1331 * gcc-interface/gigi.h (update_profiles_with): Declare.
1332 (finish_subprog_decl): Likewise.
1333 (get_minimal_subprog_decl): Delete.
1334 (create_subprog_type): Likewise.
1335 (create_param_decl): Adjust prototype.
1336 (create_subprog_decl): Likewise.
1337 * gcc-interface/decl.c (defer_limited_with): Rename into...
1338 (defer_limited_with_list): ...this.
1339 (gnat_to_gnu_entity): Adjust to above renaming.
1340 (finalize_from_limited_with): Likewise.
1341 (tree_entity_vec_map): New structure.
1342 (gt_pch_nx): New helpers.
1343 (dummy_to_subprog_map): New hash table.
1344 (gnat_to_gnu_param): Set the SLOC here. Remove MECH parameter and
1345 add FIRST parameter. Deal with the mechanism here instead of...
1346 Do not make read-only variant of types. Simplify expressions.
1347 In the by-ref case, test the mechanism before must_pass_by_ref
1348 and also TYPE_IS_BY_REFERENCE_P before building the reference type.
1349 (gnat_to_gnu_subprog_type): New static function extracted from...
1350 Do not special-case the type_annotate_only mode. Call
1351 gnat_to_gnu_profile_type instead of gnat_to_gnu_type on return type.
1352 Deal with dummy return types. Likewise for parameter types. Deal
1353 with by-reference types explicitly and add a kludge for null procedures
1354 with untagged incomplete types. Remove assertion on the types and be
1355 prepared for multiple elaboration of the declarations. Skip the whole
1356 CICO processing if the profile is incomplete. Handle the completion of
1357 a previously incomplete profile.
1358 (gnat_to_gnu_entity) <E_Variable>: Rename local variable.
1359 Adjust couple of calls to create_param_decl.
1360 <E_Access_Subprogram_Type, E_Anonymous_Access_Subprogram_Type>:
1361 Remove specific deferring code.
1362 <E_Access_Type>: Also deal with E_Subprogram_Type designated type.
1363 Simplify handling of dummy types and remove obsolete comment.
1364 Constify a couple of variables. Do not set TYPE_UNIVERSAL_ALIASING_P
1366 <E_Access_Subtype>: Tweak comment and simplify condition.
1367 <E_Subprogram_Type>: ...here. Call it and clean up handling. Remove
1368 obsolete comment and adjust call to gnat_to_gnu_param. Adjust call to
1369 create_subprog_decl.
1370 <E_Incomplete_Type>: Add a couple of 'const' qualifiers and get rid of
1371 inner break statements. Tidy up condition guarding direct use of the
1373 (get_minimal_subprog_decl): Delete.
1374 (finalize_from_limited_with): Call update_profiles_with on dummy types
1375 with TYPE_DUMMY_IN_PROFILE_P set.
1376 (is_from_limited_with_of_main): Delete.
1377 (associate_subprog_with_dummy_type): New function.
1378 (update_profile): Likewise.
1379 (update_profiles_with): Likewise.
1380 (gnat_to_gnu_profile_type): Likewise.
1381 (init_gnat_decl): Initialize dummy_to_subprog_map.
1382 (destroy_gnat_decl): Destroy dummy_to_subprog_map.
1383 * gcc-interface/misc.c (gnat_get_alias_set): Add guard for accessing
1384 TYPE_UNIVERSAL_ALIASING_P.
1385 (gnat_get_array_descr_info): Minor tweak.
1386 * gcc-interface/trans.c (gigi): Adjust calls to create_subprog_decl.
1387 (build_raise_check): Likewise.
1388 (Compilation_Unit_to_gnu): Likewise.
1389 (Identifier_to_gnu): Accept mismatches coming from a limited context.
1390 (Attribute_to_gnu): Remove kludge for dispatch table entities.
1391 (process_freeze_entity): Do not retrieve old definition if there is an
1392 address clause on the entity. Call update_profiles_with on dummy types
1393 with TYPE_DUMMY_IN_PROFILE_P set.
1394 * gcc-interface/utils.c (build_dummy_unc_pointer_types): Also set
1395 TYPE_REFERENCE_TO to the fat pointer type.
1396 (create_subprog_type): Delete.
1397 (create_param_decl): Remove READONLY parameter.
1398 (finish_subprog_decl): New function extracted from...
1399 (create_subprog_decl): ...here. Call it. Remove CONST_FLAG and
1400 VOLATILE_FLAG parameters and adjust.
1401 (update_pointer_to): Also clear TYPE_REFERENCE_TO in the unconstrained
1404 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1406 * aa_util.adb, aa_util.ads: Removed, no longer used.
1408 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1410 * sem_prag.adb (Analyze_Pragma): An object
1411 renaming declaration resulting from the expansion of an object
1412 declaration is a suitable context for pragma Ghost.
1414 2016-04-27 Doug Rupp <rupp@adacore.com>
1416 * init.c: Refine last checkin so the only requirement is the
1417 signaling compilation unit is compiled with the same mode as
1418 the compilation unit containing the initial landing pad.
1420 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1422 * sem_ch13.adb (Valid_Default_Iterator): Better filter of illegal
1423 specifications for Default_Iterator, including overloaded cases
1424 where no interpretations are legal, and return types that are
1427 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1429 * exp_ch5.adb (Expand_N_Assignment_Statement): Do not install
1430 an accessibility check when the left hand side of the assignment
1431 denotes a container cursor.
1432 * exp_util.ads, exp_util.adb (Find_Primitive_Operations): Removed.
1433 * sem_ch4.adb (Find_Indexing_Operations): New routine.
1434 (Try_Container_Indexing): Code cleanup.
1436 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1438 * sem_ch10.adb, sem_case.adb: Mark messages udner -gnatwr when needed.
1440 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1442 * errout.adb, errutil.adb: Minor reformatting.
1444 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1446 * sem_ch13.adb (Analyze_Aspect_Specifications, case Pre/Post):
1447 Check that the classwide version is illegal when the prefix is
1448 an operation of an untagged synchronized type.
1450 2016-04-27 Arnaud Charlet <charleT@adacore.com>
1452 * sinput-l.ads, sem_ch13.adb: Minor editing.
1454 2016-04-27 Doug Rupp <rupp@adacore.com>
1456 * init.c (__gnat_adjust_context_for_raise) [arm-linux thumb]:
1457 Bump the pc so the lower order bit is set.
1459 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1461 * sem_case.adb, sem_case.ads (NO_Op): If appropriate warning is
1462 enabled, report an empty range in a case construct.
1464 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1466 * sinput.ads, a-cfdlli.adb, a-crbtgo.adb, a-chtgop.adb, a-cbhama.adb,
1467 a-rbtgbo.adb, a-crdlli.adb, a-chtgbo.adb: Minor editing.
1469 2016-04-27 Bob Duff <duff@adacore.com>
1471 * a-chtgop.adb (Adjust): Zero the tampering counts on assignment,
1472 as is done for the other containers.
1474 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1476 * ghost.adb (In_Subprogram_Body_Profile): New routine.
1477 (Is_OK_Declaration): Treat an unanalyzed expression
1478 function as an OK context. Treat a reference to a Ghost entity
1479 as OK when it appears within the profile of a subprogram body.
1481 2016-04-27 Bob Duff <duff@adacore.com>
1483 * errout.ads: Document the fact that informational messages
1484 don't have to be warnings.
1485 * errout.adb (Error_Msg_Internal): In statistics counts, deal
1486 correctly with informational messages that are not warnings.
1487 (Error_Msg_NEL): Remove useless 'if' aroung Set_Posted, because
1488 Set_Posted already checks for errors and ignores others.
1489 * erroutc.adb (Prescan_Message): Set Is_Serious_Error to False
1490 if Is_Info_Msg; the previous code was assuming that Is_Info_Msg
1491 implies Is_Warning_Msg.
1492 * errutil.adb (Error_Msg): In statistics counts, deal correctly
1493 with informational messages that are not warnings.
1495 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1497 * sem_util.ads, sem_util.adb (Is_Null_Record_Type): New predicate
1498 to determine whether a record type is a null record.
1499 * sem_ch3.adb (Analyze_Object_Declaration): If the type is a
1500 null record and there is no expression in the declaration,
1501 no predicate check applies to the object.
1503 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1505 * sem_ch7.adb (Analyze_Package_Body_Helper): The body of an
1506 instantiated package should not cause freezing of previous contracts.
1508 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1510 * sem_dim.adb (Analyze_Dimension): Handle subtype declarations
1511 that do not come from source.
1512 (Analyze_Dimension_Subtype_Declaration): Allow confirming
1513 dimensions on subtype entity, either inherited from base type
1514 or provided by aspect specification.
1516 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1518 * s-gearop.ads (Matrix_Vector_Solution, Matrix_Matrix_Solution):
1519 Add scalar formal object Zero, to allow detection and report
1520 when the matrix is singular.
1521 * s-gearop.adb (Matrix_Vector_Solution, Matrix_Matrix_Solution):
1522 Raise Constraint_Error if the Forward_Eliminate pass has
1523 determined that determinant is Zero.o
1524 * s-ngrear.adb (Solve): Add actual for Zero in corresponding
1526 * s-ngcoar.adb (Solve): Ditto.
1528 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1530 * sem_ch3.adb: Minor reformatting.
1532 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1534 * sem_dim.adb (Analyze_Dimension, case N_Identifier): Check
1535 that identifier has a usable type before analysis, to handle
1536 properly identifiers introduced after some lexical/syntactic
1537 recovery that created new identifiers.
1539 2016-04-27 Bob Duff <duff@adacore.com>
1541 * a-coinve.adb, a-comutr.adb, a-conhel.adb, a-convec.adb,
1542 exp_util.adb: Remove assertions that can fail in obscure cases when
1543 assertions are turned on but tampering checks are turned off.
1545 2016-04-27 Javier Miranda <miranda@adacore.com>
1547 * exp_ch6.adb (Add_Call_By_Copy_Code,
1548 Add_Simple_Call_By_Copy_Code, Expand_Actuals): Handle formals
1549 whose type comes from the limited view.
1551 2016-04-27 Yannick Moy <moy@adacore.com>
1553 * a-textio.adb: Complete previous patch.
1555 2016-04-27 Yannick Moy <moy@adacore.com>
1557 * inline.adb (Expand_Inlined_Call): Use Cannot_Inline instead of
1558 Error_Msg_N to issue message about impossibility to inline call,
1559 with slight change of message.
1561 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1563 * exp_spark.adb (Expand_Potential_Renaming): Removed.
1564 (Expand_SPARK): Update the call to expand a potential renaming.
1565 (Expand_SPARK_Potential_Renaming): New routine.
1566 * exp_spark.ads (Expand_SPARK_Potential_Renaming): New routine.
1567 * sem.adb Add with and use clauses for Exp_SPARK.
1568 (Analyze): Expand a non-overloaded potential renaming for SPARK.
1570 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1572 * sem_ch3.adb (Constrain_Discriminated_Type): In an instance,
1573 check full view for the presence of defaulted discriminants,
1574 even when the partial view of a private type has no visible and
1575 no unknown discriminants.
1577 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1579 * lib-xref.adb, exp_ch3.adb: Minor reformatting.
1581 2016-04-27 Nicolas Roche <roche@adacore.com>
1583 * rtinit.c: Add weak symbol __gnat_do_argv_expansion.
1585 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1587 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Code
1588 cleanup. Check the original node when trying to determine the node kind
1589 of pragma Volatile's argument to account for untagged derivations
1590 where the type is transformed into a constrained subtype.
1592 2016-04-27 Olivier Hainque <hainque@adacore.com>
1594 * mkdir.c (__gnat_mkdir): Rework the vxworks section to use a
1595 consistent posix interface on the caller side.
1597 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1599 * sem_ch10.adb (Build_Limited_View, Decorate_Type): If this
1600 is a limited view of a type, initialize the Limited_Dependents
1601 field to catch misuses of the type in a client unit.
1603 2016-04-27 Thomas Quinot <quinot@adacore.com>
1605 * a-strunb-shared.adb (Finalize): add missing Reference call.
1606 * s-strhas.adb: minor grammar fix and extension of comment
1607 * sem_ch8.adb: minor whitespace fixes
1609 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1611 * lib-xref.adb (Get_Type_Reference): Handle properly the case
1612 of an object declaration whose type definition is a class-wide
1613 subtype and whose expression is a function call that returns a
1616 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1618 * sem_util.ads, sem_util.adb (Output_Entity): New routine.
1619 (Output_Name): New routine.
1621 2016-04-27 Bob Duff <duff@adacore.com>
1623 * exp_ch3.adb (Rewrite_As_Renaming): Disable previous change for now.
1625 2016-04-27 Vincent Celier <celier@adacore.com>
1627 * gnatcmd.adb: For "gnat ls -V -P", recognize switch
1628 --unchecked-shared-lib-imports and set the flag
1629 Opt.Unchecked_Shared_Lib_Imports accordingly.
1631 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1633 * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part):
1634 A generic subprogram is never a primitive operation, and thus
1635 a classwide condition for it is not legal.
1637 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1639 * sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor
1642 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1644 * sem_res.adb (Flag_Effectively_Volatile_Objects): New routine.
1645 (Resolve_Actuals): Flag effectively volatile objects with enabled
1646 property Async_Writers or Effective_Reads as illegal.
1647 * sem_util.adb (Is_OK_Volatile_Context): Comment reformatting.
1649 2016-04-27 Javier Miranda <miranda@adacore.com>
1651 * exp_ch3.adb (Make_Predefined_Primitive_Specs):
1652 Do not generate the profile of the equality operator if it has
1653 been explicitly defined as abstract in the parent type. Required
1654 to avoid reporting an spurious error.
1656 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1658 * sem_dim.ads, sem_dim.adb (Check_Expression_Dimensions): New
1659 procedure to compute the dimension vector of a scalar expression
1660 and compare it with the dimensions if its expected subtype. Used
1661 for the ultimate components of a multidimensional aggregate,
1662 whose components typically are themselves aggregates that are
1663 expanded separately. Previous to this patch, dimensionality
1664 checking on such aggregates generated spurious errors.
1665 * sem_aggr.adb (Resolve_Array_Aggregate): Use
1666 Check_Expression_Dimensions when needed.
1668 2016-04-27 Javier Miranda <miranda@adacore.com>
1670 * einfo.ads, einfo.adb (Corresponding_Function): New attribute
1671 (applicable to E_Procedure).
1672 (Corresponding_Procedure): New attribute (applicable to E_Function).
1673 * exp_util.adb (Build_Procedure_Form): Link the function with
1674 its internally built proc and viceversa.
1675 * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
1676 attribute Rewritten_For_C and Corresponding_Procedure to the body.
1677 * exp_ch6.adb (Rewritten_For_C_Func_Id): Removed.
1678 (Rewritten_For_C_Proc_Id): Removed.
1679 * exp_unst.adb (Note_Uplevel_Ref): Use the new attribute to
1680 locate the corresponding procedure.
1682 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1684 * sem_ch13.adb (Analyze_Aspect_Export_Import): Signal that there is no
1685 corresponding pragma.
1687 2016-04-27 Bob Duff <duff@adacore.com>
1689 * exp_ch3.adb: Minor comment improvement.
1691 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1693 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): If the
1694 return type is an untagged limited record with only access
1695 discriminants and no controlled components, the return value does not
1696 need to use the secondary stack.
1698 2016-04-27 Javier Miranda <miranda@adacore.com>
1700 * exp_util.adb (Remove_Side_Effects): When
1701 generating C code handle object declarations that have
1702 discriminants and are initialized by means of a call to a
1705 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1707 * a-textio.adb (Get_Line function): Handle properly the case of
1708 a line that has the same length as the buffer (or a multiple
1709 thereof) and there is no line terminator.
1710 * a-tigeli.adb (Get_Line procedure): Do not store an end_of_file
1711 in the string when there is no previous line terminator and we
1712 need at most one additional character.
1714 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1716 * s-rident.ads: Make No_Implicit_Loops non partition wide.
1718 2016-04-27 Arnaud Charlet <charlet@adacore.com>
1720 * sem_ch11.adb (Analyze_Handled_Statements): check useless
1721 assignments also in entries and task bodies, not only in
1722 procedures and declaration blocks.
1723 * sem_ch5.adb (Analyze_Block_Statement): check useless
1724 assignements in declaration blocks as part of processing their
1725 handled statement sequence, just like it was done for procedures
1726 and now is also done for entries and task bodies.
1727 * sem_warn.adb (Warn_On_Useless_Assignment): detect boundries
1728 of entries and task bodies just like of procedures.
1730 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1732 * sem_util.adb (Is_Volatile_Function): Recognize
1733 a function declared within a protected type as well as the
1734 protected/unprotected version of a function.
1736 2016-04-27 Bob Duff <duff@adacore.com>
1738 * exp_ch3.adb (Expand_N_Object_Declaration): Rewrite an object
1739 declaration of the form "X : T := Func (...);", where T is
1740 controlled, as a renaming.
1741 * a-strunb-shared.adb (Finalize): Set the Unbounded_String Object
1742 to be an empty string, instead of null-ing out the Reference.
1743 * exp_util.adb (Needs_Finalization): Remove redundant code.
1745 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1747 * aspects.ads Aspects Export and Import do not require delay. They
1748 were classified as delayed aspects, but treated as non-delayed
1749 by the analysis of aspects.
1750 * freeze.adb (Copy_Import_Pragma): New routine.
1751 (Wrap_Imported_Subprogram): Copy the import pragma by first
1752 resetting all semantic fields to avoid an infinite loop when
1753 performing the copy.
1754 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add
1755 comment on the processing of aspects Export and Import
1756 at the freeze point.
1757 (Analyze_Aspect_Convention: New routine.
1758 (Analyze_Aspect_Export_Import): New routine.
1759 (Analyze_Aspect_External_Link_Name): New routine.
1760 (Analyze_Aspect_External_Or_Link_Name): Removed.
1761 (Analyze_Aspect_Specifications): Factor out the analysis of
1762 aspects Convention, Export, External_Name, Import, and Link_Name
1763 in their respective routines. Aspects Export and Import should
1764 not generate a Boolean pragma because their corresponding pragmas
1765 have a very different syntax.
1766 (Build_Export_Import_Pragma): New routine.
1767 (Get_Interfacing_Aspects): New routine.
1769 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1771 * inline.adb (Add_Inlined_Body): Overhaul implementation,
1772 robustify handling of -gnatn1, add special treatment for
1773 expression functions.
1775 2016-04-27 Doug Rupp <rupp@adacore.com>
1777 * g-traceb.ads: Update comment.
1778 * exp_ch2.adb: minor style fix in object declaration
1780 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1782 * sem_elab.adb (Check_Internal_Call): Do not
1783 consider a call when it appears within pragma Initial_Condition
1784 since the pragma is part of the elaboration statements of a
1785 package body and may only call external subprograms or subprograms
1786 whose body is already available.
1787 (Within_Initial_Condition): New routine.
1789 2016-04-27 Ed Schonberg <schonberg@adacore.com>
1791 * exp_util.adb (Build_Procedure_Form): Prevent double generation
1792 of the procedure form when dealing with an expression function
1793 whose return type is an array.
1794 * sem_ch3.adb: Fix out-of order Has_Predicates setting.
1795 * exp_ch6.adb: Proper conversion for inherited operation in C.
1796 * sem_ch6.adb: Code cleanup.
1798 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
1800 * lib-xref.ads, sem_ch10.adb: minor style fix in comment
1801 * g-socket.adb: Minor reformatting.
1802 * sinfo.ads: Minor comment correction.
1803 * sem_warn.ads: minor grammar fix in comment
1805 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1807 * gcc-interface/gigi.h (gnat_to_gnu_entity): Adjust prototype.
1808 (maybe_pad_type): Adjust comment.
1809 (finish_record_type): Likewise.
1810 (rest_of_record_type_compilation): Likewise.
1811 * gcc-interface/decl.c (gnat_to_gnu_entity): Change DEFINITION type
1812 parameter from integer to boolean. Adjust recursive calls.
1813 <E_Subprogram_Type>: Use copy_type and remove redundant assignments.
1814 <E_Signed_Integer_Subtype>: Adjust comment. Remove call to
1815 rest_of_record_type_compilation. Set TYPE_PADDING_P flag earlier.
1816 Pass false to finish_record_type. Set the debug type later.
1817 <E_Record_Subtype>: Remove call to rest_of_record_type_compilation.
1818 (gnat_to_gnu_component_type): Fix formatting.
1819 (gnat_to_gnu_field_decl): Adjust call to gnat_to_gnu_entity.
1820 (gnat_to_gnu_type): Likewise.
1821 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
1822 (Loop_Statement_to_gnu): Likewise.
1823 (Subprogram_Body_to_gnu): Likewise.
1824 (Exception_Handler_to_gnu_fe_sjlj): Likewise.
1825 (Exception_Handler_to_gnu_gcc): Likewise.
1826 (Compilation_Unit_to_gnu): Likewise.
1827 (gnat_to_gnu): Likewise.
1828 (push_exception_label_stack): Likewise.
1829 (elaborate_all_entities_for_package): Likewise.
1830 (process_freeze_entity): Likewise.
1831 (process_decls): Likewise.
1832 (process_type): Likewise.
1833 * gcc-interface/utils.c (struct deferred_decl_context_node): Tweak.
1834 (maybe_pad_type): Adjust comments. Set the debug type later. Remove
1835 call to rest_of_record_type_compilation.
1836 (rest_of_record_type_compilation): Use copy_type.
1837 (copy_type): Use correctly typed constants.
1838 (gnat_signed_or_unsigned_type_for): Use copy_type.
1839 * gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
1840 (build_goto_raise): Adjust call tognat_to_gnu_entity.
1842 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
1844 * gcc-interface/misc.c (gnat_init): Do not call
1845 internal_reference_types.
1847 2016-04-27 Svante Signell <svante.signell@gmail.com>
1849 * gcc-interface/Makefile.in (x86 GNU/Hurd): Use s-osinte-gnu.adb.
1850 * s-osinte-gnu.ads: Small tweaks.
1851 * s-osinte-gnu.adb: New file.
1853 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
1855 * sem_prag.adb (Match_Constituent): Treat a constant as a legal
1856 constituent even if it is not to prevent spurious errors.
1858 2016-04-21 Gary Dismukes <dismukes@adacore.com>
1860 * sem_ch4.adb: Minor typo fixes and reformatting.
1862 2016-04-21 Dmitriy Anisimkov <anisimko@adacore.com>
1864 * g-calend.ads (No_Time): The same value in any timezone.
1865 * g-socket.adb (Raise_Host_Error): Remove ending
1866 dot from original error message before append colon delimited
1869 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
1871 * sem_ch3.adb: Code cleanup.
1872 * sem_ch6.adb: Code cleanup.
1873 (Is_Matching_Limited_View): New routine.
1874 (Matches_Limited_With_View): Reimplemented.
1875 * sem_ch10.adb (Decorate_Type): Code cleanup.
1877 2016-04-21 Doug Rupp <rupp@adacore.com>
1879 * tracebak.c (PPC ELF): Add macro defs for lynxos178e.
1881 2016-04-21 Ed Schonberg <schonberg@adacore.com>
1883 * sem_ch4.adb (Try_Container_Indexing): If there are overloaded
1884 indexing functions, collect all overloadings of the call firts,
1885 and then transfer them to indexing node, to prevent interleaving
1886 of the set of interpretations of the nodes involved.
1887 * sem_res.adb (Resolve): Suppress cascaded errors that report
1888 ambiguities when one of the actuals in an overloaded generatlized
1889 indexing operation is illegal and has type Any_Type, as is done
1890 for similar cascaded errors in subprogram calls.
1891 (Valid_Tagged_Conversion): Cleanup conversion checks when one
1892 of the types involved is a class-wide subtype.
1894 2016-04-21 Ed Schonberg <schonberg@adacore.com>
1896 * sem_ch12.adb (Load_Parent_Of_Generic): When looking for the
1897 subprogram declaration within a wrapper package, skip pragmas
1898 that may have been generated by aspect specifications on the
1901 2016-04-21 Javier Miranda <miranda@adacore.com>
1903 * exp_aggr.adb (Component_Not_OK_For_Backend): Generating C
1904 code return True for array identifiers since the backend needs
1905 to initialize such component by means of memcpy().
1907 2016-04-21 Arnaud Charlet <charlet@adacore.com>
1909 * a-tasatt.adb, a-tasatt.ads (Fast_Path): Rewritten to avoid reading
1910 potentially uninitialized memory.
1911 * sem_ch3.adb: Minor style fix in comment.
1913 2016-04-21 Arnaud Charlet <charlet@adacore.com>
1915 * gnat_rm.texi, gnat_ugn.texi,
1916 doc/gnat_ugn/gnat_project_manager.rst,
1917 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
1918 doc/gnat_ugn/gnat_and_program_execution.rst,
1919 doc/gnat_ugn/gnat_utility_programs.rst,
1920 doc/gnat_ugn/the_gnat_compilation_model.rst,
1921 doc/gnat_rm/implementation_defined_attributes.rst,
1922 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
1923 doc/gnat_rm/implementation_defined_pragmas.rst,
1924 doc/gnat_rm/the_gnat_library.rst,
1925 doc/gnat_rm/implementation_defined_aspects.rst: Update doc.
1926 * doc/Makefile: Cleanups.
1928 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
1930 * exp_pakd.adb, sem_ch13.adb: Minor reformatting.
1932 2016-04-21 Ed Schonberg <schonberg@adacore.com>
1934 * exp_dbug.adb, exp_dbug.ads (Qualify_Entity_Name): Add suffixes to
1935 disambiguate local variables that may be hidden from inner visibility
1936 by nested block declarations or loop variables.
1938 2016-04-21 Jerome Lambourg <lambourg@adacore.com>
1940 * s-soflin.adb: Initialize the Stack_Limit global variable.
1942 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
1944 * lib-writ.adb: Minor reformatting.
1946 2016-04-21 Ed Schonberg <schonberg@adacore.com>
1948 * exp_pakd.adb (Compute_Number_Components): New function to
1949 build an expression that computes the number of a components of
1950 an array that may be multidimensional.
1951 (Expan_Packed_Eq): Use it.
1953 2016-04-21 Arnaud Charlet <charlet@adacore.com>
1955 * g-traceb.ads: Update list of supported platforms.
1957 2016-04-21 Ed Schonberg <schonberg@adacore.com>
1959 * sem_ch13.adb (Add_Predicates): if the type is declared in
1960 an inner package it may be frozen outside of the package, and
1961 the generated pragma has not been analyzed yet, the expression
1962 for the predicate must be captured and added to the predicate
1963 function at this point.
1965 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
1967 * contracts.adb (Analyze_Package_Body_Contract): Do not check
1968 for a missing package refinement because 1) packages do not have
1969 "refinement" and 2) the check for proper state refinement is
1970 performed in a different place.
1971 * einfo.adb (Has_Non_Null_Visible_Refinement): Reimplemented.
1972 (Has_Null_Visible_Refinement): Reimplemented.
1973 * sem_ch3.adb (Analyze_Declarations): Determine whether all
1974 abstract states have received a refinement and if not, emit
1976 * sem_ch7.adb (Analyze_Package_Declaration): Code
1977 cleanup. Determine whether all abstract states of the
1978 package and any nested packages have received a refinement
1979 and if not, emit errors.
1980 (Requires_Completion_In_Body): Add new formal parameter
1981 Do_Abstract_States. Update the comment on usage. Propagate the
1982 Do_Abstract_States flag to all Unit_Requires_Body calls.
1983 (Unit_Requires_Body): Remove formal
1984 parameter Ignore_Abstract_States. Add new formal paramter
1985 Do_Abstract_States. Propagate the Do_Abstract_States flag to
1986 all Requires_Completion_In calls.
1987 * sem_ch7.ads (Unit_Requires_Body): Remove formal
1988 parameter Ignore_Abstract_States. Add new formal paramter
1989 Do_Abstract_States. Update the comment on usage.
1990 * sem_ch9.adb (Analyze_Single_Protected_Declaration): Do
1991 not initialize the constituent list as this is now done on a
1992 need-to-add-element basis.
1993 (Analyze_Single_Task_Declaration):
1994 Do not initialize the constituent list as this is now done on
1995 a need-to-add-element basis.
1996 * sem_ch10.adb (Decorate_State): Do not initialize the constituent
1997 lists as this is now done on a need-to-add-element basis.
1998 * sem_prag.adb (Analyze_Constituent): Set the
1999 refinement constituents when adding a new element.
2000 (Analyze_Part_Of_In_Decl_Part): Set the Part_Of constituents when
2001 adding a new element.
2002 (Analyze_Part_Of_Option): Set the Part_Of
2003 constituents when adding a new element.
2004 (Analyze_Pragma): Set the Part_Of constituents when adding a new
2006 (Check_Constituent_Usage (all versions)): Reimplemented.
2007 (Collect_Constituent): Set the refinement constituents when adding
2009 (Create_Abstract_State): Do not initialize the
2010 constituent lists as this is now done on a need-to-add-element basis.
2011 (Propagate_Part_Of): Set the Part_Of constituents when
2012 adding a new element.
2013 * sem_util.adb (Check_State_Refinements): New routine.
2014 (Has_Non_Null_Refinement): Reimplemented.
2015 (Has_Null_Refinement): Reimplemented.
2016 (Requires_State_Refinement): Removed.
2017 * sem_util.ads (Check_State_Refinements): New routine.
2018 (Requires_State_Refinement): Removed.
2020 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2022 * lib-writ.adb, sem_ch6.adb: Minor reformatting and code cleanup.
2023 * sem.adb: Fix comment.
2025 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2027 * sem_ch3.adb (Analyze_Subtype_Declaration): A subtype
2028 declaration with no aspects, whose subtype_mark is a subtype
2029 with predicates, inherits the list of subprograms for the type.
2031 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2033 * exp_aggr.adb (Has_Per_Object_Constraint): Refine previous
2036 2016-04-21 Thomas Quinot <quinot@adacore.com>
2038 * g-socket.adb (Raise_Host_Error): Include additional Name parameter.
2040 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2042 * lib-writ.adb (Write_ALI): Do not record in ali file units
2043 that are present in the files table but not analyzed. These
2044 units are present because they appear in the context of units
2045 named in limited_with clauses, and the unit being compiled does
2046 not depend semantically on them.
2048 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2050 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Simplify code to
2051 create the procedure body for an function returning an array type,
2052 when generating C code. Reuse the subprogram body rather than
2053 creating a new one, both as an efficiency measure and because
2054 in an instance the body may contain global references that must
2057 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2059 * sem_ch3.adb, exp_attr.adb, exp_ch6.adb, exp_aggr.adb: Minor
2062 2016-04-21 Javier Miranda <miranda@adacore.com>
2064 * exp_aggr.adb (Component_Check): Extend
2065 the check that verifies that the aggregate has no function
2066 calls to handle transformations performed by the frontend.
2067 (Ultimate_Original_Expression): New subprogram.
2069 2016-04-21 Philippe Gil <gil@adacore.com>
2071 * krunch.adb (Krunch): Fix krunching of i-java.
2073 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2075 * exp_ch8.adb (Evaluation_Required): Always return
2076 True when Modify_Tree_For_C.
2078 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2080 * gnatlink.adb (Gnatlink): Robustify detection of Windows target.
2081 * alloc.ads: Minor comment fixes.
2082 * einfo.ads: Fix typo.
2084 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2086 * exp_aggr.adb (Component_Not_OK_For_Backend): Redo previous
2087 changes to handle all cases of components depending on the
2088 discriminant, not just string literals.
2090 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2092 * sem_ch3.adb (Analyze_Subtype_Declaration): If the subtype
2093 declaration is the generated declaration for a generic actual,
2094 inherit predicates from the actual if it is a predicated subtype.
2096 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2098 * exp_ch6.adb (Rewrite_Function_Call_For_C): If the function is
2099 inherited and its result is controlling, introduce a conversion
2100 on the actual for the corresponding procedure call, to avoid
2101 spurious type errors.
2103 2016-04-21 Jerome Lambourg <lambourg@adacore.com>
2105 * krunch.adb (Krunch): Fix krunching of i-vxworks.
2107 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2109 * exp_aggr.adb: Minor reformatting and code cleanup.
2111 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2113 * sem_ch13.adb (Resolve_Name): Omit quantified expressions from
2114 resolution, because they introduce local names. Full resolution
2115 will take place when predicate function is constructed.
2117 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2119 * exp_aggr.adb (Component_Not_OK_For_Backend): Refine previous
2120 change to take into account Per_Object_Constraint field rather
2121 than special casing strings.
2122 * exp_ch6.adb: Fix typo in Replace_Returns.
2124 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2126 * sem_ch5.adb: Minor reformatting.
2128 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2130 * exp_aggr.adb (Backend_Processing_Possible): Return False
2131 when generating C and aggregate contains function calls.
2133 2016-04-21 Tristan Gingold <gingold@adacore.com>
2135 * krunch.adb (Krunch): Only partially krunch children of
2136 Interfaces that aren't known.
2138 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2140 * sem_prag.adb (Make_Inline): Handle properly the instantiation
2141 of a generic subpprogram that carries an Inline aspect. Place
2142 inline info on the anonymous subprogram that is constructed in
2143 the wrapper package.
2144 (Analyze_Pragma, case Pure): Do not check placement if pragma
2145 appears within an instantiation, which can be nested at any level.
2146 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not copy Freeze
2147 node from anonymous subprogram to its visible renaming. The
2148 freeze node will be constructed if the subprogram carries
2150 (Set_Global): Preserve dimension information if present (from
2153 2016-04-21 Vasiliy Fofanov <fofanov@adacore.com>
2155 * gnatlink.adb: Change wording of the warning message on
2156 problematic filenames to be more neutral. Add a new substring
2157 "patch" introduced on Windows 10.
2159 2016-04-21 Philippe Gil <gil@adacore.com>
2161 * tracebak.c (__gnat_backtrace): handle bad RIP values (win64 only)
2163 2016-04-21 Javier Miranda <miranda@adacore.com>
2165 * exp_aggr.adb (Component_Not_OK_For_Backend): Return true for string
2168 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2170 * einfo.adb (Has_Non_Null_Abstract_State): New routine.
2171 * einfo.ads New synthesized attribute
2172 Has_Non_Null_Abstract_State along with occurrences in entities.
2173 (Has_Non_Null_Abstract_State): New routine.
2174 * sem_ch7.adb (Unit_Requires_Body): Add local variable
2175 Requires_Body. A package declaring an abstract state requires
2176 a body only when the state is non-null and the package contains
2177 at least one other construct that requires completion in a body.
2178 * sem_util.adb (Mode_Is_Off): Removed.
2179 (Requires_State_Refinement): Remove an obsolete check. Code
2182 2016-04-21 Bob Duff <duff@adacore.com>
2184 * sem_attr.adb (Analyze_Attribute): In processing
2185 the 'Old attribute, a warning is given for infinite recursion. Fix
2186 the code to not crash when the prefix of 'Old denotes a protected
2188 * sem_ch5.adb (Analyze_Iterator_Specification):
2189 Avoid calling Is_Dependent_Component_Of_Mutable_Object in cases
2190 where the parameter would not be an object.
2192 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2194 * sem_eval.adb (Compile_Time_Compare): Be prepared for an empty
2195 Etype or Underlying_Type of the operands.
2197 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2199 * atree.adb (Print_Statistics): Protect against overflows and
2200 print the memory consumption in bytes.
2201 * table.adb (Reallocate): Do the intermediate calculation of the new
2202 size using the Memory.size_t type.
2204 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2206 * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
2207 expansion of Attribute_Machine and Attribute_Model for AAMP.
2209 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2211 * freeze.adb: Disable previous change for now.
2213 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2215 * sem_ch8.adb (Find_Selected_Component): If prefix has an
2216 access type and designated type is a limited view, introduce
2217 an explicit dereference before continuing the analysis, and
2218 set its type to the non-limited view of the designated type,
2219 if we are in context where it is available.
2221 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2223 * freeze.adb: Freeze profile in ASIS mode.
2225 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2227 * sem_aux.ads, sem_aux.adb (Has_Rep_Item): New variant.
2228 * sem_util.adb (Inherit_Rep_Item_Chain): Reimplemented.
2230 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2232 * exp_ch6.adb: Minor reformatting.
2234 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2236 * sem_ch13.adb: Minor comment update.
2238 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2240 * freeze.ads, freeze.adb (Freeze_Entity, Freeze_Before): Add
2241 boolean parameter to determine whether freezing an overloadable
2242 entity freezes its profile as well. This is required by
2243 AI05-019. The call to Freeze_Profile within Freeze_Entity is
2244 conditioned by the value of this flag, whose default is True.
2245 * sem_attr.adb (Resolve_Attribute, case 'Access): The attribute
2246 reference freezes the prefix, but it the prefix is a subprogram
2247 it does not freeze its profile.
2249 2016-04-21 Javier Miranda <miranda@adacore.com>
2251 * exp_util.adb (Build_Procedure_Form): No action needed for
2252 subprogram renamings since the backend can generate the call
2253 using the renamed subprogram. This leaves the tree more clean
2255 * exp_ch6.adb (Expand_Call): Extend previous patch for
2256 rewritten-for-c entities to handle subprogram renamings.
2257 (Rewrite_Function_Call_For_C): Handle subprogram renamings.
2259 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2261 * sem_ch13.adb: Code cleanup.
2263 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2265 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If the body is
2266 created for SPARK_To_C, the entity must remain invisible so it
2267 does not overload subsequent references to the original function.
2268 * exp_ch6.adb (Build_Procedure_Body_Form, Replace_Returns):
2269 Handle Extended_Return_Statements by replacing it with a block
2270 with assignments and a simple return statement.
2271 * exp_util.adb (Build_Procedure_Form): Make procedure entity
2272 invisible after analyzing declaration, to prevent improper
2275 2016-04-21 Javier Miranda <miranda@adacore.com>
2277 * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
2278 attribute Rewritten_For_C to the body since since the expander
2279 may generate calls using that entity.
2280 * exp_ch6.adb (Expand_Call): For internally generated
2281 calls ensure that they reference the entity of the spec
2282 of the called function.
2283 (Rewritten_For_C_Func_Id): New subprogram.
2284 (Rewritten_For_C_Proc_Id): New subprogram.
2285 (Rewrite_Function_Call_For_C): Invoke the new subprogram to
2286 ensure that we skip freezing entities.
2287 * exp_util.adb (Build_Procedure_Form): No action needed if the
2288 procedure was already built.
2290 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2292 * sem_ch3.adb, exp_util.adb, sem_ch13.adb, exp_unst.adb: Minor
2295 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2297 * sem_util.adb (Denotes_Iterator): Use root type to determine
2298 whether the ultimate ancestor is the predefined iterator
2300 * exp_ch5.adb (Expand_Iterator_Over_Container): simplify code
2301 and avoid reuse of Pack local variable.
2303 2016-04-21 Olivier Hainque <hainque@adacore.com>
2305 * system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
2306 system-vxworks-ppc.ads, system-vxworks-m68k.ads,
2307 system-vxworks-mips.ads, system-vxworks-x86.ads: Define
2308 Executable_Extension to ".out".
2310 2016-04-21 Javier Miranda <miranda@adacore.com>
2312 * frontend.adb: Update call to Unnest_Subprograms.
2313 * exp_ch6.ads, exp_ch6.adb, exp_unst.ads, exp_unst.adb
2314 (Unnest_Subprograms): Moved to package exp_unst.
2315 * exp_unst.ads (Unnest_Subprogram): Moved to the body of the
2317 * exp_dbug.adb (Qualify_Entity_Name): Enable qualification of
2318 enumeration literals when generating C code.
2320 2016-04-21 Javier Miranda <miranda@adacore.com>
2322 * frontend.adb: Remove call to initialize Exp_Ch6.
2323 * exp_ch6.ads, exp_ch6.adb (Initialize): removed.
2324 (Unest_Entry/Unest_Bodies): Removed.
2325 (Unnest_Subprograms): Code cleanup.
2327 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2329 * set_targ.adb (Read_Target_Dependent_Values):
2330 close target description file once its contents is read.
2331 * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File
2332 and Stderr_File): Close local file descriptors before spawning
2334 * exp_util.adb (Containing_Package_With_Ext_Axioms): Limit scope of
2335 local variables to make the code easier to understand and avoid
2336 duplicated calls to Parent and Generic_Parent.
2338 2016-04-20 Bob Duff <duff@adacore.com>
2340 * s-os_lib.ads: Minor comment fix.
2342 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2344 * exp_ch5.adb (Expand_N_Assignment_Statement): Do no generate
2345 a discriminant check for a type whose partial view has unknown
2346 discriminants when the full view has discriminants with defaults.
2348 2016-04-20 Javier Miranda <miranda@adacore.com>
2350 * exp_util.adb (Remove_Side_Effects): When generating C code
2351 remove side effect of type conversion of access to unconstrained
2353 (Side_Effect_Free): Return false for the type
2354 conversion of access to unconstrained array type when generating
2356 * sem_res.adb (Resolved_Type_Conversion): Remove side effects
2357 of access to unconstrained array type conversion when generating
2360 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2362 * sem_ch13.adb (Build_Predicate_Function_Declaration): New
2363 function, to construct the declaration of a predicate function
2364 at the end of the current declarative part rather than at the
2365 (possibly later) freeze point of the type. This also allows uses
2366 of a type with predicates in instantiations elsewhere.
2367 (Resolve_Aspect_Expression): New procedure to detect visiblity
2368 errors in aspect expressions, at the end of the declarative part
2369 that includes the type declaration.
2370 * sem_ch3.adb (Complete_Private_Subtype): Propagate properly the
2371 predicate function from private to full view.
2372 * einfo.adb (Predicate_Function): Refine search for predicate
2373 function when type has a full view and predicate function may
2374 be defined on either view.
2376 2016-04-20 Javier Miranda <miranda@adacore.com>
2378 * frontend.adb: Passing the root of the tree to
2379 Unnest_Subprograms().
2380 * exp_ch6.adb (Expand_N_Subprogram_Body): Remove code that
2381 took care of adding subprograms to the Unest_Bodies table since
2382 performing such action too early disables the ability to process
2383 generic instantiations.
2384 (Unnest_Subprograms): Adding parameter.
2385 (Search_Unnesting_Subprograms): New subprogram.
2386 * exp_ch6.ads (Unnest_Subrograms): Update documentation.
2388 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2390 * exp_util.adb, freeze.adb, sem_util.adb: Minor reformatting.
2392 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2394 * exp_unst.adb (Check_Static_Type): For a private type, check
2397 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2399 * sem_attr.adb (Check_Type): Reject an attribute reference in
2400 an aspect expression, when the prefix of the reference is the
2401 current instance of the type to which the aspect applies.
2403 2016-04-20 Bob Duff <duff@adacore.com>
2405 * sem_ch6.adb (Enter_Overloaded_Entity): Do not warn about
2406 hiding unless we're actually hiding something. The previous
2407 code would (for example) warn about a "<" on a record type
2408 because it incorrectly thought it was hiding the "<" on Boolean
2409 in Standard. We need to check that the homonym S is in fact a
2410 homograph of a predefined operator.
2412 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2414 * exp_util.ads, exp_util.adb (Build_Procedure_Form): Moved here
2415 from exp_ch6.adb, for use in SPARK_To_C mode when creating the
2416 procedure equivalent to a function returning an array, when this
2417 construction is deferred to the freeze point of the function.
2418 * sem_util.adb (Is_Unchecked_Conversion_Instance): Include a
2419 function that renames an instance of Unchecked_Conversion.
2420 * freeze.adb (Freeze_Subprogram): Generate the proper procedure
2421 declaration for a function returning an array.
2422 * exp_ch6.adb (Build_Procedure_Form): Moved to exp_util.
2424 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2426 * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute):
2427 New predicate to determine that in a context with full run-time,
2428 a function call is an expansion of a reference to attribute
2430 * sem_ch5.adb (Analyze_Function_Call): use it.
2431 * exp_ch5.adb (Expand_N_Subprogram_Call): use it.
2433 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2435 * einfo.adb Flag286 is now used as Is_Exception_Handler.
2436 (Is_Exception_Handler): New routine.
2437 (Set_Is_Exception_Handler): New routine.
2438 (Write_Entity_Flags): Output the status of Is_Exception_Handler.
2439 * einfo.ads New attribute Is_Exception_Handler along with
2440 occurrences in entities.
2441 (Is_Exception_Handler): New routine along with pragma Inline.
2442 (Set_Is_Exception_Handler): New routine along with pragma Inline.
2443 * exp_ch7.adb (Make_Transient_Block): Ignore blocks generated
2444 for exception handlers with a choice parameter.
2445 * sem_ch11.adb (Analyze_Exception_Handlers): Mark the scope
2446 generated for a choice parameter as an exception handler.
2448 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2450 * sem_ch3.adb (Build_Derived_Access_Type): Remove dead code.
2451 (Constrain_Discriminated_Type): In an instance, if the type has
2452 unknown discriminants, use its full view.
2453 (Process_Subtype): Check that the base type is private before
2454 adding subtype to Private_Dependents list.
2456 2016-04-20 Bob Duff <duff@adacore.com>
2458 * sem_ch13.adb: Minor comment fix.
2460 2016-04-20 Yannick Moy <moy@adacore.com>
2462 * sem_ch4.adb: Fix typos in comments.
2463 * sem_res.adb (Resolve_Case_Expression): Fix type of case alternatives.
2465 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2467 * sem_ch4.adb (Analyze_Selected_Component): A reference to the
2468 current instance of a task type is legal if the prefix is an
2469 expression of that task type and the selector is an entry or
2472 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2474 * a-cfdlli.ads (List): Type is no longer tagged, not needed. Move
2475 varsize field at the end for efficiency.
2477 2016-04-20 Vincent Celier <celier@adacore.com>
2479 * gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
2480 ls" includes the switch -V.
2481 * clean.adb: "<target>-gnatclean -P" now calls "gprclean
2483 * make.adb: "<target>-gnatmake -P" now calls "gprbuild
2486 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2488 * sem_ch12.adb (Qualify_Type): Do not perform
2489 partial qualification when the immediate scope is a generic unit.
2491 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2493 * exp_unst.adb: Minor reformatting.
2495 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2497 * exp_ch4.adb (Expand_Allocator_Expression): Ensure that the
2498 tag assignment and adjustment preceed the accessibility check.
2499 * exp_ch7.adb (Is_Subprogram_Call): Reimplemented.
2501 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2503 * exp_prag.adb (Expand_Attributes): Ensure that
2504 the temporary used to capture the value of attribute 'Old's
2505 prefix is properly initialized.
2507 2016-04-20 Javier Miranda <miranda@adacore.com>
2509 * exp_unst.ads, exp_unst.adb (Get_Level, Subp_Index): Moved to library
2512 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2514 * sem_ch9.adb (Analyze_Task_Type_Declaration): Shut down warning
2517 2016-04-20 Vincent Celier <celier@adacore.com>
2519 * make.adb: Code cleanup.
2521 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2523 * exp_ch4.adb (Expand_Allocator_Expression): Help C code
2526 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2528 * sem_ch12.adb (Copy_Generic_Node): Handle the special
2529 qualification installed for universal literals that act as
2530 operands in binary or unary operators. (Qualify_Operand): Mark
2531 the qualification to signal the instantiation mechanism how to
2532 handle global reference propagation.
2533 * sinfo.adb (Is_Qualified_Universal_Literal): New routine.
2534 (Set_Is_Qualified_Universal_Literal): New routine.
2535 * sinfo.ads New attribute Is_Qualified_Universal_Literal along
2536 with occurrences in nodes.
2537 (Is_Qualified_Universal_Literal):
2538 New routine along with pragma Inline.
2539 (Set_Is_Qualified_Universal_Literal): New routine along with
2542 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2544 * sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length
2545 so that the corresponding checks are preserved across compilations
2546 that include System.Constants in their context.
2548 2016-04-20 Gary Dismukes <dismukes@adacore.com>
2550 * sem_type.adb: Minor typo fix and reformatting.
2551 * a-conhel.ads: Update comment.
2553 2016-04-20 Bob Duff <duff@adacore.com>
2555 * a-cihama.adb, a-cihase.adb, a-coinve.adb (Copy): Rewrite the
2556 code so it doesn't trigger an "uninit var" warning.
2558 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2560 * sem_attr.ads Add new table Universal_Type_Attribute.
2561 * sem_util.adb (Yields_Universal_Type): Use a table lookup when
2562 checking attributes.
2564 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2566 * exp_aggr.adb (Init_Stored_Discriminants,
2567 Init_Visible_Discriminants): New procedures, subsidiary of
2568 Build_Record_Aggr_Code, to handle properly the construction
2569 of aggregates for a derived type that constrains some parent
2570 discriminants and renames others.
2572 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2574 * sem_ch12.adb (Qualify_Universal_Operands): New routine.
2575 (Save_References_In_Operator): Add explicit qualifications in
2576 the generic template for all operands of universal type.
2577 * sem_type.adb (Disambiguate): Update the call to Matches.
2578 (Matches): Reimplemented.
2579 * sem_util.ads, sem_util.adb (Yields_Universal_Type): New routine.
2581 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2583 * sem_ch13.adb (Rep_Item_Too_Late): Better error message for
2584 an illegal aspect that freezes the entity to which it applies.
2586 2016-04-20 Bob Duff <duff@adacore.com>
2588 * a-stwibo.ads, a-stzbou.ads
2589 ("="): Add overriding keyword before function to avoid crash when
2590 compiler is called with -gnatyO (check overriding indicators).
2592 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2594 * sem_prag.adb (Analyze_Pragma, case Check_Policy): If this
2595 is a configuration pragma and it uses the ARG syntax, insert
2596 the rewritten pragma after the current one rather than using
2599 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2601 * exp_aggr.adb (Backend_Processing_Possible): Add handling of
2604 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2606 * s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb,
2607 s-imglli.adb: Minor reformatting.
2609 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2611 * sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the
2612 renamed operator when the associated node appears within a
2614 * sem_util.ads, sem_util.adb (In_Pre_Post_Condition): New routine.
2616 2016-04-20 Yannick Moy <moy@adacore.com>
2618 * osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix.
2619 * einfo.adb (Set_Overridden_Operation): Add assertion.
2620 * sem_util.adb (Unique_Entity): for renaming-as-body return the spec
2623 2016-04-20 Javier Miranda <miranda@adacore.com>
2625 * exp_unst.adb (Append_Unique_Call): New subprogram.
2626 (Unnest_Subprogram): Replace the unique occurrence
2627 of Call.Append() by Append_Unique_Call() which protects us from
2628 adding to the Calls table duplicated entries.
2630 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2632 * exp_attr.adb (Is_GCC_Target): Fix for C backend.
2633 * xref_lib.ads (Dependencies_Tables): instantiate
2634 Table package with types that guarantee its safe use.
2635 * s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested
2638 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2640 * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]):
2641 Disable expansion when generating C code.
2642 * sinfo.ads, inline.ads: Minor editing.
2644 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2646 * sem_util.adb, contracts.adb, ghost.adb, exp_ch6.adb: Minor
2649 2016-04-20 Javier Miranda <miranda@adacore.com>
2651 * contracts.adb (Build_Postconditions_Procedure): Code cleanup.
2652 * ghost.adb (Os_OK_Ghost_Context.Is_OK_Declaration): Handle the
2653 declaration of the internally built _postcondition procedure.
2655 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2657 * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
2659 * sem_util.adb (Is_Unchecked_Conversion_Instance):
2660 defense against library-level renamings of other functions,
2661 which are never instances of Unchecked_Conversion.
2662 * einfo.ads: minor fix of casing in comment
2664 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2666 * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
2667 that has been analyzed and expanded already. Qualify the names
2668 in the proper body for use in the generation of C code.
2670 2016-04-20 Javier Miranda <miranda@adacore.com>
2672 * contracts.adb (Build_Postconditions_Procedure): Force its
2673 inlining when generating C code.
2674 * sem_attr.adb (Analyze_Attribute_Old_Result): Handle inlined
2675 _postconditions when generating C code.
2676 * exp_ch6.adb (Inlined_Subprogram): Inline calls to
2677 _postconditions when generating C code.
2678 * sinfo.ads, sinfo.adb (Corresponding_Spec, Set_Corresponding_Spec):
2679 types of return value and argument changed from Node_Id to
2682 2016-04-20 Vincent Celier <celier@adacore.com>
2684 * make.adb, clean.adb, gnatname.adb: Revert previous change for now.
2686 2016-04-20 Eric Botcazou <ebotcazou@adacore.com>
2688 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
2689 the Has_Delayed_Freeze flag on the anonymous instance node.
2691 2016-04-20 Javier Miranda <miranda@adacore.com>
2693 * sem_ch5.adb (Analyze_Iterator_Specification): Remove transient
2694 scope associated with the renaming object declaration.
2695 * exp_util.adb (Insert_Actions): Remove handling of iterator
2696 loop marked as requiring the secondary stack.
2698 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2700 * sem_attr.adb (Analyze_Attribute, case 'Image): Implement
2701 AI12-0124, which extends the functionality of the attribute so it
2702 reflects the semantics of GNAT 'Img when applied to scalar types.
2703 * lib-xref.adb: minor whitespace layout fix.
2705 2016-04-20 Vincent Celier <celier@adacore.com>
2707 * clean.adb (Gnatclean): Fail if project file specified and
2708 gprclean is not available.
2709 * gnatname.adb: Fail is -P is used and gprname is not available.
2710 * make.adb (Initialize): Fail if project file specified and
2711 gprbuild is not available.
2713 2016-04-20 Bob Duff <duff@adacore.com>
2715 * sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary
2716 stack when possible.
2718 2016-04-20 Gary Dismukes <dismukes@adacore.com>
2720 * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
2723 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2725 * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
2726 If the pragma comes from an aspect specification, verify that
2727 the aspect applies to an entity with a declarative part.
2728 * exp_ch5.adb: Code cleanup.
2730 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2732 * sem_res.adb (Resolve_If_Expression): If first expression is
2733 universal, resolve subsequent ones with the corresponding class
2734 type (Any_Integer or Any_Real).
2736 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2738 * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
2739 disabled, complete the analysis of the iterator name to ensure
2740 that reference for entities within are properly generated.
2742 2016-04-20 Arnaud Charlet <charlet@adacore.com>
2744 * a-dispat.ads (Yield): add Global contract.
2745 * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
2746 * a-taside.adb: Added Initializes => Tasking_State.
2748 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2750 * sem_ch13.adb (Build_Invariant_Procedure):
2751 Reimplement the invariant procedure spec and body insertion.
2753 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
2755 * sem_ch13.adb (Add_Invariant): Do not replace
2756 the saved expression of an invariatn aspect when inheriting
2757 a class-wide type invariant as this clobbers the existing
2758 expression. Do not use New_Copy_List as it is unnecessary
2759 and leaves the parent pointers referencing the wrong part of
2760 the tree. Do not replace the type references for ASIS when
2761 inheriting a class-wide type invariant as this clobbers the
2762 existing replacement.
2764 2016-04-20 Ed Schonberg <schonberg@adacore.com>
2766 * sem_util.adb (Build_Explicit_Dereference): If the designated
2767 expression is an entity name, generate reference to the entity
2768 because it will not be resolved again.
2770 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2772 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
2773 gnat_rm.texi: Update documentation.
2775 2016-04-19 Olivier Hainque <hainque@adacore.com>
2777 * par_sco.adb (Traverse_One, case N_Case_Statement):
2778 Skip pragmas before the first alternative.
2779 (Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.
2781 2016-04-19 Tristan Gingold <gingold@adacore.com>
2783 * adaint.c (__gnat_lwp_self): New function (for darwin).
2784 * s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
2787 2016-04-19 Olivier Hainque <hainque@adacore.com>
2789 * sem_util.adb (Build_Elaboration_Entity): Always request an
2790 elab counter when preserving control-flow.
2792 2016-04-19 Olivier Hainque <hainque@adacore.com>
2794 * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set
2795 Needs_Debug_Info when producing SCOs.
2796 * par_sco.adb (Traverse_Aspects): Fix categorization of
2797 Type_Invariant to match actual processing as activated depending
2798 on pragma Assertion_Policy.
2799 * sem_prag.adb (Analyze_Pragma): Remove special case for
2800 Name_Invariant regarding SCO generation, which completely disabled
2801 the production of SCOs for Invariant pragmas and aspects.
2803 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
2805 * checks.adb, sem_util.adb, sem_res.adb, sem_attr.adb: Minor
2808 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2810 * freeze.adb (Freeze_Profile): Refine predicate that checks
2811 whether a function that returns a limited view is declared in
2812 another unit and cannot be frozen at this point.
2814 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2816 * exp_aggr.adb (Component_Count): Handle properly superflat
2817 arrays, i.e. empty arrays where Hi < Lo - 1, to ensure that the
2818 return value of the function is Natural, rather than leaving
2819 the handling of such arrays to the caller of this function.
2821 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2823 * sem_prag.adb, sem_attr.adb, par-prag.adb, exp_aggr.adb, sem_type.adb
2824 sem_ch12.adb, sem_ch3.adb, exp_ch7.adb, exp_ch9.adb: Code cleanup.
2825 * sem_res.adb, sem_util.ads, sem_util.adb (Is_OK_Volatile_Context):
2826 Promoted from being a nested subprogram in Sem_Res.Resolve_Entity_Name
2827 to publicly visible routine in Sem_Util.
2829 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2831 * checks.adb (Apply_Parameter_Aliasing_Checks): Do not apply
2832 the check if the type of the actual is By_Reference.
2834 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2836 * sem_res.adb (Within_Subprogram_Call): Detect
2837 also nodes that appear in entry calls.
2838 (Resolve_Actuals, Insert_Default): Propagate
2839 dimension information if any, from default expression to the
2840 copy that appears in the list of actuals.
2841 * uintp.ads: minor whitespace fix in comment.
2842 * sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
2844 * set_targ.adb (Set_Targ): convert directly from
2845 Natural to Pos, without intermediate conversion to Int.
2847 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2849 * sem_ch6.adb (Process_Formals): Mark suspicious reference to
2850 SPARK RM in comment.
2851 * sem_prag.adb (Analyze_Global_Item): Fix reference to SPARK RM
2853 * sem_res.adb (Property_Error, Resolve_Actuals): Fix reference
2854 to SPARK RM in both comment and error message.
2856 2016-04-19 Eric Botcazou <ebotcazou@adacore.com>
2858 * sem_ch6.adb (Possible_Freeze): If the type is an incomplete
2859 CW type, then the subprogram must have a delayed freeze. This
2860 ensures that the backend can properly recover the full view when
2861 elaborating the access subprogram declaration.
2863 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2865 * sem_attr.adb (Resolve_Attribute, case 'Access): Freeze
2866 overloadable entity if originally overloaded.
2868 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2870 * exp_aggr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_code.adb,
2871 exp_fixd.adb, namet.adb, osint.adb, osint.ads, par-ch2.adb,
2872 sem_ch10.adb, sem_ch12.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb
2873 sem_util.adb, styleg.adb, styleg.ads, stylesw.ads: Minor code
2876 2016-04-19 Arnaud Charlet <charlet@adacore.com>
2878 * sem_util.adb (Copy_Node_With_Replacement):
2879 use Set_Comes_From_Source instead of directly manipulating
2880 internals of the node table.
2881 * sem_util.adb (Within_Scope): refactored to remove duplicated code.
2882 * sem_aux.adb (Get_Rep_Pragma,
2883 Subprogram_Body_Entity, Subprogram_Spec): declare variables that
2884 do not change as constants and initialize them in the declaration.
2885 (Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare
2886 variables that do not change as constants and initialize them
2889 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2891 * sem_res.adb (Resolve_Entry_Call): If the entry has
2892 preconditions it is rewritten by means of a wrapper that
2893 incorporates the original call. Before rewriting generate a
2894 reference to the entry being called to prevent spurious warnings
2895 and provide correct cross-reference information.
2897 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
2899 * sem_disp.adb (Check_Dispatching_Context): Code cleanup. Add
2900 local constant Scop. Ignore any internally generated loops when
2901 performing the check concerning an abstract subprogram call
2902 without a controlling argument.
2903 * sem_util.ads, sem_util.adb (Current_Scope_No_Loops): New routine.
2905 2016-04-19 Bob Duff <duff@adacore.com>
2907 * sem_elab.adb (Check_A_Call): There are cases where we have No
2908 (Ent) after the Alias loop, even when there was no previous error,
2909 so we can't assert that there was an error.
2911 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2913 * sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
2914 Reject use of type name as a prefix to 'access within an aggregate
2915 in a context that is not the declarative region of a type.
2917 2016-04-19 Vincent Celier <celier@adacore.com>
2919 * gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
2920 -P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
2921 -l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
2922 Remove anything related to project files
2923 * g-mbdira.adb: minor whitespace cleanup
2924 * g-spipat.adb: minor removal of extra spaces after closing paren
2926 2016-04-19 Ed Schonberg <schonberg@adacore.com>
2928 * exp_ch6.adb (Expand_Actuals): If post-statements are present
2929 and the enclosing context is a function call or indexing, build
2930 an Expression_With_Actions for the call.
2932 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
2934 * lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
2935 a with line for an ignored Ghost unit.
2936 * sem_ch7.adb (Analyze_Package_Declaration): Add local constant
2937 Par. A child package is Ghost when its parent is Ghost.
2938 * sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
2939 a subprogram declaration that acts as a compilation unit.
2941 2016-04-18 Michael Matz <matz@suse.de>
2943 * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
2944 (gnat_to_gnu_field): Ditto.
2945 (components_to_record): Ditto.
2946 (create_variant_part_from): Ditto.
2947 (copy_and_substitute_in_size): Ditto.
2948 (substitute_in_type): Ditto.
2949 * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
2950 (make_packable_type): Ditto.
2951 (maybe_pad_type): Ditto.
2952 (finish_fat_pointer_type): Ditto.
2953 (finish_record_type): Ditto and use SET_DECL_ALIGN.
2954 (rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
2955 (create_field_decl): Use SET_DECL_ALIGN.
2957 2016-04-18 Arnaud Charlet <charlet@adacore.com>
2959 * einfo.adb (Overridden_Operation): assert that
2960 function is called for valid arguments.
2961 * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb,
2962 s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads,
2963 sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb,
2964 sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb,
2965 s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb:
2966 No space after closing parenthesis except where required for
2968 * sem_res.adb: Minor reformatting.
2970 2016-04-18 Arnaud Charlet <charlet@adacore.com>
2972 * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case
2973 statement when relevant.
2975 2016-04-18 Bob Duff <duff@adacore.com>
2977 * a-cuprqu.adb (Enqueue): Properly handle the
2978 case where the new element has a unique priority.
2980 2016-04-18 Tristan Gingold <gingold@adacore.com>
2982 * adaint.h: Define stat structures and functions for iOS
2985 2016-04-18 Arnaud Charlet <charlet@adacore.com>
2987 * sem_res.adb (Resolve_Entry_Call): reset
2988 Is_Overloaded flag after resolving calls to overloaded protected
2990 * exp_spark.adb (Expand_SPARK): call
2991 Qualify_Entity_Names for tasking nodes, i.e. protected types,
2992 task types and entries.
2993 * exp_ch4.adb (Expand_N_If_Expression): Refine previous change
2994 in case of an unconstrained type.
2996 2016-04-18 Yannick Moy <moy@adacore.com>
2998 * sem_eval.adb, sem_eval.ads (Check_Non_Static_Context): Add
2999 comment to document usage of subprogram in GNATprove.
3001 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3003 * sem_prag.adb (Analyze_Pragma, case Test_Case): Improve error
3004 message for wrong placement of aspect Test_Case.
3006 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3008 * einfo.ads: Update the documentation of attribute Renamed_Object.
3009 * exp_spark.adb (Expand_Potential_Renaming): Reimplemented.
3011 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3013 * exp_ch4.adb (Optimize_Length_Comparison): Return immediately
3014 in the case of AAMP (same as for use of the -gnatd.P switch) to
3015 suppress this optimization, which avoids creating a dependence
3016 on the 64-bit arithmetic package.
3018 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3020 * exp_ch4.adb: Update comment.
3022 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3024 * exp_ch6.adb (Expand_Call): Make sure instantiations are
3025 registered only once as pending here.
3027 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3029 * exp_ch4.adb, gnat1drv.adb, opt.ads, sem_res.adb
3030 (Minimize_Expression_With_Actions): New flag.
3031 (Adjust_Global_Switches): Set Minimize_Expression_With_Actions
3033 (Resolve_Short_Circuit): Redo previous change
3034 using Minimize_Expression_With_Actions.
3035 (Expand_N_If_Expression,
3036 Expand_Short_Circuit_Operator): Restore old code to avoid
3037 Expression_With_Actions when Minimize_Expression_With_Actions
3040 2016-04-18 Vincent Celier <celier@adacore.com>
3042 * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File and
3043 Stderr_File): Close local file descriptors when no longer needed.
3045 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3047 * sem_ch5.adb (Analyze_Iterator_Specification): Remove SPARK
3048 mode check that the type of the cursor in an iteration over
3049 a formal container is not volatile. The proper check on the
3050 element type is done elsewhere.
3052 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3054 * sem_ch6.adb (Process_Formals): Do not set a delay freeze on
3055 a subprogram that returns a class-wide type, if the subprogram
3056 is a compilation unit, because otherwise gigi will treat the
3057 subprogram as external, leading to link errors.
3059 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3061 * sem_res.adb (Resolve_Short_Circuit): Do not use
3062 expression-with-actions when generating C.
3064 2016-04-18 Yannick Moy <moy@adacore.com>
3066 * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate
3067 raise node in GNATprove mode.
3069 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3071 * s-fileio.adb: Minor reformatting.
3072 * sem_prag.adb (Analyze_Input_Item): Add local
3073 variable Input_OK. Do not consider mappings of generic formal
3074 parameters to actuals.
3076 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3078 * sem_ch5.adb (Get_Cursor_Type): If iterator type is a derived
3079 type, the cursor is declared in the scope of the parent type.
3080 (Analyze_Parameter_Specification): A qualified expression with an
3081 iterator type indicates an iteration over a container (explicit
3084 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3086 * osint-c.ads, osint-c.adb (Delete_C_File, Delete_H_File): New.
3087 * gnat1drv.adb (Gnat1drv): Delete old C files before regenerating them.
3088 * debug.adb: Reserve -gnatd.4 to force generation of C files.
3090 2016-04-18 Yannick Moy <moy@adacore.com>
3092 * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static
3093 division by zero, instead possibly issue a warning.
3094 * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on
3095 static division by zero, instead add check flag on original
3097 * sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error):
3098 Only issue error when both SPARK_Mode is On and Warn is False.
3100 2016-04-18 Yannick Moy <moy@adacore.com>
3102 * checks.adb (Apply_Scalar_Range_Check): Force
3103 warning instead of error when SPARK_Mode is On, on index out of
3104 bounds, and set check flag for GNATprove.
3106 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3108 * sem_prag.adb (Check_In_Out_States.Check_Constituent_Usage):
3109 Update the comment on usage. Reimplemented.
3110 (Check_Input_States.Check_Constituent_Usage): Update the comment
3111 on usage. A Proof_In constituent can now refine an Input state
3112 as long as there is at least one Input constituent present.
3114 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3116 * sem_ch6.adb (Check_Inline_Pragma): Use the Sloc of the
3117 body id as the sloc of the entity in the generated subprogram
3118 declaration, to avoid spurious conformance errors when style
3121 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3123 * sem_ch4.adb (Analyze_Selected_Component, Has_Dereference):
3124 Refine check on illegal calls to entities within a task body,
3125 when the entity is declared in an object of the same type. In
3126 a generic context there might be no explicit dereference but if
3127 the prefix includes an access type the construct is legal.
3129 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3131 * rtsfind.ads, rtsfind.adb (RE_Id, RE_Unit_Table): add
3132 RE_Default_Priority.
3134 2016-04-18 Bob Duff <duff@adacore.com>
3136 * sem_prag.adb (Check_Arg_Is_Local_Name): Don't do the check
3137 if the pragma came from an aspect specification.
3139 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3141 * gnat1drv.adb, contracts.adb: Minor reformatting and wording fixes.
3143 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3145 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): To suppress
3146 superfluous conformance check on an inlined body with a previous
3147 spec, use the fact that the generated declaration does not come
3148 from source. We must treat the entity as coming from source to
3149 enable some back-end inlining when pragma appears after the body.
3151 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3153 * lib-xref-spark_specific.adb, par-ch2.adb, errout.ads,
3154 exp_intr.adb: Minor reformatting and typo corrections.
3156 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3158 * sem_ch6.adb: Code cleanup.
3160 2016-04-18 Thomas Quinot <quinot@adacore.com>
3162 * sem_ch13.adb: Minor reformatting and error message tweaking
3163 (remove extraneous spaces).
3165 2016-04-18 Johannes Kanig <kanig@adacore.com>
3167 * gnat1drv.adb (Gnat1drv): Force loading of System unit for SPARK.
3169 2016-04-18 Bob Duff <duff@adacore.com>
3171 * s-fileio.adb (Fopen_Mode): If Mode = Out_File, and the file
3172 exists, and it's a fifo, we use "w" as the open string instead of
3173 "r+". This is necessary to make a write to the fifo block until
3176 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3178 * sem_attr.adb (Denote_Same_Function): Account
3179 for a special case where a primitive of a tagged type inherits
3180 a class-wide postcondition from a parent type.
3182 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3184 * par-ch2.adb (P_Expression_Or_Reserved_Word): New routine.
3185 (P_Pragma): Signal Scan_Pragma_Argument_Association when the use
3186 of reserved words is OK.
3187 (Scan_Pragma_Argument_Association):
3188 Add new formal Reserved_Words_OK and update the comment on
3189 usage. Code cleanup. Parse an expression or a reserved word in
3190 identifier form for pragmas Restriction_Warnings and Restrictions
3191 No_Use_Of_Attribute.
3192 * restrict.adb (Check_Restriction_No_Use_Of_Attribute):
3193 Reimplemented. (Check_Restriction_No_Use_Of_Pragma): Code cleanup.
3194 (Set_Restriction_No_Specification_Of_Aspect): Properly set the warning
3196 (Set_Restriction_No_Use_Of_Attribute): Properly set the warning
3197 flag for an attribute. (Set_Restriction_No_Use_Of_Entity):
3198 Update the parameter profile.
3199 (Set_Restriction_No_Use_Of_Pragma): Properly set the warning flag for
3201 * restrict.ads (Check_Restriction_No_Use_Of_Attribute): Update
3202 the comment on usage.
3203 (Set_Restriction_No_Use_Of_Entity): Update the parameter profile.
3204 * sem_attr.adb (Analyze_Attribute): Check restriction
3205 No_Use_Of_Attribute.
3206 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Check
3207 restriction No_Use_Of_Attribute before any rewritings have
3209 * sem_prag.adb (Analyze_Pragma): Check restriction
3210 No_Use_Of_Pragma before any rewritings have taken place.
3212 2016-04-18 Bob Duff <duff@adacore.com>
3214 * sem_ch6.adb (Is_Inline_Pragma): The pragma
3215 argument can be a selected component, which has no Chars field,
3216 so we need to deal with that case (use the Selector_Name).
3217 (Check_Inline_Pragma): We need to test Is_List_Member before
3218 calling In_Same_List, because in case of a library unit, they're
3219 not in lists, so In_Same_List fails an assertion.
3221 2016-04-18 Bob Duff <duff@adacore.com>
3223 * namet.ads, namet.adb: Add an Append that appends a
3224 Bounded_String onto a Bounded_String. Probably a little more
3225 efficient than "Append(X, +Y);". Also minor cleanup.
3226 (Append_Decoded, Append_Decoded_With_Brackets, Append_Unqualified,
3227 Append_Unqualified_Decoded): Make sure these work with non-empty
3229 * casing.ads, casing.adb (Set_Casing): Pass a Bounded_String
3230 parameter, defaulting to Global_Name_Buffer.
3231 * errout.ads, errout.adb (Adjust_Name_Case): Pass a
3232 Bounded_String parameter, no default.
3233 * exp_ch11.adb (Expand_N_Raise_Statement): Use local
3234 Bounded_String instead of Global_Name_Buffer.
3235 * exp_intr.ads, exp_intr.adb (Write_Entity_Name): Rename it
3236 to Append_Entity_Name, and pass a Bounded_String parameter,
3237 instead of using globals.
3238 (Add_Source_Info): Pass a Bounded_String parameter, instead of
3240 (Expand_Source_Info): Use local instead of globals.
3241 * stringt.ads, stringt.adb (Append): Add an Append procedure
3242 for appending a String_Id onto a Bounded_String.
3243 (String_To_Name_Buffer, Add_String_To_Name_Buffer): Rewrite in
3245 * sem_prag.adb (Set_Error_Msg_To_Profile_Name): Adjust for new
3246 Adjust_Name_Case parameter.
3247 * erroutc.adb, uname.adb: Don't pass D => Mixed_Case to
3248 Set_Casing; that's the default.
3249 * lib-xref-spark_specific.adb (Add_SPARK_Scope): Pretend that calls to
3250 protected subprograms are entry calls; otherwise it is not possible to
3251 distinguish them from regular subprogram calls.
3253 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3255 * sem_ch13.adb (Has_Good_Profile): Improvement
3256 of error message. Now indicates subtype_mark of formal parameter
3257 rather than the formal's name, plus minor rewording.
3259 2016-04-18 Pascal Obry <obry@adacore.com>
3261 * adaint.c, adaint.h, s-os_lib.ads: Add new routine Current_Process_Id.
3263 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3265 * stringt.adb, exp_ch6.adb, sem_ch13.adb: Minor reformatting.
3267 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3269 * par-ch4.adb, sem_prag.adb: Minor reformatting.
3271 2016-04-18 Bob Duff <duff@adacore.com>
3273 * sinput.ads, sinput.adb (Build_Location_String): Take a
3274 parameter instead of using a global variable. The function
3275 version no longer destroys the Name_Buffer.
3276 * stringt.ads, stringt.adb (String_From_Name_Buffer): Take a
3277 parameter, which defaults to the Global_Name_Buffer, so some
3278 calls can avoid the global.
3279 * exp_ch11.adb, exp_intr.adb: Use new interfaces above
3280 to avoid using globals. All but one call to Build_Location_String
3281 avoids the global. Only one call to String_From_Name_Buffer
3284 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3286 * namet.adb, namet.ads, exp_unst.adb: Minor reformatting.
3288 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3290 * sem_eval.adb (Choice_Matches): Check the expression
3291 against the predicate values when the choice denotes a
3292 subtype with a static predicate.
3293 (Eval_Membership_Op): Code cleanup. Remove the suspicious guard which
3294 tests for predicates.
3295 (Is_OK_Static_Subtype): A subtype with a dynamic predicate
3296 is not static. (Is_Static_Subtype): A subtype with a dynamic
3297 predicate is not static.
3298 * sem_eval.ads (Is_OK_Static_Subtype): Update the comment on usage.
3299 (Is_Static_Subtype): Update the comment on usage.
3301 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3303 * sem_prag.adb (Analyze_Input_Item): Allow
3304 generic formals to appear as initialization items.
3306 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3308 * sem_ch13.adb (Analyze_Stream_TSS_Definition,
3309 Has_Good_Profile): Additional error message to indicate that
3310 the second parameter of the subprogram must be a first subtype.
3312 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3314 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Is_Inline_Pragma):
3315 Use the pragma lookahead that determines whether a subprogram
3316 is to be inlined, when some level of backend optimization is
3318 * sem_ch12.ads, sem_ch12.adb (Add_Pending_Instantiation): Factorize
3319 code used to create an instance body when needed for inlining.
3320 * exp_ch6.adb (Expand_Call): When a call is to be inlined, and the
3321 call appears within an instantiation that is not a compilation
3322 unit, add a pending instantiation for the enclosing instance,
3323 so the backend can inline in turn the calls contained in the
3326 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3328 * sem_prag.adb (Build_Pragma_Check_Equivalent): The mapping
3329 that relates operations of the parent type to the operations of
3330 the derived type has three distinct sources:
3331 a) explicit operations of the derived type carry an
3332 Overridden_Operation that designates the operation in the
3334 b) Implicit operations that are inherited by the derived type
3335 carry an alias that may be an explicit subprogram (in which case
3336 it may have an Overridden_ Operation indicator) or may also be
3337 inherited and carry its own alias.
3338 c) If the parent type is an interface, the operation of the
3339 derived type does not override, but the interface operation
3340 indicates the operation that implements it.
3341 * sem_prag.adb: Minor reformatting.
3342 * sem_prag.adb (Check_External_Property): Update
3343 the comment on usage. Reimplement.
3345 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3347 * exp_ch5.adb (Expand_Assignment_Statement): In restricted
3348 profiles such as ZFP, ceiling priority is not available.
3350 2016-04-18 Bob Duff <duff@adacore.com>
3352 * namet-sp.ads: Minor typo fix, ironically in 'Spelling_Checker'.
3354 2016-04-18 Bob Duff <duff@adacore.com>
3356 * sem_elab.adb (Output_Calls): Use
3357 Get_Name_String, to clearly indicate that the global Name_Buffer
3358 is being used. The previous code used Is_Internal_Name, which
3359 returns a Boolean, but also has a side effect of setting the
3360 Name_Buffer. Then it called the other Is_Internal_Name, which uses
3361 the Name_Buffer for its input. And then it called Error_Msg_N,
3362 again using the Name_Buffer. We haven't eliminated the global
3363 usage here, but we've made it a bit clearer.
3364 This also allows us to have a side-effect-free version of
3366 * namet.ads, namet.adb: Provide a type Bounded_String, along with
3367 routines that can be used without using global variables. Provide
3368 Global_Name_Buffer so existing code can continue to use the
3369 global. Mark the routines that use globals as obsolete. New code
3370 shouldn't call the obsolete ones, and we should clean up existing
3371 code from time to time.
3372 Name_Find_Str is renamed as Name_Find.
3373 * namet.h: Changed as necessary to interface to the new version
3375 * bindgen.adb, exp_unst.adb: Name_Find_Str is renamed as
3378 2016-04-18 Yannick Moy <moy@adacore.com>
3380 * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization): used
3381 outside of GNATprove, hence it should not be removed.
3383 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3385 * sem_prag.adb (Analyze_Refinement_Clause):
3386 The refinement of an external abstract state can now mention
3387 non-external constituents.
3388 (Check_External_Property): Update all SPARK RM references.
3390 2016-04-18 Bob Duff <duff@adacore.com>
3392 * exp_intr.adb: Remove some duplicated code.
3394 2016-04-18 Yannick Moy <moy@adacore.com>
3396 * a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-nuflra.ads: Mark
3397 package spec and body out of SPARK.
3399 2016-04-18 Johannes Kanig <kanig@adacore.com>
3401 * spark_xrefs.ads: Minor comment update.
3403 2016-04-18 Johannes Kanig <kanig@adacore.com>
3405 * gnat1drv.adb (Gnat1drv): Force loading of System
3408 2016-04-18 Bob Duff <duff@adacore.com>
3410 * a-cuprqu.adb: Correction to previous change. If a new node
3411 is inserted at the front of the queue (because it is higher
3412 priority than the previous front node), we need to update
3413 Header.Next_Unequal -- not just in the case where the queue was
3416 2016-04-18 Bob Duff <duff@adacore.com>
3418 * a-cuprqu.ads: Change the representation of List_Type from a
3419 singly-linked list to a doubly-linked list. In addition, add a
3420 pointer Next_Unequal, which points past a possibly-long chain
3421 of equal-priority items. This increases efficiency, especially
3422 in the case of many equal-priority items.
3423 * a-cuprqu.adb (Dequeue, Enqueue): Rewrite algorithms to take
3424 advantage of new data structure.
3425 (Finalize): Rewrite in terms of Dequeue, for simplicity.
3427 2016-04-18 Yannick Moy <moy@adacore.com>
3429 * contracts.adb (Analyze_Object_Contract,
3430 Analyze_Protected_Contract): Remove tests performed in GNATprove.
3431 * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization):
3432 Remove query for tests performed in GNATprove.
3434 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3436 * sem_aggr.adb (Resolve_Record_Aggregate): If
3437 Warn_On_Redundant_Constructs is enabled, report a redundant box
3438 association that does not cover any components, as it done for
3439 redundant others associations in case statements.
3441 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3443 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions):
3444 Analyze the generated Check pragma for an inherited condition so
3445 that it does not freeze the dispatching type of the primitive
3446 operation, because it is pre-analyzed at the point of the
3447 subprogram declaration (and not in the subprogram body, as is
3448 done during regular expansion).
3450 2016-04-18 Vincent Celier <celier@adacore.com>
3452 * ali.ads: Increase the range of all _Id types to 100 millions.
3454 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3456 * sem_warn.adb (Check_References): Change warning to suggest
3457 using pragma Export rather than saying "volatile has no effect".
3459 2016-04-18 Bob Duff <duff@adacore.com>
3461 * g-souinf.ads (Compilation_ISO_Date): New function to return
3462 the current date in ISO form.
3463 * exp_intr.adb (Expand_Source_Info, Add_Source_Info): Expand
3464 a call to Compilation_ISO_Date into a string literal containing
3465 the current date in ISO form.
3466 * exp_intr.ads (Add_Source_Info): Improve documentation.
3467 * sem_intr.adb (Check_Intrinsic_Subprogram): Recognize
3468 Compilation_ISO_Date.
3469 * snames.ads-tmpl (Name_Compilation_ISO_Date): New Name_Id.
3471 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3473 * layout.adb (Set_Elem_Alignment): Extend setting of alignment
3474 to subtypes that are not first subtypes.
3476 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3478 * sem_prag.ads (Collect_Inherited_Class_Wide_Conditions):
3480 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Insert
3481 generated pragmas after subprogram declaration, rather than in
3482 the corresponding subprogram body.
3483 * sem_ch6.adb (New_Overloaded_Entity): In GNATProve
3484 mode, if the operation is overridding, call
3485 Collect_Inherited_Class_Wide_Conditions to generate the
3486 corresponding pragmas immediately after the corresponding
3487 subprogram declaration.
3489 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3491 * spark_xrefs.ads (Xref_Index, Scope_Index, File_Index): restrict
3492 type to natural numbers.
3493 (Stype): document code characters for concurrent entities.
3495 2016-04-18 Olivier Hainque <hainque@adacore.com>
3497 * targparm.ads: Update the Frontend_Exceptions default internal
3499 (Frontend_Exceptions_On_Target): Change default value to True.
3501 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3503 * sem_ch4.adb (Analyze_Selected_Component): Refine error
3504 detection when a selected component in the body of a synchronized
3505 type is a reference to an object of the same type declared
3506 elsewhere. The construct is legal if the prefix of the selected
3507 component includes an explicit dereference at any point.
3509 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3511 * sem_ch3.adb (Analyze_Object_Declaration): Do not consider
3512 internally generated expressions when trying to determine whether
3513 a formal parameter of a tagged type subject to Extensions_Visible
3514 False is used to initialize an object.
3515 * sem_ch4.adb (Analyze_Type_Conversion): Do not consider
3516 internally generated expressions when trying to determine whether
3517 a formal parameter of a tagged type subject to Extensions_Visible
3518 False is used in a type conversion.
3520 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3522 * sem_res.adb (Is_Protected_Operation_Call):
3523 Add guards to account for a non-decorated selected component.
3525 2016-04-18 Yannick Moy <moy@adacore.com>
3527 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve
3528 implementation of Body_Has_SPARK_Mode_On.
3529 * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_From_Annotation):
3530 New function replacing previous Get_SPARK_Mode_From_Pragma, that
3531 deals also with aspects.
3532 (Get_SPARK_Mode_Type): Make function internal again.
3533 * inline.adb, sem_ch7.adb, sem_util.adb: Use new
3534 Get_SPARK_Mode_From_Annotation.
3536 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3538 * contracts.adb (Analyze_Object_Contract): Update references to
3540 * freeze.adb (Freeze_Entity): Update references to SPARK RM.
3541 * ghost.adb Add with and use clauses for Sem_Disp.
3542 (Check_Ghost_Derivation): Removed.
3543 (Check_Ghost_Overriding):
3544 Reimplemented. (Check_Ghost_Policy): Update references to SPARK RM.
3545 (Check_Ghost_Primitive): New routine.
3546 (Check_Ghost_Refinement): New routine. (Is_OK_Ghost_Context):
3547 Update references to SPARK RM. (Is_OK_Pragma): Update references
3548 to SPARK RM. Predicates are now a valid context for references
3550 * ghost.ads (Check_Ghost_Derivation): Removed.
3551 (Check_Ghost_Overriding): Update the comment on usage.
3552 (Check_Ghost_Primitive): New routine.
3553 (Check_Ghost_Refinement): New routine.
3554 (Remove_Ignored_Ghost_Code): Update references to SPARK RM.
3555 * sem_ch3.adb (Process_Full_View): Remove the now obsolete check
3556 related to Ghost derivations
3557 * sem_ch6.adb (Check_Conformance): Remove now obsolete check
3558 related to the convention-like behavior of pragma Ghost.
3559 (Check_For_Primitive_Subprogram): Verify that the Ghost policy
3560 of a tagged type and its primitive agree.
3561 * sem_prag.adb (Analyze_Pragma): Update references to SPARK
3562 RM. Move the verification of pragma Assertion_Policy Ghost
3563 to the proper place. Remove the now obsolete check related
3564 to Ghost derivations.
3565 (Collect_Constituent): Add a call to Check_Ghost_Refinement.
3566 * sem_res.adb (Resolve_Actuals): Update references to SPARK RM.
3568 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3570 * layout.adb: Fix more minor typos in comments.
3572 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3574 * a-calend.ads, sem_prag.adb, sem_ch6.adb: Minor reformatting.
3576 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3578 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): In GNATprove
3579 mode, collect inherited class-wide conditions to generate the
3580 corresponding pragmas.
3581 * sem_prag.ads (Build_Pragma_Check_Equivalent): Moved from contracts
3582 * contracts.adb (Collect_Inherited_Class_Wide_Conditions): New
3583 procedure for overriding subprograms, used to generate the pragmas
3584 corresponding to an inherited class- wide pre- or postcondition.
3585 * sem_prag.adb (Build_Pragma_Check_Equivalent): moved here
3586 from contracts.adb (Replace_Condition_Entities): Subsidiary
3587 Build_Pragma_Check_Equivalent, to implement the proper semantics
3588 of inherited class-wide conditions, as given in AI12-0113.
3589 (Process_Class_Wide_Condition): Removed.
3590 (Collect_Inherited_Class_Wide_Conditions): Iterate over pragmas
3591 in contract of subprogram, to collect inherited class-wide
3593 (Build_Pragma_Check_Equivalent): Moved to sem_prag.adb
3595 2016-04-18 Yannick Moy <moy@adacore.com>
3597 * a-calend.adb (Ada.Calendar): Mark package body as SPARK_Mode Off.
3598 * a-calend.ads (Ada.Calendar): Mark package spec as
3599 SPARK_Mode and add synchronous external abstract state Clock_Time.
3601 2016-04-18 Yannick Moy <moy@adacore.com>
3603 * sem_res.adb (Resolve_Call): Prevent inlining of
3604 calls inside expression functions. Factor previous code issuing
3605 errors to call Cannot_Inline instead, which does appropriate
3606 processing of message for GNATprove.
3608 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3610 * einfo.ads, sem_ch3.adb, sem_ch8.adb, osint-l.adb, rtsfind.adb,
3611 osint-b.adb: Cleanups.
3613 2016-04-18 Yannick Moy <moy@adacore.com>
3615 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Only create
3616 body to inline in GNATprove mode when SPARK_Mode On applies to
3618 * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_Type): Make function
3621 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3623 * layout.adb: Fix minor typo in comment.
3624 * inline.adb: Fix minor pasto.
3625 * sem_ch12.ads: Fix minor typos in comments.
3627 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3629 * sem_disp.adb (Check_Dispatching_Call): Major rewriting to
3630 handle some complex cases of tag indeterminate calls that are
3631 actuals in other dispatching calls that are themselves tag
3633 (Check_Dispatching_Context): Add parameter to support recursive
3634 check for an enclosing construct that may provide a tag for a
3635 tag-indeterminate call.
3637 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3639 * sem_prag.adb (Analyze_Depends_In_Decl_Part):
3640 Add global variables Task_Input_Seen and Task_Output_Seen.
3641 (Analyze_Global_Item): Detect an illegal use of the current
3642 instance of a single protected/task type in a global annotation.
3643 (Analyze_Input_Output): Inputs and output related to the current
3644 instance of a task unit are now tracked.
3645 (Check_Usage): Require
3646 the presence of the current instance of a task unit only when
3647 one input/output is available. (Current_Task_Instance_Seen):
3649 (Is_CCT_Instance): New parameter profile. Update
3650 the comment on usage. The routine now properly recognizes several
3651 cases related to single protected/task types.
3653 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3655 * freeze.adb (Freeze_Entity): Use New_Freeze_Node
3656 to create a brand new freeze node. This handles a case where an
3657 ignored Ghost context is freezing something which is not ignored
3658 Ghost and whose freeze node should not be removed from the tree.
3659 (New_Freeze_Node): New routine.
3661 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
3663 * sigtramp.h (__gnat_set_is_vxsim) New function to
3664 tell sigtramp-vxworks to handle vxsim signal contexts. *
3665 sigtramp-vxworks.c (__gnat_sigtramp) Take into account the
3666 differences in the sigcontext structure between the expected
3667 regular x86 or x86_64 ones and the ones received in case of
3668 exexution on the vxworks simulator.
3669 * init.c: also compute is_vxsim in case of x86_64-vx7 target. Provide
3670 this information to sigtramp-vxworks.c. Remove the old mechanism for
3672 * init-vxsim.c, sigtramp-vxworks-vxsim.c: remove, now obsolete.
3674 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3676 * exp_ch3.adb (Inline_Init_Proc): New function returning
3677 whether the initialization procedure of a type should be
3678 inlined. Return again True for controlled type themselves.
3679 (Build_Array_Init_Proc): Call it to set Set_Is_Inlined on Init_Proc.
3680 (Build_Record_Init_Proc): Likewise.
3682 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3684 * gnatvsn.ads (Library_Version): Bump to 7.
3686 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3688 * sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag
3689 on the entity of a subprogram declaration that is completed by
3690 an expression function.
3692 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3694 * sem_util.adb (Is_Current_Instance): A entity given by a subtype
3695 declaration can appear in an aspect specification for a dynamic
3696 predicate, and a pragma for aspect Predicate_Failure.
3697 * exp_util.adb (Replace_Subtype_References): Replace current
3698 occurrences of the subtype to which a dynamic predicate applies,
3699 byt the expression that triggers a predicate check. Needed to
3700 implement new aspect Predicate_Failure.
3702 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3704 * a-intsig.ads, a-intsig.adb: Removed, no longer used.
3705 * Makefile.rtl: update accordingly.
3707 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3709 * sem_type.adb (Disambiguate): Call Covers only when necessary
3710 for standard operators.
3712 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3714 * atree.ads (Num_Extension_Nodes): Add couple of figures
3716 * atree.adb: Add GNAT.Heap_Sort_G dependency.
3717 (Print_Statistics): New exported procedure to print statistics.
3719 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3721 * exp_ch3.adb (Build_Record_Init_Proc): Do not mark the procedure
3722 as to be inlined if the type needs finalization.
3724 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
3726 * sigtramp-vxworks-target.inc: sigtramp-vxworks: force the stack
3727 alignment for x86_64.
3728 * init.c: Better fix for guard page reset on x86_64-vx7.
3729 Do not try to retrieve the page that actually raised
3730 the signal as the probing mechanism used on x86_64 do not allow
3731 such retrieval. We thus just test if the guard page is active,
3732 and re-activate it if not.
3734 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3736 * a-sytaco.adb (Suspension_Object): Aspect Default_Initial_Condition
3739 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
3741 * affinity.c: Use the proper type for task id.
3742 * init.c (__gnat_inum_to_ivec): ivec is a pointer.
3744 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3746 * sem_prag.adb (Process_Convention): Relax rule on exporting
3747 Intrinsic types if Relaxed_RM_Semantics is True.
3749 2016-04-18 Vincent Celier <celier@adacore.com>
3751 * sem_ch3.adb, lib.ads, sinfo.ads, sem_ch10.adb, einfo.adb, einfo.ads,
3752 checks.ads, sem_ch12.adb, sem.adb, sem_util.adb, sem_util.ads,
3753 sem_res.adb, sem_attr.adb, par.adb, exp_ch4.adb, errout.ads,
3754 sem_ch4.adb, atree.adb, atree.ads, sem_warn.adb, treepr.adb,
3755 exp_ch3.ads, exp_unst.adb: Change "descendent" to
3756 "descendant" in comments, error messages and identifiers.
3757 * gcc-interface/decl.c: Ditto.
3759 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3761 * sem_type.adb (Operator_Matches_Spec): Call First_Formal on
3762 New_S only once at the beginning of the function.
3764 2016-04-02 Eric Botcazou <ebotcazou@adacore.com>
3766 * gcc-interface/decl.c (components_to_record): Restrict the previous
3767 change to fields with variable size.
3769 2016-03-27 Eric Botcazou <ebotcazou@adacore.com>
3771 * gcc-interface/decl.c (components_to_record): Add special case for
3772 single field with representation clause at offset 0.
3774 2016-03-16 Svante Signell <svante.signell@gmail.com>
3776 * gcc-interface/Makefile.in: Add support for x86 GNU/Hurd.
3777 * s-osinte-gnu.ads: New file.
3779 2016-03-13 Eric Botcazou <ebotcazou@adacore.com>
3781 * system-vxworks-m68k.ads (Stack_Check_Probes): Set to True.
3782 (Stack_Check_Limits): Set to False.
3783 * system-vxworks-mips.ads (Stack_Check_Probes): Set to True.
3784 (Stack_Check_Limits): Set to False.
3785 * system-vxworks-ppc.ads (Stack_Check_Probes): Set to True.
3786 (Stack_Check_Limits): Set to False.
3787 * system-vxworks-sparcv9.ads (Stack_Check_Probes): Set to True.
3788 (Stack_Check_Limits): Set to False.
3789 * system-vxworks-x86.ads (Stack_Check_Probes): Set to True.
3790 (Stack_Check_Limits): Set to False.
3792 2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
3794 * gcc-interface/trans.c (statement_node_p): New predicate.
3795 (gnat_to_gnu): Invoke it to detect statement nodes. In ASIS mode, do
3796 not return dummy results for expressions attached to packed array
3797 implementation types.
3799 2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
3801 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always mark
3802 the expression of a renaming manually in case #3.
3804 2016-03-02 Dominik Vogt <vogt@linux.vnet.ibm.com>
3806 * system-linux-s390.ads: Enable Stack_Check_Probes.
3807 * system-linux-s390.ads: Likewise.
3809 2016-02-29 Martin Liska <mliska@suse.cz>
3811 * gcc-interface/utils.c (set_reverse_storage_order_on_pad_type):
3812 Replace ENABLE_CHECKING macro with flag_checking.
3814 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3816 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Retrofit
3817 handling of unconstrained array types as designated types into common
3818 processing. Also handle array types as incomplete designated types.
3820 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3822 * gcc-interface/decl.c (gnat_to_gnu_entity) <Concurrent types>: In
3823 ASIS mode, fully lay out the minimal record type.
3825 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3827 * gcc-interface/trans.c (finalize_nrv_r): Remove obsolete code.
3828 (build_return_expr): Likewise.
3829 (Call_to_gnu): If this is a function call and there is no target,
3830 create a temporary for the return value for all aggregate types,
3831 but never create it for a return statement. Push a binding level
3832 around the call in more cases. Remove obsolete code.
3834 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
3836 * gcc-interface/ada-tree.h (DECL_RETURN_VALUE_P): New macro.
3837 * gcc-interface/gigi.h (gigi): Remove useless attribute.
3838 (gnat_gimplify_expr): Likewise.
3839 (gnat_to_gnu_external): Declare.
3840 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Factor out
3841 code dealing with the expression of external constants into...
3842 Invoke gnat_to_gnu_external instead.
3843 <E_Variable>: Invoke gnat_to_gnu_external to translate renamed objects
3844 when not for a definition. Deal with COMPOUND_EXPR and variables with
3845 DECL_RETURN_VALUE_P set for renamings and with the case of a dangling
3846 'reference to a function call in a renaming. Remove obsolete test and
3847 adjust associated comment.
3848 * gcc-interface/trans.c (Call_to_gnu): Set DECL_RETURN_VALUE_P on the
3849 temporaries created to hold the return value, if any.
3850 (gnat_to_gnu_external): ...this. New function.
3851 * gcc-interface/utils.c (create_var_decl): Detect a constant created
3852 to hold 'reference to function call.
3853 * gcc-interface/utils2.c (build_unary_op) <ADDR_EXPR>: Add folding
3854 for COMPOUND_EXPR in the DECL_RETURN_VALUE_P case.
3856 2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
3858 * exp_ch4.adb (Expand_N_Indexed_Component): Activate synchronization if
3859 the prefix denotes an entity which Has_Atomic_Components.
3860 * gcc-interface/trans.c (node_is_atomic): Return true if the prefix
3861 denotes an entity which Has_Atomic_Components.
3863 2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
3865 * gcc-interface/utils2.c (gnat_protect_expr): Make a SAVE_EXPR only
3866 for fat pointer or scalar types.
3868 2016-02-16 Eric Botcazou <ebotcazou@adacore.com>
3870 * gcc-interface/gigi.h (maybe_debug_type): New inline function.
3871 * gcc-interface/misc.c (gnat_get_array_descr_info): Use it.
3872 Call maybe_character_value on the array bounds. Get to the base type
3873 of the index type and call maybe_debug_type on it.
3874 * gcc-interface/utils.c (finish_character_type): Add special treatment
3877 2016-02-16 Eric Botcazou <ebotcazou@adacore.com>
3879 * gcc-interface/misc.c (gnat_enum_underlying_base_type): New function.
3880 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define to above.
3882 2016-02-12 Jakub Jelinek <jakub@redhat.com>
3884 * prj-tree.ads: Spelling fixes - behaviour -> behavior and
3885 neighbour -> neighbor.
3886 * prep.adb: Likewise.
3887 * prj.ads: Likewise.
3888 * prepcomp.adb: Likewise.
3889 * g-socket.ads: Likewise.
3890 * s-imgrea.adb: Likewise.
3891 * a-calend.adb: Likewise.
3892 * exp_disp.adb: Likewise.
3893 * doc/gnat_ugn/gnat_utility_programs.rst: Likewise.
3894 * g-socket.adb: Likewise.
3895 * sem_ch12.adb: Likewise.
3896 * terminals.c: Likewise.
3898 2016-02-08 Bernd Schmidt <bschmidt@redhat.com>
3900 * gcc-interface/misc.c (gnat_init): Remove second argument in call to
3901 build_common_tree_nodes.
3903 2016-02-08 Eric Botcazou <ebotcazou@adacore.com>
3905 * gcc-interface/utils.c (create_var_decl): Set again DECL_COMMON and
3906 DECL_IGNORED_P last.
3908 2016-01-28 Eric Botcazou <ebotcazou@adacore.com>
3910 * gcc-interface/gigi.h (enum attr_type): Rename into...
3911 (enum attrib_type): ...this.
3912 (struct attrib): Adjust.
3913 * gcc-interface/decl.c (prepend_one_attribute): Likewise.
3915 2016-01-20 Eric Botcazou <ebotcazou@adacore.com>
3917 * exp_ch2.adb (Expand_Current_Value): Make an appropriate character
3918 literal if the entity is of a character type.
3919 * gcc-interface/lang.opt (fsigned-char): New option.
3920 * gcc-interface/misc.c (gnat_handle_option): Accept it.
3921 (gnat_init): Adjust comment.
3922 * gcc-interface/gigi.h (finish_character_type): New prototype.
3923 (maybe_character_type): New inline function.
3924 (maybe_character_value): Likewise.
3925 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>: For
3926 a character of CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
3927 Set TYPE_ARTIFICIAL early and call finish_character_type on the type.
3928 <E_Enumeration_Subtype>: For a subtype of character with RM_Size and
3929 Esize equal to CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
3930 Copy TYPE_STRING_FLAG from type to subtype.
3931 <E_Array_Type>: Deal with character index types.
3932 <E_Array_Subtype>: Likewise.
3933 * gcc-interface/trans.c (gigi): Replace unsigned_char_type_node with
3934 char_type_node throughout.
3935 (build_raise_check): Likewise.
3936 (get_type_length): Deal with character types.
3937 (Attribute_to_gnu) <Attr_Pos>: Likewise. Remove obsolete range check
3939 <Attr_Pred>: Likewise.
3940 (Loop_Statement_to_gnu): Likewise.
3941 (Raise_Error_to_gnu): Likewise.
3942 <N_Indexed_Component>: Deal with character index types. Remove
3944 <N_Slice>: Likewise.
3945 <N_Type_Conversion>: Deal with character types. Minor tweak.
3946 <N_Unchecked_Type_Conversion>: Likewise.
3948 <N_Op_Eq>: Likewise.
3949 (emit_index_check): Delete.
3950 * gcc-interface/utils.c (finish_character_type): New function.
3951 (gnat_signed_or_unsigned_type_for): Deal with built-in character types.
3952 * gcc-interface/utils2.c (expand_sloc): Replace unsigned_char_type_node
3953 with char_type_node.
3954 (build_call_raise): Likewise.
3955 (build_call_raise_column): Likewise.
3956 (build_call_raise_range): Likewise.
3958 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
3960 * gcc-interface/gigi.h (build_call_raise_column): Adjust prototype.
3961 (build_call_raise_range): Likewise.
3962 (gnat_unsigned_type): Delete.
3963 (gnat_signed_type): Likewise.
3964 (gnat_signed_or_unsigned_type_for): New prototype.
3965 (gnat_unsigned_type_for): New inline function.
3966 (gnat_signed_type_for): Likewise.
3967 * gcc-interface/cuintp.c (build_cst_from_int): Call build_int_cst.
3968 * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
3969 (gnat_to_gnu_entity) <E_Array_Type>: Always translate the index types
3970 and compute their base type from that.
3971 <E_Array_Subtype>: Remove duplicate declaration.
3972 * gcc-interface/misc.c (get_array_bit_stride): Call build_int_cst.
3973 * gcc-interface/trans.c (get_type_length): Likewise.
3974 (Attribute_to_gnu): Likewise.
3975 (Loop_Statement_to_gnu): Likewise.
3976 (Call_to_gnu): Likewise.
3977 (gnat_to_gnu): Call build_real, build_int_cst, gnat_unsigned_type_for
3978 and gnat_signed_type_for. Minor tweaks.
3979 (build_binary_op_trapv): Likewise.
3980 (emit_check): Likewise.
3981 (convert_with_check): Likewise.
3982 (Raise_Error_to_gnu): Adjust calls to the build_call_raise family of
3983 functions. Minor tweaks.
3984 (Case_Statement_to_gnu): Remove dead code.
3985 (gnat_to_gnu): Call gnat_unsigned_type_for and gnat_signed_type_for.
3986 (init_code_table): Minor reordering.
3987 * gcc-interface/utils.c (gnat_unsigned_type): Delete.
3988 (gnat_signed_type): Likewise.
3989 (gnat_signed_or_unsigned_type_for): New function.
3990 (unchecked_convert): Use directly the size in the test for precision
3991 vs size adjustments.
3992 (install_builtin_elementary_types): Call gnat_signed_type_for.
3993 * gcc-interface/utils2.c (nonbinary_modular_operation): Call
3995 (build_goto_raise): New function taken from...
3996 (build_call_raise): ...here. Call it.
3997 (build_call_raise_column): Add KIND parameter and call it.
3998 (build_call_raise_range): Likewise.
4000 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4002 * gcc-interface/ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename to
4003 (TYPE_IMPL_PACKED_ARRAY_P): ...this.
4004 (TYPE_CAN_HAVE_DEBUG_TYPE_P): Do not test TYPE_DEBUG_TYPE.
4005 * gcc-interface/decl.c (gnat_to_gnu_entity): Simplify NULL_TREE tests
4006 and tweak gnat_encodings tests throughout.
4007 (initial_value_needs_conversion): Likewise.
4008 (intrin_arglists_compatible_p): Likewise.
4009 * gcc-interface/misc.c (gnat_print_type): Likewise.
4010 (gnat_get_debug_type): Likewise.
4011 (gnat_get_fixed_point_type_info): Likewise.
4012 (gnat_get_array_descr_info): Likewise.
4013 (get_array_bit_stride): Likewise.
4014 (gnat_get_type_bias): Fix formatting.
4015 (enumerate_modes): Likewise.
4016 * gcc-interface/trans.c (gnat_to_gnu): Likewise.
4017 (add_decl_expr): Simplify NULL_TREE test.
4018 (end_stmt_group): Likewise.
4019 (build_binary_op_trapv): Fix formatting.
4020 (get_exception_label): Use switch statement.
4021 (init_code_table): Move around.
4022 * gcc-interface/utils.c (global_bindings_p): Simplify NULL_TREE test.
4023 (gnat_poplevel): Likewise.
4024 (gnat_set_type_context): Likewise.
4025 (defer_or_set_type_context): Fix formatting.
4026 (gnat_pushdecl): Simplify NULL_TREE test.
4027 (maybe_pad_type): Likewise.
4028 (add_parallel_type): Likewise.
4029 (create_range_type): Likewise.
4030 (process_deferred_decl_context): Likewise.
4031 (convert): Likewise.
4032 (def_builtin_1): Likewise.
4033 * gcc-interface/utils2.c (find_common_type): Likewise.
4034 (build_binary_op): Likewise.
4035 (gnat_rewrite_reference): Likewise.
4036 (get_inner_constant_reference): Likewise.
4038 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4041 * gcc-interface/trans.c (check_inlining_for_nested_subprog): Consider
4042 the parent function instead of the current function in order to issue
4043 the warning or the error. Add guard for ignored functions.
4045 2016-01-17 Jakub Jelinek <jakub@redhat.com>
4047 * adaint.c (__gnat_killprocesstree): Avoid -Wparentheses warning.
4049 2016-01-15 Jakub Jelinek <jakub@redhat.com>
4051 * adaint.c (__gnat_locate_exec_on_path): Use const char * instead
4052 of char * for path_val to avoid warnings.
4054 2016-01-06 Pierre-Marie de Rodat <derodat@adacore.com>
4056 * gcc-interface/utils.c: Bump copyright year.
4057 (rest_of_record_type_compilation): Add XVE/XVU parallel types to
4058 the current lexical scope.
4060 2016-01-04 Jakub Jelinek <jakub@redhat.com>
4062 * gnat_ugn.texi: Bump @copying's copyright year.
4063 * gnat_rm.texi: Likewise.
4065 2016-01-02 Eric Botcazou <ebotcazou@adacore.com>
4067 * gnatvsn.ads: Bump copyright year.
4070 Copyright (C) 2016 Free Software Foundation, Inc.
4072 Copying and distribution of this file, with or without modification,
4073 are permitted in any medium without royalty provided the copyright
4074 notice and this notice are preserved.