[COMMITTED] ada: Update of SPARK RM legality rules on ghost code

2024-05-14 Thread Marc Poulhiès
From: Yannick Moy Update checking of ghost code after a small change in SPARK RM rules 6.9(15) and 6.9(20), so that the Ghost assertion policy that matters when checking the validity of a reference to a ghost entity in an assertion expression is the Ghost assertion policy at the point of declarat

[COMMITTED 1/9] ada: Remove repeated guards in validity checks

2024-09-02 Thread Marc Poulhiès
From: Piotr Trojanek Routine Insert_Valid_Check only applies checks when Expr_Known_Valid query returns False; there is no need to call this query before inserting checks. Code cleanup; behavior is unaffected. gcc/ada/ * exp_imgv.adb (Expand_User_Defined_Enumeration_Image) (Exp

[COMMITTED 2/9] ada: Cleanup expansion of object declarations

2024-09-02 Thread Marc Poulhiès
From: Piotr Trojanek Replace repeated calls to Sloc with uses of local constant Loc. Code cleanup; behavior is unaffected. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Replace calls to Sloc with uses of Loc; turn variable Prag into constant. Tested on x86_64-pc-linux-

[COMMITTED 6/9] ada: Fix minor issues in -gnaty0's documentation

2024-09-02 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the documentation of -gnaty0 used 0-based indexing for column numbers while 1-based indexing is used everywhere else. This patch makes this documentation use 1-based indexing, and also adds a missing parenthesis. gcc/ada/ * doc/gnat_ugn/buildin

[COMMITTED 8/9] ada: Create usage entry for -gnatw_l

2024-09-02 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: update documentation for the -gnatw_l switch. * usage.adb: Add -gnatw_l entry. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_u

[COMMITTED 9/9] ada: Diagnose too large size clause on floating-point type

2024-09-02 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the size clause changes the floating-point format used for the type, but it must not when this format is the widest format that is supported in hardware on the target. Instead a padding type must be built and the associated warning given. gcc/ada/

[COMMITTED 3/9] ada: Also reset scope for some nested declaration

2024-09-02 Thread Marc Poulhiès
When changing the scope for entities found in the entry body that is mutated into a procedure, the compiler needs to look deeper than only the top level entities as expansion may produce object declarations which scopes are also the entry. For example, the tree after expansion may look like: pro

[COMMITTED 7/9] ada: Fix standard output stream for gnatcmd output

2024-09-02 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the gnat command sent to standard error pieces of information that are a better match for standard output. This patch makes this information go to standard output. gcc/ada/ * gnatcmd.adb (GNATCmd): Fix standard output stream. Tested on x86_64-

[COMMITTED 5/9] ada: Documentation for generic type inference

2024-09-02 Thread Marc Poulhiès
From: Bob Duff ...plus minor improvements to existing documentation. gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: I assume "extended set of extensions" was a typo for "experimental set of extensions", because "extended extensions" is repetitive and redundant. "in

[COMMITTED 4/9] ada: Small fixes for FreeBSD

2024-09-02 Thread Marc Poulhiès
From: Patrick Bernardi Size of pthread data types now need to be defined for FreeBSD ports. Traceback support for AArch64 FreeBSD is now defined. gcc/ada/ * s-oscons-tmplt.c: Define sizes of pthread data types on FreeBSD. * tracebak.c: Use GCC unwinder and adjust PC appropriatel

[COMMITTED 01/10] ada: Fix Finalize_Storage_Only bug in b-i-p calls

2024-09-03 Thread Marc Poulhiès
From: Bob Duff Do not pass null for the Collection parameter when Finalize_Storage_Only is in effect. If the collection is null in that case, we will blow up later when we deallocate the object. gcc/ada/ * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Remove Finali

[COMMITTED 02/10] ada: Reject illegal array aggregates as per AI22-0106.

2024-09-03 Thread Marc Poulhiès
From: Steve Baird Implement the new legality rules of AI22-0106 which (as discussed in the AI) are needed to disallow constructs whose semantics would otherwise be poorly defined. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Implement the two new legality rules of AI11-010

[COMMITTED 03/10] ada: Do not warn for partial access to Atomic Volatile_Full_Access objects

2024-09-03 Thread Marc Poulhiès
From: Eric Botcazou The initial implementation of the GNAT aspect/pragma Volatile_Full_Access made it incompatible with Atomic, because it was not decided whether the read-modify-write sequences generated by Volatile_Full_Access would need to be implemented atomically when Atomic was also specifi

[COMMITTED 04/10] ada: Transform Length attribute references for non-Strict overflow mode.

2024-09-03 Thread Marc Poulhiès
From: Steve Baird The non-strict overflow checking code does a better job of eliminating overflow checks if given an expression consisting only of predefined operators (including relationals), literals, identifiers, and conditional expressions. If it is both feasible and useful, rewrite a Length

[COMMITTED 08/10] ada: Fix internal error with Atomic Volatile_Full_Access object

2024-09-03 Thread Marc Poulhiès
From: Eric Botcazou The initial implementation of the GNAT aspect/pragma Volatile_Full_Access made it incompatible with Atomic, because it was not decided whether the read-modify-write sequences generated by Volatile_Full_Access would need to be implemented atomically when Atomic was also specifi

[COMMITTED 10/10] ada: Add kludge for quirk of ancient 32-bit ABIs to previous change

2024-09-03 Thread Marc Poulhiès
From: Eric Botcazou Some ancient 32-bit ABIs, most notably that of x86/Linux, misalign double scalars in record types, so comparing DECL_ALIGN with TYPE_ALIGN directly may give the wrong answer for them. gcc/ada/ * gcc-interface/trans.cc (addressable_p) : Add kludge to cope with

[COMMITTED 05/10] ada: Simplify Note_Uplevel_Bound procedure

2024-09-03 Thread Marc Poulhiès
The procedure Note_Uplevel_Bound was implemented as a custom expression tree walk. This change replaces this custom tree traversal by a more idiomatic use of Traverse_Proc. gcc/ada/ * exp_unst.adb (Check_Static_Type::Note_Uplevel_Bound): Refactor to use the generic Traverse_Proc.

[COMMITTED 07/10] ada: Pass unaligned record components by copy in calls on all platforms

2024-09-03 Thread Marc Poulhiès
From: Eric Botcazou This has historically been done only on platforms requiring the strict alignment of memory references, but this can arguably be considered as being mandated by the language on all of them. gcc/ada/ * gcc-interface/trans.cc (addressable_p) : Take into account

[COMMITTED 06/10] ada: Fix internal error on pragma pack with discriminated record component

2024-09-03 Thread Marc Poulhiès
From: Eric Botcazou When updating the size after making a packable type in gnat_to_gnu_field, we fail to clear it again when it is not constant. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_field): Clear again gnu_size after updating it if it is not constant. Tested on x86_64-

