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

2025-04-18 Thread Marc Poulhiès
age4). As GCC 16 cycle has just started, we'll iterate with our testing and hopefully will manage to have this merged as part of the forthcoming stage1. Best regards, Marc Poulhiès

[COMMITTED] gcc-15/changes: Document Ada changes

2025-04-08 Thread Marc Poulhiès
From: Fernando Oleo Blanco Co-authored-by: Marc Poulhiès --- Thanks Fernando, I've pushed the attached changes. Marc htdocs/gcc-15/changes.html | 112 - 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-15/changes.html b/htdoc

Re: Patch held up in gcc-patches due to size

2025-02-03 Thread Marc Poulhiès
February 3, 2025 at 11:02 AM, "Mark Wielaard" mailto:m...@klomp.org?to=%22Mark%20Wielaard%22%20%3Cmark%40klomp.org%3E > wrote: > > (Does anybody actually look at the messages, as promised in the e-mail?= > > > I think it is done multiple times each day. The current moderators are > Jeff and Marc,

[COMMITTED 09/14] ada: Warn about redundant parentheses inside unary operators

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning is now emitted for unary operators as well. gcc/ada/ChangeLog: * par-ch4.adb (P_Factor): Warn when the operand of a unary operator

[COMMITTED 14/14] ada: Update gnatdll documentation (-b option removed)

2025-01-13 Thread Marc Poulhiès
From: Pascal Obry gcc/ada/ChangeLog: * doc/gnat_ugn/platform_specific_information.rst: Update. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../platform_specific_information.rst | 19 ++- gcc/ada/gnat_ugn.texi

[COMMITTED 12/14] ada: Fix relocatable DLL creation with gnatdll

2025-01-13 Thread Marc Poulhiès
From: Pascal Obry gcc/ada/ChangeLog: * mdll.adb: For the created DLL to be relocatable we do not want to use the base file name when calling gnatdll. * gnatdll.adb: Removes option -d which is not working anymore. And when using a truly relocatable DLL the base-add

[COMMITTED 08/14] ada: Remove redundant parentheses inside unary operators in comments

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid future build errors. gcc/ada/ChangeLog:

[COMMITTED 11/14] ada: Remove redundant parentheses inside unary operators (cont.)

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid build errors. gcc/ada/ChangeLog:

[COMMITTED 04/14] ada: Simplify expansion of negative membership operator

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_ch4.adb: (Expand_N_Not_In): Preserve Alternatives in expanded membership operator just like preserving Right_Opnd (though only one of these fields is present at a time). * par-ch

[COMMITTED 10/14] ada: Cleanup preanalysis of static expressions (part 4)

2025-01-13 Thread Marc Poulhiès
From: Javier Miranda Fix regression in the SPARK 2014 testsuite. gcc/ada/ChangeLog: * sem_util.adb (Build_Actual_Subtype_Of_Component): No action under preanalysis. * sem_ch5.adb (Set_Assignment_Type): If the right-hand side contains target names, expansion has b

[COMMITTED 13/14] ada: Cleanup preanalysis of static expressions (part 5)

2025-01-13 Thread Marc Poulhiès
From: Javier Miranda Partially revert the fix for sem_ch13.adb as it does not comply with RM 13.14(7.2/5). gcc/ada/ChangeLog: * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Restore calls to Preanalyze_Spec_Expression that were replaced by calls to Preanalyze_And_R

[COMMITTED 05/14] ada: Unbounded recursion on character aggregates with predicated component subtype

2025-01-13 Thread Marc Poulhiès
From: Gary Dismukes The compiler was recursing endlessly when analyzing an aggregate of an array type whose component subtype has a static predicate and the component expressions are static, repeatedly transforming the aggregate first into a string literal and then back into an aggregate. This is

[COMMITTED 07/14] ada: Remove redundant parentheses inside unary operators

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid future build errors. gcc/ada/ChangeLog:

[COMMITTED 06/14] ada: Fix spurious warning about redundant parentheses in range bound

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek Use the same logic for warning about redundant parentheses in lower and upper bounds of a discrete range. This fixes a spurious warning that, if followed, would render the code illegal. gcc/ada/ChangeLog: * par-ch3.adb (P_Discrete_Range): Detect redundant parenthese

[COMMITTED 02/14] ada: Add more commentary to System.Val_Real.Large_Powfive

2025-01-13 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ChangeLog: * libgnat/s-valrea.adb (Large_Powfive) [2 parameters]: Add a couple of additional comments. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-valrea.adb | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/

[COMMITTED 01/14] ada: Fix parsing of raise expressions with no parens

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek According to Ada grammar, raise expression is an expression, but requires parens to be a simple_expression. We wrongly classified raise expressions as expressions, because we mishandled a global state variable in the parser. This patch causes some illegal code to be rejected

[COMMITTED 03/14] ada: Warn about redundant parentheses in upper range bounds

2025-01-13 Thread Marc Poulhiès
From: Piotr Trojanek Fix a glitch in condition that effectively caused detection of redundant parentheses in upper range bounds to be dead code. gcc/ada/ChangeLog: * par-ch3.adb (P_Discrete_Range): Replace N_Subexpr, which was catching all subexpressions, with kinds that catch n

[COMMITTED 3/5] ada: Set syntactic node properties immediately when crating the nodes

2025-01-10 Thread Marc Poulhiès
From: Piotr Trojanek When creating a node, we can directly set its syntactic properties. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * contracts.adb (Build_Call_Helper_Decl): Tune whitespace. * exp_attr.adb (Analyze_Attribute): Set Of_Present while creating

[COMMITTED 5/5] ada: Incorrect accessibilty level for library level subprograms

2025-01-10 Thread Marc Poulhiès
From: squirek The patch fixes an issue in the compiler whereby accessibility level calculations for objects declared witihin library-level subprograms were done incorrectly - potentially allowing runtime accessibility checks to spuriously pass. gcc/ada/ChangeLog: * accessibility.adb:

[COMMITTED 4/5] ada: Remove empty line.

2025-01-10 Thread Marc Poulhiès
gcc/ada/ChangeLog: * env.h: Remove last empty line. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/env.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ada/env.h b/gcc/ada/env.h index b80b7e9a0fc..58a92b9d7f2 100644 --- a/gcc/ada/env.h +++ b/g

[COMMITTED 2/5] ada: Turn Is_Effective_Use_Clause from syntactic to semantic flag

2025-01-10 Thread Marc Poulhiès
From: Piotr Trojanek For a USE clause being effective is a semantic property, not a syntactic. AST cleanup; behavior is unaffected. gcc/ada/ChangeLog: * gen_il-gen-gen_nodes.adb (Gen_Nodes): Change Is_Effective_Use_Clause from syntactic to semantic property. Tested on x86_64-pc

[COMMITTED 1/5] ada: Reorder syntactic node fields to match the Ada RM grammar

2025-01-10 Thread Marc Poulhiès
From: Piotr Trojanek Several AST nodes had their syntactic fields in a different order than specified by the Ada RM grammar. With the variable-size nodes this no longer had an impact on the AST memory layout and was making the automatically generated Nmake routines a bit unintuitive to use. gcc/

[COMMITTED 1/2] ada: Accept predefined multiply operator for fixed point in expression function

2025-01-09 Thread Marc Poulhiès
From: Eric Botcazou The RM 4.5.5(19.1/2) subclause says that the predefined multiply operator for universal_fixed is still available, despite the declaration of a user- defined primitive multiply operator for the fixed-point type at stake, if it is identified using an expanded name with prefix de

[COMMITTED 2/2] ada: Fix missing detection of late equality operator returning subtype of Boolean

2025-01-09 Thread Marc Poulhiès
From: Eric Botcazou In Ada 2012, the compiler fails to check that a primitive equality operator for an untagged record type must appear before the type is frozen, when the operator returns a subtype of Boolean. This plugs the legality loophole but adds the debug switch -gnatd_q to go back to the

[COMMITTED 2/2] ada: Error on Disable_Controlled aspect in Multiway_Trees

2025-01-09 Thread Marc Poulhiès
From: squirek This patch fixes an issue in the compiler whereby instantiating Multiway_Trees with a formal type leads to a compile-time error due to the expression supplied for aspect Disable_Controlled specified on types decalred within Multiway_Trees' body not being static. gcc/ada/ChangeLog:

[COMMITTED 1/2] ada: Cleanup preanalysis of static expressions (part 3)

2025-01-09 Thread Marc Poulhiès
From: Javier Miranda Avoid reporting spurious errors. gcc/ada/ChangeLog: * freeze.adb (Freeze_Expr_Types): Reverse patch; that is, restore calls to Preanalyze_Spec_Expression instead of Preanalyze_And_Resolve for the sake of consistency with Analyze_Expression_Function.

[COMMITTED 30/31] ada: Adjust pragma obsolescent message

2025-01-07 Thread Marc Poulhiès
Do not mention an explicit version. gcc/ada/ChangeLog: * libgnat/a-calcon.ads: Adjust. * libgnat/a-calend.ads: Adjust. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-calcon.ads | 16 gcc/ada/libgnat/a-calend.ads | 14 ++ 2

[COMMITTED 25/31] ada: Cleanup preanalysis of static expressions (part 2)

2025-01-07 Thread Marc Poulhiès
From: Javier Miranda According to RM 13.14(8/4), a static expression in an aspect specification does not cause freezing; however, the frontend performs many calls to Preanalyze_Spec_Expression made during the analysis of aspects. This patch, suggested by Eric Botcazou, takes care of this addition

[COMMITTED 23/31] ada: Improve protection against wrong use from GDB

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek A code cleanup in routine intended to be used from DGB, suggested by running GNATcheck rule Boolean_Negations. However, this code can be tuned to protect against more illegal uses. gcc/ada/ChangeLog: * exp_disp.adb (Write_DT): Add guards that prevent crashes on ille

[COMMITTED 24/31] ada: Fix constants overlayed by variables

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup suggested by GNATcheck rule Constant_Overlays. gcc/ada/ChangeLog: * repinfo-input.adb (Decode_Name, Read_Name_With_Prefix): Use constant overlay with pragma Import. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/repinfo-input

[COMMITTED 28/31] ada: Do not create temporaries for initialization statements

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou Assignment statements marked with the No_Ctrl_Actions or No_Finalize_Actions flag are initialization statements and, therefore, no temporaries are needed to hold the value of the right-hand side for them. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Call_to_gnu): Alw

