[PATCH][libatomic] Add nvptx support

2020-09-07 Thread Tom de Vries
Hi, Add nvptx support to libatomic. Given that atomic_test_and_set is not implemented for nvptx (PR96964), the compiler translates __atomic_test_and_set falling back onto the "Failing all else, assume a single threaded environment and simply perform the operation" case in expand_atomic_test_and_s

Re: Bug in FINDLOC documentation at https://gcc.gnu.org/onlinedocs/gfortran/FINDLOC.html

2020-09-07 Thread Thomas Koenig via Gcc-patches
Hello Kay, The above website reads: "9.108 FINDLOC — Search an array for a value Description: Determines the location of the element in the array with the value given in the VALUE argument, or, if the DIM argument is supplied, determines the locations of the maximum element along each row of

Re: [PATCH] c++: Further tweaks for new-expression and paren-init [PR77841]

2020-09-07 Thread Jason Merrill via Gcc-patches
On 9/6/20 11:34 AM, Marek Polacek wrote: This patch corrects our handling of array new-expression with ()-init: new int[4](1, 2, 3, 4); should work even with the explicit array bound, and new char[3]("so_sad"); should cause an error, but we weren't giving any. Fixed by handling array n

RE: [PATCH v2] doc: add 'cd' command before 'make check-gcc' command in install.texi

2020-09-07 Thread Hans-Peter Nilsson
On Mon, 7 Sep 2020, Hu, Jiangping wrote: > Hi, H-P > > Thanks for comment. > > > On Sat, 29 Aug 2020, Hu Jiangping wrote: > > > > > This patch add 'cd' command before 'make check-gcc' command > > > when run the testsuite on selected tests. > > > > No, don't do that; those targets work fine from the

Re: [PATCH] libphobos: libdruntime doesn't support shadow stack (PR95680)

2020-09-07 Thread H.J. Lu via Gcc-patches
On Mon, Sep 7, 2020 at 2:35 PM Iain Buclaw wrote: > > Hi, > > This patch removes whatever CET support was in the switchContext routine > for x86 D runtime, and instead uses the ucontext fallback, which propely > handles shadow stack handling. > > Rather than implementing support within D runtime i

Re: [PATCH] gcc: Make strchr return value pointers const

2020-09-07 Thread JonY via Gcc-patches
On 9/4/20 12:47 PM, Martin Storsjö wrote: > Hi, > > On Fri, 4 Sep 2020, Jakub Jelinek wrote: > >> On Tue, Sep 01, 2020 at 04:01:42PM +0300, Martin Storsjö wrote: >>> This fixes compilation of codepaths for dos-like filesystems >>> with Clang. When built with clang, it treats C input files as C++

[PATCH] Add support for C++20 barriers

2020-09-07 Thread Thomas Rodgers
Re-sending Adds * include/Makefile.am (std_headers): Add new header. * include/Makefile.in: Regenerate. * include/bits/atomic_base.h (__atomic_base<_Itp>::_M_wait): Define. (__atomic_base<_Itp>::wait): Delegate to _M_wait. * include/std/barrier: New file.

Re: [RFC] enable flags-unchanging asms, add_overflow/expand/combine woes

2020-09-07 Thread Alexandre Oliva
On Sep 4, 2020, Segher Boessenkool wrote: > Please open a PR? (But see below first.) I saw the bit below, then filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96965 > Btw, we could perhaps try permuting arms in combine itself (not in > recog)? In combine we know that there are at most 4 s

Re: [PATCH] c++: Fix ICE in reshape_init with init-list [PR95164]

2020-09-07 Thread Jason Merrill via Gcc-patches
On 9/4/20 5:39 PM, Marek Polacek wrote: This patch fixes a long-standing bug in reshape_init_r. Since r209314 we implement DR 1467 which handles list-initialization with a single initializer of the same type as the target. In this test this causes a crash in reshape_init_r when we're processing

Re: [PATCH] --enable-link-serialization support

