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

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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 13/17] ada: Print Insertion_Sloc in dmsg

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

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

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

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

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

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

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

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

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

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

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

[COMMITTED 10/17] ada: Improve Inspection_Point warning

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[COMMITTED 01/17] ada: Update documentation for conditional when constructs

2024-08-29 Thread Marc Poulhiès
From: Justin Squirek This patch moves the documentation for conditional when constructs out of the curated set (e.g. into -gnatX0). gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Move conditional when constructs out of the curated set. * gnat_rm.texi: Regenerate.

[COMMITTED 03/17] ada: Proper handling for iterator associations in array aggregates

2024-08-29 Thread Marc Poulhiès
From: Gary Dismukes The compiler was flagging type-mismatch errors on iterated component associations in array aggregates of form "for C in ", improperly requiring the type of the iterator to be the array index type. The parser can't distinguish whether the association is one involving an actual

[COMMITTED 16/16] ada: Fix crash on aliased variable with packed array type and -g switch

2024-08-23 Thread Marc Poulhiès
From: Eric Botcazou This comes from a loophole in gnat_get_array_descr_info for record types containing a template, which represent an aliased array, when this array type is bit-packed and implemented as a modular integer. gcc/ada/ * gcc-interface/misc.cc (gnat_get_array_descr_info): Te

[COMMITTED 13/16] ada: Crash on string interpolation with custom string types

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda The compiler crashes when processing an object declaration of a custom string type initialized with an interpolated string. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference: [Put_Image]): Add support for custom string types. * exp_ch2.adb (Expan

[COMMITTED 11/16] ada: Eliminated-mode overflow check not eliminated

2024-08-23 Thread Marc Poulhiès
From: Steve Baird If the Overflow_Mode in effect is Eliminated, then evaluating an arithmetic op such as addition or subtraction should not fail an overflow check. Fix a bug which resulted in such an overflow check failure. gcc/ada/ * checks.adb (Is_Signed_Integer_Arithmetic_Op): Return

[COMMITTED 14/16] ada: Fix incorrect tracebacks on Windows

2024-08-23 Thread Marc Poulhiès
From: Sebastian Poeplau PECOFF symbols don't have a size attached to them. The symbol size that System.Object_Reader.Read_Symbol guesses to make up for the lack of information can be wrong when the symbol table doesn't match the algorithm's expectations; in particular that's the case when functio

[COMMITTED 07/16] ada: Fix style in lines starting with assignment operator

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek Style cleanup; semantics is unaffected. Offending occurrences found with grep "^ *:=" and fixed manually. gcc/ada/ * checks.ads, cstand.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb, exp_dbug.adb, exp_util.adb, gnatlink.adb, lib-util.adb, libgnat/a-exc

[COMMITTED 10/16] ada: Update libraries with the limited flag

2024-08-23 Thread Marc Poulhiès
From: Viljar Indus Records without a limited keyword now emit a warning if they contain a member that has an inherently limited type. gcc/ada/ * libgnat/a-coinho__shared.ads: add limited keyword. * libgnat/g-awk.adb: add limited keyword. * libgnat/g-comlin.ads: add limit

[COMMITTED 12/16] ada: Implicit_Dereference aspect specification for subtype incorrectly accepted

2024-08-23 Thread Marc Poulhiès
From: Steve Baird Implicit_Dereference is a type-specific aspect and therefore cannot be legally specified as part of a subtype declaration. gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Generate error if an aspect specification specifies the Implicit_De

[COMMITTED 09/16] ada: Emit a warning on inheritly limited types

2024-08-23 Thread Marc Poulhiès
From: Viljar Indus Record types that do not have a limited keyword but have a member with a limited type are also considered to be limited types. This can be confusing to understand for newer Ada users. It is better to emit a warning in this scenario and suggest that the type should be marked wit

[COMMITTED 08/16] ada: First controlling parameter aspect

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch6.adb (Check_Private_Overriding): Improve code detecting error on private function with controlling result. Fixes the regression of ACATS bde0003. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch6.adb | 14 +++

[COMMITTED 05/16] ada: Simplify validity checks for scalar parameters

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek Replace low-level iteration over formal and actual parameters with a call to high-level Find_Actual routine. Code cleanup; behavior is unaffected. gcc/ada/ * checks.adb (Ensure_Valid): Use Find_Actual. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/a

[COMMITTED 01/16] ada: First controlling parameter aspect

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda This patch adds support for a new GNAT aspect/pragma that modifies the semantics of dispatching primitives. When a tagged type has this aspect/pragma, only subprograms that have the first parameter of this type will be considered dispatching primitives; this new pragma/aspect

[COMMITTED 15/16] ada: String interpolation: report error without Extensions allowed

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda The compiler does not report the correct error in occurrences of interpolated strings, when the sources are compiled without language extensions allowed. gcc/ada/ * scng.adb (Scan): Call Error_Msg_GNAT_Extension() to report an error, when the sources are com

[COMMITTED 06/16] ada: Cleanup validity of boolean operators

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek Move detection of always valid expressions from routine Ensure_Valid (which inserts validity checks) to Expr_Known_Valid (which decides their validity). In particular, this patch removes duplicated detection of boolean operators, which were recognized in both these routines.

[COMMITTED 04/16] ada: Fix validity checks for named parameter associations

2024-08-23 Thread Marc Poulhiès
From: Piotr Trojanek When iterating over actual and formal parameters, we should use First_Actual/Next_Actual and not simply First/Next, because the order of actual parameters might be different than the order of formal parameters obtained with First_Formal/Next_Formal. This patch fixes a glitch

[COMMITTED 02/16] ada: Error missing when 'access is applied to an interface type object

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda The compiler does not report an error when 'access is applied to a non-aliased class-wide interface type object. gcc/ada/ * exp_util.ads (Is_Expanded_Class_Wide_Interface_Object_Decl): New subprogram. * exp_util.adb (Is_Expanded_Class_Wide_Interface_

[COMMITTED 03/16] ada: First controlling parameter aspect

2024-08-23 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Temporarily remove reporting an error when the new aspect is set to True and the extensions are not enabled. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 3 --- 1 file

[COMMITED] fix single argument static_assert

2024-08-22 Thread Marc Poulhiès
Single argument static_assert is C++17 only. libcpp/ChangeLog: * lex.cc(search_line_ssse3): fix static_assert to use 2 arguments. --- Pushed to master as obvious. Fixed the CL + added a reason in the assert. Thanks! libcpp/lex.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH] fix single argument static_assert

