Re: [PATCH] Modify combine pattern by a pseudo AND with its nonzero bits [PR93453]

2021-12-02 Thread HAO CHEN GUI via Gcc-patches
Kewen, Many thanks for your comments. On 2/12/2021 上午 10:21, Kewen.Lin wrote: > Hi Haochen, > > on 2021/12/1 下午5:01, HAO CHEN GUI via Gcc-patches wrote: >> Hi, >> This patch modifies the combine pattern with a helper - >> change_pseudo_and_mask when recog fails. >> The helper converts

[PATCH] [i386] Prefer INT_SSE_REGS for SSE_FLOAT_MODE_P in preferred_reload_class.

2021-12-02 Thread liuhongt via Gcc-patches
The patch helps reload to choose GENENRAL_REGS alternatives for SSE_FLOAT_MODE and enabled optimization like - vmovd %xmm0, -4(%rsp) - movl$1, %eax - addl-4(%rsp), %eax + movd%xmm0, %eax + addl$1, %eax Bootstrapped anf regtested on x86_64-pc-linux

Re: [PATCH v2 1/2] c++: Print function template parms when relevant

2021-12-02 Thread Matthias Kretz
On Friday, 26 November 2021 16:23:43 CET Matthias Kretz wrote: > > Hmm, since it walks DECL_TEMPLATE_RESULT, I wouldn't expect it to find > > template parms that aren't in the function signature. > > You were right, walking TREE_TYPE (DECL_TEMPLATE_RESULT (t)) does what I > need. ... for FUNCTION

Re: [PATCH] [i386] Prefer INT_SSE_REGS for SSE_FLOAT_MODE_P in preferred_reload_class.

2021-12-02 Thread Hongtao Liu via Gcc-patches
On Thu, Dec 2, 2021 at 4:27 PM liuhongt wrote: > > The patch helps reload to choose GENENRAL_REGS alternatives for > SSE_FLOAT_MODE and enabled optimization like > > - vmovd %xmm0, -4(%rsp) > - movl$1, %eax > - addl-4(%rsp), %eax > + movd%xmm0, %eax > +