2020-09-07 Thread Jason Merrill via Gcc-patches
On Thu, Sep 3, 2020 at 10:49 AM Jakub Jelinek via Gcc-patches wrote: > > On Thu, Sep 03, 2020 at 03:53:35PM +0200, Richard Biener wrote: > > On Thu, 3 Sep 2020, Jakub Jelinek wrote: > > But is that an issue in practice? I usually do not do make -j32 cc1plus > > in a tree that was configured for b

Re: [PATCH, rs6000] Add non-relative jump table support on Power Linux

2020-09-07 Thread Segher Boessenkool
On Mon, Aug 24, 2020 at 03:48:43PM +0800, HAO CHEN GUI wrote: > >I'll try to be quicker at reviewing iterations of this -- there is quite > >some way to go, without me slowing things down! Sigh :-( > * config/rs6000/linux.h (rs6000_relative_jumptables): Define. That macro looks like it is

[PATCH] libphobos: libdruntime doesn't support shadow stack (PR95680)

2020-09-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes whatever CET support was in the switchContext routine for x86 D runtime, and instead uses the ucontext fallback, which propely handles shadow stack handling. Rather than implementing support within D runtime itself, use libc getcontext/setcontext functions if CET is enabled

Re: [PATCH] hppa64: Improve hppa_rtx_costs for DImode shifts by constants.

2020-09-07 Thread John David Anglin
On 2020-09-07 3:59 p.m., Roger Sayle wrote: > Please let me know what you think. > > > 2020-09-07 Roger Sayle > > gcc/ChangeLog > * config/pa/pa.c (hppa_rtx_costs) [ASHIFT, ASHIFTRT, LSHIFTRT]: > Provide accurate costs for DImode shifts of integer constants. Will do. I'm still testi

[PATCH] hppa64: Improve hppa_rtx_costs for DImode shifts by constants.

2020-09-07 Thread Roger Sayle
Hi Dave, Here's another patch for you to try on hppa64. I've no idea whether it helps PR middle-end/87256 on hppa64 or makes things worse, but this updates the DImode shift by constant costs on TARGET_64BIT, in the same way that the previous rtx_costs patch improved the SImode costs. Generating op

Re: *Ping*: [PATCH] PR fortran/96711 - ICE on NINT() Function

2020-09-07 Thread Harald Anlauf
Hi Thomas, thanks for the review! > Regarding the patch: Could you change the test caes into a > run-time test and check for the results both for compile-time > simplification and evaluation at run-time? Just to make sure that > fold_convert wasn't trying to tell us something that convert doesn'

Re: [PING] floatformat.h: Add bfloat16 support.

2020-09-07 Thread Joseph Myers
On Mon, 7 Sep 2020, Willgerodt, Felix via Gcc-patches wrote: > @@ -133,6 +133,9 @@ extern const struct floatformat > floatformat_ia64_quad_little; > /* IBM long double (double+double). */ extern const struct floatformat > floatformat_ibm_long_double_big; extern const struct floatformat > fl

[PATCH 6/6] ipa-cp: Separate and increase the large-unit parameter

2020-09-07 Thread Martin Jambor
Hi, a previous patch in the series has taught IPA-CP to identify the important cloning opportunities in 548.exchange2_r as worthwhile on their own, but the optimization is still prevented from taking place because of the overall unit-growh limit. This patches raises that limit so that it takes pl

[PATCH 5/6] ipa-cp: Add dumping of overall_size after cloning

2020-09-07 Thread Martin Jambor
Hi, when experimenting with IPA-CP parameters, especially when looking into exchange2_r, it has been very useful to know what the value of overall_size is at different stages of the decision process. This patch therefore adds it to the generated dumps. Bootstrapped and tested and LTO bootstrappe

[PATCH 4/6] ipa: Multiple predicates for loop properties, with frequencies

