[COMMITTED 37/38] ada: Remove special case for the size of a string literal subtype

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Apparently we no longer need to ignore string literal subtypes case when validating size of a type entity. Code cleanup; behavior appears to be unaffected. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Remove special case for string liter

[COMMITTED 30/38] ada: Avoid unused with warning with Extend_System

2024-11-04 Thread Marc Poulhiès
From: Viljar Indus When the Extend_System pragma is used then we are supposed to check the extended system for referenced entities. Otherwise we would get an incorrect unused with warning. This was previously done on body files but it should also be done specs as well. gcc/ada/ChangeLog:

[COMMITTED 34/38] ada: Improve Unbounded_Wide_String performance

2024-11-04 Thread Marc Poulhiès
From: Nicolas Roche Improve performance of iteration using Element function. Improve performance of Append. gcc/ada/ChangeLog: * libgnat/a-stwiun__shared.adb: Restructure code to inline only the most common cases. Remove whenever possible runtime checks. * libgnat/a-stwi

[COMMITTED 33/38] ada: Improve performance of Unbounded_Wide_Wide_String

2024-11-04 Thread Marc Poulhiès
From: Nicolas Roche Improve performance of iteration using Element function. Improve performance of Append. gcc/ada/ChangeLog: * libgnat/a-stzunb__shared.adb: Restructure code to inline only the most common cases. Remove whenever possible runtime checks. * libgnat/a-stzu

[COMMITTED 14/38] ada: Fix alignment of pthread_mutex_t

2024-11-04 Thread Marc Poulhiès
From: Daniel King On most targets the alignment of unsigned long is the same as pointer alignment, but on CHERI targets pointers have larger alignment (16 bytes compared to 8 bytes). pthread_mutex_t needs the same alignment as System.Address to account for CHERI targets. gcc/ada/ChangeLog:

[COMMITTED 21/38] ada: CheriBSD: add SIGPROT handler

2024-11-04 Thread Marc Poulhiès
From: Daniel King gcc/ada/ChangeLog: * libgnarl/s-intman__cheribsd.adb: Add SIGPROT to interrupt list. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnarl/s-intman__cheribsd.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/libgnarl/s

[COMMITTED 31/38] ada: Initial implementation of Extended_Access aspect (FE portion only)

2024-11-04 Thread Marc Poulhiès
From: Steve Baird The Extended_Access aspect can be specified to be True for certain access-to-unconstrained-array-subtype types. Such extended access types can designate objects that a normal general access type (with the same designated subtype) cannot, such as a slice of an aliased array objec

[COMMITTED 18/35] ada: Pragmas Pre_Class/Post_Class rejected for abstract subprograms

2024-10-25 Thread Marc Poulhiès
From: Javier Miranda The Pre_Class/Post_Class pragmas are rejected at compile time for abstract subprograms. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pre_Post_Condition): Allow the use of pragma Pre_Class/Post_Class with abstract subprograms. Tested on x86_64-pc-linux-gnu, co

[COMMITTED 05/35] ada: Fix fallout of change to 'Wide_Wide_Value for enumeration types

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou The literals of enumeration types are always normalized, even though they contain wide characters (but the normalization leaves these unchanged), so a normalization routine that is aware of wide characters must be run on the input string for 'Wide_Wide_Value. gcc/ada/ChangeLo

[COMMITTED 16/35] ada: Adjust documentation of External_Initialization

2024-10-25 Thread Marc Poulhiès
From: Ronan Desplanques The parameters Maximum_Size and If_Empty were mentioned during the request for comments phase but are not implemented, at least for now. This patch changes the GNAT reference manual accordingly. It also makes a minor punctuation change. gcc/ada/ChangeLog: * doc/g

[COMMITTED 10/35] ada: Constraint error not raised in ACATS test c413007

2024-10-25 Thread Marc Poulhiès
From: Javier Miranda The Constraint_Error exception is not raised when a subprogram is called using prefix notation, and the prefix of the call is an access-to-subprogram type with a null value. This new check is enabled by switch -gnatd_P gcc/ada/ChangeLog: * gen_il-fields.ads: New nod

[COMMITTED 30/35] ada: Add 'artificial_p' parameter to build_unc_object_type

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey This adds an 'artificial_p' parameter to build_unc_object_type, so that the artificiality of the type can be propagated to create_type_decl. This will affect the namelessness of the type in a subsequent patch. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_ent