2024-08-22 Thread Marc Poulhiès
Single argument static_assert is C++17 only. libcpp/ChangeLog: * lex.cc: fix static_assert to use 2 arguments. --- OK for master? libcpp/lex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpp/lex.cc b/libcpp/lex.cc index daf2c770bc3..402a2e42f46 100644 --- a/l

Re: [PATCH] gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]

2024-08-19 Thread Marc Poulhiès
Arsen Arsenović writes: Hello Arsen, > Reg-tested on x86_64-pc-linux-gnu with all languages and yes,rtl,extra > checking. > > OK for trunk? > > TIA, have a lovely day. > -- >8 -- > > gcc/ada/ChangeLog: > > PR ada/115917 > * gnatvsn.ads: Add note about the duplication

Re: [wwwdocs] Re: [COMMITTED] gcc-14: Add Ada changes

2024-08-12 Thread Marc Poulhiès
Gerald Pfeifer writes: > On Fri, 26 Apr 2024, Marc Poulhiès wrote: >> Co-authored-by: Fernando Oleo Blanco >> Co-authored-by: Piotr Trojanek >> Signed-off-by: Marc Poulhiès >> --- >> htdocs/gcc-14/changes.html | 67 ++

[COMMITTED 3/6] ada: Futher refinements to mutably tagged types

2024-08-08 Thread Marc Poulhiès
From: Justin Squirek This patch further enhances the mutably tagged type implementation by fixing several oversights relating to generic instantiations, attributes, and type conversions. gcc/ada/ * exp_put_image.adb (Append_Component_Attr): Obtain the mutably tagged type for the

[COMMITTED 5/6] ada: Etype missing for raise expression

2024-08-08 Thread Marc Poulhiès
From: Steve Baird If the primitive equality operator of the component type of an array type is abstract, then a call to that abstract function raises Program_Error (when such a call is legal). The FE generates a raise expression to implement this. That raise expression is an expression so it shou

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

2024-08-08 Thread Marc Poulhiès
From: Steve Baird An access discriminant is allowed to have a default value only if the discriminated type is immutably limited. In the case of a discriminated limited private type declaration, this rule needs to be checked when the completion of the type is seen. gcc/ada/ * sem_ch6.adb

[COMMITTED 2/6] ada: Spurious maximum nesting level warnings

2024-08-08 Thread Marc Poulhiès
From: Justin Squirek This patch fixes an issue in the compiler whereby disabling style checks via pragma Style_Checks ("-L") resulted in the minimum nesting level being zero but the style still being enabled - leading to spurious maximum nesting level exceeded warnings. gcc/ada/ * style