2020-09-07 Thread Martin Jambor
Hi, this patch enhances the ability of IPA to reason under what conditions loops in a function have known iteration counts or strides because it replaces single predicates which currently hold conjunction of predicates for all loops with vectors capable of holding multiple predicates, each with a

[PATCH 3/6] ipa: Bundle estimates of ipa_call_context::estimate_size_and_time

2020-09-07 Thread Martin Jambor
Hi, A subsequent patch adds another two estimates that the code in ipa_call_context::estimate_size_and_time computes, and the fact that the function has a special output parameter for each thing it computes would make it have just too many. Therefore, this patch collapses all those ouptut paramet

[PATCH 2/6] ipa: Introduce ipa_cached_call_context

2020-09-07 Thread Martin Jambor
Hi, as we discussed with Honza on the mailin glist last week, making cached call context structure distinct from the normal one may make it clearer that the cached data need to be explicitely deallocated. This implements does that division. It is not mandatory for the overall main goals of the p

[PATCH 1/6] ipa: Bundle vectors describing argument values

2020-09-07 Thread Martin Jambor
Hi, this large patch is mostly mechanical change which aims to replace uses of separate vectors about known scalar values (usually called known_vals or known_csts), known aggregate values (known_aggs), known virtual call contexts (known_contexts) and known value ranges (known_value_ranges) with us

Re: [committed] libstdc++: Optimise GCD algorithms

2020-09-07 Thread Jonathan Wakely via Gcc-patches
On 05/09/20 09:34 +0100, Jonathan Wakely via Libstdc++ wrote: On Sat, 5 Sep 2020 at 01:35, Sidney Marshall wrote: Jonathan I don't know if the following comments are useful or not but here goes: Reviews of my patches are always welcome, thanks. >The current std::gcd and std::chrono::dura

[committed] libstdc++: Simplify constraints for semiregular-box [LWG 3477]

2020-09-07 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/std/ranges (__box): Simplify constraints as per LWG 3477. Tested powerpc64le-linux. Committed to trunk. commit 00ffe730072f5e2e1923692163dc37db7b3784cb Author: Jonathan Wakely Date: Mon Sep 7 20:09:17 2020 libstdc++: Simplify constraints for semi

Re: [PATCH] vec: Revert "dead code removal in tree-vect-loop.c" and add a comment.

2020-09-07 Thread Andrea Corallo
Richard Sandiford writes: > Andrea Corallo writes: >> Hi Richard, >> >> this reverts the discussed patch and adds what was suggested as a >> comment. >> >> Apologies for the inconvenience, okay for trunk? > > OK, thanks! And sorry for not commenting/documenting this very well. > > Richard Inst

Re: ubsan: d-demangle.c:214 signed integer overflow

2020-09-07 Thread Ian Lance Taylor
Iain Buclaw writes: > Excerpts from Alan Modra's message of September 7, 2020 2:56 am: >> On Fri, Sep 04, 2020 at 06:23:10PM +0200, Iain Buclaw wrote: >>> If we're already using limits.h, I guess it should be fine to also add >>> >>> #define UINT_MAX ((unsigned) ~0U) >> >> Yes, except that I'll

Re: [PATCH] vec: Revert "dead code removal in tree-vect-loop.c" and add a comment.

2020-09-07 Thread Richard Sandiford
Andrea Corallo writes: > Hi Richard, > > this reverts the discussed patch and adds what was suggested as a > comment. > > Apologies for the inconvenience, okay for trunk? OK, thanks! And sorry for not commenting/documenting this very well. Richard > > Thanks > > Andrea > > From 84dfa2d461692

Re: [PATCH] doc: Update documentation on MODE_PARTIAL_INT subregs

2020-09-07 Thread Jozef Lawrynowicz
On Mon, Sep 07, 2020 at 01:55:59PM +0100, Richard Sandiford wrote: > Jozef Lawrynowicz writes: > > In d8487c949ad5 (~GCC 4.9.0), MODE_PARTIAL_INT modes were changed from > > having an unknown number of undefined bits, to having a known number of > > undefined bits, however the documentation on usi

