Re: [PATCH] c, v2: Speed up compilation of large char array initializers when not using #embed

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 07:42:11PM +, Joseph Myers wrote: > > On Sat, 3 Aug 2024, Jakub Jelinek wrote: > > > > > * c-c++-common/init-1.c: New test. > > > > I think there should also be tests of initializing signed char (and plain > > char) arrays

[committed, v2] libstdc++: Test 17_intro/names.cc with -D_FORTIFY_SOURCE=2 [PR116210]

2024-10-09 Thread Jonathan Wakely
I removed the >= 2.35 check, because it was failing on a RHEL glibc 2.34 with the fortify changes backported. So let's just #undef u for anything older than 2.41 instead. Tested powerpc64le-linux (glibc-2.34-100.el9_4.3) and x86_64-linux (glibc-2.39-22.fc40). Pushed to trunk. -- >8 -- Add a new

Re: [PATCH v5 1/2] aarch64: Add SVE2 faminmax intrinsics

2024-10-09 Thread Richard Sandiford
writes: > +/* > +** amax_0_f16_m_tied1: > +** ... > +** famax z0\.h, p0/m, z0\.h, (z[0-9]+\.h) Sorry to ask for another round, but: the "(" and ")" aren't needed. They're used when something later in the regular expression sequence needs to refer back to something earlier, such as in: **

Re: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul extension.

2024-10-09 Thread Jeff Law
On 10/9/24 3:21 PM, Patrick O'Neill wrote: On 10/9/24 14:07, Jeff Law wrote: Also note that if you use the tag "[RISC-V]" in your subject line your patch will be automatically picked up by a pre-commit tester that can be subsequently examined to verify behavior. This patch's subject li

[Ada] PR ada/117038

2024-10-09 Thread Eric Botcazou
This is the LTO bootstrap failure with -Werror=lto-type-mismatch introduced by the patch implementing the new aspect External_Initialization. In GNAT's implementation model, using convention C (or C_Pass_By_Copy) has no effect on the internal representation of types since the representation is

[Ada] Remove support for HP-UX 10

2024-10-09 Thread Eric Botcazou
The support was removed from the rest of the compiler two years ago. Applied on the mainline. 2024-10-09 Eric Botcazou * Makefile.rtl: Remove HP-UX 10 section. * libgnarl/s-osinte__hpux-dce.ads: Delete. * libgnarl/s-osinte__hpux-dce.adb: Likewise. * libgnarl/s

Re: [Ada] Remove support for HP-UX 10

2024-10-09 Thread Jeff Law
On 10/9/24 3:35 PM, Eric Botcazou wrote: The support was removed from the rest of the compiler two years ago. Yea, HPUX 10 is a dead OS on a dead chip :-0 Jeff

Re: [PATCH] RISC-V: Add implication for M extension.

2024-10-09 Thread Jeff Law
On 10/9/24 10:52 AM, Palmer Dabbelt wrote: On Tue, 08 Oct 2024 16:43:13 PDT (-0700), jeffreya...@gmail.com wrote: On 10/7/24 11:33 PM, Tsung Chun Lin wrote: That M implies Zmmul. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: M implies Zmmul. THanks.  I've pushed this to

Re: [PATCH] RISC-V: Add implication for M extension.

2024-10-09 Thread Palmer Dabbelt
On Tue, 08 Oct 2024 16:43:13 PDT (-0700), jeffreya...@gmail.com wrote: On 10/7/24 11:33 PM, Tsung Chun Lin wrote: That M implies Zmmul. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: M implies Zmmul. THanks. I've pushed this to the trunk. jeff ps. Quite a discussion on t

Re: [PATCH] RISC-V: Add implication for M extension.

2024-10-09 Thread Palmer Dabbelt
On Wed, 09 Oct 2024 09:55:02 PDT (-0700), jeffreya...@gmail.com wrote: On 10/9/24 10:52 AM, Palmer Dabbelt wrote: On Tue, 08 Oct 2024 16:43:13 PDT (-0700), jeffreya...@gmail.com wrote: On 10/7/24 11:33 PM, Tsung Chun Lin wrote: That M implies Zmmul. gcc/ChangeLog: * common/confi

PING: [PATCH v7] Provide new GCC builtin __builtin_counted_by_ref [PR116016]

2024-10-09 Thread Qing Zhao
Hi, This is the Ping to the 7th version of the patch. Okay for the trunk? thanks. Qing Begin forwarded message: From: Qing Zhao Subject: [PATCH v7] Provide new GCC builtin __builtin_counted_by_ref [PR116016] Date: September 27, 2024 at 14:05:50 EDT To: josmy...@redhat.com, ja...@redhat.com,

Re: [PATCH v5 1/2] aarch64: Add SVE2 faminmax intrinsics

2024-10-09 Thread Saurabh Jha
On 10/9/2024 5:26 PM, Richard Sandiford wrote: writes: +/* +** amax_0_f16_m_tied1: +** ... +** famax z0\.h, p0/m, z0\.h, (z[0-9]+\.h) Sorry to ask for another round, but: the "(" and ")" aren't needed. They're used when something later in the regular expression sequence needs to

Re: [PATCH] [PR116831] match.pd: Check trunc_mod vector obtap before folding.

2024-10-09 Thread Jennifer Schmitz
> On 8 Oct 2024, at 10:31, Richard Biener wrote: > > External email: Use caution opening links or attachments > > > On Fri, 4 Oct 2024, Jennifer Schmitz wrote: > >> As in https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663185.html, >> this patch guards the simplification x / y * y ==

[PATCH v1 2/2] RISC-V: Add testcases for form 3 of scalar signed SAT_TRUNC

2024-10-09 Thread pan2 . li
From: Pan Li Form 3: #define DEF_SAT_S_TRUNC_FMT_3(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_3 (WT x) \ { \ NT trunc = (NT)x;

[PATCH v3] Remove sys/user time in -ftime-report

2024-10-09 Thread Andi Kleen
From: Andi Kleen Retrieving sys/user time in timevars is quite expensive because it always needs a system call. Only getting the wall time is much cheaper because operating systems have optimized paths for this. The sys time isn't that interesting for a compiler and wall time is usually close to

Re: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul extension.

2024-10-09 Thread Jeff Law
On 10/8/24 12:25 AM, Tsung Chun Lin wrote: 0001-RISC-V-Enable-builtin-__riscv_mul-with-Zmmul-extensi.patch From d5b254e19d1f37fe27c7e98a0160e5c22446cfea Mon Sep 17 00:00:00 2001 From: Jim Lin Date: Tue, 8 Oct 2024 13:14:32 +0800 Subject: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul

Re: [PATCH v2] libstdc++: Workaround glibc headers on ia64-linux

2024-10-09 Thread Frank Scheiner
On 08.10.24 20:51, Jonathan Wakely wrote: On Thu, 3 Oct 2024 at 20:59, Frank Scheiner wrote: [...] The following patch adds a workaround for this on the libstdc++ testsuite side. Signed-off-by: Frank Scheiner Thanks, I'll push this. N.B. there's no ChangeLog entry in the patch submission, s

Re: [PATCH v3 0/2] ia64: enable LRA and un-obsolete ia64*-*-linux

2024-10-09 Thread Frank Scheiner
On 09.10.24 11:29, Richard Biener wrote: On Wed, 9 Oct 2024, Frank Scheiner wrote: On 09.10.24 10:26, Richard Biener wrote: On Wed, 9 Oct 2024, Richard Biener wrote: [...] I'll push this for you. I spoke too fast - something between you and me corrupts the patch so it doesn't apply (even a

[PATCH] testsuite: arm: use effective-target for mod* tests

2024-10-09 Thread Torbjörn SVENSSON
Committed below patch as obvious to master. -- This fixes a typo introduced in r15-4200-gcf08dd297ca that was reported at https://linaro.atlassian.net/browse/GNU-1369. gcc/testsuite/ChangeLog * gcc.target/arm/mod_2.c: Corrected effective-target to arm_cpu_cortex_a57_ok.

Re: [PATCH v4 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-10-09 Thread Tobias Burnus
First comments; I need to have a deeper, but now I need fetch some victuals. Paul-Antoine Arras wrote: This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common

Re: [wwwdocs] Document that gcc-8 changed the default to -std=gnu17

2024-10-09 Thread Jonathan Wakely
On Wed, 9 Oct 2024 at 18:07, Joseph Myers wrote: > > On Wed, 9 Oct 2024, Jonathan Wakely wrote: > > > +C > > + > > +The default mode has been changed to -std=gnu17. > > + > > The option didn't exist before GCC 8, I think you need to say something > about the option being added rather than j

Re: [PATCH] libcpp, c, middle-end, v2: Optimize initializers using #embed in C

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Jakub Jelinek wrote: > Here is an updated patch with that implemented plus additional testcase > which tests it (and was failing with the old version of the patch for C). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? The libcpp/, gcc/c-family/, gcc/

Re: [wwwdocs] Document that gcc-8 changed the default to -std=gnu17

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Jonathan Wakely wrote: > +C > + > +New options -std=c17, to select support for the 2018 > +edition of the ISO C standard, and -std=gnu17, for C17 > +with GNU extensions. > +The default mode has been changed to -std=gnu17. > + That seems reasonable. > Shoul

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Alejandro Colomar wrote: > Every little bit adds up. Documentation is simpler if there is naming > consistency. We have SYNOPSISes in the man pages, and they're up front, > because they constitute an important part of the documentation. We also have a convention for future s

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
On Wed, Oct 09, 2024 at 09:11:52PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > Every little bit adds up. Documentation is simpler if there is naming > > consistency. We have SYNOPSISes in the man pages, and they're up front, > > because they constitute an import

Re: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul extension.

2024-10-09 Thread Patrick O'Neill
On 10/9/24 14:07, Jeff Law wrote: Also note that if you use the tag "[RISC-V]" in your subject line your patch will be automatically picked up by a pre-commit tester that can be subsequently examined to verify behavior. This patch's subject line looks good to me. It would've been picked u

[pushed] c++: more modules and -M

2024-10-09 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In r15-4119-gc877a27f04f648 I told preprocess_file to use the directives-only scan with modules, but it seems that I also need to set the cpp_option so that communication between _cpp_handle_directive and scan_translation_unit_directives_onl

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Alejandro Colomar wrote: > I'm not fabricating, BTW. Here's a list of off-by-one bugs in login > code, precisely due to this size-length naming issue: > >

Re: [wwwdocs] Document that gcc-8 changed the default to -std=gnu17

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Jonathan Wakely wrote: > +C > + > +The default mode has been changed to -std=gnu17. > + The option didn't exist before GCC 8, I think you need to say something about the option being added rather than just referring to a new default of an option that wasn't in previo

Re: [PATCH] testsuite: arm: use effective-target for mod* tests

2024-10-09 Thread Christophe Lyon
Thanks for the prompt fix! Christophe Le mer. 9 oct. 2024, 22:14, Torbjörn SVENSSON a écrit : > Committed below patch as obvious to master. > > -- > > This fixes a typo introduced in r15-4200-gcf08dd297ca that was reported > at https://linaro.atlassian.net/browse/GNU-1369. > > gcc/testsuite/Cha

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 07:31:50PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > The documentation of an API starts by its prototype. > > > > void login_prompt(char *name, int len); > > void login_prompt(char *name, int size); > > > > The forme

Re: Meaning of "length", "size", and "count"

2024-10-09 Thread Alejandro Colomar
Hi Jakub, On Wed, Oct 09, 2024 at 09:40:11PM GMT, Jakub Łukasiewicz wrote: > On 2024-10-09 20:48 CEST, Alejandro Colomar wrote: > > countof() is a new term, so it doesn't yet have a meaning (except as > > given by the attribute), but it naturally fits more with number of > > elements. > > How wo

Re: [PATCH v3] libstdc++: implement concatenation of strings and string_views

2024-10-09 Thread Patrick Palka
On Sat, 21 Sep 2024, Giuseppe D'Angelo wrote: > On 31/07/2024 00:19, Jonathan Wakely wrote: > > One more thing that I missed last time, sorry: > > > > +#if __glibcxx_string_view >= 202403L > > + // const string & + string_view > > + template > > +_GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR > >

[PATCH v1 1/2] Match: Support form 3 for scalar signed integer SAT_TRUNC

2024-10-09 Thread pan2 . li
From: Pan Li This patch would like to support the form 3 of the scalar signed integer SAT_TRUNC. Aka below example: Form 3: #define DEF_SAT_S_TRUNC_FMT_3(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_3 (WT x)

Re: [PATCH] aarch64: Fix folding of degenerate svwhilele case [PR117045]

2024-10-09 Thread Richard Sandiford
Tamar Christina writes: > Hi Richard, > >> -Original Message- >> From: Richard Sandiford >> Sent: Wednesday, October 9, 2024 12:58 PM >> To: gcc-patches@gcc.gnu.org >> Cc: ktkac...@nvidia.com; Richard Earnshaw ; >> Tamar Christina >> Subject: [PATCH] aarch64: Fix folding of degenerate sv

[committed] libstdc++: Drop format attribute from snprintf wrapper [PR116969]

2024-10-09 Thread Jonathan Wakely
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- When __LONG_DOUBLE_IEEE128__ is defined we need to declare a wrapper for Glibc's 'snprintf' symbol, so we can call the original definition that works with the IBM128 format of long double. Because we were declaring the wrapper using __typeof__(_

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Alejandro Colomar wrote: > The documentation of an API starts by its prototype. > > void login_prompt(char *name, int len); > void login_prompt(char *name, int size); > > The former should _not_ include a NUL terminator in the argument. > The latter should. If th

Meaning of "length", "size", and "count"

2024-10-09 Thread Jakub Łukasiewicz
On 2024-10-09 20:48 CEST, Alejandro Colomar wrote: countof() is a new term, so it doesn't yet have a meaning (except as given by the attribute), but it naturally fits more with number of elements. How would you call, for example, a function that returns how many times a value is contained in

Re: [PATCH ver2 0/4] rs6000, remove redundant built-ins and add more test cases

2024-10-09 Thread Carl Love
Ping On 10/1/24 8:12 AM, Carl Love wrote: GCC maintainers: The following version 2 of a series of patches for PowerPC removes some built-ins that are covered by existing overloaded built-ins. Additionally, there are patches to add missing testcases and documentation.  The original versio

Re: [PATCH] rs6000, fix test builtins-1-p10-runnable.c

2024-10-09 Thread Carl Love
Ping, FYI this is a fairly simple fix to a testcase. On 10/3/24 8:11 AM, Carl Love wrote: GCC maintainers: The builtins-1-10-runnable.c has the debugging inadvertently enabled.  The test uses #ifdef to enable/disable the debugging. Unfortunately, the #define DEBUG was set to 0 to disable deb

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 05:05:16PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > I'm not fabricating, BTW. Here's a list of off-by-one bugs in login > > code, precisely due to this size-length naming issue: > >

[PATCH 3/4] libcpp: avoid extra spaces in module preprocessing

2024-10-09 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, will apply to trunk with the rest of this patch series. -- 8< -- Within the compiler, module keywords "import", "module", and "export" that are recognized as part of module directives gain an extra trailing space to distinguish them from other non-keyword uses of those

Re: [PATCH v3] RISC-V: Optimize branches with shifted immediate operands

2024-10-09 Thread Jeff Law
On 10/9/24 2:59 AM, Jovan Vukic wrote: After the valuable feedback I received, it’s clear to me that the oversight was in the tests showing the benefits of the patch. In the test file, I added functions f5 and f6, which now generate more efficient code with fewer instructions. Before the patc

[PATCH RFC 1/4] c-family: add -fsearch-include-path

2024-10-09 Thread Jason Merrill
Tested x86_64-pc-linux-gnu. Any thoughts? -- 8< -- The C++ modules code has a -fmodule-header option to specify looking up headers to compile to header units on the usual include paths. I'd like to have the same functionality for full C++20 modules such as module std, which could also live on t

[PATCH RFC 2/4] c++: add internal --header flag

2024-10-09 Thread Jason Merrill
Tested x86_64-pc-linux-gnu. Any other ideas for how to communicate headerness to the front-end? -- 8< -- C++20 modules support has depended on the driver seeing the -fmodules-ts flag in order to implicitly add other flags. This won't work when we start enabling modules support by default; it's

[PATCH 4/4] c++: enable modules by default in c++20

2024-10-09 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, will apply to trunk with the rest of the patch series. -- 8< -- At this point there doesn't seem to be much reason not to have modules support enabled by default in C++20, and it's good get more test coverage to find corner case bugs like some I fixed recently. It als

Re: [PATCH] libgcc: Use inline variable instead of function-local static

2024-10-09 Thread Jason Merrill
On 10/8/24 8:58 AM, Michael Matz wrote: Hello, On Tue, 8 Oct 2024, Jonathan Wakely wrote: We originally had global static variables, which means a different variable per TU. That causes ODR violations which were silently ignored until we try to use them in modules, where they're diagnosed. So

Re: [PATCH 4/4] c++: enable modules by default in c++20

2024-10-09 Thread Patrick Palka
On Wed, 9 Oct 2024, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, will apply to trunk with the rest of the patch > series. > > -- 8< -- > > At this point there doesn't seem to be much reason not to have modules > support enabled by default in C++20, and it's good get more test coverage to >

RE: [PATCH v5] gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]

2024-10-09 Thread Jiang, Haochen
> From: Andreas Schwab > Sent: Wednesday, October 9, 2024 2:04 PM > > ../../libcpp/directives.cc: In function 'void do_pragma_once(cpp_reader*)': > ../../libcpp/directives.cc:2078:20: error: unknown conversion type character > '<' in format [-Werror=format=] > 2078 | "%<#pragma

[PATCH v5 1/2] aarch64: Add SVE2 faminmax intrinsics

2024-10-09 Thread saurabh.jha
The AArch64 FEAT_FAMINMAX extension introduces instructions for computing the floating point absolute maximum and minimum of the two vectors element-wise. This patch introduces SVE2 faminmax intrinsics. The intrinsics of this extension are implemented as the following builtin functions: * sva[max

[PATCH v5 0/2] Add support for SVE2 faminmax

2024-10-09 Thread saurabh.jha
From: Saurabh Jha This patch series is a revised version of: https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664391.html Previous review comments are in this thread: https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664329.html The second patch of this is okay to merge. The changes

[PATCH v5 2/2] aarch64: Add codegen support for SVE2 faminmax

2024-10-09 Thread saurabh.jha
The AArch64 FEAT_FAMINMAX extension introduces instructions for computing the floating point absolute maximum and minimum of the two vectors element-wise. This patch adds code generation for famax and famin in terms of existing unspecs. With this patch: 1. famax can be expressed as taking UNSPEC_

RE: [PATCH]middle-end: support SLP early break

2024-10-09 Thread Richard Biener
On Tue, 8 Oct 2024, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Wednesday, October 2, 2024 1:50 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > > Subject: Re: [PATCH]middle-end: support SLP early break > > > >

RE: [PATCH]middle-end: support SLP early break

2024-10-09 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Wednesday, October 9, 2024 9:20 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > Subject: RE: [PATCH]middle-end: support SLP early break > > On Tue, 8 Oct 2024, Tamar Christina wrote: > > > > -Or

Re: [PATCH 3/3] aarch64: libgcc: Add -Werror support

2024-10-09 Thread Christophe Lyon
On Wed, 9 Oct 2024 at 03:05, Eric Gallager wrote: > > On Tue, Oct 8, 2024 at 6:25 AM Richard Sandiford > wrote: > > > > Christophe Lyon writes: > > > When --enable-werror is enabled when running the top-level configure, > > > it passes --enable-werror-always to subdirs. Some of them, like > > >

Re: [PATCH] testsuite: Define missing and use ET for arm_arch_* and arm_cpu_*

2024-10-09 Thread Richard Earnshaw (lists)
On 07/10/2024 20:04, Torbjorn SVENSSON wrote: Hi Richard, On 2024-10-07 12:45, Richard Earnshaw (lists) wrote: On 07/10/2024 09:03, Torbjörn SVENSSON wrote: Ok for trunk? -- Update test cases to use -mcpu=unset/-march=unset feature introduced in r15-3606-g7d6c6a0d15c. The acronym ET isn't

[PATCH] config: add -Werror=lto-type-mismatch,odr to bootstrap-lto*

2024-10-09 Thread Sam James
Add -Werror=lto-type-mismatch,odr to bootstrap-lto* configurations to help stop LTO breakage/correctness issues sneaking in. We discussed -Werror=strict-aliasing but it runs early and doesn't give better diagnostics with LTO so left it out. config/ChangeLog: PR rust/108087 PR ada/

[committed] libstdc++: Fix -Wsign-compare in std::latch::count_down

2024-10-09 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- Also add assertions for the precondition on the parameter's value. libstdc++-v3/ChangeLog: * include/std/latch (latch::count_down): Add assertions for preconditions. Cast parameter to avoid -Wsign-compare on some targets. --

[committed] libstdc++: Ignore _GLIBCXX_USE_POSIX_SEMAPHORE if not supported [PR116992]

2024-10-09 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- If _GLIBCXX_HAVE_POSIX_SEMAPHRE is undefined then users get an error when defining _GLIBCXX_USE_POSIX_SEMAPHORE. We can just ignore it instead (and warn them it's being ignored). This fixes a testsuite failure on hppa64-hp-hpux11.11 (and probably so

[committed] libstdc++: Fix -Wnarrowing in [PR116991]

2024-10-09 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- When _GLIBCXX_USE_C99_COMPLEX_ARC is undefined we use the generic __complex_acos function template for _Float32 etc. and that gives a -Wnarrowing warning: complex:2043: warning: ISO C++ does not allow converting to '_Float32' from 'long double' wit

[wwwdocs] Document that gcc-8 changed the default to -std=gnu17

2024-10-09 Thread Jonathan Wakely
OK for wwwdocs? --- htdocs/gcc-8/changes.html | 7 +++ 1 file changed, 7 insertions(+) diff --git a/htdocs/gcc-8/changes.html b/htdocs/gcc-8/changes.html index c329a509..6761fb90 100644 --- a/htdocs/gcc-8/changes.html +++ b/htdocs/gcc-8/changes.html @@ -24,6 +24,8 @@ You may also want to che

Re: [PATCH v4 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-10-09 Thread Tobias Burnus
Hi PA, sorry for the slow review. Looks mostly fine, but I stumbled over a few minor points. Some are only RFC items (some of the 'I wonder …'). Paul-Antoine Arras wrote: This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done i

Re: [PATCH v2] Add -ftime-report-wall

2024-10-09 Thread Andi Kleen
> So, shouldn't we go without the new option and simply change > -ftime-report behavior? I think it's fine (given the constraints I outlined earlier). It will slightly change the output, but I guess there aren't that many users that parse it mechanically. I can do that unless someoneelse objects.

Re: [PATCH v3 0/2] ia64: enable LRA and un-obsolete ia64*-*-linux

2024-10-09 Thread Richard Biener
On Tue, 8 Oct 2024, Frank Scheiner wrote: > With stage 3 of GCC 15 approaching, to save me some time by finally > dropping the non-LRA testcase from my cross builds of GCC and Linux and > as I had the time, I updated the patch set from René with the requested > changes and rebased it to 0ad2c76bea

Re: [PATCH v3 0/2] ia64: enable LRA and un-obsolete ia64*-*-linux

2024-10-09 Thread Richard Biener
On Wed, 9 Oct 2024, Richard Biener wrote: > On Tue, 8 Oct 2024, Frank Scheiner wrote: > > > With stage 3 of GCC 15 approaching, to save me some time by finally > > dropping the non-LRA testcase from my cross builds of GCC and Linux and > > as I had the time, I updated the patch set from René with

Re: Ping: [PATCH] gcc/doc: adjust __builtin_choose_expr() description

2024-10-09 Thread Jan Beulich
On 08.10.2024 17:38, Sandra Loosemore wrote: > On 10/8/24 09:35, Jan Beulich wrote: >> On 08.10.2024 17:30, Sandra Loosemore wrote: >>> [snip] >>> >>> Hmmm, looking at the complete documentation for this built-in, and the >>> code, I think I'd go a little farther with fixing up the docs. >>> >>> Si

Re: [PATCH v3 1/2] aarch64: Add SVE2 faminmax intrinsics

2024-10-09 Thread Saurabh Jha
On 10/8/2024 3:27 PM, Richard Sandiford wrote: Saurabh Jha writes: Thanks for the review. Wanted to clarify your comment: On 10/8/2024 11:51 AM, Richard Sandiford wrote: writes: diff --git a/gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/amax_f16.c b/gcc/testsuite/gcc.target/aarch64/sve

[wwwdocs] Document defining _GLIBCXX_ASSERTIONS for -O0

2024-10-09 Thread Jonathan Wakely
--- Pushed to wwwdocs. htdocs/gcc-15/changes.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html index ad0daf04..805a6703 100644 --- a/htdocs/gcc-15/changes.html +++ b/htdocs/gcc-15/changes.html @@ -93,6 +93,9 @@ a work-in-progress.

Re: [PATCH] libstdc++: Implement P0849R8 auto(x) library changes

2024-10-09 Thread Patrick Palka
On Mon, 7 Oct 2024, Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk only? > This doesn't seem worth backporting since there should be no > behavior change. > > -- >8 -- > > This implements the library changes in P0849R8 "auto(x): decay-copy > in the language" wh

Re: [PATCH v3 1/2] Enable vectorization for unknown tripcount in very cheap cost model but disable epilog vectorization.

2024-10-09 Thread Richard Biener
On Wed, Oct 9, 2024 at 3:27 AM liuhongt wrote: > > >We'd also need to update the documentation: > > >... The @samp{very-cheap} model only > >allows vectorization if the vector code would entirely replace the > >scalar code that is being vectorized. For example, if each iteration > >of a vectorize

Re: [PATCH v3 2/2] Adjust testcase after relax O2 vectorization.

2024-10-09 Thread Richard Biener
On Wed, Oct 9, 2024 at 3:27 AM liuhongt wrote: > > Update in V3. > >The testcase looks bogus: > > > > b[i+k] = b[i+k-5] + 2; > > > >accesses b[-3], can you instead adjust the inner loop to start with k == 4? > > Changed, also adjust b[100] to b[200] to avoid array out of bound. > > >Please r

[PATCH][aarch64][libstdc++] Use shufflevector instead of shuffle in opt_random.h

2024-10-09 Thread Ricardo Jesus
This patch modifies the implementation of the vectorized Mersenne Twister random number generator to use __builtin_shufflevector instead of __builtin_shuffle. This makes it (almost) compatible with Clang. To make the implementation fully compatible with Clang, Clang will need to support internal

RE: [PATCH] aarch64: Fix folding of degenerate svwhilele case [PR117045]

2024-10-09 Thread Tamar Christina
Hi Richard, > -Original Message- > From: Richard Sandiford > Sent: Wednesday, October 9, 2024 12:58 PM > To: gcc-patches@gcc.gnu.org > Cc: ktkac...@nvidia.com; Richard Earnshaw ; > Tamar Christina > Subject: [PATCH] aarch64: Fix folding of degenerate svwhilele case [PR117045] > > The sv

Re: [PATCH] tree-optimization/117000 - elide .REDUC_IOR with compare against zero

2024-10-09 Thread Uros Bizjak
On Tue, Oct 8, 2024 at 10:19 AM Richard Biener wrote: > > The following adds a pattern to elide a .REDUC_IOR operation when > the result is compared against zero with a cbranch. I've resorted > to using can_compare_p since that's what RTL expansion eventually > checks - while GIMPLE allowed whole

[PATCH v3] RISC-V: Optimize branches with shifted immediate operands

2024-10-09 Thread Jovan Vukic
After the valuable feedback I received, it’s clear to me that the oversight was in the tests showing the benefits of the patch. In the test file, I added functions f5 and f6, which now generate more efficient code with fewer instructions. Before the patch: f5: li a4,2097152 a

Re: [PATCH] testsuite: Define missing and use ET for arm_arch_* and arm_cpu_*

2024-10-09 Thread Torbjorn SVENSSON
On 2024-10-09 12:18, Richard Earnshaw (lists) wrote: On 07/10/2024 20:04, Torbjorn SVENSSON wrote: Hi Richard, On 2024-10-07 12:45, Richard Earnshaw (lists) wrote: On 07/10/2024 09:03, Torbjörn SVENSSON wrote: Ok for trunk? -- Update test cases to use -mcpu=unset/-march=unset feature int

[PATCH] aarch64: Fix folding of degenerate svwhilele case [PR117045]

2024-10-09 Thread Richard Sandiford
The svwhilele folder mishandled the degenerate case in which the second argument is the maximum integer. In that case, the result is all-true regardless of the first parameter: If the second scalar operand is equal to the maximum signed integer value then a condition which includes an equalit

[PATCH] tree-optimization/117041 - fix load classification of former grouped load

2024-10-09 Thread Richard Biener
When we first detect a grouped load but later dis-associate it we only set DR_GROUP_FIRST_ELEMENT to NULL, indicating it is not a STMT_VINFO_GROUPED_ACCESS but leave DR_GROUP_NEXT_ELEMENT set. This causes a stray DR_GROUP_NEXT_ELEMENT access in get_group_load_store_type to go wrong, indicating a l

[PATCH] Clear DR_GROUP_NEXT_ELEMENT upon group dissolving

2024-10-09 Thread Richard Biener
I've tried to sanitize DR_GROUP_NEXT_ELEMENT accesses but there are too many so the following instead makes sure DR_GROUP_NEXT_ELEMENT is never non-NULL for !STMT_VINFO_GROUPED_ACCESS. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vect-data-refs.cc (vect_analyze_data

RE: [PATCH v5] gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]

2024-10-09 Thread Ken Matsui
On Wednesday, October 9th, 2024 at 4:27 AM, Jiang, Haochen wrote: > > > > From: Andreas Schwab sch...@suse.de > > > Sent: Wednesday, October 9, 2024 2:04 PM > > > > ../../libcpp/directives.cc: In function 'void do_pragma_once(cpp_reader*)': > > ../../libcpp/directives.cc:2078:20: error: unkn

Re: [PATCH v3 0/2] ia64: enable LRA and un-obsolete ia64*-*-linux

2024-10-09 Thread Frank Scheiner
On 09.10.24 10:26, Richard Biener wrote: On Wed, 9 Oct 2024, Richard Biener wrote: On Tue, 8 Oct 2024, Frank Scheiner wrote: With stage 3 of GCC 15 approaching, to save me some time by finally dropping the non-LRA testcase from my cross builds of GCC and Linux and as I had the time, I updated

Re: [PATCH v3 0/2] ia64: enable LRA and un-obsolete ia64*-*-linux

2024-10-09 Thread Richard Biener
On Wed, 9 Oct 2024, Frank Scheiner wrote: > On 09.10.24 10:26, Richard Biener wrote: > > On Wed, 9 Oct 2024, Richard Biener wrote: > > > >> On Tue, 8 Oct 2024, Frank Scheiner wrote: > >> > >>> With stage 3 of GCC 15 approaching, to save me some time by finally > >>> dropping the non-LRA testcase

Re: [Bug tree-optimization/109429] [PATCH v2] ivopts: fixed complexities

2024-10-09 Thread Aleksandar Rakic
A kind remind/ping on the patch. Kind regards, Aleksandar Rakić From: Aleksandar Rakic Sent: Wednesday, September 25, 2024 5:32 PM To: richard.guent...@gmail.com Cc: gcc-patches@gcc.gnu.org; Djordje Todorovic; Jovan Dmitrovic Subject: [Bug tree-optimizati

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
[CC -= Jens] Hi Chris, On Tue, Oct 08, 2024 at 03:13:11PM GMT, Chris Bazley wrote: > > ​Because I don't like the paper that has been voted into the standard. > > I kind of presented that paper against my will. I wish GCC merged the > > feature with a different name, and forced the standard to re

[PATCH] libcpp, c, middle-end, v2: Optimize initializers using #embed in C

2024-10-09 Thread Jakub Jelinek
On Tue, Oct 08, 2024 at 07:31:12PM +, Joseph Myers wrote: > On Thu, 11 Jul 2024, Jakub Jelinek wrote: > > > With the CPP_NUMBERs around it, I believe in the C FE the only places which > > need handling of the CPP_EMBED token are initializer parsing (that is the > > only one which adds actual o

[PATCH] c, v2: Speed up compilation of large char array initializers when not using #embed

2024-10-09 Thread Jakub Jelinek
On Tue, Oct 08, 2024 at 07:42:11PM +, Joseph Myers wrote: > On Sat, 3 Aug 2024, Jakub Jelinek wrote: > > > * c-c++-common/init-1.c: New test. > > I think there should also be tests of initializing signed char (and plain > char) arrays; I don't see any such tests here. Here is an updated

Re: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul extension.

2024-10-09 Thread Patrick O'Neill
On 10/9/24 14:50, Jeff Law wrote: On 10/9/24 3:21 PM, Patrick O'Neill wrote: On 10/9/24 14:07, Jeff Law wrote: Also note that if you use the tag "[RISC-V]" in your subject line your patch will be automatically picked up by a pre-commit tester that can be subsequently examined to verify

[pushed: r15-4231] diagnostics: move text output member functions to correct file

2024-10-09 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-4231-g00ede02bc8bb73. gcc/ChangeLog: * diagnostic-format-text.cc (diagnostic_text_output_format::after_diagnostic): Replace call to show_any_path with body,

[pushed: r15-4230] diagnostics: mark the JSON output format as deprecated

2024-10-09 Thread David Malcolm
The bulk of the documentation for -fdiagnostics-format= is taken up by a description of the "json" format added in r9-4156-g478dd60ddcf177. I don't plan to add any extra features to the "json" format; all my future work on machine-readable GCC diagnostics is likely to be on the SARIF output format

[pushed: r15-4229] lto: reimplement print_lto_docs_link [PR116613]

2024-10-09 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-4229-g8d0de31c931dda. gcc/ChangeLog: PR other/116613 * lto-wrapper.cc (print_lto_docs_link): Use a format string rather than building the string manually. Fix memory leak of "url" by

[PATCH v1 1/2] Match: Support form 4 for scalar signed integer SAT_TRUNC

2024-10-09 Thread pan2 . li
From: Pan Li This patch would like to support the form 4 of the scalar signed integer SAT_TRUNC. Aka below example: Form 4: #define DEF_SAT_S_TRUNC_FMT_4(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_4 (WT x)

[PATCH v1 2/2] RISC-V: Add testcases for form 4 of scalar signed SAT_TRUNC

2024-10-09 Thread pan2 . li
From: Pan Li Form 4: #define DEF_SAT_S_TRUNC_FMT_4(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_4 (WT x) \ { \ NT trunc = (NT)x;

[PATCH] Allow SLP store of mixed external and costant

2024-10-09 Thread Richard Biener
vect_build_slp_tree_1 rejected this during SLP discovery because it ran into the rhs code comparison code for stores. The following skips that completely for loads and stores as those are handled later anyway. This needs a heuristic adjustment in vect_get_and_check_slp_defs to avoid fallout with

Re: [PATCH] x86: Implement Fast-Math Float Truncation to BF16 via PSRLD Instruction

2024-10-09 Thread Hongtao Liu
On Tue, Oct 8, 2024 at 3:24 PM Levy Hsu wrote: > > Bootstrapped and tested on x86_64-linux-gnu, OK for trunk? Ok. > > gcc/ChangeLog: > > * config/i386/i386.md: Rewrite insn truncsfbf2. > > gcc/testsuite/ChangeLog: > > * gcc.target/i386/truncsfbf-1.c: New test. > * gcc.targe

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Xavier Del Campo Romero
Hello, Could you please unCC me from this discussion? Despite I originally made this proposal, I no longer have an opinion on the subject and there is not much I can add to the discussion anyway. Thank you all very much for your efforts into improving C. Best regards, -- Xavier Del Campo Romer

[PATCH] RISC-V:Bugfix for C++ code compilation failure with rv32imafc_zve32f[pr116883]

2024-10-09 Thread Li Xu
From: xuli Example as follows: int main() { unsigned long arraya[128], arrayb[128], arrayc[128]; for (int i = 0; i < 128; i++) { arraya[i] = arrayb[i] + arrayc[i]; } return 0; } Compiled with -march=rv32imafc_zve32f -mabi=ilp32f, it will cause a compilation issue: riscv_vect

Re: [RFC/PATCH] libgcc: sh: Use soft-fp for non-hosted SH3/SH4

2024-10-09 Thread Oleg Endo
On Wed, 2024-07-03 at 11:59 +0200, Sébastien Michelland wrote: > libgcc's fp-bit.c is quite slow and most modern/developed architectures > have switched to using the soft-fp library. This patch does so for > free-standing/unknown-OS SH3/SH4 builds, using soft-fp's default parameters > for the most

[PATCH] i386: Fix scalar VCOMSBF16 which only compares low word

2024-10-09 Thread Kong, Lingling
Hi, Fixed scalar VCOMSBF16 misused in AVX10.2. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m64}. Ok for trunk? gcc/ChangeLog: * config/i386/sse.md (avx10_2_comsbf16_v8bf): Fixed scalar operands. --- gcc/config/i386/sse.md | 8 ++-- 1 file changed, 6 insertions(+), 2

[PATCH] i386: Fix some patterns's mem attribute.

2024-10-09 Thread Hu, Lin1
Hi, all This is another patch to modify some pattern's type attr from ssemov to ssemov2. Some ssemov pattern's mem attr should be load when their 2 operand is a memory operand. Bootstrapped and regtested on x86-64-linux-pc, OK for trunk? BRs, Lin gcc/ChangeLog: * config/i386/sse.md