Re: [PATCH] Refine ranges using relations in GORI.

2022-09-30 Thread Bernhard Reutner-Fischer via Gcc-patches
Hi Andrew! On Thu, 29 Sep 2022 18:36:53 -0400 Andrew MacLeod via Gcc-patches wrote: > diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc > index 57a7e820749..b37d03cddda 100644 > --- a/gcc/gimple-range-gori.cc > +++ b/gcc/gimple-range-gori.cc > @@ -934,6 +934,115 @@ gori_compute::c

[committed][PATCH] Improve Z flag handling on H8

2022-09-30 Thread Jeff Law via Gcc-patches
This patch improves handling of the Z bit in the status register in a variety of ways to improve either the code size or code speed on various H8 subtargets. For example, we can test the zero/nonzero status of the upper byte of a 16 bit register using mov.b, we can move the Z or an inverted Z

[pushed] c++: loop through array CONSTRUCTOR

2022-09-30 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- I noticed that we were ignoring all the special rules for when to use a simple INIT_EXPR for array initialization from a CONSTRUCTOR, because split_nonconstant_init_1 was also passing 1 to the from_array parameter. Arguably that's the real b

[pushed] c++: cast split_nonconstant_init return val to void

2022-09-30 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- We were already converting the result of expand_vec_init_expr to void; we need to do the same for split_nonconstant_init. The test that I noticed this with no longer fails without it. gcc/cp/ChangeLog: * cp-gimplify.cc (cp_generic

Re: [PATCH] Fix the build of record_edge_info()

2022-09-30 Thread Palmer Dabbelt
On Fri, 30 Sep 2022 18:01:00 PDT (-0700), jeffreya...@gmail.com wrote: On 9/30/22 18:57, Palmer Dabbelt wrote: As of 1214196da79 ("More gimple const/copy propagation opportunities"), I'm getting some build failures during bootstrap ../../gcc/tree-ssa-dom.cc: In function ‘void record_edge

Re: [PATCH] Fix the build of record_edge_info()

2022-09-30 Thread Jeff Law via Gcc-patches
On 9/30/22 18:57, Palmer Dabbelt wrote: As of 1214196da79 ("More gimple const/copy propagation opportunities"), I'm getting some build failures during bootstrap ../../gcc/tree-ssa-dom.cc: In function ‘void record_edge_info(basic_block)’: ../../gcc/tree-ssa-dom.cc:689:27: error: ‘dst

[PATCH] Fix the build of record_edge_info()

2022-09-30 Thread Palmer Dabbelt
As of 1214196da79 ("More gimple const/copy propagation opportunities"), I'm getting some build failures during bootstrap ../../gcc/tree-ssa-dom.cc: In function ‘void record_edge_info(basic_block)’: ../../gcc/tree-ssa-dom.cc:689:27: error: ‘dst’ was not declared in this scope; did you mean

Re: [committed] Minor cleanup/prep in DOM

2022-09-30 Thread Jeff Law
On 9/30/22 18:07, H.J. Lu wrote: On Fri, Sep 30, 2022 at 4:06 PM Jeff Law wrote: It's a bit weird that free_dom_edge_info leaves a dangling pointer in e->aux. Not sure what I was thinking. There's two callers. One wipes e->aux immediately after the call, the other attaches a newly created

Re: [committed] Minor cleanup/prep in DOM

2022-09-30 Thread H.J. Lu via Gcc-patches
On Fri, Sep 30, 2022 at 4:06 PM Jeff Law wrote: > > > It's a bit weird that free_dom_edge_info leaves a dangling pointer in > e->aux. Not sure what I was thinking. > > > There's two callers. One wipes e->aux immediately after the call, the > other attaches a newly created object immediately afte

[committed] More gimple const/copy propagation opportunities

2022-09-30 Thread Jeff Law
While investigating a benchmark for optimization opportunities I came across single block loop which either iterates precisely once or forever.    This is an interesting scenario as we can ignore the infinite looping path and treat any PHI nodes as degenerates. So more concretely let's consider

[committed] Minor cleanup/prep in DOM

2022-09-30 Thread Jeff Law
It's a bit weird that free_dom_edge_info leaves a dangling pointer in e->aux.  Not sure what I was thinking. There's two callers.  One wipes e->aux immediately after the call, the other attaches a newly created object immediately after the call.  So we can wipe e->aux within the call and si

Re: [PATCH] Document -fexcess-precision=16 in tm.texi

2022-09-30 Thread Palmer Dabbelt
On Fri, 30 Sep 2022 15:51:02 PDT (-0700), H.J. Lu wrote: On Fri, Sep 30, 2022 at 3:25 PM Palmer Dabbelt wrote: On Sat, 24 Sep 2022 19:13:36 PDT (-0700), san...@codesourcery.com wrote: > On 9/18/22 02:47, Palmer Dabbelt wrote: >> On Fri, 09 Sep 2022 02:46:40 PDT (-0700), Palmer Dabbelt wrote: >

Re: [PATCH] Document -fexcess-precision=16 in tm.texi

2022-09-30 Thread H.J. Lu via Gcc-patches
On Fri, Sep 30, 2022 at 3:25 PM Palmer Dabbelt wrote: > > On Sat, 24 Sep 2022 19:13:36 PDT (-0700), san...@codesourcery.com wrote: > > On 9/18/22 02:47, Palmer Dabbelt wrote: > >> On Fri, 09 Sep 2022 02:46:40 PDT (-0700), Palmer Dabbelt wrote: > >>> I just happened to stuble on this one while tryi

Re: [PATCH RFC] c++: fix broken conversion in coroutines

2022-09-30 Thread Iain Sandoe
Hi Jason, > On 30 Sep 2022, at 23:06, Jason Merrill wrote: > > You can't use CONVERT_EXPR to convert between two class types, and it was > breaking copy elision. > > Unfortunately, this patch breaks symmetric-transfer-00-basic.C, where > susp_type is Loopy::handle_type. How is this supposed to

Re: [PATCH] Document -fexcess-precision=16 in tm.texi

2022-09-30 Thread Palmer Dabbelt
On Sat, 24 Sep 2022 19:13:36 PDT (-0700), san...@codesourcery.com wrote: On 9/18/22 02:47, Palmer Dabbelt wrote: On Fri, 09 Sep 2022 02:46:40 PDT (-0700), Palmer Dabbelt wrote: I just happened to stuble on this one while trying to sort out the RISC-V bits. gcc/ChangeLog * doc/tm.texi (TAR

Re: [PATCH] RISC-V: Support -fexcess-precision=16

2022-09-30 Thread Palmer Dabbelt
On Fri, 09 Sep 2022 02:56:26 PDT (-0700), Kito Cheng wrote: LGTM, seems like you have landed now, see you soon :) Committed. On Fri, Sep 9, 2022 at 5:44 PM Palmer Dabbelt wrote: This fixes f19a327077e ("Support -fexcess-precision=16 which will enable FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 whe

[PATCH RFC] c++: fix broken conversion in coroutines

2022-09-30 Thread Jason Merrill via Gcc-patches
You can't use CONVERT_EXPR to convert between two class types, and it was breaking copy elision. Unfortunately, this patch breaks symmetric-transfer-00-basic.C, where susp_type is Loopy::handle_type. How is this supposed to work? gcc/cp/ChangeLog: * coroutines.cc (expand_one_await_expre

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:13, Jonathan Wakely via Libstdc++ wrote: > > On Fri, 30 Sept 2022 at 19:07, Jonathan Wakely wrote: > > > > On Fri, 30 Sept 2022 at 19:04, Jonathan Wakely wrote: > > > > > > On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > > > > > > > On Fri, Sep 30, 2022 at 06:

[committed] libstdc++: Remove dependency from std::bitset::to_ulong() test

2022-09-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- There's no need to use a stringstream to test the to_ulong() member. This will allow the test to be used in freestanding mode. libstdc++-v3/ChangeLog: * testsuite/20_util/bitset/access/to_ulong.cc: Construct bitset from binary liter

[committed] libstdc++: Remove non-standard public members in std::bitset

2022-09-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This makes _M_copy_from_ptr, _M_copy_from_string and _M_copy_to_string private, and declares operator<< and operator>> as friends. Also remove the historical _M_copy_from_string and _M_copy_to_string overloads. Those were used before DR 396 was impl

[committed] libstdc++: Optimize operator>> for std::bitset

2022-09-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- We can improve performance by using a char buffer instead of basic_string. The loop bound already means we can't overflow the buffer, and we don't need to keep writing a null character after every character written to the buffer. We could just use b

Re: [PATCH] c++, c: Implement C++23 P1774R8 - Portable assumptions [PR106654]

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/22/22 05:55, Jakub Jelinek wrote: Hi! The following patch implements C++23 P1774R8 - Portable assumptions paper, by introducing support for [[assume (cond)]]; attribute for C++. In addition to that the patch adds [[gnu::assume (cond)]]; and __attribute__((assume (cond))); support to both C

Re: [PATCH RFC] c++: streamline process for adding new builtin trait

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/22 11:14, Patrick Palka wrote: On Thu, 29 Sep 2022, Jason Merrill wrote: On 9/29/22 11:05, Patrick Palka wrote: Adding a new builtin trait currently involves some boilerplate (as can be seen in r13-2956-g9ca147154074a0) of defining corresponding RID_ and CPTK_ enumerators and adding th

Re: [PATCH] c++: make some cp_trait_kind switch statements exhaustive

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/22 13:37, Patrick Palka wrote: On Fri, 30 Sep 2022, Patrick Palka wrote: This replaces the unreachable default case in some cp_trait_kind switches with an exhaustive listing of the _unexpected_ trait codes, so that when adding a new trait we'll get a -Wswitch diagnostic if we forget to

Re: [PATCH] arm, aarch64, csky: Fix C++ ICEs with _Float16 and __fp16 [PR107080]

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/30/22 13:13, Jakub Jelinek wrote: On Fri, Sep 30, 2022 at 09:54:49AM -0400, Jason Merrill wrote: Note, there is one further problem on aarch64/arm, types with HFmode (_Float16 and __fp16) are there mangled as Dh (which is standard Itanium mangling: ::= Dh # IEEE 754r half

Re: [PATCH] x86: Check corrupted return address when unwinding stack

2022-09-30 Thread Jeff Law via Gcc-patches
On 9/21/22 14:42, H.J. Lu via Gcc-patches wrote: If shadow stack is enabled, when unwinding stack, we count how many stack frames we pop to reach the landing pad and adjust shadow stack by the same amount. When counting the stack frame, we compare the return address on normal stack against the

Re: [RFC PATCH] c++, i386, arm, aarch64, libgcc: std::bfloat16_t and __bf16 arithmetic support

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:38, Jakub Jelinek wrote: > > On Fri, Sep 30, 2022 at 06:21:04PM +, Joseph Myers wrote: > > On Fri, 30 Sep 2022, Jakub Jelinek via Gcc-patches wrote: > > > > > What isn't in the patch but I think we'll need to also change are some > > > minimal set of __builtin_*bf16

Re: [RFC PATCH] c++, i386, arm, aarch64, libgcc: std::bfloat16_t and __bf16 arithmetic support

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 06:21:04PM +, Joseph Myers wrote: > On Fri, 30 Sep 2022, Jakub Jelinek via Gcc-patches wrote: > > > What isn't in the patch but I think we'll need to also change are some > > minimal set of __builtin_*bf16 builtins. Seems for _Float16, GCC provides > > all the __builti

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Andreas Schwab
On Sep 30 2022, Jonathan Wakely via Gcc-patches wrote: > That fixes the error, but now the regex doesn't match so there are > still excess errors. It needs to be: > > // { dg-prune-output ".*\[/\\](functional|bits\[/\\]invoke.h):.*" } In Tcl "." matches newlines, thus this will prune too much. -

Re: [RFC PATCH] c++, i386, arm, aarch64, libgcc: std::bfloat16_t and __bf16 arithmetic support

2022-09-30 Thread Joseph Myers
On Fri, 30 Sep 2022, Jakub Jelinek via Gcc-patches wrote: > What isn't in the patch but I think we'll need to also change are some > minimal set of __builtin_*bf16 builtins. Seems for _Float16, GCC provides > all the __builtin_*f16 (and for C/ObjC even with *f16 names), but there is > no glibc su

Re: [PATCH 00/10] c-family,libstdc++: P1642 and related changes

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 17:46, Arsen Arsenović via Libstdc++ wrote: > > Hi, > > This patchset: > - Implements the P1642 WG21 paper, with a fair few extensions, > - Fixes libstdc++' build system on systems --without-headers, > - Ports (a large chunk of) the libstdc++ testsuite to freestanding, and

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:07, Jonathan Wakely wrote: > > On Fri, 30 Sept 2022 at 19:04, Jonathan Wakely wrote: > > > > On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > > > > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches > > > wrote: > > > > On Fri, 30 Sept

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:04, Jonathan Wakely wrote: > > On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches > > wrote: > > > On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > > > > > > > On Fri, 30 Sept 2

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches > wrote: > > On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > > > > > On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON > > > wrote: > > > > > > > > libstdc++

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches wrote: > On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > > > On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON > > wrote: > > > > > > libstdc++-v3/testsuite: > > > > > > * 20_util/bind/ref_neg.cc: Prune Wind

Re: [PATCH] arm, aarch64, csky: Fix C++ ICEs with _Float16 and __fp16 [PR107080]

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 06:38:39PM +0100, Richard Sandiford wrote: > OK for the aarch64 part, thanks. But could you add some scan-assemblers > to the test to check for the mangled names? I assume they should be: Ok, about to commit the aarch64 part, will await review of the rest afterwards. > >

Re: [PATCH] Adjust the symbol for SECTION_LINK_ORDER linked_to section [PR99889]

2022-09-30 Thread Segher Boessenkool
On Fri, Sep 30, 2022 at 08:47:53PM +0800, Kewen.Lin wrote: > on 2022/9/30 04:31, Segher Boessenkool wrote: > > Please don't define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY at all, > > instead, and remove this whole function? > > This hook is still needed for "ELFv2 support rework" which > was jus

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON > wrote: > > > > libstdc++-v3/testsuite: > > > > * 20_util/bind/ref_neg.cc: Prune Windows paths too. > > Please CC the libstdc++ for libstdc++ patches. > > OK for trunk, thanks. I'm

Re: [GCC13][Patch][V4][PATCH 1/2] Add a new option -fstrict-flex-arrays[=n] and new attribute strict_flex_arrays

2022-09-30 Thread Martin Sebor via Gcc-patches
On 9/28/22 13:17, Qing Zhao wrote: Hi, Martin, Thanks for the comments. And sorry for my late reply till now (I just came back home from LPC, GNU Cauldron and then a one-week vacation after that…) On Sep 12, 2022, at 12:42 PM, Martin Sebor wrote: On 9/6/22 18:28, Qing Zhao wrote: Add the f

Re: [PATCH] arm, aarch64, csky: Fix C++ ICEs with _Float16 and __fp16 [PR107080]

2022-09-30 Thread Richard Sandiford via Gcc-patches
Jakub Jelinek writes: > On Fri, Sep 30, 2022 at 09:54:49AM -0400, Jason Merrill wrote: >> > Note, there is one further problem on aarch64/arm, types with HFmode >> > (_Float16 and __fp16) are there mangled as Dh (which is standard >> > Itanium mangling: >> > ::= Dh # IEEE 754r ha

Re: [PATCH] c++: make some cp_trait_kind switch statements exhaustive

2022-09-30 Thread Patrick Palka via Gcc-patches
On Fri, 30 Sep 2022, Patrick Palka wrote: > This replaces the unreachable default case in some cp_trait_kind > switches with an exhaustive listing of the _unexpected_ trait codes, > so that when adding a new trait we'll get a -Wswitch diagnostic if we > forget to handle the trait code in one of

[PATCH] c++: make some cp_trait_kind switch statements exhaustive

2022-09-30 Thread Patrick Palka via Gcc-patches
This replaces the unreachable default case in some cp_trait_kind switches with an exhaustive listing of the _unexpected_ trait codes, so that when adding a new trait we'll get a -Wswitch diagnostic if we forget to handle the trait code in one of these switches. Bootstrappend and regtested on x86_6

[PATCH] arm, aarch64, csky: Fix C++ ICEs with _Float16 and __fp16 [PR107080]

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 09:54:49AM -0400, Jason Merrill wrote: > > Note, there is one further problem on aarch64/arm, types with HFmode > > (_Float16 and __fp16) are there mangled as Dh (which is standard > > Itanium mangling: > > ::= Dh # IEEE 754r half-precision floating point (

[PATCH 07/10] libstdc++: Make some tests work on freestanding [PR103626]

2022-09-30 Thread Arsen Arsenović via Gcc-patches
PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding Co-authored-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/103626 * testsuite/17_intro/headers/c++1998/stdc++.cc [!__STDC_HOSTED__]: Do not include C headers that aren't valid for freestanding.

[PATCH 09/10] libstdc++: Re-enable std::hash in freestanding [PR103626]

2022-09-30 Thread Arsen Arsenović via Gcc-patches
PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding libstdc++-v3/ChangeLog: PR libstdc++/103626 * include/std/bitset [!_GLIBCXX_HOSTED]: Re-enable std::hash. * testsuite/20_util/bitset/cons/constexpr_c++23.cc: Require ET hosted. * testsuite/2

[PATCH 04/10] libstdc++: Mark headers that must be hosted as such [PR103626]

2022-09-30 Thread Arsen Arsenović via Gcc-patches
PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding Co-authored-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/103626 * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/bits/requires_hosted.h: New header.

[PATCH 08/10] libstdc++: Add effective-target 'hosted' for testsuite [PR103626]

2022-09-30 Thread Arsen Arsenović via Gcc-patches
From: Jonathan Wakely PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding libstdc++-v3/ChangeLog: PR libstdc++/103626 * testsuite/lib/libstdc++.exp (check_effective_target_stacktrace): Also require hosted. (check_effective_target_hosted): New proc.

[PATCH 06/10] libstdc++: Rework how freestanding install works [PR106953]

2022-09-30 Thread Arsen Arsenović via Gcc-patches
In light of there being far more freestanding headers now, ad-hoc maintenance of a subset of the install implementation has become unsustainable. Instead, we gate off a part of the normal install routine so that it works without HOSTED enabled, as well as subdivide lists of headers into freestandin

[PATCH 03/10] libstdc++: Adjust precompiled headers for freestanding

2022-09-30 Thread Arsen Arsenović via Gcc-patches
From: Jonathan Wakely Co-authored-by: Arsen Arsenović libstdc++-v3/ChangeLog: * include/precompiled/extc++.h [!_GLIBCXX_HOSTED]: Do not include headers that aren't valid for freestanding. * include/precompiled/stdc++.h [!_GLIBCXX_HOSTED]: Likewise. Signed-off-by: Arsen

[PATCH 02/10] libstdc++: Filter out unconditional default include

2022-09-30 Thread Arsen Arsenović via Gcc-patches
_AC_INCLUDES_DEFAULT_REQUIREMENTS including when checking for stdint.h has prevented proper detection of whether stdint.h is present, since it'd poison the cache variables with test results failing due to failing to include. As a solution, for autoconf versions under 2.70, we filter out that bit

[PATCH 05/10] c-family: Implement new `int main' semantics in freestanding

2022-09-30 Thread Arsen Arsenović via Gcc-patches
>From now, by default, (specifically) `int main' in freestanding will implicitly return 0, as it does for hosted modes. The old behaviour is still accessible via -fno-builtin-main. gcc/c-family/ChangeLog: * c-common.cc (disable_builtin_function): Support special value `main' that,

[PATCH 00/10] c-family,libstdc++: P1642 and related changes

2022-09-30 Thread Arsen Arsenović via Gcc-patches
Hi, This patchset: - Implements the P1642 WG21 paper, with a fair few extensions, - Fixes libstdc++' build system on systems --without-headers, - Ports (a large chunk of) the libstdc++ testsuite to freestanding, and - Changes the semantics of `int main' in freestanding (!!). Thanks, Arsen Arseno

[PATCH 01/10] libstdc++: Make _GLIBCXX_HOSTED respect -ffreestanding [PR103626]

2022-09-30 Thread Arsen Arsenović via Gcc-patches
From: Jonathan Wakely This allows the library to switch to freestanding mode when compiling with the -ffreestanding flag. This means you don't need a separate libstdc++ build configured with --disable-hosted-libstdcxx in order to compile for a freestanding environment. The testsuite support file

[PATCH] openmp: Add begin declare target support

2022-09-30 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch adds support for the begin declare target construct, which is another spelling for declare target construct without clauses (where it needs paired end declare target), but unlike that one accepts clauses. This is an OpenMP 5.1 feature, implemented with 5.2 clarification be

[PATCH] undef offsetof before defining it in stddef.h

2022-09-30 Thread Olivier Hainque via Gcc-patches
Hello, The attached patch is a proposal to #undef offsetof before the #define we do in ginclude/stddef.h, which prevents redefinition warnings from dg tests passing -Wsystem-headers on systems which provide a definition in system headers, such as VxWorks. We have been using this for a while with

Re: C++ ABI

2022-09-30 Thread Patrick Palka via Gcc-patches
On Fri, 30 Sep 2022, Nathan Sidwell wrote: > Hi, > I've discovered some mangling problems with lambdas. (a) divergence from > clang and (b) manglings that incorrectly demangle. With #a I'm not yet sure > who is correct. for #b g++ is definitely wrong. > > From the docs, it doesn't appear to ha

Re: [PATCH v3] testsuite: Only run test on target if VMA == LMA

2022-09-30 Thread Richard Sandiford via Gcc-patches
Torbjörn SVENSSON writes: > Checking that the triplet matches arm*-*-eabi (or msp430-*-*) is not > enough to know if the execution will enter an endless loop, or if it > will give a meaningful result. As the execution test only work when > VMA and LMA are equal, make sure that this condition is me

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON wrote: > > libstdc++-v3/testsuite: > > * 20_util/bind/ref_neg.cc: Prune Windows paths too. Please CC the libstdc++ for libstdc++ patches. OK for trunk, thanks. > > Co-Authored-By: Yvan ROUX > Signed-off-by: Torbjörn SVENSSON > --- >

[PATCH v3] testsuite: Only run test on target if VMA == LMA

2022-09-30 Thread Torbjörn SVENSSON via Gcc-patches
Checking that the triplet matches arm*-*-eabi (or msp430-*-*) is not enough to know if the execution will enter an endless loop, or if it will give a meaningful result. As the execution test only work when VMA and LMA are equal, make sure that this condition is met. gcc/ChangeLog: * doc/s

Re: PING^1 [PATCH] testsuite: Do not prefix linker script with "-Wl, "

2022-09-30 Thread Richard Sandiford via Gcc-patches
Torbjorn SVENSSON writes: > Hi, > > Ping: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601831.html OK, thanks. Richard > Kind regards, > Torbjörn > > On 2022-09-19 18:57, Torbjörn SVENSSON wrote: >> The linker script should not be prefixed with "-Wl," - it's not an >> input file and

[PATCH] Introduce DWARF_VERSION_DEFAULT (and redefine for VxWorks)

2022-09-30 Thread Olivier Hainque via Gcc-patches
Hello, This change is a proposal to introduce a target overridable macro to replace the hardcoded value used in common.opt to initialize dwarf_version. The main advantage compared to special code in a target override_options hook is that redefinitions by target config files are visible by both th

Re: [PATCH v2] testsuite: Only run test on target if VMA == LMA

2022-09-30 Thread Richard Sandiford via Gcc-patches
Sorry for the slow reply. Torbjorn SVENSSON writes: > Hi Richard, > > Thanks for your review. > Comments below. > > On 2022-09-23 19:34, Richard Sandiford wrote: >> Torbjörn SVENSSON via Gcc-patches writes: >>> Checking that the triplet matches arm*-*-eabi (or msp430-*-*) is not >>> enough to kn

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-30 Thread Richard Sandiford via Gcc-patches
Richard Sandiford via Gcc-patches writes: > Prathamesh Kulkarni writes: >> Sorry to ask a silly question but in which case shall we select 2nd vector ? >> For num_poly_int_coeffs == 2, >> a1 /trunc n1 == (a1 + 0x) / (n1.coeffs[0] + n1.coeffs[1]*x) >> If a1/trunc n1 succeeds, >> 0 / n1.coeffs[1] =

[patch] Prevent secondary warning from diagnostic tweak in gthr-vxworks.h

2022-09-30 Thread Olivier Hainque via Gcc-patches
Within gthr-vxworks.h, we prevent C++ errors from missing declarations in some system headers by prepending their inclusion with a #pragma GCC diagnostic ignored "-Wstrict-prototypes" But Wstrict-prototypes is internally registered as valid for C/ObjC only, not C++, and this trick in turn tr

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-30 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Tue, 27 Sept 2022 at 01:59, Richard Sandiford > wrote: >> >> Prathamesh Kulkarni writes: >> > On Fri, 23 Sept 2022 at 21:33, Richard Sandiford >> > wrote: >> >> >> >> Prathamesh Kulkarni writes: >> >> > On Tue, 20 Sept 2022 at 18:09, Richard Sandiford >> >> >

Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080]

2022-09-30 Thread Segher Boessenkool
On Fri, Sep 30, 2022 at 05:31:26PM +0200, Jakub Jelinek wrote: > On Fri, Sep 30, 2022 at 10:07:59AM -0500, Segher Boessenkool wrote: > > On Thu, Sep 29, 2022 at 12:01:43PM +0200, Jakub Jelinek via Gcc-patches > > wrote: > > > --- gcc/config/i386/i386.cc.jj2022-09-29 09:13:25.713718513 +0200 >

[PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Torbjörn SVENSSON via Gcc-patches
libstdc++-v3/testsuite: * 20_util/bind/ref_neg.cc: Prune Windows paths too. Co-Authored-By: Yvan ROUX Signed-off-by: Torbjörn SVENSSON --- libstdc++-v3/testsuite/20_util/bind/ref_neg.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/20_util

Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080]

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 10:07:59AM -0500, Segher Boessenkool wrote: > Hi! > > On Thu, Sep 29, 2022 at 12:01:43PM +0200, Jakub Jelinek via Gcc-patches wrote: > > --- gcc/config/i386/i386.cc.jj 2022-09-29 09:13:25.713718513 +0200 > > +++ gcc/config/i386/i386.cc 2022-09-29 11:29:20.828358152 +02

Re: [PATCH] arm: unified syntax for libgcc clear_cache

2022-09-30 Thread Seija Kijin via Gcc-patches
Yes, please! On Tue, Sep 6, 2022 at 10:48 AM Kyrylo Tkachov wrote: > > Hi Seija, > > > -Original Message- > > From: Gcc-patches > bounces+kyrylo.tkachov=arm@gcc.gnu.org> On Behalf Of Seija Kijin via > > Gcc-patches > > Sent: Thursday, August 11, 2022 2:36 PM > > To: gcc-patches@gcc.g

Re: [V2 PATCH] RISC-V:Add '-m[no]-csr-check' option in gcc.

2022-09-30 Thread Kito Cheng via Gcc-patches
Committed, but I decided to take v1 and disable that by default to prevent breaking the existing code :) On Tue, Sep 13, 2022 at 5:37 PM jiawei wrote: > > From: Jiawei > > Add -m[no]-csr-check option in gcc part, when enable -mcsr-check option, > it will add csr-check in .option section and pass

Re: [PATCH RFC] c++: streamline process for adding new builtin trait

2022-09-30 Thread Patrick Palka via Gcc-patches
On Thu, 29 Sep 2022, Jason Merrill wrote: > On 9/29/22 11:05, Patrick Palka wrote: > > Adding a new builtin trait currently involves some boilerplate (as can > > be seen in r13-2956-g9ca147154074a0) of defining corresponding RID_ and > > CPTK_ enumerators and adding them to various switch statemen

Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080]

2022-09-30 Thread Segher Boessenkool
Hi! On Thu, Sep 29, 2022 at 12:01:43PM +0200, Jakub Jelinek via Gcc-patches wrote: > --- gcc/config/i386/i386.cc.jj2022-09-29 09:13:25.713718513 +0200 > +++ gcc/config/i386/i386.cc 2022-09-29 11:29:20.828358152 +0200 > @@ -22725,6 +22725,9 @@ ix86_mangle_type (const_tree type) >&

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Tobias Burnus
On 30.09.22 15:30, Julian Brown wrote: On Fri, 23 Sep 2022 14:10:51 +0200 Tobias Burnus wrote: ... I added n->expr->expr_type == EXPR_VARIABLE to the condition -- I think that should suffice for now? Yes. A similar mean way to write code would be: integer, ta

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Tobias Burnus
Hi Julian, On 30.09.22 15:30, Julian Brown wrote: i = 1; j = 2 map (foo(i)%dt_ptr(1:3), foo(j)%dt_ptr) Good catch! In that gfc_dep_resolver considers those terms to have a dependency, and that triggers the mapping node transformation. But I don't think OpenMP allows you to write this: IIUC

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-30 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 27 Sept 2022 at 01:59, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 23 Sept 2022 at 21:33, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 20 Sept 2022 at 18:09, Richard Sandiford > >> > wrote: > >> >> > >> >> Prathamesh Kulkarn

Re: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-09-30 Thread Richard Biener via Gcc-patches
> Am 30.09.2022 um 16:29 schrieb Richard Sandiford via Gcc-patches > : > > Tamar Christina writes: >>> -Original Message- >>> From: Richard Biener >>> Sent: Friday, September 30, 2022 12:53 PM >>> To: Tamar Christina >>> Cc: Richard Sandiford ; Tamar Christina via >>> Gcc-patches ;

Re: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-09-30 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> -Original Message- >> From: Richard Biener >> Sent: Friday, September 30, 2022 12:53 PM >> To: Tamar Christina >> Cc: Richard Sandiford ; Tamar Christina via >> Gcc-patches ; nd ; Jeff Law >> >> Subject: RE: [PATCH 1/2]middle-end: RFC: On expansion of conditio

Re: [RFC PATCH] c++, i386, arm, aarch64, libgcc: std::bfloat16_t and __bf16 arithmetic support

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 09:49:08AM -0400, Jason Merrill wrote: > The comment from Apple on the ABI mangling proposal suggests to me that we > might want to delay enabling C++ std::bfloat16_t (i.e. defining > __STDCPP_BFLOAT16_T__) until we have that excess precision support? I saw that comment. W

Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080]

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/29/22 06:01, Jakub Jelinek wrote: Hi! The following testcase ICEs on x86 as well as ppc64le (the latter with -mabi=ieeelongdouble), because _Float64x there isn't mangled as DF64x but e or u9__ieee128 instead. Those are the mangling that should be used for the non-standard types with the sam

Re: C++ ABI

2022-09-30 Thread Nathan Sidwell via Gcc-patches
On 9/30/22 09:43, Nathan Sidwell wrote: Hi, I've discovered some mangling problems with lambdas.  (a) divergence from clang and (b) manglings that incorrectly demangle.  With #a I'm not yet sure who is correct.  for #b g++ is definitely wrong. From the docs, it doesn't appear to have been bu

Re: [RFC PATCH] c++, i386, arm, aarch64, libgcc: std::bfloat16_t and __bf16 arithmetic support

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/29/22 11:55, Jakub Jelinek wrote: Hi! Here is more complete patch to add std::bfloat16_t support on x86, AArch64 and (only partially) on ARM 32-bit. No BFmode optabs are added by the patch, so for binops/unops it extends to SFmode first and then truncates back to BFmode. For {HF,SF,DF,XF,T

[committed] libstdc++: Add missing include to

2022-09-30 Thread Jonathan Wakely via Gcc-patches
From: Arsen Arsenović Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/bitset: Include . --- libstdc++-v3/include/std/bitset | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset inde

C++ ABI

2022-09-30 Thread Nathan Sidwell via Gcc-patches
Hi, I've discovered some mangling problems with lambdas. (a) divergence from clang and (b) manglings that incorrectly demangle. With #a I'm not yet sure who is correct. for #b g++ is definitely wrong. From the docs, it doesn't appear to have been bumped this cycle. Is that correct, and I

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Julian Brown
On Fri, 23 Sep 2022 14:10:51 +0200 Tobias Burnus wrote: > Hi Julian and Jakub, hi all, > > On 23.09.22 09:29, Julian Brown wrote: > > How about this version? (Re-tested.) > > Some more generic (pre)remarks – not affecting the patch code, > but possibly the commit log message: > > > This foll

Re: [PATCH] c-family: ICE with [[gnu::nocf_check]] [PR106937]

2022-09-30 Thread Jason Merrill via Gcc-patches
On 9/29/22 18:49, Marek Polacek wrote: When getting the name of an attribute, we ought to use get_attribute_name, which handles both [[ ]] and __attribute__(()) forms. Failure to do so may result in an ICE, like here. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? How do we prin

RE: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-09-30 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Friday, September 30, 2022 12:53 PM > To: Tamar Christina > Cc: Richard Sandiford ; Tamar Christina via > Gcc-patches ; nd ; Jeff Law > > Subject: RE: [PATCH 1/2]middle-end: RFC: On expansion of conditional > branches, give hint if argu

Re: [PATCH] Adjust the symbol for SECTION_LINK_ORDER linked_to section [PR99889]

2022-09-30 Thread Kewen.Lin via Gcc-patches
Hi Segher, on 2022/9/30 04:31, Segher Boessenkool wrote: > Hi! > > On Wed, Aug 24, 2022 at 04:17:07PM +0800, Kewen.Lin wrote: >> --- a/gcc/config/rs6000/rs6000.cc >> +++ b/gcc/config/rs6000/rs6000.cc >> @@ -14771,18 +14771,9 @@ rs6000_print_patchable_function_entry (FILE *file, >>

Re: [PATCH v4] rs6000: Rework ELFv2 support for -fpatchable-function-entry* [PR99888]

2022-09-30 Thread Kewen.Lin via Gcc-patches
Hi Segher, Thanks for the review comments! on 2022/9/28 23:22, Segher Boessenkool wrote: > Hi! > > On Thu, Aug 25, 2022 at 01:50:28PM +0800, Kewen.Lin wrote: >> --- a/gcc/config/rs6000/rs6000-internal.h >> +++ b/gcc/config/rs6000/rs6000-internal.h >> @@ -183,10 +183,15 @@ extern tree rs6000_fold

Re: [PATCH] Emit discriminators for inlined call sites.

2022-09-30 Thread Richard Biener via Gcc-patches
On Fri, Sep 30, 2022 at 8:28 AM Eugene Rozenfeld via Gcc-patches wrote: > > This change is based on commit 9fa26998a63d4b22b637ed8702520819e408a694 > by Dehao Chen in vendors/google/heads/gcc-4_8. OK > gcc/ChangeLog: > > * dwarf2out.cc (add_call_src_coords_attributes): Emit discriminator

Re: [PATCH] rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]

2022-09-30 Thread Kewen.Lin via Gcc-patches
Hi Segher! on 2022/9/28 22:55, Segher Boessenkool wrote: > Hi! > > On Wed, Aug 24, 2022 at 04:17:55PM +0800, Kewen.Lin wrote: >> As PR106516 shows, we can get unexpected gimple outputs for >> function thud on some target which supports modulus operation >> for vector int. This patch introduces o

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-30 Thread Kewen.Lin via Gcc-patches
on 2022/9/30 01:11, Segher Boessenkool wrote: > On Thu, Sep 29, 2022 at 01:45:16PM +0800, Kewen.Lin wrote: >> I found this flag is mainly related to tune setting and spotted that we have >> some code >> for tune setting when no explicit cpu is given. >> >> ... >> >> else >> { >> size_

RE: [PATCH v2] testsuite: [arm] Relax expected register names in MVE tests

2022-09-30 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Christophe Lyon > Sent: Friday, September 30, 2022 12:20 PM > To: gcc-patches@gcc.gnu.org > Cc: Kyrylo Tkachov ; Andre Simoes Dias Vieira > ; Christophe Lyon > > Subject: [PATCH v2] testsuite: [arm] Relax expected register names in MVE > tests > > These tw

RE: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-09-30 Thread Richard Biener via Gcc-patches
On Fri, 30 Sep 2022, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Friday, September 30, 2022 11:17 AM > > To: Tamar Christina > > Cc: Richard Sandiford ; Tamar Christina via > > Gcc-patches ; nd ; Jeff Law > > > > Subject: RE: [PATCH 1/2]middle-end: R

Re: [PATCH v2] testsuite: [arm] Relax expected register names in MVE tests

2022-09-30 Thread Richard Earnshaw via Gcc-patches
On 30/09/2022 12:19, Christophe Lyon via Gcc-patches wrote: These two tests have hardcoded q0 as destination/source of load/store instructions, but this register is actually used only under -mfloat-abi=hard. When using -mfloat-abi=softfp, other registers (eg. q3) can be used to transfer functi

Re: [Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Tobias Burnus
Hi Jakub, On 30.09.22 13:04, Jakub Jelinek via Fortran wrote: On Fri, Sep 30, 2022 at 12:41:19PM +0200, Tobias Burnus wrote: And 'device(omp_initial_device)' printed a warning in Fortran. (BTW: C/C++ silently accepts any negative value.) I think that is what the standard wants. E.g. in 5.2 d

[PATCH v2] testsuite: [arm] Relax expected register names in MVE tests

2022-09-30 Thread Christophe Lyon via Gcc-patches
These two tests have hardcoded q0 as destination/source of load/store instructions, but this register is actually used only under -mfloat-abi=hard. When using -mfloat-abi=softfp, other registers (eg. q3) can be used to transfer function arguments from core registers to MVE registers, making the exp

Re: [PATCH] testsuite: Colon is reserved on Windows

2022-09-30 Thread Nathan Sidwell via Gcc-patches
On 9/30/22 04:18, Torbjörn SVENSSON wrote: The ':' is reserved in filenames on Windows. Can't find any specification for this, but when there is no filename defined in the map file, GCC will replace the ':' with a '-' in the generated filename for the module. Correct (and the specification is i

RE: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-09-30 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Friday, September 30, 2022 11:17 AM > To: Tamar Christina > Cc: Richard Sandiford ; Tamar Christina via > Gcc-patches ; nd ; Jeff Law > > Subject: RE: [PATCH 1/2]middle-end: RFC: On expansion of conditional > branches, give hint if argu

Re: [Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 30, 2022 at 12:41:19PM +0200, Tobias Burnus wrote: > While has_device_addr has been implemented (in GCC 12), updating > use_device_ptr for Fortran was missed. > > This patch fixes it: Removing the restrictions and mapping to > has_device_addr where applicable. > > For use_device_ptr s

Re: [Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Tobias Burnus
On 30.09.22 12:41, Tobias Burnus wrote: Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318] The following two lines slipped in – which I have now removed in my version of the patch: --- a/gcc/testsuite/gfortran.dg/gomp/is_device_ptr-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/is_device_ptr

  1   2   >