Fix undefined behaviour in profile_count::differs_from_p

2023-08-10 Thread Jan Hubicka via Gcc-patches
Hi, This patch avoid overflow in profile_count::differs_from_p and also makes it to return false from one of the values is undefined while other is defined. Bootstrapped/regtested x86_64-linux, comitted. gcc/ChangeLog: * profile-count.cc (profile_count::differs_from_p): Fix overflow and

[RFC PATCH v2] c++: extend cold, hot attributes to classes

2023-08-10 Thread Javier Martinez via Gcc-patches
Thanks for the comments, Jason. v2: + Fix formatting, remove unnecessarily warning. On Tue, Aug 8, 2023 at 10:28 PM Jason Merrill wrote: > Seems reasonable, but how do you expect this to be used? We have large applications where some large classes are known to be used only at startup. Marking

Re: [RFC PATCH v2] c++: extend cold, hot attributes to classes

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 14:06, Javier Martinez wrote: Thanks for the comments, Jason. v2: + Fix formatting, remove unnecessarily warning. On Tue, Aug 8, 2023 at 10:28 PM Jason Merrill > wrote: > Seems reasonable, but how do you expect this to be used? We have large applications

[PATCH] rtl-optimization/110939 Really fix narrow comparison of memory and constant

2023-08-10 Thread Stefan Schulze Frielinghaus via Gcc-patches
In the former fix in commit 41ef5a34161356817807be3a2e51fbdbe575ae85 I completely missed the fact that the normal form of a generated constant for a mode with fewer bits than in HOST_WIDE_INT is a sign extended version of the actual constant. This even holds true for unsigned constants. Fixed by

RE: Intel AVX10.1 Compiler Design and Support

2023-08-10 Thread Jiang, Haochen via Gcc-patches
Hi all, There are lots of discussions on arch level and ABIs and I really appreciate that. For the arch level issue, it might be a little early to discuss and should not block these patches. For ABI issue, the problem actually comes from the current behavior between GCC and clang/LLVM are

RE: Intel AVX10.1 Compiler Design and Support

2023-08-10 Thread Zhang, Annita via Gcc-patches
For ABI change proposal, I'd suggest to raise a discussion in x86-64-abi group. Thx, Annita > -Original Message- > From: Jiang, Haochen > Sent: Thursday, August 10, 2023 10:15 PM > To: Beulich, Jan ; Phoebe Wang > > Cc: Joseph Myers ; Wang, Phoebe > ; Hongtao Liu ; gcc- >

[PATCH] c, c++, v2: Accept __builtin_classify_type (typename)

2023-08-10 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping this patch. Reposting it as I found a typo in the documentation - s/builtin-in/built-in/. Bootstrapped/regtested again on x86_64-linux and i686-linux, ok for trunk? On Mon, Jun 12, 2023 at 09:57:17PM +0200, Jakub Jelinek via Gcc-patches wrote: > As mentioned in my

Re: Intel AVX10.1 Compiler Design and Support

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 03:08:31PM +, Jiang, Haochen via Gcc-patches wrote: > There are lots of discussions on arch level and ABIs and I really appreciate > that. > > For the arch level issue, it might be a little early to discuss and should > not block > these patches. > > For ABI issue,

Fix profile update in duplicat_loop_body_to_header_edge for loops with 0 count_in

2023-08-10 Thread Jan Hubicka via Gcc-patches
Hi, this patch makes duplicate_loop_body_to_header_edge to not drop profile counts to uninitialized when count_in is 0. This happens because profile_probability in 0 count is undefined. Bootstrapped/regtested x86_64-linux, committed. gcc/ChangeLog: * cfgloopmanip.cc

Re: [PATCH] c++: improve debug_tree for templated types/decls

2023-08-10 Thread Patrick Palka via Gcc-patches
On Tue, 8 Aug 2023, Jason Merrill wrote: > On 7/31/23 20:34, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > > > -- >8 -- > > > > gcc/cp/ChangeLog: > > > > * ptree.cc (cxx_print_decl): Check for DECL_LANG_SPECIFIC and > > TS_DECL_COMMON only

[Committed] RISC-V: Add Ztso atomic mappings

2023-08-10 Thread Patrick O'Neill
Committed - thanks! On 8/8/23 14:54, Palmer Dabbelt wrote: On Tue, 08 Aug 2023 14:52:14 PDT (-0700), Patrick O'Neill wrote: The RISC-V Ztso extension currently has no effect on generated code. With the additional ordering constraints guarenteed by Ztso, we can emit more optimized atomic

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

2023-08-10 Thread Martin Uecker
Am Donnerstag, dem 10.08.2023 um 10:58 -0400 schrieb Siddhesh Poyarekar: > On 2023-08-10 10:47, Martin Uecker wrote: > > Am Donnerstag, dem 10.08.2023 um 16:42 +0200 schrieb Jakub Jelinek: > > > On Thu, Aug 10, 2023 at 04:38:21PM +0200, Martin Uecker wrote: > > > > Am Donnerstag, dem 10.08.2023 um

Re: Intel AVX10.1 Compiler Design and Support

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 03:08:11PM +, Zhang, Annita via Gcc-patches wrote: > > IMO it is not acceptable for AVX10-256 to generate zmm registers. > > > > If I have to choose among the three proposal, the second is better. > > > > But the best choice I suppose is to keep what we are doing

