1 2016-07-06 Javier Miranda <miranda@adacore.com>
3 * sem_ch6.adb (Check_Inline_Pragma): if the subprogram has no spec
4 then move its aspects to the internally built subprogram spec.
6 2016-07-06 Yannick Moy <moy@adacore.com>
8 * sem_ch6.adb (Analyze_Expression_Function): Mark body of
9 expression function as ghost if needed when created.
10 * sem_prag.adb (Analyze_Pragma.Process_Inline.Set_Inline_Flags):
13 2016-07-06 Arnaud Charlet <charlet@adacore.com>
15 * lib.adb (Check_Same_Extended_Unit): Complete previous change.
16 * sem_intr.adb (Errint): New parameter Relaxed. Refine previous
17 change to only disable errors selectively.
18 * sem_util.adb: minor style fix in object declaration
20 2016-07-06 Yannick Moy <moy@adacore.com>
22 * sem_warn.adb (Check_Infinite_Loop_Warning.Find_Var): Special case a
23 call to a volatile function, so that it does not lead to a warning in
26 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com>
28 * sem_ch12.adb, sem_ch4.adb, sem_ch6.adb: Minor reformatting.
30 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com>
32 * gnat1drv.adb: Code clean up. Do not emit any
33 code generation errors when the unit is ignored Ghost.
35 2016-07-06 Ed Schonberg <schonberg@adacore.com>
37 * sem_eval.adb (Check_Non_Static_Context): If the expression
38 is a real literal of a floating point type that is part of a
39 larger expression and is not a static expression, transform it
40 into a machine number now so that the rest of the computation,
41 even if other components are static, is not evaluated with
44 2016-07-06 Javier Miranda <miranda@adacore.com>
46 * sem_ch13.adb (Freeze_Entity_Checks): Undo previous patch and move the
47 needed functionality to Analyze_Freeze_Generic_Entity.
48 (Analyze_Freeze_Generic_Entity): If the entity is not already frozen
49 and has delayed aspects then analyze them.
51 2016-07-06 Yannick Moy <moy@adacore.com>
53 * sem_prag.adb (Analyze_Pragma.Process_Inline.Set_Inline_Flags):
54 Special case for unanalyzed body entity of ghost expression function.
56 2016-07-06 Javier Miranda <miranda@adacore.com>
58 * sem_ch7.adb (Analyze_Package_Specification): Insert its
59 freezing nodes after the last declaration. Needed to ensure
60 that global entities referenced in aspects of frozen types are
62 * freeze.adb (Freeze_Entity): Minor code reorganization to ensure
63 that freezing nodes of generic packages are handled.
64 * sem_ch13.adb (Freeze_Entity_Checks): Handle N_Freeze_Generic nodes.
65 * sem_ch12.adb (Save_References_In_Identifier): Handle selected
66 components which denote a named number that is constant folded
67 in the analyzed copy of the tree.
69 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com>
71 * exp_aggr.adb Remove with and use clauses for Exp_Ch11 and Inline.
72 (Initialize_Array_Component): Protect the initialization
73 statements in an abort defer / undefer block when the associated
74 component is controlled.
75 (Initialize_Record_Component): Protect the initialization statements
76 in an abort defer / undefer block when the associated component is
78 (Process_Transient_Component_Completion): Use Build_Abort_Undefer_Block
79 to create an abort defer / undefer block.
80 * exp_ch3.adb Remove with and use clauses for Exp_ch11 and Inline.
81 (Default_Initialize_Object): Use Build_Abort_Undefer_Block to
82 create an abort defer / undefer block.
83 * exp_ch5.adb (Expand_N_Assignment_Statement): Mark an abort
84 defer / undefer block as such.
85 * exp_ch9.adb (Find_Enclosing_Context): Do not consider an abort
86 defer / undefer block as a suitable context for an activation
88 * exp_util.adb Add with and use clauses for Exp_Ch11.
89 (Build_Abort_Undefer_Block): New routine.
90 * exp_util.ads (Build_Abort_Undefer_Block): New routine.
91 * sinfo.adb (Is_Abort_Block): New routine.
92 (Set_Is_Abort_Block): New routine.
93 * sinfo.ads New attribute Is_Abort_Block along with occurrences
95 (Is_Abort_Block): New routine along with pragma Inline.
96 (Set_Is_Abort_Block): New routine along with pragma Inline.
98 2016-07-06 Justin Squirek <squirek@adacore.com>
100 * sem_ch4.adb (Analyze_One_Call): Add a conditional to handle
103 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com>
105 * einfo.adb Flag252 is now used as Is_Finalized_Transient. Flag295
106 is now used as Is_Ignored_Transient.
107 (Is_Finalized_Transient): New routine.
108 (Is_Ignored_Transient): New routine.
109 (Is_Processed_Transient): Removed.
110 (Set_Is_Finalized_Transient): New routine.
111 (Set_Is_Ignored_Transient): New routine.
112 (Set_Is_Processed_Transient): Removed.
113 (Write_Entity_Flags): Output Flag252 and Flag295.
114 * einfo.ads: New attributes Is_Finalized_Transient
115 and Is_Ignored_Transient along with occurrences in
116 entities. Remove attribute Is_Processed_Transient.
117 (Is_Finalized_Transient): New routine along with pragma Inline.
118 (Is_Ignored_Transient): New routine along with pragma Inline.
119 (Is_Processed_Transient): Removed along with pragma Inline.
120 (Set_Is_Finalized_Transient): New routine along with pragma Inline.
121 (Set_Is_Ignored_Transient): New routine along with pragma Inline.
122 (Set_Is_Processed_Transient): Removed along with pragma Inline.
123 * exp_aggr.adb Add with and use clauses for Exp_Ch11 and Inline.
124 (Build_Record_Aggr_Code): Change the handling
125 of controlled record components.
126 (Ctrl_Init_Expression): Removed.
127 (Gen_Assign): Add new formal parameter In_Loop
128 along with comment on usage. Remove local variables Stmt and
129 Stmt_Expr. Change the handling of controlled array components.
130 (Gen_Loop): Update the call to Gen_Assign.
131 (Gen_While): Update the call to Gen_Assign.
132 (Initialize_Array_Component): New routine.
133 (Initialize_Ctrl_Array_Component): New routine.
134 (Initialize_Ctrl_Record_Component): New routine.
135 (Initialize_Record_Component): New routine.
136 (Process_Transient_Component): New routine.
137 (Process_Transient_Component_Completion): New routine.
138 * exp_ch4.adb (Process_Transient_In_Expression): New routine.
139 (Process_Transient_Object): Removed. Replace all existing calls
140 to this routine with calls to Process_Transient_In_Expression.
141 * exp_ch6.adb (Expand_Ctrl_Function_Call): Remove local constant
142 Is_Elem_Ref. Update the comment on ignoring transients.
143 * exp_ch7.adb (Process_Declarations): Do not process ignored
144 or finalized transient objects.
145 (Process_Transient_In_Scope): New routine.
146 (Process_Transients_In_Scope): New routine.
147 (Process_Transient_Objects): Removed. Replace all existing calls
148 to this routine with calls to Process_Transients_In_Scope.
149 * exp_util.adb (Build_Transient_Object_Statements): New routine.
150 (Is_Finalizable_Transient): Do not consider a transient object
151 which has been finalized.
152 (Requires_Cleanup_Actions): Do not consider ignored or finalized
154 * exp_util.ads (Build_Transient_Object_Statements): New routine.
155 * sem_aggr.adb: Major code clean up.
156 * sem_res.adb: Update documentation.
158 2016-07-06 Ed Schonberg <schonberg@adacore.com>
160 * sem_ch3.adb (Analyze_Subtype_Declaration): For generated
161 subtypes, such as actual subtypes of unconstrained formals,
162 inherit predicate functions, if any, from the parent type rather
163 than creating redundant new ones.
165 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com>
167 * exp_attr.adb, sem_attr.adb, sem_ch13.adb: Minor reformatting.
169 2016-07-06 Arnaud Charlet <charlet@adacore.com>
171 * lib.adb (Check_Same_Extended_Unit): Prevent looping forever.
172 * gnatbind.adb: Disable some consistency checks in codepeer mode,
173 which are not needed.
175 2016-07-06 Ed Schonberg <schonberg@adacore.com>
177 * sem_ch12.adb (Check_Fixed_Point_Actual): Add a warning when
178 a formal fixed point type is instantiated with a type that has
179 a user-defined arithmetic operations, but the generic has no
180 corresponding formal functions. This is worth a warning because
181 of the special semantics of fixed-point operators.
183 2016-07-06 Bob Duff <duff@adacore.com>
185 * sem_attr.adb (Analyze_Attribute): Allow any expression of
187 * exp_attr.adb (Expand_N_Attribute_Reference): Change the
188 constant-folding code to correctly handle cases newly allowed
189 by Analyze_Attribute.
191 2016-07-05 Eric Botcazou <ebotcazou@adacore.com>
193 * gcc-interface/decl.c (gnat_to_gnu_entity): Invoke global_bindings_p
194 last when possible. Do not call elaborate_expression_2 on offsets in
195 local record types and avoid useless processing for constant offsets.
197 2016-07-04 Arnaud Charlet <charlet@adacore.com>
199 * gnat_rm.texi, gnat_ugn.texi,
200 doc/gnat_ugn/gnat_project_manager.rst,
201 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
202 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
203 doc/gnat_ugn/about_this_guide.rst,
204 doc/gnat_ugn/platform_specific_information.rst,
205 doc/gnat_ugn/tools_supporting_project_files.rst,
206 doc/gnat_ugn/gnat_and_program_execution.rst,
207 doc/gnat_ugn/gnat_utility_programs.rst,
208 doc/gnat_ugn/the_gnat_compilation_model.rst,
209 doc/gnat_rm/implementation_defined_attributes.rst,
210 doc/gnat_rm/implementation_defined_pragmas.rst,
211 doc/gnat_rm/representation_clauses_and_pragmas.rst,
212 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
213 doc/gnat_ugn.rst: Update documentation.
215 2016-07-04 Arnaud Charlet <charlet@adacore.com>
217 * gcc-interface/Makefile.in: Cleanups.
219 2016-07-04 Ed Schonberg <schonberg@adacore.com>
221 * sem_attr.adb (Analyze_Attribute_Old_Result): The attributes can
222 appear in the postcondition of a subprogram renaming declaration,
223 when the renamed entity is an attribute reference that is a
224 function (such as 'Value).
225 * sem_attr.adb (Eval_Attribute): It doesn't
226 need to be static, just known at compile time, so use
227 Compile_Time_Known_Value instead of Is_Static_Expression.
228 This is an efficiency improvement over the previous bug fix.
229 * sem_ch13.adb (Analyze_One_Aspect): Use Original_Node to detect
230 illegal aspects on subprogram renaming declarations that may
231 have been rewritten as bodies.
233 2016-07-04 Arnaud Charlet <charlet@adacore.com>
235 * sem_intr.adb (Errint): Do not emit error message in
236 Relaxed_RM_Semantics mode.
238 2016-07-04 Bob Duff <duff@adacore.com>
240 * sem_attr.adb (Eval_Attribute): The code was assuming
241 that X'Enum_Rep, where X denotes a constant, can be constant
242 folded. Fix it so it makes that assumption only when X denotes
245 2016-07-04 Ed Schonberg <schonberg@adacore.com>
247 * sem_ch4.adb (Compatible_Types_In_Predicate): New function
248 to handle cases where a formal of a predicate function and the
249 corresponding actual have different views of the same type.
251 2016-07-04 Philippe Gil <gil@adacore.com>
253 * g-debpoo.adb (Free_Blocks) free blocks also until
254 Logically_Deallocated less than Maximum_Logically_Freed_Memory
255 (Dump) add dump of number of traceback & validity elements
258 2016-07-04 Justin Squirek <squirek@adacore.com>
260 * sem_ch12.adb (Instantiate_Package_Body): Add
261 a guard to ignore Itypes which fail when installing primitives.
263 2016-07-04 Bob Duff <duff@adacore.com>
265 * sem_eval.adb (Decompose_Expr): Set 'out' parameters
266 Kind and Cons to valid values, to avoid use of uninit vars.
267 (Extract_Length): Reorder the check to make it clearer that
268 we're depending on BOTH Ent1 and Ent2 to be Present.
269 * sem_aggr.adb (Resolve_Aggregate): Remove dead code.
270 (Check_Misspelled_Component): Remove exit statement, because
271 it's covered by the 'while' condition.
272 * checks.adb (Apply_Selected_Range_Checks): Remove useless
273 condition "or else not Checks_On".
274 (Selected_Range_Checks):
275 Initialize Known_LB and Known_HB to False, because they are
276 tested unconditionally; avoid use of uninit vars.
277 * frontend.adb (Frontend): Removed useless condition
278 "Operating_Mode = Check_Semantics and then", and added an Assert
279 to clarify why it was useless.
280 * prep.adb (Preprocess): Remove redundant condition. Add an
282 * sem_ch10.adb (Analyze_Proper_Body): Moved redundant condition
283 "Original_Operating_Mode = Generate_Code" to an Assert.
284 (Process_Spec_Clauses, Process_Body_Clauses): Change parameters
285 from 'in out' to 'out', and don't initialize actuals.
286 * sem_ch12.adb (Is_In_Main_Unit): Removed useless condition
287 "Unum = Main_Unit or else".
288 (Save_Global_Descendant): Moved
289 redundant condition "D = Union_Id (No_List)" to an Assert.
290 * sem_ch4.adb (Check_Misspelled_Selector): Remove exit
291 statement, because it's covered by the 'while' condition.
292 (Analyze_Case_Expression): Initialize Wrong_Alt to Empty,
293 because it looks like it is used uninitialized otherwise.
294 * sem_ch6.adb (Check_Return_Subtype_Indication): Moved redundant
295 condition "not R_Type_Is_Anon_Access" to an Assert.
296 * sem_elim.adb (Line_Num_Match): Moved redundant condition
297 "Sloc_Trace (Idx) = '['" to an Assert.
298 * sem_util.adb (Compile_Time_Constraint_Error): Change "J" to
299 "J - 1". This code is trying to replace "?" with "<", but not if
300 the "?" is quoted, as in "'?", so we want to check the PREVIOUS
302 * snames.adb-tmpl (Is_Pragma_Name): Remove useless condition
303 "or else N = Name_Relative_Deadline". It's useless because
304 Name_Relative_Deadline is in the range First_Pragma_Name
306 * treepr.adb (Visit_Node): Moved redundant condition "D =
307 Union_Id (No_List)" to an Assert.
308 * sem_ch3.adb (Derive_Subprogram, Derive_Subprograms): Change
309 parameters from 'in out' to 'out'.
310 * errout.adb (Error_Msg_Internal): Replace redundant test with Assert.
311 * inline.adb (Add_Inlined_Body): Code cleanup.
313 2016-07-04 Hristian Kirtchev <kirtchev@adacore.com>
315 * g-sercom-mingw.adb, sem_ch6.adb: Minor reformatting.
317 2016-07-04 Olivier Hainque <hainque@adacore.com>
319 * g-sercom-mingw.adb (Set): Fix port configuration for the
320 non-blocking + null-timeout case, request of immediate return.
322 2016-07-04 Ed Schonberg <schonberg@adacore.com>
324 * sem_ch6.adb (Is_Non_Overriding_Operation): Add guard to test
325 of generic parent type when operation is a parameterless function
326 that may dispatch on result.
328 2016-07-04 Hristian Kirtchev <kirtchev@adacore.com>
330 * freeze.adb, ghost.adb, sem_ch13.adb: Minor reformatting.
332 2016-07-04 Pascal Obry <obry@adacore.com>
334 * g-forstr.ads: More documentation for the Formatted_String
337 2016-07-04 Justin Squirek <squirek@adacore.com>
339 * sem_ch7.adb (Install_Parent_Private_Declarations): When
340 instantiating a child unit, do not install private declaration of
341 a non-generic ancestor of the generic that is also an ancestor
342 of the current unit: its private part will be installed when
343 private part of ancestor itself is analyzed.
345 2016-07-04 Ed Schonberg <schonberg@adacore.com>
347 * sem_ch12.adb (Instantiate_Object): In SPARK mode add a guard
348 to verify that the actual is an object reference before checking
350 (Check_Generic_Child_Unit): Prevent cascaded errors when prefix
353 2016-07-04 Gary Dismukes <dismukes@adacore.com>
355 * sem_ch12.ads, freeze.adb: Minor reformatting and typo fixes.
357 2016-07-04 Ed Schonberg <schonberg@adacore.com>
359 * sem_ch13.adb (New_Stream_Subprogram): If the attribute
360 definition clause comes from an aspect specification, place the
361 generated subprogram renaming in the freeze actions of the type.
363 2016-07-04 Philippe Gil <gil@adacore.com>
365 * g-debpoo.adb (Dump.Do_Report) - add space prefix to backtrace
366 address dump - avoid new line sent directly to stdout.
368 2016-07-04 Arnaud Charlet <charlet@adacore.com>
370 * gnat1drv.adb, sem_ch12.adb, sem_elab.adb, sem_prag.adb, sem_res.adb:
371 Relax elaboration checks in SPARK_Mode so that we rely on the
372 static elaboration model (if used). We'll have a more precise
373 check performed in flow analysis of gnat2why.
375 2016-07-04 Ed Schonberg <schonberg@adacore.com>
377 * ghost.adb (Prune_Node): A freeze node for an ignored ghost
378 entity must be pruned as well.
380 2016-07-04 Gary Dismukes <dismukes@adacore.com>
382 * sem_type.adb, einfo.ads, freeze.adb, exp_ch6.adb: Minor reformatting
385 2016-07-04 Hristian Kirtchev <kirtchev@adacore.com>
387 * sem_ch3.adb, sem_type.adb, sem_ch12.adb, xref_lib.adb,
388 freeze.adb, sinput-l.adb, sinput-l.ads, sem_ch4.adb, sem_ch8.adb:
391 2016-07-04 Justin Squirek <squirek@adacore.com>
393 * sem_prag.adb (Analyze_Unmodified_Or_Unused and
394 Analyze_Unreferenced_Or_Unused): Change warning message to be
395 more clear about pragma duplicates.
397 2016-07-04 Yannick Moy <moy@adacore.com>
399 * sinput-l.adb (Create_Instantiation_Source): Set component
400 Inlined_Call for inherited pragma case.
401 * sinput.adb, sinput.ads (Instantiation): Return component
402 Inlined_Call for inherited pragma case.
404 2016-07-04 Bob Duff <duff@adacore.com>
406 * sem_type.adb (Remove_Conversions): Protect
407 the call to Left_Opnd by checking for Nkind in N_Unary_Op --
408 unary operators do not have a left operand.
410 2016-07-04 Ed Schonberg <schonberg@adacore.com>
412 * sem_ch3.adb (Analyze_Object_Declaration): A declaration of a
413 constant in a protected operation may be a homonym of a private
414 component of the enclosing protected type. This declaration hides
415 the component renaming constructed within the protected operation.
417 2016-07-04 Bob Duff <duff@adacore.com>
419 * xref_lib.adb (Parse_X_Filename, Parse_Identifier_Info): Ignore
420 unknown files. Check that File_Nr is in the range of files we
421 know about. The previous code was checking the lower bound,
422 but not the upper bound.
424 2016-07-04 Arnaud Charlet <charlet@adacore.com>
426 * tracebak.c: Minor reformatting.
428 2016-07-04 Yannick Moy <moy@adacore.com>
430 * sem_ch12.adb, sem_ch12.ads Update calls to
431 Create_Instantiation_Source to use default argument.
432 (Adjust_Inherited_Pragma_Sloc): New function to adjust sloc
434 (Set_Copied_Sloc_For_Inherited_Pragma):
435 New function that wraps call to Create_Instantiation_Source for
436 copying an inherited pragma.
437 (Set_Copied_Sloc_For_Inlined_Body): Update call to
438 Create_Instantiation_Source with new arguments.
439 * sem_prag.adb (Build_Pragma_Check_Equivalent): In the case
440 of inherited pragmas, use the generic machinery to get chained
441 locations for the pragma and its sub-expressions.
442 * sinput-c.adb: Adapt to new type Source_File_Record.
443 * sinput-l.adb, sinput-l.ads (Create_Instantiation_Source):
444 Add parameter Inherited_Pragma and make parameter Inlined_Body
446 * sinput.adb, sinput.ads (Comes_From_Inherited_Pragma): New
447 function to return when a location comes from an inherited pragma.
448 (Inherited_Pragma): New function to detect when a location comes
449 from an inherited pragma.
450 (Source_File_Record): New component Inherited_Pragma.
452 2016-07-04 Yannick Moy <moy@adacore.com>
454 * sem_elab.adb: Register existence of quickfix for error message.
456 2016-07-04 Ed Schonberg <schonberg@adacore.com>
458 * sem_ch4.adb (Resolve_One_Call): In the context of a predicate
459 function the formal and the actual in a call may have different
460 views of the same type, because of the delayed analysis of
461 predicates aspects. Extend the patch that handles this potential
462 discrepancy to handle private and full views as well.
463 * sem_ch8.adb (Find_Selected_Component): Refine predicate that
464 produces additional error when an illegal selected component
465 looks like a prefixed call whose first formal is untagged.
467 2016-07-04 Justin Squirek <squirek@adacore.com>
469 * einfo.adb (Has_Pragma_Unused): Create this function as a setter
470 for a new flag294 (Set_Has_Pragma_Unused): Create this procedure
471 as a getter for flag294 (Write_Entity_Flags): Register the new
473 * einfo.ads Add comment documenting Has_Pragma_Unused (flag294)
474 and subsequent getter and setter declarations.
475 * lib-xref.adb (Generate_Reference): Recognize Has_Pragma_Unused
476 flag to print appropriate warning messages.
477 * par-prag.adb (Prag): Classify Pragma_Unused into "All Other
479 * snames.ads-tmpl Add a new name to the name constants and a
480 new pramga to Pragma_Id for pramga Unused.
481 * sem_prag.adb (Analyze_Pragma): Create case for Pragma_Unused
482 and move the block for Pragma_Unmodified and Pragma_Unreferenced
483 out and into local subprograms.
484 (Analyze_Unmodified, Analyze_Unreferenced): From the old pragma blocks
485 that have been separated in to local subprograms add a parameter to
486 indicate the if they are being called in the context of Pragma_Unused
487 and handle it accordingly.
488 (Is_Non_Significant_Pragma_Reference): Add an entry for Pragma_Unused
489 and correct the position of Pragma_Unevaluated_Use_Of_Old.
490 * sem_util.adb (Note_Possible_Modification): Recognize
491 Has_Pragma_Unused flag to print appropriate warning messages.
493 2016-07-04 Ed Schonberg <schonberg@adacore.com>
495 * freeze.adb (Check_Inherited_Conditions): Perform two passes over
496 the primitive operations of the type: one over source overridings
497 to build the primitives mapping, and one over inherited operations
498 to check for the need to create wrappers, and to check legality
499 of inherited condition in SPARK.
500 * sem_prag.ads (Update_Primitive_Mapping): Make public, for use
502 * sem_prag.adb (Build_Pragma_Check_Equivalent): Refine error
503 message in the case of an inherited condition in SPARK that
504 includes a call to some other overriding primitive.
506 2016-07-04 Hristian Kirtchev <kirtchev@adacore.com>
508 * exp_aggr.adb (Ctrl_Init_Expression): New routine.
509 (Gen_Assign): Code cleanup. Perform in-place side effect removal when
510 the expression denotes a controlled function call.
511 * exp_util.adb (Remove_Side_Effects): Do not remove side effects
512 on a function call which has this behavior suppressed.
513 * sem_aggr.adb Code cleanup.
514 * sinfo.adb (No_Side_Effect_Removal): New routine.
515 (Set_Side_Effect_Removal): New routine.
516 * sinfo.ads New attribute No_Side_Effect_Removal along with
518 (No_Side_Effect_Removal): New routine along with pragma Inline.
519 (Set_Side_Effect_Removal): New routine along with pragma Inline.
521 2016-07-04 Arnaud Charlet <charlet@adacore.com>
523 * opt.ads, sem_prag.adb (Universal_Addressing_On_AAMP): Removed.
524 Remove support for pragma No_Run_Time. Update comments.
526 2016-07-04 Pascal Obry <obry@adacore.com>
528 * g-forstr.ads: More documentation for the Formatted_String
531 2016-07-04 Ed Schonberg <schonberg@adacore.com>
533 * exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case
534 'Address): If the address comes from an aspect specification
535 and not a source attribute definition clause, do not remove
536 side effects from the expression, because the expression must
537 be elaborated at the freeze point of the object and not at the
538 object declaration, because of the delayed analysis of aspect
541 2016-06-29 Eric Botcazou <ebotcazou@adacore.com>
545 * gcc-interface/gigi.h (enum standard_datatypes): Add ADT_realloc_decl
546 (realloc_decl): New macro.
547 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Use local
548 variable for the entity type and translate it as void pointer if the
549 entity has convention C.
550 (gnat_to_gnu_entity) <E_Function>: If this is not a definition and the
551 external name matches that of malloc_decl or realloc_decl, return the
552 correspoding node directly.
553 (gnat_to_gnu_subprog_type): Likewise for parameter and return types.
554 * gcc-interface/trans.c (gigi): Initialize void_list_node here, not...
555 Initialize realloc_decl.
556 * gcc-interface/utils.c (install_builtin_elementary_types): ...here.
557 (build_void_list_node): Delete.
558 * gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Return the
559 alignment of the system allocator for malloc_decl and realloc_decl.
560 Do not take alignment from void pointer types either.
562 2016-06-29 Eric Botcazou <ebotcazou@adacore.com>
564 * gcc-interface/misc.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): Reorder.
565 (LANG_HOOKS_INIT_TS): Likewise.
567 2016-06-22 Arnaud Charlet <charlet@adacore.com>
569 * sem_prag.adb: Revert unwanted change in previous commit,
570 only keep message fix.
572 2016-06-22 Ed Schonberg <schonberg@adacore.com>
574 * sem_prag.ads (Build_Classwide_Expression): new procedure to
575 build the expression for an inherited classwide condition, and
576 to validate such expressions when they apply to an inherited
577 operation that is not overridden.
578 * sem_prag.adb (Primitives_Mapping): new data structure to
579 handle the mapping between operations of a root type and the
580 corresponding overriding operations of a type extension. Used
581 to construct the expression for an inherited classwide condition.
582 (Update_Primitives_Mapping): add to Primitives_Mapping the links
583 between primitive operations of a root type and those of a given
585 (Build_Pragma_Check_Equivalent): use Primitives_Mapping.
586 * sem_ch6.adb (New_Overloaded_Entity): Remove call to
587 Collect_Iherited_Class_Wide_Conditions in GNATprove_Mode. This
588 needs to be done at freeze point of the type.
589 * freeze.adb (Check_Inherited_Conditions): new procedure to
590 verify the legality of inherited classwide conditions. In normal
591 compilation mode the procedure determines whether an inherited
592 operation needs a wrapper to handle an inherited condition that
593 differs from the condition of the root type. In SPARK mode
594 the routine invokes Collect_Inherited_Class_Wide_Conditions to
595 produce the SPARK version of these inherited conditions.
596 (Freeze_Record_Type): For a type extension, call
597 Check_Inherited_Conditions.
599 2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
601 * sem_ch3.adb, sem_type.adb, sem.adb, freeze.adb, sem_util.adb,
602 s-htable.adb, exp_ch11.adb, s-secsta.adb, restrict.adb, exp_disp.adb,
603 sem_ch8.adb, s-tpobop.adb, exp_aggr.ads, sem_ch13.adb: Minor
606 2016-06-22 Yannick Moy <moy@adacore.com>
608 * lib-xref-spark_specific.adb (Collect_SPARK_Xrefs): Inverse order of
609 treatments so that files without compilation unit are simply skipped
610 before more elaborate treatments.
612 2016-06-22 Bob Duff <duff@adacore.com>
614 * s-memory.ads: Minor typo fixes in comments.
615 * s-memory.adb: Code cleanup.
617 2016-05-22 Olivier Hainque <hainque@adacore.com>
619 * vxworks-crtbe-link.spec: Removed, no longer used.
621 2016-06-22 Justin Squirek <squirek@adacore.com>
623 * sem_ch8.adb (Push_Scope): Add a check for when the
624 scope table is empty to assign the global variable
625 Configuration_Component_Alignment.
626 * sem.adb (Do_Analyze): Add Configuration_Component_Alignment
627 to be assigned when the environment is cleaned instead of the
629 * sem.ads Add a global variable Configuration_Component_Alignment
630 to store the value given by pragma Component_Alignment in the
631 context of a configuration file.
632 * sem_prag.adb (Analyze_Pragma): Correct the case for
633 Component_Alignment so that the pragma is verified and add
634 comments to explain how it is applied to the scope stack.
636 2016-06-22 Justin Squirek <squirek@adacore.com>
638 * sprint.adb (Sprint_Node_Actual): Add check in
639 the case of an N_Object_Declaration when evaluating an expression
640 to properly ignore errors.
642 2016-06-22 Bob Duff <duff@adacore.com>
644 * g-comlin.ads (Parameter_Type): Change subtype of Last to
646 * g-comlin.adb (Set_Parameter): Change subtype of Last to
648 (Getopt): Check for Arg = "", and Switches /= "".
649 (Internal_Initialize_Option_Scan): Check for Argument (Parser,
652 2016-06-22 Gary Dismukes <dismukes@adacore.com>
654 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
656 2016-06-22 Ed Schonberg <schonberg@adacore.com>
658 * einfo.ads, einfo.adb (Is_Actual_Subtype): New flag, defined
659 on subtypes that are created within subprogram bodies to handle
660 unconstrained composite formals.
661 * checks.adb (Apply_Predicate_Check): Do not generate a check on
662 an object whose type is an actual subtype.
663 * sem_ch6.adb (Set_Actual_Subtypes): Do not generate an
664 actual subtype for a formal whose base type is private.
665 Set Is_Actual_Subtype on corresponding entity after analyzing
668 2016-06-22 Justin Squirek <squirek@adacore.com>
670 * sem_prag.adb (Check_Expr_Is_OK_Static_Expression): Fix ordering
671 of if-block and add in a condition to test for errors during
673 * sem_res.adb (Resolution_Failed): Add comment to explain why
674 the type of a node which failed to resolve is set to the desired
675 type instead of Any_Type.
676 * sem_ch8.adb (Analyze_Object_Renaming): Add a check for Any_Type
677 to prevent crashes on Is_Access_Constant.
679 2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
681 * lib-xref-spark_specific.adb, checks.adb, sem_ch13.adb: Minor
683 * exp_ch7.adb: Minor typo fix.
684 * lib.ads (Get_Top_Level_Code_Unit): Add comment.
686 2016-06-22 Bob Duff <duff@adacore.com>
688 * s-tassta.adb (Task_Wrapper): Fix handling of Fall_Back_Handler
689 wrt independent tasks.
691 2016-06-22 Ed Schonberg <schonberg@adacore.com>
693 * sem_dim.adb (Analyze_Dimension): Propagate dimension for
694 explicit_dereference nodes when they do not come from source,
695 to handle correctly dimensional analysis on iterators over
696 containers whose elements have declared dimensions.
698 2016-06-22 Arnaud Charlet <charlet@adacore.com>
700 * spark_xrefs.ads (Scope_Num): type refined to positive integers.
701 * lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope):
702 moved into scope of Collect_SPARK_Xrefs.
703 (Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs;
704 now uses Dspec and Scope_Id from Collect_SPARK_Xrefs.
705 (Collect_SPARK_Xrefs): refactored to avoid retraversing the list
707 (Traverse_Compilation_Unit): refactored as a generic procedure.
708 * types.ads (Unit_Number_Type): range refined.
710 2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
712 * lib-xref-spark_specific.adb, a-cuprqu.ads, sem_ch6.adb: Minor
715 2016-06-22 Eric Botcazou <ebotcazou@adacore.com>
717 * sem_util.ads (Address_Value): Declare new function.
718 * sem_util.adb (Address_Value): New function extracted
719 unmodified from Apply_Address_Clause_Check, which returns the
720 underlying value of the expression of an address clause.
721 * checks.adb (Compile_Time_Bad_Alignment): Delete.
722 (Apply_Address_Clause_Check): Call Address_Value on
723 the expression. Do not issue the main warning here and
724 issue the secondary warning only when the value of the
725 expression is not known at compile time.
726 * sem_ch13.adb (Address_Clause_Check_Record): Add A component and
727 adjust the description.
728 (Analyze_Attribute_Definition_Clause): In the case
729 of an address, move up the code creating an entry in the table of
730 address clauses. Also create an entry for an absolute address.
731 (Validate_Address_Clauses): Issue the warning for absolute
732 addresses here too. Tweak condition associated with overlays
735 2016-06-22 Ed Schonberg <schonberg@adacore.com>
737 * sem_ch13.adb (Is_Predicate_Static): An inherited predicate
738 can be static only if it applies to a scalar type.
740 2016-06-22 Ed Schonberg <schonberg@adacore.com>
742 * exp_util.adb (Adjust_Result_Type): Convert operand to base
743 type to prevent spurious constraint checks on subtypes of Boolean.
745 2016-06-22 Bob Duff <duff@adacore.com>
747 * debug.adb: Document debug switch -gnatd.o.
748 * sem_elab.adb (Check_Internal_Call): Debug switch -gnatd.o
749 now causes a more conservative treatment of indirect calls,
750 treating P'Access as a call to P in more cases. We Can't make
751 this the default, because it breaks common idioms, for example
753 * sem_util.adb: Add an Assert.
755 2016-06-22 Bob Duff <duff@adacore.com>
757 * a-cuprqu.ads, a-cuprqu.adb: Completely rewrite this package. Use
758 red-black trees, which gives O(lg N) worst-case performance on
759 Enqueue and Dequeue. The previous version had O(N) Enqueue in
762 2016-06-22 Arnaud Charlet <charlet@adacore.com>
764 * sem_warn.adb: minor style fix in comment.
765 * spark_xrefs.ads (Scope_Num): type refined to positive integers.
766 * lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope):
767 moved into scope of Collect_SPARK_Xrefs.
768 (Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs;
769 now uses Dspec and Scope_Id from Collect_SPARK_Xrefs.
770 (Collect_SPARK_Xrefs): refactored to avoid retraversing the list
772 * sem_ch3.adb (Build_Discriminal): Set Parent of the discriminal.
774 2016-06-22 Arnaud Charlet <charlet@adacore.com>
776 * lib-xref-spark_specific.adb (Generate_Dereference): Assignment to not
777 commented local variables replaced with direct uses of their values.
779 2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
781 * exp_ch7.adb (Add_Invariant): Replace the
782 current type instance with the _object parameter even in ASIS mode.
783 (Build_Invariant_Procedure_Body): Do not insert the
784 invariant procedure body into the tree for ASIS and GNATprove.
785 (Build_Invariant_Procedure_Declaration): Do not insert the
786 invariant procedure declaration into the tree for ASIS and
788 * lib-xref-spark_specific.adb (Add_SPARK_Scope): Update comment.
790 2016-06-22 Ed Schonberg <schonberg@adacore.com>
792 * sem_ch6.adb (Set_Actual_Subtypes): If the type of the actual
793 has predicates, the actual subtype must be frozen properly
794 because of the generated tests that may follow. The predicate
795 may be specified by an explicit aspect, or may be inherited in
798 2016-06-22 Ed Schonberg <schonberg@adacore.com>
800 * exp_ch4.adb (In_Range_Chec)): New predicate, subsidiary of
801 Expand_N_In: within an expanded range check that might raise
802 Constraint_Error do not generate a predicate check as well. It
803 is redundant because the context will add an explicit predicate
804 check, and it will raise the wrong exception if it fails.
805 * lib-xref-spark_specific.adb (Add_SPARK_File): Remove useless checks
806 since dependency units always have an associated compilation unit.
808 2016-06-22 Arnaud Charlet <charlet@adacore.com>
810 * lib.ads: Code cleanup.
811 * inline.adb: Type refinement for a counter variable.
812 * lib-xref-spark_specific.adb (Add_SPARK_File): removal of no-op code.
815 2016-06-21 Eric Botcazou <ebotcazou@adacore.com>
817 * gcc-interface/decl.c (set_nonaliased_component_on_array_type): New
819 (set_reverse_storage_order_on_array_type): Likewise.
820 (gnat_to_gnu_entity) <E_Array_Type>: Call them to set the flags.
821 <E_Array_Subtype>: Likewise.
822 <E_String_Literal_Subtype>: Likewise.
823 (substitute_in_type) <ARRAY_TYPE>: Likewise.
824 * gcc-interface/utils.c (gnat_pushdecl): Always create a variant for
825 the DECL_ORIGINAL_TYPE of a type.
827 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
829 * make.adb, gnatbind.adb, g-socket.adb, sem_ch13.adb: Minor
831 * lib.ads, sem_util.adb: Minor typo in comment.
833 2016-06-20 Yannick Moy <moy@adacore.com>
835 * sem_prag.adb, sem_prag.ads (Build_Pragma_Check_Equivalent):
836 Add parameter Keep_Pragma_Id to optionally keep
837 the identifier of the pragma instead of converting
838 to pragma Check. Also set type of new function call
839 appropriately. (Collect_Inherited_Class_Wide_Conditions):
840 Call Build_Pragma_Check_Equivalent with the new parameter
841 Keep_Pragma_Id set to True to keep the identifier of the copied
843 * sinfo.ads: Add comment.
845 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
847 * exp_ch7.adb (Build_Invariant_Procedure_Body):
848 Always install the scope of the invariant procedure
849 in order to produce better error messages. Do not
850 insert the body when the context is a generic unit.
851 (Build_Invariant_Procedure_Declaration): Perform minimal
852 decoration of the invariant procedure and its formal parameter
853 in case they are not analyzed. Do not insert the declaration
854 when the context is a generic unit.
856 2016-06-20 Ed Schonberg <schonberg@adacore.com>
858 * sem_ch13.adb (Visible_Component): New procedure, subsidiary
859 of Replace_Type_References_ Generic, to determine whether an
860 identifier in a predicate or invariant expression is a visible
861 component of the type to which the predicate or invariant
862 applies. Implements the visibility rule stated in RM 13.1.1
865 2016-06-20 Hristian Kirtchev <kirtchev@adacore.com>
867 * s-regpat.adb, sem_prag.adb, pprint.adb, sem_ch13.adb: Minor
870 2016-06-20 Tristan Gingold <gingold@adacore.com>
872 * make.adb (Check_Standard_Library): Consider system.ads
873 if s-stalib.adb is not available.
874 * gnatbind.adb (Add_Artificial_ALI_File): New procedure extracted from
877 2016-06-20 Thomas Quinot <quinot@adacore.com>
879 * g-socket.adb (Is_IP_Address): A string consisting in digits only is
882 2016-06-20 Arnaud Charlet <charlet@adacore.com>
884 * exp_ch7.adb (Build_Invariant_Procedure_Body):
885 decorate invariant procedure body with typical properties of
888 2016-06-20 Arnaud Charlet <charlet@adacore.com>
890 * a-exetim-darwin.adb: New file.
892 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
894 * atree.ads, atree.adb (Elist29): New routine.
895 (Set_Elist29): New routine.
896 * atree.h New definition for Elist29.
897 * einfo.adb Subprograms_For_Type is now an Elist rather than
898 a node. Has_Invariants is now a synthesized attribute
899 and does not require a flag. Has_Own_Invariants
900 is now Flag232. Has_Inherited_Invariants is
901 Flag291. Is_Partial_Invariant_Procedure is Flag292.
902 (Default_Init_Cond_Procedure): Reimplemented.
903 (Has_Inherited_Invariants): New routine.
904 (Has_Invariants): Reimplemented.
905 (Has_Own_Invariants): New routine.
906 (Invariant_Procedure): Reimplemented.
907 (Is_Partial_Invariant_Procedure): New routine.
908 (Partial_Invariant_Procedure): Reimplemented.
909 (Predicate_Function): Reimplemented.
910 (Predicate_Function_M): Reimplemented.
911 (Set_Default_Init_Cond_Procedure): Reimplemented.
912 (Set_Has_Inherited_Invariants): New routine.
913 (Set_Has_Invariants): Removed.
914 (Set_Has_Own_Invariants): New routine.
915 (Set_Invariant_Procedure): Reimplemented.
916 (Set_Is_Partial_Invariant_Procedure): New routine.
917 (Set_Partial_Invariant_Procedure): Reimplemented.
918 (Set_Predicate_Function): Reimplemented.
919 (Set_Predicate_Function_M): Reimplemented.
920 (Set_Subprograms_For_Type): Reimplemented.
921 (Subprograms_For_Type): Reimplemented.
922 (Write_Entity_Flags): Output Flag232 and Flag291.
923 * einfo.ads Add new attributes Has_Inherited_Invariants
924 Has_Own_Invariants Is_Partial_Invariant_Procedure
925 Partial_Invariant_Procedure Change the documentation
926 of attributes Has_Inheritable_Invariants Has_Invariants
927 Invariant_Procedure Is_Invariant_Procedure Subprograms_For_Type
928 (Has_Inherited_Invariants): New routine along with pragma Inline.
929 (Has_Own_Invariants): New routine along with pragma Inline.
930 (Is_Partial_Invariant_Procedure): New routine along with pragma Inline.
931 (Partial_Invariant_Procedure): New routine.
932 (Set_Has_Inherited_Invariants): New routine along with pragma Inline.
933 (Set_Has_Invariants): Removed along with pragma Inline.
934 (Set_Has_Own_Invariants): New routine along with pragma Inline.
935 (Set_Is_Partial_Invariant_Procedure): New routine
936 along with pragma Inline.
937 (Set_Partial_Invariant_Procedure): New routine.
938 (Set_Subprograms_For_Type): Update the signature.
939 (Subprograms_For_Type): Update the signature.
940 * exp_ch3.adb Remove with and use clauses for Sem_Ch13.
941 (Build_Array_Invariant_Proc): Removed.
942 (Build_Record_Invariant_Proc): Removed.
943 (Freeze_Type): Build the body of the invariant procedure.
944 (Insert_Component_Invariant_Checks): Removed.
945 * exp_ch7.adb Add with and use clauses for Sem_Ch6, Sem_Ch13,
947 (Build_Invariant_Procedure_Body): New routine.
948 (Build_Invariant_Procedure_Declaration): New routine.
949 * exp_ch7.ads (Build_Invariant_Procedure_Body): New routine.
950 (Build_Invariant_Procedure_Declaration): New routine.
951 * exp_ch9.adb (Build_Corresponding_Record): Do not propagate
952 attributes related to invariants to the corresponding record
953 when building the corresponding record. This is done by
954 Build_Invariant_Procedure_Declaration.
955 * exp_util.adb (Make_Invariant_Call): Reimplemented.
956 * freeze.adb (Freeze_Array_Type): An array type requires an
957 invariant procedure when its component type has invariants.
958 (Freeze_Record_Type): A record type requires an invariant
959 procedure when at least one of its components has an invariant.
960 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Inherit
961 invariant-related attributes.
962 (Analyze_Subtype_Declaration):
963 Inherit invariant-related attributes.
964 (Build_Derived_Record_Type): Inherit invariant-related attributes.
965 (Check_Duplicate_Aspects): Reimplemented.
966 (Get_Partial_View_Aspect): New routine.
967 (Process_Full_View): Inherit invariant-related attributes. Reimplement
968 the check on hidden inheritance of class-wide invariants.
969 (Remove_Default_Init_Cond_Procedure): Reimplemented.
970 * sem_ch6.adb (Analyze_Subprogram_Specification): Do not modify
971 the controlling type for an invariant procedure declaration
973 (Is_Invariant_Procedure_Or_Body): New routine.
974 * sem_ch7.adb (Analyze_Package_Specification): Build the partial
975 invariant body in order to preanalyze and resolve all invariants
976 of a private type at the end of the visible declarations. Build
977 the full invariant body in order to preanalyze and resolve
978 all invariants of a private type's full view at the end of
979 the private declarations.
980 (Preserve_Full_Attributes): Inherit invariant-related attributes.
981 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Ensure that
982 aspects are analyzed with the proper view when the protected type
983 is a completion of a private type. Inherit invariant-related attributes.
984 (Analyze_Task_Type_Declaration): Ensure that
985 aspects are analyzed with the proper view when the task type
986 is a completion of a private type. Inherit invariant-related
988 * sem_ch13.adb Remove with and use clauses for Stringt.
989 (Build_Invariant_Procedure_Declaration): Removed.
990 (Build_Invariant_Procedure): Removed.
991 (Freeze_Entity_Checks): Do not build the body of the invariant
993 The body is built when the type is frozen in Freeze_Type.
994 (Inherit_Aspects_At_Freeze_Point): Do not inherit any attributes
995 related to invariants here because this leads to erroneous
997 (Replace_Node): Rename to Replace_Type_Ref.
998 * sem_ch13.ads (Build_Invariant_Procedure_Declaration): Removed.
999 (Build_Invariant_Procedure): Removed.
1000 * sem_prag.adb Add with and use clauses for Exp_Ch7.
1001 (Analyze_Pragma): Reimplement the analysis of pragma Invariant.
1002 * sem_res.adb (Resolve_Actuals): Emit a specialized error when
1003 the context is an invariant.
1004 * sem_util.adb (Get_Views): New routine.
1005 (Incomplete_Or_Partial_View): Consider generic packages when
1006 examining declarations.
1007 (Inspect_Decls): Consider full type
1008 declarations because they may denote a derivation from a
1010 (Propagate_Invariant_Attributes): New routine.
1011 * sem_util.ads (Get_Views): New routine.
1012 (Propagate_Invariant_Attributes): New routine.
1014 2016-06-16 Arnaud Charlet <charlet@adacore.com>
1016 * pprint.adb (Expression_Image): Add better handling of UCs,
1017 we don't want to strip them all for clarity.
1020 2016-06-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
1022 * exp_util.adb (Safe_Unchecked_Type_Conversion): Use "alignment"
1023 instead of "alignement".
1025 2016-06-16 Gary Dismukes <dismukes@adacore.com>
1027 * sem_util.adb: Minor typo fix.
1029 2016-06-16 Emmanuel Briot <briot@adacore.com>
1031 * s-regpat.adb: Further fix for invalid index in GNAT.Regexp.
1033 2016-06-16 Eric Botcazou <ebotcazou@adacore.com>
1035 * sem_ch13.adb (Validate_Address_Clauses): Use the same logic to
1036 issue the warning on the offset for the size as for the alignment
1037 and tweak the wording for the sake of consistency.
1039 2016-06-16 Ed Schonberg <schonberg@adacore.com>
1041 * sem_prag.adb (Check_Class_Wide_COndition): New procedure,
1042 subsidiary of Analyze_Pre_Post_ Condition_In_Decl_Part, to
1043 check legality rules that follow from the revised semantics of
1044 class-wide pre/postconditions described in AI12-0113.
1045 (Build_Pragma_Check_Equivalent): Abstract subprogram declarations
1046 must be included in list of overriding primitives of a derived
1049 2016-06-16 Ed Schonberg <schonberg@adacore.com>
1051 * sem_util.adb (May_Be_Lvalue): An actual in an unexpanded
1052 attribute reference 'Read is an assignment and must be considered
1053 a modification of the object.
1055 2016-06-16 Gary Dismukes <dismukes@adacore.com>
1057 * einfo.adb: Minor editorial.
1059 2016-06-16 Ed Schonberg <schonberg@adacore.com>
1061 * sem_prag.adb (Overridden_Ancestor): Clean up code to use
1062 controlling type of desired primitive rather than its scope,
1063 because the primitive that inherits the classwide condition may
1064 comes from several derivation steps.
1066 2016-06-16 Javier Miranda <miranda@adacore.com>
1068 * einfo.adb (Set_Default_Init_Cond_Procedure): Allow calls setting
1069 this attribute to Empty (only if the attribute has not been set).
1070 * sem_util.adb (Build_Default_Init_Cond_Procedure_Body):
1071 No action needed if the spec was not built.
1072 (Build_Default_Init_Cond_Procedure_Declaration): The spec is
1073 not built if DIC is set to NULL or no condition was specified.
1074 * exp_ch3.adb (Expand_N_Object_Declaration): Check availability
1075 of the Init_Cond procedure before generating code to call it.
1077 2016-06-16 Emmanuel Briot <briot@adacore.com>
1079 * s-regpat.adb: Fix invalid index check when matching end-of-line
1082 2016-06-16 Arnaud Charlet <charlet@adacore.com>
1084 * gnat1drv.adb: Minor reformatting.
1086 2016-06-16 Ed Schonberg <schonberg@adacore.com>
1088 * sem_ch3.adb (Check_Entry_Contracts): New procedure, subsidiary
1089 of Analyze_Declarations, that performs pre-analysis of
1090 pre/postconditions on entry declarations before full analysis
1091 is performed after entries have been converted into procedures.
1092 Done solely to capture semantic errors.
1093 * sem_attr.adb (Analyze_Attribute, case 'Result): Add guard to
1094 call to Denote_Same_Function.
1096 2016-06-16 Emmanuel Briot <briot@adacore.com>
1098 * g-comlin.adb: Fix minor memory leak in GNAT.Command_Line.
1100 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
1102 * exp_ch7.adb (Find_Last_Init): Remove obsolete code. The
1103 logic is now performed by Process_Object_Declaration.
1104 (Process_Declarations): Recognize a controlled deferred
1105 constant which is in fact initialized by means of a
1106 build-in-place function call as needing finalization actions.
1107 (Process_Object_Declaration): Insert the counter after the
1108 build-in-place initialization call for a controlled object. This
1109 was previously done in Find_Last_Init.
1110 * exp_util.adb (Requires_Cleanup_Actions): Recognize a controlled
1111 deferred constant which is in fact initialized by means of a
1112 build-in-place function call as needing finalization actions.
1114 2016-06-16 Justin Squirek <squirek@adacore.com>
1116 * exp_aggr.adb (Expand_Array_Aggregate): Minor comment changes and
1117 additional style fixes.
1118 * exp_ch7.adb: Minor typo fixes and reformatting.
1120 2016-06-16 Justin Squirek <squirek@adacore.com>
1122 * sem_ch3.adb (Analyze_Object_Declaration): Add a missing check
1123 for optimized aggregate arrays with qualified expressions.
1124 * exp_aggr.adb (Expand_Array_Aggregate): Fix block and
1125 conditional statement in charge of deciding whether to perform
1126 in-place expansion. Specifically, use Parent_Node to jump over
1127 the qualified expression to the object declaration node. Also,
1128 a check has been inserted to skip the optimization if SPARK 2005
1129 is being used in strict adherence to RM 4.3(5).
1131 2016-06-16 Tristan Gingold <gingold@adacore.com>
1133 * sem_prag.adb (Analyze_Pragma): Simplify code
1134 for Pragma_Priority.
1136 2016-06-16 Eric Botcazou <ebotcazou@adacore.com>
1138 * sem_util.ads (Indexed_Component_Bit_Offset): Declare.
1139 * sem_util.adb (Indexed_Component_Bit_Offset): New
1140 function returning the offset of an indexed component.
1141 (Has_Compatible_Alignment_Internal): Call it.
1142 * sem_ch13.adb (Offset_Value): New function returning the offset of an
1143 Address attribute reference from the underlying entity.
1144 (Validate_Address_Clauses): Call it and take the offset into
1145 account for the size warning.
1147 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
1149 * bindgen.adb, exp_util.adb, sem_ch9.adb, sem_util.adb: Minor
1152 2016-06-16 Gary Dismukes <dismukes@adacore.com>
1154 * sem_ch9.adb, sem_util.ads, sem_res.adb: Minor reformatting and typo
1157 2016-06-16 Javier Miranda <miranda@adacore.com>
1159 * sem_res.adb (Resolve): Under relaxed RM semantics silently
1160 replace occurrences of null by System.Null_Address.
1161 * sem_ch4.adb (Analyze_One_Call, Operator_Check): Under
1162 relaxed RM semantics silently replace occurrences of null by
1163 System.Null_Address.
1164 * sem_util.ad[sb] (Null_To_Null_Address_Convert_OK): New subprogram.
1165 (Replace_Null_By_Null_Address): New subprogram.
1167 2016-06-16 Bob Duff <duff@adacore.com>
1169 * exp_util.adb (Is_Controlled_Function_Call):
1170 This was missing the case where the call is in prefix format,
1171 with named notation, as in Obj.Func (Formal => Actual).
1173 2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
1175 * exp_attr.adb, inline.adb, sem_attr.adb, sem_elab.adb: Minor
1178 2016-06-16 Bob Duff <duff@adacore.com>
1180 * sem_util.adb (Collect): Avoid Empty Full_T. Otherwise Etype
1181 (Full_T) crashes when assertions are on.
1182 * sem_ch12.adb (Matching_Actual): Correctly handle the case where
1183 "others => <>" appears in a generic formal package, other than
1186 2016-06-16 Arnaud Charlet <charlet@adacore.com>
1188 * usage.adb: Remove confusing comment in usage line.
1189 * bindgen.adb: Fix binder generated file in codepeer mode wrt
1192 2016-06-16 Javier Miranda <miranda@adacore.com>
1194 * restrict.adb (Check_Restriction_No_Use_Of_Entity): Avoid
1195 never-ending loop, code cleanup; adding also support for Text_IO.
1196 * sem_ch8.adb (Find_Expanded_Name): Invoke
1197 Check_Restriction_No_Use_Entity.
1199 2016-06-16 Tristan Gingold <gingold@adacore.com>
1201 * exp_ch9.adb: Minor comment fix.
1202 * einfo.ads (Has_Protected): Clarify comment.
1203 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Do not
1204 consider private protected types declared in the runtime for
1205 the No_Local_Protected_Types restriction.
1207 2016-06-14 Ed Schonberg <schonberg@adacore.com>
1209 * sem_ch6.adb (Set_Actual_Subtypes): Do not generate actual
1210 subtypes for unconstrained formals when analyzing the generated
1211 body of an expression function, because it may lead to premature
1212 and misplaced freezing of the types of formals.
1214 2016-06-14 Gary Dismukes <dismukes@adacore.com>
1216 * sem_elab.adb, sem_ch4.adb: Minor reformatting and typo fix.
1218 2016-06-14 Tristan Gingold <gingold@adacore.com>
1220 * einfo.adb (Set_Has_Timing_Event): Add assertion.
1221 * sem_util.ads, sem_util.adb (Propagate_Concurrent_Flags): New
1222 name for Propagate_Type_Has_Flags.
1223 * exp_ch3.adb, sem_ch3.adb, sem_ch7.adb, sem_ch9.adb: Adjust after
1226 2016-06-14 Bob Duff <duff@adacore.com>
1228 * sem_elab.adb (Check_A_Call): Do nothing if the callee is
1229 (or is in) an instance, and the caller is outside. Misc cleanup.
1231 2016-06-14 Javier Miranda <miranda@adacore.com>
1233 * sem_ch4.adb (Analyze_Quantified_Expression):
1234 Generating C code avoid spurious warning on loop variable of
1235 inlinined postconditions.
1237 2016-06-14 Javier Miranda <miranda@adacore.com>
1239 * sem_attr.adb (Analyze_Attribute_Old_Result): Adding assertion.
1240 (Analyze_Attribute [Attribute_Old]): Generating C handle
1241 analysis of 'old in inlined postconditions.
1242 (Analyze_Attribute [Attribute_Result]): Generating C handle analysis
1243 of 'result in inlined postconditions.
1244 * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Old]):
1245 Generating C handle expansion of 'old in inlined postconditions.
1246 * inline.adb (Declare_Postconditions_Result): New subprogram.
1247 * sem_ch12.adb (Copy_Generic_Node): Copy pragmas generated from
1248 aspects when generating C code since pre/post conditions are
1249 inlined and the frontend inlining relies on this routine to
1251 * exp_ch6.adb (Inlined_Subprogram): Replace Generate_C_Code
1252 by Modify_Tree_For_C.
1253 * exp_unst.adb (Visit_Node): Searching for up-level references
1254 skip entities defined in inlined subprograms.
1256 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
1258 * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb:
1261 2016-06-14 Bob Duff <duff@adacore.com>
1263 * sem_elab.adb: Do nothing if the callee is intrinsic.
1264 * sinfo.ads, einfo.ads: Minor comment fixes.
1266 2016-06-14 Ed Schonberg <schonberg@adacore.com>
1268 * contracts.adb (Has_Null_Body): Move to sem_util, for general
1270 * sem_util.ads, sem_util.adb (Has_Null_Body): Predicate to
1271 determine when an internal procedure created for some assertion
1272 checking (e.g. type invariant) is a null procedure. Used to
1273 eliminate redundant calls to such procedures when they apply to
1274 components of composite types.
1275 * exp_ch3.adb (Build_Component_Invariant_Call): Do not add call
1276 if invariant procedure has a null body.
1278 2016-06-14 Thomas Quinot <quinot@adacore.com>
1280 * g-socket.ads (Check_Selector): Clarify effect on IN OUT socket
1283 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
1285 * exp_ch4.adb (Process_Action): Pass the action
1286 list to Process_Transient_Object.
1287 (Process_If_Case_Statements): Pass the action list to
1288 Process_Transient_Object.
1289 (Process_Transient_Object): Add new parameter Stmts and update the
1290 comment on usage. When the context is a Boolean evaluation, insert
1291 any finalization calls after the last statement of the construct.
1293 2016-06-14 Tristan Gingold <gingold@adacore.com>
1295 * einfo.adb, einfo.ads (Has_Timing_Event,
1296 Set_Has_Timing_Event): Add Has_Timing_Event flag.
1297 (Write_Entity_Flags): Display * sem_util.ads, sem_util.adb:
1298 (Propagate_Type_Has_Flags): New procedure to factorize code.
1299 * exp_ch3.adb (Expand_Freeze_Array_Type,
1300 Expand_Freeze_Record_Type): Call Propagate_Type_Has_Flags.
1301 * sem_ch3.adb (Access_Type_Decalaration): Initialize
1302 Has_Timing_Event flag. (Analyze_Object_Declaration):
1303 Move code that check No_Local_Timing_Events near
1304 the code that check No_Local_Protected_Objects.
1305 (Analyze_Private_Extension_Declaration, Array_Type_Declaration)
1306 (Build_Derived_Type, Copy_Array_Base_Type_Attributes,
1307 Process_Full_View) (Record_Type_Definition): Call
1308 Propagate_Type_Has_Flags.
1309 * sem_ch4.adb (Analyze_Allocator): Check No_Local_Timing_Events.
1310 * sem_ch7.adb (New_Private_Type): Set Has_Timing_Event on the
1312 (Uninstall_Declaration): Call Propagate_Type_Has_Flags.
1313 * sem_ch9.adb (Analyze_Protected_Definition): Call
1314 Propagate_Type_Has_Flags.
1316 2016-06-14 Arnaud Charlet <charlet@adacore.com>
1318 * sem.ads: Minor style fix.
1320 2016-06-14 Ed Schonberg <schonberg@adacore.com>
1322 * sem_ch12.adb (Analyze_Associations): An actual parameter
1323 with a box must be included in the count of actuals, to detect
1324 possible superfluous named actuals that do not match any of the
1325 formals of the generic unit in a formal package declaration.
1327 2016-06-14 Justin Squirek <squirek@adacore.com>
1329 * sem_ch3.adb (Analyze_Object_Declaration): Fix formatting
1330 of error output related to SPARK RM 6.1.7(3) and pragma
1332 * sem_ch4.adb (Analyze_Type_Conversion): Fix formatting of error
1333 output related to SPARK RM 6.1.7(3) and pragma Extensions_Visible.
1334 * sem_prag.adb (Analyze_Pragma): Fix formatting of error output
1335 related to SPARK RM 7.1.2(15) and pragma Volatile_Function
1336 so that the values True and False are no longer surrounded by
1338 * sem_res.adb (Resolve_Actuals): Fix formatting of error output
1339 related to SPARK RM 6.1.7(3) and pragma Extensions_Visible.
1341 2016-06-14 Arnaud Charlet <charlet@adacore.com>
1343 * gnat1drv.adb (Adjust_Global_Switches): Enable access checks
1345 * freeze.adb: Minor grammar fix in comment.
1346 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
1348 * lib.adb: Minor reformatting.
1349 * sem_util.adb (Is_OK_Volatile_Context): Do
1350 include Address in the supported attributes.
1352 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
1354 * exp_ch4.adb (Expand_N_Case_Expression):
1355 Code cleanup. Finalize any transient controlled
1356 objects on exit from a case expression alternative.
1357 (Expand_N_If_Expression): Code cleanup.
1358 (Process_Actions): Removed.
1359 (Process_If_Case_Statements): New routine.
1360 (Process_Transient_Object): Change the name of formal Rel_Node to
1361 N and update all occurrences. Update the comment on usage. When
1362 the type of the context is Boolean, the proper insertion point
1363 for the finalization call is after the last declaration.
1365 2016-06-14 Ed Schonberg <schonberg@adacore.com>
1367 * lib-xref.ads, lib-xref.adb (Has_Deferred_Reference): new
1368 predicate to determine whether an entity appears in a context
1369 for which a Deferred_Reference was created, because it is not
1370 possible to determine when reference is analyzed whether it
1371 appears in a context in which the entity is modified.
1372 * sem_ch5.adb (Analyze_Statement): Do not emit a useless warning
1373 on assignment for an entity that has a deferred_reference.
1375 2016-06-14 Javier Miranda <miranda@adacore.com>
1377 * sem_res.adb (Resolve_Actuals): Generate a reference to actuals that
1378 come from source. Previously the reference was generated only if the
1379 call comes from source but the call may be rewritten by the expander
1380 thus causing the notification of spurious warnings.
1382 2016-06-14 Arnaud Charlet <charlet@adacore.com>
1384 * gnat1drv.adb: Remove further references to AAMP.
1385 * checks.adb (Apply_Scalar_Range_Check): Take
1386 Check_Float_Overflow info account.
1387 * live.ads, live.adb Added subprogram headers and
1388 start-of-processing-for comments.
1389 * sem_ch12.adb (Instantiate_Package_Body): Do not suppress
1390 checks when instantiating runtime units in CodePeer mode.
1392 2016-06-14 Arnaud Charlet <charlet@adacore.com>
1394 * exp_ch3.adb (Expand_N_Object_Declaration): Only consider
1397 2016-06-14 Arnaud Charlet <charlet@adacore.com>
1399 * switch-c.adb, gnat1drv.adb (Adjust_Global_Switches): Only disable
1400 simple value propagation in CodePeer mode when warnings are disabled.
1401 (Scan_Front_End_Switches): Enable relevant front-end switches
1404 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com>
1406 * sem_util.adb (Is_OK_Volatile_Context): A
1407 reference to a volatile object is considered OK if appears as
1408 the prefix of attributes Address, Alignment, Component_Size,
1409 First_Bit, Last_Bit, Position, Size, Storage_Size.
1411 2016-06-14 Yannick Moy <moy@adacore.com>
1413 * lib-xref-spark_specific.adb (Add_SPARK_File): Do not traverse
1414 subunits directly, as they are already traversed as part of the
1415 top-level unit to which they belong.
1416 (Add_SPARK_Xrefs): Add assertions to ensure correct sorting.
1417 (Generate_Dereference): Use unique definition place for special
1418 variable __HEAP, to ensure correct sorting of references.
1419 * lib-xref.adb (Generate_Reference): Use top-level unit in case
1421 * lib.adb, lib.ads (Get_Top_Level_Code_Unit): New functions that
1422 compute the top-level code unit for a source location of AST node,
1423 that go past subunits.
1425 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
1427 * gcc-interface/decl.c (gnat_to_gnu_subprog_type): Build only a minimal
1428 PARM_DECL when the parameter type is dummy.
1429 * gcc-interface/trans.c (Call_to_gnu): Translate formal types before
1432 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
1434 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
1435 PLUS_EXPR in the expression of a renaming.
1437 2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
1439 * gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Deal specially
1440 with calls to malloc.
1442 2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
1444 * gcc-interface/trans.c (build_binary_op_trapv): If no operand is a
1445 constant, use the generic implementation of the middle-end; otherwise
1446 turn the dynamic conditions into static conditions and simplify.
1448 2016-06-11 Eric Botcazou <ebotcazou@adacore.com>
1450 * gcc-interface/trans.c (Case_Statement_to_gnu): Deal with characters.
1452 2016-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
1454 * gcc-interface/decl.c (gnat_to_gnu_entity): Do not clobber
1455 gnat_entity_name with temporary names for XUP and XUT types.
1457 2016-06-10 Martin Sebor <msebor@redhat.com>
1460 * gcc/ada/gcc-interface/utils.c (handle_nonnull_attribute): Accept
1461 the nonnull attribute in type-generic builtins.
1463 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1465 * gcc-interface/decl.c (Gigi_Equivalent_Type): Make sure equivalent
1466 types are present before returning them. Remove final assertion.
1467 (gnat_to_gnu_entity) <E_Access_Protected_Subprogram_Type>: Adjust to
1469 <E_Protected_Type>: Likewise.
1471 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1473 * gcc-interface/trans.c (elaborate_all_entities_for_package): Also do
1474 not elaborate Itypes.
1476 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1478 * gcc-interface/utils.c (gnat_internal_attribute_table): Add support
1479 for noinline and noclone attributes.
1480 (handle_noinline_attribute): New handler.
1481 (handle_noclone_attribute): Likewise.
1483 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1485 * gcc-interface/trans.c (process_type): Beef up comment.
1487 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1489 * gcc-interface/utils2.c (build_call_alloc_dealloc): Do not substitute
1490 placeholder expressions here but...
1491 * gcc-interface/trans.c (gnat_to_gnu) <N_Free_Statement>: ...here.
1492 Make an exception to the protection of a CALL_EXPR result with an
1493 unconstrained type only in the same cases as Call_to_gnu.
1495 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1497 * gcc-interface/trans.c (gnat_to_gnu): Rework special code dealing
1498 with boolean rvalues and set the location directly. Do not set the
1499 location in the other cases for a simple name.
1500 (gnat_to_gnu_external): Clear the location on the expression.
1502 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1504 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Component>: Remove
1505 useless 'else' statements and tidy up.
1506 <E_Array_Subtype>: Fully deal with the declaration here.
1507 <E_Incomplete_Type>: Use properly-typed constant.
1508 Assert that we don't apply the special type treatment to dummy types.
1509 Separate this treatment from the final back-annotation and simplify
1510 the condition for the RM size.
1511 (gnat_to_gnu_param): Add GNU_PARAM_TYPE parameter and adjust.
1512 (gnat_to_gnu_subprog_type): Ajust call to gnat_to_gnu_param.
1513 * gcc-interface/trans.c (gnat_to_gnu) <N_Subprogram_Declaration>: Add
1515 (process_freeze_entity): Remove obsolete code.
1516 (process_type): Minor tweaks.
1518 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1520 * einfo.ads (Returns_Limited_View): Remove.
1521 (Set_Returns_Limited_View ): Likewise.
1522 * einfo.adb (Returns_Limited_View): Likewise.
1523 (Set_Returns_Limited_View ): Likewise.
1524 * freeze.adb (Late_Freeze_Subprogram): Remove.
1525 (Freeze_Entity): Do not defer the freezing of functions returning an
1526 incomplete type coming from a limited context.
1528 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1530 * gcc-interface/gigi.h (finish_subprog_decl): Add ASM_NAME parameter.
1531 * gcc-interface/decl.c (gnu_ext_name_for_subprog): New function.
1532 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not check compatibility
1533 of profiles for builtins here... Call gnu_ext_name_for_subprog.
1534 Also update profiles if pointers to limited_with'ed types are
1536 (gnat_to_gnu_param): Restore the correct source location information
1537 for vector ABI warnings.
1538 (associate_subprog_with_dummy_type): Add comment about AI05-019.
1539 Set TYPE_DUMMY_IN_PROFILE_P flag unconditionally.
1540 (update_profile): Deal with builtin declarations.
1541 Call gnu_ext_name_for_subprog. Adjust call to finish_subprog_decl.
1542 (update_profiles_with): Add comment.
1543 (gnat_to_gnu_subprog_type): Reuse the return type if it is complete.
1544 Likewise for parameter declarations in most cases. Do not change
1545 the return type for the CICO mechanism if the profile is incomplete.
1546 ...but here instead. Always reset the slot for the parameters.
1547 * gcc-interface/utils.c (create_subprog_decl): Call
1548 gnu_ext_name_for_subprog. Do not set the assembler name here but...
1549 (finish_subprog_decl): ...but here instead. Add ASM_NAME parameter.
1551 2016-06-06 Eric Botcazou <ebotcazou@adacore.com>
1553 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Insert the
1554 declaration of the corresponding record type before that of the
1555 unprotected version of the subprograms that operate on it.
1556 (Expand_Access_Protected_Subprogram_Type): Declare the Equivalent_Type
1557 just before the original type.
1558 * sem_ch3.adb (Handle_Late_Controlled_Primitive): Point the current
1559 declaration to the newly created declaration for the primitive.
1560 (Analyze_Subtype_Declaration): Remove obsolete code forcing the
1561 freezing of the subtype before its declaration.
1562 (Replace_Anonymous_Access_To_Protected_Subprogram): Insert the new
1563 declaration in the nearest enclosing scope for formal parameters too.
1564 (Build_Derived_Access_Type): Restore the status of the created Itype
1565 after it is erased by Copy_Node.
1566 * sem_ch6.adb (Exchange_Limited_Views): Remove guard on entry.
1567 (Analyze_Subprogram_Body_Helper): Call Exchange_Limited_Views only if
1568 the specification is present.
1569 Move around the code changing the designated view of the return type
1570 and save the original view. Restore it on exit.
1571 * sem_ch13.adb (Build_Predicate_Function_Declaration): Always insert
1572 the declaration right after that of the type.
1574 2016-06-01 Simon Wright <simon@pushface.org>
1577 * g-comlin.adb (Display_Section_Help): Do not dereference
1578 Config.Switches if it's null.
1581 2016-05-31 Eric Botcazou <ebotcazou@adacore.com>
1583 * s-osinte-kfreebsd-gnu.ads (clock_getres): Define.
1584 (Get_Page_Size): Remove duplicate and return int.
1586 2016-05-31 Jan Sommer <soja-lists@aries.uberspace.de>
1589 * s-osinte-rtems.ads (clock_getres): Define.
1590 (Get_Page_Size): Remove duplicate and return int.
1592 2016-05-20 Eric Botcazou <ebotcazou@adacore.com>
1594 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
1595 Make same-sized subtypes of signed base types signed.
1596 * gcc-interface/utils.c (make_type_from_size): Adjust to above change.
1597 (unchecked_convert): Likewise.
1599 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1601 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Do not build
1602 a specific type for the object if it is deemed a constant.
1604 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1606 * freeze.adb (Freeze_Record_Type): Extend pragma Implicit_Packing to
1607 components of any elementary types and of composite types.
1609 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1611 * freeze.adb (Freeze_Array_Type): Call Addressable predicate instead
1612 of testing for individual sizes.
1613 (Freeze_Entity): Rework implementation of pragma Implicit_Packing for
1614 array types, in particular test for suitable sizes upfront and do not
1615 mimic the processing that will be redone later in Freeze_Array_Type.
1617 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1619 * gcc-interface/trans.c (elaborate_all_entities_for_package): Also skip
1622 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1624 * doc/gnat_rm/implementation_defined_attributes.rst
1625 (Scalar_Storage_Order): Adjust restriction for packed array types.
1626 * einfo.ads (Is_Bit_Packed_Array): Adjust description.
1627 (Is_Packed): Likewise.
1628 (Is_Packed_Array_Impl_Type): Likewise.
1629 (Packed_Array_Impl_Type): Likewise.
1630 * exp_ch4.adb (Expand_N_Indexed_Component): Do not do anything special
1631 if the prefix is not a packed array implemented specially.
1632 * exp_ch6.adb (Expand_Actuals): Expand indexed components only for
1633 bit-packed array types.
1634 * exp_pakd.adb (Install_PAT): Set Is_Packed_Array_Impl_Type flag on
1635 the PAT before analyzing its declaration.
1636 (Create_Packed_Array_Impl_Type): Remove redundant statements.
1637 * freeze.adb (Check_Component_Storage_Order): Reject packed array
1638 components only if they are bit packed.
1639 (Freeze_Array_Type): Fix logic detecting bit packing and do not bit
1640 pack for composite types whose size is multiple of a byte.
1641 Create the implementation type for packed array types only when it is
1642 needed, i.e. bit packing or packing because of holes in index types.
1643 Make sure the Has_Non_Standard_Rep and Is_Packed flags agree.
1644 * gcc-interface/gigi.h (make_packable_type): Add MAX_ALIGN parameter.
1645 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
1646 Call maybe_pad_type instead of building the padding type manually.
1647 (gnat_to_gnu_entity) <E_Array_Subtype>: Do not assert that
1648 Packed_Array_Impl_Type is present for packed arrays.
1649 (gnat_to_gnu_component_type): Also handle known alignment for packed
1650 types by passing it to make_packable_type.
1651 * gcc-interface/utils.c (make_packable_type): Add MAX_ALIGN parameter
1652 and deal with it in the array case. Adjust recursive call. Simplify
1653 computation of new size and cap the alignment to BIGGEST_ALIGNMENT.
1655 2016-05-16 Thomas Quinot <quinot@adacore.com>
1657 * freeze.adb (Check_Component_Storage_Order): Also get full view of
1660 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1662 * exp_util.adb (Remove_Side_Effects): Also make a constant if we need
1663 to capture the value for a small not by-reference record type.
1664 * freeze.ads (Check_Compile_Time_Size): Adjust comment.
1665 * freeze.adb (Set_Small_Size): Likewise. Accept a size in the range
1667 (Check_Compile_Time_Size): Merge scalar and access type cases. Change
1668 variable name in array type case. For the computation of the packed
1669 size, deal with record components and remove redundant test.
1670 (Freeze_Array_Type): Also adjust packing status when the size of the
1671 component type is in the range 33 .. 64 bits.
1672 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Turn primitive
1673 into elementary type throughout. Minor tweaks.
1674 (Alignment Clauses): Document actual alignment of packed array types.
1675 (Pragma Pack for Arrays): List only the 3 main cases and adjust. Add
1676 "simple" to the record case. Document effect on non packable types.
1677 (Pragma Pack for Records): Likewise. Add record case and adjust.
1679 2016-05-16 Eric Botcazou <ebotcazou@adacore.com>
1681 * gcc-interface/Make-lang.in (GNATMAKE_FOR_HOST): In the canadian
1682 cross case, use host_noncanonical instead of host as prefix.
1683 (GNATBIND_FOR_HOST): Likewise.
1684 (GNATLINK_FOR_HOST): Likewise.
1685 (GNATLS_FOR_HOST): Likewise.
1687 2016-05-06 Eric Botcazou <ebotcazou@adacore.com>
1690 * system-darwin-ppc64.ads: Add pragma No_Elaboration_Code_All.
1691 * system-linux-armeb.ads: Likewise.
1692 * system-linux-mips64el.ads: Likewise.
1693 * system-linux-mips.ads: Likewise.
1694 * system-linux-mipsel.ads: Likewise.
1695 * system-linux-ppc64.ads: Likewise.
1696 * system-linux-sparcv9.ads: Likewise.
1697 * system-rtems.ads: Likewise.
1699 2016-05-04 Samuel Thibault <samuel.thibault@ens-lyon.org>
1701 * s-osinte-gnu.ads (Get_Page_Size): Return int and use getpagesize
1702 instead of __getpagesize.
1704 2016-05-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1706 * gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
1709 2016-05-02 Tristan Gingold <gingold@adacore.com>
1711 * fname.adb (Is_Predefined_File_Name): Also consider non-krunched
1714 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1716 * sem_util.adb (Aggregate_Constraint_Checks): Separate
1717 accessibility checks and non-null checks for aggregate components,
1718 to prevent spurious accessibility errors.
1720 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1722 * sem_ch3.adb (OK_For_Limited_Init): A type conversion is not
1723 always legal in the in-place initialization of a limited entity
1724 (e.g. an allocator).
1725 * sem_res.adb (Resolve_Allocator): Improve error message with RM
1726 reference when allocator expression is illegal.
1728 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1730 * exp_ch6.adb (Expand_Call): When inlining a call to a function
1731 declared in a package instance, locate the instance node of the
1732 package after the actual package declaration. skipping over
1733 pragmas that may have been introduced when the generic unit
1734 carries aspects that are transformed into pragmas.
1736 2016-05-02 Bob Duff <duff@adacore.com>
1738 * s-memory.adb (Alloc, Realloc): Move checks
1739 for Size = 0 or size_t'Last into the Result = System.Null_Address
1740 path for efficiency. Improve comments (based on actual C language
1741 requirements for malloc).
1742 * exp_util.adb (Build_Allocate_Deallocate_Proc): Optimize the
1743 case where we are using the default Global_Pool_Object, and we
1744 don't need the heavy finalization machinery.
1746 2016-05-02 Gary Dismukes <dismukes@adacore.com>
1748 * exp_util.ads, sem_ch12.adb: Minor reformatting.
1750 2016-05-02 Javier Miranda <miranda@adacore.com>
1752 * exp_util.ads, exp_util.adb (Force_Evaluation): Adding new formal.
1753 (Remove_Side_Effects): Adding a new formal.
1754 * exp_ch6.adb (Expand_Simple_Function_Return): Generating the
1755 call to the _Postconditions procedure ensure that side-effects
1756 are unconditionally removed.
1758 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1760 * sem_ch12.adb (Check_Formal_Package_Instance, Check_Mismatch):
1761 Use original node to determine whether the declaration is for
1762 a formal type declaration, to take into account that formwl
1763 private types are rewritten as private extension declarations
1764 to simplify semantic analysis.
1766 2016-05-02 Gary Dismukes <dismukes@adacore.com>
1768 * exp_ch9.adb, sem_ch6.adb, sem_ch6.ads: Minor reformatting and typo
1771 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1773 * sem_ch3.adb, exp_ch9.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb: Minor
1776 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1778 * exp_ch4.adb (Expand_N_Allocator): If the designated type
1779 is a private derived type with no discriminants, examine its
1780 underlying_full_view to determine whether the full view has
1781 defaulted discriminants, so their defaults can be used in the
1782 call to the initialization procedure for the designated object.
1784 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1786 * exp_prag.adb, comperr.adb: Minor reformatting.
1788 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1790 * exp_pakd.adb (Rj_Unchecked_Convert_To): Do not perform an
1791 unchecked conversion if the source size is 0 (indicating that
1792 its RM size is unknown). This will happen with packed arrays of
1793 non-discrete types, in which case the component type is known
1796 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1798 * debug.adb: Reserve -gnatd.V.
1800 2016-05-02 Javier Miranda <miranda@adacore.com>
1802 * sem_ch3.adb (Process_Full_View): Remove from visibility
1803 wrappers of synchronized types to avoid spurious errors with
1804 their wrapped entity.
1805 * exp_ch9.adb (Build_Wrapper_Spec): Do not generate the wrapper
1806 if no interface primitive is covered by the subprogram and this is
1807 not a primitive declared between two views; see Process_Full_View.
1808 (Build_Protected_Sub_Specification): Link the dispatching
1809 subprogram with its original non-dispatching protected subprogram
1810 since their names differ.
1811 (Expand_N_Protected_Type_Declaration):
1812 If a protected subprogram overrides an interface primitive then
1813 do not build a wrapper if it was already built.
1814 * einfo.ads, einfo.adb (Original_Protected_Subprogram): New attribute.
1815 * sem_ch4.adb (Names_Match): New subprogram.
1816 * sem_ch6.adb (Check_Synchronized_Overriding): Moved
1817 to library level and defined in the public part of the
1818 package to invoke it from Exp_Ch9.Build_Wrapper_Spec
1819 (Has_Matching_Entry_Or_Subprogram): New subprogram.
1820 (Report_Conflict): New subprogram.
1822 2016-05-02 Jerome Lambourg <lambourg@adacore.com>
1824 * s-unstyp.ads: Code cleanups.
1826 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1828 * sem_ch13.adb (Size_Too_Small_Error): Fix the error message format.
1830 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1832 * exp_prag.adb (Expand_attributes_In_Consequence,
1833 Expand_Attributes): If the prefix of'Old is an unconstrained type,
1834 for example an unconstrained formal of the enclosing subprogram,
1835 create an object declaration with an expression to obtain the
1836 actual subtype of the temporary.
1838 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1840 * comperr.adb (Delete_SCIL_Files): Add missing handling of
1841 N_Subprogram_Declaration.
1843 2016-05-02 Gary Dismukes <dismukes@adacore.com>
1845 * exp_ch5.adb, exp_ch7.adb, exp_ch7.ads, checks.adb, sem_attr.adb,
1846 gnat1drv.adb, sem_ch4.adb, sem_ch13.adb: Minor reformatting and typo
1848 * sem_prag.adb, sem_ch12.adb: Minor typo fixes.
1850 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1852 * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): The
1853 function call may be wrapped in an explicit type conversion.
1855 2016-05-02 Jerome Lambourg <lambourg@adacore.com>
1857 * interfac.ads: use pragma No_Elaboration_Code_All.
1858 * s-unstyp.ads: s-unstyp.ads: use pragma No_Elaboration_Code_All.
1860 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1862 * sem.adb (Analyze: If node is an error node previously created
1863 by the parser, disable expansion to prevent subsequent glitches
1866 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1868 * sem_ch13.adb (Alignment_Error): Removed.
1869 (Get_Alignment_Value): Code cleanup.
1871 2016-05-02 Tristan Gingold <gingold@adacore.com>
1873 * sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected
1874 to check for the no local protected objects restriction.
1876 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1878 * einfo.adb Anonymous_Master now uses Node35.
1879 (Anonymous_Master): Update the assertion and node reference.
1880 (Set_Anonymous_Master): Update the assertion and node reference.
1881 (Write_Field35_Name): Add output for Anonymous_Master.
1882 (Write_Field36_Name): The output is now undefined.
1883 * einfo.ads Update the node and description of attribute
1884 Anonymous_Master. Remove prior occurrences in entities as this
1885 is now a type attribute.
1886 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove local variable
1887 Ins_Node. Anonymous access- to-controlled component types no
1888 longer need finalization masters. The master is now built when
1889 a related allocator is expanded.
1890 (Expand_Freeze_Record_Type): Remove local variable Has_AACC. Do not
1891 detect whether the record type has at least one component of anonymous
1892 access-to- controlled type. These types no longer need finalization
1893 masters. The master is now built when a related allocator is expanded.
1894 * exp_ch4.adb Remove with and use clauses for Lib and Sem_Ch8.
1895 (Current_Anonymous_Master): Removed.
1896 (Expand_N_Allocator): Call Build_Anonymous_Master to create a
1897 finalization master for an anonymous access-to-controlled type.
1898 * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
1899 Call routine Build_Anonymous_Master to create a finalization master
1900 for an anonymous access-to-controlled type.
1901 * exp_ch7.adb (Allows_Finalization_Master): New routine.
1902 (Build_Anonymous_Master): New routine.
1903 (Build_Finalization_Master): Remove formal parameter
1904 For_Anonymous. Use Allows_Finalization_Master to determine whether
1905 circumstances warrant a finalization master. This routine no
1906 longer creates masters for anonymous access-to-controlled types.
1907 (In_Deallocation_Instance): Removed.
1908 * exp_ch7.ads (Build_Anonymous_Master): New routine.
1909 (Build_Finalization_Master): Remove formal parameter For_Anonymous
1910 and update the comment on usage.
1911 * sem_util.adb (Get_Qualified_Name): New routines.
1912 (Output_Name): Reimplemented.
1913 (Output_Scope): Removed.
1914 * sem_util.ads (Get_Qualified_Name): New routines.
1916 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1918 * debug.adb: Document the use of switch -gnatd.H.
1919 * gnat1drv.adb (Adjust_Global_Switches): Set ASIS_GNSA mode when
1920 -gnatd.H is present.
1921 (Gnat1drv): Suppress the call to gigi when ASIS_GNSA mode is active.
1922 * opt.ads: Add new option ASIS_GNSA_Mode.
1923 * sem_ch13.adb (Alignment_Error): New routine.
1924 (Analyze_Attribute_Definition_Clause): Suppress certain errors in
1925 ASIS mode for attribute clause Alignment, Machine_Radix, Size, and
1927 (Check_Size): Use routine Size_Too_Small_Error to
1928 suppress certain errors in ASIS mode.
1929 (Get_Alignment_Value): Use routine Alignment_Error to suppress certain
1930 errors in ASIS mode.
1931 (Size_Too_Small_Error): New routine.
1933 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1935 * spark_xrefs.ads Description of the spark cross-references
1936 clarified; small style fixes.
1937 * lib-xref-spark_specific.adb (Add_SPARK_Scope,
1938 Detect_And_Add_SPARK_Scope): consider protected types and bodies
1939 as yet another scopes.
1940 (Enclosing_Subprogram_Or_Library_Package): refactored using
1941 Hristian's suggestions; added support for scopes of protected
1942 types and bodies; fix for entries to return the scope of the
1943 enclosing concurrent type, which is consistent with what is
1944 returned for protected subprograms.
1945 * sem_intr.adb: Minor style fix in comment.
1947 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
1949 * lib-xref.ads, lib-xref-spark_specific.adb, get_spark_xrefs.adb,
1950 put_spark_xrefs.adb: Minor reformatting.
1952 2016-05-02 Doug Rupp <rupp@adacore.com>
1954 * g-traceb.ads: Document traceback for ARM.
1956 2016-05-02 Javier Miranda <miranda@adacore.com>
1958 * exp_disp.adb (Make_Tags): Do not generate the
1959 external name of interface tags adding the suffix counter since
1960 it causes problems at link time when the IP routines are inlined
1961 across units with optimization.
1963 2016-05-02 Ed Schonberg <schonberg@adacore.com>
1965 * einfo.ads, einfo.adb (Predicates_Ignared): new flag to indicate
1966 that predicate checking is disabled for predicated subtypes in
1967 the context of an Assertion_Policy pragma.
1968 * checks.adb (Apply_Predicate_Check): Do nothing if
1969 Predicates_Ignored is true.
1970 * exp_ch3.adb (Expand_Freeze_Enumeration_Type): If
1971 Predicates_Ignores is true, the function Rep_To_Pos does raise
1972 an exception for invalid data.
1973 * exp_ch4.adb (Expand_N_Type_Conversion): IF target is a predicated
1974 type do not apply check if Predicates_Ignored is true.
1975 * exp_ch5.adb (Expand_N_Case_Statement): If Predicates_Ignored
1976 is true, sem_prag.adb:
1977 * sem_ch3.adb (Analyze_Object_Declaration): If Predicates_Ignored
1978 is true do not emit predicate check on initializing expression.
1980 2016-05-02 Arnaud Charlet <charlet@adacore.com>
1982 * get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when
1983 they are declared; refine type of a counter from Integer to Natural.
1984 * sem_ch5.adb, gnatcmd.adb, s-intman-posix.adb, eval_fat.adb,
1985 prj.adb, sem_util.adb, s-intman-android.adb, prj-nmsc.adb, sem_ch8.adb,
1986 exp_ch3.adb: Minor editing.
1988 2016-05-02 Yannick Moy <moy@adacore.com>
1990 * a-tigeli.adb (Get_Line): Always set Last prior to returning.
1992 2016-05-02 Yannick Moy <moy@adacore.com>
1994 * lib-xref.adb: Minor style fix in whitespace of declarations.
1995 * put_spark_xrefs.adb (Put_SPARK_Xrefs): printing of strings
1996 refactored without loops.
1997 * put_spark_xrefs.ads (Write_Info_Str): new formal argument of
1999 * spark_xrefs.adb (Write_Info_Str): new actual in instantiation
2000 of generic procedure.
2002 2016-05-02 Arnaud Charlet <charlet@adacore.com>
2004 * lib-xref-spark_specific.adb (Add_SPARK_Scope): add task type scope.
2005 (Detect_And_Add_SPARK_Scope): detect and add task type scope.
2006 (Enclosing_Subprogram_Or_Package): Respect boundaries of task
2007 and entry declarations.
2008 * spark_xrefs.ads: minor typo in comment.
2010 2016-05-02 Arnaud Charlet <charlet@adacore.com>
2012 * make.adb: Minor: avoid an exception when calling gnatmake with
2013 no argument and gnatmake is built with checks on.
2014 * lib-xref-spark_specific.adb: Minor code cleanup.
2016 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2018 * sem_util.adb (Normalize_Actuals): Take into account extra
2019 actuals that may have been introduced previously. Normally extra
2020 actuals are introduced when a call is expanded, but a validity
2021 check may copy and reanalyze a call that carries an extra actual
2022 (e.g. an accessibility parameter) before the call itself is
2023 marked Analzyed, and the analysis of the copy has to be able to
2024 cope with the added actual.
2026 2016-05-02 Bob Duff <duff@adacore.com>
2028 * sem_ch10.adb (Analyze_Compilation_Unit): Preserve
2029 treeishness. Previous version had Context_Items shared between
2032 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2034 * sem_aggr.adb (Resolve_Aggr_Expression): For both array and
2035 record cases, apply predicate check on component for expression
2036 only if expression has been analyzed already. For expressions
2037 that need to be duplicated when they cover multiple components,
2038 resolution and predicate checking take place later.
2040 2016-05-02 Olivier Hainque <hainque@adacore.com>
2042 * a-direct.adb (Delete_Tree): Use full names to designate subdirs
2043 and files therein, instead of local names after a change of
2046 2016-05-02 Thomas Quinot <quinot@adacore.com>
2048 * freeze.adb (Check_Component_Storage_Order): Get full view of
2051 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2053 * checks.adb, freeze.adb, sem_res.adb, s-stposu.adb, repinfo.adb:
2056 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com>
2058 * sem_ch4.adb (Find_Indexing_Operations): Use the underlying type
2059 of the container base type in case the container is a subtype.
2060 * sem_ch5.adb (Analyze_Iterator_Specification): Ensure that
2061 the selector has an entity when checking for a component of a
2064 2016-05-02 Arnaud Charlet <charlet@adacore.com>
2067 * opt.ads (Latest_Ada_Only): New flag.
2068 * sem_prag.adb, par-prag.adb: Ignore pragma Ada_xx under this flag.
2069 * usage.adb, switch-c.adb: Disable support for -gnatxx under this flag.
2070 * einfo.ads (Has_Predicates, Predicate_Function):
2071 Clarify that Has_Predicates does not imply that Predicate_Function
2072 will return a non-empty entity.
2074 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2076 * sem_res.adb (Resolve_Qualified_Expression): Generate a predicate
2077 check if type requires it.
2078 * checks.adb (Apply_Predicate_Check): Disable checks in the
2079 object declaration created for an expression with side-effects
2080 that requires a predicate check to prevent infinite recursion
2083 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2085 * sem_ch6.adb (Process_Formals): Check properly the type of a
2086 formal to determine whether a given convention applies to it.
2088 2016-05-02 Doug Rupp <rupp@adacore.com>
2090 * tracebak.c: Add incantations for arm-vxworks[67] traceback.
2092 2016-05-02 Thomas Quinot <quinot@adacore.com>
2094 * freeze.adb (Check_Component_Storage_Order): Make it a warning, not an
2095 error, to have a component with implicit SSO within a composite type
2096 that has explicit SSO.
2098 2016-05-02 Bob Duff <duff@adacore.com>
2100 * s-stposu.adb (Allocate_Any_Controlled): Don't lock/unlock twice.
2102 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2104 * repinfo.adb (List_Entities): Make procedure recursive, to
2105 provide representation information for subprograms declared
2106 within subprogram bodies.
2108 2016-05-02 Arnaud Charlet <charlet@adacore.com>
2110 * exp_ch5.adb, layout.adb, gnatcmd.adb exp_attr.adb, make.adb,
2111 bindgen.adb, debug.adb, exp_pakd.adb, freeze.adb, sem_util.adb,
2112 gnatlink.adb, switch-m.adb, exp_ch4.adb, repinfo.adb, adabkend.adb,
2113 osint.adb: Remove dead code.
2115 2016-05-02 Yannick Moy <moy@adacore.com>
2117 * a-tigeli.adb (Get_Line): Fix bound for test to
2118 decide when to compensate for character 0 added by call to fgets.
2120 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2122 * sem_ch4.adb (Analyze_Allocator): If the expression does not
2123 have a subtype indication and the type is an unconstrained tagged
2124 type with defaulted discriminants, create an explicit constraint
2125 for it during analysis to prevent out-of-order freezing actions
2126 on generated classwide types.
2128 2016-05-02 Javier Miranda <miranda@adacore.com>
2130 * exp_ch5.adb (Expand_N_Assignment_Statement):
2131 In the runtime check that ensures that the tags of source an
2132 target match, add missing displacement of the pointer to the
2133 objects if they cover interface types.
2135 2016-05-02 Ed Schonberg <schonberg@adacore.com>
2137 * sem_attr.adb (Analyze_Attribute, case 'Old): Do not use
2138 base type for attribute when type is discrete: transformation
2139 is not needed for such types, and leads to spurious errors if
2140 the context is a case construct.
2142 2016-05-02 Eric Botcazou <ebotcazou@adacore.com>
2144 * gcc-interface/decl.c (elaborate_reference_1): Do not bother about
2145 operand #2 for COMPONENT_REF.
2146 * gcc-interface/utils2.c (gnat_save_expr): Likewise.
2147 (gnat_protect_expr): Likewise.
2148 (gnat_stabilize_reference_1): Likewise.
2149 (gnat_rewrite_reference): Do not bother about operand #3 for ARRAY_REF.
2150 (get_inner_constant_reference): Likewise.
2151 (gnat_invariant_expr): Likewise.
2152 * gcc-interface/trans.c (fold_constant_decl_in_expr): Likewise.
2154 2016-05-02 Eric Botcazou <ebotcazou@adacore.com>
2156 * gcc-interface/trans.c (Range_to_gnu): New static function.
2157 (Raise_Error_to_gnu) <N_In>: Call it to translate the range.
2158 (gnat_to_gnu) <N_In>: Likewise.
2160 2016-04-30 Eric Botcazou <ebotcazou@adacore.com>
2162 * gcc-interface/Make-lang.in (ACATSCMD): New variable.
2163 (check-acats): Use it.
2164 (check_acats_targets): Likewise.
2166 2016-04-28 Eric Botcazou <ebotcazou@adacore.com>
2169 * a-textio.adb (Get_Immediate): Add missing 'not' in expression.
2171 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
2173 * sem_aux.adb (Is_By_Reference_Type): Also return true for a tagged
2174 incomplete type without full view.
2175 * sem_ch6.adb (Exchange_Limited_Views): Change into a function and
2176 return the list of changes.
2177 (Restore_Limited_Views): New procedure to undo the transformation made
2178 by Exchange_Limited_Views.
2179 (Analyze_Subprogram_Body_Helper): Adjust call to Exchange_Limited_Views
2180 and call Restore_Limited_Views at the end, if need be.
2181 (Possible_Freeze): Do not delay freezing because of incomplete types.
2182 (Process_Formals): Remove kludges for class-wide types.
2183 * types.h (By_Copy_Return): Delete.
2184 * gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): Move around.
2185 (TYPE_DUMMY_IN_PROFILE_P): New macro.
2186 * gcc-interface/gigi.h (update_profiles_with): Declare.
2187 (finish_subprog_decl): Likewise.
2188 (get_minimal_subprog_decl): Delete.
2189 (create_subprog_type): Likewise.
2190 (create_param_decl): Adjust prototype.
2191 (create_subprog_decl): Likewise.
2192 * gcc-interface/decl.c (defer_limited_with): Rename into...
2193 (defer_limited_with_list): ...this.
2194 (gnat_to_gnu_entity): Adjust to above renaming.
2195 (finalize_from_limited_with): Likewise.
2196 (tree_entity_vec_map): New structure.
2197 (gt_pch_nx): New helpers.
2198 (dummy_to_subprog_map): New hash table.
2199 (gnat_to_gnu_param): Set the SLOC here. Remove MECH parameter and
2200 add FIRST parameter. Deal with the mechanism here instead of...
2201 Do not make read-only variant of types. Simplify expressions.
2202 In the by-ref case, test the mechanism before must_pass_by_ref
2203 and also TYPE_IS_BY_REFERENCE_P before building the reference type.
2204 (gnat_to_gnu_subprog_type): New static function extracted from...
2205 Do not special-case the type_annotate_only mode. Call
2206 gnat_to_gnu_profile_type instead of gnat_to_gnu_type on return type.
2207 Deal with dummy return types. Likewise for parameter types. Deal
2208 with by-reference types explicitly and add a kludge for null procedures
2209 with untagged incomplete types. Remove assertion on the types and be
2210 prepared for multiple elaboration of the declarations. Skip the whole
2211 CICO processing if the profile is incomplete. Handle the completion of
2212 a previously incomplete profile.
2213 (gnat_to_gnu_entity) <E_Variable>: Rename local variable.
2214 Adjust couple of calls to create_param_decl.
2215 <E_Access_Subprogram_Type, E_Anonymous_Access_Subprogram_Type>:
2216 Remove specific deferring code.
2217 <E_Access_Type>: Also deal with E_Subprogram_Type designated type.
2218 Simplify handling of dummy types and remove obsolete comment.
2219 Constify a couple of variables. Do not set TYPE_UNIVERSAL_ALIASING_P
2221 <E_Access_Subtype>: Tweak comment and simplify condition.
2222 <E_Subprogram_Type>: ...here. Call it and clean up handling. Remove
2223 obsolete comment and adjust call to gnat_to_gnu_param. Adjust call to
2224 create_subprog_decl.
2225 <E_Incomplete_Type>: Add a couple of 'const' qualifiers and get rid of
2226 inner break statements. Tidy up condition guarding direct use of the
2228 (get_minimal_subprog_decl): Delete.
2229 (finalize_from_limited_with): Call update_profiles_with on dummy types
2230 with TYPE_DUMMY_IN_PROFILE_P set.
2231 (is_from_limited_with_of_main): Delete.
2232 (associate_subprog_with_dummy_type): New function.
2233 (update_profile): Likewise.
2234 (update_profiles_with): Likewise.
2235 (gnat_to_gnu_profile_type): Likewise.
2236 (init_gnat_decl): Initialize dummy_to_subprog_map.
2237 (destroy_gnat_decl): Destroy dummy_to_subprog_map.
2238 * gcc-interface/misc.c (gnat_get_alias_set): Add guard for accessing
2239 TYPE_UNIVERSAL_ALIASING_P.
2240 (gnat_get_array_descr_info): Minor tweak.
2241 * gcc-interface/trans.c (gigi): Adjust calls to create_subprog_decl.
2242 (build_raise_check): Likewise.
2243 (Compilation_Unit_to_gnu): Likewise.
2244 (Identifier_to_gnu): Accept mismatches coming from a limited context.
2245 (Attribute_to_gnu): Remove kludge for dispatch table entities.
2246 (process_freeze_entity): Do not retrieve old definition if there is an
2247 address clause on the entity. Call update_profiles_with on dummy types
2248 with TYPE_DUMMY_IN_PROFILE_P set.
2249 * gcc-interface/utils.c (build_dummy_unc_pointer_types): Also set
2250 TYPE_REFERENCE_TO to the fat pointer type.
2251 (create_subprog_type): Delete.
2252 (create_param_decl): Remove READONLY parameter.
2253 (finish_subprog_decl): New function extracted from...
2254 (create_subprog_decl): ...here. Call it. Remove CONST_FLAG and
2255 VOLATILE_FLAG parameters and adjust.
2256 (update_pointer_to): Also clear TYPE_REFERENCE_TO in the unconstrained
2259 2016-04-27 Arnaud Charlet <charlet@adacore.com>
2261 * aa_util.adb, aa_util.ads: Removed, no longer used.
2263 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2265 * sem_prag.adb (Analyze_Pragma): An object
2266 renaming declaration resulting from the expansion of an object
2267 declaration is a suitable context for pragma Ghost.
2269 2016-04-27 Doug Rupp <rupp@adacore.com>
2271 * init.c: Refine last checkin so the only requirement is the
2272 signaling compilation unit is compiled with the same mode as
2273 the compilation unit containing the initial landing pad.
2275 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2277 * sem_ch13.adb (Valid_Default_Iterator): Better filter of illegal
2278 specifications for Default_Iterator, including overloaded cases
2279 where no interpretations are legal, and return types that are
2282 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2284 * exp_ch5.adb (Expand_N_Assignment_Statement): Do not install
2285 an accessibility check when the left hand side of the assignment
2286 denotes a container cursor.
2287 * exp_util.ads, exp_util.adb (Find_Primitive_Operations): Removed.
2288 * sem_ch4.adb (Find_Indexing_Operations): New routine.
2289 (Try_Container_Indexing): Code cleanup.
2291 2016-04-27 Arnaud Charlet <charlet@adacore.com>
2293 * sem_ch10.adb, sem_case.adb: Mark messages udner -gnatwr when needed.
2295 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2297 * errout.adb, errutil.adb: Minor reformatting.
2299 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2301 * sem_ch13.adb (Analyze_Aspect_Specifications, case Pre/Post):
2302 Check that the classwide version is illegal when the prefix is
2303 an operation of an untagged synchronized type.
2305 2016-04-27 Arnaud Charlet <charleT@adacore.com>
2307 * sinput-l.ads, sem_ch13.adb: Minor editing.
2309 2016-04-27 Doug Rupp <rupp@adacore.com>
2311 * init.c (__gnat_adjust_context_for_raise) [arm-linux thumb]:
2312 Bump the pc so the lower order bit is set.
2314 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2316 * sem_case.adb, sem_case.ads (NO_Op): If appropriate warning is
2317 enabled, report an empty range in a case construct.
2319 2016-04-27 Arnaud Charlet <charlet@adacore.com>
2321 * sinput.ads, a-cfdlli.adb, a-crbtgo.adb, a-chtgop.adb, a-cbhama.adb,
2322 a-rbtgbo.adb, a-crdlli.adb, a-chtgbo.adb: Minor editing.
2324 2016-04-27 Bob Duff <duff@adacore.com>
2326 * a-chtgop.adb (Adjust): Zero the tampering counts on assignment,
2327 as is done for the other containers.
2329 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2331 * ghost.adb (In_Subprogram_Body_Profile): New routine.
2332 (Is_OK_Declaration): Treat an unanalyzed expression
2333 function as an OK context. Treat a reference to a Ghost entity
2334 as OK when it appears within the profile of a subprogram body.
2336 2016-04-27 Bob Duff <duff@adacore.com>
2338 * errout.ads: Document the fact that informational messages
2339 don't have to be warnings.
2340 * errout.adb (Error_Msg_Internal): In statistics counts, deal
2341 correctly with informational messages that are not warnings.
2342 (Error_Msg_NEL): Remove useless 'if' aroung Set_Posted, because
2343 Set_Posted already checks for errors and ignores others.
2344 * erroutc.adb (Prescan_Message): Set Is_Serious_Error to False
2345 if Is_Info_Msg; the previous code was assuming that Is_Info_Msg
2346 implies Is_Warning_Msg.
2347 * errutil.adb (Error_Msg): In statistics counts, deal correctly
2348 with informational messages that are not warnings.
2350 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2352 * sem_util.ads, sem_util.adb (Is_Null_Record_Type): New predicate
2353 to determine whether a record type is a null record.
2354 * sem_ch3.adb (Analyze_Object_Declaration): If the type is a
2355 null record and there is no expression in the declaration,
2356 no predicate check applies to the object.
2358 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2360 * sem_ch7.adb (Analyze_Package_Body_Helper): The body of an
2361 instantiated package should not cause freezing of previous contracts.
2363 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2365 * sem_dim.adb (Analyze_Dimension): Handle subtype declarations
2366 that do not come from source.
2367 (Analyze_Dimension_Subtype_Declaration): Allow confirming
2368 dimensions on subtype entity, either inherited from base type
2369 or provided by aspect specification.
2371 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2373 * s-gearop.ads (Matrix_Vector_Solution, Matrix_Matrix_Solution):
2374 Add scalar formal object Zero, to allow detection and report
2375 when the matrix is singular.
2376 * s-gearop.adb (Matrix_Vector_Solution, Matrix_Matrix_Solution):
2377 Raise Constraint_Error if the Forward_Eliminate pass has
2378 determined that determinant is Zero.o
2379 * s-ngrear.adb (Solve): Add actual for Zero in corresponding
2381 * s-ngcoar.adb (Solve): Ditto.
2383 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2385 * sem_ch3.adb: Minor reformatting.
2387 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2389 * sem_dim.adb (Analyze_Dimension, case N_Identifier): Check
2390 that identifier has a usable type before analysis, to handle
2391 properly identifiers introduced after some lexical/syntactic
2392 recovery that created new identifiers.
2394 2016-04-27 Bob Duff <duff@adacore.com>
2396 * a-coinve.adb, a-comutr.adb, a-conhel.adb, a-convec.adb,
2397 exp_util.adb: Remove assertions that can fail in obscure cases when
2398 assertions are turned on but tampering checks are turned off.
2400 2016-04-27 Javier Miranda <miranda@adacore.com>
2402 * exp_ch6.adb (Add_Call_By_Copy_Code,
2403 Add_Simple_Call_By_Copy_Code, Expand_Actuals): Handle formals
2404 whose type comes from the limited view.
2406 2016-04-27 Yannick Moy <moy@adacore.com>
2408 * a-textio.adb: Complete previous patch.
2410 2016-04-27 Yannick Moy <moy@adacore.com>
2412 * inline.adb (Expand_Inlined_Call): Use Cannot_Inline instead of
2413 Error_Msg_N to issue message about impossibility to inline call,
2414 with slight change of message.
2416 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2418 * exp_spark.adb (Expand_Potential_Renaming): Removed.
2419 (Expand_SPARK): Update the call to expand a potential renaming.
2420 (Expand_SPARK_Potential_Renaming): New routine.
2421 * exp_spark.ads (Expand_SPARK_Potential_Renaming): New routine.
2422 * sem.adb Add with and use clauses for Exp_SPARK.
2423 (Analyze): Expand a non-overloaded potential renaming for SPARK.
2425 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2427 * sem_ch3.adb (Constrain_Discriminated_Type): In an instance,
2428 check full view for the presence of defaulted discriminants,
2429 even when the partial view of a private type has no visible and
2430 no unknown discriminants.
2432 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2434 * lib-xref.adb, exp_ch3.adb: Minor reformatting.
2436 2016-04-27 Nicolas Roche <roche@adacore.com>
2438 * rtinit.c: Add weak symbol __gnat_do_argv_expansion.
2440 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2442 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Code
2443 cleanup. Check the original node when trying to determine the node kind
2444 of pragma Volatile's argument to account for untagged derivations
2445 where the type is transformed into a constrained subtype.
2447 2016-04-27 Olivier Hainque <hainque@adacore.com>
2449 * mkdir.c (__gnat_mkdir): Rework the vxworks section to use a
2450 consistent posix interface on the caller side.
2452 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2454 * sem_ch10.adb (Build_Limited_View, Decorate_Type): If this
2455 is a limited view of a type, initialize the Limited_Dependents
2456 field to catch misuses of the type in a client unit.
2458 2016-04-27 Thomas Quinot <quinot@adacore.com>
2460 * a-strunb-shared.adb (Finalize): add missing Reference call.
2461 * s-strhas.adb: minor grammar fix and extension of comment
2462 * sem_ch8.adb: minor whitespace fixes
2464 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2466 * lib-xref.adb (Get_Type_Reference): Handle properly the case
2467 of an object declaration whose type definition is a class-wide
2468 subtype and whose expression is a function call that returns a
2471 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2473 * sem_util.ads, sem_util.adb (Output_Entity): New routine.
2474 (Output_Name): New routine.
2476 2016-04-27 Bob Duff <duff@adacore.com>
2478 * exp_ch3.adb (Rewrite_As_Renaming): Disable previous change for now.
2480 2016-04-27 Vincent Celier <celier@adacore.com>
2482 * gnatcmd.adb: For "gnat ls -V -P", recognize switch
2483 --unchecked-shared-lib-imports and set the flag
2484 Opt.Unchecked_Shared_Lib_Imports accordingly.
2486 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2488 * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part):
2489 A generic subprogram is never a primitive operation, and thus
2490 a classwide condition for it is not legal.
2492 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2494 * sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor
2497 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2499 * sem_res.adb (Flag_Effectively_Volatile_Objects): New routine.
2500 (Resolve_Actuals): Flag effectively volatile objects with enabled
2501 property Async_Writers or Effective_Reads as illegal.
2502 * sem_util.adb (Is_OK_Volatile_Context): Comment reformatting.
2504 2016-04-27 Javier Miranda <miranda@adacore.com>
2506 * exp_ch3.adb (Make_Predefined_Primitive_Specs):
2507 Do not generate the profile of the equality operator if it has
2508 been explicitly defined as abstract in the parent type. Required
2509 to avoid reporting an spurious error.
2511 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2513 * sem_dim.ads, sem_dim.adb (Check_Expression_Dimensions): New
2514 procedure to compute the dimension vector of a scalar expression
2515 and compare it with the dimensions if its expected subtype. Used
2516 for the ultimate components of a multidimensional aggregate,
2517 whose components typically are themselves aggregates that are
2518 expanded separately. Previous to this patch, dimensionality
2519 checking on such aggregates generated spurious errors.
2520 * sem_aggr.adb (Resolve_Array_Aggregate): Use
2521 Check_Expression_Dimensions when needed.
2523 2016-04-27 Javier Miranda <miranda@adacore.com>
2525 * einfo.ads, einfo.adb (Corresponding_Function): New attribute
2526 (applicable to E_Procedure).
2527 (Corresponding_Procedure): New attribute (applicable to E_Function).
2528 * exp_util.adb (Build_Procedure_Form): Link the function with
2529 its internally built proc and viceversa.
2530 * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
2531 attribute Rewritten_For_C and Corresponding_Procedure to the body.
2532 * exp_ch6.adb (Rewritten_For_C_Func_Id): Removed.
2533 (Rewritten_For_C_Proc_Id): Removed.
2534 * exp_unst.adb (Note_Uplevel_Ref): Use the new attribute to
2535 locate the corresponding procedure.
2537 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2539 * sem_ch13.adb (Analyze_Aspect_Export_Import): Signal that there is no
2540 corresponding pragma.
2542 2016-04-27 Bob Duff <duff@adacore.com>
2544 * exp_ch3.adb: Minor comment improvement.
2546 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2548 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): If the
2549 return type is an untagged limited record with only access
2550 discriminants and no controlled components, the return value does not
2551 need to use the secondary stack.
2553 2016-04-27 Javier Miranda <miranda@adacore.com>
2555 * exp_util.adb (Remove_Side_Effects): When
2556 generating C code handle object declarations that have
2557 discriminants and are initialized by means of a call to a
2560 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2562 * a-textio.adb (Get_Line function): Handle properly the case of
2563 a line that has the same length as the buffer (or a multiple
2564 thereof) and there is no line terminator.
2565 * a-tigeli.adb (Get_Line procedure): Do not store an end_of_file
2566 in the string when there is no previous line terminator and we
2567 need at most one additional character.
2569 2016-04-27 Arnaud Charlet <charlet@adacore.com>
2571 * s-rident.ads: Make No_Implicit_Loops non partition wide.
2573 2016-04-27 Arnaud Charlet <charlet@adacore.com>
2575 * sem_ch11.adb (Analyze_Handled_Statements): check useless
2576 assignments also in entries and task bodies, not only in
2577 procedures and declaration blocks.
2578 * sem_ch5.adb (Analyze_Block_Statement): check useless
2579 assignements in declaration blocks as part of processing their
2580 handled statement sequence, just like it was done for procedures
2581 and now is also done for entries and task bodies.
2582 * sem_warn.adb (Warn_On_Useless_Assignment): detect boundries
2583 of entries and task bodies just like of procedures.
2585 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2587 * sem_util.adb (Is_Volatile_Function): Recognize
2588 a function declared within a protected type as well as the
2589 protected/unprotected version of a function.
2591 2016-04-27 Bob Duff <duff@adacore.com>
2593 * exp_ch3.adb (Expand_N_Object_Declaration): Rewrite an object
2594 declaration of the form "X : T := Func (...);", where T is
2595 controlled, as a renaming.
2596 * a-strunb-shared.adb (Finalize): Set the Unbounded_String Object
2597 to be an empty string, instead of null-ing out the Reference.
2598 * exp_util.adb (Needs_Finalization): Remove redundant code.
2600 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2602 * aspects.ads Aspects Export and Import do not require delay. They
2603 were classified as delayed aspects, but treated as non-delayed
2604 by the analysis of aspects.
2605 * freeze.adb (Copy_Import_Pragma): New routine.
2606 (Wrap_Imported_Subprogram): Copy the import pragma by first
2607 resetting all semantic fields to avoid an infinite loop when
2608 performing the copy.
2609 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add
2610 comment on the processing of aspects Export and Import
2611 at the freeze point.
2612 (Analyze_Aspect_Convention: New routine.
2613 (Analyze_Aspect_Export_Import): New routine.
2614 (Analyze_Aspect_External_Link_Name): New routine.
2615 (Analyze_Aspect_External_Or_Link_Name): Removed.
2616 (Analyze_Aspect_Specifications): Factor out the analysis of
2617 aspects Convention, Export, External_Name, Import, and Link_Name
2618 in their respective routines. Aspects Export and Import should
2619 not generate a Boolean pragma because their corresponding pragmas
2620 have a very different syntax.
2621 (Build_Export_Import_Pragma): New routine.
2622 (Get_Interfacing_Aspects): New routine.
2624 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
2626 * inline.adb (Add_Inlined_Body): Overhaul implementation,
2627 robustify handling of -gnatn1, add special treatment for
2628 expression functions.
2630 2016-04-27 Doug Rupp <rupp@adacore.com>
2632 * g-traceb.ads: Update comment.
2633 * exp_ch2.adb: minor style fix in object declaration
2635 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2637 * sem_elab.adb (Check_Internal_Call): Do not
2638 consider a call when it appears within pragma Initial_Condition
2639 since the pragma is part of the elaboration statements of a
2640 package body and may only call external subprograms or subprograms
2641 whose body is already available.
2642 (Within_Initial_Condition): New routine.
2644 2016-04-27 Ed Schonberg <schonberg@adacore.com>
2646 * exp_util.adb (Build_Procedure_Form): Prevent double generation
2647 of the procedure form when dealing with an expression function
2648 whose return type is an array.
2649 * sem_ch3.adb: Fix out-of order Has_Predicates setting.
2650 * exp_ch6.adb: Proper conversion for inherited operation in C.
2651 * sem_ch6.adb: Code cleanup.
2653 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com>
2655 * lib-xref.ads, sem_ch10.adb: minor style fix in comment
2656 * g-socket.adb: Minor reformatting.
2657 * sinfo.ads: Minor comment correction.
2658 * sem_warn.ads: minor grammar fix in comment
2660 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
2662 * gcc-interface/gigi.h (gnat_to_gnu_entity): Adjust prototype.
2663 (maybe_pad_type): Adjust comment.
2664 (finish_record_type): Likewise.
2665 (rest_of_record_type_compilation): Likewise.
2666 * gcc-interface/decl.c (gnat_to_gnu_entity): Change DEFINITION type
2667 parameter from integer to boolean. Adjust recursive calls.
2668 <E_Subprogram_Type>: Use copy_type and remove redundant assignments.
2669 <E_Signed_Integer_Subtype>: Adjust comment. Remove call to
2670 rest_of_record_type_compilation. Set TYPE_PADDING_P flag earlier.
2671 Pass false to finish_record_type. Set the debug type later.
2672 <E_Record_Subtype>: Remove call to rest_of_record_type_compilation.
2673 (gnat_to_gnu_component_type): Fix formatting.
2674 (gnat_to_gnu_field_decl): Adjust call to gnat_to_gnu_entity.
2675 (gnat_to_gnu_type): Likewise.
2676 * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
2677 (Loop_Statement_to_gnu): Likewise.
2678 (Subprogram_Body_to_gnu): Likewise.
2679 (Exception_Handler_to_gnu_fe_sjlj): Likewise.
2680 (Exception_Handler_to_gnu_gcc): Likewise.
2681 (Compilation_Unit_to_gnu): Likewise.
2682 (gnat_to_gnu): Likewise.
2683 (push_exception_label_stack): Likewise.
2684 (elaborate_all_entities_for_package): Likewise.
2685 (process_freeze_entity): Likewise.
2686 (process_decls): Likewise.
2687 (process_type): Likewise.
2688 * gcc-interface/utils.c (struct deferred_decl_context_node): Tweak.
2689 (maybe_pad_type): Adjust comments. Set the debug type later. Remove
2690 call to rest_of_record_type_compilation.
2691 (rest_of_record_type_compilation): Use copy_type.
2692 (copy_type): Use correctly typed constants.
2693 (gnat_signed_or_unsigned_type_for): Use copy_type.
2694 * gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
2695 (build_goto_raise): Adjust call tognat_to_gnu_entity.
2697 2016-04-27 Eric Botcazou <ebotcazou@adacore.com>
2699 * gcc-interface/misc.c (gnat_init): Do not call
2700 internal_reference_types.
2702 2016-04-27 Svante Signell <svante.signell@gmail.com>
2704 * gcc-interface/Makefile.in (x86 GNU/Hurd): Use s-osinte-gnu.adb.
2705 * s-osinte-gnu.ads: Small tweaks.
2706 * s-osinte-gnu.adb: New file.
2708 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2710 * sem_prag.adb (Match_Constituent): Treat a constant as a legal
2711 constituent even if it is not to prevent spurious errors.
2713 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2715 * sem_ch4.adb: Minor typo fixes and reformatting.
2717 2016-04-21 Dmitriy Anisimkov <anisimko@adacore.com>
2719 * g-calend.ads (No_Time): The same value in any timezone.
2720 * g-socket.adb (Raise_Host_Error): Remove ending
2721 dot from original error message before append colon delimited
2724 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2726 * sem_ch3.adb: Code cleanup.
2727 * sem_ch6.adb: Code cleanup.
2728 (Is_Matching_Limited_View): New routine.
2729 (Matches_Limited_With_View): Reimplemented.
2730 * sem_ch10.adb (Decorate_Type): Code cleanup.
2732 2016-04-21 Doug Rupp <rupp@adacore.com>
2734 * tracebak.c (PPC ELF): Add macro defs for lynxos178e.
2736 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2738 * sem_ch4.adb (Try_Container_Indexing): If there are overloaded
2739 indexing functions, collect all overloadings of the call firts,
2740 and then transfer them to indexing node, to prevent interleaving
2741 of the set of interpretations of the nodes involved.
2742 * sem_res.adb (Resolve): Suppress cascaded errors that report
2743 ambiguities when one of the actuals in an overloaded generatlized
2744 indexing operation is illegal and has type Any_Type, as is done
2745 for similar cascaded errors in subprogram calls.
2746 (Valid_Tagged_Conversion): Cleanup conversion checks when one
2747 of the types involved is a class-wide subtype.
2749 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2751 * sem_ch12.adb (Load_Parent_Of_Generic): When looking for the
2752 subprogram declaration within a wrapper package, skip pragmas
2753 that may have been generated by aspect specifications on the
2756 2016-04-21 Javier Miranda <miranda@adacore.com>
2758 * exp_aggr.adb (Component_Not_OK_For_Backend): Generating C
2759 code return True for array identifiers since the backend needs
2760 to initialize such component by means of memcpy().
2762 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2764 * a-tasatt.adb, a-tasatt.ads (Fast_Path): Rewritten to avoid reading
2765 potentially uninitialized memory.
2766 * sem_ch3.adb: Minor style fix in comment.
2768 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2770 * gnat_rm.texi, gnat_ugn.texi,
2771 doc/gnat_ugn/gnat_project_manager.rst,
2772 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
2773 doc/gnat_ugn/gnat_and_program_execution.rst,
2774 doc/gnat_ugn/gnat_utility_programs.rst,
2775 doc/gnat_ugn/the_gnat_compilation_model.rst,
2776 doc/gnat_rm/implementation_defined_attributes.rst,
2777 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
2778 doc/gnat_rm/implementation_defined_pragmas.rst,
2779 doc/gnat_rm/the_gnat_library.rst,
2780 doc/gnat_rm/implementation_defined_aspects.rst: Update doc.
2781 * doc/Makefile: Cleanups.
2783 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2785 * exp_pakd.adb, sem_ch13.adb: Minor reformatting.
2787 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2789 * exp_dbug.adb, exp_dbug.ads (Qualify_Entity_Name): Add suffixes to
2790 disambiguate local variables that may be hidden from inner visibility
2791 by nested block declarations or loop variables.
2793 2016-04-21 Jerome Lambourg <lambourg@adacore.com>
2795 * s-soflin.adb: Initialize the Stack_Limit global variable.
2797 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2799 * lib-writ.adb: Minor reformatting.
2801 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2803 * exp_pakd.adb (Compute_Number_Components): New function to
2804 build an expression that computes the number of a components of
2805 an array that may be multidimensional.
2806 (Expan_Packed_Eq): Use it.
2808 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2810 * g-traceb.ads: Update list of supported platforms.
2812 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2814 * sem_ch13.adb (Add_Predicates): if the type is declared in
2815 an inner package it may be frozen outside of the package, and
2816 the generated pragma has not been analyzed yet, the expression
2817 for the predicate must be captured and added to the predicate
2818 function at this point.
2820 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2822 * contracts.adb (Analyze_Package_Body_Contract): Do not check
2823 for a missing package refinement because 1) packages do not have
2824 "refinement" and 2) the check for proper state refinement is
2825 performed in a different place.
2826 * einfo.adb (Has_Non_Null_Visible_Refinement): Reimplemented.
2827 (Has_Null_Visible_Refinement): Reimplemented.
2828 * sem_ch3.adb (Analyze_Declarations): Determine whether all
2829 abstract states have received a refinement and if not, emit
2831 * sem_ch7.adb (Analyze_Package_Declaration): Code
2832 cleanup. Determine whether all abstract states of the
2833 package and any nested packages have received a refinement
2834 and if not, emit errors.
2835 (Requires_Completion_In_Body): Add new formal parameter
2836 Do_Abstract_States. Update the comment on usage. Propagate the
2837 Do_Abstract_States flag to all Unit_Requires_Body calls.
2838 (Unit_Requires_Body): Remove formal
2839 parameter Ignore_Abstract_States. Add new formal paramter
2840 Do_Abstract_States. Propagate the Do_Abstract_States flag to
2841 all Requires_Completion_In calls.
2842 * sem_ch7.ads (Unit_Requires_Body): Remove formal
2843 parameter Ignore_Abstract_States. Add new formal paramter
2844 Do_Abstract_States. Update the comment on usage.
2845 * sem_ch9.adb (Analyze_Single_Protected_Declaration): Do
2846 not initialize the constituent list as this is now done on a
2847 need-to-add-element basis.
2848 (Analyze_Single_Task_Declaration):
2849 Do not initialize the constituent list as this is now done on
2850 a need-to-add-element basis.
2851 * sem_ch10.adb (Decorate_State): Do not initialize the constituent
2852 lists as this is now done on a need-to-add-element basis.
2853 * sem_prag.adb (Analyze_Constituent): Set the
2854 refinement constituents when adding a new element.
2855 (Analyze_Part_Of_In_Decl_Part): Set the Part_Of constituents when
2856 adding a new element.
2857 (Analyze_Part_Of_Option): Set the Part_Of
2858 constituents when adding a new element.
2859 (Analyze_Pragma): Set the Part_Of constituents when adding a new
2861 (Check_Constituent_Usage (all versions)): Reimplemented.
2862 (Collect_Constituent): Set the refinement constituents when adding
2864 (Create_Abstract_State): Do not initialize the
2865 constituent lists as this is now done on a need-to-add-element basis.
2866 (Propagate_Part_Of): Set the Part_Of constituents when
2867 adding a new element.
2868 * sem_util.adb (Check_State_Refinements): New routine.
2869 (Has_Non_Null_Refinement): Reimplemented.
2870 (Has_Null_Refinement): Reimplemented.
2871 (Requires_State_Refinement): Removed.
2872 * sem_util.ads (Check_State_Refinements): New routine.
2873 (Requires_State_Refinement): Removed.
2875 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2877 * lib-writ.adb, sem_ch6.adb: Minor reformatting and code cleanup.
2878 * sem.adb: Fix comment.
2880 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2882 * sem_ch3.adb (Analyze_Subtype_Declaration): A subtype
2883 declaration with no aspects, whose subtype_mark is a subtype
2884 with predicates, inherits the list of subprograms for the type.
2886 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2888 * exp_aggr.adb (Has_Per_Object_Constraint): Refine previous
2891 2016-04-21 Thomas Quinot <quinot@adacore.com>
2893 * g-socket.adb (Raise_Host_Error): Include additional Name parameter.
2895 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2897 * lib-writ.adb (Write_ALI): Do not record in ali file units
2898 that are present in the files table but not analyzed. These
2899 units are present because they appear in the context of units
2900 named in limited_with clauses, and the unit being compiled does
2901 not depend semantically on them.
2903 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2905 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Simplify code to
2906 create the procedure body for an function returning an array type,
2907 when generating C code. Reuse the subprogram body rather than
2908 creating a new one, both as an efficiency measure and because
2909 in an instance the body may contain global references that must
2912 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2914 * sem_ch3.adb, exp_attr.adb, exp_ch6.adb, exp_aggr.adb: Minor
2917 2016-04-21 Javier Miranda <miranda@adacore.com>
2919 * exp_aggr.adb (Component_Check): Extend
2920 the check that verifies that the aggregate has no function
2921 calls to handle transformations performed by the frontend.
2922 (Ultimate_Original_Expression): New subprogram.
2924 2016-04-21 Philippe Gil <gil@adacore.com>
2926 * krunch.adb (Krunch): Fix krunching of i-java.
2928 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2930 * exp_ch8.adb (Evaluation_Required): Always return
2931 True when Modify_Tree_For_C.
2933 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
2935 * gnatlink.adb (Gnatlink): Robustify detection of Windows target.
2936 * alloc.ads: Minor comment fixes.
2937 * einfo.ads: Fix typo.
2939 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2941 * exp_aggr.adb (Component_Not_OK_For_Backend): Redo previous
2942 changes to handle all cases of components depending on the
2943 discriminant, not just string literals.
2945 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2947 * sem_ch3.adb (Analyze_Subtype_Declaration): If the subtype
2948 declaration is the generated declaration for a generic actual,
2949 inherit predicates from the actual if it is a predicated subtype.
2951 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2953 * exp_ch6.adb (Rewrite_Function_Call_For_C): If the function is
2954 inherited and its result is controlling, introduce a conversion
2955 on the actual for the corresponding procedure call, to avoid
2956 spurious type errors.
2958 2016-04-21 Jerome Lambourg <lambourg@adacore.com>
2960 * krunch.adb (Krunch): Fix krunching of i-vxworks.
2962 2016-04-21 Gary Dismukes <dismukes@adacore.com>
2964 * exp_aggr.adb: Minor reformatting and code cleanup.
2966 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2968 * sem_ch13.adb (Resolve_Name): Omit quantified expressions from
2969 resolution, because they introduce local names. Full resolution
2970 will take place when predicate function is constructed.
2972 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2974 * exp_aggr.adb (Component_Not_OK_For_Backend): Refine previous
2975 change to take into account Per_Object_Constraint field rather
2976 than special casing strings.
2977 * exp_ch6.adb: Fix typo in Replace_Returns.
2979 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
2981 * sem_ch5.adb: Minor reformatting.
2983 2016-04-21 Arnaud Charlet <charlet@adacore.com>
2985 * exp_aggr.adb (Backend_Processing_Possible): Return False
2986 when generating C and aggregate contains function calls.
2988 2016-04-21 Tristan Gingold <gingold@adacore.com>
2990 * krunch.adb (Krunch): Only partially krunch children of
2991 Interfaces that aren't known.
2993 2016-04-21 Ed Schonberg <schonberg@adacore.com>
2995 * sem_prag.adb (Make_Inline): Handle properly the instantiation
2996 of a generic subpprogram that carries an Inline aspect. Place
2997 inline info on the anonymous subprogram that is constructed in
2998 the wrapper package.
2999 (Analyze_Pragma, case Pure): Do not check placement if pragma
3000 appears within an instantiation, which can be nested at any level.
3001 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not copy Freeze
3002 node from anonymous subprogram to its visible renaming. The
3003 freeze node will be constructed if the subprogram carries
3005 (Set_Global): Preserve dimension information if present (from
3008 2016-04-21 Vasiliy Fofanov <fofanov@adacore.com>
3010 * gnatlink.adb: Change wording of the warning message on
3011 problematic filenames to be more neutral. Add a new substring
3012 "patch" introduced on Windows 10.
3014 2016-04-21 Philippe Gil <gil@adacore.com>
3016 * tracebak.c (__gnat_backtrace): handle bad RIP values (win64 only)
3018 2016-04-21 Javier Miranda <miranda@adacore.com>
3020 * exp_aggr.adb (Component_Not_OK_For_Backend): Return true for string
3023 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
3025 * einfo.adb (Has_Non_Null_Abstract_State): New routine.
3026 * einfo.ads New synthesized attribute
3027 Has_Non_Null_Abstract_State along with occurrences in entities.
3028 (Has_Non_Null_Abstract_State): New routine.
3029 * sem_ch7.adb (Unit_Requires_Body): Add local variable
3030 Requires_Body. A package declaring an abstract state requires
3031 a body only when the state is non-null and the package contains
3032 at least one other construct that requires completion in a body.
3033 * sem_util.adb (Mode_Is_Off): Removed.
3034 (Requires_State_Refinement): Remove an obsolete check. Code
3037 2016-04-21 Bob Duff <duff@adacore.com>
3039 * sem_attr.adb (Analyze_Attribute): In processing
3040 the 'Old attribute, a warning is given for infinite recursion. Fix
3041 the code to not crash when the prefix of 'Old denotes a protected
3043 * sem_ch5.adb (Analyze_Iterator_Specification):
3044 Avoid calling Is_Dependent_Component_Of_Mutable_Object in cases
3045 where the parameter would not be an object.
3047 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
3049 * sem_eval.adb (Compile_Time_Compare): Be prepared for an empty
3050 Etype or Underlying_Type of the operands.
3052 2016-04-21 Eric Botcazou <ebotcazou@adacore.com>
3054 * atree.adb (Print_Statistics): Protect against overflows and
3055 print the memory consumption in bytes.
3056 * table.adb (Reallocate): Do the intermediate calculation of the new
3057 size using the Memory.size_t type.
3059 2016-04-21 Gary Dismukes <dismukes@adacore.com>
3061 * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
3062 expansion of Attribute_Machine and Attribute_Model for AAMP.
3064 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3066 * freeze.adb: Disable previous change for now.
3068 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3070 * sem_ch8.adb (Find_Selected_Component): If prefix has an
3071 access type and designated type is a limited view, introduce
3072 an explicit dereference before continuing the analysis, and
3073 set its type to the non-limited view of the designated type,
3074 if we are in context where it is available.
3076 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3078 * freeze.adb: Freeze profile in ASIS mode.
3080 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
3082 * sem_aux.ads, sem_aux.adb (Has_Rep_Item): New variant.
3083 * sem_util.adb (Inherit_Rep_Item_Chain): Reimplemented.
3085 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
3087 * exp_ch6.adb: Minor reformatting.
3089 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3091 * sem_ch13.adb: Minor comment update.
3093 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3095 * freeze.ads, freeze.adb (Freeze_Entity, Freeze_Before): Add
3096 boolean parameter to determine whether freezing an overloadable
3097 entity freezes its profile as well. This is required by
3098 AI05-019. The call to Freeze_Profile within Freeze_Entity is
3099 conditioned by the value of this flag, whose default is True.
3100 * sem_attr.adb (Resolve_Attribute, case 'Access): The attribute
3101 reference freezes the prefix, but it the prefix is a subprogram
3102 it does not freeze its profile.
3104 2016-04-21 Javier Miranda <miranda@adacore.com>
3106 * exp_util.adb (Build_Procedure_Form): No action needed for
3107 subprogram renamings since the backend can generate the call
3108 using the renamed subprogram. This leaves the tree more clean
3110 * exp_ch6.adb (Expand_Call): Extend previous patch for
3111 rewritten-for-c entities to handle subprogram renamings.
3112 (Rewrite_Function_Call_For_C): Handle subprogram renamings.
3114 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3116 * sem_ch13.adb: Code cleanup.
3118 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3120 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If the body is
3121 created for SPARK_To_C, the entity must remain invisible so it
3122 does not overload subsequent references to the original function.
3123 * exp_ch6.adb (Build_Procedure_Body_Form, Replace_Returns):
3124 Handle Extended_Return_Statements by replacing it with a block
3125 with assignments and a simple return statement.
3126 * exp_util.adb (Build_Procedure_Form): Make procedure entity
3127 invisible after analyzing declaration, to prevent improper
3130 2016-04-21 Javier Miranda <miranda@adacore.com>
3132 * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
3133 attribute Rewritten_For_C to the body since since the expander
3134 may generate calls using that entity.
3135 * exp_ch6.adb (Expand_Call): For internally generated
3136 calls ensure that they reference the entity of the spec
3137 of the called function.
3138 (Rewritten_For_C_Func_Id): New subprogram.
3139 (Rewritten_For_C_Proc_Id): New subprogram.
3140 (Rewrite_Function_Call_For_C): Invoke the new subprogram to
3141 ensure that we skip freezing entities.
3142 * exp_util.adb (Build_Procedure_Form): No action needed if the
3143 procedure was already built.
3145 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
3147 * sem_ch3.adb, exp_util.adb, sem_ch13.adb, exp_unst.adb: Minor
3150 2016-04-21 Ed Schonberg <schonberg@adacore.com>
3152 * sem_util.adb (Denotes_Iterator): Use root type to determine
3153 whether the ultimate ancestor is the predefined iterator
3155 * exp_ch5.adb (Expand_Iterator_Over_Container): simplify code
3156 and avoid reuse of Pack local variable.
3158 2016-04-21 Olivier Hainque <hainque@adacore.com>
3160 * system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
3161 system-vxworks-ppc.ads, system-vxworks-m68k.ads,
3162 system-vxworks-mips.ads, system-vxworks-x86.ads: Define
3163 Executable_Extension to ".out".
3165 2016-04-21 Javier Miranda <miranda@adacore.com>
3167 * frontend.adb: Update call to Unnest_Subprograms.
3168 * exp_ch6.ads, exp_ch6.adb, exp_unst.ads, exp_unst.adb
3169 (Unnest_Subprograms): Moved to package exp_unst.
3170 * exp_unst.ads (Unnest_Subprogram): Moved to the body of the
3172 * exp_dbug.adb (Qualify_Entity_Name): Enable qualification of
3173 enumeration literals when generating C code.
3175 2016-04-21 Javier Miranda <miranda@adacore.com>
3177 * frontend.adb: Remove call to initialize Exp_Ch6.
3178 * exp_ch6.ads, exp_ch6.adb (Initialize): removed.
3179 (Unest_Entry/Unest_Bodies): Removed.
3180 (Unnest_Subprograms): Code cleanup.
3182 2016-04-21 Arnaud Charlet <charlet@adacore.com>
3184 * set_targ.adb (Read_Target_Dependent_Values):
3185 close target description file once its contents is read.
3186 * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File
3187 and Stderr_File): Close local file descriptors before spawning
3189 * exp_util.adb (Containing_Package_With_Ext_Axioms): Limit scope of
3190 local variables to make the code easier to understand and avoid
3191 duplicated calls to Parent and Generic_Parent.
3193 2016-04-20 Bob Duff <duff@adacore.com>
3195 * s-os_lib.ads: Minor comment fix.
3197 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3199 * exp_ch5.adb (Expand_N_Assignment_Statement): Do no generate
3200 a discriminant check for a type whose partial view has unknown
3201 discriminants when the full view has discriminants with defaults.
3203 2016-04-20 Javier Miranda <miranda@adacore.com>
3205 * exp_util.adb (Remove_Side_Effects): When generating C code
3206 remove side effect of type conversion of access to unconstrained
3208 (Side_Effect_Free): Return false for the type
3209 conversion of access to unconstrained array type when generating
3211 * sem_res.adb (Resolved_Type_Conversion): Remove side effects
3212 of access to unconstrained array type conversion when generating
3215 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3217 * sem_ch13.adb (Build_Predicate_Function_Declaration): New
3218 function, to construct the declaration of a predicate function
3219 at the end of the current declarative part rather than at the
3220 (possibly later) freeze point of the type. This also allows uses
3221 of a type with predicates in instantiations elsewhere.
3222 (Resolve_Aspect_Expression): New procedure to detect visiblity
3223 errors in aspect expressions, at the end of the declarative part
3224 that includes the type declaration.
3225 * sem_ch3.adb (Complete_Private_Subtype): Propagate properly the
3226 predicate function from private to full view.
3227 * einfo.adb (Predicate_Function): Refine search for predicate
3228 function when type has a full view and predicate function may
3229 be defined on either view.
3231 2016-04-20 Javier Miranda <miranda@adacore.com>
3233 * frontend.adb: Passing the root of the tree to
3234 Unnest_Subprograms().
3235 * exp_ch6.adb (Expand_N_Subprogram_Body): Remove code that
3236 took care of adding subprograms to the Unest_Bodies table since
3237 performing such action too early disables the ability to process
3238 generic instantiations.
3239 (Unnest_Subprograms): Adding parameter.
3240 (Search_Unnesting_Subprograms): New subprogram.
3241 * exp_ch6.ads (Unnest_Subrograms): Update documentation.
3243 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3245 * exp_util.adb, freeze.adb, sem_util.adb: Minor reformatting.
3247 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3249 * exp_unst.adb (Check_Static_Type): For a private type, check
3252 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3254 * sem_attr.adb (Check_Type): Reject an attribute reference in
3255 an aspect expression, when the prefix of the reference is the
3256 current instance of the type to which the aspect applies.
3258 2016-04-20 Bob Duff <duff@adacore.com>
3260 * sem_ch6.adb (Enter_Overloaded_Entity): Do not warn about
3261 hiding unless we're actually hiding something. The previous
3262 code would (for example) warn about a "<" on a record type
3263 because it incorrectly thought it was hiding the "<" on Boolean
3264 in Standard. We need to check that the homonym S is in fact a
3265 homograph of a predefined operator.
3267 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3269 * exp_util.ads, exp_util.adb (Build_Procedure_Form): Moved here
3270 from exp_ch6.adb, for use in SPARK_To_C mode when creating the
3271 procedure equivalent to a function returning an array, when this
3272 construction is deferred to the freeze point of the function.
3273 * sem_util.adb (Is_Unchecked_Conversion_Instance): Include a
3274 function that renames an instance of Unchecked_Conversion.
3275 * freeze.adb (Freeze_Subprogram): Generate the proper procedure
3276 declaration for a function returning an array.
3277 * exp_ch6.adb (Build_Procedure_Form): Moved to exp_util.
3279 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3281 * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute):
3282 New predicate to determine that in a context with full run-time,
3283 a function call is an expansion of a reference to attribute
3285 * sem_ch5.adb (Analyze_Function_Call): use it.
3286 * exp_ch5.adb (Expand_N_Subprogram_Call): use it.
3288 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3290 * einfo.adb Flag286 is now used as Is_Exception_Handler.
3291 (Is_Exception_Handler): New routine.
3292 (Set_Is_Exception_Handler): New routine.
3293 (Write_Entity_Flags): Output the status of Is_Exception_Handler.
3294 * einfo.ads New attribute Is_Exception_Handler along with
3295 occurrences in entities.
3296 (Is_Exception_Handler): New routine along with pragma Inline.
3297 (Set_Is_Exception_Handler): New routine along with pragma Inline.
3298 * exp_ch7.adb (Make_Transient_Block): Ignore blocks generated
3299 for exception handlers with a choice parameter.
3300 * sem_ch11.adb (Analyze_Exception_Handlers): Mark the scope
3301 generated for a choice parameter as an exception handler.
3303 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3305 * sem_ch3.adb (Build_Derived_Access_Type): Remove dead code.
3306 (Constrain_Discriminated_Type): In an instance, if the type has
3307 unknown discriminants, use its full view.
3308 (Process_Subtype): Check that the base type is private before
3309 adding subtype to Private_Dependents list.
3311 2016-04-20 Bob Duff <duff@adacore.com>
3313 * sem_ch13.adb: Minor comment fix.
3315 2016-04-20 Yannick Moy <moy@adacore.com>
3317 * sem_ch4.adb: Fix typos in comments.
3318 * sem_res.adb (Resolve_Case_Expression): Fix type of case alternatives.
3320 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3322 * sem_ch4.adb (Analyze_Selected_Component): A reference to the
3323 current instance of a task type is legal if the prefix is an
3324 expression of that task type and the selector is an entry or
3327 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3329 * a-cfdlli.ads (List): Type is no longer tagged, not needed. Move
3330 varsize field at the end for efficiency.
3332 2016-04-20 Vincent Celier <celier@adacore.com>
3334 * gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
3335 ls" includes the switch -V.
3336 * clean.adb: "<target>-gnatclean -P" now calls "gprclean
3338 * make.adb: "<target>-gnatmake -P" now calls "gprbuild
3341 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3343 * sem_ch12.adb (Qualify_Type): Do not perform
3344 partial qualification when the immediate scope is a generic unit.
3346 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3348 * exp_unst.adb: Minor reformatting.
3350 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3352 * exp_ch4.adb (Expand_Allocator_Expression): Ensure that the
3353 tag assignment and adjustment preceed the accessibility check.
3354 * exp_ch7.adb (Is_Subprogram_Call): Reimplemented.
3356 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3358 * exp_prag.adb (Expand_Attributes): Ensure that
3359 the temporary used to capture the value of attribute 'Old's
3360 prefix is properly initialized.
3362 2016-04-20 Javier Miranda <miranda@adacore.com>
3364 * exp_unst.ads, exp_unst.adb (Get_Level, Subp_Index): Moved to library
3367 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3369 * sem_ch9.adb (Analyze_Task_Type_Declaration): Shut down warning
3372 2016-04-20 Vincent Celier <celier@adacore.com>
3374 * make.adb: Code cleanup.
3376 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3378 * exp_ch4.adb (Expand_Allocator_Expression): Help C code
3381 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3383 * sem_ch12.adb (Copy_Generic_Node): Handle the special
3384 qualification installed for universal literals that act as
3385 operands in binary or unary operators. (Qualify_Operand): Mark
3386 the qualification to signal the instantiation mechanism how to
3387 handle global reference propagation.
3388 * sinfo.adb (Is_Qualified_Universal_Literal): New routine.
3389 (Set_Is_Qualified_Universal_Literal): New routine.
3390 * sinfo.ads New attribute Is_Qualified_Universal_Literal along
3391 with occurrences in nodes.
3392 (Is_Qualified_Universal_Literal):
3393 New routine along with pragma Inline.
3394 (Set_Is_Qualified_Universal_Literal): New routine along with
3397 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3399 * sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length
3400 so that the corresponding checks are preserved across compilations
3401 that include System.Constants in their context.
3403 2016-04-20 Gary Dismukes <dismukes@adacore.com>
3405 * sem_type.adb: Minor typo fix and reformatting.
3406 * a-conhel.ads: Update comment.
3408 2016-04-20 Bob Duff <duff@adacore.com>
3410 * a-cihama.adb, a-cihase.adb, a-coinve.adb (Copy): Rewrite the
3411 code so it doesn't trigger an "uninit var" warning.
3413 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3415 * sem_attr.ads Add new table Universal_Type_Attribute.
3416 * sem_util.adb (Yields_Universal_Type): Use a table lookup when
3417 checking attributes.
3419 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3421 * exp_aggr.adb (Init_Stored_Discriminants,
3422 Init_Visible_Discriminants): New procedures, subsidiary of
3423 Build_Record_Aggr_Code, to handle properly the construction
3424 of aggregates for a derived type that constrains some parent
3425 discriminants and renames others.
3427 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3429 * sem_ch12.adb (Qualify_Universal_Operands): New routine.
3430 (Save_References_In_Operator): Add explicit qualifications in
3431 the generic template for all operands of universal type.
3432 * sem_type.adb (Disambiguate): Update the call to Matches.
3433 (Matches): Reimplemented.
3434 * sem_util.ads, sem_util.adb (Yields_Universal_Type): New routine.
3436 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3438 * sem_ch13.adb (Rep_Item_Too_Late): Better error message for
3439 an illegal aspect that freezes the entity to which it applies.
3441 2016-04-20 Bob Duff <duff@adacore.com>
3443 * a-stwibo.ads, a-stzbou.ads
3444 ("="): Add overriding keyword before function to avoid crash when
3445 compiler is called with -gnatyO (check overriding indicators).
3447 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3449 * sem_prag.adb (Analyze_Pragma, case Check_Policy): If this
3450 is a configuration pragma and it uses the ARG syntax, insert
3451 the rewritten pragma after the current one rather than using
3454 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3456 * exp_aggr.adb (Backend_Processing_Possible): Add handling of
3459 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3461 * s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb,
3462 s-imglli.adb: Minor reformatting.
3464 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3466 * sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the
3467 renamed operator when the associated node appears within a
3469 * sem_util.ads, sem_util.adb (In_Pre_Post_Condition): New routine.
3471 2016-04-20 Yannick Moy <moy@adacore.com>
3473 * osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix.
3474 * einfo.adb (Set_Overridden_Operation): Add assertion.
3475 * sem_util.adb (Unique_Entity): for renaming-as-body return the spec
3478 2016-04-20 Javier Miranda <miranda@adacore.com>
3480 * exp_unst.adb (Append_Unique_Call): New subprogram.
3481 (Unnest_Subprogram): Replace the unique occurrence
3482 of Call.Append() by Append_Unique_Call() which protects us from
3483 adding to the Calls table duplicated entries.
3485 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3487 * exp_attr.adb (Is_GCC_Target): Fix for C backend.
3488 * xref_lib.ads (Dependencies_Tables): instantiate
3489 Table package with types that guarantee its safe use.
3490 * s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested
3493 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3495 * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]):
3496 Disable expansion when generating C code.
3497 * sinfo.ads, inline.ads: Minor editing.
3499 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3501 * sem_util.adb, contracts.adb, ghost.adb, exp_ch6.adb: Minor
3504 2016-04-20 Javier Miranda <miranda@adacore.com>
3506 * contracts.adb (Build_Postconditions_Procedure): Code cleanup.
3507 * ghost.adb (Os_OK_Ghost_Context.Is_OK_Declaration): Handle the
3508 declaration of the internally built _postcondition procedure.
3510 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3512 * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
3514 * sem_util.adb (Is_Unchecked_Conversion_Instance):
3515 defense against library-level renamings of other functions,
3516 which are never instances of Unchecked_Conversion.
3517 * einfo.ads: minor fix of casing in comment
3519 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3521 * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
3522 that has been analyzed and expanded already. Qualify the names
3523 in the proper body for use in the generation of C code.
3525 2016-04-20 Javier Miranda <miranda@adacore.com>
3527 * contracts.adb (Build_Postconditions_Procedure): Force its
3528 inlining when generating C code.
3529 * sem_attr.adb (Analyze_Attribute_Old_Result): Handle inlined
3530 _postconditions when generating C code.
3531 * exp_ch6.adb (Inlined_Subprogram): Inline calls to
3532 _postconditions when generating C code.
3533 * sinfo.ads, sinfo.adb (Corresponding_Spec, Set_Corresponding_Spec):
3534 types of return value and argument changed from Node_Id to
3537 2016-04-20 Vincent Celier <celier@adacore.com>
3539 * make.adb, clean.adb, gnatname.adb: Revert previous change for now.
3541 2016-04-20 Eric Botcazou <ebotcazou@adacore.com>
3543 * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
3544 the Has_Delayed_Freeze flag on the anonymous instance node.
3546 2016-04-20 Javier Miranda <miranda@adacore.com>
3548 * sem_ch5.adb (Analyze_Iterator_Specification): Remove transient
3549 scope associated with the renaming object declaration.
3550 * exp_util.adb (Insert_Actions): Remove handling of iterator
3551 loop marked as requiring the secondary stack.
3553 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3555 * sem_attr.adb (Analyze_Attribute, case 'Image): Implement
3556 AI12-0124, which extends the functionality of the attribute so it
3557 reflects the semantics of GNAT 'Img when applied to scalar types.
3558 * lib-xref.adb: minor whitespace layout fix.
3560 2016-04-20 Vincent Celier <celier@adacore.com>
3562 * clean.adb (Gnatclean): Fail if project file specified and
3563 gprclean is not available.
3564 * gnatname.adb: Fail is -P is used and gprname is not available.
3565 * make.adb (Initialize): Fail if project file specified and
3566 gprbuild is not available.
3568 2016-04-20 Bob Duff <duff@adacore.com>
3570 * sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary
3571 stack when possible.
3573 2016-04-20 Gary Dismukes <dismukes@adacore.com>
3575 * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
3578 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3580 * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
3581 If the pragma comes from an aspect specification, verify that
3582 the aspect applies to an entity with a declarative part.
3583 * exp_ch5.adb: Code cleanup.
3585 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3587 * sem_res.adb (Resolve_If_Expression): If first expression is
3588 universal, resolve subsequent ones with the corresponding class
3589 type (Any_Integer or Any_Real).
3591 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3593 * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
3594 disabled, complete the analysis of the iterator name to ensure
3595 that reference for entities within are properly generated.
3597 2016-04-20 Arnaud Charlet <charlet@adacore.com>
3599 * a-dispat.ads (Yield): add Global contract.
3600 * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
3601 * a-taside.adb: Added Initializes => Tasking_State.
3603 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3605 * sem_ch13.adb (Build_Invariant_Procedure):
3606 Reimplement the invariant procedure spec and body insertion.
3608 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
3610 * sem_ch13.adb (Add_Invariant): Do not replace
3611 the saved expression of an invariatn aspect when inheriting
3612 a class-wide type invariant as this clobbers the existing
3613 expression. Do not use New_Copy_List as it is unnecessary
3614 and leaves the parent pointers referencing the wrong part of
3615 the tree. Do not replace the type references for ASIS when
3616 inheriting a class-wide type invariant as this clobbers the
3617 existing replacement.
3619 2016-04-20 Ed Schonberg <schonberg@adacore.com>
3621 * sem_util.adb (Build_Explicit_Dereference): If the designated
3622 expression is an entity name, generate reference to the entity
3623 because it will not be resolved again.
3625 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3627 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
3628 gnat_rm.texi: Update documentation.
3630 2016-04-19 Olivier Hainque <hainque@adacore.com>
3632 * par_sco.adb (Traverse_One, case N_Case_Statement):
3633 Skip pragmas before the first alternative.
3634 (Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.
3636 2016-04-19 Tristan Gingold <gingold@adacore.com>
3638 * adaint.c (__gnat_lwp_self): New function (for darwin).
3639 * s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
3642 2016-04-19 Olivier Hainque <hainque@adacore.com>
3644 * sem_util.adb (Build_Elaboration_Entity): Always request an
3645 elab counter when preserving control-flow.
3647 2016-04-19 Olivier Hainque <hainque@adacore.com>
3649 * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set
3650 Needs_Debug_Info when producing SCOs.
3651 * par_sco.adb (Traverse_Aspects): Fix categorization of
3652 Type_Invariant to match actual processing as activated depending
3653 on pragma Assertion_Policy.
3654 * sem_prag.adb (Analyze_Pragma): Remove special case for
3655 Name_Invariant regarding SCO generation, which completely disabled
3656 the production of SCOs for Invariant pragmas and aspects.
3658 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
3660 * checks.adb, sem_util.adb, sem_res.adb, sem_attr.adb: Minor
3663 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3665 * freeze.adb (Freeze_Profile): Refine predicate that checks
3666 whether a function that returns a limited view is declared in
3667 another unit and cannot be frozen at this point.
3669 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3671 * exp_aggr.adb (Component_Count): Handle properly superflat
3672 arrays, i.e. empty arrays where Hi < Lo - 1, to ensure that the
3673 return value of the function is Natural, rather than leaving
3674 the handling of such arrays to the caller of this function.
3676 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3678 * sem_prag.adb, sem_attr.adb, par-prag.adb, exp_aggr.adb, sem_type.adb
3679 sem_ch12.adb, sem_ch3.adb, exp_ch7.adb, exp_ch9.adb: Code cleanup.
3680 * sem_res.adb, sem_util.ads, sem_util.adb (Is_OK_Volatile_Context):
3681 Promoted from being a nested subprogram in Sem_Res.Resolve_Entity_Name
3682 to publicly visible routine in Sem_Util.
3684 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3686 * checks.adb (Apply_Parameter_Aliasing_Checks): Do not apply
3687 the check if the type of the actual is By_Reference.
3689 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3691 * sem_res.adb (Within_Subprogram_Call): Detect
3692 also nodes that appear in entry calls.
3693 (Resolve_Actuals, Insert_Default): Propagate
3694 dimension information if any, from default expression to the
3695 copy that appears in the list of actuals.
3696 * uintp.ads: minor whitespace fix in comment.
3697 * sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
3699 * set_targ.adb (Set_Targ): convert directly from
3700 Natural to Pos, without intermediate conversion to Int.
3702 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3704 * sem_ch6.adb (Process_Formals): Mark suspicious reference to
3705 SPARK RM in comment.
3706 * sem_prag.adb (Analyze_Global_Item): Fix reference to SPARK RM
3708 * sem_res.adb (Property_Error, Resolve_Actuals): Fix reference
3709 to SPARK RM in both comment and error message.
3711 2016-04-19 Eric Botcazou <ebotcazou@adacore.com>
3713 * sem_ch6.adb (Possible_Freeze): If the type is an incomplete
3714 CW type, then the subprogram must have a delayed freeze. This
3715 ensures that the backend can properly recover the full view when
3716 elaborating the access subprogram declaration.
3718 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3720 * sem_attr.adb (Resolve_Attribute, case 'Access): Freeze
3721 overloadable entity if originally overloaded.
3723 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3725 * exp_aggr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_code.adb,
3726 exp_fixd.adb, namet.adb, osint.adb, osint.ads, par-ch2.adb,
3727 sem_ch10.adb, sem_ch12.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb
3728 sem_util.adb, styleg.adb, styleg.ads, stylesw.ads: Minor code
3731 2016-04-19 Arnaud Charlet <charlet@adacore.com>
3733 * sem_util.adb (Copy_Node_With_Replacement):
3734 use Set_Comes_From_Source instead of directly manipulating
3735 internals of the node table.
3736 * sem_util.adb (Within_Scope): refactored to remove duplicated code.
3737 * sem_aux.adb (Get_Rep_Pragma,
3738 Subprogram_Body_Entity, Subprogram_Spec): declare variables that
3739 do not change as constants and initialize them in the declaration.
3740 (Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare
3741 variables that do not change as constants and initialize them
3744 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3746 * sem_res.adb (Resolve_Entry_Call): If the entry has
3747 preconditions it is rewritten by means of a wrapper that
3748 incorporates the original call. Before rewriting generate a
3749 reference to the entry being called to prevent spurious warnings
3750 and provide correct cross-reference information.
3752 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
3754 * sem_disp.adb (Check_Dispatching_Context): Code cleanup. Add
3755 local constant Scop. Ignore any internally generated loops when
3756 performing the check concerning an abstract subprogram call
3757 without a controlling argument.
3758 * sem_util.ads, sem_util.adb (Current_Scope_No_Loops): New routine.
3760 2016-04-19 Bob Duff <duff@adacore.com>
3762 * sem_elab.adb (Check_A_Call): There are cases where we have No
3763 (Ent) after the Alias loop, even when there was no previous error,
3764 so we can't assert that there was an error.
3766 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3768 * sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
3769 Reject use of type name as a prefix to 'access within an aggregate
3770 in a context that is not the declarative region of a type.
3772 2016-04-19 Vincent Celier <celier@adacore.com>
3774 * gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
3775 -P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
3776 -l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
3777 Remove anything related to project files
3778 * g-mbdira.adb: minor whitespace cleanup
3779 * g-spipat.adb: minor removal of extra spaces after closing paren
3781 2016-04-19 Ed Schonberg <schonberg@adacore.com>
3783 * exp_ch6.adb (Expand_Actuals): If post-statements are present
3784 and the enclosing context is a function call or indexing, build
3785 an Expression_With_Actions for the call.
3787 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>
3789 * lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
3790 a with line for an ignored Ghost unit.
3791 * sem_ch7.adb (Analyze_Package_Declaration): Add local constant
3792 Par. A child package is Ghost when its parent is Ghost.
3793 * sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
3794 a subprogram declaration that acts as a compilation unit.
3796 2016-04-18 Michael Matz <matz@suse.de>
3798 * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
3799 (gnat_to_gnu_field): Ditto.
3800 (components_to_record): Ditto.
3801 (create_variant_part_from): Ditto.
3802 (copy_and_substitute_in_size): Ditto.
3803 (substitute_in_type): Ditto.
3804 * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
3805 (make_packable_type): Ditto.
3806 (maybe_pad_type): Ditto.
3807 (finish_fat_pointer_type): Ditto.
3808 (finish_record_type): Ditto and use SET_DECL_ALIGN.
3809 (rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
3810 (create_field_decl): Use SET_DECL_ALIGN.
3812 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3814 * einfo.adb (Overridden_Operation): assert that
3815 function is called for valid arguments.
3816 * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb,
3817 s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads,
3818 sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb,
3819 sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb,
3820 s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb:
3821 No space after closing parenthesis except where required for
3823 * sem_res.adb: Minor reformatting.
3825 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3827 * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case
3828 statement when relevant.
3830 2016-04-18 Bob Duff <duff@adacore.com>
3832 * a-cuprqu.adb (Enqueue): Properly handle the
3833 case where the new element has a unique priority.
3835 2016-04-18 Tristan Gingold <gingold@adacore.com>
3837 * adaint.h: Define stat structures and functions for iOS
3840 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3842 * sem_res.adb (Resolve_Entry_Call): reset
3843 Is_Overloaded flag after resolving calls to overloaded protected
3845 * exp_spark.adb (Expand_SPARK): call
3846 Qualify_Entity_Names for tasking nodes, i.e. protected types,
3847 task types and entries.
3848 * exp_ch4.adb (Expand_N_If_Expression): Refine previous change
3849 in case of an unconstrained type.
3851 2016-04-18 Yannick Moy <moy@adacore.com>
3853 * sem_eval.adb, sem_eval.ads (Check_Non_Static_Context): Add
3854 comment to document usage of subprogram in GNATprove.
3856 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3858 * sem_prag.adb (Analyze_Pragma, case Test_Case): Improve error
3859 message for wrong placement of aspect Test_Case.
3861 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3863 * einfo.ads: Update the documentation of attribute Renamed_Object.
3864 * exp_spark.adb (Expand_Potential_Renaming): Reimplemented.
3866 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3868 * exp_ch4.adb (Optimize_Length_Comparison): Return immediately
3869 in the case of AAMP (same as for use of the -gnatd.P switch) to
3870 suppress this optimization, which avoids creating a dependence
3871 on the 64-bit arithmetic package.
3873 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3875 * exp_ch4.adb: Update comment.
3877 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
3879 * exp_ch6.adb (Expand_Call): Make sure instantiations are
3880 registered only once as pending here.
3882 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3884 * exp_ch4.adb, gnat1drv.adb, opt.ads, sem_res.adb
3885 (Minimize_Expression_With_Actions): New flag.
3886 (Adjust_Global_Switches): Set Minimize_Expression_With_Actions
3888 (Resolve_Short_Circuit): Redo previous change
3889 using Minimize_Expression_With_Actions.
3890 (Expand_N_If_Expression,
3891 Expand_Short_Circuit_Operator): Restore old code to avoid
3892 Expression_With_Actions when Minimize_Expression_With_Actions
3895 2016-04-18 Vincent Celier <celier@adacore.com>
3897 * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File and
3898 Stderr_File): Close local file descriptors when no longer needed.
3900 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3902 * sem_ch5.adb (Analyze_Iterator_Specification): Remove SPARK
3903 mode check that the type of the cursor in an iteration over
3904 a formal container is not volatile. The proper check on the
3905 element type is done elsewhere.
3907 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3909 * sem_ch6.adb (Process_Formals): Do not set a delay freeze on
3910 a subprogram that returns a class-wide type, if the subprogram
3911 is a compilation unit, because otherwise gigi will treat the
3912 subprogram as external, leading to link errors.
3914 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3916 * sem_res.adb (Resolve_Short_Circuit): Do not use
3917 expression-with-actions when generating C.
3919 2016-04-18 Yannick Moy <moy@adacore.com>
3921 * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate
3922 raise node in GNATprove mode.
3924 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3926 * s-fileio.adb: Minor reformatting.
3927 * sem_prag.adb (Analyze_Input_Item): Add local
3928 variable Input_OK. Do not consider mappings of generic formal
3929 parameters to actuals.
3931 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3933 * sem_ch5.adb (Get_Cursor_Type): If iterator type is a derived
3934 type, the cursor is declared in the scope of the parent type.
3935 (Analyze_Parameter_Specification): A qualified expression with an
3936 iterator type indicates an iteration over a container (explicit
3939 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3941 * osint-c.ads, osint-c.adb (Delete_C_File, Delete_H_File): New.
3942 * gnat1drv.adb (Gnat1drv): Delete old C files before regenerating them.
3943 * debug.adb: Reserve -gnatd.4 to force generation of C files.
3945 2016-04-18 Yannick Moy <moy@adacore.com>
3947 * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static
3948 division by zero, instead possibly issue a warning.
3949 * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on
3950 static division by zero, instead add check flag on original
3952 * sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error):
3953 Only issue error when both SPARK_Mode is On and Warn is False.
3955 2016-04-18 Yannick Moy <moy@adacore.com>
3957 * checks.adb (Apply_Scalar_Range_Check): Force
3958 warning instead of error when SPARK_Mode is On, on index out of
3959 bounds, and set check flag for GNATprove.
3961 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
3963 * sem_prag.adb (Check_In_Out_States.Check_Constituent_Usage):
3964 Update the comment on usage. Reimplemented.
3965 (Check_Input_States.Check_Constituent_Usage): Update the comment
3966 on usage. A Proof_In constituent can now refine an Input state
3967 as long as there is at least one Input constituent present.
3969 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3971 * sem_ch6.adb (Check_Inline_Pragma): Use the Sloc of the
3972 body id as the sloc of the entity in the generated subprogram
3973 declaration, to avoid spurious conformance errors when style
3976 2016-04-18 Ed Schonberg <schonberg@adacore.com>
3978 * sem_ch4.adb (Analyze_Selected_Component, Has_Dereference):
3979 Refine check on illegal calls to entities within a task body,
3980 when the entity is declared in an object of the same type. In
3981 a generic context there might be no explicit dereference but if
3982 the prefix includes an access type the construct is legal.
3984 2016-04-18 Arnaud Charlet <charlet@adacore.com>
3986 * rtsfind.ads, rtsfind.adb (RE_Id, RE_Unit_Table): add
3987 RE_Default_Priority.
3989 2016-04-18 Bob Duff <duff@adacore.com>
3991 * sem_prag.adb (Check_Arg_Is_Local_Name): Don't do the check
3992 if the pragma came from an aspect specification.
3994 2016-04-18 Gary Dismukes <dismukes@adacore.com>
3996 * gnat1drv.adb, contracts.adb: Minor reformatting and wording fixes.
3998 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4000 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): To suppress
4001 superfluous conformance check on an inlined body with a previous
4002 spec, use the fact that the generated declaration does not come
4003 from source. We must treat the entity as coming from source to
4004 enable some back-end inlining when pragma appears after the body.
4006 2016-04-18 Gary Dismukes <dismukes@adacore.com>
4008 * lib-xref-spark_specific.adb, par-ch2.adb, errout.ads,
4009 exp_intr.adb: Minor reformatting and typo corrections.
4011 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4013 * sem_ch6.adb: Code cleanup.
4015 2016-04-18 Thomas Quinot <quinot@adacore.com>
4017 * sem_ch13.adb: Minor reformatting and error message tweaking
4018 (remove extraneous spaces).
4020 2016-04-18 Johannes Kanig <kanig@adacore.com>
4022 * gnat1drv.adb (Gnat1drv): Force loading of System unit for SPARK.
4024 2016-04-18 Bob Duff <duff@adacore.com>
4026 * s-fileio.adb (Fopen_Mode): If Mode = Out_File, and the file
4027 exists, and it's a fifo, we use "w" as the open string instead of
4028 "r+". This is necessary to make a write to the fifo block until
4031 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4033 * sem_attr.adb (Denote_Same_Function): Account
4034 for a special case where a primitive of a tagged type inherits
4035 a class-wide postcondition from a parent type.
4037 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4039 * par-ch2.adb (P_Expression_Or_Reserved_Word): New routine.
4040 (P_Pragma): Signal Scan_Pragma_Argument_Association when the use
4041 of reserved words is OK.
4042 (Scan_Pragma_Argument_Association):
4043 Add new formal Reserved_Words_OK and update the comment on
4044 usage. Code cleanup. Parse an expression or a reserved word in
4045 identifier form for pragmas Restriction_Warnings and Restrictions
4046 No_Use_Of_Attribute.
4047 * restrict.adb (Check_Restriction_No_Use_Of_Attribute):
4048 Reimplemented. (Check_Restriction_No_Use_Of_Pragma): Code cleanup.
4049 (Set_Restriction_No_Specification_Of_Aspect): Properly set the warning
4051 (Set_Restriction_No_Use_Of_Attribute): Properly set the warning
4052 flag for an attribute. (Set_Restriction_No_Use_Of_Entity):
4053 Update the parameter profile.
4054 (Set_Restriction_No_Use_Of_Pragma): Properly set the warning flag for
4056 * restrict.ads (Check_Restriction_No_Use_Of_Attribute): Update
4057 the comment on usage.
4058 (Set_Restriction_No_Use_Of_Entity): Update the parameter profile.
4059 * sem_attr.adb (Analyze_Attribute): Check restriction
4060 No_Use_Of_Attribute.
4061 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Check
4062 restriction No_Use_Of_Attribute before any rewritings have
4064 * sem_prag.adb (Analyze_Pragma): Check restriction
4065 No_Use_Of_Pragma before any rewritings have taken place.
4067 2016-04-18 Bob Duff <duff@adacore.com>
4069 * sem_ch6.adb (Is_Inline_Pragma): The pragma
4070 argument can be a selected component, which has no Chars field,
4071 so we need to deal with that case (use the Selector_Name).
4072 (Check_Inline_Pragma): We need to test Is_List_Member before
4073 calling In_Same_List, because in case of a library unit, they're
4074 not in lists, so In_Same_List fails an assertion.
4076 2016-04-18 Bob Duff <duff@adacore.com>
4078 * namet.ads, namet.adb: Add an Append that appends a
4079 Bounded_String onto a Bounded_String. Probably a little more
4080 efficient than "Append(X, +Y);". Also minor cleanup.
4081 (Append_Decoded, Append_Decoded_With_Brackets, Append_Unqualified,
4082 Append_Unqualified_Decoded): Make sure these work with non-empty
4084 * casing.ads, casing.adb (Set_Casing): Pass a Bounded_String
4085 parameter, defaulting to Global_Name_Buffer.
4086 * errout.ads, errout.adb (Adjust_Name_Case): Pass a
4087 Bounded_String parameter, no default.
4088 * exp_ch11.adb (Expand_N_Raise_Statement): Use local
4089 Bounded_String instead of Global_Name_Buffer.
4090 * exp_intr.ads, exp_intr.adb (Write_Entity_Name): Rename it
4091 to Append_Entity_Name, and pass a Bounded_String parameter,
4092 instead of using globals.
4093 (Add_Source_Info): Pass a Bounded_String parameter, instead of
4095 (Expand_Source_Info): Use local instead of globals.
4096 * stringt.ads, stringt.adb (Append): Add an Append procedure
4097 for appending a String_Id onto a Bounded_String.
4098 (String_To_Name_Buffer, Add_String_To_Name_Buffer): Rewrite in
4100 * sem_prag.adb (Set_Error_Msg_To_Profile_Name): Adjust for new
4101 Adjust_Name_Case parameter.
4102 * erroutc.adb, uname.adb: Don't pass D => Mixed_Case to
4103 Set_Casing; that's the default.
4104 * lib-xref-spark_specific.adb (Add_SPARK_Scope): Pretend that calls to
4105 protected subprograms are entry calls; otherwise it is not possible to
4106 distinguish them from regular subprogram calls.
4108 2016-04-18 Gary Dismukes <dismukes@adacore.com>
4110 * sem_ch13.adb (Has_Good_Profile): Improvement
4111 of error message. Now indicates subtype_mark of formal parameter
4112 rather than the formal's name, plus minor rewording.
4114 2016-04-18 Pascal Obry <obry@adacore.com>
4116 * adaint.c, adaint.h, s-os_lib.ads: Add new routine Current_Process_Id.
4118 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4120 * stringt.adb, exp_ch6.adb, sem_ch13.adb: Minor reformatting.
4122 2016-04-18 Gary Dismukes <dismukes@adacore.com>
4124 * par-ch4.adb, sem_prag.adb: Minor reformatting.
4126 2016-04-18 Bob Duff <duff@adacore.com>
4128 * sinput.ads, sinput.adb (Build_Location_String): Take a
4129 parameter instead of using a global variable. The function
4130 version no longer destroys the Name_Buffer.
4131 * stringt.ads, stringt.adb (String_From_Name_Buffer): Take a
4132 parameter, which defaults to the Global_Name_Buffer, so some
4133 calls can avoid the global.
4134 * exp_ch11.adb, exp_intr.adb: Use new interfaces above
4135 to avoid using globals. All but one call to Build_Location_String
4136 avoids the global. Only one call to String_From_Name_Buffer
4139 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4141 * namet.adb, namet.ads, exp_unst.adb: Minor reformatting.
4143 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4145 * sem_eval.adb (Choice_Matches): Check the expression
4146 against the predicate values when the choice denotes a
4147 subtype with a static predicate.
4148 (Eval_Membership_Op): Code cleanup. Remove the suspicious guard which
4149 tests for predicates.
4150 (Is_OK_Static_Subtype): A subtype with a dynamic predicate
4151 is not static. (Is_Static_Subtype): A subtype with a dynamic
4152 predicate is not static.
4153 * sem_eval.ads (Is_OK_Static_Subtype): Update the comment on usage.
4154 (Is_Static_Subtype): Update the comment on usage.
4156 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4158 * sem_prag.adb (Analyze_Input_Item): Allow
4159 generic formals to appear as initialization items.
4161 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4163 * sem_ch13.adb (Analyze_Stream_TSS_Definition,
4164 Has_Good_Profile): Additional error message to indicate that
4165 the second parameter of the subprogram must be a first subtype.
4167 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4169 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Is_Inline_Pragma):
4170 Use the pragma lookahead that determines whether a subprogram
4171 is to be inlined, when some level of backend optimization is
4173 * sem_ch12.ads, sem_ch12.adb (Add_Pending_Instantiation): Factorize
4174 code used to create an instance body when needed for inlining.
4175 * exp_ch6.adb (Expand_Call): When a call is to be inlined, and the
4176 call appears within an instantiation that is not a compilation
4177 unit, add a pending instantiation for the enclosing instance,
4178 so the backend can inline in turn the calls contained in the
4181 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4183 * sem_prag.adb (Build_Pragma_Check_Equivalent): The mapping
4184 that relates operations of the parent type to the operations of
4185 the derived type has three distinct sources:
4186 a) explicit operations of the derived type carry an
4187 Overridden_Operation that designates the operation in the
4189 b) Implicit operations that are inherited by the derived type
4190 carry an alias that may be an explicit subprogram (in which case
4191 it may have an Overridden_ Operation indicator) or may also be
4192 inherited and carry its own alias.
4193 c) If the parent type is an interface, the operation of the
4194 derived type does not override, but the interface operation
4195 indicates the operation that implements it.
4196 * sem_prag.adb: Minor reformatting.
4197 * sem_prag.adb (Check_External_Property): Update
4198 the comment on usage. Reimplement.
4200 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4202 * exp_ch5.adb (Expand_Assignment_Statement): In restricted
4203 profiles such as ZFP, ceiling priority is not available.
4205 2016-04-18 Bob Duff <duff@adacore.com>
4207 * namet-sp.ads: Minor typo fix, ironically in 'Spelling_Checker'.
4209 2016-04-18 Bob Duff <duff@adacore.com>
4211 * sem_elab.adb (Output_Calls): Use
4212 Get_Name_String, to clearly indicate that the global Name_Buffer
4213 is being used. The previous code used Is_Internal_Name, which
4214 returns a Boolean, but also has a side effect of setting the
4215 Name_Buffer. Then it called the other Is_Internal_Name, which uses
4216 the Name_Buffer for its input. And then it called Error_Msg_N,
4217 again using the Name_Buffer. We haven't eliminated the global
4218 usage here, but we've made it a bit clearer.
4219 This also allows us to have a side-effect-free version of
4221 * namet.ads, namet.adb: Provide a type Bounded_String, along with
4222 routines that can be used without using global variables. Provide
4223 Global_Name_Buffer so existing code can continue to use the
4224 global. Mark the routines that use globals as obsolete. New code
4225 shouldn't call the obsolete ones, and we should clean up existing
4226 code from time to time.
4227 Name_Find_Str is renamed as Name_Find.
4228 * namet.h: Changed as necessary to interface to the new version
4230 * bindgen.adb, exp_unst.adb: Name_Find_Str is renamed as
4233 2016-04-18 Yannick Moy <moy@adacore.com>
4235 * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization): used
4236 outside of GNATprove, hence it should not be removed.
4238 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4240 * sem_prag.adb (Analyze_Refinement_Clause):
4241 The refinement of an external abstract state can now mention
4242 non-external constituents.
4243 (Check_External_Property): Update all SPARK RM references.
4245 2016-04-18 Bob Duff <duff@adacore.com>
4247 * exp_intr.adb: Remove some duplicated code.
4249 2016-04-18 Yannick Moy <moy@adacore.com>
4251 * a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-nuflra.ads: Mark
4252 package spec and body out of SPARK.
4254 2016-04-18 Johannes Kanig <kanig@adacore.com>
4256 * spark_xrefs.ads: Minor comment update.
4258 2016-04-18 Johannes Kanig <kanig@adacore.com>
4260 * gnat1drv.adb (Gnat1drv): Force loading of System
4263 2016-04-18 Bob Duff <duff@adacore.com>
4265 * a-cuprqu.adb: Correction to previous change. If a new node
4266 is inserted at the front of the queue (because it is higher
4267 priority than the previous front node), we need to update
4268 Header.Next_Unequal -- not just in the case where the queue was
4271 2016-04-18 Bob Duff <duff@adacore.com>
4273 * a-cuprqu.ads: Change the representation of List_Type from a
4274 singly-linked list to a doubly-linked list. In addition, add a
4275 pointer Next_Unequal, which points past a possibly-long chain
4276 of equal-priority items. This increases efficiency, especially
4277 in the case of many equal-priority items.
4278 * a-cuprqu.adb (Dequeue, Enqueue): Rewrite algorithms to take
4279 advantage of new data structure.
4280 (Finalize): Rewrite in terms of Dequeue, for simplicity.
4282 2016-04-18 Yannick Moy <moy@adacore.com>
4284 * contracts.adb (Analyze_Object_Contract,
4285 Analyze_Protected_Contract): Remove tests performed in GNATprove.
4286 * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization):
4287 Remove query for tests performed in GNATprove.
4289 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4291 * sem_aggr.adb (Resolve_Record_Aggregate): If
4292 Warn_On_Redundant_Constructs is enabled, report a redundant box
4293 association that does not cover any components, as it done for
4294 redundant others associations in case statements.
4296 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4298 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions):
4299 Analyze the generated Check pragma for an inherited condition so
4300 that it does not freeze the dispatching type of the primitive
4301 operation, because it is pre-analyzed at the point of the
4302 subprogram declaration (and not in the subprogram body, as is
4303 done during regular expansion).
4305 2016-04-18 Vincent Celier <celier@adacore.com>
4307 * ali.ads: Increase the range of all _Id types to 100 millions.
4309 2016-04-18 Gary Dismukes <dismukes@adacore.com>
4311 * sem_warn.adb (Check_References): Change warning to suggest
4312 using pragma Export rather than saying "volatile has no effect".
4314 2016-04-18 Bob Duff <duff@adacore.com>
4316 * g-souinf.ads (Compilation_ISO_Date): New function to return
4317 the current date in ISO form.
4318 * exp_intr.adb (Expand_Source_Info, Add_Source_Info): Expand
4319 a call to Compilation_ISO_Date into a string literal containing
4320 the current date in ISO form.
4321 * exp_intr.ads (Add_Source_Info): Improve documentation.
4322 * sem_intr.adb (Check_Intrinsic_Subprogram): Recognize
4323 Compilation_ISO_Date.
4324 * snames.ads-tmpl (Name_Compilation_ISO_Date): New Name_Id.
4326 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4328 * layout.adb (Set_Elem_Alignment): Extend setting of alignment
4329 to subtypes that are not first subtypes.
4331 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4333 * sem_prag.ads (Collect_Inherited_Class_Wide_Conditions):
4335 * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Insert
4336 generated pragmas after subprogram declaration, rather than in
4337 the corresponding subprogram body.
4338 * sem_ch6.adb (New_Overloaded_Entity): In GNATProve
4339 mode, if the operation is overridding, call
4340 Collect_Inherited_Class_Wide_Conditions to generate the
4341 corresponding pragmas immediately after the corresponding
4342 subprogram declaration.
4344 2016-04-18 Arnaud Charlet <charlet@adacore.com>
4346 * spark_xrefs.ads (Xref_Index, Scope_Index, File_Index): restrict
4347 type to natural numbers.
4348 (Stype): document code characters for concurrent entities.
4350 2016-04-18 Olivier Hainque <hainque@adacore.com>
4352 * targparm.ads: Update the Frontend_Exceptions default internal
4354 (Frontend_Exceptions_On_Target): Change default value to True.
4356 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4358 * sem_ch4.adb (Analyze_Selected_Component): Refine error
4359 detection when a selected component in the body of a synchronized
4360 type is a reference to an object of the same type declared
4361 elsewhere. The construct is legal if the prefix of the selected
4362 component includes an explicit dereference at any point.
4364 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4366 * sem_ch3.adb (Analyze_Object_Declaration): Do not consider
4367 internally generated expressions when trying to determine whether
4368 a formal parameter of a tagged type subject to Extensions_Visible
4369 False is used to initialize an object.
4370 * sem_ch4.adb (Analyze_Type_Conversion): Do not consider
4371 internally generated expressions when trying to determine whether
4372 a formal parameter of a tagged type subject to Extensions_Visible
4373 False is used in a type conversion.
4375 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4377 * sem_res.adb (Is_Protected_Operation_Call):
4378 Add guards to account for a non-decorated selected component.
4380 2016-04-18 Yannick Moy <moy@adacore.com>
4382 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve
4383 implementation of Body_Has_SPARK_Mode_On.
4384 * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_From_Annotation):
4385 New function replacing previous Get_SPARK_Mode_From_Pragma, that
4386 deals also with aspects.
4387 (Get_SPARK_Mode_Type): Make function internal again.
4388 * inline.adb, sem_ch7.adb, sem_util.adb: Use new
4389 Get_SPARK_Mode_From_Annotation.
4391 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4393 * contracts.adb (Analyze_Object_Contract): Update references to
4395 * freeze.adb (Freeze_Entity): Update references to SPARK RM.
4396 * ghost.adb Add with and use clauses for Sem_Disp.
4397 (Check_Ghost_Derivation): Removed.
4398 (Check_Ghost_Overriding):
4399 Reimplemented. (Check_Ghost_Policy): Update references to SPARK RM.
4400 (Check_Ghost_Primitive): New routine.
4401 (Check_Ghost_Refinement): New routine. (Is_OK_Ghost_Context):
4402 Update references to SPARK RM. (Is_OK_Pragma): Update references
4403 to SPARK RM. Predicates are now a valid context for references
4405 * ghost.ads (Check_Ghost_Derivation): Removed.
4406 (Check_Ghost_Overriding): Update the comment on usage.
4407 (Check_Ghost_Primitive): New routine.
4408 (Check_Ghost_Refinement): New routine.
4409 (Remove_Ignored_Ghost_Code): Update references to SPARK RM.
4410 * sem_ch3.adb (Process_Full_View): Remove the now obsolete check
4411 related to Ghost derivations
4412 * sem_ch6.adb (Check_Conformance): Remove now obsolete check
4413 related to the convention-like behavior of pragma Ghost.
4414 (Check_For_Primitive_Subprogram): Verify that the Ghost policy
4415 of a tagged type and its primitive agree.
4416 * sem_prag.adb (Analyze_Pragma): Update references to SPARK
4417 RM. Move the verification of pragma Assertion_Policy Ghost
4418 to the proper place. Remove the now obsolete check related
4419 to Ghost derivations.
4420 (Collect_Constituent): Add a call to Check_Ghost_Refinement.
4421 * sem_res.adb (Resolve_Actuals): Update references to SPARK RM.
4423 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4425 * layout.adb: Fix more minor typos in comments.
4427 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4429 * a-calend.ads, sem_prag.adb, sem_ch6.adb: Minor reformatting.
4431 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4433 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): In GNATprove
4434 mode, collect inherited class-wide conditions to generate the
4435 corresponding pragmas.
4436 * sem_prag.ads (Build_Pragma_Check_Equivalent): Moved from contracts
4437 * contracts.adb (Collect_Inherited_Class_Wide_Conditions): New
4438 procedure for overriding subprograms, used to generate the pragmas
4439 corresponding to an inherited class- wide pre- or postcondition.
4440 * sem_prag.adb (Build_Pragma_Check_Equivalent): moved here
4441 from contracts.adb (Replace_Condition_Entities): Subsidiary
4442 Build_Pragma_Check_Equivalent, to implement the proper semantics
4443 of inherited class-wide conditions, as given in AI12-0113.
4444 (Process_Class_Wide_Condition): Removed.
4445 (Collect_Inherited_Class_Wide_Conditions): Iterate over pragmas
4446 in contract of subprogram, to collect inherited class-wide
4448 (Build_Pragma_Check_Equivalent): Moved to sem_prag.adb
4450 2016-04-18 Yannick Moy <moy@adacore.com>
4452 * a-calend.adb (Ada.Calendar): Mark package body as SPARK_Mode Off.
4453 * a-calend.ads (Ada.Calendar): Mark package spec as
4454 SPARK_Mode and add synchronous external abstract state Clock_Time.
4456 2016-04-18 Yannick Moy <moy@adacore.com>
4458 * sem_res.adb (Resolve_Call): Prevent inlining of
4459 calls inside expression functions. Factor previous code issuing
4460 errors to call Cannot_Inline instead, which does appropriate
4461 processing of message for GNATprove.
4463 2016-04-18 Arnaud Charlet <charlet@adacore.com>
4465 * einfo.ads, sem_ch3.adb, sem_ch8.adb, osint-l.adb, rtsfind.adb,
4466 osint-b.adb: Cleanups.
4468 2016-04-18 Yannick Moy <moy@adacore.com>
4470 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Only create
4471 body to inline in GNATprove mode when SPARK_Mode On applies to
4473 * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_Type): Make function
4476 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4478 * layout.adb: Fix minor typo in comment.
4479 * inline.adb: Fix minor pasto.
4480 * sem_ch12.ads: Fix minor typos in comments.
4482 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4484 * sem_disp.adb (Check_Dispatching_Call): Major rewriting to
4485 handle some complex cases of tag indeterminate calls that are
4486 actuals in other dispatching calls that are themselves tag
4488 (Check_Dispatching_Context): Add parameter to support recursive
4489 check for an enclosing construct that may provide a tag for a
4490 tag-indeterminate call.
4492 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4494 * sem_prag.adb (Analyze_Depends_In_Decl_Part):
4495 Add global variables Task_Input_Seen and Task_Output_Seen.
4496 (Analyze_Global_Item): Detect an illegal use of the current
4497 instance of a single protected/task type in a global annotation.
4498 (Analyze_Input_Output): Inputs and output related to the current
4499 instance of a task unit are now tracked.
4500 (Check_Usage): Require
4501 the presence of the current instance of a task unit only when
4502 one input/output is available. (Current_Task_Instance_Seen):
4504 (Is_CCT_Instance): New parameter profile. Update
4505 the comment on usage. The routine now properly recognizes several
4506 cases related to single protected/task types.
4508 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>
4510 * freeze.adb (Freeze_Entity): Use New_Freeze_Node
4511 to create a brand new freeze node. This handles a case where an
4512 ignored Ghost context is freezing something which is not ignored
4513 Ghost and whose freeze node should not be removed from the tree.
4514 (New_Freeze_Node): New routine.
4516 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
4518 * sigtramp.h (__gnat_set_is_vxsim) New function to
4519 tell sigtramp-vxworks to handle vxsim signal contexts. *
4520 sigtramp-vxworks.c (__gnat_sigtramp) Take into account the
4521 differences in the sigcontext structure between the expected
4522 regular x86 or x86_64 ones and the ones received in case of
4523 exexution on the vxworks simulator.
4524 * init.c: also compute is_vxsim in case of x86_64-vx7 target. Provide
4525 this information to sigtramp-vxworks.c. Remove the old mechanism for
4527 * init-vxsim.c, sigtramp-vxworks-vxsim.c: remove, now obsolete.
4529 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4531 * exp_ch3.adb (Inline_Init_Proc): New function returning
4532 whether the initialization procedure of a type should be
4533 inlined. Return again True for controlled type themselves.
4534 (Build_Array_Init_Proc): Call it to set Set_Is_Inlined on Init_Proc.
4535 (Build_Record_Init_Proc): Likewise.
4537 2016-04-18 Arnaud Charlet <charlet@adacore.com>
4539 * gnatvsn.ads (Library_Version): Bump to 7.
4541 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4543 * sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag
4544 on the entity of a subprogram declaration that is completed by
4545 an expression function.
4547 2016-04-18 Ed Schonberg <schonberg@adacore.com>
4549 * sem_util.adb (Is_Current_Instance): A entity given by a subtype
4550 declaration can appear in an aspect specification for a dynamic
4551 predicate, and a pragma for aspect Predicate_Failure.
4552 * exp_util.adb (Replace_Subtype_References): Replace current
4553 occurrences of the subtype to which a dynamic predicate applies,
4554 byt the expression that triggers a predicate check. Needed to
4555 implement new aspect Predicate_Failure.
4557 2016-04-18 Arnaud Charlet <charlet@adacore.com>
4559 * a-intsig.ads, a-intsig.adb: Removed, no longer used.
4560 * Makefile.rtl: update accordingly.
4562 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4564 * sem_type.adb (Disambiguate): Call Covers only when necessary
4565 for standard operators.
4567 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4569 * atree.ads (Num_Extension_Nodes): Add couple of figures
4571 * atree.adb: Add GNAT.Heap_Sort_G dependency.
4572 (Print_Statistics): New exported procedure to print statistics.
4574 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4576 * exp_ch3.adb (Build_Record_Init_Proc): Do not mark the procedure
4577 as to be inlined if the type needs finalization.
4579 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
4581 * sigtramp-vxworks-target.inc: sigtramp-vxworks: force the stack
4582 alignment for x86_64.
4583 * init.c: Better fix for guard page reset on x86_64-vx7.
4584 Do not try to retrieve the page that actually raised
4585 the signal as the probing mechanism used on x86_64 do not allow
4586 such retrieval. We thus just test if the guard page is active,
4587 and re-activate it if not.
4589 2016-04-18 Arnaud Charlet <charlet@adacore.com>
4591 * a-sytaco.adb (Suspension_Object): Aspect Default_Initial_Condition
4594 2016-04-18 Jerome Lambourg <lambourg@adacore.com>
4596 * affinity.c: Use the proper type for task id.
4597 * init.c (__gnat_inum_to_ivec): ivec is a pointer.
4599 2016-04-18 Arnaud Charlet <charlet@adacore.com>
4601 * sem_prag.adb (Process_Convention): Relax rule on exporting
4602 Intrinsic types if Relaxed_RM_Semantics is True.
4604 2016-04-18 Vincent Celier <celier@adacore.com>
4606 * sem_ch3.adb, lib.ads, sinfo.ads, sem_ch10.adb, einfo.adb, einfo.ads,
4607 checks.ads, sem_ch12.adb, sem.adb, sem_util.adb, sem_util.ads,
4608 sem_res.adb, sem_attr.adb, par.adb, exp_ch4.adb, errout.ads,
4609 sem_ch4.adb, atree.adb, atree.ads, sem_warn.adb, treepr.adb,
4610 exp_ch3.ads, exp_unst.adb: Change "descendent" to
4611 "descendant" in comments, error messages and identifiers.
4612 * gcc-interface/decl.c: Ditto.
4614 2016-04-18 Eric Botcazou <ebotcazou@adacore.com>
4616 * sem_type.adb (Operator_Matches_Spec): Call First_Formal on
4617 New_S only once at the beginning of the function.
4619 2016-04-02 Eric Botcazou <ebotcazou@adacore.com>
4621 * gcc-interface/decl.c (components_to_record): Restrict the previous
4622 change to fields with variable size.
4624 2016-03-27 Eric Botcazou <ebotcazou@adacore.com>
4626 * gcc-interface/decl.c (components_to_record): Add special case for
4627 single field with representation clause at offset 0.
4629 2016-03-16 Svante Signell <svante.signell@gmail.com>
4631 * gcc-interface/Makefile.in: Add support for x86 GNU/Hurd.
4632 * s-osinte-gnu.ads: New file.
4634 2016-03-13 Eric Botcazou <ebotcazou@adacore.com>
4636 * system-vxworks-m68k.ads (Stack_Check_Probes): Set to True.
4637 (Stack_Check_Limits): Set to False.
4638 * system-vxworks-mips.ads (Stack_Check_Probes): Set to True.
4639 (Stack_Check_Limits): Set to False.
4640 * system-vxworks-ppc.ads (Stack_Check_Probes): Set to True.
4641 (Stack_Check_Limits): Set to False.
4642 * system-vxworks-sparcv9.ads (Stack_Check_Probes): Set to True.
4643 (Stack_Check_Limits): Set to False.
4644 * system-vxworks-x86.ads (Stack_Check_Probes): Set to True.
4645 (Stack_Check_Limits): Set to False.
4647 2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
4649 * gcc-interface/trans.c (statement_node_p): New predicate.
4650 (gnat_to_gnu): Invoke it to detect statement nodes. In ASIS mode, do
4651 not return dummy results for expressions attached to packed array
4652 implementation types.
4654 2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
4656 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always mark
4657 the expression of a renaming manually in case #3.
4659 2016-03-02 Dominik Vogt <vogt@linux.vnet.ibm.com>
4661 * system-linux-s390.ads: Enable Stack_Check_Probes.
4662 * system-linux-s390.ads: Likewise.
4664 2016-02-29 Martin Liska <mliska@suse.cz>
4666 * gcc-interface/utils.c (set_reverse_storage_order_on_pad_type):
4667 Replace ENABLE_CHECKING macro with flag_checking.
4669 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
4671 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Retrofit
4672 handling of unconstrained array types as designated types into common
4673 processing. Also handle array types as incomplete designated types.
4675 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
4677 * gcc-interface/decl.c (gnat_to_gnu_entity) <Concurrent types>: In
4678 ASIS mode, fully lay out the minimal record type.
4680 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
4682 * gcc-interface/trans.c (finalize_nrv_r): Remove obsolete code.
4683 (build_return_expr): Likewise.
4684 (Call_to_gnu): If this is a function call and there is no target,
4685 create a temporary for the return value for all aggregate types,
4686 but never create it for a return statement. Push a binding level
4687 around the call in more cases. Remove obsolete code.
4689 2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
4691 * gcc-interface/ada-tree.h (DECL_RETURN_VALUE_P): New macro.
4692 * gcc-interface/gigi.h (gigi): Remove useless attribute.
4693 (gnat_gimplify_expr): Likewise.
4694 (gnat_to_gnu_external): Declare.
4695 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Factor out
4696 code dealing with the expression of external constants into...
4697 Invoke gnat_to_gnu_external instead.
4698 <E_Variable>: Invoke gnat_to_gnu_external to translate renamed objects
4699 when not for a definition. Deal with COMPOUND_EXPR and variables with
4700 DECL_RETURN_VALUE_P set for renamings and with the case of a dangling
4701 'reference to a function call in a renaming. Remove obsolete test and
4702 adjust associated comment.
4703 * gcc-interface/trans.c (Call_to_gnu): Set DECL_RETURN_VALUE_P on the
4704 temporaries created to hold the return value, if any.
4705 (gnat_to_gnu_external): ...this. New function.
4706 * gcc-interface/utils.c (create_var_decl): Detect a constant created
4707 to hold 'reference to function call.
4708 * gcc-interface/utils2.c (build_unary_op) <ADDR_EXPR>: Add folding
4709 for COMPOUND_EXPR in the DECL_RETURN_VALUE_P case.
4711 2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
4713 * exp_ch4.adb (Expand_N_Indexed_Component): Activate synchronization if
4714 the prefix denotes an entity which Has_Atomic_Components.
4715 * gcc-interface/trans.c (node_is_atomic): Return true if the prefix
4716 denotes an entity which Has_Atomic_Components.
4718 2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
4720 * gcc-interface/utils2.c (gnat_protect_expr): Make a SAVE_EXPR only
4721 for fat pointer or scalar types.
4723 2016-02-16 Eric Botcazou <ebotcazou@adacore.com>
4725 * gcc-interface/gigi.h (maybe_debug_type): New inline function.
4726 * gcc-interface/misc.c (gnat_get_array_descr_info): Use it.
4727 Call maybe_character_value on the array bounds. Get to the base type
4728 of the index type and call maybe_debug_type on it.
4729 * gcc-interface/utils.c (finish_character_type): Add special treatment
4732 2016-02-16 Eric Botcazou <ebotcazou@adacore.com>
4734 * gcc-interface/misc.c (gnat_enum_underlying_base_type): New function.
4735 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define to above.
4737 2016-02-12 Jakub Jelinek <jakub@redhat.com>
4739 * prj-tree.ads: Spelling fixes - behaviour -> behavior and
4740 neighbour -> neighbor.
4741 * prep.adb: Likewise.
4742 * prj.ads: Likewise.
4743 * prepcomp.adb: Likewise.
4744 * g-socket.ads: Likewise.
4745 * s-imgrea.adb: Likewise.
4746 * a-calend.adb: Likewise.
4747 * exp_disp.adb: Likewise.
4748 * doc/gnat_ugn/gnat_utility_programs.rst: Likewise.
4749 * g-socket.adb: Likewise.
4750 * sem_ch12.adb: Likewise.
4751 * terminals.c: Likewise.
4753 2016-02-08 Bernd Schmidt <bschmidt@redhat.com>
4755 * gcc-interface/misc.c (gnat_init): Remove second argument in call to
4756 build_common_tree_nodes.
4758 2016-02-08 Eric Botcazou <ebotcazou@adacore.com>
4760 * gcc-interface/utils.c (create_var_decl): Set again DECL_COMMON and
4761 DECL_IGNORED_P last.
4763 2016-01-28 Eric Botcazou <ebotcazou@adacore.com>
4765 * gcc-interface/gigi.h (enum attr_type): Rename into...
4766 (enum attrib_type): ...this.
4767 (struct attrib): Adjust.
4768 * gcc-interface/decl.c (prepend_one_attribute): Likewise.
4770 2016-01-20 Eric Botcazou <ebotcazou@adacore.com>
4772 * exp_ch2.adb (Expand_Current_Value): Make an appropriate character
4773 literal if the entity is of a character type.
4774 * gcc-interface/lang.opt (fsigned-char): New option.
4775 * gcc-interface/misc.c (gnat_handle_option): Accept it.
4776 (gnat_init): Adjust comment.
4777 * gcc-interface/gigi.h (finish_character_type): New prototype.
4778 (maybe_character_type): New inline function.
4779 (maybe_character_value): Likewise.
4780 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>: For
4781 a character of CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
4782 Set TYPE_ARTIFICIAL early and call finish_character_type on the type.
4783 <E_Enumeration_Subtype>: For a subtype of character with RM_Size and
4784 Esize equal to CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
4785 Copy TYPE_STRING_FLAG from type to subtype.
4786 <E_Array_Type>: Deal with character index types.
4787 <E_Array_Subtype>: Likewise.
4788 * gcc-interface/trans.c (gigi): Replace unsigned_char_type_node with
4789 char_type_node throughout.
4790 (build_raise_check): Likewise.
4791 (get_type_length): Deal with character types.
4792 (Attribute_to_gnu) <Attr_Pos>: Likewise. Remove obsolete range check
4794 <Attr_Pred>: Likewise.
4795 (Loop_Statement_to_gnu): Likewise.
4796 (Raise_Error_to_gnu): Likewise.
4797 <N_Indexed_Component>: Deal with character index types. Remove
4799 <N_Slice>: Likewise.
4800 <N_Type_Conversion>: Deal with character types. Minor tweak.
4801 <N_Unchecked_Type_Conversion>: Likewise.
4803 <N_Op_Eq>: Likewise.
4804 (emit_index_check): Delete.
4805 * gcc-interface/utils.c (finish_character_type): New function.
4806 (gnat_signed_or_unsigned_type_for): Deal with built-in character types.
4807 * gcc-interface/utils2.c (expand_sloc): Replace unsigned_char_type_node
4808 with char_type_node.
4809 (build_call_raise): Likewise.
4810 (build_call_raise_column): Likewise.
4811 (build_call_raise_range): Likewise.
4813 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4815 * gcc-interface/gigi.h (build_call_raise_column): Adjust prototype.
4816 (build_call_raise_range): Likewise.
4817 (gnat_unsigned_type): Delete.
4818 (gnat_signed_type): Likewise.
4819 (gnat_signed_or_unsigned_type_for): New prototype.
4820 (gnat_unsigned_type_for): New inline function.
4821 (gnat_signed_type_for): Likewise.
4822 * gcc-interface/cuintp.c (build_cst_from_int): Call build_int_cst.
4823 * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
4824 (gnat_to_gnu_entity) <E_Array_Type>: Always translate the index types
4825 and compute their base type from that.
4826 <E_Array_Subtype>: Remove duplicate declaration.
4827 * gcc-interface/misc.c (get_array_bit_stride): Call build_int_cst.
4828 * gcc-interface/trans.c (get_type_length): Likewise.
4829 (Attribute_to_gnu): Likewise.
4830 (Loop_Statement_to_gnu): Likewise.
4831 (Call_to_gnu): Likewise.
4832 (gnat_to_gnu): Call build_real, build_int_cst, gnat_unsigned_type_for
4833 and gnat_signed_type_for. Minor tweaks.
4834 (build_binary_op_trapv): Likewise.
4835 (emit_check): Likewise.
4836 (convert_with_check): Likewise.
4837 (Raise_Error_to_gnu): Adjust calls to the build_call_raise family of
4838 functions. Minor tweaks.
4839 (Case_Statement_to_gnu): Remove dead code.
4840 (gnat_to_gnu): Call gnat_unsigned_type_for and gnat_signed_type_for.
4841 (init_code_table): Minor reordering.
4842 * gcc-interface/utils.c (gnat_unsigned_type): Delete.
4843 (gnat_signed_type): Likewise.
4844 (gnat_signed_or_unsigned_type_for): New function.
4845 (unchecked_convert): Use directly the size in the test for precision
4846 vs size adjustments.
4847 (install_builtin_elementary_types): Call gnat_signed_type_for.
4848 * gcc-interface/utils2.c (nonbinary_modular_operation): Call
4850 (build_goto_raise): New function taken from...
4851 (build_call_raise): ...here. Call it.
4852 (build_call_raise_column): Add KIND parameter and call it.
4853 (build_call_raise_range): Likewise.
4855 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4857 * gcc-interface/ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename to
4858 (TYPE_IMPL_PACKED_ARRAY_P): ...this.
4859 (TYPE_CAN_HAVE_DEBUG_TYPE_P): Do not test TYPE_DEBUG_TYPE.
4860 * gcc-interface/decl.c (gnat_to_gnu_entity): Simplify NULL_TREE tests
4861 and tweak gnat_encodings tests throughout.
4862 (initial_value_needs_conversion): Likewise.
4863 (intrin_arglists_compatible_p): Likewise.
4864 * gcc-interface/misc.c (gnat_print_type): Likewise.
4865 (gnat_get_debug_type): Likewise.
4866 (gnat_get_fixed_point_type_info): Likewise.
4867 (gnat_get_array_descr_info): Likewise.
4868 (get_array_bit_stride): Likewise.
4869 (gnat_get_type_bias): Fix formatting.
4870 (enumerate_modes): Likewise.
4871 * gcc-interface/trans.c (gnat_to_gnu): Likewise.
4872 (add_decl_expr): Simplify NULL_TREE test.
4873 (end_stmt_group): Likewise.
4874 (build_binary_op_trapv): Fix formatting.
4875 (get_exception_label): Use switch statement.
4876 (init_code_table): Move around.
4877 * gcc-interface/utils.c (global_bindings_p): Simplify NULL_TREE test.
4878 (gnat_poplevel): Likewise.
4879 (gnat_set_type_context): Likewise.
4880 (defer_or_set_type_context): Fix formatting.
4881 (gnat_pushdecl): Simplify NULL_TREE test.
4882 (maybe_pad_type): Likewise.
4883 (add_parallel_type): Likewise.
4884 (create_range_type): Likewise.
4885 (process_deferred_decl_context): Likewise.
4886 (convert): Likewise.
4887 (def_builtin_1): Likewise.
4888 * gcc-interface/utils2.c (find_common_type): Likewise.
4889 (build_binary_op): Likewise.
4890 (gnat_rewrite_reference): Likewise.
4891 (get_inner_constant_reference): Likewise.
4893 2016-01-18 Eric Botcazou <ebotcazou@adacore.com>
4896 * gcc-interface/trans.c (check_inlining_for_nested_subprog): Consider
4897 the parent function instead of the current function in order to issue
4898 the warning or the error. Add guard for ignored functions.
4900 2016-01-17 Jakub Jelinek <jakub@redhat.com>
4902 * adaint.c (__gnat_killprocesstree): Avoid -Wparentheses warning.
4904 2016-01-15 Jakub Jelinek <jakub@redhat.com>
4906 * adaint.c (__gnat_locate_exec_on_path): Use const char * instead
4907 of char * for path_val to avoid warnings.
4909 2016-01-06 Pierre-Marie de Rodat <derodat@adacore.com>
4911 * gcc-interface/utils.c: Bump copyright year.
4912 (rest_of_record_type_compilation): Add XVE/XVU parallel types to
4913 the current lexical scope.
4915 2016-01-04 Jakub Jelinek <jakub@redhat.com>
4917 * gnat_ugn.texi: Bump @copying's copyright year.
4918 * gnat_rm.texi: Likewise.
4920 2016-01-02 Eric Botcazou <ebotcazou@adacore.com>
4922 * gnatvsn.ads: Bump copyright year.
4925 Copyright (C) 2016 Free Software Foundation, Inc.
4927 Copying and distribution of this file, with or without modification,
4928 are permitted in any medium without royalty provided the copyright
4929 notice and this notice are preserved.