[PATCH] middle-end/114734 - wrong code with expand_call_mem_ref

2024-04-26 Thread Richard Biener
When expand_call_mem_ref looks at the definition of the address argument to eventually expand a _MEM_REF argument together with a masked load it fails to honor constraints imposed by SSA coalescing decisions. The following fixes this. Boostrap and regtest running on x86_64-unknown-linux-gnu.

Re: [PATCH] libgcc: Don't use weakrefs for glibc 2.34

2024-04-25 Thread Richard Biener
> Am 25.04.2024 um 20:24 schrieb Jakub Jelinek : > > Hi! > > glibc 2.34 and later doesn't have separate libpthread (libpthread.so.0 is a > dummy shared library with just some symbol versions for compatibility, but > all the pthread_* APIs are in libc.so.6). > So, we don't need to do the

Re: [PATCH] wwwdocs: contribute.html: Update consensus on patch content.

2024-04-25 Thread Richard Biener
> Am 25.04.2024 um 17:44 schrieb Carlos O'Donell : > > Discussion is here: > https://inbox.sourceware.org/gcc/CAPS5khZeWkAD=v8ka9g5eecdnk3bdhfnzjumpvc+hedmkvj...@mail.gmail.com/ > > Rough consensus from Jakub Jelinek, Richard Biener and others is > that maintainers ar

[PATCH] tree-optimization/114792 - order loops to unloops in CH

2024-04-25 Thread Richard Biener
When we use unloop_loops we have to make sure to have loops ordered inner to outer as otherwise we can wreck inner loop structure where unlooping relies on that being intact. The following re-sorts the vector of to unloop loops after copy-header as that adds to the vector in two places and the

[PATCH] tree-optimization/114787 - more careful loop update with CFG cleanup

2024-04-24 Thread Richard Biener
When CFG cleanup removes a backedge we have to be more careful with loop update. In particular we need to clear niter info and estimates and if we remove the last backedge of a loop we have to also mark it for removal to prevent a following basic block merging to associate loop info with an

[PATCH] tree-optimization/114832 - wrong dominator info with vect peeling

2024-04-23 Thread Richard Biener
When we update the dominator of the redirected exit after peeling we check whether the immediate dominator was the loop header rather than the exit source when we later want to just update it to the new source. The following fixes this oversight. Bootstrap and regtest running on

[PATCH] tree-optimization/114799 - SLP and patterns

2024-04-23 Thread Richard Biener
The following plugs a hole with computing whether a SLP node has any pattern stmts which is important to know when we want to replace it by a CTOR from external defs. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/114799 * tree-vect-slp.cc

Re: [PATCH] decay vect tests from run to link for pr95401

2024-04-22 Thread Richard Biener
On Mon, Apr 22, 2024 at 12:05 PM Alexandre Oliva wrote: > > Ping?-ish for the full version of the RFC posted at > https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566588.html > > On Mar 11, 2021, Richard Biener wrote: > > > On Thu, Mar 11, 2021 at 9:03 AM Alexandre

Re: [PATCH] s390: testsuite: Fix forwprop-4{0,1}.c

2024-04-22 Thread Richard Biener
On Mon, Apr 22, 2024 at 10:47 AM Andreas Krebbel wrote: > > Hi Stefan, > > due to that missed optimization we currently generate silly code for these > two tests and should > really fix this (after gcc entering stage1). So just skipping it on s390x > would definitely be the > wrong choice I

Re: [PATCH]middle-end: refactory vect_recog_absolute_difference to simplify flow [PR114769]

2024-04-19 Thread Richard Biener
On Fri, Apr 19, 2024 at 3:29 PM Tamar Christina wrote: > > Hi All, > > As the reporter in PR114769 points out the control flow for the abd detection > is hard to follow. This is because vect_recog_absolute_difference has two > different ways it can return true. > > 1. It can return true when the

Re: [PATCH] rtlanal: Fix set_noop_p for volatile loads or stores [PR114768]

2024-04-19 Thread Richard Biener
024-04-18 15:43:30.389730365 +0200 > @@ -0,0 +1,10 @@ > +/* PR rtl-optimization/114768 */ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -fdump-rtl-final" } */ > +/* { dg-final { scan-rtl-dump "\\\(mem/v:" "final" { target { ! { nvptx*-*-* > } } } } } */ > + > +void > +foo (int *p) > +{ > + *p = *(volatile int *) p; > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] libgcc: Another __divmodbitint4 bug fix [PR114762]

2024-04-19 Thread Richard Biener
ive_tests } { "-flto" } { "" } } */ > + > +#if __BITINT_MAXWIDTH__ >= 255 > +__attribute__((__noipa__)) signed _BitInt(255) > +foo (signed _BitInt(255) a, signed _BitInt(65) b) > +{ > + return a / b; > +} > +#endif > + > +int > +main () > +{ > +#if __BITINT_MAXWIDTH__ >= 255 > + if (foo (1, -0xwb - 1wb)) > +__builtin_abort (); > +#endif > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] libstdc++: Support link chains in std::chrono::tzdb::locate_zone [PR114770]

2024-04-19 Thread Richard Biener
On Thu, Apr 18, 2024 at 6:34 PM Jonathan Wakely wrote: > > This would fix the but, how do people feel about it this close to the > gcc-14 release? Guess we'll have to fix it anyway, so why not now ... (what could go wrong..) Richard. > Tested x86_64-linux. > > -- >8 -- > > Since 2022 the TZif