[COMMITTED 22/31] ada: Fix violations of GNAT-specific GNATcheck rules

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * diagnostics-pretty_emitter.adb (Get_Last_Line_Char): Fix whitespace. * sem_aggr.adb (Resolve_Array_Aggregate): Fix style. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/diagnosti

[COMMITTED 27/31] ada: Remove unused AST flag Address_Warning_Posted

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Flag Address_Warning_Posted was only read and never written, so it can be safely removed. gcc/ada/ChangeLog: * gen_il-fields.ads (Opt_Field_Enum): Remove flag. * gen_il-gen-gen_nodes.adb (N_Attribute_Definition_Clause): Remove field. * sem_ch

[COMMITTED 20/31] ada: Fix abort deferral for finally parts

2025-01-07 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes two problems with how abort was deferred in finally parts. First, calls to runtime subprograms are now omitted when aborting is disallowed by active restrictions. Second, Abort_Undefer is now correctly called when the finally part propagates an exception.

[COMMITTED 14/31] ada: Remove unnecessary qualifiers for First/Next list operations

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup related to work on expression functions for GNATprove (which require accessibility checks even when they are not expanded and thus have no explicit return statements). gcc/ada/ChangeLog: * accessibility.adb (First_Selector): Remove redundant and locally

[COMMITTED 10/31] ada: Add "finally" GNAT extension

