Re: [PATCH] libstdc++: Implement C++20 features for

2020-10-09 Thread Thomas Rodgers via Gcc-patches
Jonathan Wakely writes: > On 07/10/20 18:15 -0700, Thomas Rodgers wrote: >>@@ -500,6 +576,40 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 >> } >> #endif >> >>+#if __cplusplus > 201703L && _GLIBCXX_USE_CXX11_ABI >>+ basic_istringstream(ios_base::openmode __mode, const allocator_type& >>__a) >>+

Re: [PING][PATCH v2] combine: Don't turn (mult (extend x) 2^n) into extract [PR96998]

2020-10-09 Thread Segher Boessenkool
On Fri, Oct 09, 2020 at 09:38:09AM +0100, Alex Coplan wrote: > Hi Segher, > > On 08/10/2020 15:20, Segher Boessenkool wrote: > > On Thu, Oct 08, 2020 at 11:21:26AM +0100, Alex Coplan wrote: > > > Ping. The kernel is still broken on AArch64. > > > > You *cannot* fix a correctness bug with a combin

[r11-3748 Regression] FAIL: gcc.dg/tree-ssa/modref-2.c execution test on Linux/x86_64

2020-10-09 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, ffe8baa996486fa0313aa804a064a58b0b161f07 is the first bad commit commit ffe8baa996486fa0313aa804a064a58b0b161f07 Author: Jan Hubicka Date: Fri Oct 9 11:29:58 2020 +0200 IPA modref: fix miscompilation in clone when IPA modref is used caused FAIL: gcc.c-torture/execute/iee

[r11-3750 Regression] FAIL: gcc.dg/vect/bb-slp-pr65935.c scan-tree-dump-times slp1 "Building vector operands from scalars" 1 on Linux/x86_64

2020-10-09 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 16760e5bf7028dfa36b39af305d05cdf2c15b3a9 is the first bad commit commit 16760e5bf7028dfa36b39af305d05cdf2c15b3a9 Author: Richard Biener Date: Fri Oct 9 12:24:46 2020 +0200 tree-optimization/97334 - improve BB SLP discovery caused FAIL: gcc.dg/vect/bb-slp-pr65935.c -flto

Re: Problem with static const objects and LTO

2020-10-09 Thread Jeff Law via Gcc-patches
On 10/7/20 5:12 PM, H.J. Lu wrote: > On Wed, Oct 7, 2020 at 3:09 PM Jeff Law via Gcc-patches > wrote: >> Adding the testcase... >> >> On 10/7/20 4:08 PM, Jeff Law wrote: >>> On 9/17/20 1:03 PM, Jakub Jelinek wrote: >>> [ ... Big snip, starting over ... ] >>> >>> I may have not explained things t

[PATCH] libstdc++: Simplify metaprogramming in

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This removes the __detail::_Shift class template, replacing it with a constexpr function template __pow2m1. Instead of using the _Mod class template to calculate a modulus just perform a bitwise AND with the result of __pow2m1. This works because the places that change all perform a modulus operati

[committed] libstdc++: Fix incorrect results in std::seed_seq::generate [PR 97311]

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This ensures that intermediate results are done in uint32_t values, meeting the requirement for operations to be done modulo 2^32. If the target doesn't define __UINT32_TYPE__ then substitute uint32_t with a class type that uses uint_least32_t and masks the value to UINT32_MAX. I've also split th

[PATCH v2] IBM Z: Change vector copysign to use bitwise operations

2020-10-09 Thread Ilya Leoshkevich via Gcc-patches
Bootstrapped and regtested on s390x-redhat-linux. OK for master? v1: https://gcc.gnu.org/pipermail/gcc-patches/2020-October/555782.html v1 -> v2: Use related_int_vector_mode. The vector copysign pattern incorrectly assumes that vector if_then_else operates on bits, not on elements. This can t

Re: [PATCH] c++: Distinguish btw. alignof and __alignof__ in cp_tree_equal [PR97273]

2020-10-09 Thread Jason Merrill via Gcc-patches
On 10/9/20 4:48 AM, Jakub Jelinek wrote: On Tue, Oct 06, 2020 at 03:40:52PM -0400, Jason Merrill via Gcc-patches wrote: On 10/4/20 11:28 PM, Patrick Palka wrote: cp_tree_equal currently considers alignof the same as __alignof__, but these operators are semantically different ever since r8-7957.

