[COMMITTED 11/13] ada: Compiler accepts an illegal Unchecked_Access attribute reference

2024-07-02 Thread Marc Poulhiès
From: Steve Baird The compiler incorrectly accepts Some_Object'Unchecked_Access'Image. gcc/ada/ * sem_attr.adb (Analyze_Image_Attribute.Check_Image_Type): Check for E_Access_Attribute_Type prefix type. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 13/13] ada: Use static allocation for small dynamic string concatenations in more cases

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou This lifts the limitation of the original implementation whereby the first operand of the concatenation needs to have a length known at compiled time in order for the static allocation to be used. gcc/ada/ * exp_ch4.adb (Expand_Concatenate): In the case where an

[COMMITTED 10/13] ada: Use clause (or use type clause) in a protected operation sometimes ignored.

2024-07-02 Thread Marc Poulhiès
From: Steve Baird In some cases, a use clause (or a use type clause) occurring within a protected operation is incorrectly ignored. gcc/ada/ * exp_ch9.adb (Expand_N_Protected_Body): Declare new procedure Unanalyze_Use_Clauses and call it before analyzing the newly

[COMMITTED 08/13] ada: Allow mutably tagged types to work with qualified expressions

2024-07-02 Thread Marc Poulhiès
From: Justin Squirek This patch modifies the experimental 'Size'Class feature such that objects of mutably tagged types can be assigned qualified expressions featuring a definite type (e.g. Mutable_Obj := Root_Child_T'(Root_T with others => <>)). gcc/ada/ * sem_ch5.adb:

[COMMITTED 12/13] ada: Fix generic renaming table low bound on reset

2024-07-02 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ * sem_ch12.adb (Save_And_Reset): Fix value of low bound used to reset table. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch12.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch12.adb

[COMMITTED 09/13] ada: Put_Image aspect spec ignored for null extension.

2024-07-02 Thread Marc Poulhiès
From: Steve Baird If type T1 is is a tagged null record with a Put_Image aspect specification and type T2 is a null extension of T1 (with no aspect specifications), then evaluation of a T2'Image call should include a call to the specified procedure (as opposed to yielding "(NULL RECORD)").

[COMMITTED 07/13] ada: Bug box for expression function with list comprehension

2024-07-02 Thread Marc Poulhiès
From: Bob Duff GNAT crashes on an iterator with a filter inside an expression function that is the completion of an earlier spec. gcc/ada/ * freeze.adb (Freeze_Type_Refs): If Node is in N_Has_Etype, check that it has had its Etype set, because this can be called early

[COMMITTED 05/13] ada: Fix analysis of Extensions_Visible

2024-07-02 Thread Marc Poulhiès
From: Yannick Moy Pragma/aspect Extensions_Visible should be analyzed before any pre/post contracts on a subprogram, as the legality of conversions of formal parameters to classwide type depends on the value of Extensions_Visible. Now fixed. gcc/ada/ * contracts.adb

[COMMITTED 06/13] ada: Call memcmp instead of Compare_Array_Unsigned_8 and...

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou ... implement support for ordering comparisons of discrete array types. This extends the Support_Composite_Compare_On_Target feature to ordering comparisons of discrete array types as specified by RM 4.5.2(26/3), when the component type is a byte (unsigned). Implement

[COMMITTED 03/13] ada: Miscomputed bounds for inner null array aggregates

2024-07-02 Thread Marc Poulhiès
From: Javier Miranda When an array has several dimensions, and inner dimmensions are initialized using Ada 2022 null array aggregates, the compiler crashes or reports spurious errors computing the bounds of the null array aggregates. This patch fixes the problem and adds new warnings reported

[COMMITTED 04/13] ada: Fix bogus error on allocator in instantiation with private derived types

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the call to Convert_View made from Make_Init_Call does nothing because the Etype is not set on the second argument. gcc/ada/ * exp_ch7.adb (Convert_View): Add third parameter Typ and use it if the second parameter does not have an Etype.

[COMMITTED 01/13] ada: Document that -gnatdJ is unused

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * debug.adb (dJ): Add back as unused. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/debug.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index f7fcd399769..3313c4a408f 100644 ---

[COMMITTED 02/13] ada: Fix crash on box-initialized component with No_Default_Initialization

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the implementation of the No_Default_Initialization restriction assumes that no type initialization routines are needed and, therefore, builds a dummy version of them, which goes against their use for box-initialized components in aggregates. Therefore

[COMMITTED 1/7] ada: Implement first half of Generalized Finalization

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou This implements the first half of the Generalized Finalization proposal, namely the Finalizable aspect as well as its optional relaxed semantics for the finalization operations, but the latter part is only implemented for dynamically allocated objects. In accordance with the

[COMMITTED 5/7] ada: Add missing dimension information for target names

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou It is computed from the Etype of N_Target_Name nodes. gcc/ada/ * sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the node once the Etype is set. * sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name.

[COMMITTED 4/7] ada: Fix array-manipulating code in Mdll

2024-06-27 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a duo of array assigments in Mdll that were bound to fail. gcc/ada/ * mdll.adb (Build_Non_Reloc_DLL): Fix incorrect assignment to array object. (Ada_Build_Non_Reloc_DLL): Likewise. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED 7/7] ada: Remove last uses of System.Address_Operations in runtime library

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou This completes the switch from using System.Address_Operations to using only System.Storage_Elements in the runtime library. The remaining uses were for simple optimizations that can be done by the optimizer alone. gcc/ada/ * libgnat/s-carsi8.adb: Remove clauses

