[COMMITTED 14/30] ada: Fix expansion of protected subprogram bodies

2024-06-13 Thread Marc Poulhiès
From: Ronan Desplanques 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

[COMMITTED 28/30] ada: Fix segmentation fault on slice of array with Unbounded_String component

2024-06-13 Thread Marc Poulhiès
From: Eric Botcazou This fixes a regression introduced by the overhaul of the implementation of finalization. When the first subtype of an array type is declared as constrained, the Finalize_Address primitive of the base type synthesized by the compiler is tailored to this first subtype, which

[COMMITTED 22/30] ada: Minor cleanups in generic formal matching

2024-06-13 Thread Marc Poulhiès
From: Bob Duff 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

[COMMITTED 17/30] ada: List subprogram body entities in scopes

2024-06-13 Thread Marc Poulhiès
From: Yannick Moy 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

[COMMITTED 15/30] ada: Fix Super attribute documentation

2024-06-13 Thread Marc Poulhiès
From: Steve Baird 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/

[COMMITTED 19/30] ada: Convert an info message to a continuation

2024-06-13 Thread Marc Poulhiès
From: Viljar Indus 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

[COMMITTED 18/30] ada: Simplify code in Cannot_Inline

2024-06-13 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * inline.adb (Cannot_Inline): Simplify string handling logic. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/inline.adb | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/ada/inline.adb

[COMMITTED 04/30] ada: Simplify checks for Address and Object_Size clauses

2024-06-13 Thread Marc Poulhiès
From: Piotr Trojanek 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

[COMMITTED 10/30] ada: Do not inline subprogram which could cause SPARK violation

2024-06-13 Thread Marc Poulhiès
From: Yannick Moy 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/

[COMMITTED 09/30] ada: Fix incorrect String lower bound in gnatlink

2024-06-13 Thread Marc Poulhiès
From: Ronan Desplanques 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. Tested on x86_64-pc-linux-gnu,

[COMMITTED 07/30] ada: Inline if -gnatn in CCG mode even if -O0

2024-06-13 Thread Marc Poulhiès
From: Richard Kenner gcc/ada/ * exp_ch6.adb (Expand_Ctrl_Function_Call): Inline if -gnatn in CCG mode even if -O0. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[COMMITTED 05/30] ada: Missing support for 'Old with overloaded function

2024-06-13 Thread Marc Poulhiès
From: Javier Miranda 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

[COMMITTED 01/30] ada: Missing dynamic predicate checks

2024-06-13 Thread Marc Poulhiès
From: Javier Miranda 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

[COMMITTED 03/30] ada: Add support for symbolic backtraces with DLLs on Windows

2024-06-13 Thread Marc Poulhiès
From: Eric Botcazou 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.

[COMMITTED 29/30] ada: Storage_Error in indirect call to function returning limited type

2024-06-10 Thread Marc Poulhiès
From: Javier Miranda 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):

[COMMITTED 25/30] ada: Resolve compilation issues with container aggregates in draft ACATS B tests

2024-06-10 Thread Marc Poulhiès
From: Gary Dismukes 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

[COMMITTED 24/30] ada: Missing style check for extra parentheses in operators

2024-06-10 Thread Marc Poulhiès
From: Justin Squirek 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. *

[COMMITTED 21/30] ada: Unreferenced warning on abstract subprogram

2024-06-10 Thread Marc Poulhiès
From: Justin Squirek 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

[COMMITTED 26/30] ada: For freezing, treat an extension or delta aggregate like a regular aggregate.

2024-06-10 Thread Marc Poulhiès
From: Steve Baird 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

[COMMITTED 14/30] ada: Remove incorrect assertion in run-time

2024-06-10 Thread Marc Poulhiès
From: Ronan Desplanques 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

[COMMITTED 28/30] ada: Derived type with convention C must override convention C_Pass_By_Copy

2024-06-10 Thread Marc Poulhiès
From: Gary Dismukes 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

[COMMITTED 23/30] ada: Iterator filter ignored on formal loop

2024-06-10 Thread Marc Poulhiès
From: Justin Squirek 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.

[COMMITTED 12/30] ada: Cleanup repeated code in expansion of stream attributes

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek 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

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

2024-06-10 Thread Marc Poulhiès
From: Justin Squirek 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. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 27/30] ada: Minor code adjustment to "not Present" test

2024-06-10 Thread Marc Poulhiès
From: Gary Dismukes 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. Tested on x86_64-pc-linux-gnu, committed

[COMMITTED 22/30] ada: Crash checking accessibility level on private type

2024-06-10 Thread Marc Poulhiès
From: Justin Squirek 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

