[COMMITTED 33/35] ada: Start the initialization of the tasking runtime earlier

2024-05-17 Thread Marc Poulhiès
From: Eric Botcazou This installs the tasking versions of the RTS_Lock manipulation routines very early, before the elaboration of all the Ada units of the program, including those of the runtime, because this elaboration may require the initialization of RTS_Lock objects. gcc/ada/ * bi

[COMMITTED 24/35] ada: Do not query the modification time of a special file.

2024-05-17 Thread Marc Poulhiès
From: Steve Baird In Ada.Directories, the function Modification_Time raises Name_Error if it is called for a special file. So don't do that in Start_Search_Internal. gcc/ada/ * libgnat/a-direct.adb (Start_Search_Internal): Do not call Modification_Time for a special file; declar

[COMMITTED 32/35] ada: Improve test for unprocessed preprocessor directives

2024-05-17 Thread Marc Poulhiès
From: Steve Baird Preprocessor directives are case insensitive and may have spaces or tabs between the '#' and the keyword. When checking for the error case of unprocessed preprocessor directives, take these rules into account. gcc/ada/ * scng.adb (scan): When checking for an unprocesse

[COMMITTED 03/30] ada: Implement representation aspect Max_Entry_Queue_Length

2024-05-20 Thread Marc Poulhiès
From: Jose Ruiz Enforce Max_Entry_Queue_Length (and its synonym Max_Entry_Queue_Depth) when applied to individual protected entries. gcc/ada/ * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Clarify comments. * sem_prag.adb (Analyze_Pragma): Check for duplicates

