[Bug target/110892] New: [14 Regression] Risc-V rvv testsuite failures caused by conditional move costing

2023-08-03 Thread ewlu at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110892 Bug ID: 110892 Summary: [14 Regression] Risc-V rvv testsuite failures caused by conditional move costing Product: gcc Version: 14.0 Status: UNCONFIRMED

Re: One question on the source code of tree-object-size.cc

2023-08-03 Thread Qing Zhao via Gcc-patches
> On Aug 3, 2023, at 12:15 PM, Siddhesh Poyarekar wrote: > > On 2023-08-02 10:02, Qing Zhao wrote: >> /*when checking the observed access p->array, we only have info on the >> observed access, i.e, the TYPE_SIZE info from the access. We don't have >> info on the whole object. */ >>

[PATCHv2] Fix PR 110874: infinite loop in gimple_bitwise_inverted_equal_p with fre

2023-08-03 Thread Andrew Pinski via Gcc-patches
This changes gimple_bitwise_inverted_equal_p to use a 2 different match patterns to try to match bit_not wrapped with a possible nop_convert and a comparison also wrapped with a possible nop_convert. This is to avoid being recursive. OK? Bootstrapped and tested on x86_64-linux-gnu with no

[Bug c/95130] GCC ignoring attribute(format(gnu_printf)) on printf in mingw

2023-08-03 Thread tomas.kalibera at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95130 --- Comment #17 from Tomas Kalibera --- (In reply to Tomas Kalibera from comment #16) > (In reply to Julian Waters from comment #15) > > It seems like the patch also doesn't fix the strftime case too, strangely > > enough. gcc with that patch

[PATCH] Add documentation for -Wflex-array-member-not-at-end.

2023-08-03 Thread Qing Zhao via Gcc-patches
When adding the option -Wflex-array-member-not-at-end in the commit https://gcc.gnu.org/pipermail/gcc-cvs/2023-June/385730.html the documentation for this new option was missing. This patch is to add the documentation for this warning option. bootstrapped and also checked the documentation, no

Re: One question on the source code of tree-object-size.cc

2023-08-03 Thread Siddhesh Poyarekar
On 2023-08-02 10:02, Qing Zhao wrote: /*when checking the observed access p->array, we only have info on the observed access, i.e, the TYPE_SIZE info from the access. We don't have info on the whole object. */ expect(__builtin_dynamic_object_size(q->array, 1), q->foo *

[Bug tree-optimization/110891] [14 Regression] Dead Code Elimination Regression since r14-2674-gd0de3bf9175

2023-08-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110891 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug middle-end/110728] should __attribute__((cleanup())) callback get invoked for indirect edges of asm goto

2023-08-03 Thread matz at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110728 --- Comment #11 from Michael Matz --- (In reply to Michael Matz from comment #9) > Just for completeness: I agree with Andrew that the initial code example in > comment #0 doesn't show any problem. The edge from asmgoto to l0 doesn't > cross >

[Bug tree-optimization/110891] [14 Regression] Dead Code Elimination Regression since r14-2674-gd0de3bf9175

2023-08-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110891 Andrew Pinski changed: What|Removed |Added Keywords||missed-optimization Target

[Bug tree-optimization/110891] New: [14 Regression] Dead Code Elimination Regression since r14-2674-gd0de3bf9175

2023-08-03 Thread theodort at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110891 Bug ID: 110891 Summary: [14 Regression] Dead Code Elimination Regression since r14-2674-gd0de3bf9175 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity:

[Bug middle-end/110728] should __attribute__((cleanup())) callback get invoked for indirect edges of asm goto

2023-08-03 Thread ndesaulniers at google dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110728 --- Comment #10 from Nick Desaulniers --- (In reply to Michael Matz from comment #9) > That has to do with how we need to (possibly) > split > critical edges, which changes label identity, which in turn might actually > be the thing that's

Re: [PATCH v2] analyzer: stash values for CPython plugin [PR107646]