[COMMITTED 09/10] ada: Plug loophole exposed by previous change

2024-09-03 Thread Marc Poulhiès
From: Eric Botcazou The change causes more temporaries to be created at call sites for unaligned actual parameters, thus revealing that the machinery does not properly deal with unconstrained nominal subtypes for them. gcc/ada/ * gcc-interface/trans.cc (create_temporary): Deal with type

[COMMITTED 1/6] ada: Tweak assertions in Inline.Cannot_Inline

2024-09-05 Thread Marc Poulhiès
From: Ronan Desplanques The purpose of this patch is to silence a GNATSAS report. gcc/ada/ * inline.adb (Cannot_Inline): Remove assertion. * inline.ads (Cannot_Inline): Add precondition. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/inline.adb | 2 -- gcc/ad

[COMMITTED 5/6] ada: Streamline handling of low-level peculiarities of record field layout

2024-09-05 Thread Marc Poulhiès
From: Eric Botcazou This factors out the interface to the low-level field layout machinery. gcc/ada/ * gcc-interface/gigi.h (default_field_alignment): New function. * gcc-interface/misc.cc: Include tm_p header file. (default_field_alignment): New function. * gcc-

[COMMITTED 2/6] ada: Binder respects Ada version for checksum of runtime files

2024-09-05 Thread Marc Poulhiès
From: Jose Ruiz The parsing to compute the checksums of runtime files (within the binder) was done using the default Ada version (Ada 2012 currently), while the creation of the checksum, when the runtime files are compiled, is performed in a more recent Ada version (Ada 2022 currently). This chan

[COMMITTED 4/6] ada: Remove unused parameters in validity checking routine