Re: [PATCH] libgcc: Fix up __divmodbitint4 [PR114755]

2024-04-18 Thread Richard Biener
21448 +0200 > +++ gcc/testsuite/gcc.dg/torture/bitint-69.c 2024-04-17 19:10:25.343814139 > +0200 > @@ -0,0 +1,26 @@ > +/* PR libgcc/114755 */ > +/* { dg-do run { target bitint } } */ > +/* { dg-options "-std=c23" } */ > +/* { dg-skip-if "" { ! run_expensiv

Re: [PATCH] internal-fn: Temporarily disable flag_trapv during .{ADD,SUB,MUL}_OVERFLOW etc. expansion [PR114753]

2024-04-18 Thread Richard Biener
alse, NULL); > + flag_trapv = save_flag_trapv; > return; > } > > --- gcc/testsuite/gcc.dg/pr114753.c.jj2024-04-17 13:55:16.246482369 > +0200 > +++ gcc/testsuite/gcc.dg/pr114753.c 2024-04-17 13:54:14.035352376 +0200 > @@ -0,0 +1,14 @@ > +/

Re: [PATCH v2 2/2] lto-wrapper: Truncate files using -truncate driver option [PR110710]

2024-04-18 Thread Richard Biener
On Thu, Apr 18, 2024 at 6:12 AM Peter Damianov wrote: > > This commit changes the Makefiles generated by lto-wrapper to no longer use > the "mv" and "touch" shell commands. These don't exist on Windows, so when the > Makefile attempts to call them, it results in errors like: > The system cannot

Re: [PATCH v2 1/2] Driver: Add new -truncate option

2024-04-18 Thread Richard Biener
On Thu, Apr 18, 2024 at 6:12 AM Peter Damianov wrote: > > This commit adds a new option to the driver that truncates one file after > linking. > > Tested likeso: > > $ gcc hello.c -c > $ du -h hello.o > 4.0K hello.o > $ gcc hello.o -truncate hello > $ ./a.out > Hello world > $ du -h hello.o > $

Re: [PATCH] DOCUMENTATION_ROOT_URL vs. release branches [PR114738]

2024-04-17 Thread Richard Biener
On Wed, Apr 17, 2024 at 1:17 PM Jakub Jelinek wrote: > > Hi! > > Starting with GCC 14 we have the nice URLification of the options printed > in diagnostics, say for in > test.c:4:23: warning: format ‘%d’ expects argument of type ‘int’, but > argument 2 has type ‘long int’ [-Wformat=] > the

[PATCH] Support {CEIL, FLOOR, ROUND}_{DIV, MOD}_EXPR and EXACT_DIV_EXPR in GIMPLE FE

2024-04-17 Thread Richard Biener
The following adds support for the various division and modulo operators to the GIMPLE frontend via __{CEIL,FLOOR,ROUND}_{DIV,MOD} and __EXACT_DIV operators. Bootstrapped and tested on x86_64-unknown-linux-gnu, queued for stage1. Richard. gcc/c/ * gimple-parser.cc

[PATCH] tree-optimization/114749 - reset partial vector decision for no-SLP retry

2024-04-17 Thread Richard Biener
The following makes sure to reset LOOP_VINFO_USING_PARTIAL_VECTORS_P to its default of false when re-trying without SLP as otherwise analysis may run into bogus asserts. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. PR tree-optimization/114749 *

Re: [PATCH] asan: Don't instrument .ABNORMAL_DISPATCHER [PR114743]

2024-04-17 Thread Richard Biener
> + > +void > +freddy (int x, int *y, struct S *p) > +{ > + bar (*p); > + ++p; > + if (x == 25) > +x = foo (2); > + else if (x == 42) > +x = foo (foo (3)); > + *y = bar (*p); > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

[PATCH] middle-end/13421 - -ftrapv vs. POINTER_DIFF_EXPR

2024-04-16 Thread Richard Biener
Currently we expand POINTER_DIFF_EXPR using subv_optab when -ftrapv (but -fsanitize=undefined does nothing). That's not consistent with the behavior of POINTER_PLUS_EXPR which never uses addv_optab with -ftrapv. Both are because of the way we select whether to use the trapping or the

[PATCH] tree-optimization/114736 - SLP DFS walk issue

2024-04-16 Thread Richard Biener
The following fixes a DFS walk issue when identifying to be ignored latch edges. We have (bogus) SLP_TREE_REPRESENTATIVEs for VEC_PERM nodes so those have to be explicitly ignored as possibly being PHIs. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. Richard. PR

[PATCH] tree-optimization/114733 - neg induction fails for 1 element vectors

2024-04-16 Thread Richard Biener
The neg induction vectorization code isn't prepared to deal with single element vectors. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. Richard. PR tree-optimization/114733 * tree-vect-loop.cc (vectorizable_nonlinear_induction): Reject neg induction

Re: [PATCH] Fix some comment nits

2024-04-16 Thread Richard Biener
t; > -/* For T being aggregate type try to turn it into a incomplete variant. > +/* For T being aggregate type try to turn it into an incomplete variant. > Return T if no simplification is possible. */ > > static tree > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] [testsuite] [i386] require fpic for pr111497.C

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:43 AM Alexandre Oliva wrote: > > > Fix another test that uses -fPIC without requiring fpic support. > > Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 on arm-, > aarch64-, x86- and x86_64-vxworks7r2. Ok to install? OK. > PS: This is neither the first nor

