1 2024-07-07 Maciej W. Rozycki <macro@orcam.me.uk>
3 * gcc-interface/Make-lang.in (ada.all.cross): Move recipe to...
4 (GNATTOOLS_CROSS_MV): ... this new variable.
5 (cross-gnattools): Paste it here.
6 (gnattools-cross-mv): New target.
8 2024-07-03 Alexandre Oliva <oliva@adacore.com>
10 * gcc-interface/misc.cc (gnat_get_array_descr_info): Only follow
11 TYPE_DEBUG_TYPE if TYPE_CAN_HAVE_DEBUG_TYPE_P.
12 * gcc-interface/utils.cc (sized_type_hash): New struct.
13 (sized_type_hasher): New struct.
14 (sized_type_hash_table): New variable.
15 (init_gnat_utils): Allocate it.
16 (destroy_gnat_utils): Release it.
17 (sized_type_hasher::equal): New.
18 (hash_sized_type): New.
19 (canonicalize_sized_type): New.
20 (make_type_from_size): Use it to cache packed variants. Fix
21 type reuse by combining biased_p and for_biased earlier. Hold
22 the combination in for_biased, adjusting later uses.
24 2024-07-03 Alexandre Oliva <oliva@adacore.com>
26 * gcc-interface/cuintp.cc (UI_To_gnu): Add mode that selects a
27 wide enough unsigned type. Fail if the constant exceeds the
28 representable numbers.
29 * gcc-interface/decl.cc (gnat_to_gnu_entity): Use it for
30 numerator and denominator of fixed-point types. In case of
31 failure, fall back to an indeterminate fraction.
33 2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
35 * exp_ch4.adb (Expand_Concatenate): In the case where an operand
36 does not have both bounds known at compile time, use nevertheless
37 the low bound directly if it is known at compile time.
38 Fold the conditional expression giving the low bound of the result
39 in the general case if the low bound of all the operands are equal.
41 2024-07-02 Ronan Desplanques <desplanques@adacore.com>
43 * sem_ch12.adb (Save_And_Reset): Fix value of low bound used to
46 2024-07-02 Steve Baird <baird@adacore.com>
49 (Analyze_Image_Attribute.Check_Image_Type): Check for
50 E_Access_Attribute_Type prefix type.
52 2024-07-02 Steve Baird <baird@adacore.com>
55 (Expand_N_Protected_Body): Declare new procedure
56 Unanalyze_Use_Clauses and call it before analyzing the newly
57 constructed subprogram body.
59 2024-07-02 Steve Baird <baird@adacore.com>
62 (Build_Record_Put_Image_Procedure): Declare new Boolean-valued
63 function Null_Record_Default_Implementation_OK; call it as part of
64 deciding whether to generate "(NULL RECORD)" text.
66 2024-07-02 Justin Squirek <squirek@adacore.com>
69 (Analyze_Assignment): Add special expansion for qualified expressions
70 in certain cases dealing with mutably tagged types.
72 2024-07-02 Bob Duff <duff@adacore.com>
74 * freeze.adb (Freeze_Type_Refs): If Node is in N_Has_Etype,
75 check that it has had its Etype set, because this can be
76 called early for expression functions that are completions.
78 2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
80 * exp_ch4.adb (Expand_Array_Comparison): Remove the obsolete byte
81 addressibility test. If Support_Composite_Compare_On_Target is true,
82 immediately return for a component size of 8, an unsigned component
83 type and aligned operands. Disable when Unnest_Subprogram_Mode is
85 (Expand_N_Op_Eq): Adjust comment.
86 * targparm.ads (Support_Composite_Compare_On_Target): Replace bit by
87 byte in description and document support for ordering comparisons.
88 * gcc-interface/utils2.cc (compare_arrays): Rename into...
89 (compare_arrays_for_equality): ...this. Remove redundant lines.
90 (compare_arrays_for_ordering): New function.
91 (build_binary_op) <comparisons>: Call compare_arrays_for_ordering
92 to implement ordering comparisons for arrays.
94 2024-07-02 Yannick Moy <moy@adacore.com>
96 * contracts.adb (Analyze_Pragmas_In_Declarations): Analyze
97 pragmas in two iterations over the list of declarations in
98 order to analyze some pragmas before others.
99 * einfo-utils.ads (Get_Pragma): Fix comment.
100 * sem_prag.ads (Pragma_Significant_To_Subprograms): Fix.
101 (Pragma_Significant_To_Subprograms_Analyzed_First): Add new
102 global array to identify these pragmas which should be analyzed
103 first, which concerns only Extensions_Visible for now.
105 2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
107 * exp_ch7.adb (Convert_View): Add third parameter Typ and use it if
108 the second parameter does not have an Etype.
109 (Make_Adjust_Call): Remove obsolete setting of Etype and pass Typ in
110 call to Convert_View.
111 (Make_Final_Call): Likewise.
112 (Make_Init_Call): Pass Typ in call to Convert_View.
114 2024-07-02 Javier Miranda <miranda@adacore.com>
116 * sem_aggr.adb (Cannot_Compute_High_Bound): New subprogram.
117 (Report_Null_Array_Constraint_Error): New subprogram.
118 (Collect_Aggr_Bounds): For null aggregates, build the bounds
119 of the inner dimensions.
120 (Has_Null_Aggregate_Raising_Constraint_Error): New subprogram.
121 (Subtract): New subprogram.
122 (Resolve_Array_Aggregate): Report a warning when the index of
123 null array aggregates is an enumeration type or a modular type
124 at we can statically determine that the program will raise CE
125 at runtime computing its high bound.
126 (Resolve_Null_Array_Aggregate): ditto.
128 2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
130 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
131 (No_Default_Initialization): Mention components alongside variables.
132 * exp_aggr.adb (Build_Array_Aggr_Code.Gen_Assign): Check that the
133 restriction No_Default_Initialization is not in effect for default
134 initialized component.
135 (Build_Record_Aggr_Code): Likewise.
136 * gnat_rm.texi: Regenerate.
138 2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
140 * debug.adb (dJ): Add back as unused.
142 2024-06-27 Eric Botcazou <ebotcazou@adacore.com>
144 * libgnat/s-carsi8.adb: Remove clauses for System.Address_Operations
145 and use only operations of System.Storage_Elements for addresses.
146 * libgnat/s-casi16.adb: Likewise.
147 * libgnat/s-casi32.adb: Likewise.
148 * libgnat/s-casi64.adb: Likewise.
149 * libgnat/s-casi128.adb: Likewise.
150 * libgnat/s-carun8.adb: Likewise.
151 * libgnat/s-caun16.adb: Likewise.
152 * libgnat/s-caun32.adb: Likewise.
153 * libgnat/s-caun64.adb: Likewise.
154 * libgnat/s-caun128.adb: Likewise.
155 * libgnat/s-geveop.adb: Likewise.
157 2024-06-27 Javier Miranda <miranda@adacore.com>
159 * sem_ch2.adb (Analyze_Interpolated_String_Literal): Report
160 interpretations of ambiguous parameterless function calls.
162 2024-06-27 Eric Botcazou <ebotcazou@adacore.com>
164 * sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the
165 node once the Etype is set.
166 * sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name.
167 (Analyze_Dimension): Call Analyze_Dimension_Has_Etype for it.
169 2024-06-27 Ronan Desplanques <desplanques@adacore.com>
171 * mdll.adb (Build_Non_Reloc_DLL): Fix incorrect assignment
173 (Ada_Build_Non_Reloc_DLL): Likewise.
175 2024-06-27 Javier Miranda <miranda@adacore.com>
177 * sem_res.adb (Has_Applicable_User_Defined_Literal): Add missing
178 support for interpolated strings.
180 2024-06-27 Martin Clochard <clochard@adacore.com>
182 * sem_ch6.adb (Check_Overriding_Indicator) Remove Comes_From_Source filter.
183 (New_Overloaded_Entity) Move up special case of LSP_Subprogram,
184 and remove Comes_From_Source filter.
186 2024-06-27 Eric Botcazou <ebotcazou@adacore.com>
188 * aspects.ads (Aspect_Id): Add Aspect_Finalizable.
189 (Implementation_Defined_Aspect): Add True for Aspect_Finalizable.
190 (Operational_Aspect): Add True for Aspect_Finalizable.
191 (Aspect_Argument): Add Expression for Aspect_Finalizable.
192 (Is_Representation_Aspect): Add False for Aspect_Finalizable.
193 (Aspect_Names): Add Name_Finalizable for Aspect_Finalizable.
194 (Aspect_Delay): Add Always_Delay for Aspect_Finalizable.
195 * checks.adb: Add with and use clauses for Sem_Elab.
196 (Install_Primitive_Elaboration_Check): Call Is_Controlled_Procedure.
197 * einfo.ads (Has_Relaxed_Finalization): Document new flag.
198 (Is_Controlled_Active): Update documentation.
199 * exp_aggr.adb (Generate_Finalization_Actions): Replace Find_Prim_Op
200 with Find_Controlled_Prim_Op for Name_Finalize.
201 * exp_attr.adb (Expand_N_Attribute_Reference) <Finalization_Size>:
202 Return 0 if the prefix type has relaxed finalization.
203 * exp_ch3.adb (Build_Equivalent_Record_Aggregate): Return Empty if
204 the type needs finalization.
205 (Expand_Freeze_Record_Type): Call Find_Controlled_Prim_Op instead of
206 Find_Prim_Op for Name_{Adjust,Initialize,Finalize}.
207 Call Make_Finalize_Address_Body for all controlled types.
208 * exp_ch4.adb (Insert_Dereference_Action): Do not generate a call to
209 Adjust_Controlled_Dereference if the designated type has relaxed
211 * exp_ch6.adb (Needs_BIP_Collection): Return false for an untagged
212 type that has relaxed finalization.
213 * exp_ch7.adb (Allows_Finalization_Collection): Return false if the
214 designated type has relaxed finalization.
215 (Check_Visibly_Controlled): Call Find_Controlled_Prim_Op instead of
217 (Make_Adjust_Call): Likewise.
218 (Make_Deep_Record_Body): Likewise.
219 (Make_Final_Call): Likewise.
220 (Make_Init_Call): Likewise.
221 * exp_disp.adb (Set_All_DT_Position): Remove obsolete warning.
222 * exp_util.ads: Add with and use clauses for Snames.
223 (Find_Prim_Op): Add precondition.
224 (Find_Controlled_Prim_Op): New function declaration.
225 (Name_Of_Controlled_Prim_Op): Likewise.
226 * exp_util.adb: Remove with and use clauses for Snames.
227 (Build_Allocate_Deallocate_Proc): Do not build finalization actions
228 if the designated type has relaxed finalization.
229 (Find_Controlled_Prim_Op): New function.
230 (Find_Last_Init): Call Find_Controlled_Prim_Op instead of
232 (Name_Of_Controlled_Prim_Op): New function.
233 * freeze.adb (Freeze_Entity.Freeze_Record_Type): Propagate the
234 Has_Relaxed_Finalization flag from components.
235 * gen_il-fields.ads (Opt_Field_Enum): Add Has_Relaxed_Finalization.
236 * gen_il-gen-gen_entities.adb (Entity_Kind): Likewise.
237 * sem_aux.adb (Is_By_Reference_Type): Return true for all controlled
239 * sem_ch3.adb (Build_Derived_Record_Type): Do not special case types
240 declared in Ada.Finalization.
241 (Record_Type_Definition): Propagate the Has_Relaxed_Finalization
242 flag from components.
243 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Also process the
245 (Analyze_Aspect_Specifications): Likewise. Call Flag_Non_Static_Expr
247 (Check_Aspect_At_Freeze_Point): Likewise.
248 (Inherit_Aspects_At_Freeze_Point): Likewise.
249 (Resolve_Aspect_Expressions): Likewise.
250 (Resolve_Finalizable_Argument): New procedure.
251 (Validate_Finalizable_Aspect): Likewise.
252 * sem_elab.ads: Add with and use clauses for Snames.
253 (Is_Controlled_Procedure): New function declaration.
254 * sem_elab.adb: Remove with and use clauses for Snames.
255 (Is_Controlled_Proc): Move to...
256 (Is_Controlled_Procedure): ...here and rename.
257 (Check_A_Call): Call Find_Controlled_Prim_Op instead of
259 (Is_Finalization_Procedure): Likewise.
260 * sem_util.ads (Propagate_Controlled_Flags): Update documentation.
261 * sem_util.adb (Is_Fully_Initialized_Type): Replace call to
262 Find_Optional_Prim_Op with Find_Controlled_Prim_Op.
263 Call Has_Null_Extension only for derived tagged types.
264 (Propagate_Controlled_Flags): Propagate Has_Relaxed_Finalization.
265 * snames.ads-tmpl (Name_Finalizable): New name.
266 (Name_Relaxed_Finalization): Likewise.
267 * libgnat/s-finroo.ads (Root_Controlled): Add Finalizable aspect.
268 * doc/gnat_rm/gnat_language_extensions.rst: Document implementation
269 of Generalized Finalization.
270 * gnat_rm.texi: Regenerate.
271 * gnat_ugn.texi: Regenerate.
273 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
275 * gcc-interface/trans.cc (Subprogram_Body_to_gnu): Also return early
276 for a protected subprogram in -gnatc mode.
278 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
280 * gcc-interface/decl.cc (gnat_to_gnu_entity) <discrete_type>: Set
281 the TYPE_JUSTIFIED_MODULAR_P flag earlier.
282 * gcc-interface/misc.cc (gnat_unit_size_without_reusable_padding):
284 (LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING): Redefine to above
287 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
289 * gcc-interface/utils.cc (clear_decl_bit_field): New function.
290 (finish_record_type): Call clear_decl_bit_field instead of clearing
291 DECL_BIT_FIELD manually.
293 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
295 * gcc-interface/trans.cc (gnat_to_gnu) <N_Op_Mod>: Fix formatting.
296 * gcc-interface/utils2.cc: Include optabs-query.h.
297 (fast_modulo_reduction): Call can_mult_highpart_p on the TYPE_MODE
298 before generating a high-part multiply. Fix formatting.
300 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
302 * gcc-interface/gigi.h (fast_modulo_reduction): Declare.
303 * gcc-interface/trans.cc (gnat_to_gnu) <N_Op_Mod>: In the unsigned
304 case, call fast_modulo_reduction for {FLOOR,TRUNC}_MOD_EXPR if the
305 RHS is a constant and not a power of two, and the precision is not
306 larger than the word size.
307 * gcc-interface/utils2.cc: Include expmed.h.
308 (fast_modulo_reduction): New function.
309 (nonbinary_modular_operation): Call fast_modulo_reduction for the
310 multiplication if the precision is not larger than the word size.
312 2024-06-21 Javier Miranda <miranda@adacore.com>
314 * sem_ch2.adb (Analyze_Interpolated_String_Literal): Reject
315 ambiguous function calls.
317 2024-06-21 Ronan Desplanques <desplanques@adacore.com>
319 * sem_util.adb (Examine_Array_Bounds): Add missing return
320 statements. Fix criterion for a string literal being empty.
322 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
324 * bcheck.adb (Check_Consistency_Of_Sdep): Guard against path to ALI
327 2024-06-21 Javier Miranda <miranda@adacore.com>
329 * sem_ch13.adb (Analyze_One_Aspect): Fix code locating the entity
332 2024-06-21 Marc Poulhiès <poulhies@adacore.com>
334 * make.adb (Scan_Make_Arg): Adjust error message.
335 * gnatls.adb (Search_RTS): Likewise.
336 * switch-b.adb (Scan_Debug_Switches): Likewise.
338 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
340 * einfo.ads (Direct_Primitive_Operations): Mention concurrent types
341 as well as GNAT extensions instead of implementation details.
342 (Primitive_Operations): Document that Direct_Primitive_Operations is
343 also used for concurrent types as a fallback.
344 * einfo-utils.adb (Primitive_Operations): Tweak formatting.
345 * exp_util.ads (Find_Prim_Op): Adjust description.
346 * exp_util.adb (Make_Subtype_From_Expr): In the private case with
347 unknown discriminants, always copy Direct_Primitive_Operations and
348 do not overwrite the Class_Wide_Type of the expression's base type.
349 * sem_ch3.adb (Analyze_Incomplete_Type_Decl): Tweak comment.
350 (Analyze_Subtype_Declaration): Remove older and now dead calls to
351 Set_Direct_Primitive_Operations. Tweak comment.
352 (Build_Derived_Private_Type): Likewise.
353 (Build_Derived_Record_Type): Likewise.
354 (Build_Discriminated_Subtype): Set Direct_Primitive_Operations in
355 all cases instead of just for tagged types.
356 (Complete_Private_Subtype): Likewise.
357 (Derived_Type_Declaration): Tweak comment.
358 * sem_ch4.ads (Try_Object_Operation): Adjust description.
360 2024-06-21 Doug Rupp <rupp@adacore.com>
362 * init.c [vxworks] (__gnat_install_handler): Revert to
363 installing signal handlers without regard to interrupt_state.
365 2024-06-21 Javier Miranda <miranda@adacore.com>
367 * sem_disp.adb (Find_Hidden_Overridden_Primitive): Check
368 public dispatching primitives of ancestors; previously,
369 only immediately-visible primitives were checked.
371 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
373 * checks.adb (Generate_Index_Checks): Add specific treatment for
374 index expressions that are N_Expression_With_Actions nodes.
376 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
378 * sem_ch4.adb (Analyze_Selected_Component): Rename Name into Pref
379 and use Sel local variable consistently.
380 (Is_Simple_Indexed_Component): New predicate.
381 Call Is_Simple_Indexed_Component to determine whether to build an
382 actual subtype for the component.
384 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
386 * freeze.adb (Freeze_Array_Type): Decouple the handling of the
387 interaction between packing and aliased/atomic components from
388 that of the interaction between a component clause and aliased/
389 atomic components, and retrofit the processing of the interaction
390 between the two characteristics and independent components into
391 the common processing.
393 2024-06-21 Bob Duff <duff@adacore.com>
395 * gen_il-gen-gen_nodes.adb
396 (N_Generic_Package_Declaration): Remove Activation_Chain_Entity.
397 * sinfo.ads: Comment improvements. Add missing doc.
398 Remove obsolete comment about Activation_Chain_Entity.
399 * einfo.ads: Comment improvements. Add missing doc.
400 * einfo-utils.adb (Base_Type): Add Assert (disabled for now).
401 (Next_Index): Minor cleanup.
402 * aspects.ads: Minor comment fix.
403 * exp_ch6.adb: Likewise.
404 * sem_ch3.adb: Likewise.
406 2024-06-21 Piotr Trojanek <trojanek@adacore.com>
408 * sem_ch3.adb (Add_Interface_Tag_Components): Simplify with No.
410 2024-06-21 Steve Baird <baird@adacore.com>
412 * sem_ch4.adb (Is_Effectively_Visible_Operator): A new function.
413 (Check_Arithmetic_Pair): In paths where Add_One_Interp was
414 previously called unconditionally, instead call only if
415 Is_Effectively_Visible_Operator returns True.
416 (Check_Boolean_Pair): Likewise.
417 (Find_Unary_Types): Likewise.
419 2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
421 * accessibility.adb (Accessibility_Level): Apply the processing to
422 Expr when its Original_Node is an unanalyzed identifier.
424 2024-06-21 Piotr Trojanek <trojanek@adacore.com>
426 * sem_attr.adb (In_Aspect_Specification): Use the standard
427 condition that works correctly with declare expressions.
428 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Replace
429 ordinary analysis with preanalysis of spec expressions.
431 2024-06-21 Justin Squirek <squirek@adacore.com>
433 * csets.ads (Identifier_Char): New function - replacing table.
434 * csets.adb (Identifier_Char): Rename and move table for static values.
435 (Initialize): Remove dynamic calculations.
436 (Identifier_Char): New function to calculate dynamic values.
437 * opt.adb (Set_Config_Switches): Remove setting of Identifier_Char.
439 2024-06-20 Steve Baird <baird@adacore.com>
441 * sem_attr.adb (Resolve_Attribute.Proper_Op): When resolving the
442 name of the reducer subprogram in a reduction expression,
443 Proper_Op treats references to operators defined in Standard
444 specially. Disable this special treatment if the type of the
445 reduction expression is not the right class of type for the
446 operator, or if a new Boolean parameter (named "Strict") is True.
447 (Resolve_Attribute): In the overloaded case, iterate over the
448 reducer subprogram candidates twice. First with Strict => True and
449 then, if no good intepretation is found, with Strict => False.
451 2024-06-20 Yannick Moy <moy@adacore.com>
453 * ghost.adb (Check_Ghost_Type): Fix checking.
455 2024-06-20 Bob Duff <duff@adacore.com>
457 * expander.ads: Minor comment fixes.
458 * nlists.ads: Misc comment improvements.
459 * sem_aux.ads (First_Discriminant): Improve comment.
460 * sem_ch12.adb: Misc cleanups.
461 (Associations): New package containing type Gen_Assocs_Rec
462 to represent matchings, and function Match_Assocs to create the
463 Gen_Assocs_Rec constant.
464 (Analyze_Associations): Call Match_Assocs, and other major
465 changes related to that.
466 * sem_ch12.ads: Minor comment fixes.
467 * sem_ch3.adb: Minor comment fixes.
469 2024-06-20 Steve Baird <baird@adacore.com>
471 * doc/gnat_rm/gnat_language_extensions.rst: Update documentation.
472 * doc/gnat_rm/implementation_defined_pragmas.rst: Update
475 (Error_Msg_GNAT_Extension): Update error message text.
476 * par-prag.adb: Update pragma parsing. This includes changing the
477 the name of the Check_Arg_Is_On_Or_Off formal parameter All_OK_Too
478 to All_Extensions_OK_Too.
479 * sem_prag.adb (Analyze_Pragma): In analyzing an
480 Extensions_Allowed pragma, replace uses of Name_All with
481 Name_All_Extensions; update a comment to reflect this.
482 * snames.ads-tmpl: Add Name_All_Extensions declaration.
483 * gnat_rm.texi: Regenerate.
485 2024-06-20 Gary Dismukes <dismukes@adacore.com>
487 * sem_ch4.adb (Try_Selected_Component_In_Instance): Reverse if_statement
488 clauses so that the testing for the special case of extensions of private
489 types in instance bodies is done first, followed by the testing for the case
490 of a parent type that's a generic actual type. In the extension case, apply
491 Base_Type to the type actual in the test of Used_As_Generic_Actual, and add
492 a test of Present (Parent_Subtype (Typ)).
494 2024-06-20 Yannick Moy <moy@adacore.com>
496 * inline.adb (Establish_Actual_Mapping_For_Inlined_Call): In the
497 case of formal with a fixed lower bounds, insert appropriate
498 conversion like in the case of a constrained type.
499 * tbuild.adb (Unchecked_Convert_To): Do not skip the conversion
500 when it may involve sliding due to a type with fixed lower bound.
502 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
504 * sem_ch12.adb (Instantiate_Formal_Package): Accept renamings of a
505 generic parent that is a child unit for the abbreviated instance.
507 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
509 * exp_ch4.adb (Expand_Composite_Equality): In the untagged record
510 case, always look for a user-defined equality operator in Ada 2012.
512 2024-06-20 Doug Rupp <rupp@adacore.com>
514 * ali.ads (Interrupts_Default_To_System): New boolean.
515 (Interrupts_Default_To_System_Specified): New boolean.
516 * ali.adb (Interrupts_Default_To_System_Specified): Initialize.
517 (Interrupts_Default_To_System): Initialize.
518 (Scan_ALI): Processing for "ID".
519 * bindgen.adb: Coallesce comments on interrupt settings to ...
520 (Gen_Adainit): Import Interrupts_Default_To_System flag and set if
522 (Gen_Output_File_Ada): Generate Local_Interrupt_States according
525 [vxworks] (__gnat_install_handler): Test for interrupt_state.
526 (__gl_interrupts_default_to_system): New global flag.
527 (__gnat_get_interrupt_State): return interrupt state according to
529 * lib-writ.ads: Document "ID".
530 * lib-writ.adb: Write out "ID".
531 * opt.ads (Interrupts_System_By_Default): New boolean, defaulted
533 * par-prag.adb (Pragma_Interrupts_System_By_Default): New.
534 * sem_prag.adb (Pragma_Interrupts_System_By_Default): Handle it.
535 (Pragma_Interrupts_System_By_Default): Default it.
536 * snames.ads-tmpl (Name_Interrupts_System_By_Default): New name.
537 (Pragma_Interrupts_System_By_Default): New
538 * libgnarl/s-intman__posix.adb (Initialize): Ensure the
539 Keep_Unmasked signal is sigset-able.
540 * doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma
541 Interrupts_System_By_Default.
542 * doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration
543 pragmas): Add Interrupts_System_By_Default. (Partition-Wide
544 Settings): Mention pragma Interrupts_System_By_Default.
545 * gnat_rm.texi: Regenerate.
546 * gnat_ugn.texi: Regenerate.
548 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
550 * exp_ch4.adb (Expand_Array_Equality.Component_Equality): Copy the
551 Comes_From_Source flag from the original test to the new one, and
552 remove obsolete code dealing with unchecked unions.
553 * sem_util.adb (Has_Inferable_Discriminants): Return False for an
554 incomplete or private nominal subtype.
556 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
558 * freeze.adb (Freeze_Expression): Also attach pending freeze nodes
559 to the parent in the case of an internal block in a spec expression.
561 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
563 * debug.adb (d_l): Document new usage for the compiler.
564 * freeze.adb (Check_Strict_Alignment): Set the Strict_Alignment
565 flag on array types with aliased component, except if the
566 component size is equal to the storage unit or the -gnatd_l switch
569 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
571 * doc/gnat_rm/implementation_advice.rst (Representation Clauses):
572 Remove >> marker and add end of sentence after code-block directive.
573 (RM 13.5.3(7-8)): Update to Ada 2005 wording.
574 * doc/gnat_rm/implementation_defined_characteristics.rst
575 (RM 13.5.3(5)): Likewise.
576 * gnat_rm.texi: Regenerate.
577 * gnat_ugn.texi: Regenerate.
579 2024-06-20 Piotr Trojanek <trojanek@adacore.com>
581 * doc/gnat_rm/implementation_defined_aspects.rst
582 (Aspect Subprogram_Variant): Refer to SPARK User's Guide.
583 * doc/gnat_rm/implementation_defined_pragmas.rst
584 (Pragma Subprogram_Variant): Document syntax to satisfy the
585 convention; refer to SPARK User's Guide for semantics.
586 * gnat_rm.texi: Regenerate.
587 * gnat_ugn.texi: Regenerate.
589 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
591 * freeze.adb (Freeze_Array_Type): Call Propagate_Controlled_Flags
592 to propagate the controlled flags from the component to the array.
593 (Freeze_Record_Type): Propagate the Finalize_Storage_Only flag
594 from the components to the record.
595 * sem_ch3.adb (Analyze_Private_Extension_Declaration): Do not call
596 Propagate_Concurrent_Flags here but...
597 (Array_Type_Declaration): Tidy and call Propagate_Controlled_Flags
598 to propagate the controlled flags from the component to the array.
599 (Build_Derived_Private_Type): Do not propagate the controlled flags
601 (Build_Derived_Record_Type): ...call Propagate_Controlled_Flags to
602 propagate the controlled flags from parent to derived type.
603 (Build_Derived_Type): Likewise.
604 (Copy_Array_Base_Type_Attributes): Call Propagate_Controlled_Flags
605 to copy the controlled flags.
606 (Record_Type_Definition): Streamline the propagation of the
607 Finalize_Storage_Only flag from the components to the record.
608 * sem_ch7.adb (Preserve_Full_Attributes): Use Full_Base and call
609 Propagate_Controlled_Flags to copy the controlled flags.
610 * sem_ch9.adb (Analyze_Protected_Definition): Use canonical idiom
611 to compute Has_Controlled_Component.
612 (Analyze_Protected_Type_Declaration): Minor tweak.
613 * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Do not deal with
614 Finalize_Storage_Only here.
615 * sem_util.ads (Propagate_Controlled_Flags): New declaration.
616 * sem_util.adb (Propagate_Controlled_Flags): New procedure.
618 2024-06-20 Piotr Trojanek <trojanek@adacore.com>
620 * freeze.adb (Check_Current_Instance): This routine is only called
621 with parameter E being a type entity, so there is no need to check
622 for types just before the equality with E.
623 * sem_ch13.adb (Analyze_Aspect_Specifications): Regroup condition
624 to avoid unnecessary evaluation.
625 (Check_Aspect_At_End_Of_Declarations): If In_Instance is true,
626 then the routine exits early.
628 2024-06-20 Piotr Trojanek <trojanek@adacore.com>
630 * freeze.adb (Find_Aspect_No_Parts): Tune whitespace.
631 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Fix style.
633 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
635 * aspects.ads (Aspect_Id): Remove Aspect_Max_Entry_Queue_Depth.
636 (global arrays): Remove entry for it.
637 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove
638 reference to pragma Max_Entry_Queue_Depth in comment.
639 * par-prag.adb (Prag): Remove handling of
640 Pragma_Max_Entry_Queue_Depth.
641 * sem_ch13.adb (Analyze_Aspect_Specifications): Remove reference
642 to aspect Max_Entry_Queue_Depth in comment.
643 (Analyze_Aspect_Specifications): Remove processing of aspect
644 Max_Entry_Queue_Depth.
645 (Check_Aspect_At_Freeze_Point): Likewise.
646 * sem_prag.ads (Find_Related_Declaration_Or_Body): Remove
647 reference to pragma Max_Entry_Queue_Depth in comment.
648 * sem_prag.adb (Analyze_Pragma): Remove processing of pragma
649 Max_Entry_Queue_Depth.
650 (Sig_Flags): Remove entry for Pragma_Max_Entry_Queue_Depth.
651 * sem_util.adb (Get_Max_Queue_Length): Remove handling of pragma
652 Max_Entry_Queue_Depth.
653 (Has_Max_Queue_Length): Likewise.
654 * snames.ads-tmpl (Name_Max_Entry_Queue_Depth): Move back from
655 pragmas section to others section.
656 (Pragma_Id): Remove Pragma_Max_Entry_Queue_Depth.
658 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
660 * doc/gnat_rm/gnat_language_extensions.rst (Pragma Storage_Model):
661 Rename to Storage Model.
662 * doc/gnat_rm/implementation_defined_aspects.rst: Alphabetize.
663 * gnat_rm.texi: Regenerate.
664 * gnat_ugn.texi: Regenerate.
666 2024-06-20 Ronan Desplanques <desplanques@adacore.com>
668 * gnat1drv.adb (Gnat1drv): Add coverage instrumentation
671 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
673 * exp_ch3.adb (Expand_Freeze_Array_Type): Do not propagate the
674 concurrent flags and the Has_Controlled_Component flag here.
675 (Expand_Freeze_Record_Type): Likewise.
676 * freeze.adb (Freeze_Array_Type): Propagate the concurrent flags.
677 (Freeze_Record_Type): Likewise.
678 * sem_util.adb (Has_Some_Controlled_Component): Adjust comment.
680 2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
682 * mutably_tagged.ads: Fix minor issues in comments throughout.
684 2024-06-20 Richard Kenner <kenner@adacore.com>
686 * debug.adb: Add documentation for -gnatd_w.
688 2024-06-20 Viljar Indus <indus@adacore.com>
690 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update
691 documentation for -gnatw.v.
692 * sem_ch13.adb: Convert all -gnatw.v related messages to warnings.
693 * gnat_ugn.texi: Regenerate.
695 2024-06-20 Viljar Indus <indus@adacore.com>
697 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update
698 documentation for -gnatw.n switch.
699 * exp_util.adb: Convert info messages into warnings.
700 * gnat_ugn.texi: Regenerate.
702 2024-06-20 Viljar Indus <indus@adacore.com>
704 * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
706 * errout.adb (Error_Msg_Internal): Stop printing info messages if
708 * opt.ads: Add Info_Suppressed flag to track whether info messages
709 should be suppressed.
710 * switch-c.adb: Add parsing for -gnatis.
711 * gnat_ugn.texi: Regenerate.
713 2024-06-20 Viljar Indus <indus@adacore.com>
715 * atree.ads: Remove Warning_Info_Messages.
716 * errout.adb: Remove various places where Warning_Info_Messages
718 * erroutc.adb: Remove various places where Warning_Info_Messages
719 was used. Create Error_Msg_Object objects with only an info
720 attribute if the message contained both info and warning insertion
721 characters. New method Has_Switch_Tag for detecting if a message
722 should have an error tag.
723 * errutil.adb: Create Error_Msg_Object objects with only an info
724 attribute if the message contained both info and warning insertion
727 2024-06-20 Justin Squirek <squirek@adacore.com>
729 * doc/gnat_rm/gnat_language_extensions.rst: Add entry for 'Super.
730 * doc/gnat_rm/implementation_defined_attributes.rst: Remove entry
732 * gnat_rm.texi: Regenerate.
733 * gnat_ugn.texi: Regenerate.
735 2024-06-20 Steve Baird <baird@adacore.com>
737 * gprep.adb (Process_Files.Process_One_File): When calling OS_Exit in an error
738 path, pass in a Status parameter of 1 instead of 0 (because 0
740 * lib-load.adb (Load_Main_Source): Do not emit a message about a missing source file
741 if other error messages were generated by calling Load_Source_File;
742 the file isn't missing - it failed preprocessing.
744 2024-06-20 Piotr Trojanek <trojanek@adacore.com>
746 * sem_attr.adb (Attribute_22): Add Put_Image and Object_Size.
747 * sem_attr.ads (Attribute_Impl_Def): Remove Object_Size.
749 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
751 * gcc-interface/Makefile.in (tmake_file): Remove all references.
753 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
755 * gcc-interface/decl.cc: Include function.h.
756 (gnat_to_gnu_param): Minor comment tweaks.
757 (gnat_to_gnu_subprog_type): Take into account the default for the
758 computation of the return mechanism. Give a warning if a by-copy
759 specified mechanism cannot be honored.
761 2024-06-14 Yannick Moy <moy@adacore.com>
763 * gcc-interface/trans.cc (elaborate_all_entities_for_package)
764 (process_freeze_entity): Skip entities of kind E_Subprogram_Body.
766 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
769 * gcc-interface/trans.cc (maybe_make_gnu_thunk): Create an alias
770 instead of a null thunk.
772 2024-06-14 Marc Poulhiès <poulhies@adacore.com>
774 * gcc-interface/decl.cc (gnat_to_gnu_entity): Typo fix.
775 (gnat_to_gnu_component_type): Indent fix.
776 * gcc-interface/gigi.h (build_call_alloc_dealloc): Typo fix.
777 * gcc-interface/utils.cc (make_dummy_type): Typo fix.
778 * gcc-interface/utils2.cc (gnat_protect_expr): Indent fix.
780 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
782 * aspects.ads (Aspect_Id): Alphabetize, remove the GNAT tag from
783 Default_Initial_Condition and Object_Size, move No_Controlled_Parts
784 and No_Task_Parts to boolean subclass.
785 (Nonoverridable_Aspect_Id): Add missing Ada 2022 aspects.
786 (Implementation_Defined_Aspect): Add all missing aspects, remove
787 Max_Entry_Queue_Length and Object_Size
788 (Aspect_Argument): Remove specific entries for No_Controlled_Parts
789 and No_Task_Parts, list boolean aspects last.
790 (Is_Representation_Aspect ): Move boolean aspects last.
791 (Aspect_Names): Alphabetize.
792 * sem_ch13.adb (Analyze_Aspect_Disable_Controlled): Adjust.
793 (Analyze_Aspect_Specifications): Move around processing for
794 No_Controlled_Parts and No_Task_Parts.
795 (Check_Aspect_At_Freeze_Point): Remove specific entries for
796 No_Controlled_Parts and No_Task_Parts
798 2024-06-14 Steve Baird <baird@adacore.com>
801 (Expand_Loop_Entry_Attribute):
802 Ensure that Etype of the saved expression is set correctly.
804 2024-06-14 Jerome Guitton <guitton@adacore.com>
806 * sysdep.c (S_dosFsLib_FILE_NOT_FOUND, S_nfsLib_NFSERR_NOENT):
807 New macros, falback to ENOENT when not already defined.
808 (__gnat_is_file_not_found_error): Use these new macros to remove
809 tests against VxWorks flavors.
811 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
813 * snames.ads-tmpl (Name_Present): Move to Repinfo section.
815 2024-06-14 Justin Squirek <squirek@adacore.com>
817 * doc/gnat_rm/gnat_language_extensions.rst: Add documentation for
818 mutably tagged type feature.
819 * aspects.ads: Add registration for 'Size'Class.
820 * einfo.ads: Add documentation for new components
821 Class_Wide_Equivalent_Type and Is_Mutably_Tagged_Type.
822 * exp_aggr.adb (Gen_Assign): Assume associated mutably tagged type
823 when class-wide equivalent type is encountered.
824 (Contains_Mutably_Tagged_Type): New subprogram.
825 (Convert_To_Positional): Assume associated mutably tagged type
826 when class-wide equivalent type is encountered.
827 (Is_Static_Element): Assume associated mutably tagged type when
828 class-wide equivalent type is encountered.
829 (Expand_Array_Aggregate): Assume associated mutably tagged type
830 when class-wide equivalent type is encountered.
831 (Expand_Record_Aggregate): Force mutably tagged records to be
832 expanded into assignments.
833 * exp_ch3.adb (Build_Array_Init_Proc): Assume associated mutably
834 tagged type when class-wide equivalent type is encountered.
835 (Simple_Initialization_OK): Disallow simple initialization for
836 class-wide equivalent types.
837 (Build_Init_Statements): Assume associated mutably tagged type
838 when class-wide equivalent type is encountered.
839 (Expand_Freeze_Array_Type): Ignore building of record init procs
840 for mutably tagged types.
841 (Expand_N_Full_Type_Declaration): Replace mutably tagged type
842 declarations with their associated class-wide equivalent types.
843 (Default_Initialize_Object): Add special handling for mutably
845 * exp_ch4.adb (Expand_N_Allocator): Add initialization for mutably
847 (Expand_Record_Equality): Generate mutably tagged unchecked
849 * exp_ch5.adb (Expand_N_Assignment_Statement): Generate a special
850 assignment case for class-wide equivalent types which does tag
851 assignments and ignores certain checks.
852 * exp_ch6.adb (Expand_Call_Helper): Propagate constrained extra
853 formal actuals for mutably tagged types.
854 * exp_ch7.adb (Make_Init_Call): Handle mutably tagged type
856 * exp_util.adb (Make_CW_Equivalent_Type): Modify to handle mutably
857 tagged objects which contain no initialization expression.
858 (Make_Subtype_From_Expr): Modify call to Make_CW_Equivalent_Type.
859 * exp_util.ads (Make_CW_Equivalent_Type): Move declaration from
861 * freeze.adb (Size_Known): No longer return false automatically
862 when a class-wide type is encountered.
863 (Freeze_Entity): Ignore error messages about size not being known
864 for mutably tagged types.
865 * gen_il-fields.ads: Register new fields
866 Class_Wide_Equivalent_Type and Is_Mutably_Tagged_Type.
867 * gen_il-gen-gen_entities.adb: Register new fields
868 Class_Wide_Equivalent_Type and Is_Mutably_Tagged_Type for type
870 * mutably_tagged.adb, mutably_tagged.ads
871 (Corresponding_Mutably_Tagged_Type): New subprogram.
872 (Depends_On_Mutably_Tagged_Ext_Comp): New subprogram.
873 (Get_Corresponding_Mutably_Tagged_Type_If_Present): New
875 (Get_Corresponding_Tagged_Type_If_Present): New subprogram.
876 (Is_Mutably_Tagged_Conversion): New subprogram.
877 (Is_Mutably_Tagged_CW_Equivalent_Type): New subprogram.
878 (Make_Mutably_Tagged_Conversion): New subprogram.
879 (Make_CW_Size_Compile_Check): New subprogram.
880 (Make_Mutably_Tagged_CW_Check): New subprogram.
881 * sem_aggr.adb (Resolve_Array_Aggregate): Skip tag checks for
882 class-wide equivalent types.
883 (Resolve_Aggr_Expr): Assume associated mutably tagged type when
884 class-wide equivalent type is encountered.
885 * sem_attr.adb (Analyze_Attribute): Allow 'Tag on mutably tagged
887 (Resolve_Attribute): Detect errors for dependence of mutably
888 tagged extension type component.
889 * sem_ch12.adb (Instantiate_Object): Detect errors for dependence
890 of mutably tagged extension type component.
891 * sem_ch13.adb (Analyze_One_Aspect): Propagate 'Size'Class to
893 (Analyze_Attribute_Definition_Clause): Add handling of 'Size'Class
894 by generating class-wide equivalent types and checking for illegal
896 * sem_ch2.adb (Analyze_Identifier): Generate unchecked conversion
897 for class-wide equivalent types.
898 * sem_ch3.adb (Analyze_Component_Declaration): Avoid unconstrained
899 errors on mutably tagged types.
900 (Analyze_Object_Declaration): Rewrite declarations of mutably
901 tagged types to use class-wide equivalent types.
902 (Array_Type_Declaration): Modify arrays of mutably tagged types to
903 use their corresponding class-wide equivalent types.
904 (Derived_Type_Declaration): Add various checks for mutably tagged
906 * sem_ch4.adb (Analyze_Allocator): Replace reference to mutably
907 tagged type with cooresponding tagged type.
908 (Process_Indexed_Component): Generate unchecked conversion for
909 class-wide equivalent type.
910 (Analyze_One_Call): Generate unchecked conversion for class-wide
912 (Analyze_Selected_Component): Assume reference to class-wide
913 equivalent type is associated mutably tagged type.
914 (Analyze_Type_Conversion): Generate unchecked conversion for
915 class-wide equivalent type.
916 * sem_ch5.adb (Analyze_Assignment): Assume associated mutably
917 tagged type when class-wide equivalent type is encountered.
918 (Analyze_Iterator_Specification): Detect errors for dependence of
919 mutably tagged extension type component.
920 * sem_ch6.adb (Create_Extra_Formals): Add code to generate extra
921 formal for mutably tagged types to signal if they are constrained.
922 * sem_ch8.adb (Analyze_Object_Renaming): Detect error on renaming
923 of mutably tagged extension type component.
924 (Analyze_Renaming_Primitive_Operation): Detect error on renaming
925 of mutably tagged extension type component.
926 * sem_res.adb (Resolve_Actuals): Allow class-wide arguments on
927 class-wide equivalent types.
928 (Valid_Conversion): Assume associated mutably tagged type when
929 class-wide equivalent type is encountered.
930 * sem_util.adb (Is_Fully_Initialized_Type): Flag mutably tagged
931 types as fully initialized.
932 (Needs_Simple_Initalization): Flag class-wide equivalent types as
933 needing initialization.
934 * gnat_rm.texi: Regenerate.
935 * gcc-interface/Make-lang.in: Add entry for mutably_tagged.o.
937 2024-06-14 Justin Squirek <squirek@adacore.com>
940 (Accessibility_Level): Replace call Get_Full_View with call to
941 Full_View since Get_Full_View only works with incomplete types.
943 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
945 * aspects.ads (Operational_Aspect): Alphabetize.
946 * sem_ch13.ads (Analyze_Aspects_At_Freeze_Point): Fix description.
947 * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point) <Aggregate>: Give
948 the error for array types here instead of...
949 (Analyze_Aspect_Specifications) <Aggregate>: Adjust comment.
950 (Check_Aspect_At_Freeze_Point) <Aggregate>: ...here.
952 2024-06-14 Javier Miranda <miranda@adacore.com>
954 * exp_aggr.adb (Must_Slide): Add missing support for
955 multidimensional arrays.
957 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
959 * freeze.adb (Freeze_All): Call Check_Aspects_At_End_Of_Declarations
960 to perform the visibility check for aspects.
961 * sem_ch13.ads (Check_Aspects_At_End_Of_Declarations): Declare.
962 (Check_Aspect_At_Freeze_Point): Move to...
963 (Check_Aspect_At_End_Of_Declarations): Move to...
964 * sem_ch13.adb (Check_Aspect_At_Freeze_Point): ...here.
965 (Check_Aspect_At_End_Of_Declarations): ...here.
966 (Analyze_Aspect_Specifications): Remove peculiar processing for
967 Stable_Properties, Designated_Storage_Model, Storage_Model_Type
968 and Aggregate. Move that of Local_Restrictions around. Reset
969 Aitem at the beginning of the loop for each aspect.
970 (Check_Aspects_At_End_Of_Declarations): New procedure.
972 2024-06-14 Justin Squirek <squirek@adacore.com>
975 (Analyze_Attribute): Add check for dereference.
977 2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
979 * snames.ads-tmpl (Name_Storage_Model): Delete.
981 2024-06-14 Alexandre Oliva <oliva@gnu.org>
984 2024-06-12 Alexandre Oliva <oliva@adacore.com>
986 * gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type
987 as the debug type for packed fields.
989 2024-06-13 Steve Baird <baird@adacore.com>
992 (Insert_Actions): Code was relying on an incorrect assumption that an
993 N_Itype_Reference cannot occur in declaration list or a statement
994 list. Fix the code to handle this case.
996 2024-06-13 Viljar Indus <indus@adacore.com>
998 * debug.adb: Remove mentions of -gnatdJ.
999 * errout.adb: Remove printing subprogram names to JSON.
1000 * erroutc.adb: Remove printing subprogram names in messages.
1001 * erroutc.ads: Remove Node and Subprogram_Name_Ptr used for -gnatdJ.
1002 * errutil.adb: Remove Node used for -gnatdJ
1003 * gnat1drv.adb: Remove references of -gnatdJ and
1004 Include_Subprgram_In_Messages.
1005 * opt.ads: Remove Include_Subprgram_In_Messages
1006 * par-util.adb: Remove behavior related to
1007 Include_Subprgram_In_Messages.
1008 * sem_util.adb: Remove Subprogram_Name used for -gnatdJ
1010 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1012 * exp_ch7.adb (Attach_Object_To_Master_Node): Fix formatting.
1013 (Build_Finalizer.Process_Object_Declaration): Synthesize a local
1014 Finalize_Address primitive if the object's subtype is an array
1015 that has a constrained first subtype and is not this first subtype.
1016 * exp_util.adb (Find_Last_Init): Get again to the base type in the
1019 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1021 * doc/gnat_rm/implementation_defined_attributes.rst (Iterable):
1023 * gnat_rm.texi: Regenerate.
1024 * gnat_ugn.texi: Regenerate.
1026 2024-06-13 Yannick Moy <moy@adacore.com>
1028 * sem_util.adb (Check_Ambiguous_Aggregate): Fix test.
1030 2024-06-13 Javier Miranda <miranda@adacore.com>
1032 * freeze.ads (Check_Condition_Entities): Complete documentation.
1033 * freeze.adb (Check_Inherited_Conditions): Extend its functionality to
1034 build two kind of wrappers: the existing LSP wrappers, and wrappers
1035 required to handle postconditions of interface primitives implemented
1036 by inherited primitives.
1037 (Build_Inherited_Condition_Pragmas): Rename formal.
1038 (Freeze_Record_Type): For derived tagged types, move call to
1039 Check_Inherited_Conditions to subprogram Freeze_Entity_Checks;
1040 done to improve the performance of Check_Inherited_Conditions since it
1041 can rely on the internal entities that link interface primitives with
1042 tagged type primitives that implement them.
1043 (Check_Interface_Primitives_Strub_Mode): New subprogram.
1044 * sem_ch13.adb (Freeze_Entity_Checks): Call Check_Inherited_Conditions.
1045 Call Check_Inherited_Conditions with derived interface types to check
1046 strub mode compatibility of their primitives.
1047 * sem_disp.adb (Check_Dispatching_Operation): Adjust assertion to accept
1048 wrappers of interface primitives that have classwide postconditions.
1049 * exp_disp.adb (Write_DT): Adding text to identify wrappers.
1051 2024-06-13 Viljar Indus <indus@adacore.com>
1053 * sem_res.adb (Resolve_Call): add warning insertion
1054 character into the info message.
1056 2024-06-13 Steve Baird <baird@adacore.com>
1059 (New_Copy_Tree.Visit_Entity): Delete code that prevented copying some entities.
1061 2024-06-13 Bob Duff <duff@adacore.com>
1063 * sem_ch12.adb (Check_Fixed_Point_Actual): Minor rewording; it seems
1064 more proper to say "operator" rather than "operation".
1065 (Matching_Actual): Give an error for <> in positional notation.
1066 This is a syntax error. Disable this for now.
1067 (Analyze_Associations): Copy the use clause in all cases.
1068 The "mustn't recopy" comment seems wrong, because New_Copy_Tree
1070 * libgnat/a-ticoau.ads: Fix violation of new postion-box error.
1071 * libgnat/a-wtcoau.ads: Likewise.
1072 * libgnat/a-ztcoau.ads: Likewise.
1074 2024-06-13 Viljar Indus <indus@adacore.com>
1076 * par-labl.adb (Rewrite_As_Loop): Remove info message
1078 2024-06-13 Viljar Indus <indus@adacore.com>
1080 * par-ch7.adb: Remove warning characters from info message
1081 * par-endh.adb: Remove warning characters from info message
1082 * sem_res.adb: Remove warning characters from info message
1084 2024-06-13 Viljar Indus <indus@adacore.com>
1086 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): change the
1087 info message to a continuation message.
1089 2024-06-13 Viljar Indus <indus@adacore.com>
1091 * inline.adb (Cannot_Inline): Simplify string handling logic.
1093 2024-06-13 Yannick Moy <moy@adacore.com>
1095 * exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Skip entities
1096 of kind E_Subprogram_Body.
1097 * repinfo.adb (List_Entities): Remove special case for subprogram
1099 * sem_ch6.adb (Analyze_Subprogram_Body_Helper): List subprogram
1100 body entities in the enclosing scope.
1102 2024-06-13 Javier Miranda <miranda@adacore.com>
1104 * sem_ch4.adb (Traverse_Interfaces): Add missing support
1105 for climbing to parents of interface types.
1107 2024-06-13 Steve Baird <baird@adacore.com>
1109 * doc/gnat_rm/implementation_defined_attributes.rst:
1110 Update Super attribute documentation.
1111 * gnat_rm.texi: Regenerate.
1112 * gnat_ugn.texi: Regenerate.
1114 2024-06-13 Ronan Desplanques <desplanques@adacore.com>
1116 * exp_ch7.adb (Build_Cleanup_Statements): Adapt to changes
1117 made to Build_Protected_Subprogram_Call_Cleanup.
1118 * exp_ch9.adb (Make_Unlock_Statement, Wrap_Unprotected_Call):
1120 (Build_Protected_Subprogram_Body): Fix resource management in
1122 (Build_Protected_Subprogram_Call_Cleanup): Make use of newly
1123 introduced Make_Unlock_Statement.
1125 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1128 * exp_util.adb (Find_Renamed_Object): Recurse for any renaming.
1130 2024-06-13 Piotr Trojanek <trojanek@adacore.com>
1132 * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context):
1133 Iterate over encapsulating abstract states.
1135 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1137 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-imad32$(objext),
1138 s-imad64$(objext) and s-imagea$(objext).
1139 * exp_atag.ads (Build_Set_Size_Function): Replace Tag_Node parameter
1141 * exp_atag.adb: Add clauses for Sinfo.Utils.
1142 (Build_Set_Size_Function): Retrieve the TSD object statically.
1143 * exp_disp.adb: Add clauses for Ttypes.
1144 (Make_DT): Call Address_Image{32,64] instead of Address_Image.
1145 (Register_Primitive): Pass Tag_Typ to Build_Set_Size_Function.
1146 * rtsfind.ads (RTU_Id): Remove System_Address_Image and add
1147 System_Img_Address_{32;64}.
1148 (RE_Id): Remove entry for RE_Address_Image and add entries for
1149 RE_Address_Image{32,64}.
1150 * rtsfind.adb (System_Descendant): Adjust to above changes.
1151 * libgnat/a-tags.ads (Address_Array): Suppress initialization.
1152 * libgnat/s-addima.adb (System.Address_Image): Call the appropriate
1153 routine based on the address size.
1154 * libgnat/s-imad32.ads: New file.
1155 * libgnat/s-imad64.ads: Likewise.
1156 * libgnat/s-imagea.ads: Likewise.
1157 * libgnat/s-imagea.adb: Likewise.
1158 * gcc-interface/Make-lang.in (GNAT_ADA_OBJS) [$(STAGE1)=False]: Add
1159 ada/libgnat/s-imad32.o and ada/libgnat/s-imad64.o.
1161 2024-06-13 Yannick Moy <moy@adacore.com>
1163 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not inline
1164 when constant with address clause is found.
1166 2024-06-13 Ronan Desplanques <desplanques@adacore.com>
1168 * gnatlink.adb (Gnatlink): Fix incorrect lower bound assumption.
1169 (Is_Prefix): New function.
1171 2024-06-13 Steve Baird <baird@adacore.com>
1174 (Requires_Completion_In_Body): Modify the Comes_From_Source test so that
1175 the implicit declaration of an inherited subprogram does not cause
1176 an incorrect result of True.
1178 2024-06-13 Richard Kenner <kenner@adacore.com>
1180 * exp_ch6.adb (Expand_Ctrl_Function_Call): Inline if -gnatn in
1181 CCG mode even if -O0.
1183 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1186 * exp_util.adb (Find_Renamed_Object): Recurse if the renamed object
1187 is itself a renaming.
1189 2024-06-13 Javier Miranda <miranda@adacore.com>
1191 * sem_attr.adb (Analyze_Attribute): Enhance support for
1192 using 'Old with a prefix that references an overloaded
1193 function that has no parameters; add missing support
1194 for the use of 'Old within qualified expressions.
1195 * sem_util.ads (Preanalyze_And_Resolve_Without_Errors):
1197 * sem_util.adb (Preanalyze_And_Resolve_Without_Errors):
1200 2024-06-13 Piotr Trojanek <trojanek@adacore.com>
1202 * layout.adb (Layout_Type): Use high-level wrapper routine.
1203 * sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Likewise.
1204 * sem_ch3.adb (Analyze_Object_Declaration): Likewise.
1206 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1208 * libgnat/s-tsmona__linux.adb (Get): Move down descriptive comment.
1209 * libgnat/s-tsmona__mingw.adb: Add with clause and use clause for
1210 System.Storage_Elements.
1211 (Get): Pass GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT in the call
1212 to GetModuleHandleEx and remove the subsequent call to FreeLibrary.
1213 Upon success, set Load_Addr to the base address of the module.
1214 * libgnat/s-win32.ads (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS): Use
1216 (GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT): New constant.
1218 2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
1221 * exp_ch7.adb (Build_Finalizer.Process_Declarations): Remove dead
1222 code dealing with renamings.
1223 * exp_util.ads (Is_Finalizable_Transient): Rename Rel_Node to N.
1224 * exp_util.adb (Is_Finalizable_Transient): Likewise.
1225 (Is_Aliased): Remove obsolete code dealing wih EWA nodes and only
1226 consider renamings present in N itself.
1227 (Requires_Cleanup_Actions): Remove dead code dealing with renamings.
1229 2024-06-13 Javier Miranda <miranda@adacore.com>
1231 * sem_ch13.adb (Analyze_One_Aspect): Set the applicable policy
1232 of a type declaration when its aspect Dynamic_Predicate is
1234 * sem_prag.adb (Handle_Dynamic_Predicate_Check): New subprogram
1235 that enables or ignores dynamic predicate checks depending on
1236 whether dynamic checks are enabled in the context where the
1237 associated type declaration is defined; used in the analysis
1238 of pragma check. In addition, for pragma Predicate, do not
1239 disable it when the aspect was internally build as part of
1240 processing a dynamic predicate aspect.
1242 2024-06-12 Alexandre Oliva <oliva@adacore.com>
1244 * gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type
1245 as the debug type for packed fields.
1247 2024-06-10 Eric Botcazou <ebotcazou@adacore.com>
1249 * exp_ch4.adb (Expand_Nonbinary_Modular_Op): Create an explicit Mod
1250 for additive operations if No_Implicit_Conditionals is in effect.
1251 (Expand_Modular_Addition): Likewise.
1252 (Expand_Modular_Subtraction): Likewise.
1253 (Expand_Modular_Op): Always use an unsigned type obtained by calling
1254 Small_Integer_Type_For on the required size.
1256 2024-06-10 Javier Miranda <miranda@adacore.com>
1258 * sem_ch6.adb (Might_Need_BIP_Task_Actuals): Add support
1259 for access-to-subprogram parameter types.
1260 * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call):
1261 Add dummy BIP parameters to access-to-subprogram types
1262 that may reference a function that has BIP parameters.
1264 2024-06-10 Gary Dismukes <dismukes@adacore.com>
1266 * sem_prag.adb (Set_Convention_From_Pragma): If the specified convention on
1267 a record type is not C_Pass_By_Copy, then force the C_Pass_By_Copy flag to
1268 False, to ensure that it's overridden.
1270 2024-06-10 Gary Dismukes <dismukes@adacore.com>
1272 * sem_aggr.adb (Resolve_Iterated_Association): Change "not Present"
1273 to "No" in test of Add_Named_Subp.
1275 2024-06-10 Steve Baird <baird@adacore.com>
1278 (Should_Freeze_Type.Is_Dispatching_Call_Or_Aggregate): Treat an extension
1279 aggregate or a delta aggregate like a regular aggregate.
1281 2024-06-10 Gary Dismukes <dismukes@adacore.com>
1283 * sem_aggr.adb (Resolve_Iterated_Association): In the case of
1284 N_Iterated_Element_Associations that have a key expression, issue
1285 an error if the aggregate type does not have an Add_Named
1286 operation, and include a reference to RM22 4.3.5(24) in the error
1287 message. In the case of an N_Component_Association with a
1288 Defining_Identifer where the "choice" is given by a function call,
1289 in the creation of the iterator_specification associate a copy of
1290 Choice as its Name, and remove the call to
1291 Analyze_Iterator_Specification, which was causing problems with
1292 the reanalysis of function calls originally given in prefixed form
1293 that were transformed into function calls in normal (infix) form.
1294 The iterator_specification will be analyzed later in any case, so
1295 that call should not be done here. Remove the with and use of
1298 2024-06-10 Justin Squirek <squirek@adacore.com>
1300 * ali.adb (Get_Nat): Remove unnecessary parentheses.
1301 * exp_ch11.adb (Expand_Local_Exception_Handlers): Remove
1302 unnecessary parentheses.
1303 * freeze.adb (Freeze_Entity): Remove unnecessary parentheses.
1304 * lib-list.adb (List): Remove unnecessary parentheses.
1305 * par-ch5.adb (P_Condition): Add extra parentheses checks on
1307 * sem_ch3.adb (Add_Interface_Tag_Components): Remove unnecessary
1309 (Check_Delta_Expression): Remove unnecessary parenthesis.
1310 (Check_Digits_Expression): Remove unnecessary parentheses.
1311 * sem_ch12.adb (Validate_Array_Type_Instance): Remove unnecessary
1314 2024-06-10 Justin Squirek <squirek@adacore.com>
1316 * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Add
1317 expansion of filter condition.
1318 (Expand_Formal_Container_Loop): Add expansion of filter condition.
1320 2024-06-10 Justin Squirek <squirek@adacore.com>
1322 * accessibility.adb (Accessibility_Level): Use Get_Full_View to
1323 avoid crashes when calculating scope.
1325 2024-06-10 Justin Squirek <squirek@adacore.com>
1327 * sem_warn.adb (Warn_On_Unreferenced_Entity): Add a condition to
1328 ignore warnings on unreferenced abstract subprogram.
1330 2024-06-10 Justin Squirek <squirek@adacore.com>
1332 * sem_attr.adb (Analyze_Attribute): Add check for interface parent
1335 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1337 * einfo.ads, exp_attr.adb, exp_ch4.adb, exp_ch7.adb,
1338 lib-writ.adb, libgnat/a-stbuut.ads, sem_ch13.adb, sem_ch3.adb,
1339 sem_ch7.adb: Use "RM" in comments.
1341 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1344 (Immediate_Context_Implies_Is_Potentially_Unevaluated): Use
1345 collective subtypes in membership tests.
1346 (Is_Known_On_Entry): Require all alternatives in a case statement
1347 to return; this change could prevent a recently fixed glitch,
1348 where one of the alternatives relied on the return statement
1349 afterwards (also, the new code is shorter).
1350 * sem_util.ads (Is_Potentially_Unevaluated): Clarify that this
1351 routine applies to Ada 2012.
1353 2024-06-10 Yannick Moy <moy@adacore.com>
1355 * libgnat/a-chtgfo.adb (Generic_Read, Generic_Write): Remove.
1356 * libgnat/a-chtgfo.ads: Same. Remove dependency on Ada.Streams.
1358 2024-06-10 Ronan Desplanques <desplanques@adacore.com>
1360 * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of
1361 SetThreadAffinityMask.
1362 * libgnat/s-winext.ads (SetThreadAffinityMask): Fix binding
1365 2024-06-10 Ronan Desplanques <desplanques@adacore.com>
1367 * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage
1368 of SetThreadIdealProcessor.
1370 2024-06-10 Ronan Desplanques <desplanques@adacore.com>
1372 * libgnat/s-os_lib.adb (Normalize_Pathname): Remove incorrect
1374 (Missed_Drive_Letter): Rename into...
1375 (Drive_Letter_Omitted): This.
1377 2024-06-10 Ronan Desplanques <desplanques@adacore.com>
1379 * gnatlink.adb (Check_File_Name): Fix incorrect assumption.
1381 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1383 * exp_attr.adb (Expand_N_Attribute_Reference): Use constants
1384 declared at the beginning of subprogram; tune layout.
1385 * exp_ch3.adb (Predefined_Primitive_Bodies): Tune layout.
1387 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1389 * doc/gnat_rm/implementation_defined_pragmas.rst
1390 (No_Tagged_Streams): Move documentation.
1391 * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
1392 (No_Streams): Likewise.
1393 * exp_disp.adb (Make_DT): Extend comment.
1394 * gnat_rm.texi: Regenerate.
1395 * gnat_ugn.texi: Regenerate.
1397 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1399 * sem_attr.adb (Analyze_Attribute): Use fully qualified name
1400 without a NUL, so that it doesn't need to be skipped afterwards.
1402 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1404 * exp_ch3.adb (Stream_Operation_OK): Check restriction
1405 No_Default_Stream_Attributes before call to
1406 Type_Without_Stream_Operation.
1407 * sem_util.adb (Type_Without_Stream_Operation): Remove static
1408 condition from recursive routine
1410 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1412 * inline.adb (Has_Single_Return_In_GNATprove_Mode): Remove.
1413 (Process_Formals): When rewriting an occurrence of a formal
1414 parameter, use location of the occurrence, not of the inlined
1417 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1419 * debug.adb (d_k): Use first available debug switch.
1420 * gnat1drv.adb (Adjust_Global_Switches): If new debug switch is
1421 active then don't expand assertion expressions by default.
1423 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1425 * exp_ch6.adb (Install_Class_Preconditions_Check): Refactor
1426 common code for checking if precondition fails, since the
1427 difference is only in raising an exception or calling the
1428 Raise_Assert_Failure procedure.
1430 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1432 * exp_ch6.adb (Build_Dynamic_Check_Helper_Call): Remove unused
1433 iteration over formal parameters.
1435 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1437 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Make
1438 discriminants visible when analyzing aspect Interrupt_Priority.
1439 (Freeze_Entity_Checks): Likewise.
1440 (Resolve_Aspect_Expressions): Likewise for both aspects CPU and
1443 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1445 * sem_prag.adb (Report_Extra_Clauses): Remove redundant check
1446 for empty list, because First works also for No_List.
1448 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1450 * sem_prag.adb (Check_Dependency_Clause, Check_Output_States,
1451 Report_Extra_Clauses): Remove multiple checks for being inside
1453 (Analyze_Refined_Depends_In_Decl_Part): Add single check for
1454 being inside an instance.
1456 2024-06-10 Piotr Trojanek <trojanek@adacore.com>
1458 * sem_prag.adb (Check_In_Out_States, Check_Input_States,
1459 Check_Output_States, Check_Proof_In_States,
1460 Check_Refined_Global_List, Report_Extra_Constituents,
1461 Report_Missing_Items): Remove multiple checks for being inside
1463 (Analyze_Refined_Global_In_Decl_Part): Add single check for
1464 being inside an instance.
1466 2024-06-05 Kewen Lin <linkw@linux.ibm.com>
1468 * gcc-interface/decl.cc (gnat_to_gnu_entity): Use TYPE_PRECISION of
1469 long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
1471 2024-05-29 Eric Botcazou <ebotcazou@adacore.com>
1474 * Makefile.rtl (PowerPC/Linux): Use libgnat/s-atopri__32.ads for
1476 (SPARC/Linux): Likewise.
1478 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1481 * libgnarl/s-taprop__solaris.adb (Initialize): Fix pasto.
1482 * libgnat/s-oslock__solaris.ads (Owner_Int): Delete.
1483 (Owner_ID): Change the designated type to Integer.
1485 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1487 * gcc-interface/utils2.cc (nonbinary_modular_operation): Rewrite.
1488 Do not create signed types for subtraction, do not create types with
1489 partial precision, call fold_convert instead of convert throughout.
1491 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1493 * gcc-interface/decl.cc (gnat_to_gnu_entity): Use the Is_Base_Type
1494 predicate and remove superfluous calls to Base_Type.
1496 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1498 * gcc-interface/utils2.cc (gnat_protect_expr): Deal specifically
1499 with atomic loads. Document the relationship with gnat_save_expr.
1501 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1503 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: For a
1504 packed type implemented specially, temporarily save the XUA type as
1505 equivalent to the entity before processing the implementation type.
1506 For this implementation type, if its component type is the same as
1507 that of the original type, copy the alias set from the latter.
1508 <types>: Resort to universal aliasing for all interface types.
1509 * gcc-interface/trans.cc (Call_to_gnu): Add GNU_ACTUAL_TYPE local
1510 variable and rename existing one to GNU_UNPADDED_ACTUAL_TYPE.
1511 If the formal is passed by reference and the actual is a conversion,
1512 call aliasable_p to detect aliasing violations, issue a warning upon
1513 finding one and create the temporary in the target type.
1514 Add an assertion that no such violation has been missed above.
1515 (addressable_p): Revert latest changes.
1516 (aliasable_p): New predicate.
1517 * gcc-interface/utils2.cc (build_binary_op) <ARRAY_RANGE_REF>: When
1518 creating a new array type on the fly, preserve the alias set of the
1521 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1523 * gcc-interface/trans.cc (gnat_to_gnu) <N_Simple_Return_Statement>:
1524 In the return-by-invisible-reference case, remove conversions before
1525 looking for a dereference in the return values and building the test
1526 protecting against a useless copy operation.
1528 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1530 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Set
1531 TYPE_TYPELESS_STORAGE on the array types if Universal_Aliasing is
1532 set on the type or its component type.
1533 <E_Array_Subtype>: Likewise.
1534 For other aggregate types, set TYPE_TYPELESS_STORAGE in this case.
1535 (set_typeless_storage_on_aggregate_type): New function.
1536 (set_universal_aliasing_on_type): Likewise.
1537 * gcc-interface/trans.cc (Call_to_gnu): Add const to local variable.
1538 Adjust comment. Pass GNAT_NAME in the call to addressable_p and add
1539 a bypass for atomic types in case it returns false.
1540 (addressable_p): Add GNAT_EXPR third parameter with default value
1541 and add a default value to the existing second parameter.
1542 <VIEW_CONVERT_EXPR:>: Return false if the expression comes from a
1543 function call and if the alias sets of source and target types are
1544 both distinct from zero and each other.
1546 2024-05-21 Ronan Desplanques <desplanques@adacore.com>
1548 * gcc-interface/utils2.cc (build_cond_expr): Also apply an
1549 indirection when the result type is variable-sized.
1551 2024-05-21 Marc Poulhiès <poulhies@adacore.com>
1553 * gcc-interface/decl.cc: Fix typo in comment.
1555 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1557 * gcc-interface/utils2.cc (build_call_alloc_dealloc_proc): Add an
1558 assertion that this is not a deallocation of the return or secondary
1559 stack and remove subsequent unreachable code.
1561 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1563 * gcc-interface/utils2.cc (build_cond_expr): Use the indirect path
1564 for all types containing a placeholder.
1566 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1568 * gcc-interface/Make-lang.in (GNATBIND_OBJS): Remove unused
1571 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1573 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Give a
1574 warning for a statically allocated object whose size is constant,
1575 valid but too large.
1576 (allocatable_size_p): In the static case, return false for a size
1577 that is constant, valid but too large.
1579 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1581 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: For an
1582 array allocated with its bounds, make sure to have an array type
1583 to build the template.
1585 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1587 * gcc-interface/trans.cc (access_attribute_p): New predicate.
1588 (lvalue_required_for_attribute_p): Return again 1 for Size and add
1589 the missing terminating call to gcc_unreachable.
1590 (gnat_to_gnu): Return the result unmodified for a reference to an
1591 unconstrained array only if it is the prefix of an access attribute.
1593 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1595 * gcc-interface/utils.cc (relate_alias_sets): Restore previous code
1596 when the type uses structural equality.
1598 2024-05-21 Steve Baird <baird@adacore.com>
1600 * exp_util.adb (Remove_Side_Effects): Make_Reference assumes that
1601 the referenced object satisfies the constraints of the designated
1602 subtype of the access type. Ensure that this assumption holds by
1603 introducing a qualified expression if needed (and then ensuring
1604 that checking associated with evaluation of the qualified
1605 expression is not suppressed).
1607 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1609 * aspects.ads (Nonoverridable_Aspect_Id): Fix layout.
1611 2024-05-21 Ronan Desplanques <desplanques@adacore.com>
1613 * frontend.adb (Frontend): Remove duplicate statement.
1615 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1617 * sem_ch13.adb (Validate_Unchecked_Conversion): Restrict forcing the
1618 Can_Use_Internal_Rep flag to platforms that require unnesting.
1620 2024-05-21 Viljar Indus <indus@adacore.com>
1622 * sem_elab.adb: Add missing elaboration insertion
1623 characters to info messages.
1625 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1627 * inline.adb (Add_Scope_To_Clean): Use Append_Unique_Elmt.
1628 (Analyze_Inlined_Bodies): Refine type of a local counter;
1629 remove extra whitespace.
1631 2024-05-21 Ronan Desplanques <desplanques@adacore.com>
1633 * libgnarl/s-taenca.adb (Wait_For_Completion): Remove call to
1635 * libgnarl/s-tasren.adb (Timed_Selective_Wait, Wait_For_Call):
1636 Remove calls to Yield.
1638 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1640 * doc/gnat_rm/implementation_of_ada_2012_features.rst:
1642 * gnat_rm.texi: Regenerate.
1644 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1646 * doc/gnat_rm/implementation_of_ada_2012_features.rst:
1647 Order list by AI number.
1648 * gnat_rm.texi: Regenerate.
1650 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1652 * doc/gnat_rm/implementation_of_ada_2012_features.rst
1653 (AI-0216): Fix index reference.
1654 * gnat_rm.texi: Regenerate.
1656 2024-05-21 Viljar Indus <indus@adacore.com>
1658 * doc/gnat_ugn/building_executable_programs_with_gnat.rst:
1659 Update the documentation of -gnatw.n and -gnatw.l
1660 * gnat_ugn.texi: Regenerate.
1662 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1664 * doc/gnat_rm/implementation_defined_pragmas.rst
1665 (No_Tagged_Streams): Document how to avoid exposing entity names
1666 for the entire partition.
1667 * exp_disp.adb (Make_DT): Make use of restriction No_Streams.
1668 * exp_put_image.adb (Build_Record_Put_Image_Procedure): Respect
1669 Discard_Names in the generated Put_Image procedure.
1670 * gnat_rm.texi: Regenerate.
1672 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1674 * exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
1675 useless conversions.
1677 2024-05-21 Piotr Trojanek <trojanek@adacore.com>
1679 * exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
1680 trailing NUL from the fully qualified type name.
1682 2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
1684 * err_vars.ads (Error_Msg_Sloc): Initialize to No_Location.
1686 2024-05-21 Justin Squirek <squirek@adacore.com>
1688 * doc/gnat_ugn/platform_specific_information.rst: Add note about
1689 different priority level granularities under different policies in
1690 Windows and move POSIX related info into new section.
1691 * libgnarl/s-taprop.ads: Add note about Task_Dispatching_Policy.
1692 * libgnarl/s-taprop__mingw.adb:
1693 (Set_Priority): Add use of Non_FIFO_Underlying_Priorities.
1694 * libgnat/system-mingw.ads: Add documentation for modifying
1695 priority mappings and add alternative mapping
1696 Non_FIFO_Underlying_Priorities.
1697 * gnat_ugn.texi: Regenerate.
1699 2024-05-20 Bob Duff <duff@adacore.com>
1701 * sem_ch12.adb: Misc cleanups and comment fixes.
1702 (Check_Overloaded_Formal_Subprogram): Remove the Others_Choice
1704 (Others_Choice): Remove this variable; no longer needed.
1705 * types.ads (Text_Ptr): Add a range constraint limiting the
1706 subtype to values that are actually used. This has the advantage
1707 that when the compiler is compiled with validity checks,
1708 uninitialized values of subtypes Text_Ptr and Source_Ptr will be
1710 * sinput.ads (Sloc_Adjust): Use the base subtype; this is used as
1711 an offset, so we need to allow arbitrary negative values.
1713 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
1715 * exp_ch7.ads (Preload_Finalization_Collection): Delete.
1716 * exp_ch7.adb (Allows_Finalization_Collection): Revert change.
1717 (Preload_Finalization_Collection): Delete.
1718 * opt.ads (Interface_Seen): Likewise.
1719 * scng.adb (Scan): Revert latest change.
1720 * sem_ch10.adb: Remove clause for Exp_Ch7.
1721 (Analyze_Compilation_Unit): Revert latest change.
1722 * libgnat/i-c.ads: Use a fully qualified name for the standard "+"
1723 operator in the preconditons/postconditions of subprograms.
1725 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
1727 * exp_aggr.adb (Expand_Record_Aggregate.Component_OK_For_Backend):
1728 Also return False for a delayed conditional expression.
1730 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
1732 * freeze.ads (Check_Compile_Time_Size): Remove obsolete description
1733 of usage for the Size_Known_At_Compile_Time flag.
1734 * freeze.adb (Check_Compile_Time_Size.Size_Known): In the case where
1735 a variant part is present, do not return False if Esize is known.
1736 * sem_util.adb (Needs_Secondary_Stack.Caller_Known_Size_Record): Add
1737 missing "Start of processing" comment. Return true if either a size
1738 clause or an object size clause has been given for the first subtype
1741 2024-05-20 Bob Duff <duff@adacore.com>
1743 * sinfo.ads: Misc comment corrections and clarifications.
1744 The syntax for GENERIC_ASSOCIATION and FORMAL_PACKAGE_ACTUAL_PART
1746 Emphasize that "others => <>" is not represented as an
1747 N_Generic_Association (with or without Box_Present set),
1748 and give examples illustrating the various possibilities.
1750 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
1752 * einfo-utils.ads (Is_Base_Type): Move to Miscellaneous Subprograms
1753 section and add description.
1754 * fe.h (Is_Base_Type): Declare.
1756 2024-05-20 Gary Dismukes <dismukes@adacore.com>
1758 * sem_aggr.adb (Resolve_Aggregate): Move condition and call for
1759 Resolve_Record_Aggregate in front of code related to calling
1760 Resolve_Container_Aggregate (and add test that the aggregate is
1761 not homogeneous), and remove special-case testing and call to
1762 Resolve_Container_Aggregate for empty aggregates. Also, add error
1763 check for an attempt to use "[]" for an aggregate of a record type
1764 that does not specify an Aggregate aspect.
1765 (Resolve_Record_Aggregate): Remove error check for record
1766 aggregates with "[]" (now done by Resolve_Aggregate).
1768 2024-05-20 Gary Dismukes <dismukes@adacore.com>
1770 * sem_aggr.adb (Resolve_Aggregate): Move condition and call for
1771 Resolve_Record_Aggregate in front of code related to calling
1772 Resolve_Container_Aggregate (and add test that the aggregate
1773 is not homogeneous), and remove special-case testing and call
1774 to Resolve_Container_Aggregate for empty aggregates.
1776 2024-05-20 Justin Squirek <squirek@adacore.com>
1778 * accessibility.adb (Accessibility_Level): Add cases for 'First
1781 2024-05-20 Justin Squirek <squirek@adacore.com>
1783 * sem_attr.adb (Analyze_Attribute): Remove restriction on 'Super
1786 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1788 * sem_attr.ads (Attribute_Impl_Def): Fix list of
1789 implementation-defined attributes.
1791 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1793 * sem_attr.adb (Attribute_12): Add attributes Old,
1794 Overlaps_Storage and Result.
1796 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1798 * sem_attr.adb (Analyze_Attribute): Move IF statement that
1799 checks restriction No_Implementation_Attributes for Ada 2005,
1800 2012 and Ada 2022 attributes inside Comes_From_Source condition
1801 that checks the same restriction for Ada 83 attributes.
1803 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1805 * sem_attr.adb (Analyze_Attribute): Remove condition that is
1806 already checked by an enclosing IF statement.
1808 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1810 * sem_attr.ads (Universal_Type_Attribute): Simplify using
1811 array aggregate syntax with discrete choice list.
1813 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1815 * sem_attr.ads (Attribute_Impl_Def): Fix style in comment.
1817 2024-05-20 Ronan Desplanques <desplanques@adacore.com>
1819 * libgnarl/s-taprop__linux.adb (Enter_Task): Move setting
1820 of thread ID out of Enter_Task.
1821 (Initialize): Set thread ID for the environment task.
1822 (Create_Task): Remove now unnecessary Unrestricted_Access
1823 attribute and add justification for a memory write.
1824 * libgnarl/s-taprop__posix.adb: Likewise.
1825 * libgnarl/s-taprop__qnx.adb: Likewise.
1826 * libgnarl/s-taprop__rtems.adb: Likewise.
1827 * libgnarl/s-taprop__solaris.adb: Likewise.
1828 * libgnarl/s-taspri__posix.ads: Remove pragma Atomic for
1829 Private_Data.Thread, and update documentation comment.
1830 * libgnarl/s-taspri__lynxos.ads: Likewise.
1831 * libgnarl/s-taspri__posix-noaltstack.ads: Likewise.
1832 * libgnarl/s-taspri__solaris.ads: Likewise.
1833 * libgnarl/s-tporft.adb (Register_Foreign_Thread): Adapt to
1834 Enter_Task not setting the thread ID anymore.
1835 * libgnarl/s-tassta.adb (Task_Wrapper): Update comment.
1837 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
1839 * exp_aggr.ads (Is_Delayed_Conditional_Expression): New predicate.
1840 * exp_aggr.adb (Convert_To_Assignments.Known_Size): Likewise.
1841 (Convert_To_Assignments): Climb the parent chain, looking through
1842 qualified expressions and dependent expressions of conditional
1843 expressions, to find out whether the expansion may be delayed.
1844 Call Known_Size for this in the case of an object declaration.
1845 If so, set Expansion_Delayed on the aggregate as well as all the
1846 intermediate conditional expressions.
1847 (Initialize_Component): Reset the Analyzed flag on an initialization
1848 expression that is a conditional expression whose expansion has been
1850 (Is_Delayed_Conditional_Expression): New predicate.
1851 * exp_ch3.adb (Expand_N_Object_Declaration): Handle initialization
1852 expressions that are conditional expressions whose expansion has
1854 * exp_ch4.adb (Build_Explicit_Assignment): New procedure.
1855 (Expand_Allocator_Expression): Handle initialization expressions
1856 that are conditional expressions whose expansion has been delayed.
1857 (Expand_N_Case_Expression): Deal with expressions whose expansion
1858 has been delayed by waiting for the rewriting of their parent as
1859 an assignment statement and then optimizing the assignment.
1860 (Expand_N_If_Expression): Likewise.
1861 (Expand_N_Qualified_Expression): Do not apply a predicate check to
1862 an operand that is a delayed aggregate or conditional expression.
1863 * gen_il-gen-gen_nodes.adb (N_If_Expression): Add Expansion_Delayed
1865 (N_Case_Expression): Likewise.
1866 * sinfo.ads (Expansion_Delayed): Document extended usage.
1868 2024-05-20 Gary Dismukes <dismukes@adacore.com>
1870 * exp_aggr.adb (Expand_Container_Aggregate): Add top-level
1871 variables Choice_{Lo|Hi} and Int_Choice_{Lo|Hi} used for
1872 determining the low and high bounds of component association
1873 choices. Replace code for determining whether we have an indexed
1874 aggregate with call to new function Sem_Aggr.Is_Indexed_Aggregate.
1875 Remove test of whether Empty_Subp is a function, since it must be
1876 a function. Move Default and Count_Type to be locals of a new
1877 block enclosing the code that creates the object to hold the
1878 aggregate length, and set them according to the default and type
1879 of the Empty function's parameter when present (and to Empty and
1880 Standard_Natural otherwise). Use Siz_Exp for the aggregate length
1881 when set, and use Empty's default length when available, and use
1882 zero for the length otherwise. In generating the call to the
1883 New_Indexed function, use the determined lower and upper bounds if
1884 determined earlier by Aggregate_Size, and otherwise compute those
1885 from the index type's lower bound and the determined aggregate
1886 length. In the case where a call to Empty is generated and the
1887 function has a formal parameter, pass the value saved in Siz_Decl
1888 (otherwise the parameter list is empty). Remove code specific to
1889 making a parameterless call to the Empty function. Extend the code
1890 for handling positional container aggregates to account for types
1891 that define Assign_Indexed, rather than just Add_Unnamed, and in
1892 the case of indexed aggregates, create a temporary object to hold
1893 values of the aggregate's key index, and initialize and increment
1894 that temporary for each call generated to the Assign_Indexed
1895 procedure. For named container aggregates that have key choices
1896 given by ranges, call Expand_Range_Component to generate a loop
1897 that will call the appropriate insertion procedure for each value
1898 of the range. For indexed aggregates with a Component_Associations
1899 list, set and use the Assign_Indexed procedure for each component
1900 association, whether or not there's an iterator specification.
1901 (Add_Range_Size): Add code to determine the low and high bounds of
1902 the range and capture those in up-level variables when their value
1903 is less than or greater than (respectively) the current minimum
1904 and maximum bounds values.
1905 (Aggregate_Size): Separately handle the case where a single choice
1906 is of a discrete type, and call Add_Range_Size to take its value
1907 into consideration for determination of min and max bounds of the
1908 aggregate. Add comments in a couple of places.
1909 (Build_Siz_Exp): Remove the last sentence and "???" from the
1910 comment that talks about accumulating nonstatic sizes, since that
1911 sentence seems to be obsolete. Record the low and high bound
1912 values in Choice_Lo and Choice_Hi in the case of a nonstatic
1914 (Expand_Iterated_Component): Set the Defining_Identifier of the
1915 iterator specification to the Loop_Id in the
1916 N_Iterated_Component_Association case.
1917 (Expand_Range_Component): Procedure unnested from the block
1918 handling indexed aggregates in Expand_Container_Aggregate, and
1919 moved to top level of that procedure so it can also be called for
1920 Add_Named cases. A formal parameter Insert_Op is added, and
1921 existing calls to this procedure are changed to pass the
1922 appropriate insertion procedure's Entity.
1923 * sem_aggr.ads: Add with_clause for Sinfo.Nodes.
1924 (Is_Indexed_Aggregate): New function for use by
1925 Resolve_Container_Aggregate and Expand_Container_Aggregate.
1926 * sem_aggr.adb: Add with_clause for Sem_Ch5. Move with_clause for
1927 Sinfo.Nodes to sem_aggr.ads.
1928 (Is_Indexed_Aggregate): New function to determine whether a
1929 container aggregate is a container aggregate (replacing local
1930 variable of the same name in Resolve_Container_Aggregate).
1931 (Resolve_Iterated_Association): Remove part of comment saying that
1932 a Key_Expression is always present. Set Parent field of the copy
1933 of a component association with a loop parameter specification. On
1934 the setting of Loop_Param_Id, account for a
1935 Loop_Parameter_Specification being changed into an
1936 Iterator_Specification as a result of being analyzed. Only call
1937 Preanalyze_And_Resolve on Key_Expr when a key expression is
1938 actually present. Remove loop for handling choices for the case of
1939 an N_Component_Association with a Defining_Identifier (there
1940 shouldn't be more than one choice in this case, and add an
1941 assertion to ensure that). Also add code here to handle the case
1942 where the choice is a function call, creating an
1943 iterator_specification analyzing it, and call
1944 Resolve_Iterated_Association recursively to process it. Add error
1945 check to enforce RM22 4.3.5(27), which requires that the type of
1946 the loop parameter must be the same as the key type when there is
1947 no key expression and the aggregate is an indexed aggregate or has
1949 (Resolve_Container_Aggregate): In the Add_Unnamed case, call
1950 Resolve_Iterated_Association for both
1951 N_Iterated_Element_Association and N_Component_Association (rather
1952 than just the latter). Remove error check for nonstatic choices in
1953 component associations in Add_Named cases (multiple named
1954 nonstatic associations are fine except in indexed aggregates).
1955 Remove local variable Is_Indexed_Aggregate, replaced with new
1956 library-level function of the same name, and add test of
1957 Is_Indexed_Aggregate in the case where the aggregate type has an
1958 Assign_Indexed operation, as a guard for doing error checks for
1959 indexed aggregates. For indexed aggregate resolution, do not call
1960 Analyze_And_Resolve on the expression of an
1961 N_Component_Association in the "box association" case. Move error
1962 checks for indexed aggregates with iterated associations that flag
1963 cases where an association is a loop_parameter_specification with
1964 an iterator filter or a key expression (violation of RM22
1965 4.3.5(28/5)), from the loop that checks for contiguous and
1966 nonoverlapping choices and into the preceding association loop
1967 after the call to Resolve_Iterated_Association. The RM reference
1968 is added to the error-message strings.
1970 2024-05-20 Ronan Desplanques <desplanques@adacore.com>
1972 * libgnarl/s-taprop__linux.adb (Set_Task_Affinity): Fix
1973 decision about whether to call CPU_FREE.
1975 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
1977 * exp_aggr.ads (Convert_Aggr_In_Allocator): Remove Aggr parameter
1978 and adjust description.
1979 (Convert_Aggr_In_Object_Decl): Adjust description.
1980 * exp_aggr.adb (Convert_Aggr_In_Allocator): Remove Aggr parameter
1981 and add local variable of the same name instead. Adjust call to
1982 Convert_Array_Aggr_In_Allocator.
1983 (Convert_Aggr_In_Object_Decl): Add comment for early return and
1984 remove useless inner block statement.
1985 (Convert_Array_Aggr_In_Allocator): Remove Aggr parameter and add
1986 local variable of the same name instead.
1987 (In_Place_Assign_OK): Move down declarations of local variables.
1988 (Convert_To_Assignments): Put all declarations of local variables
1989 in the same place. Fix typo in comment. Replace T with Full_Typ.
1990 * exp_ch4.adb (Expand_Allocator_Expression): Call Unqualify instead
1991 of Expression on the qualified expression of the allocator for the
1992 sake of consistency. Adjust call to Convert_Aggr_In_Allocator.
1994 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
1996 * sem_attr.adb (Eval_Attribute): Handle enumeration type with
1999 2024-05-20 Piotr Trojanek <trojanek@adacore.com>
2001 * exp_imgv.adb (Expand_Width_Attribute): Fix for 'Width that
2002 is computed at run time.
2003 * sem_attr.adb (Eval_Attribute): Fix for 'Width that is computed
2004 at compilation time.
2006 2024-05-20 Sebastian Poeplau <poeplau@adacore.com>
2008 * libgnat/s-pooglo.adb (Allocate): Use arithmetic on
2009 System.Address to compute the aligned address.
2011 2024-05-20 Steve Baird <baird@adacore.com>
2013 * freeze.adb (Adjust_Esize_For_Alignment): Assert that a valid
2014 Alignment specification cannot result in adjusting the given
2015 type's Esize to be larger than System_Max_Integer_Size.
2016 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): In analyzing
2017 an Alignment specification, enforce the rule that a specified
2018 Alignment value for a discrete or fixed-point type shall not be
2019 larger than System_Max_Integer_Size / 8 .
2021 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
2023 * libgnat/g-sothco.ads (In_Addr): Add aspect Universal_Aliasing.
2025 2024-05-20 Jose Ruiz <ruiz@adacore.com>
2027 * sem_prag.adb (Analyze_Pragma): Exclude detection of duplicates
2028 because they are detected elsewhere.
2030 2024-05-20 Jose Ruiz <ruiz@adacore.com>
2032 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Clarify
2034 * sem_prag.adb (Analyze_Pragma): Check for duplicates
2035 Max_Entry_Queue_Length, Max_Entry_Queue_Depth and Max_Queue_Length
2036 for the same protected entry.
2037 * sem_util.adb (Get_Max_Queue_Length): Take into account all three
2038 representation aspects that can be used to set this restriction.
2039 (Has_Max_Queue_Length): Likewise.
2040 * doc/gnat_rm/implementation_defined_pragmas.rst:
2041 (pragma Max_Queue_Length): Fix pragma in example.
2042 * gnat_rm.texi: Regenerate.
2044 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
2046 * libgnat/s-finpri.ads (Collection_Node): Move to private part.
2047 (Collection_Node_Ptr): Likewise.
2048 (Header_Alignment): Change to declaration and move completion to
2050 (Header_Size): Likewise.
2051 (Lock_Type): Delete.
2052 (Finalization_Collection): Move Lock component and remove default
2053 value for Finalization_Started component.
2054 * libgnat/s-finpri.adb (Initialize): Reorder statements.
2056 2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
2058 * doc/gnat_rm/implementation_defined_pragmas.rst
2059 (Universal_Aliasing): Remove reference to No_Strict_Aliasing.
2060 * doc/gnat_ugn/gnat_and_program_execution.rst
2061 (Optimization and Strict Aliasinng): Simplify first example and
2062 make it more consistent with the second. Add description of the
2063 effects of pragma Universal_Aliasing and document new warning
2064 issued for unchecked conversions. Remove obsolete stuff.
2065 * gnat_rm.texi: Regenerate.
2066 * gnat_ugn.texi: Regenerate.
2068 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2071 * libgnarl/s-osinte__solaris.ads (mutex_t): Fix typo.
2072 * libgnarl/s-taprop__solaris.adb (Record_Lock): Add conversion.
2073 (Check_Sleep): Likewise.
2074 (Record_Wakeup): Likewise.
2075 (Check_Unlock): Likewise.
2076 * libgnarl/s-tasini.adb (Initialize_RTS_Lock): Add pragma Import
2077 on the overlaid variable.
2078 (Finalize_RTS_Lock): Likewise.
2079 (Acquire_RTS_Lock): Likewise.
2080 (Release_RTS_Lock): Likewise.
2081 * libgnarl/s-taspri__solaris.ads (To_RTS_Lock_Ptr): New instance
2082 of Ada.Unchecked_Conversion.
2083 * libgnat/s-oslock__solaris.ads: Add with clause for
2084 Ada.Unchecked_Conversion.
2085 (array_type_9): Add missing name qualification.
2086 (record_type_3): Likewise.
2087 (mutex_t): Fix formatting.
2089 2024-05-17 Viljar Indus <indus@adacore.com>
2091 * exp_aggr.adb (Expand_Container_Aggregate):
2092 Derive the size for iterable aggregates in the case of
2093 one-dimensional array objects.
2095 2024-05-17 Ronan Desplanques <desplanques@adacore.com>
2097 * exp_aggr.adb (Aggr_Size_OK): Remove workaround and extend
2100 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2102 * bindgen.adb (Gen_Adainit): Generate declaration and call to the
2103 imported procedure __gnat_tasking_runtime_initialize if need be.
2104 * libgnat/s-soflin.ads (Locking Soft-Links): Add commentary.
2105 * libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): New procedure
2106 exported as __gnat_tasking_runtime_initialize. Initialize RTS_Lock
2107 manipulation routines here instead of...
2108 (Init_RTS): ...here.
2110 2024-05-17 Steve Baird <baird@adacore.com>
2112 * scng.adb (scan): When checking for an unprocessed preprocessor
2113 directive, take into account the preprocessor's rules about case
2114 insensitivity and about white space between the '#' and the
2117 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2119 * libgnarl/s-taspri__mingw.ads: Add clause for System.OS_Interface.
2120 (Private_Data): Change type of Thread component.
2122 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2124 * libgnat/g-alvevi.ads: Add pragma Universal_Aliasing for all the
2126 * libgnat/s-stratt.ads: Likewise for Fat_Pointer type.
2128 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2130 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-oslock$(objext).
2131 (LIBGNAT_TARGET_PAIRS): Use s-oslock__dummy.ads by default.
2132 Set specific s-oslock.ads source file for all the platforms.
2133 * exp_ch7.ads (Preload_Finalization_Collection): New procedure.
2134 * exp_ch7.adb (Allows_Finalization_Collection): Return False if
2135 System.Finalization_Primitives has not been preloaded.
2136 (Preload_Finalization_Collection): New procedure.
2137 * opt.ads (Interface_Seen): New boolean variable.
2138 * s-oscons-tmplt.c: Use "N" string for pragma Style_Checks.
2139 * scng.adb (Scan): Set Interface_Seen upon seeing "interface".
2140 * sem_ch10.adb: Add clause for Exp_Ch7.
2141 (Analyze_Compilation_Unit): Call Preload_Finalization_Collection
2142 after the context of the unit is analyzed.
2143 * libgnarl/a-rttiev.adb: Add with clause for System.OS_Locks and
2145 (Event_Queue_Lock): Adjust qualified name of subtype.
2146 * libgnarl/s-osinte__aix.ads: Add with clause for System.OS_Locks
2147 and change pthread_mutex_t into a local subtype.
2148 * libgnarl/s-osinte__android.ads: Likewise.
2149 * libgnarl/s-osinte__darwin.ads: Likewise.
2150 * libgnarl/s-osinte__dragonfly.ads: Likewise.
2151 * libgnarl/s-osinte__freebsd.ads: Likewise.
2152 * libgnarl/s-osinte__gnu.ads: Likewise.
2153 * libgnarl/s-osinte__hpux-dce.ads: Likewise.
2154 * libgnarl/s-osinte__hpux.ads: Add Likewise.
2155 * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise.
2156 * libgnarl/s-osinte__linux.ads: Likewise.
2157 * libgnarl/s-osinte__lynxos178e.ads: Likewise.
2158 * libgnarl/s-osinte__qnx.ads: Likewise.
2159 * libgnarl/s-osinte__rtems.ads: Likewise.
2160 * libgnarl/s-osinte__mingw.ads: Add with clause for System.OS_Locks
2161 and change CRITICAL_SECTION into a local subtype. Add declarations
2162 for imported procedures dealing with CRITICAL_SECTION.
2163 * libgnarl/s-osinte__solaris.ads: Add with clause for System.OS_Locks
2164 and change mutex_t into a local subtype.
2165 * libgnarl/s-osinte__vxworks.ads: Add missing blank line.
2166 * libgnarl/s-taprop.ads: Alphabetize clauses and package renamings.
2167 Use qualified name for RTS_Lock throughout.
2168 * libgnarl/s-taprop__dummy.adb: Add use clause for System.OS_Locks
2169 and alphabetize others.
2170 * libgnarl/s-taprop__hpux-dce.adb: Likewise.
2171 * libgnarl/s-taprop__linux.adb: Likewise.
2172 * libgnarl/s-taprop__posix.adb: Likewise.
2173 * libgnarl/s-taprop__qnx.adb: Likewise.
2174 * libgnarl/s-taprop__rtems.adb: Likewise.
2175 * libgnarl/s-taprop__solaris.adb: Likewise.
2176 * libgnarl/s-taprop__vxworks.adb: Likewise.
2177 * libgnarl/s-taprop__mingw.adb: Likewise. Remove declarations for
2178 imported procedures dealing with CRITICAL_SECTION.
2179 * libgnarl/s-tarest.adb: Add with clause for System.OS_Locks and
2181 (Global_Task_Lock): Adjust qualified name of subtype.
2182 * libgnarl/s-tasini.adb: Add clause for System.OS_Locks.
2183 (Initialize_RTS_Lock): New procedure.
2184 (Finalize_RTS_Lock): Likewise.
2185 (Acquire_RTS_Lock): Likewise.
2186 (Release_RTS_Lock): Likewise.
2187 (Init_RTS): Add compile-time assertions for RTS_Lock types.
2188 Set the soft links for the RTS lock manipulation routines.
2189 * libgnarl/s-taspri__dummy.ads: Add with clause for System.OS_Locks.
2190 (RTS_Lock): Delete and adjust throughout accordingly.
2191 * libgnarl/s-taspri__hpux-dce.ads: Likewise.
2192 * libgnarl/s-taspri__lynxos.ads: Likewise.
2193 * libgnarl/s-taspri__mingw.ads: Likewise.
2194 * libgnarl/s-taspri__posix-noaltstack.ads: Likewise.
2195 * libgnarl/s-taspri__posix.ads: Likewise.
2196 * libgnarl/s-taspri__solaris.ads: Likewise.
2197 * libgnarl/s-taspri__vxworks.ads: Likewise.
2198 * libgnat/s-finpri.ads: Add clause for System.OS_Locks.
2199 (Finalization_Collection): Change type of Lock.
2200 * libgnat/s-finpri.adb (Initialize): Call Initialize_RTS_Lock.
2201 (Lock_Collection): Call Acquire_RTS_Lock.
2202 (Unlock_Collection): Call Release_RTS_Lock.
2203 * libgnat/s-oslock__dummy.ads: New file.
2204 * libgnat/s-oslock__hpux-dce.ads: Likewise.
2205 * libgnat/s-oslock__mingw.ads: Likewise.
2206 * libgnat/s-oslock__posix.ads: Likewise.
2207 * libgnat/s-oslock__solaris.ads: Likewise.
2208 * libgnat/s-oslock__vxworks.ads: Likewise.
2209 * libgnat/s-soflin.ads (Null_Set_Address): New null procedure.
2210 (Initialize_RTS_Lock): New soft link.
2211 (Finalize_RTS_Lock): Likewise.
2212 (Acquire_RTS_Lock): Likewise.
2213 (Release_RTS_Lock): Likewise.
2214 * exp_ch4.adb (Expand_N_Allocator): In the subtype indication case,
2215 call Apply_Predicate_Check on the resulting access value if need be.
2217 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2219 * einfo.ads (Materialize_Entity): Document secondary usage.
2221 2024-05-17 Steve Baird <baird@adacore.com>
2223 * local_restrict.adb (Active_Restriction): When traversing scopes,
2224 do not skip over a subprogram body.
2226 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2228 * libgnarl/s-taprop__dummy.adb (Initialize_Lock): Fix formatting.
2229 * libgnarl/s-taprop__linux.adb (RTS_Lock_Ptr): Delete.
2230 (Init_Mutex): Rename into...
2231 (Initialize_Lock): ...this.
2232 (Initialize_Lock [Lock]): Call above procedure.
2233 (Initialize_Lock [RTS_Lock]): Likewise.
2234 (Initialize_TCB): Likewise.
2235 * libgnarl/s-taprop__posix.adb (Initialize_Lock): New procedure
2236 factored out from the other two homonyms.
2237 (Initialize_Lock [Lock]): Call above procedure.
2238 (Initialize_Lock [RTS_Lock]): Likewise.
2239 * libgnarl/s-taprop__qnx.adb (RTS_Lock_Ptr): Delete.
2240 (Init_Mutex): Rename into...
2241 (Initialize_Lock): ...this.
2242 (Initialize_Lock [Lock]): Call above procedure.
2243 (Initialize_Lock [RTS_Lock]): Likewise.
2244 (Initialize_TCB): Likewise.
2245 * libgnarl/s-taprop__rtems.adb (Initialize_Lock): New procedure
2246 factored out from the other two homonyms.
2247 (Initialize_Lock [Lock]): Call above procedure.
2248 (Initialize_Lock [RTS_Lock]): Likewise.
2250 2024-05-17 Piotr Trojanek <trojanek@adacore.com>
2252 * sem_util.adb (Is_Known_On_Entry): Handle constants introduced
2255 2024-05-17 Steve Baird <baird@adacore.com>
2257 * libgnat/a-direct.adb (Start_Search_Internal): Do not call
2258 Modification_Time for a special file; declare a Calendar.Time
2259 constant No_Time and use that instead.
2261 2024-05-17 Steve Baird <baird@adacore.com>
2263 * exp_ch3.adb (Build_Equivalent_Record_Aggregate): Add
2264 Has_Predicates test for a scalar component to match what is
2265 already done for other kinds of components.
2267 2024-05-17 Ronan Desplanques <desplanques@adacore.com>
2269 * sem_aggr.adb (Resolve_Array_Aggregate): Improve comments
2272 2024-05-17 Ronan Desplanques <desplanques@adacore.com>
2274 * sem_aggr.adb (Resolve_Array_Aggregate): Fix location of error
2277 2024-05-17 Piotr Trojanek <trojanek@adacore.com>
2279 * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Move to
2280 Sem_Util, so it can be used from GNATprove.
2281 * sem_util.ads (Is_Unconstrained_Or_Tagged_Item): Move from
2283 * sem_util.adb (Is_Unconstrained_Or_Tagged_Item): Move from
2286 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2288 * exp_pakd.adb (Create_Packed_Array_Impl_Type): For non-bit-packed
2289 array types, propagate the aliased property of the component.
2290 (Install_PAT): Set fields on the implicit base type of an array.
2291 * libgnat/a-stream.ads (private part): Add pragma Universal_Aliasing
2293 * libgnat/g-alleve.ads: Add pragma Universal_Aliasing for all the
2295 * libgnat/g-alleve__hard.ads: Likewise.
2297 2024-05-17 Bob Duff <duff@adacore.com>
2299 * bcheck.adb (Check_Consistency_Of_Sdep): Split out new procedure.
2300 Add check for special case of subprogram spec that no longer
2302 (Check_Consistency): Call Check_Consistency_Of_Sdep, except when
2303 Reified_Child_Spec is True. No need for "goto Continue" or "exit
2305 * ali.ads (Subunit_Name, Unit_Name): Change the type to
2306 Unit_Name_Type. Add a comment pointing to the ALI file
2307 documentation, because it's in a somewhat-surprising place.
2308 * ali.adb (Scan_ALI): Subunit_Name and Unit_Name are now
2309 Unit_Name_Type. Remove comment explaining why Name_Find is used;
2310 Name_Find is the usual case. Do not remove the "%s" or "%b" from
2311 the Unit_Name. We need to be able to distinguish specs and bodies.
2312 This is also necessary to obey the invariant of Unit_Name_Type.
2313 * binde.adb (Write_Closure): Subunit_Name is now Unit_Name_Type.
2314 * clean.adb (Clean_Executables): Likewise.
2316 2024-05-17 Ronan Desplanques <desplanques@adacore.com>
2318 * sem_aggr.adb (Resolve_Null_Array_Aggregate): Update
2319 documentation comments.
2321 2024-05-17 Steve Baird <baird@adacore.com>
2323 * sem_util.adb (Has_Some_Controlled_Component): Fix a bug which
2324 causes (in some cases involving a Disable_Controlled aspect
2325 specification) Needs_Finalization to return different answers for
2326 one type depending on whether the function is called before or
2327 after the type is frozen.
2328 * libgnat/a-coorse.ads: Type Control_Reference_Type gets an Adjust
2330 * libgnat/a-cborse.ads: Likewise.
2331 * libgnat/a-ciorse.ads: Likewise
2332 * libgnat/a-coorse.adb:
2333 (Finalize): Reclaim allocated Key_Type object.
2334 (Adjust): New procedure; prevent sharing of non-null Key_Access
2335 values by allocating a copy.
2336 * libgnat/a-cborse.adb: Likewise.
2337 * libgnat/a-ciorse.adb: Likewise.
2339 2024-05-17 Bob Duff <duff@adacore.com>
2341 * uname.adb (Get_Unit_Name_String): Move Asserts after
2344 2024-05-17 Bob Duff <duff@adacore.com>
2346 * ali-util.adb (Read_Withed_ALIs): Minor reformatting.
2347 * bindo-units.adb (Corresponding_Body): Add assert.
2348 (Corresponding_Spec): Likewise.
2349 * uname.adb: Clean up assertions, use available functions.
2350 Get_Spec_Name/Get_Body_Name can assert that N obeys the
2351 conventions for Unit_Name_Type (end in "%s" or "%b").
2353 2024-05-17 Sebastian Poeplau <poeplau@adacore.com>
2355 * raise-gcc.c: Work around __builtin_code_address_from_pointer
2356 if it is unavailable.
2358 2024-05-17 Marc Poulhiès <poulhies@adacore.com>
2360 * exp_aggr.adb (Build_Array_Aggr_Code) <Gen_Loop>: Copy the
2361 initialization expression when unrolling the loop.
2363 2024-05-17 Bob Duff <duff@adacore.com>
2365 * sem_disp.adb (Check_Dispatching_Operation): Call
2366 Create_Extra_Formals, so that the caller will have an extra
2367 "constrained" parameter, which will be checked on assignment in
2368 the callee, and will be passed in by the caller.
2370 2024-05-17 Piotr Trojanek <trojanek@adacore.com>
2372 * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Remove call
2373 to Has_Discriminants; combine ELSIF branches.
2375 2024-05-17 Piotr Trojanek <trojanek@adacore.com>
2377 * sem_ch7.adb (New_Private_Type): Simplify setting of
2378 Is_Constrained flag.
2379 * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Simplify
2380 detection of private types with no discriminant.
2382 2024-05-17 Piotr Trojanek <trojanek@adacore.com>
2384 * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Allow objects
2385 of private types with unknown discriminants.
2387 2024-05-17 Piotr Trojanek <trojanek@adacore.com>
2389 * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Tune repeated
2390 testing of type kinds.
2392 2024-05-17 Marc Poulhiès <poulhies@adacore.com>
2394 * doc/gnat_rm/implementation_defined_attributes.rst: Fix
2396 * gnat_rm.texi: Regenerate.
2397 * gnat_ugn.texi: Regenerate.
2399 2024-05-17 Viljar Indus <indus@adacore.com>
2401 * sem_ch3.adb (Analyze_Component_Declaration):
2402 Apply range checks only for Scalar_Types to
2403 ensure that they have the Scalar_Range attribute.
2405 2024-05-17 Viljar Indus <indus@adacore.com>
2407 * sem_ch3.adb (Analyze_Component_Declaration):
2408 Add Range_Checks for Subtype_Indications
2410 2024-05-17 Ronan Desplanques <desplanques@adacore.com>
2412 * exp_ch4.adb (Expand_N_Case_Expression): Remove call to
2414 * sem_attr.adb (Analyze_Attribute): Likewise.
2416 2024-05-17 Ronan Desplanques <desplanques@adacore.com>
2418 * exp_aggr.adb (Flatten): Small cleanup.
2420 2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
2422 * sem_attr.adb (Analyze_Attribute) <Attribute_Size>: Remove special
2423 processing for pragma Compile_Time_{Warning,Error}.
2424 (Eval_Attribute.Compile_Time_Known_Attribute): Set Is_Static on the
2425 resulting value if In_Compile_Time_Warning_Or_Error is set.
2426 (Eval_Attribute.Full_Type): New helper function.
2427 (Eval_Attribute): Call Full_Type for type attributes. Add handling
2428 of Object_Size and adjust that of Max_Size_In_Storage_Elements in
2429 the non-static case.
2431 2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
2433 * exp_ch7.adb (Attach_Object_To_Master_Node): Remove reference to a
2434 transient object in comment.
2436 2024-05-16 Marc Poulhiès <poulhies@adacore.com>
2438 * exp_ch7.adb (Reset_Scopes_To_Block_Elab_Proc): also reset scope
2439 for object declarations.
2441 2024-05-16 Steve Baird <baird@adacore.com>
2443 * checks.adb (Expr_Known_Valid): Return True for a static expression.
2444 * exp_util.adb (Adjust_Condition): No validity check needed for a
2445 condition if it is an expression for which a validity check has
2446 already been generated.
2448 2024-05-16 Gary Dismukes <dismukes@adacore.com>
2450 * libgnat/a-coinve.ads (type Vector): In the Aggregate aspect for
2451 this type, the Empty operation is changed to denote the Empty
2452 function, rather than the Empty_Vector constant.
2453 * exp_aggr.adb (Expand_Container_Aggregate): Remove code for
2454 handling the case where the Empty_Subp denotes a constant object,
2455 which should never happen (and add an assertion that Empty_Subp
2456 must denote a function).
2457 * sem_ch13.adb (Valid_Empty): No longer allow the entity to be an
2458 E_Constant, and require the (optional) parameter of an Empty
2459 function to be of a signed integer type (rather than any integer
2462 2024-05-16 Justin Squirek <squirek@adacore.com>
2464 * doc/gnat_rm/implementation_defined_attributes.rst: Add entry for
2466 * accessibility.adb (Accessibility_Level): Add handling for Super.
2467 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
2469 * sem_attr.adb (Analyze_Attribute): Create a case to handle the
2470 semantic checking and expansion for Super.
2471 (Eval_Attribute): Add entry for Super.
2472 * sem_attr.ads: Add entry for Super.
2473 * sem_util.adb (Is_Aliased_View, Is_Variable): Add case to handle
2474 references to 'Super.
2475 * snames.ads-tmpl: Register Name_Super and Attribute_Super.
2476 * gnat_rm.texi: Regenerate.
2478 2024-05-16 Ronan Desplanques <desplanques@adacore.com>
2480 * sem_util.ads (Check_Function_Writable_Actuals): Fix comment.
2482 2024-05-16 Ronan Desplanques <desplanques@adacore.com>
2484 * sem_res.adb (Resolve_Case_Expression): Add length check
2486 * exp_ch4.adb (Expand_N_Case_Expression): Add handling of nodes
2487 known to raise Constraint_Error.
2489 2024-05-16 Sebastian Poeplau <poeplau@adacore.com>
2491 * adaint.c: New defines for STANDALONE mode.
2493 2024-05-16 Viljar Indus <indus@adacore.com>
2495 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
2496 If the spec is not present for a subprogram body then
2497 check if the body definiton was created for a protected
2500 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2502 * exp_cg.adb (Generate_CG_Output): Remove code for ignored ghost
2503 entities that applied to subprogram calls.
2504 (Register_CG_Node): Skip ignored ghost entities, both calls
2505 and tagged types, when they are registered.
2507 2024-05-16 Ronan Desplanques <desplanques@adacore.com>
2509 * checks.adb (Apply_Selected_Length_Checks): Fix reason code.
2511 2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
2513 * libgnat/s-finpri.adb (Raise_From_Controlled_Operation): New
2514 declaration of imported procedure moved from...
2515 (Finalize_Master): ...there.
2516 (Finalize): Call Raise_From_Controlled_Operation instead of
2517 Reraise_Occurrence to propagate the exception, if any.
2519 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2521 * sem_ch4.adb (Analyze_If_Expression): Add guard for
2522 if_expression without an ELSE part.
2524 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2526 * exp_ch13.adb (Expand_N_Free_Statement): After analysis, the
2527 new temporary has the type of its Object_Definition and the new
2528 occurrence of this temporary has this type as well; simplify.
2530 (Indirect_Temp_Value): Remove redundant call to Set_Etype;
2532 (Is_Access_Type_For_Indirect_Temp): Add missing body header.
2534 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2536 * sem_util.adb (Is_Known_On_Entry): Check whether condition and
2537 dependent expressions of an if_expression are known on entry.
2539 2024-05-16 Ronan Desplanques <desplanques@adacore.com>
2541 * checks.ads: Fix comments.
2542 * checks.adb: Likewise.
2544 2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
2546 * libgnat/s-finpri.ads: Add use type clause for Storage_Offset.
2547 (Header_Alignment): Turn into an expression function.
2548 (Header_Size): Likewise.
2549 * libgnat/s-finpri.adb: Remove use type clause for Storage_Offset.
2550 (Header_Alignment): Delete.
2551 (Header_Size): Likewise.
2553 2024-05-16 Marc Poulhiès <poulhies@adacore.com>
2555 * exp_ch7.adb (Unnest_Loop::Fixup_Inner_Scopes): detect a new
2556 problematic pattern and fixup the scope accordingly.
2558 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2560 * gnat_cuda.adb (Remove_CUDA_Device_Entities): Fix typo.
2562 2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
2564 * libgnat/s-finpri.ads (Header_Alignment): New function.
2565 (Header_Size): Adjust description.
2566 (Master_Node): Put Finalize_Address as first component.
2567 (Collection_Node): Likewise.
2568 * libgnat/s-finpri.adb (Header_Alignment): New function.
2569 (Header_Size): Return the object size in storage units.
2570 * libgnat/s-stposu.ads (Adjust_Controlled_Dereference): Replace
2571 collection node with header in description.
2572 * libgnat/s-stposu.adb (Adjust_Controlled_Dereference): Likewise.
2573 (Allocate_Any_Controlled): Likewise. Pass the maximum of the
2574 specified alignment and that of the header to the allocator.
2575 (Deallocate_Any_Controlled): Likewise to the deallocator.
2577 2024-05-16 Viljar Indus <indus@adacore.com>
2579 * exp_aggr.adb (Two_Pass_Aggregate_Expansion):
2580 Explicitly create new Defining_Iterators for both
2583 2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
2585 * sem_ch6.adb (Check_Private_Overriding): Implement the second part
2586 of RM 3.9.3(10) consistently in both cases.
2588 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2590 * erroutc.adb (Set_Msg_Insertion_Reserved_Word): Fix casing for
2591 CUDA appearing in error message strings.
2592 (Set_Msg_Str): Likewise for CUDA being a part of a Name_Id.
2594 2024-05-16 Ronan Desplanques <desplanques@adacore.com>
2596 * exp_ch4.adb (Expand_Composite_Equality): Call Error_Msg_N
2597 instead of Error_Msg.
2599 2024-05-16 Steve Baird <baird@adacore.com>
2601 * exp_attr.adb (Build_And_Insert_Type_Attr_Subp): Further tweaking
2602 of the point where a compiler-generated Put_Image or streaming
2603 subprogram is to be inserted in the tree. If one such subprogram
2604 calls another (as is often the case with, for example, Put_Image
2605 procedures for composite type and for a component type thereof),
2606 then we want to avoid use-before-definition problems that can
2607 result from inserting the caller ahead of the callee.
2609 2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
2611 * libgnat/s-finpri.ads (Lock_Type): New modular type.
2612 (Collection_Node): Add Enclosing_Collection component.
2613 (Finalization_Collection): Add Lock component.
2614 * libgnat/s-finpri.adb: Add clauses for System.Atomic_Primitives.
2615 (Attach_Object_To_Collection): Lock and unlock the collection.
2616 Save a pointer to the enclosing collection in the node.
2617 (Detach_Object_From_Collection): Lock and unlock the collection.
2618 (Finalize): Likewise.
2619 (Initialize): Initialize the lock.
2620 (Lock_Collection): New procedure.
2621 (Unlock_Collection): Likewise.
2623 2024-05-16 Steve Baird <baird@adacore.com>
2625 * sem_attr.adb (Eval_Attribute): Expand existing checks for
2626 generic formal types for which Is_Generic_Type returns False. In
2627 that case, mark the attribute reference as nonstatic.
2629 2024-05-16 Steve Baird <baird@adacore.com>
2631 * sem_util.adb (Copy_Node_With_Replacement): Add call to
2632 Copy_Dimensions so that any dimension information associated with
2633 the copied node is also associated with the resulting copy.
2635 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2637 * gen_il-gen-gen_nodes.adb (N_Procedure_Specification): Remove
2638 Aspect_Specifications field.
2640 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2642 * sem_ch13.adb (Analyze_Aspect_Specification): Consistently
2643 reuse existing constant where possible.
2645 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2647 * sem_ch13.adb (Analyze_Aspect_Specification): Consistently
2648 reuse existing constant where possible.
2650 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2652 * aspects.ads (Aspect_Id): Fix ordering.
2654 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2656 * sem_prag.adb (Analyze_Pragma): Move case alternative to match
2657 to alphabetic order.
2659 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2661 * gnat_cuda.adb (Remove_CUDA_Device_Entities): Fix casing
2662 (this primarily fixes a style, because the capitalization will
2663 not be preserved by the error-reporting machinery anyway).
2664 * sem_ch13.adb (Analyze_User_Aspect_Aspect_Specification): Fix
2665 casing in error message.
2667 2024-05-16 Piotr Trojanek <trojanek@adacore.com>
2669 * doc/gnat_rm/implementation_defined_pragmas.rst: Fix
2671 * sem_prag.adb: Fix comments.
2672 * gnat_rm.texi: Regenerate.
2674 2024-05-14 Piotr Trojanek <trojanek@adacore.com>
2676 * aspects.ads (Aspect_Id, Boolean_Aspect): Change categorization
2677 of Boolean-valued SPARK aspects.
2678 * sem_ch13.adb (Analyze_Aspect_Specification): Adapt CASE
2679 statements to new classification of Boolean-valued SPARK
2682 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2684 * sem_ch13.adb (Validate_Unchecked_Conversions): Add node
2685 parameters to Error_Msg calls.
2687 2024-05-14 Marc Poulhiès <poulhies@adacore.com>
2689 * sem_util.adb: Typo fix in comment.
2690 * exp_aggr.adb: Likewise.
2692 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2694 * exp_ch7.adb (Finalization Management): Add a short description of
2695 the implementation of finalization chains.
2697 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2699 * exp_ch4.adb (Expand_Allocator_Expression): Move the first call to
2700 Build_Allocate_Deallocate_Proc up to before the accessibility check.
2702 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2704 * errout.adb (Validate_Specific_Warnings): Adapt to record
2706 * erroutc.adb (Set_Specific_Warning_On, Set_Specific_Warning_Off,
2707 Warning_Specifically_Suppressed): Likewise.
2708 * erroutc.ads: Change record definition.
2710 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2712 * exp_ch3.adb (Build_Default_Initialization): Do not generate the
2713 protection for finalization collections.
2714 (Build_Heap_Or_Pool_Allocator): Set the No_Initialization flag on
2715 the declaration of the temporary.
2716 * exp_ch4.adb (Build_Aggregate_In_Place): Do not build an allocation
2718 (Expand_Allocator_Expression): Build an allocation procedure, if it
2719 is required, only just before rewriting the allocator.
2720 (Expand_N_Allocator): Do not build an allocation procedure if the
2721 No_Initialization flag is set on the allocator, except for those
2722 generated for special return objects. In other cases, build an
2723 allocation procedure, if it is required, only before rewriting
2725 * exp_ch7.ads (Make_Address_For_Finalize): New function declaration.
2726 * exp_ch7.adb (Finalization Management): Update description for
2727 dynamically allocated objects.
2728 (Make_Address_For_Finalize): Remove declaration.
2729 (Find_Last_Init): Change to function and move to...
2730 (Process_Object_Declaration): Adjust to above change.
2731 * exp_util.ads (Build_Allocate_Deallocate_Proc): Add Mark parameter
2732 with Empty default and document it.
2733 (Find_Last_Init): New function declaration.
2734 * exp_util.adb (Build_Allocate_Deallocate_Proc): Add Mark parameter
2735 with Empty default and pass it in recursive call. Deal with type
2736 conversions created for interface types. Adjust call sequence to
2737 Allocate_Any_Controlled by changing Collection to In/Out parameter
2738 and removing Finalize_Address parameter. For a controlled object,
2739 generate a conditional call to Attach_Object_To_Collection for an
2740 allocation and to Detach_Object_From_Collection for a deallocation.
2741 (Find_Last_Init): ...here. Compute the initialization type for an
2742 allocator whose designating type is class wide specifically and also
2743 handle concurrent types.
2744 * rtsfind.ads (RE_Id): Add RE_Attach_Object_To_Collection and
2745 RE_Detach_Object_From_Collection.
2746 (RE_Unit_Table): Add entries for RE_Attach_Object_To_Collection and
2747 RE_Detach_Object_From_Collection.
2748 * libgnat/s-finpri.ads (Finalization_Started): Delete.
2749 (Attach_Node_To_Collection): Likewise.
2750 (Detach_Node_From_Collection): Move to...
2751 (Attach_Object_To_Collection): New procedure declaration.
2752 (Detach_Object_From_Collection): Likewise.
2753 (Finalization_Collection): Remove Atomic for Finalization_Started.
2754 Add pragma Inline for Initialize.
2755 * libgnat/s-finpri.adb: Add clause for Ada.Unchecked_Conversion.
2756 (To_Collection_Node_Ptr): New instance of Ada.Unchecked_Conversion.
2757 (Detach_Node_From_Collection): ...here.
2758 (Attach_Object_To_Collection): New procedure.
2759 (Detach_Object_From_Collection): Likewise.
2760 (Finalization_Started): Delete.
2761 (Finalize): Replace allocation with attachment in comments.
2762 * libgnat/s-stposu.ads (Allocate_Any_Controlled): Rename parameter
2763 Context_Subpool into Named_Subpool, parameter Context_Collection
2764 into Collection and change it to In/Out, and remove Fin_Address.
2765 * libgnat/s-stposu.adb: Remove clause for Ada.Unchecked_Conversion
2766 and Finalization_Primitives.
2767 (To_Collection_Node_Ptr): Delete.
2768 (Allocate_Any_Controlled): Rename parameter Context_Subpool into
2769 Named_Subpool, parameter Context_Collection into Collection and
2770 change it to In/Out, and remove Fin_Address. Do not lock/unlock
2771 and do not attach the object, instead only displace its address.
2772 (Deallocate_Any_Controlled): Do not lock/unlock and do not detach
2774 (Header_Size_With_Padding): Use qualified name for Header_Size.
2776 2024-05-14 Steve Baird <baird@adacore.com>
2778 * exp_attr.adb (Build_And_Insert_Type_Attr_Subp): If a subprogram
2779 associated with a (library-level) type declared in another unit is
2780 to be inserted somewhere in a list, then insert it at the head of
2782 * sem_ch5.adb (Analyze_Assignment): Normally a limited-type
2783 assignment is illegal. Relax this rule if Comes_From_Source is
2784 False and the type is not immutably limited.
2786 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2788 * errout.ads (Error_Msg): Add node parameter.
2789 * errout.adb (Error_Msg): Add parameter and pass it to
2790 the underlying call.
2791 * sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Pass
2792 pragma node when emitting errors.
2794 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2796 * styleg.ads (Check_Xtra_Parens_Precedence): Moved ...
2797 * style.ads (Check_Xtra_Parens_Precedence): ... here. Also
2798 replace corresponding renaming.
2799 * styleg.adb (Check_Xtra_Parens_Precedence): Moved ...
2800 * style.adb (Check_Xtra_Parens_Precedence): here. Also use
2801 Errout.Error_Msg and pass it a node parameter.
2803 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2805 * exp_aggr.ads (Convert_Aggr_In_Allocator): Rename Alloc into N,
2806 replace Decl with Temp and adjust description.
2807 (Convert_Aggr_In_Object_Decl): Alphabetize.
2808 (Is_Delayed_Aggregate): Likewise.
2809 * exp_aggr.adb (Convert_Aggr_In_Allocator): Rename Alloc into N
2810 and replace Decl with Temp. Allocate a list only when neeeded.
2811 (Convert_Array_Aggr_In_Allocator): Replace N with Decl and insert
2813 * exp_ch4.adb (Build_Aggregate_In_Place): New procedure nested in
2814 Expand_Allocator_Expression.
2815 (Expand_Allocator_Expression): Call it to build aggregates in place.
2816 Remove second parameter in calls to Build_Allocate_Deallocate_Proc.
2817 (Expand_N_Allocator): Likewise.
2818 * exp_ch13.adb (Expand_N_Free_Statement): Likewise.
2819 * exp_util.ads (Build_Allocate_Deallocate_Proc): Remove Is_Allocate
2821 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove Is_Allocate
2822 parameter and replace it with local variable of same name. Delete
2823 useless pattern matching.
2825 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2827 * usage.adb (Usage): Fix enabled-by-default indicators.
2829 2024-05-14 Philippe Gil <gil@adacore.com>
2831 * libgnat/s-win32.ads (LocalFileTimeToFileTime): Swap parameters.
2833 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2835 * restrict.adb (Violation_Of_No_Dependence): Tweak error
2838 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2840 * sem_prag.adb (Analyze_Pragma): Adapt call to new signature.
2841 * erroutc.ads (Set_Specific_Warning_Off): change signature
2842 and update documentation.
2843 (Validate_Specific_Warnings): Move ...
2844 * errout.adb: ... here and change signature. Also move body
2845 of Validate_Specific_Warnings from erroutc.adb.
2846 (Finalize): Adapt call.
2847 * errout.ads (Set_Specific_Warning_Off): Adapt signature of
2849 * erroutc.adb (Set_Specific_Warning_Off): Adapt signature and
2851 (Validate_Specific_Warnings): Move to the body of Errout.
2852 (Warning_Specifically_Suppressed): Adapt body.
2854 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2856 * exp_aggr.adb (Build_Array_Aggr_Code): Pass N in the call to
2857 Build_Initialization_Call.
2858 (Build_Record_Aggr_Code): Likewise.
2859 (Convert_Aggr_In_Object_Decl): Likewise.
2860 (Initialize_Discriminants): Likewise.
2861 * exp_ch3.ads (Build_Initialization_Call): Replace Loc witn N.
2862 * exp_ch3.adb (Build_Array_Init_Proc): Pass N in the call to
2863 Build_Initialization_Call.
2864 (Build_Default_Initialization): Likewise.
2865 (Expand_N_Object_Declaration): Likewise.
2866 (Build_Initialization_Call): Replace Loc witn N parameter and add
2867 Loc local variable. Build a default subtype for an allocator of
2868 a discriminated type with defaulted discriminants.
2869 (Build_Record_Init_Proc): Pass the declaration of components in the
2870 call to Build_Initialization_Call.
2871 * exp_ch6.adb (Make_CPP_Constructor_Call_In_Allocator): Pass the
2872 allocator in the call to Build_Initialization_Call.
2874 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2876 * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix typo.
2878 2024-05-14 Gary Dismukes <dismukes@adacore.com>
2880 * exp_util.adb (Find_Hook_Context): Exclude N_*Aggregate Nkinds
2881 of Parent (Par) from the early return in the second loop of the
2882 In_Cond_Expr case, to prevent returning an aggregate from this
2883 function rather than the enclosing declaration or statement.
2885 2024-05-14 Steve Baird <baird@adacore.com>
2887 * exp_attr.adb: Replace 6 "not Present" tests with equivalent calls to "No".
2889 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2891 * exp_ch3.adb (Expand_N_Object_Declaration): Examine the Expression
2892 field after the call to Default_Initialize_Object in order to set
2893 Is_Known_Null, as well as Is_Known_Non_Null, on an access object.
2895 2024-05-14 Steve Baird <baird@adacore.com>
2897 * exp_attr.adb: Change name of package Cached_Streaming_Ops to
2898 reflect the fact that it is now also used for Put_Image
2899 procedures. Similarly change other "Streaming_Op" names therein.
2900 Add Validate_Cached_Candidate procedure to detect case where a
2901 subprogram found in the cache cannot be reused. Add new generic
2902 procedure Build_And_Insert_Type_Attr_Subp; the "Build" part is
2903 handled by just calling a formal procedure; the bulk of this
2904 (generic) procedure's code has to with deciding where in the tree
2905 to insert the newly-constructed subprogram. Replace each later
2906 "Build" call (and the following Insert_Action or
2907 Compile_Stream_Body_In_Scope call) with a declare block that
2908 instantiates and then calls this generic procedure. Delete the
2909 now-unused procedure Compile_Stream_Body_In_Scope. A constructed
2910 subprogram is entered in the appropriate cache if the
2911 corresponding type is untagged; this replaces more complex tests.
2912 A new function Interunit_Ref_OK is added to determine whether an
2913 attribute reference occuring in one unit can safely refer to a
2914 cached subprogram declared in another unit.
2915 * exp_ch3.adb (Build_Predefined_Primitive_Bodies): A formal
2916 parameter was deleted, so delete the corresponding actual in a
2918 * exp_put_image.adb (Build_Array_Put_Image_Procedure): Because the
2919 procedure being built may be referenced more than once, the
2920 generated procedure takes its source position info from the type
2921 declaration instead of the (first) attribute reference.
2922 (Build_Record_Put_Image_Procedure): Likewise.
2923 * exp_put_image.ads (Build_Array_Put_Image_Procedure): Eliminate
2924 now-unused Nod parameter.
2925 (Build_Record_Put_Image_Procedure): Eliminate now-unused Loc parameter.
2926 * sem_ch3.adb (Constrain_Discriminated_Type): For declaring a
2927 subtype with a discriminant constraint, ignore privacy if
2928 Comes_From_Source is false (as is already done if Is_Instance is
2930 * sem_res.adb (Resolve): When passed two type entities that have
2931 the same underlying base type, Sem_Type.Covers may return False in
2932 some cases because of privacy. [This can happen even if
2933 Is_Private_Type returns False both for Etype (N) and for Typ;
2934 Covers calls Base_Type, which can take a non-private argument and
2935 yield a private result.] If Comes_From_Source (N) is False
2936 (e.g., for a compiler-generated Put_Image or streaming subprogram), then
2937 avoid that scenario by not calling Covers. Covers already has tests for
2938 doing this sort of thing (see the calls therein to Full_View_Covers),
2939 but the Comes_From_Source test is too coarse to apply there. So instead
2940 we handle the problem here at the call site.
2941 (Original_Implementation_Base_Type): A new function. Same as
2942 Implementation_Base_Type except if the Original_Node attribute of
2943 a non-derived type declaration indicates that it once was a derived
2944 type declaration. Needed for looking through privacy.
2945 (Valid Conversion): Ignore privacy when converting between different views
2946 of the same type if Comes_From_Source is False for the conversion.
2947 (Valid_Tagged_Conversion): An ancestor-to-descendant conversion is not an
2948 illegal downward conversion if there is no type extension involved
2949 (because the derivation was from an untagged view of the parent type).
2951 2024-05-14 Steve Baird <baird@adacore.com>
2953 * sem_ch5.adb (Analyze_Case_Statement): Emit a message and return
2954 early in the case where general case statements are allowed but
2955 the selector expression is of a private type. This is done to
2958 2024-05-14 Justin Squirek <squirek@adacore.com>
2960 * sem_util.adb (Set_Referenced_Modified): Use Original_Node to
2961 avoid recursive calls on expanded / internal objects such that
2962 source nodes get appropriately marked as referenced.
2964 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
2966 * sem_warn.adb (Warn_On_Overlapping_Actuals): Stop ignoring
2967 warning suppression settings.
2969 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2971 * exp_util.adb (Build_Allocate_Deallocate_Proc): Pass the alignment
2972 parameter in the inner call for a secondary stack allocation too.
2974 2024-05-14 Javier Miranda <miranda@adacore.com>
2976 * sem_ch10.adb (Install_Inherited_Policy_Pragmas): New subprogram.
2977 (Remove_Inherited_Policy_Pragmas): New subprogram.
2978 (Analyze_Compilation_Unit): Call the new subprograms to
2979 install and remove inherited assertion policy pragmas.
2981 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
2983 * exp_ch4.adb (Expand_N_If_Expression): Set No_Initialization on the
2984 declaration of the temporary in the by-reference case.
2985 * exp_util.adb (Initialized_By_Access): Delete.
2986 (Is_Allocated): Likewise.
2987 (Initialized_By_Reference): New predicate.
2988 (Is_Finalizable_Transient): If the transient object is of an access
2989 type, do not return true unless it is initialized by a reference.
2991 2024-05-14 Steve Baird <baird@adacore.com>
2993 * exp_attr.adb: Move computation of Accum_Typ entirely into the
2994 function Build_Stat.
2996 2024-05-14 Steve Baird <baird@adacore.com>
2998 * sem_ch12.ads: Declare new Instance_Context package, which
2999 declares a private type Context with operations Save_And_Reset and
3001 * sem_ch12.adb: Provide body for new Instance_Context package.
3002 * rtsfind.adb (Load_RTU): Wrap an Instance_Context Save/Restore
3003 call pair around the call to Semantics.
3004 * table.ads: Add initial value for Last_Val (because
3005 Save_And_Reset expects Last_Val to be initialized).
3007 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
3009 * exp_aggr.adb (Build_Record_Aggr_Code): Replace reference to
3010 Build_Task_Allocate_Block_With_Init_Stmts in comment with reference
3011 to Build_Task_Allocate_Block.
3012 (Convert_Aggr_In_Allocator): Likewise for the call in the code.
3013 * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Likewise.
3014 * exp_ch3.ads: Alphabetize clauses.
3015 (Build_Default_Initialization): New function declaration.
3016 (Build_Default_Simple_Initialization): Likewise.
3017 (Build_Initialization_Call): Add Target_Ref parameter with default.
3018 * exp_ch3.adb (Build_Default_Initialization): New function extracted
3020 (Build_Default_Simple_Initialization): Likewise.
3021 (Build_Initialization_Call): Add Target_Ref parameter with default.
3022 (Expand_N_Object_Declaration): ...here.
3023 (Default_Initialize_Object): Call Build_Default_Initialization and
3024 Build_Default_Simple_Initialization.
3025 * exp_ch4.adb (Expand_Allocator_Expression): Minor comment tweaks.
3026 (Expand_N_Allocator): Call Build_Default_Initialization and
3027 Build_Default_Simple_Initialization to implement the default
3028 initialization of the allocated object.
3029 * exp_ch9.ads (Build_Task_Allocate_Block): Delete.
3030 (Build_Task_Allocate_Block_With_Init_Stmts): Rename into...
3031 (Build_Task_Allocate_Block): ...this.
3032 * exp_ch9.adb: Remove clauses for Exp_Tss.
3033 (Build_Task_Allocate_Block): Delete.
3034 (Build_Task_Allocate_Block_With_Init_Stmts): Rename into...
3035 (Build_Task_Allocate_Block): ...this.
3036 * exp_util.adb (Build_Allocate_Deallocate_Proc): Remove unnecessary
3037 initialization expression, adjust commentary and replace early exit
3039 * sem_ch4.adb (Analyze_Allocator): In the null-exclusion case, call
3040 Apply_Compile_Time_Constraint_Error to insert the raise.
3042 2024-05-14 Ronan Desplanques <desplanques@adacore.com>
3044 * styleg.ads (Check_Boolean_Operator): Moved ...
3045 * style.ads (Check_Boolean_Operator): ... here.
3046 * styleg.adb (Check_Boolean_Operator): Moved ...
3047 * style.adb (Check_Boolean_Operator): ... here. Also add node
3048 parameter to call to Errout.Error_Msg.
3050 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
3052 * sprint.adb (Sprint_Node_Actual) <N_Raise_Statement>: Be prepared
3054 <N_Raise_When_Statement>: Likewise.
3056 2024-05-14 Yannick Moy <moy@adacore.com>
3058 * contracts.adb: Fix references to SPARK RM rules.
3060 * ghost.adb: Fix references to SPARK RM rules.
3061 (Check_Ghost_Context): Update checking of references to
3062 ghost entities in assertion expressions.
3063 * sem_ch6.adb: Fix references to SPARK RM rules.
3064 * sem_prag.adb: Same.
3066 2024-05-14 Yannick Moy <moy@adacore.com>
3068 * ghost.adb (Mark_And_Set_Ghost_Instantiation): Fix the current
3069 Ghost policy for the instantiation.
3071 2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
3073 * exp_ch3.adb (Default_Initialize_Object): Return immediately when
3074 either Has_Init_Expression or No_Initialization is set on the node.
3075 Tidy up the rest of the code accordingly.
3076 (Simple_Initialization_OK): Do not test Has_Init_Expression here.
3078 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3080 * accessibility.adb: Remove clauses for Exp_Ch3.
3081 * exp_ch3.ads (Init_Proc_Level_Formal): Move declaration to...
3082 * exp_ch3.adb (Init_Proc_Level_Formal): Move body to...
3083 * exp_util.ads (Init_Proc_Level_Formal): ...here.
3084 (Inside_Init_Proc): Alphabetize.
3085 * exp_util.adb (Init_Proc_Level_Formal): ...here.
3087 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3089 * sem_util.adb (Is_Potentially_Unevaluated): Remove code for
3090 recovering the original structure of expressions with AND THEN.
3092 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3094 * sem_attr.adb (Attribute_22): Remove Put_Image and Object_Size.
3095 * sem_attr.ads (Attribute_Imp_Def): Restore Object_Size.
3097 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3099 * exp_ch7.adb: Adjust the description of finalization management.
3100 (Build_Finalizer): Rename scope master into master throughout.
3101 * rtsfind.ads (RE_Id): Replace RE_Finalization_Scope_Master with
3102 RE_Finalization_Master.
3103 (RE_Unit_Table): Replace entry for RE_Finalization_Scope_Master with
3104 entry for RE_Finalization_Master.
3105 * libgnat/s-finpri.ads (Finalization_Scope_Master): Rename into...
3106 (Finalization_Master): ...this.
3107 (Attach_Object_To_Master): Adjust to above renaming.
3108 (Chain_Node_To_Master): Likewise.
3109 (Finalize_Master): Likewise.
3110 * libgnat/s-finpri.adb (Attach_Object_To_Master): Likewise.
3111 (Chain_Node_To_Master): Likewise.
3112 (Finalize_Master): Likewise.
3114 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3116 * libgnat/s-imaged.ads (System.Image_D): Add Uns formal parameter.
3117 * libgnat/s-imaged.adb: Add with clauses for System.Image_I,
3118 System.Value_I_Spec and System.Value_U_Spec.
3119 (Uns_Spec): New instance of System.Value_U_Spec.
3120 (Int_Spec): New instance of System.Value_I_Spec.
3121 (Image_I): New instance of System.Image_I.
3122 (Set_Image_Integer): New renaming.
3123 (Set_Image_Decimal): Replace 'Image with call to Set_Image_Integer.
3124 * libgnat/s-imde32.ads (Uns32): New subtype.
3125 (Impl): Pass Uns32 as second actual paramter to Image_D.
3126 * libgnat/s-imde64.ads (Uns64): New subtype.
3127 (Impl): Pass Uns64 as second actual paramter to Image_D.
3128 * libgnat/s-imde128.ads (Uns128): New subtype.
3129 (Impl): Pass Uns128 as second actual paramter to Image_D.
3130 * libgnat/s-imagef.adb (Set_Image_Fixed): Document bounds for the
3131 A, D and AF local constants.
3133 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3135 * sem_attr.adb (Attribute_22): Add Put_Image and Object_Size.
3136 * sem_attr.ads (Attribute_Imp_Def): Remove Object_Size.
3138 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3140 * aspects.adb (Copy_Aspects): Style fix.
3141 * contracts.adb (Analyze_Contracts): Style fix.
3142 (Save_Global_References_In_Contract): Remove extra guards.
3143 * par_sco.adb (Traverse_Aspects): Move guard to the caller and
3144 make it consistent with Save_Global_References_In_Contract.
3145 * sem_ch12.adb (Has_Contracts): Remove extra guards.
3146 * sem_ch3.adb (Delayed_Aspect_Present, Get_Partial_View_Aspect,
3147 Check_Duplicate_Aspects): Likewise.
3148 * sem_disp.adb (Check_Dispatching_Operation): Likewise.
3150 2024-05-13 Bob Duff <duff@adacore.com>
3152 * errout.adb (Output_Messages): Protect against the total going
3155 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3157 * contracts.adb (Append_Enabled_Item): Remove use of Split_PPC;
3159 * gen_il-fields.ads (Opt_Field_Enum): Remove flag definition.
3160 * gen_il-gen-gen_nodes.adb (N_Aspect_Specification, N_Pragma):
3161 Remove Split_PPC flags.
3162 * gen_il-internals.adb (Image): Remove use of Split_PPC.
3163 * par_sco.adb (Traverse_Aspects): Likewise.
3164 * sem_ch13.adb (Make_Aitem_Pragma): Likewise.
3165 * sem_ch6.adb (List_Inherited_Pre_Post_Aspects): Likewise.
3166 * sem_prag.adb (Analyze_Pre_Post_Condition, Analyze_Pragma,
3167 Find_Related_Declaration_Or_Body): Likewise.
3168 * sem_util.adb (Applied_On_Conjunct): Likewise.
3169 * sinfo.ads: Remove flag documentation.
3170 * treepr.adb (Image): Remove use of Split_PPC.
3172 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3174 * exp_ch6.adb (Append_Message): Build the location string from
3175 scratch and not rely on the one produced while splitting the
3176 aspect into pragmas.
3177 * exp_prag.adb (Expand_Pragma_Check): Split pre/post checks in
3179 * sem_ch13.adb (Analyze_Aspect_Specification): Don't split
3180 pre/post expressions into conjuncts; don't add message with
3181 location to the corresponding pragma.
3182 * sem_prag.adb (Build_Pragma_Check_Equivalent): Inherited
3183 pragmas no longer have messages that would need to be updated.
3184 * sinput.adb (Build_Location_String): Adjust to keep previous
3185 messages while using with inherited pragmas.
3187 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3189 * contracts.adb (Inherit_Subprogram_Contract): Fix style.
3190 * sem_ch5.adb (Analyze_Iterator_Specification): Likewise.
3192 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3194 * sem_util.adb (Has_No_Output): Iteration with
3195 First_Formal/Next_Formal involves Entity_Ids.
3197 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3199 * sem_prag.adb (Analyze_Pragma): When processing pragma
3200 Lock_Free, check if restriction No_Implementation_Pragmas is
3203 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3205 * gen_il-fields.ads (Opt_Field_Enum):
3206 Remove Is_Expanded_Contract from the list of flags.
3207 * gen_il-gen-gen_nodes.adb (N_Contract): Remove
3208 Is_Expanded_Contract from the list of N_Contract fields.
3209 * sinfo.ads (Is_Expanded_Contract): Remove comments for the flag
3210 and its single occurrence in N_Contract.
3212 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3214 * exp_ch9.adb (Build_Protected_Subprogram_Body,
3215 Build_Protected_Subprogram_Call_Cleanup): Reuse refactored
3218 (Has_Enabled_Aspect): Refactored repeated code.
3219 (Is_Static_Function): Reuse refactored routine.
3220 * sem_util.ads (Has_Enabled_Aspect):
3221 New query routine refactored from repeated code.
3223 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3225 * exp_ch9.adb (Build_Protected_Subprogram_Call_Cleanup): If
3226 aspect Exclusive_Functions is present then the cleanup of a
3227 protected function now services queued entries, just like the
3228 cleanup of a protected procedure.
3230 2024-05-13 Bob Duff <duff@adacore.com>
3232 * sem_util.ads (Append_Entity_Name): Fix comment to reflect new
3233 semantics. The comment said, "The qualification stops at an
3234 enclosing scope has no source name (block or loop)." There seems
3235 to be no reason for stopping; instead, we should SKIP things with
3236 no source name. And the "loop" part was wrong.
3237 * sem_util.adb (Append_Entity_Name): Do not stop the recursion;
3238 skip to next-outer scope instead. Misc cleanup/simplification.
3240 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3242 * libgnat/s-finpri.adb (Finalize): Replace "master" by "collection"
3243 in comments and add a comment about the form of the loop.
3244 * libgnat/s-stposu.adb (Allocate_Any_Controlled): Tweak comment.
3246 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3248 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Remove s-finmas$(objext).
3249 * einfo.ads (Anonymous_Masters): Rename into Anonymous_Collections.
3250 (Finalization_Master): Rename into Finalization_Collection.
3251 * gen_il-fields.ads (Opt_Field_Enum): Replace Anonymous_Masters
3252 with Anonymous_Collections; and Finalization_Master with
3253 Finalization_Collection.
3254 * gen_il-gen-gen_entities.adb (Access_Kind): Likewise.
3255 (E_Function): Likewise.
3256 (E_Procedure): Likewise.
3257 (E_Package): Likewise.
3258 (E_Subprogram_Body): Likewise.
3259 * exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Adjust to renamings.
3260 (Freeze_Type): Likewise.
3261 (Stream_Operation_OK): Remove obsolete test.
3262 * exp_ch4.adb (Expand_Allocator_Expression): Adjust to renamings.
3263 (Expand_N_Allocator): Likewise.
3264 * exp_ch6.ads (BIP_Formal_Kind): Replace BIP_Finalization_Master
3265 with BIP_Collection.
3266 (Needs_BIP_Finalization_Master): Rename into...
3267 (Needs_BIP_Collection): ...this.
3268 * exp_ch6.adb (BIP_Finalization_Master_Suffix): Delete.
3269 (BIP_Collection_Suffix): New constant string.
3270 (Add_Finalization_Master_Actual_To_Build_In_Place_Call): Rename to
3271 (Add_Collection_Actual_To_Build_In_Place_Call): ...this and adjust.
3272 (BIP_Formal_Suffix): Replace BIP_Finalization_Master alternative
3273 with BIP_Collection alternative.
3274 (BIP_Suffix_Kind): Replace test on BIP_Finalization_Master_Suffix
3275 with test on BIP_Collection_Suffix.
3276 (Is_Build_In_Place_Entity): Likewise.
3277 (Make_Build_In_Place_Call_In_Allocator): Call Needs_BIP_Collection
3278 and Add_Collection_Actual_To_Build_In_Place_Call.
3279 (Make_Build_In_Place_Call_In_Anonymous_Context): Likewise.
3280 (Make_Build_In_Place_Call_In_Assignment): Likewise.
3281 (Make_Build_In_Place_Call_In_Object_Declaration): Likewise.
3282 (Needs_BIP_Finalization_Master): Rename into...
3283 (Needs_BIP_Collection): ...this.
3284 (Needs_BIP_Alloc_Form): Call Needs_BIP_Collection.
3285 * exp_ch7.ads (Build_Anonymous_Master): Rename into...
3286 (Build_Anonymous_Collection): ...this.
3287 (Build_Finalization_Master): Rename into...
3288 (Build_Finalization_Collection): ...this.
3289 * exp_ch7.adb (Allows_Finalization_Master): Rename into...
3290 (Allows_Finalization_Collection): ...this.
3291 (Build_BIP_Cleanup_Stmts): Adjust to renamings.
3292 (Build_Anonymous_Master): Rename into...
3293 (Build_Anonymous_Collection): ...this. Adjust to renamings.
3294 (Build_Finalization_Master): Rename into...
3295 (Build_Finalization_Collection): ...this. Adjust to renamings.
3296 (Build_Finalizer): Adjust comment to renamings.
3297 * exp_ch13.adb (Expand_N_Free_Statement): Adjust to renamings.
3298 * exp_util.adb (Build_Allocate_Deallocate_Proc): Likewise.
3299 (Requires_Cleanup_Actions): Adjust comment to renamings.
3300 * freeze.adb (Freeze_All): Likewise.
3301 * rtsfind.ads (RTU_Id): Remove System_Finalization_Masters.
3302 (RE_Id): Remove RE_Finalization_Master & RE_Finalization_Master_Ptr
3303 add RE_Finalization_Collection & RE_Finalization_Collection_Ptr.
3304 Adjust RE_Add_Offset_To_Address and RE_Finalization_Scope_Master.
3305 (RE_Unit_Table): Remove entries for RE_Finalization_Master &
3306 RE_Finalization_Master_Ptr, add ones for RE_Finalization_Collection
3307 & RE_Finalization_Collection_Ptr. Also adjust those of
3308 RE_Add_Offset_To_Address and RE_Finalization_Scope_Master.
3309 * sem_ch3.adb (Access_Type_Declaration): Adjust to renamings.
3310 * sem_ch6.adb (Create_Extra_Formals): Likewise.
3311 * sem_util.adb (Designated_Subtype_Mark): Likewise.
3312 * libgnat/s-finpri.ads: Add clauses for Ada.Finalization and
3313 System.Storage_Elements.
3314 (Finalization_Collection): New limited controlled type.
3315 (Finalization_Collection_Ptr): Likewise.
3316 (Initialize): New overriding procedure.
3317 (Finalize): Likewise.
3318 (Finalization_Started): Likewise.
3319 (Collection_Node): New type.
3320 (Collection_Node_Ptr): Likewise.
3321 (Attach_Node_To_Collection): New procedure.
3322 (Detach_Node_From_Collection): Likewise.
3323 (Header_Size): New function.
3324 (Add_Offset_To_Address): Likewise.
3325 * libgnat/s-finpri.adb (Add_Offset_To_Address): New function.
3326 (Attach_Node_To_Collection): New procedure.
3327 (Detach_Node_From_Collection): Likewise.
3328 (Finalization_Started): Likewise.
3329 (Finalize): New overriding procedure.
3330 (Header_Size): New function.
3331 (Initialize): New overriding procedure.
3332 * libgnat/s-spsufi.ads (Finalize_And_Deallocate): Adjust comment.
3333 * libgnat/s-spsufi.adb: Remove clause for Finalization_Masters and
3334 add clause for Finalization_Primitives.
3335 (Finalize_And_Deallocate): Finalize the Collection component.
3336 * libgnat/s-stposu.ads: Remove clause for Finalization_Masters and
3337 add clause for Finalization_Primitives.
3338 (Root_Subpool): Replace Master component with Collection.
3339 (Allocate_Any_Controlled): Replace Context_Master parameter with
3340 Context_Collection parameter.
3341 * libgnat/s-stposu.adb: Remove clauses for Finalization_Masters and
3342 add clauses for Finalization_Primitives.
3343 (Address_To_FM_Node_Ptr): Delete.
3344 (To_Collection_Node_Ptr): New instance of Ada.Unchecked_Conversion.
3345 (Adjust_Controlled_Dereference): Adjust comment to renamings.
3346 (Allocate_Any_Controlled): Replace Context_Master parameter with
3347 Context_Collection parameter. Adjust to renamings.
3348 (Deallocate_Any_Controlled): Adjust to renamings.
3349 (Print_Subpool): Likewise.
3350 * libgnat/s-finmas.ads: Delete.
3351 * libgnat/s-finmas.adb: Likewise.
3353 2024-05-13 Ashley Gay <gay@adacore.com>
3355 * Makefile.rtl: remove i-vxinco.* from the build
3356 * doc/gnat_rm/the_gnat_library.rst: Remove i-vxinco.ads from
3357 the units documentation.
3358 * impunit.adb: Remove i-vxinco from the list of available units
3360 * libgnarl/i-vxinco.adb: Remove.
3361 * libgnarl/i-vxinco.ads: Ditto.
3362 * libgnarl/s-interr__vxworks.adb: enrich comment
3363 * libgnarl/s-vxwext__kernel.ads: fix comment
3364 * libgnat/i-vxwork.ads: Remove deprecated interrupt connections
3365 API, as well as an example.
3366 * libgnat/i-vxwork__x86.ads: Ditto and add the paragma
3367 Obscolescent to Attach_Handler
3368 * gnat_rm.texi: Regenerate.
3370 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3372 * exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Use the BIPstoragepool
3373 formal parameter to retrieve the pool in the presence of a master.
3374 * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Always pass
3375 a pool reference along with the master reference.
3376 (Make_Build_In_Place_Call_In_Object_Declaration): Likewise.
3377 * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Use the BIPstoragepool
3378 formal parameter to retrieve the pool in the presence of a master.
3379 (Create_Anonymous_Master): Do not call Set_Base_Pool.
3380 (Build_Finalization_Master): Likewise.
3381 * rtsfind.ads (RE_Id): Remove RE_Base_Pool and RE_Set_Base_Pool.
3382 (RE_Unit_Table): Remove associated entries.
3383 * libgnat/s-finmas.ads: Remove clause for System.Storage_Pools.
3384 (Any_Storage_Pool_Ptr): Delete.
3385 (Finalization_Master): Remove Base_Pool component.
3386 (Base_Pool): Delete.
3387 (Set_Base_Pool): Likewise.
3388 * libgnat/s-finmas.adb (Base_Pool): Likewise.
3389 (Set_Base_Pool): Likewise.
3390 (Print_Master): Do not print Base_Pool.
3392 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3394 * exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call):
3395 Rename Pool_Actual into Pool_Exp and use Empty as default value.
3396 (Add_Finalization_Master_Actual_To_Build_In_Place_Call): Change the
3397 names of the first two parameters and use a simpler code structure.
3398 (Make_Build_In_Place_Call_In_Allocator): Rename the local variable
3399 for the pool actual and set it to Empty if it is not used.
3400 (Make_Build_In_Place_Call_In_Object_Declaration): Rename the local
3401 variable for the master actual.
3403 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3405 * exp_ch3.adb (Expand_N_Object_Declaration): In the case of a
3406 return object of a BIP function that needs finalization, save
3407 the assignment statement made to initialize it, if any.
3408 * exp_ch6.ads (BIP_Formal_Kind): Adjust description.
3409 * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Make a
3410 couple of adjustments to the commentary.
3411 (Needs_BIP_Alloc_Form): Also return true if the function needs
3412 a BIP_Finalization_Master parameter.
3413 * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Remove now always true
3414 test on Needs_BIP_Alloc_Form.
3415 (Attach_Object_To_Master_Node): Remove duplication in comment.
3417 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3419 * sem_util.adb (Get_Index_Bounds): Guard against missing Entity,
3420 which happens on illegal constrained type declaration.
3422 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3424 * sem_attr.adb (Eval_Attribute): Treat Alignment like Component_Size
3427 2024-05-13 Steve Baird <baird@adacore.com>
3429 * sem_case.adb: Replace all tests of Core_Extensions_Allowed with
3430 corresponding tests of All_Extensions_Allowed.
3431 * sem_ch5.adb: Likewise.
3432 * doc/gnat_rm/gnat_language_extensions.rst: update documentation.
3433 * gnat_rm.texi: Regenerate.
3435 2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
3437 * sem_ch13.adb (New_Put_Image_Subprogram): In the nondeferred case
3438 coming from an aspect and for a type with delaying freezing, also
3439 freeze the subprogram immediately.
3441 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3443 * libgnat/a-direct.adb (Start_Search_Internal): Combine subtype
3444 and object declaration.
3445 * libgnat/g-dirope.adb (Read): Replace convoluted unchecked
3446 conversion with an overlay.
3448 2024-05-13 Piotr Trojanek <trojanek@adacore.com>
3450 * libgnat/g-dirope.adb (Read): Use null-excluding,
3451 access-to-constant type; replace element-by-element copy with
3454 2024-05-13 Gary Dismukes <dismukes@adacore.com>
3456 * exp_aggr.adb (Expand_Container_Aggregate): Move determination of
3457 whether the aggregate is an indexed aggregate earlier in the
3458 procedure. Test Is_Indexed_Aggregate as a criterion for generating
3459 a call to the container type's New_Indexed function, add proper
3460 computation of bounds to pass in to the function, and remove later
3461 code for generating such a call. Add and improve comments.
3462 (Aggregate_Size): Remove special treatment of case where there is
3463 exactly one component association, and instead loop over all
3464 component associations to determine whether any of them have a
3465 nonstatic length. If there is at least one such nonstatic
3466 association, return -1.
3467 (Build_Siz_Exp): Accumulate a sum of the sizes of each of the
3468 component associations in Siz_Exp (which will only be used if
3469 there any associations that are of Nkind
3470 N_Iterated_Component_Association with a nonstatic range).
3471 (Expand_Range_Component): Fix typos in the procedure's spec
3472 comment and block comment.
3474 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3476 * sem_util.adb (Number_Of_Elements_In_Array): Fix counting of
3477 elements in null arrays; remove redundant parenthesis; avoid
3478 run-time conversion of 1 to universal integer.
3480 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3482 * lib.ads, lib.adb (Primary_Stack_Count, Sec_Stack_Count,
3483 Increment_Primary_Stack_Count, Increment_Sec_Stack_Count,
3484 Unit_Record): Stack counts are never negative.
3485 * ali.ads (Unit_Record): Likewise.
3486 * bindgen.adb (Num_Primary_Stacks, Num_Sec_Stacks): Likewise.
3487 * exp_ch3.adb (Count_Default_Sized_Task_Stacks): Likewise.
3488 * sem_util.ads, sem_util.adb (Number_Of_Elements_In_Array):
3491 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3493 * exp_ch3.adb (Count_Default_Sized_Task_Stacks): Do not look for
3494 tasks inside record discriminants; remove avoid repeated call to
3495 Has_Task that happened for record components.
3496 (Expand_N_Object_Declaration): Use high-level routine to detect
3497 array types and subtypes; remove unused initial values.
3499 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3501 * exp_aggr.ads (Static_Array_Aggregate): Fix typo in comment.
3503 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3505 * inline.adb (Has_Single_Return): Remove redundant check for
3506 empty list, because First works also for empty list.
3508 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3510 * exp_ch4.adb (Useful): Remove redundant check for empty list,
3511 because iteration with First works also for empty list; rename
3512 local variable from L to Action.
3514 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3516 * inline.adb (Has_Formal_With_Per_Object_Constrained_Component):
3517 Use flag Has_Per_Object_Constraint which is set by analysis;
3518 rename for consistency.
3520 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3522 * sem_attr.adb (Analyze_Access_Attribute): Replace loop with
3523 Current_Scope_No_Loops.
3525 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3527 * sem_attr.adb (Analyze_Access_Attribute): Move code to IF
3528 branch where its result is used.
3530 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3532 * sem_attr.adb (Analyze_Access_Attribute): Prevent search from
3534 * sem_ch3.adb (Analyze_Component_Declaration): Remove
3535 Contains_POC; reuse Has_Discriminant_Dependent_Constraint.
3537 2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
3539 * einfo.ads (Pending_Access_Types): Delete.
3540 * exp_ch3.adb (Freeze_Type.Process_Pending_Access_Types): Likewise.
3541 (Freeze_Type): Do not call Process_Pending_Access_Types.
3542 * exp_ch7.ads (Make_Set_Finalize_Address_Call): Delete.
3543 * exp_ch7.adb (Build_Finalization_Master.Add_Pending_Access_Type):
3545 (Build_Finalization_Master): Do not set Finalize_Address on the
3546 master or call Add_Pending_Access_Type.
3547 (Make_Set_Finalize_Address_Call): Delete.
3548 * gen_il-fields.ads (Opt_Field_Enum): Remove Pending_Access_Types.
3549 * gen_il-gen-gen_entities.adb (Type_Kind): Likewise.
3550 * rtsfind.ads (RE_Id): Remove RE_Set_Finalize_Address.
3551 (RE_Unit_Table): Likewise.
3552 * sem_ch3.adb (Analyze_Full_Type_Declaration): Do not deal with
3553 pending access types.
3554 * libgnat/s-finmas.ads (Attach_Unprotected): Add Finalize_Address
3556 (Delete_Finalize_Address_Unprotected): Delete.
3557 (Finalize_Address): Likewise.
3558 (Finalize_Address_Unprotected): Likewise.
3559 (Is_Homogeneous): Likewise.
3560 (Set_Finalize_Address): Likewise.
3561 (Set_Finalize_Address_Unprotected): Likewise.
3562 (Set_Heterogeneous_Finalize_Address_Unprotected): Likewise.
3563 (Set_Is_Heterogeneous): Likewise.
3564 (FM_Node): Add Finalize_Address component.
3565 (Finalization_Master): Remove Is_Homogeneous and Finalize_Address
3567 * libgnat/s-finmas.adb: Remove with & use clauses for System.HTable.
3568 (Finalize_Address_Table): Delete.
3569 (Attach_Unprotected): Add Finalize_Address second parameter and save
3570 its value in the Finalize_Address field of the node.
3571 (Delete_Finalize_Address_Unprotected): Delete.
3572 (Finalize): Call Finalize_Address saved in the nodes.
3573 (Finalize_Address): Delete.
3574 (Finalize_Address_Unprotected): Likewise.
3576 (Is_Homogeneous): Likewise.
3577 (Print_Master): Adjust.
3578 (Set_Finalize_Address): Delete.
3579 (Set_Finalize_Address_Unprotected): Likewise.
3580 (Set_Heterogeneous_Finalize_Address_Unprotected): Likewise.
3581 (Set_Is_Heterogeneous): Likewise.
3582 * libgnat/s-stposu.adb (Finalize_Address_Table_In_Use): Likewise.
3583 (Allocate_Any_Controlled): Pass Fin_Address to Attach_Unprotected
3584 and remove obsolete processing.
3585 (Deallocate_Any_Controlled): Remove obsolete processing.
3586 (Set_Pool_Of_Subpool): Do not call Set_Is_Heterogeneous.
3588 2024-05-07 Joffrey Huguet <huguet@adacore.com>
3590 * libgnat/a-ngelfu.ads (Sqrt): Add Global contracts.
3606 (Arcsinh): Likewise.
3607 (Arccosh): Likewise.
3608 (Arctanh): Likewise.
3609 (Arccoth): Likewise.
3611 2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
3613 * einfo.ads (Postconditions_Proc): Delete.
3614 * gen_il-fields.ads (Opt_Field_Enum): Remove Postconditions_Proc.
3615 * gen_il-gen-gen_entities.adb (E_Function): Likewise.
3616 (E_Procedure): Likewise.
3617 (E_Entry): Likewise.
3618 (E_Entry_Family): Likewise.
3620 2024-05-07 Ronan Desplanques <desplanques@adacore.com>
3622 * sinfo.ads: Fix typo.
3624 2024-05-07 Bob Duff <duff@adacore.com>
3626 * exp_attr.adb (Attribute_Old): The 'Old attribute we are
3627 processing here is in a postcondition, which cannot be inside the
3628 "Wrapped_Statements" of the subprogram with that postcondition. So
3629 remove the loop labeled "Climb the parent chain looking for
3630 subprogram _Wrapped_Statements". The only way this loop could find
3631 a Subp is if we are nested inside a subprogram that also has a
3632 postcondition, and in that case we would find the wrong (outer)
3633 one. In any case, Subp is set to Empty after the loop, so all
3634 subsequent tests for Present (Subp) are necessarily False; remove
3635 them and the corresponding code. Set Ins_Node unconditionally (to
3636 the right thing). Remove obsolete comments.
3637 * sem_util.adb (Determining_Expressions): Fix assertion;
3638 Pragma_Test_Case was missing.
3639 (Eligible_For_Conditional_Evaluation): Fix assert that could fail
3641 * libgnat/s-valspe.ads: Remove pragma Unevaluated_Use_Of_Old;
3642 there are no uses of 'Old in this package.
3644 2024-05-07 Yannick Moy <moy@adacore.com>
3646 * libgnat/a-strsea.adb (Index): Add assertions.
3647 * libgnat/a-strsup.ads ("="): Remove useless precondition.
3648 * libgnat/s-aridou.adb (Prove_Rounding_Case): Add assertions.
3649 (Lemma_Shift_Right): Add call to lemma.
3650 * libgnat/s-arit32.adb (Prove_Rounding_Case): Add assertion.
3651 (Prove_ Signs): Add assertions.
3652 (Scaled_Divide32): Add assertions.
3654 2024-05-07 Steve Baird <baird@adacore.com>
3656 * sem_prag.adb (Analyze_Pragma): Restructure the loop over
3657 possible resolutions of a No_Return pragma's argument so that
3658 functions (and generic functions) are not processed until after it
3659 is known whether there is a non-function candidate resolution. For
3660 a pre-2022 Ada version, terminate the iteration before processing
3661 functions if a non-function resolution is found.
3663 2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
3665 * libgnat/g-socthi.ads (C_Bind): Turn into inline function.
3666 (C_Getpeername): Likewise.
3667 (C_Getsockname): Likewise.
3668 (C_Getsockopt): Likewise.
3669 (C_Setsockopt): Likewise.
3670 (Nonreentrant_Gethostbyaddr): Likewise.
3671 * libgnat/g-socthi.adb (Syscall_Accept): Adjust profile.
3672 (Syscall_Connect): Likewise.
3673 (Syscall_Recvfrom): Likewise.
3674 (Syscall_Sendto): Likewise.
3675 (C_Bind): New function.
3676 (C_Accept): Adjust to above change for profiles.
3677 (C_Connect): Likewise.
3678 (C_Getpeername): New function.
3679 (C_Getsockname): Likewise.
3680 (C_Getsockopt): Likewise.
3681 (C_Recvfrom): Adjust to above change for profiles.
3682 (C_Setsockopt): New function.
3683 (Nonreentrant_Gethostbyaddr): Likewise.
3685 2024-05-07 Bob Duff <duff@adacore.com>
3687 * par-ch3.adb (P_Component_Items): Move P_Aspect_Specifications
3688 into the loop, so aspects can be attached to multiple component
3690 (P_Type_Declaration, P_Subtype_Declaration)
3691 (P_Known_Discriminant_Part_Opt): Remove default for Semicolon in
3692 calls to P_Aspect_Specifications.
3693 * gen_il-gen-gen_nodes.adb (N_Discriminant_Specification): Add
3694 Aspect_Specifications field to N_Discriminant_Specification, which
3696 * aspects.adb (Has_Aspect_Specifications_Flag): Make it True for
3697 N_Discriminant_Specification.
3698 * par-ch13.adb: Remove default for Semicolon in calls to
3699 P_Aspect_Specifications.
3700 (Get_Aspect_Specifications): Misc cleanup.
3701 (P_Aspect_Specifications): Remove comment. It's not clear what
3702 "the flag" is referring to, but anyway the first part of the
3703 comment is obvious, and the second part is apparently obsolete.
3705 * par.adb (P_Aspect_Specifications, Get_Aspect_Specifications):
3706 Remove default for Semicolon; calls are more readable that way.
3708 * par-ch12.adb: Remove default for Semicolon in calls to
3709 P_Aspect_Specifications.
3710 * par-ch6.adb: Likewise.
3711 * par-ch7.adb: Likewise.
3712 * par-ch9.adb: Likewise.
3713 * par-endh.adb: Likewise.
3715 2024-05-07 Justin Squirek <squirek@adacore.com>
3717 * sem_prag.adb (Defer_Compile_Time_Warning_Error_To_BE): Better
3718 handle itypes such that the tree copy required for the expansion
3719 of the pragma doesn't cause ordering problems with internal names.
3721 2024-05-07 Yannick Moy <moy@adacore.com>
3723 * sem_res.adb (Resolve_Actuals): Add range check flag.
3725 2024-05-07 Yannick Moy <moy@adacore.com>
3727 * sem_util.adb (Find_Placement_In_State_Space): Stop search for
3728 placement when reaching the public state of a generic package.
3730 2024-05-07 Javier Miranda <miranda@adacore.com>
3732 * sem_ch3.adb (Check_Return_Subtype_Indication): Add missing check
3733 on statically compatible subtypes.
3734 * sem_eval.adb (Subtypes_Statically_Compatible): Ensure that both
3735 types are either scalar types or access types to evaluate this
3738 2024-05-07 Bob Duff <duff@adacore.com>
3740 * sem_ch13.adb (Resolve_Name): Clarify comment.
3742 2024-05-07 Bob Duff <duff@adacore.com>
3744 * sem_ch13.adb (Resolve_Name): This is called only for names in
3745 aspect_specifications. If the name is an overloaded
3746 selected_component, reset the Entity. Note that this was already
3747 done for N_Identifier in the code just below.
3749 2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
3751 * repinfo.adb (List_Record_Info.List_Structural_Record_Layout): Add
3752 another guard for private types after retrieving the parent in the
3755 2024-05-07 Yannick Moy <moy@adacore.com>
3757 * sem_util.adb (Is_Volatile_Function): Return True on functions
3760 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3762 * sem_prag.adb (Analyze_Global_Item): Handle side-effect
3763 functions like procedures.
3765 2024-05-07 Piotr Trojanek <trojanek@adacore.com>
3767 * sem_prag.adb (Collect_Global_Item): Update comment.
3769 2024-05-06 Piotr Trojanek <trojanek@adacore.com>
3771 * sem_prag.adb (Collect_Global_Item): Handle functions with
3774 2024-05-06 Piotr Trojanek <trojanek@adacore.com>
3776 * sem_prag.adb (Collect_Global_Item): Move code.
3778 2024-05-06 Piotr Trojanek <trojanek@adacore.com>
3780 * sem_prag.adb (Find_Role): Handle functions with side-effects
3783 2024-05-06 Gary Dismukes <dismukes@adacore.com>
3786 (Make_Build_In_Place_Iface_Call_In_Object_Declaration): Set the
3787 Is_Return_Object flag on the entity of the temp object created to
3788 hold the BIP call result, from the flag on the passed-in object
3789 declaration's entity. Update copyright notice to 2024.
3791 2024-05-06 Bob Duff <duff@adacore.com>
3793 * sem_ch10.adb (Expand_With_Clause): Misc cleanup.
3794 (Install_Private_With_Clauses): Avoid installing a private
3795 with_clause that comes from an instantiated generic
3796 (it is marked as Implicit_With, but doesn't come from a parent
3797 with). Fix typo in comment, and other minor cleanups.
3799 2024-05-06 Ronan Desplanques <desplanques@adacore.com>
3801 * sem_util.adb (Build_Default_Subtype): Tweak source location
3804 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3806 * exp_ch7.adb (Build_Finalizer.Process_Declarations): Do not call
3807 Processing_Actions for simple protected objects if the profile is
3809 * exp_util.adb (Requires_Cleanup_Actions): Do not return True for
3810 simple protected objects if the profile is restricted.
3812 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3814 * fe.h: Remove unused declarations and add 'extern' to others.
3816 2024-05-06 Piotr Trojanek <trojanek@adacore.com>
3818 * einfo-utils.adb (Is_Relaxed_Initialization_State): Remove.
3819 * einfo-utils.ads (Is_Relaxed_Initialization_State): Remove.
3820 * einfo.ads: Remove description of removed aspect.
3821 * fe.h (Is_Relaxed_Initialization_State): Remove.
3822 * sem_prag.adb (Analyze_Abstract_State): Remove support for
3823 Relaxed_Initialization.
3824 * sem_util.adb (Has_Relaxed_Initialization): Likewise.
3825 * sem_util.ads (Has_Relaxed_Initialization): Likewise.
3827 2024-05-06 Justin Squirek <squirek@adacore.com>
3829 * sem_warn.adb (Within_Postcondition): Add coverage for
3832 2024-05-06 Justin Squirek <squirek@adacore.com>
3834 * sem_warn.adb (Within_Postcondition): Add/modify comments to
3835 document various cases.
3837 2024-05-06 Justin Squirek <squirek@adacore.com>
3839 * sem_warn.adb (Within_Postcondition): Renamed to
3840 Within_Contract_Or_Predicate.
3842 2024-05-06 Justin Squirek <squirek@adacore.com>
3844 * sem_warn.adb (Within_Postcondition): Add case to ignore
3845 references within generated predicate function calls.
3847 2024-05-06 Ronan Desplanques <desplanques@adacore.com>
3849 * hostparm.ads: Fix reference to RM clause.
3851 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3853 * libgnat/s-finpri.ads (Finalize_Master): Remove obsolete reference
3855 (Finalize_Object): Document the effects of repeated calls.
3857 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3859 * einfo.ads (Finalization_Master_Node_Or_Object): Rename into...
3860 (Finalization_Master_Node): ...this and adjust description.
3861 * exp_ch4.adb (Process_Transient_In_Expression): Attach the object
3862 to its master node here.
3863 * exp_ch7.ads (Attach_Object_To_Master_Node): New declaration.
3864 * exp_ch7.adb (Attach_Object_To_Master_Node): New procedure.
3865 (Build_Finalizer.Process_Declarations): Examine the type of a
3866 variable to spot master nodes.
3867 (Build_Finalizer.Process_Object_Declaration): Look only at the
3868 object and deal specifically with the case of a master node.
3869 (Build_Finalizer.Build_BIP_Cleanup_Stmts): Move to child function
3870 of Attach_Object_To_Master_Node.
3871 (Build_Finalizer.Make_Address_For_Finalize): Move to...
3872 (Insert_Actions_In_Scope_Around.Process_Transient_In_Scope): Attach
3873 the object to its master node here.
3874 (Make_Address_For_Finalize): ...here.
3875 (Make_Master_Node_Declaration): Adjust to above renaming and set
3876 Finalization_Master_Node only on the object.
3877 (Make_Suppress_Object_Finalize_Call): Adjust to above renaming and
3878 attach the object to its master node here.
3879 * exp_util.adb (Requires_Cleanup_Actions): Examine the type of a
3880 variable to spot master nodes.
3881 * gen_il-fields.ads (Opt_Field_Enum): Adjust to above renaming.
3882 * gen_il-gen-gen_entities.adb (Allocatable_Kind): Likewise.
3883 * rtsfind.ads (RE_Id): Add RE_Chain_Node_To_Master.
3884 (RE_Unit_Table): Add entry for RE_Chain_Node_To_Master.
3885 * libgnat/s-finpri.ads (Chain_Node_To_Master): New declaration.
3886 * libgnat/s-finpri.adb (Chain_Node_To_Master): New procedure.
3887 (Attach_Object_To_Master): Call it.
3888 (Finalize_Master): Do not raise Program_Error on null addresses.
3889 (Finalize_Object): Add assertion that the address is not null.
3891 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3893 * libgnarl/s-taprob.ads (Protection): Add cross-reference to the
3894 counterpart in System.Tasking.Protected_Objects.Entries.
3895 * libgnarl/s-taskin.ads (Locking Rules): Replace PO_Simple by
3897 * libgnarl/s-tpoben.ads (Protection_Entries): Likewise.
3899 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3901 * exp_attr.adb (Expand_N_Attribute_Reference) <Finalization_Size>:
3902 Return 0 if the prefix is a dereference of an access value subject
3903 to the No_Heap_Finalization pragma.
3905 2024-05-06 Ronan Desplanques <desplanques@adacore.com>
3907 * exp_imgv.adb (Append_Table_To): Remove reference to removed
3909 * gen_il-fields.ads: Remove Is_Enum_Array_Aggregate field.
3910 * gen_il-gen-gen_nodes.adb: Likewise.
3911 * sem_aggr.adb: Tweak warning emission condition.
3912 * sinfo.ads: Remove documentation for Is_Enum_Array_Aggregate.
3914 2024-05-06 Piotr Trojanek <trojanek@adacore.com>
3916 * make.adb (Scan_Make_Arg): Remove redundant condition.
3917 * switch-b.adb (Scan_Debug_Switches): Likewise.
3918 * switch-c.adb (Scan_Front_End_Switches): Likewise.
3920 2024-05-06 Yannick Moy <moy@adacore.com>
3922 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add guard.
3924 2024-05-06 Piotr Trojanek <trojanek@adacore.com>
3926 * exp_pakd.adb (Create_Packed_Array_Impl_Type): Set associated
3927 node for the packed array itype.
3928 * exp_util.adb (Possible_Side_Effect_In_SPARK): Remove
3929 workaround for a missing associated node.
3931 2024-05-06 Richard Kenner <kenner@adacore.com>
3933 * freeze.adb (Freeze_Entity): When changing the convention of
3934 primitive to match that of the type, only do this for user-specified
3937 2024-05-06 Bob Duff <duff@adacore.com>
3939 * exp_put_image.adb (Build_Image_Call): Call Set_Uses_Sec_Stack on
3940 the current scope. We don't do this at all call sites, because
3941 there are three; better to do it here.
3943 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3945 * sem_attr.adb (Analyze_Attribute) <Attribute_Round>: Also accept it
3946 for ordinary fixed point types.
3947 * doc/gnat_rm/implementation_defined_attributes.rst (Round): New.
3948 * gnat_rm.texi: Regenerate.
3950 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3952 * exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Use No instead of
3955 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3957 * exp_ch7.adb (Build_Finalizer.Process_Object_Declaration): Adjust
3958 the Sloc of the master node declaration in the degenerate case.
3960 2024-05-06 Yannick Moy <moy@adacore.com>
3962 * inline.adb (Call_Can_Be_Inlined_In_GNATprove_Mode):
3963 Add case to prevent inlining of call.
3964 * inline.ads: Likewise.
3965 * sem_res.adb (Resolve_Call): Update comment and message.
3967 2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
3969 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-finpri$(objext).
3970 * contracts.adb (Add_Call_Helper): Append freeze actions to the
3971 class-wide type rather than the specific tagged type.
3972 * einfo.ads (Finalization_Master_Node_Or_Node): Document.
3973 (Status_Flag_Or_Transient_Decl): Remove.
3974 * exp_attr.adb (Expand_N_Attribute_Reference) <Address>: Do not
3975 adjust a return object of a class-wide interface type.
3976 * exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Add test that
3977 Finalize_Address is not already present as a condition for calling
3978 Make_Finalize_Address_Body.
3979 (Expand_Freeze_Record_Type): Call Make_Finalize_Address_Body for
3980 class-wide types of both regular tagged types and interface types.
3981 * exp_ch4.adb (Process_Transients_In_Expression): Replace the use
3982 of hooks with the use of master nodes.
3983 * exp_ch6.adb (Build_Flag_For_Function): Delete.
3984 (Expand_N_Extended_Return_Statement): Create a master node for the
3985 return object if it does not exist. At the end of the statement,
3986 generate a call to Suppress_Object_Finalize.
3987 (Expand_Non_Function_Return): Likewise just before the return.
3988 * exp_ch7.ads (Make_Master_Node_Declaration): Declare.
3989 (Make_Suppress_Object_Finalize_Call): Likewise.
3990 * exp_ch7.adb (Build_Finalization_Master): Defer generating the
3991 call to Set_Finalize_Address until freezing if the Finalize_Address
3992 procedure has not been analyzed yet.
3993 (Build_Finalizer): Reimplement the expansion using a finalization
3994 scope master per finalizer.
3995 (Insert_Actions_In_Scope_Around): Replace finalization hooks by
3996 master nodes and calls to the Finalize_Object.
3997 (Make_Master_Node_Declaration): New procedure.
3998 (Make_Suppress_Object_Finalize_Call): Likewise.
3999 * exp_util.ads (Build_Transient_Object_Statements): Delete.
4000 * exp_util.adb (Build_Transient_Object_Statements): Likewise.
4001 (Requires_Cleanup_Actions): Remove obsolete code and return true
4003 * gen_il-fields.ads (Opt_Field_Enum): Add
4004 Finalization_Master_Node_Or_Object and
4005 remove Status_Flag_Or_Transient_Decl.
4006 * gen_il-gen-gen_entities.adb (Allocatable_Kind): Likewise.
4007 * rtsfind.ads (RTU_Id): Add System_Finalization_Primitives.
4008 (RE_Id): Add entities of System_Finalization_Primitives.
4009 (RE_Unit_Table): Add entries for them.
4010 * sem_ch3.adb (Analyze_Object_Declaration): For an array whose type
4011 has an unconstrained first subtype and a controlled component, set
4012 the Is_Constr_Array_Subt_With_Bounds flag.
4013 * libgnat/s-finpri.ads: New file.
4014 * libgnat/s-finpri.adb: Likewise.
4016 2024-05-06 Yannick Moy <moy@adacore.com>
4018 * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Adapt checking.
4020 2024-04-26 Jakub Jelinek <jakub@redhat.com>
4022 * gnatvsn.ads: Bump Library_Version to 15.
4024 2024-04-15 Piotr Trojanek <trojanek@adacore.com>
4026 * doc/gnat_rm/implementation_defined_aspects.rst
4027 (Exceptional_Cases): Add description for aspect.
4028 * doc/gnat_rm/implementation_defined_pragmas.rst
4029 (Exceptional_Cases): Add description for pragma.
4030 * gnat_rm.texi: Regenerate.
4031 * gnat_ugn.texi: Regenerate.
4033 2024-03-07 Eric Botcazou <ebotcazou@adacore.com>
4036 * exp_ch4.adb (Expand_N_Allocator): In the subtype indication case,
4037 call Apply_Predicate_Check on the resulting access value if needed.
4039 2024-02-26 Eric Botcazou <ebotcazou@adacore.com>
4042 * exp_ch7.adb (Build_Anonymous_Master): Do not build the master
4043 for a local designated type.
4044 * exp_util.adb (Build_Allocate_Deallocate_Proc): Force Needs_Fin
4045 to false if no finalization master is attached to an access type
4046 and assert that it is anonymous in this case.
4047 * sem_res.adb (Resolve_Allocator): Mention that the object might
4048 not be finalized at all in the warning given when the type is an
4049 anonymous access-to-controlled type.
4051 2024-01-23 Ronan Desplanques <desplanques@adacore.com>
4053 * gnatvsn.ads: Update year.
4055 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4057 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Use the
4058 TYPE_CANONICAL of types when it comes to aliasing.
4059 * gcc-interface/utils.cc (relate_alias_sets): Likewise.
4061 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4063 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Use a
4064 separate FLD local variable to hold the first field of the fat
4065 pointer type being built.
4066 * gcc-interface/gigi.h (relate_alias_sets): Remove GNU_ prefix on
4067 the first two parameters.
4068 * gcc-interface/utils.cc (relate_alias_sets): Likewise and adjust.
4070 2024-01-09 Viljar Indus <indus@adacore.com>
4072 * sem_attr.adb: avoid marking a use of the Address attribute
4073 as a modification of its prefix.
4075 2024-01-09 Gary Dismukes <dismukes@adacore.com>
4077 * exp_aggr.adb (Expand_Container_Aggregate): Change "not Present"
4078 tests to tests using "No" (in two places).
4080 2024-01-09 Bob Duff <duff@adacore.com>
4082 * sem_ch12.adb (Instantiate_Type): Make the relevant error message
4083 conditional upon "Ekind (A_Gen_T) /= E_Incomplete_Type". Misc
4086 2024-01-09 Gary Dismukes <dismukes@adacore.com>
4088 * exp_aggr.adb (Expand_Container_Aggregate): Add code to determine
4089 whether the aggregate is an indexed aggregate, setting a flag
4090 (Is_Indexed_Aggregate), which is tested to have proper separation
4091 of treatment for the Add_Unnamed
4092 (for positional aggregates) and New_Indexed (for indexed
4093 aggregates) cases. In the code generating associations for indexed
4094 aggregates, remove the code for Expressions cases entirely, since
4095 the code for indexed aggregates is governed by the presence of
4096 Component_Associations, and add an assertion that Expressions must
4097 be Empty. Also, exclude empty aggregates from entering that code.
4099 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4101 * rtsfind.ads (RE_Id): Remove RE_Attach.
4102 (RE_Unit_Table): Likewise.
4103 * libgnat/s-finmas.ads (Attach): Delete.
4104 * libgnat/s-finmas.adb (Attach): Likewise.
4106 2024-01-09 Tucker Taft <taft@adacore.com>
4108 * pprint.adb (List_Name): Check for "Box_Present" when displaying
4109 a list, and emit "<>" if returns True.
4110 * sem_scil.adb (Check_SCIL_Node): Handle case when the type of a
4111 parameter is from a package that was mentioned in a limited with
4112 clause, and make no further checks, since this check routine does
4113 not have all the logic to check such a usage.
4115 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4117 * freeze.adb (Freeze_Expression.Has_Decl_In_List): Deal specifically
4118 with itypes that are class-wide subtypes.
4120 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4122 * libgnat/s-atopri.ads (Atomic_Store): New generic procedure.
4123 (Atomic_Store_8): New instantiated procedure.
4124 (Atomic_Store_16): Likewise.
4125 (Atomic_Store_32): Likewise.
4126 (Atomic_Store_64): Likewise.
4127 * libgnat/s-atopri__32.ads (Atomic_Store): New generic procedure.
4128 (Atomic_Store_8): New instantiated procedure.
4129 (Atomic_Store_16): Likewise.
4130 (Atomic_Store_32): Likewise.
4131 * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Implement the
4132 support for __atomic_store_n and __sync_bool_compare_and_swap_n.
4133 * gcc-interface/gigi.h (list_second): New inline function.
4135 2024-01-09 Javier Miranda <miranda@adacore.com>
4137 * sem_ch6.adb (Analyze_Subprogram_Specification): Do not replace
4138 the type of the formals with its corresponding record in
4140 * sem_ch9.adb (Analyze_Requeue): Add missing support to requeue to
4141 a procedure that denotes a renaming of an entry.
4143 2024-01-09 Piotr Trojanek <trojanek@adacore.com>
4145 * exp_util.adb (Possible_Side_Effect_In_SPARK): Refine handling of
4148 2024-01-09 Piotr Trojanek <trojanek@adacore.com>
4150 * sem_ch6.adb (Analyze_Subprogram_Specification): Set Is_Inlined
4151 flag by default in GNATprove mode.
4152 * sem_res.adb (Resolve_Call): Only look at flag which is cleared
4153 when inlined subprogram is detected to be recursive.
4155 2024-01-09 Piotr Trojanek <trojanek@adacore.com>
4157 * inline.adb (Establish_Actual_Mapping_For_Inlined_Call):
4158 Remove detection of recursive calls.
4160 2024-01-09 Piotr Trojanek <trojanek@adacore.com>
4162 * inline.adb (Cannot_Inline): Cleanup use of 'Length; remove
4165 2024-01-09 Piotr Trojanek <trojanek@adacore.com>
4167 * sem_aggr.adb (Resolve_Container_Aggregate): Use "No".
4168 * sem_ch8.adb (Find_Direct_Name): Likewise.
4170 2024-01-09 Steve Baird <baird@adacore.com>
4172 * sem_util.adb (Enclosing_Declaration): Instead of returning a
4173 subprogram specification node, return its parent (which is
4174 presumably a subprogram declaration).
4175 * contracts.adb (Insert_Stable_Property_Check): Remove code
4176 formerly needed to compensate for incorrect behavior of
4177 Sem_Util.Enclosing_Declaration.
4178 * exp_attr.adb (In_Available_Context): Remove code formerly needed
4179 to compensate for incorrect behavior of
4180 Sem_Util.Enclosing_Declaration.
4181 * sem_ch8.adb (Is_Actual_Subp_Of_Inst): Remove code formerly
4182 needed to compensate for incorrect behavior of
4183 Sem_Util.Enclosing_Declaration.
4185 2024-01-09 Steve Baird <baird@adacore.com>
4187 * sem_ch8.adb (Check_Constrained_Object): Before updating the
4188 subtype mark of an object renaming declaration by calling Rewrite,
4189 first check whether the destination of the Rewrite call exists.
4190 * atree.adb (Copy_Slots): Return without performing any updates if
4191 Destination equals Empty or Error, or if Source equals Empty. Any
4192 of those conditions indicates an error case.
4193 * sem_ch12.adb (Analyze_Formal_Derived_Type): Avoid cascading
4195 * sem_ch3.adb (Analyze_Number_Declaration): In an error case, do
4196 not pass Error as destination in a call to Rewrite.
4197 (Find_Type_Of_Subtype_Indic): In an error case, do not pass Error
4198 or Empty as destination in a call to Rewrite.
4200 2024-01-09 Joffrey Huguet <huguet@adacore.com>
4202 * libgnat/i-cstrin.ads (Update): Fix precondition.
4204 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4206 * sem_aggr.adb (Resolve_Extension_Aggregate): Remove the unreachable
4207 call to Transform_BIP_Assignment as well as the procedure.
4209 2024-01-09 Bob Duff <duff@adacore.com>
4211 * lib-xref.adb (Generate_Reference): Do not count it as a read
4212 reference if we're calling a TSS.
4214 2024-01-09 Piotr Trojanek <trojanek@adacore.com>
4216 * doc/gnat_rm/implementation_defined_aspects.rst,
4217 doc/gnat_rm/implementation_defined_pragmas.rst: Add sections for
4219 * gnat-style.texi: Regenerate.
4220 * gnat_rm.texi: Regenerate.
4221 * gnat_ugn.texi: Regenerate.
4223 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4226 * libgnat/g-regexp.ads: Fix outdated comment.
4228 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4231 * exp_ch6.ads (Is_Build_In_Place_Function): Adjust description.
4232 * exp_ch6.adb (Is_True_Build_In_Place_Function_Call): Delete.
4233 (Is_Function_Call_With_BIP_Formals): New predicate.
4234 (Is_Build_In_Place_Function_Call): Restore original semantics.
4235 (Expand_Call_Helper): Adjust conditions guarding the calls to
4236 Add_Dummy_Build_In_Place_Actuals to above renaming.
4237 (Expand_N_Extended_Return_Statement): Adjust to above renaming.
4238 (Expand_Simple_Function_Return): Likewise. Move the assertion
4239 to after the transformation into an extended return statement.
4240 (Make_Build_In_Place_Call_In_Allocator): Remove unreachable code.
4241 (Make_Build_In_Place_Call_In_Assignment): Likewise.
4243 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4246 * sem_ch12.adb (Instantiate_Type): Use Etype instead of Base_Type
4247 consistently to retrieve the ancestor for a derived type.
4248 * sem_ch4.adb (Analyze_Explicit_Dereference): Test Is_Access_Type
4249 consistently before accessing Designated_Type.
4251 2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
4253 * gcc-interface/utils2.cc (build_binary_op) <EQ_EXPR>: Relax
4254 assertion for regular pointer types.
4256 2024-01-04 David Malcolm <dmalcolm@redhat.com>
4258 * gcc-interface/lang.opt.urls: New file, autogenerated by
4259 regenerate-opt-urls.py.
4261 2024-01-03 Jakub Jelinek <jakub@redhat.com>
4263 * gnat_ugn.texi: Bump @copying's copyright year.
4264 * gnat_rm.texi: Likewise.
4267 Copyright (C) 2024 Free Software Foundation, Inc.
4269 Copying and distribution of this file, with or without modification,
4270 are permitted in any medium without royalty provided the copyright
4271 notice and this notice are preserved.