Re: [PATCH v9 2/5] Convert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.

2024-05-28 Thread Richard Biener
On Tue, May 28, 2024 at 11:09 PM Qing Zhao wrote: > > Thank you for the comments. See my answers below: > > Joseph, please see the last question, I need your help on it. Thanks a lot > for the help. > > Qing > > > On May 28, 2024, at 03:38, Richard Biener > > wrote: > > > > On Fri, Apr 12, 2024

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Jakub Jelinek
On Wed, May 29, 2024 at 08:49:01AM +0200, Tobias Burnus wrote: > Jakub Jelinek wrote: > > I mean, if we want to add something, maybe better would an -include like > > option that instead of including a file includes it directly. > > gcc --include-inline '#pragma omp requires unified_shared_memory'

Re: [PATCH v3 #1/2] [rs6000] adjust return_pc debug attrs

2024-05-28 Thread Alexandre Oliva
On May 27, 2024, "Kewen.Lin" wrote: > I wonder if it's possible to have a test case for this? gcc.dg/guality/pr54519-[34].c at -O[1g] are fixed by this patch on ppc64le-linux-gnu. Are these the sort of test case you're interested in, or are you looking for something that tests the offsets in de

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Jakub Jelinek
On Wed, May 29, 2024 at 08:41:04AM +0200, Tobias Burnus wrote: > Jakub Jelinek wrote: > > How is that option different from > > echo '#pragma omp requires unified_shared_memory' > omp-usm.h > > gcc -include omp-usm.h > > ? > > I mean with -include you can add anything you want, not just one particu

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Tobias Burnus
Jakub Jelinek wrote: I mean, if we want to add something, maybe better would an -include like option that instead of including a file includes it directly. gcc --include-inline '#pragma omp requires unified_shared_memory' ... Likewise for Fortran, but there the question is whether it should be

Re: [Patch, PR Fortran/90069] Polymorphic Return Type Memory Leak Without Intermediate Variable

2024-05-28 Thread Richard Biener
On Tue, May 28, 2024 at 9:46 PM Harald Anlauf wrote: > > Hi Andre, > > On 5/28/24 14:10, Andre Vehreschild wrote: > > Hi all, > > > > the attached patch fixes a memory leak with unlimited polymorphic return > > types. > > The leak occurred, because an expression with side-effects was evaluated >

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Tobias Burnus
Jakub Jelinek wrote: How is that option different from echo '#pragma omp requires unified_shared_memory' > omp-usm.h gcc -include omp-usm.h ? I mean with -include you can add anything you want, not just one particular directive, and adding a separate option for each is just weird. For C/C++, -i

Ping^2: [PATCH 0/2] Fix two test failures with --enable-default-pie [PR70150]

2024-05-28 Thread Xi Ruoyao
Ping again. On Mon, 2024-05-06 at 12:45 +0800, Xi Ruoyao wrote: > In GCC 14.1-rc1, there are two new (comparing to GCC 13) failures if > the build is configured --enable-default-pie.  Let's fix them. > > Tested on x86_64-linux-gnu.  Ok for trunk and releases/gcc-14? > > Xi Ruoyao (2): >   i386:

[PATCHv5] Optab: add isfinite_optab for __builtin_isfinite

2024-05-28 Thread HAO CHEN GUI
Hi, This patch adds an optab for __builtin_isfinite. The finite check can be implemented on rs6000 by a single instruction. It needs an optab to be expanded to the certain sequence of instructions. The subsequent patches will implement the expand on rs6000. Compared to previous version, the

Re: [PATCH v2] add explicit ABI and align options to pr88233.c

2024-05-28 Thread Alexandre Oliva
On May 26, 2024, "Kewen.Lin" wrote: > Hi, > on 2024/4/22 17:38, Alexandre Oliva wrote: >> Ping? >> https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566530.html >> (modified version follows) > Segher originated this test case, I was expecting he can chime in this. :) Me too ;-) >> We've obs

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Jakub Jelinek
On Wed, May 29, 2024 at 08:26:04AM +0200, Jakub Jelinek wrote: > > *I am especially thinking about a global variable and "#pragma omp declare > > target". At least with 'omp requires self_maps' of OpenMP 6, it seems as if > > 'declare target enter(global_var)' should become 'link(global_var)' where

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Jakub Jelinek
On Tue, May 28, 2024 at 09:23:41PM +0200, Tobias Burnus wrote: > -fopenmp-force-usm can be useful for some badly written code. Explicity > using 'omp requires' makes more sense but still. It might also make sense > for testing purpose. > > Unfortunately, I did not see a simple way of testing it. W

Re: [patch] libgomp: Enable USM for some nvptx devices

2024-05-28 Thread Tobias Burnus
Tobias Burnus wrote: While most of the nvptx systems I have access to don't have the support for CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, one has: Actually, CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS is sufficient. And I finally also found the proper webpage for this

Re: [PATCH-1, rs6000] Add a new type of CC mode - CCBCD for bcd insns [PR100736, PR114732]

