Re: [Ping, Fortran, Patch, PR80235, v1] Fix ICE when coarray from module is referenced in submodule.

2024-10-16 Thread Andre Vehreschild
Hi Paul, thanks for the review. Committed as: gcc-15-4405-ge32fff675c3 Thanks again, Andre On Wed, 16 Oct 2024 14:41:09 +0100 Paul Richard Thomas wrote: > Hi Andre, > > The handling of submodules is something of a kludge, especially where > module procedures are concerned, that seems t

Re: [PATCH 2/7] libstdc++: Make __normal_iterator constexpr, always_inline, nodiscard

2024-10-16 Thread Jonathan Wakely
On Thu, 17 Oct 2024, 03:33 Patrick Palka, wrote: > On Tue, 15 Oct 2024, Jonathan Wakely wrote: > > > Tested x86_64-linux. > > > > -- >8 -- > > > > The __gnu_cxx::__normal_iterator type we use for std::vector::iterator > > is not specified by the standard, it's an implementation detail. This > > m

RE: [PATCH v1] Internal-fn: Add new IFN mask_len_strided_load/store

2024-10-16 Thread Li, Pan2
It is quit a while since last discussion. I recall these materials recently and have a try in the risc-v backend. 1 │ void foo (int * __restrict a, int * __restrict b, int stride, int n) 2 │ { 3 │ for (int i = 0; i < n; i++) 4 │ a[i*stride] = b[i*stride] + 100; 5

Re: [PATCH] SVE intrinsics: Add fold_active_lanes_to method to refactor svmul and svdiv.

2024-10-16 Thread Jennifer Schmitz
> On 16 Oct 2024, at 21:16, Richard Sandiford wrote: > > External email: Use caution opening links or attachments > > > Jennifer Schmitz writes: >> As suggested in >> https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663275.html, >> this patch adds the method gimple_folder::fold_activ

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

2024-10-16 Thread François Dumont
As a side note you should provide your patches as .txt files so that any email client can render it without going through an editor. And regarding the patch, I wonder what the std::move is for on the returned value ? Like this one: +    { +  return std::move(__lhs.append(__rhs)); +    }

Re: SVE intrinsics: Fold constant operands for svlsl.

2024-10-16 Thread Soumya AR
Hi Richard, Thanks for the feedback. I’ve updated the patch with the suggested change. Ok for mainline? Best, Soumya > On 14 Oct 2024, at 6:40 PM, Richard Sandiford > wrote: > > External email: Use caution opening links or attachments > > > Soumya AR writes: >> This patch implements constant

Re: [PATCH 2/2] libstdc++: Implement C++23 (P1222R4)

2024-10-16 Thread Patrick Palka
On Mon, 30 Sep 2024, Patrick Palka wrote: > This implements the C++23 container adaptors std::flat_set and > std::flat_multiset from P1222R4. The implementation is essentially > an simpler and pared down version of std::flat_map. > > The main known issues are: > > * exception safety is likely

Re: [PATCH 1/2] libstdc++: Implement C++23 (P0429R9)

2024-10-16 Thread Patrick Palka
On Mon, 30 Sep 2024, Patrick Palka wrote: > This implements the C++23 container adaptors std::flat_map and > std::flat_multimap from P0429R9. The implementation is shared > as much as possible between the two adaptors via a common base > class that's parameterized according to key uniqueness. >

[PATCHv2 1/2] cfgexpand: Handle scope conflicts better [PR111422]

2024-10-16 Thread Andrew Pinski
After fixing loop-im to do the correct overflow rewriting for pointer types too. We end up with code like: ``` _9 = (unsigned long) &g; _84 = _9 + 18446744073709551615; _11 = _42 + _84; _44 = (signed char *) _11; ... *_44 = 10; g ={v} {CLOBBER(eos)}; ... n[0] = &f; *_44 = 8; g ={v

[PATCH 2/2] cfgexpand: Handle integral vector types and constructors for scope conflicts [PR105769]

2024-10-16 Thread Andrew Pinski
This is an expansion of the last patch to also track pointers via vector types and the constructor that are used with vector types. In this case we had: ``` _15 = (long unsigned int) &bias; _10 = (long unsigned int) &cov_jn; _12 = {_10, _15}; ... MEM[(struct vec *)&cov_jn] ={v} {CLOBBER(bob)}; bi

Re: [PATCH 2/7] libstdc++: Make __normal_iterator constexpr, always_inline, nodiscard

2024-10-16 Thread Patrick Palka
On Tue, 15 Oct 2024, Jonathan Wakely wrote: > Tested x86_64-linux. > > -- >8 -- > > The __gnu_cxx::__normal_iterator type we use for std::vector::iterator > is not specified by the standard, it's an implementation detail. This > means it's not constrained by the rule that forbids strengthening >

[PATCH] i386: Utilize VCOMSBF16 for BF16 Comparisons with AVX10.2

2024-10-16 Thread Levy Hsu
Bootstrapped and regtested on x86_64-pc-linux-gnu{-m64}. Ok for trunk? This patch enables the use of the VCOMSBF16 instruction from AVX10.2 for efficient BF16 comparisons. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_branch): Handle BFmode when TARGET_AVX10_2_256 is e

