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

[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

  1   2   3   4   5   6   7   8   9   10   >