[COMMITTED] ada: Refactor repeated code for querying Boolean-valued aspects

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup following a fix for aspect Exclusive_Functions; semantics is unaffected. gcc/ada/ * exp_ch9.adb (Build_Protected_Subprogram_Body, Build_Protected_Subprogram_Call_Cleanup): Reuse refactored routine. * sem_util.adb

[COMMITTED] ada: Remove dynamic frame in System.Image_D and document it in System.Image_F

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou The former can easily be removed while the latter cannot. gcc/ada/ * libgnat/s-imaged.ads (System.Image_D): Add Uns formal parameter. * libgnat/s-imaged.adb: Add with clauses for System.Image_I, System.Value_I_Spec and System.Value_U_Spec.

[COMMITTED] ada: Remove guards against traversal of empty list of aspects

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek When iterating over Aspect_Specifications, we can use First/Next directly even if the Aspect_Specifications returns a No_List or the list has no items. Code cleanup. gcc/ada/ * aspects.adb (Copy_Aspects): Style fix. * contracts.adb (Analyze_Contracts):

[COMMITTED] ada: Deconstruct unused flag Is_Expanded_Contract

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Flag Is_Expanded_Contract was introduced together with N_Contract field (when implementing freezing of contracts), but was never actually used. gcc/ada/ * gen_il-fields.ads (Opt_Field_Enum): Remove Is_Expanded_Contract from the list of flags. *

[COMMITTED] ada: Move Init_Proc_Level_Formal from Exp_Ch3 to Exp_Util

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou This makes it possible to remove clauses from the Accessibility package. gcc/ada/ * accessibility.adb: Remove clauses for Exp_Ch3. * exp_ch3.ads (Init_Proc_Level_Formal): Move declaration to... * exp_ch3.adb (Init_Proc_Level_Formal): Move body to...

[COMMITTED] ada: Move splitting of pre/post aspect expressions to expansion

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek We split expressions of pre/post aspects into individual conjuncts and emit messages with their precise location when they fail at runtime. This was done when processing the aspects and caused inefficiency when the original expression had to be recovered to detects uses of

[COMMITTED] ada: Complete implementation of Ada 2022 aspect Exclusive_Functions

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Extend implementation of RM 9.5.1(7/4), which now applies also to protected function if the protected type has aspect Exclusive_Functions. gcc/ada/ * exp_ch9.adb (Build_Protected_Subprogram_Call_Cleanup): If aspect Exclusive_Functions is present then the