2025-01-07 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds a new reserved word, "finally", and accompanying new syntax that's similar to the Java equivalent. gcc/ada/ChangeLog: * atree.adb (Parent_Or_List_Containing): New function. * atree.ads (Parent_Or_List_Containing): Likewise. * gen_i

[COMMITTED 29/31] ada: Drop g-cpp* units not needed by the compiler

2025-01-07 Thread Marc Poulhiès
From: Alexandre Oliva Having moved __gnat_convert_caught_object to g-cstyin.o, we can drop other g-cpp* units that are now needed by programs that actually use their APIs to get more information about C++ exceptions and type_info objects. gcc/ada/ChangeLog: * gcc-interface/Make-lang.in

[COMMITTED 08/31] ada: Reject references to attribute Result in Exceptional_Cases

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Functions with aspect Side_Effects should not reference attribute Result in consequences of their aspect Exceptional_Cases. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Exceptional_Cases_In_Decl_Part): Reject references to attribute Result. Tested on x86_64-p

[COMMITTED 18/31] ada: Remove flag Is_Inherited_Pragma which is only set and never used

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. Flag Is_Inherited_Pragma is only set in GNAT, but is not actually used, neither by the compiler nor by any backend. gcc/ada/ChangeLog: * contracts.adb (Inherit_Pragma): Don't set flag Is_Inherited_Pragma. * gen_il-fields

