1 2018-12-23 Iain Sandoe <iain@sandoe.co.uk>
3 * adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system
4 interface used is available on the target.
6 2018-12-14 Eric Botcazou <ebotcazou@adacore.com>
8 * gcc-interface/decl.c (rm_size): Take into account the padding in
9 the case of a record type containing a template.
10 * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Likewise.
11 Do not subtract the padded size for Max_Size_In_Storage_Elements.
12 <Attr_Descriptor_Size>: Tweak comment.
14 2018-12-14 Eric Botcazou <ebotcazou@adacore.com>
16 * gcc-interface/decl.c (choices_to_gnu): Directly use a naked boolean
17 discriminant if the value is the boolean true.
19 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
22 * gcc-interface/Makefile.in (./stamp-gnatlib1-$(RTSDIR)): Also pass
23 MULTISUBDIR to sub-make and add quotes around $(THREAD_KIND).
24 (gnatlib-shared-dual): Also pass PICFLAG_FOR_TARGET to sub-make.
25 (gnatlib-sjlj): Also pass MULTISUBDIR to sub-make, but do not pass
27 (gnatlib-zcx): Likewise.
29 2018-12-11 Piotr Trojanek <trojanek@adacore.com>
31 * libgnat/a-calend.ads: Add "Global => null" contract to pure routines.
33 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
35 * freeze.adb (Check_Pragma_Thread_Local_Storage): Use the
36 violating set to diagnose detect an illegal initialization,
37 rather than the complement of the OK set.
38 (Freeze_Object_Declaration): Factorize code in
39 Has_Default_Initialization.
40 (Has_Default_Initialization, Has_Incompatible_Initialization):
43 2018-12-11 Dmitriy Anisimkov <anisimko@adacore.com>
45 * libgnat/g-socket.ads (Family_Type): Add new enumerated value
46 Family_Unspec to be able to use it in Get_Address_Info parameter
47 and find IPv4 together with IPv6 addresses.
48 (Inet_Addr_Bytes_Length): Zero length for Family_Unspec. New
49 IPv6 predefined constant addresses.
50 (IPv4_To_IPv6_Prefix): IPv4 mapped to IPv6 address prefix.
51 (Is_IPv4_Address): Rename from Is_IP_Address and published.
52 (Is_IPv6_Address): New routine.
53 (Image of Inet_Addr_Type): Fix description about IPv6 address
55 (Level_Type): New propocol level IP_Protocol_For_IPv6_Level.
56 (Add_Membership_V4): New socket option equal to Add_Membership.
57 (Drop_Membership_V4): New socket option equal to
59 (Multicast_If_V4): New socket option equal to Multicast_If.
60 (Multicast_Loop_V4, Add_Membership_V6, Drop_Membership_V6,
61 Multicast_If_V6, Multicast_Loop_V6, Multicast_Hops, IPv6_Only):
62 New socket option for IPv6.
63 (Address_Info): New record to keep address info.
64 (Address_Info_Array): Array to keep address info records.
65 (Get_Address_Info): Routine to get address info records by host
67 (Host_Service): Record to keep host and service names.
68 (Get_Name_Info): New routine to get host and service names by
70 (Create_Socket): Add Level parameter, IP_Protocol_For_IP_Level
72 (Name_Array, Inet_Addr_Array): Change array index to Positive.
73 * libgnat/g-socket.adb (IPV6_Mreq): New record definition for
75 (Hex_To_Char): Remove.
76 (Short_To_Network, Network_To_Short): Move to package
77 GNAT.Sockets.Thin_Common.
78 (Is_IP_Address): Remove.
79 (To_In_Addr, To_Inet_Addr): Move to package
80 GNAT.Sockets.Thin_Common.
81 (Get_Socket_Option): Get value of Multicast_Loop option as
82 integer boolean, process IPv6 options. Don't try to get
83 Add_Membership_V4, Add_Membership_V6, Drop_Membership_V4, and
84 Drop_Membership_V6 as not supported by the socket API.
85 (Set_Socket_Option): Set value of Multicast_Loop option as
86 integer boolean, process IPv6 options.
88 (IPV6_ADD_MEMBERSHIP): Define from IPV6_JOIN_GROUP if necessary
90 (IPV6_DROP_MEMBERSHIP): Define from IPV6_LEAVE_GROUP if
92 (HAVE_INET_NTOP): New definition.
93 (HAVE_INET_PTON): Includes VxWorks now.
94 * socket.c (__gnat_getaddrinfo, __gnat_getnameinfo,
95 __gnat_freeaddrinfo, __gnat_gai_strerror, __gnat_inet_ntop): New
97 * libgnat/g-sothco.ads, libgnat/g-sothco.adb
98 (socklen_t, In6_Addr, To_In6_Addr): New.
99 (To_In_Addr, To_Inet_Addr): Move from package body GNAT.Sockets.
100 (To_Inet_Addr): New overload with In6_Addr type parmeter.
101 (In_Addr_Access_Array): Remove.
102 (Sockaddr): Unchecked_Union instead of Sockaddr_In and old
103 defined generic Sockaddr.
104 (Set_Address): Use it to set family, port and address into
106 (Get_Address): New routine to get Socket_Addr_Type from
108 (Addrinfo): Structure to use with getaddrinfo.
109 (C_Getaddrinfo, C_Freeaddrinfo, C_Getnameinfo, C_GAI_Strerror,
110 Inet_Ntop): New routine import.
111 (Short_To_Network, Network_To_Short): Move from package body
113 * libgnat/g-stsifd__sockets.adb: Use Sockaddr instead of
115 * s-oscons-tmplt.c (AF_UNSPEC, EAI_SYSTEM, SOCK_RAW,
116 IPPROTO_IPV6, IP_RECVERR, SIZEOF_socklen_t, IF_NAMESIZE): New
118 (AI_xxxx_OFFSET): Constants to consider platform differences in
119 field positions and sizes for addrinfo structure.
120 (AI_xxxxx): Flags for getaddrinfo.
121 (NI_xxxxx): Flags for getnameinfo.
122 (IPV6_xxxxx): Socket options for IPv6.
123 (Inet_Ntop_Linkname): New routine.
125 2018-12-11 Yannick Moy <moy@adacore.com>
127 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Deactivate
128 expansion in ignored ghost subprogram body.
129 * sem_ch7.adb (Analyze_Package_Body_Helper): Deactivate
130 expansion in ignored ghost package body.
132 2018-12-11 Ed Schonberg <schonberg@adacore.com>
134 * exp_unst.adb (Register_Subprogram): A subprogram whose address
135 is taken (through attribute Address or Access) is reachable and
136 cannot be eliminated, even if there is no explicit call to it:
137 the address may be used in an indirect call or in some
138 address-related operation.
140 2018-12-11 Ed Schonberg <schonberg@adacore.com>
142 * sem_util.adb (Get_Actual_Subtype): Function can return type
144 (Get_Cursor_Type): Improve recovery and error message on a
145 misplaced First aspect for an iterable type.
147 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
149 * checks.adb: Add with and use clauses for Sem_Mech.
150 (Ensure_Valid): Update the "annoying special case" to include
151 entry and function calls. Use Get_Called_Entity to obtain the
152 entry or subprogram being invoked, rather than retrieving it
153 manually. Parameters passed by reference do not need a validity
156 2018-12-11 Yannick Moy <moy@adacore.com>
158 * sem_prag.adb (Analyze_Global_Item): Refine error message.
160 2018-12-11 Ed Schonberg <schonberg@adacore.com>
162 * exp_ch7.adb (Check_Unnesting_In_Declarations): Extend
163 subprogram so that it is usable for visible and private
164 declarations of a package declaration, not just for declarations
166 * exp_ch13.adb (Expand_Freeze_Entity): Handle properly the
167 freezing of a finalizer routine generated for a controlled objet
168 declaration. Special processing already applies to finalizers
169 because they are usually displaced into another construct.
171 2018-12-11 Arnaud Charlet <charlet@adacore.com>
173 * exp_unst.adb (Unnest_Subprogram): Ensure Current_Subprogram is
176 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
178 * gcc-interface/decl.c (gnat_to_gnu_entity): Add
179 gnat_annotate_type local variable initialized to Empty.
180 <E_Record_Subtype>: Set it to the Cloned_Subtype, if any. For
181 types, back-annotate alignment and size values earlier and only
182 if the DECL was created here; otherwise, if gnat_annotate_type
183 is present, take the values from it.
184 (gnat_to_gnu_field): Add gnat_clause local variable. If a
185 component clause is present, call validate_size only once on the
186 Esize of the component. Otherwise, in the packed case, do not
187 call validate_size again on the type of the component but
188 retrieve directly its RM size.
189 (components_to_record): Minor tweak.
190 (set_rm_size): Remove useless test.
191 * gcc-interface/trans.c (gnat_to_gnu): Do not wrap the instance of
192 a boolean discriminant attached to a variant part.
194 2018-12-11 Ed Schonberg <schonberg@adacore.com>
196 * sem_aggr.adb (Array_Aggr_Subtype. Resolve_Aggr_Expr): Indicate
197 that aggregate subtype has a predicate if the component type has
198 a predicate; do not rely on exisatence of predicate function for
199 component, in case component is a type no yet frozen, for which
200 predicate function has not been created yet.
202 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
204 * exp_aggr.adb (Packed_Array_Aggregate_Handled): Bail out for
205 any non-scalar type as component type of the array.
207 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
209 * einfo.ads (Is_Bit_Packed_Array): Fix values of component size.
210 (Is_Packed): Likewise.
211 * gcc-interface/utils.c (convert): Do not extract the value of a
212 justified modular type if the destination type is a regular
214 * gcc-interface/decl.c (gnat_to_gnu_component_type): Pass
215 TYPE_DECL to validate_size wherever the array has packed
218 2018-12-11 Bob Duff <duff@adacore.com>
220 * gnat1drv.adb (gnat1drv): Pass the correct Object value when
221 calling Write_ALI in the case of -gnatQ.
222 * gnatbind.adb (Gnatbind): Avoid silent failure; give an error
225 2018-12-11 Ed Schonberg <schonberg@adacore.com>
227 * exp_unst.adb (Needs_Fat_Pointer): A fat pointer is required if
228 the entity has a private type whose full view is an
229 unconstrained array type.
230 (Rewrite_One_Ref): If the reference is to a static constant, use
231 its value rather than create a reference through the activation
232 record. This is more efficient, and furthermore indispensable if
233 the context requires a static constant, such as in a branch of a
236 2018-12-11 Ed Schonberg <schonberg@adacore.com>
238 * sem_ch3.adb (Analyze_Object_Declaration): Apply
239 Dynamic_Predicate check to an object of an array type
240 initialized with an aggregate.
242 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
244 * freeze.adb (Add_To_Result): Move the ignored Ghost-specific
245 handling of freeze nodes to...
246 (Freeze_Entity): ...here. This ensures that the freeze nodes of
247 constructs that have recursive freezing are preserved when the
248 context is ignored Ghost, and the top level construct being
251 2018-12-11 Ed Schonberg <schonberg@adacore.com>
253 * uintp.ads, uintp.adb (UI_From_Integral): New generic function,
254 to simplify construction of Universal_Integer representations
255 from any Integer type. If type is small enough the code is
256 equivalent to a call to UI_To_Int with appropriate conversions;
257 otherwise the routine uses the existing mechanism of building a
258 vector of suitable integer values and calling Vector_To_Uint.
259 The routine must not be applied to a biased type.
261 2018-12-11 Ed Schonberg <schonberg@adacore.com>
263 * sem_ch3.adb (Build_Itype_Reference): Handle properly an itype
264 reference created for a function that is a compilation unit, for
265 example if the function builds in place an object of a limited
268 2018-12-11 Dmitriy Anisimkov <anisimko@adacore.com>
270 * libgnat/g-socket.ads, libgnat/g-socket.adb: Fix duration
271 computations to be compatible with the type for socket timeouts
274 2018-12-11 Gary Dismukes <dismukes@adacore.com>
276 * exp_util.ads: Use preferred U.S. spelling of "honored".
277 * sem_spark.adb: Remove extra whitespace.
279 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
281 * exp_util.adb (Insert_Action): Add new formal parameter
283 (Insert_Actions): Add new formal parameter Spec_Expr_OK. Update
284 all calls to Insert_Actions where relevant. Honour an insertion
285 from a spec expression context when requested by the caller.
286 * exp_util.ads (Insert_Action): Add new formal parameter
288 (Insert_Actions): Add new formal parameter Spec_Expr_OK.
289 * freeze.adb (Add_To_Result): Force the insertion of the freeze
290 node even when the context is a spec expression.
292 2018-12-11 Jerome Lambourg <lambourg@adacore.com>
294 * vxaddr2line.adb, vxlink-bind.adb, vxlink-bind.ads,
295 vxlink-link.adb, vxlink-link.ads, vxlink-main.adb, vxlink.adb,
297 * gcc-interface/Make-lang.in, gcc-interface/Makefile.in: Remove
298 bits for vxaddr2line.
300 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
302 * exp_aggr.adb, exp_ch7.adb, gnat1drv.adb, sem_ch10.adb,
303 sem_ch13.adb, sem_ch6.adb, sem_ch7.adb, sem_util.adb: Minor
306 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
308 * fe.h (Is_Atomic_Object): Declare.
309 (Is_Volatile_Object): Likewise.
310 * gcc-interface/trans.c (atomic_or_volatile_copy_required_p): New.
311 (Call_to_gnu): Generate a copy for an actual parameter passed by
312 reference if the conditions set forth by RM C.6(19) are met and
313 specificially deal with an atomic actual parameter.
315 2018-12-11 Piotr Trojanek <trojanek@adacore.com>
317 * sem_util.adb (Is_Subprogram_Stub_Without_Prior_Declaration):
318 Return False on stubs that complete a generic subprogram.
319 * sem_util.ads: Update corresponding comment.
321 2018-12-11 Ed Schonberg <schonberg@adacore.com>
323 * sem_ch4.adb (Analyze_Allocator): In GNATprove mode build a
324 subtype declaration if the allocator has a subtype indication
325 with a constraint. This allows additional proofs to be applied
326 to allocators that designate uninitialized constrained objects.
328 2018-12-11 Yannick Moy <moy@adacore.com>
330 * sem_util.adb (Has_Full_Default_Initialization): Consider
331 access types as having full default initialization.
333 2018-12-11 Yannick Moy <moy@adacore.com>
335 * gnat1drv.adb (Gnat1drv): Issue specific error message in
336 GNATprove mode when multiple file names on the command line.
337 * osint.adb, osint.ads (Dump_Command_Line_Source_File_Names):
338 New procedure to print file names on the command line.
340 2018-12-11 Javier Miranda <miranda@adacore.com>
342 * exp_aggr.adb (Convert_To_Assignments): When gnerating C, do
343 not declare a temporary to initialize an aggregate assigned to
344 Out or In_Out parameters whose type has no discriminants. This
345 avoids stack overflow errors at runtime.
347 2018-12-11 Ed Schonberg <schonberg@adacore.com>
349 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Extend
350 algorithm to cover subprograms generated in nested loops and in
351 exception handlers, in order to build an explicit elaboration
352 procedure in more complex cases.
354 2018-12-11 Jerome Lambourg <lambourg@adacore.com>
356 * Makefile.rtl, gcc-interface/Makefile.in: Remove crtbe bits for
358 * libgnat/system-vxworks-arm-rtp-smp.ads,
359 libgnat/system-vxworks-arm-rtp.ads,
360 libgnat/system-vxworks-arm.ads,
361 libgnat/system-vxworks-e500-kernel.ads,
362 libgnat/system-vxworks-e500-rtp-smp.ads,
363 libgnat/system-vxworks-e500-rtp.ads,
364 libgnat/system-vxworks-ppc-kernel.ads,
365 libgnat/system-vxworks-ppc-rtp-smp.ads,
366 libgnat/system-vxworks-ppc-rtp.ads,
367 libgnat/system-vxworks-ppc.ads,
368 libgnat/system-vxworks-x86-kernel.ads,
369 libgnat/system-vxworks-x86-rtp-smp.ads,
370 libgnat/system-vxworks-x86-rtp.ads,
371 libgnat/system-vxworks7-aarch64-rtp-smp.ads,
372 libgnat/system-vxworks7-aarch64.ads,
373 libgnat/system-vxworks7-arm-rtp-smp.ads,
374 libgnat/system-vxworks7-e500-kernel.ads,
375 libgnat/system-vxworks7-e500-rtp-smp.ads,
376 libgnat/system-vxworks7-e500-rtp.ads,
377 libgnat/system-vxworks7-ppc-kernel.ads,
378 libgnat/system-vxworks7-ppc-rtp-smp.ads,
379 libgnat/system-vxworks7-ppc-rtp.ads,
380 libgnat/system-vxworks7-ppc64-kernel.ads,
381 libgnat/system-vxworks7-ppc64-rtp-smp.ads,
382 libgnat/system-vxworks7-x86-kernel.ads,
383 libgnat/system-vxworks7-x86-rtp-smp.ads,
384 libgnat/system-vxworks7-x86-rtp.ads,
385 libgnat/system-vxworks7-x86_64-kernel.ads,
386 libgnat/system-vxworks7-x86_64-rtp-smp.ads: Remove pragma
387 Linker_Options for --specs.
388 * vx_crtbegin.c, vx_crtbegin.inc, vx_crtbegin_array.c,
389 vx_crtbegin_attr.c, vx_crtend.c, vxworks-gnat-crtbe-link.spec:
392 2018-12-11 Ed Schonberg <schonberg@adacore.com>
394 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations,
395 Freeze_Entity_Checks): Process aspect Predicate in the same
396 fashion as aspect Dynamic_Predicate.
398 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
400 * gcc-interface/trans.c (elaborate_all_entities_for_package):
401 Skip aliasing subprograms.
403 2018-12-11 Bob Duff <duff@adacore.com>
405 * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatmetric
406 documentation for the Libadalang-based version.
408 2018-12-11 Javier Miranda <miranda@adacore.com>
410 * exp_aggr.adb (In_Object_Declaration): Removed.
411 (Is_CCG_Supported_Aggregate): New subprogram that replaces
412 In_Object_Declaration extending its functionality to indicate if
413 an aggregate is in a context supported by the CCG backend.
415 2018-12-11 Bob Duff <duff@adacore.com>
417 * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatstub
418 documentation for the Libadalang-based version.
419 * gnat_ugn.texi: Regenerate.
421 2018-12-11 Ed Schonberg <schonberg@adacore.com>
423 * sem_ch13.adb (Push_Type, Pop_Type): New procedures, used for
424 analysis of aspect expressions for record types, whose
425 components (not only discriminants) may be referenced in aspect
427 (Analyze_Aspect_Specifications, Analyze_Aspects_At_Freeze_Point,
428 Analyze_Aspect_At_End-Of_Declarations,
429 Resolve_Aspect_Expressions): Use the new subprograms.
430 (Check_Aspect_At_End_Of_Declarations): Improve error message.
431 (Build_Predicate_Functions): Do not build their bodies in a
433 (Is_Derived_Type_With_Constraint): New subprogram to uncover and
434 reject aspect specificationss on types that appear after the
436 * sem_ch13.ads (Push_Scope_And_Install_Discriminants,
437 Uninstall_Discriminants_And_Pop_Scope): Remove.
438 * sem_ch6.adb, sem_ch6.ads (Fully_Conformant_Expressions):
439 Additional parameter to improve error message on illegal aspect
440 specifications whose resolution differ between aspect
441 specification and freeze point.
442 * freeze.adb: Remove references to
443 Install/Uninstall_Discriminants.
445 2018-12-11 Pierre-Marie de Rodat <derodat@adacore.com>
447 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
448 Document the -fgnat-encodings switch.
449 * gnat_ugn.texi: Regenerate.
451 2018-12-11 Justin Squirek <squirek@adacore.com>
453 * sem_ch10.adb (Analyze_Subunit): Modify conditional to fully
454 remove parent contexts from library-level subprogram bodies in
455 addition to package bodies.
457 2018-12-11 Hristian Kirtchev <kirtchev@adacore.com>
459 * exp_prag.adb (Expand_Pragma_Initial_Condition): Do not
460 generate an Initial_Condition procedure and a call to it when
461 the associated pragma is ignored.
462 * sem_ch10.adb (Analyze_Compilation_Unit): Minor cleanup.
464 2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
466 * fe.h (Debug_Generated_Code): Declare.
467 * gcc-interface/gigi.h (enum inline_status_t): Rename
468 is_disabled to is_default, is_enabled to is_requested and add
470 * gcc-interface/decl.c (inline_status_for_subprog): New function.
471 (gnat_to_gnu_entity) <E_Subprogram_Type>: Use it to get the
472 inlining status of the subprogram.
473 * gcc-interface/trans.c (gigi): Adjust to above renaming.
474 (build_raise_check): Likewise.
475 (Compilation_Unit_to_gnu): Likewise.
476 (gnat_to_gnu): Likewise.
477 * gcc-interface/utils.c (create_subprog_decl): Likewise. Deal
478 with is_prescribed status by setting
479 DECL_DISREGARD_INLINE_LIMITS. Do not set the
480 DECL_NO_INLINE_WARNING_P flag if Debug_Generated_Code is true.
482 2018-12-03 Gary Dismukes <dismukes@adacore.com>
484 * sem_aux.adb (Object_Type_Has_Constrained_Partial_View): Return
485 True for an untagged discriminated formal derived type when
486 referenced within a generic body (augments existing test for
487 formal private types).
488 * sem_util.adb (Is_Dependent_Component_Of_Mutable_Type): If the
489 prefix of the name is a qualified expression, retrieve the
490 operand of that. Add a test of whether the (possible)
491 dereference prefix is a variable, and also test whether that
492 prefix might just be of an access type (occurs in some implicit
493 dereference cases) rather than being an explicit dereference.
494 Retrieve the Original_Node of the object name's main prefix and
495 handle the possibility of that being a qualified expression.
496 Remove special-case code for explicit dereferences that don't
497 come from source. Add test for the renaming not being within a
498 generic body for proper determination of whether a formal access
499 type is known to be constrained (it is within a generic spec,
500 but not in the body). Fix an existing incorrect test for
501 renaming of a discriminant-dependent component of a untagged
502 generic formal type being within a generic body, adding test of
503 taggedness and calling In_Generic_Body (now properly checks for
504 cases where the renaming is in a nongeneric body nested within a
505 generic). Return False in cases where the selector is not a
506 component (or discriminant), which can occur for
507 prefixed-notation calls.
509 2018-12-03 Ed Schonberg <schonberg@adacore.com>
511 * sem_res.adb (Apply_Check): For array types, apply a length
512 check rather than a qualification, to avoid spurious errors when
513 the value of a dependend expression has a matching length but
514 different bounds from those of the type of the contect.
516 2018-12-03 Hristian Kirtchev <kirtchev@adacore.com>
518 * libgnat/a-calend.adb: Update the number of leap seconds. Add
519 the hard time values for year 2015 and 2016.
521 2018-12-03 Gary Dismukes <dismukes@adacore.com>
523 * exp_ch3.adb, libgnarl/s-taasde.adb, libgnarl/s-taenca.adb,
524 libgnarl/s-tarest.adb, libgnarl/s-tasini.adb,
525 libgnarl/s-taskin.ads, libgnarl/s-tasren.adb,
526 libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb: Spelling fixes and
529 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
531 * exp_aggr.adb (Convert_To_Positional): Use
532 Static_Array_Aggregate to decide whether to set
533 Compile_Time_Known_Aggregate on an already flat aggregate.
534 (Expand_Array_Aggregate): Remove test on
535 Compile_Time_Known_Aggregate that turns out to be dead and
537 (Is_Static_Component): New predicate extracted from...
538 (Static_Array_Aggregate): ...here. Test neither Is_Tagged_Type
539 nor Is_Controlled for the type, but test whether the component
540 type has discriminants. Use the Is_Static_Component predicate
541 consistently for the positional and named cases.
543 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
545 * freeze.adb (Freeze_Entity): Do not freeze the partial view of
546 a private subtype if its base type is also private with delayed
547 freeze before the full type declaration of the base type has
549 * sem_ch7.adb (Preserve_Full_Attributes): Add assertion on
552 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
554 * exp_ch3.adb (Build_Record_Init_Proc): Inherit an
555 initialization procedure if it is present, even if it is null.
557 2018-12-03 Patrick Bernardi <bernardi@adacore.com>
559 * libgnarl/s-taskin.ads (ATC_Level_Base): Redefine to span from
560 -1 to Max_ATC_Nesting so that 0 represents no ATC nesting and -1
561 represented a completed task. To increase readability, new
562 constants are introduced to represent key ATC nesting levels.
563 Consequently, Level_No_Pending_Abort replaces
564 ATC_Level_Infinity. ATC_Level related definitions now
566 (Ada_Task_Control_Block): The default initialization of
567 components ATC_Nesting_Level and Pending_ATC_Level now use new
568 ATC_Level_Base constants. Comments improved
569 * libgnarl/s-taskin.adb (Initialize): Improve the initialisation
570 of the first element of the Entry_Calls array to facilitate
572 * libgnarl/s-taasde.ads: Update comment.
573 * libgnarl/s-taasde.adb, libgnarl/s-taenca.adb,
574 libgnarl/s-tasren.adb, libgnarl/s-tassta.adb,
575 libgnarl/s-tasuti.ads, libgnarl/s-tasuti.adb: Use new
576 ATC_Level_Base constants.
577 * libgnarl/s-tarest.adb (Create_Restricted_Task): Improve the
578 initialisation of the first element of the task's Entry_Calls
579 array to facilitate better maintenance.
580 * libgnarl/s-tasini.ads (Locked_Abort_To_Level): Update
581 signature to accept ATC_Level_Base.
582 * libgnarl/s-tasini.adb (Locked_Abort_To_Level): Update
583 signature to accept ATC_Level_Base. Use new ATC_Level_Base
584 constants and only modify the aborting task's Entry_Calls array
585 if any entry call is happening.
586 * libgnarl/s-tposen.adb (Protected_Single_Entry_Call): Reference
587 the first element of the task's Entry_Calls array via 'First
588 attribute to facilitate better maintenance.
590 2018-12-03 Eric Botcazou <ebotcazou@adacore.com>
592 * einfo.adb (Write_Entity_Info): Don't take Scope of Standard
594 * sem_ch4.adb (Remove_Abstract_Operations): Add missing blank
595 lines to -gnatdv output.
596 * sem_type.adb (Write_Overloads): Take Entity of entity names
599 2018-12-03 Hristian Kirtchev <kirtchev@adacore.com>
601 * checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch3.adb,
602 exp_util.adb, exp_util.ads, repinfo.adb, sem_attr.adb,
603 sem_ch3.adb, sem_res.adb, sem_util.adb: Minor reformatting.
605 2018-12-03 Ed Schonberg <schonberg@adacore.com>
607 * sem_ch3.adb (Complete_Private_Subtype): Enhance comment.
609 2018-12-03 Olivier Hainque <hainque@adacore.com>
611 * gcc-interface/lang.opt (fopenacc): New option for Ada.
612 * gcc-interface/misc.c (gnat_handle_option): Handle it.
613 * gcc-interface/trans.c (struct loop_info_d): Add OMP
615 (Iterate_Acc_Clause_Arg, Acc_gnat_to_gnu): New functions,
616 helpers for OpenACC pragmas processing in Pragma_to_gnu.
617 (Acc_Var_to_gnu, Acc_Reduc_Var_to_gnu, Acc_Reduc_to_gnu):
619 (Acc_Size_Expr_to_gnu, Acc_Size_List_to_gnu): Likewise.
620 (Pragma_Acc_Data_to_gnu): Likewise.
621 (Pragma_to_gnu): Handle Pragma_Acc_Loop, Pragma_Acc_Data,
622 Pragma_Acc_Kernels and Pragma_Acc_Parallel.
623 (Acc_Loop_to_gnu, Regular_Loop_to_gnu): New functions. Helpers
625 (Loop_Statement_to_gnu): Rework to handle OpenACC loops.
627 2018-12-03 Olivier Hainque <hainque@adacore.com>
629 * gcc-interface/targtyps.c (MALLOC_OBSERVABLE_ALIGNMENT): Set to
632 2018-12-03 Ed Schonberg <schonberg@adacore.com>
634 * sem_res.adb (Set_Slice_Subtype): The index type of a slice is
637 2018-11-26 Matthias Klose <doko@ubuntu.com>
640 * libgnarl/s-linux__alpha.ads: Define SIGSYS.
642 2018-11-19 Alexandre Oliva <oliva@adacore.com>
645 * gcc-interface/config-lang.in (lang_requires): Set to "c c++"
646 when gnattools wants it.
648 2018-11-19 Eric Botcazou <ebotcazou@adacore.com>
650 * gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
652 2018-11-15 Eric Botcazou <ebotcazou@adacore.com>
654 * gcc-interface/misc.c (gnat_init_gcc_eh): Do not override the switch
655 -fnon-call-exceptions passed on the command line in -gnatp mode.
657 2018-11-14 Ed Schonberg <schonberg@adacore.com>
659 * exp_util.ads, exp_util.adb: Change the profile of
660 Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
661 of the right opersnd. This prevents unnesting anomalies when
662 that operand contains uplevel references.
663 * exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
664 * exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.
666 2018-11-14 Patrick Bernardi <bernardi@adacore.com>
668 * libgnarl/a-intnam__linux.ads: Add SIGSYS.
669 * libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
670 libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
671 libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
672 libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
673 SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
674 implementation specific.
675 * libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
676 SIGSYS. Move SIG32, SIG33 and SIG34 from the unmasked list to
679 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
681 * exp_aggr.adb (Is_Static_Element): New predicate extracted
683 (Check_Static_Components): ...here. Call Is_Static_Element on
684 each element of the component association list, if any.
685 (Flatten): Duplicate the expression of an others choice only if
686 it is static or is an aggregate which can itself be flattened.
688 2018-11-14 Olivier Hainque <hainque@adacore.com>
690 * sigtramp-vxworks-target.inc: Fix stack checking test errors in
691 ACATS, now that GCC can emit CFI rules referring to sp in
692 absence of a frame pointer.
694 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
696 * exp_aggr.adb (Check_Static_Components): Remove dead test.
697 (Flatten): Likewise. Move comment around.
699 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
701 * sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
702 SPARK-related global state at the start of the routine. Set the
703 Ghost mode of the completed spec if any. Restore the saved
704 Ghost and SPARK-related global state on exit from the routine.
706 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
708 * doc/gnat_ugn/building_executable_programs_with_gnat.rst
709 (-gnatR): Document new -gnatR4 level.
710 * gnat_ugn.texi: Regenerate.
711 * opt.ads (List_Representation_Info): Bump upper bound to 4.
712 * repinfo.adb: Add with clause for GNAT.HTable.
713 (Relevant_Entities_Size): New constant.
714 (Entity_Header_Num): New type.
715 (Entity_Hash): New function.
716 (Relevant_Entities): New set implemented with GNAT.HTable.
717 (List_Entities): Also list compiled-generated entities present
718 in the Relevant_Entities set. Consider that the Component_Type
719 of an array type is relevant.
720 (List_Rep_Info): Reset Relevant_Entities for each unit.
721 * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4.
722 * switch-m.adb (Normalize_Compiler_Switches): Likewise
723 * usage.adb (Usage): Likewise.
725 2018-11-14 Javier Miranda <miranda@adacore.com>
727 * exp_disp.adb (Expand_Interface_Thunk): Extend handling of
728 renamings of the predefined equality primitive.
729 (Make_Secondary_DT): When calling Expand_Interface_Thunk() pass
730 it the primitive, instead of its Ultimate_Alias; required to
731 allow the called routine to identify renamings of the predefined
734 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
736 * freeze.adb (Check_Pragma_Thread_Local_Storage): New routine. A
737 variable with suppressed initialization has no initialization
738 for purposes of the pragma.
739 (Freeze_Object_Declaration): Remove variable
740 Has_Default_Initialization as it is no longer used. Use routine
741 Check_Pragma_Thread_Local_Storage to verify the semantics of
742 pragma Thread_Local_Storage.
744 2018-11-14 Ed Schonberg <schonberg@adacore.com>
746 * sem_res.adb (Resolve_If_Expression): Verify that the subtypes
747 of all dependent expressions obey the constraints of the
748 expected type for the if-expression.
749 (Analyze_Expression): Only add qualificiation to the dependent
750 expressions when the context type is constrained. Small
751 adjustment to previous patch.
753 2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
755 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't
756 register a compile-time warning or error for 'Alignment or 'Size
757 of an entity declared in a generic unit.
759 2018-11-14 Justin Squirek <squirek@adacore.com>
761 * sem_ch8.adb (Use_One_Package): Add test for out-of-scope
764 2018-11-14 Ed Schonberg <schonberg@adacore.com>
766 * exp_ch3.adb: (Expand_N_Object_Declaration): If the expression
767 is a limited aggregate its resolution is delayed until the
768 object declaration is expanded.
769 * sem_ch3.adb: (Analyze_Object_Declaration): If the expression
770 is a limited aggregate and the declaration has a following
771 address clause indicate that resolution of the aggregate (which
772 must be built in place) must be delayed.
774 2018-11-14 Bob Duff <duff@adacore.com>
776 * sem_attr.adb (To_Address): Simplify setting of
777 Is_Static_Expression. Remove second (unconditional) call to
778 Set_Is_Static_Expression -- surely it's not static if the
779 operand is not. Initialize Static on declaration. Do not try
780 to fold 'To_Address, even though it's static.
781 * exp_attr.adb (To_Address): Preserve Is_Static_Expression.
782 * sinfo.ads, sem_eval.ads, sem_eval.adb (Is_Static_Expression,
783 Is_OK_Static_Expression, Raises_Constraint_Error): Simplify
784 documentation. There was too much repetition and redundancy.
786 2018-11-14 Ed Schonberg <schonberg@adacore.com>
788 * sem_ch3.adb (Analyze_Object_Declaration): Use the
789 Actual_Subtype to preserve information about a constant
790 initialized with a non-static entity that is known to be valid,
791 when the type of the entity has a narrower range than that of
792 the nominal subtype of the constant.
793 * checks.adb (Determine_Range): If the expression is a constant
794 entity that is known-valid and has a defined Actual_Subtype, use
795 it to determine the actual bounds of the value, to enable
796 additional optimizations.
798 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
800 * back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
801 exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
802 freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
803 sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.
805 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
807 * exp_ch4.adb (Find_Aliased_Equality): New routine.
808 (Find_Equality): Reimplemented.
809 (Is_Equality): New routine.
811 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
813 * ghost.adb (Ghost_Entity): New routine.
814 (Mark_And_Set_Ghost_Assignment): Reimplemented.
815 * sem_ch5.adb (Analyze_Assignment): Assess whether the target of
816 the assignment is an ignored Ghost entity before analyzing the
818 * sem_ch8.adb (Find_Direct_Name): Update the subprogram
819 signature. Do not generate markers and references when they are
821 (Nvis_Messages): Do not execute when errors are not desired.
822 (Undefined): Do not emit errors when they are not desired.
823 * sem_ch8.ads (Find_Direct_Name): Update the subprogram
824 signature and comment on usage.
825 * sem_util.adb (Ultimate_Prefix): New routine.
826 * sem_util.ads (Ultimate_Prefix): New routine.
828 2018-11-14 Justin Squirek <squirek@adacore.com>
830 * sem_ch7.adb (Uninstall_Declarations): Add conditional to avoid
831 uninstalling potential visibility during freezing on enumeration
834 2018-11-14 Jerome Lambourg <lambourg@adacore.com>
836 * env.c: Do not include crt_externs.h on iOS, as it does not
837 exist there. This is also true for the iPhone Simulator SDK.
839 2018-11-14 Ed Schonberg <schonberg@adacore.com>
841 * exp_ch7.adb (Check_Unnesting_In_Declarations): New procedure
842 to transform blocks that appear in the declarative part of a
843 package body into subprograms if they contain generated
844 subprograms (such as finalization routines). Needed to generate
845 the proper upward references in unnesting mode.
847 2018-11-14 Ed Schonberg <schonberg@adacore.com>
849 * freeze.adb (Freeze_Fixed_Point_Type): If the given low bound
850 of the type is less than the nearest model number, do not expand
851 the range of the type to include the model number below the
852 bound. Similar adjustment if the upper bound is larger than the
853 nearest model number.
855 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
857 * checks.adb (Install_Primitive_Elaboration_Check): Do not
858 create the check when exceptions cannot be used.
859 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not raise
860 Program_Errror when exceptions cannot be used. Analyze the
861 generated code with all checks suppressed.
862 * exp_ch7.adb (Build_Finalizer): Remove the declaration of
864 (Make_Deep_Array_Body): Remove the declaration of Exceptions_OK.
865 (Make_Deep_Record_Body): Remove the declaration of
867 (Process_Transients_In_Scope): Remove the declaration of
869 * exp_util.adb (Exceptions_In_Finalization_OK): Renamed to
871 * exp_util.ads (Exceptions_In_Finalization_OK): Renamed to
874 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
876 * exp_ch4.adb (Expand_N_Op_Eq): Remove duplicated code and use
877 routine Find_Equality instead.
878 (Find_Equality): New routine.
880 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
882 * sem_util.adb (First_From_Global_List): Do not expect
883 N_Selected_Component in the Global contract; simplify assertion
886 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
888 * sem_ch12.adb (Instantiate_Object): Set
889 Corresponding_Generic_Association on generic actuals with
891 * sinfo.ads (Corresponding_Generic_Association): Update comment.
893 2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
895 * exp_ch4.adb (Expand_Concatenate): Use the proper routine to
896 set the need for debug info.
897 * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Use the
898 proper routine to set the need for debug info.
899 * exp_prag.adb (Expand_Pragma_Initial_Condition): Use the proper
900 routine to set the need for debug info.
901 * exp_util.adb (Build_DIC_Procedure_Declaration): Use the proper
902 routine to set the need for debug info.
903 (Build_Invariant_Procedure_Declaration): Use the proper routine
904 to set the need for debug info.
905 * ghost.adb (Record_Ignored_Ghost_Node): Add statements as a
906 whole class to the list of top level ignored Ghost nodes.
907 * sem_util.adb (Set_Debug_Info_Needed): Do not generate debug
908 info for an ignored Ghost entity.
910 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
912 * bindgen.adb, exp_cg.adb, repinfo.adb, sprint.adb: Minor reuse
913 Cancel_Special_Output where possible.
915 2018-11-14 Piotr Trojanek <trojanek@adacore.com>
917 * exp_dbug.ads, sem_util.ads: Minor fixes in comments.
919 2018-11-14 Arnaud Charlet <charlet@adacore.com>
921 * adabkend.adb (Scan_Back_End_Switches): Handle -gx switches
924 2018-11-13 Eric Botcazou <ebotcazou@adacore.com>
926 * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
927 for the runtime on platforms where System.Machine_Overflow is true.
929 2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
931 * fe.h (Suppress_Checks): Declare.
932 * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
933 only if checks are not suppressed and -faggressive-loop-optimizations
935 * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
936 warned_aggressive_loop_optimizations fields.
937 (gigi): Do not clear warn_aggressive_loop_optimizations here.
938 (Raise_Error_to_gnu): Do not set has_checks.
939 (gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
942 2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
944 * gcc-interface/decl.c (components_to_record): Remove obsolete kludge.
945 * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the
946 new type but do not take into account the setting on the old type for
947 the new fields. Rename a local variable.
948 (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at
950 (create_field_decl): Tweak comment.
952 2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
954 * gcc-interface/utils.c (unchecked_convert): Use local variables for
955 the biased and reverse SSO attributes of both types.
956 Further extend the processing of integral types in the presence of
957 reverse SSO to all scalar types.
959 2018-10-22 Eric Botcazou <ebotcazou@adacore.com>
961 * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Inspection_Point>: Use
962 a simple memory constraint in all cases.
964 * gcc-interface/lang-specs.h: Bump copyright year.
966 2018-10-17 David Malcolm <dmalcolm@redhat.com>
968 * gcc-interface/Make-lang.in (selftest-ada): New.
970 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
972 * exp_ch3.adb (Is_Null_Statement_List): New predicate.
973 (Build_Array_Init_Proc): Use it to find out whether the
974 initialization procedure Is_Null_Init_Proc; if so, set
975 Warnings_Off on the parameter.
976 (Build_Init_Procedure): Likewise.
977 (Init_Formals): Use an in/out first parameter only for
978 unconstrained arrays and for records either containing or built
979 for proteced types or task types; use an out parameter in all
981 * fe.h (Is_Init_Proc): Declare.
982 * gcc-interface/decl.c (type_requires_init_of_formal): Do not
983 return true for a discriminant in an unchecked union.
984 (gnat_to_gnu_param): Do not create a PARM_DECL for the Out
985 parameter of an initialization procedure.
987 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
989 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If
990 this is not a definition, retrieve the expression in all cases
991 even if we are just annotating types.
992 * gcc-interface/trans.c (gnat_to_gnu): Also translate Size
993 attribute for constrained types in this mode.
995 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
997 * adaint.c (__gnat_get_executable_suffix_ptr): Add new line.
998 (__gnat_locate_exec): Check that HOST_EXECUTABLE_SUFFIX is not
999 empty before doing a string search for it.
1000 * socket.c (ATTRIBUTE_UNUSED): Define.
1001 (__gnat_disable_sigpipe): Add ATTRIBUTE_UNUSED on parameter.
1002 * terminals.c (ATTRIBUTE_UNUSED): Move around.
1003 (__gnat_setup_child_communication): Add ATTRIBUTE_UNUSED on
1005 (__gnat_send_header): Add ATTRIBUTE_UNUSED on parameters.
1007 2018-10-09 Yannick Moy <moy@adacore.com>
1009 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
1010 pragmas as null statements in GNATprove mode.
1012 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
1014 * exp_ch6.adb (Add_Call_By_Copy_Code): Initialize the temporary
1015 made for an Out parameter if the formal type has discriminants.
1017 2018-10-09 Maroua Maalej <maalej@adacore.com>
1019 * sem_spark.adb (Check_Declaration): fix bug related to non
1020 access object permissions.
1022 2018-10-09 Doug Rupp <rupp@adacore.com>
1024 * libgnat/a-ncelfu.ads: Fix name in header to match package.
1026 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
1028 * exp_disp.adb (Make_Disp_Asynchronous_Select_Spec): Set
1029 Warnings_Off on the B out parameter.
1031 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
1033 * einfo.ads: Small comment fix.
1035 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
1037 * sem_ch7.adb (Has_Referencer): Add comment for the
1038 N_Freeze_Entity case. Do not rely on
1039 Has_Referencer_Of_Non_Subprograms to clear the Is_Public flag on
1040 subprogram entities.
1042 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1044 * exp_unst.adb (In_Synchronized_Call): Handle properly private
1045 types whose full views are synchronized types, in order to
1046 recognize generated subprograms whose bodies must be considered
1047 reachable even if no direct calls to them are visible in the
1050 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1052 * exp_ch4.adb (Expand_Modular_Op): When expanding an operation
1053 on nonbinary modular types, convert the opersnds to an integer
1054 type that is large enough to hold the modulus of the type, which
1055 may be larger than Integer'Last.
1057 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1059 * exp_unst.adb (Unnest_Subprogram): When an uplevel reference
1060 is to an unconstrained formal, the 'Access reference that is
1061 created to initialize the corresponding component of the
1062 activation record must be wrapped in an unchecked conversion to
1063 the generated type of the component. Otherwise, spurious suvtype
1064 conformance errors will be generated when the code is within an
1065 instantiation and the type of the formal is a formal type of the
1066 enclosing generic. Note that during unnesting there is no simple
1067 way to determine that the code appears within an instance
1068 because ther is no scope stack.
1070 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
1072 * gcc-interface/decl.c (type_requires_init_of_formal): New
1074 (gnat_to_gnu_param): Use it to determine whether a PARM_DECL
1075 must be created for an Out parameter passed by copy.
1077 2018-10-09 Arnaud Charlet <charlet@adacore.com>
1079 * libgnat/a-coboho.ads (Storage_Element): Fix a typo.
1081 2018-10-09 Claire Dross <dross@adacore.com>
1083 * libgnat/a-cfinve.ads: Remove default value for
1084 Max_Size_In_Storage_Elements as it was not supported in SPARK.
1086 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1088 * exp_ch6.adb (Add_Call_By_Copy_Node,
1089 Add_Simple_Call_By_Copy_Node, Expand_Call_Helper): Reset
1090 Is_True_Constant on entities used as Out or In_Out parameters in
1093 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1095 * exp_unst.adb (Unnest_Subprogram): Do not load System to obtain
1096 the Address entity unless an activation record is being built.
1097 Removes useless with_clauses for System when nested subprograms
1098 do not have uplevel references, and therefore do not need
1101 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1103 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
1104 the conformance check on an aspect expression that includes a
1105 call to an instance of Unchecked_Conversion, or more generally a
1106 call to an intrinsic operation.
1108 2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
1110 * repinfo.adb: Remove with/use clause for Stand.
1111 (List_Mechanisms): List the mechanism of functions only.
1113 2018-10-09 Bob Duff <duff@adacore.com>
1115 * doc/gnat_ugn/gnat_utility_programs.rst: Correct spelling of
1116 --eol switch. Document the language-version switches. Update
1117 description for --no-exception.
1119 2018-10-09 Vasiliy Fofanov <fofanov@adacore.com>
1121 * libgnat/s-os_lib.ads (Normalize_Pathname): Fix incorrect
1124 2018-10-09 Arnaud Charlet <charlet@adacore.com>
1126 * vxlink.adb: Remove pragma Annotate, no longer needed.
1128 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1130 * checks.adb (Apply_Type_Conversion_Checks): Use GNATprove_Mode
1131 rather than SPARK_mode in order to preserve the Do_Range_Check
1132 flag for verification purposes.
1134 2018-10-09 Ed Schonberg <schonberg@adacore.com>
1136 * exp_aggr.adb (Expand_Array_Aggregate): If it is not possible
1137 to build in place an aggregate with component associations, set
1138 the Warnings_Off flag on the generated temporary, to prevent
1139 spurious warnings from the backend when compiling with the
1140 -Wuninitialized gcc flag.
1142 2018-09-30 Alexandre Oliva <oliva@adacore.com>
1144 * gcc-interface/lang-specs.h (default_compilers): When given
1145 fcompare-debug-second, adjust auxbase like cc1, and pass
1147 * gcc-interface/misc.c (flag_compare_debug): Remove variable.
1148 (gnat_post_options): Do not set it.
1149 * lib-writ.adb (flag_compare_debug): Remove import.
1150 (Write_ALI): Do not test it.
1152 2018-09-28 Eric Botcazou <ebotcazou@adacore.com>
1153 Pierre-Marie de Rodat <derodat@adacore.com>
1155 * gcc-interface/decl.c (is_cplusplus_method): Do not require C++
1156 convention on Interfaces.
1157 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a
1158 bona-fide thunk and hand it over to the middle-end.
1159 (get_controlling_type): New function.
1160 (use_alias_for_thunk_p): Likewise.
1161 (thunk_labelno): New static variable.
1162 (make_covariant_thunk): New function.
1163 (maybe_make_gnu_thunk): Likewise.
1164 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the
1165 result DECL here instead of...
1166 (end_subprog_body): ...here.
1168 2018-09-27 Martin Sebor <msebor@redhat.com>
1170 * gcc-interface/utils.c (make_packable_type): Introduce a temporary
1172 (unchecked_convert): Same.
1174 2018-09-26 Elisa Barboni <barboni@adacore.com>
1176 * sem_prag.adb (Check_Refined_Global_Item): Improve error
1179 2018-09-26 Thomas Quinot <quinot@adacore.com>
1181 * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a
1182 representation item that is an N_Aspect_Definition, retrieve the
1183 entity it applies to using the Entity attribute.
1185 2018-09-26 Justin Squirek <squirek@adacore.com>
1187 * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition
1188 to check for unmarked subprogram references coming from
1191 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1193 * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches.
1195 2018-09-26 Yannick Moy <moy@adacore.com>
1197 * errout.ads: Update comment for insertion character '?'.
1198 * inline.adb: Use simple insertion character '?' for GNATprove
1200 * sem_res.adb (Resolve_Call): Issue an info message on inlining
1203 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1205 * checks.adb (Apply_Type_Conversion_Checks): Do not generate a
1206 range check on the expression of the conversion if it involves a
1207 fixed-point type, as such conversions are handled specially
1209 * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from
1210 Fixed to Integer, use the base type of the expression to ensure
1211 that the caller will generate the proper constraint check when
1214 2018-09-26 Maroua Maalej <maalej@adacore.com>
1216 * sem_spark.adb (Check_Loop_Statement): Fix a bug related to
1217 loop exit environment.
1218 (Check_Statement): fixing a bug when comparing the source and
1219 target in an assignment statement.
1221 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1223 * sem_ch12.adb (Instantiate_Package_Body): Capture and restore
1224 the full compilation context.
1225 (Instantiate_Subprogram_Body): Capture and restore the full
1226 compilation context.
1228 2018-09-26 Yannick Moy <moy@adacore.com>
1230 * debug.adb: Add use for -gnatd_f switch.
1231 * inline.adb (Cannot_Inline): Only issue info message for
1232 failure to inline in GNATprove mode when switch -gnatd_f is
1235 2018-09-26 Javier Miranda <miranda@adacore.com>
1237 * exp_disp.adb (Expand_Interface_Conversion): No displacement of
1238 the pointer needed when the type of the operand is an interface
1239 type that maches the target type and we are compiling under
1240 configurable runtime. Adding also documentation explaining why
1241 this cannot be done when compiling with the full runtime.
1242 * exp_intr.adb: Update comment.
1244 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1246 * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return.
1248 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1250 * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when
1251 applying a predicate check to prevent spurious errors when
1252 private ancestors are involved.
1254 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1256 * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the
1257 secondary stack does not clash with restriction
1259 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that
1260 the use of the secondary stack does not clash with restriction
1262 * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block
1263 prior to analysis in order to either provide a local scope for
1264 an iterator, or ensure that the secondary stack is properly
1266 (Check_Call): Account for the case where the tree may be
1267 unanalyzed or contain prior errors.
1268 (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call.
1269 Update all uses of the subprogram.
1270 (Prepare_Loop_Statement): New routine.
1272 2018-09-26 Javier Miranda <miranda@adacore.com>
1274 * sem_res.adb (Resolve_Actuals): If the formal is a class-wide
1275 type conversion then do not skip resolving and expanding the
1276 conversion; required to displace the pointer to the object and
1277 reference the dispatch table associated with the target
1280 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1282 * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number
1283 of key-value pairs in the hash table only when adding a brand
1286 2018-09-26 Sergey Rybin <rybin@adacore.com>
1288 * doc/gnat_ugn/gnat_utility_programs.rst: Add note about
1289 processing of aggregate projects in gnatmetric and gnatstub.
1291 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1293 * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
1294 opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
1295 sinfo.ads, snames.ads-tmpl: Minor reformatting.
1297 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
1299 * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of
1301 * impunit.adb: Add unit GNAT.Sets to the list of predefined
1303 * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking
1305 * libgnat/g-sets.adb: New unit.
1306 * libgnat/g-sets.ads: New unit.
1307 * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to
1308 allow for small sets. Update all occurrences of Table_Locked to
1310 (Ensure_Unlocked): Query the number of iterators.
1311 (Find_Node): Use the supplied equality.
1312 (Is_Empty): New routine.
1313 (Lock): Update the number of iterators.
1314 (Prepend_Or_Replace): Use the supplied equality.
1315 (Size): Update the return type.
1316 (Unlock): Update the number of iterators.
1317 * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked
1318 to Iterated. Rename formal subprogram Equivalent_Keys to "=".
1319 (Bucket_Range_Type, Pair_Count_Type): Remove types.
1320 (Not_Created, Table_Locked, Iterator_Exhausted): Remove
1322 (Hash_Table): Update to store the number of iterators rather
1324 (Is_Empty): New routine.
1325 (Size): Update the return type.
1326 * libgnat/g-lists.adb: Update all occurrences of List_Locked to
1328 (Ensure_Unlocked): Query the number of iterators.
1330 (Lock): Update the number of iterators.
1331 (Size): New routine.
1332 (Unlock): Update the number of iterators.
1333 * libgnat/g-lists.ads: Update all occurrences of List_Locked to
1335 (Element_Count_Type): Remove type.
1336 (Not_Created, Table_Locked, Iterator_Exhausted): Remove
1338 (Linked_List): Update type to store the number of iterators
1341 (Size): New routine.
1342 * libgnat/gnat.ads (Bucket_Range_Type): New type.
1343 (Iterated, Iterator_Exhausted, and Not_Created): New exceptions.
1345 2018-09-26 Javier Miranda <miranda@adacore.com>
1347 * checks.adb (Install_Null_Excluding_Check): Do not add
1348 null-excluding checks when the tree may not be fully decorated.
1349 This patch cascade errors.
1351 2018-09-26 Gary Dismukes <dismukes@adacore.com>
1353 * sem_ch3.adb (Analyze_Object_Declaration): Remove test for
1354 Comes_From_Source, which prevented implicit conversions from
1355 being applied to anonymous access-to-subprogram formals in
1356 constant declartions that arise from instance associations for
1357 generic formal objects. Add RM and AARM references to comment.
1359 2018-09-26 Olivier Hainque <hainque@adacore.com>
1361 * opt.ads (OpenAcc_Enabled): New flag. False by default. True
1362 when OpenACC pragmas are requested to be honored, when -fopenacc
1363 is found on the command line.
1364 * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if
1365 -fopenacc is seen on the command line.
1366 * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New
1367 flag/predicate on Loop statements which embed an Acc_Kernels,
1368 Acc_Parallel or Acc_Data pragma.
1369 (Is_OpenAcc_Loop): New flag/predicate on Loop statements which
1370 embed an Acc_Loop pragma.
1371 (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for
1373 * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel
1374 and Acc_Kernels pragmas. Nothing to do here, all handled by
1376 * sem_prag.adb (Acc_First, Acc_Next,
1377 Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause,
1378 Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause,
1379 Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang,
1380 Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker,
1381 Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New
1382 helper for Analyze_Pragma, to handle OpenACC pragmas.
1383 (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and
1384 Acc_Kernels pragmas.
1385 * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on
1386 variable entity, action for ...
1387 (Disable_Constants): Helper for Analyze_Loop_Statement, to ...
1388 (Analyze_Loop_Statement): Disable True_Constant on variables
1389 referenced within an OpenACC environment.
1390 * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives
1391 and clauses we can handle. Remove an exraneous whitespace before
1392 columns, preventing line length overflow in the generated spec
1393 with Ids now reaching beyond 999.
1394 * doc/gnat_rm/implementation_defined_pragmas.rst: Document
1395 pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data.
1396 * gnat_rm.texi: Regenerate.
1398 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1400 * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P
1401 is a derived limited record is not itself limited if P is a
1402 derived limited interface.
1404 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1406 * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and
1407 add In_Nested_Instance and
1408 Has_Outer_Referencer_Of_Non_Subprograms parameters. Rename
1409 Has_Non_Subprograms_Referencer variable into
1410 Has_Referencer_Of_Non_Subprograms and initialize it with the new
1411 third parameter. Adjust recursive calls and to the renaming.
1412 Replace test on Top_Level with test on In_Nested_Instance to
1413 decide whether to clear the Is_Public flag on entities.
1414 (Hide_Public_Entities): Adjust call to Has_Referencer.
1416 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1418 * exp_disp.adb (Expand_Interface_Conversion): Use Present test.
1419 (Expand_Interface_Thunk): Propagate debug info setting from
1421 * exp_util.ads (Find_Interface_Tag): Adjust comment.
1422 * exp_util.adb (Find_Interface_Tag): Remove assertions of
1424 * sem_util.adb (Is_Variable_Size_Record): Only look at
1425 components and robustify the implementation.
1426 * fe.h (Find_Interface_Tag): Declare.
1427 (Is_Variable_Size_Record): Likewise.
1429 2018-09-26 Thomas Quinot <quinot@adacore.com>
1431 * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order
1432 and scalar storage order from root type to classwide equivalent
1433 type, to prevent rejection of the equivalent type by the
1436 2018-09-26 Justin Squirek <squirek@adacore.com>
1438 * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional
1439 to freeze called functions within iterator specifications during
1441 (Preanalyze_Range): Minor typo fix.
1443 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1445 * sem_ch6.adb (Analyze_Function_Return): If the return type has
1446 a dynamic_predicate, apply a Predicate_Check to the expression,
1447 given that it is implicitly converted to the return type.
1448 Exclude case expressions from the check, because in this context
1449 the expression is expanded into individual return statements.
1451 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1453 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: In
1454 -gnatct mode, process the discriminants only for a definition.
1456 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1458 * repinfo.adb (List_Record_Layout): Be prepared for JSON output.
1459 (List_Record_Info): Use the flat representation for record
1460 subtypes in the JSON format.
1462 2018-09-26 Justin Squirek <squirek@adacore.com>
1464 * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
1465 documentation and an extra conditional check for RCI units so
1466 that generated ali files will list the spec only instead of a
1467 body when a body is not found.
1469 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1471 * gcc-interface/gigi.h (error_gnat_node): Delete.
1472 * gcc-interface/trans.c (error_gnat_node): Likewise.
1473 (gigi): Replace it with Current_Error_Node.
1474 (gnat_to_gnu): Likewise.
1475 * gcc-interface/utils.c (rest_of_subprog_body_compilation):
1477 * gcc-interface/misc.c (internal_error_function): Do not set it.
1479 2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
1481 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
1482 code retrieving the address when a clause has already been
1484 * gcc-interface/trans.c (gnat_to_gnu)
1485 <N_Attribute_Definition_Clause>: For an object with a Freeze
1486 node, build a meaningful expression.
1488 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1490 * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets
1491 Opt.Disable_ALI_File.
1492 * debug.adb: Update debug flags documentation.
1494 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1496 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
1497 analysis of preconditions specified by pragmas (rather than
1498 aspects) is not delayed, and therefore expressions functions
1499 that are completions do not need special handling during
1502 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1504 * exp_unst.adb: Fix handling of up level references for entries.
1506 2018-09-26 Ed Schonberg <schonberg@adacore.com>
1508 * contracts.adb (Expand_Subprogram_Contract,
1509 Process_Preconditions_For): Apply Freeze_Expr_Types to the
1510 expression for a precondition of an expression function that is
1511 a completion, when the completion appears in the private part
1512 and the declaration it completes is in the visible part of the
1514 * freeze.adb (Freeze_Expr_Types): Do not establish the scope of
1515 the operation if it is already installed, as will be the case
1516 when called to analyze the contract oc the subprogram (which
1517 happens when generating code inside the subprogram body).
1519 2018-09-26 Maroua Maalej <maalej@adacore.com>
1521 * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global):
1522 Change the operation associated to assigning to an IN parameter.
1523 In SPARK, IN access-to-variable is an observe operation for a
1524 function, and borrow operation for a procedure.
1526 2018-09-26 Arnaud Charlet <charlet@adacore.com>
1528 * vxlink.adb: Minor reformatting.
1530 2018-09-26 Gary Dismukes <dismukes@adacore.com>
1532 * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
1533 miscellaneous typos.
1535 2018-09-26 Jerome Lambourg <lambourg@adacore.com>
1537 * vxlink.adb: Kill a CodePeer warning.
1539 2018-09-24 Eric Botcazou <ebotcazou@adacore.com>
1542 * fe.h (Get_Attribute_Definition_Clause): Use 'unsigned char' instead
1543 of 'char' as the type of the second parameter.
1545 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
1547 * Makefile.rtl (arm% linux-gnueabi%): Always set EH_MECHANISM to -arm.
1549 2018-09-13 Eric Botcazou <ebotcazou@adacore.com>
1552 * terminals.c: Do not include termio.h.
1554 2018-08-27 Martin Liska <mliska@suse.cz>
1556 * gcc-interface/decl.c (update_profile): Use new function
1557 fndecl_built_in_p and remove check for FUNCTION_DECL if
1559 * gcc-interface/gigi.h (call_is_atomic_load): Likewise.
1560 * gcc-interface/utils.c (gnat_pushdecl): Likewise.
1562 2018-08-23 Giuliano Belinassi <giuliano.belinassi@usp.br>
1564 * exp_unst.ads: Fix typo 'exapnded' to 'expanded'.
1566 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1568 * checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
1569 exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
1570 exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
1571 lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
1572 sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
1573 sprint.adb: Minor reformatting.
1575 2018-08-21 Jerome Lambourg <lambourg@adacore.com>
1577 * vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
1578 vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
1579 new tool vxlink to handle VxWorks constructors in DKMs.
1580 * gcc-interface/Makefile.in: add rules to build vxlink
1582 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1584 * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
1585 Refine the handling of freezing types for expression functions
1586 that are not completions, when analyzing the generated body for
1587 the function: the body is inserted at the end of the enclosing
1588 declarative part, and its analysis may freeze types declared in
1589 the same scope that have not been frozen yet.
1591 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1593 * sem_ch6.adb: Remove Freeze_Expr_Types.
1594 * freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
1595 sem_ch6.adb, and extended to handle other expressions that may
1596 contain unfrozen types that must be frozen in their proper
1598 * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
1599 contract is for the generated body of an expression function
1600 that is a completion, traverse the expressions for pre- and
1601 postconditions to freeze all types before adding the contract
1602 code within the subprogram body.
1604 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1606 * sem_ch10.adb: Remove the with and use clause for unit Ghost.
1607 (Analyze_With_Clause): Do not mark a with clause which mentions
1608 an ignored Ghost code for elimination.
1610 2018-08-21 Javier Miranda <miranda@adacore.com>
1612 * lib-writ.adb (Write_Unit_Information): Handle pragmas removed
1615 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1617 * sem_ch6.adb (Check_Synchronized_Overriding): The conformance
1618 between an overriding protected operation and the overridden
1619 abstract progenitor operation requires subtype conformance;
1620 requiring equality of return types in the case of a function is
1621 too restrictive and leads to spurious errors when the return
1622 type is a generic actual.
1624 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1626 * exp_ch9.adb (Expand_N_Timed_Entry_Call,
1627 Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
1628 properly the scope of all entities created in blocks generated
1629 by the expansion of these constructs.
1631 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1633 * sem_ch13.adb (Build_Predicate_Functioss): Apply
1634 Reset_Quantified_Variables_Scope after predicate function has
1635 been analyzed, so that the scope can be reset on the generated
1636 loop statements that have replaced the quantified expressions.
1638 2018-08-21 Bob Duff <duff@adacore.com>
1640 * einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
1643 2018-08-21 Maroua Maalej <maalej@adacore.com>
1645 * sem_spark.adb (Check_Call_Statement): Check global and formal
1646 parameter permissions at call sites.
1647 (Check_Callable_Body): Assume permissions on globals and
1648 parameters depending on their modes then analyse the body
1650 (Check_Declaration): Consider both deep (including elementary
1651 access) object declarations and normal variables. First check
1652 whether the deep object is of Ownership Aspec True or not, then,
1653 depending on its initialization, assign the appropriate state.
1654 Check related to non access type variables deal with
1655 initialization value permissions.
1656 (Check_Expression): Check nodes used in the expression being
1658 (Check_Globals): Call by Check_Call_Statement to perform the
1660 (Check_List): Call Check_Node on each element of the list.
1661 (Check_Loop_Statement): Check the Iteration_Scheme and loop
1663 (Check_Node): Main traversal procedure to check safe pointer usage.
1664 (Check_Package_Body): Check subprogram's body.
1665 (Check_Param_In): Take a formal and an actual parameter and
1666 Check the permission of every in-mode parameter.
1667 (Check_Param_Out): Take a formal and an actual parameter and
1668 check the state of out-mode and in out-mode parameters.
1669 (Check_Statement): Check statements other than procedure call.
1670 (Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
1671 related to the given name.
1672 (Is_Deep): Return True if an object is of access type or has
1673 subfields of access type.
1674 (Perm_Error, Perm_Error_Subprogram_End): Add an error message
1675 whenever the found state on the given name is different from the
1676 one expected (in the statement being analyzed).
1677 (Process_Path): Given an operation and a current state, call
1678 Perm_Error if there is any mismatch.
1679 (Return_Declarations, Return_Globals, Return_The_Global): Check
1680 the state of a given name at the end of the subprogram. These
1681 procedures may change depending on how we shall finally deal
1682 with globals and the rhs state in a move operation.
1683 (Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
1684 Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
1685 Setup_Parameters): Set up the new states to the given node and
1686 up and down the tree after an operation.
1687 (Has_Ownership_Aspect_True): This function may disappear later
1688 when the Ownership Aspect will be implemented in the FE.
1690 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1692 * sem_res.adb (Resolve_Call): Resolve correctly a parameterless
1693 call that returns an access type whose designated type is the
1694 component type of an array, when the function has no defaulted
1697 2018-08-21 Yannick Moy <moy@adacore.com>
1699 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1700 Document entries of the target parametrization file.
1701 * gnat_ugn.texi: Regenerate.
1703 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1705 * sem_attr.adb: Set scope of elaboration flag for 'Access.
1707 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1709 * sprint.adb: Add guard on printing aspects.
1711 2018-08-21 Javier Miranda <miranda@adacore.com>
1713 * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
1716 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1718 * layout.adb: Do not set size of access subprogram if unnesting.
1720 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1722 * freeze.adb: Remove warnings for access to subprograms when
1723 unnesting is active.
1725 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1727 * exp_aggr.adb (Expand_Array_Aggregate): If the component type
1728 is limited, the array must be constructed in place, so set flag
1729 In_Place_Assign_OK_For_Declaration accordingly. This prevents
1730 improper copying of an array of tasks during initialization.
1732 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
1734 * gcc-interface/trans.c (Call_to_gnu): Always suppress an
1735 unchecked conversion around the actual for an In parameter
1738 2018-08-21 Eric Botcazou <ebotcazou@adacore.com>
1740 * exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
1741 selected component inherited in a record extension and subject
1742 to a representation clause, retrieve the position and size from
1743 the original record component.
1745 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1747 * sem_util.ads, sem_util.adb (New_External_Entity): Type of
1748 Suffix_Index must be Int, not Nat, so that a negative value can
1749 be used to generate a unique name for an external object, as
1750 specified in Tbuild.New_External_Name.
1751 (Scope_Within): Handle private type whose completion is a
1752 synchronized type (For unnesting).
1753 * itypes.ads, itypes.adb (Create_Itype): Ditto
1754 * sem_ch3.adb (Constrain_Corresponding_Record): Generate a
1755 unique name for the created subtype, because there may be
1756 several discriminated tasks present in the same scope, and each
1757 needs its distinct corresponding record subtype.
1759 2018-08-21 Yannick Moy <moy@adacore.com>
1761 * doc/gnat_ugn/gnat_and_program_execution.rst: Update
1762 documentation of dimensionality analysis.
1763 * gnat_ugn.texi: Regenerate.
1764 * Makefile.rtl, impunit.adb: Consider the new units.
1765 * libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
1766 libgnat/s-diflmk.ads: New units based on Float.
1767 * libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
1768 libgnat/s-dlmopr.ads: New units based on Long_Float.
1769 * libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
1771 System.Dim.Generic_Mks.Generic_Other_Prefixes.
1772 * libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
1773 into an instance of System.Dim.Generic_Mks.
1775 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1777 * impunit.adb: Add g-lists to the set of non-implementation
1779 * libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
1780 * Makefile.rtl: Add g-lists to the set of non-tasking units.
1781 * gcc-interface/Make-lang.in: Add g-lists to the set of files
1784 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1786 * exp_ch9.adb (Reset_Scopes): Do not recurse into type
1787 declarations when resetting the scope of entities declared the
1788 procedures generated for entry bodies and accept alternatives.
1789 Use the entity of the procedure declaration, not its body, as
1792 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1794 * einfo.adb (Elaboration_Entity): Include entries and entry
1795 families in the set of legal entities.
1796 (Elaboration_Entity_Required): Include entries and entry
1797 families in the set of legal entities.
1798 (Set_Elaboration_Entity): Include entries and entry families in
1799 the set of legal entities.
1800 (Set_Elaboration_Entity_Required): Include entries and entry
1801 families in the set of legal entities.
1802 (Write_Field13_Name): Update the output of attribute
1804 * einfo.ads: Attributes Elaboration_Entity and
1805 Elaboration_Entity_Required now apply to entries and entry
1808 2018-08-21 Arnaud Charlet <charlet@adacore.com>
1810 * set_targ.adb: Mark some CodePeer message as Intentional.
1812 2018-08-21 Ed Schonberg <schonberg@adacore.com>
1814 * sem_res.adb (Resolve_Call): Force the freezing of an
1815 expression function that is called to provide a default value
1816 for a defaulted discriminant in an object initialization.
1818 2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
1820 * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
1823 2018-08-21 Javier Miranda <miranda@adacore.com>
1825 * checks.ads (Determine_Range): Adding documentation.
1826 * checks.adb (Determine_Range): Don't deal with enumerated types
1827 with non-standard representation.
1828 (Convert_And_Check_Range): For conversion of enumeration types
1829 with non standard representation to an integer type perform a
1830 direct conversion to the target integer type.
1832 2018-08-21 Piotr Trojanek <trojanek@adacore.com>
1834 * lib-xref.ads, lib-xref-spark_specific.adb
1835 (Enclosing_Subprogram_Or_Library_Package): Now roughtly works
1836 for pragmas that come from aspect specifications.
1838 2018-08-21 Pierre-Marie de Rodat <derodat@adacore.com>
1840 * sa_messages.ads, sa_messages.adb: New source files.
1842 2018-08-03 Pierre-Marie de Rodat <derodat@adacore.com>
1845 2018-07-06 Jim Wilson <jimw@sifive.com>
1847 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
1848 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
1849 * gcc-interface/Makefile.in (xoscons): Likewise.
1851 2018-07-31 Alexandre Oliva <oliva@adacore.com>
1852 Olivier Hainque <hainque@adacore.com>
1854 * gcc-interface/trans.c: Include debug.h.
1855 (file_map): New static variable.
1856 (gigi): Set it. Create decl_to_instance_map when needed.
1857 (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
1858 (Sloc_to_locus): ... this. Add decl parm, map it to instance.
1859 * gcc-interface/gigi.h (Sloc_to_locus): Adjust declaration.
1861 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1863 * clean.adb, gnatchop.adb, gnatfind.adb, gnatls.adb,
1864 gnatmake.ads, gnatxref.adb, make.adb, make.ads, make_util.ads,
1865 sfn_scan.adb, vxaddr2line.adb, xeinfo.adb, xoscons.adb,
1866 xr_tabls.adb, xref_lib.adb: Address CodePeer messages.
1868 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1870 * gnatlink.adb: Fix potential Constraint_Error if
1871 Library_Version is too long.
1873 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1875 * sem_elab.adb: Remove duplicate condition detected by CodePeer.
1877 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1879 * exp_unst.adb (Subp_Index): In the case of a protected
1880 operation, the relevant entry is the generated
1881 protected_subprogram_body into which the original body is
1882 rewritten. Assorted cleanup and optimizations.
1884 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1886 * exp_attr.adb (Expand_Attribute, case Fixed_Value): Set the
1887 base type of the result to ensure that proper overflow and range
1888 checks are generated. If the target is a fixed-point tyoe,
1889 generate the required overflow and range checks explicitly,
1890 rather than relying on Apply_Type_Conversion_Checks, which might
1891 simply set the Do_Range_Check flag and rely on the backend to
1894 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1896 * sem_res.adb (Resolve_Call): Establish a transient scope to
1897 manage the secondary stack when the designated type of an
1898 access-to-subprogram requires it.
1900 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1902 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): To find local
1903 subprograms in the elaboration code for a package body, recurse
1904 through nested statement sequences because a compiler-generated
1905 procedure may appear within a condition statement.
1907 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1909 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Handle
1910 properly a protected call that includes a default parameter that
1911 is a call to a protected function of the same type.
1913 2018-07-31 Justin Squirek <squirek@adacore.com>
1915 * lib-writ.adb (Write_With_Lines): Modfiy the generation of
1916 dependencies within ali files so that source unit bodies are
1917 properly listed even if said bodies are missing. Perform legacy
1918 behavior in GNATprove mode.
1919 * lib-writ.ads: Modify documentation to reflect current behavior.
1921 2018-07-31 Eric Botcazou <ebotcazou@adacore.com>
1923 * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.
1924 (mutex_t): Use it for 'lock' and 'data' components.
1925 (cond_t): Likewise for 'data' and use single 'flags' component.
1927 2018-07-31 Justin Squirek <squirek@adacore.com>
1929 * exp_ch5.adb (Make_Field_Assign): Force temporarily generated
1930 objects for assignment of overlaid user objects to be renamings
1931 instead of constant declarations.
1933 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1935 * exp_ch9.adb (Analyze_Pragmas): New routine.
1936 (Build_Private_Protected_Declaration): Code clean up. Relocate
1937 relevant aspects and pragmas from the stand-alone body to the
1938 newly created spec. Explicitly analyze any pragmas that have
1939 been either relocated or produced by the analysis of the
1941 (Move_Pragmas): New routine.
1942 * sem_prag.adb (Find_Related_Declaration_Or_Body): Recognize the
1943 case where a pragma applies to the internally created spec for a
1944 stand-along subprogram body declared in a protected body.
1946 2018-07-31 Gary Dismukes <dismukes@adacore.com>
1948 * exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
1949 calls to Current_Scope in three assertions with calls to
1952 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1954 * sem_eval.adb (Check_Non_Static_Context): Do not warn on an
1955 integer literal greater than the upper bound of
1956 Universal_Integer'Last when expansion is disabled, to avoid a
1957 spurious warning over ranges involving 64-bit modular types.
1959 2018-07-31 Arnaud Charlet <charlet@adacore.com>
1961 * einfo.adb (Write_Entity_Flags): Also print
1962 Is_Activation_Record flag.
1964 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
1966 * exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb,
1967 repinfo.adb, sem_ch9.adb: Minor replace Ekind membership tests
1968 with a wrapper routine.
1970 2018-07-31 Piotr Trojanek <trojanek@adacore.com>
1972 * ali.adb (Known_ALI_Lines): Remove 'F' as a prefix for lines
1973 related to the FORMAL analysis done by GNATprove.
1975 2018-07-31 Javier Miranda <miranda@adacore.com>
1977 * sem.ads (Inside_Preanalysis_Without_Freezing): New global
1979 * sem.adb (Semantics): This subprogram has now the
1980 responsibility of resetting the counter before analyzing a unit,
1981 and restoring its previous value before returning.
1982 * freeze.adb (Freeze_Entity): Do not freeze if we are
1983 preanalyzing without freezing.
1984 * sem_res.adb (Preanalyze_And_Resolve): Set & restore
1985 In_Preanalysis_Without_Freezing.
1987 2018-07-31 Ed Schonberg <schonberg@adacore.com>
1989 * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
1990 may rename a matching class-wide operation only if the renaming
1991 declaration for that actual is in an enclosing scope (i.e.
1992 within the corrresponding instance).
1994 2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
1996 * checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
1997 exp_disp.adb, make.adb, sem_ch4.adb, sem_eval.adb, sem_res.adb,
1998 usage.adb: Minor reformatting.
2000 2018-07-31 Bob Duff <duff@adacore.com>
2002 * sem_res.adb (Resolve_Allocator): Do not complain about the
2003 implicit allocator that occurs in the expansion of a return
2004 statement for a build-in-place function.
2006 2018-07-20 Martin Sebor <msebor@redhat.com>
2009 * gcc-interface/misc.c (gnat_handle_option): Change function argument
2012 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
2014 * gcc-interface/decl.c (choices_to_gnu): Rename parameters. Deal with
2015 an operand of Character type. Factor out range generation to the end.
2016 Check that the bounds are literals and convert them to the type of the
2017 operand before building the ranges.
2018 * gcc-interface/utils.c (make_dummy_type): Minor tweak.
2019 (make_packable_type): Propagate TYPE_DEBUG_TYPE.
2020 (maybe_pad_type): Likewise.
2022 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2024 * sem_ch4.adb (Try_Object_Operation): Handle properly a prefixed call
2025 in an instance, when the generic parameters include an interface type
2026 and a abstract operation of that type, and the actuals in the instance
2027 include an interface type and a corresponding abstract operation of it,
2028 with a different name than the corresponding generic subprogram
2031 2018-07-17 Arnaud Charlet <charlet@adacore.com>
2033 * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
2036 2018-07-17 Arnaud Charlet <charlet@adacore.com>
2038 * checks.adb (Apply_Division_Check): Add provision for floating-point
2041 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2043 * exp_aggr.adb (Component_OK_For_Backend): If an array component of the
2044 enclosing record has a bound that is out of range (and that has been
2045 rewritten as a raise statement) the aggregate is not OK for any back
2046 end, and should be expanded into individual assignments.
2048 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2050 * atree.adb (Relocate_Node): Simplify with Is_Rewrite_Substitution.
2052 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2054 * sem_util.ads (Denotes_Same_Object): Likewise.
2055 * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix RM rule references.
2057 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
2059 * exp_disp.adb (Make_Tags): When the type has user-defined primitives,
2060 build the access type that is later used by Build_Get_Prim_Op_Address
2061 as pointing to a subtype of Ada.Tags.Address_Array.
2063 2018-07-17 Patrick Bernardi <bernardi@adacore.com>
2065 * libgnat/s-memory__mingw.adb: Remove.
2066 * Makefile.rtl: Remove s-memory.adb target pair from the Cygwin/Mingw32
2069 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2071 * frontend.adb (Frontend): The removal of ignored Ghost code must be
2072 the last semantic operation performed on the tree.
2074 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2076 * frontend.adb (Frontend): Update the call to Register_Config_Switches.
2077 * inline.ads: Add new component Config_Switches to record
2078 Pending_Body_Info which captures the configuration state of the pending
2079 body. Remove components Version, Version_Pragma, SPARK_Mode, and
2080 SPARK_Mode_Pragma from record Pending_Body_Info because they are
2081 already captured in component Config_Switches.
2082 * opt.adb (Register_Opt_Config_Switches): Rename to
2083 Register_Config_Switches.
2084 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
2085 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
2086 routine is now a function, and returns the saved configuration state as
2087 an aggregate to avoid missing an attribute.
2088 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
2089 * opt.ads (Register_Opt_Config_Switches): Rename to
2090 Register_Config_Switches.
2091 (Restore_Opt_Config_Switches): Rename to Restore_Config_Switches.
2092 (Save_Opt_Config_Switches): Rename to Save_Config_Switches. This
2093 routine is now a function.
2094 (Set_Opt_Config_Switches): Rename to Set_Config_Switches.
2095 * par.adb (Par): Update the calls to configuration switch-related
2097 * sem.adb (Semantics): Update the calls to configuration switch-related
2099 * sem_ch10.adb (Analyze_Package_Body_Stub): Update the calls to
2100 configuration switch-related subprograms.
2101 (Analyze_Protected_Body_Stub): Update the calls to configuration
2102 switch-related subprograms.
2103 (Analyze_Subprogram_Body_Stub): Update calls to configuration
2104 switch-related subprograms.
2105 * sem_ch12.adb (Add_Pending_Instantiation): Update the capture of
2106 pending instantiation attributes.
2107 (Inline_Instance_Body): Update the capture of pending instantiation
2108 attributes. It is no longer needed to explicitly manipulate the SPARK
2110 (Instantiate_Package_Body): Update the restoration of the context
2112 (Instantiate_Subprogram_Body): Update the restoration of context
2114 (Load_Parent_Of_Generic): Update the capture of pending instantiation
2116 (Set_Instance_Env): Update the way relevant configuration attributes
2117 are saved and restored.
2119 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
2121 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
2122 more rvalues in the expression of a renaming.
2124 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
2126 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Define for
2128 (TYPE_RETURN_UNCONSTRAINED_P): Likewise.
2129 (TYPE_CI_CO_LIST): Likewise.
2130 * gcc-interface/gigi.h (is_cplusplus_method): Delete.
2131 (fntype_same_flags_p): Adjust comment.
2132 * gcc-interface/decl.c (Has_Thiscall_Convention): Delete.
2133 (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not set the "thiscall"
2135 (is_cplusplus_method): Make static and adjust head comment.
2136 (gnat_to_gnu_param): Return a pointer for the "this" parameter of
2138 (gnat_to_gnu_subprog_type): Turn imported C++ constructors into their
2139 callable form. Generate a METHOD_TYPE node for imported C++ methods.
2140 Set param_list at the very end of the processing.
2141 (substitute_in_type) <METHOD_TYPE>: New case.
2142 * gcc-interface/misc.c (gnat_print_type) <METHOD_TYPE>: Likewise.
2143 (gnat_type_hash_eq): Accept METHOD_TYPE.
2144 * gcc-interface/trans.c (Identifier_to_gnu): Deal with METHOD_TYPE.
2145 (Attribute_to_gnu): Likewise.
2146 (Call_to_gnu): Likewise.
2147 (process_freeze_entity): Likewise.
2148 * gcc-interface/utils.c (create_subprog_decl): Adjust head comment.
2149 (fntype_same_flags_p): Likewise.
2151 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2153 * inline.adb (Expand_Inlined_Call): Remove extra parentheses.
2155 2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
2157 * exp_disp.adb (Gen_Parameters_Profile): Make the _Init parameter an
2159 (Set_CPP_Constructors): Adjust comment accordingly.
2161 2018-07-17 Bob Duff <duff@adacore.com>
2163 * exp_disp.adb (Build_Class_Wide_Check): Return early if the
2164 precondition is supposed to be ignored.
2166 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2168 * sem_ch6.adb (Check_Untagged_Equality): Extend check to operations
2169 declared in the same scope as the operand type, when that scope is a
2172 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2174 * exp_unst.adb (Unnest_Subprograms): Do nothing if the expander is not
2175 active. Don't use Get_Actual_Subtype for record subtypes. Ignore
2176 rewritten identifiers and uplevel references to bounds of types that
2177 come from the original type reference.
2179 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2181 * exp_ch13.adb, exp_ch7.adb, exp_unst.adb, freeze.adb,
2182 libgnat/s-os_lib.adb, sem_ch3.adb, sem_ch3.ads, sem_ch5.adb,
2183 sem_eval.adb, sem_res.adb, sem_util.adb: Minor reformatting.
2185 2018-07-17 Javier Miranda <miranda@adacore.com>
2187 * exp_ch13.adb (Expand_N_Freeze_Entity): Handle subtype declared for an
2189 * freeze.adb (Freeze_Expression): Handle freeze of an entity defined
2190 outside of a subprogram body. This case was previously handled during
2191 preanalysis; the frozen entities were remembered and left pending until
2192 we continued freezeing entities outside of the subprogram. Now, when
2193 climbing the parents chain to locate the correct placement for the
2194 freezeing node, we check if the entity can be frozen and only when no
2195 enclosing node is marked as Must_Not_Freeze the entity is frozen.
2196 * sem_ch3.ads (Preanalyze_Default_Expression): Declaration moved to the
2198 * sem_ch3.adb (Preanalyze_Default_Expression): Code adjusted to invoke
2199 the new subprogram Preanalyze_With_Freezing_And_Resolve.
2200 * sem_ch6.adb (Preanalyze_Formal_Expression): New subprogram.
2201 (Analyze_Expression_Function, Process_Formals): Invoke
2202 Preanalyze_Formal_Expression instead of Preanalyze_Spec_Expression
2203 since the analysis of the formals may freeze entities.
2204 (Analyze_Subprogram_Body_Helper): Skip building the body of the
2205 class-wide clone for eliminated subprograms.
2206 * sem_res.ads, sem_res.adb (Preanalyze_And_Resolve): New subprogram.
2207 Its code is basically the previous version of this routine but extended
2208 with an additional parameter which is used to specify if during
2209 preanalysis we are allowed to freeze entities. If the new parameter is
2210 True then the subtree root node is marked as Must_Not_Freeze and no
2211 entities are frozen during preanalysis.
2212 (Preanalyze_And_Resolve): Invokes the internal version of
2213 Preanalyze_And_Resolve without entity freezing.
2214 (Preanalyze_With_Freezing_And_Resolve): Invokes the internal version of
2215 Prenalyze_And_Resolve with freezing enabled.
2217 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2219 * einfo.ads, libgnat/g-comlin.ads: Minor change "ie" to "i.e." in docs
2222 2018-07-17 Justin Squirek <squirek@adacore.com>
2224 * libgnat/s-os_lib.adb (Argument_String_To_List): Fix trimming of
2227 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2229 * sem_prag.adb (Has_Visible_State): Do not consider constants as
2230 visible state because it is not possible to determine whether a
2231 constant depends on variable input.
2232 (Propagate_Part_Of): Add comment clarifying the behavior with respect
2235 2018-07-17 Yannick Moy <moy@adacore.com>
2237 * gnat1drv.adb (Gnat1drv): Do not issue warning about exception not
2238 being propagated in GNATprove mode.
2240 2018-07-17 Dmitriy Anisimkov <anisimko@adacore.com>
2242 * libgnat/g-socket.adb, libgnat/g-socket.ads: Reorganize and make
2243 public components of Inet_Addr_Type. Introduce public binary
2246 2018-07-17 Javier Miranda <miranda@adacore.com>
2248 * exp_ch7.adb (Make_Transient_Block): When determining whether an
2249 enclosing scope already handles the secondary stack, take into account
2250 transient blocks nested in a block that do not manage the secondary
2251 stack and are located within a loop.
2253 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2255 * sem_util.adb (Enclosing_Subprogram): Protected entries and task
2256 entries must be treated separately: task entries are within the
2257 enclosing subprogram of the task type, while protected entries are
2258 transformed into the corresponding Protected_Body_Subprogram, which is
2259 the enclosing_subprogram of any subprogram declared within the entry
2262 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2264 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add missing
2265 sections on -gnatH and -gnatJ compiler switches.
2266 * gnat_ugn.texi: Regenerate.
2268 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2270 * alloc.ads: Update the allocation metrics of the ignored Ghost nodes
2272 * atree.adb: Add a soft link for a procedure which is invoked whenever
2273 an ignored Ghost node or entity is created.
2274 (Change_Node): Preserve relevant attributes which come from the Flags
2276 (Mark_New_Ghost_Node): Record a newly created ignored Ghost node or
2278 (Rewrite): Preserve relevant attributes which come from the Flags
2280 (Set_Ignored_Ghost_Recording_Proc): New routine.
2281 * atree.ads: Define an access-to-suprogram type for a soft link which
2282 records a newly created ignored Ghost node or entity.
2283 (Set_Ignored_Ghost_Recording_Proc): New routine.
2284 * ghost.adb: Remove with and use clause for Lib. Remove table
2285 Ignored_Ghost_Units. Add new table Ignored_Ghost_Nodes.
2286 (Add_Ignored_Ghost_Unit): Removed.
2287 (Initialize): Initialize the table which stores ignored Ghost nodes.
2288 Set the soft link which allows Atree.Mark_New_Ghost_Node to record an
2290 (Is_Ignored_Ghost_Unit): Use the ultimate original node when checking
2291 an eliminated ignored Ghost unit.
2292 (Lock): Release and lock the table which stores ignored Ghost nodes.
2293 (Mark_And_Set_Ghost_Assignment): Record rather than propagate ignored
2295 (Mark_And_Set_Ghost_Procedure_Call): Record rather than propagate
2296 ignored Ghost nodes.
2297 (Mark_Ghost_Clause): Record rather than propagate ignored Ghost nodes.
2298 (Mark_Ghost_Declaration_Or_Body): Record rather than propagate ignored
2300 (Mark_Ghost_Pragma): Record rather than propagate ignored Ghost nodes.
2301 (Propagate_Ignored_Ghost_Code): Removed.
2302 (Record_Ignored_Ghost_Node): New routine.
2303 (Remove_Ignored_Ghost_Code): Reimplemented.
2304 (Remove_Ignored_Ghost_Node): New routine.
2305 (Ultimate_Original_Node): New routine.
2306 * ghost.ads (Check_Ghost_Completion): Removed.
2307 * sem_ch8.adb (Analyze_Use_Package): Remove obsolete code. Mark a use
2308 package clause as ignored Ghost if applicable.
2309 * sem_util.adb (Is_Body_Or_Package_Declaration): Reimplemented.
2311 2018-07-17 Javier Miranda <miranda@adacore.com>
2313 * sem_ch5.adb (Has_Call_Using_Secondary_Stack): Moved to library level
2315 (Analyze_Loop_Statement): Wrap the loop in a block when the evaluation
2316 of the loop iterator relies on the secondary stack.
2318 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2320 * sem_util.adb (Next_Actual): If the parent is a N_Null_Statement,
2321 which happens for inlined calls, then fetch the next actual from the
2324 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2326 * einfo.ads: Update documentation for Scalar_Range.
2328 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2330 * lib-xref-spark_specific.adb (Create_Heap): Attach the HEAP entity to
2331 the Standard package.
2333 2018-07-17 Piotr Trojanek <trojanek@adacore.com>
2335 * einfo.adb (Is_Wrapper_Package): Remove extra parentheses.
2337 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2339 * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and
2340 synchronized types that are completions of limited types or private
2342 (Scope_Within): Handle properly accept statements in task bodies.
2344 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2346 * sem_prag.adb (Has_Visible_State): Do not consider generic formals
2347 because they are not part of the visible state space. Add constants to
2348 the list of acceptable visible states.
2349 (Propagate_Part_Of): Do not consider generic formals when propagating
2350 the Part_Of indicator.
2351 * sem_util.adb (Entity_Of): Do not follow renaming chains which go
2352 through a generic formal because they are not visible for SPARK
2354 * sem_util.ads (Entity_Of): Update the comment on usage.
2356 2018-07-17 Ed Schonberg <schonberg@adacore.com>
2358 * sem_util.adb (Gather_Components): A discriminant of an ancestor may
2359 have been constrained by a later ancestor, so when looking for the
2360 value of that hidden discriminant we must examine the stored constraint
2361 of other ancestors than the immediate parent type.
2363 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
2365 * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
2366 constructs and entities within receive new entities when replicating a
2368 (Expand_N_Extended_Return_Statement): Ensure that scoping constructs
2369 and entities within receive new entities when replicating a tree.
2370 * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
2371 (Visit_Entity): Visit entities within scoping constructs inside
2372 expression with actions nodes when requested by the caller. Add blocks,
2373 labels, and procedures to the list of entities which need replication.
2374 * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
2375 the comment on usage.
2377 2018-07-17 Arnaud Charlet <charlet@adacore.com>
2379 * doc/gnat_ugn/about_this_guide.rst,
2380 doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov.
2381 * gnat_ugn.texi: Regenerate.
2383 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2385 * contracts.adb (Analyze_Contracts): Add specialized processing for
2386 package instantiation contracts.
2387 (Analyze_Package_Contract): Remove the verification of a missing
2389 (Analyze_Package_Instantiation_Contract): New routine.
2390 * contracts.ads (Analyze_Package_Contract): Update the comment on
2392 * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the
2393 instance is being examined when trying to determine whether a package
2394 instantiation needs a Part_Of indicator.
2396 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2398 * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb,
2399 sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb,
2400 sem_util.adb: Minor reformatting.
2402 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2404 * frontend.adb: Only unnest subprograms if no previous errors were
2407 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2409 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
2410 contain blocks in the elaboration code for a package body. Create the
2411 elaboration subprogram wrapper only if there is a subprogram
2412 declaration in a block or loop.
2414 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2416 * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a
2417 deep copy of the left operand when building each conjuct of the
2418 expanded membership operation, to avoid sharing nodes between them.
2419 This sharing interferes with the unnesting machinery and is generally
2422 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2424 * exp_unst.adb (Visit_Node): Handle 'Address references that are
2427 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2429 * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
2430 in relevant nodes: Allocate, Free, and return statements.
2432 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2434 * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an
2435 instance that carries an aspect Default_Storage_Pool that overrides a
2436 default storage pool that applies to the generic unit. The aspect in
2437 the generic unit was removed before copying it in the instance, rather
2438 than removing it from the copy of the aspects that are appended to the
2439 aspects in the instance.
2441 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2443 * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on
2445 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram
2447 * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an
2448 entry body to be the corresponding generated subprogram, for correct
2449 analysis of uplevel references.
2450 * exp_unst.adb (Visit_Node): Handle properly binary and unary operators
2451 Ignore pragmas, fix component associations.
2452 (Register_Subprograms): Subprograms in synchronized types must be
2453 treated as reachable.
2455 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2457 * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated
2458 states and variables.
2460 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2462 * sinfo.ads, sinfo.adb (Withed_Body): Remove.
2463 (Set_Withed_Body): Remove.
2465 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2467 * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
2468 when printing debug info.
2470 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2472 * sem.adb (Walk_Library_Items): Reuse local constant.
2473 (Is_Subunit_Of_Main): Turn condition to positive and flip the
2474 IF-THEN-ELSE branches; avoid potentially ineffective assignment to the
2477 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2479 * sem.adb (Walk_Library_Items): Deconstruct dead code.
2481 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2483 * exp_ch4.adb (Expand_N_Op_Xor): Use common routine
2484 Expand_Nonbinary_Modular_Op. Needed for unnesting.
2486 2018-07-16 Ed Schonberg <schonberg@adacore.com>
2488 * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a
2489 static predicate (for example True) but has no
2490 static_discrete_predicate.
2492 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2494 * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with
2495 class-wide types and record extensions.
2497 2018-07-16 Justin Squirek <squirek@adacore.com>
2499 * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding
2500 checks on expanded literals within if and case expressions.
2502 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2504 * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate
2505 longest sequence factor. Code clean up.
2506 (Wide_Wide_String_To_String): Use the appropriate longest sequence
2507 factor. Code clean up.
2509 2018-07-16 Javier Miranda <miranda@adacore.com>
2511 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
2512 on Bit_Order when defined for a record extension.
2514 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2516 * libgnat/s-objrea.ads: Minor code clean up.
2518 2018-07-16 Piotr Trojanek <trojanek@adacore.com>
2520 * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM
2523 2018-07-16 Arnaud Charlet <charlet@adacore.com>
2525 * adaint.c (__gnat_set_file_time_name): Code clean up.
2527 2018-07-16 Javier Miranda <miranda@adacore.com>
2529 * inline.adb (Build_Body_To_Inline): Minor code reorganization that
2530 ensures that calls to function Has_Single_Return() pass a decorated
2532 (Has_Single_Return.Check_Return): Peform checks on entities (instead on
2533 relying on their characters).
2535 2018-07-16 Javier Miranda <miranda@adacore.com>
2537 * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
2538 to avoid generating an ill-formed tree that confuses gnatprove causing
2541 2018-07-16 Yannick Moy <moy@adacore.com>
2543 * inline.adb (Has_Single_Return): Rewrap comment.
2545 2018-07-16 Eric Botcazou <ebotcazou@adacore.com>
2547 * einfo.ads: Minor tweak in comment.
2549 2018-07-16 Javier Miranda <miranda@adacore.com>
2551 * sem_ch4.adb (Analyze_Membership_Op): Code cleanup.
2553 2018-07-16 Javier Miranda <miranda@adacore.com>
2555 * exp_attr.adb (Expand_N_Attribute_Reference ['Count]): Do not
2556 transform 'Count into a function call if the current scope has been
2559 2018-07-16 Javier Miranda <miranda@adacore.com>
2561 * sem_util.ads, sem_util.adb (Has_Prefix): Move this function to the
2562 public part of this package.
2564 2018-07-16 Yannick Moy <moy@adacore.com>
2566 * sem_res.adb (Resolve_Call): Do not inline calls inside
2567 compiler-generated functions translated as predicates in GNATprove.
2569 2018-07-16 Gary Dismukes <dismukes@adacore.com>
2571 * exp_ch4.adb (Expand_N_Allocator): Test for Storage_Pool being RTE in
2572 addition to the existing test for no Storage_Pool as a condition
2573 enabling generation of the call to Check_Standard_Allocator when the
2574 restriction No_Standard_Allocators_After_Elaboration is active.
2575 * libgnat/s-elaall.ads (Check_Standard_Allocator): Correct comment to
2576 say that Storage_Error will be raised (rather than Program_Error).
2577 * libgnat/s-elaall.adb (Check_Standard_Allocator): Raise Storage_Error
2578 rather than Program_Error when Elaboration_In_Progress is False.
2580 2018-07-16 Gary Dismukes <dismukes@adacore.com>
2582 * sem_eval.adb: Fix spelling for compile-time-known.
2584 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com>
2586 * sem_eval.adb (Compile_Time_Known_Value): Add a guard which prevents
2587 the compiler from entering infinite recursion when trying to determine
2588 whether a deferred constant has a compile time known value, and the
2589 initialization expression of the constant is a reference to the
2592 2018-07-16 Nicolas Roche <roche@adacore.com>
2594 * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth
2595 factor from 1/32 to 1/2 for Unbounded_String.
2597 2018-07-13 Eric Botcazou <ebotcazou@adacore.com>
2599 * gcc-interface/lang.opt (funsigned-char): New option.
2600 * gcc-interface/misc.c (gnat_handle_option): Accept it.
2601 * gcc-interface/utils.c (finish_character_type): Tweak comment.
2603 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2605 * gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
2606 variable and use it throughout.
2607 <E_Variable>: If the nominal subtype of the object is unconstrained,
2608 compute the Ada size separately and put in on the padding type if the
2610 <E_Record_Type>: Minor tweak.
2611 * gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
2612 into max_size_unit throughout.
2614 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2616 * gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
2617 * gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
2618 * gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
2619 (add_decl_expr): Change type of second parameter and rename it.
2620 (renaming_from_instantiation_p): New function moved from...
2621 (set_expr_location_from_node): Test for exceptions here and add one
2622 for actual subtypes built for unconstrained composite actuals.
2623 * gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
2625 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2627 * gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
2628 and adjust recursive calls.
2629 (Identifier_to_gnu): Adjust calls to lvalue_required_p.
2630 (gnat_to_gnu): Likewise.
2632 2018-07-07 Eric Botcazou <ebotcazou@adacore.com>
2634 * gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
2635 (gnat_to_gnu_subprog_type): New pure_flag local variable. Set it for
2636 a pure Ada function with a by-ref In parameter. Propagate it onto the
2637 function type by means of the TYPE_QUAL_RESTRICT flag.
2638 * gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
2639 function type has the TYPE_QUAL_RESTRICT flag set.
2641 2018-07-06 Jim Wilson <jimw@sifive.com>
2643 * Makefile.rtl: Add riscv*-linux* support.
2644 * libgnarl/s-linux__riscv.ads: New.
2645 * libgnat/system-linux-riscv.ads: New.
2647 * Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
2648 (einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
2649 * gcc-interface/Makefile.in (xoscons): Likewise.
2651 2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
2653 * libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
2654 (ZCX_By_Default): Set to True.
2656 2018-07-02 Martin Liska <mliska@suse.cz>
2658 * gnatvsn.ads: Bump Library_Version to 9.
2660 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2662 * gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
2663 using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
2664 (TYPE_ALIGN_OK): Move around.
2665 (TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
2666 * gcc-interface/decl.c (change_qualified_type): Move to...
2667 (gnat_to_gnu_entity): Adjust comment.
2668 * gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
2669 (ceil_pow2): Use ceil_log2.
2670 * gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
2671 and do not set TREE_SIDE_EFFECTS.
2672 (handle_noreturn_attribute): Use change_qualified_type.
2674 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2676 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
2677 the expression of a dispatch table that is not being defined.
2678 <E_Record_Subtype>: Remove obsolete kludge.
2680 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2682 * gcc-interface/decl.c (warn_on_field_placement): Use specific wording
2684 (warn_on_list_placement): New static function.
2685 (components_to_record): Use it to warn on multiple fields in list.
2687 2018-06-12 Eric Botcazou <ebotcazou@adacore.com>
2689 * gcc-interface/decl.c (variant_desc): Add AUX field.
2690 (gnat_to_gnu_entity) <discrete_type>: Do not call compute_record_mode
2692 (reverse_sort_field_list): New static function.
2693 (components_to_record): Place the variant part at the beginning of the
2694 field list when there is an obvious order of increasing position.
2695 (build_variant_list): Initialize it.
2696 (create_variant_part_from): Do not call compute_record_mode directly.
2697 (copy_and_substitute_in_layout): Likewise. Always sort the fields with
2698 fixed position in order of increasing position, in the record and all
2699 the variants, in any. Call reverse_sort_field_list.
2700 * gcc-interface/utils.c (make_packable_type): Compute the sizes before
2701 calling finish_record_type. Do not call compute_record_mode directly.
2702 (finish_record_type): Overhaul final processing depending on REP_LEVEL
2703 and call finish_bitfield_layout if it is equal to one or two.
2705 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2707 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
2708 existing fields of a dummy fat pointer type, if any. Clear the
2709 TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.
2711 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2713 * contracts.adb (Process_Body_Postconditions): Expand only checked
2715 (Process_Contract_Cases_For): Expand only checked contract cases.
2716 (Process_Inherited_Preconditions): Ignored class-wide preconditions are
2717 partially expanded because some of their semantic checks are tied to
2719 (Process_Preconditions_For): Expand only checked preconditions.
2720 (Process_Spec_Postconditions): Expand only checked preconditions.
2721 Ignored class-wide preconditions are partially expanded because some of
2722 their semantic checks are tied to the expansion.
2723 * exp_prag.adb (Expand_N_Pragma): Suppress the expansion of ignored
2725 * exp_util.adb (Add_Inherited_Invariants): Code clean up.
2726 * sem_util.adb (Propagate_Invariant_Attributes): Code clean up.
2728 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2730 * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb,
2731 libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb,
2732 libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor
2735 2018-06-11 Gary Dismukes <dismukes@adacore.com>
2737 * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting.
2739 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2741 * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call): Do
2742 not add any actuals when the size of the object is known, and the
2743 caller will allocate it.
2744 (Build_Heap_Allocator): Rename to Build_Heap_Or_Pool_Allocator to
2745 better illustrate its functionality. Update the comment on the
2746 generated code. Generate a branch for the heap and pool cases where
2747 the object is not necessarity controlled.
2748 (Expand_N_Extended_Return_Statement): Expand the extended return
2749 statement into four branches depending the requested mode if the caller
2750 will not allocate the object on its side.
2751 (Make_Build_In_Place_Call_In_Allocator): Do not allocate a controlled
2752 object on the caller side because this will violate the semantics of
2753 finalizable types. Instead notify the function to allocate the object
2754 on the heap or a user-defined storage pool.
2755 (Needs_BIP_Alloc_Form): A build-in-place function needs to be notified
2756 which of the four modes to employ when returning a limited controlled
2758 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove a redundant
2759 guard which is already covered in Needs_Finalization.
2761 2018-06-11 Olivier Hainque <hainque@adacore.com>
2763 * libgnat/s-excmac*.ads: Factorize Unwind_Action definitions ...
2764 * libgnat/a-exexpr.adb: ... Here, then add comments describing the
2765 major datastructures associated with the current exception raised.
2766 (Setup_Current_Excep): Accept a "Phase" argument conveying the
2767 unwinding phase during which this subprogram is called. For an Ada
2768 exception, don't update the current exception buffer from the raised
2769 exception object during SEARCH_PHASE, as this is redundant with the
2770 call now issued just before propagation starts.
2771 (Propagate_GCC_Exception): Move call to Setup_Current_Excep ahead of
2772 the unwinding start, conveying Phase 0.
2773 (Unhandled_Except_Handler): Pass UA_CLEANUP_PHASE as the Phase value on
2774 the call to Setup_Current_Excep.
2775 * raise-gcc.c (personality_body): Pass uw_phases as the Phase argument
2776 on calls to Setup_Current_Excep.
2778 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2780 * exp_unst.ads, exp_unst.adb (Needs_Fat_Pointer,
2781 Build_Access_Type_Decl): New subprograms to handle uplevel references
2782 to formals of an unconstrained array type. The activation record
2783 component for these is an access type, and the reference is rewritten
2784 as an explicit derefenrence of that component.
2786 2018-06-11 Bob Duff <duff@adacore.com>
2788 * libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
2789 libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
2790 (Element): Add code to detect dangling cursors in some cases.
2792 2018-06-11 Yannick Moy <moy@adacore.com>
2794 * sem_ch6.adb (Build_Subprogram_Declaration): Mark parameters as coming
2797 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2799 * sem_ch13.adb (Build_Predicate_Functions): For a derived type, ensure
2800 that its parent is already frozen so that its predicate function, if
2801 any, has already been constructed.
2803 2018-06-11 Yannick Moy <moy@adacore.com>
2805 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Adapt for
2806 possible task unit as the enclosing context.
2808 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2810 * gnat1drv.adb: Remove use clause for Repinfo.
2811 (Gnat1drv): Beef up comment about the interplay between -gnatc and
2812 back-end annotations. Use full qualified name for List_Rep_Info.
2814 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2816 * libgnat/g-arrspl.ads: Add pragma Preelaborate.
2818 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2820 * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
2821 then" and general logical "ada" in codepeer mode.
2823 2018-06-11 Javier Miranda <miranda@adacore.com>
2825 * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
2826 N_Call_Marker nodes.
2828 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2830 * exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
2833 2018-06-11 Yannick Moy <moy@adacore.com>
2835 * doc/gnat_rm/implementation_defined_pragmas.rst: Add Suppressible
2836 argument to Assertion_Policy
2837 * gnat_rm.texi: Regenerate.
2839 2018-06-11 Yannick Moy <moy@adacore.com>
2841 * gnat1drv.adb: Do not check representation information in CodePeer and
2842 GNATprove modes, as these modes call a special backend instead of gigi,
2843 so do not have the information.
2845 2018-06-11 Yannick Moy <moy@adacore.com>
2847 * inline.adb (Build_Body_To_Inline): Consider case of extended return
2848 of unconstrained type as one case where inlining is not supported.
2849 (Expand_Inlined_Call): Remove special case for body as extended return
2850 of unconstrained type.
2852 2018-06-11 Yannick Moy <moy@adacore.com>
2854 * sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
2856 (Check_Missing_Part_Of): Do not force Part_Of on generic unit.
2858 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
2860 * sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
2861 expressions in Pre/Post contracts while in GNATprove_Mode.
2863 2018-06-11 Piotr Trojanek <trojanek@adacore.com>
2865 * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
2866 with AND THEN expressions broken down into individual conjuncts.
2868 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2870 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
2872 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2874 * exp_unst.adb (Visit_Node): Skip generic associations.
2876 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2878 * libgnat/memtrack.adb (fwrite): Remove second definition.
2880 2018-06-11 Javier Miranda <miranda@adacore.com>
2882 * sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
2883 (Is_Static_Coextension): Adding documentation.
2884 * sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
2885 (Is_Static_Coextension): Extending the assertion.
2886 * sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
2887 setting flag Is_Dynamic_Coextension (and vice versa).
2889 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2891 * exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
2892 level of a compilation unit, becuase they may contain nested
2893 subprograms that need an activation record.
2895 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2897 * Makefile.rtl: Compile Ada files with $(ADAC) instead of $(CC).
2899 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2901 * exp_ch11.adb, exp_unst.adb, inline.adb, sem_ch12.adb, sem_util.adb:
2903 * sinfo.ads: Fix a typo.
2905 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2907 * inline.adb (Expand_Inlined_Call): If no optimization level is
2908 specified, the expansion of a call to an Inline_Always function is
2909 fully performed in the front-end even on a target that support back-end
2912 2018-06-11 Arnaud Charlet <charlet@adacore.com>
2914 * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
2915 with Sec_Stack_Used.
2917 2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
2919 * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
2920 Is_Assignment_LHS further in. Use predicate
2921 Needs_Variable_Reference_Marker to determine whether to create a
2923 (Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
2924 in. Use predicate Needs_Variable_Reference_Marker to determine whether
2925 to create a variable marker.
2926 * sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
2927 checks that determine whether the identifier or expanded name is a
2928 suitable variable reference. The checks are now performed by
2929 Needs_Variable_Reference_Marker.
2930 * sem_res.adb (Resolve_Actuals): Use predicate
2931 Needs_Variable_Reference_Marker to determine whether to create a
2933 * sem_util.adb (Needs_Variable_Reference_Marker): New routine.
2934 * sem_util.ads (Needs_Variable_Reference_Marker): New routine.
2936 2018-06-11 Valentine Reboul <reboul@adacore.com>
2938 * doc/gnat_rm.rst, doc/gnat_ugn.rst: Rename "GPL Edition" into
2939 "Community Edition".
2941 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2943 * sem_ch12.adb (Install_Body): In order to determine the placement of
2944 the freeze node for an instance of a generic nested within another
2945 instance, take into account that the outer instance may be declared in
2946 the visible part of a package and the inner intance may be in the
2947 private part of the same package.
2949 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2951 * errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
2953 2018-06-11 Nicolas Roche <roche@adacore.com>
2955 * libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
2956 stack overflow while raising a constraint error.
2958 2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
2960 * repinfo.ads (Rep_Value): Use a single line.
2961 * repinfo.adb (Rep_Value): Likewise.
2962 (List_Attr): Do not use string concatenation.
2964 2018-06-11 Ed Schonberg <schonberg@adacore.com>
2966 * exp_unst.adb (Visit_Node): Check reference to formal parameter of
2967 current procedure, because the bounds of its type may be uplevel
2970 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
2972 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
2973 not a definition, retrieve the expression only if it's a compile-time
2974 known value if we are just annotating types.
2976 * gcc-interface/utils.c (convert): Do not try to upcast properly for a
2977 conversion between tagged types in type_annotate_only mode.
2979 2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
2981 * gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
2982 * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
2983 type built for an aliased component with variable size.
2985 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2987 * doc/gnat_ugn/project-manager-figure.png: Delete.
2989 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2991 * vxworks-arm-link.spec, vxworks-e500-link.spec,
2992 vxworks-gnat-crtbe-link.spec, vxworks-smp-arm-link.spec,
2993 vxworks-smp-e500-link.spec, vxworks-smp-ppc-link.spec,
2994 vxworks-smp-x86-link.spec: New files.
2996 2018-05-31 Pierre-Marie de Rodat <derodat@adacore.com>
2998 * gnatvsn.adb: Re-center the copyright header.
2999 * indepsw-darwin.adb: Adjust the starting copyright year to 2011.
3001 2018-05-31 Fedor Rybin <frybin@adacore.com>
3003 * doc/gnat_ugn/gnat_utility_programs.rst: Document Stubs_Subdir in
3004 gnattest section on user guide.
3006 2018-05-31 Ed Schonberg <schonberg@adacore.com>
3008 * sem_res.adb (Resolve_String_Literal): If the type is a string type
3009 whose component subtype has a static predicate, ensure that the
3010 predicate is applied to each character by expanding the string into the
3011 equivalent aggregate. This is also done if the component subtype is
3014 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
3016 * gcc-interface/trans.c (Call_to_gnu): Remove obsolete code.
3018 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
3020 * sem_ch6.adb (Check_Missing_Return): Handle procedures with no
3023 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
3025 * gcc-interface/trans.c (Call_to_gnu): In the by-reference case, if
3026 the type of the parameter is an unconstrained array type, convert
3027 to the type of the actual before the type of the formal only if the
3028 conversion was suppressed earlier. Use in_param and gnu_actual_type
3029 local variables throughout, and uniform spelling for In Out or Out.
3030 Also remove dead code in the component-by-reference case.
3032 2018-05-31 Frederic Konrad <konrad@adacore.com>
3034 * tracebak.c (STOP_FRAME): Harden condition.
3035 (is_return_from, EXTRA_STOP_CONDITION): New helpers for VxWorks in RTP
3038 2018-05-31 Ed Schonberg <schonberg@adacore.com>
3040 * checks.adb (Apply_Discriminant_Check): Do not apply discriminant
3041 check to a call to a build-in-place function, given that the return
3042 object is limited and cannot be copied.
3044 2018-05-31 Olivier Hainque <hainque@adacore.com>
3046 * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange
3049 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
3051 * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
3052 there is no target, also create a temporary for the return value for
3053 an allocator if the type is an unconstrained record type with default
3056 2018-05-31 Hristian Kirtchev <kirtchev@adacore.com>
3058 * exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
3059 boudary for a transient scope.
3061 2018-05-31 Valentine Reboul <reboul@adacore.com>
3063 * gnatvsn.ads: Rename "GPL" version to "Community".
3065 2018-05-31 Ed Schonberg <schonberg@adacore.com>
3067 * einfo.ads: Improve documentation for the Is_Unsigned_Type entity
3070 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
3072 * sem_prag.adb (Analyze_Pragma): Replace call to Unique_Defining_Entity
3073 with a semantically equivalent call to Defining_Entity.
3075 2018-05-31 Piotr Trojanek <trojanek@adacore.com>
3077 * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten
3078 Max_Queue_Length expression.
3080 2018-05-31 Sergey Rybin <rybin@adacore.com>
3082 * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need
3083 that the main unit to be built before the call, now it computes the
3084 closure of the main unit itself.
3085 * gnat_ugn.texi: Regenerate.
3087 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
3089 * repinfo.adb (List_Structural_Record_Layout): Set First to false
3090 after having listed the fields of the parent type, if any.
3092 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
3094 * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
3095 deal with the ___XP suffix for packed array types here...
3096 <E_Array_Subtype>: ...or here when processing the implementation type
3097 but when processing the original type instead. Do not reuse the DECL
3098 of the implementation type for the original type. Tidy up.
3100 2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
3102 * einfo.ads (Object_Size_Clause): Declare.
3103 * einfo.adb (Object_Size_Clause): New function.
3104 * gcc-interface/utils.c (maybe_pad_type): Test Has_Size_Clause before
3105 retrieving Size_Clause and post the warning on the object size clause
3106 if Has_Object_Size_Clause is true.
3108 2018-05-31 Javier Miranda <miranda@adacore.com>
3110 * sem_util.ads, sem_util.adb (Find_Primitive_Eq): New subprogram.
3111 * exp_ch4.adb (Expand_Composite_Equality): Use the new subprogram
3112 Find_Primitive_Eq to search for the primitive of types whose underlying
3113 type is a tagged type.
3115 2018-05-31 Yannick Moy <moy@adacore.com>
3117 * sem_prag.adb (Analyze_Pragma.Check_Loop_Pragma_Placement): Inverse
3118 order of treatment between nodes recognized as loop pragmas (or
3119 generated from one) and block statements.
3121 2018-05-31 Doug Rupp <rupp@adacore.com>
3123 * libgnat/s-osprim__posix2008.adb (Clock): Implement using
3126 2018-05-31 Ed Schonberg <schonberg@adacore.com>
3128 * exp_unst.ads, exp_unst.adb (In_Synchronized_Unit): New predicate to
3129 mark subprograms that cannot be eliminated because they must be treated
3130 as reachable from outside the current unit. This includes entry bodies
3131 and protected operations.
3133 2018-05-31 Ed Schonberg <schonberg@adacore.com>
3135 * exp_ch4.adb (Expand_Modular_Addition, Expand_Modular_Subtraction):
3136 Convert all operands of the generated code to Standard.Unsigned, to
3137 prevent spurious visibility errors. This is needed when the generated
3138 expansion involves a modular index type of an array type, and the index
3139 type is not immediately visible.
3141 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
3143 * einfo.ads (Package_Instantiation): Update comment after a routine
3144 that uses this field has been renamed.
3146 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3148 * exp_ch11.adb (Replace_Raise_By_Goto): The transfomation is legal even
3149 if the local raise statement includes a string expression. This
3150 expression might be picked up by an outer handler or discarded, but
3151 plays no role in this transformation.
3153 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3155 * exp_aggr.adb, exp_unst.adb, freeze.adb, libgnat/a-direct.adb: Minor
3158 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3160 * exp_unst.adb (Visit_Node): Handle the semantic Procedure_To_Call
3161 field in relevant nodes: Allocate, Free, and return statements.
3163 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3165 * exp_unst.adb (Visit_Node): Do not traverse a Component_Association
3166 that has not been analyzed, as will be the case for a nested aggregate
3167 that is expanded into individual assignments.
3169 2018-05-30 Justin Squirek <squirek@adacore.com>
3171 * aspects.adb, aspects.ads: Register new aspect.
3172 * par-prag.adb (Prag): Register new pragma.
3173 * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for new
3174 aspect similar to Aspect_Max_Queue_Length.
3175 * sem_prag.adb, sem_prag.ads (Analyze_Pragma): Register new pragma and
3176 set it to use the same processing as Pragma_Max_Queue_Length.
3177 * snames.ads-tmpl: Move definition of Name_Max_Entry_Queue_Depth so
3178 that it can be processed as a pragma in addition to a restriction and
3179 add an entry for the pragma itself.
3181 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3183 * freeze.adb (Freeze_Object_Declaration): A pragma Thread_Local_Storage
3184 is now legal on a variable of composite type initialized with an
3185 aggregate that is fully static and requires no elaboration code.
3186 * exp_aggr.adb (Convert_To_Positional): Recognize additional cases of
3187 nested aggregates that are compile-time static, so they can be used to
3188 initialize variables declared with Threqd_Local_Storage.
3189 * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation on
3190 Thread_Local_Storage.
3191 * gnat_rm.texi: Regenerate.
3193 2018-05-30 Yannick Moy <moy@adacore.com>
3195 * sem_util.adb (Policy_In_Effect): Take into account CodePeer and
3198 2018-05-30 Justin Squirek <squirek@adacore.com>
3200 * libgnat/a-direct.adb, libgnat/a-direct.ads (Name_Case_Equivalence):
3202 (Start_Search): Modify to use Start_Search_Internal
3203 (Start_Search_Internal): Add to break out an extra flag for searching
3204 case insensative due to the potential for directories within the same
3205 OS to allow different casing schemes.
3206 * sysdep.c (__gnat_name_case_equivalence): Add as a default fallback
3207 for when the more precise solution fails.
3209 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3211 * checks.adb, exp_ch5.adb, exp_ch7.adb, exp_unst.adb, sem_eval.adb:
3214 2018-05-30 Pascal Obry <obry@adacore.com>
3216 * libgnat/g-comlin.ads (Value_Callback, Define_Switch): New.
3217 * libgnat/g-comlin.adb: Add corresponding implementation.
3219 2018-05-30 Gary Dismukes <dismukes@adacore.com>
3221 * sem_res.adb, sem_util.adb: Fix several typos.
3223 2018-05-30 Olivier Hainque <hainque@adacore.com>
3225 * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
3226 (eh_registration_ctors, eh_registration_tors): New static variables,
3227 forced in a .ctors/.dtors section, respectively, with priority.
3229 2018-05-30 Bob Duff <duff@adacore.com>
3231 * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
3232 freeze.adb, inline.adb, lib-xref.adb, sem.ads, sem_aggr.adb,
3233 sem_attr.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb,
3234 sem_ch8.adb, sem_dim.adb, sem_elab.adb, sem_res.adb, sem_res.ads,
3235 sinfo.ads: Spell preanalysis, preanalyze correctly.
3237 2018-05-30 Bob Duff <duff@adacore.com>
3239 * libgnat/g-sestin.ads: Rework documentation comments.
3241 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
3243 * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb,
3244 sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb
3245 (Has_Original_Node): Refactor to use Is_Rewrite_Substitution.
3247 2018-05-30 Piotr Trojanek <trojanek@adacore.com>
3249 * sem_prag.adb (Analyze_Pragma): Remove conjuncts that are always true.
3251 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3253 * sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
3254 in a separate routine.
3255 (Is_Atomic_Object_Entity): New routine.
3256 (Is_Atomic_Prefix): Cleaned up.
3257 (Is_Synchronized_Object): Check that the object is atomic, or its type
3259 (Object_Has_Atomic_Components): Removed.
3260 * sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
3261 (Is_Atomic_Object_Entity): New routine.
3263 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3265 * sem_ch3.adb (Access_Subprogram_Declaration): The flag
3266 Needs_Activation_Record is only needed on a subprogram type, not on a
3268 * sem_res.adb (Resolve_Selected_Component): If the context type and the
3269 component type are anonymous access to subprograms, use the component
3270 type to obtain the proper value of Needs_Activation_Record flag for the
3273 2018-05-30 Eric Botcazou <ebotcazou@adacore.com>
3275 * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Add
3276 comment about the memset case.
3278 2018-05-30 Bob Duff <duff@adacore.com>
3280 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove the code
3281 to analyze the Elmt_Decl, because it gets analyzed in the wrong scope.
3282 We need to analyze it as part of analyzing the block, so that if the
3283 call to Element that initializes Elmt_Decl returns on the secondary
3284 stack, the block will ss_mark/ss_release. This block is inside the
3285 loop; we don't want to leak memory until the loop exits. The purpose
3286 of analyzing Elmt_Decl first was to catch the error of modifying it,
3287 which is illegal because it's a loop parameter. The above causes us to
3288 miss that error. Therefore, we add a flag Is_Loop_Parameter, and set
3289 it on the Element entity, so we end up with an E_Variable node with the
3291 * einfo.ads, einfo.adb (Is_Loop_Parameter): New flag.
3292 * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Give the "assignment to loop
3293 parameter not allowed" error if Is_Loop_Parameter.
3294 * sem_util.adb (Is_Variable): Return False if Is_Loop_Parameter, to
3295 trigger the call to Diagnose_Non_Variable_Lhs.
3297 2018-05-30 Arnaud Charlet <charlet@adacore.com>
3299 * checks.adb (Apply_Scalar_Range_Check):
3300 * sem_eval.adb (Check_Non_Static_Context, Out_Of_Range): Ignore out of
3301 range values for System.Priority in CodePeer mode since the actual
3302 target compiler may provide a wider range.
3304 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3306 * exp_unst.adb: Search specification of main unit as well, for
3309 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3311 * exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
3312 a package body that is a compilation unit may contain blocks that
3313 declare local subprograms. In Subprogram_Unnesting Mode such
3314 subprograms must be handled as nested inside the (implicit) elaboration
3315 procedure that executes that statement part. To handle properly uplevel
3316 references we construct that subprogram explicitly, to contain blocks
3317 and inner subprograms, The statement part of the compilation unit
3318 becomes a call to this subprogram. This is only done if blocks are
3319 present in the statement list of the body.
3321 2018-05-30 Bob Duff <duff@adacore.com>
3323 * exp_ch7.adb: Minor comment fix.
3325 2018-05-30 Ed Schonberg <schonberg@adacore.com>
3327 * exp_unst.adb (Visit_Node): Handle properly subprogram instantiations
3328 that have no corresponding body and appear as attributes of the
3329 corresponding wrapper package declaration.
3330 (Register_Subprogram): New subprogram, used for subprogram bodies and
3331 for subprogram instantiations to enter callable entity into Subp table.
3333 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3335 * libgnat/s-secsta.adb: Reimplement the secondary stack support.
3336 * libgnat/s-secsta.ads: Update the documentation of all routines in the
3337 public part of the package. Reimplement the private part of the
3338 package to account for the new secondary stack structure. Add types
3339 and subprograms for testing purposes. Add several documentation
3342 2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
3344 * exp_aggr.adb, exp_ch3.adb, exp_ch4.adb, exp_ch7.adb, exp_unst.adb,
3345 exp_util.adb, exp_util.ads, libgnat/a-calcon.adb, libgnat/a-calcon.ads,
3346 libgnat/s-os_lib.adb, repinfo.adb, sem_ch3.adb, sem_disp.adb,
3347 sem_disp.ads, sem_util.adb: Minor reformatting.
3349 2018-05-30 Arnaud Charlet <charlet@adacore.com>
3351 * gcc-interface/Makefile.in: Move special flags for Ada runtime files
3353 * Makefile.rtl: ... to here. Update comments. Protect call to
3354 "GCC_FOR_TARGET" in case target_os isn't defined.
3356 2018-05-30 Arnaud Charlet <charlet@adacore.com>
3358 * gcc-interface/Makefile.in: Move target pair settings from here...
3359 * Makefile.rtl: ... to here.
3360 (setup-rts): New target.
3362 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3364 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
3365 List of All Switches): Replace "modules" with "units".
3366 (Subprogram Inlining Control): Likewise.
3367 * gnat_ugn.texi: Regenerate.
3368 * usage.adb (Usage): Fix description of -gnatn switch.
3370 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3372 * gcc-interface/Makefile.in: Fix typos.
3374 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3376 * exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
3377 the finalizer procedure in the At_End handler, for use in LLVM
3380 2018-05-29 Javier Miranda <miranda@adacore.com>
3382 * exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
3383 subprogram Inherits_From_Tagged_Full_View to identify more reliably
3384 untagged private types completed with a derivation of an untagged
3385 private whose full view is a tagged type.
3386 * sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
3388 (Collect_Primitive_Operations): Handle untagged private types completed
3389 with a derivation of an untagged private type whose full view is a
3390 tagged type. In such case, collecting the list of primitives we may
3391 find two equality primitives: one associated with the untagged private
3392 and another associated with the ultimate tagged type (and we must
3393 remove from the returned list this latter one).
3395 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3397 * exp_unst.adb (Visit_Node): Handle statement sequences that include an
3400 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3402 * repinfo.adb (List_Entities): Also recurse into blocks without label.
3404 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3406 * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
3407 exceptions if subprogram unnesting is in effect, because these branch
3408 nodes are relevant only in the presence of nested subprograms.
3410 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3412 * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error
3413 unconditionally when applied to the largest positive (resp. largest
3414 negative) value of a floating-point type.
3416 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3418 * einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
3419 discriminants and exceptions are never components of such. The flag
3420 Needs_Activation_Record is set on subprogram types, not on access to
3423 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3425 * sem_ch3.adb: Set scope of component of subtype.
3427 2018-05-29 Ed Schonberg <schonberg@adacore.com>
3429 * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
3430 carry no type. Such selected components appear in unit names that are
3431 child units, both in the specification and possibly in an end label for
3432 the unit, and they do not contain any relevant uplevel references.
3434 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3436 * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
3439 2018-05-29 Olivier Hainque <hainque@adacore.com>
3441 * libgnat/system-vxworks7-ppc-rtp.ads: New file.
3442 * libgnat/system-vxworks7-ppc-kernel.ads: New file.
3443 * libgnat/system-vxworks7-e500-rtp.ads: New file.
3444 * libgnat/system-vxworks7-e500-kernel.ads: New file.
3445 * libgnat/system-vxworks7-x86-rtp.ads: New file.
3446 * libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
3447 * libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
3448 gnat-crtbe link spec to use the vx7 variant.
3450 2018-05-29 Olivier Hainque <hainque@adacore.com>
3452 * vx_crtbegin.inc: Use a consistent naming convention for the
3453 registration/deregistration functions across RTP or kernel. Remove the
3454 ctor/dtor attribute setting based on RTP/kernel, expect the optional
3455 attribute extension to be provided by includers instead.
3456 * vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
3457 extension for the registration/deregistration functions.
3458 * vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
3459 constructor/destructor attribute extensions.
3460 * vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
3461 attribute extensions and declare _ctors/_dtors arrays.
3462 * vx_crtbegin_auto.c: Remove.
3463 * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
3464 vxworks7-gnat-crtbe-link.spec.
3465 * libgnat/system-vxworks7-aarch64.ads: Likewise.
3466 * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
3467 * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
3468 * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
3469 * libgnat/system-vxworks7-x86-kernel.ads: Likewise.
3470 * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
3471 * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
3472 * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
3474 2018-05-29 Piotr Trojanek <trojanek@adacore.com>
3476 * ali.adb: Minor reformatting.
3478 2018-05-29 Joel Brobecker <brobecker@adacore.com>
3480 * doc/gnat_ugn/platform_specific_information.rst: Update package
3481 requirements for 32bit GNAT on x86_64-linux.
3482 * gnat_ugn.texi: Regenerate.
3484 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3486 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
3487 Control): Adjust description of -gnatRj.
3488 * gnat_ugn.texi: Regenerate.
3489 * opt.ads (List_Representation_Info_To_JSON): Likewise.
3490 * repinfo.adb (List_Rep_Info): Do not automatically create a file
3491 if List_Representation_Info_To_JSON is true.
3492 * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
3493 check between -gnatRj and -gnatRs.
3494 * usage.adb (Usage): Adjust description of -gnatRj.
3496 2018-05-29 Pascal Obry <obry@adacore.com>
3498 * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
3501 2018-05-29 Pascal Obry <obry@adacore.com>
3503 * libgnat/s-os_lib.adb: Minor reformatting.
3505 2018-05-29 Doug Rupp <rupp@adacore.com>
3507 * libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
3508 * libgnat/a-calend.ads (Epoch_Offset): to private part of spec
3509 * libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
3510 * libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.
3512 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3514 * repinfo.ads (JSON format): Document new pair for components.
3515 * repinfo.adb (Derived_Discriminant): New function.
3516 (List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
3517 in recursive calls. If the record type is the parent of an extension,
3518 find and list the derived discriminant from the extension, if any.
3519 (List_Component_Layout): List the Discriminant_Number in JSON mode.
3520 (List_Record_Info): Adjust call to List_Structural_Record_Layout.
3522 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3524 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
3525 List of All Switches): Document -gnatRj.
3526 (Debugging Control): Likewise.
3527 * gnat_ugn.texi: Regenerate.
3528 * opt.ads (List_Representation_Info_To_JSON): New boolean variable.
3529 * osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
3530 extension if List_Representation_Info_To_JSON is true.
3531 * repinfo.ads: Document the JSON output format.
3532 * repinfo.adb (List_Location): New procedure.
3533 (List_Array_Info): Add support for JSON output.
3534 (List_Entities): Likewise.
3537 (Print_Expr): Likewise.
3538 (List_Linker_Section): Likewise.
3539 (List_Mechanisms): Likewise.
3540 (List_Name): Likewise.
3541 (List_Object_Info): Likewise.
3542 (List_Record_Info): Likewise.
3543 (List_Component_Layout): Likewise. Add Indent parameter.
3544 (List_Structural_Record_Layout): New procedure.
3545 (List_Attr): Add support for JSON output.
3546 (List_Type_Info): Likewise.
3547 (Write_Unknown_Val): Likewise.
3548 * switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
3549 * usage.adb (Usage): List -gnatRj.
3551 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3553 * repinfo.adb (List_Component_Layout): New procedure extracted from...
3554 (List_Record_Layout): ...here. Invoke it.
3556 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3558 * repinfo.adb (Write_Unknown_Val): New procedure.
3559 (List_GCC_Expression): Call it.
3560 (List_Record_Layout): Likewise.
3561 (Write_Val): Likewise.
3563 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3565 * exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
3568 2018-05-29 Arnaud Charlet <charlet@adacore.com>
3570 * lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
3571 This breaks build of cross compilers with older versions of GNAT, so
3574 2018-05-29 Doug Rupp <rupp@adacore.com>
3576 * libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
3579 2018-05-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3581 * exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.
3583 2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
3585 * repinfo.adb (List_Entities): Do not list the Linker_Section for
3587 (List_Mechanisms): ...but here instead. Use consistent name output
3588 and formatting conventions.
3590 2018-05-29 Bob Duff <duff@adacore.com>
3592 * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
3594 * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
3595 To_Mixed): New functions.
3596 * osint.adb: Cleanup: use Is_Directory_Separator, which correctly
3597 allows both '\' and '/' on Windows.
3599 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3601 * repinfo.ads: Minor fixes and tweaks in comments.
3603 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3605 * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
3606 it with calls to Unop.
3608 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3610 * repinfo.ads (TCode): Adjust range.
3611 (Truth_Andif_Expr): Remove.
3612 (Truth_Orif_Expr): Likewise.
3613 (Truth_And_Expr .. Dynamic_Val): Adjust value.
3614 * repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
3615 (Rep_Value): Likewise.
3616 * repinfo.h (Truth_Andif_Expr): Remove.
3617 (Truth_Orif_Expr): Likewise.
3618 (Truth_And_Expr .. Dynamic_Val): Adjust value.
3619 * gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
3620 through to TRUTH_AND_EXPR case.
3621 <TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.
3623 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3625 * exp_unst.adb (Visit_Node): For indexed components and attribute
3626 references, examine index expressions or associated expressions as well
3627 to record uplevel references.
3628 (Vist_Node): For function and procedure calls, if a formal is an
3629 unconstrained array and the actual is constrained, check whether bounds
3630 of actual have uplevel references.
3632 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3634 * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
3635 they can appear as components of activation records.
3636 * exp_unst.adb (Visit_Node): A reference to an exception may be an
3639 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3641 * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
3642 depends on a discriminant manually instead of using the predicate
3643 Size_Depends_On_Discriminant in the array type case.
3645 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3647 * exp_unst.adb (Check_Static_Type): For a record subtype, check
3648 discriminant constraints as well.
3649 (Visit_Node): For a selected component, check type of prefix, as is
3650 done for indexed components and slices.
3652 2018-05-28 Javier Miranda <miranda@adacore.com>
3654 * exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
3655 value when converting a float value to a fixed-point value. This is
3656 required for CCG because it handles fixed-point types by means of
3657 unsigned integer type variables. The range check is now performed using
3658 the integer value stored in this temporary.
3660 2018-05-28 Yannick Moy <moy@adacore.com>
3662 * sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
3663 Length as valid non-interfering contexts for SPARK.
3665 2018-05-28 Claire Dross <dross@adacore.com>
3667 * sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
3668 generic inheritance utilities.
3669 (Generic_Inherited_Subprograms): Generic version of
3670 Inherited_Subprograms, generic in Find_Dispatching_Type function.
3671 (Generic_Is_Overriding_Subprogram): Generic version of
3672 Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
3673 (Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
3674 Sem_Disp.Find_Dispatching_Type.
3675 (Is_Overriding_Subprogram): Instance of
3676 Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
3677 (Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
3678 with Sem_Disp.Find_Dispatching_Type.
3680 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3682 * exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
3683 component type, do not expand array equality using the unconstrained
3684 base type, except for the case where the bounds of the type depend on a
3687 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3689 * einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
3690 access-to-subprogram types, to indicate that an indirect call through
3691 such a type requires an activation record when compiling for LLVM.
3692 * sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.
3694 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3696 * exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
3697 when bounds of fixed type are static, to remove some spuerfluous
3698 implicit conversions and provide an accurate result when converting
3699 back and forth between the fixed point type and a floating point type.
3701 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3703 * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
3706 2018-05-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3708 * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
3709 replaced, if any; all callers changed.
3710 (Note_Uplevel_Ref): Likewise. Also replace reference to deferred
3711 constant with private view so we take the address of that entity.
3712 (Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
3713 any; all callers changed. Handle N_Indexed_Component like
3714 N_Attribute_Reference. Add N_Type_Conversion case.
3715 (Visit_Node): Indexed references can be uplevel if the type isn't
3717 (Unnest_Subprograms): Don't rewrite if no reference given. If call has
3718 been relocated, set first_named pointer in original node as well.
3720 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3722 * exp_aggr.adb (Flatten): Copy tree of expression in a component
3723 association with a range or a set of discrete choices, rather than
3724 relocating the node. This avoids inconsistencies in the tree when
3725 handling nested subprograms with uplevel references for LLVM.
3727 2018-05-28 Arnaud Charlet <charlet@adacore.com>
3729 * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
3732 2018-05-28 Arnaud Charlet <charlet@adacore.com>
3734 * exp_unst.adb: Fix typo.
3736 2018-05-28 Bob Duff <duff@adacore.com>
3738 * libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
3739 unnecessary use of 'Unrestricted_Access.
3741 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3743 * repinfo.adb (Expr_Value_S): New routine.
3744 (List_Linker_Section): Properly extract the value of the section
3747 2018-05-28 Patrick Bernardi <bernardi@adacore.com>
3749 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
3750 description of the -D binder switch to reflect current usage.
3751 * gnat_ugn.texi: Regenerate.
3753 2018-05-28 Gary Dismukes <dismukes@adacore.com>
3755 * exp_ch3.adb: Minor reformatting
3757 2018-05-28 Justin Squirek <squirek@adacore.com>
3760 (Build_Initialization_Call): Add logic to pass the appropriate actual to match
3762 (Init_Formals): Add new formal *_skip_null_excluding_check
3763 * exp_util.adb, exp_util.ads
3764 (Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
3766 (Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
3767 (Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
3768 used to determine how to generate an Init_Proc for a given type.
3769 (Needs_Constant_Address): Minor reformatting
3771 (Resolve_Null): Add logic to generate a conditional check in certain cases
3773 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3775 * exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
3778 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com>
3780 * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
3781 the declarations of single concurrent types because they fall in the
3782 category of full type and object declarations.
3784 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3786 * repinfo.adb (Compute_Max_Length): Skip _Parent component.
3787 (List_Record_Layout): Likewise.
3789 2018-05-28 Ed Schonberg <schonberg@adacore.com>
3791 * sem_util.adb (Is_Function_Result): Add a warning if a postcondition
3792 includes a call to function to which it applies. This may mean an
3793 omission of an attribute reference 'Result, in particular if the
3794 function is pqrameterless.
3796 2018-05-28 Justin Squirek <squirek@adacore.com>
3798 * sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
3799 misresolved package name is not a case of mistaken identity.
3801 2018-05-28 Yannick Moy <moy@adacore.com>
3803 * sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
3804 GNATprove mode, as the order of resolution (low then high) means that
3805 all the information is not available when resolving the low bound the
3808 2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
3810 * repinfo.adb (List_Array_Info): Start with an explicit blank line and
3811 end with the linker section, if any.
3812 (List_Entities): Do not output the linker section for record types,
3813 array types and variables.
3814 (Print_Expr): Factor out common processing for unary operators and
3815 special values. Adjust and reorder the various cases.
3816 (List_Object_Info): End with the linker section, if any.
3817 (List_Record_Info): Likewise.
3818 (List_Type_Info): Do not start with a blank line.
3820 2018-05-25 Nicolas Roche <roche@adacore.com>
3822 * libgnat/s-valrea.adb (Scan_Real): Abort computation once it is sure
3823 that the result will be either -infinite or +infinite.
3825 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
3827 * libgnat/s-parame.ads, libgnat/s-parame__vxworks.ads,
3828 libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads (Size_Type):
3829 Expand range of type to match the address space of the target.
3830 (Task_Storage_Size): Remove unused type.
3832 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3834 * sem_res.adb (Set_Mixed_Mode_Operand): If the operand is an expression
3835 of a fixed point type and the parent is a multiplying operation,
3836 resolve the operand with its own type because the context will impose a
3837 resulting type on the result of the multiplication by means of
3838 approriate conversion.
3840 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3842 * exp_ch3.adb (Default_Initialize_Object): Ensure that the analysis of
3843 the in-place initialization aggregate created for pragmas
3844 Initialize_Scalars or Normalize_Scalars is performed with checks
3847 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3849 * exp_aggr.adb (Convert_To_Positional): Bump default for
3850 Max_Others_Replicate to 32. Update comments.
3851 * osint.ads (Unknown_Attributes): No longer pretend this is a constant.
3852 (No_File_Info_Cache): Initialize separately.
3853 * osint.adb (No_File_Info_Cache): Update initializer.
3855 2018-05-25 Javier Miranda <miranda@adacore.com>
3857 * sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
3858 test when the left operand is a class-wide interface and the right
3859 operand is not a class-wide type.
3860 * exp_ch4.adb (Tagged_Membership): Adding support for interface as the
3863 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3865 * exp_aggr.adb (Flatten): A quantified expression cannot be duplicated
3866 in an others clause to prevent visibility issues with the generated
3868 (Component_OK_For_Backend): Return false for a quantified expression.
3869 (Check_Static_Component): Ditto.
3871 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3873 * libgnat/s-secsta.adb (SS_Allocate): Reimplemented.
3874 (SS_Allocate_Dynamic): New routine. The allocation logic is now split
3875 into three distring cases rather than in one loop which attempts to
3876 handle all three cases. This rewrite eliminates an issue where the last
3877 frame of the stack cannot be freed, thus causing the memory range of a
3878 new frame to approach the overflow point of the memory index type.
3879 Since the overflow is logically treated as a
3880 too-much-memory-on-the-stack scenario, it causes a bogus Storage_Error.
3881 (SS_Allocate_Static): New routine. The routine factorizes the static
3882 secondary stack-related code from the former SS_Allocate.
3884 2018-05-25 Sergey Rybin <rybin@adacore.com>
3886 * doc/gnat_ugn/gnat_and_program_execution.rst: Add description of '-U'
3887 option for gnatelim.
3889 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3891 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not create
3892 Class_Wide_Clone_Body when analyzing a subprogram_body_stub: the clone
3893 is created when the proper body of the stub is analyzed.
3894 * sem_util.adb (ZBuild_Class_Wide_Clone_Body): If the subprogram body
3895 is the proper body of a subunit, the cloned body must be inserted in
3896 the declarative list that contains the stub.
3898 2018-05-25 Justin Squirek <squirek@adacore.com>
3900 * exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
3901 generate code for 6.5(8-10) so that we don't get an assertion error
3902 when dealing with an incomplete return type.
3904 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3906 * pprint.adb (Expression_Name): Strip too long expressions to avoid
3907 carrying very large strings.
3909 2018-05-25 Patrick Bernardi <bernardi@adacore.com>
3911 * switch-b.adb (Scan_Binder_Switches): binder switch -Q accepts Natural
3914 2018-05-25 Doug Rupp <rupp@adacore.com>
3916 * tracebak.c (aarch64-linux): Implement.
3918 2018-05-25 Justin Squirek <squirek@adacore.com>
3920 * sem_ch8.adb: Minor reformatting.
3922 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
3924 * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
3927 2018-05-25 Hristian Kirtchev <kirtchev@adacore.com>
3929 * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
3930 pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
3933 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3935 * sem_ch12.adb (Instance_Exists): New function, subsidiary of
3936 Validate_Derived_Type_Instance, to verify that all interfaces
3937 implemented by the formal type are also implemented by the actual. The
3938 verification is complicated when an interface of the formal is declared
3939 in a generic unit and the actual is declared in an instance of it.
3940 There is currently no mechanism to relate an interface declared within
3941 a generic to the corresponding interface in an instance, so we must
3942 traverse the list of interfaces of the actual, looking for a name
3943 match, and verifying that that interface is declared in an instance.
3945 2018-05-25 Piotr Trojanek <trojanek@adacore.com>
3947 * sem_util.adb (Iterate_Call_Parameters): Rewrite with extra
3948 assertions; replace function versions of Next_Formal/Next_Actual with
3949 their procedural versions (which are more concise).
3951 2018-05-25 Doug Rupp <rupp@adacore.com>
3953 * libgnarl/s-osinte__aix.ads, libgnarl/s-osinte__android.ads,
3954 libgnarl/s-osinte__darwin.ads, libgnarl/s-osinte__freebsd.ads,
3955 libgnarl/s-osinte__hpux.ads, libgnarl/s-osinte__kfreebsd-gnu.ads,
3956 libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__lynxos178e.ads,
3957 libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads
3958 (Relative_Timed_Wait): Remove.
3959 * libgnarl/s-tpopmo.adb (Timed_Sleep, Timed_Delay): Rewrite to allow
3960 for incremental looping. Remove references to Rel_Time and
3961 Relative_Timed_Wait.
3962 * libgnat/s-osprim__posix.adb, libgnat/s-osprim__posix2008.adb
3963 (Timed_Delay): Make separate.
3964 * libgnat/s-optide.adb: New separate procedure.
3965 * libgnat/s-osprim.ads (Max_System_Delay): New constant.
3966 * libgnat/s-osprim__lynxos.ads (Max_Sensible_Delay): Set to 6 months.
3967 (Max_System_Delay): New constant.
3969 2018-05-25 Ed Schonberg <schonberg@adacore.com>
3971 * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
3972 for a formal derived type implements all the interfaces declared for
3975 2018-05-25 Yannick Moy <moy@adacore.com>
3977 * sem_prag.adb (Check_Applicable_Policy): Deal specially with CodePeer
3978 and GNATprove modes when applicable policy is Ignore.
3980 2018-05-25 Eric Botcazou <ebotcazou@adacore.com>
3982 * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a
3983 boolean type with convention C.
3984 * libgnat/i-cexten.ads (bool): Change to boolean with convention C.
3985 * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable
3986 FOREIGN and use it throughout the function.
3987 <E_Enumeration_Type>: Set precision 1 on boolean types with foreign
3989 <E_Enumeration_Subtype>: Likewise for subtypes.
3990 <E_Record_Type>: Force the size of a storage unit on empty classes.
3991 * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip
3992 boolean types with precision 1 if the size is the expected one.
3994 2018-05-25 Arnaud Charlet <charlet@adacore.com>
3996 * pprint.adb (Expression_Name): Do not print non ASCII characters.
3998 2018-05-25 Bob Duff <duff@adacore.com>
4000 * libgnat/a-strunb__shared.ads, libgnat/a-stwiun__shared.ads,
4001 libgnat/a-stzunb__shared.ads: (Initialize, Adjust): Add pragma Inline.
4003 2018-05-25 Bob Duff <duff@adacore.com>
4005 * sem_util.ads: Minor comment fix.
4007 2018-05-25 Ed Schonberg <schonberg@adacore.com>
4009 * exp_unst.adb (Visit_Node): Restrict check for uplevel references in
4010 prefixes of array attributes, to prefixes that are entity names whose
4011 type is constrained.
4012 (Note_Uplevel_Bound): Verify that the bound is declared in an enclosing
4013 subprogram, as itype created for loops in pre/postcondition may appear
4014 in loops at the library level.
4016 2018-05-25 Ed Schonberg <schonberg@adacore.com>
4018 * sem_ch13.adb (Build_Predicate_Functions): The predicate function
4019 declaration is inserted into the tree and analyzed at that point, so
4020 should not be reinserted when the body is constructed. Inside a
4021 generic, ensure that the body is not inserted twice in the tree.
4023 2018-05-25 Yannick Moy <moy@adacore.com>
4025 * sem_prag.adb (Check_Grouping): Modify test to ignore statements and
4026 declarations not coming from source.
4028 2018-05-25 Fedor Rybin <frybin@adacore.com>
4030 * doc/gnat_ugn/gnat_utility_programs.rst: Document new switch
4031 --copy-environment for gnattest.
4033 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
4035 * sem_elab.adb (Non_Private_View): Simplify by removing a local Result
4037 * sem_prag.adb (Get_Base_Subprogram): Same as above.
4039 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
4041 * fe.h (Set_Normalized_First_Bit): Declare.
4042 (Set_Normalized_Position): Likewise.
4043 * repinfo.adb (List_Record_Layout): Do not use irregular output for a
4044 variable position. Fix minor spacing issue.
4045 * gcc-interface/decl.c (annotate_rep): If a field has a variable
4046 offset, compute the normalized position and annotate it in addition to
4049 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
4051 * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu):
4052 Constify and rename variables. Fix formatting.
4053 (gnat_to_gnu) <N_Exception_Handler>: Minor tweak.
4054 <N_Raise_Statement>: Likewise.
4056 2018-05-24 Javier Miranda <miranda@adacore.com>
4058 * exp_ch8.adb (Build_Body_For_Renaming): Adding support to build the
4059 body of a variant record equality renaming.
4060 (Expand_N_Subprogram_Renaming_Declaration): Adapt the code to the new
4061 implementation of Build_Body_For_Renaming.
4062 * exp_ch3.ads (Build_Variant_Record_Equality): New library level
4063 function that factorizes the functionality needed by
4064 Build_Body_For_Renaming and Expand_Freeze_Record_Type to build the body
4065 of a variant record equality subprogram.
4066 * exp_ch3.adb (Build_Variant_Record_Equality): New subprogram.
4067 (Build_Variant_Record_Equality): New local procedure of
4068 Expand_Freeze_Record_Type containing all the code specific for freezing
4069 the record type that cannot be place in the new library level function.
4071 2018-05-24 Ed Schonberg <schonberg@adacore.com>
4073 * einfo.ads, einfo.adb (Is_Activation_Record): New flag on
4074 in_parameters, used when unesting subprograms for LLVM, to indicate
4075 that a generated parameter carries the activation record from the
4076 enclosing subprogram.
4077 * exp_unst.adb (Check_Static_Type): Handle array attributes of types
4078 whose bounds may contain up-level references that need to be added to
4079 an activation recoord.
4080 (Add_Extra_Formal): Set Is_Activation_Record on new formal.
4082 2018-05-24 Yannick Moy <moy@adacore.com>
4084 * pprint.adb (Expression_Image): Improve the printing of expressions,
4085 by taking more cases into account, in particular qualified expressions
4086 and aggregates. Also count more the number of parentheses to close
4087 after the expression.
4089 2018-05-24 Javier Miranda <miranda@adacore.com>
4091 * sem_ch3.adb (Is_Visible_Component): For untagged types add missing
4092 check for renamed discriminants.
4093 * sem_ch4.adb (Analyze_Overloaded_Selected_Component,
4094 Analyze_Selected_Component, Check_Misspelled_Selector): For calls to
4095 Is_Visible_Component pass the associated selector node to allow
4096 checking renamed discriminants on untagged types.
4098 2018-05-24 Ed Schonberg <schonberg@adacore.com>
4100 * sem_ch8.adb (Analyze_Use_Type): Do not assign the Prev_Use_Clause
4101 link to a use_type clause if this would cause an infinite loop in the
4102 machinery that detects redundant use clauses. This may happen when the
4103 redundant clauses appear in the context of a child unit and the context
4106 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
4108 * sinfo.ads: Fix grammar in comment.
4110 2018-05-24 Justin Squirek <squirek@adacore.com>
4112 * einfo.ads, einfo.adb (Append_Entity): Modified to use Link_Entities
4113 and manage doubly-linked entity chain.
4114 (Nested_Scenarios): Removed entity field used for optimization during
4115 elaboration to make room for the new field Prev_Entity.
4116 (Link_Entities): Added to replace redundant calls to Set_Next_Entity
4117 and Set_Prev_Entity as well as centralize changes to the entity chain.
4118 (Predicated_Parent): Modified to use Node38.
4119 (Prev_Entity): Added to fetch new node field Prev_Entity in all entity
4121 (Remove_Entity): Moved from sem_util.
4122 (Set_Nested_Scenarios): Deleted.
4123 (Set_Predicated_Parent): Modified to use Node38.
4124 (Set_Prev_Entity): Added to set Prev_Entity field.
4125 (Set_Validated_Object): Modified to use Node38.
4126 (Unlink_Next_Entity): Added to process Prev_Entity when an unlinking
4128 (Validated_Object): Modified to use Node38.
4129 (Write_Field36_Name): Remove Nested_Scenarios, Validated_Object, and
4130 predicated parent cases.
4131 (Write_Field38_Name): Add predicated parent and Validated_Object cases.
4132 * sem_ch3.adb (Process_Subtype): Add guard to protect against
4133 inappropriate marking of Predicated_Parent to non-itype subtypes.
4134 (Make_Class_Wide_Type): Preserve Prev_Entity field and set in new type.
4135 (Copy_And_Swap): Add setting of Prev_Entity.
4136 (Build_derived_Record_Type): Replace Set_Next_Entity w/ Link_Entities.
4137 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Replace Set_Next_Entity
4139 (New_Overloaded_Entity): Remove block created to search for previous
4140 entities in the entity chain with relevant calls to Prev_Entity as well
4141 as replace duplicated code from Remove_Entity_And_Homonym with a call
4143 * sem_ch7.adb (Exchange_Declarations): Replace Set_Next_Entity w/
4145 * sem_elab.adb (Find_And_Process_Nested_Scenarios): Remove global and
4146 initial subprogram declarations related to Nested_Scenarios.
4147 (Process_Nested_Scenarios): Deleted.
4148 (Save_Scenario): Deleted.
4149 (Traverse_Body): Remove optimization for Nested_Scenarios so as to free
4150 node space in the entity tree.
4151 * sem_util.adb, sem_util.ads (Remove_Entity): Moved to einfo.
4152 (Remove_Entity_And_Homonym): Added to separate functionality of
4153 Remove_Entity from the homonym chain directly.
4154 * exp_attr.adb (Expand_N_Attribute_Reference): Replace Set_Next_Entity
4155 w/ Link_Entities and Unlink_Next_Entity.
4156 * exp_ch3.adb (Expand_N_Object_Declaration): Replace Set_Next_Entity w/
4158 * exp_ch6.adb (Replace_Renaming_Declaration_Id): Replace
4159 Set_Next_Entity w/ Link_Entities.
4160 * exp_disp.adb (Expand_Dispatching_Call): Replace Set_Next_Entity w/
4161 Link_Entities and Unlink_Next_Entity.
4162 * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Replace
4163 call to Remove_Entity with its new incarnation.
4164 * exp_util.adb (New_Class_Wide_Subtype): Add setting of Prev_Entity.
4165 * freeze.adb (Freeze_Record_Type): Replace Set_Next_Entity w/
4168 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4170 * sem_ch10.adb (Expand_Limited_With_Clause): Update the call to
4171 Install_Limited_Withed_Unit.
4172 (Expand_With_Clause): Update the call to Install_Withed_Unit.
4173 (Implicit_With_On_Parent): Update the call to Install_Withed_Unit.
4174 (Install_Context_Clauses): Update the call to Install_Withed_Unit.
4175 (Install_Limited_Context_Clauses): Update the calls to
4176 Install_Limited_Withed_Unit.
4177 (Install_Limited_Withed_Unit): Renamed to better illustrate its
4179 (Install_Private_With_Clauses): Update the calls to Install_Withed_Unit
4180 and Install_Limited_Withed_Unit.
4181 (Install_With_Clause): Uninstall a limited with clause if a [private]
4182 with clause is given for the same package.
4183 (Install_Withed_Unit): Renamed to better illustrate its purpose.
4184 (Remove_Limited_With_Unit): New routine.
4186 2018-05-24 Eric Botcazou <ebotcazou@adacore.com>
4188 * raise-gcc.c (__gnat_SEH_error_handler): Remove prototype.
4189 (__gnat_personality_seh0): Adjust and beef up comments, and
4190 fix formatting throughout.
4191 (__gnat_adjust_context): Deal minimally with version 2.
4192 * seh_init.c (__gnat_map_SEH): Fix formatting.
4193 (_gnat_SEH_error_handler): Adjust comments.
4194 (__gnat_install_SEH_handler): Fix formatting.
4196 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4198 * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
4200 2018-05-24 Ed Schonberg <schonberg@adacore.com>
4202 * exp_aggr.adb (Flatten): Add a warning on an others clause in an array
4203 aggregate with static bounds when named associations cover all index
4204 positions and the others clause is redundant.
4206 2018-05-24 Raphael Amiard <amiard@adacore.com>
4208 * libgnat/a-cohama.ads: Add documentation.
4210 2018-05-24 Raphael Amiard <amiard@adacore.com>
4212 * libgnat/a-convec.ads: Add documentation.
4214 2018-05-24 Justin Squirek <squirek@adacore.com>
4216 * exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
4217 expansion for limited tagged types when the node to be expanded is a
4218 raise expression due to it not representing a valid object.
4219 * exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
4220 message regarding assignments to limited types to ignore genereated
4223 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4225 * exp_util.adb (New_Class_Wide_Subtype): Capture and restore relevant
4226 Ghost-related attributes of the class-wide subtype because the copy
4229 2018-05-24 Justin Squirek <squirek@adacore.com>
4231 * sem_res.adb (Resolve_Entity_Name): Add guard to protect against
4232 marking use clauses as effective when the reference appears within
4235 2018-05-24 Cyrille Comar <comar@adacore.com>
4237 * doc/gnat_rm/the_gnat_library.rst: Fix typos.
4238 * gnat_rm.texi: Regenerate.
4240 2018-05-24 Bob Duff <duff@adacore.com>
4242 * exp_ch7.adb (Expand_Cleanup_Actions): Create a mark unconditionally
4243 for build-in-place functions with a caller-unknown-size result.
4244 (Create_Finalizer): For build-in-place functions with a
4245 caller-unknown-size result, check at run time whether we need to
4246 release the secondary stack.
4248 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4250 * sem_prag.adb (Analyze_Pragma): Use the full view of an internally
4251 generated incomplete type.
4253 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4255 * expander.adb (Expand): Update the save and restore of the Ghost
4257 * exp_ch3.adb (Freeze_Type): Likewise.
4258 * exp_disp.adb (Make_DT): Likewise.
4259 * exp_util.adb (Build_DIC_Procedure_Body): Likewise.
4260 (Build_DIC_Procedure_Declaration): Likewise.
4261 (Build_Invariant_Procedure_Body): Likewise.
4262 (Build_Invariant_Procedure_Declaration): Likewise.
4263 (Make_Predicate_Call): Likewise.
4264 * freeze.adb (Add_To_Result): Insert the freeze action of a living
4265 entity prior to the start of the enclosing ignored Ghost region.
4266 (Freeze_Entity): Update the save and restore of the Ghost region.
4267 * ghost.adb (Install_Ghost_Mode): Reimplemented.
4268 (Install_Ghost_Region): New routine.
4269 (Mark_And_Set_Ghost_Assignment): Install a region rather than a mode.
4270 (Mark_And_Set_Ghost_Body): Likewise.
4271 (Mark_And_Set_Ghost_Completion): Likewise.
4272 (Mark_And_Set_Ghost_Declaration): Likewise.
4273 (Mark_And_Set_Ghost_Instantiation): Likewise.
4274 (Mark_And_Set_Ghost_Procedure_Call): Likewise.
4275 (Name_To_Ghost_Mode): New routine.
4276 (Restore_Ghost_Region): New routine.
4277 * ghost.ads (Install_Ghost_Region): New routine.
4278 (Restore_Ghost_Region): New routine.
4279 * opt.ads: Add new global variable Ignored_Ghost_Region.
4280 * rtsfind.adb (Load_RTU): Update the save and restore of the Ghost
4281 region. Install a clean region.
4282 * sem.adb (Analyze): Likewise.
4283 (Do_Analyze): Likewise.
4284 * sem_ch3.adb (Analyze_Object_Declaration): Likewise
4285 (Derive_Progenitor_Subprograms): Use local variable Iface_Alias to
4286 capture the ultimate alias of the current primitive.
4287 (Process_Full_View): Update the save and restore of the Ghost region.
4288 Do not inherit DIC and invariant procedures.
4289 * sem_ch5.adb (Analyze_Assignment): Update the save and restore of the
4291 * sem_ch6.adb (Analyze_Procedure_Call): Likewise.
4292 (Analyze_Subprogram_Body_Helper): Likewise.
4293 * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise.
4294 * sem_ch12.adb (Analyze_Package_Instantiation): Likewise.
4295 (Analyze_Subprogram_Instantiation): Likewise.
4296 (Instantiate_Package_Body): Likewise.
4297 (Instantiate_Subprogram_Body): Likewise.
4298 * sem_ch13.adb (Build_Predicate_Functions): Likewise.
4299 (Build_Predicate_Function_Declaration): Likewise.
4301 (Add_Dispatching_Operation): Do not consider DIC and invariant
4303 (Check_Dispatching_Operation): Use Add_Dispatching_Operation to collect
4304 a dispatching subprogram.
4305 (Check_Operation_From_Private_View): Likewise.
4306 (Override_Dispatching_Operation): Likewise.
4307 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the save
4308 and restore of the Ghost region.
4309 (Analyze_Initial_Condition_In_Decl_Part): Likewise.
4310 (Analyze_Pragma): Update the save and restore of the Ghost region.
4311 (Analyze_Pre_Post_Condition_In_Decl_Part): Likewise.
4312 * sem_util.adb (Is_Suitable_Primitive): New routine.
4313 * sem_util.ads (Is_Suitable_Primitive): New routine.
4314 * sinfo.ads: Update the section of Ghost regions.
4316 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
4318 * doc/gnat_rm/implementation_defined_pragmas.rst (Contract_Cases):
4319 Change "condition" to "case guard" after renaming in the contract
4321 * gnat_rm.texi: Regenerate.
4323 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4325 * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
4326 construct with discrete choices no longer contains a subtype with
4327 predicates since the expansion already handled this case.
4329 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4331 * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
4332 conversion to the return type to avoid a side effect where an imported
4333 relocated function generates a new anonymous access type, whose
4334 accessibility level does not agree with with that of the wrapper.
4336 2018-05-24 Javier Miranda <miranda@adacore.com>
4338 * sem_util.adb (Abstract_Interface_List): Add missing support for
4339 private types whose full view is a synchronized type.
4340 * sem_ch3.adb (Build_Derived_Private_Type): Skip building the full
4341 derivation of a private type parent type is a task type with
4342 discriminants as gigi does not use such type directly.
4344 2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
4346 * sem_elab.adb (Build_Variable_Reference_Marker): Do not create a
4347 variable marker when the reference appears in the formal part of a
4348 compilation unit instance because there is no place to insert it.
4349 (In_Compilation_Instance_Formal_Part): New routine.
4351 2018-05-24 Piotr Trojanek <trojanek@adacore.com>
4353 * layout.ads, repinfo.ads: Fix references to renamed Backend_Layout
4354 configuration parameter.
4356 2018-05-24 Doug Rupp <rupp@adacore.com>
4358 * argv-lynxos178-raven-cert.c: New file.
4359 * libgnat/system-lynxos178-x86.ads: New file.
4361 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4363 * exp_disp.adb, freeze.adb, gnat1drv.adb, sem_ch5.adb, sem_spark.adb:
4364 Minor reformattings.
4366 2018-05-23 Pascal Obry <obry@adacore.com>
4368 * adaint.c (win32_wait): Properly free the handle/pid lists when
4369 WaitForMultipleObjects fails (return WAIT_FAILED).
4371 2018-05-23 Pascal Obry <obry@adacore.com>
4373 * adaint.c (win32_wait): Add missing parentheses.
4375 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4377 * exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
4378 (Expand_N_Object_Declaration): Do not check for a large modular array
4380 * freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
4381 (Freeze_Object_Declaration): Code cleanup. Check for a large modular
4383 * sem_ch3.adb: Minor reformatting.
4385 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4387 * einfo.ads: New attribute on types: Predicated_Parent, to simplify the
4388 retrieval of the applicable predicate function to an itype created for
4389 a constrained array component.
4390 * einfo.adb: Subprograms for Predicated_Parent.
4391 (Predicate_Function): Use new attribute.
4392 * exp_util.adb (Make_Predicate_Call): If the predicate function is not
4393 available for a subtype, retrieve it from the base type, which may have
4394 been frozen after the subtype declaration and not captured by the
4395 subtype declaration.
4396 * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is
4397 legal within a generated initiqlization procedure, as may happen with a
4398 predicate check on a component, when the predicate function applies to
4399 the base type of the component.
4400 * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of
4401 predicates for subtype declarations and for subtype indications in
4403 (Process_Subtype): Likewise. Handle properly the case of a private type
4404 with unknown discriminants whose full view is an unconstrained array.
4405 Use Predicated_Parent to indicate source of predicate function on an
4406 itype whose parent is itself an itype.
4407 (Complete_Private_Subtype): If the private view has unknown
4408 discriminants and the full view is an unconstrained array, set base
4409 type of completion to the full view of parent.
4410 (Inherit_Predicate_Flags): Prevent double assignment of predicate
4412 (Build_Subtype): For a constrained array component, propagate predicate
4413 information from original component type declaration.
4415 2018-05-23 Boris Yakobowski <yakobowski@adacore.com>
4417 * libgnat/a-ngelfu.ads (Arctanh, Arccoth): Fix faulty preconditions.
4419 2018-05-23 Arnaud Charlet <charlet@adacore.com>
4421 * checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
4423 * sem_elab.adb: Make "out" parameters instead of "in out" when
4426 2018-05-23 Bob Duff <duff@adacore.com>
4428 * gnatbind.adb (List_Applicable_Restrictions): Add
4429 No_Implementation_Restrictions to the list of restrictions not to list.
4430 Remove double negative "not No_Restriction_List". Comment the
4431 commentary that is output, so it won't cause errors if used directly in
4434 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4436 * sem_prag.adb (Inherit_Class_Wide_Pre): Refine legality check on
4437 class-wide precondition on a type extension when ancestor does not have
4438 a class-wide precondition. Previously the compiler accepted such a
4439 precondition when the ancestor had a class-wide postcondition.
4441 2018-05-23 Javier Miranda <miranda@adacore.com>
4443 * sem_attr.adb (Valid_Scalars): Do not invoke Error_Attr_P to report
4444 the warning on occurrences of this attribute whose evaluation is always
4445 true (since that subprogram aborts processing the attribute). In
4446 addition, replace the node by its boolean result 'True' (required
4447 because the backend has no knowledge of this attribute).
4449 2018-05-23 Bob Duff <duff@adacore.com>
4451 * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
4452 code in question is not reachable in the case where Count_Type'Last is
4455 2018-05-23 Yannick Moy <moy@adacore.com>
4457 * doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
4458 local pragma Warnings Off without On.
4459 * gnat_rm.texi: Regenerate.
4461 2018-05-23 Olivier Hainque <hainque@adacore.com>
4463 * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate.
4464 * libgnat/g-excact.adb: Implement.
4466 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4468 * sem_ch5.adb (Analyze_Iterator_Specification): If a subtype indication
4469 is present, verify its legality when the domain of iteration is a
4470 GNAT-specific formal container, as is already done for arrays and
4471 predefined containers.
4473 2018-05-23 Yannick Moy <moy@adacore.com>
4475 * sem_util.adb (Enclosing_Declaration): Fix the case of a named number
4476 declaration, which was not taken into account.
4478 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4480 * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on
4481 synchronized suspension.
4482 * rtsfind.ads: Add entries for units Ada.Synchronous_Barriers and
4483 Ada.Synchronous_Task_Control and routines Suspend_Until_True and
4485 * sem_elab.adb: Document switch -gnatd_s.
4486 (In_Task_Body): New routine.
4487 (Is_Potential_Scenario): Code cleanup. Stop the traversal of a task
4488 body when the current construct denotes a synchronous suspension call,
4489 and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s
4491 (Is_Synchronous_Suspension_Call): New routine.
4492 * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch
4495 2018-05-23 Javier Miranda <miranda@adacore.com>
4497 * exp_disp.adb (Make_DT): Restrict the initialization of
4498 External_Tag and Expanded_Name to an empty string to the case where
4499 both pragmas apply (i.e. No_Tagged_Streams and Discard_Names), since
4500 restricted runtimes are compiled with pragma Discard_Names.
4501 * doc/gnat_rm/implementation_defined_pragmas.rst,
4502 doc/gnat_rm/implementation_defined_characteristics.rst: Add
4504 * gnat_rm.texi: Regenerate.
4506 2018-05-23 Maroua Maalej <maalej@adacore.com>
4508 * sem_spark.adb: Fix of some permission rules of pointers in SPARK.
4510 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4512 * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of
4513 iteration of an Ada2012 loop is performed to determine the type of the
4514 domain, but full analysis is performed once the loop is rewritten as a
4515 while-loop during expansion. The pre-analysis suppresses expansion; it
4516 must also suppress the generation of freeze nodes, which may otherwise
4517 appear in the wrong scope before rewritting.
4519 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4521 * sem_elab.adb: Update the section on suppressing elaboration warnings.
4523 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4525 * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate
4526 Is_Elaboration_Target.
4527 (Is_Elaboration_Target): New routine.
4528 (Is_Elaboration_Warnings_OK_Id): Use predicate Is_Elaboration_Target.
4529 (Set_Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration_Target.
4530 (Set_Is_Elaboration_Warnings_OK_Id): Use predicate
4531 Is_Elaboration_Target.
4532 * einfo.ads: Add new synthesized attribute Is_Elaboration_Target along
4533 with occurrences in nodes.
4534 (Is_Elaboration_Target): New routine.
4535 * sem_prag.adb (Analyze_Pragma): Suppress elaboration warnings when an
4536 elaboration target is subject to pragma Warnings (Off, ...).
4538 2018-05-23 Eric Botcazou <ebotcazou@adacore.com>
4540 * repinfo.adb (List_Type_Info): Remove obsolete stuff.
4542 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4544 * einfo.adb: Flag304 is now Is_Elaboration_Warnings_OK_Id.
4545 (Is_Elaboration_Warnings_OK_Id): New routine.
4546 (Set_Is_Elaboration_Warnings_OK_Id): New routine.
4547 (Write_Entity_Flags): Output Flag304.
4548 * einfo.ads: Add new attribute Is_Elaboration_Warnings_OK_Id along with
4549 occurrences in entities.
4550 (Is_Elaboration_Warnings_OK_Id): New routine along with pragma Inline.
4551 (Set_Is_Elaboration_Warnings_OK_Id): New routine along with pragma
4553 * sem_attr.adb (Analyze_Access_Attribute): Capture the state of
4554 elaboration warnings.
4555 * sem_ch3.adb (Analyze_Object_Declaration): Capture the state of
4556 elaboration warnings.
4557 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Capture the
4558 state of elaboration warnings.
4559 (Analyze_Subprogram_Body_Helper): Capture the state of elaboration
4561 (Analyze_Subprogram_Declaration): Capture the state of elaboration
4563 * sem_ch9.adb (Analyze_Entry_Declaration): Capture the state of
4564 elaboration warnings.
4565 (Analyze_Single_Task_Declaration): Capture the state of elaboration
4567 (Analyze_Task_Type_Declaration): Capture the state of elaboration
4569 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture the state
4570 of elaboration warnings.
4571 (Analyze_Generic_Subprogram_Declaration): Capture the state of
4572 elaboration warnings.
4573 * sem_elab.adb: Add a section on suppressing elaboration warnings.
4574 Type Processing_Attributes includes component Suppress_Warnings
4575 intended to suppress any elaboration warnings along a path in the
4576 graph. Update Initial_State to include a value for this component.
4577 Types Target_Attributes and Task_Attriutes include component
4578 Elab_Warnings_OK to indicate whether the target or task has elaboration
4579 warnings enabled. component Elab_Warnings_OK.
4580 (Build_Access_Marker): Propagate attribute
4581 Is_Elaboration_Warnings_OK_Node from the attribute to the generated
4583 (Extract_Instantiation_Attributes): Set the value for Elab_Warnings_OK.
4584 (Extract_Target_Attributes): Set the value for Elab_Warnings_OK.
4585 (Extract_Task_Attributes): Set the value for Elab_Warnings_OK.
4586 (Process_Conditional_ABE_Access): Suppress futher elaboration warnings
4587 when already in this mode or when the attribute or target have warnings
4589 (Process_Conditional_ABE_Activation_Impl): Do not emit any diagnostics
4590 if warnings are suppressed.
4591 (Process_Conditional_ABE_Call): Suppress further elaboration warnings
4592 when already in this mode, or the target or call have warnings
4594 (Process_Conditional_ABE_Call_Ada): Do not emit any diagnostics if
4595 warnings are suppressed.
4596 (Process_Conditional_ABE_Call_SPARK): Do not emit any diagnostics if
4597 warnings are suppressed.
4598 (Process_Conditional_ABE_Instantiation): Suppress further elaboration
4599 warnings when already in this mode or when the instantiation has
4600 warnings suppressed.
4601 (Process_Conditional_ABE_Instantiation_Ada): Do not emit any
4602 diagnostics if warnings are suppressed.
4603 (Process_Conditional_ABE_Variable_Assignment_Ada): Use the more
4604 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4605 (Process_Conditional_ABE_Variable_Assignment_SPARK): Use the more
4606 specific Is_Elaboration_Warnings_OK_Id rather than Warnings_Off.
4607 (Process_Task_Object): Suppress further elaboration warnings when
4608 already in this mode, or when the object, activation call, or task type
4609 have warnings suppressed. Update the processing state to indicate that
4610 the path goes through a task body.
4611 * sinfo.adb (Is_Elaboration_Warnings_OK_Node): Accept attribute
4613 (Set_Is_Elaboration_Warnings_OK_Node): Accept attribute references.
4614 * sinfo.ads: Attribute Is_Elaboration_Warnings_OK_Node now applies to
4615 attribute references.
4617 2018-05-23 Piotr Trojanek <trojanek@adacore.com>
4619 * einfo.ads: Minor reformatting.
4621 2018-05-23 Ed Schonberg <schonberg@adacore.com>
4623 * sem_ch3.adb (Analyze_Object_Declaration): If expression is an
4624 anonymous_access_to_ subprogram formal, apply a conversion to force an
4625 accsssibility check that will fail statically, enforcing 3.10.2 (13).
4627 2018-05-23 Daniel Mercier <mercier@adacore.com>
4629 * gnat1drv.adb: Turn off length expansion in CodePeer mode.
4631 2018-05-23 Bob Duff <duff@adacore.com>
4633 * freeze.adb: (Check_Address_Clause): Deal with build-in-place
4634 aggregates in addition to build-in-place calls.
4636 2018-05-23 Bob Duff <duff@adacore.com>
4638 * einfo.ads: Minor reformatting.
4639 * sem_ch3.adb: Likewise.
4640 * sinfo.ads: Likewise.
4642 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4644 * exp_ch3.adb (Default_Initialize_Object): Do not optimize scalar array
4645 initialization when the component type has predicates.
4646 * exp_ch4.adb (Expand_N_Allocator): Do not optimize scalar array
4647 allocation when the component type has predicates.
4649 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
4651 * einfo.adb, exp_disp.adb, sem_ch3.adb, sem_ch6.adb, sem_prag.adb:
4654 2018-05-22 Justin Squirek <squirek@adacore.com>
4656 * sem_ch6.adb (Analyze_Expression_Function): Propagate flags from the
4657 original function spec into the generated function spec due to
4658 expansion of expression functions during analysis.
4659 (Analyze_Subprogram_Body_Helper): Modify check on formal parameter
4660 references from the body to the subprogram spec in the case of
4661 expression functions because of inconsistances related to having a
4663 * libgnarl/s-osinte__android.ads: Flag parameters as unused.
4664 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
4665 * libgnarl/s-osinte__qnx.adb: Likewise.
4666 * libgnarl/s-osinte__qnx.ads: Likewise.
4668 2018-05-22 Doug Rupp <rupp@adacore.com>
4670 * init.c (HAVE_ADJUST_CONTEXT_FOR_RAISE): Don't define on VxWorks7 for
4673 2018-05-22 Olivier Hainque <hainque@adacore.com>
4675 * libgnat/a-except.adb (Exception_Propagation.Propagate_Exception):
4676 Expect an Exception_Occurence object, not an Access.
4677 (Complete_And_Propagate_Occurrence): Adjust accordingly.
4678 (Raise_From_Signal_Handler): Likewise.
4679 (Reraise_Occurrence_No_Defer): If we have a Machine_Occurrence
4680 available in the provided occurrence object, just re-propagate the
4681 latter as a bare "raise;" would do.
4682 * libgnat/a-exexpr.adb (Propagate_Exception): Adjust to spec change.
4683 * libgnat/a-exstat.adb (String_To_EO): Initialize X.Machine_Occurrence
4684 to null, to mark that the occurrence we're crafting from the stream
4685 contents is not being propagated (yet).
4687 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4689 * exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
4690 code for a transient component in line with the rest of the
4691 initialization code, rather than before the aggregate. This ensures
4692 that the component has proper visibility of the discriminants.
4694 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4696 * adaint.c: Reorganize QNX-specific macros, use syspage to retreive the
4699 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4701 * sigtramp-qnx.c: Properly restore link register in signal trampoline.
4703 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4705 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Strip away any
4706 conversions before extracting the value of the expression.
4707 * exp_ch3.adb (Default_Initialize_Object): Optimize the default
4708 initialization of an array of scalars.
4709 (Get_Simple_Init_Val): Add processing for array types. Remove the
4710 processing of strings because this case is already handled by the array
4712 (Needs_Simple_Initialization): Moved to Sem_Util.
4713 (Simple_Init_Array_Type): New routine.
4714 (Simple_Init_Initialize_Scalars_Type): Reimplemented to use the new
4715 facilities from Sem_Util.
4716 (Simple_Initialization_OK): New routine.
4717 * exp_ch3.ads (Needs_Simple_Initialization): Moved to Sem_Util.
4718 * exp_ch4.adb (Expand_N_Allocator): Optimize the default allocation of
4719 an array of scalars.
4720 * sem_prag.adb (Analyze_Float_Value): New routine.
4721 (Analyze_Integer_Value): New routine.
4722 (Analyze_Pragma): Reimplement the analysis of pragma Initialize_Scalars
4723 to handled the extended form of the pragma.
4724 (Analyze_Type_Value_Pair): New routine.
4725 * sem_util.adb: Add invalid value-related data structures.
4726 (Examine_Array_Bounds): New routine.
4727 (Has_Static_Array_Bounds): Reimplemented.
4728 (Has_Static_Non_Empty_Array_Bounds): New routine.
4729 (Invalid_Scalar_Value): New routine.
4730 (Needs_Simple_Initialization): Moved from Exp_Ch3.
4731 (Set_Invalid_Scalar_Value): New routines.
4732 * sem_util.ads (Has_Static_Non_Empty_Array_Bounds): New routine.
4733 (Invalid_Scalar_Value): New routine.
4734 (Needs_Simple_Initialization): Moved from Exp_Ch3.
4735 (Set_Invalid_Scalar_Value): New routines.
4736 * snames.ads-tmpl: Add names for the salar type families used by pragma
4739 2018-05-22 Javier Miranda <miranda@adacore.com>
4741 * exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
4742 string when pragma No_Tagged_Streams is applicable to the tagged type,
4743 and initialize the Expanded_Name with an empty string when pragma
4744 Discard_Names is applicable to the tagged type.
4746 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4748 * sem_ch6.adb (Check_Conformance): Add RM reference for rule that a
4749 formal subprogram is never subtype conformqnt, and thus cannot be the
4750 prefix of 'Access. Reject as well the attribute when applied to a
4751 renaming of a formal subprogram.
4753 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4755 * exp_ch3.adb (Build_Array_Init_Proc): Update the call to
4756 Needs_Simple_Initialization.
4757 (Build_Init_Statements): Update the call to Get_Simple_Init_Val.
4758 (Check_Subtype_Bounds): Renamed to Extract_Subtype_Bounds. Update the
4759 profile and comment on usage.
4760 (Default_Initialize_Object): Do not use New_Copy_Tree to set the proper
4761 Sloc of a value obtained from aspect Default_Value because this could
4762 potentially replicate large trees. The proper Sloc is now set in
4763 Get_Simple_Init_Val.
4764 (Get_Simple_Init_Val): Reorganized by breaking the various cases into
4765 separate routines. Eliminate the use of global variables.
4766 (Init_Component): Update the call to Get_Simple_Init_Val.
4767 (Needs_Simple_Initialization): Update the parameter profile and all
4769 (Simple_Init_Defaulted_Type): Copy the value of aspect Default_Value
4770 and set the proper Sloc.
4771 * exp_ch3.ads (Get_Simple_Init_Val): Update the parameter profile and
4773 (Needs_Simple_Initialization): Update the parameter profile.
4775 2018-05-22 Patrick Bernardi <bernardi@adacore.com>
4777 * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
4778 user tries to use a subtype indication as a discriminant constraint.
4780 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4782 * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention
4783 of N_Reduction_Expression and N_Reduction_Expression_Parameter.
4784 * par-ch4.adb: Remove parsing routines for reduction expressions.
4785 * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb,
4786 sem_spark.adb, sprint.adb: Remove analysis routines for reduction
4789 2018-05-22 Arnaud Charlet <charlet@adacore.com>
4791 * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in
4792 Relaxed_RM_Semantics mode.
4794 2018-05-22 Arnaud Charlet <charlet@adacore.com>
4796 * comperr.adb (Delete_SCIL_Files): Take into account
4797 N_Generic_Package_Renaming_Declaration.
4799 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4801 * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is
4802 private, use the full view if available, because it may include renamed
4803 discriminants whose values are stored in the corresponding
4806 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4808 * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
4809 defined on packages that are actuals for formal packages, in order to
4810 set/reset the visibility of the formals of a formal package with given
4811 actuals, when there are subsequent uses of those formals in the
4812 enclosing generic, as required by RN 12.7 (10).
4813 * atree.ads, atree.adb: Add operations for Elist30.
4814 * atree.h: Add Elist30.
4815 * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
4816 that are not defaulted and are thus not visible within the current
4818 (Check_Formal_Packages): Reset visibility of formals of a formal
4819 package that are not defaulted, on exit from current instance.
4821 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4823 * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null,
4824 non-'Result output appears in the output list of a function.
4826 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4828 * exp_attr.adb (Build_Array_VS_Func): Reimplemented.
4829 (Build_Record_VS_Func): Reimplemented.
4830 (Expand_N_Attribute): Reimplement the handling of attribute
4832 * sem_attr.adb (Analyze_Attribute): Reimplement the handling of
4833 attribute 'Valid_Scalars.
4834 * sem_util.adb (Scalar_Part_Present): Reimplemented.
4835 (Validated_View): New routine.
4836 * sem_util.ads (Scalar_Part_Present): Update the parameter profile and
4838 (Validated_View): New routine.
4839 * doc/gnat_rm/implementation_defined_attributes.rst: Update the
4840 documentation of attribute 'Valid_Scalars.
4841 * gnat_rm.texi: Regenerate.
4843 2018-05-22 Bob Duff <duff@adacore.com>
4845 * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in
4846 the spec of a SAL_Interface package.
4848 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4850 * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an
4851 entity E within a generic unit, indicate that there are no remaining
4852 delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The
4853 entity E is not frozen yet but the aspects should not be reanalyzed at
4854 the freeze point, which may be outside of the generic and may not have
4855 the proper visibility.
4857 2018-05-22 Bob Duff <duff@adacore.com>
4859 * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
4860 the new --split-line-before-record, --indent-named-statements and
4861 --no-align-modes gnatpp switches.
4863 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4865 * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
4866 a second argument that is a constant of a given string value.
4868 2018-05-22 Doug Rupp <rupp@adacore.com>
4870 * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64.
4872 2018-05-22 Jerome Lambourg <lambourg@adacore.com>
4874 * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline.
4876 2018-05-22 Ed Schonberg <schonberg@adacore.com>
4878 * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has
4879 delayed aspects, analyze them now, os that the representation of the
4880 type (size, bounds) can be computed and validated.
4882 2018-05-22 Olivier Hainque <hainque@adacore.com>
4884 * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the
4885 executable code section boundaries.
4887 2018-05-22 Javier Miranda <miranda@adacore.com>
4889 * locales.c: New implementation for the Ada.Locales package.
4890 * libgnat/a-locale.ads: Remove comment indicating that this is not
4892 * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating
4893 that this is not implemented.
4894 * gnat_rm.texi: Regenerate.
4896 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4898 * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor
4901 2018-05-22 Justin Squirek <squirek@adacore.com>
4903 * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util.
4904 (Freeze_Subprogram_Body, Install_Body): Modify calls to
4905 In_Same_Declarative_Part.
4906 * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to
4907 verify pragma declaration is within the same declarative list with
4908 corresponding error message.
4909 * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from
4910 sem_ch12.adb and generalized to be useful outside the scope of
4913 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com>
4915 * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper
4916 categorization of the unit after processing the aspects in case one of
4917 its aspects is converted into a categorization pragma.
4919 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4921 * freeze.adb (Warn_Overlay): Do not emit a wawrning on an object
4922 declaration with an explicit address clause and a type with default
4923 initialization, if the declaration carries an aspect
4924 Suppress_Initialization.
4926 2018-05-21 Daniel Mercier <mercier@adacore.com>
4928 * pprint.adb: Use mixed case for attribute names.
4930 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4932 * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Rename the call to
4933 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4934 (Analyze_Subprogram_Body_Helper): Rename the calls to
4935 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4936 * sem_ch9.adb (Analyze_Entry_Body): Rename the call to
4937 Analyze_Aspect_Specifications_On_Body_Or_Stub.
4938 * sem_ch10.adb: Add with and use clause for Sem_Ch13.
4939 (Analyze_Package_Body_Stub): Add constant Id. Decorate the package stub
4940 prior to analyzing its aspects.
4941 (Analyze_Protected_Body_Stub): Add constant Id. Decorate the package
4942 stub prior to analyzing its aspects. Save and restore the configuration
4944 (Analyze_Task_Body_Stub): Add constant Id. Decorate the package stub
4945 prior to analyzing its aspects.
4946 * sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4947 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4948 * sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub): Renamed
4949 to Analyze_Aspects_On_Subprogram_Body_Or_Stub.
4950 * sem_prag.adb: Code reformatting.
4951 (Analyze_Refined_Depends_Global_Post): Consider task body stubs.
4953 2018-05-21 Jerome Lambourg <lambourg@adacore.com>
4955 * gcc-interface/Makefile.in: Add g-soliop__qnx.ads to the runtime build
4958 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
4960 * exp_cg.adb: Remove with and use clause for Exp_Disp.
4961 * exp_ch9.adb: Remove with and use clause for Exp_Disp.
4962 * exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4963 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4964 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4965 * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
4966 (Is_Predefined_Interface_Primitive): Moved to Sem_Util.
4967 (Is_Predefined_Internal_Operation): Moved to Sem_Util.
4968 * exp_dist.adb: Remove with and use clause for Exp_Disp.
4969 * freeze.adb: Remove with and use clause for Exp_Disp.
4970 * sem_cat.adb: Remove with and use clause for Exp_Disp.
4971 * sem_ch6.adb: Remove with and use clause for Exp_Disp.
4972 * sem_ch12.adb: Remove with and use clause for Exp_Disp.
4973 * sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
4975 * sem_util.adb: Remove with and use clause for Exp_Disp.
4976 (Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
4977 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4978 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4979 * sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
4981 (Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
4982 (Is_Predefined_Internal_Operation): Moved from Exp_Disp.
4984 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4986 * sem_res.adb (Valid_Conversion): Improve error message on an illegal
4987 type conversion whose expression has a limited view of a type.
4989 2018-05-21 Ed Schonberg <schonberg@adacore.com>
4991 * exp_ch5.adb (Build_Formal_Container_Iteration): If source has
4992 explicit name for iterator loop, preserve that name in expanded
4993 construct, for possible use in exit statements.
4995 2018-05-21 Javier Miranda <miranda@adacore.com>
4997 * sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
4998 spec of a unit has Ada 2012 membership tests with multiple choices and
4999 the unit body is not compiled under Ada 2012 mode.
5001 2018-05-21 Doug Rupp <rupp@adacore.com>
5003 * sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
5005 (CFI_COMMON_REGS): Restore LR jic probed from prologue.
5006 (REGNO_PC_OFFSET): Change to correct value for Aarch64.
5008 2018-05-21 Jose Ruiz <ruiz@adacore.com>
5010 * doc/gnat_ugn/gnat_utility_programs.rst, exp_attr.adb,
5011 libgnarl/s-tassta.adb: Minor typo fixes
5013 2018-05-21 Ed Schonberg <schonberg@adacore.com>
5015 * sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
5016 indexed call originally in prefix forn is itself the prefix of a
5019 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
5021 * sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
5023 (Not_Null_Range): Same as above.
5025 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
5027 * exp_ch3.adb: Minor reformatting.
5028 * exp_ch6.adb: Likewise.
5029 * freeze.adb: Likewise.
5030 * inline.adb: Likewise.
5031 * sem_util.adb: Likewise.
5033 2018-05-21 Yannick Moy <moy@adacore.com>
5035 * inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
5036 conversion instead of an unchecked type conversion when inlining a
5037 return statement, unless type qualification is required (for character
5038 and string literal) or no check can result from the conversion (for
5040 * opt.ads: Update comment.
5042 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
5044 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Install the elaboration
5045 model of the compilation unit spec, if any.
5046 * sem_ch7.adb (Analyze_Package_Body_Helper): Install the elaboration
5047 model of the compilation unit spec, if any.
5048 * sem_ch10.adb (Analyze_Subunit): Install the elaboration model of the
5049 parent compilation unit spec, if any.
5050 * sem_elab.adb (Check_Elaboration_Scenarios): Restore the elaboration
5051 model of the main unit.
5052 (Is_Same_Unit): The routine now uses Unit_Entity.
5053 (Is_Subunit): Removed.
5054 (Normalize_Unit): Removed.
5055 (Unit_Entity): New routine.
5056 * sem_prag.adb (Analyze_Pragma): Reimplement the handling of pragma
5057 Elaboration_Checks. The analysis now ensures that the pragma appears at
5058 the configuration level, and on the initial declaration of a unit.
5059 Other placements are either flagged as illegal, or ignored.
5060 (Check_Duplicate_Elaboration_Checks_Pragma): New routine.
5061 (Ignore_Elaboration_Checks_Pragma): New routine.
5062 * sem_util.adb (Install_Elaboration_Model): New routine.
5063 * sem_util.ads (Install_Elaboration_Model): New routine.
5064 * doc/gnat_rm/implementation_defined_pragmas.rst: Update the
5065 documentation of pragma Elaboration_Checks.
5066 * gnat_rm.texi: Regenerate.
5068 2018-05-21 Olivier Hainque <hainque@adacore.com>
5070 * libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
5071 of empty string when argv[0] couldn't be found on PATH.
5072 (Enable_Cache): Raise Program_Error instead of attempting a null
5073 pointer dereference when the Exec_Module initialization failed.
5075 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
5077 * libgnarl/a-reatim.ads (Clock_Time): Remove External aspect.
5078 * libgnarl/a-taside.ads (Tasking_State): Likewise.
5079 * libgnat/a-calend.ads (Clock_Time): Likewise.
5081 2018-05-21 Yannick Moy <moy@adacore.com>
5083 * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix
5084 call notation in inlined call in GNATprove mode.
5086 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
5088 * einfo.adb (Is_External_State): An abstract state is also external
5089 when it is declared with option "synchronous".
5090 * einfo.ads: Update the documentation of synthesized attribute
5092 * sem_util.adb (Find_Simple_Properties): New routine.
5093 (Is_Enabled_External_Property): New routine.
5094 (State_Has_Enabled_Property): Reimplemented. The two flavors of option
5095 External have precedence over option Synchronous when determining
5096 whether a property is in effect.
5098 2018-05-21 Yannick Moy <moy@adacore.com>
5100 * sem_eval.adb (Static_Length): Take into account case of variable of
5101 subtype string literal.
5103 2018-05-21 Olivier Hainque <hainque@adacore.com>
5105 * libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
5106 (Object_Section): Rename Flag_Alloc component as Flag_Xcode.
5107 * libgnat/s-objrea.adb (Get_Xcode_Bounds): Adjust to new subprogram and
5109 (Get_Section, ELF case): Set Flag_Xcode from SHF_EXECINSTR.
5110 * libgnat/s-dwalin.adb (Open): Adjust to the Get_Memory_Bounds name
5113 2018-05-21 Olivier Hainque <hainque@adacore.com>
5115 * libgnat/s-dwalin.ads (Dwarf_Context): Change type of Load_Address to
5116 Address, and type of Low, High to Storage_Offset.
5117 (Low): Rename as Low_Address and convey that the return value is a
5118 runtime reference accounting for a load address.
5119 * libgnat/s-dwalin.adb (Read_Aranges_Entry): Adjust to the
5120 address/offset type changes.
5121 (Aranges_Lookup): Likewise.
5122 (Symbolic_Address): Likewise.
5123 (Symbolic_Traceback): Likewise.
5124 (Dump_Cache): Likewise.
5125 (Is_Inside): Likewise.
5127 (Set_Load_Address): Likewise.
5128 (Low_Address): Likewise, and account for C.Load_Address.
5129 * libgnat/s-trasym__dwarf.adb (Lt): Use Low_Address instead of Low.
5130 (Multi_Module_Symbolic_Traceback): Compare address in traceback
5131 with module Low_Address instead of Low.
5133 2018-05-21 Olivier Hainque <hainque@adacore.com>
5135 * libgnat/s-dwalin.ads (Dwarf_Context): Rename Load_Slide as
5137 * libgnat/s-dwalin.adb (Is_Inside): Adjust accordingly.
5138 (Set_Load_Address): Likewise.
5139 (Symbolic_Traceback): Likewise.
5141 2018-05-21 Olivier Hainque <hainque@adacore.com>
5143 * libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
5144 Load_Address argument and pass it down to Init_Module.
5145 * libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
5146 lm.l_addr as the Load_Address to Add_Module_To_Cache.
5148 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
5150 * einfo.adb (Has_Discriminants): Stronger assertion.
5151 (Set_Has_Discriminants): Stronger assertion.
5152 * sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
5153 the stronger assertion on Has_Discriminant.
5154 (Uninstall_Discriminants_And_Pop_Scope): Same as above.
5155 * sem_util.adb (New_Copy_Tree): Same as above.
5156 * sem_ch7.adb (Generate_Parent_References): Prevent calls to
5157 Has_Discriminant on non-type entities that might happen when the
5158 compiled code has errors.
5159 * sem_ch3.adb (Derived_Type_Declaration): Only call
5160 Set_Has_Discriminant on type entities.
5162 2018-05-21 Arnaud Charlet <charlet@adacore.com>
5164 * exp_unst.adb (Unnest_Subprogram): Unnest all subprograms relevant for
5167 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
5169 * lib.ads: Fix typo in enumeration in comment.
5171 2018-05-21 Ed Schonberg <schonberg@adacore.com>
5173 * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The
5174 attribute reference is legal within a generic unit when the prefix is a
5175 formal private type.
5177 2018-05-21 Hristian Kirtchev <kirtchev@adacore.com>
5179 * exp_ch7.adb (Establish_Transient_Scope): Code cleanup. Do not
5180 delegate the secondary stack management when there is no suitable
5181 transient context, and the transient scope was intended to manage the
5182 secondary stack because this causes premature reclamation. Change the
5183 transient scope creation logic by special casing assignment statements
5184 of controlled components for type initialization procedures.
5185 (Find_Node_To_Be_Wrapped): Renamed to Find_Transient_Context. Update
5186 the comment on usage.
5187 (Find_Transient_Context): Change the initinte loop into a while loop.
5188 Iterations schemes and iterator specifications are not valid transient
5189 contexts because they rely on special processing. Assignment statements
5190 are now treated as a normal transient context, special cases are
5191 handled by the caller. Add special processing for pragma Check.
5192 (Is_OK_Construct): Removed. Its functionality has been merged in
5193 routine Find_Transient_Context.
5194 * sem_ch5.adb (Check_Call): Reimplemented. Add code to properly
5195 retrieve the subprogram being invoked. Use a more accurate predicate
5196 (Requires_Transient_Scope) to determine that the function will emply
5197 the secondary stack.
5199 2018-05-21 Piotr Trojanek <trojanek@adacore.com>
5201 * ada_get_targ.adb: Fix subprogram body headers.
5202 * adabkend.adb: Likewise.
5203 * checks.adb: Likewise.
5204 * exp_ch3.adb: Likewise.
5205 * exp_ch5.adb: Likewise.
5206 * exp_ch9.adb: Likewise.
5207 * exp_dist.adb: Likewise.
5208 * exp_tss.adb: Likewise.
5209 * inline.adb: Likewise.
5210 * lib-writ.adb: Likewise.
5211 * lib-xref-spark_specific.adb: Likewise.
5212 * libgnarl/s-osinte__darwin.adb: Likewise.
5213 * libgnarl/s-stusta.adb: Likewise.
5214 * libgnarl/s-taprop__solaris.adb: Likewise.
5215 * libgnarl/s-tposen.adb: Likewise.
5216 * libgnarl/s-vxwext__kernel-smp.adb: Likewise.
5217 * libgnarl/s-vxwext__kernel.adb: Likewise.
5218 * libgnat/a-btgbso.adb: Likewise.
5219 * libgnat/a-cfdlli.adb: Likewise.
5220 * libgnat/a-cfhama.adb: Likewise.
5221 * libgnat/a-cfinve.adb: Likewise.
5222 * libgnat/a-cimutr.adb: Likewise.
5223 * libgnat/a-coboho.adb: Likewise.
5224 * libgnat/a-cofove.adb: Likewise.
5225 * libgnat/a-cofuve.adb: Likewise.
5226 * libgnat/a-comutr.adb: Likewise.
5227 * libgnat/a-exexda.adb: Likewise.
5228 * libgnat/a-tags.adb: Likewise.
5229 * libgnat/a-tideau.adb: Likewise.
5230 * libgnat/a-wtdeau.adb: Likewise.
5231 * libgnat/a-ztdeau.adb: Likewise.
5232 * libgnat/g-alleve.adb: Likewise.
5233 * libgnat/s-excdeb.adb: Likewise.
5234 * libgnat/s-parint.adb: Likewise.
5235 * libgnat/s-shasto.adb: Likewise.
5236 * libgnat/s-traceb__hpux.adb: Likewise.
5237 * prepcomp.adb: Likewise.
5238 * sem_ch4.adb: Likewise.
5239 * sem_ch6.adb: Likewise.
5240 * sem_dist.adb: Likewise.
5241 * sem_prag.adb: Likewise.
5242 * sem_util.adb: Likewise.
5243 * sinfo.adb: Likewise.
5244 * switch.adb: Likewise.
5246 2018-05-04 John Marino <gnugcc@marino.st>
5249 * link.c (BSD platforms): Add missing backslash.
5251 2018-04-27 Eric Botcazou <ebotcazou@adacore.com>
5254 * init.c (__gnat_handle_vms_condition): Add missing parentheses.
5256 2018-04-25 Eric Botcazou <ebotcazou@adacore.com>
5259 * gnat_ugn.texi: Regenerate.
5261 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
5264 * gnatlink.adb (Gnatlink): Remove handling of -b switch.
5265 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnatlink):
5266 Remove documentation of -b switch.
5268 2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
5271 * gnatlink.adb (Process_Args): Drop existing link switches if multiple
5272 switches are passed for --LINK.
5274 2018-03-12 Eric Botcazou <ebotcazou@adacore.com>
5277 * gcc-interface/misc.c (gnat_post_options): Disable string overflow
5280 2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
5282 * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
5283 Consider only entities for objects.
5285 2018-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
5287 * gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
5289 (OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
5291 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
5293 * gcc-interface/trans.c (convert_with_check): Fix typo in the condition
5294 guarding the overflow check emitted for the upper bound of a floating-
5297 2018-03-06 Eric Botcazou <ebotcazou@adacore.com>
5299 * gcc-interface/utils.c (def_builtin_1): Bail out on error_mark_node.
5301 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
5303 * libgnat/i-cexten.ads (Float_128): New type.
5305 2018-02-02 Eric Botcazou <ebotcazou@adacore.com>
5307 * gcc-interface/decl.c (array_type_has_nonaliased_component): Return
5308 false if the component type is a pointer.
5310 2018-01-11 Gary Dismukes <dismukes@adacore.com>
5312 * exp_ch3.adb (Default_Initialize_Object): Call New_Copy_Tree on the
5313 result of Get_Simple_Init_Value and pass the source location of the
5314 object declaration's object_definition.
5316 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5318 * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Handle
5319 properly object declarations with initializations that are
5320 build-in-place function calls, when there is an address specification,
5321 either as an aspect specification or an explicit attribute
5322 specification clause, for the initialized object.
5323 * freeze.adb (Check_Address_Clause): Do not remove side-effects from
5324 initial expressions in the case of a build-in-place call.
5326 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5328 * sem_eval.adb (Is_Null_Range): Retrieve the full view when called on a
5329 private (sub)type; refactor to avoid early return statement.
5330 (Not_Null_Range): Same as above.
5332 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5334 * freeze.adb (Freeze_Entity): Ensure that a Ghost type is not
5335 concurrent, nor effectively volatile.
5336 * ghost.adb (Check_Ghost_Type): New routine.
5337 * ghost.ads (Check_Ghost_Type): New routine.
5338 * sem_util.adb (Is_Declaration): Reimplemented. The routine can now
5339 consider specific subsets of declarations.
5340 (Is_Declaration_Other_Than_Renaming): Removed. Its functionality is
5341 replicated by Is_Declaration.
5342 * sem_util.ads (Is_Declaration): New parameter profile. Update the
5344 (Is_Declaration_Other_Than_Renaming): Removed.
5346 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5348 * sem_ch5.adb (Analyze_Assignment): Assignments to variables that act
5349 as Part_Of consituents of single protected types are illegal when they
5350 take place inside a protected function.
5351 (Diagnose_Non_Variable_Lhs): Use Within_Function to check for an
5353 (Is_Protected_Part_Of_Constituent): New routine.
5354 (Within_Function): New routine.
5356 2018-01-11 Arnaud Charlet <charlet@adacore.com>
5358 Bump copyright notices to 2018.
5360 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5362 * binde.adb, par-ch6.adb, par-ch9.adb, sem_ch12.adb, sem_ch13.adb:
5365 2018-01-11 Justin Squirek <squirek@adacore.com>
5367 * par-ch6.adb (Scan_Body_Or_Expression_Function): Add additional check
5368 to make sure a given expression function is properly parenthesized.
5370 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5372 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
5373 categorization of a subprogram body which does not complete a previous
5376 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5378 * sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
5379 scope of package Ada is Standard.
5381 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5383 * sem_ch13.adb (Replace_Type_Ref): Handle properly reference to a
5384 subcomponent of the current entity when building the body for a dynamic
5385 predicate function for a record with composite subcomponents.
5387 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5389 * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Update the call to
5390 Establish_Transient_Scope.
5391 (Convert_To_Assignments): Update the call to Establish_Transient_Scope.
5392 (Expand_Array_Aggregate): Update the call to Establish_Transient_Scope.
5393 * exp_ch6.adb (Expand_Call_Helper): Update the call to
5394 Establish_Transient_Scope.
5395 (Make_Build_In_Place_Call_In_Object_Declaration): Update the call to
5396 Establish_Transient_Scope.
5397 * exp_ch7.adb (Establish_Transient_Scope): Restructured. Delegate the
5398 management of the secondary stack to an enclosing scope if there is no
5399 suitable construct to wrap, and the transient scope was intended to
5400 manage the secondary stack.
5401 (Find_Node_To_Be_Wrapped): Restructured. A case_statement_alternative
5402 is a valid boundary for a transient expression which comes from the
5403 statements of the alternative, otherwise alternatives cannot be
5404 wrapped. Assignments of controlled objects which have controlled
5405 actions suppressed now stop the traversal as there is no point in
5406 looking for an enclosing construct. Add several N_xxx_Body choices to
5407 the termination conditions for completeness.
5408 * exp_ch7.ads (Establish_Transient_Scope): Update the parameter profile
5409 and the associated comment on usage.
5410 * exp_smem.adb (Add_Shared_Var_Lock_Procs): Update the call to
5411 Establish_Transient_Scope.
5412 (Add_Write_After): Update the call to Establish_Transient_Scope.
5413 * sem_res.adb (Check_Initialization_Call): Removed.
5414 (Resolve_Actuals): Account for additional cases where finalization
5415 actions are required by utilizing predicate Needs_Finalization rather
5417 (Resolve_Call): Type initialization procedures can now utilize
5418 transient scopes to manage the secondary stack, thus preventing leaks
5419 during initialization. Remove the previous kludgy algorithm which
5420 attempts to manage the secondary stack at the object creation site.
5422 2018-01-11 Jerome Lambourg <lambourg@adacore.com>
5424 * libgnat/g-soliop__qnx.ads: New.
5425 * adaint.c, adaint.h, cstreams.c, s-oscons-tmplt.c, sysdep.c: Update
5428 2018-01-11 Bob Duff <duff@adacore.com>
5430 * par-ch9.adb (P_Protected_Operation_Declaration_Opt): Give an error if
5431 a null procedure occurs in a protected definition.
5433 2018-01-11 Bob Duff <duff@adacore.com>
5435 * binderr.ads, namet.ads: Minor reformatting.
5437 2018-01-11 Bob Duff <duff@adacore.com>
5439 * doc/gnat_ugn/gnat_utility_programs.rst: Improve documentation of
5442 2018-01-11 Bob Duff <duff@adacore.com>
5444 * binde.adb (Force_Elab_Order): Give an error if there are duplicate
5447 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5449 * sem_ch6.adb (Freeze_Expr_Types): If an access value is the
5450 controlling argument of a dispatching call. freeze the corresponding
5453 2018-01-11 Ben Brosgol <brosgol@adacore.com>
5455 * doc/Makefile: Add Sphinx option -W to treat warnings as errors.
5457 2018-01-11 Ben Brosgol <brosgol@adacore.com>
5459 * doc/gnat_rm/implementation_defined_aspects.rst: Minor type/wording
5461 * gnat_rm.texi: Regenerate.
5463 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5465 * sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
5466 formsl type corresponding to the actual fixed point type is private,
5467 because in this case there can be no suspicious arithmetic operations
5468 in the generic unless they reference a formal subprogram. Clarify
5471 2018-01-11 Javier Miranda <miranda@adacore.com>
5473 * exp_util.adb (Remove_Side_Effects): No action done for functions
5474 returning class-wide types since it requires generating code using
5475 'reference and the CCG target has no secondary stack.
5476 * gnat1drv.adb: Disable building static dispatch tables when generating
5479 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5481 * libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
5482 libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
5483 (File_Type): Add Default_Initial_Condition aspect.
5485 2018-01-11 Pascal Obry <obry@adacore.com>
5487 * libgnat/s-os_lib.adb (Normalize_Pathname): New implementation.
5489 2018-01-11 Bob Duff <duff@adacore.com>
5491 * doc/gnat_ugn/gnat_utility_programs.rst: Rewrite gnatpp documentation
5492 to match what the Libadalang-based version does.
5493 * doc/gnat_ugn/about_this_guide.rst: Update reference.
5495 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5497 * sem_res.adb (Uses_SS): A controlled type requires the secondary stack
5498 if it contains at least one component declaration employing a function
5499 call returning on the secondary stack.
5501 2018-01-11 Yannick Moy <moy@adacore.com>
5503 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
5504 Update description of restriction SPARK_05 with SPARK 2014.
5505 * gnat_rm.texi: Regenerate.
5507 2018-01-11 Vasiliy Fofanov <fofanov@adacore.com>
5509 * doc/gnat_ugn/gnat_utility_programs.rst: Fix layout.
5511 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5513 * exp_aggr.adb, exp_ch9.adb, exp_util.adb, sem_aggr.adb, sem_ch3.adb,
5514 sem_res.adb, sem_util.adb: Minor reformatting.
5516 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5518 * sem_prag.adb (Analyze_Pragma, case Predicate): Indicate that the type
5519 has a delayed aspect which must be processed at the point the type is
5520 frozen. This mimics what is done when the predicate is provided by a
5523 2018-01-11 Doug Rupp <rupp@adacore.com>
5525 * init.c (vxworks): Add macro checks for __aarch64__.
5527 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5529 * exp_util.adb (Add_Failure_Expression): New routine.
5530 (Make_Predicate_Check): Reimplement the handling of Predicate_Failure.
5531 * sem_util.adb (Is_Current_Instance): Code cleanup.
5533 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
5535 * libgnat/s-parame*.adb, libgnat/s-parame*.ads: Remove unneeded
5536 Default_Sec_Stack_Size.
5537 * libgnat/s-secsta.adb (SS_Allocate): Handle the fixed secondary stack
5538 limit check so that the integer index does not overflow. Check the
5539 dynamic stack allocation does not cause the secondary stack pointer to
5541 (SS_Info): Align colons.
5542 (SS_Init): Cover the case when bootstraping with an old compiler that
5543 does not set Default_SS_Size.
5545 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5547 * sem_ch3.adb (Add_Internal_Interface_Entities): When checking the
5548 legality of an inherited operation that may require overriding, ignore
5549 primitive_wrappers that correspond to explicit operations that override
5550 an interface primitive.
5551 * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): If the
5552 operation to which the class-wide expression applies is a protected op.
5553 with a primitive_wrapper, verify that the updated inherited expression
5554 does not contain an internal call to a protected function. This
5555 completes the implementation of AI12-0166.
5557 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5559 * ali.adb: Document the remaining letters available for ALI lines.
5560 (Scan_ALI): A with clause is internal when it is encoded on a 'Z' line.
5561 * ali.ads: Update type With_Record. Field
5562 Implicit_With_From_Instantiation is no longer in use. Add field
5564 * csinfo.adb (CSinfo): Remove the setup for attribute
5565 Implicit_With_From_Instantiation.
5566 * lib-writ.adb (Collect_Withs): Correct the logic which marks a unit as
5567 either implicitly or explicitly withed.
5568 (Is_Implicit_With_Clause): New routine.
5569 (Write_ALI): Rename array Implicit_With to Has_Implicit_With to avoid
5570 confusion with the with clause attribute by the same name.
5571 (Write_With_Lines): Update the emission of 'W', 'Y', and 'Z' headers.
5572 * rtsfind.adb (Maybe_Add_With): Code cleanup.
5573 * sem_ch8.adb (Present_System_Aux): Code cleanup.
5574 * sem_ch10.adb (Expand_With_Clause): Mark the with clause as generated
5576 (Implicit_With_On_Parent): Mark the with clause as generated for a
5578 * sem_ch12.adb (Inherit_Context): With clauses inherited by an
5579 instantiation are no longer marked as Implicit_With_From_Instantiation
5580 because they are already marked as implicit.
5581 * sem_elab.adb (Ensure_Prior_Elaboration_Static): Remove the kludge
5582 which marks implicit with clauses as related to an instantiation.
5583 * sinfo.adb (Implicit_With_From_Instantiation): Removed.
5584 (Parent_With): New routine.
5585 (Set_Implicit_With_From_Instantiation): Removed.
5586 (Set_Parent_With): New routine.
5587 * sinfo.ads: Update the documentation of attribute Implicit_With.
5588 Remove attribute Implicit_With_From_Instantiation along with
5589 occurrences in nodes. Add attribute Parent_With along with occurrences
5591 (Implicit_With_From_Instantiation): Removed along with pragma Inline.
5592 (Parent_With): New routine along with pragma Inline.
5593 (Set_Implicit_With_From_Instantiation): Removed along with pragma Inline.
5594 (Set_Parent_With): New routine along with pragma Inline.
5596 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5598 * sem_util.adb (Find_Enclosing_Scope): Return the unique defining
5599 entity when the enclosing construct is a body.
5601 2018-01-11 Patrick Bernardi <bernardi@adacore.com>
5603 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Simplified
5604 Secondary_Stack_Size handling as a pragma is now generated for the
5605 corresponding aspect instead of an attribute. Pragma expression is
5606 relocated instead of evaluated. Discriminant of the corresponding
5607 record type is referenced rather than the type discriminant.
5608 (Create_Secondary_Stack_For_Task, Make_Task_Create_Call): Update
5609 Secondary_Stack_Size rep item checks to only look for the pragma rep.
5610 * sem_ch13.adb (Analyze_One_Aspect): Transform
5611 Aspect_Secondary_Stack_Size into a pragma instead of an attribute
5612 because the attribute does not have visibility on a task type's
5613 discriminants when the type's definition is expanded.
5614 (Analyze_Attribute_Definition_Clause): Remove handling of
5615 Attribute_Secondary_Stack_Size.
5616 * snames.adb-tmpl, snames.ads-tmpl: Remove
5617 Attribute_Secondary_Stack_Size, no longer used.
5619 2018-01-11 Justin Squirek <squirek@adacore.com>
5621 * sem_ch8.adb: Minor comment fix.
5623 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5625 * exp_ch4.adb (Process_Action): Do not abandon the inspection of an
5626 individual action because the action may denote a complex expression,
5627 such as a case statement, which in turn may contain additional
5630 2018-01-11 Ed Schonberg <schonberg@adacore.com>
5632 * sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
5633 analysis on a copy of the expression with a copy of the index variable,
5634 because full expansion will rewrite construct into a loop with the
5635 original loop variable.
5636 * exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
5637 expression is an iterated component association. Full analysis takes
5638 place when construct is rewritten as a loop.
5639 (In_Place_Assign_OK, Safe_Component): An iterated_component_association
5640 is not safe for in-place assignment.
5641 * sem_util.adb (Remove_Entity): Handle properly the case of an isolated
5642 entity with no homonym and no other entity in the scope.
5644 2018-01-11 Justin Squirek <squirek@adacore.com>
5646 * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
5647 message to be printed on the pragma argument identifier.
5649 2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
5651 * exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
5652 entity of the generated invariant procedure in order to construct a
5653 proper entity chain.
5655 2018-01-11 Piotr Trojanek <trojanek@adacore.com>
5657 * sem_ch13.adb (Build_Predicate_Functions): Fix minor issues in
5660 2018-01-11 Arnaud Charlet <charlet@adacore.com>
5662 * einfo.ads, einfo.adb (Activation_Record_Component,
5663 Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
5664 Allow E_Discriminant.
5666 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
5668 * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
5669 for atomic access once the component size is taken into account and
5670 also do it if the component type is Atomic or Volatile_Full_Access.
5672 2018-01-04 Eric Botcazou <ebotcazou@adacore.com>
5674 * gnatvsn.ads: Bump copyright year.
5676 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5677 Alan Hayward <alan.hayward@arm.com>
5678 David Sherwood <david.sherwood@arm.com>
5680 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE
5683 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5684 Alan Hayward <alan.hayward@arm.com>
5685 David Sherwood <david.sherwood@arm.com>
5687 * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION
5690 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5691 Alan Hayward <alan.hayward@arm.com>
5692 David Sherwood <david.sherwood@arm.com>
5694 * gcc-interface/utils.c (gnat_types_compatible_p): Handle
5695 polynomial TYPE_VECTOR_SUBPARTS.
5697 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
5698 Alan Hayward <alan.hayward@arm.com>
5699 David Sherwood <david.sherwood@arm.com>
5701 * gcc-interface/misc.c (enumerate_modes): Handle polynomial
5704 2018-01-03 Jakub Jelinek <jakub@redhat.com>
5706 Update copyright years.
5708 * gnat_ugn.texi: Bump @copying's copyright year.
5709 * gnat_rm.texi: Likewise.
5711 Copyright (C) 2018 Free Software Foundation, Inc.
5713 Copying and distribution of this file, with or without modification,
5714 are permitted in any medium without royalty provided the copyright
5715 notice and this notice are preserved.