[COMMITTED 3/7] ada: Bug using user defined string literals with interpolated strings

2024-06-27 Thread Marc Poulhiès
From: Javier Miranda The frontend rejects the use of user defined string literals using interpolated strings. gcc/ada/ * sem_res.adb (Has_Applicable_User_Defined_Literal): Add missing support for interpolated strings. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 2/7] ada: Overridden operation field not correctly set for controlling result wrappers

2024-06-27 Thread Marc Poulhiès
From: Martin Clochard Implicit wrapper overridings generated for functions with controlling result when deriving with null extension may have field Overridden_Operation incorrectly set, when making several such derivations in succession. This happens because overridings were assumed to come from

[COMMITTED 6/7] ada: Reject ambiguous function calls in interpolated string expressions

2024-06-27 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch2.adb (Analyze_Interpolated_String_Literal): Report interpretations of ambiguous parameterless function calls. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch2.adb | 80 -

[COMMITTED 13/22] ada: Change error message on invalid RTS path

2024-06-21 Thread Marc Poulhiès
Include the invalid path in the error message. gcc/ada/ * make.adb (Scan_Make_Arg): Adjust error message. * gnatls.adb (Search_RTS): Likewise. * switch-b.adb (Scan_Debug_Switches): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gnatls.adb |

[COMMITTED 22/22] ada: Fix internal error on protected type with -gnatc -gnatR

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou It occurs when the body of a protected subprogram is processed, because the references to the components of the type have not been properly expanded. gcc/ada/ * gcc-interface/trans.cc (Subprogram_Body_to_gnu): Also return early for a protected subprogram in

[COMMITTED 17/22] ada: Reject ambiguous function calls in interpolated string expressions

2024-06-21 Thread Marc Poulhiès
From: Javier Miranda When the interpolated expression is a call to an ambiguous call the frontend does not reject it; erroneously accepts the call and generates code that calls to one of them. gcc/ada/ * sem_ch2.adb (Analyze_Interpolated_String_Literal): Reject ambiguous

[COMMITTED 20/22] ada: Fix bogus Address Sanitizer stack-buffer-overflow on packed record equality

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou We set DECL_BIT_FIELD optimistically during the translation of record types and clear it afterward if needed, but fail to clear other attributes in the latter case, which fools the logic of the Address Sanitizer. gcc/ada/ * gcc-interface/utils.cc