2024-05-28 Thread Kewen.Lin
Hi, on 2024/4/30 15:18, HAO CHEN GUI wrote: > Hi, > It's the first patch of a series of patches optimizing CC modes on > rs6000. > > bcd insns set all four bits of a CR field. But it has different single > bit reverse behavior than CCFP's. The forth bit of bcd cr fields is used > to indict ov

[PATCH v3 6/8] [APX NF] Support APX NF for shld/shrd

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (x86_64_shld_nf): New define_insn. (x86_64_shld_ndd_nf): Ditto. (x86_64_shld_1_nf): Ditto. (x86_64_shld_ndd_1_nf): Ditto. (*x86_64_shld_shrd_1_nozext_nf): Ditto. (x86_shld_nf): Ditto. (x86_shld_ndd_nf): Di

[PATCH v3 7/8] [APX NF] Support APX NF for mul/div

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (*mul3_1_nf): New define_insn. (*mulqi3_1_nf): Ditto. (*divmod4_noext_nf): Ditto. (divmodhiqi3_nf): Ditto. --- gcc/config/i386/i386.md | 47 ++--- 1 file changed, 30 insertions(+), 17 deletion

[PATCH v3 4/8] [APX NF] Support APX NF for right shift insns

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (*ashr3_1_nf): New. (*lshr3_1_nf): Ditto. (*lshrqi3_1_nf): Ditto. (*lshrhi3_1_nf): Ditto. --- gcc/config/i386/i386.md | 82 +++-- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git

[PATCH v3 8/8] [APX NF] Support APX NF for lzcnt/tzcnt/popcnt

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (clz2_lzcnt_nf): New define_insn. (*clz2_lzcnt_falsedep_nf): Ditto. (__nf): Ditto. (*__falsedep_nf): Ditto. (_hi_nf): Ditto. (popcount2_nf): Ditto. (*popcount2_falsedep_nf): Ditto. (popcounthi2_nf)

[PATCH v3 5/8] [APX NF] Support APX NF for rotate insns

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (ashr3_cvt_nf): New define_insn. (*3_1_nf): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/apx-nf.c: Add NF test for rotate insns. --- gcc/config/i386/i386.md| 59 +- gcc/testsuite/gcc.target

[PATCH v3 2/8] [APX NF] Support APX NF for {sub/and/or/xor/neg}

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (nf_nonf_attr): New subst_attr. (nf_nonf_x64_attr): Ditto. (*sub_1_nf): New define_insn. (*anddi_1_nf): Ditto. (*and_1_nf): Ditto. (*qi_1_nf): Ditto. (*_1_nf): Ditto. (*neg_1_nf): Ditto. *

[PATCH v3 3/8] [APX NF] Support APX NF for left shift insns

2024-05-28 Thread Kong, Lingling
gcc/ChangeLog: * config/i386/i386.md (*ashl3_1_nf): New. (*ashlhi3_1_nf): Ditto. (*ashlqi3_1_nf): Ditto. * config/i386/sse.md: New define_split. --- gcc/config/i386/i386.md | 96 ++--- gcc/config/i386/sse.md | 13 ++ 2 files

[PATCH v3 1/8] [APX NF]: Support APX NF add

2024-05-28 Thread Kong, Lingling
Hi, compared with v2, these patches restored the original lea patten position and addressed hongtao's comment. APX NF(no flags) feature implements suppresses the update of status flags for arithmetic operations. For NF add, it is not clear whether nf add can be faster than lea. If so, the patte

[PATCH] Implement -fassume-sane-operator-new [PR110137]

2024-05-28 Thread user202729
This patch implements the flag -fassume-sane-operator-new as suggested in PR110137. When the flag is enabled, it is assumed that operator new does not modify global memory. While this patch is not powerful enough to handle the original issue in PR110035, it allows the optimizer to handle some s

RE: [PATCH 0/2] Align tight loops to solve cross cacheline issue

2024-05-28 Thread Jiang, Haochen
> > > > Bootstrapped and regtested on x86_64-pc-linux-gnu. > Ok for this if there's no objection in 48 hours. > > > > > > > > After we committed into trunk for a month, if there isn't any > > > > unexpected happen. We planned to backport it to GCC14.2. I accidentally backported it to GCC14.2 for n

[PATCH] ASAN: call initialize_sanitizer_builtins for hwasan [PR115205]

2024-05-28 Thread Andrew Pinski
Sometimes initialize_sanitizer_builtins is not called before emitting the asan builtins with hwasan. In the case of the bug report, there was a path with the fortran front-end where it was not called. So let's call it in asan_instrument before calling transform_statements. Built and tested for aar

Re: [RFC/PATCH] Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook

2024-05-28 Thread Kewen.Lin
Hi Richi and Joseph, on 2024/5/24 20:23, Richard Biener wrote: > On Fri, May 24, 2024 at 12:20 PM Kewen.Lin wrote: >> btw, the attached patch is bootstrapped and regtested on >> powerpc64-linux-gnu and powerpc64le-linux-gnu with all >> languages on, cross cc1 built well for affected ports. > > L

[PATCH] [x86] Support vcond_mask_qiqi and friends.

2024-05-28 Thread liuhongt
Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: * config/i386/sse.md (vcond_mask_): New expander. gcc/testsuite/ChangeLog: * gcc.target/i386/pr114125.c: New test. --- gcc/config/i386/sse.md | 20