[COMMITTED 20/35] ada: Fix ATC with timed delay from Ada.Real_Time

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou An Asynchronous Transfer of Control blocks with a timed delay that is computed by means of the Ada.Real_Time unit (instead of the default Ada.Calendar unit) because of a missing abort deferral in the unit. gcc/ada/ChangeLog: PR ada/43485 * libgnarl/a-retide.a

[COMMITTED 08/35] ada: Fix internal error on ambiguous operands of comparison operator

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou This is a regression introduced when the diagnosis of ambiguous operands for comparison and equality operators was moved from the analysis to the resolution phase in order to avoid spurious ambiguities in specific cases. When an ambiguity is detected for the operands of prede

[COMMITTED 14/35] ada: Add Type_Size_For function to Uintp package

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou It computes the size of an integer type that can accommodate the input. gcc/ada/ChangeLog: * uintp.ads (Type_Size_For): New function declaration. * uintp.adb (Type_Size_For): New function body. * exp_imgv.adb (Rewrite_Object_Image): Call Type_Size_For

[COMMITTED 13/35] ada: Update simpler accessibility model doc

2024-10-25 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: update simpler accessibility model * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_rm/gnat_language_exte

[COMMITTED 27/35] ada: Fix internal error on bit-packed array type with Volatile_Full_Access

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou The problem occurs when the component type is a record type with default values for the initialization procedure of the (base) array type, because the compiler is trying to generate a full access for a parameter of the base array type, which does not make sense. gcc/ada/Chang

[COMMITTED 24/35] ada: Emit DWARF for Ada 'with' and 'use' clauses

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey This changes the Ada compiler to emit DWARF information for Ada 'with' and 'use' clauses. In particular, code like: with Pck; use Pck; will be emitted as: <1><146a>: Abbrev Number: 23 (DW_TAG_module) <146b> DW_AT_name: pck <146f> DW_AT_decl_file : 1

[COMMITTED 34/35] ada: Set DECL_NAMELESS in create_type_decl

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey When using minimal encodings, most artificial types do not need to have their names emitted in the DWARF. This patch changes the compiler to generally omit these names. However, a subset of names are needed: when the compiler creates an artificial type for certain kinds of arra

[COMMITTED 11/35] ada: Increase stack size for Windows tasking programs

2024-10-25 Thread Marc Poulhiès
From: squirek This patch increases the default tasking stack size for Windows tasking program to 8 mb to avoid use of pragma Linker_Options in the general case. gcc/ada/ChangeLog: * libgnarl/s-taprop__mingw.adb: Modify stack size and update documentation. Tested on x86_64-pc-li

[COMMITTED 35/35] ada: Change scope of XUB type

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey An earlier patch in the "nameless" series caused a regression with -fgnat-encodings=all. Previously, all artificial types were emitted in the CU scope in the DWARF, but with the patch, an "XUB" type is emitted in the function scope. This causes gdb lookups to erroneously find t

[COMMITTED 23/35] ada: Small adjustments to commentary after latest change

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou This removes the enumeration of the various cases in the comment associated with the declaration of In_Expanded_Body to prevent synchronization issues. gcc/ada/ChangeLog: * freeze.adb (Freeze_Expression.In_Expanded_Body): Tweak comments. Tested on x86_64-pc-linux-gn

[COMMITTED 33/35] ada: Mark some type decls as nameless

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey The types created by record_builtin_type and create_type_stub_decl can be marked as nameless when using minimal encodings. In this situation, gdb does not need these type names. gcc/ada/ChangeLog: * gcc-interface/utils.cc (record_builtin_type, create_type_stub_decl):

[COMMITTED 28/35] ada: Fix fallout of change in parameter passing out of aliasing considerations

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou If an actual parameter that is a type conversion is passed by reference but not addressable, the temporary that is created and whose address is passed instead may need to be in the target type of the conversion to fulfill the requirements of strict aliasing. gcc/ada/ChangeLog

[COMMITTED 22/35] ada: Pragma Pre_Class and Post_Class have no effect at runtime

2024-10-25 Thread Marc Poulhiès
From: Javier Miranda The pragmas Pre_Class and Post_Class are accepted by the compiler but have no effect at runtime. gcc/ada/ChangeLog: * freeze.adb (Freeze_Entity): If the entity is an access-to-subprogram type declaration that pre/postcondition contracts, build the wr

[COMMITTED 29/35] ada: Standard types are not artificial

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey This changes gigi so that standard types are no longer marked artificial. This change is needed to prevent subsequent patches from causing standard types to have their names elided. Also, although DWARF says that DW_AT_artificial is used for "the declaration of an object or typ

