[COMMITTED 05/17] ada: Ensure validity checks for private scalar types

2024-08-29 Thread Marc Poulhiès
From: Piotr Trojanek To check validity of data values, we must strip privacy from their types. gcc/ada/ * checks.adb (Expr_Known_Valid): Use Validated_View, which strips type derivation and privacy. * exp_ch3.adb (Simple_Init_Private_Type): Kill checks inside unc

[COMMITTED 09/17] ada: Avoid creating continuation messages without an intended parent

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus The messages modified in this patch do not have a clear intended parent. This causes a lot of issues when grouping continuation messages together with their parent. This can be confusing as it is not obvious what was the parent message that caused this problem or in worst case

[COMMITTED 04/17] ada: Display actual line length in line length check

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * styleg.adb (Check_Line_Max_Length): Add the actual line length to the diagnostic message. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/styleg.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sty

[COMMITTED 12/17] ada: Use the same warning character in continuation messages

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus For consitency sake the main and continuation messages should use the same warning characters. gcc/ada/ * exp_aggr.adb (Expand_Range_Component): Remove extra warning character. Use same conditional warning char. * freeze.adb (Warn_Overlay): Use named w

[COMMITTED 02/17] ada: First controlling parameter aspect

2024-08-29 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * usage.adb (Usage): Document switch -gnatw_j * doc/gnat_rm/gnat_language_extensions.rst: Add documentation. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_rm/gnat_language_extensions.rst

[COMMITTED 06/17] ada: Extract line fitting algorithm

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus Separate the line fitting algorithm from the general line printing algorithm. gcc/ada/ * erroutc.ads: Add new method Output_Text_Within * erroutc.adb: Move the line fitting code to a new method called Output_Text_Within Tested on x86_64-pc-linux-gnu,

[COMMITTED 14/17] ada: Fix missing finalization for call to function returning limited view

2024-08-29 Thread Marc Poulhiès
From: Eric Botcazou The call is legal because it is made from the body, which has visibility on the nonlimited view, so this changes the code in Expand_Call_Helper to look at the Etype of the call node instead of the Etype of the function. gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): In

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

2024-08-29 Thread Marc Poulhiès
From: Steve Baird Refine previous fix to better handle tagged cases. gcc/ada/ * sem_ch6.adb (Check_Discriminant_Conformance): Immediately after calling Is_Immutably_Limited_Type, perform an additional test that one might reasonably imagine would instead have been part of

[COMMITTED 10/17] ada: Improve Inspection_Point warning

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus Ensure that the primary and sub message point to the same location in order to assure that the submessages get pretty printed in the correct order. gcc/ada/ * exp_prag.adb (Expand_Pragma_Inspection_Point): Improve sub diagnostic generation. Tested on x86_64-p

[COMMITTED 07/17] ada: Use consistent type continuations messages

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus Avoid cases where the main message is an error and the continuation is a warning. gcc/ada/ * freeze.adb: Remove warning insertion characters from a continuation message. * sem_util.adb: Remove warning insertion characters from a continuation me

[COMMITTED 17/17] ada: Fix assertion failure on private limited with clause

2024-08-29 Thread Marc Poulhiès
From: Eric Botcazou This checks that the name is of an entity before accessing its Entity field. gcc/ada/ * sem_ch8.adb (Has_Private_With): Add test on Is_Entity_Name. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch8.adb | 1 + 1 file changed, 1 insertion(+) d

[COMMITTED 16/17] ada: Fix internal error on concatenation of discriminant-dependent component

2024-08-29 Thread Marc Poulhiès
From: Eric Botcazou This only occurs with optimization enabled, but the expanded code is always wrong because it reuses the formal parameter of an initialization procedure associated with a discriminant (a discriminal in GNAT parlance) outside of the initialization procedure. gcc/ada/ *