2024-09-05 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_util.ads, exp_util.adb (Duplicate_Subexpr_No_Checks): Remove parameters, which are no longer used. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 18 ++

[COMMITTED 6/6] ada: Add bypass for internal fields on strict-alignment platforms

2024-09-05 Thread Marc Poulhiès
From: Eric Botcazou This is required to support misalignment of tagged types in legacy code. gcc/ada/ * gcc-interface/trans.cc (addressable_p) : Add bypass for internal fields on strict-alignment platforms. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-i

[COMMITTED 1/7] ada: Whitespace cleanup in declaration of calendar-related routines

2024-09-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ * libgnat/s-os_lib.ads: Remove extra whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-os_lib.ads | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/libgnat/s-os_lib.

[COMMITTED 3/7] ada: Evaluate calls to GNAT.Source_Info routines in semantic checking

2024-09-10 Thread Marc Poulhiès
From: Piotr Trojanek When semantic checking mode is active, i.e. when switch -gnatc is present or when the frontend is operating in the GNATprove mode, we now rewrite calls to GNAT.Source_Info routines in evaluation and not expansion (which is disabled in these modes). This is needed to recogniz

[COMMITTED 7/7] ada: Include missing associated header file

2024-09-10 Thread Marc Poulhiès
From: Eric Botcazou memmodel.h must be included alongside tm_p.h for the sake of the SPARC port. gcc/ada/ * gcc-interface/misc.cc: Include memmodel.h before tm_p.h. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/misc.cc | 1 + 1 file changed, 1 insertio

[COMMITTED 2/7] ada: Simplify code for inserting checks into expressions

2024-09-10 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * checks.adb (Remove_Checks): Combine CASE alternatives. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/checks.adb | 34 -- 1 file changed, 12 insertions(+), 22 delet

[COMMITTED 4/7] ada: Normalize span generation on different platforms

