[PATCH v2 2/2] add -Wdangling-pointer [PR #63272]

2021-11-30 Thread Martin Sebor via Gcc-patches
Attached is a revision of this patch with adjustments for the changes to the prerequisite patch 1 in the series and a couple of minor simplifications and slightly improved test coverage, rested on x86_64-linux. On 11/1/21 4:18 PM, Martin Sebor wrote: Patch 2 in this series adds support for detec

[committed] analyzer: verify that -Wanalyzer-too-complex can be disabled via pragmas [PR100524]

2021-11-30 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-5640-g03ea0ca1189a39e095188b0425c66446cc84a0a5. gcc/testsuite/ChangeLog: PR analyzer/100524 * gcc.dg/analyzer/pragma-2.c: New test. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/pragma-2.c |

[committed] analyzer: add regression test [PR94579]

2021-11-30 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-5642-g955ea7b58e4f1e3cc5083e88575161168c147254. gcc/testsuite/ChangeLog: PR analyzer/94579 * gcc.dg/analyzer/pr94579.c: New test. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/pr94579.c | 11

Re: [PATCH v2] rs6000: Modify the way for extra penalized cost

2021-11-30 Thread Segher Boessenkool
Hi! On Tue, Nov 30, 2021 at 01:05:48PM +0800, Kewen.Lin wrote: > on 2021/11/30 上午6:06, Segher Boessenkool wrote: > > On Tue, Sep 28, 2021 at 04:16:04PM +0800, Kewen.Lin wrote: > >> unsigned adjusted_cost = (nunits == 2) ? 2 : 1; > >> unsigned extra_cost = nunits * adjusted_cost; > > > >>

Re: [PATCH] Remove more stray returns and gcc_unreachable ()s

2021-11-30 Thread Martin Sebor via Gcc-patches
On 11/30/21 12:51 AM, Richard Biener wrote: On Mon, 29 Nov 2021, Martin Sebor wrote: On 11/29/21 11:53 AM, Martin Sebor wrote: On 11/29/21 6:09 AM, Richard Biener via Gcc-patches wrote: This removes more cases that appear when bootstrap with -Wunreachable-code-return progresses. ... diff -

Re: [EXTERNAL] Re: [PATCH] tree-optimization/98956 Optimizing out boolean left shift

2021-11-30 Thread Navid Rahimi via Gcc-patches
Hi Andrew, Thanks for your detailed comment. There are two problem I wanted to discuss with you about: a) The optimization I have sent patch, does optimize variable length "<<" too(for example B0 << x, where x is variable). This [1] link shows the actual optimization and a link for the proof i

[committed] libstdc++: Ensure C++20 std::stringstream definitions use correct ABI

2021-11-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux (old ABI) and x86_64-linux (new ABI), pushed to trunk. The definitions of the new C++20 members of std::stringstream etc are missing when --with-default-libstdcxx-abi=gcc4-compatible is used, because all the explicit instantiations in src/c++20/sstream-inst.cc are skipped

[committed] libstdc++: Fix fully-dynamic-string build

2021-11-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux (old ABI) and x86_64-linux (new ABI), pushed to trunk. My last change to the fully-dynamic-string actually broke it. This fixes the move constructor so it builds, and simplifies it slightly so that more code is common between the fully-dynamic enabled/disabled cases. lib

[committed] libstdc++: Fix tests that fail with fully-dynamic-string

2021-11-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux (old ABI) and x86_64-linux (new ABI), pushed to trunk. Fix some tests that assume that a moved-from string is empty, or that default constructing a string doesn't allocate. libstdc++-v3/ChangeLog: * testsuite/21_strings/basic_string/cons/char/moveable.cc: Allow

Re: [EXTERNAL] Re: [PATCH] tree-optimization/98956 Optimizing out boolean left shift