[COMMITTED 19/35] ada: Fix internal error on function call in class-wide precondition

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou This occurs when the call is to a function that is declared in a package that is nested in the scope where the type declaration is located. gcc/ada/ChangeLog: * freeze.adb (Freeze_Expression.In_Expanded_Body): Also return True for the body of a helper/wrapper

[COMMITTED 32/35] ada: Mark XUA types as artificial

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey gdb does not need the name of XUA types. This patch changes the compiler to unconditionally mark these as artificial; a subsequent patch will arrange for the name to be omitted. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Pass 'true' to cre

Re: [PATCHv2 0/3] ada: Add GNU/Hurd x86_64 support

2024-11-12 Thread Marc Poulhiès
Samuel Thibault writes: > Hello, > > Marc Poulhiès, le lun. 04 nov. 2024 16:28:43 +0100, a ecrit: >> Samuel Thibault writes: >> >> > I reworked the patch to factorize the bsd signal definitions. >> > I have split off the system definitions because

[COMMITTED 25/35] ada: Disable self-referential with_clauses

2024-10-25 Thread Marc Poulhiès
From: Bob Duff Self-referential with_clauses (as in package body X says "with X;") cause trouble, such as duplicate nested instantiations when using container packages. This patch disables most of the processing by setting the Is_Implicit_With flag. It's not really implicit, but the subsequent pr

[COMMITTED 31/35] ada: Mark XUB types as nameless

2024-10-25 Thread Marc Poulhiès
From: Tom Tromey gdb does not need the name of XUB types. This patch changes the compiler to omit these names from the DWARF when minimal encodings are in use. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Set TYPE_NAMELESS on XUB types. Tested on x86_64-pc-

Re: [PATCH] ada: Add GNU/Hurd x86_64 support

2024-10-31 Thread Marc Poulhiès
Samuel Thibault writes: Hello Samuel, > This is essentially the same as the i386-pc-gnu section, the differences > are the same as between freebsd i386 and freebsd x86_64. Changes look fine. > +# x86_64-pc-gnu i.e. GNU Hurd > +ifeq ($(strip $(filter-out x86_64 pc gnu,$(target_cpu) $(target_os)

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2024-10-31 Thread Marc Poulhiès
>> >> Would it be possible to drop it altogether and use s-osprim__posix.adb >> instead? >> Otherwise what's the remaining difference between >> s-osprim__posix.adb and s-osprim__rtems.adb? The difference should >> help us find a proper name based on properties of the file. > > At first view, it s

[COMMITTED 21/30] ada: Remove obsolete ??? comment about Assignment_OK flag

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The flagged use has apparently disappeared for long. gcc/ada/ChangeLog: * sinfo.ads (Assignment_OK): Remove obsolete ??? comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sinfo.ads | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[COMMITTED 28/30] ada: Accept SPARK.Big_Integers.Big_Integer where Big_Integer is accepted

2024-11-12 Thread Marc Poulhiès
From: Piotr Trojanek For certification of a light SPARK runtime libraries we now accept expressions of type SPARK.Big_Integers.Big_Integer in subprogram and loop variants. gcc/ada/ChangeLog: * exp_util.adb (Make_Variant_Comparison): Accept new types in expansion. * rtsfi

[COMMITTED 15/30] ada: Spurious error on abstract primitive with access formals

2024-11-12 Thread Marc Poulhiès
From: squirek This patch fixes an issue in the compiler whereby using anonymous access types as abstract overridden subprogram formals for a derived abtract type may lead to compile-time errors. gcc/ada/ChangeLog: * accessibility.adb (Type_Access_Level): Add handling for subprog

[COMMITTED 27/30] ada: Make Interrupt and Attach Handlers Obsolescent in VXWorks

2024-11-12 Thread Marc Poulhiès
From: Viljar Indus In order to trigger an obsolescent feature warning in VXWorks if either the pragma or aspect of Interrupt_Handler or Attach_Handler is used, the spec of the Register_Interrupt_Handler method needs to be marked as obsolescent in a VXWorks specific version of the file. gcc/ada/C

[COMMITTED 19/30] ada: Improve message for misused implicitly-defined preprocessor symbol.

2024-11-12 Thread Marc Poulhiès
From: Steve Baird If the -u option is specified, then otherwise-undefined preprocessor symbols are implicitly defined to be False. If such an implicitly-defined symbol is then incorrectly used in a context that requires an integer value, the resulting error message should not incorrectly state th