Re: [PING][PATCH] correct handling of indices into arrays with elements larger than 1 (PR c++/96511)

2020-10-09 Thread Jason Merrill via Gcc-patches
On 10/9/20 10:51 AM, Martin Sebor wrote: On 10/8/20 1:40 PM, Jason Merrill wrote: On 10/8/20 3:18 PM, Martin Sebor wrote: On 10/7/20 3:01 PM, Jason Merrill wrote: On 10/7/20 4:11 PM, Martin Sebor wrote: ... For the various member functions, please include the comments with the definition as

Re: [PING][PATCH] correct handling of indices into arrays with elements larger than 1 (PR c++/96511)

2020-10-09 Thread Martin Sebor via Gcc-patches
On 10/8/20 1:40 PM, Jason Merrill wrote: On 10/8/20 3:18 PM, Martin Sebor wrote: On 10/7/20 3:01 PM, Jason Merrill wrote: On 10/7/20 4:11 PM, Martin Sebor wrote: ... For the various member functions, please include the comments with the definition as well as the in-class declaration. Only

[PUSHED] Patch to fix a LRA ICE [PR 97313]

2020-10-09 Thread Vladimir Makarov via Gcc-patches
The following patch has been committed into the main line.  The patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97313 The patch was successfully bootstrapped and tested on x86-64. gcc/ChangeLog: 2020-10-09 Vladimir Makarov PR rtl-optimization/97313 * lra-constraints.c (match_re

[PATCH] arc: Improve/add instruction patterns to better use MAC instructions.

2020-10-09 Thread Claudiu Zissulescu via Gcc-patches
From: Claudiu Zissulescu ARC MYP7+ instructions add MAC instructions for vector and scalar data types. This patch adds a madd pattern for 16it datum that is using the 32bit MAC instruction, and dot_prod patterns for v4hi vector types. The 64bit moves are also upgraded by using vadd2 instuction.

[RFC][gimple] Move can_duplicate_bb_p to gimple_can_duplicate_bb_p

2020-10-09 Thread Tom de Vries
Hi, The function gimple_can_duplicate_bb_p currently always returns true. The presence of can_duplicate_bb_p in tracer.c however suggests that there are cases when bb's indeed cannot be duplicated. Move the implementation of can_duplicate_bb_p to gimple_can_duplicate_bb_p. Bootstrapped and reg-

[PATCH] x86-64: Check CMPXCHG16B for x86-64-v[234]

2020-10-09 Thread H.J. Lu via Gcc-patches
x86-64-v2 includes CMPXCHG16B. Since -mcx16 enables CMPXCHG16B and defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16, check it in x86-64-v[234] tests. PR target/97250 * gcc.target/i386/x86-64-v2.c: Verify that __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 is defined. * gcc.target/

Re: [PATCH, libstdc++] Improve the performance of std::uniform_int_distribution (fewer divisions)

2020-10-09 Thread Jonathan Wakely via Gcc-patches
On 06/10/20 15:55 -0400, Daniel Lemire via Libstdc++ wrote: The updated patch looks good to me. It is indeed cleaner to have a separate (static) function. It might be nice to add a comment to explain the _S_nd function maybe with a comment like "returns a random value in [0,__range) without any

Re: [committed] libstdc++: Pass CXXFLAGS to check_performance script

2020-10-09 Thread Jonathan Wakely via Gcc-patches
On 09/10/20 14:02 +0100, Jonathan Wakely wrote: It looks like our check-performance target runs completely unoptimized, which is a bit silly. This exports the CXXFLAGS from the parent make process to the check_performance script. libstdc++-v3/ChangeLog: * scripts/check_performance: Use

[committed] libstdc++: Add performance test for

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This tests std::uniform_int_distribution with various parameters and engines. libstdc++-v3/ChangeLog: * testsuite/performance/26_numerics/random_dist.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit f9919ba717dfaf6018b7e625bebc84a461477b52 Author: Jonathan Wakely Date

[committed] libstdc++: Pass CXXFLAGS to check_performance script

2020-10-09 Thread Jonathan Wakely via Gcc-patches
It looks like our check-performance target runs completely unoptimized, which is a bit silly. This exports the CXXFLAGS from the parent make process to the check_performance script. libstdc++-v3/ChangeLog: * scripts/check_performance: Use gnu++11 instead of gnu++0x. * testsuite/Ma

Re: [ Preprocessor ] [ Common ] Feature: Macros for identifying the wide and narrow execution string literal encoding

2020-10-09 Thread JeanHeyd Meneide via Gcc-patches
Hello, > Typo: comple-time > > >2020-10-08 JeanHeyd "ThePhD" Meneide > > > >* gcc/c-family/c-cppbuiltin.c: Add predefined macro > >definitions for charsets > > I think you should put the macro names in braces after the filename and drop > the trailing "for charsets". Can do! >

Re: [committed][nvptx] Set -misa=sm_35 by default

2020-10-09 Thread Tom de Vries
On 10/9/20 2:19 PM, Tobias Burnus wrote: > Hi, > > On 10/9/20 1:56 PM, Tom de Vries wrote: >> The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas >> of the >> latest cuda release (11.1) no longer supports sm_30. > > Interestingly, at > https://docs.nvidia.com/cuda/parallel-threa

[PATCH] Refactor range handling of builtins in vr_values and ranger.

2020-10-09 Thread Aldy Hernandez via Gcc-patches
Hi Jakub. As the last known expert in this area, would you review this, please? :) This sets things up so we can share range handling of builtins between vr_values and ranger. It is meant to refactor the code so that we can verify that both implementations yield the same results. First, we abst