2024-09-10 Thread Marc Poulhiès
From: Viljar Indus The total number of characters on a source code line is different on Windows and Linux based systems (CRLF vs LF endings). Use the last non line change character to adjust printing the spans that go over the end of line. gcc/ada/ * diagnostics-pretty_emitter.adb (Get_

[COMMITTED 5/7] ada: First controlling parameter: report error without Extensions allowed

2024-09-10 Thread Marc Poulhiès
From: Javier Miranda Enable reporting an error when this new aspect/pragma is set to True, and the sources are compiled without language extensions allowed. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Call Error_Msg_GNAT_Extension() to report an error when the aspect F

[COMMITTED 6/7] ada: Use the same warning character in continuations

2024-09-10 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * gcc-interface/decl.cc: Use same warning characters in continuation messages. * gcc-interface/trans.cc: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 8 gcc/ada/gcc-interface/tr

Re: [PATCH] ada: Fix gcc-interface/misc.cc compilation on SPARC

2024-09-10 Thread Marc Poulhiès
Eric Botcazou writes: >> commit 72c6938f29cbeddb3220720e68add4cf09ffd794 >> Author: Eric Botcazou >> Date: Sun Aug 25 15:20:59 2024 +0200 >> >> ada: Streamline handling of low-level peculiarities of record field >> layout >> >> broke the Ada build on SPARC: >> >> In file included from ./tm

[COMMITTED 05/32] ada: Add System definitions of SIGSYS for Android

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque This allows reusing a-intnam__linux.ads for Android. gcc/ada/ChangeLog: * libgnarl/s-linux__android-arm.ads: Define SIGSYS. * libgnarl/s-linux__android-aarch64.ads: Define SIGSYS. * libgnarl/s-osinte__android.ads: Expose SIGSYS value. Tested on x86

[COMMITTED 11/32] ada: Missing constraint check for 'Length attribute reference

2024-10-08 Thread Marc Poulhiès
From: Steve Baird In some cases involving a universal-integer-valued attribute reference (typically a 'Length attribute reference) occurring as an actual parameter in a call, the runtime check that the constraints of the formal parameter are satisfied is incorrectly not performed. gcc/ada/Change

[COMMITTED 06/32] ada: Use a-nallfl__wraplf.ads for Android

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque This is the most common definition. Otherwise, from the default: a-nallfl.ads:51:13: ... intrinsic binding type mismatch on result a-nallfl.ads:51:13: ... intrinsic binding type mismatch on parameter 1 a-nallfl.ads:51:13: ... profile of "Sin" doesn't match the builtin it bi

[COMMITTED 03/32] ada: Account for aarch64 in init.c section for Android

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque Unlike the ARM port already there, aarch64 is dwarf CFI based for unwinding and Android-Linux exposes kernel CFI for signal handlers. gcc/ada/ChangeLog: * init.c (__gnat_error_handler): Map signals straight to Ada exceptions, without a local CFI trampoline.

[COMMITTED 02/32] ada: Extend arm-android section of Makefile.rtl to aarch64

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque gcc/ada/ChangeLog: * Makefile.rtl: Extend arm-android section to aarch64, in a similar fashion as other arm/arch64 configurations. Introduce pair selection guards to prevent match of aarch64-linux-android on the regular aarch64-linux% cross a

[COMMITTED 01/32] ada: sem_prag.adb: ignore compile_time_{warning, error} in CodePeer mode

2024-10-08 Thread Marc Poulhiès
From: Ghjuvan Lacambre GNAT sometimes needs help from the GCC back-end in order to check whether Compile_Time_{Warning,Error} are true. As CodePeer does not have access to a GCC back-end, it is unable to perform these checks. Thus we need to remove said pragmas from the tree. gcc/ada/ChangeLog:

[COMMITTED 19/32] ada: Add Is_Rep_To_Pos predicate and export it for use in gigi

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou This is modeled on the existing Is_Init_Proc predicate. gcc/ada/ChangeLog: * exp_tss.ads (Is_Rep_To_Pos): New function declaration. * exp_tss.adb (Is_Rep_To_Pos): New function body. * fe.h (Is_Rep_To_Pos): New macro and extern declaration. Tested on x

[COMMITTED 13/32] ada: Print the load address in symbolic backtraces

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The load address of PIE executables is printed in non-symbolic backtraces (-E binder switch) but it makes sense to print it in symbolic backtraces (-Es binder switch) too, because symbolic backtraces may degenerate into non-symbolic ones when the executable is stripped for exa

[COMMITTED 14/32] ada: Early freezeing of types with 'Size'Class

2024-10-08 Thread Marc Poulhiès
From: squirek This patch fixes an issue in the compiler whereby declarations of derived types whose parent is a mutably tagged type cause early freezing of the parent type - leading to spurious compile-time errors. gcc/ada/ChangeLog: * sem_ch3.adb (Derived_Type_Declaration): Modify gener

[COMMITTED 04/32] ada: Rework s-linux/osinte for arm/aarch64-android sigactions

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque Building an aarch64-android compiler with the current sources initially intended for arm-android expectedly trips on problems. This change is meant to address: ``` .../gcc/ada/rts % ../../gnat1 -quiet ... a-stbufi.adb -I. s-osinte.ads:591:07: error: component "sa_flags" ov

[COMMITTED 08/32] ada: sem_prag.adb: fix indentation

2024-10-08 Thread Marc Poulhiès
From: Ghjuvan Lacambre The indentation was wrong on these two lines. gcc/ada/ChangeLog: * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Fix indentation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 4 ++-- 1 file changed, 2 insertions(

[COMMITTED 07/32] ada: Add External_Initialization extension

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch introduces a GNAT extension that adds a new aspect, External_Initialization. A section is added to the reference manual with a description of what the aspect does. The implementation reuses existing mechanisms, in particular Sinput.L.Load_Source_File and Sem_Re

[COMMITTED 15/32] ada: Improved support for incomplete parameter types

2024-10-08 Thread Marc Poulhiès
From: Steve Baird Fix two bugs uncovered by a recent ACATS test C3A1005: a freezing problem and a case where a user-defined equality function for an incomplete type was incorrectly hidden from use-clause visibility by the "corresponding" predefined op (which doesn't actually exist). gcc/ada/Chan

[COMMITTED 16/32] ada: Fix reproducer generation with child subprograms

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a corner case that was not handled correctly by Generate_Minimal_Reproducer. gcc/ada/ChangeLog: * generate_minimal_reproducer.adb (Generate_Minimal_Reproducer): Fix behavior on child subprograms without specs. Tested on x86_64-pc-linux-gn

[COMMITTED 17/32] ada: Use semantics from the RFC for declarative items mixed with statements

2024-10-08 Thread Marc Poulhiès
From: Raphaël AMIARD We want to allow statements lists with declarations *and* an exception handler. What follows from this is that declarations declared in the statement list are *not* visible from the exception handler, and that the following code: declare A : Integer := 12; be

[COMMITTED 10/32] ada: Add adareducer integration to ICE handling

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds a way to have the adareducer tool run on a appropriate set of files when GNAT crashes. This feature is behind the -gnatd_m debugging switch. gcc/ada/ChangeLog: * comperr.adb (Compiler_Abort): Add call to Generate_Minimal_Reproducer and repl

[COMMITTED 12/32] ada: Legal access discriminant default expression incorrectly rejected

2024-10-08 Thread Marc Poulhiès
From: Steve Baird If a limited private partial view of a type has an access discriminant with a default expression, and if the type (perhaps tagged, perhaps not) is completed by deriving from an immutably limited type, then the default discriminant expression should not be rejected. gcc/ada/Chan

[COMMITTED 09/32] ada: Fix wrong finalization of anonymous array aggregate

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The issue arises when the aggregate consists only of iterated associations because, in this case, its expansion uses a 2-pass mechanism which creates a temporary that needs a fully-fledged initialization, thus running afoul of the optimization that avoids building the initiali

[COMMITTED 25/32] ada: Reject mixed container aggregates

2024-10-08 Thread Marc Poulhiès
From: Viljar Indus A container aggregate can either be empty, contain only positional elements or named element associations. Reject the scenario where the latter two are both used. gcc/ada/ChangeLog: * diagnostics-constructors.adb (Make_Mixed_Container_Aggregate_Error): New func

[COMMITTED 18/32] ada: Avoid dependency on Long_Long_Long_Integer and System.Img_LLLI for 'Image

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou When the Image attribute is applied directly to another attribute returning Universal_Integer, for example Enum_Rep, it is converted to the equivalent of Universal_Integer'Image, which is implemented by Long_Long_Long_Integer and thus triggers a dependency on System.Img_LLLI,

[COMMITTED 20/32] ada: Use corect capacity with two dimensional arrays

2024-10-08 Thread Marc Poulhiès
From: Viljar Indus Previously when a bounded list was initialized with an array aggregate then we used the correct size only if the array was one dimensional. This patch adds support for deriving the size for multidimensional array types as well. gcc/ada/ChangeLog: * exp_aggr.adb (Build_

[COMMITTED 24/32] ada: Add mechanism to test internal error machinery

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds a pragma that triggers an internal compiler error when analyzed. It is not externally documented and makes it possible to test the code that runs when the compiler encounters an internal error. gcc/ada/ChangeLog: * snames.ads-tmpl: Add new pragma d

[COMMITTED 21/32] ada: Add dependency lines for External_Initialization

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques When a file included through External_Initialization has been modified, the unit including it must be recompiled. This patch adds the generation of dependency lines to the handling of the External_Initialization aspect, to signal that fact to gnatmake and other tools that

[COMMITTED 32/32] ada: Fix infinite loop on MSP430 with -mlarge flag

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou This removes the loop trying to find a pointer mode among the integer modes, which is obsolete and does not work on platforms where pointers have unusual size like MSP430 or special semantics like Morello. gcc/ada/ChangeLog: PR ada/116498 * gcc-interface/decl.

[COMMITTED 23/32] ada: Tweak position of comment

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch puts a comment explaining the absence of Storage_Size in an alphabetically sorted list at the spot where Storage_Size would be in that list. gcc/ada/ChangeLog: * snames.ads-tmpl: Tweak position of comment. Tested on x86_64-pc-linux-gnu, committed on ma

[COMMITTED 28/32] ada: Fix bogus error in instantiation with formal package

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The compiler reports that an actual does not match the formal when there is a defaulted formal discrete type because Check_Formal_Package_Instance fails to skip the implicit base type generated by the compiler. gcc/ada/ChangeLog: PR ada/114636 * sem_ch12.adb (

[COMMITTED 27/32] ada: Fix negative value returned by 'Image for array with nonnegative component

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The problem is that Exp_Put_Image.Build_Elementary_Put_Image_Call uses the signedness of the base type but the size of the first subtype, hence the discrepancy between them. gcc/ada/ChangeLog: PR ada/115535 * exp_put_image.adb (Build_Elementary_Put_Image_Call)

[COMMITTED 22/32] ada: Remove references to internal gnat RFC's

2024-10-08 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: replace references to RFC's with appropriate text from the rfc * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc

[COMMITTED 26/32] ada: Fix internal error on elsif part of if-statement containing if-expression

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The problem occurs when the compiler is trying to find a context to which it can hoist finalization actions coming from the if-expression, because Find_Hook_Context incorrectly returns the N_Elsif_Part node. gcc/ada/ChangeLog: PR ada/114640 * exp_util.adb (Fin

[COMMITTED 29/32] ada: Fix bogus Constraint_Error for 'Wide_Wide_Value on wide enumeration literal

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The problem is that 'Wide_Wide_Value is piggybacked on 'Value and the latter invokes System.Val_Util.Normalize_String, which incorrectly normalizes the input string in the presence of enumeration literals with wide characters. gcc/ada/ChangeLog: PR ada/115507

[COMMITTED 31/32] ada: Remove -gnateE information message for noncontiguous enumeration type

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou It is very confusing for the user because it does not make any reference to the source code but only to details of the underlying implementation. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Raise_Error_to_gnu) : Do not the generate range information if the va

[COMMITTED 30/32] ada: Rework the Android sigtramp implementation

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque The initial signal handling code introduced for aarch64-android overlooked details of the tasking runtime, not in the initial testing perimeter. Specifically, a reference to __gnat_sigtramp from __gnat_error_handler, initially introduced for the arm port, was prevented if !

Re: Ping: [PATCH] d,ada/spec: only sub nostd{inc,lib} rather than nostd{inc,lib}*

2024-10-11 Thread Marc Poulhiès
Arsen Arsenović writes: > Ping on this patch. Hello Arsen, and sorry for taking so long to reply. The patch is OK for the Ada part. Cheers, Marc

[COMMITTED] ada: Fix static_assert with one argument

2024-10-29 Thread Marc Poulhiès
Single argument static_assert is C++17 only and breaks the build using older GCC (prerequisite is C++14). gcc/ada * types.h: fix static_assert. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/types.h | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --

[COMMITED] [wwwdocs] index: GCC developer room at FOSDEM 2025: Call for Participation open

2024-10-30 Thread Marc Poulhiès
--- htdocs/index.html | 4 1 file changed, 4 insertions(+) diff --git a/htdocs/index.html b/htdocs/index.html index b303744c..d20c7348 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -55,6 +55,10 @@ mission statement. News +https://inbox.sourceware.org/gcc/875xparmhn@katap

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

2024-11-04 Thread Marc Poulhiès
Samuel Thibault writes: > I reworked the patch to factorize the bsd signal definitions. > I have split off the system definitions because the priority range of > GNU/Mach has diverged from the original BSD kernels. > gcc/ada/ChangeLog | 17 ++ Hello, The changes lo

[COMMITTED 04/38] ada: Assignment local variable only when it is used

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_res.adb (In_Decl): Rename and move local variable where it is used. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 16 1 file changed, 8 insert

[COMMITTED 08/38] ada: Missing precondition runtime check in inherited primitive

2024-11-04 Thread Marc Poulhiès
From: Javier Miranda When a derived tagged type implements interface types in addition to deriving from its parent type, and a primitive inherited from its parent type corresponds to an inherited primitive that has class-wide preconditions, then the generated code fails to check the class-wide pr

[COMMITTED 01/38] ada: Fix asymmetry in resolution of unary intrinsic operators

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Resolution of binary and unary intrinsic operators differed when expansion was inactive. In particular, this affected GNATprove handling of Ada.Real_Time."abs" operator. This patch makes unary resolution behave like binary resolution. gcc/ada/ChangeLog: * sem_res.ad

[COMMITTED 06/38] ada: Minor whitespace tuning

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_N_Op_Multiply): Remove extra whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_ch4.a

[COMMITTED 03/38] ada: Add null exclusion to avoid run-time checks

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek By declaring access parameter with non-null qualifier, the compiler should avoid generating run-time checks in debug builds, resulting in a tiny performance improvement. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_res.adb (Type_In_P): Add non-nu

[COMMITTED 13/38] ada: Move formal hash tables from gnat repository to the SPARK library

2024-11-04 Thread Marc Poulhiès
From: Claire Dross The formal containers have been part of the SPARK library for some time now. However, some units used only by these containers are still part of the gnat repository. Move them to the SPARK library. gcc/ada/ChangeLog: * Makefile.rtl: Remove references to moved units.

[COMMITTED 18/38] ada: Tweak CPU affinity handling

2024-11-04 Thread Marc Poulhiès
From: Ronan Desplanques The primary motivation for this change is making the taskset command line tool work as expected for tasking programs that don't use features from section D.16 of the Ada reference manual. A couple of components are added to the ATCB record to make it possible to tell value

[COMMITTED 05/38] ada: Avoid run-time conversion of 0 from Int to Uint

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup and tiny performance improvement; semantics is unaffected. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_N_Op_Subtract): Replace numeric literal with universal integer constant, just like it is done in expansion of addition operator. Tested

[COMMITTED 10/38] ada: Minor tweaks in comments

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou They are related to the special support for text encoding on Windows. gcc/ada/ChangeLog: * adaint.c: Replace initialize.c with rtinit.c in comment. * sysdep.c (__gnat_set_mode): Fix reference in comment. * libgnat/i-cstrea.ads (Content_Encoding): Adju

[COMMITTED 20/38] ada: Add Invocation node to the SARIF report

2024-11-04 Thread Marc Poulhiès
From: Viljar Indus Add an invocation node to the SARIF report that contains the command line use to activate gnat and whether the execution was successful or not. gcc/ada/ChangeLog: * diagnostics-sarif_emitter.adb (Print_Runs): Add printing for the invocation node that consists

[COMMITTED 15/38] ada: Refactor exception declarations from Interfaces.CHERI to separate package

2024-11-04 Thread Marc Poulhiès
From: Daniel King Exception declarations require elaboration on the full run-time to register the exceptions. The package Interfaces.CHERI, however, is used on bare-metal targets during early initialization, before elaboration and is therefore marked No_Elaboration_Code_All. Refactoring the excep

[COMMITTED 11/38] ada: Fix internal error on alignment clause for type declared in generic unit

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou The front-end raises Program_Error on an alignment clause for a type in a generic unit that references the alignment of another type in the unit. gcc/ada/ChangeLog: PR ada/117051 * freeze.adb (Freeze_Entity): Call the layout procedure on subtypes decl

[COMMITTED 07/38] ada: Fix visibility of Taft amendment types

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek When uninstalling private package declarations we must mark Taft amendment types hidden, just like we mark other types. Looking at previous revisions of this code, it is quite clear that this bug comes from a code evolution and marking types should happen in all ELSE branche

[COMMITTED 25/38] ada: Tweak description of new predicate

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou The existing comment is a bit too vague. gcc/ada/ChangeLog: * exp_aggr.ads (Is_Two_Pass_Aggregate): Beef up comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.ads | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/

[COMMITTED 23/38] ada: Missing runtime check in interpolated string

2024-11-04 Thread Marc Poulhiès
From: Javier Miranda When the type imposed by the context for an interpolated string is constrained, the compiler silently omits adding a runtime check. gcc/ada/ChangeLog: * exp_ch2.adb (Expand_N_Interpolated_String_Literal): Use the base type of the type imposed by the context

[COMMITTED 16/38] ada: Build and runtime support for CheriBSD

2024-11-04 Thread Marc Poulhiès
From: Daniel King SIGPROT is a new signal on CheriBSD that signals a CHERI protection violation. The full runtime converts these to the appropriate Ada exception declared in Interfaces.CHERI.Exceptions. gcc/ada/ChangeLog: * Makefile.rtl: Build support for Morello CheriBSD. * lib

[COMMITTED 26/38] ada: Update documentation for -gnatVxx switches

2024-11-04 Thread Marc Poulhiès
From: Viljar Indus Imporve the wording to explicitly state which options are turned on by -gnatVa and that -gnatVd is enabled by default. It can be somewhat hard to decifer that information from the old wording. Especially when compared to -gnatWxx switches where there is an elaborate scheme for

[COMMITTED 24/38] ada: Display message on reproducer generation failure

2024-11-04 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, nothing was reported to the user when an exception was raised during generation of a minimal reproducer. This patch fixes this. gcc/ada/ChangeLog: * comperr.adb (Compiler_Abort): Display message in exception handler. Tested on x86_64-pc-linux-

[COMMITTED 12/38] ada: Add doc for deep delta aggregates

2024-11-04 Thread Marc Poulhiès
From: Raphaël AMIARD gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Adjust documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_rm/gnat_language_extensions.rst | 14

[COMMITTED 36/38] ada: Fix ancient typo in process_decls

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou It has gone unnoticed for decades because it changes nothing in practice. gcc/ada/ChangeLog: * gcc-interface/trans.cc (process_decls): Remove tests on Nkind that contain a typo and would be redundant if written correctly. Tested on x86_64-pc-linux-gnu, commi

[COMMITTED 29/38] ada: Fix crash on default value with nested iterated component associations

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the freeze node for the type of the element ends up in the component list of the record type declared with the default value. gcc/ada/ChangeLog: PR ada/113036 * freeze.adb (Freeze_Expression): Deal with freezing actions coming from

[COMMITTED 17/38] ada: Fix error message for pragma First_Controlling_Parameter

2024-11-04 Thread Marc Poulhiès
From: Raphaël AMIARD gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma): Fix format for second line of warning (should be a continuation line) Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[COMMITTED 19/38] ada: Add Schema to the SARIF report

2024-11-04 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * diagnostics-sarif_emitter.adb (Print_SARIF_Report): Add a Schema field to the SARIF report. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/diagnostics-sarif_emitter.adb | 14 +- 1 file changed, 13 insertions(

[COMMITTED 02/38] ada: Resolve intrinsic operators without homonyms

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Intrinsic operators are resolved by rewriting into a corresponding operator from the Standard package. Traversing homonyms just to find the corresponding operator was not particularly efficient; also, for the binary "-" it was finding the unary "-". There appears to be no di

[COMMITTED 35/38] ada: Split Library_Unit using multiple wrappers

2024-11-04 Thread Marc Poulhiès
From: Bob Duff The Library_Unit field was used for all sorts of different purposes, which led to confusing code. This patch splits Library_Unit into much more specific wrapper subprograms that should be called instead of [Set_]Library_Unit. Predicates and pragmas Assert are used to catch misuses

[COMMITTED 22/38] ada: Add CHERI variant of full secondary stack allocator

2024-11-04 Thread Marc Poulhiès
From: Daniel King gcc/ada/ChangeLog: * Makefile.rtl: Use s-secsta__cheri.adb on Morello CheriBSD. * libgnat/s-secsta__cheri.adb: New file. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/Makefile.rtl|3 +- gcc/ada/libgnat/s-secsta__cheri.adb

[COMMITTED 28/38] ada: Propagate resolution status from Resolve_Iterated_Component_Association

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou The resolution status of Resolve_Aggr_Expr is lost when the routine is invoked indirectly from Resolve_Iterated_Component_Association. gcc/ada/ChangeLog: * sem_aggr.adb (Resolve_Iterated_Component_Association): Change to function returning Boolean and return

[COMMITTED 09/38] ada: Correction to disable self-referential with_clauses

2024-11-04 Thread Marc Poulhiès
From: Bob Duff Follow-on to previous change "Disable self-referential with_clauses", which caused some regressions. Remove useless use clauses referring to useless self-referential with'ed packages. This is necessary because in some cases, such use clauses cause the compiler to crash or give spur

[COMMITTED 32/38] ada: Improve Unbounded_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-strunb__shared.adb: Restructure code to inline only the most common cases. Remove whenever possible runtime checks. * libgnat/a-stru

[COMMITTED 38/38] ada: Move special case for null string literal from frontend to backend

2024-11-04 Thread Marc Poulhiès
From: Piotr Trojanek Previously the lower bound of string literals indexed by non-static integer types was artificially set to 1 in the frontend. This was to avoid an overflow in calculation of a null string size by the GCC backend, which was causing an excessively large binary object file. Howe

[COMMITTED 27/38] ada: Remove dead code in Resolve_Iterated_Component_Association

2024-11-04 Thread Marc Poulhiès
From: Eric Botcazou It dates back to when analysis was performed on a copy of the expression. gcc/ada/ChangeLog: * sem_aggr.adb (Resolve_Iterated_Component_Association): Move up declaration of Expr and remove dead code from older processing. Tested on x86_64-pc-linux-gnu, commi

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