[COMMITTED 4/6] ada: Run-time error with GNAT-LLVM on container aggregate with finalization

2024-08-08 Thread Marc Poulhiès
From: Gary Dismukes When unnesting is enabled, the compiler was failing to copy the At_End_Proc field from a block statement to the procedure created to replace it when unnesting of top-level blocks is done. At run time this could lead to exceptions due to missing finalization calls. gcc/ada/

[COMMITTED 1/6] ada: Finalization_Size raises Constraint_Error

2024-08-08 Thread Marc Poulhiès
From: Javier Miranda When the attribute Finalization_Size is applied to an interface type object, the compiler-generated code fails at runtime, raising a Constraint_Error exception. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) : If the prefix is an interface type, gene

Re: [PATCH] Ada, libgnarl: Fix s-taprop__posix.adb compilation.

2024-08-08 Thread Marc Poulhiès
Iain Sandoe writes: Hello, > Tested on x86_64-darwin21, OK for trunk? Yes, thanks! Marc

Re: [PATCH] ada: Fix s-taprop__solaris.adb compilation

2024-08-08 Thread Marc Poulhiès
Rainer Orth writes: Hello, > Solaris Ada bootstrap is broken as of 2024-08-06 with > > s-taprop.adb:1971:23: error: "int" is not visible > s-taprop.adb:1971:23: error: multiple use clauses cause hiding > s-taprop.adb:1971:23: error: hidden declaration at s-osinte.ads:51 > s-taprop.adb:1971:23: e

[PATCH] rust: avoid clobbering LIBS

2024-08-06 Thread Marc Poulhiès
Save LIBS around calls to AC_SEARCH_LIBS to avoid clobbering $LIBS. ChangeLog: * configure: Regenerate. * configure.ac: Save LIBS around calls to AC_SEARCH_LIBS. Signed-off-by: Marc Poulhiès Reviewed-by: Thomas Schwinge Tested-by: Thomas Schwinge --- Hello, This has already

[COMMITTED 8/9] ada: Implement type inference for generic parameters