Re: [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c

2021-12-02 Thread Segher Boessenkool
On Wed, Dec 01, 2021 at 04:42:19PM -0600, Bill Schmidt wrote: > On 12/1/21 4:29 PM, Segher Boessenkool wrote: > > On Thu, Nov 18, 2021 at 10:15:21AM -0600, Bill Schmidt wrote: > >> All error messages are now one of the following: > >> "argument %d must be a %d-bit unsigned literal" > >> "argume

Re: [PR103149] introduce asmnesia internal function

2021-12-02 Thread Richard Biener via Gcc-patches
On Wed, 1 Dec 2021, Alexandre Oliva wrote: > > This is now used by -fharden-conditional-branches and > -fharden-compares to detach the values used in redundant hardening > compares from their original locations. It eventually still expands > to an asm statement, as before, but the temporary is o

[PATCH] PR target/43892: Some carry flag (CA) optimizations on PowerPC.

2021-12-02 Thread Roger Sayle
This patch resolves PR target/43892 (suboptimal add with carry) by adding four new define_insn_and_split to the rs6000 backend, that all recognize pairs of instructions where the first instruction sets the carry flag and the second one consumes it. It also adds a commutative variant of add3_carry_

[ping][PATCH] DWARF: Match behaviour of .cfi_xxx when doing manual frame output.

2021-12-02 Thread Iain Sandoe
Hi, I’d like to ping this patch at least for opinion on whether the approach is reasonable (as noted below it could be put behind a target hook if necessary) thanks Iain > On 17 Nov 2021, at 17:17, Iain Sandoe via Gcc-patches > wrote: > > At present, for several reasons, it is not possible to

Re: [PATCH] [i386] Prefer INT_SSE_REGS for SSE_FLOAT_MODE_P in preferred_reload_class.

2021-12-02 Thread Uros Bizjak via Gcc-patches
On Thu, Dec 2, 2021 at 9:36 AM Hongtao Liu wrote: > > On Thu, Dec 2, 2021 at 4:27 PM liuhongt wrote: > > > > The patch helps reload to choose GENENRAL_REGS alternatives for > > SSE_FLOAT_MODE and enabled optimization like > > > > - vmovd %xmm0, -4(%rsp) > > - movl$1, %eax > >

[SVE] PR96463 - Optimise svld1rq from vectors

2021-12-02 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, I have attached a WIP untested patch for PR96463. IIUC, the PR suggests to transform lhs = svld1rq ({-1, -1, ...}, &v[0]) into: lhs = vec_perm_expr if v is vector of 4 elements, and each element is 32 bits on little endian target ? I am sorry if this sounds like a silly question, but I

Re: [PATCH] Allow loop crossing paths in back threader copier.

2021-12-02 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 5:00 PM Aldy Hernandez wrote: > > On Wed, Dec 1, 2021 at 2:36 PM Richard Biener > wrote: > > > > On Tue, Nov 30, 2021 at 4:48 PM Aldy Hernandez via Gcc-patches > > wrote: > > > > > > We are currently restricting loop crossing paths in the generic copier > > > used by the b

Re: [PATCH] Implement -fprofile-prefix-map.

2021-12-02 Thread Martin Liška
PING^1 On 11/11/21 17:39, Martin Liška wrote: It's functionality that is analogous to -ffile-prefix-map, this time for gcov purpose. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR gcov-profile/96092 gcc/ChangeLog: *

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-02 Thread Martin Liška
On 12/1/21 19:21, Andrew MacLeod wrote: On 12/1/21 09:48, Martin Liška wrote: On 12/1/21 15:34, Richard Biener wrote: On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: On 12/1/21 15:19, Richard Biener wrote: which is compute the range of 'lhs' on edge_true into predicate->true_range, assig

Re: [RFC]PR103271 ICE in assign_stack_temp_for_type with -ftrivial-auto-var-init=pattern and VLAs and -mno-strict-align on riscv64

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, Dec 2, 2021 at 12:37 AM Qing Zhao wrote: > > Hi, > > As I studied, the issue with this bug is similar as PR102285: > > For the testing case: > > int > qy (void) > { > int tw = 4; > int fb[tw]; > return fb[2]; /* { dg-warning "uninitialized" } */ > } > > if compiled with > /home/opc/

Re: [PATCH v2] fix spelling of -linker-output-auto-nolto-rel

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, Dec 2, 2021 at 8:22 AM Rasmus Villemoes wrote: > > The transposition nolto -> notlo is confusing and it makes the long > name even harder to read than it already is - I kept reading it as > "not lo" until I realized it was a simple typo. OK for trunk and branch. Thanks, Richard. > Fixes

Re: [PATCH] Implement -fprofile-prefix-map.

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, Dec 2, 2021 at 12:43 PM Martin Liška wrote: > > PING^1 OK. > On 11/11/21 17:39, Martin Liška wrote: > > It's functionality that is analogous to -ffile-prefix-map, this time > > for gcov purpose. > > > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > > > Ready

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, Dec 2, 2021 at 12:45 PM Martin Liška wrote: > > On 12/1/21 19:21, Andrew MacLeod wrote: > > On 12/1/21 09:48, Martin Liška wrote: > >> On 12/1/21 15:34, Richard Biener wrote: > >>> On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: > > On 12/1/21 15:19, Richard Biener wrote: > >

[PATCH] tree-optimization/103527 - always use thruth type forgather mask

2021-12-02 Thread Richard Biener via Gcc-patches
This makes sure to always use a truth type to build the gather mask argument even when the target builtin prototype in the end wants a float vector. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-12-02 Richard Biener PR tree-optimization/103527 * tree-vect-s

[PATCH] middle-end/103271 - avoid VLA init of register

2021-12-02 Thread Richard Biener via Gcc-patches
This avoids using VLA types to initalize a register with -ftrivial-auto-var-init in some cases. Bootstrapped and tested on x86_64-unknown-linux-gnu, also tested on the case riscv ICEd on. Pushed. 2021-12-02 Richard Biener PR middle-end/103271 * internal-fn.c (expand_DEFERRED_

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Andrew Stubbs
On 30/11/2021 16:54, Jakub Jelinek wrote: Why does the GCN plugin or runtime need to know those vars? It needs to know the single array that contains their addresses of course... With older LLVM there were issues with relocations that made it impossible to link the the offload_var_table. This

[PATCH][committed]middle-end: make bic-bitmask-18.c test more precise [PR103479]

2021-12-02 Thread Tamar Christina via Gcc-patches
Hi All, This updates the testcase bic-bitmask-18.c to seach for " = 0;" as an expression so it doesn't match any other partial expressions. Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu (with and without -m32) and no regressions. Committed under the obvious rule. Thanks, Tamar gcc/t

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 12:36:30PM +, Andrew Stubbs wrote: > On 30/11/2021 16:54, Jakub Jelinek wrote: > > > Why does the GCN plugin or runtime need to know those vars? > > > It needs to know the single array that contains their addresses of > > > course... > > With older LLVM there were issu

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-02 Thread Martin Liška
On 12/2/21 13:01, Richard Biener wrote: On Thu, Dec 2, 2021 at 12:45 PM Martin Liška wrote: On 12/1/21 19:21, Andrew MacLeod wrote: On 12/1/21 09:48, Martin Liška wrote: On 12/1/21 15:34, Richard Biener wrote: On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: On 12/1/21 15:19, Richard B

Re: [PATCH] c++, dyninit: Optimize C++ dynamic initialization by constants into DECL_INITIAL adjustment [PR102876]

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, 4 Nov 2021, Jakub Jelinek wrote: > Hi! > > When users don't use constexpr everywhere in initialization of namespace > scope non-comdat vars and the initializers aren't constant when FE is > looking at them, the FE performs dynamic initialization of those variables. > But after inlining an

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, Dec 2, 2021 at 2:10 PM Martin Liška wrote: > > On 12/2/21 13:01, Richard Biener wrote: > > On Thu, Dec 2, 2021 at 12:45 PM Martin Liška wrote: > >> > >> On 12/1/21 19:21, Andrew MacLeod wrote: > >>> On 12/1/21 09:48, Martin Liška wrote: > On 12/1/21 15:34, Richard Biener wrote: > >>>

[PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103437 The patch was successfully bootstrapped and tested on x86-64. There is no test as the bug occurs on GCC built with sanitizing for an existing go test. commit c6cf5ac1522c54b2ced98fc687e973a9ff17ba1e Author: Vladimir

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 08:53:31AM -0500, Vladimir Makarov via Gcc-patches wrote: > The following patch fixes > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103437 > > The patch was successfully bootstrapped and tested on x86-64. There is no > test as the bug occurs on GCC built with sanitizin

Re: [PATCH] Fix --help -Q output

2021-12-02 Thread Martin Liška
On 11/30/21 10:33, Richard Biener wrote: and the "docs" say /* The switch is enabled when FLAG_VAR is nonzero. */ CLVC_BOOLEAN, That's bogus, because real meaning of CLVC_BOOLEAN is that it holds an integer value. It can be just true/false for a simple flag, can be 0,1,2 for things lik

Re: [PATCH] Fix --help -Q output

2021-12-02 Thread Richard Biener via Gcc-patches
On Thu, Dec 2, 2021 at 3:07 PM Martin Liška wrote: > > On 11/30/21 10:33, Richard Biener wrote: > > and the "docs" say > > > >/* The switch is enabled when FLAG_VAR is nonzero. */ > >CLVC_BOOLEAN, > > That's bogus, because real meaning of CLVC_BOOLEAN is that it holds an > integer value.

RE: [PATCH]middle-end cse: Make sure duplicate elements are not entered into the equivalence set [PR103404]

2021-12-02 Thread Tamar Christina via Gcc-patches
Hi All, He's a respin of the patch which doesn't change the complexity of insert. Richard S, since you approved the original patch could you take a look at this fix. --- Hi All, CSE uses equivalence classes to keep track of expressions that all have the same values at the current point in the

Re: [PATCH] Fix --help -Q output

2021-12-02 Thread Martin Liška
On 12/2/21 15:11, Richard Biener wrote: the ?:s look odd to me, the above is equivalent to v > 0 ? 1 : 0, no? Did you mean to make v > 0 v != 0? Yeah, it's typo, should be 'v != 0 ? ...'. Martin

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 09:00, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 08:53:31AM -0500, Vladimir Makarov via Gcc-patches wrote: The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103437 The patch was successfully bootstrapped and tested on x86-64. There is no test as the bug

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-02 Thread Andrew MacLeod via Gcc-patches
On 12/2/21 06:45, Martin Liška wrote: On 12/1/21 19:21, Andrew MacLeod wrote: On 12/1/21 09:48, Martin Liška wrote: On 12/1/21 15:34, Richard Biener wrote: On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: On 12/1/21 15:19, Richard Biener wrote: which is compute the range of 'lhs' on edge_

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 09:23:20AM -0500, Vladimir Makarov wrote: > > On 2021-12-02 09:00, Jakub Jelinek wrote: > > On Thu, Dec 02, 2021 at 08:53:31AM -0500, Vladimir Makarov via Gcc-patches > > wrote: > > > The following patch fixes > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10343

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 09:29, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 09:23:20AM -0500, Vladimir Makarov wrote: On 2021-12-02 09:00, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 08:53:31AM -0500, Vladimir Makarov via Gcc-patches wrote: The following patch fixes https://gcc.gnu.org/bugzilla/sho

[committed] libphobos: Push all callee-save registers on the stack before GC scan on ARM

2021-12-02 Thread Iain Buclaw via Gcc-patches
Hi, This is the library fix for PR103520 that also prevents the garbage collector from releasing live memory. However this requires that the host compiler has been patched with this fix, so the GC will remain disabled in the D front-end for now until enough time has passed for this to have trickl

Re: [PATCH] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-02 Thread Marek Polacek via Gcc-patches
On Wed, Dec 01, 2021 at 11:24:58PM -0500, Jason Merrill wrote: > On 12/1/21 10:16, Marek Polacek wrote: > > In C++23, auto(x) is valid, so decltype(auto(x)) should also be valid, > > so > > > >void f(decltype(auto(0))); > > > > should be just as > > > >void f(int); > > > > but currently

Re: [PATCH] gcc: vxworks: fix providing stdint.h header

2021-12-02 Thread Olivier Hainque via Gcc-patches
Hi Rasmus, Some new on this. > On 20 Nov 2021, at 09:07, Olivier Hainque wrote: > > I'll check how our build sequence proceeds. Turns out our build succeeds thanks to the presence of a vendor version of stdint.h in the VxWorks6/7 header dirs and we're lucky that the need to pre-include yvals.h

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Christophe Lyon via Gcc-patches
On Thu, Dec 2, 2021 at 3:38 PM Vladimir Makarov via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > > On 2021-12-02 09:29, Jakub Jelinek wrote: > > On Thu, Dec 02, 2021 at 09:23:20AM -0500, Vladimir Makarov wrote: > >> On 2021-12-02 09:00, Jakub Jelinek wrote: > >>> On Thu, Dec 02, 2021 at 08:53:3

Re: [PATCH] Fix --help -Q output

2021-12-02 Thread Martin Liška
On 12/2/21 15:22, Martin Liška wrote: On 12/2/21 15:11, Richard Biener wrote: the ?:s look odd to me, the above is equivalent to v >  0 ? 1 : 0, no? Did you mean to make v > 0 v != 0? Yeah, it's typo, should be 'v != 0 ? ...'. Martin There's a tested patch can bootstrap on x86_64-linux-gnu

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-02 Thread Martin Liška
On 12/2/21 15:27, Andrew MacLeod wrote: ranger->gori().outgoing_edge_range_p (irange &r, edge e, tree name, *get_global_range_query ()); Thank you! It works for me! Martin

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 10:52, Christophe Lyon wrote: On Thu, Dec 2, 2021 at 3:38 PM Vladimir Makarov via Gcc-patches wrote: On 2021-12-02 09:29, Jakub Jelinek wrote: > On Thu, Dec 02, 2021 at 09:23:20AM -0500, Vladimir Makarov wrote: >> On 2021-12-02 09:00, Jakub Jelinek wrote: >>>

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Andrew Stubbs
On 02/12/2021 12:58, Jakub Jelinek wrote: I've tried modifying offload_handle_link_vars but that spot doesn't catch the omp_data_sizes variables emitted by libgomp.c-c++-common/target_42.c, which was one of the motivating examples. Why doesn't catch it? Is the variable created only post-IPA? I

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: > --- a/gcc/ira-color.c > +++ b/gcc/ira-color.c > @@ -2797,6 +2797,7 @@ static void > setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n) > { >int i, length, nrefs, priority, max_priority, mult, diff; > + b

[Ada] Fix possible memory corruption for hostnames longer than 1024 bytes

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
When a hostname has more than 1024 characters, Constraint_Error is raised if the runtime is compiled with checks on, otherwise a memory corruption occurs. Use the constant NI_MAXHOST to ensure that the appropriate buffer size is allocated for the hostnames. Tested on x86_64-pc-linux-gnu, committed

[Ada] More intuitive names in sanity-checking of derived types

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Check_Derived_Type used generic names for local variables, e.g. Elmt, List, Subp. This patch renames them to be more intuitive, in particular, using Derived_ and Parent_ prefixes for variables related to derived and parent types, respectively. Cleanup related to expansion of dispatching eq

[Ada] Proof of Boolean'Image and Boolean'Value

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the functionality of the runtime support for these attributes that print and parse a Boolean value. As a side-effect of this proof, fix a possible range check failure in System.Val_Bool.Value_Boolean and a possible overflow check failure in System.Val_Util.Normalize_String. GNATprove

[Ada] Proof of System.Val_Util utilities for 'Value support

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the functionality of the utility procedures supporting the implementation of 'Value attributes. As a side-effect of this proof, fix possible range check failures. GNATprove is run with switch --level=3. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-

[Ada] Add contract to Ada.Task_Identification.Activation_Is_Complete

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Description of Activation_Is_Complete was amended in AI12-0231-1. This routine raises a Program_Error when called with Null_Task_Id. Add an explicit contract to make GNATprove aware of the restriction. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/a-taside.ads (Ac

[Ada] Proof of Interfaces.C with SPARK

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the functionality of Interfaces.C with GNATprove. Ada RM specifications are added as comments in the spec, next to the formalization of specifications as contracts. As a side-effect of this proof, fix two errors in the 4 procedure versions of To_Ada, which may raise a range check fail

[Ada] vx7r2cert/light-tasking-rtp: undefined refs on ppc/ppc64

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Vx7r2cert ppc/ppc64 targets use the gcc toolchain, which requires a slightly different forumulation of libraries for the rts-light-tasking-rtp runtime. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * vxworks7-cert-rtp-link__ppcXX.spec: New file. * Makefile.rtl: Use i

[Ada] Remove duplicated condition in warnings about read-before-write

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Code for warnings about read-before-write of a variable had one condition in the outer IF statement and then the very same condition in an inner IF statement. Cleanup related to spurious warning on 'Initialized. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_warn.adb (

[Ada] Simplify iteration over record components

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Iterate over record components with First_Component/Next_Component and not with First_Entity/Next_Entity. Change in Sem_Warn unit is related to spurious warning on 'Initialized; other occurrences of the same pattern were found with grep. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Don't allow entry in implicit with chain to be ghost

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
When we add an entry to the implicit with chain of a unit while adding an RTS unit, we must not mark it as a ignored ghost statement because it points to the next with in the chain. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * rtsfind.adb (Maybe_Add_With): Ensure that the

[Ada] Refactor nested loops in warning on unassigned out parameter

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
For warning about unassigned out parameter we had a loop over all formal parameters which contained another loop over all formal parameters. This was inefficient. Cleanup related to spurious warnings about 'Initialized. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_wa

[Ada] Split spec and body of expression function with Subprogram_Variant

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Due to a latent bug with freezing, the expression function with Subprogram_Variant which was recently added to the System.Val_Util unit triggers a crash in CodePeer. Ordinary compilation was not affected by this bug, because of the Assertion_Policy (Ghost => Ignore) applied to this unit. Tested o

[Ada] Separate building of equality from other dispatching routines

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
For GNAT we create dispatching equality together with other dispatching routines (e.g. for stream reading and writing). For GNATprove we need to create only the dispatching equality. This patch separates it, so that it can be created from a SPARK-specific expansion. Tested on x86_64-pc-linux-gnu,

[Ada] Enable expansion of dispatching equality for GNATprove

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
For GNAT the dispatching equality is generated in expansion of freezing nodes. For GNATprove this expansion needs to be specifically enabled and must occur in a carefully setup context. Previously type freezing for GNATprove only involved building of the DIC procedure, which didn't require much co

[Ada] Inline all calls in Ada.Task_Identification

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; all routines in Ada.Task_Identification had pragma Inline except Activation_Is_Complete (and Image, which should rather stay like that). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/a-taside.ads (Activation_Is_Complete): Add pragma Inline.di

[Ada] Enhance freezing code for instantiations

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This makes it possible for the freezing code to let the back-end establish a proper order of elaboration of package and subprogram instantiations in more cases, in particular with circularities, by placing freeze nodes for them later in the expanded code in these cases. Tested on x86_64-pc-linux-g

[Ada] Remove extra space after assignment symbol

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Fix style issues in GNAT after spotting a similar problem in one of the tests for GNATprove. These are easy to find with grep, but still require a manual inspection, because we want to preserve layout in declaration lists like: A := 1; B := 10; C := 100; Tested on x86_64-pc-linux-gnu, co

[Ada] Cleanups related to expansion of dispatching primitives

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Assorted cleanups related to expansion of dispatching primitives on derived types for GNATprove; semantics of the compiler is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst (No_Dispatching_

[Ada] Use bracket aggregates in Ada2022

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Make bracket syntax array and container aggregates available with -gnat2022. Parenthesis syntax is not accepted anymore for container aggregate but can still be used for array aggregates. The latter is considered obsolete and a warning is emitted with -gnatwj. The warning is also temporarily disab

[PING] [PATCH] rs6000: testsuite: Add rop_ok effective-target function

2021-12-02 Thread Peter Bergner via Gcc-patches
I'd like to ping the following patch. The test case in the previously OK'd fix for PR101324 depends on this change, so I've had to hold off committing it until this is in. Thanks. https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584208.html Peter Message-ID: This patch adds a new

[Ada] Cleanup insertion of single freezing actions

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Replace calls to Ensure_Freeze_Node & Append_Freeze_Actions (plural) with a simple call to Append_Freeze_Action (singular), which calls Ensure_Freeze_Node itself. Cleanup related to expansion of dispatching primitives for GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committe

[Ada] Cleanup detection of suspension objects

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Current implementation of Is_Suspension_Object is a leftover from an old code of Is_Descendant_Of_Suspension_Object, which used RTE_Available and indeed couldn't be called from GNATprove. Now Is_Descendant_Of_Suspension_Object can work with Is_RTE, which can be safely called from GNATprove. Clean

[Ada] Add pragma Annotate for CodePeer analysis

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
CodePeer issues a spurious message on the analysis of the loop variant in s-widthi.adb. Similarly to the same for s-widthu.adb, add a pragma Annotate to justify this message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-widthi.adb: Add pragma Annotate.diff --git

[Ada] Proof of support units for 'Width on signed integers

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This replicates the proofs performed for 'Width on modular integers to the units that support 'Width on signed integers. Also add a minimal postcondition to the System.Width_U. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-widint.ads: Mark in SPARK. * lib

[Ada] Amend proof of System.Arith_Double to remove justifications

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
The proof of System.Arith_Double contained 11 occurrences of pragma Annotate to justify unproved checks, 10 of which for calls to Raise_Error denoting a case where the input leads to a division by zero or an overflow, and one for a loop invariant regarding an assumption on Single_Size. That should

[Ada] Reset internal flags for -gnatD and -gnatG

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This resets the internal flags associated with the -gnatD and -gnatG switches once the generated code is printed, so that it does not end up being printed twice in case something goes wrong after this point. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sprint.adb (Source_

[Ada] Fix obsolete array aggregate warning being triggered by expanded code

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Filter out nodes not coming from source before emitting the warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Filter out nodes not coming from source before emitting the warning.diff --git a/gcc/ada/sem_aggr.adb b/gcc/ad

[Ada] Invalid memory access on finalization of class-wide type

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This patch is the first part of a correction for issues in the compiler whereby finalization of a heap-allocated class-wide type may cause an invalid memory read at runtime when the type in question contains a component whose type has alignment specified. Tested on x86_64-pc-linux-gnu, committed o

[Ada] Proof of System.Arith_32 for double arithmetic on 32bits

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This replicates in a simpler setting the proofs performed for generic unit System.Arith_Double. Note that it makes a difference to declare functions Big as expression functions here instead of renamings, as some checks are not proved with renamings, so expression functions are used instead. GNATp

[Ada] Fix packing for array component with discriminated part

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This restores the packing for a record type that contains a component of an array type whose component type is a record type with a subcomponent that is of a discriminated record type with variable size. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/gigi.h (a

[Ada] Do not back-annotate maximum size for limited types

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This prevents gigi from back-annotating a maximum size for the Esize of limited record and concurrent types, in keeping with the implementation of Analyze_Object_Declaration for objects of these types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.c (gna

[Ada] Remove obsolete a-assert

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This package is a leftover after the change for using the base compiler's runtime during bootstrap. It is not used anymore. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/a-assert.ads, gcc-interface/a-assert.adb: Remove.diff --git a/gcc/ada/gcc-interface/a-ass

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Andrew Stubbs
On 02/12/2021 16:05, Andrew Stubbs wrote: On 02/12/2021 12:58, Jakub Jelinek wrote: I've tried modifying offload_handle_link_vars but that spot doesn't catch the omp_data_sizes variables emitted by libgomp.c-c++-common/target_42.c, which was one of the motivating examples. Why doesn't catch

Re: [PATCH] stddef.h: add support for musl typedef macro guards

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/26/2021 9:57 AM, soeren--- via Gcc-patches wrote: From: Sören Tempel The stddef.h header checks/sets various hardcoded toolchain/os specific macro guards to prevent redefining types such as ptrdiff_t, wchar_t, or size_t. However, without this patch, the file does not check/set the type

Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c

2021-12-02 Thread Bill Schmidt via Gcc-patches
Hi! On 12/1/21 5:00 PM, Segher Boessenkool wrote: > On Thu, Nov 18, 2021 at 10:36:52AM -0600, Bill Schmidt wrote: >> Hi! This is the last patch broken out of the previous test suite patch >> for the new builtins support. > Whew :-) > >> One advantage of the new builtins support is uniform error m

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 04:31:36PM +, Andrew Stubbs wrote: > On 02/12/2021 16:05, Andrew Stubbs wrote: > > On 02/12/2021 12:58, Jakub Jelinek wrote: > > > > I've tried modifying offload_handle_link_vars but that spot > > > > doesn't catch > > > > the omp_data_sizes variables emitted by > > > >

[committed] libstdc++: Restore unconditional atomic load in COW std::string

2021-12-02 Thread Jonathan Wakely via Gcc-patches
On Wed, 1 Dec 2021 at 18:24, Jonathan Wakely wrote: > > On Wed, 1 Dec 2021 at 18:16, Florian Weimer wrote: > > > > * Jonathan Wakely via Libstdc: > > > > > diff --git a/libstdc++-v3/include/bits/cow_string.h > > > b/libstdc++-v3/include/bits/cow_string.h > > > index ced395b80b8..4fae1d02981 100644

Re: [PATCH] libstdc++: Remove broken std::allocator base classes [PR103340]

2021-12-02 Thread Jonathan Wakely via Gcc-patches
On Wed, 24 Nov 2021 at 13:25, Jonathan Wakely via Libstdc++ wrote: > > I plan to commit this Real Soon. Please yell if you need these > alternative std::allocator back-ends to stay (and explain how you're > using them when they've been broken for years, and start sending test > results to the gcc

[committed] libstdc++: Allow exception classes to move fully-dynamic strings

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux using --enable-fully-dynamic-string and x86_64-linux using the default config. Pushed to trunk. The move constructor for the fully-dynamic std::basic_string was not noexcept until recently, so the std::logic_error and std::runtime_error move constructors were defined to m

[PATCH] libstdc++: Do not leak empty COW strings

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Apart from "don't bother changing the COW string", does anybody see a reason we shouldn't do this? This passes all tests for normal COW strings and fully-dynamic COW strings. When non-const references, pointers or iterators are obtained to the contents of a COW std::basic_string, the implementati

[PATCH] libstdc++: Fix non-reserved name in std::allocator base class [PR64135]

2021-12-02 Thread Jonathan Wakely via Gcc-patches
I'd like to push this to trunk to fix PR64135. It think this fixes the use of a non-reserved name, while preserving the ABI as far as class layout goes. It will break any programs which rely on std::allocator having a __gnu_cxx::new_allocator base class, e.g. so that is_convertible<__gnu_cxx::new_

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 11:13, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2797,6 +2797,7 @@ static void setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n) { int i, length, nrefs, prio

[wwwdocs] Document --enable-libstdcxx-allocator changes

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-12/changes.html | 5 + 1 file changed, 5 insertions(+) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 000501fb..c2b87a53 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@ -41,6 +41,11 @@ a work-in-progre

[PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Mark Wielaard
Rust v0 symbols can have a .suffix because if compiler transformations. These can be ignored it the demangled name. Which is what this patch implements). But an alternative implementation could be to follow what C++ does and represent these as [clone .suffix] tagged onto the demangled name. But thi

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 12:06, Vladimir Makarov wrote: On 2021-12-02 11:13, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2797,6 +2797,7 @@ static void   setup_allocno_priorities (ira_allocno_t *consideration_allo

Re: [PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Eduard-Mihai Burtescu
On Thu, Dec 2, 2021, at 19:17, Mark Wielaard wrote: > Rust v0 symbols can have a .suffix because if compiler transformations. For some context, the suffix comes from LLVM (I believe as part of its LTO). If this were a semantic part of a Rust symbol, it would have an encoding within v0 (as we alre

Re: [SVE] PR96463 - Optimise svld1rq from vectors

2021-12-02 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > Hi Richard, > I have attached a WIP untested patch for PR96463. > IIUC, the PR suggests to transform > lhs = svld1rq ({-1, -1, ...}, &v[0]) > into: > lhs = vec_perm_expr > if v is vector of 4 elements, and each element is 32 bits on little > endian target ? > > I am s

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 12:21, Vladimir Makarov via Gcc-patches wrote: On 2021-12-02 12:06, Vladimir Makarov wrote: So simple problem and so many details :) This will require that long long is at least twice as large as int everywhere, I thought you wanted to do that only when __builtin_smul_overflow

Re: [PATCH] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-02 Thread Jason Merrill via Gcc-patches
On 12/2/21 10:27, Marek Polacek wrote: On Wed, Dec 01, 2021 at 11:24:58PM -0500, Jason Merrill wrote: On 12/1/21 10:16, Marek Polacek wrote: In C++23, auto(x) is valid, so decltype(auto(x)) should also be valid, so void f(decltype(auto(0))); should be just as void f(int); but curren

Re: [PATCH] libgccjit: add some reflection functions in the jit C api

2021-12-02 Thread Gerald Pfeifer
On Sat, 27 Nov 2021, Petter Tomner wrote: > Ye it is supposed to compile cleanly for 32bit too. > > I pushed a patch for it as a "free for all". With %zu specifiers. Thank you, Petter. I just updated the lang/gcc12-devel port in FreeBSD to Sunday's snapshot that has those changes, so we shall l

Re: [vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2021-12-02 Thread Richard Sandiford via Gcc-patches
[Review for patch 1] Joel Hutton writes: > From e7b3017b7b5879204e9d61760a85cc84beeb4fe0 Mon Sep 17 00:00:00 2001 > From: Joel Hutton > Date: Wed, 25 Aug 2021 14:31:15 +0100 > Subject: [PATCH 1/3] [vect-patterns] Refactor to allow internal_fn's > > Hi all, > > This refactor allows widening patte

Re: [PATCH] regrename: Skip renaming if instruction is noop move.

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/18/2021 11:23 PM, Jojo R wrote: — Jojo 在 2021年11月19日 +0800 AM12:13,Jeff Law ,写道: On 11/16/2021 7:20 PM, Jojo R via Gcc-patches wrote: — Jojo 在 2021年11月16日 +0800 PM8:12,Richard Biener ,写道: On Tue, Nov 16, 2021 at 12:45 PM Jojo R via Gcc-patche

Re: [PATCH] pch, v2: Add support for PCH for relocatable executables

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/18/2021 1:04 AM, Jakub Jelinek wrote: On Mon, Nov 08, 2021 at 08:48:07PM +0100, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches wrote: So, if we want to make PCH work for PIEs, I'd say we can: 1) add a new GTY option, say cal

[committed] wwwdocs: git: Fix casing of GCC

2021-12-02 Thread Gerald Pfeifer
We've been referring to the project as GCC since GCC 2.95. --- htdocs/git.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/git.html b/htdocs/git.html index 493b5734..5fbd98bf 100644 --- a/htdocs/git.html +++ b/htdocs/git.html @@ -327,7 +327,7 @@ in Git. by mai

[committed] analyzer: add regression test for leak false +ve [PR103526]

2021-12-02 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-5757-g38a0ee2649ef236ea2763bb9cfc42dc917c7d3fd. gcc/testsuite/ChangeLog: PR analyzer/103526 * gcc.dg/analyzer/pr103526.c: New test. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/pr103526.c |

[committed] doc: Remove references to FreeBSD 1 and 2

2021-12-02 Thread Gerald Pfeifer
FreeBSD 1 and FreeBSD 2, both still a.out, have been end of life for over two decades and GCC has not been supporting them for ages, too, so simply remove references. gcc: * doc/install.texi (*-*-freebsd*): Remove references to FreeBSD 1 and FreeBSD 2. --- gcc/doc/install.texi | 4

  1   2   >