Re: [PATCH] [testsuite] xfail pr103798-2 in C++ on vxworks too [PR113706]

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:31 AM Alexandre Oliva wrote: > > > pr103798-2.c fails in C++ on targets that provide a ISO C++-compliant > declaration of memchr, because it mismatches the C-compatible builtin, > as per PR113706. Expect the C++ test to fail on vxworks as well. > > Regstrapped on

Re: [PATCH] [testsuite] [analyzer] include sys/select.h if available

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:29 AM Alexandre Oliva wrote: > > > Test that calls select fails on vxworks because select is only > declared in sys/select.h. Include that header if it's present. > > Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 on arm-, > aarch64-, x86- and

Re: [PATCH] [testsuite] [analyzer] require fork where used

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:27 AM Alexandre Oliva wrote: > > > Mark tests that fail due to the lack of fork, as in vxworks kernel > mode, as requiring fork. > > Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 on arm-, > aarch64-, x86- and x86_64-vxworks7r2. Ok to install? > OK > for

Re: [PATCH] [testsuite] [analyzer] avoid vxworks libc mode_t

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:25 AM Alexandre Oliva wrote: > > > Define macro that prevents mode_t from being defined by vxworks' > headers as well. > > Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 on arm-, > aarch64-, x86- and x86_64-vxworks7r2. Ok to install? OK > > for

Re: [PATCH] [testsuite] [analyzer] skip access-mode: O_ACCMODE on vxworks

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:26 AM Alexandre Oliva wrote: > > > O_ACCMODE is not defined on vxworks, and the test is meaningless and > failing without it, so skip it. > > Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 on arm-, > aarch64-, x86- and x86_64-vxworks7r2. Ok to install? OK >

Re: [PATCH] [testsuite] introduce strndup effective target

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 5:23 AM Alexandre Oliva wrote: > > > A number of tests that call strndup fail on vxworks, where there's no > strndup. Some of them already had workarounds to skip the strndup > parts of the tests on platforms that don't offer it. I've changed > them to rely on a strndup

Re: [PATCH] Document that vector_size works with typedefs [PR92880]

2024-04-16 Thread Richard Biener
On Tue, Apr 16, 2024 at 2:26 AM Andrew Pinski wrote: > > This just adds a clause to make it more obvious that the vector_size > attribute extension works with typedefs. > Note this whole section needs a rewrite to be a similar format as other > extensions. But that is for another day. > > OK? OK

Re: [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c

2024-04-16 Thread Richard Biener
get { ! ilp32 } > } } } */ > > #include "tree-vect.h" > > -typedef unsigned long PV; > +typedef unsigned long long PV; > typedef struct _buff_t { > int foo; > PV Val; > > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: docs: document early break support and pragma novector

2024-04-16 Thread Richard Biener
d > + GCC supports a new pragma pragma GCC novector to > + indicate to the vectorizer not to vectorize the loop annotated with the > + pragma. > > > Runtime Library (libstdc++) > > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] Guard longjmp in test to not inf loop [PR114720]

2024-04-15 Thread Richard Biener
On Mon, Apr 15, 2024 at 2:35 PM Jørgen Kvalsvik wrote: > > Guard the longjmp to not infinitely loop. The longjmp (jump) function is > called unconditionally to make test flow simpler, but the jump > destination would return to a point in main that would call longjmp > again. The longjmp is really

Re: [wwwdocs] gcc-14/changes.html (AMD GCN): Mention gfx1036 support

2024-04-15 Thread Richard Biener
On Mon, Apr 15, 2024 at 12:04 PM Tobias Burnus wrote: > > I experimented with some variants to make clearer that each of RDNA2 and > RNDA3 applies to two card types, but at the end I settled on the > fewest-word version. > > Comments, remarks, suggestions? (To this change or in general?) > >

Re: [PATCH] c, v3: Fix ICE with -g and -std=c23 related to incomplete types [PR114361]

2024-04-15 Thread Richard Biener
On Mon, 15 Apr 2024, Jakub Jelinek wrote: > On Mon, Apr 15, 2024 at 10:05:58AM +0200, Jakub Jelinek wrote: > > On Mon, Apr 15, 2024 at 10:02:25AM +0200, Richard Biener wrote: > > > > Though, haven't managed to reproduce it with -O2 -flto -std=c23 > > > > struct S

[PATCH] gcov-profile/114715 - missing coverage for switch

2024-04-15 Thread Richard Biener
The following avoids missing coverage for the line of a switch statement which happens when gimplification emits a BIND_EXPR wrapping the switch as that prevents us from setting locations on the containing statements via annotate_all_with_location. Instead set the location of the GIMPLE switch

Re: [PATCH] attribs: Don't crash on NULL TREE_TYPE in diag_attr_exclusions [PR114634]

2024-04-15 Thread Richard Biener
00 > @@ -0,0 +1,8 @@ > +// PR c++/114634 > +// { dg-do compile } > + > +template > +struct A > +{ > + enum { e __attribute__ ((aligned (16))) }; // { dg-error "alignment may > not be specified for 'e'" } > +}; > > Jakub > > -- Ric

Re: [C PATCH, v2] Fix ICE with -g and -std=c23 related to incomplete types [PR114361]