[PATCH] stdckdint.h _BitInt test

2023-08-10 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch (on top of the stdckdint.h patch and _BitInt patch series) adds a test for _BitInt diagnostics of ckd_{add,sub,mul} macros. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-08-10 Jakub Jelinek * gcc.dg/stdckdint-3.c: New test. ---

[PATCH] config: Fix host -rdynamic detection for build != host != target

2023-08-10 Thread Joseph Myers
The GCC_ENABLE_PLUGINS configure logic for detecting whether -rdynamic is necessary and supported uses an appropriate objdump for $host binaries (running on $build) in cases where $host is $build or $target. However, it is missing such logic in the case where $host is neither $build nor $target,

Re: c: Support for -Wuseless-cast [RR84510]

2023-08-10 Thread Joseph Myers
On Thu, 10 Aug 2023, Martin Uecker via Gcc-patches wrote: > c: Support for -Wuseless-cast [RR84510] > > Add support for Wuseless-cast C (and ObjC). > > PR c/84510 > > gcc/c/: > * c-typeck.cc (build_c_cast): Add warning. > > gcc/doc/: > * invoke.texi: Update. >

Re: [PATCH] tree-optimization/110963 - more PRE when optimizing for size

2023-08-10 Thread Richard Biener via Gcc-patches
> Am 10.08.2023 um 17:01 schrieb Jeff Law via Gcc-patches > : > >  > >> On 8/10/23 06:41, Richard Biener via Gcc-patches wrote: >> The following adjusts the heuristic when we perform PHI insertion >> during GIMPLE PRE from requiring at least one edge that is supposed >> to be optimized for

Re: [PATCH] libatomic: Improve ifunc selection on AArch64

2023-08-10 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, >>> Answering my own question, N1 does not officially have FEAT_LSE2. >> >> It doesn't indeed. However most cores support atomic 128-bit load/store >> (part of LSE2), so we can still use the LSE2 ifunc for those cores. Since >> there >> isn't a feature bit for this in the CPU or

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

2023-08-10 Thread Qing Zhao via Gcc-patches
Hi, Martin, > On Aug 10, 2023, at 11:18 AM, Martin Uecker wrote: > > Am Donnerstag, dem 10.08.2023 um 10:58 -0400 schrieb Siddhesh Poyarekar: >> On 2023-08-10 10:47, Martin Uecker wrote: >>> Am Donnerstag, dem 10.08.2023 um 16:42 +0200 schrieb Jakub Jelinek: On Thu, Aug 10, 2023 at

Fix profile updating bug in tree-ssa-threadupdate

2023-08-10 Thread Jan Hubicka via Gcc-patches
Hi, ssa_fix_duplicate_block_edges later calls update_profile to correct profile after threading. In the testcase this does not work since we lose track of the duplicated edge. This happens because redirect_edge_and_branch returns NULL if the edge already has correct destination which is the

Re: [PATCH] VR-VALUES: Simplify comparison using range pairs

