Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-11-02 Thread Thomas Rodgers
This version of the patch specifically doesn’t deal with long double. Mostly looking for Jonathan’s review to ensure his previous feedback is addressed. I plan to rev the patch to handle long doubles after some further discussion with you and Jonathan. On Tue, Nov 2, 2021 at 12:49 AM Jakub Jelinek

Re: [PATCH] Check number of iterations for test cases pr101145

2021-11-02 Thread Jiufu Guo via Gcc-patches
Richard Biener writes: > On Mon, 1 Nov 2021, Jiufu Guo wrote: > >> PR101145 is supporting if the number of iterations can be calculated >> for the 'until wrap' condition. Current test cases are checking if >> the loop can be vectorized, if a loop can be vectorized then the number >> of interatio

Re: [PATCH, rs6000] Disable gimple fold for float or double vec_minmax when fast-math is not set

2021-11-02 Thread HAO CHEN GUI via Gcc-patches
David,   Thanks for your comments. I refined it according to your advice. ChangeLog 2021-11-01 Haochen Gui gcc/     * config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin): Disable     gimple fold for VSX_BUILTIN_XVMINDP, ALTIVEC_BUILTIN_VMINFP,     VSX_BUILTIN_XVMAXDP, ALTIVEC_

Re: [PATCH 09/18] rs6000: Builtin expansion, part 4

