[PATCH (pushed)] analyzer: fix Clang warnings

2022-11-23 Thread Martin Liška
Fixes the following warnings: gcc/analyzer/varargs.cc:655:8: warning: 'matches_call_types_p' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] gcc/analyzer/varargs.cc:707:50: warning: unused parameter 'cd' [-Wunused-parameter]

Re: [PATCH V2] Use subscalar mode to move struct block for parameter

2022-11-23 Thread Richard Biener via Gcc-patches
On Wed, 23 Nov 2022, Jiufu Guo wrote: > Hi Jeff, > > Thanks a lot for your comments! Sorry for the late response ... > Jeff Law writes: > > > On 11/20/22 20:07, Jiufu Guo wrote: > >> Jiufu Guo writes: > >> > >>> Hi, > >>> > >>> As mentioned in the previous version patch: > >>>

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-11-23 Thread HAO CHEN GUI via Gcc-patches
Hi Richard, 在 2022/11/24 4:06, Richard Biener 写道: > Wouldn't we usually either add an optab or try to recog a canonical > RTL form instead of adding a new target hook for things like this? Thanks so much for your comments. Please let me make it clear. Do you mean we should create an optab for

Re: [PATCH] AArch64: Add fma_reassoc_width [PR107413]

2022-11-23 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Hi Richard, > >>> A smart reassociation pass could form more FMAs while also increasing >>> parallelism, but the way it currently works always results in fewer FMAs. >> >> Yeah, as Richard said, that seems the right long-term fix. >> It would also avoid the hack of