2024-04-15 Thread Richard Biener
On Mon, 15 Apr 2024, Jakub Jelinek wrote: > On Mon, Apr 15, 2024 at 09:38:29AM +0200, Jakub Jelinek wrote: > > I had this spot instrumented to log the different cases (before adding the > > code to fix up also pointer types in c_update_type_canonical) and the only > > thing > > that triggered

Re: [Backport 1/2] tree-profile: Disable indirect call profiling for IFUNC resolvers

2024-04-15 Thread Richard Biener
On Mon, 15 Apr 2024, Richard Biener wrote: > On Sun, 14 Apr 2024, H.J. Lu wrote: > > > We can't profile indirect calls to IFUNC resolvers nor their callees as > > it requires TLS which hasn't been set up yet when the dynamic linker is > > resolving IFUNC symbols. > &

Re: [Backport 1/2] tree-profile: Disable indirect call profiling for IFUNC resolvers

2024-04-15 Thread Richard Biener
t; + f3(); > + return bar; > +} > + > +/* { dg-final { scan-tree-dump-not "__gcov_indirect_call_profiler_v" > "optimized" } } */ > diff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc > index da300d5f9e8..b5de0fb914f 100644 > --- a/gcc/tree-profile.cc > +++ b/gcc/tree-profile.cc > @@ -418,7 +418,13 @@ gimple_gen_ic_func_profiler (void) >gcall *stmt1; >tree tree_uid, cur_func, void0; > > - if (c_node->only_called_directly_p ()) > + /* Disable indirect call profiling for an IFUNC resolver and its > + callees since it requires TLS which hasn't been set up yet when > + the dynamic linker is resolving IFUNC symbols. See > + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114115 > + */ > + if (c_node->only_called_directly_p () > + || c_node->called_by_ifunc_resolver) > return; > >gimple_init_gcov_profiler (); > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [C PATCH, v2] Fix ICE with -g and -std=c23 related to incomplete types [PR114361]

2024-04-15 Thread Richard Biener
@@ > +/* PR c/114361 */ > +/* { dg-do compile } */ > +/* { dg-options "-std=gnu23 -g" } */ > + > +void f() > +{ > +typedef struct foo bar; > +typedef __typeof( ({ (struct foo { bar *x; }){ }; }) ) wuz; > +struct foo { wuz *x; }; > +} > + > d

Re: [PATCH]middle-end: adjust loop upper bounds when peeling for gaps and early break [PR114403].

2024-04-12 Thread Richard Biener
iltin_memcmp (buffer+i, (char*)[i].Val, store_size)) > + __builtin_abort (); > + > + return 0; > +} > + > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > index > 4375ebdcb493a90fd0501cbb4b07466077b525c3..024a24a305c4727f97eb022247f4dca791c52dfe > 100644 > --- a/gcc/tree-vect-loop.cc > +++ b/gcc/tree-vect-loop.cc > @@ -12144,6 +12144,12 @@ vect_transform_loop (loop_vec_info loop_vinfo, > gimple *loop_vectorized_call) > -min_epilogue_iters to remove iterations that cannot be performed > by the vector code. */ >int bias_for_lowest = 1 - min_epilogue_iters; > + /* For an early break we must always assume that the vector loop can be > + executed partially. In this definition a partial iteration means that > we > + take an exit before the IV exit. */ > + if (LOOP_VINFO_EARLY_BREAKS (loop_vinfo)) > +bias_for_lowest = 1; > + >int bias_for_assumed = bias_for_lowest; >int alignment_npeels = LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo); >if (alignment_npeels && LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo)) > > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] tree-cfg: Make the verifier returns_twice message translatable

2024-04-12 Thread Richard Biener
> Am 12.04.2024 um 09:58 schrieb Jakub Jelinek : > > Hi! > > While translation of the verifier messages is questionable, that case is > something that ideally should never happen except to gcc developers > and so pressumably English should be fine, we use error etc. APIs and > those imply

Re: [PATCH] Limit special asan/ubsan/bitint returns_twice handling to calls in bbs with abnormal pred [PR114687]

