[COMMITTED 5/8] ada: Fix error message about limited extensions

2025-10-02 Thread Marc Poulhiès
From: Ronan Desplanques Consider the following package: package P is type T1 is tagged limited null record; type T2 is new T1 with private; private type T2 is limited new T1 with null record; end P; It should be rejected because of ARM 7.3 (10.1/3). Before thi

[COMMITTED 4/8] ada: Unsigned_Base_Range aspect (part 4)

2025-10-02 Thread Marc Poulhiès
From: Javier Miranda Disable this feature; more work needed. gcc/ada/ChangeLog: * aspects.adb (Get_Aspect_Id): Return No_Aspect for Unsigned_Base_Range name. * sem_prag.adb (Analyze_Pragma): Disable pragma Unsigned_Base_Range. * par-ch4.adb (Scan_Apostrophe): Dis

Re: [PATCH wwwdocs] DCO: remove the name requirement

2025-10-02 Thread Marc Poulhiès
September 27, 2025 at 5:24 PM, "Marc Poulhiès" mailto:d...@kataplop.net?to=%22Marc%20Poulhi%C3%A8s%22%20%3Cdkm%40kataplop.net%3E > wrote: > > As discussed during the GNU Cauldron 2025, any difference with DCO 1.1 > is a bug. > Hello, I'm dropping my proposed

[COMMITTED 7/8] ada: Improve error for pre/post on generic formal subprogram in Ada 2012 mode

2025-09-29 Thread Marc Poulhiès
From: Piotr Trojanek Instead of saying that pragma placement is illegal, we now say that it would be legal in Ada 2022. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pre_Post_Condition): Handle contracts on generic formal subprograms like on declarations of access-to-subprogram

[COMMITTED 1/8] ada: Update the condition for ghost call arguments

2025-09-29 Thread Marc Poulhiès
From: Viljar Indus The SPARK RM specifies that the levels between the argument and the call shall have the same level. gcc/ada/ChangeLog: * ghost.adb (Check_Procedure_Call_Policies): Update the check between the levels of the argument and the call. Tested on x86_64-pc-linux-gnu

[PATCH wwwdocs] DCO: remove the name requirement

2025-09-27 Thread Marc Poulhiès
As discussed during the GNU Cauldron 2025, any difference with DCO 1.1 is a bug. Signed-off-by: Marc Poulhiès --- Hello, as discussed during the session today, I get that this name requirement is a "bug" and should be dropped. The other 4 points are identical to current DCO 1.1 text

[COMMITTED 02/10] ada: Spurious predicate check at default initialization

2025-09-23 Thread Marc Poulhiès
From: Javier Miranda For an object created by an object_declaration with no explicit initialization expression, if the type of the object is a record type (or a private record type) with no components and a dynamic predicate, then no predicate check must be performed at runtime (RM 3.2.4(31/5)).

[COMMITTED 07/10] ada: Fix missing warning when child packages hide homonym units

2025-09-23 Thread Marc Poulhiès
From: Denis Mazzucato Improve consistency of the warning message when child units are hiding other with'ed homonym package, regardless of the order of the context clauses. gcc/ada/ChangeLog: * sem_ch10.adb (Install_Siblings): Fix condition to emit warning. Tested on x86_64-pc-linux-gnu

[COMMITTED 09/10] ada: Improve robustness of stack usage tracking in concurrent contexts

2025-09-23 Thread Marc Poulhiès
From: Jose Ruiz Enabled computation of stack usage for tasks that have already initialized their stacks with the expected fill pattern. Ensured that stack usage snapshots for tasks are taken while the runtime is locked, to maintain consistency. For the environment task, approximated the stack o

[COMMITTED 08/10] ada: Refactor of Ultimate_Prefix

2025-09-23 Thread Marc Poulhiès
From: Denis Mazzucato gcc/ada/ChangeLog: * sem_util.adb (Ultimate_Prefix): Clean-up the loop condition by using Has_prefix instead of an explicit list of node kinds. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 6 +- 1 file changed, 1 inse

[COMMITTED 10/10] ada: Fix unnesting problem related to constructors

2025-09-23 Thread Marc Poulhiès
From: Bob Duff This patch fixes a bug in unnesting, which is used by the llvm back end. Exp_Unst relies on the Scope field of nodes to detect up-level references. Temps created by Prepend_Constructor_Procedure_Prologue could have an incorrect Scope, causing Exp_Unst to use an up-level reference

[COMMITTED 06/10] ada: Fix Is_Case_Choice_Pattern for allocators

2025-09-23 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * sem_case.adb (Is_Case_Choice_Pattern): Return False for allocators. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_case.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb inde