2024-08-06 Thread Marc Poulhiès
From: Bob Duff ...based on previous work that added Gen_Assocs_Rec. Minor cleanup of that previous work. gcc/ada/ * sem_ch12.adb: Implement type inference for generic parameters. (Maybe_Infer_One): Forbid inference of anonymous subtypes and types. (Inference_Reas

[COMMITTED 5/9] ada: Use fully qualified in more library files

2024-08-06 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * libgnarl/s-interr__hwint.adb: Use fully qualified names to avoid ambiguity. * libgnarl/s-taprop__qnx.adb: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnarl/s-interr__hwint.adb | 11 ++- gcc/ada/libg

[COMMITTED 4/9] ada: Assert failure in repinfo

2024-08-06 Thread Marc Poulhiès
From: Javier Miranda Using switch gnatR4, the frontend crashes when generating information for a private record type. gcc/ada/ * repinfo.adb (List_Record_Info): Handle private record types. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/repinfo.adb | 6 +- 1 file

[COMMITTED 9/9] ada: Fix error in GNATprove inlining with array concatenation

2024-08-06 Thread Marc Poulhiès
From: Yannick Moy Wrong interpretation of the type of the concatenation can lead to a spurious error in GNATprove when inlining code. Now fixed. gcc/ada/ * sem_ch4.adb (Analyze_Concatenation_Rest): Do not add a wrong interpretation of the concatenation, using the type of the ope

[COMMITTED 6/9] ada: Spurious error on the default value of a derived scalar type

2024-08-06 Thread Marc Poulhiès
From: Javier Miranda When the aspect Default_Value is inherited by a derived scalar type, and both the parent type T and the derived type DT are declared in the same scope, a spurious error may be reported. This occurs if a subprogram declared in the same scope has a parameter of type DT with a d

[COMMITTED 7/9] ada: GNAT-LLVM compiler crash on container aggregates with iterators

2024-08-06 Thread Marc Poulhiès
From: Gary Dismukes Recent fixes for container aggregates with iterated element associations exposed a latent bug with loops that are wrapped in blocks, where the loop entity's scope was not adjusted to reflect the new enclosing block scope. gcc/ada/ * sem_ch5.adb (Analyze_Loop_Statemen

[COMMITTED 1/9] ada: Reject use-clause conflicts in the run-time library

2024-08-06 Thread Marc Poulhiès
From: Bob Duff This patch fixes a bug where GNAT would fail to detect certain errors when compiling the run-time library. In particular, if two overloaded homographs are both directly visible, it would pick one, rather than complaining about the ambiguity. The problem was that some special-purp

[COMMITTED 2/9] ada: Fix propagation of SPARK_Mode for renaming-as-body

2024-08-06 Thread Marc Poulhiès
From: Yannick Moy The value of SPARK_Mode associated with a renaming-as-body might not be the correct one, when the private part of the package containing the declaration has SPARK_Mode Off while the public part has SPARK_Mode On. This may lead to analysis of code by GNATprove that should not be

[COMMITTED 3/9] ada: Use fully qualified in the runtime library

2024-08-06 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * libgnarl/s-taprop__mingw.adb: Use fully qualified names to avoid ambiguity. * libgnarl/s-taprop__posix.adb: Likewise. * libgnarl/s-taprop__qnx.adb: Likewise. * libgnarl/s-taprop__rtems.adb: Likewise. Tested on x86_64-pc-linux

[COMMITTED 26/26] ada: Fix handling of SPARK_Mode on standalone child subprogram

2024-08-02 Thread Marc Poulhiès
From: Yannick Moy SPARK_Mode aspect was not properly propagated to the body of a standalone child subprogram from the generated spec for that subprogram, leading GNATprove to not analyze this body. Now fixed. gcc/ada/ * aspects.adb (Find_Aspect): Take into account the case of a node

[COMMITTED 24/26] ada: Remove unused null branch

2024-08-02 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_util.adb (Insert_Actions): Remove null ELSE branch. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/ada/exp_util.adb b/gcc

[COMMITTED 22/26] ada: Refactor negated conjuncts

2024-08-02 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_util.adb (Insert_Actions): Move negation in front of complex conjunctions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 13 +++-- 1 file changed, 7 insertions(

[COMMITTED 17/26] ada: Add contracts to Ada.Strings.Unbounded and adapt implementation

2024-08-02 Thread Marc Poulhiès
From: Yannick Moy Add complete functional contracts to all subprograms in Ada.Strings.Unbounded, except Count, following the specification from Ada RM A.4.5. These contracts are similar to the contracts found in Ada.Strings.Fixed and Ada.Strings.Bounded. A difference is that type Unbounded_Strin

[COMMITTED 20/26] ada: Errors on legal container aggregates with iterated_element_associations

2024-08-02 Thread Marc Poulhiès
From: Gary Dismukes The compiler rejects various cases of container aggregates with iterated_element_associations that include a loop_parameter_subtype_indication or that include the "reverse" keyword. The fixes are in the parser, for naccepting the syntax for these cases, as well as for properly

[COMMITTED 15/26] ada: Remove unreferenced procedure

2024-08-02 Thread Marc Poulhiès
From: Richard Kenner gcc/ada/ * exp_ch4.adb (Generate_Temporary): Remove unused procedure. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 43 --- 1 file changed, 43 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/

[COMMITTED 25/26] ada: Fix handling of iterated component associations with sub-aggregates

2024-08-02 Thread Marc Poulhiès
From: Piotr Trojanek Fix a number of problems in handling of actions generated for a 2-dimensional array aggregate where the outer aggregate has iterated component association and the inner aggregate involves run-time checks. gcc/ada/ * exp_aggr.adb (Add_Loop_Actions): Actions are now a

[COMMITTED 11/26] ada: Reject ambiguous function calls in interpolated string expressions

2024-08-02 Thread Marc Poulhiès
From: Javier Miranda This patch enhances support for this language feature by rejecting more ambiguous function calls. In terms of name resolution, the analysis of interpolated expressions is now treated as an expression of any type, as required by the documentation. Additionally, support for nes

[COMMITTED 21/26] ada: Simplify code by reusing Choice_List

2024-08-02 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Gen_Assign): Fix layout. * sem_aggr.adb (Empty_Range): Reuse Choice_List. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 8 gcc/ada/sem_aggr.adb | 8 +

[COMMITTED 23/26] ada: Simplify manipulation of the list with loop actions

2024-08-02 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ * exp_aggr.adb (Add_Loop_Actions): Change manipulation of list to avoid unnecessary calls to Parent and Loop_Actions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- 1 fil

[COMMITTED 10/26] ada: Compiler accepts illegal assignment to reference type target.

2024-08-02 Thread Marc Poulhiès
From: Steve Baird An assignment statement whose LHS is of a reference type is never legal. If no other legality rule is violated, then it is ambiguous. In some cases this ambiguity was not correctly detected. gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Delete code that was inco

  1   2   3   4   5   6   7   8   9   10   >