[PATCH] AutoFDO: Don't try to promote indirect calls that result in recursive direct calls

2022-02-08 Thread Eugene Rozenfeld via Gcc-patches
AutoFDO tries to promote and inline all indirect calls that were promoted and inlined in the original binary and that are still hot. In the included test case, the promotion results in a direct call that is a recursive call. inline_call and optimize_inline_calls can't handle recursive calls at

Re: [PATCH] tree-optimization/104373 - early uninit diagnostic on unreachable code

2022-02-08 Thread Richard Biener via Gcc-patches
On Tue, 8 Feb 2022, Jeff Law wrote: > > > On 2/8/2022 12:03 AM, Richard Biener via Gcc-patches wrote: > > The following improves early uninit diagnostics by computing edge > > reachability using our value-numbering framework in its cheapest > > mode and ignoring unreachable blocks when looking

Re: PING^5 [PATCH v4 0/2] Implement indirect external access

2022-02-08 Thread Fāng-ruì Sòng via Gcc-patches
On Mon, Jan 3, 2022 at 7:33 PM H.J. Lu via Gcc-patches wrote: > > On Sat, Dec 11, 2021 at 10:44 AM H.J. Lu wrote: > > > > On Thu, Nov 25, 2021 at 9:54 AM H.J. Lu wrote: > > > > > > On Mon, Nov 1, 2021 at 7:02 AM H.J. Lu wrote: > > > > > > > > On Thu, Oct 21, 2021 at 12:56 PM H.J. Lu wrote: >

Re: [PATCH] x86: Check each component of source operand for AVX_U128_DIRTY

2022-02-08 Thread Hongtao Liu via Gcc-patches
On Wed, Feb 9, 2022 at 10:53 AM H.J. Lu via Gcc-patches wrote: > > commit 9775e465c1fbfc32656de77c618c61acf5bd905d > Author: H.J. Lu > Date: Tue Jul 27 07:46:04 2021 -0700 > > x86: Don't set AVX_U128_DIRTY when zeroing YMM/ZMM register > > called ix86_check_avx_upper_register to check mode

Go patch committed: Recognize Go 1.18 runtime/internal/atomic methods

2022-02-08 Thread Ian Lance Taylor via Gcc-patches
The Go 1.18 library introduces specific types in runtime/internal/atomic. This patch to the Go frontend recognizes and optimizes the methods on those types, as we do with the functions in runtime/internal/atomic. While we're here avoid getting confused by methods in any other package that we

Go patch committed: Implement FuncPCABI0, FuncPCABIInternal

2022-02-08 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend and libgo implements the abi.FuncPCABI0 and abi.FuncPCABIInternal functions. The Go 1.18 standard library uses an internal/abi package with two functions that are implemented in the compiler. This patch implements them in the gofrontend, to support the upcoming

[PATCH] PR target/102059 Fix inline of target specific functions

2022-02-08 Thread Michael Meissner via Gcc-patches
Reset -mpower8-fusion for power9 inlining power8 functions, PR 102059. This patch is an attempt to make a much simpler patch to fix PR target/102059 than the previous patch. It just fixes the issue that if a function is specifically declared as a power8 function, you can't inline in functions

[PATCH v2] MIPS: IPL is 8bit in Cause register if TARGET_MCU

2022-02-08 Thread YunQiang Su
If MIPS MCU extension is enable, the IPL section in Cause register has been expand to 8bit instead of 6bit. gcc/ChangeLog: * config/mips/mips.cc (mips_expand_prologue): IPL is 8bit for MCU ASE. --- gcc/config/mips/mips.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH v4] x86: Add -m[no-]direct-extern-access

2022-02-08 Thread H.J. Lu via Gcc-patches
On Tue, Feb 8, 2022 at 6:38 PM Hongtao Liu wrote: > > On Fri, Jan 28, 2022 at 5:53 AM H.J. Lu via Gcc-patches > wrote: > > > > The v3 patch was posted at > > > > https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574847.html > > > > There is no progress with repeated pings since then. Glibc

[PATCH] x86: Check each component of source operand for AVX_U128_DIRTY