RE: [PATCH] testsuite: Add -march=x86-64-v3 to AVX10 testcases to slience warning for GCC built with AVX512 arch

2024-10-16 Thread Liu, Hongtao
> -Original Message- > From: Jiang, Haochen > Sent: Wednesday, October 16, 2024 3:45 PM > To: gcc-patches@gcc.gnu.org > Cc: Liu, Hongtao ; ubiz...@gmail.com > Subject: [PATCH] testsuite: Add -march=x86-64-v3 to AVX10 testcases to > slience warning for GCC built with AVX512 arch > > Hi

Re: [PATCH 4/7] libstdc++: Remove indirection to __find_if in std::find etc.

2024-10-16 Thread Patrick Palka
ZOn Tue, 15 Oct 2024, Jonathan Wakely wrote: > Tested x86_64-linux. > > -- >8 -- > > There doesn't seem to be a lot of benefit in reusing __find_if with > __gnu_cxx::__ops predicates, since they aren't going to actually > instantiate any less code if we use different predicates every time > (e.g

Re: [PATCH 3/7] libstdc++: Inline memmove optimizations for std::copy etc. [PR115444]

2024-10-16 Thread Patrick Palka
On Tue, 15 Oct 2024, Jonathan Wakely wrote: > This is a slightly different approach to C++98 compatibility than used > in patch 1/1 of this series for the uninitialized algos. It worked out a > bit cleaner this way for these algos, I think. > > Tested x86_64-linux. > > -- >8 -- > > This removes

Re: [PATCH 1/7] libstdc++: Refactor std::uninitialized_{copy, fill, fill_n} algos [PR68350]

2024-10-16 Thread Patrick Palka
On Tue, 15 Oct 2024, Jonathan Wakely wrote: > This is v2 of > https://gcc.gnu.org/pipermail/gcc-patches/2024-October/665246.html > fixing some thinkos in uninitialized_{fill,fill_n}. We don't need to > worry about overwriting tail-padding in those algos, because we only use > memset for 1-byte int

[PATCH 2/2] Only do switch bit test clustering when multiple labels point to same bb

2024-10-16 Thread Andi Kleen
From: Andi Kleen The bit cluster code generation strategy is only beneficial when multiple case labels point to the same code. Do a quick check if that is the case before trying to cluster. This fixes the switch part of PR117091 where all case labels are unique however it doesn't address the per

[PATCH 1/2] Disable -fbit-tests and -fjump-tables at -O0

2024-10-16 Thread Andi Kleen
From: Andi Kleen gcc/ChangeLog: * common.opt: Enable -fbit-tests and -fjump-tables only at -O1. * tree-switch-conversion.h (jump_table_cluster::is_enabled): Dito. --- gcc/common.opt | 4 ++-- gcc/tree-switch-conversion.h | 5 +++-- 2 files changed, 5 inse

[PATCH] [AVX512] Refine splitters related to "combine vpcmpuw + zero_extend to vpcmpuw"

2024-10-16 Thread liuhongt
r12-6103-g1a7ce8570997eb combines vpcmpuw + zero_extend to vpcmpuw with the pre_reload splitter, but the splitter transforms the zero_extend into a subreg which make reload think the upper part is garbage, it's not correct. The patch adjusts the zero_extend define_insn_and_split to define_insn to

[PATCH][v5] RISC-V: add option -m(no-)autovec-segment

2024-10-16 Thread Edwin Lu
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):

Re: [PATCH v2 1/4] tree-object-size: use size_for_offset in more cases

