[PATCH] tree-optimization/109154 - improve if-conversion for vectorization

2023-03-28 Thread Richard Biener via Gcc-patches
With multi-argument PHIs and now doing VN on the if-converted blocks the optimization of CSEing condition and negated condition doesn't work well anymore. The following restores this a little bit for the case of a single inverted condition into a COND_EXPR where we can instead swap the COND_EXPR a

Re: [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64

2023-03-28 Thread Jonathan Yong via Gcc-patches
On 2/27/23 10:29, Jonathan Yong wrote: Attached patch OK?     Excess errors on x86_64-w64-mingw32: /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:50:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=] /ho

[PATCH] RISC-V: Fix reload fail issue on vector mac instructions

2023-03-28 Thread juzhe . zhong
From: Juzhe-Zhong Co-authored-by: kito-cheng Co-authored-by: kito-cheng This path fix ICE of ternary intrinsic: bug.C:144:2: error: unable to find a register to spill 144 | } | ^ bug.C:144:2: error: this is the insn: (insn 462 972 919 24 (set (reg/v:VNx8DI 546 [orig:192 var_10 ] [192

[PATCH] RISC-V: Fix ICE && codegen error of scalar move in RV32 system.

2023-03-28 Thread juzhe . zhong
From: Juzhe-Zhong bug.C:144:2: error: unrecognizable insn: 144 | } | ^ (insn 684 683 685 26 (set (reg:SI 513) (and:SI (const_int 4 [0x4]) (const_int 1 [0x1]))) "bug.C":115:47 -1 (nil)) andi a4,a4,1 ===> sgtu a4,a4,zero vsetlvi tuvsetvli tu vlse

[PATCH v2 3/3] c++: Improve location information in constexpr evaluation

2023-03-28 Thread Nathaniel Shead via Gcc-patches
This patch caches the current expression's location information in the constexpr_global_ctx struct, which allows subexpressions that have lost location information to still provide accurate diagnostics. Also rewrites a number of 'error' calls as 'error_at' to provide more specific location informat

[PATCH v2 1/3] c++: Track lifetimes in constant evaluation [PR70331, PR96630, PR98675]

2023-03-28 Thread Nathaniel Shead via Gcc-patches
This adds rudimentary lifetime tracking in C++ constexpr contexts, allowing the compiler to report errors with using values after their backing has gone out of scope. We don't yet handle other ways of ending lifetimes (e.g. explicit destructor calls). PR c++/96630 PR c++/98675

[PATCH v2 0/3] c++: Track lifetimes in constant evaluation [PR70331, ...]

2023-03-28 Thread Nathaniel Shead via Gcc-patches
This is an update of the patch series at https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614759.html The main change is modifying the first patch to store the "expired" flag in the C++-specific lang_decl_base struct instead of tree_decl_common. The second and third patches to improve diagnost

[PATCH v2 2/3] c++: Improve constexpr error for dangling local variables

2023-03-28 Thread Nathaniel Shead via Gcc-patches
Currently, when typeck discovers that a return statement will refer to a local variable it rewrites to return a null pointer. This causes the error messages for using the return value in a constant expression to be unhelpful, especially for reference return values. This patch removes this "optimis

[pushed] c++: alias ctad refinements [PR109321]

2023-03-28 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The two hunks fix missing handling demonstrated by the two testcases: first, if we omit one alias template parm but include another, we need to rewrite the deduced template args to reflect the new position of the included parm. Second, if we

Go patch committed: Mark Call_expression multi-results as result struct

2023-03-28 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend marks a Call_expression multiple results struct as a result struct. In https://go.dev/cl/343873 we stopped padding zero-sized trailing fields in functions that return multiple results where the last result is zero-sized. This CL makes the corresponding change on the c

[committed] libstdc++: Do not use facets cached in ios for ATL128 build [PR103387]

2023-03-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- For the powerpc64le build with two different long double representations, we cannot use the ios_base::_M_num_put and ios_base::_M_num_get pointers, because they might have been initialized in a translation unit using the other long double type.

Enable 'gfortran.dg/weak-2.f90' for nvptx target (was: Support for WEAK attribute, part 2)

2023-03-28 Thread Thomas Schwinge
Hi! On 2023-02-24T07:16:51+0200, Rimvydas Jasinskas via Fortran wrote: > From 5b83226c714b17780334b5bad9b17c2266af8232 Mon Sep 17 00:00:00 2001 > From: Rimvydas Jasinskas > Date: Fri, 24 Feb 2023 04:41:00 + > Subject: Fortran: Add support for WEAK attribute for variables > > Add the rest o

[Patch, fortran] PR87477 - [meta-bug] [F03] issues concerning the ASSOCIATE statement

2023-03-28 Thread Paul Richard Thomas via Gcc-patches
Hi All, I have made a start on ASSOCIATE issues. Some of the low(-ish) hanging fruit are already fixed but I have yet to check that they a really fixed and to close them: pr102106, pr102111, pr104430, pr106048, pr85510, pr87460, pr92960 & pr93338 The attached patch picks up those PRs involving de

[committed] libstdc++: Tell GCC what basic_string::_M_is_local() means [PR109299]

2023-03-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This avoids a bogus warning about overflowing a buffer, because GCC can't tell that we don't copy into the buffer unless it fits. By adding a __builtin_unreachable() hint we inform the compiler about the invariant that the buffer is only used wh

[committed] libstdc++: More fixes for null pointers used with std::char_traits

2023-03-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- The std::char_traits member functions require that [p,p+n) is a valid range, which is true for p==nullptr iff n==0. But we must not call memcpy, memset etc, in that case, as they require non-null pointers even when n==0. This std::char_traits a

[committed] libstdc++: Update tzdata to 2023a [PR109288]

2023-03-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- Import the new 2023a tzdata.zi file and update the expiry dates of the hardcoded lists of leapseconds to 2023-12-28. With the new data, Africa/Egypt no longer has a single unbroken sys_info from 2014-09-25 to chrono::year::max(). Only check up

libbacktrace patch committed: Tweaks to zstd decompression

2023-03-28 Thread Ian Lance Taylor via Gcc-patches
In looking over the recently committed support for zstd decompression in libbacktrace, I found a few minor cases that needed fixing. Bootstrapped and tested on x86_64-pc-linux-gnu. Committed to mainline. Ian * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading bits, not before. Add u

Re: [PATCH, commited] Fortran: remove dead code [PR104321]

2023-03-28 Thread Thomas Koenig via Gcc-patches
On 26.03.23 08:52, Paul Richard Thomas via Fortran wrote: If you will excuse the British cultural reference, that's a Norwegian Blue alright! Good spot. Still pining for the fjords, I gather?

[pushed] Don't emit -Wxor-used-as-pow on macro expansions [PR107002]

2023-03-28 Thread David Malcolm via Gcc-patches
PR c/107002 reports an assertion failure from deep inside the diagnostic_shows_locus when attempting to print fix-it hints relating to -Wxor-used-as-pow. The case involves macro expansions with -ftrack-macro-expansion=0. It doesn't seem to make much sense to emit this warning for macro expansions

[PATCH] LoongArch: Improve GAR store for va_list

2023-03-28 Thread Xi Ruoyao via Gcc-patches
LoongArch backend used to save all GARs for a function with variable arguments. But sometimes a function only accepts variable arguments for a purpose like C++ function overloading. For example, POSIX defines open() as: int open(const char *path, int oflag, ...); But only two forms are actu

[PATCH] c++: ICE on loopy var tmpl auto deduction [PR109300]

2023-03-28 Thread Patrick Palka via Gcc-patches
Now that we resolve non-dependent variable template-ids ahead of time, cp_finish_decl needs to handle a new invalid situation: we can end up trying to instantiate a variable template with deduced return type before we fully parsed (and attached) its initializer. Bootstrapped and regtested on x86_6

[PATCH v3] RISC-V: Add Z*inx imcompatible check in gcc

2023-03-28 Thread Jiawei
Z*inx is conflict with float extensions, add incompatible check when z*inx and f extension both enabled. Since all float extension imply f extension and all z*inx extension imply zfinx extension, so we just need to check f with zfinx extension as the base case. Co-Authored by: Kito Cheng gcc/

[PATCH v2] rtl-optimization: ppc backend generates unnecessary extension.

2023-03-28 Thread Ajit Agarwal via Gcc-patches
Hello All: This patch makes REE pass as a default pass in rs6000 target. And add necessary subroutines to eliminate extensions across basic blocks. Bootstrapped and regtested on powerpc64-linu-gnu. Thanks & Regards Ajit rtl-optimization: ppc backend generates unnecessary extens

[V6][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size

2023-03-28 Thread Qing Zhao via Gcc-patches
Hi, Joseph and Jakub, this is the 6th version of the patch. compared to the 5th version, the major changes are: 1. Update the documentation Per Joseph's comments; 2. Change the name of the new warning option per Jakub's suggestions. 3. Update testing case per the above change. these changes are

[V6][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-03-28 Thread Qing Zhao via Gcc-patches
the C front-end has been approved by Joseph. Jacub, could you please eview the middle end part of the changes of this patch? The major change is in tree-object-size.cc (addr_object_size). (To use the new TYPE_INCLUDE_FLEXARRAY info). This patch is to fix PR101832(https://gcc.gnu.org/bugzilla/

Re: [PATCH] c++: Make diagnostic translatable [PR109309]

2023-03-28 Thread Jonathan Wakely via Gcc-patches
Ignore this one - jakub just committed a fix.

[PATCH] c++: Make diagnostic translatable [PR109309]

2023-03-28 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. OK for trunk? -- >8 -- gcc/cp/ChangeLog: PR c++/109309 * contracts.cc (check_postcondition_result): Use complete strings for diagnostics, so they can be translated. --- gcc/cp/contracts.cc | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH 2/2] Update documentation to clarify a GCC extension

2023-03-28 Thread Qing Zhao via Gcc-patches
on a structure with a C99 flexible array member being nested in another structure. (PR77650) "GCC extension accepts a structure containing an ISO C99 "flexible array member", or a union containing such a structure (possibly recursively) to be a member of a structure. There are two situations:

Re: [PATCH] c++: Allow translations of check_postcondition_result messages [PR109309]

2023-03-28 Thread Jason Merrill via Gcc-patches
On 3/28/23 11:44, Jakub Jelinek wrote: Hi! As mentioned in the PR, constructing a message from two parts by concatenating them prevents translations, unless one of the parts is a keyword which should be never translated. The following patch fixes that, ok for trunk? OK. 2023-03-28 Jakub Je

[PATCH] c++: Allow translations of check_postcondition_result messages [PR109309]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, constructing a message from two parts by concatenating them prevents translations, unless one of the parts is a keyword which should be never translated. The following patch fixes that, ok for trunk? 2023-03-28 Jakub Jelinek PR c++/109309 * contrac

PING^2 Re: [PATCH RFC] c++: lambda mangling alias issues [PR107897]

2023-03-28 Thread Jason Merrill via Gcc-patches
On 3/14/23 11:16, Jason Merrill wrote: On 3/8/23 11:54, Jason Merrill wrote: On 3/8/23 11:15, Jason Merrill wrote: On 3/8/23 10:53, Jan Hubicka wrote: Tested x86_64-pc-linux-gnu.  Does this look good, or do we want to factor the flag clearing into a symtab_node counterpart to cgraph_node::res

Re: [PATCH RFC] c-family: -Wsequence-point and COMPONENT_REF [PR107163]

2023-03-28 Thread Jason Merrill via Gcc-patches
On 3/24/23 18:25, Jakub Jelinek wrote: On Fri, Mar 24, 2023 at 06:11:44PM -0400, Jason Merrill wrote: When we touch this for COMPONENT_REF, shouldn't we then handle it as unary given that the second operand is FIELD_DECL and third/fourth will likely be NULL and even if not, aren't user expressio

Re: [PATCH] RISC-V: Define __riscv_v_intrinsic [PR109312]

2023-03-28 Thread Kito Cheng via Gcc-patches
Applied to trunk :) 於 2023年3月28日 週二,22:34寫道: > LGTM。 > > > > juzhe.zh...@rivai.ai > > From: Kito Cheng > Date: 2023-03-28 22:26 > To: gcc-patches; kito.cheng; jim.wilson.gcc; palmer; andrew; juzhe.zhong; > jeffreyalaw > CC: Kito Cheng > Subject: [PATCH] RISC-V: Define __riscv_v_intrinsic [PR10931

Re: [PATCH] ipa/106124 - ICE with -fkeep-inline-functions and OpenMP

2023-03-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 28, 2023 at 06:20:36AM +, Richard Biener via Gcc-patches wrote: > The testcases in this bug reveal cases where an early generated > type is collected because it was unused but gets attempted to > be recreated later when a late DIE for a function (an OpenMP > reduction) is created.

Re: Re: [PATCH v2] RISC-V: Add Z*inx imcompatible check in gcc.

2023-03-28 Thread Kito Cheng via Gcc-patches
Maybe something like this? diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index acfd7b92563..aa7edc8cfec 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -1155,6 +1155,10 @@ riscv_subset_list::pars

Re: Re: [PATCH v2] RISC-V: Add Z*inx imcompatible check in gcc.

2023-03-28 Thread jiawei
Hi Kito, Thanks for your sugestions, I had added the new testcases in the new patch. I feel it's hard to check long string name extension by use riscv_subset_list::parse, Since it just check one char when the pointer moving, So I still keep the implement by check the extenstison with target. May

Re: [PATCH] RISC-V: Define __riscv_v_intrinsic [PR109312]

2023-03-28 Thread juzhe.zhong
LGTM。 juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-03-28 22:26 To: gcc-patches; kito.cheng; jim.wilson.gcc; palmer; andrew; juzhe.zhong; jeffreyalaw CC: Kito Cheng Subject: [PATCH] RISC-V: Define __riscv_v_intrinsic [PR109312] RVV intrinsic has defined a macro to identity the version of R

Re: [PATCH v2] RISC-V: Add Z*inx imcompatible check in gcc.

2023-03-28 Thread Kito Cheng via Gcc-patches
I would prefer those checking happened in riscv_subset_list::parse@gcc/common/config/riscv/riscv-common.cc that could be reused when we adding target attribute. And I plan integrate the arch-canonicalize script to just reusing whole arch string parser in GCC 14, so it would be great to have all ch

[PATCH] RISC-V: Define __riscv_v_intrinsic [PR109312]

2023-03-28 Thread Kito Cheng via Gcc-patches
RVV intrinsic has defined a macro to identity the version of RVV intrinsic spec, we missed that before, thanksful we are catch this before release. gcc/ChangeLog: PR target/109312 * config/riscv/riscv-c.cc (riscv_ext_version_value): New. (riscv_cpu_cpp_builtins): Define __

Re: [PATCH v2] Print padding size when aligning struct member

2023-03-28 Thread Vit Kabele
Hello, On Sat, Mar 11, 2023 at 08:35:53AM -0700, Jeff Law wrote: > On 2/24/23 00:28, Vít Kabele wrote: > You might consider changing the other similar message you added last year to > finalize_record_size to use the same format as this message for the sake of > consistency. For example like this?

[PATCH v2] RISC-V: Add Z*inx imcompatible check in gcc.

2023-03-28 Thread Jiawei
Z*inx is conflict with float extensions, add incompatible check when z*inx and hard_float both enabled. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_option_override): New check. gcc/testsuite/ChangeLog: * gcc.target/riscv/arch-19.c: New test. --- gcc/config/riscv/riscv.cc

Re: [PATCH] libstdc++: Add missing trait is_simd_flag_type

2023-03-28 Thread Jonathan Wakely via Gcc-patches
On Tue, 28 Mar 2023 at 11:41, Matthias Kretz via Libstdc++ wrote: > > I don't know how, but I forgot to implement the > is_simd_flag_type trait. This fixes it. > > No new check-simd failures on x86_64-pc-linux-gnu OK > > --- 8< -- > > Signed-off-by: Matthias Kretz >

Ping #2: [PATCH v2] doc: md.texi (Insn Splitting): Tweak wording for readability.

2023-03-28 Thread Hans-Peter Nilsson via Gcc-patches
> From: Hans-Peter Nilsson > Date: Tue, 14 Mar 2023 17:04:43 +0100 Ping #2 on contents (formatting is approved): > -- >8 -- > I needed to check what was allowed in a define_split, but > had problems understanding what was meant by "Splitting of > jump instruction into sequence that over by anoth

Re: [PATCH] PR tree-optimization/109274 -Fix compute_operand when op1 == op2 symbolically.

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, Mar 28, 2023 at 3:19 PM Andrew MacLeod wrote: > > On 3/24/23 12:36, Jakub Jelinek wrote: > > On Fri, Mar 24, 2023 at 11:52:30AM -0400, Andrew MacLeod wrote: > >> Thanks.. Ive incorporated it into my commit too. > > Note, both my earlier version of the patch and your patch regress: > > FAI

Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule comparator [PR109187]

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, Mar 28, 2023 at 3:11 PM Alexander Monakov via Gcc-patches wrote: > > Do not attempt to use a plain subtraction for generating a three-way > comparison result in autopref_rank_for_schedule qsort comparator, as > offsets are not restricted and subtraction may overflow. Open-code > a safe th

[PATCH] build: Check that -lzstd can be linked

2023-03-28 Thread Rainer Orth
Recent Solaris 11.4 SRUs bundle zstd, but only the 64-bit libraries (no idea why). Because of this, in 32-bit builds cc1 etc. fail to link with undefined references to various ZSTD_* functions from lto-compress.o. This happens because currently only the presence of is necessary to enable zstd sup

[PATCH] PR tree-optimization/109274 -Fix compute_operand when op1 == op2 symbolically.

2023-03-28 Thread Andrew MacLeod via Gcc-patches
On 3/24/23 12:36, Jakub Jelinek wrote: On Fri, Mar 24, 2023 at 11:52:30AM -0400, Andrew MacLeod wrote: Thanks.. Ive incorporated it into my commit  too. Note, both my earlier version of the patch and your patch regress: FAIL: gcc.dg/tree-ssa/vrp-float-3a.c scan-tree-dump-not evrp "link_error" F

[PATCH] haifa-sched: fix autopref_rank_for_schedule comparator [PR109187]

2023-03-28 Thread Alexander Monakov via Gcc-patches
Do not attempt to use a plain subtraction for generating a three-way comparison result in autopref_rank_for_schedule qsort comparator, as offsets are not restricted and subtraction may overflow. Open-code a safe three-way comparison instead. gcc/ChangeLog: PR rtl-optimization/109187

Re: [PATCH] tree-optimization/107087 - missed CCP after forwprop

2023-03-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 28, 2023 at 12:43:34PM +, Richard Biener wrote: > When forwprop simplifies the CFG the 2nd order opportunities by > exposed degenerate PHIs are not realized. The following improves > this by properly tracking executable edges and thus handling this > for non-cyclic CFGs at least. >

[PATCH] tree-optimization/107087 - missed CCP after forwprop

2023-03-28 Thread Richard Biener via Gcc-patches
When forwprop simplifies the CFG the 2nd order opportunities by exposed degenerate PHIs are not realized. The following improves this by properly tracking executable edges and thus handling this for non-cyclic CFGs at least. This avoids the bogus diagnostic reported for the testcase in this PR.

[PATCH] RISC-V: Fix ICE of ternary intrinsics and scalar move in RV32 system

2023-03-28 Thread juzhe . zhong
From: Juzhe-Zhong Co-authored-by: kito-cheng Co-authored-by: kito-cheng This path fix ICE of ternary intrinsic: bug.C:144:2: error: unable to find a register to spill 144 | } | ^ bug.C:144:2: error: this is the insn: (insn 462 972 919 24 (set (reg/v:VNx8DI 546 [orig:192 var_10 ] [192

Re: [PATCH 1/3] c++: Track lifetimes in constant evaluation [PR70331, PR96630, PR98675]

2023-03-28 Thread Nathaniel Shead via Gcc-patches
On Tue, Mar 28, 2023 at 10:50 PM Jakub Jelinek wrote: > > On Tue, Mar 28, 2023 at 10:32:28PM +1100, Nathaniel Shead via Gcc-patches > wrote: > > * tree-core.h (struct tree_decl_common): New flag to check if > > value lifetime has expired. > > * tree.h (DECL_EXPIRED): Access th

Re: Enable UTF-8 code page in driver and compiler on 64-bit mingw host [PR108865]

2023-03-28 Thread Jonathan Yong via Gcc-patches
On 3/28/23 10:43, Costas Argyris wrote: I forgot to update the relevant comments with the previous patch. This is a comment-only patch that brings them up-to-date. Done, thanks.

Re: [PATCH 1/3] c++: Track lifetimes in constant evaluation [PR70331, PR96630, PR98675]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 28, 2023 at 10:32:28PM +1100, Nathaniel Shead via Gcc-patches wrote: > * tree-core.h (struct tree_decl_common): New flag to check if > value lifetime has expired. > * tree.h (DECL_EXPIRED): Access the new flag. > * print-tree.cc (print_node): Print the new flag

[committed] aarch64: Restore vectorisation of vld1 inputs [PR109072]

2023-03-28 Thread Richard Sandiford via Gcc-patches
Before GCC 12, we would vectorize: int32_t arr[] = { x, x, x, x }; at -O3. Vectorizing the store on its own is often a loss, particularly for integers, so g:4963079769c99c4073adfd799885410ad484cbbe suppressed it. This was necessary to fix regressions from enabling vectorisation at -O2, Howeve

[PATCH 2/3] c++: Improve constexpr error for dangling local variables

2023-03-28 Thread Nathaniel Shead via Gcc-patches
Currently, when typeck discovers that a return statement will refer to a local variable it rewrites to return a null pointer. This causes the error messages for using the return value in a constant expression to be unhelpful, especially for reference return values. This patch removes this "optimis

[PATCH 1/3] c++: Track lifetimes in constant evaluation [PR70331, PR96630, PR98675]

2023-03-28 Thread Nathaniel Shead via Gcc-patches
This adds rudimentary lifetime tracking in C++ constexpr contexts, allowing the compiler to report errors with using values after their backing has gone out of scope. We don't yet handle other ways of ending lifetimes (e.g. explicit destructor calls). PR c++/70331 PR c++/96630

[PATCH 3/3] c++: Improve location information in constexpr evaluation

2023-03-28 Thread Nathaniel Shead via Gcc-patches
This patch caches the current expression's location information in the constexpr_global_ctx struct, which allows subexpressions that have lost location information to still provide accurate diagnostics. Also rewrites a number of 'error' calls as 'error_at' to provide more specific location informa

[PATCH 0/3] Track lifetimes in constant evaluation [PR70331,...]

2023-03-28 Thread Nathaniel Shead via Gcc-patches
The first patch fixes PR70331, PR96630, and PR98675 regarding constexpr evaluation not correctly diagnosing uses of dangling references and pointers. The following two patches clean up and improve some of the errors that are generated by this change, but aren't strictly necessary. This is my first

[PATCH] bootstrap/84402 - improve (match ...) code generation

2023-03-28 Thread Richard Biener via Gcc-patches
The following avoids duplicating matching code for (match ...) in match.pd when possible. That's more easily possible for (match ...) than simplify because we do not need to handle common matches (those would be diagnosed only during compiling) nor is the result able to inspect the active operator

Re: [PATCH] c++, coroutines: Stabilize names of promoted slot vars [PR101118].

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, Mar 28, 2023 at 1:16 PM Iain Sandoe wrote: > > Hi Richard > > > On 28 Mar 2023, at 12:27, Iain Sandoe wrote: > >> On 28 Mar 2023, at 11:58, Richard Biener > >> wrote: > >> > >> On Mon, Mar 27, 2023 at 9:32 AM Iain Sandoe wrote: > >>> > On 27 Mar 2023, at 12:48, Richard Biener >

Re: [PATCH] c++, coroutines: Stabilize names of promoted slot vars [PR101118].

2023-03-28 Thread Iain Sandoe
Hi Richard > On 28 Mar 2023, at 12:27, Iain Sandoe wrote: >> On 28 Mar 2023, at 11:58, Richard Biener wrote: >> >> On Mon, Mar 27, 2023 at 9:32 AM Iain Sandoe wrote: >>> On 27 Mar 2023, at 12:48, Richard Biener wrote: On Mon, Mar 27, 2023 at 8:58 AM Iain Sandoe wrote:

Re: [PATCH] tree-ssa-math-opts: Move PROP_gimple_opt_math from sincos pass to powcabs [PR109301]

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, 28 Mar 2023, Jakub Jelinek wrote: > Hi! > > On Tue, Mar 28, 2023 at 09:23:23AM +, Richard Biener wrote: > > But as said, the fix is probably to move the pass property. > > After looking into it in more detail I agree with you. > powcabs is a pass in the spot sincos was happening befo

Re: Enable UTF-8 code page in driver and compiler on 64-bit mingw host [PR108865]

2023-03-28 Thread Costas Argyris via Gcc-patches
I forgot to update the relevant comments with the previous patch. This is a comment-only patch that brings them up-to-date. On Tue, 28 Mar 2023 at 09:05, Jonathan Yong <10wa...@gmail.com> wrote: > On 3/27/23 17:17, Costas Argyris wrote: > > The patch attached to this email extends the UTF-8 supp

[committed] libstdc++: Fix operator% implementation for Clang

2023-03-28 Thread Matthias Kretz via Gcc-patches
This resolves a regression of my previous fix where Clang would ICE on _S_divides. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_SimdImplX86): Use _Base::_S_divides if the optimized _S_divides function is hidden via the

[PATCH] libstdc++: Add missing trait is_simd_flag_type

2023-03-28 Thread Matthias Kretz via Gcc-patches
I don't know how, but I forgot to implement the is_simd_flag_type trait. This fixes it. No new check-simd failures on x86_64-pc-linux-gnu --- 8< -- Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (is_simd_flag_type)

[PATCH] tree-ssa-math-opts: Move PROP_gimple_opt_math from sincos pass to powcabs [PR109301]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! On Tue, Mar 28, 2023 at 09:23:23AM +, Richard Biener wrote: > But as said, the fix is probably to move the pass property. After looking into it in more detail I agree with you. powcabs is a pass in the spot sincos was happening before, so the only change was defer the sin+cos simplificati

[committed] gcov-tool: Use subcommand rather than sub-command in function comments

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! Follow-up to the recently committed fix of fixing the "subcomand" typos in diagnostics. Committed to trunk as obvious. 2023-03-28 Jakub Jelinek Jonathan Wakely * gcov-tool.cc (do_merge, do_merge_stream, do_rewrite, do_overlap): Use subcommand rather than sub

[committed] openmp: Fix typo in diagnostics [PR109314]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! Trivial typo fix. Committed to trunk. 2023-03-28 Jakub Jelinek PR fortran/109314 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics - composit -> composite. --- gcc/fortran/openmp.cc.jj2023-02-16 10:13:23.813209002 +0100 +++ gcc/fortran/ope

Re: [PATCH] match.pd: Fix up sqrt (sqrt (x)) simplification [PR109301]

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, 28 Mar 2023, Jakub Jelinek wrote: > On Tue, Mar 28, 2023 at 08:57:12AM +, Richard Biener wrote: > > Hmm, but canonicalize_math_p () should be false after vectorization? > > > > When we moved the pass we should have made sure to put the > > PROP_gimple_opt_math property set to pass_exp

Re: [PATCH] match.pd: Fix up sqrt (sqrt (x)) simplification [PR109301]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 28, 2023 at 08:57:12AM +, Richard Biener wrote: > Hmm, but canonicalize_math_p () should be false after vectorization? > > When we moved the pass we should have made sure to put the > PROP_gimple_opt_math property set to pass_expand_powcabs instead. Which pass is the one that actu

Re: [PATCH] match.pd: Fix up sqrt (sqrt (x)) simplification [PR109301]

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, 28 Mar 2023, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs since the sincos and vect pass order has > been swapped. It is not valid to replace vector sqrt (sqrt (x)) with > pow (x, 0.25) because build_real on vector type is invalid (could be > handled by using build_uniform_

Re: [PATCH] range-op-float: Use get_nan_state in float_widen_lhs_range

2023-03-28 Thread Aldy Hernandez via Gcc-patches
On 3/28/23 09:54, Jakub Jelinek wrote: Hi! On Wed, Mar 22, 2023 at 07:32:44AM +0100, Aldy Hernandez wrote: * value-range.cc (frange::set): Add nan_state argument. * value-range.h (class nan_state): New. (frange::get_nan_state): New. The following patch makes use of

Re: [RFC PATCH] range-op-float: Only flush_denormals_to_zero for +-*/ [PR109154]

2023-03-28 Thread Aldy Hernandez via Gcc-patches
On 3/28/23 10:16, Jakub Jelinek wrote: Hi! As discussed in the PR, flushing denormals to zero on every frange::set might be harmful for e.g. x < 0.0 comparisons, because we then on both sides use ranges that include zero [-Inf, -0.0] on the true side, and [-0.0, +Inf] NAN on the false side, r

[SPARC] Fix PR target/109140

2023-03-28 Thread Eric Botcazou via Gcc-patches
. (fpcmpu_vis): Likewise. (vcondu): New VIS 4 expander. 2023-03-28 Eric Botcazou * gcc.target/sparc/20230328-1.c: New test. * gcc.target/sparc/20230328-2.c: Likewise. * gcc.target/sparc/20230328-3.c: Likewise. * gcc.target/sparc/20230328-4.c: Likewise

Re: [PATCH] sanopt: Return TODO_cleanup_cfg if any .{UB,HWA,A}SAN_* calls were lowered [PR106190]

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, 28 Mar 2023, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs, because without optimization eh lowering > decides not to duplicate finally block of try/finally and so we end up > with variable guarded cleanup. The sanopt pass creates a cfg that ought > to be cleaned up (some IF

Re: [PATCH] rtl-optimization/109237 - speedup bb_is_just_return

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, 28 Mar 2023, Jakub Jelinek wrote: > On Wed, Mar 22, 2023 at 10:03:42AM +, Richard Biener via Gcc-patches > wrote: > > For the testcase bb_is_just_return is on top of the profile, changing > > it to walk BB insns backwards puts it off the profile. That's because > > in the forward wal

[COMMITTED] testsuite: Fix weak_undefined handling on Darwin

2023-03-28 Thread Rainer Orth
The patch that introduced the weak_undefined effective-target keyword and corresponding dg-add-options support commit 378ec7b87a5265dbe2d489c245fac98ef37fa638 Author: Alexandre Oliva Date: Thu Mar 23 00:45:05 2023 -0300 [testsuite] test for weak_undefined support and add options badly bro

New German PO file for 'gcc' (version 13.1-b20230212)

2023-03-28 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the German team of translators. The file is available at: https://translationproject.org/latest/gcc/de.po (This file, 'gcc-13.1-b20230212.de.po',

[PATCH] match.pd: Fix up sqrt (sqrt (x)) simplification [PR109301]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs since the sincos and vect pass order has been swapped. It is not valid to replace vector sqrt (sqrt (x)) with pow (x, 0.25) because build_real on vector type is invalid (could be handled by using build_uniform_cst and adjusting type passed to build_real) but more i

[RFC PATCH] range-op-float: Only flush_denormals_to_zero for +-*/ [PR109154]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! As discussed in the PR, flushing denormals to zero on every frange::set might be harmful for e.g. x < 0.0 comparisons, because we then on both sides use ranges that include zero [-Inf, -0.0] on the true side, and [-0.0, +Inf] NAN on the false side, rather than [-Inf, nextafter (-0.0, -Inf)] on

Re: [PATCH] i386: Require just 32-bit alignment for SLOT_FLOATxFDI_387 -m32 -mpreferred-stack-boundary=2 DImode temporaries [PR109276]

2023-03-28 Thread Uros Bizjak via Gcc-patches
On Tue, Mar 28, 2023 at 10:11 AM Jakub Jelinek wrote: > > Hi! > > The following testcase ICEs since r11-2259 because assign_386_stack_local > -> assign_stack_local -> ix86_local_alignment now uses 64-bit alignment > for DImode temporaries rather than 32-bit as before. > Most of the spots in the ba

[PATCH] i386: Require just 32-bit alignment for SLOT_FLOATxFDI_387 -m32 -mpreferred-stack-boundary=2 DImode temporaries [PR109276]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs since r11-2259 because assign_386_stack_local -> assign_stack_local -> ix86_local_alignment now uses 64-bit alignment for DImode temporaries rather than 32-bit as before. Most of the spots in the backend which ask for DImode temporaries are during expansion and thos

[PATCH] tree-optimization/109304 - properly handle instrumented aliases

2023-03-28 Thread Richard Biener via Gcc-patches
When adjusting calls to reflect instrumentation we failed to handle calls to aliases since they appear to have no body. Instead resort to symtab node availability. The patch also avoids touching internal function calls in a more obvious way (builtins might have a body available). profiledbootstr

Re: Enable UTF-8 code page in driver and compiler on 64-bit mingw host [PR108865]

2023-03-28 Thread Jonathan Yong via Gcc-patches
On 3/27/23 17:17, Costas Argyris wrote: The patch attached to this email extends the UTF-8 support of the driver and compiler processes to the 32-bit mingw host.Initially, only the 64-bit host got it. About the changes in sym-mingw32.cc: Even though the 64-bit host was building fine with th

[PATCH] sanopt: Return TODO_cleanup_cfg if any .{UB,HWA,A}SAN_* calls were lowered [PR106190]

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because without optimization eh lowering decides not to duplicate finally block of try/finally and so we end up with variable guarded cleanup. The sanopt pass creates a cfg that ought to be cleaned up (some IFN_UBSAN_* functions are lowered in this case with const

[PATCH] range-op-float: Use get_nan_state in float_widen_lhs_range

2023-03-28 Thread Jakub Jelinek via Gcc-patches
Hi! On Wed, Mar 22, 2023 at 07:32:44AM +0100, Aldy Hernandez wrote: > * value-range.cc (frange::set): Add nan_state argument. > * value-range.h (class nan_state): New. > (frange::get_nan_state): New. The following patch makes use of those changes in float_widen_lhs_range. Boots

Re: [PATCH] rtl-optimization/109237 - speedup bb_is_just_return

2023-03-28 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 22, 2023 at 10:03:42AM +, Richard Biener via Gcc-patches wrote: > For the testcase bb_is_just_return is on top of the profile, changing > it to walk BB insns backwards puts it off the profile. That's because > in the forward walk you have to process possibly many debug insns > but

[PATCHv2, rs6000] rs6000: correct vector sign extend built-ins on Big Endian [PR108812]

2023-03-28 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch removes byte reverse operation before vector integer sign extension on big endian. These built-ins require to sign extend the element of the input vector that would fall in the least significant portion of the result element. So both BE and LE should do the same operation and the b

Re: [PATCH] fixincludes: Declare memmem if it's not declared in system headers [PR109293]

2023-03-28 Thread Xi Ruoyao via Gcc-patches
On Tue, 2023-03-28 at 08:35 +0200, Richard Biener wrote: > On Mon, Mar 27, 2023 at 8:00 PM Xi Ruoyao via Gcc-patches > wrote: > > > > memmem is not POSIX so the system may lack it.  Then libiberty will > > provide an implementation, but it's a "supplemental function" and not > > declared in libib