2021-11-02 Thread Segher Boessenkool
Hi! On Wed, Sep 01, 2021 at 11:13:45AM -0500, Bill Schmidt wrote: > static insn_code > elemrev_icode (rs6000_gen_builtins fcode) > { > + switch (fcode) > +{ > +default: > + gcc_unreachable (); default: goes at the end. > +case RS6000_BIF_ST_ELEMREV_V1TI: > + return BYTE

Re: [PATCH 08/18] rs6000: Builtin expansion, part 3

2021-11-02 Thread Segher Boessenkool
On Wed, Sep 01, 2021 at 11:13:44AM -0500, Bill Schmidt wrote: > * config/rs6000/rs6000-call.c (new_cpu_expand_builtin): > Implement. (just one line) > @@ -14646,6 +14646,108 @@ static rtx > new_cpu_expand_builtin (enum rs6000_gen_builtins fcode, > tree exp ATTRI

Fix wrong code caused by ipa-modref retslot handling

2021-11-02 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes (quite nasty) thinko in how I propagate EAF flags from callee to caller. In this case some flags needs to be changed. In particular - EAF_NOT_RETURNED in callee does not really mean EAF_NOT_RETURNED in caller since we speak of different return values - if callee escap

Re: [PATCH 1/2] add -Wuse-after-free

2021-11-02 Thread Martin Sebor via Gcc-patches
On 11/2/21 4:29 PM, David Malcolm wrote: On Mon, 2021-11-01 at 16:17 -0600, Martin Sebor via Gcc-patches wrote: Patch 1 in the series detects a small subset of uses of pointers made indeterminate by calls to deallocation functions like free or C++ operator delete. To control the conditions the

c: Fold implicit integer-to-floating conversions in static initializers with -frounding-math [PR103031]

2021-11-02 Thread Joseph Myers
Recent fixes to avoid inappropriate folding of some conversions to floating-point types with -frounding-math also prevented such folding in C static initializers, when folding (in the default rounding mode, exceptions discarded) is required for correctness. Folding for static initializers is handl

[PATCH] libstdc++: Deprecate std::unexpected and handler functions

2021-11-02 Thread Jonathan Wakely via Gcc-patches
These functions have been deprecated since C++11, and were removed in C++17. The proposal P0323 wants to reuse the name std::unexpected for a class template, so we will need to stop defining the current function for C++23 anyway. This marks them as deprecated for C++11 and up, to warn users they w

[committed] libstdc++: Add some noexcept to std::valarray

2021-11-02 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. libstdc++-v3/ChangeLog: * include/std/valarray (valarray::valarray()): Add noexcept. (valarray::operator[]): Likewise. --- libstdc++-v3/include/std/valarray | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib

Re: ipa-modref cleanup

2021-11-02 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 12:04:20AM +0100, Jan Hubicka via Gcc-patches wrote: > > It broke GCC bootstrap: > > > > https://gcc.gnu.org/pipermail/gcc-regression/2021-November/075676.html > > > > In file included from ../../src-master/gcc/coretypes.h:474, > > from ../../src-master/gc

Re: ipa-modref cleanup

2021-11-02 Thread Jan Hubicka via Gcc-patches
> It broke GCC bootstrap: > > https://gcc.gnu.org/pipermail/gcc-regression/2021-November/075676.html > > In file included from ../../src-master/gcc/coretypes.h:474, > from ../../src-master/gcc/expmed.c:26: > In function ‘poly_uint16 mode_to_bytes(machine_mode)’, > inlined fro

Re: [PATCH] Record that -gtoggle is already used in gcc_options.

2021-11-02 Thread Andrew Pinski via Gcc-patches
On Tue, Nov 2, 2021 at 7:11 AM Martin Liška wrote: > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > When doing flip based on -gtoggle, record it. Otherwise, we will > apply it for the second time in finish_options. > >

Re: ipa-modref cleanup

2021-11-02 Thread H.J. Lu via Gcc-patches
On Tue, Nov 2, 2021 at 2:21 PM Jan Hubicka via Gcc-patches wrote: > > Hi, > this patch is a small refactoring of ipa-modref to make it bit more > C++y by moving logic analyzing ssa name flags to a class > and I also moved the anonymous namespace markers so we do not > export unnecessary stuff. Th

[patch][PR103033]handle the case when native_interpret_expr return NULL

2021-11-02 Thread Qing Zhao via Gcc-patches
Hi, PR103033 (c-c++-common/auto-init-4.c ICEs starting with r12-4829) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103033 Is an -ftrivial-auto-var-init bug exposed on Powerpc64-linux only. For the following code in gcc/internal-fn.c: 3085 if (can_native_interpret_type_p (var_typ

Re: [PATCH 1/2] add -Wuse-after-free

2021-11-02 Thread David Malcolm via Gcc-patches
On Mon, 2021-11-01 at 16:17 -0600, Martin Sebor via Gcc-patches wrote: > Patch 1 in the series detects a small subset of uses of pointers > made indeterminate by calls to deallocation functions like free > or C++ operator delete. To control the conditions the warnings > are issued under the new -W

Re: [PATCH] RISC-V: Enable overlap-by-pieces in case of fast unaliged access

2021-11-02 Thread Vineet Gupta
On 11/2/21 2:18 PM, Christoph Müllner wrote: On Tue, Nov 2, 2021 at 9:15 PM Vineet Gupta wrote: On 11/2/21 1:09 PM, Christoph Müllner wrote: Without overlap_op_by_pieces we get: 8e: 00053023sd zero,0(a0) 92: 00052423sw zero,8(a0) 9

ipa-modref cleanup

2021-11-02 Thread Jan Hubicka via Gcc-patches
Hi, this patch is a small refactoring of ipa-modref to make it bit more C++y by moving logic analyzing ssa name flags to a class and I also moved the anonymous namespace markers so we do not export unnecessary stuff. There are no functional changes. Bootstrapped/regtested x86_64-linux, will commi

Re: [PATCH] RISC-V: Enable overlap-by-pieces in case of fast unaliged access

2021-11-02 Thread Christoph Müllner via Gcc-patches
On Tue, Nov 2, 2021 at 9:15 PM Vineet Gupta wrote: > > > > On 11/2/21 1:09 PM, Christoph Müllner wrote: > Without overlap_op_by_pieces we get: > 8e: 00053023sd zero,0(a0) > 92: 00052423sw zero,8(a0) > 96: 00051623

[PATCH] Add 'no_builtin' function attribute

2021-11-02 Thread Keith Packard via Gcc-patches
This attribute controls optimizations which make assumptions about the semantics of builtin functions. Typical cases here are code which match memcpy, calloc, sincos, or which call builtins like free. This extends on things like the -ftree-loop-distribute-patterns flag. That flag only covers conve

Re: [PATCH 1/2] Flag CPP_W_BIDIRECTIONAL so that source lines are escaped

2021-11-02 Thread David Malcolm via Gcc-patches
On Tue, 2021-11-02 at 16:58 -0400, David Malcolm wrote: > Before: > >   Wbidirectional-1.c: In function ‘main’: >   Wbidirectional-1.c:6:43: warning: unpaired UTF-8 bidirectional > character detected [-Wbidirectional=] >   6 | /*‮ } ⁦if (isAdmin)⁩ ⁦ begin admins only */ >     |

Re: redundant bitmap_bit_p followed by bitmap_clear_bit [was: Re: [COMMITTED] Kill second order relations in the path solver.]

2021-11-02 Thread Bernhard Reutner-Fischer via Gcc-patches
On 2 November 2021 14:43:38 CET, Richard Biener wrote: >On Mon, Nov 1, 2021 at 10:02 PM Bernhard Reutner-Fischer via >Gcc-patches wrote: >> >> On Mon, 1 Nov 2021 15:21:03 +0100 >> Aldy Hernandez wrote: >> >> > I'm not convinced this makes the code clearer to read, especially if >> > it's not on

[PATCH 2/2] Capture locations of bidi chars and underline ranges

2021-11-02 Thread David Malcolm via Gcc-patches
This patch converts the bidi::vec to use a struct so that we can capture location_t values for the bidirectional control characters, and uses these to label sources ranges in the diagnostics. The effect on the output can be seen in the new testcase. gcc/testsuite/ChangeLog: * c-c++-common

[PATCH 1/2] Flag CPP_W_BIDIRECTIONAL so that source lines are escaped

2021-11-02 Thread David Malcolm via Gcc-patches
Before: Wbidirectional-1.c: In function ‘main’: Wbidirectional-1.c:6:43: warning: unpaired UTF-8 bidirectional character detected [-Wbidirectional=] 6 | /*‮ } ⁦if (isAdmin)⁩ ⁦ begin admins only */ | ^ Wbidirectional-1.c:9:28: warni

[PATCH 0/2] Re: [PATCH] libcpp: Implement -Wbidirectional for CVE-2021-42574 [PR103026]

2021-11-02 Thread David Malcolm via Gcc-patches
On Mon, 2021-11-01 at 12:36 -0400, Marek Polacek via Gcc-patches wrote: > From a link below: > "An issue was discovered in the Bidirectional Algorithm in the > Unicode > Specification through 14.0. It permits the visual reordering of > characters via control sequences, which can be used to craft so

Re: [PATCH] attribs: Allow optional second arg for attr deprecated [PR102049]

2021-11-02 Thread Marek Polacek via Gcc-patches
On Mon, Nov 01, 2021 at 05:15:03PM -0600, Martin Sebor wrote: > On 10/11/21 9:17 AM, Marek Polacek via Gcc-patches wrote: > > Any thoughts? > > I'm a little unsure. Clang just uses the replacement string > as the text of the fix-it note as is, so it does nothing to > help programmers make sure th

Re: [PATCH 0/5] Fortran manual updates

2021-11-02 Thread Damian Rouson
On Tue, Nov 2, 2021 at 8:56 AM Sandra Loosemore wrote: > > ... I will hold off on that if it's going to cause problems. > > Thanks for taking on this task, Sandra. I'm not aware of the technical issues around mark-up formatting and the transition that's happening, but I hope nothing holds up a l

Re: Building GNU Arm Embedded Toolchain for macOS/arm64

2021-11-02 Thread Iain Sandoe
Hi Romain, > On 2 Nov 2021, at 20:12, Romain Goyet wrote: > > Thanks for your reply! However, what I'm referring to is a lot more simple > than that: I just want to build bare-metal binaries for Cortex-M devices from > a Darwin/arm64 host. Not to produce Mach-O binaries that can run on > Dar

Re: [PATCH] vect: Add bias parameter for partial vectorization

2021-11-02 Thread Robin Dapp via Gcc-patches
Hi, thanks for the helpful comments. The attached v2 addresses the following points from them: - Save the bias in loop_vinfo and set it once in vect_verify_loop_lens. - Add code to handle the bias in vect_set_loop_controls_directly. - Adjust costing. - Add comments for the new len_load parame

Re: [PATCH] RISC-V: Enable overlap-by-pieces in case of fast unaliged access

2021-11-02 Thread Vineet Gupta
On 11/2/21 1:09 PM, Christoph Müllner wrote: Without overlap_op_by_pieces we get: 8e: 00053023sd zero,0(a0) 92: 00052423sw zero,8(a0) 96: 00051623sh zero,12(a0) 9a: 00050723sb zero,14(a0

Re: Building GNU Arm Embedded Toolchain for macOS/arm64

2021-11-02 Thread Romain Goyet via Gcc-patches
Hi Iain, Thanks for your reply! However, what I'm referring to is a lot more simple than that: I just want to build bare-metal binaries for Cortex-M devices from a Darwin/arm64 host. Not to produce Mach-O binaries that can run on Darwin/arm64. Essentially, I just made the toolchain at https://dev

Re: [PATCH] RISC-V: Enable overlap-by-pieces in case of fast unaliged access

2021-11-02 Thread Christoph Müllner via Gcc-patches
On Tue, Nov 2, 2021 at 8:27 PM Vineet Gupta wrote: > > On 7/22/21 6:29 AM, Kito Cheng via Gcc-patches wrote: > > Could you add a testcase? Otherwise LGTM. > > > > Option: -O2 -mtune=thead-c906 -march=rv64gc -mabi=lp64 > > void foo(char *dst){ > > __builtin_memset(dst, 0, 15); > > } > > > > On

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

2021-11-02 Thread Marek Polacek via Gcc-patches
On Tue, Nov 02, 2021 at 01:20:03PM -0600, Martin Sebor wrote: > On 11/2/21 11:18 AM, Marek Polacek via Gcc-patches wrote: > > On Mon, Nov 01, 2021 at 10:10:40PM +, Joseph Myers wrote: > > > On Mon, 1 Nov 2021, Marek Polacek via Gcc-patches wrote: > > > > > > > + /* We've read a bidi char, upd

Re: [PATCH] Initial implementation of -Whomoglyph [PR preprocessor/103027]

2021-11-02 Thread Martin Sebor via Gcc-patches
On 11/1/21 3:14 PM, David Malcolm via Gcc-patches wrote: [Resending to get around mailing list size limit; see notes below] This patch implements a new -Whomoglyph diagnostic, enabled by default. Internally it implements the "skeleton" algorithm from: http://www.unicode.org/reports/tr39/#Con

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

2021-11-02 Thread Marek Polacek via Gcc-patches
On Tue, Nov 02, 2021 at 12:51:16PM -0600, Martin Sebor via Gcc-patches wrote: > On 10/4/21 4:39 PM, Eric Gallager wrote: > > On Mon, Oct 4, 2021 at 2:43 PM Martin Sebor via Gcc-patches > > wrote: > > > > > > While resolving the recent -Waddress enhancement request (PR > > > PR102103) I came acros

Re: [PATCH] RISC-V: Enable overlap-by-pieces in case of fast unaliged access

2021-11-02 Thread Vineet Gupta
On 7/22/21 6:29 AM, Kito Cheng via Gcc-patches wrote: Could you add a testcase? Otherwise LGTM. Option: -O2 -mtune=thead-c906 -march=rv64gc -mabi=lp64 void foo(char *dst){ __builtin_memset(dst, 0, 15); } On Thu, Jul 22, 2021 at 8:53 PM Christoph Muellner via Gcc-patches wrote: This patch

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

2021-11-02 Thread Martin Sebor via Gcc-patches
On 11/2/21 11:18 AM, Marek Polacek via Gcc-patches wrote: On Mon, Nov 01, 2021 at 10:10:40PM +, Joseph Myers wrote: On Mon, 1 Nov 2021, Marek Polacek via Gcc-patches wrote: + /* We've read a bidi char, update the current vector as necessary. */ + void on_char (kind k, bool ucn_p) + { +

Re: [PATCH v3] AArch64: Improve GOT addressing

2021-11-02 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Hi Richard, > >> - Why do we rewrite the constant moves after reload into ldr_got_small_sidi >> and ldr_got_small_? Couldn't we just get the move patterns to >> output the sequence directly? > > That's possible too, however it makes the movsi/di patterns more complex.

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

2021-11-02 Thread Martin Sebor via Gcc-patches
On 10/4/21 4:39 PM, Eric Gallager wrote: On Mon, Oct 4, 2021 at 2:43 PM Martin Sebor via Gcc-patches wrote: While resolving the recent -Waddress enhancement request (PR PR102103) I came across a 2007 problem report about GCC 4 having stopped warning for using the address of inline functions in

Re: [PATCH v3] AArch64: Improve GOT addressing

2021-11-02 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, > - Why do we rewrite the constant moves after reload into ldr_got_small_sidi >   and ldr_got_small_?  Couldn't we just get the move patterns to >   output the sequence directly? That's possible too, however it makes the movsi/di patterns more complex. See version v4 below. > - I thi

Re: [PATCH] PR fortran/91497 -- Silence conversion warnings for MIN1 and MAX1

2021-11-02 Thread Thomas Koenig via Gcc-patches
On 02.11.21 15:22, Manfred Schwarb wrote: Am 02.11.21 um 14:26 schrieb Thomas Koenig: Hi Manfred, In addition to the patches of Steve Kargl for PR 91497: The MIN1 and MAX1 intrinsics do explicit type conversions and should be silenced too for -Wconversion and -Wconversion-extra. Adjust testca

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

2021-11-02 Thread Martin Sebor via Gcc-patches
On 11/2/21 1:40 AM, Eric Gallager wrote: On Mon, Nov 1, 2021 at 6:20 PM Martin Sebor via Gcc-patches wrote: Patch 2 in this series adds support for detecting the uses of dangling pointers: those to auto objects that have gone out of scope. Like patch 1, to minimize false positives this detect

Re: [PATCH]middle-end Add an RPO pass after successful vectorization

2021-11-02 Thread Richard Biener via Gcc-patches
On Tue, 2 Nov 2021, Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > On Tue, 2 Nov 2021, Tamar Christina wrote: > > > >> > -Original Message- > >> > From: Richard Biener > >> > Sent: Tuesday, November 2, 2021 2:24 PM > >> > To: Tamar Christina > >> > Cc: gcc-patches

[PATCH] c++: nested lambda capturing a capture proxy [PR94376]

2021-11-02 Thread Patrick Palka via Gcc-patches
Here when determining the type of the FIELD_DECL for the by-value capture of 'i' in the inner lambda, we incorrectly give it the type const int instead of int since the effective initializer is the proxy for the outer capture, and this proxy is const qualified since the outer lambda is non-mutable.

Re: redundant bitmap_bit_p followed by bitmap_clear_bit [was: Re: [COMMITTED] Kill second order relations in the path solver.]

2021-11-02 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Mon, Nov 1, 2021 at 10:02 PM Bernhard Reutner-Fischer via > Gcc-patches wrote: >> >> On Mon, 1 Nov 2021 15:21:03 +0100 >> Aldy Hernandez wrote: >> >> > I'm not convinced this makes the code clearer to read, especially if >> > it's not on a critical pat

Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).

2021-11-02 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 02, 2021 at 05:27:14PM +0100, Jakub Jelinek via Gcc-patches wrote: > I'm not sure this is what the standard says, certainly C/C++ FE do this > quite differently for combined/composite constructs. > In particular, we first split the clauses to the individual leaf constructs > in c_omp_sp

[PATCH] tree-optimization/103029 - ensure vect loop versioning constraint on PHIs

2021-11-02 Thread Richard Biener via Gcc-patches
PHI nodes in vectorizer loop versioning need to maintain the same order of PHI arguments to not disturb SLP discovery. The following adds an assertion and mitigation in case loop versioning breaks this which happens more often after the recent reorg. Bootstrapped and tested on x86_64-unknown-linu

[PATCH] IBM Z: Free bbs in s390_loop_unroll_adjust

2021-11-02 Thread Stefan Schulze Frielinghaus via Gcc-patches
Bootstrapped and regtested on IBM Z. Ok for mainline? gcc/ChangeLog: * config/s390/s390.c (s390_loop_unroll_adjust): In case of early exit free bbs. --- gcc/config/s390/s390.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/s390/s390.c b/gcc/co

[PATCH v2] libcpp: Implement -Wbidirectional for CVE-2021-42574 [PR103026]

2021-11-02 Thread Marek Polacek via Gcc-patches
On Mon, Nov 01, 2021 at 10:10:40PM +, Joseph Myers wrote: > On Mon, 1 Nov 2021, Marek Polacek via Gcc-patches wrote: > > > + /* We've read a bidi char, update the current vector as necessary. */ > > + void on_char (kind k, bool ucn_p) > > + { > > +switch (k) > > + { > > + cas

Re: [PATCH 3/5]AArch64 sve: do not keep negated mask and inverse mask live at the same time

2021-11-02 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi, > > Here's a respin of the patch which I think encompasses the method you > expected. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? > > Thanks, > Tamar > > gcc/ChangeLog: > > * tree-vect-stmts.c (vectorizable_condition):

Re: [PATCH 1/2] add -Wuse-after-free

2021-11-02 Thread Martin Sebor via Gcc-patches
On 11/1/21 11:32 PM, Eric Gallager wrote: On Mon, Nov 1, 2021 at 6:18 PM Martin Sebor via Gcc-patches wrote: Patch 1 in the series detects a small subset of uses of pointers made indeterminate by calls to deallocation functions like free or C++ operator delete. To control the conditions the w

Re: [PATCH]middle-end Add an RPO pass after successful vectorization

2021-11-02 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Tue, 2 Nov 2021, Tamar Christina wrote: > >> > -Original Message- >> > From: Richard Biener >> > Sent: Tuesday, November 2, 2021 2:24 PM >> > To: Tamar Christina >> > Cc: gcc-patches@gcc.gnu.org; nd >> > Subject: Re: [PATCH]middle-end Add an R

Re: [PATCH] RISC-V: Fix register class subset checks for CLASS_MAX_NREGS

2021-11-02 Thread Kito Cheng via Gcc-patches
Hi Maciej: LGTM, My first impression of this patch is also confusing about the ordering of arguments for reg_class_subset_p, but after I double checked that with gdb and read the comment above the reg_class_subset_p, I think this change is right. Thanks! On Tue, Nov 2, 2021 at 11:17 PM Maciej W

Re: [PATCH] Record that -gtoggle is already used in gcc_options.

2021-11-02 Thread Richard Biener via Gcc-patches
On Tue, Nov 2, 2021 at 4:11 PM Martin Liška wrote: > > On 11/2/21 15:33, Richard Biener wrote: > > I think -gtoggle matches a Defered option and thus should be processed > > in handle_common_deferred_options. > > Well, that's quite problematic as I handle_common_deferred_options is called > after

Re: [committed v2] RISC-V: Fix build errors with shNadd/shNadd.uw patterns in zba cost model

2021-11-02 Thread Kito Cheng via Gcc-patches
On Wed, Nov 3, 2021 at 12:07 AM Maciej W. Rozycki wrote: > > Fix a build regression from commit 04a9b554ba1a ("RISC-V: Cost model > for zba extension."): > > .../gcc/config/riscv/riscv.c: In function 'bool riscv_rtx_costs(rtx, > machine_mode, int, int, int*, bool)': > .../gcc/config/riscv/riscv.c

Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).

2021-11-02 Thread Jakub Jelinek via Gcc-patches
On Fri, Oct 22, 2021 at 02:05:02PM +0100, Hafiz Abid Qadeer wrote: > This patch adds support for OpenMP 5.0 allocate clause for fortran. It does > not > yet support the allocator-modifier as specified in OpenMP 5.1. The allocate > clause is already supported in C/C++. > > gcc/fortran/ChangeLog: >

Re: [PATCH] [RFC][PR102768] aarch64: Add compiler support for Shadow Call Stack

2021-11-02 Thread Dan Li via Gcc-patches
On 11/2/21 9:04 PM, Szabolcs Nagy wrote: The 11/02/2021 00:06, Dan Li via Gcc-patches wrote: Shadow Call Stack can be used to protect the return address of a function at runtime, and clang already supports this feature[1]. To enable SCS in user mode, in addition to compiler, other support is

Re: [PATCH] Add -fopt-builtin optimization option

2021-11-02 Thread Keith Packard via Gcc-patches
Richard Biener writes: > I don't think it reliably works the way you implement it. It's also having > more side-effects than what you document, in particular Yeah, I made a 'minimal' patch that had the effect I needed, but it's clearly in the wrong place as it disables the matching of builtins

[committed v2] RISC-V: Fix build errors with shNadd/shNadd.uw patterns in zba cost model

2021-11-02 Thread Maciej W. Rozycki
Fix a build regression from commit 04a9b554ba1a ("RISC-V: Cost model for zba extension."): .../gcc/config/riscv/riscv.c: In function 'bool riscv_rtx_costs(rtx, machine_mode, int, int, int*, bool)': .../gcc/config/riscv/riscv.c:2018:11: error: 'and' of mutually exclusive equal-tests is always 0

RE: [PATCH 3/5]AArch64 sve: do not keep negated mask and inverse mask live at the same time

2021-11-02 Thread Tamar Christina via Gcc-patches
Hi, Here's a respin of the patch which I think encompasses the method you expected. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-stmts.c (vectorizable_condition): Check if inverse of mask is live.

Re: [PATCH 0/5] Fortran manual updates

2021-11-02 Thread Sandra Loosemore
On 11/2/21 9:20 AM, Martin Liška wrote: On 11/2/21 15:48, Sandra Loosemore wrote: On 11/2/21 2:51 AM, Martin Liška wrote: On 11/2/21 00:56, Sandra Loosemore wrote: I'll wait a couple days before committing these patches, in case anybody wants to give some feedback, especially on technical issu

[RFA] Minor optimization of variable bit testing

2021-11-02 Thread Jeff Law
I was wandering spec chasing down instances where we should be generating bit-test, bit-set and bit-clear types of instructions for our target when I ran across a generic missed optimization in this space. (((1 << N) & C) != 0)  -> (N == C') (((1 << N) & C) == 0)  -> (N != C') Where C is a

Re: Building GNU Arm Embedded Toolchain for macOS/arm64

2021-11-02 Thread Iain Sandoe
Hi Romain > On 2 Nov 2021, at 13:09, Romain Goyet via Gcc-patches > wrote: > Arm distribute pre-built versions of GCC that targets bare-metal Cortex-M > devices at > https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm > I have written a few sm

RE: [PATCH]middle-end Add an RPO pass after successful vectorization

2021-11-02 Thread Richard Biener via Gcc-patches
On Tue, 2 Nov 2021, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Tuesday, November 2, 2021 2:24 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd > > Subject: Re: [PATCH]middle-end Add an RPO pass after successful > > vectorization > > >

Re: [PATCH 0/5] Fortran manual updates

2021-11-02 Thread Martin Liška
On 11/2/21 15:48, Sandra Loosemore wrote: On 11/2/21 2:51 AM, Martin Liška wrote: On 11/2/21 00:56, Sandra Loosemore wrote: I'll wait a couple days before committing these patches, in case anybody wants to give some feedback, especially on technical issues. Hello. Appreciate the work you did

[PATCH] RISC-V: Fix register class subset checks for CLASS_MAX_NREGS

2021-11-02 Thread Maciej W. Rozycki
Fix the register class subset checks in the determination of the maximum number of consecutive registers needed to hold a value of a given mode. The number depends on whether a register is a general-purpose or a floating-point register, so check whether the register class requested is a subse

Re: [PATCH] Record that -gtoggle is already used in gcc_options.

2021-11-02 Thread Martin Liška
On 11/2/21 15:33, Richard Biener wrote: I think -gtoggle matches a Defered option and thus should be processed in handle_common_deferred_options. Well, that's quite problematic as I handle_common_deferred_options is called after decode_options (that calls finish_options). Note there's direct d

Re: [PATCH 2/5]AArch64 sve: combine nested if predicates

2021-11-02 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > Here’s a respin of the patch. > > The following example > > void f5(float * restrict z0, float * restrict z1, float *restrict x, > float * restrict y, float c, int n) > { > for (int i = 0; i < n; i++) { > float a = x[i]; > float b = y

Re: [PATCH] IBM Z: ldist-{rawmemchr,strlen} tests require vector extensions

2021-11-02 Thread Andreas Krebbel via Gcc-patches
On 11/2/21 15:54, Stefan Schulze Frielinghaus wrote: > The tests require vector extensions which are only available for z13 and > later while using the z/Architecture. > > Bootstrapped and regtested on IBM Z. Ok for mainline? > > gcc/testsuite/ChangeLog: > > * gcc.dg/tree-ssa/ldist-rawmem

Re: [PATCH] RISC-V: Fix build errors with shNadd/shNadd.uw patterns in zba cost model

2021-11-02 Thread Kito Cheng via Gcc-patches
Hi Maciej: On Mon, Nov 1, 2021 at 8:41 PM Maciej W. Rozycki wrote: > > Fix a build regression from commit 04a9b554ba1a ("RISC-V: Cost model > for zba extension."): > > .../gcc/config/riscv/riscv.c: In function 'bool riscv_rtx_costs(rtx, > machine_mode, int, int, int*, bool)': > .../gcc/config/ri

Re: [PATCH] dwarf: Multi-register CFI address support.

2021-11-02 Thread Hafiz Abid Qadeer
Ping. On 24/08/2021 16:55, Hafiz Abid Qadeer wrote: > Ping. > > On 22/07/2021 11:58, Hafiz Abid Qadeer wrote: >> Ping. >> >> On 13/06/2021 14:27, Hafiz Abid Qadeer wrote: >>> Add support for architectures such as AMD GCN, in which the pointer size is >>> larger than the register size. This allow

[PATCH] IBM Z: ldist-{rawmemchr, strlen} tests require vector extensions

2021-11-02 Thread Stefan Schulze Frielinghaus via Gcc-patches
The tests require vector extensions which are only available for z13 and later while using the z/Architecture. Bootstrapped and regtested on IBM Z. Ok for mainline? gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/ldist-rawmemchr-1.c: For IBM Z set arch to z13 and use z/Architecture s

Re: [PATCH 0/5] Fortran manual updates

2021-11-02 Thread Sandra Loosemore
On 11/2/21 2:51 AM, Martin Liška wrote: On 11/2/21 00:56, Sandra Loosemore wrote: I'll wait a couple days before committing these patches, in case anybody wants to give some feedback, especially on technical issues. Hello. Appreciate the work you did, but the patchset will cause quite some c

RE: [PATCH]middle-end Add an RPO pass after successful vectorization

2021-11-02 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Tuesday, November 2, 2021 2:24 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd > Subject: Re: [PATCH]middle-end Add an RPO pass after successful > vectorization > > On Tue, 2 Nov 2021, Tamar Christina wrote: > > > Hi All, >

Re: [PATCH] Record that -gtoggle is already used in gcc_options.

2021-11-02 Thread Richard Biener via Gcc-patches
On Tue, Nov 2, 2021 at 3:11 PM Martin Liška wrote: > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? I think -gtoggle matches a Defered option and thus should be processed in handle_common_deferred_options. I'd argue that --help printing should

Re: [PATCH]middle-end Add an RPO pass after successful vectorization

2021-11-02 Thread Richard Biener via Gcc-patches
On Tue, 2 Nov 2021, Tamar Christina wrote: > Hi All, > > Following my current SVE predicate optimization series a problem has presented > itself in that the way vector masks are generated for masked operations relies > on CSE to share masks efficiently. > > The issue however is that masking is d

Re: [PATCH] PR fortran/91497 -- Silence conversion warnings for MIN1 and MAX1

2021-11-02 Thread Manfred Schwarb via Gcc-patches
Am 02.11.21 um 14:26 schrieb Thomas Koenig: > Hi Manfred, > >> In addition to the patches of Steve Kargl for PR 91497: >> The MIN1 and MAX1 intrinsics do explicit type conversions and should >> be silenced too for -Wconversion and -Wconversion-extra. >> >> Adjust testcase to only use *4 and *8 real

Re: [PATCH] Add debug counters to back threader.

2021-11-02 Thread Richard Biener via Gcc-patches
On Tue, Nov 2, 2021 at 2:36 PM Aldy Hernandez wrote: > > On Tue, Nov 2, 2021 at 2:27 PM Richard Biener > wrote: > > > > On Mon, Nov 1, 2021 at 2:03 PM Jeff Law via Gcc-patches > > wrote: > > > > > > > > > > > > On 11/1/2021 3:54 AM, Aldy Hernandez wrote: > > > > Chasing down stage3 miscomparison

[PATCH] Record that -gtoggle is already used in gcc_options.

2021-11-02 Thread Martin Liška
Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin When doing flip based on -gtoggle, record it. Otherwise, we will apply it for the second time in finish_options. PR debug/102955 gcc/ChangeLog: * common.opt: Add new gt

[PATCH]middle-end Add an RPO pass after successful vectorization

2021-11-02 Thread Tamar Christina via Gcc-patches
Hi All, Following my current SVE predicate optimization series a problem has presented itself in that the way vector masks are generated for masked operations relies on CSE to share masks efficiently. The issue however is that masking is done using the & operand and & is associative and so reasso

RE: [PATCH 2/5]AArch64 sve: combine nested if predicates

2021-11-02 Thread Tamar Christina via Gcc-patches
Hi All, Here’s a respin of the patch. The following example void f5(float * restrict z0, float * restrict z1, float *restrict x, float * restrict y, float c, int n) { for (int i = 0; i < n; i++) { float a = x[i]; float b = y[i]; if (a > b) { z0[i]

Re: Add EAF_NOT_RETURNED_DIRECTLY

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, 1 Nov 2021, Jan Hubicka wrote: > Hi, > this patch adds EAF_NOT_RETURNED_DIRECTLY which works similarly as > EAF_NODIRECTESCAPE. Values pointed to by a given argument may be returned but > not the argument itself. This helps PTA quite noticeably because we mostly > care about tracking poi

Re: redundant bitmap_bit_p followed by bitmap_clear_bit [was: Re: [COMMITTED] Kill second order relations in the path solver.]

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, Nov 1, 2021 at 10:02 PM Bernhard Reutner-Fischer via Gcc-patches wrote: > > On Mon, 1 Nov 2021 15:21:03 +0100 > Aldy Hernandez wrote: > > > I'm not convinced this makes the code clearer to read, especially if > > it's not on a critical path. But if you feel strongly, please submit > > a

Re: [PATCH] Add debug counters to back threader.

2021-11-02 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 2, 2021 at 2:27 PM Richard Biener wrote: > > On Mon, Nov 1, 2021 at 2:03 PM Jeff Law via Gcc-patches > wrote: > > > > > > > > On 11/1/2021 3:54 AM, Aldy Hernandez wrote: > > > Chasing down stage3 miscomparisons is never fun, and having no way to > > > distinguish between jump threads

Re: [PATCH]middle-end testsuite: fix failing complex add testcases PR103000

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, 1 Nov 2021, Tamar Christina wrote: > Hi All, > > Some targets have overriden the default unroll factor and so do not have > enough > data to succeed for SLP vectorization if loop vect is turned off. > > To fix this just always unroll in these testcases. Another option is to place #pra

Re: [PATCH] gcc: implement AIX-style constructors

2021-11-02 Thread CHIGOT, CLEMENT via Gcc-patches
Hi David, Here is the new version of the patch. I've moved the startup function in crtcdtors files. I'm just wondering if the part dealing with the __init_aix_libgcc_cxa_atexit is needed. I'm adding it because the destructor created in crtcxa.o is following GCC format and thus won't be launched i

Re: [PATCH] Add debug counters to back threader.

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, Nov 1, 2021 at 2:03 PM Jeff Law via Gcc-patches wrote: > > > > On 11/1/2021 3:54 AM, Aldy Hernandez wrote: > > Chasing down stage3 miscomparisons is never fun, and having no way to > > distinguish between jump threads registered by a particular > > pass, is even harder. This patch adds de

Re: [PATCH] PR fortran/91497 -- Silence conversion warnings for MIN1 and MAX1

2021-11-02 Thread Thomas Koenig via Gcc-patches
Hi Manfred, In addition to the patches of Steve Kargl for PR 91497: The MIN1 and MAX1 intrinsics do explicit type conversions and should be silenced too for -Wconversion and -Wconversion-extra. Adjust testcase to only use *4 and *8 real types, provide a second testcase for *10 and *16 precision

Re: [PATCH]middle-end Fix PR103007, add missing check on complex fms detection.

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, 1 Nov 2021, Tamar Christina wrote: > Hi All, > > The complex FMS detection is missing a check on if the nodes of the VEC_PERM > has the amount of children we expect before it recurses. > > This check is there on MUL and FMA but was missing for FMS, due to this the > compiler goes on furt

Re: Add static_chain support to ipa-modref

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, 1 Nov 2021, Jan Hubicka wrote: > Hi, > this is patchs teaches ipa-modref about the static chain that is, like > retslot, a hiden argument. The patch is pretty much symemtric to what > was done for retslot handling and I verified it does the intended job > for Ada LTO bootstrap. > > Boots

Re: [PATCH] Check number of iterations for test cases pr101145

2021-11-02 Thread Richard Biener via Gcc-patches
On Mon, 1 Nov 2021, Jiufu Guo wrote: > PR101145 is supporting if the number of iterations can be calculated > for the 'until wrap' condition. Current test cases are checking if > the loop can be vectorized, if a loop can be vectorized then the number > of interations is known. While it would be

[PATCH] middle-end/103038 - avoid ICE with -ftrivial-auto-var-init=pattern

2021-11-02 Thread Richard Biener via Gcc-patches
This avoids ICEing with expanding a VIEW_CONVERT_EXRP of a SSA name on the LHS by making sure we can native-interpret OFFSET_TYPE and by never building such a LHS but instead view-converting the RHS for SSA LHS. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-11-02 Richard Bien

Re: [PATCH, rs6000] Disable gimple fold for float or double vec_minmax when fast-math is not set

2021-11-02 Thread David Edelsohn via Gcc-patches
On Mon, Nov 1, 2021 at 10:40 PM HAO CHEN GUI wrote: > > David, > > My patch file was broken. I am sorry for it. Here is the correct one. > Thanks a lot. > > ChangeLog > > 2021-11-01 Haochen Gui > > gcc/ > * config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin): Disable >

Building GNU Arm Embedded Toolchain for macOS/arm64

2021-11-02 Thread Romain Goyet via Gcc-patches
Hello, Arm distribute pre-built versions of GCC that targets bare-metal Cortex-M devices at https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm They offer a source release as well as pre-built binaries for Linux, macOS and Windows. The macOS ver

Re: [PATCH] Add -fopt-builtin optimization option

2021-11-02 Thread Richard Biener via Gcc-patches
On Sun, Oct 31, 2021 at 11:13 AM Keith Packard via Gcc-patches wrote: > > This option (enabled by default) controls optimizations which convert > a sequence of operations into an equivalent sequence that includes > calls to builtin functions. Typical cases here are code which matches > memcpy, cal

Re: [PATCH] [RFC][PR102768] aarch64: Add compiler support for Shadow Call Stack

2021-11-02 Thread Szabolcs Nagy via Gcc-patches
The 11/02/2021 00:06, Dan Li via Gcc-patches wrote: > Shadow Call Stack can be used to protect the return address of a > function at runtime, and clang already supports this feature[1]. > > To enable SCS in user mode, in addition to compiler, other support > is also required (as described in [2]).

[PATCH] PR fortran/91497 -- Silence conversion warnings for MIN1 and MAX1

2021-11-02 Thread Manfred Schwarb via Gcc-patches
Hi, In addition to the patches of Steve Kargl for PR 91497: The MIN1 and MAX1 intrinsics do explicit type conversions and should be silenced too for -Wconversion and -Wconversion-extra. Adjust testcase to only use *4 and *8 real types, provide a second testcase for *10 and *16 precisions. Regtes

Re: [PATCH 4/6 V2] aarch64: Add machine modes for Neon vector-tuple types

2021-11-02 Thread Richard Sandiford via Gcc-patches
Jonathan Wright writes: > Each of the comments on the previous version of the patch have been > addressed. Thanks. I realise I was wrong with the vcombine thing: it's only vec_concat for LE, not for BE. Sorry for the screw-up. The patch is OK with that part reverted to your original version.

Re: [PATCH] libsanitizer: Disable libbacktrace on sanitizer_platform_limits_freebsd.cpp

2021-11-02 Thread H.J. Lu via Gcc-patches
On Tue, Nov 2, 2021 at 5:11 AM Jakub Jelinek wrote: > > On Tue, Nov 02, 2021 at 05:02:12AM -0700, H.J. Lu wrote: > > > On Sat, Oct 30, 2021 at 10:54 PM H.J. Lu via Gcc-patches > > > wrote: > > > > > > > > sanitizer_platform_limits_freebsd.cpp must include from the OS, > > > > not include/md5.h i

Re: [PATCH] libsanitizer: Disable libbacktrace on sanitizer_platform_limits_freebsd.cpp

2021-11-02 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 02, 2021 at 05:02:12AM -0700, H.J. Lu wrote: > > On Sat, Oct 30, 2021 at 10:54 PM H.J. Lu via Gcc-patches > > wrote: > > > > > > sanitizer_platform_limits_freebsd.cpp must include from the OS, > > > not include/md5.h in GCC source tree which is included by libbacktrace > > > support.

  1   2   >