2022-02-08 Thread H.J. Lu via Gcc-patches
commit 9775e465c1fbfc32656de77c618c61acf5bd905d Author: H.J. Lu Date: Tue Jul 27 07:46:04 2021 -0700 x86: Don't set AVX_U128_DIRTY when zeroing YMM/ZMM register called ix86_check_avx_upper_register to check mode on source operand. But ix86_check_avx_upper_register doesn't work on source

[PATCH, rs6000] Remove TImode from mode iterator BOOL_128 [PR100694]

2022-02-08 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch removes TImode from mode iterator BOOL_128. Thus, bool operations (AND, IOR, XOR, NOT) on TImode will be split to the relevant operations on word mode during expand (in optabs.c). Potential optimizations can be implemented after the split. The former practice splits it after

[committed] analyzer: fix hashing of bit_range_region::key_t [PR104452]

2022-02-08 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu; manually verified using valgrind. Pushed to trunk as r12-7118-g391512ade5f6cda95456133296c8dcc42d5fbefd. gcc/analyzer/ChangeLog: PR analyzer/104452 * region-model.cc (selftest::test_bit_range_regions): New.

Re: [PATCH v4] x86: Add -m[no-]direct-extern-access

2022-02-08 Thread Hongtao Liu via Gcc-patches
On Fri, Jan 28, 2022 at 5:53 AM H.J. Lu via Gcc-patches wrote: > > The v3 patch was posted at > > https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574847.html > > There is no progress with repeated pings since then. Glibc 2.35 and > binutils 2.38 will support

Re: [PATCH] analyzer: Fix tests for glibc 2.35 [PR101081]

2022-02-08 Thread David Malcolm via Gcc-patches
On Fri, 2022-02-04 at 11:35 -0500, Joel Teichroeb via Gcc-patches wrote: > In recent versions of glibc fopen has __attribute__((malloc)). > Since we can not detect wether this attribute is present or not, > we avoid including stdio.h and instead forward declare what we > need in each test. > >

Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization

2022-02-08 Thread Jerry D via Gcc-patches
Remember the days when reading very old cryptic Fortran code? Remember the fixed line lengths and cryptic variable names! I fear the Standards committee has achieved history with the Standard itself it is so difficult to understand sometimes. Cheers to Paul and Harald for digging on this.

[PATCH] libstdc++: Fix deadlock in atomic wait [PR104442]