[COMMITTED 13/30] ada: Fix incorrect lower bound presumption in gnatlink

2024-06-10 Thread Marc Poulhiès
From: Ronan Desplanques 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. Tested on x86_64-pc-linux-gnu, committed on master.

[COMMITTED 15/30] ada: Fix usage of SetThreadIdealProcessor

2024-06-10 Thread Marc Poulhiès
From: Ronan Desplanques 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. Tested on x86_64-pc-linux-gnu, committed on master.

[COMMITTED 17/30] ada: Remove streaming facilities from generics for formal containers

2024-06-10 Thread Marc Poulhiès
From: Yannick Moy 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. *

[COMMITTED 08/30] ada: Enable inlining for subprograms with multiple return statements

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek With the support for forward GOTO statements in the GNATprove backend, we can now inline subprograms with multiple return statements in the frontend. Also, fix inconsistent source locations in the inlined code, which were now triggering assertion violations in the code for

[COMMITTED 19/30] ada: Fix references to Ada RM in comments

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek 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,

[COMMITTED 30/30] ada: Add support for No_Implicit_Conditionals to nonbinary modular types

2024-06-10 Thread Marc Poulhiès
From: Eric Botcazou 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

[COMMITTED 09/30] ada: Simplify check for type without stream operations

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Recursive routine Type_Without_Stream_Operation was checking restriction No_Default_Stream_Attributes at every call, which was confusing and inefficient. This routine is only called from the places: Check_Stream_Attribute, which already checks if this restriction is active,

[COMMITTED 04/30] ada: Fix handling of aspects CPU and Interrupt_Priority

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek When resolving aspect expression, aspects CPU and Interrupt_Priority should be handled like the aspect Priority; in particular, all these expressions can reference discriminants of the annotated task type. gcc/ada/ * sem_ch13.adb

[COMMITTED 18/30] ada: Tune code related to potentially unevaluated expressions

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek 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

[COMMITTED 10/30] ada: Skip processing of NUL character for attribute Type_Key

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ * sem_attr.adb (Analyze_Attribute): Use fully qualified name without a NUL, so that it doesn't need to be skipped afterwards. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 8

[COMMITTED 16/30] ada: Fix usage of SetThreadAffinityMask

2024-06-10 Thread Marc Poulhiès
From: Ronan Desplanques 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

[COMMITTED 05/30] ada: Cleanup building of error messages for class-wide contracts

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_ch6.adb (Build_Dynamic_Check_Helper_Call): Remove unused iteration over formal parameters. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 3 +-- 1 file changed, 1

[COMMITTED 03/30] ada: Remove unnecessary guard against empty list

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_prag.adb (Report_Extra_Clauses): Remove redundant check for empty list, because First works also for No_List. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 15

[COMMITTED 07/30] ada: Add switch to disable expansion of assertions in CodePeer mode

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek A new debug switch -gnatd_k is added, which has only effect in CodePeer mode. When enabled, assertion expressions are no longer expanded (which is the default in the CodePeer mode); instead, their expansion needs to be explicitly enabled by pragma Assertion_Policy. gcc/ada/

[COMMITTED 11/30] ada: Adjust comments and doc about the new use of restriction No_Streams

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek 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. *

[COMMITTED 06/30] ada: Refactor common code for dynamic and static class-wide preconditions

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_ch6.adb (Install_Class_Preconditions_Check): Refactor common code for checking if precondition fails, since the difference is only in raising an exception or calling the

[COMMITTED 02/30] ada: Refactor checks for Refined_Depends in generic instances

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_prag.adb (Check_Dependency_Clause, Check_Output_States, Report_Extra_Clauses): Remove multiple checks for being inside an instance. (Analyze_Refined_Depends_In_Decl_Part): Add single

[COMMITTED 01/30] ada: Refactor checks for Refined_Global in generic instances

2024-06-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_prag.adb (Check_In_Out_States, Check_Input_States, Check_Output_States, Check_Proof_In_States, Check_Refined_Global_List, Report_Extra_Constituents, Report_Missing_Items): Remove multiple

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

[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

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

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_ssa:

[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,

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&)’:

[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

[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

[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

[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

[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

[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

[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

[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.

[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

[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

[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. ---

[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

[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

[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.

[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 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

[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

[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

[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

[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

[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

[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

[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. ---

[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

[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

[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. ---

[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

[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

[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. ---

[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

[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

[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

[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

[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

[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

[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

[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 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 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. ---

[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

[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.

[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 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

[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

[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

[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

[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

[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/ *

[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 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

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