[to-be-committed] [RISC-V] Use pack to handle repeating constants

2024-05-28 Thread Jeff Law
This patch utilizes zbkb to improve the code we generate for 64bit constants when the high half is a duplicate of the low half. Basically we generate the low half and use a pack instruction with that same register repeated. ie pack dest,src,src That gives us a maximum sequence of 3 instruct

[PATCH] Add AVX10.1 target_clones support

2024-05-28 Thread Haochen Jiang
Hi all, Since AVX10 is the first major ISA introduced after AVX-512, we propose to add target_clones support for it. Although AVX10.1-256 won't cover 512-bit part of AVX512F, but since it is only for priority but not for implication, it won't be an issue. Bootstrapped and regtested on x86_64-pc-

[COMMITTED] Gori_on_edge tweaks.

2024-05-28 Thread Andrew MacLeod
FAST_VRP uses a non-ranger gori_on_edge routine to calculate the full set of SSA ranges that can be calculated on an edge.  It allows an optional  outgoing_edge_range object if one wanted to use switches.  This is now integrated with the gori () method of a range_query, and is no longer neede

Re: [PATCH v2 1/2] driver: Use -as/ld/objcopy as final fallback instead of native ones for cross

2024-05-28 Thread YunQiang Su
Richard Sandiford 于2024年5月29日周三 05:28写道: > > YunQiang Su writes: > > If `find_a_program` cannot find `as/ld/objcopy` and we are a cross > > toolchain, > > the final fallback is `as/ld` of system. In fact, we can have a try with > > -as/ld/objcopy before fallback to native as/ld/objcopy. > > > >

Re: [PATCHv3] Optab: add isfinite_optab for __builtin_isfinite

2024-05-28 Thread Kewen.Lin
on 2024/5/28 20:09, Richard Biener wrote: > On Tue, May 28, 2024 at 9:09 AM Kewen.Lin wrote: >> >> Hi, >> >> on 2024/5/27 20:54, Richard Biener wrote: >>> On Mon, May 27, 2024 at 11:37 AM HAO CHEN GUI wrote: Hi, This patch adds an optab for __builtin_isfinite. The finite check ca

Re: [PATCH v4] RISC-V: Introduce -mvector-strict-align.

2024-05-28 Thread Kito Cheng
I just created two PRs for adding those new options into riscv-toolchain-conventions, so that we could make sure it aligned with clang/LLVM community. https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/49 https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/50 On Wed,

Re: ping: [PATCH] libcpp: Support extended characters for #pragma {push,pop}_macro [PR109704]

2024-05-28 Thread Lewis Hyatt
Hello- May I please ping this one (now for GCC 15)? Thanks! https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642926.html -Lewis On Sat, Feb 10, 2024 at 9:02 AM Lewis Hyatt wrote: > > Hello- > > https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642926.html > > May I please ping this o

[PATCH v2 1/2] RISC-V: add option -m(no-)autovec-segment

2024-05-28 Thread Patrick O'Neill
From: Greg McGary Add option -m(no-)autovec-segment to enable/disable autovectorizer from emitting vector segment load/store instructions. This is useful for performance experiments. gcc/ChangeLog: * config/riscv/autovec.md (vec_mask_len_load_lanes, vec_mask_len_store_lanes):

[PATCH v2 2/2] Prevent divide-by-zero

2024-05-28 Thread Patrick O'Neill
From: Greg McGary gcc/ChangeLog: * gcc/tree-vect-stmts.cc (gcc/tree-vect-stmts.cc): Prevent divide-by-zero. * testsuite/gcc.target/riscv/rvv/autovec/no-segment.c: Remove xfail. --- gcc/testsuite/gcc.target/riscv/rvv/autovec/no-segment.c | 1 - gcc/tree-vect-stmts.cc

[PATCH v2 0/2] RISC-V: add option -m(no-)autovec-segment

2024-05-28 Thread Patrick O'Neill
Rebased to squash Edwin's fixup into Greg's patch. Split out the middle-end change and xfailed the associated testcase so the second patch can land seperately. Relying on pre-commit CI for full testing. Greg McGary (2): RISC-V: add option -m(no-)autovec-segment Prevent divide-by-zero gcc/co

[patch] libgomp: Enable USM for some nvptx devices

2024-05-28 Thread Tobias Burnus
While most of the nvptx systems I have access to don't have the support for CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, one has: Tesla V100-SXM2-16GB (as installed, e.g., on ORNL's Summit) does support this feature. And with that feature, unified-shared memory support doe

Re: [PATCHv3] Optab: add isfinite_optab for __builtin_isfinite

2024-05-28 Thread Segher Boessenkool
Hi! On Mon, May 27, 2024 at 05:37:23PM +0800, HAO CHEN GUI wrote: > --- a/gcc/builtins.cc > +++ b/gcc/builtins.cc > @@ -2459,8 +2459,9 @@ interclass_mathfn_icode (tree arg, tree fndecl) >errno_set = true; builtin_optab = ilogb_optab; break; > CASE_FLT_FN (BUILT_IN_ISINF): >bui

