[PATCH 2/2] RISC-V: Add quotes to #error messages (all)

2023-08-17 Thread Tsukasa OI via Gcc-patches
From: Tsukasa OI In commit 1aaf3a64e92a ("[PATCH] RISC-V: Deduplicate #error messages in testsuite"), the author made a mistake to miss the test after adding quotes around extension names. To avoid future errors and for consistency with other #error uses in the RISC-V testsuite, this commit

[PATCH 1/2] RISC-V: Add quotes to #error messages

2023-08-17 Thread Tsukasa OI via Gcc-patches
From: Tsukasa OI In commit 1aaf3a64e92a ("[PATCH] RISC-V: Deduplicate #error messages in testsuite"), the author made a mistake to miss the test after adding quotes around extension names. To avoid future errors and for consistency with other #error uses in the RISC-V testsuite, this commit

Re: [PATCH] improve error for when /usr/include isn't found [PR90835]

2023-08-17 Thread Eric Gallager
On Thu, Aug 17, 2023 at 4:05 PM Iain Sandoe wrote: > > Hi Eric, > > thanks for working on this. > > > On 17 Aug 2023, at 20:35, Eric Gallager wrote: > > > > This is a pretty simple patch that ought to help Darwin users understand > > better why their build is failing when they forget to pass the

[PATCH v6] libgfortran: Replace mutex with rwlock

2023-08-17 Thread Zhu, Lipeng via Gcc-patches
From: Lipeng Zhu This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit function, the percentage to step into the insert_unit function is around 30%, in most instances, we

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-08-17 Thread Zhu, Lipeng via Gcc-patches
Hi Thomas, > > Hi Lipeng, > > > May I know any comment or concern on this patch, thanks for your time > >  > > Thanks for your patience in getting this reviewed. > > A few remarks / questions. > > Which strategy is used in this implementation, read-preferring or write- > preferring? And if

Re: [PATCH V2] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Lehua Ding
Committed, thanks Robin. --Original-- From: "Robin Dapp"

[PATCH] RISC-V: Fix -march error of zhinxmin testcases

2023-08-17 Thread Lehua Ding
This little patch fixs the -march error of a zhinxmin testcase I added earlier and an old zhinxmin testcase, since these testcases are for zhinxmin extension and not zfhmin extension. --- gcc/testsuite/gcc.target/riscv/_Float16-zhinxmin-3.c | 2 +-

[PATCH v1] RISC-V: Refactor RVV class by frm_op_type template arg