2023-08-03 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-03 at 11:28 -0400, Eric Feng wrote: > On Wed, Aug 2, 2023 at 5:09 PM David Malcolm > wrote: > > > > On Wed, 2023-08-02 at 14:46 -0400, Eric Feng wrote: > > [...snip...] > > > > >  Otherwise, please let me know if I should request write > > > access first (the GettingStarted

Re: [PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-03 at 15:54 +0100, Matthew Malcomson wrote: > On 8/3/23 15:09, David Malcolm wrote: > > > > Hi Matthew.  I recently touched the timevar code (in r14-2881- > > g75d623946d4b6e) to add support for serializing the timevar data in > > JSON form as part of the SARIF output (PR

Re: [COMMITTEDv3] tree-optimization: [PR100864] `(a&!b) | b` is not opimized to `a | b` for comparisons

2023-08-03 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 3, 2023 at 4:58 AM Mikael Morin wrote: > > Hello, > > Le 31/07/2023 à 19:07, Andrew Pinski via Gcc-patches a écrit : > > diff --git a/gcc/generic-match-head.cc b/gcc/generic-match-head.cc > > index a71c0727b0b..ddaf22f2179 100644 > > --- a/gcc/generic-match-head.cc > > +++

Re: [PATCH v2] analyzer: stash values for CPython plugin [PR107646]

2023-08-03 Thread Eric Feng via Gcc-patches
On Wed, Aug 2, 2023 at 5:09 PM David Malcolm wrote: > > On Wed, 2023-08-02 at 14:46 -0400, Eric Feng wrote: > > On Wed, Aug 2, 2023 at 1:20 PM Marek Polacek > > wrote: > > > > > > On Wed, Aug 02, 2023 at 12:59:28PM -0400, David Malcolm wrote: > > > > On Wed, 2023-08-02 at 12:20 -0400, Eric Feng

Re: [PATCH v1] [RFC] Improve folding for comparisons with zero in tree-ssa-forwprop.

2023-08-03 Thread Jeff Law via Gcc-patches
On 8/3/23 01:04, Richard Biener wrote: On Wed, Aug 2, 2023 at 4:08 PM Manolis Tsamis wrote: Hi all, I'm pinging to discuss again if we want to move this forward for GCC14. I did some testing again and I haven't been able to find obvious regressions, including testing the code from

Re: Fix profile upate after vectorizer peeling

2023-08-03 Thread Aldy Hernandez via Gcc-patches
On 8/3/23 16:29, Jeff Law wrote: On 8/3/23 08:23, Jan Hubicka wrote: Jeff, an help would be appreciated here :) I will try to debug this.  One option would be to disable branch prediciton on vect_check for time being - it is not inlined anyway Not a lot of insight.  The backwards threader

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Jeff Law via Gcc-patches
On 8/3/23 08:56, Kito Cheng wrote: That'll be the first thing to look at. THe costing change was supposed only affect if-then-else constructs, not sets in general. If so, I think the most simple fix is adding more checks on the set cost - only check the SET_SRC is if-then-else? No, the

[committed][RISC-V] Remove errant hunk of code

2023-08-03 Thread Jeff Law via Gcc-patches
I'm using this hunk locally to more thoroughly exercise the zicond paths due to inaccuracies elsewhere in the costing model. It was never supposed to be part of the costing commit though. And as we've seen it's causing problems with the vector bits. While my testing isn't complete, this

Re: [PATCH] gcc-14/changes.html: Deprecate a GCC C extension on flexible array members.

2023-08-03 Thread Qing Zhao via Gcc-patches
> On Aug 3, 2023, at 3:10 AM, Richard Biener wrote: > > On Mon, Jul 10, 2023 at 9:12 PM Qing Zhao via Gcc-patches > wrote: >> >> Hi, >> >> This is the change for the GCC14 releaes Notes on the deprecating of a C >> extension about flexible array members. >> >> Okay for committing? >> >>

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Kito Cheng via Gcc-patches
> >> That'll be the first thing to look at. THe costing change was supposed > >> only affect if-then-else constructs, not sets in general. > > > > > > If so, I think the most simple fix is adding more checks on the set > > cost - only check the SET_SRC is if-then-else? > No, the simple fix is to

Re: [PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread Matthew Malcomson via Gcc-patches
On 8/3/23 15:09, David Malcolm wrote: Hi Matthew. I recently touched the timevar code (in r14-2881- g75d623946d4b6e) to add support for serializing the timevar data in JSON form as part of the SARIF output (PR analyzer/109361). Looking at your patch, it looks like the baseline for the patch

[Bug analyzer/110882] [13 Regression] ICE with -fanalyzer on zero-sized array

2023-08-03 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110882 David Malcolm changed: What|Removed |Added CC||asolokha at gmx dot com --- Comment #6

[Bug analyzer/108171] [13/14 Regression] ICE in binding_key::make, at analyzer/store.cc:132 since r13-4529-gdfe2ef7f2b6cac70

2023-08-03 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108171 David Malcolm changed: What|Removed |Added Resolution|--- |DUPLICATE Status|ASSIGNED

[committed] testsuite, analyzer: add test case [PR108171]

2023-08-03 Thread David Malcolm via Gcc-patches
The ICE in PR analyzer/108171 appears to be a dup of the recently fixed PR analyzer/110882 and is likewise fixed by it; adding this test case. Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2957-gf80efa49b7a163. gcc/testsuite/ChangeLog: PR analyzer/108171

[Bug analyzer/110882] [13 Regression] ICE with -fanalyzer on zero-sized array

2023-08-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110882 --- Comment #5 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:f80efa49b7a1639b0d6e9bcea8cf38850d037a02 commit r14-2957-gf80efa49b7a1639b0d6e9bcea8cf38850d037a02 Author: David Malcolm Date:

[Bug analyzer/108171] [13/14 Regression] ICE in binding_key::make, at analyzer/store.cc:132 since r13-4529-gdfe2ef7f2b6cac70

2023-08-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108171 --- Comment #6 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:f80efa49b7a1639b0d6e9bcea8cf38850d037a02 commit r14-2957-gf80efa49b7a1639b0d6e9bcea8cf38850d037a02 Author: David Malcolm Date:

RE: [PATCH v1] RISC-V: Fix one comment for binop_frm insn

2023-08-03 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Kito Cheng Sent: Thursday, August 3, 2023 10:35 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; Wang, Yanzhang Subject: Re: [PATCH v1] RISC-V: Fix one comment for binop_frm insn lgtm On Thu, Aug 3, 2023 at

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Jeff Law via Gcc-patches
On 8/3/23 08:31, Kito Cheng wrote: I am working on that, it seems the cost of vsetvli instruction become 0 due to this change, then loop invariant motion won't hoist vsetvli longer. I haven't looked yet (generating baseline rvv.exp data right now). But before I went to bed last night I was

Re: [v2 PATCH 2/2] bpf: CO-RE builtins support tests.

2023-08-03 Thread Jose E. Marchesi via Gcc-patches
OK. Thanks. > Hi, > > Resending this patch since I have noticed I had a testcase added in > previous patch. Makes more sense here. > > Thanks, > Cupertino > > From 334e9ae0f428f6573f2a5e8a3067a4d181b8b9c5 Mon Sep 17 00:00:00 2001 > From: Cupertino Miranda > Date: Thu, 27 Jul 2023 18:05:22

Re: [v2 PATCH 1/2] bpf: Implementation of BPF CO-RE builtins

2023-08-03 Thread Jose E. Marchesi via Gcc-patches
Ok. Thanks! > From fda9603ded735205b6e20fc5b65a04f8d15685e6 Mon Sep 17 00:00:00 2001 > From: Cupertino Miranda > Date: Thu, 6 Apr 2023 15:22:48 +0100 > Subject: [PATCH v2 1/2] bpf: Implementation of BPF CO-RE builtins > > This patch updates the support for the BPF CO-RE builtins >

[Bug middle-end/110728] should __attribute__((cleanup())) callback get invoked for indirect edges of asm goto

2023-08-03 Thread matz at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110728 Michael Matz changed: What|Removed |Added CC||matz at gcc dot gnu.org --- Comment #9

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

2023-08-03 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFMACC for the below samples. * __riscv_vfmacc_vv_f32m1_rm * __riscv_vfmacc_vv_f32m1_rm_m * __riscv_vfmacc_vf_f32m1_rm * __riscv_vfmacc_vf_f32m1_rm_m Signed-off-by: Pan Li gcc/ChangeLog: *

Re: [PATCH 1/2] bpf: Implementation of BPF CO-RE builtins

2023-08-03 Thread Jose E. Marchesi via Gcc-patches
> Jose E. Marchesi writes: > >>> This patch updates the support for the BPF CO-RE builtins >>> __builtin_preserve_access_index and __builtin_preserve_field_info, >>> and adds support for the CO-RE builtins __builtin_btf_type_id, >>> __builtin_preserve_type_info and __builtin_preserve_enum_value.

Re: [PATCH v1] RISC-V: Fix one comment for binop_frm insn

2023-08-03 Thread Kito Cheng via Gcc-patches
lgtm On Thu, Aug 3, 2023 at 10:32 PM wrote: > > From: Pan Li > > The previous patch missed the vfsub comment for binop_frm, this > patch would like to fix this. > > Signed-off-by: Pan Li > > gcc/ChangeLog: > > * config/riscv/riscv-vector-builtins-bases.cc: Add vfsub. > --- >

[PATCH v1] RISC-V: Fix one comment for binop_frm insn

2023-08-03 Thread Pan Li via Gcc-patches
From: Pan Li The previous patch missed the vfsub comment for binop_frm, this patch would like to fix this. Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: Add vfsub. --- gcc/config/riscv/riscv-vector-builtins-bases.cc | 1 + 1 file changed, 1

Re: [PATCH 3/3] genmatch: Log line numbers indirectly

2023-08-03 Thread Andrzej Turko via Gcc-patches
Thank you for the review. Yes, this increases the binary size. I have implemented this in the third version of this patch series, is that what you had in mind? Originally, this change increased the sizes of binaries 8-12 kB, but after updating the master branch, this change would actually

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Kito Cheng via Gcc-patches
> > I am working on that, it seems the cost of vsetvli instruction become 0 > > due to this change, then loop invariant motion won't hoist vsetvli longer. > I haven't looked yet (generating baseline rvv.exp data right now). But > before I went to bed last night I was worried that a change snuck >

Re: Fix profile upate after vectorizer peeling

2023-08-03 Thread Jeff Law
On 8/3/23 08:23, Jan Hubicka wrote: Jeff, an help would be appreciated here :) I will try to debug this. One option would be to disable branch prediciton on vect_check for time being - it is not inlined anyway Not a lot of insight. The backwards threader uses a totally different API for

[Bug analyzer/108171] [13/14 Regression] ICE in binding_key::make, at analyzer/store.cc:132 since r13-4529-gdfe2ef7f2b6cac70

2023-08-03 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108171 David Malcolm changed: What|Removed |Added Status|NEW |ASSIGNED --- Comment #5 from David

Re: Fix profile upate after vectorizer peeling

2023-08-03 Thread Jan Hubicka via Gcc-patches
> > Jeff, an help would be appreciated here :) > > > > I will try to debug this. One option would be to disable branch > > prediciton on vect_check for time being - it is not inlined anyway > Not a lot of insight. The backwards threader uses a totally different API > for the CFG/SSA updates and

[PATCH 1/3 v3] Support get_or_insert in ordered_hash_map

2023-08-03 Thread Andrzej Turko via Gcc-patches
Get_or_insert method is already supported by the unordered hash map. Adding it to the ordered map enables us to replace the unordered map with the ordered one in cases where ordering may be useful. Signed-off-by: Andrzej Turko gcc/ChangeLog: * ordered-hash-map.h: Add get_or_insert.

[PATCH 0/3 v3] genmatch: Speed up recompilation after changes to match.pd

2023-08-03 Thread Andrzej Turko via Gcc-patches
The following reduces the number of object files that need to be rebuilt after match.pd has been modified. Right now a change to match.pd which adds/removes a line almost always forces recompilation of all files that genmatch generates from it. This is because of unnecessary changes to the

[PATCH 2/3 v3] genmatch: Reduce variability of generated code

2023-08-03 Thread Andrzej Turko via Gcc-patches
So far genmatch has been using an unordered map to store information about functions to be generated. Since corresponding locations from match.pd were used as keys in the map, even small changes to match.pd which caused line number changes would change the order in which the functions are

[PATCH 3/3 v3] genmatch: Log line numbers indirectly

2023-08-03 Thread Andrzej Turko via Gcc-patches
Currently fprintf calls logging to a dump file take line numbers in the match.pd file directly as arguments. When match.pd is edited, referenced code changes line numbers, which causes changes to many fprintf calls and, thus, to many (usually all) .cc files generated by genmatch. This forces make

Re: [PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-03 at 14:38 +0100, Matthew Malcomson via Gcc-patches wrote: > > > > I think this is undesriable.  With fused you mean we use FMA? > > I think you could use -ffp-contract=off for the TU instead. > > > > Note you can't use __attribute__((noinline)) literally since the > > host

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Jeff Law via Gcc-patches
On 8/3/23 07:56, Kito Cheng wrote: I am working on that, it seems the cost of vsetvli instruction become 0 due to this change, then loop invariant motion won't hoist vsetvli longer. I haven't looked yet (generating baseline rvv.exp data right now). But before I went to bed last night I was

[Bug c++/104278] ICE with class non-type template parameter with a value depdenent constexpr call

2023-08-03 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104278 Patrick Palka changed: What|Removed |Added Status|ASSIGNED|RESOLVED Target Milestone|---

[Bug c++/102553] ICE (seg fault) in strip_array_types with NTTP and template alias

2023-08-03 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102553 Patrick Palka changed: What|Removed |Added Resolution|--- |FIXED Target Milestone|---

[Bug c++/103346] ICE on template specialization via alias template with a non-type parameter pack, and fold expression on lambda calls

2023-08-03 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103346 Patrick Palka changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Kito Cheng via Gcc-patches
I am working on that, it seems the cost of vsetvli instruction become 0 due to this change, then loop invariant motion won't hoist vsetvli longer. Jeff Law 於 2023年8月3日 週四 21:49 寫道: > > > On 8/3/23 03:27, juzhe.zh...@rivai.ai wrote: > > >

[Bug analyzer/110882] [13 Regression] ICE with -fanalyzer on zero-sized array

2023-08-03 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110882 David Malcolm changed: What|Removed |Added Summary|[13/14 Regression] ICE with |[13 Regression] ICE with

Re: Fix profile upate after vectorizer peeling

2023-08-03 Thread Jeff Law
On 8/3/23 04:13, Jan Hubicka wrote: Note most of the profile consistency checks FAIL when testing with -m32 on x86_64-unknown-linux-gnu ... For example vect-11.c has ;; basic block 4, loop depth 0, count 719407024 (estimated locally, freq 0.6700), maybe hot ;; Invalid sum of incoming

[committed] analyzer: fix ICE on zero-sized arrays [PR110882]

2023-08-03 Thread David Malcolm via Gcc-patches
Successfully bootstrapped and regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2955-gc62f93d1e0383d. gcc/analyzer/ChangeLog: PR analyzer/110882 * region.cc (int_size_in_bits): Fail on zero-sized types. gcc/testsuite/ChangeLog: PR analyzer/110882 *

Re: [PATCH 3/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

2023-08-03 Thread Jeff Law via Gcc-patches
On 8/3/23 03:27, juzhe.zh...@rivai.ai wrote: https://github.com/gcc-mirror/gcc/commit/e15d0b6680d10d7666195e9db65581364ad5e5df This patch causes so many fails in the regression: Mine. I'll take care of it.

[Bug analyzer/110882] [13/14 Regression] ICE with -fanalyzer on zero-sized array

2023-08-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110882 --- Comment #3 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:c62f93d1e0383def445d4ef2b812468cb7cdaf05 commit r14-2955-gc62f93d1e0383def445d4ef2b812468cb7cdaf05 Author: David Malcolm Date:

Re: [PATCH]AArch64 update costing for MLA by invariant

2023-08-03 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> >> Do you see vect_constant_defs in practice, or is this just for >> >> completeness? >> >> I would expect any constants to appear as direct operands. I don't >> >> mind keeping it if it's just a belt-and-braces thing though. >> > >> > In the latency case where I had

[PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread Matthew Malcomson via Gcc-patches
> > I think this is undesriable. With fused you mean we use FMA? > I think you could use -ffp-contract=off for the TU instead. > > Note you can't use __attribute__((noinline)) literally since the > host compiler might not support this. > > Richard. > Trying to make the timevar store

[PATCH] [libbacktrace] fix up broken test

2023-08-03 Thread Richard Biener via Gcc-patches
zstdtest has some inline data where some testcases lack the uncompressed length field. Thus it computes that but still ends up allocating memory for the uncompressed buffer based on that (zero) length. Oops. Causes memory corruption if the allocator returns non-NULL. Tested on

Re: [PATCH V5 1/2] Add overflow API for plus minus mult on range

2023-08-03 Thread Andrew MacLeod via Gcc-patches
This is OK. On 8/2/23 22:18, Jiufu Guo wrote: Hi, I would like to have a ping on this patch. BR, Jeff (Jiufu Guo) Jiufu Guo writes: Hi, As discussed in previous reviews, adding overflow APIs to range-op would be useful. Those APIs could help to check if overflow happens when operating

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

2023-08-03 Thread Richard Sandiford via Gcc-patches
Richard Sandiford writes: > Prathamesh Kulkarni writes: >> On Tue, 25 Jul 2023 at 18:25, Richard Sandiford >> wrote: >>> >>> Hi, >>> >>> Thanks for the rework and sorry for the slow review. >> Hi Richard, >> Thanks for the suggestions! Please find my responses inline below. >>> >>> Prathamesh

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

2023-08-03 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Tue, 25 Jul 2023 at 18:25, Richard Sandiford > wrote: >> >> Hi, >> >> Thanks for the rework and sorry for the slow review. > Hi Richard, > Thanks for the suggestions! Please find my responses inline below. >> >> Prathamesh Kulkarni writes: >> > Hi Richard, >> >

[Bug tree-optimization/110838] [14 Regression] wrong code on x365-3.5, -O3, sign extraction

2023-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110838 Richard Biener changed: What|Removed |Added Known to work||14.0 --- Comment #9 from Richard

RE: [PATCH]AArch64 update costing for MLA by invariant

2023-08-03 Thread Tamar Christina via Gcc-patches
> >> Do you see vect_constant_defs in practice, or is this just for > >> completeness? > >> I would expect any constants to appear as direct operands. I don't > >> mind keeping it if it's just a belt-and-braces thing though. > > > > In the latency case where I had allow_constants the early

Re: [PATCH] tree-optimization/110838 - vectorization of widened shifts

2023-08-03 Thread Richard Biener via Gcc-patches
On Wed, 2 Aug 2023, Richard Sandiford wrote: > Richard Biener writes: > > [...] > >> >> in vect_determine_precisions_from_range. Maybe we should drop > >> >> the shift handling from there and instead rely on > >> >> vect_determine_precisions_from_users, extending: > >> >> > >> >> if

[Bug tree-optimization/110838] [14 Regression] wrong code on x365-3.5, -O3, sign extraction

2023-08-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110838 --- Comment #8 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:29370f1387274ad5a35a020db6a5d06c0324e6c1 commit r14-2952-g29370f1387274ad5a35a020db6a5d06c0324e6c1 Author: Richard Biener Date:

Re: [PATCH]AArch64 Undo vec_widen_shiftl optabs [PR106346]

2023-08-03 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> > + >> > +(define_constraint "D3" >> > + "@internal >> > + A constraint that matches vector of immediates that is with 0 to >> > +(bits(mode)/2)-1." >> > + (and (match_code "const,const_vector") >> > + (match_test "aarch64_const_vec_all_same_in_range_p (op, 0, >>

Re: [PATCH] poly_int: Handle more can_div_trunc_p cases

2023-08-03 Thread Richard Biener via Gcc-patches
On Thu, Aug 3, 2023 at 2:46 PM Richard Sandiford via Gcc-patches wrote: > > can_div_trunc_p (a, b, , ) tries to compute a Q and r that > satisfy the usual conditions for truncating division: > > (1) a = b * Q + r > (2) |b * Q| <= |a| > (3) |r| < |b| > > We can compute Q using the

Re: Re: [PATCH V2] RISC-V: Support CALL conditional autovec patterns

2023-08-03 Thread 钟居哲
No. prepare_ternary can not be seperate patch. It's a bug fix patch which is discovered in autovectorization. Thanks for comments. I will commit it when middle-end is approved by Richi. >> As to the lmul = 8 ICE, is the problem that the register allocator >> would actually need 5 "registers"

[PATCH] poly_int: Handle more can_div_trunc_p cases

2023-08-03 Thread Richard Sandiford via Gcc-patches
can_div_trunc_p (a, b, , ) tries to compute a Q and r that satisfy the usual conditions for truncating division: (1) a = b * Q + r (2) |b * Q| <= |a| (3) |r| < |b| We can compute Q using the constant component (the case when all indeterminates are zero). Since |r| < |b| for the

RE: [PATCH]AArch64 Undo vec_widen_shiftl optabs [PR106346]

2023-08-03 Thread Tamar Christina via Gcc-patches
> > + > > +(define_constraint "D3" > > + "@internal > > + A constraint that matches vector of immediates that is with 0 to > > +(bits(mode)/2)-1." > > + (and (match_code "const,const_vector") > > + (match_test "aarch64_const_vec_all_same_in_range_p (op, 0, > > +

[Bug tree-optimization/110702] [12/13 Regression] Wrong code at -O1 on x86_64-linux-gnu (regression since GCC-12.2)

2023-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110702 Richard Biener changed: What|Removed |Added Summary|[12/13/14 Regression] Wrong |[12/13 Regression] Wrong

[Bug tree-optimization/110702] [12/13/14 Regression] Wrong code at -O1 on x86_64-linux-gnu (regression since GCC-12.2)

2023-08-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110702 --- Comment #6 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:13dfb01e5c30c3bd09333ac79d6ff96a617fea67 commit r14-2951-g13dfb01e5c30c3bd09333ac79d6ff96a617fea67 Author: Richard Biener Date:

[PATCH] tree-optimization/110702 - avoid zero-based memory references in IVOPTs

2023-08-03 Thread Richard Biener via Gcc-patches
Sometimes IVOPTs chooses a weird induction variable which downstream leads to issues. Most of the times we can fend those off during costing by rejecting the candidate but it looks like the address description costing synthesizes is different from what we end up generating so the following fixes

[COMMITTED] ada: Rewrite Set_Image_*_Unsigned routines to remove recursion.

2023-08-03 Thread Marc Poulhiès via Gcc-patches
From: Vasiliy Fofanov This rewriting removes algorithm inefficiencies due to unnecessary recursion and copying. The new version has much smaller and statically known stack requirements and is additionally up to 2x faster. gcc/ada/ * libgnat/s-imageb.adb (Set_Image_Based_Unsigned):

[COMMITTED] ada: Add pragma Annotate for GNATcheck exemptions

2023-08-03 Thread Marc Poulhiès via Gcc-patches
From: Sheri Bernstein Exempt the GNATcheck rule "Improper_Returns" with the rationale "early returns for performance". gcc/ada/ * libgnat/s-aridou.adb: Add pragma to exempt Improper_Returns. * libgnat/s-atopri.adb (Lock_Free_Try_Write): Likewise. * libgnat/s-bitops.adb

[COMMITTED] ada: Adjust again address arithmetics in System.Dwarf_Lines

2023-08-03 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Using the operator of System.Storage_Elements has introduced a range check that may be tripped on, so this removes the intermediate conversion to the Storage_Count subtype that is responsible for it. gcc/ada/ * libgnat/s-dwalin.adb ("-"): New subtraction operator.

[COMMITTED] ada: Fix spurious error on 'Input of private type with Type_Invariant aspect

2023-08-03 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The problem is that it is necessary to break the privacy during the expansion of the Input attribute, which may introduce a view mismatch with the parameter of the routine checking the invariant of the type. gcc/ada/ * exp_util.adb (Make_Invariant_Call): Convert the

Re: PING^2 [PATCH] mklog: fix bugs of --append option

2023-08-03 Thread Lehua Ding
Gentle PING^2, thanks!

Re: [COMMITTEDv3] tree-optimization: [PR100864] `(a&!b) | b` is not opimized to `a | b` for comparisons

2023-08-03 Thread Mikael Morin
Hello, Le 31/07/2023 à 19:07, Andrew Pinski via Gcc-patches a écrit : diff --git a/gcc/generic-match-head.cc b/gcc/generic-match-head.cc index a71c0727b0b..ddaf22f2179 100644 --- a/gcc/generic-match-head.cc +++ b/gcc/generic-match-head.cc @@ -121,3 +121,45 @@ bitwise_equal_p (tree expr1, tree

[Bug debug/110885] [10/11/12/13/14 Regression] "undefined reference" when using both "-fdebug-types-section" and "-gsplit-dwarf" and inline function as a template argument

2023-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110885 Richard Biener changed: What|Removed |Added Keywords||wrong-debug

[Bug middle-end/110884] strncmp false positive with -Wstringop-overread on coreutils

2023-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110884 Richard Biener changed: What|Removed |Added Blocks||97048 --- Comment #2 from Richard

Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization

2023-08-03 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 2 Aug 2023 at 14:17, Richard Biener via Gcc-patches wrote: > > On Mon, 31 Jul 2023, Jeff Law wrote: > > > > > > > On 7/28/23 01:05, Richard Biener via Gcc-patches wrote: > > > The following delays sinking of loads within the same innermost > > > loop when it was unconditional before.

[Bug libstdc++/110879] [14 Regression] Unnecessary reread from memory in a loop with std::vector

2023-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110879 Richard Biener changed: What|Removed |Added Target Milestone|--- |14.0 Summary|Unnecessary

Re: [RFC] light expander sra for parameters and returns

2023-08-03 Thread Richard Biener via Gcc-patches
On Thu, 3 Aug 2023, Jiufu Guo wrote: > > Hi Richard, > > Richard Biener writes: > > > On Tue, 1 Aug 2023, Jiufu Guo wrote: > > > >> > >> Hi, > >> > >> Richard Biener writes: > >> > >> > On Mon, 24 Jul 2023, Jiufu Guo wrote: > >> > > >> >> > >> >> Hi Martin, > >> >> > >> >> Not sure

[PATCH v3 4/8] LoongArch: Add Loongson ASX vector directive compilation framework.

2023-08-03 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

[PATCH v3 1/8] LoongArch: Add Loongson SX vector directive compilation framework.

2023-08-03 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

[PATCH v3 0/8] Add Loongson SX/ASX instruction support to LoongArch target.

2023-08-03 Thread Chenghui Pan
This is an update of : https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624770.html Changes since last version: - Revert vabsd/xvabsd RTL templates to unspec impl, because arithmetic RTL expression cannot cover the edge case of the instruction output. v2 impl of vabsd/xvabsd template

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

2023-08-03 Thread Javier Martinez via Gcc-patches
Most code is cold. This patch extends support for attribute ((cold)) to C++ Classes, Unions, and Structs (RECORD_TYPES and UNION_TYPES) to benefit from encapsulation - reducing the verbosity of using the attribute where deserved. The ((hot)) attribute is also extended for its semantic relation.

Re: [PATCH V2] RISC-V: Support CALL conditional autovec patterns

2023-08-03 Thread Robin Dapp via Gcc-patches
Hi Juzhe, I would find it a bit clearer if the prepare_ternay part were a separate patch. As it's mostly mechanical replacements I don't mind too much, though so it's LGTM from my side without that. As to the lmul = 8 ICE, is the problem that the register allocator would actually need 5

[Bug tree-optimization/110702] [12/13/14 Regression] Wrong code at -O1 on x86_64-linux-gnu (regression since GCC-12.2)

2023-08-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110702 --- Comment #5 from Richard Biener --- The issue for this seems to be that create_mem_ref gets type = unsigned long offset = 0 elements = { [0] = *

[PATCH] c-family: Add _BitInt support for __atomic_*fetch* [PR102989]

2023-08-03 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch implements the lowering of __atomic_*fetch* functions where first argument is a pointer to (optionally _Atomic) _BitInt which either doesn't have size 1, 2, 4, 8 or 16 bytes or has 16 byte size but target doesn't support TImode. Patch on top of the _BitInt patch series.

Re: [PATCH] ipa-sra: Don't consider CLOBBERS as writes preventing splitting

2023-08-03 Thread Jan Hubicka via Gcc-patches
> On Mon, Jul 31, 2023 at 7:05 PM Martin Jambor wrote: > > > > Hi, > > > > when IPA-SRA detects whether a parameter passed by reference is > > written to, it does not special case CLOBBERs which means it often > > bails out unnecessarily, especially when dealing with C++ destructors. > > Fixed by

Re: Fix profile upate after vectorizer peeling

2023-08-03 Thread Jan Hubicka via Gcc-patches
> > > > Note most of the profile consistency checks FAIL when testing with -m32 on > > x86_64-unknown-linux-gnu ... > > > > For example vect-11.c has > > > > ;; basic block 4, loop depth 0, count 719407024 (estimated locally, > > freq 0.6700), maybe hot > > ;; Invalid sum of incoming counts

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-08-03 Thread Richard Sandiford via Gcc-patches
Hao Liu OS writes: > Hi Richard, > > Update the patch with a simple case (see below case and comments). It shows > a live stmt may not have reduction def, which introduce the ICE. > > Is it OK for trunk? OK, thanks. Richard > > Fix the assertion failure on empty reduction define in

Re: [v2 PATCH 2/2] bpf: CO-RE builtins support tests.

2023-08-03 Thread Cupertino Miranda via Gcc-patches
Hi, Resending this patch since I have noticed I had a testcase added in previous patch. Makes more sense here. Thanks, Cupertino >From 334e9ae0f428f6573f2a5e8a3067a4d181b8b9c5 Mon Sep 17 00:00:00 2001 From: Cupertino Miranda Date: Thu, 27 Jul 2023 18:05:22 +0100 Subject: [PATCH v2 2/2] bpf:

Re: [v2 PATCH 1/2] bpf: Implementation of BPF CO-RE builtins

2023-08-03 Thread Cupertino Miranda via Gcc-patches
>From fda9603ded735205b6e20fc5b65a04f8d15685e6 Mon Sep 17 00:00:00 2001 From: Cupertino Miranda Date: Thu, 6 Apr 2023 15:22:48 +0100 Subject: [PATCH v2 1/2] bpf: Implementation of BPF CO-RE builtins This patch updates the support for the BPF CO-RE builtins __builtin_preserve_access_index and

[Bug libstdc++/110860] std::format("{:f}",2e304) invokes undefined behaviour

2023-08-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110860 --- Comment #4 from Jonathan Wakely --- __builtin_log10 isn't generic either. I was hoping to avoid including all of here, which is why I used the built-ins.

Re: [PATCH 1/2] bpf: Implementation of BPF CO-RE builtins

2023-08-03 Thread Cupertino Miranda via Gcc-patches
>> + /* FIXED: This wat not Ok. > > Hm? If that is fixed, do we still need that comment? :) Touche! ;) > >> +emit_insn ( \ >> + gen_mov_reloc_coredi (reg, \ >> +gen_rtx_CONST_INT (Pmode, 0), \ >> +

Re: Fix profile upate after vectorizer peeling

2023-08-03 Thread Jan Hubicka via Gcc-patches
> > Note most of the profile consistency checks FAIL when testing with -m32 on > x86_64-unknown-linux-gnu ... > > For example vect-11.c has > > ;; basic block 4, loop depth 0, count 719407024 (estimated locally, > freq 0.6700), maybe hot > ;; Invalid sum of incoming counts 708669602

<    1   2   3   >