[COMMITTED] ada: Do not inline in GNATprove the subprograms with (Un)Hide_Info

2024-05-06 Thread Marc Poulhiès
From: Yannick Moy The annotations Hide_Info and Unhide_Info in GNATprove are meant to give special visibility in the corresponding scope to the precise definition of some entities. Hence, such scopes should not be inlined in GNATprove. gcc/ada/ * inline.adb

[COMMITTED] ada: Prevent inlining in GNATprove for memory leaks

2024-05-06 Thread Marc Poulhiès
From: Yannick Moy In some cases, inlining a call in GNATprove could lead to missing a memory leak. Recognize such cases and do not inline such calls. gcc/ada/ * inline.adb (Call_Can_Be_Inlined_In_GNATprove_Mode): Add case to prevent inlining of call. * inline.ads:

[COMMITTED] ada: Adjust source location for degenerate scope master

2024-05-06 Thread Marc Poulhiès
From: Eric Botcazou When the finalization scope master degenerates into a simple master node, the latter must inherit the source location that the former would have had. gcc/ada/ * exp_ch7.adb (Build_Finalizer.Process_Object_Declaration): Adjust the Sloc of the master node

[PATCH] fix single argument static_assert

2024-05-02 Thread Marc Poulhiès
Single argument static_assert is C++17 only. gcc/ChangeLog: * value-range.h: fix static_assert to use 2 arguments. --- Ok for master? gcc/value-range.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index

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

2024-04-26 Thread Marc Poulhiès
Marek Polacek writes: Hello, >> + Experimental features: >> +> href="https://gcc.gnu.org/onlinedocs/gnat_rm/Pragma-Storage_005fModel.html;>Storage >> +Model: this feature proposes to redesign the concepts of Storage >> Pools >> +into a more efficient model allowing higher

[COMMITTED] gcc-14: Add Ada changes

2024-04-26 Thread Marc Poulhiès
Co-authored-by: Fernando Oleo Blanco Co-authored-by: Piotr Trojanek Signed-off-by: Marc Poulhiès --- htdocs/gcc-14/changes.html | 67 +- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html

[PATCH v2] gcc-14: Add Ada changes

2024-04-18 Thread Marc Poulhiès
Co-authored-by: Fernando Oleo Blanco --- Hello Fernando, Thanks again for your changes. After consulting other colleagues, I'm proposing this revised version. Does that look ok to you? As it was simpler I've created a new commit with a Co-authored-by line, but can easily change that if you

Re: [wwwdocs] Add Ada's GCC 14 changelog entry

2024-02-26 Thread Marc Poulhiès
Fernando Oleo Blanco writes: > Dear all, > > just like last year, I would like to commit the changes that took place > over at GNAT for GCC v14. The patch is attached to the email. Hopefully > it is good enough to just be added to master. If you see something wrong > or if you would like to

[COMMITTED] Update year in Gnatvsn

2024-01-23 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ * gnatvsn.ads: Update year. --- gcc/ada/gnatvsn.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads index 934c22206f7..29238362cc0 100644 --- a/gcc/ada/gnatvsn.ads +++ b/gcc/ada/gnatvsn.ads @@

[COMMITTED] ada: Document new SPARK aspect and pragma Always_Terminates

2024-01-09 Thread Marc Poulhiès
From: Piotr Trojanek Add description of a recently added SPARK contract. gcc/ada/ * doc/gnat_rm/implementation_defined_aspects.rst, doc/gnat_rm/implementation_defined_pragmas.rst: Add sections for Always_Terminates. * gnat-style.texi: Regenerate. *

[COMMITTED] ada: Fix bogus Constraint_Error on allocator for access to array of access type

2024-01-09 Thread Marc Poulhiès
From: Eric Botcazou This occurs because the access element type is not its own TYPE_CANONICAL, which creates a discrepancy between the aliasing support code, which deals with types directly, and the middle-end which looks at TYPE_CANONICAL only. gcc/ada/ * gcc-interface/decl.cc

[COMMITTED] ada: Do not count comparison of addresses as a modification

2024-01-09 Thread Marc Poulhiès
From: Viljar Indus In some extended code we generate comparisons between the Addresses of some variables. This causes those variables to be considered modified. Whereas in this particular scenario the variables are just referenced. gcc/ada/ * sem_attr.adb: avoid marking a use of the

[COMMITTED] ada: Allow passing private types to generic formal incomplete types