Re: [committed][nvptx] Set -misa=sm_35 by default

2020-10-09 Thread Tobias Burnus
Hi, On 10/9/20 1:56 PM, Tom de Vries wrote: The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas of the latest cuda release (11.1) no longer supports sm_30. Interestingly, at https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#release-notes__ptx-release-history t

[committed][nvptx] Set -misa=sm_35 by default

2020-10-09 Thread Tom de Vries
Hi, The nvptx-as assembler verifies the ptx code using ptxas, if there's any in the PATH. The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas of the latest cuda release (11.1) no longer supports sm_30. Consequently we cannot build gcc against that release (although we should st

[PATCH] Fixup gcc.dg/vect/pr65947-3.c when masked loads are available

2020-10-09 Thread Richard Biener
The following adds a effective target to properly allow the gcc.dg/vect/pr65947-3.c expected vectorization to be adjusted when run with, say, -march=cascadelake. Tested on x86_64-unknown-linux-gnu, pushed. 2020-10-09 Richard Biener gcc/ * doc/sourcebuild.texi (vect_masked_load): Docum

Re: [ Preprocessor ] [ Common ] Feature: Macros for identifying the wide and narrow execution string literal encoding

2020-10-09 Thread Bernhard Reutner-Fischer via Gcc-patches
On 8 October 2020 23:39:15 CEST, JeanHeyd Meneide via Gcc-patches wrote: >Dear Joseph, > >On Thu, Oct 8, 2020 at 1:36 PM Joseph Myers >wrote: >> >> This documentation doesn't seem sufficient to use the macros. Do >they >> expand to (narrow) string literals? To an unquoted sequence of >> charac

[PATCH] tree-optimization/97334 - improve BB SLP discovery

2020-10-09 Thread Richard Biener
We're running into a multiplication with one unvectorizable operand we expect to build from scalars but SLP discovery fatally fails the build of both since one stmt is commutated: _60 = _58 * _59; _63 = _59 * _62; _66 = _59 * _65; ... where _59 is the "bad" operand. The following patch mak

Re: [r11-3723 Regression] FAIL: gcc.dg/vect/bb-slp-subgroups-3.c scan-tree-dump-times slp2 "optimized: basic block" 2 on Linux/x86_64

2020-10-09 Thread Richard Biener
On Thu, 8 Oct 2020, sunil.k.pandey wrote: > On Linux/x86_64, > > 532e882f8872b1b4437e3a0fa8c61d2af2d999d4 is the first bad commit > commit 532e882f8872b1b4437e3a0fa8c61d2af2d999d4 > Author: Richard Biener > Date: Thu Oct 8 11:53:51 2020 +0200 > > adjust BB vectorization dump scanning > >