[COMMITTED 15/22] ada: Fix crash in GNATbind during error reporting

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou This is the minimal fix to avoid the crash. gcc/ada/ * bcheck.adb (Check_Consistency_Of_Sdep): Guard against path to ALI file not found. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/bcheck.adb | 10 +++--- 1 file changed, 7

[COMMITTED 14/22] ada: Crash when using user defined string literals

2024-06-21 Thread Marc Poulhiès
From: Javier Miranda When a non-overridable aspect is explicitly specified for a non-tagged derived type, the compiler blows up processing an object declaration of an object of such type. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Fix code locating the entity of the parent

[COMMITTED 21/22] ada: Fix bogus Address Sanitizer stack-buffer-overflow on packed array copy

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou The Address Sanitizer considers that the padding at the end of a justified modular type may be accessed through the object, but it is never accessed and therefore can always be reused. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : Set the

[COMMITTED 12/22] ada: Small cleanup in processing of primitive operations

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou The processing of primitive operations is now always uniform for tagged and untagged types, but the code contains left-overs from the time where it was specific to tagged types, in particular for the handling of subtypes. gcc/ada/ * einfo.ads

[COMMITTED 16/22] ada: Apply fixes to Examine_Array_Bounds

2024-06-21 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ * sem_util.adb (Examine_Array_Bounds): Add missing return statements. Fix criterion for a string literal being empty. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 4 +++- 1 file changed, 3 insertions(+), 1

[COMMITTED 18/22] ada: Implement fast modulo reduction for nonbinary modular multiplication

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou This implements modulo reduction for nonbinary modular multiplication with small moduli by means of the standard division-free algorithm also used in the optimizer, but with fewer constraints and therefore better results. For the sake of consistency, it is also used for the

[COMMITTED 11/22] ada: Revert conditional installation of signal handlers on VxWorks

2024-06-21 Thread Marc Poulhiès
From: Doug Rupp The conditional installation resulted in a semantic change, and although it is likely what is ultimately wanted (since HW interrupts are being reworked on VxWorks). However it must be done in concert with other modifications for the new formulation of HW interrupts and not in

[COMMITTED 08/22] ada: Fix internal error on case expression used as index of array component

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou This occurs when the bounds of the array component depend on a discriminant and the component reference is not nested, that is to say the component is not (referenced as) a subcomponent of a larger record. In this case, Analyze_Selected_Component does not build the actual

[COMMITTED 06/22] ada: Generic formal/actual matching -- misc cleanup

2024-06-21 Thread Marc Poulhiès
From: Bob Duff The only substantive change is to remove Activation_Chain_Entity from N_Generic_Package_Declaration. The comment in sinfo.ads suggesting this change was written in 1993! Various pieces of missing documentation are added to Sinfo and Einfo. Also other minor cleanups. gcc/ada/

[COMMITTED 09/22] ada: Fix missing index check with declare expression

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou The Do_Range_Check flag is properly set on the Expression of the EWA node built for the declare expression, so this instructs Generate_Index_Checks to look into this Expression. gcc/ada/ * checks.adb (Generate_Index_Checks): Add specific treatment for index

[COMMITTED 10/22] ada: Cannot override inherited function with controlling result

2024-06-21 Thread Marc Poulhiès
From: Javier Miranda When a package has the declaration of a derived tagged type T with private null extension that inherits a public function F with controlling result, and a derivation of T is declared in the public part of another package, overriding function F may be rejected by the

[COMMITTED 03/22] ada: Fix assertion failure on predicate involving access parameter

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou The assertion fails because the Original_Node of the expression has no Etype since its an unanalyzed identifier. gcc/ada/ * accessibility.adb (Accessibility_Level): Apply the processing to Expr when its Original_Node is an unanalyzed identifier. Tested on