[COMMITTED 26/31] ada: Do not raise exceptions from Exp_Aggr.Packed_Array_Aggregate_Handled

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou An exception is now raised during bootstrap and this causes compatibility issues with older compilers. gcc/ada/ChangeLog: * exp_aggr.adb (Packed_Array_Aggregate_Handled): Remove declaration and handler for Not_Handled local exception. Check the return value

[COMMITTED 11/31] ada: Drop vxworks-smp-ppc-link.spec

2025-01-07 Thread Marc Poulhiès
From: Alexandre Oliva Adding -msmp to linker options in system-vxworks-ppc-rtp-smp.ads obviated vxworks-smp-ppc-link.spec. Drop it. gcc/ada/ChangeLog: * libgnat/system-vxworks-ppc-rtp-smp.ads: Drop --specs=vxworks-ppc-link.spec from Linker_Options. * vxworks-smp-ppc-lin

[COMMITTED 07/31] ada: Move checks for consequences of Exceptional_Cases to GNAT

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Previously checks for consequence expressions of Exceptional_Cases aspects were done in GNATprove backend. However, we can do them in the frontend, where they will apply to all subprograms, regardless of the SPARK_Mode aspect. gcc/ada/ChangeLog: * sem_prag.adb (Anal

[COMMITTED 17/31] ada: Avoid conversion from String to Name_Id at runtime

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Attribute): Replace runtime conversion with existing constant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[COMMITTED 13/31] ada: Fix internal error on container aggregate for bounded vectors

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou The problem is that we analyze references to an object before the actual subtype of the object is established, thus creating a type mismatch that is flagged by the code generator. gcc/ada/ChangeLog: * exp_ch7.ads (Store_After_Actions_In_Scope_Without_Analysis): New

[COMMITTED 12/31] ada: Add guard to System.Val_Real.Large_Powfive against pathological input

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou There is no need to keep multiplying the result once it saturates to +Inf. gcc/ada/ChangeLog: * libgnat/s-powflt.ads (Maxpow_Exact): Minor comment fix. * libgnat/s-powlfl.ads (Maxpow_Exact): Likewise. * libgnat/s-powllf.ads (Maxpow_Exact): Likewise.

[COMMITTED 15/31] ada: Handle attributes related to Ada 2012 iterators as internal

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Use existing machinery for internal attributes to handle attributes related to Ada 2012 iterators. All these attributes exist exclusively as a mean to delay processing. Code cleanup. The only change in behavior is the wording of error emitted when one of the internal attribu

[COMMITTED 09/31] ada: Elide the copy for bit-packed aggregates in (safe) assignments

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou The in-place expansion has been historically disabled for them, but there does not seem to be any good reason left for this. gcc/ada/ChangeLog: * exp_aggr.adb (Expand_Array_Aggregate): Do not exclude aggregates of bit-packed array types in assignments from in

[COMMITTED 21/31] ada: Remove dead code in detection of null record definitions

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ChangeLog: * sem_util.adb (Is_Null_Record_Definition): Remove check for Component_List being present after using it; replace check for component item being a component declaration with an assertion;

[COMMITTED 04/31] ada: Error on instantiation with defaulted formal type referencing other formal type

2025-01-07 Thread Marc Poulhiès
From: Gary Dismukes The compiler wasn't accounting for default subtypes on generic formal types that reference other formal types of the same generic, leading to errors about invalid subtypes. Several other problems that could lead to blowups or incorrect errors were noticed through testing relat

[COMMITTED 19/31] ada: Improved checking of uses of package renamings

2025-01-07 Thread Marc Poulhiès
From: Steve Baird In some cases, the RM 8.5.1(3.1) legality rule about uses of renamings of limited views of packages was implemented incorrectly, resulting in rejecting legal uses. gcc/ada/ChangeLog: * gen_il-fields.ads: add new Renames_Limited_View field. * gen_il-gen-gen_enti