2024-04-12 Thread Richard Biener
> Am 12.04.2024 um 09:50 schrieb Jakub Jelinek : > > Hi! > > The tree-cfg.cc verifier only diagnoses returns_twice calls preceded > by non-label/debug stmts if it is in a bb with abnormal predecessor. > The following testcase shows that if a user lies in the attributes > (a function which

Re: [PATCH] match: Fix `!a?b:c` and `a?~t:t` patterns for signed 1 bit types [PR114666]

2024-04-12 Thread Richard Biener
On Fri, Apr 12, 2024 at 1:25 AM Andrew Pinski (QUIC) wrote: > > > -Original Message- > > From: Richard Biener > > Sent: Thursday, April 11, 2024 2:31 AM > > To: Andrew Pinski (QUIC) > > Cc: gcc-patches@gcc.gnu.org > > Subject: Re: [PATCH] ma

Re: [PATCH v2] match: Fix `!a?b:c` and `a?~t:t` patterns for signed 1 bit types [PR114666]

2024-04-12 Thread Richard Biener
On Fri, Apr 12, 2024 at 6:53 AM Andrew Pinski wrote: > > The problem is `!a?b:c` pattern will create a COND_EXPR with an 1bit signed > integer > which breaks patterns like `a?~t:t`. This rejects when we have a signed > operand for > both patterns. > > Note for GCC 15, I am going to look at the

Re: [PATCH, OpenACC 2.7] Connect readonly modifier to points-to analysis

2024-04-12 Thread Richard Biener
stage1 material and will be only able to slowly look at it after we released. > On 2024-04-03T19:50:55+0800, Chung-Lin Tang > wrote: > > On 2023/10/30 8:46 PM, Richard Biener wrote: > >>> > >>> What Chung-Lin's first patch does is mark the OMP clause for 'x' (not t

Re: [r14-9912 Regression] FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i on Linux/x86_64

2024-04-12 Thread Richard Biener
On Fri, 12 Apr 2024, haochen.jiang wrote: > On Linux/x86_64, > > c7e8a8d814229fd6fc4c16c2452f15dddc613479 is the first bad commit > commit c7e8a8d814229fd6fc4c16c2452f15dddc613479 > Author: Richard Biener > Date: Thu Apr 11 11:08:07 2024 +0200 > > tree-optimizat

Re: Combine patch ping

2024-04-11 Thread Richard Biener
> Am 11.04.2024 um 16:03 schrieb Segher Boessenkool > : > > On Wed, Apr 10, 2024 at 08:32:39PM +0200, Uros Bizjak wrote: >>> On Wed, Apr 10, 2024 at 7:56 PM Segher Boessenkool >>> wrote: >>> This is never okay. You cannot commit a patch without approval, *ever*. > > This is the biggest

Re: [PATCH] match: Fix `!a?b:c` and `a?~t:t` patterns for signed 1 bit types [PR114666]

2024-04-11 Thread Richard Biener
On Thu, Apr 11, 2024 at 10:43 AM Andrew Pinski wrote: > > The issue here is that the `a?~t:t` pattern assumed (maybe correctly) that a > here was always going to be a unsigned boolean type. This fixes the problem > in both patterns to cast the operand to boolean type first. > > I should note that

[PATCH] tree-optimization/109596 - wrong debug stmt move by copyheader

2024-04-11 Thread Richard Biener
The following fixes an omission in r14-162-gcda246f8b421ba causing wrong-debug and a bunch of guality regressions. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/109596 * tree-ssa-loop-ch.cc (ch_base::copy_headers): Propagate debug stmts

[PATCH] middle-end/114681 - condition coverage and inlining

2024-04-11 Thread Richard Biener
When inlining a gcond it can map to multiple stmts, esp. with non-call EH. The following makes sure to pick up the remapped condition when dealing with condition coverage. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR middle-end/114681 * tree-inline.cc

Re: [PATCH] asan, v3: Fix up handling of > 32 byte aligned variables with -fsanitize=address -fstack-protector* [PR110027]

2024-04-11 Thread Richard Biener
; +struct __attribute__((aligned (64))) T { char s[192]; }; > +struct __attribute__((aligned (32))) U { char s[256]; }; > +struct __attribute__((aligned (64))) V { char s[320]; }; > +struct __attribute__((aligned (128))) W { char s[512]; }; > + > +__attribute__((noipa)) void > +foo

Re: [PATCH] s390: testsuite: Fix loop-interchange-16.c

2024-04-11 Thread Richard Biener
On Thu, Apr 11, 2024 at 9:02 AM Stefan Schulze Frielinghaus wrote: > > Revert parameter max-completely-peel-times to 16, otherwise, the > innermost loop is removed and we are left with no loop interchange which > this test is all about. > > gcc/testsuite/ChangeLog: > > *

Re: Combine patch ping

2024-04-11 Thread Richard Biener
On Wed, 10 Apr 2024, Uros Bizjak wrote: > On Wed, Apr 10, 2024 at 7:56 PM Segher Boessenkool > wrote: > > > > On Sun, Apr 07, 2024 at 08:31:38AM +0200, Uros Bizjak wrote: > > > If there are no further comments, I plan to commit the referred patch > > > to the mainline on Wednesday. The latest

Re: [PATCH] c++/114409 - ANNOTATE_EXPR and templates

2024-04-10 Thread Richard Biener
On Wed, 10 Apr 2024, Jakub Jelinek wrote: > On Wed, Apr 10, 2024 at 06:43:02PM +0200, Richard Biener wrote: > > The following fixes a mismatch in COMPOUND_EXPR handling in > > tsubst_expr vs tsubst_stmt where the latter allows a stmt in > > operand zero but the former

[PATCH] c++/114409 - ANNOTATE_EXPR and templates

2024-04-10 Thread Richard Biener
The following fixes a mismatch in COMPOUND_EXPR handling in tsubst_expr vs tsubst_stmt where the latter allows a stmt in operand zero but the former doesn't. This makes a difference for the case at hand because when the COMPOUND_EXPR is wrapped inside an ANNOTATE_EXPR it gets handled by

[PATCH] tree-optimization/114672 - WIDEN_MULT_PLUS_EXPR type mismatch

2024-04-10 Thread Richard Biener
The following makes sure to restrict WIDEN_MULT*_EXPR to a mode precision final compute type as the mode is used to find the optab and type checking chokes when seeing bit-precisions later which would likely also not properly expanded to RTL. Bootstrapped and tested on x86_64-unknown-linux-gnu,

Re: [PATCH] testsuite: Adjust pr113359-2_*.c with unsigned long long [PR114662]

2024-04-10 Thread Richard Biener
On Wed, Apr 10, 2024 at 8:24 AM Kewen.Lin wrote: > > Hi, > > pr113359-2_*.c define a struct having unsigned long type > members ay and az which have 4 bytes size at -m32, while > the related constants CL1 and CL2 used for equality check > are always 8 bytes, it makes compiler consider the below >

[PATCH] Revert "combine: Don't combine if I2 does not change"

2024-04-09 Thread Richard Biener
This reverts commit 839bc42772ba7af66af3bd16efed4a69511312ae. I have now pushed the temporary reversion of this to resolve the P1 regressions this caused. I'll re-install it on trunk once 14.1 was released (which might be a week or two after stage1 opens). Richard. --- gcc/combine.cc | 11

Re: [PATCH] lto/114655 - -flto=4 at link time doesn't override -flto=auto at compile time

2024-04-09 Thread Richard Biener
On Tue, 9 Apr 2024, Jan Hubicka wrote: > > The following adjusts -flto option processing in lto-wrapper to have > > link-time -flto override any compile time setting. > > > > LTO-boostrapped on x86_64-unknown-linux-gnu, testing in progress. > > > > OK for trunk and branches? GCC 11 seems to be

[PATCH] lto/114655 - -flto=4 at link time doesn't override -flto=auto at compile time

2024-04-09 Thread Richard Biener
The following adjusts -flto option processing in lto-wrapper to have link-time -flto override any compile time setting. LTO-boostrapped on x86_64-unknown-linux-gnu, testing in progress. OK for trunk and branches? GCC 11 seems to be unaffected by this. Thanks, Richard. PR lto/114655

[PATCH] Remove live-info global bitmap

2024-04-09 Thread Richard Biener
The following removes the unused tree_live_info_d->global bitmap. Bootstrapped and tested on x86_64-unknown-linux-gnu, queued for stage1. Richard. * tree-ssa-live.h (tree_live_info_d::global): Remove. (partition_is_global): Likewise. (make_live_on_entry): Do not set bit

Re: [PATCH] Guard function->cond_uids access [PR114601]

2024-04-09 Thread Richard Biener
in PR gcov-profile/114601, when > + -finstrument-functions-once is used and the function has no conditions. > */ > unsigned > condition_uid (struct function *fn, basic_block b) > { > gimple *stmt = gsi_stmt (gsi_last_bb (b)); > -if (!safe_is_a (stmt)) >

Re: [PATCH/RFC] On the use of -funreachable-traps to deal with PR 109627

2024-04-09 Thread Richard Biener
On Tue, Apr 9, 2024 at 9:11 AM Jakub Jelinek wrote: > > On Tue, Apr 09, 2024 at 09:03:59AM +0200, Richard Biener wrote: > > > With the possibility of sounding like a broken record, I think > > > __builtin_unreachable is fundamentally flawed. It generates no code > &g

Re: [PATCH] build: Check for cargo when building rust language

2024-04-09 Thread Richard Biener
On Mon, Apr 8, 2024 at 6:39 PM wrote: > > From: Pierre-Emmanuel Patry > > Hello, > > The rust frontend requires cargo to build some of it's components, > it's presence was not checked during configuration. OK. Please work on documenting build requirements for rust in doc/install.texi, look for

Re: [PATCH 2/2] Generate constant at start of loop, without UB

2024-04-09 Thread Richard Biener
the return value, the number of conditions, make > sure > + to include the increment of the last basic block. */ > +if (increment) > + xi += 1; > + > gcc_assert (xi == bitmap_count_bits (core)); > > const tree relaxed = build_int_cst (integer_type_node, MEMMODEL_RELAXED); > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH 1/2] Add tree-inlined gconds to caller cond->expr map

2024-04-09 Thread Richard Biener
dd_local_decl (caller, new_var); >} > - > - /* If -fcondition-coverage is used and the caller has conditions, copy the > - mapping into the caller but and the end so the caller and callee > - expressions aren't mixed. */ > - if (callee->cond_uids) > -{ > -

Re: [PATCH] Fix up duplicated words mostly in comments, part 2

2024-04-09 Thread Richard Biener
to @code{TARGET_@var{name}} but take an > -argument as @samp{target_flags}, and and @code{TARGET_@var{name}_OPTS_P} also > -similar to @code{TARGET_@var{name}} but take an argument as > @code{gcc_options}. > +@code{TARGET_@var{name}_P} is similar to @code{TARGET_@var{name}} but takes

Re: [PATCH/RFC] On the use of -funreachable-traps to deal with PR 109627

2024-04-09 Thread Richard Biener
On Tue, Apr 9, 2024 at 6:03 AM Jeff Law wrote: > > > > On 4/8/24 5:04 PM, Iain Sandoe wrote: > > Hi > > > > PR 109627 is about functions that have had their bodies completely elided, > > but still have the wrappers for EH frames (either .cfi_xxx or LFSxx/LFExx). > > > > These are causing issues

Re: [PATCH] rs6000: Fix wrong align passed to build_aligned_type [PR88309]

2024-04-09 Thread Richard Biener
On Tue, Apr 9, 2024 at 4:07 AM Kewen.Lin wrote: > > on 2024/4/8 18:47, Richard Biener wrote: > > On Mon, Apr 8, 2024 at 11:22 AM Kewen.Lin wrote: > >> > >> Hi, > >> > >> As the comments in PR88309 show, there are two oversights > >&g

Re: [PATCH] bitint: Don't move debug stmts from before returns_twice calls [PR114628]

2024-04-09 Thread Richard Biener
+l2: > + x = foo (foo (3)); > + bar (y); > + goto *q[x & 1]; > +l1:; > +} > + > +void > +qux (int x, _BitInt(129) y) > +{ > + void *q[] = { &, & }; > +l2: > + x = foo (foo (3)); > + bar (y); > +l1:; > +} > +#endif > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] middle-end/114604 - ranger allocates bitmap without initialized obstack

