[PATCH] c++: P2513R4, char8_t Compatibility and Portability Fix [PR106656]

2022-09-23 Thread Marek Polacek via Gcc-patches
P0482R6, which added char8_t, didn't allow const char arr[] = u8"howdy"; because it said "Declarations of arrays of char may currently be initialized with UTF-8 string literals. Under this proposal, such initializations would become ill-formed." This caused too many issues, so P2513R4 alleviat

[committed] libstdc++: Add test for type traits not having friend access

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This ensures that the std::is_assignable and std::is_assignable_v traits are evaluated "in a context unrelated" to the argument types. libstdc++-v3/ChangeLog: * testsuite/20_util/is_assignable/requirements/access.cc: New test.

[committed] libstdc++: Fix std::is_nothrow_invocable_r for uncopyable prvalues [PR91456]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This is the last missing piece of PR 91456. This also removes the only use of the C++11 version of std::is_nothrow_invocable, which was just renamed to __is_nothrow_invocable_lib. We can remove that now. libstdc++-v3/ChangeLog: PR lib

[committed] testsuite: Add more C2x tests

2022-09-23 Thread Joseph Myers
There are some new requirements in C2x where GCC already behaves as required (for all standard versions), where previous standard versions either had weaker requirements permitting the GCC behavior, or were arguably defective in what they said in that area. Add tests that specifically verify GCC b

[r13-2804 Regression] FAIL: gcc.target/i386/avx256-unaligned-store-3.c scan-assembler vmovupd.*movv2df_internal/4 on Linux/x86_64

2022-09-23 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, a282f086ef26d90e9785e992cd09a0d118b24695 is the first bad commit commit a282f086ef26d90e9785e992cd09a0d118b24695 Author: Hu, Lin1 Date: Tue Sep 13 16:28:54 2022 +0800 i386: Optimize code generation of __mm256_zextsi128_si256(__mm_set1_epi8(-1)) caused FAIL: gcc.target/i

[PATCH] Fix profile count comparison.

2022-09-23 Thread Eugene Rozenfeld via Gcc-patches
The comparison was incorrect when the counts weren't PRECISE. For example, crossmodule-indir-call-topn-1.c was failing with AutoFDO: when count_sum is 0 with quality AFDO, count_sum > profile_count::zero() evaluates to true. Taking that branch then leads to an assert in the call to to_sreal(). Tes

[PATCH] Fix typo in chapter level for RISC-V attributes

2022-09-23 Thread Torbjörn SVENSSON via Gcc-patches
The "RISC-V specific attributes" section should be at the same level as "PowerPC-specific attributes". gcc/ChangeLog: * doc/sourcebuild.texi: Fix chapter level. Signed-off-by: Torbjörn SVENSSON --- gcc/doc/sourcebuild.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Making gcc toolchain installs relocatable

2022-09-23 Thread Keith Packard via Gcc-patches
I submitted the referenced patch to extend the 'getenv' .specs function back in August and didn't see any response, so I wanted to provide a bit more context to see if that would help people understand why I wrote this. Here's a link to that message: https://gcc.gnu.org/pipermail/gcc-pat

[PATCH] c++: Don't quote nothrow in diagnostic

2022-09-23 Thread Marek Polacek via Gcc-patches
In Jason noticed that we quote "nothrow" in diagnostics even though it's not a keyword in C++. Just removing the quotes didn't work because then -Wformat-diag complains, so this patch replaces it with "no-throw". Bootstrapped/

Re: [PATCH v2] testsuite: Only run test on target if VMA == LMA

2022-09-23 Thread Torbjorn SVENSSON via Gcc-patches
Hi Richard, Thanks for your review. Comments below. On 2022-09-23 19:34, Richard Sandiford wrote: Torbjörn SVENSSON via Gcc-patches writes: Checking that the triplet matches arm*-*-eabi (or msp430-*-*) is not enough to know if the execution will enter an endless loop, or if it will give a mea

Re: [PATCH v3] RISC-V: remove deprecate pic code model macro

2022-09-23 Thread Vineet Gupta
On 9/2/22 14:05, Vineet Gupta wrote: Came across this deprecated symbol when looking around for -mexplicit-relocs handling in code Signed-off-by: Vineet Gupta No rush but looks like this got lost in the bigger thread about LOAD_ADDRESS_MACRO. Thx, -Vineet --- gcc/config/riscv/riscv-c.c