[COMMITTED 02/10] ada: Fix assertion failure on illegal use of aspect Type_Invariant

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The illegal use is on a type derived from a formal private type, e.g.: generic type T is private; package G is type D is new T with Type_Invariant => True; end G; gcc/ada/ChangeLog: PR ada/113037 * sem_prag.adb (Analyze_Pragma) : Reject types

[COMMITTED 06/30] ada: Add Ada coverage instrumentation support

2024-11-12 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * gnat2.gpr: New file. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gnat2.gpr | 54 +++ 1 file changed, 54 insertions(+) create mode 100644 gcc/ada/gnat2.gpr diff --git a/gcc/ad

[COMMITTED 12/30] ada: Fix internal error on nested iterated component associations

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The problem is that Insert_Actions gets confused as to where it should insert actions coming from within an N_Iterated_Component_Association, because some actions may be generated during semantic analysis and some others during expansion. Instead of another ad-hoc fix, this c

[COMMITTED 26/30] ada: Fix bogus error for delta aggregate as expression function

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The compiler correctly accepts the other forms of aggregates. gcc/ada/ChangeLog: PR ada/113868 * par-ch6.adb (P_Subprogram) : Add delta aggregate alongside the other forms of aggregates. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/a

[COMMITTED 14/30] ada: Missing runtime tag check on mutably tagged objects

2024-11-12 Thread Marc Poulhiès
From: squirek This patch fixes an issue in the compiler whereby assigning to a non-existant mutably tagged object component failed to result in the expected run-time exception. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_N_Type_Conversion): Add special runtime check generation for

[COMMITTED 09/10] ada: Compile time crash on limited object in extended return

2024-11-12 Thread Marc Poulhiès
From: squirek This patch fixes an error in the compiler whereby using an extended return on an object of limited tagged type which extends a tagged protected type may lead to a compile-time crash. gcc/ada/ChangeLog: * exp_ch3.adb (Build_Assignment): Add condition to fetch corresponding

[COMMITTED 17/30] ada: Set correct minimum stack size for aarch64-linux

2024-11-12 Thread Marc Poulhiès
From: Johannes Kliemann The minimum stack size defined by PTHREAD_STACK_MIN defined on AArch64 Linux is 131072 bytes. Add a separate version for this target to reflect that value. Previously the x86-64 value of 16384 bytes was used. gcc/ada/ChangeLog: * Makefile.rtl: Use libgnat/s-param

[COMMITTED 29/30] ada: Fix premature finalization of anonymous access result from library function

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou In GNAT's implementation, the finalization of controlled objects created through anonymous access types occurs when the enclosing library unit goes out of scope if this is safe, and never occurs otherwise. The case of a function that is a library unit with an anonymous access

[COMMITTED 25/30] ada: Remove couple of irregular calls to Resolve_Aggr_Expr

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The function is supposed to be passed an expression, but it is passed the enclosing N_Component_Association node in a couple of cases, only to give an error that can as well be given in the caller, at the cost of bypasses to disable most of its processing. gcc/ada/ChangeLog:

[COMMITTED 23/30] ada: Fix markup typos

2024-11-12 Thread Marc Poulhiès
From: Richard Kenner gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix minor markup errors. * doc/gnat_ugn/gnat_utility_programs.rst: Likewise. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 20/30] ada: Get rid of Kill_Range_Checks flag on entities

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This flag is set in a single context, namely semantic analysis of record type definitions, to avoid generating spurious range checks from it, and a large testing campaign showed that, in practice, it makes a difference in a single case, namely an access-to-constrained-array co