2024-04-09 Thread Richard Biener
didn't try instrumenting there). Feel free to improve next stage1. Richard. > Aldy > > On Mon, Apr 8, 2024 at 7:47 PM Richard Biener > wrote: > > > > > > > > > Am 08.04.2024 um 18:40 schrieb Aldy Hernandez : > > > > > > On Mon, Apr 8, 2024 at 6:

Re: [PATCH] middle-end/114604 - ranger allocates bitmap without initialized obstack

2024-04-08 Thread Richard Biener
> Am 08.04.2024 um 18:40 schrieb Aldy Hernandez : > > On Mon, Apr 8, 2024 at 6:29 PM Richard Biener wrote: >> >> >> >>>> Am 08.04.2024 um 18:09 schrieb Aldy Hernandez : >>> >>> On Mon, Apr 8, 2024 at 5:54 PM Jakub Jelinek wrote:

Re: [PATCH] middle-end/114604 - ranger allocates bitmap without initialized obstack

2024-04-08 Thread Richard Biener
> Am 08.04.2024 um 18:09 schrieb Aldy Hernandez : > > On Mon, Apr 8, 2024 at 5:54 PM Jakub Jelinek wrote: >> >> On Mon, Apr 08, 2024 at 05:40:23PM +0200, Aldy Hernandez wrote: PR middle-end/114604 * gimple-range.cc (enable_ranger): Initialize the global