2024-01-09 Thread Marc Poulhiès
From: Bob Duff It is legal to pass a private type, or a type with a component whose type is private, as a generic actual type if the formal is a generic formal incomplete type. This patch fixes a bug in which the compiler would give an error in some such cases. Also misc cleanup. gcc/ada/

[COMMITTED] ada: Remove unused runtime entity

2024-01-09 Thread Marc Poulhiès
From: Eric Botcazou The compiler has not generated direct attachments for a long time. gcc/ada/ * rtsfind.ads (RE_Id): Remove RE_Attach. (RE_Unit_Table): Likewise. * libgnat/s-finmas.ads (Attach): Delete. * libgnat/s-finmas.adb (Attach): Likewise. Tested on

[COMMITTED] ada: More aggressive inlining of subprogram calls in GNATprove mode

2024-01-09 Thread Marc Poulhiès
From: Piotr Trojanek Previously if a subprogram call could not be inlined in GNATprove mode, then all subsequent calls to the same subprogram were not inlined either (because a failed attempt to inline clears flag Is_Inlined_Always and we tested this flag when attempting to inline subsequent

[COMMITTED] ada: Preliminary cleanup in aliasing support code

2024-01-09 Thread Marc Poulhiès
From: Eric Botcazou This declares an explicit temporary for the fields of the fat pointer type in gnat_to_gnu_entity and removes the GNU_ prefix of the parameters of the relate_alias_sets routine for the sake of brevity. No functional changes. gcc/ada/ * gcc-interface/decl.cc

[COMMITTED] ada: Remove dead detection of recursive inlined subprograms

2024-01-09 Thread Marc Poulhiès
From: Piotr Trojanek Inlining of subprogram calls happens in routine Expand_Inlined_Call which calls Establish_Actual_Mapping_For_Inlined_Call. Both routines had detection of recursive calls. The detection in the second routine was dead code. gcc/ada/ * inline.adb

[COMMITTED] ada: Fix internal error on class-wide allocator inside if-expression

2024-01-09 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the freeze node for the class-wide subtype built for the expression of the allocator escapes from the dependent expression instead of being stored in its list of actions. gcc/ada/ * freeze.adb (Freeze_Expression.Has_Decl_In_List): Deal

[COMMITTED] ada: Fix limited_with in Check_Scil; allow for <> in pp of aggregate

2024-01-09 Thread Marc Poulhiès
From: Tucker Taft Check_Scil failed due to not handling a type that came from a package that was mentioned in a limited-with clause. Also, an aggregate with an uninitialized component was not being pretty-printed properly. gcc/ada/ * pprint.adb (List_Name): Check for "Box_Present"

[COMMITTED] ada: Remove dead code for GNATprove inlining

2024-01-09 Thread Marc Poulhiès
From: Piotr Trojanek Removed code was dead because it could only be executed when Back_End_Inlining is True and that flag is always false in GNATprove_Mode. gcc/ada/ * inline.adb (Cannot_Inline): Cleanup use of 'Length; remove dead code. Tested on x86_64-pc-linux-gnu,

[COMMITTED] ada: Remove side effects depending on the context of subtype declaration

2024-01-09 Thread Marc Poulhiès
From: Piotr Trojanek In GNATprove mode the removal of side effects is only needed in certain syntactic contexts, which include subtype declarations. Now this removal is limited to genuine subtype declarations and not to itypes coming from expressions where side effects are not expected.

[COMMITTED] ada: Add __atomic_store_n binding to System.Atomic_Primitives

2024-01-09 Thread Marc Poulhiès
From: Eric Botcazou This is modeled on the existing binding for __atomic_load_n. gcc/ada/ * libgnat/s-atopri.ads (Atomic_Store): New generic procedure. (Atomic_Store_8): New instantiated procedure. (Atomic_Store_16): Likewise. (Atomic_Store_32): Likewise.

[COMMITTED] ada: Excess elements created for indexed aggregates with iterator_specifications

2024-01-09 Thread Marc Poulhiès
From: Gary Dismukes In the case of an indexed aggregate of a container type with both Add_Unnamed and New_Indexed specified in the Aggregate aspect of the type (such as for the Vector type in Ada.Containers.Vectors), in cases where a component association is given by an iterator_specification,

[COMMITTED] ada: Minor change replacing "not Present" tests with "No" tests

2024-01-09 Thread Marc Poulhiès
From: Gary Dismukes Fixing two places flagged by gnatcheck to use "No" instead of "not Present". gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Change "not Present" tests to tests using "No" (in two places). Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Cannot requeue to a procedure implemented by an entry

2024-01-09 Thread Marc Poulhiès
From: Javier Miranda Add missing support for RM 9.5.4(5.6/4): the target of a requeue statement may be a procedure when its name denotes a renaming of an entry. gcc/ada/ * sem_ch6.adb (Analyze_Subprogram_Specification): Do not replace the type of the formals with its

[COMMITTED] ada: Remove unreachable code in Resolve_Extension_Aggregate

2024-01-09 Thread Marc Poulhiès
From: Eric Botcazou The only functions using the BIP protocol are now those returning a limited type: Is_Build_In_Place_Result_Type => Is_Inherently_Limited_Type. gcc/ada/ * sem_aggr.adb (Resolve_Extension_Aggregate): Remove the unreachable call to Transform_BIP_Assignment as

[COMMITTED] ada: Fix bug in Sem_Util.Enclosing_Declaration

2024-01-09 Thread Marc Poulhiès
From: Steve Baird Fix Sem_Util.Enclosing_Declaration to not return an N_Subprogram_Specification node. Remove code in various places that was formerly needed to cope with this misbehavior. gcc/ada/ * sem_util.adb (Enclosing_Declaration): Instead of returning a subprogram

[COMMITTED] ada: Fix uses of not Present

2024-01-09 Thread Marc Poulhiès
From: Piotr Trojanek Fix style violation reported by GNATcheck. gcc/ada/ * sem_aggr.adb (Resolve_Container_Aggregate): Use "No". * sem_ch8.adb (Find_Direct_Name): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 2 +-

[COMMITTED] ada: Avoid xref on out params of TSS

2024-01-09 Thread Marc Poulhiès
From: Bob Duff For an actual passed as an 'in out' parameter of a type support subprogram such as deep finalize, do not count it as a read reference of the actual. Clearly these should not count. Furthermore, counting them causes different warnings in -gnatc mode compared to normal mode, because

[COMMITTED] ada: Error compiling Ada 2022 object renaming with no subtype mark

2024-01-09 Thread Marc Poulhiès
From: Steve Baird In some cases the compiler would crash or generate spurious errors compiling a legal object renaming declaration that lacks a subtype mark. In addition to fixing the immediate problem, change Atree.Copy_Slots so that attempts to modify either the Empty or the Error nodes (e.g.,

[COMMITTED] ada: Fix precondition in Interfaces.C.Strings

2024-01-09 Thread Marc Poulhiès
From: Joffrey Huguet The precondition of both Update procedures in Interfaces.C.Strings were incorrect. This patch fixes this. gcc/ada/ * libgnat/i-cstrin.ads (Update): Fix precondition. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/i-cstrin.ads | 9

Re: [PATCH 2/3] Add generated .opt.urls files

2023-12-19 Thread Marc Poulhiès
Marc Poulhiès writes: >> Perhaps this script could also deal directly with Sphinx-generated >> HTML? > > I investigated a bit... The Ada part doesn't handle the html target, so > it's expected you don't have anything to parse. The online docs are > generated using a dif

[COMMITTED] ada: Fix internal error on call with parameter of predicated subtype

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the predicated subtype does not inherit all the required attributes of a string subtype with a static predicate. gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): Remove a short-circuit for subtypes without aspects when it comes to

[COMMITTED] ada: Missing error on positional container aggregates for types with Add_Named

2023-12-19 Thread Marc Poulhiès
From: Gary Dismukes The compiler fails to reject a container aggregate written using positional notation when the container type specifies an Add_Named operation in its Aggregate aspect. Container aggregates for such types must be written using named associations. The compiler ignores the

[COMMITTED] ada: Remove GNATcheck violations

2023-12-19 Thread Marc Poulhiès
From: Sheri Bernstein Remove GNATcheck violations by refactoring code and also using pragma Annotate to exempt them. gcc/ada/ * libgnat/a-comlin.adb (Argument_Count): Rewrite code so there is only one return, to remove Improper_Returns violation. (Command_Name): Add

[COMMITTED] ada: gnatbind: Do not generate Ada.Command_Line references when not used

2023-12-19 Thread Marc Poulhiès
From: Patrick Bernardi It was previously assumed that configurable runtimes could not return exit statuses, however this assumption no longer holds. Instead, only import the required symbols from Ada.Command_Line's support packages if Ada.Command_Line is in the closure of the partition when a

[COMMITTED] ada: Rename Is_Constr_Subt_For_UN_Aliased flag

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou The flag is set on the constructed subtype of an object with unconstrained nominal subtype that is aliased and is used by the code generator to adjust the layout of the object. But it is actually only used for array subtypes, where it determines whether the object is

[COMMITTED] ada: Add missing guard to previous change

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou Ancestor_Type is overloaded with Aggregate_Bounds on N_Aggregate nodes so its access needs to be guarded in Copy_Generic_Node. gcc/ada/ * sem_ch12.adb (Copy_Generic_Node): Add guard for Ancestor_Type. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Rework comment in Expand_Ctrl_Function_Call

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This expands on the reason for properly guarding the transformation. gcc/ada/ * exp_ch6.adb (Expand_Ctrl_Function_Call): Rework last comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 7 ++- 1 file changed, 6 insertions(+),

[COMMITTED] ada: Check all interfaces for valid iterator type

2023-12-19 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * sem_ch13.adb (Valid_Default_Iterator): Check all interfaces for valid iterator type. Also improve error reporting. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 103 +-- 1

[COMMITTED] ada: Optimize performance and remove dynamic frame requirement.

2023-12-19 Thread Marc Poulhiès
From: Vasiliy Fofanov gcc/ada/ * libgnat/i-cstrin.adb (Value): Optimize. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/i-cstrin.adb | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gcc/ada/libgnat/i-cstrin.adb

[COMMITTED] ada: Compiler hangs on container aggregate with function call as key expression

2023-12-19 Thread Marc Poulhiès
From: Gary Dismukes The compiler hangs (or may crash, if assertions are enabled) when compiling an iterated association of a container aggregate that has a key expression given by a function call. The resolution of the call leads to a blowup in Build_Call_Marker, because the temporary copy of

[COMMITTED] ada: Further cleanup in finalization machinery

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This removes the setting of the Is_Ignored_Transient flag on the temporaries needing finalization created by Expand_Ctrl_Function_Call when invoked from within the dependent expressions of conditional expressions. This flag tells the general finalization machinery to

[COMMITTED] ada: Fix style and typos in comments

2023-12-19 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ * exp_ch9.adb, sem_ch10.adb, sem_util.adb: Fix comments. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch9.adb | 4 ++-- gcc/ada/sem_ch10.adb | 2 +- gcc/ada/sem_util.adb | 2 +- 3 files changed, 4 insertions(+), 4

[COMMITTED] ada: Remove unreferenced utility routine Get_Logical_Line_Number_Img

2023-12-19 Thread Marc Poulhiès
From: Piotr Trojanek Routine Get_Logical_Line_Number_Img was introduced for splitting of Pre/Post contracts, but subsequent patch for that feature removed its only use. It was then used by GNATprove, but that use is now removed as well. gcc/ada/ * sinput.adb, sinput.ads

[COMMITTED] ada: Fix crash on concurrent type aggregate

2023-12-19 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the compiler would fail to examine the corresponding record types of concurrent types when building aggregate components. This patch fixes this, and adds a precondition and additional documentation on the subprogram that triggered the crash, as it never

[COMMITTED] ada: Add makefile targets for building/installing html doc

2023-12-19 Thread Marc Poulhiès
Add the ada.html and ada.install-html targets so that we can build the html with `make html`. gcc/ada/ * gcc-interface/Make-lang.in (ada.html, ada.install-html): Add. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/Make-lang.in | 35

[COMMITTED] ada: Ignore unconstrained components as inputs for Depends

2023-12-19 Thread Marc Poulhiès
From: Piotr Trojanek The current wording of SPARK RM 6.1.5(5) about the inputs for the Depends contract doesn't mention "a record with at least one unconstrained component". gcc/ada/ * sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Update comment and body. Tested on

[COMMITTED] ada: Remove No_Dynamic_Priorities from Restricted_Tasking

2023-12-19 Thread Marc Poulhiès
From: Johannes Kliemann Some of our restricted runtimes support dynamic priorities. The binder needs to generate code for a restricted runtime even if the restriction No_Dynamic_Priorities is not in place. gcc/ada/ * libgnat/s-rident.ads: Remove No_Dynamic_Priorities from

[COMMITTED] ada: Fix spurious visibility error on parent's component in instance

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This occurs for an aggregate of a derived tagged type in the body of the instance, because the full view of the parent type, which was visible in the generic construct (otherwise the aggregate would have been illegal), is not restored in the body of the instance.

[COMMITTED] ada: Fix SPARK expansion of container aggregates

2023-12-19 Thread Marc Poulhiès
From: Yannick Moy GNATprove supports container aggregates, except for indexed aggregates. It needs all expressions to have suitable target types and Do_Range_Check flags, which are added by the special expansion for GNATprove. There is no impact on code generation. gcc/ada/ *

[COMMITTED] ada: Cope with Sem_Util.Enclosing_Declaration oddness.

2023-12-19 Thread Marc Poulhiès
From: Steve Baird Sem_Util.Enclosing_Declaration can return a non-empty result which is not a declaration; clients may need to compensate for the case where an N_Subprogram_Specification node is returned. One such client is the function Is_Actual_Subp_Of_Inst. gcc/ada/ * sem_ch8.adb

[COMMITTED] ada: Adapt Ada.Command_Line to work on configurable runtimes

2023-12-19 Thread Marc Poulhiès
From: Patrick Bernardi The behaviour of the binder when handling command line arguments and exit codes is simplified so that references to the corresponding runtime symbols are always generated when the runtime is configured with command line argument and exit code support. This allows

[COMMITTED] ada: Plug small loophole in finalization machinery

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou The path in Expand_N_If_Expression implementing the special optimization for an unidimensional array type and dependent expressions with static bounds fails to call Process_Transients_In_Expression on their list of actions. gcc/ada/ * exp_ch4.adb

[COMMITTED] ada: Restore object constraint optimization

2023-12-19 Thread Marc Poulhiès
From: Ronan Desplanques This patch relaxes the requirement that discriminants values should be known at compile time for a particular optimization to be applied. That optimization is the one that treats an unconstrained object as constrained when the object is of a limited type, in order to

[COMMITTED] ada: Cleanup SPARK legality checking

2023-12-19 Thread Marc Poulhiès
From: Yannick Moy Move one SPARK legality check from GNAT to GNATprove, and cleanup other uses of SPARK_Mode for legality checking. gcc/ada/ * sem_ch4.adb (Analyze_Selected_Component): Check correct mode variable for GNATprove. * sem_prag.adb (Refined_State): Call

[COMMITTED] ada: Illegal instance of Generic_1.Generic_2 incorrectly accepted

2023-12-19 Thread Marc Poulhiès
From: Steve Baird If G1 is a generic package and G1.G2 is a child unit (also a generic package) then it would be illegal if some third generic unit (declared outside of G1) takes a formal instance of G1.G2, as in "with package I2 is new G1.G2;". This construct was incorrectly accepted in some

[COMMITTED] ada: Further cleanup in finalization machinery

2023-12-19 Thread Marc Poulhiès
From: Eric Botcazou This streamlines the submachinery that makes it so that the finalization of temporaries created for EWAs and conditional expressions is deferred to the enclosing context. The original implementation was using a deep tree traversal for EWAs, which was later restricted to

[PATCH v2] testsuite: adjust call to abort in excess-precision-12

2023-12-11 Thread Marc Poulhiès
On non-hosted targets, cstdlib may not be sufficient to have abort defined, but it should be for std::abort. gcc/testsuite/ChangeLog: * g++.target/i386/excess-precision-12.C: call std::abort instead of abort. --- Changed from calling __builtin_abort to std::abort, as advised. Ok for

Re: [PATCH] testsuite: adjust call to abort in excess-precision-12

2023-12-11 Thread Marc Poulhiès
Hello, > Why wouldn't they have abort and what else does __builtin_abort () expand > to? It expands to abort but works around the "abort is undeclared" error. > There are 2000+ other tests in gcc.target/i386/ which call abort (), > not __builtin_abort (), after including directly or indirectly

Re: [PATCH] ada: Fix Ada bootstrap on FreeBSD

2023-12-11 Thread Marc Poulhiès
Rainer Orth writes: > Ada bootstrap on FreeBSD/amd64 was also broken by the recent warning > changes: > > terminals.c: In function 'allocate_pty_desc': > terminals.c:1200:12: error: implicit declaration of function 'openpty'; did > you > mean 'openat'? [-Wimplicit-function-declaration] >

Re: [PATCH] testsuite: require avx_runtime for vect-simd-clone-17f

2023-12-08 Thread Marc Poulhiès
Marc Poulhiès writes: > Should I revert r14-6272 that has the same issue of disabling the > modified tests on non-x86? I've reverted the r14-6272. Marc

Re: [PATCH] testsuite: require avx_runtime for some tests

2023-12-08 Thread Marc Poulhiès
Thomas Schwinge writes: > Hi Marc! > > On 2023-11-06T11:59:18+0100, Marc Poulhiès wrote: >> These 3 tests fails parsing the 'vect' dump when not using -mavx. Make >> the dependency explicit. > > But that means that the tests are now enabled *only* for > effe

Re: [PATCH] testsuite: require avx_runtime for vect-simd-clone-17f

2023-12-08 Thread Marc Poulhiès
Jakub Jelinek writes: > This looks wrong, then it won't be tested at all on non-x86 targets. Right, I'll look for a better fix. Should I revert r14-6272 that has the same issue of disabling the modified tests on non-x86? Marc

Re: [PATCH] testsuite: add missing dg-require ifunc in pr105554.c

2023-12-08 Thread Marc Poulhiès
Jakub Jelinek writes: > On Thu, Dec 07, 2023 at 05:25:39PM +0100, Marc Poulhiès wrote: >> The 'target_clones' attribute depends on the ifunc support. >> >> gcc/testsuite/ChangeLog: >> * gcc.target/i386/pr105554.c: Add dg-require ifunc. >> --- >>

[PATCH] testsuite: require avx_runtime for vect-simd-clone-17f

2023-12-07 Thread Marc Poulhiès
The test fails parsing the 'vect' dump when not using -mavx. Make the dependency explicit. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-simd-clone-17f.c: Add dep on avx_runtime. --- Tested on x86_64-linux and x86_64-elf. Ok for master? gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c |

[PATCH] testsuite: adjust call to abort in excess-precision-12

2023-12-07 Thread Marc Poulhiès
abort() is not always available, using the builtin as done in other tests. gcc/testsuite/ChangeLog: * g++.target/i386/excess-precision-12.C: call builtin_abort instead of abort. --- Tested on x86_64-linux and x86_64-elf. Ok for master?

[PATCH] testsuite: add missing dg-require ifunc in pr105554.c

2023-12-07 Thread Marc Poulhiès
The 'target_clones' attribute depends on the ifunc support. gcc/testsuite/ChangeLog: * gcc.target/i386/pr105554.c: Add dg-require ifunc. --- Tested on x86_64-linux and x86_64-elf. Ok for master? gcc/testsuite/gcc.target/i386/pr105554.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH] testsuite: skip gcc.target/i386/pr106910-1.c test when using newlib