Re: [PATCH v2] testsuite: Only run test on target if VMA == LMA

2022-09-23 Thread Richard Sandiford via Gcc-patches
Torbjörn SVENSSON via Gcc-patches writes: > Checking that the triplet matches arm*-*-eabi (or msp430-*-*) is not > enough to know if the execution will enter an endless loop, or if it > will give a meaningful result. As the execution test only work when > VMA and LMA are equal, make sure that this

Re: [PATCH v2] testsuite: Skip intrinsics test if arm

2022-09-23 Thread Richard Sandiford via Gcc-patches
Torbjörn SVENSSON via Gcc-patches writes: > In the test cases, it's clearly written that intrinsics is not > implemented on arm*. A simple xfail does not help since there are > link error and that would cause an UNRESOLVED testcase rather than > XFAIL. > By changing to dg-skip-if, the entire test

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Marek Polacek via Gcc-patches
On Fri, Sep 23, 2022 at 05:34:21PM +0100, Jonathan Wakely wrote: > On Fri, 23 Sept 2022 at 15:43, Jonathan Wakely wrote: > > > > On Fri, 23 Sept 2022 at 15:34, Marek Polacek wrote: > > > > > > On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > > > > On 9/22/22 09:39, Marek Polacek wro

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Sept 2022 at 15:43, Jonathan Wakely wrote: > > On Fri, 23 Sept 2022 at 15:34, Marek Polacek wrote: > > > > On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > > > On 9/22/22 09:39, Marek Polacek wrote: > > > > To improve compile times, the C++ library could use compiler buil

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Marek Polacek via Gcc-patches
On Fri, Sep 23, 2022 at 11:54:53AM -0400, Jason Merrill wrote: > On 9/23/22 10:34, Marek Polacek wrote: > > On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > > > On 9/22/22 09:39, Marek Polacek wrote: > > > > To improve compile times, the C++ library could use compiler built-ins > >

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-23 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Tue, 20 Sept 2022 at 18:09, Richard Sandiford > wrote: >> >> Prathamesh Kulkarni writes: >> > On Mon, 12 Sept 2022 at 19:57, Richard Sandiford >> > wrote: >> >> >> >> Prathamesh Kulkarni writes: >> >> >> The VLA encoding encodes the first N patterns explicitly.

Re: [PATCH] RISC-V: make USE_LOAD_ADDRESS_MACRO easier to understand

2022-09-23 Thread Kito Cheng via Gcc-patches
Committed with ChangeLog and minor naming tweaking. > But I'm not sure if the current checking of local symbol can be simplified > a bit. Isn't the first line enough for GET_CODE == const case too ? SYMBOL_REF_P not work for CONST, SYMBOL_REF_P is just checking GET_CODE is SYMBOL_REF, and SYMBOL

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jason Merrill via Gcc-patches
On 9/23/22 10:34, Marek Polacek wrote: On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: On 9/22/22 09:39, Marek Polacek wrote: To improve compile times, the C++ library could use compiler built-ins rather than implementing std::is_convertible (and _nothrow) as class templates. Th

[patch] Fix thinko in powerpc default specs for -mabi

2022-09-23 Thread Olivier Hainque via Gcc-patches
Hello, For a powerpc compiler configured with --with-abi=elfv2, an explicit -mabi option other than elfv1 fails to override the default. For example, after [...]/configure --enable-languages=c --target=powerpc-elf --with-abi=elfv2 make all-gcc This command: ./gcc/xgcc -B./gcc/ t.c -mabi=

Re: [PATCH] RISC-V: Add RVV machine modes.

2022-09-23 Thread Kito Cheng via Gcc-patches
Committed, thanks! On Thu, Sep 15, 2022 at 7:40 PM wrote: > > From: zhongjuzhe > > gcc/ChangeLog: > > * config/riscv/riscv-modes.def (VECTOR_BOOL_MODE): Add RVV mask modes. > (ADJUST_NUNITS): Adjust nunits using riscv_vector_chunks. > (ADJUST_ALIGNMENT): Adjust alignment.