Re: [PATCH] IPA: merge profiles more sensitively

2020-10-09 Thread Martin Liška
On 10/7/20 1:56 PM, Martin Liška wrote: So what do you suggest to fix it :P? Note that we have a nice reduced test-case here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97295#c6 It's really a mixture of -O1 -fprofile-use and -O0. Martin

[committed] libstdc++: Fix unused variable warning

2020-10-09 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/util/testsuite_performance.h (report_header): Remove unused variable. Tested powerpc64le-linux. Committed to trunk. commit afcbeb35e0b9fb0251d04362a1bd4031520ff7f8 Author: Jonathan Wakely Date: Fri Oct 9 11:52:56 2020 libstdc++: Fix unu

[PATCH] IPA modref: fix miscompilation in clone when IPA modref is used

2020-10-09 Thread Martin Liška
Hello. There's a tested Honza's patch for the 2 PRs related to SPEC benchmarks. Patch can bootstrap on x86_64-linux-gnu and survives regression tests with one exception: FAIL: gcc.dg/lto/modref-1 c_lto_modref-1_0.o-c_lto_modref-1_1.o execute -O2 -flto-partition=max -flto It's a run-time test

[PATCH 1/2] correct BB frequencies after loop changed

2020-10-09 Thread guojiufu via Gcc-patches
When investigating the issue from https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549786.html I find the BB COUNTs of loop seems are not accurate in some case. For example: In below figure: COUNT:268435456 pre-header | | .

[PATCH 2/2] reset edge probibility and BB-count for peeled/unrolled loop

2020-10-09 Thread guojiufu via Gcc-patches
Hi, PR68212 mentioned that the COUNT of unrolled loop was not correct, and comments of this PR also mentioned that loop become 'cold'. This patch fixes the wrong COUNT/PROB of unrolled loop. And the patch handles the case where unrolling in unreliable count number can cause a loop to no longer lo

Re: [committed][nvptx] Split up function ref plus const

2020-10-09 Thread Tom de Vries
On 10/9/20 11:03 AM, Thomas Schwinge wrote: > Hi Tom! > > On 2020-09-23T22:46:34+0200, Tom de Vries wrote: >> With test-case gcc.c-torture/compile/pr92231.c, we run into: > > "Interesting" testcase... ;-) > >> ... >> nvptx-as: ptxas terminated with signal 11 [Segmentation fault], core dumped^M

RE: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted at -O3

2020-10-09 Thread xiezhiheng
> -Original Message- > From: Richard Sandiford [mailto:richard.sandif...@arm.com] > Sent: Thursday, August 27, 2020 4:08 PM > To: xiezhiheng > Cc: Richard Biener ; gcc-patches@gcc.gnu.org > Subject: Re: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions > emitted at -O3 > > xiezhihe

[PATCH] tree-optimization/97347 - fix another SLP constant insertion issue

2020-10-09 Thread Richard Biener
Just use edge insertion which will appropriately handle the situation from botan. Bootstrapped / tested on x86_64-unknown-linux-gnu, applied. 2020-10-09 Richard Biener PR tree-optimization/97347 * tree-vect-slp.c (vect_create_constant_vectors): Use edge insertion when

Re: [committed][nvptx] Split up function ref plus const

2020-10-09 Thread Thomas Schwinge
Hi Tom! On 2020-09-23T22:46:34+0200, Tom de Vries wrote: > With test-case gcc.c-torture/compile/pr92231.c, we run into: "Interesting" testcase... ;-) > ... > nvptx-as: ptxas terminated with signal 11 [Segmentation fault], core dumped^M Confirmed with: $ ptxas --version ptxas: NVIDIA

Re: [PATCH] IBM Z: Change vector copysign to use bitwise operations

2020-10-09 Thread Andreas Krebbel via Gcc-patches
On 08.10.20 11:38, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. OK for master? > > The vector copysign pattern incorrectly assumes that vector > if_then_else operates on bits, not on elements. This can theoretically > mislead the optimizers. Fix by changing it to

[PUSHED] Fix for PR97317.