[COMMITTED 08/17] ada: Parse the attributes of continuation messages correctly

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus Currently unless pretty printing is enabled we avoid parsing the message strings for continuation messages. This leads to inconsistent state for the Error_Msg_Object-s that are being created. gcc/ada/ * erroutc.adb (Prescan_Message): Avoid not parsing all of the

[COMMITTED 11/17] ada: Restructure continuation message for pretty printing

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus Continuation messages should have the same location as the main message. If the goal is to point to a different location then Error_Msg_Sloc should be used to change the location of the continuation message. gcc/ada/ * par-ch4.adb (P_Name): Use Error_Msg_Sloc for the

[COMMITTED 13/17] ada: Print Insertion_Sloc in dmsg

2024-08-29 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * erroutc.adb (dmsg): Print Insertion_Sloc. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/erroutc.adb | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index 4e0a9f26e0d..db1c0923e90 100644

[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

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

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

[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. * doc/gnat_rm/standard_and_implementati

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

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

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

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

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

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

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

[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. * libgnat/a-chtg

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

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

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

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

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

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

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

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

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

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

[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): Ad

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

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

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

[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 a/gcc/ada/exp_c

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

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

[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 b/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 (Check_

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

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

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

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

[COMMITTED 12/30] ada: Check global mode restriction on encapsulating abstract states

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

[COMMITTED 13/30] ada: Fix oversight in latest finalization fix

2024-06-13 Thread Marc Poulhiès
From: Eric Botcazou 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. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 2 +- 1 file cha

[COMMITTED 23/30] ada: Deep copy of an expression sometimes fails to copy entities

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

[COMMITTED 24/30] ada: Revert changing a GNATProve mode message to a non-warning

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

[COMMITTED 06/30] ada: Fix fallout of previous finalization change

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

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

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

[COMMITTED 02/30] ada: Fix too late finalization of temporary object

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

[COMMITTED 11/30] ada: Streamline elaboration of local tagged types

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

[COMMITTED 20/30] ada: Remove warning insertion characters from info messages

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

[COMMITTED 26/30] ada: Fix test for giving hint on ambiguous aggregate

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

[COMMITTED 21/30] ada: Remove message about goto rewritten as a loop

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

[COMMITTED 16/30] ada: Interfaces order disables class-wide prefix notation calls

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

[COMMITTED 25/30] ada: Missing postcondition runtime check in inherited primitive

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

[COMMITTED 30/30] ada: Compiler goes into loop

2024-06-13 Thread Marc Poulhiès
From: Steve Baird In some cases that are difficult to characterize, the compiler fails an assertion check (if the compiler is built with assertions enabled) or loops forever (if assertions are not enabled). One way this can happen is if Exp_Util.Insert_Actions is called with an N_Itype_Reference

[COMMITTED 29/30] ada: Remove -gnatdJ switch

2024-06-13 Thread Marc Poulhiès
From: Viljar Indus Using -gnatdJ with various other switches was error prone. Remove this switch since the primary users of this mode GNATCheck and Codepeer no longer need it. gcc/ada/ * debug.adb: Remove mentions of -gnatdJ. * errout.adb: Remove printing subprogram names to JSO

[COMMITTED 01/16] ada: Remove unused name of aspect from Snames

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * snames.ads-tmpl (Name_Storage_Model): Delete. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/snames.ads-tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 6cc66566907..699b8df5

[COMMITTED 04/16] ada: Missing initialization of multidimensional array using sliding

2024-06-14 Thread Marc Poulhiès
From: Javier Miranda When a multidimensional array is initialized with an array aggregate, and inner dimensions of the array are initialized with array subaggregates using sliding, the code generated by the compiler does not initialize the inner dimensions of the array. gcc/ada/ * exp_a

[COMMITTED 03/16] ada: Couple of small cleanups in semantic analysis of aspects

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou The first cleanup is to expose a consistent interface from Sem_Ch13 for the analysis of aspects at various points of the program. The second cleanup is to fix the awkward implementation of the analysis of the specification for the aspects Stable_Properties, Designated_Storage

[COMMITTED 02/16] ada: Allow implicit dereferenced for uses of 'Super

2024-06-14 Thread Marc Poulhiès
From: Justin Squirek This patch modifies the experimental 'Super attribute to allow an access-valued prefix to be equivalent to Prefix.all'Super. gcc/ada/ * sem_attr.adb: (Analyze_Attribute): Add check for dereference. Tested on x86_64-pc-linux-gnu, committed on master. --- g

[COMMITTED 06/16] ada: Crash checking accessibility level on private type

2024-06-14 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: (Accessib

[COMMITTED 09/16] ada: Simplify handling of VxWorks-specific error codes for ENOENT

2024-06-14 Thread Marc Poulhiès
From: Jerome Guitton These error codes were defined on older versions of VxWorks (5, 6, 7 SR0540) and now they are either not defined or they fallback to ENOENT. To handle these cases without using complex tests against vxworks versions, leverage on __has_include and provide a fallback to ENOENT

[COMMITTED 05/16] ada: Minor tweaks to processing of Aggregate aspect

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou The main one is to give the error for Aggregate applied to array types from Analyze_Aspects_At_Freeze_Point instead of Check_Aspect_At_Freeze_Point, as for the other aspects. The message is also changed to be more direct. gcc/ada/ * aspects.ads (Operational_Aspect):

[COMMITTED 08/16] ada: Minor tweak in Snames

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * snames.ads-tmpl (Name_Present): Move to Repinfo section. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/snames.ads-tmpl | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-

[COMMITTED 13/16] ada: Do not create null GCC thunks

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou This prevents Gigi from creating null GCC thunks, i.e. thunks that have all their internal parameters set to zero, replacing them with aliases. They can arise in degenerate cases and null thunks would trip on an assertion in former_thunk_p when they are later optimized. gcc/

[COMMITTED 10/16] ada: Bad tree built for Obj.Discrim_Dep_Component'Loop_Entry in assertion

2024-06-14 Thread Marc Poulhiès
From: Steve Baird The Etype for an N_Selected_Component node usually should not match the Etype of the referenced component if the component is subject to a discriminant-dependent constraint. Instead Build_Actual_Subtype_Of_Component should be called. Fix a case where this rule was not being foll

[COMMITTED 12/16] ada: Typo and indentation fix

2024-06-14 Thread Marc Poulhiès
Fixes typo in comments and 2 instances of bad indentation. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Typo fix. (gnat_to_gnu_component_type): Indent fix. * gcc-interface/gigi.h (build_call_alloc_dealloc): Typo fix. * gcc-interface/utils.cc (make_dummy_t

[COMMITTED 11/16] ada: Fix parts of classification of aspects

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou Many aspects are (correctly) marked as GNAT-specific but nevertheless not listed in the Implementation_Defined_Aspect array, so this aligns the two sides and also removes Default_Initial_Condition and Object_Size from the list, since they are defined in Ada 2022. This also mo

[COMMITTED 16/16] ada: Do not include target-specific makefile fragments

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou They are unused in this context. gcc/ada/ * gcc-interface/Makefile.in (tmake_file): Remove all references. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/Makefile.in | 6 -- 1 file changed, 6 deletions(-) diff --git a/gcc/ada/gc

[COMMITTED 07/16] ada: Add prototype for mutably tagged types

2024-06-14 Thread Marc Poulhiès
From: Justin Squirek This patch implements mutably tagged types via the new Size'Class aspect. gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Add documentation for mutably tagged type feature. * aspects.ads: Add registration for 'Size'Class. * einfo.ads: Ad

[COMMITTED 15/16] ada: Fix return mechanism reported by -gnatRm

2024-06-14 Thread Marc Poulhiès
From: Eric Botcazou The return mechanism of functions is reported when the -gnatRm switch is specified, but it is incorrect when the result type is not a by-reference type in the language sense but is nevertheless returned by reference. gcc/ada/ * gcc-interface/decl.cc: Include function

[COMMITTED 14/16] ada: Skip subprogram body entities inside scopes

2024-06-14 Thread Marc Poulhiès
From: Yannick Moy Entities of kind E_Subprogram_Body, used on bodies of subprograms for which there is a separate declaration, have been added in the entities linked from a scope in order to get the representation information on their enclosed object and type declarations. Skip these entities in

[COMMITTED 01/30] ada: Fix list of attributes defined by Ada 2022

2024-06-20 Thread Marc Poulhiès
From: Piotr Trojanek Recognize references to attributes Put_Image and Object_Size as language-defined in Ada 2022 and implementation-defined in earlier versions of Ada. Other attributes listed in Ada 2022 RM, K.2 and currently implemented in GNAT are correctly categorized. This change only affec

[COMMITTED 02/30] ada: Improve preprocessor error handling.

2024-06-20 Thread Marc Poulhiès
From: Steve Baird In some cases, gnatprep would correctly emit an error message and then incorrectly exit with a return code of zero, indicating success. In some cases, a correct message about an error detected by the integrated preprocessor would be accompanied by an incorrect message indicating

[COMMITTED 07/30] ada: Change messages for -gnatw.v to warnings

2024-06-20 Thread Marc Poulhiès
From: Viljar Indus Previously this switch was emitting only info messages which was both confusing in terms of the name of the switch that was used internally and externally. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update documentation for -gnatw.v.

[COMMITTED 10/30] ada: Do not compute Has_Controlled_Component twice during freezing

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou The Has_Controlled_Component flag is computed twice during freezing when expansion is enabled: in Freeze_Array_Type and Expand_Freeze_Array_Type for array types, and in Freeze_Record_Type and Expand_Freeze_Record_Type for record types. This removes the latter computation in b

[COMMITTED 04/30] ada: Treat Info-Warnings as Info messages

2024-06-20 Thread Marc Poulhiès
From: Viljar Indus There was a general concept of info messages being a subset of warnings. However that is no longer the case. Messages with an info insertion character should be treated just as info messages. gcc/ada/ * atree.ads: Remove Warning_Info_Messages. * errout.adb: Re

[COMMITTED 06/30] ada: Convert -gnatw.n messages to warnings

2024-06-20 Thread Marc Poulhiès
From: Viljar Indus Previously the messages produced by this warning switch were info messages that were suppressed with the same methods as regular warnings. Since info messages are now separated as a completely different class of messages then these messages should be converted back to warnings

[COMMITTED 05/30] ada: Add switch for suppressing info messages

2024-06-20 Thread Marc Poulhiès
From: Viljar Indus Add a separate switch -gnatis to suppress info messages separately from warning messages that are controlled by -gnatws. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add entry for -gnatis. * errout.adb (Error_Msg_Internal): Stop

[COMMITTED 14/30] ada: Fix style in freezing code

2024-06-20 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * freeze.adb (Find_Aspect_No_Parts): Tune whitespace. * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Fix style. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/freeze.adb | 8 +++

[COMMITTED 08/30] ada: Document -gnatd_w for CCG

2024-06-20 Thread Marc Poulhiès
From: Richard Kenner gcc/ada/ * debug.adb: Add documentation for -gnatd_w. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/debug.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 602a8fa0b63..97f88b76

[COMMITTED 11/30] ada: Add Dump_Buffers hooks for code coverage

2024-06-20 Thread Marc Poulhiès
From: Ronan Desplanques The purpose of this patch is to make it possible to set up code coverage for the GNAT front end in gnat1 using GNATcoverage. It is not obvious how to have GNATcoverage instrument gnat1's main function, and since the front end has a clear entry point (Gnat1drv), we add manu

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