2023-12-01 Thread Marc Poulhiès
Marc Poulhiès writes: > Using newlib produces a different codegen because the support for c99 > differs (see libc_has_function hook). > > gcc/testsuite/ChangeLog: > > * gcc.target/i386/pr106910-1.c: Disable for newlib. > --- > Tested on x86_64-linux and x86_6

Re: [PATCH] testsuite: require avx_runtime for some tests

2023-12-01 Thread Marc Poulhiès
Marc Poulhiès writes: > These 3 tests fails parsing the 'vect' dump when not using -mavx. Make > the dependency explicit. > > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/vect-ifcvt-18.c: Add dep on avx_runtime. > * gcc.dg/vect/vect-simd-clone-16f.c: Likewise.

Re: [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib

2023-12-01 Thread Marc Poulhiès
Marc Poulhiès writes: > Contrary to glibc, including stdio.h from newlib defines mode_t which > conflicts with the test's type definition. > > .../gcc/testsuite/gcc.dg/analyzer/fd-4.c:19:3: error: redefinition of typedef > 'mode_t' with different type > ... > .../inclu

Re: [PATCH] ada: Fix Ada bootstrap on macOS

2023-12-01 Thread Marc Poulhiès
Rainer Orth writes: > The recent warning changes broke Ada bootstrap on macOS: > > adaint.c: In function '__gnat_copy_attribs': > adaint.c:3336:10: error: implicit declaration of function 'utimes'; did you > mean 'utime'? [-Wimplicit-function-declaration] > 3336 | if (utimes (to, tbuf)

[COMMITTED] ada: Remove SPARK legality checks

2023-11-30 Thread Marc Poulhiès
From: Yannick Moy SPARK legality checks apply only to code with SPARK_Mode On, and are performed again in GNATprove for detecting SPARK-compatible declarations in code with SPARK_Mode Auto. Remove this duplication, to only perform SPARK legality checking in GNATprove. After this patch, only a

[COMMITTED] ada: Rework fix for wrong finalization of qualified aggregate in allocator

2023-11-30 Thread Marc Poulhiès
From: Eric Botcazou The problem is that there is no easy method to insert an action after an arbitrary node in the tree, so the original fix does not correctly work when the allocator is nested in another expression. Therefore this moves the burden of the insertion from Apply_Predicate_Check to

[COMMITTED] ada: Support Put_Image for types in user-defined instances of predefined generics.

2023-11-30 Thread Marc Poulhiès
From: Steve Baird Predefined units do not generally support the Put_Image attribute. There are good reasons for this in most cases. But if a user-defined instantiation of a predefined generic occurs in Ada 2022 code, then Put_Image can be supported for types declared therein. Add this support.

[COMMITTED] ada: Ignore defered compile time errors without backend

2023-11-30 Thread Marc Poulhiès
From: Viljar Indus We defer some compile time warnings and errors until the backend has added the extra information needed. However it is not guaranteed that the backend has run by this point. Avoid checking these errors if the backend has not been activated and no code has been generated.

[COMMITTED] ada: Fix spelling of functions with(out) "side effects"

2023-11-30 Thread Marc Poulhiès
From: Yannick Moy Correct spelling does not include an hyphen. Fix comments and one error message. Also fix other mispellings of "side-effect" or "side effect" depending on the case (adjective should have hyphen), and "side-effect-free" with double hyphen as an adjective. gcc/ada/ *

[COMMITTED] ada: Remove GNATcheck violations

2023-11-30 Thread Marc Poulhiès
From: Sheri Bernstein Remove GNATcheck violations by refactoring code and also using pragma Annotate to exempt them. gcc/ada/ * libgnat/i-cstrin.adb (Free): Rewrite code so there is only one return, to remove Improper_Returns violation. (Position_Of_Nul): Add pragma to

[COMMITTED] ada: Name resolution in expanded instances

2023-11-30 Thread Marc Poulhiès
From: Steve Baird In building the tree for an instance of a generic, expansion sets entity fields on names that refer to things declared outside of the instance, but leaves the entity field unset on names that should end up referring to things declared within the instance. These will instead be

[COMMITTED] ada: Crash initializing component of private record type

2023-11-30 Thread Marc Poulhiès
From: Javier Miranda The compiler may crash processing the full type declaration of a private record type that initializes a component with a call to a function instantiated in the private part of the package. gcc/ada/ * freeze.adb (Declared_In_Expanded_Body): New subprogram.

[COMMITTED] ada: Too-strict conformance checking for formal discriminated type

2023-11-30 Thread Marc Poulhiès
From: Steve Baird The discriminant subtype conformance check for an actual parameter corresponding to a generic formal discriminated type was too strict and could incorrectly reject legal instantiations. gcc/ada/ * sem_ch12.adb (Validate_Discriminated_Formal_Type): Replace

[COMMITTED] ada: Add comment describing Partition_Elaboration_Policy dependency.

2023-11-30 Thread Marc Poulhiès
From: Steve Baird Add a comment in the spec for the default (as opposed to hie) version of Ada.Real_Time.Timing_Events indicating that it is incompatible with a a Partition_Elaboration_Policy specification specifying a policy other than Concurrent. gcc/ada/ * libgnarl/a-rttiev.ads: add

[COMMITTED] ada: Fix predicate check failure in Expand_Allocator_Expression

2023-11-30 Thread Marc Poulhiès
From: Eric Botcazou The For_Special_Return_Object flag needs to be accessed on entry of the procedure in case the allocator is rewritten during the processing. gcc/ada/ * exp_ch4.adb (Expand_Allocator_Expression): Add Special_Return boolean constant to hold the value of

[COMMITTED] ada: Fix wrong finalization for qualified aggregate of limited type in allocator

2023-11-30 Thread Marc Poulhiès
From: Eric Botcazou This happens with -gnata when the limited type has controlled components and a predicate, because the predicate check generated for the aggregate causes the creation of a temporary that is used as the expression of the allocator. Now this combination is illegal for a limited

[COMMITTED] ada: Constant_Indexing used when context requires a variable

2023-11-30 Thread Marc Poulhiès
From: Steve Baird In the case of a call with a formal parameter of mode other than "IN" where the corresponding actual parameter is a generalized indexing and the indexable container has both Constant_Indexing and Variable_Indexing aspects specified, the generalized indexing must be interpreted

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-28 Thread Marc Poulhiès
Marc Poulhiès writes: > Simon Wright writes: >> gcc/ada/Changelog: >> >> 2023-11-22 Simon Wright >> >> PR ada/111909 >> >> Can we commit this one now, please? > > Hello Simon, > > Yes we can commit this one, as both Iain and Arnaud

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-28 Thread Marc Poulhiès
Simon Wright writes: > gcc/ada/Changelog: > > 2023-11-22 Simon Wright > > PR ada/111909 > > Can we commit this one now, please? Hello Simon, Yes we can commit this one, as both Iain and Arnaud ACKed it. I'll create a proper commit with the change and the fixed commit log and merge it.

[COMMITTED] ada: Fix wrong size value output with -gnatR -gnatc

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou This happens when a parameter is involved in the computation. gcc/ada/ * gcc-interface/decl.cc (annotate_value): Apply the same processing for parameters as for variables. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Add comment for assertion

2023-11-28 Thread Marc Poulhiès
Add possible cause for a failed assertion. gcc/ada/ * gcc-interface/utils2.cc (build_simple_component_ref): Add comment on assertion. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils2.cc | 5 - 1 file changed, 4 insertions(+), 1

[COMMITTED] ada: False alarms from -gnatw.t with generic functions

2023-11-28 Thread Marc Poulhiès
From: Bob Duff Disable the warnings generated by -gnatw.t on instances. Otherwise, we get false positives. gcc/ada/ * sem_util.adb (Check_Result_And_Post_State): Disable this when we're in an instance. Misc cleanup. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Error compiling reduction expression with overloaded reducer subprogram

2023-11-28 Thread Marc Poulhiès
From: Steve Baird In some cases involving a reduction expression with an overloaded reducer subprogram, the accumulator type is not determined correctly. This can lead to spurious compile-time errors. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): In the case of a

[COMMITTED] ada: Errors on instance of Multiway_Trees with discriminated type

2023-11-28 Thread Marc Poulhiès
From: Gary Dismukes The compiler may report various type conflicts on an instantiation of the generic package Ada.Containers.Multiway_Trees with an actual for Element_Type that is a nonprivate actual type with discriminants that has a discriminant-dependent component of a private type (such as a

[COMMITTED] ada: Fix incorrect quoting in documentation

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * doc/gnat_rm/the_implementation_of_standard_i_o.rst: Fix a couple occurrences of incorrect quoting. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Further cleanup in finalization machinery

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou When transient scopes are being materialized, they can give rise to a block created around the construct being wrapped or not, depending on the kind of construct. In both cases finalization actions for the transient objects of the scope are generated the same way, with

[COMMITTED] ada: Fix premature finalization for nested return within extended one

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou The return object is incorrectly finalized when the nested return is taken, because the special flag attached to the return object is not updated. gcc/ada/ * exp_ch6.adb (Build_Flag_For_Function): New function made up of the code building the special flag

[COMMITTED] ada: Add new predicate Is_Address_Compatible_Type

2023-11-28 Thread Marc Poulhiès
From: Sebastian Poeplau When emitting code for architectures with tagged pointers, it is useful to be able to recognize values representing addresses because they require special handling. This commits adds the predicate Is_Address_Compatible_Type, which differs from the node attribute

[COMMITTED] ada: Fix internal error on declare expression in expression function

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou When the expression function is not a completion, its (return) expression does not cause freezing so analyzing the declare expression in this context must not freeze the type of the object. The change also contains another fix, which makes it so that the compiler does not

[COMMITTED] ada: Type error on container aggregate with loop_parameter_specification

2023-11-28 Thread Marc Poulhiès
From: Gary Dismukes The compiler incorrectly reported a type error on a container aggregate for a Vector type with a loop_parameter_specification specifying a nonstatic upper bound, complaining that it expected the Vector index type, but instead found type Count_Type. The expansion of the

[COMMITTED] ada: Handle unchecked conversion in bound

2023-11-28 Thread Marc Poulhiès
From: Richard Kenner Look through both unchecked and normal conversions when seeing if any part of a bound is uplevel. gcc/ada/ * exp_unst.adb (Note_Uplevel_Bound): Treat N_Unchecked_Type_Conversion like N_Type_Conversion. Tested on x86_64-pc-linux-gnu, committed on master.

[COMMITTED] ada: Remove dependency on System.Val_Bool in System.Img_Bool

2023-11-28 Thread Marc Poulhiès
From: Yannick Moy In order to facilitate the certification of System.Img_Bool, remove its dependency on unit System.Val_Bool. Modify the definition of ghost function Is_Boolean_Image_Ghost to take the expected boolean value and move it to System.Val_Spec. gcc/ada/ *

<    1   2   3   4   5   6   7   8   9   10   >