[og12] Come up with {,UN}LIKELY macros (was: [Patch][2/3][v2] nvptx: libgomp+mkoffload.cc: Prepare for reverse offload fn lookup)

2022-09-23 Thread Thomas Schwinge
Hi! Since the 2022-09-12 backport of this: On 2022-08-29T20:43:26+0200, Tobias Burnus wrote: > nvptx: libgomp+mkoffload.cc: Prepare for reverse offload fn lookup ... to og12 in commit 2b6ad53fd76c7bb9605be417d137a7d9a18f2117, the og12 branch didn't build anymore: [...]/gcc/config/nvptx/mko

Re: [PATCH] RISC-V: Suppress riscv-selftests.cc warning.

2022-09-23 Thread Kito Cheng via Gcc-patches
Committed, but squashed changes to "RISC-V: Support poly move manipulation and selftests." instead of a standalone commit. On Sat, Sep 17, 2022 at 9:00 AM wrote: > > From: Ju-Zhe Zhong > > This patch is a fix patch for: > https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601643.html > > S

Re: [PATCH] RISC-V: Support poly move manipulation and selftests.

2022-09-23 Thread Kito Cheng via Gcc-patches
Committed. thanks! On Thu, Sep 15, 2022 at 4:29 PM wrote: > > From: zhongjuzhe > > gcc/ChangeLog: > > * common/config/riscv/riscv-common.cc: Change "static void" to "void". > * config.gcc: Add riscv-selftests.o > * config/riscv/predicates.md: Allow const_poly_int. >

[Patch] OpenACC: Fix reduction tree-sharing issue [PR106982]