[COMMITTED 11/35] ada: Reject pragma Attach_Handler on procedures in protected bodies

2025-09-20 Thread Marc Poulhiès
From: Piotr Trojanek Pragma Attach_Handler and Interrupt_Handler are only legal for procedures declared in protected definition. When given for procedures declared in protected body, they were wrongly accepted and triggered an odd error message from expansion. gcc/ada/ChangeLog: * sem_p

[COMMITTED 27/31] ada: Fix crash on reference to aliased object of packed array type with -g

2025-09-20 Thread Marc Poulhiès
From: Eric Botcazou This happens when the object is declared in another compilation unit. gcc/ada/ChangeLog: * gcc-interface/misc.cc (gnat_get_array_descr_info): In the record type case, bail out if the original array type cannot be retrieved. Tested on x86_64-pc-linux-gnu, com

[COMMITTED 17/35] ada: Avoid marking a ghost pragma twice

2025-09-20 Thread Marc Poulhiès
From: Viljar Indus Previously all assertion level pragmas were marked based on the current scope. Additionally some pragmas were marked afterwards based on the relevant entity e.g. Pre. This would lead to cases where a pragma was marked as both ignored and checked ghost pragma. Each pragma shoul

[COMMITTED 28/31] ada: Get rid of TYPE_ALIGN_OK flag in gcc-interface

2025-09-20 Thread Marc Poulhiès
From: Eric Botcazou The TYPE_ALIGN_OK flag had originally been a GCC flag tested in the RTL expander and was at some point kicked out of the middle-end to become a pure Gigi flag. But it's only set for tagged types and CW-equivalent types and can be replaced by a explicit predicate without too m

[COMMITTED 33/35] ada: Remove incorrect comment

2025-09-20 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * sem_ch3.adb (Analyze_Incomplete_Type_Decl): Remove incorrect comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcc/ada/sem_c

[COMMITTED 13/27] ada: Fix crash on iterator of type with Constant_Indexing aspect

2025-09-20 Thread Marc Poulhiès
From: Eric Botcazou This happens when the type returned by the indexing function is a private type whose completion is derived from another private type, because the Finalize_Address routine cannot correctly fetch the actual root type. gcc/ada/ChangeLog: * exp_util.adb (Finalize_Address

[COMMITTED 16/31] ada: Fix visibility bug related to target name

2025-09-20 Thread Marc Poulhiès
From: Bob Duff This patch fixes the following bug: If the right-hand side of an expression contains a target name (i.e. "@"), and also contains a reference to a user-defined operator that is directly visible because of a "use type" clause on a renaming of the package where the operator is declare

[COMMITTED 20/35] ada: Remove useless statements

2025-09-19 Thread Marc Poulhiès
From: Ronan Desplanques The initial value of fields of type Elist_Id is No_Elist, therefore the statements this patch removes were useless. gcc/ada/ChangeLog: * sem_ch7.adb (New_Private_Type): Remove useless statements. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/

[COMMITTED 18/31] ada: Apply ghost regions for assigmnents correctly

2025-09-18 Thread Marc Poulhiès
From: Viljar Indus When frontend is operating in GNATprove mode (where expander is disabled), it should check ghost policy for assignment statements just like it does for other statements. This is because we want ghost policy errors to be reported not just by GNAT, but also by GNATprove. Additio

[COMMITTED 22/31] ada: Update coding style

2025-09-18 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Policy): Update coding style. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb

[COMMITTED 20/31] ada: Check ghost level dependencies inside assignments