[committed] MSP430: Don't override default ISA when MCU name is unrecognized

2020-09-07 Thread Jozef Lawrynowicz
430X is the default ISA under normal operation, so even when the MCU name passed to -mmcu= is unrecognized, it should not be overriden. Committed as obvious. >From 7f87e446691f1debfe2671a40f8738bd5e128832 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Mon, 7 Sep 2020 17:35:04 +0100 Subjec

[pushed] Darwin, testsuite : Update pubtypes tests.

2020-09-07 Thread Iain Sandoe via Gcc-patches
Hi Recent changes in debug output have resulted in a change in the length of the pub types info. This updates the tests to reflect the new length. tested on i686-darwin, x86_64-darwin, applied to master thanks Iain gcc/testsuite/ChangeLog: * gcc.dg/pubtypes-2.c: Amend Pub Info Length.

Re: ubsan: d-demangle.c:214 signed integer overflow

2020-09-07 Thread Iain Buclaw via Gcc-patches
Excerpts from Alan Modra's message of September 7, 2020 2:56 am: > On Fri, Sep 04, 2020 at 06:23:10PM +0200, Iain Buclaw wrote: >> If we're already using limits.h, I guess it should be fine to also add >> >> #define UINT_MAX ((unsigned) ~0U) > > Yes, except that I'll use the simpler fall-back > #

[PATCH] vec: Revert "dead code removal in tree-vect-loop.c" and add a comment.

2020-09-07 Thread Andrea Corallo
Hi Richard, this reverts the discussed patch and adds what was suggested as a comment. Apologies for the inconvenience, okay for trunk? Thanks Andrea >From 84dfa2d461692f445f45b3c3498f9bedba5c3848 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Mon, 7 Sep 2020 13:45:47 +0100 Subject: [P

[PATCH 1/1] arm: [testsuite] Skip thumb2-cond-cmp tests on Cortex-M [PR94595]

2020-09-07 Thread Christophe Lyon via Gcc-patches
Since r204778 (g571880a0a4c512195aa7d41929ba6795190887b2), we favor branches over IT blocks on Cortex-M. As a result, instead of generating two nested IT blocks in thumb2-cond-cmp-[1234].c, we generate either a single IT block, or use branches depending on conditions tested by the program. Since t

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-07 Thread H.J. Lu via Gcc-patches
On Mon, Sep 7, 2020 at 7:06 AM Segher Boessenkool wrote: > > On Fri, Sep 04, 2020 at 11:52:13AM -0700, H.J. Lu wrote: > > On Fri, Sep 4, 2020 at 11:09 AM Segher Boessenkool > > wrote: > > > On Fri, Sep 04, 2020 at 10:34:23AM -0700, H.J. Lu wrote: > > > > > You probably have to do this for every t

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-07 Thread Segher Boessenkool
On Fri, Sep 04, 2020 at 01:23:14AM +, Rodriguez Bahena, Victor wrote: > Qing, thanks a lot for the measurement, I am not sure if this is the limit of > overhead the community is willing to accept by adding extra security (me as > gcc user will be willing to accept). The overhead is of cours

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-07 Thread Segher Boessenkool
On Fri, Sep 04, 2020 at 02:00:41PM -0500, Qing Zhao wrote: > >> However, if we only clear USED registers, the worst case is 1.72% on > >> average. This overhead is very reasonable. > > > > No, that is the number I meant. 2% overhead is extremely much, unless > > this is magically super effecti

Re: [PATCH] aarch64: Remove redundant mult patterns

2020-09-07 Thread Alex Coplan
On 28/08/2020 11:00, Richard Sandiford wrote: > Alex Coplan writes: > > Hello, > > > > Following on from the earlier patch to fix up the syntax for > > add/sub/adds/subs and friends with a sign/zero-extended operand [0], > > this patch removes the "mult" variants of these patterns which are > > al

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-07 Thread Segher Boessenkool
On Fri, Sep 04, 2020 at 11:52:13AM -0700, H.J. Lu wrote: > On Fri, Sep 4, 2020 at 11:09 AM Segher Boessenkool > wrote: > > On Fri, Sep 04, 2020 at 10:34:23AM -0700, H.J. Lu wrote: > > > > You probably have to do this for every target separately? But it is not > > > > enough to handle it in the ep

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-07 Thread Rodriguez Bahena, Victor via Gcc-patches
From: Qing Zhao Date: Friday, September 4, 2020 at 9:19 AM To: "Rodriguez Bahena, Victor" , Kees Cook Cc: Segher Boessenkool , Jakub Jelinek , Uros Bizjak , GCC Patches Subject: Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all] On Sep 3, 2020, at 8:

Re: [PATCH] doc: Update documentation on MODE_PARTIAL_INT subregs

2020-09-07 Thread Richard Sandiford
Jozef Lawrynowicz writes: > In d8487c949ad5 (~GCC 4.9.0), MODE_PARTIAL_INT modes were changed from > having an unknown number of undefined bits, to having a known number of > undefined bits, however the documentation on using SUBREG expressions > with MODE_PARTIAL_INT modes was not updated to refl

[PATCH] gas: Don't error when .debug_line already exists, unless .loc was used

2020-09-07 Thread Mark Wielaard
When -g was used to generate DWARF gas would error out when a .debug_line already exists. But when a .debug_info section already exists it would simply skip generating one without warning or error. Do the same for .debug_line. It is only an error when the user explicitly uses .loc directives and al

[PATCH] improve SLP vect dumping

2020-09-07 Thread Richard Biener
This adds additional dumping helping in particular basic-block vectorization SLP dump reading plus showing what we actually generate code from. Bootstrapped / tested on x86_64-unknown-linux-gnu, pushed. 2020-09-07 Richard Biener * tree-vect-slp.c (vect_analyze_slp_instance): Dump

Re: [PATCH v2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-07 Thread Richard Biener via Gcc-patches
On Mon, Sep 7, 2020 at 7:44 AM luoxhu wrote: > > Hi, > > On 2020/9/4 18:23, Segher Boessenkool wrote: > >> diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c > >> index 03b00738a5e..00c65311f76 100644 > >> --- a/gcc/config/rs6000/rs6000-c.c > >> +++ b/gcc/config/rs6000/rs6000

Re: [PATCH] C-SKY: Add fpuv3 instructions and CK860 arch

2020-09-07 Thread Xianmiao Qu
Hi Gengqi, Is this patch based on the master branch? I cannot apply it successfully. Cooper On 8/27/20 5:33 PM, gengqi via Gcc-patches wrote: From: gengq gcc/ChangeLog: * config/csky/constraints.md (W): New constriant for mem operand with a base reg with a index register.

Re: Do we need to do a loop invariant motion after loop interchange ?

2020-09-07 Thread Richard Biener via Gcc-patches
On Mon, Sep 7, 2020 at 11:43 AM HAO CHEN GUI via Gcc-patches wrote: > > Hi, > > I want to follow Lijia's work as I gained the performance benefit on > some SPEC workloads by adding a im pass after loop interchange. Could > you send me the latest patches? I could do further testing. Thanks a lot.

Re: [PATCH] vec: remove unreachable code

2020-09-07 Thread Richard Sandiford
"Kewen.Lin" writes: > Hi Andrea, > > on 2020/9/4 锟斤拷锟斤拷8:11, Andrea Corallo wrote: >> Hi all, >> >> just a small patch removing a piece of unreachable code in >> 'vect_estimate_min_profitable_iters' given the condition >> (LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo)) is always true as >> chec

[PING] floatformat.h: Add bfloat16 support.

2020-09-07 Thread Willgerodt, Felix via Gcc-patches
Kindly pinging. Felix -Original Message- From: Felix Willgerodt Sent: Montag, 17. August 2020 13:37 To: Willgerodt, Felix ; gcc-patches@gcc.gnu.org Subject: [PATCH] floatformat.h: Add bfloat16 support. This change is motivated by a patchset that adds bfloat16 debugging support for new