[COMMITTED] ada: Deconstruct flag Split_PPC since splitting now is done in expansion

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Remove flag Split_PPC and all its uses. gcc/ada/ * contracts.adb (Append_Enabled_Item): Remove use of Split_PPC; simplify. * gen_il-fields.ads (Opt_Field_Enum): Remove flag definition. * gen_il-gen-gen_nodes.adb (N_Aspect_Specification,

[COMMITTED] ada: Avoid crash on illegal constrained type declarations

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Fix crash on ACATS test B38003B introduced by a recent cleanup of per-object constraints. gcc/ada/ * sem_util.adb (Get_Index_Bounds): Guard against missing Entity, which happens on illegal constrained type declaration. Tested on x86_64-pc-linux-gnu,

[COMMITTED] ada: Fix style in comments

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup. gcc/ada/ * contracts.adb (Inherit_Subprogram_Contract): Fix style. * sem_ch5.adb (Analyze_Iterator_Specification): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/contracts.adb | 2 +- gcc/ada/sem_ch5.adb | 2 +-

[COMMITTED] ada: Decouple finalization masters from storage pools

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou The coupling came from the build-in-place protocol but is now unnecessary because the storage pool reference is always passed along with the master reference in this protocol. No functional changes. gcc/ada/ * exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Use the

[COMMITTED] ada: Rename finalization scope masters into finalization masters

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou Now that what was previously called "finalization master" has been renamed into "finalization collection" in the front-end, we can also rename what was initially called "finalization scope master" into "finalization master". These entities indeed drive the finalization of

[COMMITTED] ada: Replace finalization masters with finalization collections

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou This change replaces finalization masters with finalization collections in most cases, that is to say, when they implement a list of objects created by allocators of a given access type; indeed the moniker is overloaded in the front-end, e.g. Sem_Util.Is_Master determines if

[COMMITTED] ada: Restore fix for controlled dynamic allocation with BIP function call

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou The resolution made some time ago had been that a dynamic allocation for a limited type that needs finalization with a function call as expression always needs to be done in the called function, even if the limited type has a known size. But the fix implementing this

[COMMITTED] ada: Couple of comment tweaks to latest change

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou This replaces a few remaining references to "master" by "collection" and makes a couple of additional tweaks in comments. gcc/ada/ * libgnat/s-finpri.adb (Finalize): Replace "master" by "collection" in comments and add a comment about the form of the loop.

[COMMITTED] ada: Remove deprecated VxWorks interrupt connection API

2024-05-13 Thread Marc Poulhiès
From: Ashley Gay The VxWorks 7 API to use hardware interrupts is the VxBus subsystem. GNAT API still provides bindings for the deprecated (VxWorks 6) routines. A direct consequence of this change is that Attach_Handler cannot be used anymore (the VxBus subsystem should be used instead). This

[COMMITTED] ada: Fix pragma Compile_Time_Error for alignment of array types

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou The pragma is consistenly rejected for the alignment of array types because Eval_Attribute does not evaluate it even if it is known. gcc/ada/ * sem_attr.adb (Eval_Attribute): Treat Alignment like Component_Size for array types. Tested on

[COMMITTED] ada: Recognize pragma Lock_Free as specific to GNAT

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Pramga Lock_Free must be recognized as implementation-defined. gcc/ada/ * sem_prag.adb (Analyze_Pragma): When processing pragma Lock_Free, check if restriction No_Implementation_Pragmas is enabled. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Rewrite Append_Entity_Name; skip irrelevant names

2024-05-13 Thread Marc Poulhiès
From: Bob Duff This patch rewrites Append_Entity_Name, both for maintainability and to improve user messages. The main issue was that the recursion stopped when the enclosing scope is the wrapper created in case of postconditions with 'Old. This caused different results depending on the

[COMMITTED] ada: Simplify uses of readdir_gnat with object overlay

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ * libgnat/a-direct.adb (Start_Search_Internal): Combine subtype and object declaration. * libgnat/g-dirope.adb (Read): Replace convoluted unchecked conversion with an overlay. Tested on

[COMMITTED] ada: Enable casing on composite via -X0 instead of -X

2024-05-13 Thread Marc Poulhiès
From: Steve Baird Move case statement pattern matching out of the curated language extension set and into the extended set. gcc/ada/ * sem_case.adb: Replace all tests of Core_Extensions_Allowed with corresponding tests of All_Extensions_Allowed. * sem_ch5.adb: Likewise.

[COMMITTED] ada: Fix internal error with Put_Image aspect on access-to-class-wide type

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou This occurs with an instantiation of Ada.Containers.Vectors in a nested package on an access-to-class-wide type declared with the Put_Image aspect because of too late a freezing for the internal renaming generated for the Put_Image procedure. The change freezes this renaming

[COMMITTED] ada: Small cleanup in the BIP machinery

2024-05-13 Thread Marc Poulhiès
From: Eric Botcazou This avoids creating Null nodes when they are not used in the end and makes the implementation of Add_Finalization_Master_Actual_To_Build_In_Place_Call more consistent with that of its sibling routines. No functional changes. gcc/ada/ * exp_ch6.adb

[COMMITTED] ada: Compiler crash on nonstatic container aggregates for Doubly_Linked_Lists

2024-05-13 Thread Marc Poulhiès
From: Gary Dismukes The compiler was crashing on container aggregates for the List type coming from an instantiation of Ada.Containers.Doubly_Linked_Lists when the aggregate has more than one iterated_element_association with nonstatic range bounds. As part of addressing this, it was noticed

[COMMITTED] ada: Refactor GNAT.Directory_Operations.Read to minimise runtime checks

2024-05-13 Thread Marc Poulhiès
From: Piotr Trojanek Array assignments are likely more efficient than element-by-element copying; in particular, they avoid constraints checks in every iteration of a loop (when the runtime is compiled with checks enabled). A cleanup and improvement opportunity spotted while working on improved

Re: Fix gnu versioned namespace mode 00/03

2024-05-13 Thread Jonathan Wakely
On Mon, 13 May 2024, 07:30 Iain Sandoe, wrote: > > > > On 13 May 2024, at 06:06, François Dumont wrote: > > > > > > On 07/05/2024 18:15, Iain Sandoe wrote: > >> Hi François > >> > >>> On 4 May 2024, at 22:11, François Dumont wrote: > >>> > >>> Here is the list of patches to restore gnu

[PATCH] tree-ssa-math-opts: Pattern recognize yet another .ADD_OVERFLOW pattern [PR113982]

2024-05-13 Thread Jakub Jelinek
Hi! We pattern recognize already many different patterns, and closest to the requested one also yc = (type) y; zc = (type) z; x = yc + zc; w = (typeof_y) x; if (x > max) where y/z has the same unsigned type and type is a wider unsigned type and max is maximum value of the narrower

Re: [PATCH] internal-fn: Do not force vcond operand to reg.

2024-05-13 Thread Richard Biener
On Mon, May 13, 2024 at 8:18 AM Robin Dapp wrote: > > > How does this make a difference in the end? I'd expect say forwprop to > > fix things? > > In general we try to only add the masking "boilerplate" of our > instructions at split time so fwprop, combine et al. can do their > work uninhibited

Re: [PATCH] Don't reduce estimated unrolled size for innermost loop.

2024-05-13 Thread Richard Biener
On Mon, May 13, 2024 at 4:29 AM liuhongt wrote: > > As testcase in the PR, O3 cunrolli may prevent vectorization for the > innermost loop and increase register pressure. > The patch removes the 1/3 reduction of unr_insn for innermost loop for UL_ALL. > ul != UR_ALL is needed since some small loop

Re: [PATCH] Fortran: improve attribute conflict checking [PR93635]

2024-05-13 Thread Mikael Morin
Le 10/05/2024 à 21:56, Harald Anlauf a écrit : Am 10.05.24 um 21:48 schrieb Harald Anlauf: Hi Mikael, Am 10.05.24 um 11:45 schrieb Mikael Morin: Le 09/05/2024 à 22:30, Harald Anlauf a écrit : I'll stop here... Thanks. Go figure, I have no problem reproducing today. It's PR99798 (and there

Re: [PATCH 1/4] rs6000: Make all 128 bit scalar FP modes have 128 bit precision [PR112993]

2024-05-13 Thread Richard Biener
On Mon, May 13, 2024 at 3:39 AM Kewen.Lin wrote: > > Hi Joseph and Richi, > > Thanks for the suggestions and comments! > > on 2024/5/10 14:31, Richard Biener wrote: > > On Thu, May 9, 2024 at 9:12 PM Joseph Myers wrote: > >> > >> On Wed, 8 May 2024, Kewen.Lin wrote: > >> > >>> to widen IFmode to

Re: gcc/DATESTAMP wasn't updated since 20240507

2024-05-13 Thread Rainer Orth
Richard Biener writes: > On Thu, 9 May 2024, Jakub Jelinek wrote: > >> On Thu, May 09, 2024 at 12:14:43PM +0200, Jakub Jelinek wrote: >> > On Thu, May 09, 2024 at 12:04:38PM +0200, Rainer Orth wrote: >> > > I just noticed that gcc/DATESTAMP wasn't updated yesterday and today, >> > > staying at

[PATCH] c++: Avoid using __array_rank as a variable name [PR115061]

2024-05-13 Thread Ken Matsui
This patch fixes a compilation error when building GCC using Clang. Since __array_rank is used as a built-in trait name, use rank instead. PR c++/115061 gcc/cp/ChangeLog: * semantics.cc (finish_trait_expr): Use rank instead of __array_rank. Signed-off-by: Ken Matsui

Re: Fix gnu versioned namespace mode 00/03

2024-05-13 Thread Iain Sandoe
> On 13 May 2024, at 06:06, François Dumont wrote: > > > On 07/05/2024 18:15, Iain Sandoe wrote: >> Hi François >> >>> On 4 May 2024, at 22:11, François Dumont wrote: >>> >>> Here is the list of patches to restore gnu versioned namespace mode. >>> >>> 1/3: Bump gnu version namespace >>>

Re: [PATCH 1/13] rs6000, Remove __builtin_vsx_cmple* builtins

2024-05-13 Thread Kewen.Lin
Hi, on 2024/4/20 05:16, Carl Love wrote: > > rs6000, Remove __builtin_vsx_cmple* builtins > > The built-ins __builtin_vsx_cmple_u16qi, __builtin_vsx_cmple_u2di, > __builtin_vsx_cmple_u4si and __builtin_vsx_cmple_u8hi should take > unsigned arguments and return an unsigned result. The current

Re: [PATCH] internal-fn: Do not force vcond operand to reg.

2024-05-13 Thread Robin Dapp
> How does this make a difference in the end? I'd expect say forwprop to > fix things? In general we try to only add the masking "boilerplate" of our instructions at split time so fwprop, combine et al. can do their work uninhibited of it (and we don't need numerous (if_then_else ...

<    1   2