2025-09-17 Thread Marc Poulhiès
From: Viljar Indus Check that entities on the RHS are ghost level dependent on the entities on the LHS of the assignemnt. gcc/ada/ChangeLog: * ghost.adb (Is_OK_Statement): Check the levels of the assignee with the levels of the entity are ghost level dependent. (Check_As

[COMMITTED 35/35] ada: Warning for composite equality that calls an abstract equality function

2025-09-17 Thread Marc Poulhiès
From: Gary Dismukes When equality is tested for a composite type that has any record components whose type has an abstract equality function that will be called as part of the enclosing type's equality, Program_Error will be raised. We now issue a warning on the equality test, mentioning the com

[COMMITTED 07/31] ada: Refine condition for reporting warnings on components with abstract equality

2025-09-17 Thread Marc Poulhiès
From: Gary Dismukes The initial implementation of the warning resulted in unwanted false positives for types that have a user-defined equality function (in which case abstract equality on components will typically not ever be invoked). The conditions for reporting the warning are refined by this

[COMMITTED 17/31] ada: Compiler crash on container aggregate association with nonstatic key choice

2025-09-17 Thread Marc Poulhiès
From: Gary Dismukes The compiler blows up on a container aggregate with a container element association that has a key_choice given by a nonstatic key expression. This happens in the size computation for the aggregate due to calling Update_Choices with the nonstatic expression. The fix is simply

[COMMITTED 11/31] ada: Allow implicit packing of arrays when larger than needed

2025-09-17 Thread Marc Poulhiès
From: Bob Duff For Implicit_Packing, do not require the Size clause to exactly match the packed size. For example, an array of 7 Booleans will fit in 7 bits if packed, or 7*8=56 bits if not packed. This patch allows "for T'Size use 8;" to force packing in Implicit_Packing mode; previously, the c

[COMMITTED 17/27] ada: Update ghost code SPARK RM rules

2025-09-17 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * contracts.adb: Update SPARK RM reference numbers. * freeze.adb: Likewise. * ghost.adb: Likewise. * ghost.ads: Likewise. * sem_ch12.adb: Likewise. * sem_ch3.adb: Likewise. * sem_ch6.adb: Likewise.

[COMMITTED 08/27] ada: Improve ghost region creation for pragmas

2025-09-17 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * atree.adb (Mark_New_Ghost_Node): Set Is_Implicit_Ghost for all newly created nodes. * gen_il-fields.ads (Is_Implicit_Ghost): New attribute. * gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Implicit_Ghost attribute

[COMMITTED 24/31] ada: Create a ghost region for pragma annotate

2025-09-17 Thread Marc Poulhiès
From: Viljar Indus Create a ghost region for pragma annotate so that we are able to analyze the entity references correctly inside the pragma. gcc/ada/ChangeLog: * sem_prag.adb: Create a ghost region for pragma annotate before analyzing its arguments. Tested on x86_64-pc-linux-

[COMMITTED 19/35] ada: Replace Preelaborable_Initialization pragmas with equivalent aspect specs

2025-09-17 Thread Marc Poulhiès
From: Denis Mazzucato All Preelaborable_Initialization pragmas in the language-defined units are replaced by the equivalent Preelaborable_Initialization aspect. gcc/ada/ChangeLog: * targparm.adb (Get_Target_Parameters): Address type declaration doesn't ends anymore with a semico

[COMMITTED 2/2] ada: Fix error message for Stream_Size

2025-09-16 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, confirming Stream_Size aspect specifications on elementary types were incorrectly rejected when the stream size was 128, and the error messages emitted for Stream_Size aspect errors gave incorrect possible values. This patch fixes this. The most signifi

[COMMITTED 1/2] ada: Revert "Remove dependence on secondary stack for type with controlled component"

2025-09-16 Thread Marc Poulhiès
From: Gary Dismukes This reverts commit 91b51fc42b167eedaaded6360c490a4306bc5c55. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 49 ++--- gcc/ada/exp_ch6.ads | 6 -- gcc/ada/exp_ch7.adb | 20 +- 3 file

[COMMITTED 09/27] ada: Implement Super aspect and improve implementation of related features.

2025-09-15 Thread Marc Poulhiès
From: Steve Baird Implement the GNAT-defined Super aspect (which should not be confused with with the Super attribute). For a two-part constructor procedure declaration, an Initialize aspect specification is permitted on the subprogram body, and not on the subprogram specification (this reverses

[COMMITTED 26/27] ada: Remove dependence on secondary stack for type with controlled component

2025-09-15 Thread Marc Poulhiès
From: Gary Dismukes There are cases where GNAT introduces a dependence on the secondary stack in a build-in-place function with a result subtype that is definite, when this dependence could be avoided. In particular this is done for record types that requires finalization due to having a control

[COMMITTED 07/27] ada: Remove the note that GNAT LLVM doesn't ship the light runtime

2025-09-15 Thread Marc Poulhiès
From: Sebastian Poeplau gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove the note on light runtimes. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_ugn/building_executable_programs_with_gnat.rst| 3 +-- 1 file chang

[COMMITTED 24/27] ada: Document hardening features not supported by LLVM

2025-09-15 Thread Marc Poulhiès
From: Jose Ruiz gcc/ada/ChangeLog: * doc/gnat_rm/security_hardening_features.rst: clarify that hardening options are not supported by the LLVM back end. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on m

[COMMITTED 21/27] ada: C_Pass_By_Copy convention incorrectly ignored

2025-09-15 Thread Marc Poulhiès
From: Steve Baird In some cases involving a convention-C anonymous access-to-subprogram type with a parameter whose type has a convention of C_Pass_By_Copy, that C_Pass_By_Copy convention is incorrectly ignored. gcc/ada/ChangeLog: * freeze.adb (Freeze_Entity): In the case of an anonymou

[COMMITTED 10/27] ada: Avoid ghost context check in early freeze

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus We freeze the expression for expression functions that complete before we have set up the ghost region from both the existing spec and body. Avoid triggering the ghost context checks during the analysis for this early freeze as the expression will be reanalyzed when we analyze

[COMMITTED 02/27] ada: Disable ghost context checks before context is set

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus There are cases where we need to analyze the argument of the pragma in order to determine the ghostliness of the pragma. However during that analysis the ghost region of the pragma is not set yet so we cannot perform the ghost context checks at that moment. This patch provides

[COMMITTED 05/27] ada: Don't generate call of `System.Standard_Library.Adafinal`

2025-09-15 Thread Marc Poulhiès
From: Vadim Godunko `adafinal` is not available on targets without standard library. gcc/ada/ChangeLog: * bindgen.adb (Gen_Adafinal): Don't generate call of adafinal when use of standard library suppressed. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/bindg

[COMMITTED 15/27] ada: Fix the condition of ghost level dependencies inside assignments

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus The assignee should depend on the level of all of the ghost entiies with the assignment. gcc/ada/ChangeLog: * ghost.adb (Check_Assignee_Levels): Fix the condition and improve error message handling. Tested on x86_64-pc-linux-gnu, committed on master. --- gc

[COMMITTED 16/27] ada: Refactor ghost argument consistency checks

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus Create a new method for checking and emitting errors on pragmas Unused, Unrefefrenced, Unreferenced_Objects, Inline and No_Return that support specifying multiple entities as arguments. Emit an error when one argument is ghost and the other is not and when one argument has a g

[COMMITTED 20/27] ada: Add Assertion_Policy checks for assertion levels

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus Implement SPARK RM 6.9(19) check: An Assertion_Policy pragma specifying an Assertion_Level policy shall not occur within a ghost subprogram or package associated to an assertion level which depends on this level. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma): A

[COMMITTED 04/27] ada: Fix code generation when there is no No_Finalization restiction

2025-09-15 Thread Marc Poulhiès
From: Vadim Godunko Check whether library is elaborated is not generated when there is not standard library available on target. gcc/ada/ChangeLog: * bindgen.adb (Gen_Adafinal): Don't generate code when use of standard library suppressed. Tested on x86_64-pc-linux-gnu, committe

[COMMITTED 22/27] ada: Match assertion levels by name

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus Since Assertion_Levels cannot be named after valid assertion names we no longer need the policies to be matched by entity. gcc/ada/ChangeLog: * sem_prag.adb (Get_Applicable_Policy): Match assertion levels by name. Tested on x86_64-pc-linux-gnu, committed on m

[COMMITTED 12/27] ada: Fix missing finalization for qualified expression in conditional expression

2025-09-15 Thread Marc Poulhiès
From: Eric Botcazou A qualified expression around a function call may cause a temporary to be created and, therefore, cannot be bypassed in Expand_Ctrl_Function_Call. gcc/ada/ChangeLog: * exp_util.ads (Unqualified_Unconditional_Parent): New function. * exp_util.adb (Unconditiona

[COMMITTED 27/27] ada: Fix internal error on aspect in complex object declaration

2025-09-15 Thread Marc Poulhiès
From: Eric Botcazou The sufficient conditions are that the aspect be deferred and the object be rewritten as a renaming because of the complex initialization expression. gcc/ada/ChangeLog: * gcc-interface/trans.cc (gnat_to_gnu) : Deal with objects whose elaboration is de

[COMMITTED 25/27] ada: Fix wrong finalization of aliased array of bounded vector

2025-09-15 Thread Marc Poulhiès
From: Eric Botcazou The problem is that Apply_Discriminant_Check introduces an unnecessary temporary for an assignment where both sides have the same constrained subtype but the left-hand side is an aliased component. This comes from an approximation in the implementation introduced long time ag

[COMMITTED 19/27] ada: Fix ghost condition for level dependencies for assignments

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * ghost.adb (Check_Assignment_Policies): The level of the assignee should depend on the level of the region. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 8 +--- 1 file changed, 5 insertions(+), 3 deletio

[COMMITTED 23/27] ada: Avoid ghost context errors when preanalyzing Loop_Invariant

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma): Disable context checks for the preanalysis of the expression for Loop_Invariant pragmas as the ghost region for the pragma has not been set up yet. Tested on x86_64-pc-linux-gnu, committed on master.

[COMMITTED 06/27] ada: Recommend GPR's Toolchain_Name for GNAT LLVM more prominently

2025-09-15 Thread Marc Poulhiès
From: Sebastian Poeplau gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move recommendation of Toolchain_Name up. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- ...building_executable_programs_with_gna

[COMMITTED 18/27] ada: Remove checks for the old rule 20

2025-09-15 Thread Marc Poulhiès
From: Viljar Indus This rule was removed. This can scenario can be detected by Rule 18. gcc/ada/ChangeLog: * ghost.adb (Is_Ok_Pragma): Remove calls to Check_Policies. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 48 +-

[COMMITTED 03/27] ada: Add `Set_[Wide_]Wide_String` subprograms to auxiliary packages.

2025-09-15 Thread Marc Poulhiès
From: Vadim Godunko gcc/ada/ChangeLog: * libgnat/a-swunau.ads (Set_Wide_String): New subprogram. * libgnat/a-swunau.adb (Set_Wide_String): Likewise. * libgnat/a-swunau__shared.adb (Set_Wide_String): Likewise. * libgnat/a-szunau.ads (Set_Wide_Wide_String): Likewise

[COMMITTED 11/27] ada: Fix section of Finalizable extension in GNAT RM

2025-09-15 Thread Marc Poulhiès
From: Ronan Desplanques The generalized finalization extension was awarded the title of curated extension some time ago, but this wasn't reflected in the GNAT reference manual before this patch, which moves the documentation for generalized finalization in the curated extension section. gcc/ada/

[COMMITTED 01/27] ada: Fix documentation of Is_Ancestor_Package

2025-09-15 Thread Marc Poulhiès
From: Ronan Desplanques "Is_Ancestor_Package (E, E)" returns True and this patch fixes a comment that claimed otherwise. This patch also renames an object local to Is_Ancestor_Package that was misleadingly named "Par", a common abbreviation of "Parent". gcc/ada/ChangeLog: * sem_util.ads

[COMMITTED 26/35] ada: Remove unnecessary if statement

2025-09-14 Thread Marc Poulhiès
From: Ronan Desplanques Calling Check_Nonoverridable_Aspects only makes sense when the full type declaration being analyzed is the completion of a partial view, and the one call site of this procedure ensures this. Therefore the handling of all the possible cases of completion in the procedure th

[COMMITTED 23/31] ada: Check instantces of ghost iterator functions

2025-09-13 Thread Marc Poulhiès
From: Viljar Indus Since we do not analyze the policy errors for expanded code we need to check the functions specified in the Iterable aspect whenever we are analyzing an iterator spcification with that aspect. gcc/ada/ChangeLog: * sem_ch5.adb (Analyze_Iterator_Specification): Check gh

[COMMITTED 21/35] ada: Create a pragma to emit a misplaced Storage_Size aspect error

2025-09-13 Thread Marc Poulhiès
From: Viljar Indus We do not emit an error on misplaced Strorage_Size error when the aspect is not applied to a task (or an access type). We instead create an attribute definition which is ignored most of the time. Create a temporary pragma for the aspect specification to emit the same misplaced

[COMMITTED 30/31] ada: Minor comment tweaks

2025-09-11 Thread Marc Poulhiès
gcc/ada/ChangeLog: * env.c (__gnat_clearenv): Adjust comment. * libgnarl/a-intnam__bsd.ads: Fix copyright date. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/env.c | 3 ++- gcc/ada/libgnarl/a-intnam__bsd.ads | 2 +- 2 files changed, 3 inser

[COMMITTED 27/35] ada: Fix comment in Find_Type_Name

2025-09-11 Thread Marc Poulhiès
From: Ronan Desplanques The comment this patch changes was made incorrect by the possibility of completing an incomplete view with a private type declaration in Ada 2012. To avoid any possible confusion, this patch brings the comment up to date. gcc/ada/ChangeLog: * sem_ch3.adb (Find_Ty

[COMMITTED 16/35] ada: Avoid renamed declaration becoming both ignored and checked

2025-09-11 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * ghost.adb (Mark_Ghost_Declaration_Or_Body): Mark ghost entity explicitly as ignored or checked. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 37 + 1 file changed, 33 inse

[COMMITTED 29/31] ada: Give a warning for huge imported objects

2025-09-11 Thread Marc Poulhiès
From: Eric Botcazou This is a follow-up to a recent change, where a warning was implemented for huge library-level objects. However it is not given if the objects are imported, although an indirection is also added for them under the hood to match the export side. gcc/ada/ChangeLog: *

[COMMITTED 13/35] ada: Fix ghost policy detection for declarations

2025-09-11 Thread Marc Poulhiès
From: Viljar Indus Declarations should take the ghost policy from the region if they do not have an explicit ghost aspect/pragam themselves. gcc/ada/ChangeLog: * ghost.adb (Mark_And_Set_Ghost_Declaration): apply the ghost policy and level from the declaration only if the declara

[COMMITTED 14/31] ada: Fix regression in Root_Type

2025-09-11 Thread Marc Poulhiès
From: Bob Duff Previous change, "Make pp and friends more robust (base type only)" introduced a bug in Root_Type. Etype (T) can, in fact, be Empty (but only in case of errors.) This patch fixes it. gcc/ada/ChangeLog: * einfo-utils.adb (Root_Type): Deal with missing Etype. (Root_

[COMMITTED 13/31] ada: Crash on b3a1004 with assertions enabled

2025-09-11 Thread Marc Poulhiès
From: Javier Miranda The compilation of files b3a10041.ads and b3a10042.adb crash when the compiler is built with assertions enabled. gcc/ada/ChangeLog: * freeze.adb (Freeze_Entity): Protect call to Associated_Storage_Pool since it cannot be used when the Etype is not set.

[COMMITTED 08/31] ada: Disable signals when calling pthread_create on QNX

2025-09-11 Thread Marc Poulhiès
From: Johannes Kliemann The QNX Certified Products Defect Notification from February 2025 mentions a potential memory leak when pthread_create is interrupted by a signal. It recommends to disable signals for this function call. gcc/ada/ChangeLog: * adaint.c: Add functions to disable and

[COMMITTED 31/31] ada: add BACKLOG_MAX OS constant

2025-09-11 Thread Marc Poulhiès
BACKLOG_MAX represents the number of outstanding connections in the socket's listen queue. gcc/ada/ChangeLog: * libgnat/g-socket.adb (Listen_Socket): Change default value. * libgnat/g-socket.ads (Listen_Socket): Likewise. * s-oscons-tmplt.c (BACKLOG_MAX): New. Tested on x

[COMMITTED 19/31] ada: Tune description of Ghost_Assertion_Level

2025-09-11 Thread Marc Poulhiès
From: Piotr Trojanek Fix grammar in comment. gcc/ada/ChangeLog: * einfo.ads (Ghost_Assertion_Level): Fix comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/

[COMMITTED 25/31] ada: Perform predicate check before, not after, parameter copy back.

2025-09-11 Thread Marc Poulhiès
From: Steve Baird In the case of a call to a subprogram that has an out (or in-out) parameter that is passed by copy, the caller performs copy-back after the call returns. If the actual parameter is a view conversion to a subtype that has an enabled predicate, then the predicate check performed a

[COMMITTED 21/31] ada: Ignore ghost policy errors inside aspect Iterable

2025-09-11 Thread Marc Poulhiès
From: Viljar Indus It is OK to define a checked ghost type with an iterable aspect that has ignored Iterable functions. gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Policy): Avoid triggering a ghost policy error if the policy is referenced within the Iterable aspect. Tes

[COMMITTED 26/31] ada: Implement overflow checking for unsigned types

2025-09-11 Thread Marc Poulhiès
From: Eric Botcazou The implementation is essentially mirrored from the one for signed types. gcc/ada/ChangeLog: * gcc-interface/gigi.h (standard_datatypes): Add ADT_uns_mulv64_decl and ADT_uns_mulv128_decl. (uns_mulv64_decl): New macro. (uns_mulv128_decl): Likew

[COMMITTED 15/31] ada: Fix regression in Root_Type -- adjustment

2025-09-11 Thread Marc Poulhiès
From: Bob Duff Recent changes "Fix regression in Root_Type" and "Crash on b3a1004 with assertions enabled" are partially redundant; they are addressing the same bug. This patch adjusts the former in the case of Root_Type. But we leave Root_Type_If_Set alone; debugging printouts should survive bug

[COMMITTED 12/31] ada: Fix argument type of read() and write() on windows

2025-09-11 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * libgnat/s-crtl.ads: define unsigned * libgnat/s-crtl__mingw.adb (read, write): change arg type Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-crtl.ads| 3 +++ gcc/ada/libgnat/s-crtl__mingw.adb | 8

[COMMITTED 04/31] ada: Better warning when single letter package conflicts with predefined unit naming

2025-09-11 Thread Marc Poulhiès
From: Denis Mazzucato This patch improves the warning message when the actual file name of a child package with a single letter parent isn't the expected one because it may collide with a predefined unit name. The warning explain why in this specific case the expected name is not the standard one

[COMMITTED 09/31] ada: Make pp and friends more robust (base type only)

2025-09-11 Thread Marc Poulhiès
From: Bob Duff Prior to this fix, if pp(N) tried to print a "base type only" field, and Base_Type(N) was not yet set, it would raise an exception, which was confusing. This patch makes it simply ignore such fields. Similarly for Impl_Base_Type_Only and Root_Type_Only fields. We do this by having

[COMMITTED 10/31] ada: Crash on null aggregate of multidimensional type

2025-09-11 Thread Marc Poulhiès
From: Javier Miranda A compiler built with assertions enabled crashes processing a null aggregate of multidimensional type. gcc/ada/ChangeLog: * sem_aggr.adb (Report_Null_Array_Constraint_Error): Adjust code for reporting the error on enumeration types. (Resolve_Null_Arr

[COMMITTED 05/31] ada: Fix compile time evaluation needed for static unfoldings

2025-09-11 Thread Marc Poulhiès
From: Denis Mazzucato Unfolding of static expressions is needed when evaluating static bounds, even in the presence of strict analysis. Otherwise, we may wrongly identify static predicates as dynamic ones, and thus require unnecessary "others" default case. gcc/ada/ChangeLog: * sem_attr

[COMMITTED 02/31] ada: Improve documentation comment of Find_Type_Name

2025-09-11 Thread Marc Poulhiès
From: Ronan Desplanques The meaning of the return value of Find_Type_Name depends greatly on whether the declaration it's passed is a completion. This patch adds a description of this to the documentation comment of Find_Type_Name. gcc/ada/ChangeLog: * sem_ch3.ads (Find_Type_Name): Impr

[COMMITTED 06/31] ada: Fix comments

2025-09-11 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a reference to an Ada RM clause, fixes an occurrence of "unconstrained" that should have been "indefinite", and removes an incorrect claim that completing a partial view without discriminants with a full view with defaulted discriminants is an error situat

[COMMITTED 01/31] ada: Disable new warning for composite equality ops that can raise Program_Error

2025-09-11 Thread Marc Poulhiès
From: Gary Dismukes The new warning is spuriously flagged on membership tests in vss-xml-implementation-html_writer_data.adb, leading to the GNAT CB failing, so we disable it until that issue can be resolved. gcc/ada/ChangeLog: * exp_ch4.adb (Warn_On_Abstract_Equality_For_Component): Te

[COMMITTED 03/31] ada: Set Related_Expression on compiler-generated Valid_Scalars functions

2025-09-11 Thread Marc Poulhiès
From: Tucker Taft When creating the local functions to implement the Valid_Scalars attribute for array and record types, set a Related_Expression that points to the original attribute reference (blah'Valid_Scalars). This allows the Inspector to give a more user-friendly name when these functions

[COMMITTED 02/35] ada: Unsigned_Base_Range aspect

2025-09-09 Thread Marc Poulhiès
From: Javier Miranda This patch adds support for a new GNAT aspect/pragma for integer type definitions to explicitly enforce the use of an unsigned base type. gcc/ada/ChangeLog: * aspects.ads (Aspect_Unsigned_Base_Range): New aspect. * checks.adb (Determine_Range): Handle types

[COMMITTED 10/35] ada: Avoid performing policy checks on ignored ghost pragmas

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus These pragamas are already disabled if the relative ghost entity is disabled. gcc/ada/ChangeLog: * ghost.adb (Is_OK_Pragma): mark the context of ignored ghost pragmas as OK. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 7 +

[COMMITTED 25/35] ada: Improve documentation comment

2025-09-09 Thread Marc Poulhiès
From: Ronan Desplanques The new version of the comment makes it clearer that Check_Nonoverridable_Aspects is only concerned with cases where a partial view is present. This patch also fixes a reference to an ARM clause in the comment. gcc/ada/ChangeLog: * sem_ch3.adb (Check_Nonoverrida

[COMMITTED 23/35] ada: Adding support to defer the addition of extra formals (part 2)

2025-09-09 Thread Marc Poulhiès
From: Javier Miranda Adjust previous patch to improve the support for AI05-0151-1/08. gcc/ada/ChangeLog: * exp_attr.adb (Rewrite_Attribute_Proc_Call): Add new parameter to calls to Create_Extra_Formals. (Expand_N_Attribute_Reference): Ditto. * exp_ch3.adb (Expand

[COMMITTED 14/35] ada: Fix ghost policy change detection for procedure calls

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Policy): Use the policy in affect for the identifier at the current moment instead of the region around it when checking a policy change for a procedure call. Tested on x86_64-pc-linux-gnu, committed on maste

[COMMITTED 08/35] ada: Check restriction No_Secondary_Stack for overflow elimination

2025-09-09 Thread Marc Poulhiès
From: Piotr Trojanek When overflow checks are eliminated using System.Bignums package, we must check if secondary stack that is necessary for this package is available. gcc/ada/ChangeLog: * checks.adb (Make_Bignum_Block): Check restriction No_Secondary_Stack. Tested on x86_64-pc-linux-

[COMMITTED 29/35] ada: Improve comments in Copy_And_Swap

2025-09-09 Thread Marc Poulhiès
From: Ronan Desplanques This patch replaces usages of "attribute" with the more appropriate "field" when referring to Gen_IL fields, to avoid confusion with Ada's concept of attributes. This patch also makes comments more explicit about Gen_IL IDs and slots around a call to the low-level Atree.E

[COMMITTED 15/35] ada: The policy of a generic can be different within a instantiation

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Policy): ignore ghost policy changes within instantiation statements. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --gi

[COMMITTED 18/35] ada: Typo fix in comment

2025-09-09 Thread Marc Poulhiès
gcc/ada/ChangeLog: * s-pack.adb.tmpl: Typo fix in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/s-pack.adb.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/s-pack.adb.tmpl b/gcc/ada/s-pack.adb.tmpl index e54f3befd4f..b21d4129257

[COMMITTED 30/35] ada: Update the uses of Is_Ignored*_In_Codegen

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus Replace calls to Is_Ignored_Ghost_Entity and Predicates_Ignored with their In_Codegen versions in places where we would analyze those nodes differently from checked nodes. Describe the motive and use cases for those In_Codegen functions. gcc/ada/ChangeLog: * contract

[COMMITTED 32/35] ada: Ignore Ghost policy checks for some pragmas

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus Some pragmas where the ghostness is based on the argument of the pragma triggered ghost policy errors because we had not marked the pragmas as ghost. However we could only do so once the argument of the pragma was analyzed. We can safely ignore the policy checks for those prag

[COMMITTED 31/35] ada: Platform-specific import for read() and write()

2025-09-09 Thread Marc Poulhiès
From: Tonu Naks read() and write() return int on windows, whereas on Posix systems the return type is ssize_t (effectively long_int). The object file was added to GNAT_ADA_OBJS only, although the unit is also in the compilation closure of GNATbind, but this was harmless because the object file w

[COMMITTED 12/35] ada: Fix inheritance of Is_Primitive and legality check for nonoverridable aspects

2025-09-09 Thread Marc Poulhiès
From: Denis Mazzucato This patch fixes the identification of inherited subprograms as primitive operations via the Is_Primitive flag. This is essential in the context of the new legality check which makes sure that, if any subprogram denoted by a nonoverridable aspect of a type T with formal or r

[COMMITTED 28/35] ada: Spurious error on generalized prefix notation

2025-09-09 Thread Marc Poulhiès
From: Javier Miranda The compiler reports a spurious error when a primitive function of an untagged type that returns an array type is invoked using the prefix notation, and the sources are compiled with language extensions enabled. gcc/ada/ChangeLog: * sem_util.adb (Needs_One_Actual):

[COMMITTED 34/35] ada: Fix spurious warning for procedure named "Continue"

2025-09-09 Thread Marc Poulhiès
From: Ronan Desplanques The recent addition of a language extension for the "continue" nonreserved keyword caused spurious warnings about unreferenced subprograms for procedures named "Continue", because the call statements that are generated when identifiers are determined not to refer to the ke

[COMMITTED 24/35] ada: Add location info to policy difference errors

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Completion): Add location info to the policy messages. (Check_Ghost_Policy): Likwise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 18 ++ 1 file changed, 10 in

[COMMITTED 22/35] ada: Improve error message in the case of missing indices

2025-09-09 Thread Marc Poulhiès
From: Viljar Indus When both a missing index and an out of bounds error are present then we should also mention the error on out of bounds index as it suggests removing the index that is out of bounds rather than suggesting adding indices that are also out of bounds. gcc/ada/ChangeLog:

[COMMITTED 06/35] ada: Fix crash with global No_Tasking and async delays

2025-09-09 Thread Marc Poulhiès
From: Denis Mazzucato When optimizations are enabled, the runtime for delays is inlined and expanded. If No_Tasking is set globally, for instance via a configuration file, then the initialization of _Master, _Chain, and _Task_Name formals is skipped for task entities. Later during expansion, thes

  1   2   3   4   5   6   7   8   9   10   >