2022-09-23 Thread Tobias Burnus
This fixes a tree-sharing ICE. It seems as if all unshare_expr I added were required in this case. The first long testcase is based on the real testcase from the OpenACC testsuite, the second one is what reduction produced - but I thought some nested reduction might be interesting as well; hence,

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Marek Polacek via Gcc-patches
On Fri, Sep 23, 2022 at 03:40:23PM +0100, Jonathan Wakely wrote: > On Thu, 22 Sept 2022 at 23:14, Jason Merrill wrote: > > On 9/22/22 09:39, Marek Polacek wrote: > > > This patch doesn't make libstdc++ use the new built-ins, but I had to > > > rename a class otherwise its name would clash with the

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Sept 2022 at 15:34, Marek Polacek wrote: > > On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > > On 9/22/22 09:39, Marek Polacek wrote: > > > To improve compile times, the C++ library could use compiler built-ins > > > rather than implementing std::is_convertible (and _not

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 22 Sept 2022 at 23:14, Jason Merrill wrote: > On 9/22/22 09:39, Marek Polacek wrote: > > This patch doesn't make libstdc++ use the new built-ins, but I had to > > rename a class otherwise its name would clash with the new built-in. > > Sigh, that's going to be a hassle when comparing compil

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Marek Polacek via Gcc-patches
On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > On 9/22/22 09:39, Marek Polacek wrote: > > To improve compile times, the C++ library could use compiler built-ins > > rather than implementing std::is_convertible (and _nothrow) as class > > templates. This patch adds the built-ins.

Re: [PATCH 2/2]AArch64 Perform more late folding of reg moves and shifts which arrive after expand

2022-09-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > Similar to the 1/2 patch but adds additional back-end specific folding for if > the register sequence was created as a result of RTL optimizations. > > Concretely: > > #include > > unsigned int foor (uint32x4_t x) > { > return x[1] >> 16; > } > > generate

Re: [PATCH] Avoid depending on destructor order

2022-09-23 Thread David Edelsohn via Gcc-patches
On Fri, Sep 23, 2022 at 10:12 AM Thomas Neumann wrote: > > > > +static const bool in_shutdown = false; > > > > I'll let Jason or others decide if this is the right solution. It seems > > that in_shutdown also could be declared outside the #ifdef and > > initialized as "false". > > sure, eith

[committed] libstdc++: Micro-optimizaion for std::bitset stream extraction

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Don't bother trying to copy any characters for bitset<0>. libstdc++-v3/ChangeLog: * include/std/bitset (operator>>): Do not copy for N==0. * testsuite/20_util/bitset/io/input.cc: Add comment. --- libstdc++-v3/include/std/bitset

Re: [PATCH] Avoid depending on destructor order

2022-09-23 Thread Thomas Neumann via Gcc-patches
+static const bool in_shutdown = false; I'll let Jason or others decide if this is the right solution.  It seems that in_shutdown also could be declared outside the #ifdef and initialized as "false". sure, either is fine. Moving it outside the #ifdef wastes one byte in the executable (w

Re: [PATCH] Avoid depending on destructor order

2022-09-23 Thread David Edelsohn via Gcc-patches
On Fri, Sep 23, 2022 at 9:38 AM Thomas Neumann wrote: > > This patch broke bootstrap on AIX and probably other targets. > > > > #ifdef ATOMIC_FDE_FAST_PATH > > #include "unwind-dw2-btree.h" > > > > static struct btree registered_frames; > > static bool in_shutdown; > > ... > > #else > > > > in_sh

Re: [PATCH] Avoid depending on destructor order

2022-09-23 Thread David Edelsohn via Gcc-patches
On Fri, Sep 23, 2022 at 9:38 AM Thomas Neumann wrote: > > This patch broke bootstrap on AIX and probably other targets. > > > > #ifdef ATOMIC_FDE_FAST_PATH > > #include "unwind-dw2-btree.h" > > > > static struct btree registered_frames; > > static bool in_shutdown; > > ... > > #else > > > > in_sh

Re: [PATCH 2/2]AArch64 Add support for neg on v1df

2022-09-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Friday, September 23, 2022 6:04 AM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; Marcus Shawcroft >> ; Kyrylo Tkachov >> Subject: Re: [PATCH 2/2]AArch64 Add support for

[PATCH v2] libgo: Portable access to thread ID in struct sigevent

2022-09-23 Thread soeren--- via Gcc-patches
From: Sören Tempel Tested on x86_64 Arch Linux (glibc) and Alpine Linux (musl libc). Previously, libgo relied on the _sigev_un implementation-specific field in struct sigevent, which is only available on glibc. This patch uses the sigev_notify_thread_id macro instead which is mandated by timer_c

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-09-23 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Gcc-patches bounces+tamar.christina=arm@gcc.gnu.org> On Behalf Of Tamar > Christina via Gcc-patches > Sent: Friday, September 23, 2022 9:14 AM > To: Richard Biener > Cc: Richard Sandiford ; nd ; > Tamar Christina via Gcc-patches ; > juzhe.zh...@rivai.ai >

Re: [PATCH] Avoid depending on destructor order

2022-09-23 Thread Thomas Neumann via Gcc-patches
This patch broke bootstrap on AIX and probably other targets. #ifdef ATOMIC_FDE_FAST_PATH #include "unwind-dw2-btree.h" static struct btree registered_frames; static bool in_shutdown; ... #else in_shutdown only is defined for ATOMIC_FDE_FAST_PATH but used in code / asserts not protected by tha

Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616]