2024-10-16 Thread Siddhesh Poyarekar
On 2024-09-27 06:31, Jakub Jelinek wrote: On Fri, Sep 20, 2024 at 12:40:26PM -0400, Siddhesh Poyarekar wrote: When wholesize != size, there is a reasonable opportunity for static object sizes also to be computed using size_for_offset, so use that. gcc/ChangeLog: * tree-object-size.cc (

Re: [PATCH] c: Fix up speed up compilation of large char array initializers when not using #embed [PR117177]

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Jakub Jelinek wrote: > Hi! > > Apparently my > c: Speed up compilation of large char array initializers when not using #embed > patch broke building glibc. > > The issue is that when using CPP_EMBED, we are guaranteed by the > preprocessor that there is CPP_NUMBER CPP_COMMA

[PATCH] c: Fix up speed up compilation of large char array initializers when not using #embed [PR117177]

2024-10-16 Thread Jakub Jelinek
Hi! Apparently my c: Speed up compilation of large char array initializers when not using #embed patch broke building glibc. The issue is that when using CPP_EMBED, we are guaranteed by the preprocessor that there is CPP_NUMBER CPP_COMMA before it and CPP_COMMA CPP_NUMBER after it (or CPP_COMMA C

Re: [PATCH] c, libcpp, v2: Partially implement C2Y N3353 paper [PR117028]

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Jakub Jelinek wrote: > On Tue, Oct 15, 2024 at 05:40:58PM +, Joseph Myers wrote: > > > --- gcc/testsuite/gcc.dg/cpp/c23-delimited-escape-seq-1.c.jj > > > 2024-10-14 17:58:54.436815339 +0200 > > > +++ gcc/testsuite/gcc.dg/cpp/c23-delimited-escape-seq-1.c 2024-10-14 >

Re: [PATCH][LRA][PR116550] Reuse scratch registers generated by LRA

2024-10-16 Thread Vladimir Makarov
On 10/10/24 14:32, Denis Chertykov wrote: The patch is very simple. On x86_64, it bootstraps+regtests fine. Ok for trunk? Sorry for the delay with the answer. I missed your patch and pinging it was the right thing to do. Thanks for the detail explanation of the problem which makes me easy

Re: [PATCH] c++: Fix crash during NRV optimization with invalid input [PR117099]

2024-10-16 Thread Sam James
Simon Martin writes: > We ICE upon the following invalid code because we end up calling > finalize_nrv_r with a RETURN_EXPR with no operand. > > === cut here === > struct X { > ~X(); > }; > X test(bool b) { > { > X x; > return x; > } > if (!(b)) return; > } > === cut here === >

Re: [PATCH v1] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-16 Thread Alejandro Colomar
On Wed, Oct 16, 2024 at 03:41:00PM GMT, Eric Gallager wrote: > On Wed, Oct 16, 2024 at 8:55 AM Alejandro Colomar wrote: > > > > Just like we already do for git-send-email(1). In some cases, patches > > are prepared with git-format-patch(1), but are sent with a different > > program, or some flags

Re: [PATCH v1] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-16 Thread Eric Gallager
On Wed, Oct 16, 2024 at 8:55 AM Alejandro Colomar wrote: > > Just like we already do for git-send-email(1). In some cases, patches > are prepared with git-format-patch(1), but are sent with a different > program, or some flags to git-send-email(1) may accidentally inhibit the > configuration. By

[PATCH] c++: Fix crash during NRV optimization with invalid input [PR117099]

2024-10-16 Thread Simon Martin
We ICE upon the following invalid code because we end up calling finalize_nrv_r with a RETURN_EXPR with no operand. === cut here === struct X { ~X(); }; X test(bool b) { { X x; return x; } if (!(b)) return; } === cut here === This patch fixes this by simply returning error_mark_no

Re: [PATCH] SVE intrinsics: Add fold_active_lanes_to method to refactor svmul and svdiv.

2024-10-16 Thread Richard Sandiford
Jennifer Schmitz writes: > As suggested in > https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663275.html, > this patch adds the method gimple_folder::fold_active_lanes_to (tree X). > This method folds active lanes to X and sets inactive lanes according to > the predication, returning a ne

Re: [PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-16 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 05:21:39PM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > The old name was misleading. > > > > While at it, also rename some temporary variables that are used with > > this function, for consistency. > > This patch is OK and sho

Re: [PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Alejandro Colomar wrote: > The old name was misleading. > > While at it, also rename some temporary variables that are used with > this function, for consistency. This patch is OK and should be committed (assuming it has passed bootstrap and regression testing). -- Joseph

[pushed: r15-4392] diagnostics: eliminate m_ice_handler_cb [PR116613]

2024-10-16 Thread David Malcolm
More preliminary cleanup work for supporting multiple diagnostic output sinks. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-4392-gd826b6389d9605. gcc/ChangeLog: PR other/116613 * diagnostic-format-sarif.cc

[pushed: r15-4393] diagnostics: capture backtraces in SARIF notifications [PR116602]

2024-10-16 Thread David Malcolm
This patch makes the SARIF output's crash handler attempt to capture a backtrace in JSON form within the notification's property bag. The precise format of the property is subject to change, but, for example, in one of the test cases I got output like this: "properties": {"gcc/backtrace": {"frame

Linaro CI new feature: skip precommit testing

2024-10-16 Thread Christophe Lyon
Hi, Following "popular request", we are happy to announce that users can now request to skip Linaro CI precommit testing for some patches. The current implementation skips testing in two cases: 1- there is [RFC] or [RFC v[0-9]] in the patch subject 2- the commit message contains a line starting w

Re: [PATCH v1 4/4] aarch64: encapsulate note.gnu.property emission into a class

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:51, Richard Sandiford wrote: Matthieu Longo writes: gcc/ChangeLog: * config.gcc: Add aarch64-dwarf-metadata.o to extra_objs. * config/aarch64/aarch64-dwarf-metadata.h (class section_note_gnu_property): Encapsulate GNU properties code into a class. * config

Re: [committed] libstdc++: Fix Python deprecation warning in printers.py

2024-10-16 Thread Tom Tromey
> "Jonathan" == Jonathan Wakely writes: Jonathan> also unable to build GDB with Python 3? ... maybe unlikely) but nobody Jonathan> should be stuck on 3.0 and unable to replace that with 3.12 or so. gdb has one user (maybe more, but I doubt it) on Windows XP where the latest available version

Re: [PATCH v2] [testsuite] [arm] add effective target and options for pacbti tests

2024-10-16 Thread Richard Earnshaw (lists)
On 19/04/2024 17:37, Alexandre Oliva wrote: > Hello, Richard, > > Thanks, your response was very informative. > > Here's a revised patch. > > arm pac and bti tests that use -march=armv8.1-m.main get an implicit > -mthumb, that is incompatible with vxworks kernel mode. Declaring the > requiremen

Re: [PATCH v1 3/4] aarch64: improve assembly debug comments for build attributes

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:45, Richard Sandiford wrote: Matthieu Longo writes: The previous implementation to emit build attributes did not support string values (asciz) in aeabi_subsection, and was not emitting values associated to tags in the assembly comments. This new approach provides a more user-f

[PATCH v3] MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]

2024-10-16 Thread Eikansh Gupta
The pattern `a rrotate (32-b)` should be optimized to `a lrotate b`. The same is also true for `a lrotate (32-b)`. It can be optimized to `a rrotate b`. This patch adds following patterns: a rrotate (32-b) -> a lrotate b a lrotate (32-b) -> a rrotate b Bootstrapped and tested on x86_64-linux-gnu

[PATCH v2] MATCH: Simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` [PR112472]

2024-10-16 Thread Eikansh Gupta
This patch simplify `(trunc)copysign ((extend)x, CST)` to `copysign (x, -1.0/1.0)` depending on the sign of CST. Previously, it was simplified to `copysign (x, CST)`. It can be optimized as the sign of the CST matters, not the value. The patch also simplify `(trunc)abs (extend x)` to `abs (x)`.

Re: [PATCH v1 2/4] aarch64: add minimal support for GCS build attributes

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:42, Richard Sandiford wrote: Since this is an RFC, it would probably be more helpful to get review comments about the design or the adherence to the spec. I'll need to look into things a bit more for that, though, so I'm afraid the below is more implementation trivia. Matthieu

Re: [committed] libstdc++: Fix Python deprecation warning in printers.py

2024-10-16 Thread Jonathan Wakely
On Wed, 16 Oct 2024 at 16:58, Tom Tromey wrote: > > > "Jonathan" == Jonathan Wakely writes: > > Jonathan> Using a keyword argument for count only became possible with Python > 3.1 > Jonathan> so introduce a new function to do the substitution. > > gdb docs are inconsistent on this, but at le

Re: [PATCH v1 1/4] aarch64: add debug comments to feature properties in .note.gnu.property

2024-10-16 Thread Matthieu Longo
On 2024-10-08 18:39, Richard Sandiford wrote: Sorry for the slow review. Matthieu Longo writes: GNU properties are emitted to provide some information about the features used in the generated code like PAC, BTI, or GCS. However, no debug comment are emitted in the generated assembly even if -d

Re: [committed] libstdc++: Fix Python deprecation warning in printers.py

2024-10-16 Thread Tom Tromey
> "Jonathan" == Jonathan Wakely writes: Jonathan> Using a keyword argument for count only became possible with Python 3.1 Jonathan> so introduce a new function to do the substitution. gdb docs are inconsistent on this, but at least one spot says that the minimum supported Python version is

[PATCH] libcpp: Fix ICE lexing invalid raw string in a deferred pragma [PR117118]

2024-10-16 Thread Lewis Hyatt
Hello- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117118 This fixes an old regression from GCC 11. Is it OK for trunk and all backports please? Bootstrap + regtested all languages on x86-64 Linux. Thanks! -Lewis -- >8 -- The PR shows that we ICE after lexing an invalid unterminated raw strin

[PATCH] c: Add u{,l,ll,imax}abs builtins [PR117024]

2024-10-16 Thread Jakub Jelinek
Hi! The following patch adds u{,l,ll,imax}abs builtins, which just fold to ABSU_EXPR, similarly to how {,l,ll,imax}abs builtins fold to ABS_EXPR. Tested on x86_64-linux, ok for trunk if it passes full bootstrap/regtest on x86_64-linux and i686-linux? 2024-10-16 Jakub Jelinek PR c/117

[PATCH v8] c++: Fix overeager Woverloaded-virtual with conversion operators [PR109918]

2024-10-16 Thread Simon Martin
Hi Jason, On 12 Oct 2024, at 4:51, Jason Merrill wrote: > On 10/11/24 7:02 AM, Simon Martin wrote: >> Hi Jason, >> >> On 11 Oct 2024, at 0:35, Jason Merrill wrote: >> >>> On 10/7/24 3:35 PM, Simon Martin wrote: On 7 Oct 2024, at 18:58, Jason Merrill wrote: > On 10/7/24 11:27 AM, Simon Ma

Re: [PATCH] SVE intrinsics: Add constant folding for svindex.

2024-10-16 Thread Jennifer Schmitz
I resubmitted an corrected version of this patch in https://gcc.gnu.org/pipermail/gcc-patches/2024-October/665648.html > On 16 Oct 2024, at 10:32, Jennifer Schmitz wrote: > > This patch folds svindex with constant arguments into a vector series. > We implemented this in svindex_impl::fold using

[PATCH] SVE intrinsics: Add constant folding for svindex.

2024-10-16 Thread Jennifer Schmitz
This patch folds svindex with constant arguments into a vector series. We implemented this in svindex_impl::fold using the function build_vec_series. For example, svuint64_t f1 () { return svindex_u642 (10, 3); } compiled with -O2 -march=armv8.2-a+sve, is folded to {10, 13, 16, ...} in the gimple

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2024-10-16 Thread Arnaud Charlet
> The base types are unchanged, the (non-private) subtypes defined in > System.C_Time only add range constraints preventing some obviously > invalid values. I do not understand how this could break existing > code, could you please give an example? OK, that should work indeed, so I withdraw my com

Re: PING - [PATCH][LRA][PR116550] Reuse scratch registers generated by LRA

2024-10-16 Thread Denis Chertykov
Just a reminder with CCing maintainer (Vladimir Makarov). Denis.

Re: [PATCH 3/7] libstdc++: Inline memmove optimizations for std::copy etc. [PR115444]

2024-10-16 Thread Jonathan Wakely
On Tue, 15 Oct 2024 at 15:29, Jonathan Wakely wrote: > > This is a slightly different approach to C++98 compatibility than used > in patch 1/1 of this series for the uninitialized algos. It worked out a > bit cleaner this way for these algos, I think. > > Tested x86_64-linux. > > -- >8 -- > > This

Re: [PATCH RFC] build: update bootstrap req to C++14

2024-10-16 Thread Jakub Jelinek
On Wed, Oct 16, 2024 at 11:04:32AM -0400, Jason Merrill wrote: > > Alternatively, systems (that care about Ada and D) running 4.7 could > > build 10.5, systems running 4.8 could build 11.5. > > Here's an updated patch. I tested C++14 bootstrap again with 5.x compilers, > and Jakub's dwarf2asm cha

Re: [PATCH] c: Add some checking asserts to named loops handling code

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Jakub Jelinek wrote: > Hi! > > Jonathan mentioned an unnamed static analyzer reported issue in > c_finish_bc_name. > It is actually a false positive, because the construction of the > loop_names vector guarantees that the last element of the vector > (if the vector is non-emp

Re: [PATCH] c: Fix up uninitialized next.original_type use in #embed optimization

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Jakub Jelinek wrote: > Hi! > > Jonathan pointed me at a diagnostic from an unnamed static analyzer > which found that next.original_type isn't initialized for the CPP_EMBED > case when it is parsed in a comma expression, yet > expr.original_type = next.original_type; > is d

Re: [PATCH RFC] build: update bootstrap req to C++14

2024-10-16 Thread Jason Merrill
On 9/20/24 11:51 AM, Jason Merrill wrote: On 9/19/24 4:37 PM, Jakub Jelinek wrote: On Thu, Sep 19, 2024 at 10:21:15AM -0400, Jason Merrill wrote: On 9/19/24 7:57 AM, Richard Biener wrote: On Wed, Sep 18, 2024 at 6:22 PM Jason Merrill wrote: Tested x86_64-pc-linux-gnu with 5.5.0 bootstrap co

[PATCH v2 9/9] aarch64: Handle alignment when it is bigger than BIGGEST_ALIGNMENT

2024-10-16 Thread Evgeny Karpov
Thursday, September 19, 2024 Richard Sandiford wrote: >> For instance: >> float __attribute__((aligned (32))) large_aligned_array[3]; >> >> BIGGEST_ALIGNMENT could be up to 512 bits on x64. >> This patch has been added to cover this case without needing to >> change the FFmpeg code. > > What goes

Re: [PATCH v3 2/5] openmp: Add support for iterators in map clauses (C/C++)

2024-10-16 Thread Jakub Jelinek
On Fri, Oct 11, 2024 at 04:59:27PM +0200, Jakub Jelinek wrote: > E.g. it would be IMHO fine if the gimplification is done in a similar way > how we do OMP_CLAUSE_REDUCTION_{INIT,MERGE} gimplification into > &OMP_CLAUSE_REDUCTION_GIMPLE_{INIT,MERGE}, instead of gimplifying the > map clause expressio

[committed] Add libgomp.oacc-fortran/acc_on_device-1-4.f (was: Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device: Harmonize 'libgomp.oacc-fortran/acc_on_device-1-*'

2024-10-16 Thread Tobias Burnus
Fixed the following commit Thomas Schwinge wrote: Pushed to trunk branch commit 9f549d216c9716e787aaa38593bc9f83195b60ae "Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device: Harmonize 'libgomp.oacc-fortran/acc_on_device-1-*'", see attached. by re-adding a te

[PATCH] RISC-V:Auto vect for vector bf16

2024-10-16 Thread Feng Wang
This patch add auto-vect patterns for vector-bfloat16 extension. Similar to vector extensions, these patterns can use vector BF16 instructions to optimize the automatic vectorization of for loops. gcc/ChangeLog: * config/riscv/vector-bfloat16.md (extend2): Add auto-vect pattern for

[PATCH 3/3] aarch64: Optimize vector rotates into REV* instructions where possible

2024-10-16 Thread Kyrylo Tkachov
Hi all, Some vector rotate operations can be implemented in a single instruction rather than using the fallback SHL+USRA sequence. In particular, when the rotate amount is half the bitwidth of the element we can use a REV64,REV32,REV16 instruction. This patch adds this transformation in the recent

[PATCH 2/3] PR 117048: aarch64: Add define_insn_and_split for vector ROTATE

2024-10-16 Thread Kyrylo Tkachov
Hi all, The ultimate goal in this PR is to match the XAR pattern that is represented as a (ROTATE (XOR X Y) VCST) from the ACLE intrinsics code in the testcase. The first blocker for this was the missing recognition of ROTATE in simplify-rtx, which is fixed in the previous patch. The next problem

[PATCH 1/3] PR 117048: simplify-rtx: Simplify (X << C1) [+,^] (X >> C2) into ROTATE

2024-10-16 Thread Kyrylo Tkachov
Hi all, The motivating testcase for this is in AArch64 intrinsics: uint64x2_t G2(uint64x2_t a, uint64x2_t b) { uint64x2_t c = veorq_u64(a, b); return veorq_u64(vaddq_u64(c, c), vshrq_n_u64(c, 63)); } which I was hoping to fold to a single XAR (a ROTATE+XOR instruction) but GCC was failin

Re: [PATCH] reassoc: Do not sort likely vectorizable ops by rank.

2024-10-16 Thread Richard Biener
On Wed, 16 Oct 2024, Robin Dapp wrote: > > Interesting - this is bleh | bswap (..), right, so having > > bla1 | (bleh | bla2) fails to recognize bla1 | bla2 as bswap. > > Yes, exactly. > > > I'd expect this kind of pattern to fail bswap detection easily > > if you mangle it a bit. So possibly b

Re: [PATCH] reassoc: Do not sort likely vectorizable ops by rank.

2024-10-16 Thread Robin Dapp
> Interesting - this is bleh | bswap (..), right, so having > bla1 | (bleh | bla2) fails to recognize bla1 | bla2 as bswap. Yes, exactly. > I'd expect this kind of pattern to fail bswap detection easily > if you mangle it a bit. So possibly bswap detection should learn > to better pick the "piec

Re: [Ping, Fortran, Patch, PR80235, v1] Fix ICE when coarray from module is referenced in submodule.

2024-10-16 Thread Paul Richard Thomas
Hi Andre, The handling of submodules is something of a kludge, especially where module procedures are concerned, that seems to work OK. Given that, your patch looks right and is good for mainline. Thanks for the patch. Paul On Wed, 16 Oct 2024 at 08:21, Andre Vehreschild wrote: > Hi all, > >

Re: [PATCH] reassoc: Do not sort likely vectorizable ops by rank.

2024-10-16 Thread Robin Dapp
> Hmm, reassoc isn't supposed to apply width > 1 before vectorization; > IIRC I "fixed" that at some point, but this is what I see: > > # sum_126 = PHI > ... > _23 = *pix_134; > _24 = (unsigned int) _23; > _31 = MEM[(uint8_t *)pix_134 + 1B]; > _32 = (unsigned int) _31; > _118 = _24 +

[PATCH v1] contrib/: Configure git-format-patch(1) to add To: gcc-patches@gcc.gnu.org

2024-10-16 Thread Alejandro Colomar
Just like we already do for git-send-email(1). In some cases, patches are prepared with git-format-patch(1), but are sent with a different program, or some flags to git-send-email(1) may accidentally inhibit the configuration. By adding the TO in the email file, we make sure that gcc-patches@ wil

[PATCH] c: Add some checking asserts to named loops handling code

2024-10-16 Thread Jakub Jelinek
Hi! Jonathan mentioned an unnamed static analyzer reported issue in c_finish_bc_name. It is actually a false positive, because the construction of the loop_names vector guarantees that the last element of the vector (if the vector is non-empty) always has either C_DECL_LOOP_NAME (l) or C_DECL_SWIT

Re: [PATCH] Ternary operator formatting fixes

2024-10-16 Thread Richard Biener
On Wed, 16 Oct 2024, Jakub Jelinek wrote: > Hi! > > While working on PR117028 C2Y changes, I've noticed weird ternary > operator formatting (operand1 ? operand2: operand3). > The usual formatting is operand1 ? operand2 : operand3 > where we have around 18000+ cases of that (counting only what fit

Re: testsuite: Prepare for -std=gnu23 default

2024-10-16 Thread Jakub Jelinek
On Wed, Oct 16, 2024 at 12:21:49PM +, Joseph Myers wrote: > On Wed, 16 Oct 2024, Jakub Jelinek wrote: > > > Generally, I'd prefer dg-additional-options for tests > > which don't already have dg-options into which one can just add the new > > flag, or as in the above cases where a new flag is a

[PATCH] c: Fix up uninitialized next.original_type use in #embed optimization

2024-10-16 Thread Jakub Jelinek
Hi! Jonathan pointed me at a diagnostic from an unnamed static analyzer which found that next.original_type isn't initialized for the CPP_EMBED case when it is parsed in a comma expression, yet expr.original_type = next.original_type; is done a few lines later and the expr is returned. Fixed th

Re: [PATCH] reassoc: Do not sort likely vectorizable ops by rank.

2024-10-16 Thread Richard Biener
On Wed, 16 Oct 2024, Robin Dapp wrote: > Hi, > > this is probably rather an RFC than a patch as I'm not sure whether > reassoc is the right place to fix it. On top, the heuristic might > be a bit "ad-hoc". Maybe we can also work around it in the vectorizer? > > The following function is vector

[PATCH v16b 2/4] gcc/: Rename array_type_nelts => array_type_nelts_minus_one

2024-10-16 Thread Alejandro Colomar
The old name was misleading. While at it, also rename some temporary variables that are used with this function, for consistency. Link: gcc/ChangeLog: *

[PATCH v16b 4/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
This operator is similar to sizeof but can only be applied to an array, and returns its number of elements. FUTURE DIRECTIONS: - We should make it work with array parameters to functions, and somehow magically return the number of elements of the array, regardless of it being really a poin

[PATCH v16b 3/4] gcc/: Merge definitions of array_type_nelts_top

2024-10-16 Thread Alejandro Colomar
There were two identical definitions, and none of them are available where they are needed for implementing __nelementsof__. Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for __nelementsof__, which will be added in the following commit. gcc/ChangeLog:

[PATCH v16b 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-16 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/gcc

[PATCH v16b 0/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
Hi! v16 changes: - Remove () from commit messages in function names. [Joseph] - Use __countof__ (name of the actual operator) in diagnostic messages. [Joseph] - Add CC (sorry for not CCing the patches to most people in v15; I accidentally suppressed most of them while sending). v16b is

Re: testsuite: Prepare for -std=gnu23 default

2024-10-16 Thread Jakub Jelinek
On Wed, Oct 16, 2024 at 11:01:49AM +, Joseph Myers wrote: > --- a/gcc/testsuite/c-c++-common/Wcast-function-type.c > +++ b/gcc/testsuite/c-c++-common/Wcast-function-type.c > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > -/* { dg-options "-Wcast-function-type" } */ > +/* { dg-options "-std=gnu17

Re: [PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Alejandro Colomar wrote: > On Wed, Oct 16, 2024 at 10:34:21AM GMT, Joseph Myers wrote: > > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > > > The old name was misleading. > > > > > > While at it, also rename some temporary variables that are used with > > > this functio

[PATCH] Ternary operator formatting fixes

2024-10-16 Thread Jakub Jelinek
Hi! While working on PR117028 C2Y changes, I've noticed weird ternary operator formatting (operand1 ? operand2: operand3). The usual formatting is operand1 ? operand2 : operand3 where we have around 18000+ cases of that (counting only what fits on one line) and indent -nbad -bap -nbc -bbo -bl -bli

[PATCH] reassoc: Do not sort likely vectorizable ops by rank.

2024-10-16 Thread Robin Dapp
Hi, this is probably rather an RFC than a patch as I'm not sure whether reassoc is the right place to fix it. On top, the heuristic might be a bit "ad-hoc". Maybe we can also work around it in the vectorizer? The following function is vectorized in a very inefficient way because we construct ve

Re: [PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Alejandro Colomar
On Wed, Oct 16, 2024 at 10:34:21AM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > The old name was misleading. > > > > While at it, also rename some temporary variables that are used with > > this function, for consistency. > > This patch is OK. Note that in Chan

Re: [PATCH v15 4/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 10:30:36AM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > + if (type_code != ARRAY_TYPE) > > +{ > > + error_at (loc, "invalid application of % to type %qT", > > type); > > + return error_mark_node; > > +} > > +

Re: [PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 16, 2024 at 10:34:21AM GMT, Joseph Myers wrote: > On Wed, 16 Oct 2024, Alejandro Colomar wrote: > > > The old name was misleading. > > > > While at it, also rename some temporary variables that are used with > > this function, for consistency. > > This patch is OK. Note

[committed] testsuite: Add tests for C23 __STDC_VERSION__

2024-10-16 Thread Joseph Myers
Add some tests for the value of __STDC_VERSION__ in C23 mode. Bootstrapped with no regressions for x86_64-pc-linux-gnu. * gcc.dg/c23-version-1.c, gcc.dg/c23-version-2.c, gcc.dg/gnu23-version-1.c: New tests. diff --git a/gcc/testsuite/gcc.dg/c23-version-1.c b/gcc/testsuite/gcc.dg

Re: [PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Alejandro Colomar wrote: > The old name was misleading. > > While at it, also rename some temporary variables that are used with > this function, for consistency. This patch is OK. Note that in ChangeLog entries as in other documentation, a function is referred to just as

Re: [PATCH v15 4/4] c: Add __countof__ operator

2024-10-16 Thread Joseph Myers
On Wed, 16 Oct 2024, Alejandro Colomar wrote: > + if (type_code != ARRAY_TYPE) > +{ > + error_at (loc, "invalid application of % to type %qT", type); > + return error_mark_node; > +} > + if (!COMPLETE_TYPE_P (type)) > +{ > + error_at (loc, > + "invalid appl

[PATCH v15 4/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
This operator is similar to sizeof but can only be applied to an array, and returns its number of elements. FUTURE DIRECTIONS: - We should make it work with array parameters to functions, and somehow magically return the number of elements of the array, regardless of it being really a poin

[PATCH v15 3/4] Merge definitions of array_type_nelts_top()

2024-10-16 Thread Alejandro Colomar
There were two identical definitions, and none of them are available where they are needed for implementing __nelementsof__. Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for __nelementsof__, which will be added in the following commit. gcc/ChangeLog:

[PATCH v15 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-16 Thread Alejandro Colomar
The old name was misleading. While at it, also rename some temporary variables that are used with this function, for consistency. Link: gcc/ChangeLog: *

[PATCH v15 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-16 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/gcc

[PATCH v15 0/4] c: Add __countof__ operator

2024-10-16 Thread Alejandro Colomar
v15 changes: - Rebase. - Remove (unused) changes under and . It was dead code. - Fix typos in comments. - Make format of changelog more consistent. - Add some links and CCs to the commit message. - Add Acked-by James K. Lowden. Quoting him: > Just to say, [...], you're ab

[PATCH] c, libcpp, v2: Partially implement C2Y N3353 paper [PR117028]

2024-10-16 Thread Jakub Jelinek
On Tue, Oct 15, 2024 at 05:40:58PM +, Joseph Myers wrote: > > --- gcc/testsuite/gcc.dg/cpp/c23-delimited-escape-seq-1.c.jj > > 2024-10-14 17:58:54.436815339 +0200 > > +++ gcc/testsuite/gcc.dg/cpp/c23-delimited-escape-seq-1.c 2024-10-14 > > 17:59:05.032666716 +0200 > > @@ -0,0 +1,87 @

[PATCH] Fix gcc.dg/vect/vect-early-break_39.c FAIL with forced SLP

2024-10-16 Thread Richard Biener
The testcases shows single-element interleaving of size three being exempted from permutation lowering via heuristics (see also PR116973). But it wasn't supposed to apply to non-power-of-two sizes so this amends the check to ensure the sub-group is aligned even when the number of lanes is one. Bo

[committed] libstdc++: Fix Python deprecation warning in printers.py

2024-10-16 Thread Jonathan Wakely
Tested x86_64-linux with gdb-15.1 and Python 3.12. Pushed to trunk, backports to follow. -- >8 -- python/libstdcxx/v6/printers.py:1355: DeprecationWarning: 'count' is passed as positional argument The Python docs say: Deprecated since version 3.13: Passing count and flags as positional ar

[PATCH] Enhance gather fallback for PR65518 with SLP

2024-10-16 Thread Richard Biener
With SLP forced we fail to use gather for PR65518 on RISC-V as expected because we're failing due to not effective peeling for gaps. The following appropriately moves the memory_access_type adjustment before doing all the overrun checking since using VMAT_ELEMENTWISE means there's no overrun. Boo

Re: [PATCH v2 34/36] arm: [MVE intrinsics] rework vadcq

2024-10-16 Thread Christophe Lyon
On 10/15/24 11:18, Richard Earnshaw wrote: On 14/10/2024 19:18, Richard Earnshaw (lists) wrote: On 04/09/2024 14:26, Christophe Lyon wrote: Implement vadcq using the new MVE builtins framework. We re-use most of the code introduced by the previous patch to support vadciq: we just need to in

Re: [PATCH v2 06/36] arm: [MVE intrinsics] rework vcvtq

2024-10-16 Thread Christophe Lyon
On 10/14/24 19:05, Richard Earnshaw (lists) wrote: On 04/09/2024 14:26, Christophe Lyon wrote: Implement vcvtq using the new MVE builtins framework. In config/arm/arm-mve-builtins-base.def, the patch also restores the alphabetical order. 2024-07-11 Christophe Lyon gcc/ *

  1   2   >