2023-08-17 Thread Pan Li via Gcc-patches
From: Pan Li As suggested by kito, we will add new frm_opt_type template arg to the op class, to avoid the duplicated function expand. Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc (class binop_frm): Removed. (class

Re: [PATCH V2] RISC-V: Add the missed half floating-point mode patterns of local_pic_load/store when only use zfhmin or zhinxmin

2023-08-17 Thread Lehua Ding
Committed, thanks Robin and Palmer. --Original-- From: "Palmer Dabbelt"

[PATCH] testsuite: Improve test in dg-require-python-h

2023-08-17 Thread Thiago Jung Bauermann via Gcc-patches
If GCC is tested with a sysroot which doesn't contain a Python installation (e.g., with a command such as "make check-gcc-c FLAGS_UNDER_TEST="--sysroot=/some/path"), but there's a python3-config in $PATH, then the testsuite will pick up the host's Python.h which can't actually be used: Executing

RISC-V: Deduplicate #error messages in testsuite

2023-08-17 Thread juzhe.zh...@rivai.ai
FAIL: gcc.target/riscv/zvkn-1.c -O0 (test for excess errors) FAIL: gcc.target/riscv/zvkn-1.c -O1 (test for excess errors) FAIL: gcc.target/riscv/zvkn-1.c -O2 (test for excess errors) FAIL: gcc.target/riscv/zvkn-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread Jonathan Wakely via Gcc-patches
On Thu, 17 Aug 2023 at 20:44, Jonathan Wakely wrote: > > On Thu, 17 Aug 2023 at 20:37, Jonathan Wakely wrote: > > > > On Thu, 17 Aug 2023 at 19:59, Jonathan Wakely wrote: > > > > > > On Thu, 17 Aug 2023 at 18:40, François Dumont > > > wrote: > > > > > > > > > > > > On 17/08/2023 19:22,

Re: [committed] libstdc++: Reuse double overload of __convert_to_v if possible

2023-08-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 18 Aug 2023 at 00:20, Hans-Peter Nilsson wrote: > > > Date: Thu, 17 Aug 2023 21:32:29 +0100 > > From: Jonathan Wakely via Gcc-patches > > > Tested x86_64-linux. Pushed to trunk. > > Does the below typo imply that for x86_64-linux, > "__DBL_MANT_DIG__ == __LDBL_MANT_DIG__" is false and

[committed] libstdc++: Replace global std::string objects in tzdb.cc

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- When the library is built with --disable-libstdcxx-dual-abi the only type of std::string supported is the COW string, and the two global std::string objects in tzdb.cc have to allocate memory. I added them thinking they would fit in the SSO string

Re: [committed] libstdc++: Reuse double overload of __convert_to_v if possible

2023-08-17 Thread Hans-Peter Nilsson via Gcc-patches
> Date: Thu, 17 Aug 2023 21:32:29 +0100 > From: Jonathan Wakely via Gcc-patches > Tested x86_64-linux. Pushed to trunk. Does the below typo imply that for x86_64-linux, "__DBL_MANT_DIG__ == __LDBL_MANT_DIG__" is false and the code is actually untested? > libstdc++-v3/ChangeLog: > > *

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Siddhesh Poyarekar
On 2023-08-17 17:25, Qing Zhao wrote: It's not exactly the same issue, the earlier discussion was about choosing sizes in the same pass while the current one is about choosing between passes, but I agree it "rhymes". This is what I was alluding to originally (for OST_MINIMUM use MIN_EXPR if

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Qing Zhao via Gcc-patches
> On Aug 17, 2023, at 4:57 PM, Siddhesh Poyarekar wrote: > > On 2023-08-17 16:23, Qing Zhao wrote: Then, I think whatever MIN or MAX, the early phase has more precise information than the later phase, we should use its result if it’s NOT UNKNOWN? >>> >>> We can't be sure

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Siddhesh Poyarekar
On 2023-08-17 16:23, Qing Zhao wrote: Then, I think whatever MIN or MAX, the early phase has more precise information than the later phase, we should use its result if it’s NOT UNKNOWN? We can't be sure about that though, can we? For example for something like this: struct S { int a;

[committed] libstdc++: Add std::formatter specializations for extended float types

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This makes it possible to format _Float32, _Float64 etc. in C++20 mode. Previously it was only possible to format them in C++23 when the typedefs and the std::to_chars overloads were defined. Instead of relying on std::to_chars for those types, we

[committed] libstdc++: Define std::numeric_limits<_FloatNN> before C++23

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The extended floating-point types such as _Float32 are supported by GCC prior to C++23, you just can't use the standard-conforming names from to refer to them. This change defines the specializations of std::numeric_limits for those types for older

[committed] libstdc++: Reuse double overload of __convert_to_v if possible

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- For targets where double and long double have the same representation we can reuse the same __convert_to_v code for both types. This will slightly reduce the size of the compiled code in the library. libstdc++-v3/ChangeLog: *

[committed] libstdc++: Make __cmp_cat::__unseq constructor consteval

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Probably good to backport. -- >8 -- This constructor should only ever be used with a literal 0 as the argument, so we can make it consteval. This has the nice advantage that it is expanded immediately in the front end, and so GDB will never step into the

[committed] libstdc++: Micro-optimize construction of named std::locale

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This shaves about 100ns off the std::locale constructor for named locales (which is only about 1% of the total time). Using !*s instead of !strcmp(s, "") doesn't make any difference as GCC optimizes that already even at -O1. !strcmp(s, "C") is

[committed] libstdc++: Simplify chrono::__units_suffix using std::format

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- For std::chrono formatting we can simplify __units_suffix by using std::format_to to generate the "[n/m]s" suffix with the correct character type and write directly to the output iterator, so it doesn't need to be

[committed] libstdc++: Rework std::format support for wchar_t

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This changes how std::format creates wide strings, by replacing uses of std::ctype::widen with the recently-added __to_wstring_numeric helper function. This removes the dependency on the locale, which should only be used for locale-specific formats

[committed] libstdc++: Optimize std::string::assign(Iter, Iter) [PR110945]

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Calling string::assign(Iter, Iter) with "foreign" iterators (not the string's own iterator or pointer types) currently constructs a temporary string and then calls replace to copy the characters from it. That means we copy from the iterators twice,

[committed] libstdc++: Fix -Wunused-parameter in

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/experimental/internet (address_v4::to_string): Remove unused parameter name. --- libstdc++-v3/include/experimental/internet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[committed] libstdc++: Implement std::to_string in terms of std::format (P2587R3)

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This change for C++26 affects std::to_string for floating-point arguments, so that they should be formatted using std::format("{}", v) instead of using sprintf. The modified specification in the standard also affects integral arguments, but there's

[committed] libstdc++: Optimize std::to_string using std::string::resize_and_overwrite

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This uses std::string::__resize_and_overwrite to avoid initializing the string buffer with characters that are immediately overwritten. This results in about 6% better performance for the std_to_string case in int-benchmark.cc from

[committed] libstdc++: Define std::string::resize_and_overwrite for C++11 and COW string

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- There are several places in the library where we can improve performance using resize_and_overwrite so it's inconvenient only being able to use it in C++23 mode, and only for cxx11 strings. This adds it for COW strings, and also adds

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Qing Zhao via Gcc-patches
> On Aug 17, 2023, at 3:59 PM, Siddhesh Poyarekar wrote: > > On 2023-08-17 15:27, Qing Zhao wrote: >>> Yes, that's it. Maybe it's more correct if instead of MAX_EXPR if for >>> OST_MINIMUM we stick with the early_objsz answer if it's non-zero. I'm not >>> sure if that's the case for

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Siddhesh Poyarekar
On 2023-08-17 15:27, Qing Zhao wrote: Yes, that's it. Maybe it's more correct if instead of MAX_EXPR if for OST_MINIMUM we stick with the early_objsz answer if it's non-zero. I'm not sure if that's the case for maximum size though, my gut says it isn't. So, the major purpose for adding the

Re: [PATCH] improve error for when /usr/include isn't found [PR90835]

2023-08-17 Thread Iain Sandoe
Hi Eric, thanks for working on this. > On 17 Aug 2023, at 20:35, Eric Gallager wrote: > > This is a pretty simple patch that ought to help Darwin users understand > better why their build is failing when they forget to pass the > --with-sysroot= flag to configure. > > gcc/ChangeLog: > >

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread Jonathan Wakely via Gcc-patches
On Thu, 17 Aug 2023 at 20:37, Jonathan Wakely wrote: > > On Thu, 17 Aug 2023 at 19:59, Jonathan Wakely wrote: > > > > On Thu, 17 Aug 2023 at 18:40, François Dumont wrote: > > > > > > > > > On 17/08/2023 19:22, Jonathan Wakely wrote: > > > > On Sun, 13 Aug 2023 at 14:27, François Dumont via

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread Jonathan Wakely via Gcc-patches
On Thu, 17 Aug 2023 at 19:59, Jonathan Wakely wrote: > > On Thu, 17 Aug 2023 at 18:40, François Dumont wrote: > > > > > > On 17/08/2023 19:22, Jonathan Wakely wrote: > > > On Sun, 13 Aug 2023 at 14:27, François Dumont via Libstdc++ > > > wrote: > > >> Here is the fixed patch tested in all 3

[PATCH] improve error for when /usr/include isn't found [PR90835]

2023-08-17 Thread Eric Gallager via Gcc-patches
This is a pretty simple patch that ought to help Darwin users understand better why their build is failing when they forget to pass the --with-sysroot= flag to configure. gcc/ChangeLog: PR target/90835 * Makefile.in: improve error message when /usr/include is missing

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Qing Zhao via Gcc-patches
> On Aug 17, 2023, at 1:49 PM, Siddhesh Poyarekar wrote: > > On 2023-08-17 09:58, Qing Zhao wrote: >>> So this is a (sort of) known issue, which necessitated the early_objsz pass >>> to get an estimate before a subobject reference was optimized to a MEM_REF. >> Do you mean that after a

[PATCH] Document cond_neg, cond_one_cmpl, cond_len_neg and cond_len_one_cmpl standard patterns

2023-08-17 Thread Andrew Pinski via Gcc-patches
When I added `cond_one_cmpl` (and the corresponding IFN) I had noticed cond_neg standard named pattern was not documented and this adds the documentation for all 4 named patterns now. OK? Tested by building the manual. gcc/ChangeLog: * doc/md.texi (Standard patterns): Document cond_neg,

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread Jonathan Wakely via Gcc-patches
On Thu, 17 Aug 2023 at 18:40, François Dumont wrote: > > > On 17/08/2023 19:22, Jonathan Wakely wrote: > > On Sun, 13 Aug 2023 at 14:27, François Dumont via Libstdc++ > > wrote: > >> Here is the fixed patch tested in all 3 modes: > >> > >> - _GLIBCXX_USE_DUAL_ABI > >> > >> -

Re: [PATCH] c: Add support for [[__extension__ ...]]

2023-08-17 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: >> Am 17.08.2023 um 13:25 schrieb Richard Sandiford via Gcc-patches >> : >> >> Joseph Myers writes: On Wed, 16 Aug 2023, Richard Sandiford via Gcc-patches wrote: Would it be OK to add support for: [[__extension__ ...]] to suppress

[PATCH] RISC-V: Implement TLS Descriptors.

2023-08-17 Thread Tatsuyuki Ishi via Gcc-patches
This implements TLS Descriptors (TLSDESC) as specified in [1]. In TLSDESC instruction sequence, the first instruction relocates against the target TLS variable, while subsequent instructions relocates against the address of the first. Such usage of labels are not well-supported within GCC. Due to

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread Guillaume Gomez via Gcc-patches
Quick question: do you plan to make the merge or should I ask Antoni? Le jeu. 17 août 2023 à 17:59, Guillaume Gomez a écrit : > Thanks for the review! > > Le jeu. 17 août 2023 à 17:50, David Malcolm a écrit > : > > > > On Thu, 2023-08-17 at 17:41 +0200, Guillaume Gomez wrote: > > > And now I

Re: [PATCH V2] RISC-V: Add the missed half floating-point mode patterns of local_pic_load/store when only use zfhmin or zhinxmin

2023-08-17 Thread Palmer Dabbelt
On Thu, 17 Aug 2023 10:03:04 PDT (-0700), rdapp@gmail.com wrote: Indeed all ANYLSF patterns have TARGET_HARD_FLOAT (==f extension) which is incompatible with ZHINX or ZHINXMIN anyway. That should really be fixed separately or at least clarified, maybe I'm missing something. We've also got

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Siddhesh Poyarekar
On 2023-08-17 09:58, Qing Zhao wrote: So this is a (sort of) known issue, which necessitated the early_objsz pass to get an estimate before a subobject reference was optimized to a MEM_REF. Do you mean that after a subobject reference was optimized to a MEM_REF, there is no way to compute

Re: [Committed] RISCV: Add rotate immediate regression test

2023-08-17 Thread Palmer Dabbelt
On Thu, 17 Aug 2023 10:10:38 PDT (-0700), Patrick O'Neill wrote: On 8/16/23 21:36, Jeff Law wrote: On 8/16/23 19:17, Patrick O'Neill wrote: This adds new regression tests to ensure half-register rotations are correctly optimized into rori instructions. gcc/testsuite/ChangeLog: *

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread François Dumont via Gcc-patches
On 17/08/2023 19:22, Jonathan Wakely wrote: On Sun, 13 Aug 2023 at 14:27, François Dumont via Libstdc++ wrote: Here is the fixed patch tested in all 3 modes: - _GLIBCXX_USE_DUAL_ABI - !_GLIBCXX_USE_DUAL_ABI && !_GLIBCXX_USE_CXX11_ABI - !_GLIBCXX_USE_DUAL_ABI && _GLIBCXX_USE_CXX11_ABI I

[COMMITTED] PR tree-optimization/111009 - Fix range-ops operator_addr.

2023-08-17 Thread Andrew MacLeod via Gcc-patches
operator_addr was simply calling fold_range() to implement op1_range, but it turns out op1_range needs to be more restrictive. take for example  from the PR :    _13 = >maj when folding,  getting a value of 0 for op1 means dso->maj resolved to a value of [0,0]. 

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread Jonathan Wakely via Gcc-patches
On Sun, 13 Aug 2023 at 14:27, François Dumont via Libstdc++ wrote: > > Here is the fixed patch tested in all 3 modes: > > - _GLIBCXX_USE_DUAL_ABI > > - !_GLIBCXX_USE_DUAL_ABI && !_GLIBCXX_USE_CXX11_ABI > > - !_GLIBCXX_USE_DUAL_ABI && _GLIBCXX_USE_CXX11_ABI > > I don't know what you have in mind

Re: [PATCH] sso-string@gnu-versioned-namespace [PR83077]

2023-08-17 Thread François Dumont via Gcc-patches
Another fix to define __cow_string(const std::string&) in cxx11-stdexcept.cc even if ! _GLIBCXX_USE_DUAL_ABI. On 13/08/2023 21:51, François Dumont wrote: Here is another version with enhanced sizeof/alignof static_assert in string-inst.cc for the std::__cow_string definition from . The

Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization

2023-08-17 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 15 Aug 2023 at 14:28, Richard Sandiford wrote: > > Richard Biener writes: > > On Mon, 14 Aug 2023, Prathamesh Kulkarni wrote: > >> On Mon, 7 Aug 2023 at 13:19, Richard Biener > >> wrote: > >> > It doesn't seem to make a difference for x86. That said, the "fix" is > >> > probably

[Committed] RISCV: Add rotate immediate regression test

2023-08-17 Thread Patrick O'Neill
On 8/16/23 21:36, Jeff Law wrote: On 8/16/23 19:17, Patrick O'Neill wrote: This adds new regression tests to ensure half-register rotations are correctly optimized into rori instructions. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbb-rol-ror-08.c: New test. *

Re: [PATCH] c: Add support for [[__extension__ ...]]

2023-08-17 Thread Richard Biener via Gcc-patches
> Am 17.08.2023 um 13:25 schrieb Richard Sandiford via Gcc-patches > : > > Joseph Myers writes: >>> On Wed, 16 Aug 2023, Richard Sandiford via Gcc-patches wrote: >>> >>> Would it be OK to add support for: >>> >>> [[__extension__ ...]] >>> >>> to suppress the pedwarn about using [[]]

Re: [PATCH V2] RISC-V: Add the missed half floating-point mode patterns of local_pic_load/store when only use zfhmin or zhinxmin

2023-08-17 Thread Robin Dapp via Gcc-patches
Indeed all ANYLSF patterns have TARGET_HARD_FLOAT (==f extension) which is incompatible with ZHINX or ZHINXMIN anyway. That should really be fixed separately or at least clarified, maybe I'm missing something. Still we can go forward with the patch itself as it improves things independently, so

Re: [V2][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-08-17 Thread Kees Cook via Gcc-patches
On Thu, Aug 17, 2023 at 01:44:42PM +, Qing Zhao wrote: > Thanks for the testing case. > Yes, I noticed this issue too, and already fixed it in my private branch. > > With the latest patch, the compilation has no issue: > [opc@qinzhao-ol8u3-x86 108896]$ sh t >

Re: [pushed][LRA]: Spill pseudos assigned to fp when fp->sp elimination became impossible

2023-08-17 Thread Vladimir Makarov via Gcc-patches
On 8/17/23 07:19, senthilkumar.selva...@microchip.com wrote: On Wed, 2023-08-16 at 12:13 -0400, Vladimir Makarov wrote: EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe The attached patch fixes recently found wrong insn removal in LRA port for AVR.

[pushed][LRA]: When assigning stack slots to pseudos previously assigned to fp consider other spilled pseudos

2023-08-17 Thread Vladimir Makarov via Gcc-patches
The following patch fixes a problem with allocating the same stack slots to conflicting pseudos.  The problem exists only for AVR LRA port. The patch was successfully bootstrapped and tested on x86-64 and aarch64. commit c024867d1aa9d465e0236fc9d45d8e1d4bb6bd30 Author: Vladimir N. Makarov

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread Guillaume Gomez via Gcc-patches
Thanks for the review! Le jeu. 17 août 2023 à 17:50, David Malcolm a écrit : > > On Thu, 2023-08-17 at 17:41 +0200, Guillaume Gomez wrote: > > And now I just discovered that a lot of commits from Antoni's fork > > haven't been sent upstream which is why the ABI count is so high in > > his

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-17 at 17:41 +0200, Guillaume Gomez wrote: > And now I just discovered that a lot of commits from Antoni's fork > haven't been sent upstream which is why the ABI count is so high in > his repository. Fixed that as well. Thanks for the updated patch; I was about to comment on that.

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread Guillaume Gomez via Gcc-patches
And now I just discovered that a lot of commits from Antoni's fork haven't been sent upstream which is why the ABI count is so high in his repository. Fixed that as well. Le jeu. 17 août 2023 à 17:26, Guillaume Gomez a écrit : > > Antoni spot a typo I made: > > I added

Re: [PATCH V4] Add warning options -W[no-]compare-distinct-pointer-types

2023-08-17 Thread Jose E. Marchesi via Gcc-patches
> On Thu, 17 Aug 2023, Jose E. Marchesi via Gcc-patches wrote: > >> +@opindex Wcompare-distinct-pointer-types >> +@item -Wcompare-distinct-pointer-types > > This @item should say @r{(C and Objective-C only)}, since the option isn't > implemented for C++. OK with that change. Pushed with that

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread Guillaume Gomez via Gcc-patches
Antoni spot a typo I made: I added `LIBGCCJIT_HAVE_gcc_jit_type_get_size` instead of `LIBGCCJIT_HAVE_gcc_jit_type_get_restrict`. Fixed in this patch, sorry for the noise. Le jeu. 17 août 2023 à 11:30, Guillaume Gomez a écrit : > > Hi Dave, > > > What kind of testing has the patch had? (e.g. did

Re: [PATCH V4] Add warning options -W[no-]compare-distinct-pointer-types

2023-08-17 Thread Joseph Myers
On Thu, 17 Aug 2023, Jose E. Marchesi via Gcc-patches wrote: > +@opindex Wcompare-distinct-pointer-types > +@item -Wcompare-distinct-pointer-types This @item should say @r{(C and Objective-C only)}, since the option isn't implemented for C++. OK with that change. -- Joseph S. Myers

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-17 Thread Joseph Myers
On Thu, 17 Aug 2023, Xi Ruoyao via Gcc-patches wrote: > So I guess we just need > > builtin_define ("__builtin_fabsq=__builtin_fabsf128"); > builtin_define ("__builtin_nanq=__builtin_nanf128"); > > etc. to map the "q" builtins to "f128" builtins if we really need the > "q" builtins. > >

Re: [PING] Re: [PATCH v2] Re: [WIP] Have -Wpointer-sign be enabled by -Wextra, too [PR109836]

2023-08-17 Thread Joseph Myers
On Wed, 16 Aug 2023, Eric Gallager via Gcc-patches wrote: > PING > > On Tue, Aug 8, 2023 at 8:17 PM Eric Gallager wrote: > > > > On Tue, May 30, 2023 at 5:42 PM Eric Gallager wrote: > > > > > > PR109836 is a request to have -Wpointer-sign enabled by default. There > > > were points of

Re: [PATCH] Loongarch: Fix plugin header missing install.

2023-08-17 Thread chenglulu
LGTM! 在 2023/8/16 上午9:48, Guo Jie 写道: gcc/ChangeLog: * config/loongarch/t-loongarch: Add loongarch-driver.h into TM_H. Add loongarch-def.h and loongarch-tune.h into OPTIONS_H_EXTRA. Co-authored-by: Lulu Cheng --- gcc/config/loongarch/t-loongarch | 4 1 file

Re: [PATCH V2] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Robin Dapp via Gcc-patches
OK, thanks. Regards Robin

[PATCH V4] Add warning options -W[no-]compare-distinct-pointer-types

2023-08-17 Thread Jose E. Marchesi via Gcc-patches
[Changes from V3: - Previous thread: https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600625.html - The tests have been augmented to check all six relational operators. In particular it covers both code paths impacted by the patch: the equality/inequality and the relational ops.] GCC

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Qing Zhao via Gcc-patches
> On Aug 17, 2023, at 7:00 AM, Siddhesh Poyarekar wrote: > > On 2023-08-16 11:59, Qing Zhao wrote: >> Jakub and Sid, >> During my study, I found an interesting behavior for the following small >> testing case: >> #include >> #include >> struct fixed { >> size_t foo; >> char b; >> char

Re: [PATCH] RISC-V: Deduplicate #error messages in testsuite

2023-08-17 Thread Jeff Law via Gcc-patches
On 8/13/23 20:53, Tsukasa OI via Gcc-patches wrote: From: Tsukasa OI "#error Feature macro not defined" is required to test the existence of an extension through the preprocessor. However, multiple occurrence of the exact same error message will confuse the developer once an error is

Re: [V2][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-08-17 Thread Qing Zhao via Gcc-patches
Hi, Kees, Thanks for the testing case. Yes, I noticed this issue too, and already fixed it in my private branch. With the latest patch, the compilation has no issue: [opc@qinzhao-ol8u3-x86 108896]$ sh t /home/opc/Install/latest-d/bin/gcc -O2 -c -o /dev/null bug.c [opc@qinzhao-ol8u3-x86

Re: RISC-V: Added support for CRC.

2023-08-17 Thread Alexander Monakov
On Wed, 16 Aug 2023, Philipp Tomsich wrote: > > > I fully expect that latency to drop within the next 12-18 months. In that > > > world, there's not going to be much benefit to using hand-coded libraries > > > vs > > > just letting the compiler do it. > > I would also hope that the

[committed] libgomp: call numa_available first when using libnuma

2023-08-17 Thread Tobias Burnus
Found when looking at libnuma/libmemkind test issues discussing in https://gcc.gnu.org/PR111024 [The fails of the PR are not fully understood but point towards a buggy libmemkind or combination or libmemkind + other libraries; they only show up recently as before no libgomp testcase checked

[PATCH] tree-optimization/111039 - abnormals and bit test merging

2023-08-17 Thread Richard Biener via Gcc-patches
The following guards the bit test merging code in if-combine against the appearance of SSA names used in abnormal PHIs. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/111039 * tree-ssa-ifcombine.cc (ifcombine_ifandif): Check for

[PATCH V2] RISC-V: Add the missed half floating-point mode patterns of local_pic_load/store when only use zfhmin or zhinxmin

2023-08-17 Thread Lehua Ding
Hi, There is a new failed RISC-V testcase(testsuite/gcc.target/riscv/rvv/autovec/vls/const-4.c) on the current trunk branch when use medany as default cmodel. The reason is the load of half floating-point imm is convert from RTL 1 to RTL 2 as the cmodel be changed from medlow to medany. This

[COMMITTED] bpf: support `naked' function attributes in BPF targets

2023-08-17 Thread Jose E. Marchesi via Gcc-patches
The kernel selftests and other BPF programs make extensive use of the `naked' function attribute with bodies written using basic inline assembly. This patch adds support for the attribute to bpf-unkonwn-none, makes it to inhibit warnings due to lack of explicit `return' statement, and updates

[PATCH V2] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Lehua Ding
Hi, This little patch fix the fail testcase (gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c) after apply this patch (https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627121.html). The specific reason is that the vsetvl pass has bug and this patch forbidden the fuse of this

[committed] libstdc++: Fix std::format("{:F}", inf) to use uppercase

2023-08-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 will follow. -- >8 -- std::format was treating {:f} and {:F} identically on the basis that for the fixed 1.234567 format there are no alphabetical characters that need to be in uppercase. But that's wrong for infinities and NaNs, which

[committed] libstdc++: Regenerate Makefile.in

2023-08-17 Thread Jonathan Wakely via Gcc-patches
This target in include/Makefile.am was supposed to ensure that nobody building gcc would need autogen to regenerate the bits/version.h header, but it didn't make it in to include/Makefile.in. Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/Makefile.in:

Re: [PATCH] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Lehua Ding
Hi Robin, Hmm, ok so that has nothing to do with the rest of the patch but just happend to be the same test case. So we didn't schedule a vsetvl here because vmv1r doesn't require one but the simulation doesn't initialize vtype before the first vsetvl? If this is the only instance, I guess

Re: [PATCH] RISC-V: Add the missed half floating-point mode patterns of local_pic_load/store when only use zfhmin

2023-08-17 Thread Lehua Ding
Hi Robin, You likely want TARGET_ZHINXMIN instead of ZHINX though? I mean the hardware support is obviously always there but the patterns should be available for the min extension already. Please double check as I haven't worked with that extension before. Our test coverage for the *inx

Re: [PATCH] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Robin Dapp via Gcc-patches
Hi Lehua, > XPASS: gcc.target/riscv/rvv/autovec/partial/slp-1.c scan-assembler \\tvand > XPASS: gcc.target/riscv/rvv/autovec/partial/slp-1.c scan-assembler \\tvand > XPASS: gcc.target/riscv/rvv/autovec/partial/slp-1.c scan-assembler \\tvand > XPASS: gcc.target/riscv/rvv/autovec/partial/slp-1.c

Re: [PATCH] RISC-V: Add the missed half floating-point mode patterns of local_pic_load/store when only use zfhmin

2023-08-17 Thread Robin Dapp via Gcc-patches
Hi Lehua, thanks for fixing this. Looks like the same reason we have the separation of zvfh and zvfhmin for vector loads/stores. > +;; Iterator for hardware-supported load/store floating-point modes. > +(define_mode_iterator ANYLSF [(SF "TARGET_HARD_FLOAT || TARGET_ZFINX") > +

Re: [PATCH] RISC-V: Fix XPASS slp testcases

2023-08-17 Thread juzhe.zh...@rivai.ai
LGTM. Thanks for fixing my previous mistakes. juzhe.zh...@rivai.ai From: Lehua Ding Date: 2023-08-17 19:43 To: gcc-patches CC: juzhe.zhong; kito.cheng; rdapp.gcc; palmer; jeffreyalaw Subject: [PATCH] RISC-V: Fix XPASS slp testcases This patch fixs XPASS slp testcases on trunk by making the

[PATCH] RISC-V: Fix XPASS slp testcases

2023-08-17 Thread Lehua Ding
This patch fixs XPASS slp testcases on trunk by making the conditions for xfail stricter. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/partial/slp-1.c: Fix. * gcc.target/riscv/rvv/autovec/partial/slp-16.c: Ditto. * gcc.target/riscv/rvv/autovec/partial/slp-17.c:

Re: [WIP RFC v2] analyzer: Add support of placement new and improved operator new [PR105948]

2023-08-17 Thread Benjamin Priour via Gcc-patches
On Thu, Aug 17, 2023 at 12:34 AM David Malcolm wrote: > On Wed, 2023-08-16 at 14:19 +0200, priour...@gmail.com wrote: > > From: benjamin priour > > > > Hi, > > (s/we/the analyzer/) > > Hi Benjamin, thanks for the updated patch. > > > > > I've been continuing my patch of supporting operator new

Re: Re: [PATCH 1/4][V4][RISC-V] support cm.push cm.pop cm.popret in zcmp

2023-08-17 Thread Fei Gao
Hi Kito Root cause has been identified. Here's the frame layout fo the TC, please use courier font :) +---+  |                               |  |  GPR save area  112 B         |  |                               |

[PATCH] c: Add support for [[__extension__ ...]]

2023-08-17 Thread Richard Sandiford via Gcc-patches
Joseph Myers writes: > On Wed, 16 Aug 2023, Richard Sandiford via Gcc-patches wrote: > >> Would it be OK to add support for: >> >> [[__extension__ ...]] >> >> to suppress the pedwarn about using [[]] prior to C2X? Then we can > > That seems like a plausible feature to add. Thanks. Of

Re: [pushed][LRA]: Spill pseudos assigned to fp when fp->sp elimination became impossible

2023-08-17 Thread SenthilKumar.Selvaraj--- via Gcc-patches
On Wed, 2023-08-16 at 12:13 -0400, Vladimir Makarov wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > The attached patch fixes recently found wrong insn removal in LRA port > for AVR. > > The patch was successfully tested and bootstrapped

Re: [PATCH] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Lehua Ding
I see these failing testcases on trunk: === gcc: Unexpected fails for rv64gcv_zfh lp64d medany spike === FAIL: gcc.dg/pr42685.c (test for excess errors) FAIL: gcc.dg/pr45105.c (test for excess errors) XPASS: gcc.dg/unroll-7.c scan-rtl-dump-not loop2_unroll "Invalid sum" FAIL:

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-17 Thread Siddhesh Poyarekar
On 2023-08-16 11:59, Qing Zhao wrote: Jakub and Sid, During my study, I found an interesting behavior for the following small testing case: #include #include struct fixed { size_t foo; char b; char array[10]; } q = {}; #define noinline __attribute__((__noinline__)) static void

Re: [PATCH] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Lehua Ding
Hi Robin, unrelated but I'm seeing a lot of failing gather/scatter tests on master right now. Are you talking about these FAILs like bellow? If so,If so it should be caused by a recent commit from juzhe who is looking at it.If not,I didn't have these fails in my local run. XPASS:

Re: [PATCH] Fix code_helper unused argument warning for fr30

2023-08-17 Thread Richard Biener via Gcc-patches
On Thu, Aug 17, 2023 at 9:21 AM Jan-Benedict Glaw wrote: > > Hi! > > fr30 is the only target defining GO_IF_LEGITIMATE_ADDRESS right now, in > which case the `code_helper ch` argument to memory_address_addr_space_p() > is unused and emits a new warning. OK. > gcc/ChangeLog: > * recog.cc

Re: [PATCH] doc: Fixes to RTL-SSA sample code

2023-08-17 Thread Richard Sandiford via Gcc-patches
Alex Coplan writes: > Hi, > > This patch fixes up the code examples in the RTL-SSA documentation (the > sections on making insn changes) to reflect the current API. > > The main issues are as follows: > - rtl_ssa::recog takes an obstack_watermark & as the first parameter. >Presumably this is

[PATCH] doc: Fixes to RTL-SSA sample code

2023-08-17 Thread Alex Coplan via Gcc-patches
Hi, This patch fixes up the code examples in the RTL-SSA documentation (the sections on making insn changes) to reflect the current API. The main issues are as follows: - rtl_ssa::recog takes an obstack_watermark & as the first parameter. Presumably this is intended to be the change attempt,

Re: [PATCH] RISC-V: Forbidden fuse vlmax vsetvl to DEMAND_NONZERO_AVL vsetvl

2023-08-17 Thread Robin Dapp via Gcc-patches
Hi Lehua, unrelated but I'm seeing a lot of failing gather/scatter tests on master right now. > /* DIRTY -> DIRTY or VALID -> DIRTY. */ > + if (block_info.reaching_out.demand_p (DEMAND_NONZERO_AVL) > + && vlmax_avl_p (prop.get_avl ())) > +

Re: [PATCH v3][RFC] c-family: Implement __has_feature and __has_extension [PR60512]

2023-08-17 Thread Alex Coplan via Gcc-patches
I'd like to ping this for review from C and C++ maintainers: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626178.html I probably should have dropped the RFC tag this time round as I think the patch is nearly ready, I suppose we just need agreement on the issues below: is there any GCC

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread Guillaume Gomez via Gcc-patches
Hi Dave, > What kind of testing has the patch had? (e.g. did you run "make check- > jit" ? Has this been in use on real Rust code?) I tested it as Rust backend directly on this code: ``` pub fn foo(a: i32, b: i32, c: ) { *a += *c; *b += *c; } ``` I ran it with `rustc` (and the GCC

Re: [PATCH] bpf: fix pseudoc w regs for small modes [PR111029]

2023-08-17 Thread Jose E. Marchesi via Gcc-patches
> On Tue, Aug 15, 2023 at 9:03 PM Jose E. Marchesi via Gcc-patches > wrote: >> >> >> Hello David. >> Thanks for the patch. >> >> OK. > > Picking a random patch/mail for this question - how do we maintain BPF > support for the most recent GCC release which is GCC 13? I see the > current state

Re: [PATCH] bpf: fix pseudoc w regs for small modes [PR111029]

2023-08-17 Thread Richard Biener via Gcc-patches
On Tue, Aug 15, 2023 at 9:03 PM Jose E. Marchesi via Gcc-patches wrote: > > > Hello David. > Thanks for the patch. > > OK. Picking a random patch/mail for this question - how do we maintain BPF support for the most recent GCC release which is GCC 13? I see the current state in GCC 13 isn't

Re: [PATCH] testsuite: Remove unused dg-line in ce8cdf5bcf96a2db6d7b9f656fc9ba58d7942a83

2023-08-17 Thread Richard Biener via Gcc-patches
On Tue, Aug 15, 2023 at 8:36 PM Benjamin Priour via Gcc-patches wrote: > > From: benjamin priour > > Yet another blunder. > > Succesfully regstrapped against ce8cdf5bcf96a2db6d7b9f656fc9ba58d7942a83 > on x86_64-linux-gnu. > > OK to push on trunk ? OK. > Sorry, > Benjamin. > > Fixup below. >

  1   2   >