aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2023-05-30ada: Fix fallout of recent fix for missing finalizationEric Botcazou1-10/+26
The original fix makes it possible to create transient scopes around return statements in more cases, but it overlooks that transient scopes are reused and, in particular, that they can be promoted to secondary stack management. gcc/ada/ * exp_ch7.adb (Find_Enclosing_Transient_Scope): Return the index in the scope table instead of the scope's entity. (Establish_Transient_Scope): If an enclosing scope already exists, do not set the Uses_Sec_Stack flag on it if the node to be wrapped is a return statement which requires secondary stack management.
2023-05-30ada: Add System.Traceback.Symbolic.Module_Name support on AArch64 LinuxJoel Brobecker1-0/+2
This commit changes the runtime on aarch64-linux to use the Linux version of s-tsmona.adb, so as to add support for this functionality on aarch64-linux. gcc/ada/ * Makefile.rtl: Use libgnat/s-tsmona__linux.adb on aarch64-linux. Link libgnat with -ldl, as the use of s-tsmona__linux.adb requires it.
2023-05-30ada: Only build access-to-subprogram wrappers when expander is activePiotr Trojanek2-14/+2
For access-to-subprogram types with Pre/Post aspects we create a wrapper routine that evaluates these aspects. Spec of this wrapper was created always, while its body was only created when expansion was enabled. Now we only create these wrappers when expansion is enabled. In particular, we don't create them in GNATprove mode; instead, GNATprove picks the Pre/Post expressions directly from the aspects. gcc/ada/ * exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Build wrapper body if requested by routine that builds wrapper spec. * sem_ch3.adb (Analyze_Full_Type_Declaration): Only build wrapper when expander is active. (Build_Access_Subprogram_Wrapper): Remove special-case for GNATprove.
2023-05-30ada: Fix minor issues in user's guideRonan Desplanques3-36/+32
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix minor issues. * doc/gnat_ugn/the_gnat_compilation_model.rst: Fix minor issues. * gnat_ugn.texi: Regenerate.
2023-05-30ada: Ensure Default_Stack_Size is greater than Minimum_Stack_SizeJohannes Kliemann3-2/+13
The Default_Stack_Size function does not check that the binder specified default stack size is greater than the minimum stack size for the runtime. This can result in tasks using default stack sizes less than the minimum stack size because the Adjust_Storage_Size only adjusts storages sizes for tasks that explicitly specify a storage size. To avoid this, the binder specified default stack size is round up to the minimum stack size if required. gcc/ada/ * libgnat/s-parame.adb: Check that Default_Stack_Size >= Minimum_Stack_size. * libgnat/s-parame__rtems.adb: Ditto. * libgnat/s-parame__vxworks.adb: Check that Default_Stack_Size >= Minimum_Stack_size and use the proper Minimum_Stack_Size if Stack_Check_Limits is enabled.
2023-05-30ada: Fix regression of secondary stack management in return statementsEric Botcazou1-38/+31
This happens when the expression of the return statement is a call that does not return on the same stack as the enclosing function. gcc/ada/ * sem_res.adb (Resolve_Call): Restrict previous change to calls that return on the same stack as the enclosing function. Tidy up.
2023-05-30ada: Use generalized loop iteration in Put_Image routinesEric Botcazou2-16/+10
gcc/ada/ * libgnat/a-cidlli.adb (Put_Image): Simplify. * libgnat/a-coinve.adb (Put_Image): Likewise.
2023-05-30ada: Fix visibility error with DIC or Type_Invariant aspect on generic typeEric Botcazou1-2/+17
The compiler fails to capture global references during the analysis of the aspect on the generic type because it analyzes a copy of the expression. gcc/ada/ * exp_util.adb (Build_DIC_Procedure_Body.Add_Own_DIC): When inside a generic unit, preanalyze the expression directly. (Build_Invariant_Procedure_Body.Add_Own_Invariants): Likewise.
2023-05-30ada: Fix coding style in init.cCedric Landet1-2/+2
The coding style rules require to avoid using FIXME comments. ??? is preferred. gcc/ada/ * init.c: Replace FIXME by ???
2023-05-29Daily bump.GCC Administrator1-0/+286
2023-05-29ada: Define sigset for systems that does not suport socketsCedric Landet1-5/+5
In s-oscons-tmplt.c, sigset is defined inside the HAVE_SOCKETS bloc. A platform could require sigset without supporting sockets. gcc/ada/ * s-oscons-tmplt.c: move the definition of sigset out of the HAVE_SOCKETS bloc.
2023-05-29ada: Set g-spogwa as a GNATRTL_SOCKETS_OBJSCedric Landet1-2/+1
g-spogwa.adb is the body of the procedure GNAT.Sockets.Poll.G_Wait. This is a socket specific procedure. It should only be built for systems that support sockets. gcc/ada/ * Makefile.rtl: Move g-spogwa$(objext) from GNATRTL_NONTASKING_OBJS to GNATRTL_SOCKETS_OBJS
2023-05-29ada: Fix spurious error on imported generic function with preconditionEric Botcazou1-7/+1
It occurs during the instantiation because the compiler forgets the context of the generic declaration. gcc/ada/ * freeze.adb (Wrap_Imported_Subprogram): Use Copy_Subprogram_Spec in both cases to copy the spec of the subprogram.
2023-05-29ada: Fix memory leak in expression function returning Big_IntegerEric Botcazou2-16/+28
We fail to establish a transient scope around the return statement because the function returns a controlled type, but this is no longer problematic because controlled types are no longer returned on the secondary stack. gcc/ada/ * exp_ch7.adb (Establish_Transient_Scope.Find_Transient_Context): Bail out for a simple return statement only if the transient scope and the function both require secondary stack management, or else if the function is a thunk. * sem_res.adb (Resolve_Call): Do not create a transient scope when the call is the expression of a simple return statement.
2023-05-29ada: Use Code_Address attribute to determine subprogram addressesPatrick Bernardi3-89/+48
The runtime used label addresses to determine the code address of subprograms because the subprogram's canonical address on some targets is a descriptor or a stub. Simplify the code by using the Code_Address attribute instead, which is designed to return the code address of a subprogram. This also works around a current GNAT-LLVM limitation where the address of a label is incorrectly calculated when using -O1. As a result, we can now build a-except.adb and g-debpoo.adb at -O1 again with GNAT-LLVM. gcc/ada/ * libgnat/a-excach.adb (Call_Chain): Replace Code_Address_For_AAA/ZZZ functions with AAA/ZZZ'Code_Address. * libgnat/a-except.adb (Code_Address_For_AAA/ZZZ): Delete. (AAA/ZZZ): New null procedures. * libgnat/g-debpoo.adb (Code_Address_For_Allocate_End): Delete. (Code_Address_For_Deallocate_End): Delete. (Code_Address_For_Dereference_End): Delete. (Allocate): Remove label and use Code_Address attribute to determine subprogram addresses. (Dellocate): Likewise. (Dereference): Likewise. (Allocate_End): Convert to null procedure. (Dellocate_End): Likewise. (Dereference_End): Likewise.
2023-05-29ada: Call idiomatic routine in Expand_Simple_Function_ReturnEric Botcazou1-1/+1
In the primary stack case, Insert_Actions is invoked when the expression is being rewritten, whereas Insert_List_Before_And_Analyze is invoked in the secondary stack case. The former is idiomatic, the latter is not. gcc/ada/ * exp_ch6.adb (Expand_Simple_Function_Return): Call Insert_Actions consistently when rewriting the expression.
2023-05-29ada: Fix wrong finalization for loop on indexed containerEric Botcazou1-3/+99
The problem is that a transient temporary created for the constant indexing of the container is finalized almost immediately after its creation. gcc/ada/ * exp_util.adb (Is_Finalizable_Transient.Is_Indexed_Container): New predicate to detect a temporary created to hold the result of a constant indexing on a container. (Is_Finalizable_Transient.Is_Iterated_Container): Adjust a couple of obsolete comments. (Is_Finalizable_Transient): Return False if Is_Indexed_Container returns True on the object.
2023-05-29ada: Fix bogus error on conditional expression with only user-defined literalsEric Botcazou1-29/+98
This implements the recursive resolution of conditional expressions whose dependent expressions are (all) user-defined literals the same way it is implemented for operators. gcc/ada/ * sem_res.adb (Has_Applicable_User_Defined_Literal): Make it clear that the predicate also checks the node itself. (Try_User_Defined_Literal): Move current implementation to... Deal only with literals, named numbers and conditional expressions whose dependent expressions are literals or named numbers. (Try_User_Defined_Literal_For_Operator): ...this. Remove multiple return False statements and put a single one at the end. (Resolve): Call Try_User_Defined_Literal instead of directly Has_Applicable_User_Defined_Literal for all nodes. Call Try_User_Defined_Literal_For_Operator for operator nodes.
2023-05-29ada: Fix crash on semi-recursive call in access-to-subprogram contractPiotr Trojanek1-2/+2
Calls to access-to-subprogram from its own pre/post aspects are rejected as illegal, e.g.: type F is access function (X : Natural) return Boolean with Pre => F.all (X); but they caused an assertion failure in detection of recursive calls. Now they are properly recognized as recursive, but the error is suppressed, because it has been already posted at the call node. gcc/ada/ * sem_res.adb (Invoked_With_Different_Arguments): Use Get_Called_Entity, which properly deals with calls via an access-to-subprogram; fix inconsistent use of a Call object declared in enclosing subprogram.
2023-05-29ada: Attach pre/post on access-to-subprogram to internal subprogram typePiotr Trojanek2-5/+13
Aspects Pre/Post that annotate access-to-subprogram type were attached to the source entity (whose kind is either E_Access_Subprogram_Type or E_Access_Protected_Subprogram_Type). However, it is more convenient to attach them to the internal entity (whose kind is E_Subprogram_Type), so that both Pre/Post aspects and First_Formal/Next_Formal chain are attached to the same entity, just like for ordinary subprograms. The drawback of having the Post aspect attached to an internal entity is that name in prefixes of attribute Result no longer match the name of entity where this Post aspect is attached. However, currently there is no code that relies on this matching and, in general, there are fewer routines that deal with attribute Result so they are easier to adapt than the code that queries the Pre/Post aspects. gcc/ada/ * contracts.adb (Add_Pre_Post_Condition): Attach pre/post aspects to E_Subprogram_Type entity. (Analyze_Entry_Or_Subprogram_Contract): Adapt to use full type declaration for a contract attached to E_Subprogram_Type entity. * sem_prag.adb (Analyze_Pre_Post_Condition): Add pre/post aspects to the designed type.
2023-05-29ada: Remove redundant protection against empty listsPiotr Trojanek1-3/+1
Calls to First on No_List intentionally return Empty, so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. gcc/ada/ * sem_util.adb (Check_Function_Writable_Actuals): Remove guard against a membership test with no alternatives; simplify with a membership test.
2023-05-29ada: Remove extra whitespace from FOR loopsPiotr Trojanek3-6/+6
Whitespace cleanup. gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst (Some Useful Memory Pools): Remove extra whitespace from examples. * sem_aggr.adb (Make_String_Into_Aggregate): Remove extra whitespace. * gnat_ugn.texi: Regenerate.
2023-05-29ada: Cleanup detection of type support subprogram entitiesPiotr Trojanek3-47/+35
Avoid repeated calls to Get_TSS_Name. Code cleanup related to handling of dispatching operations in GNATprove; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Convert_Aggr_In_Allocator): Replace Get_TSS_Name with a high-level Is_TSS. * sem_ch6.adb (Check_Conformance): Replace DECLARE block and nested IF with a call to Get_TSS_Name and a membership test. (Has_Reliable_Extra_Formals): Refactor repeated calls to Get_TSS_Name. * sem_disp.adb (Check_Dispatching_Operation): Replace repeated calls to Get_TSS_Name with a membership test.
2023-05-29ada: Fix wrong finalization for case expression in expression functionEric Botcazou1-2/+6
This happens when the case expression contains a single alternative. gcc/ada/ * exp_ch5.adb (Expand_N_Case_Statement): Do not remove the statement if it is the node to be wrapped by a transient scope.
2023-05-29ada: Fix internal error with pragma Compile_Time_{Warning,Error}Eric Botcazou1-2/+7
This happens when the pragmas are deferred to the back-end from an external unit to the main unit that is generic, because the back-end does not compile a main unit that is generic. gcc/ada/ * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Do not defer anything to the back-end when the main unit is generic.
2023-05-29ada: Fix small fallout of previous changeEric Botcazou1-4/+6
It may lead to an infinite recursion if no interpretation exists. gcc/ada/ * sem_res.adb (Try_User_Defined_Literal): Restrict previous change to non-leaf nodes.
2023-05-29ada: Fix remaining failures in Roman Numbers testEric Botcazou1-2/+6
The test is inspired from the example of user-defined literals given in the Ada 2022 RM. Mixed Arabic numbers/Roman numbers computations are rejected because the second resolution pass would try to resolve Arabic numbers only as user-defined literals. gcc/ada/ * sem_res.adb (Try_User_Defined_Literal): For arithmetic operators, also accept operands whose type is covered by the resolution type.
2023-05-29ada: Fix memory leak in multi-dimensional array aggregate of VectorEric Botcazou1-1/+1
It comes from a superfluous adjustment for subarray components. gcc/ada/ * exp_aggr.adb (Initialize_Array_Component): Fix condition detecting the nested case that requires an adjustment.
2023-05-29ada: Fix wrong result for membership test of null in null-excluding access typeEric Botcazou1-3/+5
The result must be False as per the RM 4.5.2 (30.2/4) clause. gcc/ada/ * exp_ch4.adb (Expand_N_In): Deal specifically with a null operand.
2023-05-29ada: Fix small fallout of previous changeEric Botcazou1-0/+7
The same guard must be added to Expand_Simple_Function_Return as the one that was added to Analyze_Function_Return. gcc/ada/ * exp_ch6.adb (Expand_Simple_Function_Return): Deal with a rewriting of the simple return during the adjustment of its expression.
2023-05-29ada: Fix wrong finalization for call to BIP function in conditional expressionEric Botcazou3-55/+138
This happens when the call is a dependent expression of the conditional expression, and the conditional expression is either the expression of a simple return statement or the return expression of an expression function. The reason is that the special processing of "tail calls" for BIP functions, i.e. calls that are the expression of simple return statements or the return expression of expression functions, is not applied. This change makes sure that it is applied by distributing the simple return statements enclosing conditional expressions into the dependent expressions of the conditional expressions in almost all cases. As a side effect, this elides a temporary in the nonlimited by-reference case, as well as a pair of calls to Adjust/Finalize in the nonlimited controlled case. gcc/ada/ * exp_ch4.adb (Expand_N_Case_Expression): Distribute simple return statements enclosing the conditional expression into the dependent expressions in almost all cases. (Expand_N_If_Expression): Likewise. (Process_Transient_In_Expression): Adjust to the above distribution. * exp_ch6.adb (Expand_Ctrl_Function_Call): Deal with calls in the dependent expressions of a conditional expression. * sem_ch6.adb (Analyze_Function_Return): Deal with the rewriting of a simple return statement during the resolution of its expression.
2023-05-29ada: Accept parameters of enclosing subprograms in exceptional casesPiotr Trojanek1-0/+1
Rules about parameters of modes OUT and IN OUT in aspect Exceptional_Cases only apply to the parameters of the current subprogram. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Refine rules for Exceptional_Cases.
2023-05-29ada: Fix crash on vector initializationMarc Poulhiès3-5/+8
Initializing a vector using Vec : V.Vector := [Some_Type'(Some_Abstract_Type with F => 0)]; may crash the compiler. The expander marks the N_Extension_Aggregate for delayed expansion which never happens and incorrectly ends up in gigi. The delayed expansion is needed for nested aggregates, which the original code is testing for, but container aggregates are handled differently. Such assignments to container aggregates are later transformed into procedure calls to the procedures named in the Aggregate aspect definition, for which the delayed expansion is not required/expected. gcc/ada/ * exp_aggr.adb (Convert_To_Assignments): Do not mark node for delayed expansion if parent type has the Aggregate aspect. * sem_util.adb (Is_Container_Aggregate): Move... * sem_util.ads (Is_Container_Aggregate): ... here and make it public.
2023-05-29ada: Allow attributes like First and Last to be read in Exceptional_CasesPiotr Trojanek1-1/+9
Attributes that do not read data from the object can be safely used in consequences of Exceptional_Cases regardless of the parameter passing mode. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Relax rules for Exceptional_Cases.
2023-05-29ada: Repair support for user-defined literals in arithmetic operatorsEric Botcazou3-155/+156
It was partially broken to fix a regression in error reporting, because the fix was applied to the first pass of resolution instead of the second pass, as needs to be done for user-defined literals. gcc/ada/ * sem_ch4.ads (Unresolved_Operator): New procedure. * sem_ch4.adb (Has_Possible_Literal_Aspects): Rename into... (Has_Possible_User_Defined_Literal): ...this. Tidy up. (Operator_Check): Accept again unresolved operators if they have a possible user-defined literal as operand. Factor out the handling of the general error message into... (Unresolved_Operator): ...this new procedure. * sem_res.adb (Resolve): Be prepared for unresolved operators on entry in Ada 2022 or later. If they are still unresolved on exit, call Unresolved_Operator to give the error message. (Try_User_Defined_Literal): Tidy up.
2023-05-29ada: Default_Component_Value trumps Initialize/Normalize_ScalarsSteve Baird1-0/+6
If the Default_Component_Value aspect is specified for an array type, then specifying Initialize_Scalars or Normalize_Scalars should have no effect on the default initialization of an object of the array type. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration.Default_Initialize_Object): Add test for specified Default_Component_Value aspect when deciding whether either Initialize_Scalars or Normalize_Scalars impacts default initialization of an array object.
2023-05-29ada: Crash on aggregate for tagged record with discriminantsJavier Miranda1-1/+1
The frontend may crash processing an aggregate initializing a derived tagged record type that has discriminants. gcc/ada/ * sem_aggr.adb (Resolve_Record_Aggregate): For aggregates of derived tagged record types with discriminants, when collecting components from ancestors, pass to subprogram Gather_Components the parent type. Required to report errors on wrong aggregate components.
2023-05-29ada: Reuse routine for getting from body entity to spec entityPiotr Trojanek1-21/+1
Cleanup related to handling of access-to-subprogram types with Pre and Post aspects. Behavior is unaffected. gcc/ada/ * sem_util.adb (Check_Result_And_Post_State): Replace low-level navigation with a high-level Unique_Entity.
2023-05-29ada: Fix retrieval of spec entity from entry body entityPiotr Trojanek1-0/+3
When retrieving entities of subprogram spec we only handled functions and procedures, but not entries. This had no consequences, because we then only applied checks to functions, but still is worth a cleanup, so the code is easier to adapt for access-to-subprogram entities as well. gcc/ada/ * sem_util.adb (Check_Result_And_Post_State): Properly handle entry bodies.
2023-05-29ada: Restore parent link for both lists and nodes in class-wide conditionPiotr Trojanek1-3/+5
When preanalysing class-wide conditions, we restore "Function (Object)" to its original "Object.Function" notation. This requires the Parent links to be fixed. We did it for nodes; now we do it for lists as well. This patch is enough to fix assertion failure in CCG and to make the tree well-connected. Perhaps there is a more elegant solution, but that remains to be investigated. gcc/ada/ * contracts.adb (Fix_Parent): Fir part both for lists and nodes.
2023-05-29ada: Refining handling of inlining for CCGArnaud Charlet1-3/+6
By marking relevant functions inline when -gnatn is used. gcc/ada/ * sem_ch7.adb: Refine handling of inlining for CCG
2023-05-29ada: Fix spurious error on nested instantiations with generic renamingEric Botcazou1-9/+18
The problem is that the renaming slightly changes the form of a global reference that was saved during the analysis of a generic package, and that is sufficient to fool the code adjusting global references during the instantiation. gcc/ada/ * sem_ch12.adb (Copy_Generic_Node): Test the original node kind for the sake of consistency. For identifiers and other entity names and operators, accept an expanded name as associated node. Replace "or" with "or else" in condtion and fix its formatting.
2023-05-29ada: Tune message for missing 'Result in Contract_CasesPiotr Trojanek1-1/+2
Make the message consistent with the one for postcondition. gcc/ada/ * sem_util.adb (Check_Result_And_Post_State): Tune message.
2023-05-29ada: Simplify removal of formals from the scopePiotr Trojanek2-22/+3
Calls to Install_Formals are typically enclosed by Push_Scope/End_Scope. There were just two such calls that instead used Pop_Scope, but most likely that was by mistake. Cleanup related to handling of class-wide contracts. Behavior appears to be unaffected. gcc/ada/ * contracts.adb (Remove_Formals): Remove. (Preanalyze_Condition): Replace Pop_Scope with End_Scope. * sem_ch13.adb (Build_Discrete_Static_Predicate): Replace Pop_Scope with End_Scope; enclose Install_Formals within Push_Scope/End_Scope.
2023-05-29ada: Tune message for pre/post on access-to-subprogram in old AdaPiotr Trojanek1-1/+1
Fix grammar in error message; make it consistent with a similar message for pre/postcondition on formal subprogram. gcc/ada/ * sem_prag.adb (Analyze_Pre_Post_Condition): Tune error message.
2023-05-29ada: Spurious error on string interpolationJavier Miranda3-5/+25
The frontend reports spurious errors on operators found in interpolated string literals. gcc/ada/ * scans.ads (Inside_Interpolated_String_Expression): New variable. * par-ch2.adb (P_Interpolated_String_Literal): Set/clear new variable when parsing interpolated string expressions. * scng.adb (Set_String): Skip processing operator symbols when we arescanning an interpolated string literal.
2023-05-29ada: Add QNX specific version of System.ParametersJohannes Kliemann2-0/+82
The QNX runtimes used the default implementation of System.Parameters that defines a default stack size of 2 MB. The QNX specific version uses the QNX default stack size of 256 KB instead. gcc/ada/ * Makefile.rtl (QNX): Use s-parame__qnx.adb for s-parame.adb. * libgnat/s-parame__qnx.adb: Add QNX specific version of System.Parameters.
2023-05-29ada: Restore SPARK_Mode On for numerical functionsYannick Moy1-6/+0
GNATprove has ad-hoc support for the standard numerical functions, which consists in emitting an unprovable preconditions on cases which could lead to an overflow. These functions are thus valid to call from SPARK code. gcc/ada/ * libgnat/a-ngelfu.ads: Restore SPARK_Mode from context.
2023-05-29ada: Fix restoration of parent linkMarc Poulhiès1-1/+2
When resetting the parent link after having restored the selected component node, the assertion used was incorrectly triggered when the traversal hits the members of the parameters association list, as in: This.Some_Func (Param1, Param2).Dispatching_Call When restoring the selected component for Dispatching_Call, the assertion was wrongly triggered when passed Param1 and Param2. gcc/ada/ * contracts.adb (Restore_Original_Selected_Component): Adjust assertion.
2023-05-29ada: Analyze pre/post on access-to-subprogram without a wrapperPiotr Trojanek5-18/+54
Aspects Pre/Post attached to an access-to-subprogram type were relocated to a spec of a wrapper subprogram and analyzed there; the body of the wrapper was only created with expansion enabled. However, there were several problems with this approach. When switch -gnat2022 was missing, we didn't relocate the Pre/Post aspects to wrapper and complained that their placement is incorrect (because we wrongly assumed that relocation is unconditional). Now we gently inform, that these aspects are Ada 2022 features that require -gnat20222 switch. When switch -gnata was missing, we entirely bypassed analysis of the Pre/Post aspects on access-to-subprogram. This was unlike for Pre/Post aspects on subprograms, which are checked for legality regardless of the -gnata switch. Finally, in the GNATprove backend we were picking the Pre/Post contract on an access-to-subprogram type from the wrapper, which was awkward as otherwise we had to ignore the wrapper specs and special-case for their missing bodies. In general, it is cleaner for GNATprove to extract the aspect expressions from where they originally appear and not from various expansion artifacts like access-to-subprogram wrappers (but the same applies to predication functions, type invariant procedures and default initialization procedures). Now we analyze the Pre/Post aspects on the types where they are originally attached, regardless of the -gnata switch. Once we adapt GNATprove to pick the aspect expression from there, we will stop creating the wrapper spec when expansion is disabled. gcc/ada/ * contracts.adb (Add_Pre_Post_Condition): Adapt to handle pre/post of an access-to-subprogram type. (Analyze_Type_Contract): Analyze pre/post of an access-to-subprogram. * contracts.ads (Analyze_Type_Contract): Adapt comment. * sem_ch3.adb (Build_Access_Subprogram_Wrapper): Copy pre/post aspects to wrapper spec and keep it on the type. * sem_prag.adb (Analyze_Pre_Post_Condition): Expect pre/post aspects on access-to-subprogram and complain if they appear without -gnat2022 switch. (Analyze_Pre_Post_Condition_In_Decl_Part): Adapt to handle pre/post on an access-to-subprogram type entity. * sem_attr.adb (Analyze_Attribute_Old_Result): Likewise. (Result): Likewise.