Re: [PATCHv3] Optab: add isfinite_optab for __builtin_isfinite

2024-05-28 Thread Segher Boessenkool
On Tue, May 28, 2024 at 02:09:50PM +0200, Richard Biener wrote: > On Tue, May 28, 2024 at 9:09 AM Kewen.Lin wrote: > > As Haochen's previous reply, I think there are three cases: > > 1) no optab defined, fold in a generic way; > > 2) optab defined, SUCC, expand as what it defines; > > 3) opt

Re: [PATCH 2/2] RISC-V: Fix testcases renamed test flag options

2024-05-28 Thread Vineet Gupta
On 5/28/24 14:55, Patrick O'Neill wrote: > From: Edwin Lu > > Some testcases still had --param=riscv-autovec-preference=_, > update to use -mrvv-vector-bits=_. And this can be squashed with prev one, maybe added Tested-by Edwin. Thx, -Vineet

Re: [PATCH 1/2] RISC-V: add option -m(no-)autovec-segment

2024-05-28 Thread Vineet Gupta
On 5/28/24 14:55, Patrick O'Neill wrote: > From: Greg McGary > > Add option -m(no-)autovec-segment to enable/disable autovectorizer > from emitting vector segment load/store instructions. This is useful for > performance experiments. > > gcc/ChangeLog: > * config/riscv/autovec.md (vec_mas

[PATCH 2/2] RISC-V: Fix testcases renamed test flag options

2024-05-28 Thread Patrick O'Neill
From: Edwin Lu Some testcases still had --param=riscv-autovec-preference=_, update to use -mrvv-vector-bits=_. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/no-segment.c: Update dejagnu flags * gcc.target/riscv/rvv/autovec/struct/mask_struct_load_noseg_run-1.c: Ditto

[PATCH 1/2] RISC-V: add option -m(no-)autovec-segment

2024-05-28 Thread Patrick O'Neill
From: Greg McGary Add option -m(no-)autovec-segment to enable/disable autovectorizer from emitting vector segment load/store instructions. This is useful for performance experiments. gcc/ChangeLog: * config/riscv/autovec.md (vec_mask_len_load_lanes, vec_mask_len_store_lanes):

[PATCH 0/2] RISC-V: Add -m(no-)autovec-segment option

2024-05-28 Thread Patrick O'Neill
Rebased and combined these two patches into a series for precommit-CI to properly test. Edwin Lu (1): RISC-V: Fix testcases renamed test flag options Greg McGary (1): RISC-V: add option -m(no-)autovec-segment gcc/config/riscv/autovec.md | 4 +- gcc/config/riscv/riscv-opts

[COMMITTED] More tweaks from gimple_outgoing_range changes.

2024-05-28 Thread Andrew MacLeod
The dom_ranger class used for fast vrp no longer needs it's own local gimple_outgoing_range object as it is now always available from the range_query parent class. The builtin_unreachable code for adjusting globals and removing the builtin calls during the final VRP pass can now function with

Re: [PATCHv3] Optab: add isfinite_optab for __builtin_isfinite

2024-05-28 Thread Richard Sandiford
HAO CHEN GUI writes: > Hi, > This patch adds an optab for __builtin_isfinite. The finite check can be > implemented on rs6000 by a single instruction. It needs an optab to be > expanded to the certain sequence of instructions. > > The subsequent patches will implement the expand on rs6000. > >

Re: [PATCH v3] tree-ssa-pre.c/115214(ICE in find_or_generate_expression, at tree-ssa-pre.c:2780): Return NULL_TREE when deal special cases.

2024-05-28 Thread Richard Sandiford
Richard Biener writes: > On Mon, May 27, 2024 at 9:48 AM Jiawei wrote: >> >> Return NULL_TREE when genop3 equal EXACT_DIV_EXPR. >> https://gcc.gnu.org/pipermail/gcc-patches/2024-May/652641.html >> >> version log v3: remove additional POLY_INT_CST check. >> https://gcc.gnu.org/pipermail/gcc-patche

Re: [C23 PATCH]: allow aliasing for types derived from structs with variable size

2024-05-28 Thread Joseph Myers
On Sun, 26 May 2024, Martin Uecker wrote: > +/* Helper function for comptypes. For two compatible types, return 1 > + if they pass consistency checks. In particular we test that > + TYPE_CANONICAL ist set correctly, i.e. the two types can alias. */ s/ist/is/. OK with that fix. -- Joseph

Re: [C23 PATCH, v2] fix aliasing for structures/unions with incomplete types

2024-05-28 Thread Joseph Myers
On Sun, 26 May 2024, Martin Uecker wrote: > This is the patch I sent previously, but I tried to improve the > description and added a long comment. This patch is needed so > that we do not have to update TYPE_CANONICAL of structures / unions > when a tagged type is completed that is (recursively)

Re: [C PATCH, v2]: allow aliasing of compatible types derived from enumeral types [PR115157]

2024-05-28 Thread Joseph Myers
On Fri, 24 May 2024, Martin Uecker wrote: > This is another version of this patch with two changes: > > - I added a fix (with test) for PR 115177 which is just the same > issue for hardbools which are internally implemented as enums. > > - I fixed the golang issue. Since the addition of the main