Re: [PATCH 3/3] tree-optimization/114052 - niter analysis from undefined behavior

2024-04-08 Thread Richard Biener
On Mon, 8 Apr 2024, Richard Biener wrote: > On Fri, 5 Apr 2024, Jan Hubicka wrote: > > > > + /* When there's a call that might not return the last iteration > > > + is possibly partial. This matches what we check in invariant > > > + motion. > &

Re: [PATCH 3/3] tree-optimization/114052 - niter analysis from undefined behavior

2024-04-08 Thread Richard Biener
utions (loop); > > > > - basic_block *body = get_loop_body (loop); > > + basic_block *body = get_loop_body_in_rpo (cfun, loop); > >auto_vec exits = get_loop_exit_edges (loop, body); > >likely_exit = single_likely_exit (loop, exits); > >FOR_EACH_VEC_ELT (exits, i, ex) > > -- > > 2.35.3 > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Re: [PATCH] testsuite: Add profile_update_atomic check to gcov-20.c [PR114614]

2024-04-08 Thread Richard Biener
On Mon, Apr 8, 2024 at 11:23 AM Kewen.Lin wrote: > > Hi, > > As PR114614 shows, the newly added test case gcov-20.c by > commit r14-9789-g08a52331803f66 failed on targets which do > not support atomic profile update, there would be a message > like: > > warning: target does not support atomic

Re: [PATCH] rs6000: Fix wrong align passed to build_aligned_type [PR88309]

2024-04-08 Thread Richard Biener
On Mon, Apr 8, 2024 at 11:22 AM Kewen.Lin wrote: > > Hi, > > As the comments in PR88309 show, there are two oversights > in rs6000_gimple_fold_builtin that pass align in bytes to > build_aligned_type but which actually requires align in > bits, it causes unexpected ICE or hanging in function >

[PATCH] middle-end/114604 - ranger allocates bitmap without initialized obstack

2024-04-08 Thread Richard Biener
The following fixes ranger bitmap allocation when invoked from IPA context where the global bitmap obstack possibly isn't initialized. Instead of trying to use one of the ranger obstacks the following simply initializes the global bitmap obstack around an active ranger. Bootstrapped and tested on

[PATCH] tree-optimization/114624 - fix use-after-free in SCCP

2024-04-08 Thread Richard Biener
We're inspecting the replaced PHI node after releasing it. Bootstrapped and tested on x86-64-unknown-linux-gnu, pushed. PR tree-optimization/114624 * tree-scalar-evolution.cc (final_value_replacement_loop): Get at the PHI arg location before releasing the PHI node.

Re: Combine patch ping

2024-04-07 Thread Richard Biener
> Am 01.04.2024 um 21:28 schrieb Uros Bizjak : > > Hello! > > I'd like to ping the > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/647634.html > PR112560 P1 patch. Ok. Thanks, Richard > Thanks, > Uros.

Re: [PATCH 0/2] Condition coverage fixes

2024-04-07 Thread Richard Biener
> Am 06.04.2024 um 22:41 schrieb Jørgen Kvalsvik : > > On 06/04/2024 13:15, Jørgen Kvalsvik wrote: >>> On 06/04/2024 07:50, Richard Biener wrote: >>> >>> >>>> Am 05.04.2024 um 21:59 schrieb Jørgen Kvalsvik : >>>> >&

Re: [pushed] aarch64: Fix bogus cnot optimisation [PR114603]

2024-04-06 Thread Richard Biener
On Fri, Apr 5, 2024 at 3:52 PM Richard Sandiford wrote: > > aarch64-sve.md had a pattern that combined: > > cmpeq pb.T, pa/z, zc.T, #0 > mov zd.T, pb/z, #1 > > into: > > cnotzd.T, pa/m, zc.T > > But this is only valid if pa.T is a ptrue. In other cases, the >

Re: [PATCH] rtl-optimization/101523 - avoid re-combine after noop 2->2 combination

2024-04-06 Thread Richard Biener
On Fri, Apr 5, 2024 at 11:29 PM Segher Boessenkool wrote: > > Hi! > > On Wed, Apr 03, 2024 at 01:07:41PM +0200, Richard Biener wrote: > > The following avoids re-walking and re-combining the instructions > > between i2 and i3 when the pattern of i2 doesn't change. >

Re: [PATCH 0/2] Condition coverage fixes

2024-04-05 Thread Richard Biener
> Am 05.04.2024 um 21:59 schrieb Jørgen Kvalsvik : > > Hi, > > I propose these fixes for the current issues with the condition > coverage. > > Rainer, I propose to simply delete the test with __sigsetjmp. I don't > think it actually detects anything reasonable any more, I kept it around >

Re: [PATCH] middle-end/114599 - fix bitmap allocation for check_ifunc_callee_symtab_nodes

2024-04-05 Thread Richard Biener
> Am 05.04.2024 um 15:46 schrieb H.J. Lu : > > On Fri, Apr 5, 2024 at 1:21 AM Richard Biener wrote: >> >> There's no default bitmap obstack during global CTORs, so allocate the >> bitmap locally. >> >> Bootstrap and regtest running on x

Re: [PATCH 3/3] tree-optimization/114052 - niter analysis from undefined behavior

2024-04-05 Thread Richard Biener
On Fri, 5 Apr 2024, Richard Biener wrote: > The following makes sure to only compute upper bounds for the number > of iterations of loops from undefined behavior invoked by stmts when > those are executed in each loop iteration, in particular also in the > last one. The l

[PATCH 3/3] tree-optimization/114052 - niter analysis from undefined behavior

2024-04-05 Thread Richard Biener
The following makes sure to only compute upper bounds for the number of iterations of loops from undefined behavior invoked by stmts when those are executed in each loop iteration, in particular also in the last one. The latter cannot be guaranteed if there's possible infinite loops or calls with

[PATCH 2/3] Add get_loop_body_in_rpo

2024-04-05 Thread Richard Biener
The following adds another get_loop_body variant, one to get blocks in RPO. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. * cfgloop.h (get_loop_body_in_rpo): Declare. * cfgloop.cc (get_loop_body_in_rpo): Compute loop body in RPO. --- gcc/cfgloop.cc | 68

[PATCH 1/3] Pass reliable down to infer_loop_bounds_from_array

2024-04-05 Thread Richard Biener
The following passes down whether a stmt is always executed from infer_loop_bounds_from_undefined to infer_loop_bounds_from_array. The parameters were already documented. The patch doesn't remove possibly redundant checks from idx_infer_loop_bounds yet. Boostrapped on x86_64-unknown-linux-gnu,

Re: [PATCH] Add extra copy of the ifcombine pass after pre [PR102793]

2024-04-05 Thread Richard Biener
On Fri, Apr 5, 2024 at 2:28 PM Manolis Tsamis wrote: > > If we consider code like: > > if (bar1 == x) > return foo(); > if (bar2 != y) > return foo(); > return 0; > > We would like the ifcombine pass to convert this to: > > if (bar1 == x || bar2 != y) > return

Re: [PATCH] vect: Don't clear base_misaligned in update_epilogue_loop_vinfo [PR114566]

2024-04-05 Thread Richard Biener
ttribute__((noipa)) int > +foo (float x, float y) > +{ > + float a[8][56]; > + __builtin_memset (a, 0, sizeof (a)); > + > + for (int j = 0; j < 8; j++) > +for (int k = 0; k < 56; k++) > + { > + float b = k * y; > + if (b < 0.) > + b = 0.;

Re: [PATCH] testsuite: Fix up error on gcov1.d

2024-04-05 Thread Richard Biener
dg/gcov.exp.jj 2024-04-04 21:45:56.025155257 +0200 > +++ gcc/testsuite/gdc.dg/gcov.exp 2024-04-05 10:20:23.678682559 +0200 > @@ -1,4 +1,4 @@ > -# Copyright (C) 1997-2023 Free Software Foundation, Inc. > +# Copyright (C) 1997-2024 Free Software Foundation, Inc. > > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

[PATCH] middle-end/114599 - fix bitmap allocation for check_ifunc_callee_symtab_nodes

2024-04-05 Thread Richard Biener
There's no default bitmap obstack during global CTORs, so allocate the bitmap locally. Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. PR middle-end/114599 * symtab.cc (ifunc_ref_map): Do not use auto_bitmap. (is_caller_ifunc_resolver): Optimize

Re: [PATCH]middle-end vect: adjust loop upper bounds when peeling for gaps and early break [PR114403]

2024-04-05 Thread Richard Biener
On Thu, 4 Apr 2024, Tamar Christina wrote: > Hi All, > > The report shows that we end up in a situation where the code has been peeled > for gaps and we have an early break. > > The code for peeling for gaps assume that a scalar loop needs to perform at > least one iteration. However this

[PATCH] middle-end/114579 - speed up add_scope_conflicts

2024-04-04 Thread Richard Biener
The following speeds up stack variable conflict detection by recognizing that the all-to-all conflict recording is only necessary for CFG merges as it's the unioning of the live variable sets that doesn't come with explicit mentions we record conflicts for. If we employ this optimization we have

  1   2   3   4   5   6   7   8   9   10   >