[COMMITTED 02/30] ada: Small cleanup in System.Finalization_Primitives unit

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou It has been made possible by recent changes. gcc/ada/ * libgnat/s-finpri.ads (Collection_Node): Move to private part. (Collection_Node_Ptr): Likewise. (Header_Alignment): Change to declaration and move completion to private part. (Head

[COMMITTED 04/30] ada: Detect only conflict with synomyms of max queue length

2024-05-20 Thread Marc Poulhiès
From: Jose Ruiz Use of duplicated representation aspect is detected elsewhere so we do not try to detect them here to avoid repetition of messages. gcc/ada/ * sem_prag.adb (Analyze_Pragma): Exclude detection of duplicates because they are detected elsewhere. Tested on x86_64-pc

[COMMITTED 06/30] ada: Reject too-strict alignment specifications.

2024-05-20 Thread Marc Poulhiès
From: Steve Baird For a discrete (or fixed-point) type T, GNAT requires that T'Object_Size shall be a multiple of T'Alignment * 8 . GNAT also requires that T'Object_Size shall be no larger than Standard'Max_Integer_Size. For a sufficiently-large alignment specification, these requirements can con

[COMMITTED 07/30] ada: Use System.Address for address computation in System.Pool_Global

2024-05-20 Thread Marc Poulhiès
From: Sebastian Poeplau Some architectures don't let us convert System.Storage_Elements.Integer_Address back to a valid System.Address. Using the arithmetic operations on System.Address from System.Storage_Elements prevents the problem while leaving semantics unchanged. gcc/ada/ * libgn

[COMMITTED 05/30] ada: One more adjustment coming from aliasing considerations

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou It is needed on PowerPC platforms because of specific calling conventions. gcc/ada/ * libgnat/g-sothco.ads (In_Addr): Add aspect Universal_Aliasing. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/g-sothco.ads | 7 +-- 1 file changed, 5

[COMMITTED 08/30] ada: Fix for attribute Width on enumeration types with Discard_Name

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Fix computation of attribute 'Width for enumeration types with Discard_Name aspect enabled. gcc/ada/ * exp_imgv.adb (Expand_Width_Attribute): Fix for 'Width that is computed at run time. * sem_attr.adb (Eval_Attribute): Fix for 'Width that is compute

[COMMITTED 15/30] ada: Fix style in list of implementation-defined attributes

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ * sem_attr.ads (Attribute_Impl_Def): Fix style in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.ads | 8 1 file changed, 8 insertions(+) diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads

[COMMITTED 16/30] ada: Use discrete choice list in declaration of universal type attributes

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ * sem_attr.ads (Universal_Type_Attribute): Simplify using array aggregate syntax with discrete choice list. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.ads | 62 ++

[COMMITTED 01/30] ada: Rework and augment documentation on strict aliasing

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou The documentation was originally centered around pragma No_Strict_Aliasing and pragma Universal_Aliasing was mentioned only as an afterthought. It also contained a warning about the usage of overlays implemented by means of address clauses that has been obsolete for long. gc

[COMMITTED 09/30] ada: Fix static 'Img for enumeration type with Discard_Names

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Fix a short-circuit folding of 'Img for enumeration type, which wrongly ignored Discard_Names and exposed enumeration literals. gcc/ada/ * sem_attr.adb (Eval_Attribute): Handle enumeration type with Discard_Names. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED 14/30] ada: Tweak handling of thread ID on POSIX

2024-05-20 Thread Marc Poulhiès
From: Ronan Desplanques This patch changes the task initialization subprograms on POSIX platforms so that the thread ID of an ATCB is only set once. This has the advantage of getting rid of the Atomic aspect on the corresponding record component, and silences a Helgrind warning about a data race.

[COMMITTED 22/30] ada: Handle accessibility calculations for 'First and 'Last

2024-05-20 Thread Marc Poulhiès
From: Justin Squirek This patch fixes a crash in the compiler whereby calculating the accessibility level of of a local variable whose original expression is an 'First on an array type led to an error during compilation. gcc/ada/ * accessibility.adb (Accessibility_Level): Add cases for

[COMMITTED 11/30] ada: Fix incorrect free with Task_Info pragma

2024-05-20 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, on Linux, the procedure System.Task_Primitives.Operations.Set_Task_Affinity called CPU_FREE on instances of cpu_set_t_ptr that it didn't own when the obsolescent Task_Info pragma was in play. This patch fixes that issue. gcc/ada/ * libgnarl/s-t

[COMMITTED 12/30] ada: Resolve ACATS compilation and execution issues with container aggregates

2024-05-20 Thread Marc Poulhiès
From: Gary Dismukes This change set addresses various compilation and execution problems encountered in the draft ACATS tests for container aggregates: C435001 (container aggregates with Assign_Indexed) C435002 (container aggregates with Add_Unnamed) C435003 (container aggregates with Add_Named)

[COMMITTED 13/30] ada: Extend expansion delaying mechanism to conditional expressions

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou When an aggregate that needs to be converted into a series of assignments is present in an expression of a parent aggregate, or in the expression of an allocator, an object declaration, or an assignment in very specific cases, its expansion is delayed until its parent itself i

[COMMITTED 24/30] ada: Error on instantiation of generic containing legal container aggregate

2024-05-20 Thread Marc Poulhiès
From: Gary Dismukes When a container aggregate for a predefined container type (such as a Vector type) that has an iterated component association occurs within a generic unit and that generic is instantiated, the compiler reports a spurious error message "iterated component association can only a

[COMMITTED 10/30] ada: Another small cleanup about allocators and aggregates

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou This eliminates a few more oddities present in the expander for allocators and aggregates nested in allocators and other constructs: - Convert_Aggr_In_Allocator takes both the N_Allocator and the aggregate as parameters, while the sibling procedures Convert_Aggr_In_Assi

[COMMITTED 23/30] ada: Error on instantiation of generic containing legal container aggregate

2024-05-20 Thread Marc Poulhiès
From: Gary Dismukes When a container aggregate for a predefined container type (such as a Vector type) that has an iterated component association occurs within a generic unit and that generic is instantiated, the compiler reports a spurious error message "iterated component association can only a

[COMMITTED 20/30] ada: Fix list of implementation-defined attributes

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Several of the implementation-defined attributes were wrongly recognized as defined by the Ada RM. This change only affects code with restriction No_Implementation_Attributes. gcc/ada/ * sem_attr.ads (Attribute_Impl_Def): Fix list of implementation-defined

[COMMITTED 26/30] ada: Formal package comment corrections in sinfo.ads

2024-05-20 Thread Marc Poulhiès
From: Bob Duff Misc comment corrections and clarifications in sinfo.ads related to generic formal packages. gcc/ada/ * sinfo.ads: Misc comment corrections and clarifications. The syntax for GENERIC_ASSOCIATION and FORMAL_PACKAGE_ACTUAL_PART was wrong. Emphasize

[COMMITTED 17/30] ada: Remove repeated condition in check for implementation attributes

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_attr.adb (Analyze_Attribute): Remove condition that is already checked by an enclosing IF statement. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 2 +- 1 file changed,

[COMMITTED 21/30] ada: Further refine 'Super attribute

2024-05-20 Thread Marc Poulhiès
From: Justin Squirek This patch relaxes the restriction on 'Super such that it can apply to abstract type objects. gcc/ada/ * sem_attr.adb (Analyze_Attribute): Remove restriction on 'Super for abstract types. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem

[COMMITTED 18/30] ada: Apply restriction No_Implementation_Attributes to source nodes only

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Restriction No_Implementation_Attributes must not be applied to nodes that come from expansion. In particular, it must not be applied to Object_Size, which is implementation-defined attribute before Ada 2022, but appears in expansion of tagged types since Ada 95. gcc/ada/

[COMMITTED 25/30] ada: Add Is_Base_Type predicate to C interface

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou This also documents what the predicate effectively does. gcc/ada/ * einfo-utils.ads (Is_Base_Type): Move to Miscellaneous Subprograms section and add description. * fe.h (Is_Base_Type): Declare. Tested on x86_64-pc-linux-gnu, committed on master. --

[COMMITTED 19/30] ada: Fix list of attributes defined by Ada 2012

2024-05-20 Thread Marc Poulhiès
From: Piotr Trojanek Recognize references to attributes Old, Overlaps_Storage and Result as language-defined in Ada 2012 and implementation-defined in earlier versions of Ada. Other attributes introduced by Ada 2012 RM are correctly categorized. This change only affects code with restriction No_

[COMMITTED 29/30] ada: Add direct workaround for limitations of RTSfind mechanism

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou This adds a direct workaround for the spurious compilation errors caused by the presence of preconditions/postconditions in the Interfaces.C unit, which trip on limitations of the RTSfind mechanism when it comes to visibility, as well as removes an indirect workaround that was

[COMMITTED 27/30] ada: Get rid of secondary stack for indefinite record types with size clause

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou This change eliminates the use of the secondary stack for indefinite record types for which a valid (object) size clause is specified. In accordance with the RM, the compiler accepts (object) size clauses on such types only if all the components, including those of the varian

[COMMITTED 28/30] ada: Fix internal error on nested aggregate in conditional expression

2024-05-20 Thread Marc Poulhiès
From: Eric Botcazou This plugs a loophole in the change improving code generation for nested aggregates present in conditional expressions: once the delayed expansion is chosen for the nested aggregate, the expansion of the parent aggregate cannot be left to the back-end and the test must be adju

[COMMITTED 30/30] ada: Allow 'others' in formal packages with overloaded formals

2024-05-20 Thread Marc Poulhiès
From: Bob Duff If a generic package has two or more generic formal parameters with the same defining name (which can happen only for formal subprograms), then RM-12.7(4.1/3) disallows named associations in a corresponding formal package. This is not intended to cover "others => <>". This patch a

[COMMITTED 02/31] ada: Follow-up fix to previous change for Text_Ptr

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The variable would be saved and restored while still uninitialized. gcc/ada/ * err_vars.ads (Error_Msg_Sloc): Initialize to No_Location. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/err_vars.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[COMMITTED 04/31] ada: Remove conversion from String_Id to String and back to String_Id

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove useless conversions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_put_image.adb | 6 ++ 1 file changed, 2 insertions(

[COMMITTED 07/31] ada: Fix index entry for an implemented AI feature

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Fix inconsistent reference with "05" in the name of AI. gcc/ada/ * doc/gnat_rm/implementation_of_ada_2012_features.rst (AI-0216): Fix index reference. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/

[COMMITTED 03/31] ada: Remove trailing NUL in minimal expansion of Put_Image attribute

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek When procedure that implements Put_Image attribute emits the type name, this name was wrongly followed by a NUL character. gcc/ada/ * exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove trailing NUL from the fully qualified type name. Tested on x86

[COMMITTED 12/31] ada: Add elaboration switch tags to info messages

2024-05-21 Thread Marc Poulhiès
From: Viljar Indus Add the ?$? insertion characters for elaboration message so they would be marked with the [-gnatel] tag. Note that these insertion characters were not added for SPARK elaboration messages: gcc/ada/ * sem_elab.adb: Add missing elaboration insertion characters t

[COMMITTED 09/31] ada: Fix formatting in list of implemented Ada 2012 features

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Fix formatting; meaning is unaffected. gcc/ada/ * doc/gnat_rm/implementation_of_ada_2012_features.rst: Fix formatting. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/implementation_of_ada_20

[COMMITTED 05/31] ada: Do not leak tagged type names when Discard_Names is enabled

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek When both pragmas Discard_Names and No_Tagged_Streams apply to a tagged type, the intended behavior is to prevent type names from leaking into object code, as documented in GNAT RM. However, while Discard_Names can be used as a configuration pragma, No_Tagged_Streams must be

[COMMITTED 06/31] ada: Update documentation of warning messages

2024-05-21 Thread Marc Poulhiès
From: Viljar Indus Update the documentation of warning messages that only emit info messages to clearly reflect that they only emit info messages and not warning messages. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the documentation of -gnatw.n an

[COMMITTED 11/31] ada: Simplify management of scopes while inlining

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * inline.adb (Add_Scope_To_Clean): Use Append_Unique_Elmt. (Analyze_Inlined_Bodies): Refine type of a local counter; remove extra whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- g

[COMMITTED 21/31] ada: Remove unused dependencies from gnatbind object list

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek The gnatbind executable does not depend on aspects, SCIL, style checks, etc. Also, these dependencies are not needed to actually build the executable. Cleanup. gcc/ada/ * gcc-interface/Make-lang.in (GNATBIND_OBJS): Remove unused dependencies. Tested on x86_

[COMMITTED 01/31] ada: Add new Mingw task priority mapping

2024-05-21 Thread Marc Poulhiès
From: Justin Squirek This patch adds a new mapping (Non_FIFO_Underlying_Priorities) for dynamically setting task priorities in Windows when pragma Task_Dispatching_Policy (FIFO_Within_Priorities) is not present. Additionally, it documents the requirement to specify the pragma in order to use Set_

[COMMITTED 13/31] ada: Remove useless trampolines caused by Unchecked_Conversion

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The partial solution implemented in Validate_Unchecked_Conversion to support unchecked conversions between addresses and pointers to subprograms, for the platforms where pointers to subprograms do not all have the same size, turns out to be counter-productive for others becaus

[COMMITTED 16/31] ada: Missing constraint check for initial value of object with address clause

2024-05-21 Thread Marc Poulhiès
From: Steve Baird In some cases where an object is declared with an initial value that is an aggregate and also with a specified Address (either via an aspect_specification or via an attribute_definition_clause), the check that the initial value satisfies the constraints of the object's subtype w

[COMMITTED 10/31] ada: Remove some explicit yields in tasking run-time

2024-05-21 Thread Marc Poulhiès
From: Ronan Desplanques This patch removes three occurrences where tasking run-time subprograms yielded control shortly before conditional calls to Sleep, in order to avoid these calls more often. It was intended as an optimization on systems where calls to Sleep are costly and in particular VMS.

[COMMITTED 28/31] ada: Fix strict aliasing violation in parameter passing (continued)

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This fixes another long-standing (implicit) violation of the strict aliasing rules that occurs when the result of a value conversion is directly passed as an actual parameter in a call to a subprogram and the passing mechanism is by reference. In this case, the reference pass

[COMMITTED 15/31] ada: Fix layout in a list of aspects

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * aspects.ads (Nonoverridable_Aspect_Id): Fix layout. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/aspects.ads | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --gi

[COMMITTED 20/31] ada: Fix assembler error for gigantic library-level object on 64-bit Windows

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou Most small 64-bit code models have a limit of 2 GB on the span of binaries, so we also use the limit for the size of the largest statically allocatable object by the compiler. If the limit is topped, the compiler switches over to a dynamic allocation (if not forbidden) after

[COMMITTED 14/31] ada: Remove duplicate statement

2024-05-21 Thread Marc Poulhiès
From: Ronan Desplanques This patch removes a duplicate statement that was useless and could be misleading to the reader by suggesting that there are multiple global variables named Style_Check, while there is just one. gcc/ada/ * frontend.adb (Frontend): Remove duplicate statement. Tes

[COMMITTED 19/31] ada: Fix crash on aliased constant with packed array type and -g switch

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The problem is that we build a template whose array field is not an array in the case of an aliased object with nominal unconstrained array subtype. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : For an array allocated with its bounds, make sure to h

[COMMITTED 18/31] ada: Fix small inaccuracy for Size attribute applied to objects

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This reverts a change made some time ago in lvalue_required_for_attribute_p whereby the Size attribute applied to objects would no longer be considered as requiring an lvalue. While not wrong in principle, this turns out to be problematic because the implementation in Attribu

[COMMITTED 17/31] ada: Fix oversight in previous change

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou In rare cases, types using structural equality may reach relate_alias_sets. gcc/ada/ * gcc-interface/utils.cc (relate_alias_sets): Restore previous code when the type uses structural equality. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada

[COMMITTED 22/31] ada: Avoid temporary for conditional expression of discriminated record type

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This just aligns the definite case (discriminants with default) with the indefinite case (discriminants without default), the latter case having been properly handled for long. In the former case, the maximum size is used so a temporary can be much larger than the actual data

[COMMITTED 24/31] ada: Minor typo fix in comment

2024-05-21 Thread Marc Poulhiès
gcc/ada/ * gcc-interface/decl.cc: Fix typo in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index e16ee6edac

[COMMITTED 27/31] ada: Make detection of useless copy for return more robust

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou In the return-by-invisible-reference case, the return object of an extended return statement is allocated directly on the return stack and, therefore, the copy operation on return is useless. The code detecting this was not robust enough and missed some complex cases. gcc/ad

[COMMITTED 29/31] ada: Fix internal error on discriminated record with Atomic aspect in Ada 2022

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou It occurs in build_load_modify_store where the pattern matching logic cannot find the atomic load that is present in the tree because it has been wrapped in a SAVE_EXPR by gnat_protect_expr, which is unnecessary. gcc/ada/ * gcc-interface/utils2.cc (gnat_protect_expr)

[COMMITTED 23/31] ada: Follow-up adjustment to earlier fix in Build_Allocate_Deallocate_Proc

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The deallocation call of the return and secondary stacks no longer matches the profile built in Exp_Util.Build_Allocate_Deallocate_Proc, so this just removes the code as unreachable and adds an assertion to that effect. gcc/ada/ * gcc-interface/utils2.cc (build_call_

[COMMITTED 31/31] ada: Streamline implementation of simple nonbinary modular operations

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou They are implemented by the nonbinary_modular_operation routine, which is complex and, in particular, creates signed types and types with a partial precision each time a subtraction or a multiplication resp. is generated. Both are unnecessary and a simple approach even generat

[COMMITTED 25/31] ada: Fix crash with aliased array and if expression

2024-05-21 Thread Marc Poulhiès
From: Ronan Desplanques The way if expressions were translated led the gimplifying phase to attempt to create a temporary of a variable-sized type in some cases. This patch fixes this by adding an address indirection layer in those cases. gcc/ada/ * gcc-interface/utils2.cc (build_cond_e

[COMMITTED 26/31] ada: Fix strict aliasing violation in parameter passing

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This fixes a long-standing (implicit) violation of the strict aliasing rules that occurs when the result of a call to an instance of Unchecked_Conversion is directly passed as an actual parameter in a call to a subprogram and the passing mechanism is by reference. In this cas

[COMMITTED 30/31] ada: Simplify test for propagation of attributes to subtypes

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This changes the test to use the Is_Base_Type predicate and also removes the superfluous call to Base_Type before First_Subtype. No functional changes. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Use the Is_Base_Type predicate and remove superfluo

[COMMITTED] fix: valid compiler optimization may fail the test

2024-05-31 Thread Marc Poulhiès
cxa4001 may fail with "Exception not raised" when the compiler omits the calls to To_Mapping, in accordance with 10.2.1(18/3): "If a library unit is declared pure, then the implementation is permitted to omit a call on a library-level subprogram of the library unit if the results are not nee

Re: [Patch, aarch64, middle-end\ v4: Move pair_fusion pass from aarch64 to middle-end

2024-05-31 Thread Marc Poulhiès
Hello, I can't bootstrap using gcc 5.5 since this change. It fails with: .../gcc/pair-fusion.cc: In member function ‘bool pair_fusion_bb_info::fuse_pair(bool, unsigned int, int, rtl_ssa::insn_info*, rtl_ssa::in sn_info*, base_cand&, const rtl_ssa::insn_range_info&)’: .../gcc/pair-fusion.cc:1790

[PATCH] pair-fusion: fix for older GCC

2024-06-03 Thread Marc Poulhiès
Older GCCs fail with: .../gcc/pair-fusion.cc: In member function ‘bool pair_fusion_bb_info::fuse_pair(bool, unsigned int, int, rtl_ssa::insn_info*, rtl_ssa::in sn_info*, base_cand&, const rtl_ssa::insn_range_info&)’: .../gcc/pair-fusion.cc:1790:40: error: ‘writeback’ is not a class, namesp

Re: [Patch, aarch64, middle-end\ v4: Move pair_fusion pass from aarch64 to middle-end

2024-06-03 Thread Marc Poulhiès
Richard Sandiford writes: > Marc Poulhiès writes: >> Hello, >> >> I can't bootstrap using gcc 5.5 since this change. It fails with: >> >> .../gcc/pair-fusion.cc: In member function ‘bool >> pair_fusion_bb_info::fuse_pair(bool, unsigned int, int, rtl

Re: [PATCH] pair-fusion: fix for older GCC

2024-06-03 Thread Marc Poulhiès
Richard Sandiford writes: > Marc Poulhiès writes: >> Older GCCs fail with: >> >> .../gcc/pair-fusion.cc: In member function ‘bool >> pair_fusion_bb_info::fuse_pair(bool, unsigned int, int, rtl_ssa::insn_info*, >> rtl_ssa::in >> sn_info*, bas

[PATCH] aarch64: adjust enum writeback after rename

2024-06-03 Thread Marc Poulhiès
gcc/ChangeLog: * config/aarch64/aarch64-ldp-fusion.cc (struct aarch64_pair_fusion): Use new type name. --- My previous change fixed the generic code, but I forgot to adjust the overload in aarch64. I don't have an aarch64 setup to check it fixes the build, but will set it up lat

Re: [PATCH] aarch64: adjust enum writeback after rename

2024-06-03 Thread Marc Poulhiès
Richard Sandiford writes: > Marc Poulhiès writes: >> gcc/ChangeLog: >> >> * config/aarch64/aarch64-ldp-fusion.cc (struct aarch64_pair_fusion): >> Use new type name. >> --- >> My previous change fixed the generic code, but I forgot to adjust the

Re: [PATCH] ada: Fix s-taprop__solaris.adb compilation

2024-08-08 Thread Marc Poulhiès
Rainer Orth writes: Hello, > Solaris Ada bootstrap is broken as of 2024-08-06 with > > s-taprop.adb:1971:23: error: "int" is not visible > s-taprop.adb:1971:23: error: multiple use clauses cause hiding > s-taprop.adb:1971:23: error: hidden declaration at s-osinte.ads:51 > s-taprop.adb:1971:23: e

Re: [PATCH] Ada, libgnarl: Fix s-taprop__posix.adb compilation.

2024-08-08 Thread Marc Poulhiès
Iain Sandoe writes: Hello, > Tested on x86_64-darwin21, OK for trunk? Yes, thanks! Marc

[COMMITTED 1/6] ada: Finalization_Size raises Constraint_Error

2024-08-08 Thread Marc Poulhiès
From: Javier Miranda When the attribute Finalization_Size is applied to an interface type object, the compiler-generated code fails at runtime, raising a Constraint_Error exception. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) : If the prefix is an interface type, gene

[COMMITTED 4/6] ada: Run-time error with GNAT-LLVM on container aggregate with finalization

2024-08-08 Thread Marc Poulhiès
From: Gary Dismukes When unnesting is enabled, the compiler was failing to copy the At_End_Proc field from a block statement to the procedure created to replace it when unnesting of top-level blocks is done. At run time this could lead to exceptions due to missing finalization calls. gcc/ada/

[COMMITTED 2/6] ada: Spurious maximum nesting level warnings

2024-08-08 Thread Marc Poulhiès
From: Justin Squirek This patch fixes an issue in the compiler whereby disabling style checks via pragma Style_Checks ("-L") resulted in the minimum nesting level being zero but the style still being enabled - leading to spurious maximum nesting level exceeded warnings. gcc/ada/ * style

[COMMITTED 6/6] ada: Missing legality check when type completed

2024-08-08 Thread Marc Poulhiès
From: Steve Baird An access discriminant is allowed to have a default value only if the discriminated type is immutably limited. In the case of a discriminated limited private type declaration, this rule needs to be checked when the completion of the type is seen. gcc/ada/ * sem_ch6.adb

[COMMITTED 5/6] ada: Etype missing for raise expression

2024-08-08 Thread Marc Poulhiès
From: Steve Baird If the primitive equality operator of the component type of an array type is abstract, then a call to that abstract function raises Program_Error (when such a call is legal). The FE generates a raise expression to implement this. That raise expression is an expression so it shou

[COMMITTED 3/6] ada: Futher refinements to mutably tagged types

2024-08-08 Thread Marc Poulhiès
From: Justin Squirek This patch further enhances the mutably tagged type implementation by fixing several oversights relating to generic instantiations, attributes, and type conversions. gcc/ada/ * exp_put_image.adb (Append_Component_Attr): Obtain the mutably tagged type for the

Re: [wwwdocs] Re: [COMMITTED] gcc-14: Add Ada changes

2024-08-12 Thread Marc Poulhiès
Gerald Pfeifer writes: > On Fri, 26 Apr 2024, Marc Poulhiès wrote: >> Co-authored-by: Fernando Oleo Blanco >> Co-authored-by: Piotr Trojanek >> Signed-off-by: Marc Poulhiès >> --- >> htdocs/gcc-14/changes.html | 67 ++

Re: [PATCH] gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]

2024-08-19 Thread Marc Poulhiès
Arsen Arsenović writes: Hello Arsen, > Reg-tested on x86_64-pc-linux-gnu with all languages and yes,rtl,extra > checking. > > OK for trunk? > > TIA, have a lovely day. > -- >8 -- > > gcc/ada/ChangeLog: > > PR ada/115917 > * gnatvsn.ads: Add note about the duplication

[PATCH] fix single argument static_assert

2024-08-22 Thread Marc Poulhiès
Single argument static_assert is C++17 only. libcpp/ChangeLog: * lex.cc: fix static_assert to use 2 arguments. --- OK for master? libcpp/lex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpp/lex.cc b/libcpp/lex.cc index daf2c770bc3..402a2e42f46 100644 --- a/l

[COMMITED] fix single argument static_assert

2024-08-22 Thread Marc Poulhiès
Single argument static_assert is C++17 only. libcpp/ChangeLog: * lex.cc(search_line_ssse3): fix static_assert to use 2 arguments. --- Pushed to master as obvious. Fixed the CL + added a reason in the assert. Thanks! libcpp/lex.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[COMMITTED 02/16] ada: Error missing when 'access is applied to an interface type object

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda The compiler does not report an error when 'access is applied to a non-aliased class-wide interface type object. gcc/ada/ * exp_util.ads (Is_Expanded_Class_Wide_Interface_Object_Decl): New subprogram. * exp_util.adb (Is_Expanded_Class_Wide_Interface_

[COMMITTED 03/16] ada: First controlling parameter aspect

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Temporarily remove reporting an error when the new aspect is set to True and the extensions are not enabled. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 3 --- 1 file

[COMMITTED 04/16] ada: Fix validity checks for named parameter associations

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek When iterating over actual and formal parameters, we should use First_Actual/Next_Actual and not simply First/Next, because the order of actual parameters might be different than the order of formal parameters obtained with First_Formal/Next_Formal. This patch fixes a glitch

[COMMITTED 06/16] ada: Cleanup validity of boolean operators

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek Move detection of always valid expressions from routine Ensure_Valid (which inserts validity checks) to Expr_Known_Valid (which decides their validity). In particular, this patch removes duplicated detection of boolean operators, which were recognized in both these routines.

[COMMITTED 15/16] ada: String interpolation: report error without Extensions allowed

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda The compiler does not report the correct error in occurrences of interpolated strings, when the sources are compiled without language extensions allowed. gcc/ada/ * scng.adb (Scan): Call Error_Msg_GNAT_Extension() to report an error, when the sources are com

[COMMITTED 01/16] ada: First controlling parameter aspect

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda This patch adds support for a new GNAT aspect/pragma that modifies the semantics of dispatching primitives. When a tagged type has this aspect/pragma, only subprograms that have the first parameter of this type will be considered dispatching primitives; this new pragma/aspect

[COMMITTED 05/16] ada: Simplify validity checks for scalar parameters

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek Replace low-level iteration over formal and actual parameters with a call to high-level Find_Actual routine. Code cleanup; behavior is unaffected. gcc/ada/ * checks.adb (Ensure_Valid): Use Find_Actual. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/a

[COMMITTED 08/16] ada: First controlling parameter aspect

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch6.adb (Check_Private_Overriding): Improve code detecting error on private function with controlling result. Fixes the regression of ACATS bde0003. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch6.adb | 14 +++

[COMMITTED 09/16] ada: Emit a warning on inheritly limited types

2024-08-23 Thread Marc Poulhiès
From: Viljar Indus Record types that do not have a limited keyword but have a member with a limited type are also considered to be limited types. This can be confusing to understand for newer Ada users. It is better to emit a warning in this scenario and suggest that the type should be marked wit

[COMMITTED 12/16] ada: Implicit_Dereference aspect specification for subtype incorrectly accepted

2024-08-23 Thread Marc Poulhiès
From: Steve Baird Implicit_Dereference is a type-specific aspect and therefore cannot be legally specified as part of a subtype declaration. gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Generate error if an aspect specification specifies the Implicit_De

[COMMITTED 10/16] ada: Update libraries with the limited flag

2024-08-23 Thread Marc Poulhiès
From: Viljar Indus Records without a limited keyword now emit a warning if they contain a member that has an inherently limited type. gcc/ada/ * libgnat/a-coinho__shared.ads: add limited keyword. * libgnat/g-awk.adb: add limited keyword. * libgnat/g-comlin.ads: add limit

[COMMITTED 07/16] ada: Fix style in lines starting with assignment operator

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek Style cleanup; semantics is unaffected. Offending occurrences found with grep "^ *:=" and fixed manually. gcc/ada/ * checks.ads, cstand.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb, exp_dbug.adb, exp_util.adb, gnatlink.adb, lib-util.adb, libgnat/a-exc

[COMMITTED 14/16] ada: Fix incorrect tracebacks on Windows

2024-08-23 Thread Marc Poulhiès
From: Sebastian Poeplau PECOFF symbols don't have a size attached to them. The symbol size that System.Object_Reader.Read_Symbol guesses to make up for the lack of information can be wrong when the symbol table doesn't match the algorithm's expectations; in particular that's the case when functio

[COMMITTED 11/16] ada: Eliminated-mode overflow check not eliminated

2024-08-23 Thread Marc Poulhiès
From: Steve Baird If the Overflow_Mode in effect is Eliminated, then evaluating an arithmetic op such as addition or subtraction should not fail an overflow check. Fix a bug which resulted in such an overflow check failure. gcc/ada/ * checks.adb (Is_Signed_Integer_Arithmetic_Op): Return

[COMMITTED 13/16] ada: Crash on string interpolation with custom string types

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda The compiler crashes when processing an object declaration of a custom string type initialized with an interpolated string. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference: [Put_Image]): Add support for custom string types. * exp_ch2.adb (Expan

[COMMITTED 16/16] ada: Fix crash on aliased variable with packed array type and -g switch

2024-08-23 Thread Marc Poulhiès
From: Eric Botcazou This comes from a loophole in gnat_get_array_descr_info for record types containing a template, which represent an aliased array, when this array type is bit-packed and implemented as a modular integer. gcc/ada/ * gcc-interface/misc.cc (gnat_get_array_descr_info): Te

[COMMITTED 03/17] ada: Proper handling for iterator associations in array aggregates

2024-08-29 Thread Marc Poulhiès
From: Gary Dismukes The compiler was flagging type-mismatch errors on iterated component associations in array aggregates of form "for C in ", improperly requiring the type of the iterator to be the array index type. The parser can't distinguish whether the association is one involving an actual

[COMMITTED 01/17] ada: Update documentation for conditional when constructs

2024-08-29 Thread Marc Poulhiès
From: Justin Squirek This patch moves the documentation for conditional when constructs out of the curated set (e.g. into -gnatX0). gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Move conditional when constructs out of the curated set. * gnat_rm.texi: Regenerate.

<    1   2   3   4   5   6   7   8   9   10   >