2021-11-30 Thread Andrew Pinski via Gcc-patches
On Tue, Nov 30, 2021 at 3:08 PM Navid Rahimi wrote: > > Hi Andrew, > > Thanks for your detailed comment. There are two problem I wanted to discuss > with you about: > > a) The optimization I have sent patch, does optimize variable length "<<" > too(for example B0 << x, where x is variable). This

Re: [EXTERNAL] Re: [PATCH] tree-optimization/98956 Optimizing out boolean left shift

2021-11-30 Thread Andrew Pinski via Gcc-patches
On Tue, Nov 30, 2021 at 3:18 PM Andrew Pinski wrote: > > On Tue, Nov 30, 2021 at 3:08 PM Navid Rahimi > wrote: > > > > Hi Andrew, > > > > Thanks for your detailed comment. There are two problem I wanted to discuss > > with you about: > > > > a) The optimization I have sent patch, does optimize

[r12-5612 Regression] FAIL: gcc.target/i386/pr88531-1a.c (test for excess errors) on Linux/x86_64

2021-11-30 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 10833849b55401a52f2334eb032a70beb688e9fc is the first bad commit commit 10833849b55401a52f2334eb032a70beb688e9fc Author: Richard Sandiford Date: Tue Nov 30 09:52:29 2021 + vect: Support gather loads with SLP caused FAIL: gcc.target/i386/avx2-i32gatherpd256-2.c (inter

Re: [EXTERNAL] Re: [PATCH] tree-optimization/98956 Optimizing out boolean left shift

2021-11-30 Thread Navid Rahimi via Gcc-patches
I see. That makes sense. Thanks for the explanation. I was looking at the 64992 and it seems all the implementation right now are only using INTEGER_CST at the moment. But now it makes sense. Best wishes, Navid. From: Andrew Pinski Sent: Tuesday, Novem

[PATCH RFA (fold/symtab)] c++: constexpr, fold, weak redecl, fp/0 [PR103310]

2021-11-30 Thread Jason Merrill via Gcc-patches
For PR61825, honza changed tree_single_nonzero_warnv_p to prevent a later declaration from marking a function as weak after we've determined that it wasn't weak before. But we shouldn't do that for speculative folding; we should only do it when we actually need a constant value. In C++, such a co

Re: [PATCH] Modify combine pattern by anding a pseudo with its nonzero bits

2021-11-30 Thread HAO CHEN GUI via Gcc-patches
Hi Segher,    Thanks for your review. Please see my comments. On 1/12/2021 上午 2:11, Segher Boessenkool wrote: > Hi! > > On Tue, Nov 30, 2021 at 04:46:34PM +0800, HAO CHEN GUI wrote: >>     This patch modifies the combine pattern with a helper - >> change_pseudo_and_mask when recog fails. The hel

[PATCH] tree-optimization/103456 - Record only successes from object_sizes_set

2021-11-30 Thread Siddhesh Poyarekar
Avoid overwriting osi->changed if object_sizes_set does not update the size, so that a previous success in the same pass is not overwritten. This fixes the bootstrap-ubsan build config, which was failing due to incorrect object size. Also completed a bootstrap on x86_64 which didn't show any new f

Re: [PATCH] tree-optimization/103456 - Record only successes from object_sizes_set

2021-11-30 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 01, 2021 at 09:47:21AM +0530, Siddhesh Poyarekar wrote: > Avoid overwriting osi->changed if object_sizes_set does not update the > size, so that a previous success in the same pass is not overwritten. > This fixes the bootstrap-ubsan build config, which was failing due to > incorrect ob

Re: [PATCH] Avoid some -Wunreachable-code-ctrl

2021-11-30 Thread Richard Biener via Gcc-patches
On Tue, 30 Nov 2021, Jason Merrill wrote: > On 11/29/21 10:03, Richard Biener via Gcc-patches wrote: > > This cleans up unreachable code diagnosed by -Wunreachable-code-ctrl. > > It largely follows the previous series but discovers a few extra > > cases, namely dead code after break or continue or

<    1   2