Re: *PING* [Patch] Fortran: Fixes for pointer function call as variable (PR96896)

2020-09-07 Thread Thomas Koenig via Gcc-patches
Hi Tobias, *PING* OK. Thanks for the patch! Regards Thomas

[committed][libatomic, testsuite] Add missing include in atomic-generic.c

2020-09-07 Thread Tom de Vries
Hi, When compiling atomic-generic.c from the libatomic testsuite, we run into: ... $ gcc src/libatomic/testsuite/libatomic.c/atomic-generic.c -latomic src/libatomic/testsuite/libatomic.c/atomic-generic.c: In function ‘main’: src/libatomic/testsuite/libatomic.c/atomic-generic.c:31:7: warning: \ i

RE: [PATCH v2] doc: add 'cd' command before 'make check-gcc' command in install.texi

2020-09-07 Thread Hu, Jiangping
Hi, H-P Thanks for comment. > On Sat, 29 Aug 2020, Hu Jiangping wrote: > > > This patch add 'cd' command before 'make check-gcc' command > > when run the testsuite on selected tests. > > No, don't do that; those targets work fine from the toplevel > too, and then include the language libs. Yes,

Do we need to do a loop invariant motion after loop interchange ?

2020-09-07 Thread HAO CHEN GUI via Gcc-patches
Hi, I want to follow Lijia's work as I gained the performance benefit on some SPEC workloads by adding a im pass after loop interchange.  Could you send me the latest patches? I could do further testing. Thanks a lot. https://gcc.gnu.org/pipermail/gcc/2020-February/232091.html

*PING* [Patch] Fortran: Fixes for pointer function call as variable (PR96896)

2020-09-07 Thread Tobias Burnus
*PING* On 9/2/20 5:02 PM, Tobias Burnus wrote: During some discussion such an example as attached came up: f() = 0.0 where 'f' is a function which returns a pointer to an array. This gets handled as _F.D0 => f() _F.D0 = 0.0 However, the first line did fail with a rank error as the rank was

Re: [r11-1851 Regression] FAIL: gcc.dg/vect/slp-46.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2 on Linux/x86_64 (-m64 -march=cascadelake)

2020-09-07 Thread Richard Biener
On Mon, 7 Sep 2020, Hongtao Liu wrote: > On Mon, Aug 31, 2020 at 8:35 PM H.J. Lu via Gcc-patches > wrote: > > > > On Mon, Aug 31, 2020 at 12:25 AM Richard Biener wrote: > > > > > > On Sat, 29 Aug 2020, sunil.k.pandey wrote: > > > > > > > On Linux/x86_64, > > > > > > > > dccbf1e2a6e544f71b4a5795f

Re: [r11-1851 Regression] FAIL: gcc.dg/vect/slp-46.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2 on Linux/x86_64 (-m64 -march=cascadelake)

2020-09-07 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 31, 2020 at 8:35 PM H.J. Lu via Gcc-patches wrote: > > On Mon, Aug 31, 2020 at 12:25 AM Richard Biener wrote: > > > > On Sat, 29 Aug 2020, sunil.k.pandey wrote: > > > > > On Linux/x86_64, > > > > > > dccbf1e2a6e544f71b4a5795f0c79015db019fc3 is the first bad commit > > > commit dccbf1e

Re: [PATCH][Arm] Auto-vectorization for MVE: vsub

2020-09-07 Thread Dennis Zhang
Hi Ramana, On 8/21/20 10:33 PM, Ramana Radhakrishnan wrote: > On Mon, Aug 17, 2020 at 7:42 PM Dennis Zhang wrote: >> >> >> Hi all, >> >> This patch enables MVE vsub instructions for auto-vectorization. >> It adds RTL templates for MVE vsub instructions using 'minus' instead of >> unspec expressio