Re: [PATCH v2] testsuite: Add test for r11-4123

2022-08-22 Thread Richard Biener via Gcc-patches
On Mon, 22 Aug 2022, Marek Polacek wrote: > On Mon, Aug 22, 2022 at 10:16:23AM -0700, Andrew Pinski wrote: > > On Mon, Aug 22, 2022 at 9:58 AM Marek Polacek via Gcc-patches > > wrote: > > > > > > r11-4123 came without a test but I happened upon a nice test case that > > > got fixed by that revisi

Re: [PATCH] Add __m128bf16/__m256bf16/__m512bf16 type for bf16 abi test

2022-08-22 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 22, 2022 at 10:16 AM Haochen Jiang via Gcc-patches wrote: > > Hi all, > > This patch added __m128bf16/__m256bf16/__m512bf16 type in testcases. Ok. > > BRs, > Haochen > > gcc/testsuite/ChangeLog: > > * gcc.target/x86_64/abi/bf16/bf16-helper.h: > Add _m128bf16/m256bf16/_m

RE: [PATCH] Enhance final_value_replacement_loop to handle bitop with an invariant induction.[PR105735]

2022-08-22 Thread Kong, Lingling via Gcc-patches
Hi Richard, could you help to have a look for the patch ? > Hi, > > This patch is for pr105735/pr101991. It will enable below optimization: > { > - long unsigned int bit; > - > - [local count: 32534376]: > - > - [local count: 1041207449]: > - # tmp_10 = PHI > - # bit_12 = PHI > - tmp

Re: [PATCH] x86: Cast stride to __PTRDIFF_TYPE__ in AMX intrinsics

2022-08-22 Thread Hongtao Liu via Gcc-patches
On Tue, Aug 23, 2022 at 1:02 AM H.J. Lu wrote: > > On 64-bit Windows, long is 32 bits and can't be used as stride in memory > operand when base is a pointer which is 64 bits. Cast stride to > __PTRDIFF_TYPE__, instead of long. Ok. > > PR target/106714 > * config/i386/amxtileintrin

[PATCH 2/3] libstdc++: Implement std::pair/tuple/misc enhancements from P2321R2

2022-08-22 Thread Patrick Palka via Gcc-patches
This implements the non- changes from P2321R2, which primarily consist of new converting constructors, assignment operator and swap overloads for std::pair and std::tuple. Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/bits/stl_bvector.h (_B

[PATCH 3/3] libstdc++: Implement ranges::zip_view from P2321R2

2022-08-22 Thread Patrick Palka via Gcc-patches
Tested on 86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__min_fn, min): Move to ... * include/bits/ranges_util.h: ... here in order to avoid including all of ranges_algo.h from . * include/std/ranges (__detai

[PATCH 1/3] libstdc++: Separate construct/convertibility tests for std::tuple

2022-08-22 Thread Patrick Palka via Gcc-patches
P2321R2 adds new conditionally explicit constructors to std::tuple which we'll concisely implement in a subsequent patch using explicit(bool), like in our C++20 std::pair implementation. But before we can do that, this patch first adds members to _TupleConstraints that test for constructibility an

[COMMITTED] PR tree-optimization/106687 - Return the correct relation

2022-08-22 Thread Andrew MacLeod via Gcc-patches
With an input condition of op1 > op2, and evaluating the unsigned expression:     LHS = op1 - op2 range-ops was returning LHS < op1 , which is incorrect as op2 could be zero.  This patch adjusts it to return LHS <= op1. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew

[PATCH] c++: Quash bogus -Wredundant-move warning

2022-08-22 Thread Marek Polacek via Gcc-patches
This patch fixes a pretty stoopid thinko. When I added code to warn about pessimizing std::move in initializations like T t{std::move(T())}; I also added code to unwrap the expression from { }. But when we have return {std::move(t)}; we cannot warn about a redundant std::move because the

[committed] libstdc++: Document linker option for C++23 [PR105678]

2022-08-22 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Needs backporting. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/105678 * doc/xml/manual/using.xml: Document -lstdc++_libbacktrace requirement for using std::stacktrace. Also adjust -frtti and -fexceptions to document non

[committed] libstdc++: Check for overflow in regex back-reference [PR106607]

2022-08-22 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Worth backporting. -- >8 -- Currently we fail to notice integer overflow when parsing a back-reference expression, or when converting the parsed result from long to int. This changes the result to be int, so no conversion is needed, and uses the overflow

[committed] libstdc++: Fix for explicit copy ctors in and [PR106695]

2022-08-22 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Needs backporting. -- >8 -- When I changed std::thread and std::async to avoid unnecessary move construction of temporaries, I introduced a regression where types with an explicit copy constructor could not be passed to std::thread or std::async. The fix

Re: [PATCH] c++: Extend -Wpessimizing-move to other contexts

2022-08-22 Thread Marek Polacek via Gcc-patches
On Mon, Aug 22, 2022 at 01:48:34PM +0200, Stephan Bergmann wrote: > On 16/08/2022 14:27, Marek Polacek via Gcc-patches wrote: > > Ping. (The other std::move patches depend on this one.) > > > "c++: Extend -Wp

Re: [PATCH 10/10] [RISCV] Fix PR 106632 and PR 106588 a few constraints in bitmanip.md

2022-08-22 Thread Palmer Dabbelt
On Thu, 18 Aug 2022 15:03:53 PDT (-0700), gcc-patches@gcc.gnu.org wrote: From: Andrew Pinski The constraints should be n instead of i. Also there needs to a check for out of bounds zero_extract for *bexti. gcc/ChangeLog: PR target/106632 PR target/106588 * config/riscv

Re: [PATCH 00/10] [RISCV] Fix/improve the RISCV backend

2022-08-22 Thread Palmer Dabbelt
On Thu, 18 Aug 2022 15:03:43 PDT (-0700), gcc-patches@gcc.gnu.org wrote: From: Andrew Pinski This set of patches fixes a few RISCV issues and does a few cleanups. Including moving all of the iterators to iterators.md like many newer backends. It also fixes a few PRs which I filed including the

[committed] pru: Add mov variants to load const -1

2022-08-22 Thread Dimitar Dimitrov
Use the FILL instruction to efficiently load -1 constants. Regression tested on pru-unknown-elf, committed to mainline. gcc/ChangeLog: * config/pru/pru.md (prumov, mov): Add variants for loading -1 consts. gcc/testsuite/ChangeLog: * gcc.target/pru/mov-m1.c: New test. S

[committed] PR target/106564: pru: Optimize 64-bit sign- and zero-extend

2022-08-22 Thread Dimitar Dimitrov
Add new patterns to optimize 64-bit sign- and zero-extend operations for the PRU target. The new 64-bit zero-extend patterns are straightforward define_insns. The old 16/32-bit sign-extend pattern has been rewritten from scratch in order to add 64-bit support. The new pattern expands into severa

[committed] pru: Optimize 64-bit logical operations

2022-08-22 Thread Dimitar Dimitrov
The earlyclobber in the pattern yields inefficient code due to unnecessarily generated moves. Optimize by removing the earlyclobber for two special alternatives: - If OP2 is a small constant integer. - If the logical bit operation has only two operands. Regression tested on pru-unknown-elf, c

[PATCH] gcov: fix file and function summary information

2022-08-22 Thread Martin Liška
Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Jorgen: Can you please test it before I'll install it? Thanks, Martin gcc/ChangeLog: * gcov.cc (add_line_counts): Add group functions to coverage summary. (accumulate_line_counts): Similarly for files

[Patch] add more C++ name hints. v2

2022-08-22 Thread Ulrich Drepper via Gcc-patches
This is the second version of the proposed patch to add more identifiers to the known list to give hints about #include and version numbers. Marek looked through the first version and found it acceptable but remarked that the list is getting long and the sequential search performed by the current

[PATCH] libstdc++: Optimize operator+(string/char*, string/char*) equally

2022-08-22 Thread whh8b
From: Will Hawkins Until now operator+(char*, string) and operator+(string, char*) had different performance characteristics. The former required a single memory allocation and the latter required two. This patch makes the performance equal. libstdc++-v3/ChangeLog: * libstdc++-v3/include

[PATCH] libstdc++: Optimize operator+(string/char*, string/char*) equally

2022-08-22 Thread whh8b
After consultation with Jonathan, we realized that there was a missed optimization opportunity in the implementation of the various forms of operator+ for string. operator+(char *, string) required a single allocation but operator+(string, char*) required two. This patch attempts to change that a

[PATCH v2] testsuite: Add test for r11-4123

2022-08-22 Thread Marek Polacek via Gcc-patches
On Mon, Aug 22, 2022 at 10:16:23AM -0700, Andrew Pinski wrote: > On Mon, Aug 22, 2022 at 9:58 AM Marek Polacek via Gcc-patches > wrote: > > > > r11-4123 came without a test but I happened upon a nice test case that > > got fixed by that revision. So I think it'd be good to add it. The > > ICE wa

Re: Ping [PATCH V2] libcpp: Optimize #pragma once with a hash table [PR58770]

2022-08-22 Thread Paul Hollinsky via Gcc-patches
On Sun, Aug 21, 2022 at 08:40:26PM +0100, David Malcolm wrote: > On Fri, 2022-08-19 at 13:27 -0700, Paul Hollinsky wrote: > > Hi all, > > > > Would love some feedback on this patch! > > > > Thanks, > > Paul > > Hi Paul. Sorry for not getting back to you before. I'm listed as a > libcpp maintain

Re: Ping [PATCH V2] libcpp: Optimize #pragma once with a hash table [PR58770]

2022-08-22 Thread Paul Hollinsky via Gcc-patches
On Mon, Aug 22, 2022 at 09:19:29AM -0400, Nathan Sidwell wrote: > On 8/19/22 16:27, Paul Hollinsky wrote: > > Hi all, > > > > Would love some feedback on this patch! > > > > Thanks, > > Paul > > > > On Mon, Aug 01, 2022 at 05:18:40AM +, Paul Hollinsky wrote: > > > Rather than traversing the

Re: [PATCH] testsuite: Add test for r11-4123

2022-08-22 Thread Andrew Pinski via Gcc-patches
On Mon, Aug 22, 2022 at 9:58 AM Marek Polacek via Gcc-patches wrote: > > r11-4123 came without a test but I happened upon a nice test case that > got fixed by that revision. So I think it'd be good to add it. The > ICE was: > > phi-1.C: In constructor 'ElementManager::ElementManager()': > phi-1.

[PATCH] x86: Cast stride to __PTRDIFF_TYPE__ in AMX intrinsics

2022-08-22 Thread H.J. Lu via Gcc-patches
On 64-bit Windows, long is 32 bits and can't be used as stride in memory operand when base is a pointer which is 64 bits. Cast stride to __PTRDIFF_TYPE__, instead of long. PR target/106714 * config/i386/amxtileintrin.h (_tile_loadd_internal): Cast to __PTRDIFF_TYPE__.

[PATCH] testsuite: Add test for r11-4123

2022-08-22 Thread Marek Polacek via Gcc-patches
r11-4123 came without a test but I happened upon a nice test case that got fixed by that revision. So I think it'd be good to add it. The ICE was: phi-1.C: In constructor 'ElementManager::ElementManager()': phi-1.C:28:1: error: missing definition 28 | ElementManager::ElementManager() : array_

[PATCH] c++: Predefine __cpp_named_character_escapes=202207L for C++23 [PR106648]

2022-08-22 Thread Jakub Jelinek via Gcc-patches
On Sun, Aug 21, 2022 at 08:18:02PM +0200, Jakub Jelinek via Gcc-patches wrote: > Resending with the generated uname2c.h part of patch split into > compressed attachment, as it was too large for gcc-patches. Unfortunately seems I forgot about the feature test macro for this, here is an incremental

Re: [PATCH] OpenMP, libgomp: Environment variable syntax extension.

2022-08-22 Thread Jakub Jelinek via Gcc-patches
On Tue, Aug 02, 2022 at 09:52:02AM +0200, Marcel Vollweiler wrote: > libgomp/ChangeLog: > > * config/gcn/icv-device.c (omp_get_default_device): Return device- > specific ICV. > (omp_get_max_teams): Added for GCN devices. > (omp_set_num_teams): Likewise. > (ialias): Li

Re: [PATCH] s390: Recognize reverse/element swap permute patterns.

2022-08-22 Thread Andreas Krebbel via Gcc-patches
On 8/22/22 17:10, Robin Dapp wrote: > Hi, > > after discussing off-list, here is v2 of the patch. We now recognize if > the permutation mask only refers to the first or the second operand and > use this later when emitting vpdi. > > Regtested and bootstrapped, no regressions. > > Is it OK? > >

Re: [PATCH] s390: Recognize reverse/element swap permute patterns.

2022-08-22 Thread Robin Dapp via Gcc-patches
Hi, after discussing off-list, here is v2 of the patch. We now recognize if the permutation mask only refers to the first or the second operand and use this later when emitting vpdi. Regtested and bootstrapped, no regressions. Is it OK? Regards Robin >From 1f11a6b89c9b0ad64b480229cd4db06eaaa

Re: [PATCH] jobserver: detect properly O_NONBLOCK

2022-08-22 Thread Richard Biener via Gcc-patches
On Mon, Aug 22, 2022 at 11:06 AM Martin Liška wrote: > > On 8/19/22 09:44, Richard Biener wrote: > > libstdc++ uses > > > > # For Networking TS. > > AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h sys/uio.h poll.h > > netdb.h arpa/inet.h netinet/in.h netinet/tcp.h]) > > AC_CHECK_DECL(F_GETFL,,,

[PATCH] Refactor is_non_loop_exit_postdominating

2022-08-22 Thread Richard Biener via Gcc-patches
That's a weird function in predicate analysis that currently looks like /* Return true if BB1 is postdominating BB2 and BB1 is not a loop exit bb. The loop exit bb check is simple and does not cover all cases. */ static bool is_non_loop_exit_postdominating (basic_block bb1, basic_block bb2) {

[PATCH] Remove dead predicate analysis GENERIC expr building code

2022-08-22 Thread Richard Biener via Gcc-patches
The following removes the unused def_expr, use_expr and expr APIs from the predicate class including the unconditional build of the GENERIC use_expr on each uninit analysis run. Bootstrap & regtest running on x86_64-unknown-linux-gnu. * gimple-predicate-analysis.h (predicate::m_use_expr):

Re: Ping [PATCH V2] libcpp: Optimize #pragma once with a hash table [PR58770]

2022-08-22 Thread Nathan Sidwell via Gcc-patches
On 8/19/22 16:27, Paul Hollinsky wrote: Hi all, Would love some feedback on this patch! Thanks, Paul On Mon, Aug 01, 2022 at 05:18:40AM +, Paul Hollinsky wrote: Rather than traversing the all_files linked list for every include, this factors out the quick idempotency checks (modification

Re: [PATCH] c++: Extend -Wpessimizing-move to other contexts

2022-08-22 Thread Stephan Bergmann via Gcc-patches
On 16/08/2022 14:27, Marek Polacek via Gcc-patches wrote: Ping. (The other std::move patches depend on this one.) "c++: Extend -Wpessimizing-move to other contexts" started to cause false positive $ c

[PATCH] preprocessor: Implement C++23 P2437R1 - Support for #warning [PR106646]

2022-08-22 Thread Jakub Jelinek via Gcc-patches
Hi! On Thu, Aug 18, 2022 at 11:02:44PM +, Joseph Myers wrote: > ISO C2x standardizes the existing #warning extension. Arrange > accordingly for it not to be diagnosed with -std=c2x -pedantic, but to > be diagnosed with -Wc11-c2x-compat. And here is the corresponding C++ version. Don't pedwar

Re: [PATCH] Fortran: fix simplification of intrinsics IBCLR and IBSET [PR106557]

2022-08-22 Thread Mikael Morin
Le 20/08/2022 à 21:11, Harald Anlauf via Fortran a écrit : Dear all, the simplification of the TRANSFER intrinsic produces a redundant representation of the result, one in expr->value and another in expr->representation.string. This is done to ensure a safe "round-trip" for nested TRANSFER. In

Re: [committed] Fix more problems with new linker warnings

2022-08-22 Thread Martin Liška
On 4/28/22 18:10, Jeff Law via Gcc-patches wrote: > As I mentioned in the original thread, my change to pr94157_0 was an attempt > to avoid these warnings by passing a magic flag to the linker.  Of course we > may not be using GNU ld.  Or we may be on a non-elf target where the flag I > used doe

Re: [PATCH][DOCS] Document make jobserver related changes for GCC 13.

2022-08-22 Thread Martin Liška
On 8/18/22 22:53, Gerald Pfeifer wrote: > On Thu, 18 Aug 2022, Martin Liška wrote: >> Ready for master? > > Nearly. :) > >> +Link-time optimization improvements: >> + >> +LTO supports the newly added GNU make's jobserver that uses >> named pipes (--jobserver-style=fifo) > > I be

Re: [PATCH] middle-end: Fix issue of poly_uint16 (1, 1) in self test

2022-08-22 Thread Richard Sandiford via Gcc-patches
juzhe.zh...@rivai.ai writes: > From: zhongjuzhe > > This patch fix issue of poly_uint16 (1, 1) in machine mode self test. > > gcc/ChangeLog: > > * simplify-rtx.cc (test_vector_subregs_fore_back): Make first value > and repeat value different. Thanks, pushed. Richard > > --- > gcc/simp

Re: [PATCH 0/3] [RISCV] Improve bswap for ZBB

2022-08-22 Thread Kito Cheng via Gcc-patches
Hi Andrew: LGTM, Just checked what's clang gen, and saw LLVM already did the same optimization, thanks for improving the code gen! On Sun, Aug 21, 2022 at 1:15 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > Just some improvements for bswap and ZBB including a testsuite change

Re: Re: [PATCH] middle-end: skipp stepped vector test of poly_int (1, 1) and allow the machine_mode definition with poly_uint16 (1, 1)

2022-08-22 Thread juzhe.zh...@rivai.ai
I sent another patch called "Fix issue of poly_uint16 (1,1) in self test" to fix it. I didn't send V2 following this patch because this patch name is misleading. Thank you so much. Richard. juzhe.zh...@rivai.ai From: Richard Sandiford Date: 2022-08-22 16:56 To: juzhe.zhong\@rivai.ai CC: gcc-

[PATCH] middle-end: Fix issue of poly_uint16 (1, 1) in self test

2022-08-22 Thread juzhe . zhong
From: zhongjuzhe This patch fix issue of poly_uint16 (1, 1) in machine mode self test. gcc/ChangeLog: * simplify-rtx.cc (test_vector_subregs_fore_back): Make first value and repeat value different. --- gcc/simplify-rtx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: [PATCH 10/10] [RISCV] Fix PR 106632 and PR 106588 a few constraints in bitmanip.md

2022-08-22 Thread Kito Cheng via Gcc-patches
On Fri, Aug 19, 2022 at 6:08 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > The constraints should be n instead of i. Also there > needs to a check for out of bounds zero_extract for > *bexti. > > gcc/ChangeLog: > > PR target/106632 > PR target/106588 > *

Re: [PATCH] jobserver: detect properly O_NONBLOCK

2022-08-22 Thread Martin Liška
On 8/19/22 09:44, Richard Biener wrote: > libstdc++ uses > > # For Networking TS. > AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h sys/uio.h poll.h > netdb.h arpa/inet.h netinet/in.h netinet/tcp.h]) > AC_CHECK_DECL(F_GETFL,,,[#include ]) > AC_CHECK_DECL(F_SETFL,,,[#include ]) > if test "$ac_cv

Re: [PATCH] middle-end: skipp stepped vector test of poly_int (1, 1) and allow the machine_mode definition with poly_uint16 (1, 1)

2022-08-22 Thread Richard Sandiford via Gcc-patches
"juzhe.zh...@rivai.ai" writes: > Thanks for your reply. Your suggestion "-1 - (int) i" is better. > > Can I send another patch that changes "builder.quick_push (gen_int_mode > (-(int) i, int_mode));" > into “builder.quick_push (gen_int_mode (-1 - (int) i, int_mode));" then you > merge it for me?

Re: [PATCH 06/10] [RISCV] Use constraints/predicates instead of checking const_int directly for shNadd patterns

2022-08-22 Thread Kito Cheng via Gcc-patches
I know using more precise constraints might result in better code gen in some situations, but I am Curious what's the difference between the using pattern condition and constraints/predicates in this case? Is there any performance or code gen difference? On Fri, Aug 19, 2022 at 6:07 AM apinski---

Re: Re: [PATCH] middle-end: skipp stepped vector test of poly_int (1, 1) and allow the machine_mode definition with poly_uint16 (1, 1)

2022-08-22 Thread juzhe.zh...@rivai.ai
Thanks for your reply. Your suggestion "-1 - (int) i" is better. Can I send another patch that changes "builder.quick_push (gen_int_mode (-(int) i, int_mode));" into “builder.quick_push (gen_int_mode (-1 - (int) i, int_mode));" then you merge it for me? Or you change it yourself? Thank you so

Re: [PATCH] middle-end: skipp stepped vector test of poly_int (1, 1) and allow the machine_mode definition with poly_uint16 (1, 1)

2022-08-22 Thread Richard Sandiford via Gcc-patches
钟居哲 writes: > After deep analysis and several tries. I have made a analysis and conclusion > as follows. > I really appreciate if you could spend some time take a look at the following > analysis that I made: > > According to the codes in test_vector_subregs_fore_back: > > ~~~ > poly_uint64 nun

[PATCH] analyzer: buffer overlap checker [PR105898]

2022-08-22 Thread Tim Lange
Hi, below is the patch for the buffer overlap checker in the analyzer. It contains a working buffer overlap warning as well as most of the code needed to also warn on the general case aka when arguments alias with an argument passed to restrict-qualified parameter. The current C standard draft st

Re: [Patch] lto-wrapper.cc: Delete offload_names temp files in case of error [PR106686]

2022-08-22 Thread Richard Biener via Gcc-patches
On Fri, Aug 19, 2022 at 6:54 PM Tobias Burnus wrote: > > I saw that files such as /tmp/ccxFKYeS.target.o kept accumulating. Not a high > number, > but still several. > > I turned out that when compiling an offloading program successfully, they > were removed. > But when it failed, those remained