Re: Fix type compatibility for types with flexible array member [PR113688,PR114014,PR117724]

2024-11-26 Thread Richard Biener
On Mon, 25 Nov 2024, Martin Uecker wrote: > > Hi Richard, > > here is another version. This now just ignores the size for all trailing > arrays which I think is the right thing to do. It also modifies the lto > hashing which also seems to work (but needs more testing and I haven't > added test

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Lulu Cheng
在 2024/11/27 下午3:10, Xi Ruoyao 写道: On Wed, 2024-11-27 at 14:24 +0800, Lulu Cheng wrote: 在 2024/11/27 下午12:06, Xi Ruoyao 写道: On Wed, 2024-11-27 at 11:58 +0800, Lulu Cheng wrote: --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-shift-sameimm-vec.c @@ -0,0 +1,72 @@ +/* Te

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Jinyang He
在 2024/11/27 上午10:14, Xi Ruoyao 写道: On Tue, 2024-11-26 at 18:37 +0800, Jinyang He wrote: For {xv,v}{srl,sll,sra}, the constraint `vector_same_uimm6` cause overflow in when emit {w,h,b}. Since the number of bits shifted is the remainder of the register value, it is actually unnecessary to constr

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Xi Ruoyao
On Wed, 2024-11-27 at 14:24 +0800, Lulu Cheng wrote: > > 在 2024/11/27 下午12:06, Xi Ruoyao 写道: > > On Wed, 2024-11-27 at 11:58 +0800, Lulu Cheng wrote: > > > > > --- /dev/null > > > > > +++ > > > > > b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-shift-sameimm-vec.c > > > > > @@ -0,0 +1,72 @

Re: [PATCH RFC] c++: modules and using-directives

2024-11-26 Thread Nathaniel Shead
On Wed, Nov 27, 2024 at 12:03:23AM -0500, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu. > > Does this approach make sense to you? Any other ideas? > > -- 8< -- > > We weren't representing 'using namespace' at all in modules, which broke > some of the literals tests. > > I experimented wi

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Lulu Cheng
在 2024/11/27 下午12:06, Xi Ruoyao 写道: On Wed, 2024-11-27 at 11:58 +0800, Lulu Cheng wrote: --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-shift-sameimm-vec.c @@ -0,0 +1,72 @@ +/* Test shift bits overflow in vector */ +/* { dg-do compile } */ +/* { dg-options "-mlasx -O2"

[PATCH RFC] c++: modules and using-directives

2024-11-26 Thread Jason Merrill
Tested x86_64-pc-linux-gnu. Does this approach make sense to you? Any other ideas? -- 8< -- We weren't representing 'using namespace' at all in modules, which broke some of the literals tests. I experimented with various approaches to representing them, and ended up with emitting them as a ps

[PATCH] libstdc++: module std fixes

2024-11-26 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, OK for trunk? -- 8< -- Some tests were failing due to the exported using declaration of iter_move conflicting with friend declarations; the exported using needs to be in the inline namespace, like the customization point itself, rather than std::ranges. Also add a few

[RFC][PATCH] aarch64: Fold lsl+lsr+orr to rev for half-width shifts

2024-11-26 Thread Dhruv Chawla
This patch modifies the intrinsic expanders to expand svlsl and svlsr to unpredicated forms when the predicate is a ptrue. It also folds the following pattern: lsl , , lsr , , orr , , to: revb/h/w , when the shift amount is equal to half the bitwidth of the register. This relies

[pushed] c++: modules and local static

2024-11-26 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Here we weren't emitting the guard variable for 'a' when we emitted 'afn' in the importer, because we only treated inline variables as needing that. Fixed by generalizing to vague_linkage_p. But we need to specifically exempt vtables, beca

[pushed] c++: enable -Warray-compare by default

2024-11-26 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. Marek, I hope this change doesn't interfere with your work on P2865R5. -- 8< -- P2865R5 pointed out that we only enabled this warning with -Wall; we should handle it like other deprecations. gcc/c-family/ChangeLog: * c-opts.cc (c_common_po

[pushed] libcpp: modules and -include again

2024-11-26 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- I enabled include translation to header units in r15-1104-ga29f481bbcaf2b, but it seems that patch wasn't sufficient, as any diagnostics in the main source file would show up as coming from the header instead. Fixed by setting buffer->file

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Xi Ruoyao
On Wed, 2024-11-27 at 11:58 +0800, Lulu Cheng wrote: > > > --- /dev/null > > > +++ > > > b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-shift-sameimm-vec.c > > > @@ -0,0 +1,72 @@ > > > +/* Test shift bits overflow in vector */ > > > +/* { dg-do compile } */ > > > +/* { dg-options "-mlasx -O

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Lulu Cheng
在 2024/11/27 上午10:14, Xi Ruoyao 写道: On Tue, 2024-11-26 at 18:37 +0800, Jinyang He wrote: For {xv,v}{srl,sll,sra}, the constraint `vector_same_uimm6` cause overflow in when emit {w,h,b}. Since the number of bits shifted is the remainder of the register value, it is actually unnecessary to const

Re: [PATCH] PR117350: Keep assembler name for abstract decls for autofdo

2024-11-26 Thread Andi Kleen
On Tue, Nov 26, 2024 at 04:06:37PM -0800, Andrew Pinski wrote: > On Thu, Oct 31, 2024 at 1:41 PM Andi Kleen wrote: > > > > From: Andi Kleen > > > > autofdo looks up inline stacks and tries to match them with the profile > > data using their symbol name. Make sure all decls that can be in a inline

[PATCH] [x86] [RFC] Prevent loop vectorization if it's in a deeply nested big loop.

2024-11-26 Thread liuhongt
When loop requires any kind of versioning which could increase register pressure too much, and it's in a deeply nest big loop, don't do vectorization. I tested the patch with both Ofast and O2 for SPEC2017, besides 548.exchange_r, other benchmarks are same binary. Bootstrapped and regtested 0on x

Re: [PATCH] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector.

2024-11-26 Thread Xi Ruoyao
On Tue, 2024-11-26 at 18:37 +0800, Jinyang He wrote: > For {xv,v}{srl,sll,sra}, the constraint `vector_same_uimm6` cause overflow > in when emit {w,h,b}. Since the number of bits shifted is the remainder of > the register value, it is actually unnecessary to constrain the range. > Simply mask the s

[PATCH v4] I386: Add more testcases for unsigned SAT_ADD vector pattern

2024-11-26 Thread pan2 . li
From: Pan Li Some forms like below failed to recog the SAT_ADD pattern for target i386. It is related to some match pattern extraction but get fixed after the refactor of the SAT_ADD pattern. Thus, add testcases to ensure we may have similar issue in futrue. #define DEF_SAT_ADD(T) \ T sa

[PATCH] match: Improve handling of double convert [PR117776]

2024-11-26 Thread Andrew Pinski
For a double conversion, we will simplify it into a conversion with an and if the outer type and inside precision matches and the intra precision is smaller and unsigned. We should be able to extend this to where the outer precision is larger too. This is a good canonicalization too. Bootstrapped

Re: [PATCH] PR117350: Keep assembler name for abstract decls for autofdo

2024-11-26 Thread Andrew Pinski
On Thu, Oct 31, 2024 at 1:41 PM Andi Kleen wrote: > > From: Andi Kleen > > autofdo looks up inline stacks and tries to match them with the profile > data using their symbol name. Make sure all decls that can be in a inline > stack > have a valid assembler name. > > This fixes a bootstrap problem

[PATCH] driver: -fhardened and -z lazy/-z norelro [PR117739]

2024-11-26 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- As the manual states, using "-fhardened -fstack-protector" will produce a warning because -fhardened wants to enable -fstack-protector-strong, but it can't since it's been overriden by the weaker -fstack-protector. -fhardened a

[committed] libstdc++: Add -fno-assume-sane-operators-new-delete to test [PR117751]

2024-11-26 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: PR libstdc++/117751 * testsuite/18_support/50594.cc: Edit dg-options to include the -fno-assume-sane-operators-new-delete option. --- Tested x86_64-linux. Pushed to trunk. I checked the other tests that replace operator new and operator delete, but

Re: [PATCH v2] c: Introduce -Wfree-labels

2024-11-26 Thread Joseph Myers
On Mon, 18 Nov 2024, Florian Weimer wrote: > This is another recent GCC extension whose use is apparently > difficult to spot in code reviews. > > The name of the option is due to Jonathan Wakely. Part of it > could apply to C++ as well (for labels at the end of a compound > statement). > > gcc

Re: [PATCH] Fortran: fix minor front-end memleaks

2024-11-26 Thread Harald Anlauf
Am 26.11.24 um 23:12 schrieb Harald Anlauf: Am 26.11.24 um 21:09 schrieb Paul Richard Thomas: Hi Harald, Looks good to me. Thanks Paul Thanks, Paul. Pushed as r15-5701-geff7e72815ada5 . This should have read r15-5708-g94f98f67f7271f, the testcase in the other one was used in the testing f

Re: [PATCH] Fortran: fix minor front-end memleaks

2024-11-26 Thread Harald Anlauf
Am 26.11.24 um 21:09 schrieb Paul Richard Thomas: Hi Harald, Looks good to me. Thanks Paul Thanks, Paul. Pushed as r15-5701-geff7e72815ada5 . On Tue, 26 Nov 2024 at 19:51, Harald Anlauf wrote: Dear all, the attached patch fixes two minor front-end memleaks I saw when working on recent

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-26 Thread Jakub Jelinek
On Tue, Nov 26, 2024 at 04:35:15PM -0500, Marek Polacek wrote: > Thanks for the patch. > > For: > > typedef int _Bool; > > or > > int _Bool; > > this patch says: > > note: '_Bool' is a keyword with '-std=c23' onwards > > but I don't think that's true: _Bool was added in C99 and is obso

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-26 Thread Florian Weimer
* David Malcolm: > whereas with this patch we emit: > > t1.c:7:13: error: 'bool' cannot be defined via 'typedef' > 7 | typedef int bool; > | ^~~~ > t1.c:7:13: note: 'bool' is a keyword with '-std=c23' onwards > t1.c:7:1: warning: useless type name in empty declaration > 7

[PUSHED] aarch64: Update error message check for __builtin_launder check of sve-sizeless-2.C

2024-11-26 Thread Andrew Pinski
r15-3614-g9fe57e4879de93 changed the error message for __builtin_launder but this testcase was not updated for the new format of the error message since it is an aarch64 specific testcase. This patch updates the expected error message. Pushed as obvious after testing to see the testcase now wor

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-26 Thread Marek Polacek
On Mon, Nov 25, 2024 at 10:49:02PM -0500, David Malcolm wrote: > This patch attempts to provide better error messages for > code compiled with C23 that hasn't been updated for > "bool", "true", and "false" becoming keywords (based on > a brief review of the Gentoo bug tracker links given at > https

[PUSHED] aarch64: Fix fp8_scalar_1.c's stacktest1

2024-11-26 Thread Andrew Pinski
The function body test was expecting: umovw0, v0.b[0] strbw0, [sp, 15] But the code generation was improved after r15-5375-gbeec291225be to just: str b0, [sp, 15] which is correct and better because no longer need to move between SIMD registers and the GPRs. T

Re: [PATCH] csky: use quotes when referring to cpus and archs [PR90160]

2024-11-26 Thread Jeff Law
On 11/26/24 11:43 AM, Florian Weimer wrote: * Jeff Law: On 11/26/24 9:06 AM, David Malcolm wrote: OK for trunk? (caveat: not properly tested) gcc/ChangeLog: PR translation/90160 * config/csky/csky.cc (csky_configure_build_target): Use %qs when referring to cpu and a

Re: [PATCH] csky: use quotes when referring to cpus and archs [PR90160]

2024-11-26 Thread David Malcolm
On Tue, 2024-11-26 at 13:52 -0700, Jeff Law wrote: > > > On 11/26/24 11:43 AM, Florian Weimer wrote: > > * Jeff Law: > > > > > On 11/26/24 9:06 AM, David Malcolm wrote: > > > > OK for trunk?  (caveat: not properly tested) > > > > gcc/ChangeLog: > > > > PR translation/90160 > > > >

Re: Should -fsanitize=bounds support counted-by attribute for pointers inside a structure?

2024-11-26 Thread Qing Zhao
Think this over these days, I have another thought that need some feedback: The major issue right now is: 1. For the following structure in which the “counted_by” attributes is attached to the pointer field. struct foo { int n; char *p __attribute__ ((counted_by (n))); } *x; There is one i

Re: [PATCH] Fortran: fix minor front-end memleaks

2024-11-26 Thread Paul Richard Thomas
Hi Harald, Looks good to me. Thanks Paul On Tue, 26 Nov 2024 at 19:51, Harald Anlauf wrote: > Dear all, > > the attached patch fixes two minor front-end memleaks I saw when working > on recent PRs (pr117774 is one of them) and running f951 under valgrind. > > Regtested on x86_64-pc-linux-gnu.

Re: PING^3: Re: [PATCH] selftest: invoke "diff" when ASSERT_STREQ fails

2024-11-26 Thread Mike Stump
On Nov 26, 2024, at 11:55 AM, David Malcolm wrote: > > Ping Ok. I'll punt on the diff documentation bits. > On Mon, 2024-11-18 at 16:22 -0500, David Malcolm wrote: >> Another ping for this patch; any pex experts out there? >> >> Thanks! >> Dave >> >> On Wed, 2024-05-29 at 17:06 -0400, David M

Re: [PATCH v2 1/4] aarch64: return scalar fp8 values in fp registers

2024-11-26 Thread Andrew Pinski
On Wed, Nov 20, 2024 at 1:25 AM Claudio Bantaloukas wrote: > > > On 19/11/2024 17:01, Andrew Pinski wrote: > > On Fri, Nov 8, 2024 at 8:11 AM Claudio Bantaloukas > > wrote: > >> > >> According to the aapcs64: If the argument is an 8-bit (...) precision > >> Floating-point or short vector type and

Re: Ping: Re: [PATCH] testsuite: rename plugins from .c to .cc

2024-11-26 Thread Mike Stump
On Nov 26, 2024, at 11:56 AM, David Malcolm wrote: > > Ping for this patch; thanks! Ok. > On Fri, 2024-11-15 at 20:05 -0500, David Malcolm wrote: >> In r12-6650-g5c69acb32329d4 we updated our sources from .c to .cc >> since for some time GCC has been implemented in C++, not C. >> >> GCC plugin

Ping: Re: [PATCH] testsuite: rename plugins from .c to .cc

2024-11-26 Thread David Malcolm
Ping for this patch; thanks! Dave On Fri, 2024-11-15 at 20:05 -0500, David Malcolm wrote: > In r12-6650-g5c69acb32329d4 we updated our sources from .c to .cc > since for some time GCC has been implemented in C++, not C. > > GCC plugins are also implemented in C++, not C, but the plugins > in our

PING^3: Re: [PATCH] selftest: invoke "diff" when ASSERT_STREQ fails

2024-11-26 Thread David Malcolm
Ping On Mon, 2024-11-18 at 16:22 -0500, David Malcolm wrote: > Another ping for this patch; any pex experts out there? > > Thanks! > Dave > > On Wed, 2024-05-29 at 17:06 -0400, David Malcolm wrote: > > On Wed, 2024-05-29 at 16:35 -0400, Eric Gallager wrote: > > > On Tue, May 28, 2024 at 1:21 PM

[PATCH] Fortran: fix minor front-end memleaks

2024-11-26 Thread Harald Anlauf
Dear all, the attached patch fixes two minor front-end memleaks I saw when working on recent PRs (pr117774 is one of them) and running f951 under valgrind. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From d5236446302a01eb11c017862a0813fafd0b95a1 Mon Sep 17 00:00:00 2001 F

Re: [PATCH] Fortran: passing inquiry ref of complex array to assumed rank dummy [PR117774]

2024-11-26 Thread Harald Anlauf
Am 25.11.24 um 23:33 schrieb Steve Kargl: On Mon, Nov 25, 2024 at 10:05:49PM +, Harald Anlauf wrote: Dear all, the attached patch fixes an ICE when passing an inquiry reference of a complex array to an assumed-rank dummy argument by terminating the search for the array reference before we h

Re: [PATCH] csky: use quotes when referring to cpus and archs [PR90160]

2024-11-26 Thread Florian Weimer
* Jeff Law: > On 11/26/24 9:06 AM, David Malcolm wrote: >> OK for trunk? (caveat: not properly tested) >> gcc/ChangeLog: >> PR translation/90160 >> * config/csky/csky.cc (csky_configure_build_target): Use %qs when >> referring to cpu and arch names. >> (csky_option_override):

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Jonathan Wakely
On Tue, 26 Nov 2024 at 18:16, Marc Glisse wrote: > > On Tue, 26 Nov 2024, Jonathan Wakely wrote: > > >>> In the bla() example above, the call bla() is a constant expression > >>> when used to initialize a const int, so the compiler is required to > >>> evaluate it at compile time. > >> > >> When u

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Marc Glisse
On Tue, 26 Nov 2024, Jonathan Wakely wrote: In the bla() example above, the call bla() is a constant expression when used to initialize a const int, so the compiler is required to evaluate it at compile time. When used in contexts that doesn't require an integral constant I think a distinction

Re: Re [PATCH v4] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-26 Thread Jakub Jelinek
On Tue, Nov 26, 2024 at 06:19:46PM +0100, Heiko Eißfeldt wrote: > Thanks for your patience! > > On 11/26/24 8:36 AM, Jakub Jelinek wrote: > > This is wrongly formatted and valid only in C++17 and later, while > > GCC is currently written in C++14. > > So it needs to be > > static_assert

Re: [PATCH] testsuite:RISC-V:Modify the char string.

2024-11-26 Thread Jeff Law
On 11/23/24 2:59 AM, shiyul...@iscas.ac.cn wrote: From: yulong This patch modifies the char string from __riscv_xsfvcp to __riscv_xsfcease. gcc/testsuite/ChangeLog: * gcc.target/riscv/predef-sf-2.c: Modify the char string. Thanks. I've pushed this to the trunk. jeff

Re: Re [PATCH v4] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-26 Thread Heiko Eißfeldt
Thanks for your patience! On 11/26/24 8:36 AM, Jakub Jelinek wrote: This is wrongly formatted and valid only in C++17 and later, while GCC is currently written in C++14. So it needs to be static_assert (FIRST_PSEUDO_REGISTER <= INT_MAX, ""); done. Heikodiff --git a/gcc/varasm.cc

Re: [PATCH] csky: use quotes when referring to cpus and archs [PR90160]

2024-11-26 Thread Jeff Law
On 11/26/24 9:06 AM, David Malcolm wrote: OK for trunk? (caveat: not properly tested) gcc/ChangeLog: PR translation/90160 * config/csky/csky.cc (csky_configure_build_target): Use %qs when referring to cpu and arch names. (csky_option_override): Likewise. It ma

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Michael Matz
Hello, On Tue, 26 Nov 2024, Jonathan Wakely wrote: > So the 'const int' doesn't really matter for any -On level, as you > say, but just avoiding two separate uses of the __deque_buf_size > function is worthwhile for -std=c++98 -O0 Oh, definitely. Avoiding duplicate calls in C++ sources (no matt

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Jonathan Wakely
On Tue, 26 Nov 2024 at 16:15, Michael Matz wrote: > > Hello, > > thanks for bearing with me :) > > On Tue, 26 Nov 2024, Jonathan Wakely wrote: > > > Being a member function makes no difference, but yes, I'm specifically > > talking about the case of calling a constexpr function. > > > > constexpr

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Michael Matz
Hello, thanks for bearing with me :) On Tue, 26 Nov 2024, Jonathan Wakely wrote: > Being a member function makes no difference, but yes, I'm specifically > talking about the case of calling a constexpr function. > > constexpr int bla() { return 2; } > int foo (void) { > const int x = bla(); >

[PATCH] csky: use quotes when referring to cpus and archs [PR90160]

2024-11-26 Thread David Malcolm
OK for trunk? (caveat: not properly tested) gcc/ChangeLog: PR translation/90160 * config/csky/csky.cc (csky_configure_build_target): Use %qs when referring to cpu and arch names. (csky_option_override): Likewise. Signed-off-by: David Malcolm --- gcc/config/csky/

[pushed] loop-prefetch: fix wording of warning [PR80760]

2024-11-26 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-5699-g67458ea13895ba. gcc/ChangeLog: PR translation/80760 * tree-ssa-loop-prefetch.cc (pass_loop_prefetch::execute): Add missing colon to not-a-power-of-two param warning. gcc/testsuite/C

[pushed] plugin: add missing colon in error message [PR93746]

2024-11-26 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-5698-g08bb92d642757f. gcc/ChangeLog: PR plugins/93746 * plugin.cc (try_init_one_plugin): Add missing colon in error message. Signed-off-by: David Malcolm --- gcc/plugin.cc | 2 +- 1 fil

[pushed] c: avoid double-negative in warning message [PR94370]

2024-11-26 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-5700-g5134bad11b9a71. gcc/c/ChangeLog: PR c/94370 * c-typeck.cc (c_build_functype_attribute_variant): Reword warning message to avoid double-negative. gcc/testsuite/ChangeLog: PR

[PATCH] arm: use quotes when referring to command-line options [PR90160]

2024-11-26 Thread David Malcolm
OK for trunk? (caveat: I haven't done a full test on this patch) gcc/ChangeLog: PR translation/90160 * config/arm/arm.cc (arm_option_check_internal): Use quotes in messages that refer to command-line options. Tweak wording. Signed-off-by: David Malcolm --- gcc/config/a

Re: [PATCH] testsuite: arm: Use correct the expected asm in epilog-1.c test

2024-11-26 Thread Torbjorn SVENSSON
On 2024-11-26 16:33, Christophe Lyon wrote: On 11/26/24 13:42, Torbjörn SVENSSON wrote: Hi, Sorry for the mess. I'm not sure how I managed to miss this... Maybe I tested the GCC15 binaries on the GCC14 test tree. Anyway, here is a fix that uses the assembler generated in GCC14. The csinc

Re: optimize basic_string

2024-11-26 Thread Jan Hubicka
Hi, here is updated patch. I am not ceratin if: const size_t __diffmax = __gnu_cxx::__numeric_traits::__max / sizeof(_CharT); really needs "/ sizeof (_CharT)". I think we only need to be able to compute the difference between two entries in multiplies of sizeof(_CharT)? However

Re: [RFC][PATCH] RISC-V: Support TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN

2024-11-26 Thread Kito Cheng
Do you mind creating a PR to https://github.com/riscv/riscv-elf-psabi-doc/pull/ to start the discussion? I believe this should be documented somewhere since it should be consistent between LLVM and GCC. On Mon, Nov 4, 2024 at 2:26 PM Zhijin Zeng wrote: > > I can't find the vector function name ma

Re: [PATCH 00/11] Add FP overloads for __atomic_fetch_add etc

2024-11-26 Thread Matthew Malcomson
I'd like to highlight the question around the C++ frontend folding the code generated by ix86_atomic_assign_expand_fenv that I mentioned in this cover letter. (Question being whether it seems reasonable to say this hook should be updated by the target maintainers or alternatively whether I'm using

Re: [PATCH] testsuite: arm: Use correct the expected asm in epilog-1.c test

2024-11-26 Thread Christophe Lyon
On 11/26/24 13:42, Torbjörn SVENSSON wrote: Hi, Sorry for the mess. I'm not sure how I managed to miss this... Maybe I tested the GCC15 binaries on the GCC14 test tree. Anyway, here is a fix that uses the assembler generated in GCC14. The csinc instruction was introduced in r15-1579-g792f97b

2nd Ping: [PATCH v4 0/3][RFC]Provide more contexts for -Warray-bounds and -Wstringop-* warning messages

2024-11-26 Thread Qing Zhao
Another ping on the Middle-end review of this patch. This patch has been waiting for the middle-end review for a long time. Please review it and provide any feedback, I believe that this should be a nice improvement to GCC diagnostic in general. Thanks. Qing > On Nov 15, 2024, at 10:34, Qi

Re: Fix type compatibility for types with flexible array member [PR113688,PR114014,PR117724]

2024-11-26 Thread Qing Zhao
> On Nov 25, 2024, at 16:46, Martin Uecker wrote: > > > Hi Qing, > > Am Montag, dem 25.11.2024 um 17:40 + schrieb Qing Zhao: >> Hi, Martin, >> >> I didn’t go through all the details of your patch. >> >> But I have one question: >> >> Did you consider the effect of the option -fstrict-f

Re: [PATCH] gdbhooks: Handle references to vec* in VecPrinter

2024-11-26 Thread Alex Coplan
On 29/09/2024 09:35, Jeff Law wrote: > > > On 9/23/24 4:33 AM, Alex Coplan wrote: > > On 30/08/2024 18:11, Alex Coplan wrote: > > > Hi, > > > > > > vec.h has this method: > > > > > >template > > >inline T * > > >vec_safe_push (vec *&v, const T &obj CXX_MEM_STAT_INFO) > > > > > > wh

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Jonathan Wakely
On Tue, 26 Nov 2024 at 14:27, Michael Matz wrote: > > Hello, > > I don't have anything to add to the threads topic itself, but was > triggered by something: > > On Tue, 26 Nov 2024, Jonathan Wakely wrote: > > > > > const size_t __bufsz = __deque_buf_size(sizeof(_Tp)); > > > ... > > > I wonder wh

[PATCH v3 1/1] CPP: Add flag to generate resolver at default version implementation.

2024-11-26 Thread alfie.richards
This patch adds the TARGET_CREATE_FMV_DISPATCHER_AT_DEFAULT_IMPL flag which changes FMV behavior for target_version functions to match the Arm C Language Extension. The functional differences consist of: 1. Generating the resolver for the dispatched symbol at the site of the default version de

[PATCH v3 0/1] CPP: Add flag to generate resolver at default version implementation.

2024-11-26 Thread alfie.richards
From: Alfie Richards Hello, I have changed this patch to not rely on the C multiversion patch. I still plan to get that patch up eventually, but I think it requires some more work and feedback. This patch now just changes the FMV dispatcher generation for Aarch64 to comply with the ACLE. If po

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Michael Matz
Hello, I don't have anything to add to the threads topic itself, but was triggered by something: On Tue, 26 Nov 2024, Jonathan Wakely wrote: > > > const size_t __bufsz = __deque_buf_size(sizeof(_Tp)); > > ... > > I wonder why "const" is useful here. > > Because if you don't initialize a cons

[PING^2][PATCH] testsuite: Simplify target test and dg-options for AMO tests

2024-11-26 Thread jeevitha
Ping! please review. Thanks & Regards Jeevitha On 15/10/24 12:49 pm, jeevitha wrote: > Hi All, > > Removed powerpc*-*-* from the target test as it is always true. Simplified > options by removing -mpower9-misc and -mvsx, which are enabled by default with > -mdejagnu-cpu=power9. The has_arch_pwr

[PATCH] genrecog: Split into separate partitions [PR111600].

2024-11-26 Thread Robin Dapp
Hi, this patch makes genrecog split its output into separate files (10 by default) in the same vein genemit does. The changes are mostly mechanical again, changing printfs and puts to fprintf. As insn-recog.cc relies on being able to call other recog functions a header insn-recog.h is introduced

Re: [PATCH 1/1] aarch64: add ACLE macro _CHKFEAT_GCS

2024-11-26 Thread Richard Sandiford
Yury Khrustalev writes: > gcc/ChangeLog: > * config/aarch64/arm_acle.h (_CHKFEAT_GCS): New. > > libgcc/ChangeLog: > > * config/aarch64/aarch64-unwind.h (_Unwind_Frames_Extra): Update. > (_Unwind_Frames_Increment): Update OK, thanks. (We discussed getting commit access off-list.

Re: [PATCH 9/10] docs: Add new AArch64 flags

2024-11-26 Thread Richard Sandiford
Andrew Carlotti writes: > gcc/ChangeLog: > > * doc/invoke.texi: Add new AArch64 flags. > OK, thanks. Richard > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index > 7146163d66d068522f5aa19f59badc1b05d05114..56186e98ca6a4d28d1c315746ade89cdc835219e > 100644 > --- a/gcc/doc/inv

[PATCH] testsuite: arm: Use correct the expected asm in epilog-1.c test

2024-11-26 Thread Torbjörn SVENSSON
Hi, Sorry for the mess. I'm not sure how I managed to miss this... Maybe I tested the GCC15 binaries on the GCC14 test tree. Anyway, here is a fix that uses the assembler generated in GCC14. The csinc instruction was introduced in r15-1579-g792f97b44ff that was not backported. Ok for releases/gc

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Jan Hubicka
> > diff --git a/libstdc++-v3/include/bits/deque.tcc > > b/libstdc++-v3/include/bits/deque.tcc > > index deb010a0ebb..e56cd0b9319 100644 > > --- a/libstdc++-v3/include/bits/deque.tcc > > +++ b/libstdc++-v3/include/bits/deque.tcc > > @@ -955,6 +955,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER > >

Re: optimize basic_string

2024-11-26 Thread Jonathan Wakely
On Tue, 26 Nov 2024 at 12:22, Jan Hubicka wrote: > > > On 24/11/24 01:42 +0100, Jan Hubicka wrote: > > > Hi, > > > another common source of unnecesary throw_bad_alloc calls is > > > basic_string::_M_create. > > >basic_string<_CharT, _Traits, _Alloc>:: > > >_M_create(size_type& __capacity,

Re: optimize basic_string

2024-11-26 Thread Jan Hubicka
> On 24/11/24 01:42 +0100, Jan Hubicka wrote: > > Hi, > > another common source of unnecesary throw_bad_alloc calls is > > basic_string::_M_create. > >basic_string<_CharT, _Traits, _Alloc>:: > >_M_create(size_type& __capacity, size_type __old_capacity) > >{ > > // _GLIBCXX_RESOLVE

Re: improve std::deque::_M_reallocate_map

2024-11-26 Thread Jonathan Wakely
On Tue, 26 Nov 2024 at 12:08, Jan Hubicka wrote: > > > > diff --git a/libstdc++-v3/include/bits/deque.tcc > > > b/libstdc++-v3/include/bits/deque.tcc > > > index deb010a0ebb..e56cd0b9319 100644 > > > --- a/libstdc++-v3/include/bits/deque.tcc > > > +++ b/libstdc++-v3/include/bits/deque.tcc > > > @

[PATCH v2 2/2] aarch64: Add support for AdvSIMD lut

2024-11-26 Thread saurabh.jha
The AArch64 FEAT_LUT extension is optional from Armv9.2-a and mandatory from Armv9.5-a. It introduces instructions for lookup table reads with bit indices. This patch adds support for AdvSIMD lut intrinsics. The intrinsics for this extension are implemented as the following builtin functions: * v

[PATCH v2 1/2] aarch64: Refactor AdvSIMD intrinsics

2024-11-26 Thread saurabh.jha
Refactor AdvSIMD intrinsics defined using the new pragma-based approach so that it is more extensible. Introduce a new struct, simd_type, which defines types using a mode and qualifiers, and use objects of this struct in the declaration of intrinsics in the aarch64-simd-pragma-builtins.def file.

[PATCH v2 0/2] aarch64: Add AdvSIMD lut

2024-11-26 Thread saurabh.jha
From: Saurabh Jha This patch series is a revised version of: https://gcc.gnu.org/pipermail/gcc-patches/2024-November/667692.html In the refactor patch, I redesigned how types are declared and how expand happens. I have taken some ideas from the reviews of the other patch series: https://gcc.gnu.

[PING^2][PATCH v3] rs6000: Fix issue in specifying PTImode as an attribute [PR106895]

2024-11-26 Thread jeevitha
Ping! please review. Thanks & Regards Jeevitha On 14/10/24 5:16 pm, jeevitha wrote: > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > PTImode assists in generating even/odd register pairs on 128 bits. When the > user > specifies PTImode as an attr

[PATCH v2] match.pd: Add pattern to simplify `(a - 1) & -a` to `0`

2024-11-26 Thread Jovan Vukic
Thank you for the feedback on the v1 patch. As requested, I added detailed tests for various signed and unsigned integer types in the test file bitops-11.c. I also included more complex expressions to observe how everything behaves at the GIMPLE level and added vector test examples as well. Since

Re: [PATCH v3] I386: Add more testcases for unsigned SAT_ADD vector pattern

2024-11-26 Thread Uros Bizjak
On Tue, Nov 26, 2024 at 2:25 AM wrote: > > From: Pan Li > > There are some forms like below failed to recog the SAT_ADD Some forms like below failed to be recognized as SAT_ADD ... > pattern for target i386. It is related to some match pattern > extraction but get fixed after the refactor of

[PATCH] LoongArch: Mask shift offset when emit {xv, v}{srl, sll, sra} with sameimm vector.

2024-11-26 Thread Jinyang He
For {xv,v}{srl,sll,sra}, the constraint `vector_same_uimm6` cause overflow in when emit {w,h,b}. Since the number of bits shifted is the remainder of the register value, it is actually unnecessary to constrain the range. Simply mask the shift number with the unit-bit-width, without any constraint o

Re: [PATCH] c++, v2: Implement C++26 P3176R1 - The Oxford variadic comma

2024-11-26 Thread Jonathan Wakely
On Tue, 26 Nov 2024 at 08:34, Jakub Jelinek wrote: > > On Mon, Nov 25, 2024 at 03:40:18PM -0500, Marek Polacek wrote: > > Just "omitting a comma", I think. > > > > "of a function parameter list" > > > > I suppose we should also test -Wno-deprecated and/or > > -Wno-deprecated-variadic-comma-omissio

Re: Ping: [PATCH] c++: Allow overloaded builtins to be used in SFINAE context

2024-11-26 Thread Matthew Malcomson
Ping 3 On 11/18/24 13:22, Matthew Malcomson wrote: External email: Use caution opening links or attachments Ping 2 On 10/21/24 11:43, Matthew Malcomson wrote: External email: Use caution opening links or attachments Ping (re-sending ping because previous message body too large for list --

[COMMITTED 10/19] ada: Remove Current_Node from Errout

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus This variable was used for Opt.Include_Subprogram_In_Messages activated by -gnatdJ. This switch has been removed so this variable is no longer used. gcc/ada/ChangeLog: * errout.ads: Remove Current_Node. * errout.adb: Remove uses of Current_Node. * par-

[COMMITTED 15/19] ada: Refactor code of Check_Ambiguous_Call and Valid_Conversion

2024-11-26 Thread Marc Poulhiès
From: Javier Miranda Code cleanup; factorizing code. gcc/ada/ChangeLog: * sem_ch2.adb (Check_Ambiguous_Call): Replace code factorized code by call to the new subprogram Is_Ambiguous_Operand. * sem_res.ads (Is_Ambiguous_Operand): New subprogram that factorizes pre

[COMMITTED 14/19] ada: Relocate implementation of Write_Error_Summary

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Reuse the same implementation in Errout and Errutil. gcc/ada/ChangeLog: * errout.adb: Remove implmentation of Write_Error_Summary. * erroutc.adb: Add implemenetation of Write_Error_Summary. * erroutc.ads: Add spec of Write_Error_Summary. * erru

[COMMITTED 08/19] ada: Store error message kind as an enum

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Simplify the storage for the kind of error message under a single enumerator. This replaces the existing attributes with the following enumeration values. * Is_Warning_Msg => Warning * Is_Style_Msg => Style * Is_Info_Msg => Info * Is_Check_Msg => Low_Check, Medium_Check, High_C

[COMMITTED 18/19] ada: Add minimal support for address clause/aspect on controlled objects

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou The clause and aspect have been accepted by the compiler for a few years, but the result is generally an internal compiler error or an incorrect finalization at run time. gcc/ada/ChangeLog: * exp_ch3.adb (Expand_N_Object_Declaration): Do not insert the tag as

[COMMITTED 13/19] ada: Relocate implementation of Set_Msg_Insertion_Column

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus The implementation was duplicated in errout and errutil. Move the implementation to erroutc where other similar commonly used functions are. gcc/ada/ChangeLog: * errout.adb: Remove implemntation of Set_Msg_Insertion_Column. * erroutc.adb: Add implementation of

[COMMITTED 11/19] ada: Refactor checking redundant messages

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Move common code between errout and errutil into a single function. gcc/ada/ChangeLog: * errout.adb: Use Is_Redundant_Error_Message. * erroutc.adb: Move the common code for checking if a message can be removed to Is_Redundant_Error_Message. * e

[COMMITTED 16/19] ada: Minor adjustments to error message for RM B.1(24)

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou The RM B.1(24) sub-clause says that imported entities cannot be initialized and it is checked in three contexts, aspect Import, pragma Import and pragma Import_Object, with slightly different error messages. Moreover, for the aspect, the error is given twice because that of t

[COMMITTED 19/19] ada: Do not use ATTR_ADDR_EXPR for 'Unrestricted_Access

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou Unlike for 'Access or 'Unchecked_Access, the Attribute_to_gnu routine passes ATTR_ADDR_EXPR to build_unary_op for 'Unrestricted_Access, which causes the processing done in build_unary_op to flatten the reference, in particular to remove all intermediate (view) conversions, whi

[COMMITTED 09/19] ada: Remove Raise_Exception_On_Error

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus Raise_Exception_On_Error is never modified so it can be removed. gcc/ada/ChangeLog: * err_vars.ads: Remove Raise_Exception_On_Error and Error_Msg_Exception. * errout.ads: Same as above. * errout.adb: Remove uses of Raise_Exception_On_Error and

[COMMITTED 07/19] ada: Refactor code for printing the error location

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * errout.adb: Use Output_Msg_Location * erroutc.adb: add common implementation for printing the error message line. * erroutc.ads: Add new method Output_Msg_Location * errutil.adb: use Output_Msg_Location Tested on x8

[COMMITTED 12/19] ada: Remove Warn_Runtime_Raise attribute from Error_Msg_Object

2024-11-26 Thread Marc Poulhiès
From: Viljar Indus The goal of this attribute is to raise a warning to an error when the -gnatwE flag is used. This is similar to the existing warnings as error behavior under the Warn_Err flag so it can be merged. gcc/ada/ChangeLog: * errout.adb: Set Warn_Err as true if Is_Runtime_Erro

[COMMITTED 02/19] ada: Clean up utility function

2024-11-26 Thread Marc Poulhiès
From: Ronan Desplanques This patch makes Sem_Util.Get_Library_Unit_Name use Uname more idiomatically. gcc/ada/ChangeLog: * sem_util.adb (Get_Library_Unit_Name): Improve use of Uname. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 10 ++ 1 file

[COMMITTED 17/19] ada: Clean up previous change

2024-11-26 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ChangeLog: * sem_res.adb (Valid_Conversion): Do not initialize Opnd_Type before calling Get_Corresponding_Mutably_Tagged_Type_If_Present. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 16 ++-- 1 file chang

  1   2   >