[COMMITTED 06/31] ada: Fix comments about Subprogram_Variant and Exceptional_Cases

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek The comment about Subprogram_Variant was outdated after more types have been allowed by the corresponding SPARK RM rule; the comment about Exceptional_Cases was incorrect, after being copy-pasted. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Exceptional_Contract, Anal

[COMMITTED 03/31] ada: Use the syntax of Ada 2012 if-expression in -gnatR3 output

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou This uses the syntax of Ada 2012 if-expression in the output produced by the -gnatR3 switch for dynamic expressions. gcc/ada/ChangeLog: * repinfo.adb (List_GCC_Expression.Print_Expr) : Do not output the final "end". Tested on x86_64-pc-linux-gnu, committed o

[COMMITTED 01/31] ada: Restrict previous change made to expansion of allocators

2025-01-07 Thread Marc Poulhiès
From: Eric Botcazou There is no need to build a cleanup if exceptions cannot be propagated. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_Allocator_Expression): Do not build a cleanup if restriction No_Exception_Propagation is active. * exp_ch6.adb (Make_Build_In_Place_Call_I

[COMMITTED 05/31] ada: Put_Image spec incorrectly ignored for Fixed_Point_Type'Base'Image call.

2025-01-07 Thread Marc Poulhiès
From: Steve Baird If a Put_Image aspect specification (introduced in Ada 2022) is given for a fixed point type Fx, then in some cases a call to Fx'Base'Image would incorrectly ignore the aspect specification and would instead return the pre-Ada2022 version of the image. However, a call to Fx'Imag

[COMMITTED 16/31] ada: Untangle check for restriction No_Implementation_Attributes

2025-01-07 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; given that no attribute is both defined by Ada 83 and specific to GNAT, the semantics is unaffected. gcc/ada/ChangeLog: * sem_attr.adb (Analyze_Attribute): Simplify logic. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb

[COMMITTED 02/31] ada: Preserve Warning_Doc_Switch in gnatprove invocation

2025-01-07 Thread Marc Poulhiès
From: Johannes Kanig When invoked by gnat2why, the Warning_Doc_Switch was unintenionally reset. gcc/ada/ChangeLog: * gnat1drv.adb: (SPARK_Library_Warning): preserve Warning_Doc_Switch Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gnat1drv.adb | 2 ++ 1 file changed,

[COMMITTED 30/30] ada: Fix small thinko in previous change to two-pass aggregate expansion

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou We need a type tailored to the base index type to compute the length. gcc/ada/ChangeLog: * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Use the base type of the index type to find the type used to compute the length. Tested on x86_64-pc-linux-gnu, committed

[COMMITTED 28/30] ada: Fix predicate involving array indexing rejected in generic package

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou The indexing is rejected with the message: error: reference to current instance of type does not denote a type when it is applied to a prefix which is the current instance of the type to which the predicate is applied. There is already a specific handling of component sel

[COMMITTED 24/30] ada: Correct xref of operator expression function body

2025-01-06 Thread Marc Poulhiès
From: Bob Duff For an expression function body that is an operator, make sure the xref entry in the ALI file points one past the double quote mark. For example, if the name is ">", point to the greater-than symbol, not the double quote. This was already the case for proper bodies. gcc/ada/Change

[COMMITTED 16/30] ada: Plug small loophole in previous change

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou The initial change only deals with the controlled record case for assignment statements, but the controlled array case needs the same treatment. gcc/ada/ChangeLog: * exp_ch5.adb (Expand_Assign_Array): Bail out for controlled components if the RHS is a functio

[COMMITTED 15/30] ada: Fix printing boolean attributes in the SARIF report

2025-01-06 Thread Marc Poulhiès
From: Viljar Indus Boolean attributes should have the value true or false without any quotes. gcc/ada/ChangeLog: * diagnostics-json_utils.adb: Add new method Write_Boolean_Attribute. * diagnostics-json_utils.ads: Likewise. * diagnostics-sarif_emitter.adb (Print_I

[COMMITTED 29/30] ada: Streamline runtime support of finalization collections

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou Finalization collections are declared as (limited) controlled types so that they can be naturally attached to a finalization master, but the same result can be achieved by means of (limited) finalizable types, which need not be tagged and thus avoid dragging the runtime suppor

[COMMITTED 11/30] ada: null procedure cannot be used as compilation unit

2025-01-06 Thread Marc Poulhiès
From: Bob Duff This patch gives a syntax error if a null procedure is used as a compilation unit. The error was already given during semantic analysis; now it is given in the parser, which is more convenient for other tools like gprbuild, because the -gnats switch now gives the error. Note that

[COMMITTED 19/30] ada: Declare that the new argument may not be used

2025-01-06 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * adaint.c (__gnat_locate_exec_on_path): modify function signature Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/adaint.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c

[COMMITTED 14/30] ada: Remove level attribute from Rules in the SARIF report

2025-01-06 Thread Marc Poulhiès
From: Viljar Indus A Rule object in the SARIF report does not have a level attribute. Result objects are the elements in the SARIF reprot that have a level attribute that ultimately determines the level of each diagnostic object. Rules can have a defaultConfiguration attribute which has a level

[COMMITTED 10/30] ada: Cleanup preanalysis of static expressions

2025-01-06 Thread Marc Poulhiès
From: Javier Miranda Complete previous patch; required to avoid regressions in GNATProve. gcc/ada/ChangeLog: * sem_ch6.adb (Analyze_Expression_Function): Set the parent of the new node to be the parent of the original to get the proper context, which is needed for comple

[COMMITTED 22/30] ada: cleanup documentation for shift and rotate

2025-01-06 Thread Marc Poulhiès
From: Bob Duff Documentation updated. gcc/ada/ChangeLog: * sinfo.ads (Shift_Count_OK): Update comments. (Is_Power_Of_2_For_Shift): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sinfo.ads | 34 -- 1 file changed, 16 i

[COMMITTED 17/30] ada: Crash in prefix notation with access to class-wide object

2025-01-06 Thread Marc Poulhiès
From: Javier Miranda The compiler crashes analyzing a prefix notation call when its prefix is an access to a class-wide object, an actual parameter is missing, and the sources are compiled with language extensions (-gnatX) and full errors (-gnatf). gcc/ada/ChangeLog: * sem_ch4.adb (Try_

[COMMITTED 23/30] ada: Small housekeeping work in Exp_Aggr

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou This moves a few declarations around and tweaks a few comments. gcc/ada/ChangeLog: * exp_aggr.adb (Case_Table_Type): Fix reference in comment. (In_Place_Assign_OK): Move declaration around. (Is_Build_In_Place_Aggregate_Return): Likewise and adjust.

[COMMITTED 05/30] ada: Use inheritance in Gen_IL

2025-01-06 Thread Marc Poulhiès
From: Bob Duff In Gen_IL, detect cases where fields could be inherited from an abstract type instead of being defined in each of two or more descendants of that type. Raise Illegal when that is the case, except in specific cases called out as exceptions to this rule. For every such case, either

[COMMITTED 26/30] ada: Reduce footprint of C++ exception interoperation support

2025-01-06 Thread Marc Poulhiès
From: Alexandre Oliva The initial C++ base-type exception interoperation support change brought all of GNAT.CPP* along with raise-gcc, because of [__gnat_]Convert_Caught_Object. Move that private but pragma-exported function to GNAT.CPP.Std.Type_Info, so that it can rely on the C++ virtual/dispa

[COMMITTED 21/30] ada: Fix memory leak when failing to initialize newly allocated memory

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou This makes the compiler generate cleanup code to deallocate the memory when the evaluation of the expression of an allocator raises an exception, if the expression is a call to a function that may raise, i.e. is not declared with the No_Raise aspect/pragma. This can also be d

[COMMITTED 27/30] ada: Fix incorrect RM reference in s-imagef.adb

2025-01-06 Thread Marc Poulhiès
From: Bob Duff gcc/ada/ChangeLog: * libgnat/s-imagef.adb (Set_Image_Integer): Change "RM A.3.10" to be "RM A.10.9". Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-imagef.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/

[COMMITTED 20/30] ada: Fix assertion failure on 'Old in post-condition with -gnat2022

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou It comes from a small oversight in the updated implementation for Ada 2022. gcc/ada/ChangeLog: PR ada/117956 * sem_util.adb (Is_Known_On_Entry): Be prepared for constants coming from a renaming declaration. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED 13/30] ada: Avoid null-exclusion checks for Node_Field_Table

2025-01-06 Thread Marc Poulhiès
From: Piotr Trojanek By generating the type of Node_Field_Table with a "not null" qualifier we check the null exclusion of its elements only once, at the object declaration. Tiny performance improvement for the debug builds (because in production builds checks are disabled anyway); semantics is

[COMMITTED 12/30] ada: Ada version used to compile runtime is constant

2025-01-06 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ChangeLog: * opt.ads (Ada_Version_Runtime): Now a constant, since it cannot and should never be modified. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/opt.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[COMMITTED 04/30] ada: Fix incorrect incomplete type error

2025-01-06 Thread Marc Poulhiès
From: Viljar Indus In Ada 2005 even if the formal is using a tagged limited type then the type should not be considered incomplete. gcc/ada/ChangeLog: * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Exchange_Limited_Views also in Ada 2005. Tested on x86_64-pc-linux-gnu, committ

[COMMITTED 09/30] ada: C++ exception hierarchies: adjust for gnat-llvm

2025-01-06 Thread Marc Poulhiès
From: Alexandre Oliva gnat-llvm doesn't support C++ imports, so arrange for the GNAT.CPP* units to be omitted from gnat-llvm builds. Drop G++ exception interoperability support from raise-gcc.c, so as to not require the GNAT.CPP* units that define some of the required symbols. Co-Authored-By: O

[COMMITTED 08/30] ada: Elide copy for calls as default values of nonlimited by-reference components

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou This prevents a temporary from being created on the primary stack to hold the result of the function calls before it is copied to the object being elaborated in the nonlimited by-reference case. That's already not done in the nonlimited non-by-reference case and there is no r

[COMMITTED 03/30] ada: Fix finalization issue introduced by previous change

2025-01-06 Thread Marc Poulhiès
From: Eric Botcazou When detecting calls to subprograms specified for aspects of a type, the entity denoted by the aspects must go through Ultimate_Alias, since that of the name of the calls did the same. gcc/ada/ChangeLog: * exp_ch6.adb (Expand_Call_Helper): Call Ultimate_Alias for the

[COMMITTED 18/30] ada: Fix crash on Depends contract with homonym functions

2025-01-06 Thread Marc Poulhiès
From: Piotr Trojanek When resolving names in flow contracts, we refine the ordinary analysis by knowing that an overloaded name must refer to an abstract state and not a function. However, when all overloadings refer to function, we shouldn't crash, but instead let the error to be diagnosed later

[COMMITTED 01/30] ada: Remove workaround for RM_Size being unable to represent unknown size

2025-01-06 Thread Marc Poulhiès
From: Piotr Trojanek When validating instances of Ada.Unchecked_Conversion, we explicitly detected null arrays, because a size of 0 was used to indicate both an unknown size and an actual size of 0. This limitation has been lifted, so we can remove detection of null arrays. Code cleanup; behavio

[COMMITTED 02/30] ada: Fix markup in user's guide

2025-01-06 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix markup. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_ugn/building_executable_programs_with_gnat.rst | 2 +- gcc/ada/

[COMMITTED 07/30] ada: Follow-on to Use inheritance in Gen_IL

2025-01-06 Thread Marc Poulhiès
From: Bob Duff Fix too-long line. gcc/ada/ChangeLog: * gen_il-gen.adb: Fix too-long line. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gen_il-gen.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gen_il-gen.adb b/gcc/ada/gen_il-gen.a

[COMMITTED 06/30] ada: Silence unused parameter warning on linux

2025-01-06 Thread Marc Poulhiès
From: Tonu Naks In __gnat_locate_exec_on_path (char *exec_name, int current_dir_on_windows) the recently added second parameter is for windows only. On non-windows platforms its usage is removed by the preprocessor and the compiler reports unused parameter. gcc/ada/ChangeLog: * adaint.c

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

2025-01-03 Thread Marc Poulhiès
>> Would it make sense to drop the "Glibc" here? Having "Glibc" means that >> we end up with glibc specifics in files that are not glibc specific (e.g. >> a-exetim__posix.adb or s-osinte__linux.ads). Are these particular macros >> glibc specific? We need these to build with other libc (e.g. musl)

[COMMITTED 28/30] ada: Rely on default parameter when making component definition nodes

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek When calling Make_Component_Definition we can rely on the default value of parameter Aliased_Present being False. This makes code cleaner and consistent with relying on the default value of other parameters of this routine, e.g. Null_Exclusion_Present. Code cleanup; semantic

[COMMITTED 30/30] ada: Rely on default parameter when making non-null nodes

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek When calling Make_Access_To_Object_Definition and Make_Parameter_Specification we can rely on the default value of parameter Null_Exclusion_Present being False. This makes code cleaner and consistent with relying on the default value of other parameters of this routine. Code

[COMMITTED 23/30] ada: Enclosing_Entity of specless subprogram bodies

2025-01-03 Thread Marc Poulhiès
From: Bob Duff Correct Enclosing_Entity of specless subprogram bodies; these are marked as Comes_From_Source = False, so the simple name was missing. gcc/ada/ChangeLog: * sem_util.adb (Append_Entity_Name): Do not skip the simple name for a compilation unit (which includes

[COMMITTED 26/30] ada: Remove extra checks for raising a constraint error

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Routine Is_OK_Static_Expression itself calls Raises_Constraint_Error, so there is no need to call both of these routines in a row. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_attr.adb (Check_Array_Type): Remove extra call. * sem_util.adb

[COMMITTED 20/30] ada: Fix latent issue exposed by latest change

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou The finalization machinery needs to precisely locate the point where the initialization of objects is complete in order to generate the attachment to the finalization master. For objects initialized with a built-in-place function call, this is achieved by means of the BIP_Ini

[COMMITTED 22/30] ada: Fix comments and change subtype name in response to review

2025-01-03 Thread Marc Poulhiès
From: Tucker Taft gcc/ada/ChangeLog: * pprint.adb (Expression_Image): Adjust and improve comments to match style recommendations, and change name of subtype from Not_Associative to Non_Associative, in response to code review. Tested on x86_64-pc-linux-gnu, commit

[COMMITTED 11/30] ada: Fix small thinko in previous change

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou Even if the declaration of the conditional object is turned into a renaming during expansion, the conditional object must be finalized when the original object would have been. gcc/ada/ChangeLog: * exp_ch4.adb (Insert_Conditional_Object_Declaration): Create the

[COMMITTED 29/30] ada: Rely on default parameter when making non-constant nodes

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek When calling Make_Access_To_Object_Definition and Make_Object_Declaration we can rely on the default value of parameter Constant_Present being False. This makes code cleaner and consistent with relying on the default value of other parameters of this routine, like Null_Exclus

[COMMITTED 21/30] ada: Add parentheses in expressions involving combinations of and & or

2025-01-03 Thread Marc Poulhiès
From: Tucker Taft In the Expression_Image function, we were not inserting parentheses properly when there was a sequence of and and or operators, even though Ada requires such parentheses to show the correct order of association. gcc/ada/ChangeLog: * pprint.adb (Expression_Image): In lo

[COMMITTED 16/30] ada: Simplify check for No_Coextensions restriction

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Alocator): Move unrelated code out of a declare block. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 4 ++-- 1 file changed, 2 insertions(+),

[COMMITTED 19/30] ada: Refine subtype of a universal arithmetic utility routine

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * uintp.adb (N_Digits): Refine return subtype, since this routine always returns a positive number of digits. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/uintp.adb | 4 ++-- 1 f

[COMMITTED 15/30] ada: Simplify traversal procedures into traversal functions

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Instead of using the generic routine Traverse_Proc to set a global flag when a particular node is found, we can use its underlying routine Traverse_Func and check if traversal has been abandoned. We already used this pattern in a number of places; this patch merely applies it

[COMMITTED 12/30] ada: Improve and correct support for inheritance of nonoverriding aspects

2025-01-03 Thread Marc Poulhiès
From: Gary Dismukes This set of changes fixes various issues with the handling of inheritance of nonoverridable aspects (such as for Aggregate, and the indexing and iterator aspects, among others), plus improves some of the error reporting related to those. The prior implementation incorrectly ha

[COMMITTED 07/30] ada: Fix double free at run time for class-wide allocation

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou The previous change was too aggressive and overlooked a specific case. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_Allocator_Expression): Put back the call to Remove_Side_Effects in the case of a function call, a class-wide designated type and a regular

  1   2   3   4   5   6   7   8   9   10   >