[COMMITTED 04/14] ada: Small cleanup in expansion of array aggregates in allocators

2024-11-18 Thread Marc Poulhiès
From: Eric Botcazou Convert_Array_Aggr_In_Allocator does nothing that Late_Expansion cannot do, so this deletes the former and moves its support code for Storage_Model to the latter. No functional changes. gcc/ada/ChangeLog: * exp_aggr.adb (Convert_Array_Aggr_In_Allocator): Delete.

[COMMITTED 4/8] ada: Another small fix to the description of run-time library routines

2024-11-14 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ChangeLog: * libgnat/s-imagef.ads (Image_Fixed): Adjust outdated sentence. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-imagef.ads | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/libgnat/s-imagef.

[COMMITTED 5/8] ada: Adapt proofs of light runtime to current version of SPARK

2024-11-14 Thread Marc Poulhiès
From: Claire Dross gcc/ada/ChangeLog: * libgnat/a-strmap.adb: Add assert to regain proofs. * libgnat/a-strsup.adb: Likewise. * libgnat/s-aridou.adb: Add assertions to regain proofs. * libgnat/s-arit32.adb: Use Exceptional_Cases to specify Raise. * libgnat/

[COMMITTED 8/8] ada: Avoid doing unnecessary work in elaborate_expression_2

2024-11-14 Thread Marc Poulhiès
From: Eric Botcazou This prevents the expression from being tweaked by the match.pd machinery in the process, which can damage the readability of the -gnatR3 output. gcc/ada/ChangeLog: * gcc-interface/decl.cc (elaborate_expression_2): Do not divide and multiply back if the align

[COMMITTED 1/8] ada: Fix internal error on misplaced iterated component association

2024-11-14 Thread Marc Poulhiès
From: Eric Botcazou This happens for example in the others choice of a 1-dimensional array: A : array (1 .. Length) of Integer := (others => for Each in 1 .. Length => Each); or when it is used without parentheses for the array component of a record. gcc/ada/ChangeLog: PR

[COMMITTED 6/8] ada: Tweak test for predefined units in binder

2024-11-14 Thread Marc Poulhiès
From: Ronan Desplanques The new way makes better use of the existing abstractions. gcc/ada/ChangeLog: * bindgen.adb (Gen_Elab_Calls): Tweak test. (Gen_Elab_Externals): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/bindgen.adb | 7 ++- 1 file ch

[COMMITTED 3/8] ada: Fix spurious warning on representation clause for private discriminated type

2024-11-14 Thread Marc Poulhiès
From: Eric Botcazou This is the warning enabled by -gnatw.h for holes in record types that are declared with a representation clause for their components. When a discriminated type has a private declaration that also declares its discriminants, the sibling discriminants present on the full decla

[COMMITTED 7/8] ada: Improved legality checking for deep delta aggregates.

2024-11-14 Thread Marc Poulhiès
From: Steve Baird Enforce deep delta legality rules about nonoverlapping choices. For example, do not allow both Aaa.Bbb and Aaa.Bbb.Ccc as choices in one delta aggregate. One special case impacts "regular" Ada2022 delta aggregates - the rule preventing a record component from occurring twice as

[COMMITTED 2/8] ada: Fix outdated description in System.Arith_* units

