[PATCH] PR tree-optimization/96779 Adding a missing pattern to match.pd

2021-11-16 Thread Navid Rahimi via Gcc-patches
Hi GCC community, This patch will add the missed pattern described in bug 102232 [1] to the match.pd. Tree-optimization/96779: Adding new optimization to match.pd: * match.pd (-x == x) -> (x == 0): New optimization. * gcc.dg/tree-ssa/pr96779.c: testcase for this optimiz

Re: [PATCH v2] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2021-11-16 Thread David Malcolm via Gcc-patches
> On Mon, Nov 15, 2021 at 06:15:40PM -0500, David Malcolm wrote: > > > On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote: > > > > Ping, can we conclude on the name? IMHO, -Wbidirectional is just fine, > > > > but changing the name is a trivial operation. > > > > > > Here's a patch w

Re: [PATCH] Fix spelling of ones' complement.

2021-11-16 Thread Eric Botcazou
> Nitpicking time. It's spelled "ones' complement" rather than "one's > complement". I didn't go into config/. > > Ok for trunk? > > gcc/ChangeLog: > > * doc/implement-c.texi: Fix spelling. > * doc/md.texi: Likewise. > * expmed.c (emit_store_flag_int): Likewise. > * opt

[PATCH] handle folded nonconstant array bounds [PR101702]

2021-11-16 Thread Martin Sebor via Gcc-patches
-Warray-parameter and -Wvla-parameter assume that array bounds in function parameters are either constant integers or variable, but not something in between like a cast of a constant that's not recognized as an INTEGER_CST until we strip the cast from it. This leads to an ICE as the the internal

[PATCH v3] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2021-11-16 Thread Marek Polacek via Gcc-patches
On Tue, Nov 16, 2021 at 06:00:58PM -0500, David Malcolm wrote: > > On Mon, Nov 15, 2021 at 06:15:40PM -0500, David Malcolm wrote: > > > > On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote: > > > > > Ping, can we conclude on the name? IMHO, -Wbidirectional is just > > > > > fine, > >

Fix optimization difference caused by -fdump-ipa-inline

2021-11-16 Thread Jan Hubicka via Gcc-patches
Hi, This patch fixes a bug that caused some optimizations to be dropped with -fdump-ipa-inline. gcc/ChangeLog: 2021-11-17 Jan Hubicka PR ipa/103246 * ipa-modref.c (ipa_merge_modref_summary_after_inlining): Fix clearing of to_info_lto diff --git a/gcc/ipa-modref.c b/gc

Re: [PATCH] restore ancient -Waddress for weak symbols [PR33925]

2021-11-16 Thread Martin Sebor via Gcc-patches
On 11/16/21 1:23 PM, Jason Merrill wrote: On 10/23/21 19:06, Martin Sebor wrote: On 10/4/21 3:37 PM, Jason Merrill wrote: On 10/4/21 14:42, Martin Sebor wrote: While resolving the recent -Waddress enhancement request (PR PR102103) I came across a 2007 problem report about GCC 4 having stopped

Re: [PATCH] Fix spelling of ones' complement.

2021-11-16 Thread Koning, Paul via Gcc-patches
> On Nov 16, 2021, at 4:19 PM, Marek Polacek via Gcc-patches > wrote: > > On Tue, Nov 16, 2021 at 01:09:15PM -0800, Mike Stump via Gcc-patches wrote: >> On Nov 15, 2021, at 5:48 PM, Marek Polacek via Gcc-patches >> wrote: >>> >>> Nitpicking time. It's spelled "ones' complement" rather tha

Re: [PATCH, rs6000] Optimization for vec_xl_sext

2021-11-16 Thread HAO CHEN GUI via Gcc-patches
Bill,     Sorry, I mixed up the patches. There is one vec_reve patch which hasn't gotten approval for a long time. I will re-send it.  Thanks a lot. On 16/11/2021 下午 9:10, Bill Schmidt wrote: > Hi Hao Chen, > > I don't understand.  This patch was already approved and you committed it. > :-) I

[committed] analyzer: don't assume target has alloca [PR102779]

2021-11-16 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-5329-ga80d4e098b10d5cd161f55e4fce64a6be9683ed3. gcc/testsuite/ChangeLog: PR analyzer/102779 * gcc.dg/analyzer/capacity-1.c: Add dg-require-effective-target alloca. Use __builtin_alloca rather than alloc

[committed] analyzer: fix missing -Wanalyzer-write-to-const [PR102695]