Re: [PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-11-23 Thread Richard Biener via Gcc-patches
On Tue, 22 Nov 2022, Kees Cook wrote: > On Tue, Nov 22, 2022 at 03:02:04PM +, Qing Zhao wrote: > > > > > > > On Nov 22, 2022, at 9:10 AM, Qing Zhao via Gcc-patches > > > wrote: > > > > > > > > > > > >> On Nov 22, 2022, at 3:16 AM, Richard Biener wrote: > > >> > > >> On Mon, 21 Nov

[committed] analyzer: fix nondeterminism in logs

2022-11-23 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-4275-ge0f18b87bfaf0b. gcc/analyzer/ChangeLog: * checker-path.cc (checker_path::inject_any_inlined_call_events): Don't dump the address of the block when -fdump-noaddr. Signed-off-by: David

[committed] analyzer: revamp of heap-allocated regions [PR106473]

2022-11-23 Thread David Malcolm via Gcc-patches
PR analyzer/106473 reports a false positive from -Wanalyzer-malloc-leak on: void foo(char **args[], int *argc) { *argc = 1; (*args)[0] = __builtin_malloc(42); } The issue is that at the write to *argc we don't know if argc could point within *args, and so we conservatiely set

[committed 1/2] analyzer: move known funs for fds to sm-fd.cc

2022-11-23 Thread David Malcolm via Gcc-patches
This mostly mechanical change enables a simplification in the followup patch. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-4273-g50d5b240424d2b. gcc/analyzer/ChangeLog: * analyzer.h (register_known_fd_functions):

[committed 2/2] analyzer: eliminate region_model::on_ fns for sockets

2022-11-23 Thread David Malcolm via Gcc-patches
This mostly mechanical patch eliminates a confusing extra layer of redundant calls in the handling of socket-related functions. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-4274-g5d2908b7bf9305. gcc/analyzer/ChangeLog: * region-model.h

[r13-4268 Regression] FAIL: gcc.dg/pr107127.c (test for excess errors) on Linux/x86_64

2022-11-23 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, 8a0fce6a51915c29584427fd376b40073c328090 is the first bad commit commit 8a0fce6a51915c29584427fd376b40073c328090 Author: Jakub Jelinek Date: Wed Nov 23 19:09:31 2022 +0100 c: Fix compile time hog in c_genericize [PR107127] caused FAIL: gcc.dg/pr107127.c (test for excess

[PATCH v2] [x86] Fix incorrect _mm_cvtsbh_ss.

2022-11-23 Thread liuhongt via Gcc-patches
After supporting real __bf16, the implementation of _mm_cvtsbh_ss went wrong. The patch add a builtin to generate pslld for the intrinsic, also extendbfsf2 is supported with pslld when !flag_signaling_nans && !HONOR_NANS (BFmode). truncsfbf2 is supported with vcvtneps2bf16 when

Re: [PATCH] Remove use_equiv_p in vr-values.cc

2022-11-23 Thread Richard Biener via Gcc-patches
On Tue, Nov 22, 2022 at 2:58 PM Aldy Hernandez wrote: > > With no equivalences, the use_equiv_p argument in various methods in > simplify_using_ranges is always false. This means we can remove all > calls to compare_names, along with the function. > > OK pending tests? OK > gcc/ChangeLog: > >

Re: [PATCH] Remove follow_assert_exprs from overflow_comparison.

2022-11-23 Thread Richard Biener via Gcc-patches
On Tue, Nov 22, 2022 at 2:58 PM Aldy Hernandez wrote: > > OK pending tests? OK > gcc/ChangeLog: > > * tree-vrp.cc (overflow_comparison_p_1): Remove follow_assert_exprs. > (overflow_comparison_p): Remove use_equiv_p. > * tree-vrp.h (overflow_comparison_p): Same. >

Re: [PATCH] Remove ASSERT_EXPR.

2022-11-23 Thread Richard Biener via Gcc-patches
On Tue, Nov 22, 2022 at 2:58 PM Aldy Hernandez wrote: > > This removes all uses of ASSERT_EXPR except the internal one in ipa-*. > > OK pending tests? OK. > gcc/ChangeLog: > > * doc/gimple.texi: Remove ASSERT_EXPR references. > * fold-const.cc (tree_expr_nonzero_warnv_p): Same.

Re: [PATCH] Make Warray-bounds alias to Warray-bounds= [PR107787]

2022-11-23 Thread Richard Biener via Gcc-patches
On Wed, Nov 23, 2022 at 3:08 PM Iskander Shakirzyanov via Gcc-patches wrote: > > Hi! > Sorry for the initially missing description. > The following patch changes the definition of -Warray-bounds to an Alias to > -Warray-bounds=1. This is necessary for the correct use of >

Re: [PATCH] Remove legacy VRP (maybe?)

2022-11-23 Thread Richard Biener via Gcc-patches
On Tue, Nov 22, 2022 at 2:40 PM Aldy Hernandez wrote: > > > > On 11/22/22 10:22, Richard Biener wrote: > > On Tue, Nov 22, 2022 at 10:04 AM Aldy Hernandez wrote: > >> > >> > >> > >> On 11/22/22 09:25, Richard Biener wrote: > >>> On Tue, Nov 22, 2022 at 9:24 AM Richard Biener > >>> wrote: >

Re: [PATCH] Add a new conversion for conditional ternary set into ifcvt [PR106536]

2022-11-23 Thread Richard Biener via Gcc-patches
On Wed, Nov 23, 2022 at 8:09 AM HAO CHEN GUI via Gcc-patches wrote: > > Hi, > There is a new insn on my target, which has a nested if_then_else and > set -1, 0 and 1 according to a comparison. > >[(set (match_operand:SI 0 "gpc_reg_operand" "=r") > (if_then_else:SI (lt

Re: [PATCH] rs6000: Adjust loop_unroll_adjust to match middle-end change [PR 107692]

2022-11-23 Thread Richard Biener via Gcc-patches
On Wed, Nov 23, 2022 at 2:53 AM Hongyu Wang wrote: > > Hi, Segher and Richard > > > > Something in your patch was wrong, please fix that (or revert the > > > patch). You should not have to touch config/rs6000/ at all. > > > > Sure something is wrong, but I think there's the opportunity to > >

Re: [PATCH] AArch64: Add fma_reassoc_width [PR107413]

2022-11-23 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, >> A smart reassociation pass could form more FMAs while also increasing >> parallelism, but the way it currently works always results in fewer FMAs. > > Yeah, as Richard said, that seems the right long-term fix. > It would also avoid the hack of treating PLUS_EXPR as a signal > of an

Re: [PATCH] c: Fix compile time hog in c_genericize [PR107127]

2022-11-23 Thread Joseph Myers
On Wed, 23 Nov 2022, Jakub Jelinek via Gcc-patches wrote: > Hi! > > The complex multiplications result in deeply nested set of many SAVE_EXPRs, > which takes even on fast machines over 5 minutes to walk. > This patch fixes that by using walk_tree_without_duplicates where it is > instant. > >

Re: [PATCH]AArch64 sve2: Fix expansion of division [PR107830]

2022-11-23 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > SVE has an actual division optab, and when using -Os we don't > optimize the division away. This means that we need to distinguish > between a div which we can optimize and one we cannot even during > expansion. > > Bootstrapped Regtested on

Re: [PATCH] doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor

2022-11-23 Thread Jason Merrill via Gcc-patches
On 11/23/22 05:10, Jonathan Wakely wrote: The existence of this option makes users think they need it (even though it's in neither -Wall nor -Wextra). Document that there's a better option (since 2011). OK for trunk? OK. -- >8 -- The newer -Wdelete-non-virtual-dtor has no false positives

Re: [PATCH 2/5] c++: Set the locus of the function result decl

2022-11-23 Thread Jason Merrill via Gcc-patches
On 11/22/22 15:25, Jason Merrill wrote: On 11/20/22 12:06, Bernhard Reutner-Fischer wrote: Hi Jason! The "meh" of result-decl-plugin-test-2.C should likely be omitted, grokdeclarator would need some changes to add richloc hints and we would not be able to make a reliable guess what to remove

Re: [PATCH] analyzer: Use __builtin_alloca in gcc.dg/analyzer/call-summaries-2.c

2022-11-23 Thread David Malcolm via Gcc-patches
On Wed, 2022-11-23 at 14:27 +0100, Rainer Orth wrote: > gcc.dg/analyzer/call-summaries-2.c currently FAILs on Solaris: > > FAIL: gcc.dg/analyzer/call-summaries-2.c (test for excess errors) > > Excess errors: > /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/call- >

[PATCH]AArch64 sve2: Fix expansion of division [PR107830]

2022-11-23 Thread Tamar Christina via Gcc-patches
Hi All, SVE has an actual division optab, and when using -Os we don't optimize the division away. This means that we need to distinguish between a div which we can optimize and one we cannot even during expansion. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master?

Re: [PATCH] Make Warray-bounds alias to Warray-bounds= [PR107787]

2022-11-23 Thread Iskander Shakirzyanov via Gcc-patches
Hi! Sorry for the initially missing description. The following patch changes the definition of -Warray-bounds to an Alias to -Warray-bounds=1. This is necessary for the correct use of -Werror=array-bounds=X, for more information see bug report 107787

[PATCH] Make Warray-bounds alias to Warray-bounds= [PR107787]

2022-11-23 Thread Искандер Шакирзянов via Gcc-patches
From 51559e862d191a1f51cc9af11f0d9be5fbc0b43c Mon Sep 17 00:00:00 2001 From: Iskander Shakirzyanov Date: Wed, 23 Nov 2022 12:26:47 + Subject: [PATCH] Make Warray-bounds alias to Warray-bounds= [PR107787] PR driver/107787 gcc/ChangeLog: * common.opt (Warray-bounds): Turn

[PATCH] analyzer: Use __builtin_alloca in gcc.dg/analyzer/call-summaries-2.c

2022-11-23 Thread Rainer Orth
gcc.dg/analyzer/call-summaries-2.c currently FAILs on Solaris: FAIL: gcc.dg/analyzer/call-summaries-2.c (test for excess errors) Excess errors: /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c:468:12: warning: implicit declaration of function 'alloca'

Re: [PATCH] d: respect --enable-link-mutex configure option

2022-11-23 Thread Martin Liška
On 11/22/22 13:59, Iain Buclaw wrote: > Excerpts from Martin Liška's message of November 22, 2022 10:41 am: >> I noticed the option is ignored because @DO_LINK_MUTEX@ >> is not defined in d/Make-lang.in. >> >> Tested locally before and after the patch. >> >> Ready to be installed? >> Thanks, >>

Re: [PATCH] diagnostics: Fix selftest ICE in certain locales [PR107722]

2022-11-23 Thread David Malcolm via Gcc-patches
On Wed, 2022-11-23 at 09:51 +0100, Jakub Jelinek wrote: > Hi! > > As reported in the PR, since special_fname_builtin () call has been > introduced, the diagnostics code compares filename against _(" in>") > rather than "", which means that if self tests are > performed > with the string being

Re: [PATCH] [x86] Fix incorrect implementation for mm_cvtsbh_ss.

2022-11-23 Thread Hongtao Liu via Gcc-patches
On Wed, Nov 23, 2022 at 8:40 PM Jakub Jelinek wrote: > > On Wed, Nov 23, 2022 at 08:28:20PM +0800, liuhongt via Gcc-patches wrote: > > After supporting real __bf16 type, implementation of mm_cvtsbh_ss went > > wrong. > > The patch supports extendbfsf2/truncsfbf2 with pslld/psrld, > > and then

Re: [PATCH] [x86] Fix incorrect implementation for mm_cvtsbh_ss.

2022-11-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 23, 2022 at 08:28:20PM +0800, liuhongt via Gcc-patches wrote: > After supporting real __bf16 type, implementation of mm_cvtsbh_ss went wrong. > The patch supports extendbfsf2/truncsfbf2 with pslld/psrld, > and then refined the intrinsic with implicit conversion. This is not correct.

[PATCH] [x86] Fix incorrect implementation for mm_cvtsbh_ss.

2022-11-23 Thread liuhongt via Gcc-patches
After supporting real __bf16 type, implementation of mm_cvtsbh_ss went wrong. The patch supports extendbfsf2/truncsfbf2 with pslld/psrld, and then refined the intrinsic with implicit conversion. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk? gcc/ChangeLog: PR

Re: *PING* - [wwwdocs] projects/gomp: TR11 + GCC13 update

2022-11-23 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 23, 2022 at 10:34:39AM +0100, Tobias Burnus wrote: > On 11.11.22 16:13, Tobias Burnus wrote: > > This patch adds TR11 to the history of OpenMP releases – and it does > > an update of the implementation status. > > > > OK? LGTM, thanks. Jakub

[PATCH] c-family: Incremental fix for -Wsign-compare BIT_NOT_EXPR handling [PR107465]

2022-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! There can be too many extensions and seems I didn't get everything right in the previously posted patch. The following incremental patch ought to fix that. The code can deal with quite a few sign/zero extensions at various spots and it is important to deal with all of them right. On the

[committed] libstdc++: Fix unsafe use of dirent::d_name [PR107814]

2022-11-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and sparc-sun-solaris2.11. Pushed to trunk. I'll backport to the branches too. -- >8 -- Copy the fix for PR 104731 to the equivalent experimental::filesystem test. libstdc++-v3/ChangeLog: PR libstdc++/107814 *

[PATCH] doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor

2022-11-23 Thread Jonathan Wakely via Gcc-patches
The existence of this option makes users think they need it (even though it's in neither -Wall nor -Wextra). Document that there's a better option (since 2011). OK for trunk? -- >8 -- The newer -Wdelete-non-virtual-dtor has no false positives and fewer bugs. There is very little reason to use

[PATCH] lto: fix usage of timer in materialize_cgraph

2022-11-23 Thread Martin Liška
Pretty obvious change. Ready to be installed? Thanks, Martin PR lto/107829 gcc/lto/ChangeLog: * lto.cc (materialize_cgraph): Call timevar_push before materialization starts. --- gcc/lto/lto.cc | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff

*PING* - [wwwdocs] projects/gomp: TR11 + GCC13 update

2022-11-23 Thread Tobias Burnus
On 11.11.22 16:13, Tobias Burnus wrote: This patch adds TR11 to the history of OpenMP releases – and it does an update of the implementation status. OK? Tobias PS: The implementation-status changes were lying around in that file for a while. I think both the GCC 13 release notes and this file

Re: [PATCH v1] LoongArch: Fixed a compilation failure with '%c' in inline assembly [PR107731].

2022-11-23 Thread chenglulu
在 2022/11/23 17:25, Xi Ruoyao 写道: On Wed, 2022-11-23 at 17:14 +0800, chenglulu wrote: 在 2022/11/23 16:59, Xi Ruoyao 写道: On Wed, 2022-11-23 at 14:49 +0800, Lulu Cheng wrote: 'A' Print a _DB suffix if the memory model requires a release. 'b' Print the address of a memory operand,

Re: [PATCH v1] LoongArch: Fixed a compilation failure with '%c' in inline assembly [PR107731].

2022-11-23 Thread Xi Ruoyao via Gcc-patches
On Wed, 2022-11-23 at 17:14 +0800, chenglulu wrote: > > 在 2022/11/23 16:59, Xi Ruoyao 写道: > > On Wed, 2022-11-23 at 14:49 +0800, Lulu Cheng wrote: > > > 'A' Print a _DB suffix if the memory model requires a > > > release. > > > 'b' Print the address of a memory operand, without offset.

Re: [PATCH] libstdc++: Fix libstdc++ build on some targets [PR107811]

2022-11-23 Thread Jonathan Wakely via Gcc-patches
On Wed, 23 Nov 2022 at 08:55, Jakub Jelinek wrote: > > Hi! > > fast_float library relies on size_t being 32-bit or larger and float/double > being IEEE single/double. Otherwise we only use strtod/strtof. > In 3 spots I've used fast_float namespace stuff unconditionally in one > function, which

Re: [PATCH v1] LoongArch: Fixed a compilation failure with '%c' in inline assembly [PR107731].

2022-11-23 Thread chenglulu
在 2022/11/23 16:59, Xi Ruoyao 写道: On Wed, 2022-11-23 at 14:49 +0800, Lulu Cheng wrote:     'A' Print a _DB suffix if the memory model requires a release.     'b' Print the address of a memory operand, without offset. +   'c'  print an integer. Nit: 'c' Print an integer. to match

[PATCH] c: Fix compile time hog in c_genericize [PR107127]

2022-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! The complex multiplications result in deeply nested set of many SAVE_EXPRs, which takes even on fast machines over 5 minutes to walk. This patch fixes that by using walk_tree_without_duplicates where it is instant. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Re: [PATCH v1] LoongArch: Fixed a compilation failure with '%c' in inline assembly [PR107731].

2022-11-23 Thread Xi Ruoyao via Gcc-patches
On Wed, 2022-11-23 at 14:49 +0800, Lulu Cheng wrote: >     'A' Print a _DB suffix if the memory model requires a release. >     'b' Print the address of a memory operand, without offset. > +   'c'  print an integer. Nit: 'c' Print an integer. to match the format of other entries. >    

[PATCH] libstdc++: Fix libstdc++ build on some targets [PR107811]

2022-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! fast_float library relies on size_t being 32-bit or larger and float/double being IEEE single/double. Otherwise we only use strtod/strtof. In 3 spots I've used fast_float namespace stuff unconditionally in one function, which breaks the build if fast_float is disabled. Fixed thusly,

[PATCH] diagnostics: Fix selftest ICE in certain locales [PR107722]

2022-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! As reported in the PR, since special_fname_builtin () call has been introduced, the diagnostics code compares filename against _("") rather than "", which means that if self tests are performed with the string being translated, one self-test fails. The following patch fixes that.