aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2024-06-13ada: Remove Iterable from list of GNAT-specific attributesEric Botcazou3-513/+496
The attribute is rejected except in attribute definition clauses, where it is silently ignored (it's a by-product of the processing of the aspect). gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst (Iterable): Delete entry. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-06-13ada: Fix test for giving hint on ambiguous aggregateYannick Moy1-1/+1
In the case the type of an aggregate cannot be determined due to an ambiguity, caused by the existence of container aggregates, a hint can be given by GNAT. The test for giving this hint should be the Ada language version, not the fact that extensions are allowed. Now fixed. There is no impact on code generation. gcc/ada/ * sem_util.adb (Check_Ambiguous_Aggregate): Fix test.
2024-06-13ada: Missing postcondition runtime check in inherited primitiveJavier Miranda5-85/+269
When a derived tagged type implements more interface interface types than its parent type, and a primitive inherited from its parent type covers a primitive of these additional interface types that has classwide postconditions, the code generated by the compiler does not check the classwide postconditions inherited from the interface primitive. gcc/ada/ * freeze.ads (Check_Condition_Entities): Complete documentation. * freeze.adb (Check_Inherited_Conditions): Extend its functionality to build two kind of wrappers: the existing LSP wrappers, and wrappers required to handle postconditions of interface primitives implemented by inherited primitives. (Build_Inherited_Condition_Pragmas): Rename formal. (Freeze_Record_Type): For derived tagged types, move call to Check_Inherited_Conditions to subprogram Freeze_Entity_Checks; done to improve the performance of Check_Inherited_Conditions since it can rely on the internal entities that link interface primitives with tagged type primitives that implement them. (Check_Interface_Primitives_Strub_Mode): New subprogram. * sem_ch13.adb (Freeze_Entity_Checks): Call Check_Inherited_Conditions. Call Check_Inherited_Conditions with derived interface types to check strub mode compatibility of their primitives. * sem_disp.adb (Check_Dispatching_Operation): Adjust assertion to accept wrappers of interface primitives that have classwide postconditions. * exp_disp.adb (Write_DT): Adding text to identify wrappers.
2024-06-13ada: Revert changing a GNATProve mode message to a non-warningViljar Indus1-1/+1
GNATProve compiles the program multiple times. During the first run the warnings are suppressed. These messages need to be suppressed during that run in order to avoid having them duplicated in the following runs. Revert the previous changes as there currently is not a way to simply suppress info messages. gcc/ada/ * sem_res.adb (Resolve_Call): add warning insertion character into the info message.
2024-06-13ada: Deep copy of an expression sometimes fails to copy entitiesSteve Baird1-21/+0
An entity can be defined within an expression (the best example is probably a declare expression, but a quantified expression is another; there are others). When making a deep copy of an expression, the Entity nodes for such entities were sometimes not copied, apparently for performance reasons. This caused correctness problems in some cases, so do not perform that "optimization". gcc/ada/ * sem_util.adb (New_Copy_Tree.Visit_Entity): Delete code that prevented copying some entities.
2024-06-13ada: Minor cleanups in generic formal matchingBob Duff4-17/+17
Minor rewording of a warning. Disallow positional notation for <> (but disable this check), and fix resulting errors. Copy use clauses. gcc/ada/ * sem_ch12.adb (Check_Fixed_Point_Actual): Minor rewording; it seems more proper to say "operator" rather than "operation". (Matching_Actual): Give an error for <> in positional notation. This is a syntax error. Disable this for now. (Analyze_Associations): Copy the use clause in all cases. The "mustn't recopy" comment seems wrong, because New_Copy_Tree preserves Slocs. * libgnat/a-ticoau.ads: Fix violation of new postion-box error. * libgnat/a-wtcoau.ads: Likewise. * libgnat/a-ztcoau.ads: Likewise.
2024-06-13ada: Remove message about goto rewritten as a loopViljar Indus1-3/+0
This message provides only inner details of how the compiler handles this kind of construct and does not provide meaningful information that the user can interact on. gcc/ada/ * par-labl.adb (Rewrite_As_Loop): Remove info message
2024-06-13ada: Remove warning insertion characters from info messagesViljar Indus3-3/+3
Remove warning insertion characters without switch characters from info messages. gcc/ada/ * par-ch7.adb: Remove warning characters from info message * par-endh.adb: Remove warning characters from info message * sem_res.adb: Remove warning characters from info message
2024-06-13ada: Convert an info message to a continuationViljar Indus1-2/+3
The info message about the freeze point should be considered a continuation of the error message about the change of visibility after the freeze point. This improves the error layout for formatted error messages with the -gnatdF switch. gcc/ada/ * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): change the info message to a continuation message.
2024-06-13ada: Simplify code in Cannot_InlineViljar Indus1-10/+10
gcc/ada/ * inline.adb (Cannot_Inline): Simplify string handling logic.
2024-06-13ada: List subprogram body entities in scopesYannick Moy3-57/+17
Add entities of kind E_Subprogram_Body to the list of entities associated to a given scope. This ensures that representation information is correctly output for object and type declarations inside these subprogram bodies. This is useful for outputing that information fron the compiler with the switch -gnatR, as well as for getting precise representation information inside GNATprove. Remove ad-hoc code inside repinfo.adb that retrieved this information in only some cases. gcc/ada/ * exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Skip entities of kind E_Subprogram_Body. * repinfo.adb (List_Entities): Remove special case for subprogram bodies. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): List subprogram body entities in the enclosing scope.
2024-06-13ada: Interfaces order disables class-wide prefix notation callsJavier Miranda1-1/+22
When the first formal parameter of a subprogram is a class-wide interface type (or an access to a class-wide interface type), changing the order of the interface types implemented by a type declaration T enables or disables the ability to use the prefix notation to call it with objects of type T. When the call is disabled the compiler rejects it reporting an error. gcc/ada/ * sem_ch4.adb (Traverse_Interfaces): Add missing support for climbing to parents of interface types.
2024-06-13ada: Fix Super attribute documentationSteve Baird3-3/+3
The GNAT-defined Super attribute was formerly disallowed for an object of a derived tagged type having an abstract parent type. This rule has been relaxed; an abstract parent type is now permitted as long as it is not an interface type. Update the GNAT RM accordingly. gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Update Super attribute documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-06-13ada: Fix expansion of protected subprogram bodiesRonan Desplanques2-118/+147
System.Tasking.Protected_Objects.Lock can raise exceptions, but that wasn't taken into account by the expansion of protected subprogram bodies before this patch. More precisely, there were cases where calls to System.Tasking.Initialization.Abort_Undefer were incorrectly omitted. This patch fixes this. gcc/ada/ * exp_ch7.adb (Build_Cleanup_Statements): Adapt to changes made to Build_Protected_Subprogram_Call_Cleanup. * exp_ch9.adb (Make_Unlock_Statement, Wrap_Unprotected_Call): New functions. (Build_Protected_Subprogram_Body): Fix resource management in generated code. (Build_Protected_Subprogram_Call_Cleanup): Make use of newly introduced Make_Unlock_Statement.
2024-06-13ada: Fix oversight in latest finalization fixEric Botcazou1-1/+1
The Defining_Identifier of a renaming may be a E_Constant in the context. gcc/ada/ PR ada/114710 * exp_util.adb (Find_Renamed_Object): Recurse for any renaming.
2024-06-13ada: Check global mode restriction on encapsulating abstract statesPiotr Trojanek1-25/+56
We already checked that a global item of mode Output is not an Input of the enclosing subprograms. With this change we also check that if this global item is a constituent, then none of its encapsulating abstract states is an Input of the enclosing subprograms. gcc/ada/ * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Iterate over encapsulating abstract states.
2024-06-13ada: Streamline elaboration of local tagged typesEric Botcazou13-59/+289
This set of changes is aimed at streamlining the code generated for the elaboration of local tagged types. The dispatch tables and other related data structures are built dynamically on the stack for them and a few of the patterns used for this turn out to be problematic for the optimizer: 1. the array of primitives in the dispatch table is default-initialized to null values by calling the initialization routine of an unconstrained array type, and then immediately assigned an aggregate made up of the same null values. 2. the external tag is initialized by means of a dynamic concatenation involving the secondary stack, but all the elements have a fixed size. 3. the _size primitive is saved in the TSD by means of the dereference of the address of the TSD that was previously saved in the dispatch table. gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-imad32$(objext), s-imad64$(objext) and s-imagea$(objext). * exp_atag.ads (Build_Set_Size_Function): Replace Tag_Node parameter with Typ parameter. * exp_atag.adb: Add clauses for Sinfo.Utils. (Build_Set_Size_Function): Retrieve the TSD object statically. * exp_disp.adb: Add clauses for Ttypes. (Make_DT): Call Address_Image{32,64] instead of Address_Image. (Register_Primitive): Pass Tag_Typ to Build_Set_Size_Function. * rtsfind.ads (RTU_Id): Remove System_Address_Image and add System_Img_Address_{32;64}. (RE_Id): Remove entry for RE_Address_Image and add entries for RE_Address_Image{32,64}. * rtsfind.adb (System_Descendant): Adjust to above changes. * libgnat/a-tags.ads (Address_Array): Suppress initialization. * libgnat/s-addima.adb (System.Address_Image): Call the appropriate routine based on the address size. * libgnat/s-imad32.ads: New file. * libgnat/s-imad64.ads: Likewise. * libgnat/s-imagea.ads: Likewise. * libgnat/s-imagea.adb: Likewise. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS) [$(STAGE1)=False]: Add ada/libgnat/s-imad32.o and ada/libgnat/s-imad64.o.
2024-06-13ada: Do not inline subprogram which could cause SPARK violationYannick Moy1-1/+82
Inlining in GNATprove a subprogram containing a constant declaration with an address clause/aspect might lead to a spurious error if the address expression is based on a constant view of a mutable object at call site. Do not allow such inlining in GNATprove. gcc/ada/ * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not inline when constant with address clause is found.
2024-06-13ada: Fix incorrect String lower bound in gnatlinkRonan Desplanques1-7/+24
This patch fixes code in gnatlink that incorrectly assumed that the lower bound of a particular string was always 1. gcc/ada/ * gnatlink.adb (Gnatlink): Fix incorrect lower bound assumption. (Is_Prefix): New function.
2024-06-13ada: Reject too-strict alignment specifications.Steve Baird1-2/+3
In some cases the compiler incorrectly concludes that a package body is required for a package specification that includes the implicit declaration of one or more inherited subprograms for an explicitly declared derived type. Spurious error messages (e.g., "cannot generate code for file") may result. gcc/ada/ * sem_ch7.adb (Requires_Completion_In_Body): Modify the Comes_From_Source test so that the implicit declaration of an inherited subprogram does not cause an incorrect result of True.
2024-06-13ada: Inline if -gnatn in CCG mode even if -O0Richard Kenner1-2/+3
gcc/ada/ * exp_ch6.adb (Expand_Ctrl_Function_Call): Inline if -gnatn in CCG mode even if -O0.
2024-06-13ada: Fix fallout of previous finalization changeEric Botcazou1-4/+14
Now that Is_Finalizable_Transient only looks at the renamings coming from nontransient objects serviced by transient scopes, it must find the object ultimately renamed by them through a chain of renamings. gcc/ada/ PR ada/114710 * exp_util.adb (Find_Renamed_Object): Recurse if the renamed object is itself a renaming.
2024-06-13ada: Missing support for 'Old with overloaded functionJavier Miranda3-1/+51
The compiler reports an error when the prefix of 'Old is a call to an overloaded function that has no parameters. gcc/ada/ * sem_attr.adb (Analyze_Attribute): Enhance support for using 'Old with a prefix that references an overloaded function that has no parameters; add missing support for the use of 'Old within qualified expressions. * sem_util.ads (Preanalyze_And_Resolve_Without_Errors): New subprogram. * sem_util.adb (Preanalyze_And_Resolve_Without_Errors): New subprogram.
2024-06-13ada: Simplify checks for Address and Object_Size clausesPiotr Trojanek3-7/+4
Where possible, we can use high-level wrapper routines instead of the low-level Get_Attribute_Definition_Clause. Code cleanup; semantics is unaffected. gcc/ada/ * layout.adb (Layout_Type): Use high-level wrapper routine. * sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Likewise. * sem_ch3.adb (Analyze_Object_Declaration): Likewise.
2024-06-13ada: Add support for symbolic backtraces with DLLs on WindowsEric Botcazou3-28/+29
This puts Windows on par with Linux as far as backtraces are concerned. gcc/ada/ * libgnat/s-tsmona__linux.adb (Get): Move down descriptive comment. * libgnat/s-tsmona__mingw.adb: Add with clause and use clause for System.Storage_Elements. (Get): Pass GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT in the call to GetModuleHandleEx and remove the subsequent call to FreeLibrary. Upon success, set Load_Addr to the base address of the module. * libgnat/s-win32.ads (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS): Use shorter literal. (GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT): New constant.
2024-06-13ada: Fix too late finalization of temporary objectEric Botcazou3-98/+48
The problem is that Is_Finalizable_Transient returns false when a transient object is subject to a renaming by another transient object present in the same transient scope, thus forcing its finalization to be deferred to the enclosing scope. That's not necessary, as only renamings by nontransient objects serviced by transient scopes need to be rejected by the predicate. The change also removes now dead code in the finalization machinery. gcc/ada/ PR ada/114710 * exp_ch7.adb (Build_Finalizer.Process_Declarations): Remove dead code dealing with renamings. * exp_util.ads (Is_Finalizable_Transient): Rename Rel_Node to N. * exp_util.adb (Is_Finalizable_Transient): Likewise. (Is_Aliased): Remove obsolete code dealing wih EWA nodes and only consider renamings present in N itself. (Requires_Cleanup_Actions): Remove dead code dealing with renamings.
2024-06-13ada: Missing dynamic predicate checksJavier Miranda2-2/+112
The compiler does not generate dynamic predicate checks when they are enabled for one type declaration and ignored for other type declarations defined in the same scope. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Set the applicable policy of a type declaration when its aspect Dynamic_Predicate is analyzed. * sem_prag.adb (Handle_Dynamic_Predicate_Check): New subprogram that enables or ignores dynamic predicate checks depending on whether dynamic checks are enabled in the context where the associated type declaration is defined; used in the analysis of pragma check. In addition, for pragma Predicate, do not disable it when the aspect was internally build as part of processing a dynamic predicate aspect.
2024-06-13Daily bump.GCC Administrator1-0/+5
2024-06-12map packed field type to unpacked for debug infoAlexandre Oliva1-0/+4
We create a distinct type for each field in a packed record with a gnu_size, but there is no distinct debug information for them. Use the same unpacked type for debug information. for gcc/ada/ChangeLog * gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type as the debug type for packed fields. for gcc/testsuite/ChangeLog * gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.
2024-06-11Daily bump.GCC Administrator1-0/+219
2024-06-10ada: Add support for No_Implicit_Conditionals to nonbinary modular typesEric Botcazou1-55/+77
The expansion of additive operations for nonbinary modular types implemented in the front-end and its counterpart in code generators may create branches, which is not allowed when restriction No_Implicit_Conditionals is in effect. This changes it to use an explicit Mod operation when the restriction is in effect, which is assumed not to create such branches. gcc/ada/ * exp_ch4.adb (Expand_Nonbinary_Modular_Op): Create an explicit Mod for additive operations if No_Implicit_Conditionals is in effect. (Expand_Modular_Addition): Likewise. (Expand_Modular_Subtraction): Likewise. (Expand_Modular_Op): Always use an unsigned type obtained by calling Small_Integer_Type_For on the required size.
2024-06-10ada: Storage_Error in indirect call to function returning limited typeJavier Miranda2-8/+15
At runtime the code generated by the compiler reports the exception Storage_Error in an indirect call through an access-to-subprogram variable that references a function returning a limited tagged type object. gcc/ada/ * sem_ch6.adb (Might_Need_BIP_Task_Actuals): Add support for access-to-subprogram parameter types. * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Add dummy BIP parameters to access-to-subprogram types that may reference a function that has BIP parameters.
2024-06-10ada: Derived type with convention C must override convention C_Pass_By_CopyGary Dismukes1-0/+9
If a type DT is derived from a record type T with convention C_Pass_By_Copy and explicitly specifies convention C (via aspect or pragma), then type DT should not be treated as a type with convention C_Pass_By_Copy. Any parameters of the derived type should be passed by reference rather than by copy. The compiler was incorrectly inheriting convention C_Pass_By_Copy, by inheriting the flag set on the parent type, but that flag needs to be unset in the case where the convention is overridden. gcc/ada/ * sem_prag.adb (Set_Convention_From_Pragma): If the specified convention on a record type is not C_Pass_By_Copy, then force the C_Pass_By_Copy flag to False, to ensure that it's overridden.
2024-06-10ada: Minor code adjustment to "not Present" testGary Dismukes1-1/+1
This is just changing a "not Present (...)" test to "No (...)" to address a CB complaint from gnatcheck. gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Association): Change "not Present" to "No" in test of Add_Named_Subp.
2024-06-10ada: For freezing, treat an extension or delta aggregate like a regular ↵Steve Baird1-1/+3
aggregate. Extend existing special freezing rules for regular aggregates to also apply to extension and delta aggregates. gcc/ada/ * freeze.adb (Should_Freeze_Type.Is_Dispatching_Call_Or_Aggregate): Treat an extension aggregate or a delta aggregate like a regular aggregate.
2024-06-10ada: Resolve compilation issues with container aggregates in draft ACATS B testsGary Dismukes1-6/+20
This change set addresses compilation problems encountered in the draft versions of the following ACATS B tests for container aggregates: B435001 (container aggregates with Assign_Indexed) B435002 (container aggregates with Add_Unnamed) B435003 (container aggregates with Add_Named) B435004 (container aggregates with Assign_Indexed and Add_Unnamed) gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Association): In the case of N_Iterated_Element_Associations that have a key expression, issue an error if the aggregate type does not have an Add_Named operation, and include a reference to RM22 4.3.5(24) in the error message. In the case of an N_Component_Association with a Defining_Identifer where the "choice" is given by a function call, in the creation of the iterator_specification associate a copy of Choice as its Name, and remove the call to Analyze_Iterator_Specification, which was causing problems with the reanalysis of function calls originally given in prefixed form that were transformed into function calls in normal (infix) form. The iterator_specification will be analyzed later in any case, so that call should not be done here. Remove the with and use of Sem_Ch5.
2024-06-10ada: Missing style check for extra parentheses in operatorsJustin Squirek7-9/+34
This patch fixes an issue in the compiler whereby wrapping an operand of a boolean operator resulted in a failure to detect whether or not they were unnecessary for the -gnatyx style checks. gcc/ada/ * ali.adb (Get_Nat): Remove unnecessary parentheses. * exp_ch11.adb (Expand_Local_Exception_Handlers): Remove unnecessary parentheses. * freeze.adb (Freeze_Entity): Remove unnecessary parentheses. * lib-list.adb (List): Remove unnecessary parentheses. * par-ch5.adb (P_Condition): Add extra parentheses checks on condition operands. * sem_ch3.adb (Add_Interface_Tag_Components): Remove unnecessary parentheses. (Check_Delta_Expression): Remove unnecessary parenthesis. (Check_Digits_Expression): Remove unnecessary parentheses. * sem_ch12.adb (Validate_Array_Type_Instance): Remove unnecessary parentheses.
2024-06-10ada: Iterator filter ignored on formal loopJustin Squirek1-8/+37
This patch fixs an issue where iterator filters for formal container and formal container element loops got silently ignored and remained unexpanded. gcc/ada/ * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Add expansion of filter condition. (Expand_Formal_Container_Loop): Add expansion of filter condition.
2024-06-10ada: Crash checking accessibility level on private typeJustin Squirek1-1/+1
This patch fixes an issue in the compiler whereby calculating a static accessibility level on a private type with an access discriminant resulted in a compile time crash when No_Dynamic_Accessibility_Checks is enabled. gcc/ada/ * accessibility.adb (Accessibility_Level): Use Get_Full_View to avoid crashes when calculating scope.
2024-06-10ada: Unreferenced warning on abstract subprogramJustin Squirek1-4/+8
This patch modifies the unreferenced entity warning in the compiler to avoid noisily warning about unreferenced abstract subprogram. gcc/ada/ * sem_warn.adb (Warn_On_Unreferenced_Entity): Add a condition to ignore warnings on unreferenced abstract subprogram.
2024-06-10ada: Further refine 'Super attributeJustin Squirek1-0/+6
This patch adds the restriction on 'Super such that it cannot apply to objects whose parent type is an interface. gcc/ada/ * sem_attr.adb (Analyze_Attribute): Add check for interface parent types.
2024-06-10ada: Fix references to Ada RM in commentsPiotr Trojanek9-12/+11
We seem to have a convention of using "RM" in the GNAT comments, not "Ada RM". Also, the paragraph references by convention should appear in parentheses, e.g. "8.3(12.3/2)", not "8.3 12.3/2". gcc/ada/ * einfo.ads, exp_attr.adb, exp_ch4.adb, exp_ch7.adb, lib-writ.adb, libgnat/a-stbuut.ads, sem_ch13.adb, sem_ch3.adb, sem_ch7.adb: Use "RM" in comments.
2024-06-10ada: Tune code related to potentially unevaluated expressionsPiotr Trojanek2-6/+4
Code cleanup; semantics is unaffected. gcc/ada/ * sem_util.adb (Immediate_Context_Implies_Is_Potentially_Unevaluated): Use collective subtypes in membership tests. (Is_Known_On_Entry): Require all alternatives in a case statement to return; this change could prevent a recently fixed glitch, where one of the alternatives relied on the return statement afterwards (also, the new code is shorter). * sem_util.ads (Is_Potentially_Unevaluated): Clarify that this routine applies to Ada 2012.
2024-06-10ada: Remove streaming facilities from generics for formal containersYannick Moy2-92/+0
The dependency on Ada.Streams is problematic for light runtimes. As these streaming facilities are in fact not used in formal containers, remove the corresponding dead code. gcc/ada/ * libgnat/a-chtgfo.adb (Generic_Read, Generic_Write): Remove. * libgnat/a-chtgfo.ads: Same. Remove dependency on Ada.Streams.
2024-06-10ada: Fix usage of SetThreadAffinityMaskRonan Desplanques2-4/+4
This patches fixes the signature of the binding to SetThreadAffinityMask in the run-time library. It also fixes the error checking after calls to SetThreadAffinityMask. The previous code behaved as if SetThreadAffinityMask returned 1 on success, but it in fact returns a pointer value on success and 0 on failure. gcc/ada/ * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of SetThreadAffinityMask. * libgnat/s-winext.ads (SetThreadAffinityMask): Fix binding signature.
2024-06-10ada: Fix usage of SetThreadIdealProcessorRonan Desplanques1-2/+11
This patches fixes the way the run-time library checks the return value of SetThreadIdealProcessor. gcc/ada/ * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of SetThreadIdealProcessor.
2024-06-10ada: Remove incorrect assertion in run-timeRonan Desplanques1-11/+11
There is a special case of file paths on Windows that are absolute but don't start with a drive letter: UNC paths. This patch removes an assertion in System.OS_Lib.Normalize_Pathname that failed to take this case into account. It also renames a local subprogram of Normalize_Pathname to make its purpose clearer. gcc/ada/ * libgnat/s-os_lib.adb (Normalize_Pathname): Remove incorrect assert statement. (Missed_Drive_Letter): Rename into... (Drive_Letter_Omitted): This.
2024-06-10ada: Fix incorrect lower bound presumption in gnatlinkRonan Desplanques1-9/+8
This patch fixes a subprogram in gnatlink that incorrectly assumed that the strings it is passed as arguments all have a lower bound of 1. gcc/ada/ * gnatlink.adb (Check_File_Name): Fix incorrect assumption.
2024-06-10ada: Cleanup repeated code in expansion of stream attributesPiotr Trojanek2-23/+16
In expansion of various attributes, in particular for the Input/Output and Read/Write attributes, we can use constants that are already used for expansion of many other attributes. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): Use constants declared at the beginning of subprogram; tune layout. * exp_ch3.adb (Predefined_Primitive_Bodies): Tune layout.
2024-06-10ada: Adjust comments and doc about the new use of restriction No_StreamsPiotr Trojanek5-15/+19
Extend code comment; move recently added documentation from pragma No_Tagged_Streams to restriction No_Streams. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (No_Tagged_Streams): Move documentation. * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst (No_Streams): Likewise. * exp_disp.adb (Make_DT): Extend comment. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.