2021-11-16 Thread David Malcolm via Gcc-patches
This patch fixes -Wanalyzer-write-to-const so that it will complain about attempts to write to functions, to labels. It also "teaches" the analyzer about strchr, in that strchr can either return a pointer into the input area (and thus -Wanalyzer-write-to-const can now complain about writes into a s

Re: [PATCH] regrename: Skip renaming if instruction is noop move.

2021-11-16 Thread Jojo R via Gcc-patches
— Jojo 在 2021年11月16日 +0800 PM8:12,Richard Biener ,写道: > On Tue, Nov 16, 2021 at 12:45 PM Jojo R via Gcc-patches > wrote: > > > > Skip renaming if instruction is noop move, and it will > > been removed for performance. > > Is there any (target specific) testcase you can add? Such commits are > pr

Re: [PATCH v3] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2021-11-16 Thread David Malcolm via Gcc-patches
On Tue, 2021-11-16 at 19:37 -0500, Marek Polacek wrote: > On Tue, Nov 16, 2021 at 06:00:58PM -0500, David Malcolm wrote: > > > On Mon, Nov 15, 2021 at 06:15:40PM -0500, David Malcolm wrote: > > > > > On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote: > > > > > > Ping, can we conclude on

Re: [PATCH v3] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2021-11-16 Thread Marek Polacek via Gcc-patches
On Tue, Nov 16, 2021 at 09:28:21PM -0500, David Malcolm wrote: > On Tue, 2021-11-16 at 19:37 -0500, Marek Polacek wrote: > > Sorry for a dumb question, but is this what you have in mind? > > > > /* LRE > >    PDF */ > > /* FSI > >    PDI */ > > and check that we warn for these? > > I mean somethi

[r12-5324 Regression] FAIL: gcc.dg/tree-ssa/modref-dse-4.c scan-tree-dump dse2 "Deleted dead store: kill_me" on Linux/x86_64

2021-11-16 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 6dc90c4dbb6f9589dea9c670c3468496bb207de5 is the first bad commit commit 6dc90c4dbb6f9589dea9c670c3468496bb207de5 Author: Jan Hubicka Date: Tue Nov 16 23:01:28 2021 +0100 Use modref summaries for byte-wise dead store elimination. caused FAIL: gcc.dg/tree-ssa/modref-dse-4.

[PATCH] Enhance optimize_atomic_bit_test_and to handle truncation.

2021-11-16 Thread liuhongt via Gcc-patches
r12-5102-gfb161782545224f5 improves integer bit test on __atomic_fetch_[or|and]_* returns only for nop_convert, .i.e. transfrom mask_5 = 1 << bit_4(D); mask.0_1 = (unsigned int) mask_5; _2 = __atomic_fetch_or_4 (a_7(D), mask.0_1, 0); t1_9 = (int) _2; t2_10 = mask_5 & t1_9; to mask_5

Re: [PATCH 06/15] visium: Fix non-robust split condition in define_insn_and_split

2021-11-16 Thread Kewen.Lin via Gcc-patches
Hi Eric, on 2021/11/17 上午12:57, Eric Botcazou wrote: >> gcc/ChangeLog: >> >> * config/visium/visium.md (*add3_insn, *addsi3_insn, *addi3_insn, >> *sub3_insn, *subsi3_insn, *subdi3_insn, *neg2_insn, >> *negdi2_insn, *and3_insn, *ior3_insn, *xor3_insn, >> *one_cmpl2_insn, *ashl3_

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-16 Thread Jason Merrill via Gcc-patches
On 11/8/21 11:40, Matthias Kretz wrote: On Tuesday, 17 August 2021 20:31:54 CET Jason Merrill wrote: 2. Given a DECL_TI_ARGS tree, can I query whether an argument was deduced or explicitly specified? I'm asking because I still consider diagnostics of function templates unfortunate. `template vo

[PATCH] Fix tree-optimization/101941: IPA splitting out function with error attribute

2021-11-16 Thread apinski--- via Gcc-patches
From: Andrew Pinski The Linux kernel started to fail compile when the jump threader was improved (r12-2591-g2e96b5f14e4025691). This failure was due to the IPA splitting code decided now to split off the basic block which contained two functions, one of those functions included the error attribut

Re: [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split

2021-11-16 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 11, 2021 at 12:25 PM Kewen Lin wrote: > > This patch is to fix some non-robust split conditions in some > define_insn_and_splits, to make each of them applied on top of > the corresponding condition for define_insn part, otherwise the > splitting could perform unexpectedly. > > gcc/Cha

[PATCH] Fix PR 103288, ICE after PHI-OPT, move an assigment when still in use for another bb

2021-11-16 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem is r12-5300-gf98f373dd822b35c allows phiopt to recognize more basic blocks but missed one location where phiopt could move an assignment from the middle block to the non-middle one. This patch fixes that. OK? Bootstrapped and tested on x86_64-linux-gnu with no

Re: [PATCH] Fix PR 103288, ICE after PHI-OPT, move an assigment when still in use for another bb

2021-11-16 Thread Richard Biener via Gcc-patches
On November 17, 2021 8:46:54 AM GMT+01:00, apinski--- via Gcc-patches wrote: >From: Andrew Pinski > >The problem is r12-5300-gf98f373dd822b35c allows phiopt to recognize more >basic blocks >but missed one location where phiopt could move an assignment from the middle >block >to the non-middle

<    1   2