[COMMITTED 04/22] ada: Predefined arithmetic operators incorrectly treated as directly visible

2024-06-21 Thread Marc Poulhiès
From: Steve Baird In some cases, a predefined operator (e.g., the "+" operator for an integer type) is incorrectly treated as being directly visible when it is not. This can lead to both accepting operator uses that should be rejected and also to incorrectly rejecting legal constructs as

[COMMITTED 19/22] ada: Implement fast modulo reduction for nonbinary modular multiplication

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou This adds the missing guard to prevent the reduction from being used when the target does not provide or cannot synthesize a high-part multiply. gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu) : Fix formatting. * gcc-interface/utils2.cc: Include

[COMMITTED 07/22] ada: Fix incorrect handling of packed array with aliased composite components

2024-06-21 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the handling of the interaction between packing and aliased/atomic/independent components of an array type is tied to that of the interaction between a component clause and aliased/atomic/independent components, although the semantics are different:

[COMMITTED 05/22] ada: Fix gnatcheck violation reported after a recent cleanup

2024-06-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_ch3.adb (Add_Interface_Tag_Components): Simplify with No. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[COMMITTED 01/22] ada: Spurious style error with mutiple square brackets

2024-06-21 Thread Marc Poulhiès
From: Justin Squirek This patch fixes a spurious error in the compiler when checking for style for token separation where two square brackets are next to each other. gcc/ada/ * csets.ads (Identifier_Char): New function - replacing table. * csets.adb (Identifier_Char): Rename

[COMMITTED 02/22] ada: Fix for Default_Component_Value with declare expressions

2024-06-21 Thread Marc Poulhiès
From: Piotr Trojanek When the expression of aspect Default_Component_Value includes a declare expression with current type instance, we attempted to recursively froze that type, which itself caused an infinite recursion, because we didn't properly manage the scope of declare expression. This

[COMMITTED 21/30] ada: Fix bogus error with "=" operator on array of private unchecked union

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou The code is legal and, therefore, must be accepted by the compiler, but it must raise Program_Error at run time due to operands not having inferable discriminants and a warning be given at compile time (RM B.3.3(22-23)). gcc/ada/ * exp_ch4.adb

[COMMITTED 19/30] ada: Enforce strict alignment for array types with aliased component

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou This was initially implemented as part of AI12-001 but immediately disabled because it breaks Florist on 32-bit platforms. However, it is possible to reenable it in almost all cases without affecting Florist, and the -gnatd_l switch can now be used to disable it again.

[COMMITTED 28/30] ada: Rewrite generic formal/actual matching

2024-06-20 Thread Marc Poulhiès
From: Bob Duff ...in preparation for implementing type inference for generic parameters. The main change is to do the "matching" computation early, and produce a *constant* data structure (Gen_Assocs_Rec) to represent the matching between each triple of unanalyzed formal, analyzed formal, and

[COMMITTED 27/30] ada: Replace "All" argument to Extensions_Allowed pragma with "All_Extensions"

2024-06-20 Thread Marc Poulhiès
From: Steve Baird The argument to pragma Extensions_Allowed to enable all extensions is no longer "All", but instead "All_Extensions". gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Update documentation. * doc/gnat_rm/implementation_defined_pragmas.rst: Update

[COMMITTED 29/30] ada: Fix checking of SPARK RM on ghost with concurrent part

2024-06-20 Thread Marc Poulhiès
From: Yannick Moy SPARK RM 6.9(21) forbids a ghost type to have concurrent parts. This was not enforced, instead only the type itself was checked to be concurrent. Now fixed. gcc/ada/ * ghost.adb (Check_Ghost_Type): Fix checking. Tested on x86_64-pc-linux-gnu, committed on master.

[COMMITTED 26/30] ada: Crash on selected component of formal derived type in generic instance

2024-06-20 Thread Marc Poulhiès
From: Gary Dismukes The compiler crashes on an instantiation of a generic child unit G1.GC that has a formal private extension P_Ext of a private type P declared in the parent G1 whose full type has a component C, when analyzing a selected component ACC.C whose prefix is of an access type coming