2023-08-10 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 10, 2023 at 12:18 AM Richard Biener via Gcc-patches wrote: > > On Wed, Aug 9, 2023 at 6:16 PM Andrew Pinski via Gcc-patches > wrote: > > > > If `A` has a range of `[0,0][100,INF]` and the comparison > > of `A < 50`. This should be optimized to `A <= 0` (which then > > will be

Re: [PATCH] c++: dependently scoped template-id in type-req [PR110927]

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 12:08, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 13? OK. -- >8 -- Here we're incorrectly rejecting the first type-requirement at parse time with concepts-requires35.C:14:56: error: ‘typename A::B’ is not a

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

2023-08-10 Thread Qing Zhao via Gcc-patches
> On Aug 10, 2023, at 12:39 PM, Jakub Jelinek wrote: > > On Thu, Aug 10, 2023 at 12:30:06PM -0400, Siddhesh Poyarekar wrote: >> The definition of __bos/__bdos allows us the freedom to *estimate* rather >> than be precise, so I'd go for sizeof(x) + N * sizeof(*x.a) since it's bound >> to give

Re: [PATCH] c++: recognize in-class var tmpl partial spec [PR71954]

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 12:08, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- This makes us recognize variable template partial specializations defined directly inside the class body. It seems to suffice to call

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

2023-08-10 Thread Martin Uecker
Am Donnerstag, dem 10.08.2023 um 13:59 + schrieb Qing Zhao: > > > On Aug 10, 2023, at 2:58 AM, Martin Uecker wrote: > > > > Am Mittwoch, dem 09.08.2023 um 20:10 + schrieb Qing Zhao: > > > > > > > On Aug 9, 2023, at 12:21 PM, Michael Matz wrote: > > > > I am not sure for the reason

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

2023-08-10 Thread Martin Uecker
Am Donnerstag, dem 10.08.2023 um 16:42 +0200 schrieb Jakub Jelinek: > On Thu, Aug 10, 2023 at 04:38:21PM +0200, Martin Uecker wrote: > > Am Donnerstag, dem 10.08.2023 um 13:59 + schrieb Qing Zhao: > > > > > > > On Aug 10, 2023, at 2:58 AM, Martin Uecker wrote: > > > > > > > > Am Mittwoch,

Re: [PATCH] libatomic: Improve ifunc selection on AArch64

2023-08-10 Thread Richard Henderson via Gcc-patches
On 8/10/23 02:50, Wilco Dijkstra wrote: Hi Richard, Why would HWCAP_USCAT not be set by the kernel? Failing that, I would think you would check ID_AA64MMFR2_EL1.AT. Answering my own question, N1 does not officially have FEAT_LSE2. It doesn't indeed. However most cores support atomic

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-10 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: >> static bool >> is_simple_vla_size (poly_uint64 size) >> { >> if (size.is_constant ()) >> return false; >> for (int i = 1; i < ARRAY_SIZE (size.coeffs); ++i) >> if (size[i] != (i <= 1 ? size[0] : 0)) > Just wondering is this should be (i == 1 ? size[0] :

Re: [PATCH] tree-optimization/110963 - more PRE when optimizing for size

2023-08-10 Thread Jeff Law via Gcc-patches
On 8/10/23 09:05, Richard Biener wrote: Am 10.08.2023 um 17:01 schrieb Jeff Law via Gcc-patches :  On 8/10/23 06:41, Richard Biener via Gcc-patches wrote: The following adjusts the heuristic when we perform PHI insertion during GIMPLE PRE from requiring at least one edge that is

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

2023-08-10 Thread Siddhesh Poyarekar
On 2023-08-10 12:39, Jakub Jelinek wrote: On Thu, Aug 10, 2023 at 12:30:06PM -0400, Siddhesh Poyarekar wrote: The definition of __bos/__bdos allows us the freedom to *estimate* rather than be precise, so I'd go for sizeof(x) + N * sizeof(*x.a) since it's bound to give the more conservative

Re: [PATCH] c++: bogus warning w/ deduction guide in anon ns [PR106604]

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 12:09, Patrick Palka wrote: Booststrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 13? -- >8 -- We shouldn't issue a "declared static but never defined" warning for a deduction guide (declared in an anonymous namespace). PR c++/106604

Re: [RFC] GCC Security policy

2023-08-10 Thread Richard Sandiford via Gcc-patches
Siddhesh Poyarekar writes: > On 2023-08-08 10:30, Siddhesh Poyarekar wrote: >>> Do you have a suggestion for the language to address libgcc, >>> libstdc++, etc. and libiberty, libbacktrace, etc.? >> >> I'll work on this a bit and share a draft. > > Hi David, > > Here's what I came up with for

Re: [RFC] GCC Security policy

2023-08-10 Thread Richard Biener via Gcc-patches
> Am 10.08.2023 um 20:28 schrieb Richard Sandiford : > > Siddhesh Poyarekar writes: >> On 2023-08-08 10:30, Siddhesh Poyarekar wrote: Do you have a suggestion for the language to address libgcc, libstdc++, etc. and libiberty, libbacktrace, etc.? >>> >>> I'll work on this a bit

Re: [PATCH] Use strtol instead of std::stoi in gensupport.cc

2023-08-10 Thread John David Anglin
Ping. On 2023-07-19 2:59 p.m., John David Anglin wrote: Tested on trunk with hppa64-hp-hpux11.11. Okay? Dave --- Use strtol instead of std::stoi [PR110646] Implementation of std::stoi was overlooked on hppa-hpux, so use strtol instead. 2023-07-19 John David Anglin gcc/ChangeLog:

Re: [PATCH] c++: bogus warning w/ deduction guide in anon ns [PR106604]

2023-08-10 Thread Patrick Palka via Gcc-patches
On Thu, 10 Aug 2023, Jason Merrill wrote: > On 8/10/23 12:09, Patrick Palka wrote: > > Booststrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > trunk and perhaps 13? > > > > -- >8 -- > > > > We shouldn't issue a "declared static but never defined" warning > > for a

Re: [PATCH] c, c++, v2: Accept __builtin_classify_type (typename)

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 11:35, Jakub Jelinek wrote: Hi! I'd like to ping this patch. Reposting it as I found a typo in the documentation - s/builtin-in/built-in/. Bootstrapped/regtested again on x86_64-linux and i686-linux, ok for trunk? On Mon, Jun 12, 2023 at 09:57:17PM +0200, Jakub Jelinek via

Re: Intel AVX10.1 Compiler Design and Support

2023-08-10 Thread Joseph Myers
On Thu, 10 Aug 2023, Richard Biener via Gcc-patches wrote: > Isn't this situation similar to the not defined ABI when passing generic > vectors (via __attribute__((vector_size))) that do not map to vectors > supported > by the current ISA? There's cases like vector<2> char or vector<1> double >

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

2023-08-10 Thread Siddhesh Poyarekar
On 2023-08-10 10:47, Martin Uecker wrote: Am Donnerstag, dem 10.08.2023 um 16:42 +0200 schrieb Jakub Jelinek: On Thu, Aug 10, 2023 at 04:38:21PM +0200, Martin Uecker wrote: Am Donnerstag, dem 10.08.2023 um 13:59 + schrieb Qing Zhao: On Aug 10, 2023, at 2:58 AM, Martin Uecker wrote: Am

[PATCH 13/12 v2] C _BitInt incremental fixes [PR102989]

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 12:10:07PM +0200, Jakub Jelinek via Gcc-patches wrote: > Here is an incremental patch which does that: Bootstrap/regtest on i686-linux (next to x86_64-linux where it went fine) revealed I forgot to add { target bitint } to dg-do compile lines. Here is an updated patch

[PATCH] c, v2: Add stdckdint.h header for C23

2023-08-10 Thread Jakub Jelinek via Gcc-patches
Hi! Here is an updated version of the stdckdint.h patch. It is dependent on the 2 patches I've just sent. Compared to the June version of the patch, this one will #include_next if possible the same header from the C library, so that the responsibility to maintain it can be shared between the

[PATCH] c++: dependently scoped template-id in type-req [PR110927]

2023-08-10 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 13? -- >8 -- Here we're incorrectly rejecting the first type-requirement at parse time with concepts-requires35.C:14:56: error: ‘typename A::B’ is not a template [-fpermissive] We also incorrectly

[PATCH] c++: recognize in-class var tmpl partial spec [PR71954]

2023-08-10 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- This makes us recognize variable template partial specializations defined directly inside the class body. It seems to suffice to call check_explicit_specialization when we see a static TEMPLATE_ID_EXPR data

[PATCH] c++: bogus warning w/ deduction guide in anon ns [PR106604]

2023-08-10 Thread Patrick Palka via Gcc-patches
Booststrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 13? -- >8 -- We shouldn't issue a "declared static but never defined" warning for a deduction guide (declared in an anonymous namespace). PR c++/106604 gcc/cp/ChangeLog: * decl.cc

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

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 04:38:21PM +0200, Martin Uecker wrote: > Am Donnerstag, dem 10.08.2023 um 13:59 + schrieb Qing Zhao: > > > > > On Aug 10, 2023, at 2:58 AM, Martin Uecker wrote: > > > > > > Am Mittwoch, dem 09.08.2023 um 20:10 + schrieb Qing Zhao: > > > > > > > > > On Aug 9,

Re: [PATCH] tree-optimization/110963 - more PRE when optimizing for size

2023-08-10 Thread Jeff Law via Gcc-patches
On 8/10/23 06:41, Richard Biener via Gcc-patches wrote: The following adjusts the heuristic when we perform PHI insertion during GIMPLE PRE from requiring at least one edge that is supposed to be optimized for speed to also doing insertion when the expression is available on all edges (but

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

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 12:30:06PM -0400, Siddhesh Poyarekar wrote: > The definition of __bos/__bdos allows us the freedom to *estimate* rather > than be precise, so I'd go for sizeof(x) + N * sizeof(*x.a) since it's bound > to give the more conservative answer of the two. To be precise, we have

Re: [PATCHv2] Use toplevel configure for GMP and MPFR for gdb

2023-08-10 Thread Arsen Arsenović via Gcc-patches
Matthias Klose via Gcc-patches writes: > On 10.11.22 20:05, apinski--- via Binutils wrote: >> From: Andrew Pinski >> This patch uses the toplevel configure parts for GMP/MPFR for >> gdb. The only thing is that gdb now requires MPFR for building. >> Before it was a recommended but not required

Re: [PATCH] c++: improve debug_tree for templated types/decls

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 16:59, Patrick Palka wrote: On Tue, 8 Aug 2023, Jason Merrill wrote: On 7/31/23 20:34, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- gcc/cp/ChangeLog: * ptree.cc (cxx_print_decl): Check for DECL_LANG_SPECIFIC and

Re: [PATCH v4] Implement new RTL optimizations pass: fold-mem-offsets.

2023-08-10 Thread Jeff Law via Gcc-patches
On 8/10/23 03:28, Manolis Tsamis wrote: Hi Jeff, Thanks a lot for providing all this information and testcase! I have been able to reproduce the issue with it. I have investigated the cause of the issue and it's not what you mention, the uses of all intermediate calculations are properly

[PATCH] c, v2: Add __typeof_unqual__ and __typeof_unqual support

2023-08-10 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping this patch. Reposting it as the extend.texi hunk didn't apply cleanly anymore. Bootstrapped/regtested again on x86_64-linux and i686-linux, ok for trunk? On Mon, Jun 12, 2023 at 09:51:22PM +0200, Jakub Jelinek via Gcc-patches wrote: > As I mentioned in my stdckdint.h mail,

[PATCH] match.pd, v2: Implement missed optimization ((x ^ y) & z) | x -> (z & y) | x [PR109938]

2023-08-10 Thread Jakub Jelinek via Gcc-patches
Hi! On Thu, Aug 10, 2023 at 12:28:24PM +0200, Jakub Jelinek via Gcc-patches wrote: > On Tue, Aug 08, 2023 at 03:18:51PM +0200, Richard Biener via Gcc-patches > wrote: > > On Fri, Aug 4, 2023 at 11:49 PM Drew Ross via Gcc-patches > > wrote: > > > > > > Adds a simplification for ((x ^ y) & z) | x

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

2023-08-10 Thread Siddhesh Poyarekar
On 2023-08-10 11:18, Martin Uecker wrote: Am Donnerstag, dem 10.08.2023 um 10:58 -0400 schrieb Siddhesh Poyarekar: On 2023-08-10 10:47, Martin Uecker wrote: Am Donnerstag, dem 10.08.2023 um 16:42 +0200 schrieb Jakub Jelinek: On Thu, Aug 10, 2023 at 04:38:21PM +0200, Martin Uecker wrote: Am

Re: [PATCH] MATCH: [PR110937/PR100798] (a ? ~b : b) should be optimized to b ^ -(a)

2023-08-10 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 10, 2023 at 6:39 AM Christophe Lyon via Gcc-patches wrote: > > Hi Andrew, > > > On Wed, 9 Aug 2023 at 21:20, Andrew Pinski via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > > > This adds a simple match pattern for this case. > > I noticed it a couple of different places. > > One

Re: [RFC] GCC Security policy

2023-08-10 Thread Siddhesh Poyarekar
On 2023-08-10 14:28, Richard Sandiford wrote: Siddhesh Poyarekar writes: On 2023-08-08 10:30, Siddhesh Poyarekar wrote: Do you have a suggestion for the language to address libgcc, libstdc++, etc. and libiberty, libbacktrace, etc.? I'll work on this a bit and share a draft. Hi David,

Re: [PATCH] Fix PR 110954: wrong code with cmp | !cmp

2023-08-10 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 10, 2023 at 12:32 AM Richard Biener via Gcc-patches wrote: > > On Thu, Aug 10, 2023 at 2:21 AM Andrew Pinski via Gcc-patches > wrote: > > > > This was an oversight on my part not realizing that > > comparisons in generic can have a non-boolean type. > > This means if we have `(f < 0)

Re: [PATCH] c++: bogus warning w/ deduction guide in anon ns [PR106604]

2023-08-10 Thread Jason Merrill via Gcc-patches
On 8/10/23 16:40, Patrick Palka wrote: On Thu, 10 Aug 2023, Jason Merrill wrote: On 8/10/23 12:09, Patrick Palka wrote: Booststrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 13? -- >8 -- We shouldn't issue a "declared static but never defined" warning

[committed] libstdc++: Fix out-of-bounds read in format string "{:{}." [PR110974]

2023-08-10 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/110974 * include/std/format (_Spec::_S_parse_width_or_precision): Check for empty range before dereferencing iterator. *

Re: [PATCH] c, c++, v2: Accept __builtin_classify_type (typename)

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 05:44:20PM -0400, Jason Merrill wrote: > Hmm, you really think there's any code at all in the wild relying on > __builtin_classify_type + array/function decay? It's a (previously) Looking at the first uses of the builtin back in 90s in va*.h, it certainly relied on

Re: [PATCH] RISC-V: Handle no_insn in TARGET_SCHED_VARIABLE_ISSUE.

2023-08-10 Thread Jin Ma via Gcc-patches
> On 5/29/23 06:46, Jeff Law wrote: > > > > > > On 5/29/23 05:01, Jin Ma wrote: > >> Reference: > >> https://github.com/gcc-mirror/gcc/commit/d0bc0cb66bcb0e6a5a5a31a9e900e8ccc98e34e5 > >> > >> RISC-V should also be implemented to handle no_insn patterns for > >> pipelining. > >> > >>

[PATCH v1] RISC-V: Support RVV VFNMSAC rounding mode intrinsic API

2023-08-10 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFNMSAC for the below samples. * __riscv_vfnmsac_vv_f32m1_rm * __riscv_vfnmsac_vv_f32m1_rm_m * __riscv_vfnmsac_vf_f32m1_rm * __riscv_vfnmsac_vf_f32m1_rm_m Signed-off-by: Pan Li gcc/ChangeLog: *

Re: [PATCH] stdckdint.h _BitInt test

2023-08-10 Thread Joseph Myers
On Thu, 10 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > Hi! > > The following patch (on top of the stdckdint.h patch and _BitInt patch > series) adds a test for _BitInt diagnostics of ckd_{add,sub,mul} macros. I remain unconvinced that diagnosing use with types where it's clear what the

[PATCH v1] RISC-V: Support RVV VFMSAC rounding mode intrinsic API

2023-08-10 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFMSAC for the below samples. * __riscv_vfmsac_vv_f32m1_rm * __riscv_vfmsac_vv_f32m1_rm_m * __riscv_vfmsac_vf_f32m1_rm * __riscv_vfmsac_vf_f32m1_rm_m Signed-off-by: Pan Li gcc/ChangeLog: (class vfmsac_frm):

Re: [PATCH v1] RISC-V: Support RVV VFMSAC rounding mode intrinsic API

2023-08-10 Thread juzhe.zh...@rivai.ai
LGTM juzhe.zh...@rivai.ai From: pan2.li Date: 2023-08-11 10:28 To: gcc-patches CC: juzhe.zhong; jeffreyalaw; pan2.li; yanzhang.wang; kito.cheng Subject: [PATCH v1] RISC-V: Support RVV VFMSAC rounding mode intrinsic API From: Pan Li This patch would like to support the rounding mode API for

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

2023-08-10 Thread François Dumont via Gcc-patches
I hadn't tested the most basic default configuration and it is failing, I need some more time yet. François On 10/08/2023 07:13, François Dumont wrote: Hi I've eventually completed this work. This evolution will allow to build libstdc++ without dual abi and using cxx11 abi. For the moment

[PATCHv2] Fix PR 110954: wrong code with cmp | !cmp

2023-08-10 Thread Andrew Pinski via Gcc-patches
This was an oversight on my part forgetting that cmp will might have a different true value than all ones but will have a value of 1 in most cases. This means if we have `(f < 0) | !(f < 0)` we would optimize this to -1 rather than just 1. This is version 2 of the patch. Decided to go down a

Re: [PATCH] RISC-V: Handle no_insn in TARGET_SCHED_VARIABLE_ISSUE.

2023-08-10 Thread Palmer Dabbelt
On Thu, 10 Aug 2023 19:12:06 PDT (-0700), gcc-patches@gcc.gnu.org wrote: On 5/29/23 06:46, Jeff Law wrote: > > > On 5/29/23 05:01, Jin Ma wrote: >> Reference: >> https://github.com/gcc-mirror/gcc/commit/d0bc0cb66bcb0e6a5a5a31a9e900e8ccc98e34e5 >> >> RISC-V should also be implemented to

Re: [PATCH] RISC-V: Handle no_insn in TARGET_SCHED_VARIABLE_ISSUE.

2023-08-10 Thread Palmer Dabbelt
On Thu, 10 Aug 2023 20:19:02 PDT (-0700), jeffreya...@gmail.com wrote: On 8/10/23 20:30, Palmer Dabbelt wrote: Sorry for being lost here, but I'm not sure where TYPE_UNKNOWN comes from.  There's not a whole lot of instances in the code, and they all seem to be doing something very special. 

[committed] libstdc++: Fix std::format for localized floats [PR110968]

2023-08-10 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- The __formatter_fp::_M_localize function just returns an empty string if the formatting locale is the C locale, as there is nothing to do. But the caller was assuming that the returned string contains the localized

Fix division by zero in tree-ssa-loop-split

2023-08-10 Thread Jan Hubicka via Gcc-patches
Hi, Profile update I added to tree-ssa-loop-split can divide by zero in situation that the conditional is predicted with 0 probability which is triggered by jump threading update in the testcase. gcc/ChangeLog: PR middle-end/110923 * tree-ssa-loop-split.cc (split_loop): Watch for

Re: [PATCH] c, v2: Add __typeof_unqual__ and __typeof_unqual support

2023-08-10 Thread Joseph Myers
On Thu, 10 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > I'd like to ping this patch. Reposting it as the extend.texi hunk > didn't apply cleanly anymore. Bootstrapped/regtested again on x86_64-linux > and i686-linux, ok for trunk? OK. -- Joseph S. Myers jos...@codesourcery.com

[committed] libstdc++: Use alias template for iterator_category [PR110970]

2023-08-10 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- This renames __iterator_category_t to __iter_category_t, for consistency with std::iter_value_t, std::iter_difference_t and std::iter_reference_t in C++20. Then use __iter_category_t in , which fixes the problem of the

Re: [PATCH] VR-VALUES: Simplify comparison using range pairs

2023-08-10 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 10, 2023 at 12:08 PM Andrew Pinski wrote: > > On Thu, Aug 10, 2023 at 12:18 AM Richard Biener via Gcc-patches > wrote: > > > > On Wed, Aug 9, 2023 at 6:16 PM Andrew Pinski via Gcc-patches > > wrote: > > > > > > If `A` has a range of `[0,0][100,INF]` and the comparison > > > of `A <

[PATCH] Software mitigation: Disable gather generation in vectorization for GDS affected Intel Processors.

2023-08-10 Thread liuhongt via Gcc-patches
For more details of GDS (Gather Data Sampling), refer to https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/gather-data-sampling.html After microcode update, there's performance regression. To avoid that, the patch disables gather

Re: [PATCH] c, c++, v2: Accept __builtin_classify_type (typename)

2023-08-10 Thread Joseph Myers
On Thu, 10 Aug 2023, Jason Merrill via Gcc-patches wrote: > On 8/10/23 11:35, Jakub Jelinek wrote: > > Hi! > > > > I'd like to ping this patch. Reposting it as I found a typo in the > > documentation - s/builtin-in/built-in/. Bootstrapped/regtested again > > on x86_64-linux and i686-linux, ok

Re: [committed] libstdc++: Use alias template for iterator_category [PR110970]

2023-08-10 Thread Jonathan Wakely via Gcc-patches
On Thu, 10 Aug 2023 at 23:34, Jonathan Wakely via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. > > -- >8 -- > > This renames __iterator_category_t to __iter_category_t, for consistency > with std::iter_value_t,

Re: [PATCH] RISC-V: Handle no_insn in TARGET_SCHED_VARIABLE_ISSUE.

2023-08-10 Thread Jeff Law via Gcc-patches
On 8/10/23 20:30, Palmer Dabbelt wrote: Sorry for being lost here, but I'm not sure where TYPE_UNKNOWN comes from.  There's not a whole lot of instances in the code, and they all seem to be doing something very special.  Is it just something we didn't do a '(set_attr "type" ...)' on?

RE: [PATCH v1] RISC-V: Support RVV VFMSAC rounding mode intrinsic API

2023-08-10 Thread Li, Pan2 via Gcc-patches
Committed, thanks Juzhe. Pan From: juzhe.zh...@rivai.ai Sent: Friday, August 11, 2023 11:11 AM To: Li, Pan2 ; gcc-patches Cc: jeffreyalaw ; Li, Pan2 ; Wang, Yanzhang ; kito.cheng Subject: Re: [PATCH v1] RISC-V: Support RVV VFMSAC rounding mode intrinsic API LGTM

Re: [PATCH] Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all gather/scatter instructions.

2023-08-10 Thread Uros Bizjak via Gcc-patches
On Thu, Aug 10, 2023 at 3:13 AM liuhongt wrote: > > Currently we have 3 different independent tunes for gather > "use_gather,use_gather_2parts,use_gather_4parts", > similar for scatter, there're > "use_scatter,use_scatter_2parts,use_scatter_4parts" > > The patch support 2 standardizing options to

Re: [PATCH] i386: Do not sanitize upper part of V2HFmode and V4HFmode reg with -fno-trapping-math [PR110832]

2023-08-10 Thread Hongtao Liu via Gcc-patches
On Thu, Aug 10, 2023 at 2:06 PM Hongtao Liu wrote: > > On Thu, Aug 10, 2023 at 2:01 PM Uros Bizjak via Gcc-patches > wrote: > > > > On Thu, Aug 10, 2023 at 2:49 AM liuhongt wrote: > > > > > > Also add ix86_partial_vec_fp_math to to condition of V2HF/V4HF named > > > patterns in order to avoid

Re: [PATCH] i386: Do not sanitize upper part of V2HFmode and V4HFmode reg with -fno-trapping-math [PR110832]

2023-08-10 Thread Uros Bizjak via Gcc-patches
On Thu, Aug 10, 2023 at 2:49 AM liuhongt wrote: > > Also add ix86_partial_vec_fp_math to to condition of V2HF/V4HF named > patterns in order to avoid generation of partial vector V8HFmode > trapping instructions. > > Bootstrapped and regtseted on x86_64-pc-linux-gnu{-m32,} > Ok for trunk? > >

Re: [PATCH] i386: Do not sanitize upper part of V2HFmode and V4HFmode reg with -fno-trapping-math [PR110832]

2023-08-10 Thread Hongtao Liu via Gcc-patches
On Thu, Aug 10, 2023 at 2:01 PM Uros Bizjak via Gcc-patches wrote: > > On Thu, Aug 10, 2023 at 2:49 AM liuhongt wrote: > > > > Also add ix86_partial_vec_fp_math to to condition of V2HF/V4HF named > > patterns in order to avoid generation of partial vector V8HFmode > > trapping instructions. > >

Re: [PATCH] Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all gather/scatter instructions.

2023-08-10 Thread Hongtao Liu via Gcc-patches
On Thu, Aug 10, 2023 at 2:04 PM Uros Bizjak via Gcc-patches wrote: > > On Thu, Aug 10, 2023 at 3:13 AM liuhongt wrote: > > > > Currently we have 3 different independent tunes for gather > > "use_gather,use_gather_2parts,use_gather_4parts", > > similar for scatter, there're > >

Re: [PATCH 3/12] phiopt: Fix phiopt ICE on vops [PR102989]

2023-08-10 Thread Richard Biener via Gcc-patches
On Wed, 9 Aug 2023, Jakub Jelinek wrote: > On Wed, Aug 09, 2023 at 01:06:22PM -0700, Andrew Pinski wrote: > > That was my next thought, returning NULL from > > single_non_singleton_phi_for_edges if it would return a virtual OP > > might be better even. > > Either version of these patches are ok

Re: [PATCH 0/12] GCC _BitInt support [PR102989]

2023-08-10 Thread Richard Biener via Gcc-patches
On Wed, 9 Aug 2023, Joseph Myers wrote: > On Wed, 9 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > > > - _Complex _BitInt(N) isn't supported; again mainly because none of the > > psABIs > > mention how those should be passed/returned; in a limited way they are > > supported internally

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

2023-08-10 Thread Martin Uecker
Am Mittwoch, dem 09.08.2023 um 20:10 + schrieb Qing Zhao: > > > On Aug 9, 2023, at 12:21 PM, Michael Matz wrote: ... > > By definition, the sizeof() of a struct with FAM might not be the same as the > non-FAM one. > i.e, for the following two structures, one with FAM, the other with

Re: [PATCH 0/12] GCC _BitInt support [PR102989]

2023-08-10 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 10, 2023 at 06:55:05AM +, Richard Biener wrote: > On Wed, 9 Aug 2023, Joseph Myers wrote: > > > On Wed, 9 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > > > > > - _Complex _BitInt(N) isn't supported; again mainly because none of the > > > psABIs > > > mention how those

Re: [PATCH] Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all gather/scatter instructions.

2023-08-10 Thread Richard Biener via Gcc-patches
On Thu, Aug 10, 2023 at 3:13 AM liuhongt wrote: > > Currently we have 3 different independent tunes for gather > "use_gather,use_gather_2parts,use_gather_4parts", > similar for scatter, there're > "use_scatter,use_scatter_2parts,use_scatter_4parts" > > The patch support 2 standardizing options to

Re: [PATCH] Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all gather/scatter instructions.

2023-08-10 Thread Richard Biener via Gcc-patches
On Thu, Aug 10, 2023 at 9:42 AM Uros Bizjak wrote: > > On Thu, Aug 10, 2023 at 9:40 AM Richard Biener > wrote: > > > > On Thu, Aug 10, 2023 at 3:13 AM liuhongt wrote: > > > > > > Currently we have 3 different independent tunes for gather > > > "use_gather,use_gather_2parts,use_gather_4parts", >

[PATCH V2] VECT: Support loop len control on EXTRACT_LAST vectorization

2023-08-10 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richard and Richi. This patch add support live vectorization by VEC_EXTRACT for LEN loop control. Consider this following case: #include #define EXTRACT_LAST(TYPE) \ TYPE __attribute__ ((noinline, noclone)) \ test_##TYPE (TYPE *x, int n,

Re: [PATCH] Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all gather/scatter instructions.

2023-08-10 Thread Hongtao Liu via Gcc-patches
On Thu, Aug 10, 2023 at 3:49 PM Richard Biener via Gcc-patches wrote: > > On Thu, Aug 10, 2023 at 9:42 AM Uros Bizjak wrote: > > > > On Thu, Aug 10, 2023 at 9:40 AM Richard Biener > > wrote: > > > > > > On Thu, Aug 10, 2023 at 3:13 AM liuhongt wrote: > > > > > > > > Currently we have 3

Re: [PATCH V2] VECT: Support loop len control on EXTRACT_LAST vectorization

2023-08-10 Thread Richard Biener via Gcc-patches
On Thu, 10 Aug 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, Richard and Richi. > > This patch add support live vectorization by VEC_EXTRACT for LEN loop control. > > Consider this following case: > > #include > > #define EXTRACT_LAST(TYPE)\ > TYPE

[PATCH v1] RISC-V: Support RVV VFNMACC rounding mode intrinsic API

2023-08-10 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFNMACC for the below samples. * __riscv_vfnmacc_vv_f32m1_rm * __riscv_vfnmacc_vv_f32m1_rm_m * __riscv_vfnmacc_vf_f32m1_rm * __riscv_vfnmacc_vf_f32m1_rm_m Signed-off-by: Pan Li gcc/ChangeLog: *

Re: Re: [PATCH V2] VECT: Support loop len control on EXTRACT_LAST vectorization

2023-08-10 Thread juzhe.zh...@rivai.ai
>> I guess as a temporary thing your approach is OK but we shouldn't >> add these as part of new code - it's supposed to handle legacy >> cases that we didn't fixup yet. Do you mean we need to fix LC SSA PHI flow so that we don't need to set vinfo->any_known_not_updated_vssa = true ? After it's

Re: [PATCH v1] RISC-V: Support RVV VFNMACC rounding mode intrinsic API

2023-08-10 Thread Kito Cheng via Gcc-patches
LGTM On Thu, Aug 10, 2023 at 4:20 PM Pan Li via Gcc-patches wrote: > > From: Pan Li > > This patch would like to support the rounding mode API for the > VFNMACC for the below samples. > > * __riscv_vfnmacc_vv_f32m1_rm > * __riscv_vfnmacc_vv_f32m1_rm_m > * __riscv_vfnmacc_vf_f32m1_rm > *

[PATCH] RISC-V: Support TU for integer ternary OP[PR110964]

2023-08-10 Thread Juzhe-Zhong
PR target/110964 gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_cond_len_ternop): Add integer ternary. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr110964.c: New test. --- gcc/config/riscv/riscv-v.cc | 3 +--

Re: [PATCH v4] Implement new RTL optimizations pass: fold-mem-offsets.

2023-08-10 Thread Manolis Tsamis
Hi Jeff, Thanks a lot for providing all this information and testcase! I have been able to reproduce the issue with it. I have investigated the cause of the issue and it's not what you mention, the uses of all intermediate calculations are properly taken into account. In this case it would be

[PATCH V2 1/3] RISC-V: Part-1: Select suitable vector registers for vector type args and returns

2023-08-10 Thread Lehua Ding
I have posted below the vector register calling convention rules from in the proposal[1]: v0 is used to pass the first vector mask argument to a function, and to return vector mask result from a function. v8-v23 are used to pass vector data arguments, vector tuple arguments and the rest vector

[PATCH V2 0/3] RISC-V: Add an experimental vector calling convention

2023-08-10 Thread Lehua Ding
Hi RISC-V folks, This patch implement the proposal of RISC-V vector calling convention[1] and this feature can be enabled by `--param=riscv-vector-abi` option. Currently, all vector type arguments and return values are pass by reference. With this patch, these arguments and return values can pass

Re: [PATCH 1/3] RISC-V: Part-1: Select suitable vector registers for vector type args and returns

2023-08-10 Thread Lehua Ding
Thanks so much for Kito's online and offline comments. I have upload V2 patchswhich address all comments. https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626935.html Best, Lehua --Original-- From:

Re: [PATCH 1/12] expr: Small optimization [PR102989]

2023-08-10 Thread Richard Biener via Gcc-patches
On Wed, 9 Aug 2023, Jakub Jelinek wrote: > Hi! > > Small optimization to avoid testing modifier multiple times. OK. Richard. > 2023-08-09 Jakub Jelinek > > PR c/102989 > * expr.cc (expand_expr_real_1) : Add an early return for > EXPAND_WRITE or EXPAND_MEMORY modifiers to

  1   2   >