2022-09-23 Thread Patrick Palka via Gcc-patches
On Thu, 22 Sep 2022, Nathan Sidwell wrote: > On 9/22/22 14:25, Patrick Palka wrote: > > > index 80467c19254..722b64793ed 100644 > > --- a/gcc/cp/decl.cc > > +++ b/gcc/cp/decl.cc > > @@ -18235,9 +18235,11 @@ maybe_register_incomplete_var (tree var) > > { > > /* When the outermost open cl

RE: [PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-09-23 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Friday, September 23, 2022 9:10 AM > To: Tamar Christina > Cc: Andrew Pinski ; nd ; gcc- > patc...@gcc.gnu.org > Subject: RE: [PATCH]middle-end simplify complex if expressions where > comparisons are inverse of one another. > > On Fri,

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-09-23 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Friday, September 23, 2022 8:54 AM > To: Tamar Christina > Cc: Richard Sandiford ; Tamar Christina via > Gcc-patches ; nd ; > juzhe.zh...@rivai.ai > Subject: RE: [PATCH]middle-end Add optimized float addsub without > needing VEC_PERM_EXP

RE: [PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-09-23 Thread Richard Biener via Gcc-patches
On Fri, 23 Sep 2022, Tamar Christina wrote: > Hello, > > > where logical_inverted is somewhat contradicting using zero_one_valued > > instead of truth_valued_p (I think the former might not work for vector > > booleans?). > > > > In the end I'd prefer zero_one_valued_p but avoiding inverse_condi

Re: RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-09-23 Thread 钟居哲
So far I didn't see the case that V2DF <-> V4SF in RISC-V. juzhe.zh...@rivai.ai From: Richard Biener Date: 2022-09-23 20:54 To: Tamar Christina CC: Richard Sandiford; Tamar Christina via Gcc-patches; nd; juzhe.zhong Subject: RE: [PATCH]middle-end Add optimized float addsub without needing VE

Re: [PATCH] tree-object-size: Support strndup and strdup

2022-09-23 Thread Jakub Jelinek via Gcc-patches
On Thu, Sep 22, 2022 at 11:26:29AM -0400, Siddhesh Poyarekar wrote: > On 2022-09-22 09:02, Jakub Jelinek wrote: > > On Mon, Aug 15, 2022 at 03:23:11PM -0400, Siddhesh Poyarekar wrote: > > > --- a/gcc/tree-object-size.cc > > > +++ b/gcc/tree-object-size.cc > > > @@ -495,6 +495,18 @@ decl_init_size (

[COMMITTED] frange: Make the setter taking trees a wrapper.

2022-09-23 Thread Aldy Hernandez via Gcc-patches
The frange setter does all its work in trees. This incurs a penalty for the real_value variants because they must wrap their arguments into a tree and pass it to the tree setter, which will then do the opposite. This is leftovers from the irange setter. Even though the we still need constructors

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-09-23 Thread Richard Biener via Gcc-patches
On Fri, 23 Sep 2022, Tamar Christina wrote: > Hi, > > Attached is the respun version of the patch, > > > >> > > >> Wouldn't a target need to re-check if lanes are NaN or denormal if > > >> after a SFmode lane operation a DFmode lane operation follows? IIRC > > >> that is what usually makes punn

Re: [PATCH] MIPS: fix building on multiarch platform

2022-09-23 Thread YunQiang Su via Gcc-patches
Xi Ruoyao via Gcc-patches 于2022年9月21日周三 23:09写道: > > On Wed, 2022-09-21 at 11:31 +, YunQiang Su wrote: > > On platforms that support multiarch, such as Debian, > > the filesystem hierarchy doesn't fellow the old Irix style: > > lib & lib/ for native > > lib64 for N64 on N32/O32

[PATCH] tree-optimization/106922 - extend same-val clobber FRE

2022-09-23 Thread Richard Biener via Gcc-patches
The following extends the skipping of same valued stores to handle an arbitrary number of them as long as they are from the same value (which we now record). That's an obvious extension which allows to optimize the m_engaged member of std::optional more reliably. Bootstrapped on x86_64-unknown-li

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-23 Thread Tobias Burnus
Hi Julian and Jakub, hi all, On 23.09.22 09:29, Julian Brown wrote: How about this version? (Re-tested.) [...] * * * Some more generic (pre)remarks – not affecting the patch code, but possibly the commit log message: This follows OMP 5.0, 2.19.7.1 "map Clause": which is also in "OMP 5.2, 5

[PATCH] testsuite: Verify that module-mapper is avialable

2022-09-23 Thread Torbjörn SVENSSON via Gcc-patches
For some test cases, it's required that the optional module mapper "g++-mapper-server" is built. As the server is not required, the test cases will fail if it can't be found. gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_is_prog_name_available): New. * lib/targ

[committed] libstdc++: Enable constexpr std::bitset for debug mode

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. As I said in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107015 I think we should just get rid of __debug::bitset, it is useless except for C++98, where it's ABI-incompatible with C++11 and later. -- >8 -- We already disable all debug mode checks for C++11

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-23 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 20 Sept 2022 at 18:09, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 12 Sept 2022 at 19:57, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> >> The VLA encoding encodes the first N patterns explicitly. The > >> >> npatterns/nelts_per_patter

[committed] libstdc++: Optimize std::bitset::to_string

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This makes to_string approximately twice as fast at any optimization level. Instead of iterating through every bit, jump straight to the next bit that is set, by using _Find_first and _Find_next. libstdc++-v3/ChangeLog: * include/std/bitset

[PATCH 2/2]AArch64 Perform more late folding of reg moves and shifts which arrive after expand

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, Similar to the 1/2 patch but adds additional back-end specific folding for if the register sequence was created as a result of RTL optimizations. Concretely: #include unsigned int foor (uint32x4_t x) { return x[1] >> 16; } generates: foor: umovw0, v0.h[3] ret

[PATCH 1/2]middle-end Fold BIT_FIELD_REF and Shifts into BIT_FIELD_REFs alone

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, This adds a match.pd rule that can fold right shifts and bit_field_refs of integers into just a bit_field_ref by adjusting the offset and the size of the extract and adds an extend to the previous size. Concretely turns: #include unsigned int foor (uint32x4_t x) { return x[1] >> 16

[PATCH][committed] aarch64: Add Arm Neoverse V2 support

2022-09-23 Thread Kyrylo Tkachov via Gcc-patches
Hi all, This patch adds -mcpu/-mtune support for the Arm Neoverse V2 core. This updates the internal references to "demeter", but leaves "demeter" as an accepted value to -mcpu/-mtune as it appears in the released GCC 12 series. Bootstrapped and tested on aarch64-none-linux-gnu. Pushing to trunk.

[committed] MAINTAINERS: Add myself to Write After Approval

2022-09-23 Thread Paul-Antoine Arras
Hello, I just added myself to the Write After Approval section of MAINTAINERS file. -- PAFrom d10308ff618e036d6c3d1a8c491ca4755b257612 Mon Sep 17 00:00:00 2001 From: Paul-Antoine Arras Date: Fri, 23 Sep 2022 10:21:48 + Subject: [PATCH] MAINTAINERS: Add myself to Write After Approval ChangeL

RE: [PATCH 2/2]AArch64 Add support for neg on v1df

2022-09-23 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Friday, September 23, 2022 6:04 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; Kyrylo Tkachov > Subject: Re: [PATCH 2/2]AArch64 Add support for neg on v1df > > Tamar Christina

Re: [PATCH] testsuite: Sanitize fails for SP FPU on Arm

2022-09-23 Thread Torbjorn SVENSSON via Gcc-patches
Hi Joseph, On 2022-09-23 00:42, Joseph Myers wrote: On Thu, 22 Sep 2022, Torbjörn SVENSSON via Gcc-patches wrote: This patch stops reporting fails for Arm targets with single precision floating point unit for types wider than 32 bits (the width of float on arm-none-eabi). As reported in PR102

Re: [PATCH 2/2]AArch64 Add support for neg on v1df

2022-09-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Friday, September 23, 2022 5:30 AM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; Marcus Shawcroft >> ; Kyrylo Tkachov >> Subject: Re: [PATCH 2/2]AArch64 Add support for

RE: [PATCH 2/2]AArch64 Extend tbz pattern to allow SI to SI extensions.

2022-09-23 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Friday, September 23, 2022 5:43 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; Kyrylo Tkachov > Subject: Re: [PATCH 2/2]AArch64 Extend tbz pattern to allow SI to SI > extensions

RE: [PATCH 2/2]AArch64 Add support for neg on v1df

2022-09-23 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Friday, September 23, 2022 5:30 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; Kyrylo Tkachov > Subject: Re: [PATCH 2/2]AArch64 Add support for neg on v1df > > Tamar Christina

Re: [PATCH 2/2]AArch64 Extend tbz pattern to allow SI to SI extensions.

2022-09-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > This adds additional recognition of & 1 into the tbz/tbnz pattern. > > Concretely with the mid-end changes this changes > > void g1(bool x) > { > if (__builtin_expect (x, 0)) > h (); > } > > from > > tst w0, 255 > bne .L7 > > to >

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-23 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 23, 2022 at 08:29:46AM +0100, Julian Brown wrote: > On Thu, 22 Sep 2022 15:17:08 +0200 > Jakub Jelinek wrote: > > > > + bool built_sym_hash = false; > > > > So, I think usually we don't construct such hash_maps right away, > > but have just pointer to the hash map initialized to N

[PATCH 2/4]AArch64 Add implementation for pow2 bitmask division.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, This adds an implementation for the new optab for unsigned pow2 bitmask for AArch64. The implementation rewrites: x = y / (2 ^ (sizeof (y)/2)-1 into e.g. (for bytes) (x + ((x + 257) >> 8)) >> 8 where it's required that the additions be done in double the precision of x such that

[PATCH 4/4]AArch64 sve2: rewrite pack + NARROWB + NARROWB to NARROWB + NARROWT

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, This adds an RTL pattern for when two NARROWB instructions are being combined with a PACK. The second NARROWB is then transformed into a NARROWT. For the example: void draw_bitmap1(uint8_t* restrict pixel, uint8_t level, int n) { for (int i = 0; i < (n & -16); i+=1) pixel[i] += (p

[PATCH 3/4]AArch64 Add SVE2 implementation for pow2 bitmask division

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, In plenty of image and video processing code it's common to modify pixel values by a widening operation and then scale them back into range by dividing by 255. This patch adds an named function to allow us to emit an optimized sequence when doing an unsigned division that is equivalent to

[PATCH 1/4]middle-end Support not decomposing specific divisions during vectorization.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, In plenty of image and video processing code it's common to modify pixel values by a widening operation and then scale them back into range by dividing by 255. e.g.: x = y / (2 ^ (bitsize (y)/2)-1 This patch adds a new target hook can_special_div_by_const, similar to can_vec_perm whi

Re: [PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure.

2022-09-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > Often times when a check_function_body check fails it can be quite hard to > figure out why as no additional information is provided. > > This changes it so that on failures it prints out the regex expression it's > using and the text it's comparing against to

Re: [PATCH 2/2]AArch64 Add support for neg on v1df

2022-09-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > This adds support for using scalar fneg on the V1DF type. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? Why just this one operation though? Couldn't we extend iterators like GPF_F16 to include V1DF, avoiding the need

[PATCH 2/2]AArch64 Extend tbz pattern to allow SI to SI extensions.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, This adds additional recognition of & 1 into the tbz/tbnz pattern. Concretely with the mid-end changes this changes void g1(bool x) { if (__builtin_expect (x, 0)) h (); } from tst w0, 255 bne .L7 to tbnzw0, #0, .L5 This pattern occurs ~120,0

[PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, This is an RFC to figure out how to deal with targets that don't have native comparisons against QImode values. Booleans, at least in C99 and higher are 0-1 valued. This means that we only really need to test a single bit. However in RTL we no longer have this information available and

[PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, Often times when a check_function_body check fails it can be quite hard to figure out why as no additional information is provided. This changes it so that on failures it prints out the regex expression it's using and the text it's comparing against to the verbose log. This makes it much

[PATCH]middle-end fix floating out of constants in conditionals

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, The following testcase: int zoo1 (int a, int b, int c, int d) { return (a > b ? c : d) & 1; } gets de-optimized by the front-end since somewhere around GCC 4.x due to a fix that was added to fold_binary_op_with_conditional_arg. The folding is supposed to succeed only if we have folde

[PATCH]middle-end Recognize more conditional comparisons idioms.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, GCC currently recognizes some of these for signed but not unsigned types. It also has trouble dealing with casts in between because these are handled by the fold machinery. This moves the pattern detection to match.pd instead. We fold e.g.: uint32_t min1_32u(uint32_t a, uint32_t b, uint

[PATCH 2/2]AArch64 Add support for neg on v1df

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi All, This adds support for using scalar fneg on the V1DF type. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * config/aarch64/aarch64-simd.md (negv1df2): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/simd/

RE: [PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hello, > where logical_inverted is somewhat contradicting using zero_one_valued > instead of truth_valued_p (I think the former might not work for vector > booleans?). > > In the end I'd prefer zero_one_valued_p but avoiding inverse_conditions_p > would be nice. > > Richard. It's not pretty but

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-09-23 Thread Tamar Christina via Gcc-patches
Hi, Attached is the respun version of the patch, > >> > >> Wouldn't a target need to re-check if lanes are NaN or denormal if > >> after a SFmode lane operation a DFmode lane operation follows? IIRC > >> that is what usually makes punning "integer" vectors as FP vectors costly. I don't believe

[PATCH] [testsuite][arm] Fix cmse-15.c expected output

2022-09-23 Thread Torbjörn SVENSSON via Gcc-patches
The cmse-15.c testcase fails at -Os because ICF means that we generate secure3: b secure1 which is OK, but does not match the currently expected secure3: ... bx r[0-3] gcc/testsuite/ChangeLog: * gcc.target/arm/cmse/cmse-15.c: Align with -Os improvements. Co-Au

Re: [PATCH v2 0/9] fortran: clobber fixes [PR41453]

2022-09-23 Thread Mikael Morin
Le 22/09/2022 à 22:42, Harald Anlauf via Fortran a écrit : Hi Mikael, thanks for this impressive series of patches. Am 18.09.22 um 22:15 schrieb Mikael Morin via Fortran: The first patch is a refactoring moving the clobber generation in gfc_conv_procedure_call where it feels more appropriate.

Re: [PATCH] frange: drop endpoints to min/max representable numbers for -ffinite-math-only.

2022-09-23 Thread Richard Biener via Gcc-patches
On Fri, Sep 23, 2022 at 9:21 AM Aldy Hernandez wrote: > > Ughhh, my bad. I had reworked this as soon as Jakub said we couldn't > cache the min/max in TYPE_MIN/MAX_VALUE, but forgot to send it. And > yes...the incessant wrapping was very annoying. It's all fixed. > > Let me know what you think.

Re: [PATCH] tree-optimization/106922 - missed FRE/PRE

2022-09-23 Thread Richard Biener via Gcc-patches
On Fri, 23 Sep 2022, Jakub Jelinek wrote: > On Thu, Sep 22, 2022 at 01:10:08PM +0200, Richard Biener via Gcc-patches > wrote: > > * g++.dg/tree-ssa/pr106922.C: Adjust. > > > --- a/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > > +++ b/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > > @@ -87,5 +87,4 @

Re: [PATCH] tree-optimization/106922 - missed FRE/PRE

2022-09-23 Thread Jakub Jelinek via Gcc-patches
On Thu, Sep 22, 2022 at 01:10:08PM +0200, Richard Biener via Gcc-patches wrote: > * g++.dg/tree-ssa/pr106922.C: Adjust. > --- a/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > +++ b/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > @@ -87,5 +87,4 @@ void testfunctionfoo() { >} > } > > -// { dg-fi

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-23 Thread Julian Brown
On Thu, 22 Sep 2022 15:17:08 +0200 Jakub Jelinek wrote: > > + bool built_sym_hash = false; > > So, I think usually we don't construct such hash_maps right away, > but have just pointer to the hash map initialized to NULL (then you > don't need to built_sym_hash next to it) and you simply new

Re: [PATCH] frange: drop endpoints to min/max representable numbers for -ffinite-math-only.

2022-09-23 Thread Aldy Hernandez via Gcc-patches
Ughhh, my bad. I had reworked this as soon as Jakub said we couldn't cache the min/max in TYPE_MIN/MAX_VALUE, but forgot to send it. And yes...the incessant wrapping was very annoying. It's all fixed. Let me know what you think. Aldy On Fri, Sep 23, 2022 at 9:04 AM Richard Biener wrote: > > O

Re: [PATCH] frange: drop endpoints to min/max representable numbers for -ffinite-math-only.

2022-09-23 Thread Richard Biener via Gcc-patches
On Thu, Sep 22, 2022 at 6:49 PM Aldy Hernandez wrote: > > Similarly to how we drop NANs to UNDEFINED when -ffinite-math-only, I > think we can drop the numbers outside of the min/max representable > numbers to the representable number. > > This means the endpoings to VR_VARYING for -ffinite-math-o

Re: [PATCH] Add debug functions for REAL_VALUE_TYPE.

2022-09-23 Thread Aldy Hernandez via Gcc-patches
On Fri, Sep 23, 2022 at 8:54 AM Richard Biener wrote: > > On Thu, Sep 22, 2022 at 6:48 PM Aldy Hernandez via Gcc-patches > wrote: > > > > We currently have no way of dumping REAL_VALUE_TYPEs when debugging. > > > > Tested on a gdb session examining the real value 10.0: > > > > (gdb) p min > > $9