2020-10-09 Thread Aldy Hernandez via Gcc-patches
As discussed in the PR, this fixes the range-ops cast code to handle casts where the precision of the RHS is only 1 greater than the precision of the LHS. This is actually Andrew's patch. Tested on x86-64 Linux. Pushed. gcc/ChangeLog: PR tree-optimization/97317 * range-op.cc (o

Re: [PATCH] c++: Distinguish btw. alignof and __alignof__ in cp_tree_equal [PR97273]

2020-10-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Oct 06, 2020 at 03:40:52PM -0400, Jason Merrill via Gcc-patches wrote: > On 10/4/20 11:28 PM, Patrick Palka wrote: > > cp_tree_equal currently considers alignof the same as __alignof__, but > > these operators are semantically different ever since r8-7957. In the > > testcase below, this c

Re: [PING][PATCH v2] combine: Don't turn (mult (extend x) 2^n) into extract [PR96998]

2020-10-09 Thread Alex Coplan via Gcc-patches
Hi Segher, On 08/10/2020 15:20, Segher Boessenkool wrote: > On Thu, Oct 08, 2020 at 11:21:26AM +0100, Alex Coplan wrote: > > Ping. The kernel is still broken on AArch64. > > You *cannot* fix a correctness bug with a combine addition. https://gcc.gnu.org/pipermail/gcc-patches/2020-September/55515

Re: [PATCH] adjust BB vectorization dump scanning

2020-10-09 Thread Richard Biener
On Thu, 8 Oct 2020, Thomas Schwinge wrote: > Hi Richard! > > On 2020-10-08T13:34:02+0200, Richard Biener wrote: > > It might be interesting to work on adding sth like > > dg-warning to look for -fopt-info-{optimized,missing} so > > we could directly annotate (not) vectorized loops instead of > >

Re: [PATCH] Move pr97315-1.c test to g++.dg/opt/.

2020-10-09 Thread Jakub Jelinek via Gcc-patches
On Fri, Oct 09, 2020 at 10:11:29AM +0200, Aldy Hernandez wrote: > OK for trunk? Sure. > > gcc/testsuite/ChangeLog: > > PR testsuite/97337 > * gcc.dg/pr97315-1.c: Moved to... > * g++.dg/opt/pr97315-1.C: ...here. > --- > gcc/testsuite/{gcc.dg/pr97315-1.c => g++.dg/opt/pr97315-1.

[PATCH] Move pr97315-1.c test to g++.dg/opt/.

2020-10-09 Thread Aldy Hernandez via Gcc-patches
OK for trunk? gcc/testsuite/ChangeLog: PR testsuite/97337 * gcc.dg/pr97315-1.c: Moved to... * g++.dg/opt/pr97315-1.C: ...here. --- gcc/testsuite/{gcc.dg/pr97315-1.c => g++.dg/opt/pr97315-1.C} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename gcc/testsuite/{gcc

[r10-8871 Regression] FAIL: gcc.target/i386/memcpy-pr95886.c scan-rtl-dump-times expand "const_int 578437695752307201" 2 on Linux/x86_64

2020-10-09 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, e4c9aac98611f63847ef6c57916808d9a2d7abcb is the first bad commit commit e4c9aac98611f63847ef6c57916808d9a2d7abcb Author: Martin Sebor Date: Thu Oct 8 12:35:01 2020 -0600 Correct handling of constant representations containing embedded nuls (backport from trunk). caused

[PATCH] random memory leak fixes

2020-10-09 Thread Richard Biener
This fixes leaks discovered checking whether I introduced new ones with the last vectorizer changes. Bootstrap / regtest running on x86_64-unknown-linux-gnu. Parts are also applicable for branches. 2020-10-09 Richard Biener * cgraphunit.c (expand_all_functions): Free tp_first_run_ord

RE: [PATCH PR96757] aarch64: ICE during GIMPLE pass: vect

2020-10-09 Thread duanbo (C)
> -Original Message- > From: Richard Sandiford [mailto:richard.sandif...@arm.com] > Sent: Wednesday, September 30, 2020 6:38 PM > To: duanbo (C) > Cc: GCC Patches > Subject: Re: [PATCH PR96757] aarch64: ICE during GIMPLE pass: vect > > Thanks for the update, looks good apart from… > >