1 2019-07-04 Yannick Moy <moy@adacore.com>
3 * sem_spark.adb (Check_Package_Spec, Check_Package_Body): Only
4 analyze parts of the code marked in SPARK.
6 2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
8 * erroutc.adb, exp_aggr.adb, inline.adb, opt.adb, sem_ch3.adb:
11 2019-07-04 Yannick Moy <moy@adacore.com>
13 * sem_spark.adb (Explanation, Get_Expl): New functions to get
14 the explanation for a permission mismatch.
15 (Perm_Error, Perm_Mismatch, Perm_Error_Loop_Exit): Take
16 explanation into account for issuing a more precise error
18 (Set_Perm_Prefixes, Set_Perm_Extensions,
19 Set_Perm_Extensions_Move): Pass suitable argument for the
22 2019-07-04 Arnaud Charlet <charlet@adacore.com>
24 * exp_aggr.adb (In_Place_Assign_OK): Moved to top level and add
25 support for record aggregates.
26 (Component_Check): Use Is_CCG_Supported_Aggregate instead of a
27 similar local predicate.
28 (Convert_To_Assignments): Take advantage of In_Place_Assign_OK
29 predicate when possible.
30 (Is_CCG_Supported_Aggregate): Return False for records with
31 representation clauses and fix the logic for dealing with nested
34 2019-07-04 Piotr Trojanek <trojanek@adacore.com>
36 * opt.adb (Set_Config_Switches): Keep assertions policy as
37 enabled when analysing internal units in GNATprove mode.
39 2019-07-04 Arnaud Charlet <charlet@adacore.com>
41 * exp_ch4.adb (Expand_Short_Circuit_Operator): Strip
42 N_Variable_Reference_Marker when checking for the presence of
45 2019-07-04 Arnaud Charlet <charlet@adacore.com>
47 * exp_aggr.adb (Check_Component): Take into account type
50 2019-07-04 Dmitriy Anisimkov <anisimko@adacore.com>
52 * doc/gnat_ugn/platform_specific_information.rst: Document
53 Windows socket timeout particularity.
54 * gnat_ugn.texi: Regenerate.
55 * gsocket.h: Include versionhelpers.h.
56 * socket.c (__gnat_minus_500ms): New function.
57 * libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): New
59 * libgnat/g-socket.adb (Set_Socket_Option): Refactor to remove
60 500ms from the requested timeout only on old Windows version.
62 2019-07-04 Thomas Quinot <quinot@adacore.com>
64 * get_scos.adb: Remove bogus, dead code.
66 2019-07-04 Ed Schonberg <schonberg@adacore.com>
68 * sem_dim.adb (Analyze_Dimension_Array_Aggregate): If the
69 component is an entity name, its dimensions are those of its
72 2019-07-03 Bob Duff <duff@adacore.com>
74 * doc/gnat_ugn/gnat_utility_programs.rst: Document new flags in
77 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
79 * binde.adb: Remove with clause for System.OS_Lib.
80 (Force_Elab_Order): Refactor the majority of the code in Butil.
81 Use the new forced units iterator to obtain unit names.
82 * bindo-builders.adb: Add with and use clauses for Binderr,
83 Butil, Opt, Output, Types, GNAT, and GNAT.Dynamic_HTables. Add
84 a hash table which maps units to line number in the forced
85 elaboration order file.
86 (Add_Unit): New routine.
87 (Build_Library_Graph): Create forced edges between pairs of
88 units listed in the forced elaboration order file.
89 (Create_Forced_Edge, Create_Forced_Edges, Destroy_Line_Number,
90 Duplicate_Unit_Error, Hash_Unit, Internal_Unit_Info,
91 Is_Duplicate_Unit, Missing_Unit_Info): New routines.
92 * bindo-graphs.adb (Is_Internal_Unit, Is_Predefined_Unit):
93 Refactor some of the behavior to Bindo-Units.
94 * bindo-graphs.ads: Enable the enumeration literal for forced
96 * bindo-units.adb, bindo-units.ads (Is_Internal_Unit,
97 Is_Predefined_Unit): New routines.
98 * butil.adb: Add with and use clauses for Opt, GNAT, and
99 System.OS_Lib. Add with clause for Unchecked_Deallocation.
100 (Has_Next, Iterate_Forced_Units, Next, Parse_Next_Unit_Name,
101 Read_Forced_Elab_Order_File): New routines.
102 * butil.ads: Add with and use clauses for Types. Add new
103 iterator over the units listed in the forced elaboration order
105 (Has_Next, Iterate_Forced_Units, Next): New routine.
106 * namet.adb, namet.ads (Present): New routine.
108 2019-07-03 Bob Duff <duff@adacore.com>
110 * sem_ch3.adb (Access_Definition): The code was creating a
111 master in the case where the designated type is a class-wide
112 interface type. Create a master in the noninterface case as
113 well. That is, create a master for all limited class-wide types.
115 2019-07-03 Yannick Moy <moy@adacore.com>
117 * erroutc.adb (Sloc_In_Range): New function to determine whether
118 the range of a pragma Warnings covers a location, taking
119 instantiations into account.
121 2019-07-03 Johannes Kanig <kanig@adacore.com>
123 * osint.ads, osint.adb (Get_First_Main_File_Name): New routine
124 to access the first file provided on the command line.
126 2019-07-03 Ed Schonberg <schonberg@adacore.com>
128 * inline.adb (Process_Formals_In_Aspects): New procedure within
129 Expand_Inlined_Call, to perform a replacement of references to
130 formals that appear in aspect specifications within the body
133 2019-07-03 Justin Squirek <squirek@adacore.com>
135 * sem_ch8.adb (Analyze_Object_Renaming): Add call to search for
136 the appropriate actual subtype of the object renaming being
138 (Check_Constrained_Object): Minor cleanup.
140 2019-07-03 Yannick Moy <moy@adacore.com>
142 * sem_spark.adb (Get_Observed_Or_Borrowed_Expr): New function to
143 return go through traversal function call.
144 (Check_Type): Consistently use underlying type.
145 (Get_Perm): Adapt for case of elaboration code where variables
146 are not declared in the environment. Remove incorrect handling
147 of borrow and observe.
149 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
151 * inline.adb (Build_Return_Object_Formal): New routine.
152 (Can_Split_Unconstrained_Function): Code clean up.
153 (Copy_Formals,Copy_Return_Object): New routines.
154 (Split_Unconstrained_Function): Code clean up and refactoring.
156 2019-07-03 Gary Dismukes <dismukes@adacore.com>
158 * bindo-augmentors.adb, bindo-augmentors.ads,
159 bindo-builders.ads, bindo-elaborators.adb, sem_ch12.adb,
160 sem_ch13.adb, sem_spark.adb, sinfo.ads: Minor editorial
161 corrections and reformatting.
163 2019-07-03 Bob Duff <duff@adacore.com>
165 * sem_warn.adb (Check_Infinite_Loop_Warning): Avoid the warning
166 if an Iterator_Specification is present.
168 2019-07-03 Bob Duff <duff@adacore.com>
170 * doc/gnat_ugn/gnat_utility_programs.rst: Document default
173 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
175 * ali.adb: Add with and use clauses for GNAT,
176 GNAT.Dynamic_HTables, and Snames. Add a map from invocation
177 signature records to invocation signature ids. Add various
178 encodings of invocation-related attributes. Sort and update
179 table Known_ALI_Lines.
180 (Add_Invocation_Construct, Add_Invocation_Relation,
181 Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
182 Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
183 Code_To_Invocation_Graph_Line_Kind, Destroy, Hash): New
185 (Initialize_ALI): Sort the initialization sequence. Add
186 initialization for all invocation-related tables.
187 (Invocation_Construct_Kind_To_Code,
188 Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
189 Invocation_Signature_Of, Present): New routines.
190 (Scan_ALI): Add the default values for invocation-related ids.
191 Scan invocation graph lines.
192 (Scan_Invocation_Graph_Line): New routine.
193 * ali.ads: Add with clause for GNAT.Dynamic_Tables. Add types
194 for invocation constructs, relations, and signatures. Add
195 tables for invocation constructs, relations, and signatures.
196 Update Unit_Record to capture invocation-related ids. Relocate
197 table Unit_Id_Tables and subtypes Unit_Id_Table, Unit_Id_Array
199 (Add_Invocation_Construct, Add_Invocation_Relation,
200 Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
201 Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
202 Code_To_Invocation_Graph_Line_Kind,
203 Invocation_Construct_Kind_To_Code,
204 Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
205 Invocation_Signature_Of, Present): New routines.
206 * binde.adb: Add with and use clause for Types. Add use clause
207 for ALI.Unit_Id_Tables;
208 * binde.ads: Relocate table Unit_Id_Tables and subtypes
209 Unit_Id_Table, Unit_Id_Array to ALI.
210 * bindgen.adb: Remove with and use clause for ALI.
211 * bindgen.ads: Remove with and use clause for Binde. Add with
212 and use clause for ALI.
213 * bindo.adb, bindo.ads, bindo-augmentors.adb,
214 bindo-augmentors.ads, bindo-builders.adb, bindo-builders.ads,
215 bindo-diagnostics.adb, bindo-diagnostics.ads,
216 bindo-elaborators.adb, bindo-elaborators.ads, bindo-graphs.adb,
217 bindo-graphs.ads, bindo-units.adb, bindo-units.ads,
218 bindo-validators.adb, bindo-validators.ads, bindo-writers.adb,
219 bindo-writers.ads: New units.
220 * debug.adb: Use and describe GNAT debug switches -gnatd_F and
221 -gnatd_G. Add GNATbind debug switches in the ranges dA .. dZ,
222 d.a .. d.z, d.A .. d.Z, d.1 .. d.9, d_a .. d_z, d_A .. d_Z, and
223 d_1 .. d_9. Use and describe GNATbind debug switches -d_A,
224 -d_I, -d_L, -d_N, -d_O, -d_T, and -d_V.
225 * exp_util.adb, exp_util.ads (Exceptions_OK): Relocate to
227 * gnatbind.adb: Add with and use clause for Bindo. Use the new
228 Bindo elaboration order only when -d_N is in effect.
230 (Column, Extra, Invoker, Kind, Line, Locations, Name, Placement,
231 Scope, Signature, Target): New routines.
232 (Write_ALI): Output all invocation-related data.
233 (Write_Invocation_Graph): New routine.
234 * lib-writ.ads: Document the invocation graph ALI line.
235 * namet.adb, namet.ads (Present): New routines.
236 * sem_ch8.adb (Find_Direct_Name): Capture the status of
237 elaboration checks and warnings of an identifier.
238 (Find_Expanded_Name): Capture the status of elaboration checks
239 and warnings of an expanded name.
240 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Ensure
241 that invocation graph-related data within the body of the main
242 unit is encoded in the ALI file.
243 (Analyze_Generic_Subprogram_Declaration): Ensure that invocation
244 graph-related data within the body of the main unit is encoded
246 (Analyze_Package_Instantiation): Perform minimal decoration of
248 (Analyze_Subprogram_Instantiation): Perform minimal decoration
249 of the instance entity.
250 * sem_elab.adb: Perform heavy refactoring of all code. The unit
251 is now split into "services" which specialize in one area of ABE
252 checks. Add processing in order to capture invocation-graph
253 related attributes of the main unit, and encode them in the ALI
254 file. The Processing phase can now operate in multiple modes,
255 all described by type Processing_Kind. Scenarios and targets
256 are now distinct at the higher level, and carry their own
257 representations. This eliminates the need to constantly
258 recompute their attributes, and offers the various processors a
259 uniform interface. The various initial states of the Processing
260 phase are now encoded using type Processing_In_State, and
262 * sem_elab.ads: Update the literals of type
263 Enclosing_Level_Kind. Add Inline pragmas on several routines.
264 * sem_prag.adb (Process_Inline): Ensure that invocation
265 graph-related data within the body of the main unit is encoded
267 * sem_util.adb (Enclosing_Generic_Body, Enclosing_Generic_Unit):
269 (Exceptions_OK): Relocated from Sem_Util.
270 (Mark_Save_Invocation_Graph_Of_Body): New routine.
271 * sem_util.ads (Exceptions_OK): Relocated from Sem_Util.
272 (Mark_Save_Invocation_Graph_Of_Body): New routine.
273 * sinfo.adb (Is_Elaboration_Checks_OK_Node): Now applicable to
274 N_Variable_Reference_Marker.
275 (Is_Elaboration_Warnings_OK_Node): Now applicable to
276 N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
277 (Is_Read): Use Flag4.
278 (Is_SPARK_Mode_On_Node): New applicable to
279 N_Variable_Reference_Marker.
280 (Is_Write): Use Flag5.
281 (Save_Invocation_Graph_Of_Body): New routine.
282 (Set_Is_Elaboration_Checks_OK_Node): Now applicable to
283 N_Variable_Reference_Marker.
284 (Set_Is_Elaboration_Warnings_OK_Node): Now applicable to
285 N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
286 (Set_Is_SPARK_Mode_On_Node): New applicable to
287 N_Variable_Reference_Marker.
288 (Set_Save_Invocation_Graph_Of_Body): New routine.
289 * sinfo.ads: Update the documentation of attributes
290 Is_Elaboration_Checks_OK_Node, Is_Elaboration_Warnings_OK_Node,
291 Is_SPARK_Mode_On_Node. Update the flag usage of attributes
292 Is_Read, Is_Write. Add attribute Save_Invocation_Graph_Of_Body
293 and update its occurrence in nodes.
294 (Save_Invocation_Graph_Of_Body): New routine along with pragma
296 (Set_Save_Invocation_Graph_Of_Body): New routine along with
298 * switch-b.adb (Scan_Binder_Switches): Refactor the scanning of
300 (Scan_Debug_Switches): New routine.
301 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads (Contains): New routine.
302 * libgnat/g-graphs.adb (Associate_Vertices): Update the use of
303 Component_Vertex_Iterator.
304 (Contains_Component, Contains_Edge, Contains_Vertex, Has_Next):
306 (Iterate_Component_Vertices): New routine.
307 (Iterate_Vertices): Removed.
308 (Next): Update the parameter profile.
309 (Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
311 * libgnat/g-graphs.ads: Update the initialization of
312 No_Component. Add type Component_Vertex_Iterator. Remove type
314 (Has_Next): Add new versions and remove old ones.
315 (Iterate_Component_Vertices): New routine.
316 (Iterate_Vertices): Removed.
317 (Next): Add new versions and remove old ones.
318 (Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
320 * libgnat/g-sets.adb (Contains): Reimplemented.
321 * gcc-interface/Make-lang.in (GNATBIND_OBJS): Add
322 GNAT.Dynamic_HTables, GNAT.Graphs and Bindo units.
323 * rtsfind.ads: Remove extra space.
325 2019-07-03 Yannick Moy <moy@adacore.com>
327 * sem_spark.adb: Add support for locally borrowing and observing
329 (Get_Root_Object): Add parameter Through_Traversal to denote
330 when we are interesting in getting to the traversed parameter.
331 (Is_Prefix_Or_Almost): New function to support detection of
332 illegal access to borrowed or observed paths.
333 (Check_Pragma): Add analysis of assertion pragmas.
335 2019-07-03 Ed Schonberg <schonberg@adacore.com>
337 * sem_ch13.adb (Build_Predicate_Functions): In a generic context
338 we do not build the bodies of predicate fuctions, but the
339 expression in a static predicate must be elaborated to allow
340 case coverage checking within the generic unit.
341 (Build_Discrete_Static_Predicate): In a generic context, return
342 without building function body once the
343 Static_Discrete_Predicate expression for the type has been
346 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
348 * bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
349 sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
351 2019-07-03 Bob Duff <duff@adacore.com>
353 * par-ch3.adb (P_Defining_Identifier): Call
354 Check_Defining_Identifier_Casing.
355 * style.ads, styleg.ads, styleg.adb
356 (Check_Defining_Identifier_Casing): New procedure to check for
357 mixed-case defining identifiers.
358 * stylesw.ads, stylesw.adb (Style_Check_Mixed_Case_Decls): New
359 flag for checking for mixed-case defining identifiers.
360 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
361 Document new feature.
362 * gnat_ugn.texi: Regenerate.
364 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
366 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
367 (Warning message control): Document that -gnatw.z/Z apply to
369 * freeze.adb (Freeze_Entity): Give -gnatw.z warning for array
370 types as well, but not if the specified alignment is the minimum
372 * gnat_ugn.texi: Regenerate.
374 2019-07-03 Bob Duff <duff@adacore.com>
376 * einfo.ads, exp_util.adb, layout.ads, sinfo.ads: Spell "laid"
379 2019-07-03 Ed Schonberg <schonberg@adacore.com>
381 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): No error
382 message on attribute applied to a renaming when the renamed
383 object is an aggregate (from code reading).
384 (Check_Aspect_At_End_Of_Declarations): In a generic context
385 where freeze nodes are not generated, the original expression
386 for an aspect may need to be analyzed to precent spurious
387 conformance errors when compared with the expression that is
388 anakyzed at the end of the current declarative list.
390 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
392 * layout.adb (Layout_Type): Do not set the component size of an
393 array with a scalar component if the component type is
396 2019-07-03 Ed Schonberg <schonberg@adacore.com>
398 * inline.adb (Make_Loop_Labels_Unique): New procedure to modify
399 the source code of subprograms that are inlined by the
400 front-end, to prevent accidental duplication between loop labels
401 in the inlined code and the code surrounding the inlined call.
403 2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
405 * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update
406 the section on resolving elaboration circularities to eliminate
407 certain combinations of switches which together do not produce
408 the desired effect and confuse users.
409 * gnat_ugn.texi: Regenerate.
411 2019-07-03 Arnaud Charlet <charlet@adacore.com>
413 * bindgen.adb (Gen_Main): Disable generation of reference to
414 Ada_Main_Program_Name for CCG.
415 * bindusg.adb (Display): Add -G to the command-line usage for
417 * opt.ads (Generate_C_Code): Update comment.
418 * switch-b.adb (Scan_Binder_Switches): Add handling for -G.
420 2019-07-03 Arnaud Charlet <charlet@adacore.com>
422 * sem_ch7.adb (Has_Referencer): Do not consider inlined
423 subprograms when generating C code, which allows us to generate
424 static inline subprograms.
426 2019-07-03 Justin Squirek <squirek@adacore.com>
428 * sem_ch6.adb (Check_Conformance): Add expression checking for
429 constant modifiers in anonymous access types (in addition to
430 "non-null" types) so that they are considered "matching" for
431 subsequent conformance tests.
433 2019-07-03 Arnaud Charlet <charlet@adacore.com>
435 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
436 Clarify wording on No_Multiple_Elaboration.
437 * gnat_rm.texi: Regenerate.
439 2019-07-03 Ed Schonberg <schonberg@adacore.com>
441 * sem_ch8.adb (Find_Selected_Component): If the prefix is the
442 current instance of a type or subtype, complete the resolution
443 of the name by finding the component of the type denoted by the
446 2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
448 * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C):
449 Document that boolean types with convention C now map to C99 bool.
450 * gnat_rm.texi: Regenerate.
452 2019-07-03 Javier Miranda <miranda@adacore.com>
454 * exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup:
455 removing code that it is now never executed in the CCG compiler
458 2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
460 * libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
463 2019-07-01 Ed Schonberg <schonberg@adacore.com>
465 * sem_ch12.adb (Is_Defaulted): New predicate in
466 Check_Formal_Package_Intance, to skip the conformance of checks
467 on parameters of a formal package that are defaulted,
469 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
471 * checks.adb, exp_ch9.adb, exp_unst.adb, sem_ch4.adb,
472 sem_prag.adb, sem_spark.adb: Minor reformatting.
474 2019-07-01 Ed Schonberg <schonberg@adacore.com>
476 * sem_attr.adb (Analyze_Attribute, case Enum_Rep): Allow prefix
477 of attribute to be an attribute reference of a discrete type.
479 2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
481 * sem_ch12.adb (Analyze_Subprogram_Instantiation): Move up
482 handling of Has_Pragma_Inline_Always and deal with
483 Has_Pragma_No_Inline.
485 2019-07-01 Ed Schonberg <schonberg@adacore.com>
487 * sem_ch3.adb (Build_Derived_Record_Type): If the parent type is
488 declared as a subtype of a private type with an inherited
489 discriminant constraint, its generated full base appears as a
490 record subtype, so we need to retrieve its oen base type so that
491 the inherited constraint can be applied to it.
493 2019-07-01 Yannick Moy <moy@adacore.com>
495 * sem_spark.adb: Completely rework the algorithm for ownership
496 checking, as the rules in SPARK RM have changed a lot.
497 * sem_spark.ads: Update comments.
499 2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
501 * gsocket.h (Has_Sockaddr_Len): Use the offset of sin_family offset in
502 the sockaddr_in structure to determine the existence of length field
503 before the sin_family.
505 2019-07-01 Ed Schonberg <schonberg@adacore.com>
507 * sem_prag.adb (Analyze_Pragma, case Weak_External): Pragma only
508 applies to entities with run-time addresses, not to types.
510 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
512 * einfo.adb, sem_ch7.adb, sem_prag.adb, sem_util.adb: Update
513 references to the SPARK RM after the removal of Rule 7.1.4(5).
515 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
517 * sysdep.c: Cleanup references to LynuxWorks in docs and
520 2019-07-01 Ed Schonberg <schonberg@adacore.com>
522 * checks.adb (Insert_Valid_Check): Do not apply validity check
523 to variable declared within a protected object that uses the
524 Lock_Free implementation, to prevent unwarranted constant
525 folding, because entities within such an object msut be treated
528 2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
530 * exp_ch9.adb (Check_Inlining): Deal with Has_Pragma_No_Inline.
532 2019-07-01 Ed Schonberg <schonberg@adacore.com>
534 * exp_unst.adb (Visit_Node, Check_Static_Type): Improve the
535 handling of private and incomplete types whose full view is an
536 access type, to detect additional uplevel references in dynamic
537 bounds. This is relevant to N_Free_Statement among others that
538 manipulate types whose full viww may be an access type.
540 2019-07-01 Pat Rogers <rogers@adacore.com>
542 * doc/gnat_rm/representation_clauses_and_pragmas.rst: Correct
543 size indicated for R as a component of an array.
544 * gnat_rm.texi: Regenerate.
546 2019-07-01 Justin Squirek <squirek@adacore.com>
548 * libgnat/s-win32.ads: Add definition for ULONG, modify
549 OVERLAPPED type, and add appropriate pragmas.
551 2019-07-01 Bob Duff <duff@adacore.com>
553 * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is
556 2019-07-01 Yannick Moy <moy@adacore.com>
558 * sem_ch4.adb (Operator_Check): Refine error message.
560 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
562 * libgnat/a-calend.ads: Revert "Global => null" contracts on
565 2019-07-01 Piotr Trojanek <trojanek@adacore.com>
567 * exp_attr.adb, libgnat/g-graphs.ads: Fix typos in comments:
568 componant -> component.
570 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
572 * libgnat/g-graphs.adb: Use type Directed_Graph rather than
573 Instance in various routines.
574 * libgnat/g-graphs.ads: Change type Instance to Directed_Graph.
575 Update various routines that mention the type.
577 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
579 * libgnat/g-sets.adb: Use type Membership_Set rathern than
580 Instance in various routines.
581 * libgnat/g-sets.ads: Change type Instance to Membership_Set.
582 Update various routines that mention the type.
584 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
586 * libgnat/g-lists.adb: Use type Doubly_Linked_List rather than
587 Instance in various routines.
588 * libgnat/g-lists.ads: Change type Instance to
589 Doubly_Linked_List. Update various routines that mention the
592 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
594 * libgnat/g-dynhta.adb: Use type Dynamic_Hash_Table rather than
595 Instance in various routines.
596 * libgnat/g-dynhta.ads: Change type Instance to
597 Dynamic_Hash_Table. Update various routines that mention the
600 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
602 * exp_attr.adb, exp_ch7.adb, exp_unst.adb, sem_ch3.adb,
603 sem_util.adb, uintp.adb, uintp.ads: Minor reformatting.
605 2019-07-01 Javier Miranda <miranda@adacore.com>
607 * exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of
608 'Min/'Max on integer, enumeration, fixed point and floating
609 point types since the CCG backend now provides in file
610 standard.h routines to support it.
612 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
614 * impunit.adb: Add GNAT.Graphs to list Non_Imp_File_Names_95.
615 * Makefile.rtl, gcc-interface/Make-lang.in: Register unit
617 * libgnat/g-dynhta.adb: Various minor cleanups (use Present
618 rather than direct comparisons).
619 (Delete): Reimplement to use Delete_Node.
620 (Delete_Node): New routine.
621 (Destroy_Bucket): Invoke the provided destructor.
622 (Present): New routines.
623 * libgnat/g-dynhta.ads: Add new generic formal Destroy_Value.
624 Use better names for the components of iterators.
625 * libgnat/g-graphs.adb, libgnat/g-graphs.ads: New unit.
626 * libgnat/g-lists.adb: Various minor cleanups (use Present
627 rather than direct comparisons).
628 (Delete_Node): Invoke the provided destructor.
629 (Present): New routine.
630 * libgnat/g-lists.ads: Add new generic formal Destroy_Element.
631 Use better names for the components of iterators.
632 (Present): New routine.
633 * libgnat/g-sets.adb, libgnat/g-sets.ads (Destroy, Preset,
634 Reset): New routines.
636 2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
638 * libgnat/g-sothco.adb (Get_Address): Fix the case when AF_INET6
641 2019-07-01 Ed Schonberg <schonberg@adacore.com>
643 * exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value):
644 Resolve result of call to Get_Simple_Init_Val, which may be a
645 conversion of a literal.
647 2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
649 * freeze.adb (Freeze_Expression): Remove the horrible useless
650 name hiding of N. Insert the freeze nodes generated by the
651 expression prior to the expression when the nearest enclosing
654 2019-07-01 Pierre-Marie de Rodat <derodat@adacore.com>
656 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix
657 formatting issues in the -gnatR section.
658 * gnat_ugn.texi: Regenerate.
660 2019-06-30 Iain Sandoe <iain@sandoe.co.uk>
662 * gnatlink.adb (Link_Step): Remove duplicate -static-libgcc switches.
663 Push -shared-libgcc explicitly, when it is the target default (unless
664 overidden by the static flag).
665 When the user has put an instance of shared/static-libgcc do not push
668 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
670 * gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED,
671 and tweak comment on the assertion about the scopes of Itypes. Do not
672 skip the regular processing for Itypes that are E_Record_Subtype with
673 a Cloned_Subtype. Get the Cloned_Subtype for every E_Record_Subtype
674 if the type is dummy and hasn't got its own freeze node.
675 <E_Record_Subtype>: Save again the DECL of the Cloned_Subtype, if any.
676 <E_Access_Subtype>: Save again the DECL of the equivalent type.
677 (Gigi_Equivalent_Type) <E_Access_Subtype>: New case.
679 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
681 * gcc-interface/utils.c (unchecked_convert): Tweak comment. Only skip
682 dereferences when padding to have the same size on both sides. Do it
683 for destination types with self-referential size too.
685 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
687 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: If the
688 type requires strict alignment, then set the RM size to the type size.
689 Rework handling of alignment and sizes of tagged types in ASIS mode.
690 (validate_size): Rename local variable and remove special handling for
691 strict-alignment types.
692 * gcc-interface/utils.c (finish_record_type): Constify local variables
693 and use properly typed constants.
695 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
697 * gcc-interface/decl.c (gnat_to_gnu_field): Rework error messages for
698 fields requiring strict alignment, add explicit test on Storage_Unit
699 for position and size, and mention type alignment for position.
701 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
703 * gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
704 the main variant of a type, if any.
706 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
708 * gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
709 missing guard for the presence of TYPE_CANONICAL.
710 (set_reverse_storage_order_on_array_type): Likewise.
712 2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
714 * gcc-interface/gigi.h (make_packable_type): Remove default value.
715 (value_factor_p): Tweak prototype.
716 * gcc-interface/decl.c (gnat_to_gnu_entity): Add comment.
717 (gnat_to_gnu_component_type): Likewise.
718 (gnat_to_gnu_field): Likewise. Fetch the position of the field earlier
719 and simplify the condition under which the type is packed. Declare
720 local variable is_bitfield. Pass 1 as max_align to make_packable_type
721 if it is set to true.
722 (copy_and_substitute_in_layout): Pass 0 to make_packable_type.
723 * gcc-interface/utils.c (make_packable_array_type): New function.
724 (make_packable_type): Use it to rewrite the type of array field.
725 (maybe_pad_type): Pass align parameter to make_packable_type.
726 (create_field_decl): Minor tweaks.
727 (value_factor_p): Assert that FACTOR is a power of 2 and replace the
728 modulo computation by a masking operation.
730 2019-06-25 Eric Botcazou <ebotcazou@adacore.com>
732 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove superfluous test
734 * gcc-interface/gigi.h (maybe_character_type): Fix formatting.
735 (maybe_character_value): Likewise.
737 2019-06-24 Jan Hubicka <jh@suse.cz>
739 * gcc-interface/decl.c (gnat_to_gnu_entity): Check that
740 type is array or integer prior checking string flag.
741 * gcc-interface/gigi.h (maybe_character_type): Likewise.
742 (maybe_character_value): Likewise.
744 2019-06-24 Martin Sebor <msebor@redhat.com>
746 * gcc-interface/utils.c (handle_nonnull_attribute): Quote attribute
749 2019-06-18 Arnaud Charlet <charlet@adacore.com>
752 * sem_ch5.adb (Analyze_Loop_Statement): Avoid exception propagation
753 during normal processing.
755 2019-06-17 Arnaud Charlet <charlet@adacore.com>
758 * exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two
759 conditions to avoid a unnecessary exception propagation in the default
762 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
764 * gcc-interface/utils.c (handle_stack_protect_attribute): Move around.
766 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
768 * doc/gnat_rm/implementation_defined_pragmas.rst (Machine_Attribute):
769 Document additional optional parameters.
770 * sem_prag.adb (Analyze_Pragma) <Pragma_Machine_Attribute>: Accept
771 more than one optional parameter.
772 * gcc-interface/decl.c (prepend_one_attribute_pragma): Alphabetize
773 the list of supported pragmas. Simplify the handling of parameters
774 and add support for more than one optional parameter.
775 * gcc-interface/utils.c (attr_cold_hot_exclusions): New constant.
776 (gnat_internal_attribute_table): Add entry for no_icf, noipa, flatten,
777 used, cold, hot, target and target_clones.
778 (begin_subprog_body): Do not create the RTL for the subprogram here.
779 (handle_noicf_attribute): New static function.
780 (handle_noipa_attribute): Likewise.
781 (handle_flatten_attribute): Likewise.
782 (handle_used_attribute): Likewise.
783 (handle_cold_attribute): Likewise.
784 (handle_hot_attribute): Likewise.
785 (handle_target_attribute): Likewise.
786 (handle_target_clones_attribute): Likewise.
788 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
790 * gcc-interface/trans.c (lvalue_required_for_attribute_p): Return 0
792 (Identifier_to_gnu): Use the actual subtype for a reference to a
793 packed array in a return statement.
794 (Attribute_to_gnu) <Attr_Size>: Do not strip VIEW_CONVERT_EXPRs from
795 the prefix in every case.
797 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
799 * gcc-interface/trans.c (gnat_to_gnu): Remove superfluous tests on
800 Backend_Overflow_Checks_On_Target and rework comments.
802 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
804 * gcc-interface/trans.c (walk_nesting_tree): New static function.
805 (finalize_nrv): Use it to walk the entire nesting tree.
807 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
809 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Remove
810 obsolete test on Is_For_Access_Subtype.
812 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
814 * gcc-interface/decl.c (components_to_record): Set a name on the type
815 created for the REP part, if any.
816 * gcc-interface/utils.c (finish_record_type): Only take the maximum
817 when merging sizes for a variant part at offset 0.
818 (merge_sizes): Rename has_rep parameter into max.
820 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
822 * gcc-interface/utils.c (gnat_internal_attribute_table): Add support
823 for stack_protect attribute.
824 (handle_stack_protect_attribute): New static function.
826 2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
828 * gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return
829 false if the internal builtin uses a variable list.
831 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
833 * gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary
834 created out of addressability concerns if it's for the _Init parameter
835 of an initialization procedure.
837 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
839 * gcc-interface/ada-builtin-types.def: New file.
840 * gcc-interface/ada-builtins.def: Likewise.
841 * gcc-interface/ada-tree.h (BUILT_IN_LIKELY): New macro.
842 (BUILT_IN_UNLIKELY): Likewise.
843 * gcc-interface/trans.c (independent_iterations_p): Initialize the
844 auto-vector to 16 elements.
845 (Call_to_gnu): Remove local variable and change the vector of actual
846 parameters to an auto-vector. Do not convert actual parameters to
847 the argument type for front-end built-in functions. Add support for
848 front-end built-in functions.
849 (build_noreturn_cond): Use internal instead of built-in function.
850 * gcc-interface/utils.c (c_builtin_type): Include ada-builtin-types.def
851 (install_builtin_function_types): Likewise.
852 (install_builtin_functions): Include ada-builtins.def first.
854 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
856 * gcc-interface/utils.c (maybe_pad_type): Issue the warning for the
857 specific case of component types preferably.
859 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
861 * gcc-interface/trans.c (Identifier_to_gnu): Minor tweaks.
862 (gnat_to_gnu): Do not convert the result if it is a reference to an
863 unconstrained array used as the prefix of an attribute reference that
866 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
868 * gcc-interface/trans.c (Gigi_Types_Compatible): New predicate.
869 (Identifier_to_gnu): Use it to assert that the type of the identifier
870 and that of its entity are compatible for gigi. Rename a couple of
871 local variables and separate the processing of the result type.
873 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
875 * gcc-interface/trans.c (Call_to_gnu): Use the unpadded type when
876 putting back an intermediate conversion the type of the actuals.
878 2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
880 * gcc-interface/trans.c (gnat_to_gnu) <Shift operations>: Convert the
881 count to the unsigned version of its base type before proceeding.
883 2019-05-16 Martin Sebor <msebor@redhat.com>
885 * gcc-interface/trans.c (check_inlining_for_nested_subprog): Quote
888 2019-05-08 Arnaud Charlet <charlet@adacore.com>
890 * standard.ads.h: New file.
892 2019-05-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
894 * gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
897 2019-04-29 Michael K. Darling <darlingm@gmail.com>
899 * gnatvsn.ads: Bump Library_Version to 10.
901 2019-04-24 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
902 Bernd Edlinger <bernd.edlinger@hotmail.de>
903 Jakub Jelinek <jakub@redhat.com>
906 * raise-gcc.c (TARGET_ATTRIBUTE): Define.
907 (continue_unwind, personality_body, PERSONALITY_FUNCTION): Add
910 2019-04-07 Eric Botcazou <ebotcazou@adacore.com>
912 * libgnat/i-cexten.ads (CFloat_128): New type.
914 2019-03-22 Dmitriy Anisimkov <anisimko@adacore.com>
917 * libgnat/g-socket.adb (Bind_Socket, Connect_Socket,
918 Send_Socket): Fix the computation of structure lengths passed to
920 (Is_IPv6_Address): Fix the number of expected colons.
922 2019-03-11 Martin Liska <mliska@suse.cz>
924 * gcc-interface/misc.c (gnat_post_options): Wrap option name in string
925 format message and fix GNU coding style.
927 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
929 * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Minor tweak.
930 * gcc-interface/utils.c (convert): Do not pad when doing an unchecked
931 conversion here. Use TREE_CONSTANT throughout the function.
932 (unchecked_convert): Also pad if the source is a CONSTRUCTOR and the
933 destination is a more aligned array type or a larger aggregate type,
934 but not between original and packable versions of a type.
936 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
938 * gcc-interface/utils.c (max_size) <tcc_unary>: Be prepared for an
939 operand with VOID_TYPE.
941 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
943 * gcc-interface/trans.c (elaborate_all_entities): Do not elaborate the
944 entities of a package renaming another one.
946 2019-02-08 Eric Botcazou <ebotcazou@adacore.com>
948 * gcc-interface/trans.c (Regular_Loop_to_gnu): Replace tests on
949 individual flag_unswitch_loops and flag_tree_loop_vectorize switches
950 with test on global optimize switch.
951 (Raise_Error_to_gnu): Likewise.
953 2019-02-07 Eric Botcazou <ebotcazou@adacore.com>
955 * libgnarl/s-linux__sparc.ads (ETIMEDOUT): Set to correct value.
957 2019-02-06 Arnaud Charlet <charlet@adacore.com>
959 * libgnarl/s-linux__x32.ads: Resync list of signals with s-linux.ads
961 2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
963 * repinfo.adb (List_Component_Layout): Remove superfluous space for
965 * gcc-interface/ada-tree.h (TYPE_IS_EXTRA_SUBTYPE_P): New macro.
966 * gcc-interface/gigi.h (create_extra_subtype): Declare.
967 * gcc-interface/decl.c (TYPE_ARRAY_SIZE_LIMIT): Likewise.
968 (update_n_elem): New function.
969 (gnat_to_gnu_entity): Use create_extra_subtype to create extra subtypes
970 instead of doing it manually.
971 <E_Array_Type>: Use update_n_elem to compute the maximum size. Use the
972 index type instead of base type for the bounds. Set TYPE_ARRAY_MAX_SIZE
973 of the array to the maximum size.
974 <E_Array_Subtype>: Create an extra subtype using the index type of the
975 base array type for self-referential bounds. Use update_n_elem to
976 compute the maximum size. Set TYPE_ARRAY_MAX_SIZE of the array to the
978 (gnat_to_gnu_field): Clear DECL_NONADDRESSABLE_P on discriminants.
979 * gcc-interface/misc.c (gnat_get_alias_set): Return the alias set of
980 the base type for an extra subtype.
981 (gnat_type_max_size): Remove obsolete code.
982 * gcc-interface/trans.c (Attribute_to_gnu): Minor tweak.
983 (can_be_lower_p): Deal with pathological types.
984 * gcc-interface/utils.c (create_extra_subtype): New function.
985 (create_field_decl): Minor tweak.
986 (max_size) <tcc_reference>: Compute a better value by using the extra
987 subtypes on the self-referential bounds.
988 <tcc_binary>: Rewrite. Deal with "negative value" in unsigned types.
989 <tcc_expression>: Likewise.
990 * gcc-interface/utils2.c (compare_arrays): Retrieve the original bounds
991 of the arrays upfront. Swap only if the second length is not constant.
992 Use comparisons on the original bounds consistently for the null tests.
993 (build_binary_op): Use TYPE_IS_EXTRA_SUBTYPE_P macro.
994 (build_allocator): Minor tweak.
996 2019-01-27 Eric Botcazou <ebotcazou@adacore.com>
998 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
999 the same value for every dimension of a multidimensional array type.
1001 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
1003 * gcc-interface/trans.c (Regular_Loop_to_gnu): Use the SLOC of the
1004 iteration scheme, if present, throughout the translation.
1006 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
1008 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
1009 DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned
1010 by a call to memset if the LHS is a DECL.
1012 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
1014 * gcc-interface/trans.c (struct loop_info_d): Remove artificial field.
1015 (Loop_Statement_to_gnu): Do not set it.
1017 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
1019 * gcc-interface/trans.c (Iterate_Acc_Clause_Arg): Fix formatting.
1020 (Acc_gnat_to_gnu): Likewise.
1021 (Acc_Data_to_gnu): Likewise.
1022 (Acc_Var_to_gnu): Likewise.
1023 (Acc_Reduc_to_gnu): Likewise.
1024 (Acc_Size_List_to_gnu): Likewise.
1025 (Pragma_to_gnu) <Pragma_Acc_Loop>: Likewise.
1026 <Pragma_Acc_Data>): Likewise.
1027 (find_loop_for): Remove default value for parameters.
1028 * gcc-interface/trans.c (gnat_to_gnu) <N_Op_And>: Merge into...
1029 <N_Op_Eq>): ...this.
1031 2019-01-26 Eric Botcazou <ebotcazou@adacore.com>
1033 * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Use test on
1034 the sign bit instead of on the sign of the value.
1035 <PLUS_EXPR>: Turn addition of negative constant into subtraction.
1036 <MULT_EXPR>: Add test for degenerate case.
1037 <BIT_AND_EXPR>: Simplify.
1039 2019-01-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
1041 * s-oscons-tmplt.c (AF_INET6): Do not undefine for RTEMS.
1043 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
1046 * exp_ch11.adb: Change "can not" to "cannot".
1047 * sem_ch4.adb: Likewise.
1049 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
1052 * exp_ch9.adb: Mechanically replace "can not" with "cannot".
1053 * libgnat/s-regpat.ads: Likewise.
1054 * par-ch4.adb: Likewise.
1055 * set_targ.adb: Likewise.
1056 * types.ads: Likewise.
1058 2019-01-08 Justin Squirek <squirek@adacore.com>
1061 2018-07-31 Justin Squirek <squirek@adacore.com>
1063 * lib-writ.adb (Write_With_Lines): Modfiy the generation
1064 of dependencies within ali files so that source unit
1065 bodies are properly listed even if said bodies are
1066 missing. Perform legacy behavior in GNATprove mode.
1067 * lib-writ.ads: Modify documentation to reflect current
1071 2018-09-26 Justin Squirek <squirek@adacore.com>
1073 * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
1074 documentation and an extra conditional check for RCI
1075 units so that generated ali files will list the spec
1076 only instead of a body when a body is not found.
1078 2019-01-04 Eric Botcazou <ebotcazou@adacore.com>
1080 * gnatvsn.ads: Bump copyright year.
1082 2019-01-01 Jakub Jelinek <jakub@redhat.com>
1084 Update copyright years.
1086 * gnat_ugn.texi: Bump @copying's copyright year.
1087 * gnat_rm.texi: Likewise.
1089 Copyright (C) 2019 Free Software Foundation, Inc.
1091 Copying and distribution of this file, with or without modification,
1092 are permitted in any medium without royalty provided the copyright
1093 notice and this notice are preserved.