[COMMITTED 15/30] ada: Remove redundant conditions from freezing code

2024-06-20 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ * freeze.adb (Check_Current_Instance): This routine is only called with parameter E being a type entity, so there is no need to check for types just before the equality with E. * sem_ch13.adb

[COMMITTED 25/30] ada: Fix inlining of fixed-lower-bound array for GNATprove

2024-06-20 Thread Marc Poulhiès
From: Yannick Moy Inlining in GNATprove may fail on a call to a subprogram with a formal of an array type with fixed lower bound (a GNAT extension), because the appropriate conversion is not used. Fix it. Also fix the function that inserts an unchecked conversion, in cases where it could skip

[COMMITTED 23/30] ada: Fix composition of primitive equality for untagged records with variant part

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou In Ada 2012, primitive equality operators of untagged record types compose like those of tagged record types, but this has never been implemented for untagged record types with a variant part. gcc/ada/ * exp_ch4.adb (Expand_Composite_Equality): In the untagged

[COMMITTED 30/30] ada: Reference to nonexistent operator in reduction expression accepted

2024-06-20 Thread Marc Poulhiès
From: Steve Baird In some cases, a reduction expression that references the (nonexistent) "+" operator of a generic formal private type is incorrectly accepted. gcc/ada/ * sem_attr.adb (Resolve_Attribute.Proper_Op): When resolving the name of the reducer subprogram in a

[COMMITTED 20/30] ada: Fix crash on real literal in declare expression of expression function

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the freeze node of the type to which the real literal is resolved is placed inside the expression function instead of outside. gcc/ada/ * freeze.adb (Freeze_Expression): Also attach pending freeze nodes to the parent in the case of an

[COMMITTED 18/30] ada: Update Bit Ordering references in GNAT Reference Manual

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou They are still tailored to Ada 95 while the level of recommended support for Bit Ordering was changed in Ada 2005. gcc/ada/ * doc/gnat_rm/implementation_advice.rst (Representation Clauses): Remove >> marker and add end of sentence after code-block directive.

[COMMITTED 13/30] ada: Remove Max_Entry_Queue_Depth pragma/aspect

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou It was implemented apparently because a very early version of AI12-0164 that standardizes GNAT's Max_Queue_Length opted for the subtly different moniker, but later versions of the AI use Max_Entry_Queue_Length instead. gcc/ada/ * aspects.ads (Aspect_Id): Remove

[COMMITTED 16/30] ada: Streamline propagation of controlled flags on types

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou The front-end maintains a set of 4 flags on (base) types that are used to parameterize the implementation of controlled operations, and these flags need to be propagated through composition and derivation. This is done on a per-flag basis in the current implementation with a

[COMMITTED 24/30] ada: Fix assertion failure during analysis of instantiation of formal package

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou It's an assertion on the name of an instance of a generic child unit and it needs to cope with a renaming of the unit. gcc/ada/ * sem_ch12.adb (Instantiate_Formal_Package): Accept renamings of a generic parent that is a child unit for the abbreviated

[COMMITTED 12/30] ada: Couple of minor fixes in GNAT Reference Manual

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou The Storage_Model pragma no longer exists. gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst (Pragma Storage_Model): Rename to Storage Model. * doc/gnat_rm/implementation_defined_aspects.rst: Alphabetize. * gnat_rm.texi: Regenerate.

[COMMITTED 09/30] ada: Fix minor issues in comments

2024-06-20 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * mutably_tagged.ads: Fix minor issues in comments throughout. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/mutably_tagged.ads | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git

[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

[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

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

[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

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

[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

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

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

[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

[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

[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

[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

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

[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

[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

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

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

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

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

[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

[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

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

[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

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

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

[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

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

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

[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

[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

[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

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

  1   2   3   4   5   6   7   8   9   10   >