[COMMITTED 03/10] ada: Fix internal error on invalid prefix with assertions enabled

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This happens for example with: package Q3 is type Types is (One, Two); end Q3; with Q3; package P3 is Kind : Q3.Types := Q3.Types.One; end P3; and prevents the error from being given. gcc/ada/ChangeLog: PR ada/112979 * sem_ch8.adb (Find_Selected_Compo

[COMMITTED 24/30] ada: Allow file mapping for System's spec

2024-11-12 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, it was never allowed to use pragma Source_File_Name for the spec of System, allegedly because Targparm.Get_Target_Parameters is called before configuration pragmas are processed. Using a mapping file was allowed but did not work correctly. This patch ma

[COMMITTED 04/10] ada: Get rid of N_Unchecked_Expression node

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This node is used in a single place in the front-end: it wraps the newly built N_Indexed_Component nodes on the left-hand side of assignments generated to elaborate array aggregates, and its effect is to disable range checks for the expressions of these nodes. Most of the cod

[COMMITTED 08/10] ada: Fix spurious error on iterated component association with large index type

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This is only for the Ada 2022 form of the iterated component association. gcc/ada/ChangeLog: * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Use a type sized from the index type to compute the length. Simplify and remove useless calls to New_Copy_Tree

[COMMITTED 10/10] ada: Typo fix in comment

2024-11-12 Thread Marc Poulhiès
gcc/ada/ChangeLog: * gcc-interface/Makefile.in: Remove extra 'with'. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/M

[COMMITTED 10/30] ada: Fix compilation failure due to style warning

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ChangeLog: * mdll.adb (Build_Dynamic_Library): Fix indentation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/mdll.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/mdll.adb b/gcc/ada/mdll.adb index 745854304f

[COMMITTED 16/30] ada: Detect sharing of external file in inconsistent read-write modes

2024-11-12 Thread Marc Poulhiès
From: Piotr Trojanek When opening files with "shared=yes", as described in GNAT RM 11.10, Sharing Files, we now prevent sharing a single file in inconsistent read-write modes. gcc/ada/ChangeLog: * doc/gnat_rm/the_implementation_of_standard_i_o.rst (Shared Files): Add trailing pe

[COMMITTED 08/30] ada: The Library_Unit field was used for all sorts of different purposes, which led to confusing code.

2024-11-12 Thread Marc Poulhiès
From: squirek This patch further refines the previous work to fix several cases. gcc/ada/ChangeLog: * inline.adb (In_Main_Unit_Or_Subunit): Use Other_Comp_Unit instead of Spec_Or_Body_Lib_Unit. (Must_Inline): Use Other_Comp_Unit instead of Spec_Or_Body_Lib_Unit. Tested

[COMMITTED 13/30] ada: GNAT Calendar Support for 64-bit Unix Time

2024-11-12 Thread Marc Poulhiès
From: Douglas B Rupp The Epochalypse of 2038 will require the use of 64-bit time_t and tv_sec (aka time in seconds from the Unix Epoch). The subprograms in Ada calendar are self contained but nevertheless will malfunction if a 64-bit integer type and calculations aren't used. Add 64-bit versions

[COMMITTED 05/10] ada: Fix assertion failure on null aggregate in generic with pragma Ada_2022

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This happens when the unit is instantiated in a non-Ada 2022 unit. gcc/ada/ChangeLog: PR ada/114127 * sem_aggr.adb (Is_Null_Aggregate): Replace test on Ada_Version with test on Nkind. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/

[COMMITTED 30/30] ada: Fix internal error on instantiation of package with a nested ghost package

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The instantiation triggers an internal error in Gigi because of a dangling ghost entity created by the finalization machinery. gcc/ada/ChangeLog: PR ada/114300 * exp_ch7.adb (Attach_Object_To_Master_Node): Propagate the Is_Ignored_Ghost_Entity flag fr

[COMMITTED 01/30] ada: add xspack.py and corresponding templates.

2024-11-12 Thread Marc Poulhiès
xspack.py is used to generate libgnat/s-pack* files. gcc/ada/ChangeLog: * xspack.py: New * s-pack.ads.tmpl: New. * s-pack.adb.tmpl: New. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/s-pack.adb.tmpl | 254 gcc/a

[COMMITTED 05/30] ada: Implement built-in-place expansion of container aggregates

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou It is implemented for container aggregates that are used to initialize an object, as specified by RM 7.6(17.2/3-17.3/3) for immutably limited types and types that need finalization, but for all types like other aggregates. gcc/ada/ChangeLog: * exp_aggr.adb (Expand_De

[COMMITTED 02/30] ada: Fix weird error in Ada.Numerics.Discrete_Random with Component_Alignment

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The problem arises when an instance of Ada.Numerics.Discrete_Random is covered by a pragma Component_Alignment with a non-default alignment. gcc/ada/ChangeLog: * exp_ch5.adb (Expand_Assign_Array): Make Act_Rhs a constant and do not recompute it, as well as R_

[COMMITTED 04/30] ada: Remove obsolete workaround for back-end limitation

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This avoids a strange discrepancy in the handling of constants vs variables. gcc/ada/ChangeLog: * sem_aux.ads (Has_Unconstrained_Elements): Delete. * sem_aux.adb (Has_Unconstrained_Elements): Likewise. * sem_ch3.adb (Analyze_Object_Declaration): Remov

[COMMITTED 09/30] ada: Rework GNATdll shared library relocation support.

2024-11-12 Thread Marc Poulhiès
From: Pascal Obry The code has been simplified to use a single way to create a DLL. The relocation support is based on whether the base address for the DLL is passed to the final linker step or not. gcc/ada/ChangeLog: * mdll.adb: Use the same procedure to create relocatable or non

[COMMITTED 03/30] ada: sem.adb.process_bodies_in_context: check if spec has lib body before use

2024-11-12 Thread Marc Poulhiès
From: Ghjuvan Lacambre Inspector testing shows that calling Body_Lib_Unit on Spec can sometimes fail due to the following assertion failing: pragma Assert (Unit (N) in N_Lib_Unit_Declaration_Id | N_Lib_Unit_Renaming_Declaration_Id); Indeed, Unit (N) may

[COMMITTED 07/30] ada: Elide the copy in aggregate returns for nonlimited types

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This implements elision of the copy operation for aggregate returns, i.e. simple return statements whose expression is an aggregate, in the case of nonlimited by-reference types (the copy operation is already elided for limited types), which comprise controlled and tagged type

[COMMITTED 01/10] ada: Fix unexpected Program_Error raised in the parser on mismatched []

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This happens for example with: A : constant array (Natural range <>) of String := [ "xor" [; The problem is that the left bracket token is incorrectly classified as a name extension, but there is no handler in the Scan_Name_Extension_OK part of P_Name in Par.Ch4. gcc/ada/

[COMMITTED 18/30] ada: Flatten Is_Build_In_Place_Aggregate_Return predicate

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The predicate is passed an aggregate node and goes up its parent chain, but that's unnecessary because Convert_To_Assignments has already done so in the case of a record aggregate and Expand_Array_Aggregate does not fully support intermediate conditional expressions yet. gcc/

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2024-09-19 Thread Marc Poulhiès
Marc Poulhiès writes: > Nicolas Boulenguez writes: > >> PR ada/114065 >> >> Hello. >> Any news about these patches? > > Hello, > > Sorry about the delay. Arnaud already replied on BZ, but I'll add a few > remarks. Also, I forgot to men

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2024-09-19 Thread Marc Poulhiès
Nicolas Boulenguez writes: > PR ada/114065 > > Hello. > Any news about these patches? Hello, Sorry about the delay. Arnaud already replied on BZ, but I'll add a few remarks. In 0001-Ada-merge-all-timeval-and-timespec-definitions-and-c.patch: > - -- C timeval represent a duration (used in S

[COMMITTED 26/35] ada: Back out part of previous change -- disable warning

2024-10-25 Thread Marc Poulhiès
From: Bob Duff Temporarily disable the warning, because it breaks SPARK continuous builder gcc/ada/ChangeLog: * sem_ch10.adb (Analyze_With_Clause): Temporarily disable warning. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch10.adb | 3 ++- 1 file changed, 2 ins

[COMMITTED 07/35] ada: Spurious error compiling CC51011

2024-10-25 Thread Marc Poulhiès
From: Javier Miranda Adjust the check of 13.14(10.2/3) to avoid reporting an error on unfrozen incomplete types, as they are never frozen (AI12-0155-1). gcc/ada/ChangeLog: * sem_ch8.adb (Freeze_Actual_Profile): Do not report error on incomplete types, since they do not cause fre

[COMMITTED 02/35] ada: Inspect deferred constant completions in missing contexts

2024-10-25 Thread Marc Poulhiès
From: Raphaël AMIARD Namely declare expressions and statement lists, which can have object declarations in -gnatX mode. gcc/ada/ChangeLog: * sem_util.ads: Introduce Inspect_Deferred_Constant_Completion on a single object declaration, to better factorize the code * sem_ut

[COMMITTED 04/35] ada: Untagged incomplete view not detected in ACATS test b3a1a060

2024-10-25 Thread Marc Poulhiès
From: Javier Miranda Adding checks for RM 3.10.1(10): An actual parameter cannot be of an untagged incomplete view; the result object of a function call cannot be of an incomplete view. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Actuals): Add checks for incomplete type actuals.

[COMMITTED 06/35] ada: Fix wrong handling of wide wide characters in Append_Decoded_With_Brackets

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou This only shows up at link time when the name of a compilation unit contains a wide wide character. gcc/ada/ChangeLog: * namet.adb (Append_Decoded_With_Brackets): Fix condition for the cheap test at the beginning of the loop. Tested on x86_64-pc-linux-gnu, c

[COMMITTED 12/35] ada: Misc improvements to gnat RM

2024-10-25 Thread Marc Poulhiès
From: Bob Duff ...in the "GNAT language extensions" section. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Minor wording improvments. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. -

[COMMITTED 01/35] ada: Pass parameters of full access unconstrained array types by copy in calls

2024-10-25 Thread Marc Poulhiès
From: Eric Botcazou When a full access array type is declared, either Volatile_Full_Access in Ada 2012 or Atomic in Ada 2022, an implicit base array type is built by the compiler with the Full_Access flag set, although full accesses cannot be generated for objects of this type because the size is

[COMMITTED 15/35] ada: Update Compiler_Error documentation

2024-10-25 Thread Marc Poulhiès
From: Richard Kenner Since we usually build without assertions, we force a bugbox by raising Program_Error, not an always-false assertion. gcc/ada/ChangeLog: * comperr.ads (Compiler_Error): Update documentation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/comperr.

[COMMITTED 03/35] ada: Forbid repr clauses for decls in handled_stmts

2024-10-25 Thread Marc Poulhiès
From: Raphaël AMIARD gcc/ada/ChangeLog: * par-ch5.adb (P_Sequence_Of_Statements): Forbid repr clauses in handled_statements. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch5.adb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ad

[COMMITTED 17/35] ada: Spurious error when compiling in Syntax and Semantics Only mode

2024-10-25 Thread Marc Poulhiès
From: Javier Miranda Compiling under switch -gnatc, the frontend reports spurious errors accessing components of class-wide tagged types. gcc/ada/ChangeLog: * sem_ch3.adb (Record_Type_Definition): For tagged types, add the missing decoration to the First_Entity in the correspond

[COMMITTED 09/35] ada: Put Finalizable aspect in -gnatX

2024-10-25 Thread Marc Poulhiès
From: Raphaël AMIARD gcc/ada/ChangeLog: * sem_ch13.adb (Analyze_One_Aspect): change the call to `Error_Msg_GNAT_Extension` to allow this aspect in core extensions. Put the code path in core extensions. * exp_util.adb (Name_Of_Controlled_Prim_Op): Put the code path

Re: [PATCHv2 2/3] ada: Fix GNU/Hurd priority range

2024-11-07 Thread Marc Poulhiès
Samuel Thibault writes: > GNU/Mach currently uses a 0..63 range. > > gcc/ada/ChangeLog: > > * libgnat/system-gnu.ads: New file. > * Makefile.rtl (x86-gnuhurd): Use libgnat/system-gnu.ads instead of > libgnat/system-freebsd.ads. > > Signed-off-by: Samuel Thibault > --- OK witho

Re: [PATCHv2 3/3] ada: Add GNU/Hurd x86_64 support

2024-11-07 Thread Marc Poulhiès
Samuel Thibault writes: > This is essentially the same as the i386-pc-gnu section, the differences > are the same as between freebsd i386 and freebsd x86_64. > > gcc/ada/ChangeLog: > > * Makefile.rtl: Add x86_64-pc-gnu section. > > Signed-off-by: Samuel Thibault OK without the ChangeLog

Re: [PATCHv2 1/3] ada: Factorize bsd signal definitions

2024-11-07 Thread Marc Poulhiès
Samuel Thibault writes: > They are all the same on all BSD-like systems (including GNU/Hurd). > > gcc/ada/ChangeLog: > > * libgnarl/a-intnam__freebsd.ads: Rename to... > * libgnarl/a-intnam__bsd.ads: ... new file. > * libgnarl/a-intnam__dragonfly.ads: Remove file. > * Make

[COMMITTED 01/14] ada: Tweak test for predefined main unit

2024-11-18 Thread Marc Poulhiès
From: Ronan Desplanques This change is part of an effort to reduce usage of Is_Predefined_Filename. gcc/ada/ChangeLog: * frontend.adb (Frontend): tweak test for predefined main unit. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/frontend.adb | 4 +--- 1 file changed

[COMMITTED 10/14] ada: Fix another minor fallout of previous changes to aggregate expansion

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou The processing of static array aggregates in Exp_Aggr requires that their bounds be representable as Int(eger) values for practical purposes, and the previous changes have exposed another path where this is not checked. This introduces a UI_Are_In_Int_Range local predicate fo

[COMMITTED 02/14] ada: Crash on 'Access for Stream_Element_Array object

2024-11-18 Thread Marc Poulhiès
From: squirek This patch fixes a crash in the compiler when the actual for an anonymous access type formal is an 'Access of a Sream_Element_Array object during the calculation of said actual's accessibility level. gcc/ada/ChangeLog: * accessibility.adb (Accessibility_Level): Handle the

[COMMITTED 05/14] ada: Further cleanup in expansion of array aggregates in allocators

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou This mainly decouples the handling of the allocator case from that of the assignment case in Expand_Array_Aggregate and also makes Must_Slide a bit more forgiving. gcc/ada/ChangeLog: * exp_aggr.adb (In_Place_Assign_OK): Remove handling of allocators and call

[COMMITTED 03/14] ada: Constraint error not raised in ACATS test c413007

2024-11-18 Thread Marc Poulhiès
From: Javier Miranda Reverse the meaning of switch -gnatd_P; that is, enable by default the generating of a runtime check when the prefix of the call is an access-to-subprogram type with a null value. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Actuals): Add by default a null-exclusion

[COMMITTED 06/14] ada: Cleanup in expansion of array aggregates in object declarations

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou This mainly decouples the handling of the declaration case from that of the assignment case in Expand_Array_Aggregate, as well as moves the expansion in the case of an aggregate that can be processed by the back end to the Build_Array_Aggr_Code routine. gcc/ada/ChangeLog:

[COMMITTED 09/14] ada: Fix minor fallout of previous changes to aggregate expansion

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou The problem occurs for an anonymous array object declared with an aspect and when pragma {Initialize,Normalize}_Scalars is in effect: in this case, the synthesized aggregate is attached to the Initialization_Statements field by Convert_Aggr_In_Object_Decl, but Explode_Initiali

[COMMITTED 14/14] ada: Fix interaction of aspect Predicate and static case expressions

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou The semantics of the GNAT-specific Predicate aspect should be equivalent to those of the Static_Predicate aspect when the predicate expression is static, but that is not correctly implemented for static case expressions. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_N_Cas

[COMMITTED 07/14] ada: Array aggregate with large static bounds causes compiler crash

2024-11-18 Thread Marc Poulhiès
From: Steve Baird In some cases an array aggregate with statically known bounds and at least one bound outside of the range of a 32-bit signed integer causes a bugbox. gcc/ada/ChangeLog: * exp_aggr.adb (Convert_To_Positional.Flatten): Avoid raising Constraint_Error in UI_To_Int

[COMMITTED 12/14] ada: Fix small oversight in removal of N_Unchecked_Expression node

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou In addition to Resolve_Indexed_Component, Eval_Indexed_Component can also set the Do_Range_Check flag on the expressions of an N_Indexed_Component node through the call on Check_Non_Static_Context, so this also needs to be blocked by the Kill_Range_Check flag. gcc/ada/ChangeL

[COMMITTED 11/14] ada: Fix another minor fallout of previous changes to aggregate expansion

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou This is another glitch associated with Initialization_Statements. gcc/ada/ChangeLog: * exp_util.adb (Remove_Init_Call): Rewrite a compound statement in the Initialization_Statements of the variable as a null statement instead of removing it. *

[COMMITTED 13/14] ada: Atomic_Synchronization is not a user-visible check

2024-11-18 Thread Marc Poulhiès
From: Bob Duff Remove all user-level documentation of the check name "Atomic_Synchronization". The documentation was confusing because this check should never be used in source code, and because it raises the question of whether All_Checks applies to it (it does not). Change the name Atomic_Sync

[COMMITTED 08/14] ada: Small cleanup and refactoring in expansion of asynchronous select

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou The exception handler that catches Abort_Signal does nothing nowadays. This refactors the code to use Build_Abort_Block more consistently and also makes it simpler by dropping the identifier on the abort block. No functional changes. gcc/ada/ChangeLog: * exp_sel.ads

[COMMITTED 3/3] ada: Rename Within_Case_Or_If_Expression predicate

2024-11-19 Thread Marc Poulhiès
From: Eric Botcazou The case and if expressions are exactly the conditional expressions. gcc/ada/ChangeLog: * exp_util.ads (Within_Case_Or_If_Expression): Rename into... (Within_Conditional_Expression): ...this. * exp_util.adb (Within_Case_Or_If_Expression): Rename into.

[COMMITTED 2/3] ada: Small fix in expansion of array aggregates handled by the back end

2024-11-19 Thread Marc Poulhiès
From: Eric Botcazou The (minimal) expansion is now done by Build_Array_Aggr_Code in all cases, which means that it must prevent the aggregate from being re-analyzed as the RHS of the assignment, which may trigger a bogus warning and lead to another useless rewriting. The change also inlines Buil

<    4   5   6   7   8   9   10   11   12   13   >