Re: [PATCH v2 1/2] driver: Use -as/ld/objcopy as final fallback instead of native ones for cross

2024-05-28 Thread Richard Sandiford
YunQiang Su writes: > If `find_a_program` cannot find `as/ld/objcopy` and we are a cross toolchain, > the final fallback is `as/ld` of system. In fact, we can have a try with > -as/ld/objcopy before fallback to native as/ld/objcopy. > > This patch is derivatived from Debian's patch: > gcc-searc

Re: [PATCH v3 #1/2] [rs6000] adjust return_pc debug attrs

2024-05-28 Thread Segher Boessenkool
On Sat, May 25, 2024 at 09:13:12AM -0300, Alexandre Oliva wrote: > Some of the rs6000 call patterns, on some ABIs, issue multiple opcodes > out of a single call insn, but the call (bl) or jump (b) is not always > the last opcode in the sequence. > This does not seem to be a problem for exception h

Re: [PATCH v9 5/5] Add the 6th argument to .ACCESS_WITH_SIZE

2024-05-28 Thread Qing Zhao
> On May 28, 2024, at 03:43, Richard Biener wrote: > > On Fri, Apr 12, 2024 at 3:55 PM Qing Zhao wrote: >> >> to carry the TYPE of the flexible array. >> >> Such information is needed during tree-object-size.cc. >> >> We cannot use the result type or the type of the 1st argument >> of the r

Re: [PATCH v9 3/5] Use the .ACCESS_WITH_SIZE in builtin object size.

2024-05-28 Thread Qing Zhao
> On May 28, 2024, at 03:39, Richard Biener wrote: > > On Fri, Apr 12, 2024 at 3:54 PM Qing Zhao wrote: >> > > I have no comments here, if Siddesh is OK with this I approve. thanks. Qing > >> gcc/ChangeLog: >> >>* tree-object-size.cc (access_with_size_object_size): New function.

Re: [PATCH v9 2/5] Convert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.

2024-05-28 Thread Qing Zhao
Thank you for the comments. See my answers below: Joseph, please see the last question, I need your help on it. Thanks a lot for the help. Qing > On May 28, 2024, at 03:38, Richard Biener wrote: > > On Fri, Apr 12, 2024 at 3:54 PM Qing Zhao wrote: >> >> Including the following changes: >> *

Re: [RFC/PATCH] Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook

2024-05-28 Thread Joseph Myers
On Fri, 24 May 2024, Kewen.Lin wrote: > Following your suggestion and comments, I made this patch > for mode_for_floating_type first, considering this touches > a few FE and port specific code, I think I have to split > it into a patch series. Before making that, I'd like to > ensure this meets w

[committed] i386: Improve access to _Atomic DImode location via XMM regs for SSE4.1 x86_32 targets

2024-05-28 Thread Uros Bizjak
Use MOVD/PEXTRD and MOVD/PINSRD insn sequences to move DImode value between XMM and GPR register sets for SSE4.1 x86_32 targets in order to avoid spilling the value to stack. The load from _Atomic location a improves from: movqa, %xmm0 movq%xmm0, (%esp) movl(%esp), %eax

Re: [PATCH] Avoid vector -Wfree-nonheap-object warnings

2024-05-28 Thread François Dumont
I can indeed restore _M_initialize_dispatch as it was before. It was not fixing my initial problem. I simply kept the code simplification.     libstdc++: Use RAII to replace try/catch blocks     Move _Guard into std::vector declaration and use it to guard all calls to     vector _M_allocate.

Re: [PATCH v3 #1/2] enable adjustment of return_pc debug attrs

2024-05-28 Thread Segher Boessenkool
On Sat, May 25, 2024 at 09:12:05AM -0300, Alexandre Oliva wrote: You sent multiple patch series in one thread, and multiple versions of the same series even. This is very hard to even *read*, let alone work with. Please don't. Segher

Re: [PATCH 2/4] resource.cc: Replace calls to find_basic_block with cfgrtl BLOCK_FOR_INSN

2024-05-28 Thread Hans-Peter Nilsson
> Date: Mon, 27 May 2024 12:57:53 -0600 > From: Jeff Law > > * resource.cc: Include cfgrtl.h. Use BLOCK_FOR_INSN (insn)->index > > instead of calling find_basic_block (insn). Assert for not -1. > > (find_basic_block): Remove function. > > (init_resource_info): Call compute_bb_fo

[pushed 1/3] selftests: split out make_fndecl from selftest.h to its own header

2024-05-28 Thread David Malcolm
Avoid selftest.h requiring the "tree" type. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-873-gfb7a943ead689e. gcc/analyzer/ChangeLog: * region-model.cc: Include "selftest-tree.h". gcc/ChangeLog: * function-te

[pushed 3/3] diagnostics: consolidate global state in diagnostic-color.cc

2024-05-28 Thread David Malcolm
Simplify the table of default colors, avoiding the need to manually add the strlen of each entry. Consolidate the global state in diagnostic-color.cc into a g_color_dict, adding selftests for the new class diagnostic_color_dict. No functional change intended. Successfully bootstrapped & regrteste

[pushed 2/3] libcpp: move label_text to its own header

2024-05-28 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-874-g9bda2c4c81b668. libcpp/ChangeLog: * Makefile.in (TAGS_SOURCES): Add include/label-text.h. * include/label-text.h: New file. * include/rich-location.h:

Re: [PATCH] regenerate-opt-urls.py: fix transposed values for "vax" and "v850"

2024-05-28 Thread David Malcolm
On Tue, 2024-05-28 at 11:41 -0400, David Malcolm wrote: > > On Tue, 2024-05-28 at 15:03 +0200, Mark Wielaard wrote: > > Hi Maciej (Hi David, added to CC), > > > On Mon, 2024-05-27 at 05:19 +0100, Maciej W. Rozycki wrote: > > >  As reported in PR target/79646 and fixed by a change proposed by > > >

Re: [Patch, PR Fortran/90069] Polymorphic Return Type Memory Leak Without Intermediate Variable

2024-05-28 Thread Harald Anlauf
Hi Andre, On 5/28/24 14:10, Andre Vehreschild wrote: Hi all, the attached patch fixes a memory leak with unlimited polymorphic return types. The leak occurred, because an expression with side-effects was evaluated twice. I have substituted the check for non-variable expressions followed by crea

[patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Tobias Burnus
-fopenmp-force-usm can be useful for some badly written code. Explicity using 'omp requires' makes more sense but still. It might also make sense for testing purpose. Unfortunately, I did not see a simple way of testing it. When trying it manually, I looked at the 'a.xamdgcn-amdhsa.c' -save-te

[PATCH v4] RISC-V: Introduce -mvector-strict-align.

2024-05-28 Thread Robin Dapp
Hi, this patch disables movmisalign by default and introduces the -mno-vector-strict-align option to override it and re-enable movmisalign. For now, generic-ooo is the only uarch that supports misaligned vector access. The patch also adds a check_effective_target_riscv_v_misalign_ok to the tests

Re: [PATCH v3 #1/2] enable adjustment of return_pc debug attrs

2024-05-28 Thread Jason Merrill
On 5/25/24 08:12, Alexandre Oliva wrote: On Apr 27, 2023, Alexandre Oliva wrote: On Apr 14, 2023, Alexandre Oliva wrote: On Mar 23, 2023, Alexandre Oliva wrote: This patch introduces infrastructure for targets to add an offset to the label issued after the call_insn to set the call_return_p

Re: [PATCH] c++: extend -Wself-move for mem-init-list [PR109396]

2024-05-28 Thread Marek Polacek
On Fri, May 24, 2024 at 10:15:56AM -0400, Jason Merrill wrote: > On 5/23/24 19:57, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > We already warn for: > > > >x = std::move (x); > > > > which triggers: > > > >warning: moving 'x'

Re: [PATCH] c++: canonicity of fn types w/ instantiated eh specs [PR115223]

2024-05-28 Thread Jason Merrill
On 5/25/24 19:18, Patrick Palka wrote: Bootstrap and regtest on x86_64-pc-linux-gnu in progress, does this look OK for trunk if successful? OK. -- >8 -- When propagating structural equality in build_cp_fntype_variant, we should consider structural equality of the exception-less variant, not

Re: [PATCH] c++/modules: Prevent revealing a using-decl affecting cached overloads [PR114867]

2024-05-28 Thread Jason Merrill
On 5/26/24 09:01, Nathaniel Shead wrote: Is this approach OK? Alternatively I suppose we could do a deep copy of the overload list when this occurs to ensure we don't affect existing referents, would that be preferable? This strategy makes sense, but I have other concerns: Bootstrapped and r

[COMMITTED] tree-optimization/115221 - Do not invoke SCEV if it will use a different range query.

2024-05-28 Thread Andrew MacLeod
The original patch causing the PR made  ranger's cache re-entrant to enable SCEV to use the current range_query when called from within ranger.. SCEV uses the currently active range query (via get_range_query()) for picking up values.  fold_using_range is the general purpose stmt folder many 

[COMMITTED] Strlen pass should set current range query.

2024-05-28 Thread Andrew MacLeod
Thanks. Committed with the change to the testcase. Bootstraps on x86_64-pc-linux-gnu with no regressions. Andrew On 5/28/24 02:49, Richard Biener wrote: On Tue, May 28, 2024 at 1:24 AM Andrew MacLeod wrote: The strlen pass currently has a local ranger instance, but when it invokes SCEV or

Re: [PATCH v2 1/2] driver: Use -as/ld/objcopy as final fallback instead of native ones for cross

2024-05-28 Thread YunQiang Su
YunQiang Su 于2024年5月22日周三 17:54写道: > > If `find_a_program` cannot find `as/ld/objcopy` and we are a cross toolchain, > the final fallback is `as/ld` of system. In fact, we can have a try with > -as/ld/objcopy before fallback to native as/ld/objcopy. > > This patch is derivatived from Debian's pat

[PATCH] MIPS16: Mark $2/$3 as clobbered if GP is used

2024-05-28 Thread YunQiang Su
PR Target/84790. The gp init sequence li $2,%hi(_gp_disp) addiu $3,$pc,%lo(_gp_disp) sll $2,16 addu$2,$3 is generated directly in `mips_output_function_prologue`, and does not appear in the RTL. So the IRA/IPA passes are not aware that $2/$3 have been

Re: [Patch] testsuite/*/gomp: Remove 'dg-prune-output "not supported yet"'

2024-05-28 Thread Jakub Jelinek
On Tue, May 28, 2024 at 07:43:00PM +0200, Tobias Burnus wrote: > Improve test coverage by removing 'prune-output' given that the features are > implemented in the meanwhile. > > Comments, suggestions? Otherwise I will commit the patch as obvious. > > Tobias > testsuite/*/gomp: Remove 'dg-prune-o

[Patch] testsuite/*/gomp: Remove 'dg-prune-output "not supported yet"'

2024-05-28 Thread Tobias Burnus
Improve test coverage by removing 'prune-output' given that the features are implemented in the meanwhile. Comments, suggestions? Otherwise I will commit the patch as obvious. Tobias testsuite/*/gomp: Remove 'dg-prune-output "not supported yet"' gcc/testsuite/ChangeLog: * c-c++-common/gomp/l

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

2024-05-28 Thread David Malcolm
Ping. This patch has actually been *very* helpful to me when debugging selftest failures involving ASSERT_STREQ. Thanks Dave On Fri, 2024-05-17 at 15:51 -0400, David Malcolm wrote: > Currently when ASSERT_STREQ or ASSERT_STREQ_AT fail we print > both strings to stderr.  However it can be hard to

[pushed] diagnostics: disable localization of events in selftest paths [PR115203]

2024-05-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-866-g2dbb1c124c1e58. gcc/ChangeLog: PR analyzer/115203 * diagnostic-path.h (simple_diagnostic_path::disable_event_localization): New. (simple_diagnostic_path::m_localize_events): N

[pushed] Fix bootstrap on AIX by adding c-family/c-type-mismatch.cc [PR115167]

2024-05-28 Thread David Malcolm
PR bootstrap/115167 reports a bootstrap failure on AIX triggered by r15-636-g770657d02c986c whilst building f951 in stage 2, due to the linker not being able to find symbols for: vtable for range_label_for_type_mismatch range_label_for_type_mismatch::get_text(unsigned int) const The only user

Re: [PATCH] attribs: Fix and refactor diag_attr_exclusions

2024-05-28 Thread Richard Sandiford
Andrew Carlotti writes: > The existing implementation of this function was convoluted, and had > multiple control flow errors that became apparent to me while reading > the code: > > 1. The initial early return only checked the properties of the first > exclusion in the list, when these properties

Re: [PATCH] vect: Unify bbs in loop_vec_info and bb_vec_info

2024-05-28 Thread Feng Xue OS
Because bbs of loop_vec_info need to be allocated via old-fashion XCNEWVEC, in order to receive result from dfs_enumerate_from(), so have to make bb_vec_info align with loop_vec_info, use basic_block * instead of vec. Another reason is that some loop vect related codes assume that bbs is a pointer,

[PATCH] MIPS/testsuite: Fix bseli.b fail in msa-builtins.c

2024-05-28 Thread YunQiang Su
commit 05daf617ea22e1d818295ed2d037456937e23530 Author: Jeff Law Date: Sat May 25 12:39:05 2024 -0600 [committed] [v2] More logical op simplifications in simplify-rtx.cc does some simplifications, and then `bseli.b $w1,$w0,255` is found that it is same with `or.v $w1,$w0,$w1`. So there wil

[PATCH] regenerate-opt-urls.py: fix transposed values for "vax" and "v850"

2024-05-28 Thread David Malcolm
> On Tue, 2024-05-28 at 15:03 +0200, Mark Wielaard wrote: > Hi Maciej (Hi David, added to CC), >On Mon, 2024-05-27 at 05:19 +0100, Maciej W. Rozycki wrote: > > As reported in PR target/79646 and fixed by a change proposed by > > Abe we > > have a couple of issues with the descriptions of the VAX

Re: [PATCH] libstdc++: Build libbacktrace and 19_diagnostics/stacktrace with -funwind-tables [PR111641]

2024-05-28 Thread Jonathan Wakely
On Tue, 28 May 2024 at 15:25, Rainer Orth wrote: > > Several of the 19_diagnostics/stacktrace tests FAIL on Solaris/SPARC (32 > and 64-bit), Solaris/x86 (32-bit only), and several other targets: > > FAIL: 19_diagnostics/stacktrace/current.cc -std=gnu++23 execution test > FAIL: 19_diagnostics/stac

[PATCH] libstdc++: Build libbacktrace and 19_diagnostics/stacktrace with -funwind-tables [PR111641]

2024-05-28 Thread Rainer Orth
Several of the 19_diagnostics/stacktrace tests FAIL on Solaris/SPARC (32 and 64-bit), Solaris/x86 (32-bit only), and several other targets: FAIL: 19_diagnostics/stacktrace/current.cc -std=gnu++23 execution test FAIL: 19_diagnostics/stacktrace/current.cc -std=gnu++26 execution test FAIL: 19_diagn

Re: [PATCH] vect: Use vect representative statement instead of original in patch recog [PR115060]

2024-05-28 Thread Feng Xue OS
Changed as the comments. Thanks, Feng From: Richard Biener Sent: Tuesday, May 28, 2024 5:34 PM To: Feng Xue OS Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] vect: Use vect representative statement instead of original in patch recog [PR115060] On Sat,

[PATCH] target/115254 - fix gcc.dg/vect/vect-gather-4.c dump scanning

2024-05-28 Thread Richard Biener
The dump scanning is supposed to check that we do not merge two sligtly different gathers into one SLP node but since we now SLP the store scanning for "ectorizing stmts using SLP" is no longer good. Instead the following makes us look for "stmt 1 .* = .MASK" which would be how the second lane of

Re: [PATCH] libstdc++: Avoid MMX return types from __builtin_shufflevector

2024-05-28 Thread Jonathan Wakely
On Wed, 15 May 2024 at 20:50, Matthias Kretz wrote: > > Tested on aarch64-linux-gnu, arm-linux-gnueabihf, powerpc64le-linux-gnu, > x86_64-linux-gnu (-m64, -m32, -mx32), and arm-linux-gnueabi > > OK for trunk? OK > And when backporting, should I squash it with the commit that > introduced the reg

Re: [committed v2 0/2] VAX: Fix issues with FP format option documentation

2024-05-28 Thread Mark Wielaard
Hi Maciej (Hi David, added to CC), On Mon, 2024-05-27 at 05:19 +0100, Maciej W. Rozycki wrote: > As reported in PR target/79646 and fixed by a change proposed by Abe we > have a couple of issues with the descriptions of the VAX floating-point > format options in the option definition file. Add

[PATCH] tree-optimization/115236 - more points-to *ANYTHING = x fixes

2024-05-28 Thread Richard Biener
The stored-to ANYTHING handling has more holes, uncovered by treating volatile accesses as ANYTHING. We fail to properly build the pred and succ graphs, in particular we may not elide direct nodes from receiving from STOREDANYTHING. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

Re: [wwwdocs][patch] gcc-15/changes.html: Fortran - mention F2023 logical-kind additions

2024-05-28 Thread FX Coudert
Seems good, thanks Tobias! FX

[PATCH] tree-optimization/115252 - enhance peeling for gaps avoidance

2024-05-28 Thread Richard Biener
Code generation for contiguous load vectorization can already deal with generalized avoidance of loading from a gap. The following extends detection of peeling for gaps requirement with that, gets rid of the old special casing of a half load and makes sure when we do access the gap we have peeling

[PATCH] Avoid pessimistic constraints for asm memory constraints

2024-05-28 Thread Richard Biener
We process asm memory input/outputs with constraints to ESCAPED but for this temporarily build an ADDR_EXPR. The issue is that the used build_fold_addr_expr ends up wrapping the ADDR_EXPR in a conversion which ends up producing &ANYTHING constraints which is quite bad. The following uses get_cons

[Patch, PR Fortran/90069] Polymorphic Return Type Memory Leak Without Intermediate Variable

2024-05-28 Thread Andre Vehreschild
Hi all, the attached patch fixes a memory leak with unlimited polymorphic return types. The leak occurred, because an expression with side-effects was evaluated twice. I have substituted the check for non-variable expressions followed by creating a SAVE_EXPR with checking for trees with side effec

Re: [PATCHv3] Optab: add isfinite_optab for __builtin_isfinite

2024-05-28 Thread Richard Biener
On Tue, May 28, 2024 at 9:09 AM Kewen.Lin wrote: > > Hi, > > on 2024/5/27 20:54, Richard Biener wrote: > > On Mon, May 27, 2024 at 11:37 AM HAO CHEN GUI wrote: > >> > >> Hi, > >> This patch adds an optab for __builtin_isfinite. The finite check can be > >> implemented on rs6000 by a single inst

Re: [PATCH v2] object lifetime instrumentation for Valgrind [PR66487]

2024-05-28 Thread Richard Biener
On Tue, May 28, 2024 at 1:38 PM Alexander Monakov wrote: > > > On Tue, 28 May 2024, Richard Biener wrote: > > > > I am a bit confused what you mean by "cheaper". Could it be that we are > > > not > > > on the same page regarding the machine code behind client requests? > > > > Probably "cheaper"

Re: [PATCH V2] Reduce cost of MEM (A + imm).

2024-05-28 Thread Uros Bizjak
On Tue, May 28, 2024 at 12:48 PM liuhongt wrote: > > > IMO, there is no need for CONST_INT_P condition, we should also allow > > symbol_ref, label_ref and const (all allowed by > > x86_64_immediate_operand predicate), these all decay to an immediate > > value. > > Changed. > > Bootstrapped and reg

Re: [PATCH v2] object lifetime instrumentation for Valgrind [PR66487]

2024-05-28 Thread Alexander Monakov
On Tue, 28 May 2024, Richard Biener wrote: > > I am a bit confused what you mean by "cheaper". Could it be that we are not > > on the same page regarding the machine code behind client requests? > > Probably "cheaper" in register usage. But it doesn't matter considering that execution under Va

  1   2   >