2024-11-14 Thread Marc Poulhiès
From: Eric Botcazou Mainly System.Arith_Double, which has left-overs from its original version. gcc/ada/ChangeLog: * libgnat/s-aridou.ads (Add_With_Ovflo_Check): Adjust description. (Subtract_With_Ovflo_Check): Likewise. (Multiply_With_Ovflo_Check): Likewise. (Sc

[COMMITTED 09/19] ada: Remove Raise_Exception_On_Error

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Raise_Exception_On_Error is never modified so it can be removed. gcc/ada/ChangeLog: * err_vars.ads: Remove Raise_Exception_On_Error and Error_Msg_Exception. * errout.ads: Same as above. * errout.adb: Remove uses of Raise_Exception_On_Error and

[COMMITTED 07/19] ada: Refactor code for printing the error location

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * errout.adb: Use Output_Msg_Location * erroutc.adb: add common implementation for printing the error message line. * erroutc.ads: Add new method Output_Msg_Location * errutil.adb: use Output_Msg_Location Tested on x8

[COMMITTED 11/19] ada: Refactor checking redundant messages

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Move common code between errout and errutil into a single function. gcc/ada/ChangeLog: * errout.adb: Use Is_Redundant_Error_Message. * erroutc.adb: Move the common code for checking if a message can be removed to Is_Redundant_Error_Message. * e

[COMMITTED 16/19] ada: Minor adjustments to error message for RM B.1(24)

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou The RM B.1(24) sub-clause says that imported entities cannot be initialized and it is checked in three contexts, aspect Import, pragma Import and pragma Import_Object, with slightly different error messages. Moreover, for the aspect, the error is given twice because that of t

[COMMITTED 10/19] ada: Remove Current_Node from Errout

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus This variable was used for Opt.Include_Subprogram_In_Messages activated by -gnatdJ. This switch has been removed so this variable is no longer used. gcc/ada/ChangeLog: * errout.ads: Remove Current_Node. * errout.adb: Remove uses of Current_Node. * par-

[COMMITTED 01/19] ada: Fix latent issue exposed by recent change in aggregate expansion

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou The tag is not assigned when a compile-time known aggregate initializes an object declared with an address clause/aspect. gcc/ada/ChangeLog: * freeze.adb: Remove clauses for Exp_Ch3. (Check_Address_Clause): Always reassign the tag for an object of a t

[COMMITTED 13/19] ada: Relocate implementation of Set_Msg_Insertion_Column

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus The implementation was duplicated in errout and errutil. Move the implementation to erroutc where other similar commonly used functions are. gcc/ada/ChangeLog: * errout.adb: Remove implemntation of Set_Msg_Insertion_Column. * erroutc.adb: Add implementation of

[COMMITTED 08/19] ada: Store error message kind as an enum

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Simplify the storage for the kind of error message under a single enumerator. This replaces the existing attributes with the following enumeration values. * Is_Warning_Msg => Warning * Is_Style_Msg => Style * Is_Info_Msg => Info * Is_Check_Msg => Low_Check, Medium_Check, High_C

[COMMITTED 04/19] ada: Change specifications of Uname subprograms

2024-11-26 Thread Marc Poulhiès
From: Ronan Desplanques The old specifications were ambiguous as to whether they expected actuals to have %s/%b suffixes. The new specifications also increases modularity across the board. gcc/ada/ChangeLog: * uname.ads (Is_Internal_Unit_Name, Is_Predefined_Unit_Name): Change sp

[COMMITTED 06/19] ada: Simplify code

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * diagnostics-converter.adb: Remove uses of Info_Warning type. Use common constructors to simplify implementation. * diagnostics-pretty_emitter.adb: Remove Info_Warning type. * diagnostics-utils.adb: Remove uses of Info_Warnin

[COMMITTED 03/19] ada: Remove use of global name buffer

2024-11-26 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the body of Fname.UF.Get_File_Name did a lot of juggling with the global name buffer, which made it hard to understand. This patch makes the body use local buffers instead. gcc/ada/ChangeLog: * fname-uf.adb (Get_File_Name): Use local name buffe

[COMMITTED 05/19] ada: Fix the file documenting the ali format

2024-11-26 Thread Marc Poulhiès
From: Jose Ruiz gcc/ada/ChangeLog: * doc/gnat_ugn/the_gnat_compilation_model.rst: The format of the ali file is documented in lib-writ.ads. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_ugn/the_gnat_compilation_mo

[COMMITTED 17/19] ada: Clean up previous change

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ChangeLog: * sem_res.adb (Valid_Conversion): Do not initialize Opnd_Type before calling Get_Corresponding_Mutably_Tagged_Type_If_Present. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 16 ++-- 1 file chang

[COMMITTED 12/19] ada: Remove Warn_Runtime_Raise attribute from Error_Msg_Object

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus The goal of this attribute is to raise a warning to an error when the -gnatwE flag is used. This is similar to the existing warnings as error behavior under the Warn_Err flag so it can be merged. gcc/ada/ChangeLog: * errout.adb: Set Warn_Err as true if Is_Runtime_Erro

[COMMITTED 02/19] ada: Clean up utility function

2024-11-26 Thread Marc Poulhiès
From: Ronan Desplanques This patch makes Sem_Util.Get_Library_Unit_Name use Uname more idiomatically. gcc/ada/ChangeLog: * sem_util.adb (Get_Library_Unit_Name): Improve use of Uname. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 10 ++ 1 file

[COMMITTED 19/19] ada: Do not use ATTR_ADDR_EXPR for 'Unrestricted_Access

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou Unlike for 'Access or 'Unchecked_Access, the Attribute_to_gnu routine passes ATTR_ADDR_EXPR to build_unary_op for 'Unrestricted_Access, which causes the processing done in build_unary_op to flatten the reference, in particular to remove all intermediate (view) conversions, whi

[COMMITTED 18/19] ada: Add minimal support for address clause/aspect on controlled objects

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou The clause and aspect have been accepted by the compiler for a few years, but the result is generally an internal compiler error or an incorrect finalization at run time. gcc/ada/ChangeLog: * exp_ch3.adb (Expand_N_Object_Declaration): Do not insert the tag as

[COMMITTED 14/19] ada: Relocate implementation of Write_Error_Summary

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Reuse the same implementation in Errout and Errutil. gcc/ada/ChangeLog: * errout.adb: Remove implmentation of Write_Error_Summary. * erroutc.adb: Add implemenetation of Write_Error_Summary. * erroutc.ads: Add spec of Write_Error_Summary. * erru

[COMMITTED 15/19] ada: Refactor code of Check_Ambiguous_Call and Valid_Conversion

2024-11-26 Thread Marc Poulhiès
From: Javier Miranda Code cleanup; factorizing code. gcc/ada/ChangeLog: * sem_ch2.adb (Check_Ambiguous_Call): Replace code factorized code by call to the new subprogram Is_Ambiguous_Operand. * sem_res.ads (Is_Ambiguous_Operand): New subprogram that factorizes pre

[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

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

Re: [PATCH] Ada: Fix build for dummy s-taprop

2025-01-03 Thread Marc Poulhiès
Thanks, The change is fine. FTR, the original change you're referring to is r11-902-gb68c1670b7d40b. Do you have write access to git? Marc Estevan Castilho writes: > From: "Estevan Castilho (Tevo)" > > --- > gcc/ada/libgnarl/s-taprop__dummy.adb | 11 ++- > 1 file changed, 2 insertio

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

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 03/30] ada: Add SIGPROT handler for CheriBSD

2024-12-12 Thread Marc Poulhiès
From: Daniel King gcc/ada/ChangeLog: * init.c (__gnat_error_handler): Handle SIGPROT (__gnat_install_handler): Install SIGPROT handler Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/init.c | 79 ++ 1 file changed

[COMMITTED 08/30] ada: Update documentation for External_Initialization

2024-12-12 Thread Marc Poulhiès
From: Ronan Desplanques This fixes an omission in the recent change that was made to file lookup for External_Initialization. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Update External_Initialization section. * gnat_rm.texi: Regenerate. * gnat

[COMMITTED 01/30] ada: Ensure minimum stack size for preallocated task stacks

2024-12-12 Thread Marc Poulhiès
From: Johannes Kliemann On targets with preallocated task stacks the minimum stack size is defined as a constant in System.Parameters. When adding preallocated tasks to the expanded code the compiler does not have direct access to that value. Instead generate the expression Max (Task_Size, Minimu

[COMMITTED 16/30] ada: Minor refactoring in expansion of array aggregates

2024-12-12 Thread Marc Poulhiès
From: Eric Botcazou This just moves a couple of checks done in conjunction with the predicate Aggr_Assignment_OK_For_Backend into its body and adds a couple of comments. No functional changes. gcc/ada/ChangeLog: * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Add Target formal

[COMMITTED 30/30] ada: Fix reference to Ada 2020 in comment

2024-12-12 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ChangeLog: * par-ch5.adb (Test_Statement_Required): Fix comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch5.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/pa

[COMMITTED 19/30] ada: Fix reference manual clauses

2024-12-12 Thread Marc Poulhiès
From: Ronan Desplanques The clauses in section 3.5 of the reference manual were moved around along the different Ada versions, which caused some comments in our source code to go out of date. This patch updates the references in those comments. gcc/ada/ChangeLog: * libgnat/a-tifiio.adb:

[COMMITTED 29/30] ada: Elide the copy for bit-packed aggregates in object declarations

2024-12-12 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. However, this requires a small trick in order for the expanded code not to be flagged as using the object uninitialized by the code generator. gcc/ada

[COMMITTED 23/30] ada: Fix internal error on loop parameter specifications

2024-12-12 Thread Marc Poulhiès
From: Piotr Trojanek Originally loop parameter specification only occurred in loops, but now it also occurs in quantified expressions. This patch guards against flagging non-loop nodes as null loop statements. This was causing internal compiler errors that were only visible with switch -gnatdk, w

[COMMITTED 24/30] ada: Refactor warning about null loops

2024-12-12 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Move call to Comes_From_Source to the outer if-statement. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 17

[COMMITTED 17/30] ada: Refactor code of Check_Ambiguous_Call and Valid_Conversion

2024-12-12 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ChangeLog: * sem_res.adb (Is_Ambiguous_Operand): Add missing decoration of the operand when it is labeled overloaded but has just one interpretation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 3 +-- 1 fil

[COMMITTED 25/30] ada: Improve task entry context detection

2024-12-12 Thread Marc Poulhiès
From: Ronan Desplanques Access parameters are not allowed in specifications of task entries. Before this patch, the compiler failed to detect that case in accept statements that were not directly in their task body's scopes. This patch fixes this issue. gcc/ada/ChangeLog: * sem_ch3.adb

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