[PATCH] c: check if target_clone attrs are all string

2022-12-28 Thread Martin Liška
Hi. The patch checks all attribute arguments if they are string. If not, an error message is emitted. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR c/107993 gcc/c-family/ChangeLog: * c-attribs.cc (handle_target_

Re: [00/13] check hash table counts

2022-12-28 Thread Martin Liška
On 12/27/22 05:07, Alexandre Oliva via Gcc-patches wrote: > > While looking into another issue that corrupted hash tables, I added > code to check consistency of element counts, and hit numerous issues > that were concerning, of three kinds: insertion of entries that seem > empty, dangling inserti

Re: [x86 PATCH] Use ix86_expand_clear in ix86_split_ashl.

2022-12-28 Thread Uros Bizjak via Gcc-patches
On Wed, Dec 28, 2022 at 1:06 AM Roger Sayle wrote: > > This patch is a one line change, to call ix86_expand_clear instead of > emit_move_insn with const0_rtx in ix86_split_ashl, allowing the backend > to use an xor instruction to clear a register if appropriate. > > The effect is demonstrated with

[PATCH v2] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Lipeng Zhu via Gcc-patches
This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit function, the percentage to step into the insert_unit function is around 30%, in most instances, we can get the unit in t

[PATCH] docs: fix Var documentation for .opt files

2022-12-28 Thread Martin Liška
The Var documentation was somehow wrongly split into 2 pieces. PR middle-end/107966 gcc/ChangeLog: * doc/options.texi: Fix Var documentation in internal manual. --- gcc/doc/options.texi | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --gi

Re: [PATCH] IPA: do not release body if still needed

2022-12-28 Thread Martin Liška
PING^2 On 12/9/22 09:28, Martin Liška wrote: > PING^1 > > On 12/1/22 10:59, Martin Liška wrote: >> Hi. >> >> Noticed during building of libbackend.a with the LTO partial linking. >> >> The function release_body is called even if clone_of is a clone >> of a another function and thus it shares tree

Re: [PATCH] contrib: add contrib to update-copyright.py script

2022-12-28 Thread Martin Liška
On 12/14/22 14:13, Jakub Jelinek wrote: > s/Filder/Filter/g ? Yep. Pushed with the fix as there hasn't been any comments on this. Martin

Re: [PATCH v2] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Thomas Koenig via Gcc-patches
Hi Lipeng, This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit function, the percentage to step into the insert_unit function is around 30%, in most instances, we can get

Re: [x86_64 PATCH] Add post-reload splitter for extendditi2.

2022-12-28 Thread Uros Bizjak via Gcc-patches
On Wed, Dec 28, 2022 at 1:32 AM Roger Sayle wrote: > > > This is another step towards a possible solution for PR 105137. > This patch introduces a define_insn_and_split for extendditi2, > that allows DImode to TImode sign-extension to be represented in > the early RTL optimizers, before being spli

Re: [x86 PATCH] Provide zero_extend versions/variants of several patterns.

2022-12-28 Thread Uros Bizjak via Gcc-patches
On Wed, Dec 28, 2022 at 2:15 AM Roger Sayle wrote: > > > Back in September, the review of my patch for PR rtl-optimization/106594, > https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601501.html > suggested that I submit the x86 backend bits, independently and first. > > The executive summa

[PATCH] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Gcc-patches
> libstdc++ implements shared mutex with pthread_rwlock, which can > libstdc++ conflict > with the pthread_rwlock usage in libgcc. Lipeng, please limit the > pthread_rwlock usage in libgcc only when __cplusplus isn't defined. > > > -- > H.J. Thanks for suggestion, send a V2 patch. -- Lipeng

RE: [PATCH v2] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Gcc-patches
> Hi Lipeng, > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to > > increase CPU efficiency. In the get_gfc_unit function, the percentage > > to step into the insert_unit function is around 30%, in most >

Re: [PATCH] RISC-V: Fix ICE of visiting non-existing block in CFG.

2022-12-28 Thread Richard Sandiford via Gcc-patches
Jeff Law via Gcc-patches writes: > On 12/27/22 16:11, juzhe.zhong wrote: >> You mean only change to this form you suggested in this patch? Since in >> all other places of this PASS,I use RTL_SSA framework to iterate >> instructions and blocks. I use RTL_SSA framework to iterate blocks here >> t

Re: Re: [PATCH] RISC-V: Fix ICE of visiting non-existing block in CFG.

2022-12-28 Thread 钟居哲
Yeah, I agree with you that it makes the pass looks confusing that if we are mixing FOR_EACH_BB and for (const bb_info *bb... But Jeff feels happy if I use FOR_EACH_BB so I send a patch to change the iterator form if it doesn't care about the order. In this patch, it's ok for both FOR_EACH_BB and

RE: [x86 PATCH] Provide zero_extend versions/variants of several patterns.

2022-12-28 Thread Roger Sayle
Hi Uros, Many thanks for your reviews. > On Wed, Dec 28, 2022 at 2:15 AM Roger Sayle > wrote: > > > > > > Back in September, the review of my patch for PR > > rtl-optimization/106594, > > https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601501.html > > suggested that I submit the x86 ba

[14/17] parloops: don't request insert that won't be completed

2022-12-28 Thread Alexandre Oliva via Gcc-patches
In take_address_of, we may refrain from completing a decl_address INSERT if gsi is NULL, so dnn't even ask for an INSERT in this case. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-parloops.cc (take_address_of): Skip INSERT if !gsi. --- gcc/tree-parloops.

[15/17] prevent hash set/map insertion of deleted entries

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 27, 2022, David Malcolm wrote: > Would it make sense to also add assertions that such entries aren't > Traits::is_deleted? (both for hash_map and hash_set) Yeah, I guess so. I've come up with something for hash-table proper too, coming up in 17/17. Just like the recently-added checks

[16/17] check hash table counts at expand

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 28, 2022, Martin Liška wrote: > I really like the verification code you added. It's quite similar to what > I added to hash-table.h: *nod* Prompted by your encouragement, I've combined the element count verification code with the verify() loop, and also added it to expand, where it can b

[17/17] check hash table insertions

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 27, 2022, Alexandre Oliva wrote: > The number of bugs it revealed tells me that leaving callers in charge > of completing insertions is too error prone. I found this > verification code a bit too expensive to enable in general. Here's a relatively cheap, checking-only test to catch dangl

Re: [x86 PATCH] Provide zero_extend versions/variants of several patterns.

2022-12-28 Thread Uros Bizjak via Gcc-patches
On Wed, Dec 28, 2022 at 1:22 PM Roger Sayle wrote: > > > Hi Uros, > Many thanks for your reviews. > > > On Wed, Dec 28, 2022 at 2:15 AM Roger Sayle > > wrote: > > > > > > > > > Back in September, the review of my patch for PR > > > rtl-optimization/106594, > > > https://gcc.gnu.org/pipermail/gcc-

Re: [17/17] check hash table insertions

2022-12-28 Thread Richard Biener via Gcc-patches
> Am 28.12.2022 um 13:51 schrieb Alexandre Oliva via Gcc-patches > : > > On Dec 27, 2022, Alexandre Oliva wrote: > >> The number of bugs it revealed tells me that leaving callers in charge >> of completing insertions is too error prone. I found this >> verification code a bit too expensive

[PATCH 1/2] libstdc++: Normalise _GLIBCXX20_DEPRECATED macro

2022-12-28 Thread Nathaniel Shead via Gcc-patches
These two patches implement P1413 (deprecate std::aligned_storage and std::aligned_union) for C++23. Tested on x86_64-linux. -- >8 -- Updates _GLIBCXX20_DEPRECATED to be defined and behave the same as the versions for other standards (e.g. _GLIBCXX17_DEPRECATED). libstdc++-v3/ChangeLog:

[PATCH 2/2] libstdc++: Implement P1413R3 'deprecate aligned_storage and aligned_union'

2022-12-28 Thread Nathaniel Shead via Gcc-patches
These two patches implement P1413 (deprecate std::aligned_storage and std::aligned_union) for C++23. Tested on x86_64-linux. -- >8 -- Adds deprecated attributes for C++23, and makes use of it for std::aligned_storage, std::aligned_storage_t, std::aligned_union, and std::aligned_union_t. libstdc+

[PATCH] RISC-V: Optimize min/max with SImode sources on 64-bit

2022-12-28 Thread Raphael Moreira Zinsly
The Zbb min/max pattern was not matching 32-bit sources when compiling for 64-bit. This patch separates the pattern into SImode and DImode, and use a define_expand to handle SImode on 64-bit. zbb-min-max-02.c generates different code as a result of the new expander.  The resulting code is as effici

Re: [17/17] check hash table insertions

2022-12-28 Thread Alexandre Oliva via Gcc-patches
On Dec 28, 2022, Richard Biener wrote: > I wonder if on INSERT, pushing a DELETED marker would fix the dangling > insert and search during delete problem be whether that would be > better from a design point of view? (It of course requires a DELETED > representation) I'm undecided whether a desi

Re: [PATCH] RISC-V: Optimize min/max with SImode sources on 64-bit

2022-12-28 Thread Jeff Law via Gcc-patches
On 12/28/22 11:18, Raphael Moreira Zinsly wrote: The Zbb min/max pattern was not matching 32-bit sources when compiling for 64-bit. This patch separates the pattern into SImode and DImode, and use a define_expand to handle SImode on 64-bit. zbb-min-max-02.c generates different code as a result

Re: [14/17] parloops: don't request insert that won't be completed

2022-12-28 Thread Jeff Law via Gcc-patches
On 12/28/22 05:30, Alexandre Oliva via Gcc-patches wrote: In take_address_of, we may refrain from completing a decl_address INSERT if gsi is NULL, so dnn't even ask for an INSERT in this case. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-parloops.cc (

Re: [15/17] prevent hash set/map insertion of deleted entries

2022-12-28 Thread Jeff Law via Gcc-patches
On 12/28/22 05:32, Alexandre Oliva via Gcc-patches wrote: On Dec 27, 2022, David Malcolm wrote: Would it make sense to also add assertions that such entries aren't Traits::is_deleted? (both for hash_map and hash_set) Yeah, I guess so. I've come up with something for hash-table proper to

Re: [17/17] check hash table insertions

2022-12-28 Thread Richard Biener via Gcc-patches
> Am 29.12.2022 um 00:06 schrieb Alexandre Oliva : > > On Dec 28, 2022, Richard Biener wrote: > >> I wonder if on INSERT, pushing a DELETED marker would fix the dangling >> insert and search during delete problem be whether that would be >> better from a design point of view? (It of course r