2022-02-08 Thread Thomas Rodgers via Gcc-patches
This issue was observed as a deadloack in 29_atomics/atomic/wait_notify/100334.cc on vxworks. When a wait is "laundered" (e.g. type T* does not suffice as a waitable address for the platform's native waiting primitive), the address waited is that of the _M_ver member of __waiter_pool_base, so

[PATCH] PR tree-optimization/104420: Fix checks for constant folding X*0.0

2022-02-08 Thread Roger Sayle
This patch resolves PR tree-optimization/104420, which is a P1 regression where, as observed by Jakub Jelinek, the conditions for constant folding x*0.0 are incorrect (following my patch for PR tree-optimization/96392). The multiplication x*0.0 may yield a negative zero result, -0.0, if X is

Re: [PATCH] handle "invisible" reference in -Wdangling-pointer (PR104436)

2022-02-08 Thread Jason Merrill via Gcc-patches
On 2/8/22 16:59, Martin Sebor wrote: Transforming a by-value arguments to by-reference as GCC does for some class types can trigger -Wdangling-pointer when the argument is used to store the address of a local variable.  Since the stored value is not accessible in the caller the warning is a

Re: [PATCH] Fix PR 101515 (ICE in pp_cxx_unqualified_id, at cp/cxx-pretty-print.c:128)

2022-02-08 Thread Jason Merrill via Gcc-patches
On 2/8/22 15:11, Qing Zhao wrote: Hi, This is the patch to fix PR101515 (ICE in pp_cxx_unqualified_id, at cp/cxx-pretty-print.c:128) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101515 It's possible that the TYPE_NAME of a record_type is NULL, therefore when printing the TYPE_NAME, we should

[PATCH] handle "invisible" reference in -Wdangling-pointer (PR104436)

2022-02-08 Thread Martin Sebor via Gcc-patches
Transforming a by-value arguments to by-reference as GCC does for some class types can trigger -Wdangling-pointer when the argument is used to store the address of a local variable. Since the stored value is not accessible in the caller the warning is a false positive. The attached patch

[PATCH] rs6000: Correct function prototypes for vec_replace_unaligned

2022-02-08 Thread Bill Schmidt via Gcc-patches
Hi! Due to a pasto error in the documentation, vec_replace_unaligned was implemented with the same function prototypes as vec_replace_elt. It was intended that vec_replace_unaligned always specify output vectors as having type vector unsigned char, to emphasize that elements are potentially

Re: [PATCH] libstdc++: Decouple HAVE_FCNTL_H from HAVE_DIRENT_H check

2022-02-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 8 Feb 2022 at 21:02, Dimitar Dimitrov wrote: > On Mon, Feb 07, 2022 at 09:05:45PM +, Jonathan Wakely wrote: > > On Mon, 7 Feb 2022 at 21:01, Jonathan Wakely > wrote: > > > > > > > > > > > On Mon, 7 Feb 2022 at 20:12, Dimitar Dimitrov > wrote: > > > > > >> On PRU target with newlib,

[committed] libstdc++: Simplify resource management in directory iterators

2022-02-08 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This replaces the _Dir constructor that takes ownership of an existing DIR* resource with one that takes a _Dir_base rvalue instead. This means a raw DIR* is never passed around, but is always owned by a _Dir_base object. libstdc++-v3/ChangeLog:

Re: [PATCH] libstdc++: Decouple HAVE_FCNTL_H from HAVE_DIRENT_H check

2022-02-08 Thread Dimitar Dimitrov
On Mon, Feb 07, 2022 at 09:05:45PM +, Jonathan Wakely wrote: > On Mon, 7 Feb 2022 at 21:01, Jonathan Wakely wrote: > > > > > > > On Mon, 7 Feb 2022 at 20:12, Dimitar Dimitrov wrote: > > > >> On PRU target with newlib, we have the following combination in config.h: > >> /* #undef

[PATCH V2] tree-optimization/104288 - Register non-null side effects properly.

2022-02-08 Thread Andrew MacLeod via Gcc-patches
On 2/8/22 03:32, Richard Biener wrote: On Tue, Feb 8, 2022 at 2:33 AM Andrew MacLeod via Gcc-patches wrote: On 2/7/22 09:29, Andrew MacLeod wrote: I have a proposal for PR 104288. ALL patches (in sequence) bootstrap on their own and each cause no regressions. I've been continuing to work

Re: [PATCH v3] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]

2022-02-08 Thread Bill Schmidt via Gcc-patches
Hi! >From some discussion today, I think we want to limit the scope of this patch to just the power8-fusion flag that's causing trouble for now, given stage 4. We've talked about making power8-fusion a do- nothing flag, since it doesn't add much benefit now and probably shouldn't be a separate

[PATCH] Fix PR 101515 (ICE in pp_cxx_unqualified_id, at cp/cxx-pretty-print.c:128)

2022-02-08 Thread Qing Zhao via Gcc-patches
Hi, This is the patch to fix PR101515 (ICE in pp_cxx_unqualified_id, at cp/cxx-pretty-print.c:128) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101515 It's possible that the TYPE_NAME of a record_type is NULL, therefore when printing the TYPE_NAME, we should check and handle this special

Re: [PATCH] dwarf2out: Don't call expand_expr during early_dwarf [PR104407]

2022-02-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 08, 2022 at 02:20:28PM -0500, Jason Merrill wrote: > > > + return add_const_value_attribute (die, TYPE_MODE (type), rtl); > > > +} > > > + else > > > +{ > > > + /* For early_dwarf force mangling of all referenced symbols. */ > > > + tree initializer = init; > > > +

Re: [PATCH] dwarf2out: Don't call expand_expr during early_dwarf [PR104407]

2022-02-08 Thread Jason Merrill via Gcc-patches
On 2/8/22 03:35, Richard Biener wrote: On Tue, 8 Feb 2022, Jakub Jelinek wrote: Hi! As mentioned in the PR, since PR96690 r11-2834 we call rtl_for_decl_init which can call expand_expr already during early_dwarf. The comment and PR explains it that the intent is to ensure the referenced vars

Re: [PATCH] c++: Don't emit repeated -Wshadow warnings for templates/ctors [PR104379]

2022-02-08 Thread Jason Merrill via Gcc-patches
On 2/8/22 03:22, Jakub Jelinek wrote: Hi! The following patch suppresses extraneous -Wshadow warnings. On the testcase without the patch we emit 14 -Wshadow warnings, with the patch just 4. It is enough to warn once e.g. during parsing of the template or the abstract ctor, while previously

Re: [PATCH] c++: Remove superflous assert [PR104403]

2022-02-08 Thread Jason Merrill via Gcc-patches
On 2/8/22 03:16, Jakub Jelinek wrote: Hi! I've added the assert because start_decl diagnoses such vars for C++20 and earlier: if (current_function_decl && VAR_P (decl) && DECL_DECLARED_CONSTEXPR_P (current_function_decl) && cxx_dialect < cxx23) but as can be seen, we cam

Re: [PATCH] rs6000: Add support for vmsumcud and vec_msumc

2022-02-08 Thread Bill Schmidt via Gcc-patches
On 2/8/22 9:45 AM, Segher Boessenkool wrote: > On Mon, Feb 07, 2022 at 10:06:36PM -0600, Bill Schmidt wrote: >> On 2/7/22 5:05 PM, Segher Boessenkool wrote: >>> On Mon, Feb 07, 2022 at 04:20:24PM -0600, Bill Schmidt wrote: I observed recently that a couple of Power10 instructions and

Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-08 Thread Joseph Myers
On Tue, 8 Feb 2022, Richard Biener via Gcc-patches wrote: > which I think is OK? That is, when the abstract machine > arrives at 'int i;' then the previous content in 'i' goes > away? Or would Yes, that's correct. "If an initialization is specified for the object, it is performed each time

Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization

2022-02-08 Thread Harald Anlauf via Gcc-patches
Hi Paul, Am 08.02.22 um 12:22 schrieb Paul Richard Thomas via Fortran: Hi Harald, Thanks for giving the patch a whirl. the parent components as an array. I strongly suspect that, from reading 7.5.6.2 paragraphs 2 and 3 closely, that ifort has it right. However, this is another issue to

Re: [PATCH] rs6000: Fix up vspltis_shifted [PR102140]

2022-02-08 Thread David Edelsohn via Gcc-patches
On Tue, Feb 8, 2022 at 12:25 PM Jakub Jelinek wrote: > > Hi! > > The following testcase ICEs, because > (const_vector:V4SI [ > (const_int 0 [0]) repeated x3 > (const_int -2147483648 [0x8000]) > ]) > is recognized as valid

Re: [PATCH, V2] Use system default for long double if not specified on PowerPC.

2022-02-08 Thread Andreas Schwab
On Feb 08 2022, Peter Bergner wrote: > Can you please clarify one thing for me. Do you think it's possible > that we can come up with some type of configure patch that automatically > sets the long double default given something on the system we can test > for or do you think that's impossible

Re: [PATCH 5/4] tree-optimization/104288 - An alternative approach

2022-02-08 Thread Andrew MacLeod via Gcc-patches
On 2/8/22 03:32, Richard Biener wrote: On Tue, Feb 8, 2022 at 2:33 AM Andrew MacLeod via Gcc-patches wrote: On 2/7/22 09:29, Andrew MacLeod wrote: I have a proposal for PR 104288. ALL patches (in sequence) bootstrap on their own and each cause no regressions. I've been continuing to work

[PATCH] rs6000: Fix up vspltis_shifted [PR102140]

2022-02-08 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because (const_vector:V4SI [ (const_int 0 [0]) repeated x3 (const_int -2147483648 [0x8000]) ]) is recognized as valid easy_vector_constant in between split1 pass and end of RA. The problem is that such

Re: [PATCH, V2] Use system default for long double if not specified on PowerPC.

2022-02-08 Thread Peter Bergner via Gcc-patches
On 2/4/22 4:26 PM, Segher Boessenkool wrote: > As I said before, I didn't even read the patch, just the one line > summary was enough for a NAK. If the patch in fact does something else, > then it is still incorrect, and needs a very different subject and > summary. > > I hope you see how "using

Re: [PATCH] tree-optimization/104373 - early uninit diagnostic on unreachable code

2022-02-08 Thread Jeff Law via Gcc-patches
On 2/8/2022 12:03 AM, Richard Biener via Gcc-patches wrote: The following improves early uninit diagnostics by computing edge reachability using our value-numbering framework in its cheapest mode and ignoring unreachable blocks when looking for uninitialized uses. To not ICE with

Re: [PATCH] rs6000: Add support for vmsumcud and vec_msumc

2022-02-08 Thread Segher Boessenkool
On Mon, Feb 07, 2022 at 10:06:36PM -0600, Bill Schmidt wrote: > On 2/7/22 5:05 PM, Segher Boessenkool wrote: > > On Mon, Feb 07, 2022 at 04:20:24PM -0600, Bill Schmidt wrote: > >> I observed recently that a couple of Power10 instructions and built-in > >> functions > >> were somehow not

[Patch]middle-end: updating the reg use in exit block for -fzero-call-used-regs [PR100775]

2022-02-08 Thread Qing Zhao via Gcc-patches
Hi, Richard, Could you please review this patch? This is a fix to the previous -fzero-call-used-regs implementation. PR 100775 ( ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775 Although the

Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-08 Thread Michael Matz via Gcc-patches
Hello, On Tue, 8 Feb 2022, Richard Biener wrote: > > int state = 2, *p, camefrom1 = 0; > > for (;;) switch (state) { > > case 1: > > case 2: ; > > int i; > > if (state != 1) { p = i = 0; } > > if (state == 1) { (*p)++; return *p; } > > state = 1; > > continue; > > } > >

Re: [PATCH 3/4] tree-optimization/104288 - Update non-null interface to provide better precision.

2022-02-08 Thread Richard Biener via Gcc-patches
On Tue, Feb 8, 2022 at 3:53 PM Andrew MacLeod wrote: > > On 2/8/22 03:25, Richard Biener wrote: > > On Mon, Feb 7, 2022 at 3:33 PM Andrew MacLeod via Gcc-patches > > wrote: > >> This changes the non-null interface to provide more granularity and > >> facilitate more precise queries. > >> > >>

Re: [PATCH 5/4] tree-optimization/104288 - An alternative approach

2022-02-08 Thread Andrew MacLeod via Gcc-patches
On 2/8/22 03:32, Richard Biener wrote: On Tue, Feb 8, 2022 at 2:33 AM Andrew MacLeod via Gcc-patches wrote: On 2/7/22 09:29, Andrew MacLeod wrote: I have a proposal for PR 104288. ALL patches (in sequence) bootstrap on their own and each cause no regressions. I've been continuing to work

Fwd: [PATCH 2/4] tree-optimization/104288 - Register side effects during ranger vrp domwalk.

2022-02-08 Thread Andrew MacLeod via Gcc-patches
bah.. wrong reply function Forwarded Message Subject: Re: [PATCH 2/4] tree-optimization/104288 - Register side effects during ranger vrp domwalk. Date: Tue, 8 Feb 2022 09:52:49 -0500 From: Andrew MacLeod To: Richard Biener On 2/8/22 03:14, Richard Biener

Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-08 Thread Richard Biener via Gcc-patches
On Tue, 8 Feb 2022, Michael Matz wrote: > Hello, > > On Tue, 8 Feb 2022, Richard Biener wrote: > > > int foo(int always_true_at_runtime) > > { > > { > > int *p; > > if (always_true_at_runtime) > > goto after; > > lab: > > return *p; > > after: > > int i = 0; > > p =

Re: [PATCH 3/4] tree-optimization/104288 - Update non-null interface to provide better precision.

2022-02-08 Thread Andrew MacLeod via Gcc-patches
On 2/8/22 03:25, Richard Biener wrote: On Mon, Feb 7, 2022 at 3:33 PM Andrew MacLeod via Gcc-patches wrote: This changes the non-null interface to provide more granularity and facilitate more precise queries. Previously, we could only ask if NAME was nonnull anywhere in the block, and it

[committed][nvptx] Unbreak build, add PTX_ISA_SM70

2022-02-08 Thread Tom de Vries via Gcc-patches
Hi, With the commit "[nvptx] Choose -mptx default based on -misa" I introduced a use of PTX_ISA_SM70, without adding it first. Add it, as well as the corresponding TARGET_SM70. Build for x86_64 with nvptx accelerator. Committed to trunk. Thanks, - Tom [nvptx] Unbreak build, add PTX_ISA_SM70

Re: [PATCH] s390: Change costs for load on condition.

2022-02-08 Thread Robin Dapp via Gcc-patches
> Patch is ok. Thanks! As discussed off-list, committed as attached. Regards Robin commit 1e3185e714e877b2b4d14ade0865322f71a8cbf6 Author: Robin Dapp Date: Tue Feb 8 14:56:29 2022 +0100 s390: Increase costs for load on condition and change movqicc expander. This patch changes

[committed] libstdc++: Add comment to acinclude.m4

2022-02-08 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY): Add comment about checking for CAS on correct word size. --- libstdc++-v3/acinclude.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/acinclude.m4

Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-08 Thread Michael Matz via Gcc-patches
Hello, On Tue, 8 Feb 2022, Richard Biener wrote: > int foo(int always_true_at_runtime) > { > { > int *p; > if (always_true_at_runtime) > goto after; > lab: > return *p; > after: > int i = 0; > p = > if (always_true_at_runtime) > goto lab; > } > return

[committed] libstdc++: Adjust Filesystem TS test for Windows

2022-02-08 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and x86_64-w64-mingw, pushed to trunk. The Filesystem TS isn't really supported for Windows, but the FAIL for this test is just because it doesn't match what happens on Windows. libstdc++-v3/ChangeLog: *

[committed] libstdc++: Fix filesystem::remove_all for Windows [PR104161]

2022-02-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 5 Feb 2022 at 01:08, Jonathan Wakely wrote: > > On Fri, 4 Feb 2022 at 23:55, Jonathan Wakely wrote: > > +// Used to implement filesystem::remove_all. > > +fs::recursive_directory_iterator& > > +fs::recursive_directory_iterator::__erase(error_code* ecptr) > > +{ > > + error_code ec; > > +

Re: [committed][nvptx] Choose -mptx default based on -misa

2022-02-08 Thread Tom de Vries via Gcc-patches
On 2/8/22 14:24, Tobias Burnus wrote: Hi Tom, if I understand the patch correctly, -misa=sm_53 -mptx=3.1 will ... On 08.02.22 13:57, Tom de Vries via Gcc-patches wrote: Furthermore, using the -mptx option is a bit user-unfriendly. Say we want to compile for sm_80.  We can use -misa=sm_80 to

Re: [committed][nvptx] Choose -mptx default based on -misa

2022-02-08 Thread Tobias Burnus
Hi Tom, if I understand the patch correctly, -misa=sm_53 -mptx=3.1 will ... On 08.02.22 13:57, Tom de Vries via Gcc-patches wrote: Furthermore, using the -mptx option is a bit user-unfriendly. Say we want to compile for sm_80. We can use -misa=sm_80 to specify that, but then run into errors

Re: [committed][nvptx] Choose -mptx default based on -misa

2022-02-08 Thread Tom de Vries via Gcc-patches
On 2/8/22 13:57, Tom de Vries via Gcc-patches wrote: +static const char * +sm_version_to_string (enum ptx_isa sm) +{ + switch (sm) +{ +case PTX_ISA_SM30: + return "30"; +case PTX_ISA_SM35: + return "35"; +case PTX_ISA_SM53: + return "53"; +case PTX_ISA_SM70: +

[PATCH] nvptx: Tweak constraints on copysign instructions.

2022-02-08 Thread Roger Sayle
Many thanks to Thomas Schwinge for confirming my hypothesis that the register usage regression, PR target/104345, is solely due to libgcc's _muldc3 function. In addition to the isinf functionality in the previously proposed nvptx patch at

[committed][nvptx] Choose -mptx default based on -misa

2022-02-08 Thread Tom de Vries via Gcc-patches
Hi, While testing with driver version 390.147 I ran into the problem that it doesn't support ptx isa version 6.3 (the new default), only 6.1. Furthermore, using the -mptx option is a bit user-unfriendly. Say we want to compile for sm_80. We can use -misa=sm_80 to specify that, but then run

[PATCH v4][GCC13] RISC-V: Provide `fmin'/`fmax' RTL patterns

2022-02-08 Thread Maciej W. Rozycki
As at r2.2 of the RISC-V ISA specification[1] (equivalent to version 2.0 of the "F" and "D" standard architecture extensions for single-precision and double-precision floating-point respectively) the FMIN and FMAX machine instructions fully match our requirement for the `fminM3' and `fmaxM3'

Re: [PATCH] RISC-V/testsuite: Run target testing over all the usual optimization levels

2022-02-08 Thread Maciej W. Rozycki
On Tue, 8 Feb 2022, Kito Cheng wrote: > Thanks for doing this, OK to trunk. I didn't realise we still have a separate ChangeLog for the testsuite and I have mechanically updated the entry accordingly. Change applied now with that update, thanks for your review. Maciej

Re: [PATCH v2] doc: RISC-V: Document the `-misa-spec=' option

2022-02-08 Thread Maciej W. Rozycki
On Mon, 7 Feb 2022, Palmer Dabbelt wrote: > > > Good point. I have updated the text to your suggested wording, which is > > > also what I would use if I were to propose it (modulo capitalisation). I > > > will commit the change as included here shortly then unless I hear an > > > objection. >

Re: [PATCH] RISC-V: Add target machine headers as a dependency for riscv-sr.o

2022-02-08 Thread Maciej W. Rozycki
On Mon, 7 Feb 2022, Kito Cheng wrote: > OK to trunk, thanks for fixing this issue, I hit that issue before but > I didn't figure out what happened...since that issue will disappear > when I clean build :p Committed to trunk now, thanks for you review. How about release branches? Maciej

Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization

2022-02-08 Thread Paul Richard Thomas via Gcc-patches
Hi Harald, Thanks for giving the patch a whirl. > the parent components as an array. I strongly suspect that, from reading > > 7.5.6.2 paragraphs 2 and 3 closely, that ifort has it right. However, > this > > is another issue to come back to in the future. > > Could you specify which version of

Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-08 Thread Eric Botcazou via Gcc-patches
> I don't think an option to go to pre-12 behavior is useful. I'll > postpone the series to stage1. FWIW fine with me. -- Eric Botcazou

Re: [PATCH] doc: invoke: RISC-V: Clean up the -mstrict-align wording

2022-02-08 Thread Andreas Schwab
On Feb 07 2022, Palmer Dabbelt wrote: > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 0ebe538ccdc..5e8af05e359 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -27702,7 +27702,7 @@ integer load/stores only. > @item -mstrict-align > @itemx -mno-strict-align >

Re: [PATCH] doc: invoke: RISC-V: Clean up the -memit-attribute wording

2022-02-08 Thread Kito Cheng via Gcc-patches
Hi Palmer: Seems like...you update the wrong part? you are updating -mmcount-ra-address/-mno-mcount-ra-address rather than -memit-attribute/ -mno-emit-attribute ? On Tue, Feb 8, 2022 at 12:30 PM Palmer Dabbelt wrote: > > The previous wording makes it sound like "do not emit" is a >

Re: [PATCH] doc: invoke: RISC-V: Clean up the -mstrict-align wording

2022-02-08 Thread Kito Cheng via Gcc-patches
LGTM, thanks :) On Tue, Feb 8, 2022 at 12:30 PM Palmer Dabbelt wrote: > > The polarity of do/do not was reversed for this option when compored to > the rest of them. This seems to have been copied from PowerPC, when the > polarity of the arguments in the docs was reversed (presumably to match >

[committed][testsuite] Require c99_runtime to run builtin-sprintf.c

2022-02-08 Thread Tom de Vries via Gcc-patches
Hi, On nvptx, I run into an execution failure in test-case gcc.dg/tree-ssa/builtin-sprintf.c because the test-case uses the 'hh' modifier. The port uses newlib, which does by default not support that modifier. There's a configure option --enable-newlib-io-c99-formats to enable this support, but

[committed][testsuite] Require c99_runtime to run builtin-sprintf.c

2022-02-08 Thread Tom de Vries via Gcc-patches
Hi, On nvptx, I run into an execution failure in test-case gcc.dg/tree-ssa/builtin-sprintf.c because the test-case uses the 'hh' modifier. The port uses newlib, which does by default not support that modifier. There's a configure option --enable-newlib-io-c99-formats to enable this support, but

[committed][nvptx] Fix .local atomic regressions

2022-02-08 Thread Tom de Vries via Gcc-patches
Hi, In PR target/104364, two problems were reported: - in muniform-simt mode, an atom.cas insn is no longer executed in the "master lane" only. - in msoft-stack mode, an __atomic_compare_exchange_n on stack memory is translated assuming it accesses local memory, while that's not the case.

Re: [PATCH] [vect] Add vect_recog_cond_expr_convert_pattern.

2022-02-08 Thread Richard Biener via Gcc-patches
On Mon, Jan 24, 2022 at 2:01 PM liuhongt via Gcc-patches wrote: > > The pattern converts (cond (cmp a b) (convert c) (convert d)) > to (convert (cond (cmp a b) c d)) when > 1) types_match (c, d) > 2) single_use for (convert c) and (convert d) > 3) TYPE_PRECISION (TREE_TYPE (c)) == TYPE_PRECISION

[committed] libgomp: Fix segfault with posthumous orphan tasks [PR104385]

2022-02-08 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch fixes crashes with posthumous orphan tasks. When a parent task finishes, gomp_clear_parent clears the parent pointers of its children tasks present in the parent->children_queue. But children that are still waiting for dependencies aren't in that queue yet, they will be

Re: [PATCH] dwarf2out: Don't call expand_expr during early_dwarf [PR104407]

2022-02-08 Thread Richard Biener via Gcc-patches
On Tue, 8 Feb 2022, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, since PR96690 r11-2834 we call rtl_for_decl_init > which can call expand_expr already during early_dwarf. The comment and PR > explains it that the intent is to ensure the referenced vars and functions > are properly

Re: [PATCH 5/4] tree-optimization/104288 - An alternative approach

2022-02-08 Thread Richard Biener via Gcc-patches
On Tue, Feb 8, 2022 at 2:33 AM Andrew MacLeod via Gcc-patches wrote: > > On 2/7/22 09:29, Andrew MacLeod wrote: > > I have a proposal for PR 104288. > > > > ALL patches (in sequence) bootstrap on their own and each cause no > > regressions. > > I've been continuing to work with this towards the

Re: [PATCH 4/4] [GCC11] tree-optimization/104288 - range on entry should check dominators for non-null.

2022-02-08 Thread Richard Biener via Gcc-patches
On Mon, Feb 7, 2022 at 3:34 PM Andrew MacLeod via Gcc-patches wrote: > > The patches resolves the issue for GCC11 in a much simpler way. > > By default, ranger and EVRP are running in hybrid mode. This means if > ranger misses something, evrp will pick up the slack. This enables us to > change

Re: [PATCH 3/4] tree-optimization/104288 - Update non-null interface to provide better precision.

2022-02-08 Thread Richard Biener via Gcc-patches
On Mon, Feb 7, 2022 at 3:33 PM Andrew MacLeod via Gcc-patches wrote: > > This changes the non-null interface to provide more granularity and > facilitate more precise queries. > > Previously, we could only ask if NAME was nonnull anywhere in the block, > and it applied to the entire block. now

[PATCH] c++: Don't emit repeated -Wshadow warnings for templates/ctors [PR104379]

2022-02-08 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch suppresses extraneous -Wshadow warnings. On the testcase without the patch we emit 14 -Wshadow warnings, with the patch just 4. It is enough to warn once e.g. during parsing of the template or the abstract ctor, while previously we'd warn also on the clones of the ctors

[PATCH] c++: Remove superflous assert [PR104403]

2022-02-08 Thread Jakub Jelinek via Gcc-patches
Hi! I've added the assert because start_decl diagnoses such vars for C++20 and earlier: if (current_function_decl && VAR_P (decl) && DECL_DECLARED_CONSTEXPR_P (current_function_decl) && cxx_dialect < cxx23) but as can be seen, we cam trigger the assert in older standards e.g. during

Re: [PATCH 2/4] tree-optimization/104288 - Register side effects during ranger vrp domwalk.

2022-02-08 Thread Richard Biener via Gcc-patches
On Mon, Feb 7, 2022 at 3:32 PM Andrew MacLeod via Gcc-patches wrote: > > This patch adds the ability to register side effects within a block to > ranger. This is currently only for tracking non-null values. > > the rvrp_folder performs a DOM walk and then attempts to simplify and > the fold each

[PATCH] dwarf2out: Don't call expand_expr during early_dwarf [PR104407]

2022-02-08 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, since PR96690 r11-2834 we call rtl_for_decl_init which can call expand_expr already during early_dwarf. The comment and PR explains it that the intent is to ensure the referenced vars and functions are properly mangled because free_lang_data doesn't cover everything,