Re: [PATCH] PR c/104506: Tolerate error_mark_node in useless_type_conversion_p.

2022-02-14 Thread Andrew Pinski via Gcc-patches
On Mon, Feb 14, 2022 at 11:33 PM Richard Biener wrote: > > On Tue, Feb 15, 2022 at 12:58 AM Andrew Pinski via Gcc-patches > wrote: > > > > On Mon, Feb 14, 2022 at 4:54 AM Roger Sayle > > wrote: > > > > > > > > > > > > This simple fix to the middle-end, resolves PR c/104506, by adding an > > >

Re: [committed][nvptx] Handle pre-sm_7x shared atomic store using atomic exchange

2022-02-14 Thread Thomas Schwinge
Hi Tom! For my understanding: On 2022-02-10T10:13:10+0100, Tom de Vries via Gcc-patches wrote: > The ptx isa specifies (for pre-sm_7x) that atomic operations on shared memory > locations do not guarantee atomicity with respect to normal store instructions > to the same address. > > This can be

Re: [PATCH] PR c/104506: Tolerate error_mark_node in useless_type_conversion_p.

2022-02-14 Thread Richard Biener via Gcc-patches
On Tue, Feb 15, 2022 at 12:58 AM Andrew Pinski via Gcc-patches wrote: > > On Mon, Feb 14, 2022 at 4:54 AM Roger Sayle > wrote: > > > > > > > > This simple fix to the middle-end, resolves PR c/104506, by adding an > > > > explicit check for error_mark_node to useless_type_conversion_p. I first

Re: [PATCH] c: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-14 Thread Jason Merrill via Gcc-patches
On 2/14/22 21:30, Zhao Wei Liew wrote: On 14/02/2022, Jason Merrill wrote: +/* Returns true if EXPR is a reference to an implicit + call to operator=(). */ +static bool +is_assignment_overload_ref_p (tree expr) +{ + if (expr == NULL_TREE || !REFERENCE_REF_P (expr)) +return false;

[pushed] c++: TTP in member alias template [PR104107]

2022-02-14 Thread Jason Merrill via Gcc-patches
In the first testcase, coerce_template_template_parms was adding too much of outer_args when coercing to match P's template parameters, so that when substituting into the 'const T&' parameter we got an unrelated template argument for T. We should only add outer_args when the argument template is

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

2022-02-14 Thread HAO CHEN GUI via Gcc-patches
Segher, Thanks for your comments. Here are my comments and questions.Thanks. On 15/2/2022 上午 5:36, Segher Boessenkool wrote: > Hi! > > On Wed, Feb 09, 2022 at 10:43:17AM +0800, HAO CHEN GUI wrote: >> This patch removes TImode from mode iterator BOOL_128. Thus, bool >> operations (AND, IOR,

Re: [PATCH] c: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-14 Thread Zhao Wei Liew via Gcc-patches
On 14/02/2022, Jason Merrill wrote: >> >> +/* Returns true if EXPR is a reference to an implicit >> + call to operator=(). */ >> +static bool >> +is_assignment_overload_ref_p (tree expr) >> +{ >> + if (expr == NULL_TREE || !REFERENCE_REF_P (expr)) >> +return false; > > This will only warn

Re: [PATCH] PR c/104506: Tolerate error_mark_node in useless_type_conversion_p.

2022-02-14 Thread Andrew Pinski via Gcc-patches
On Mon, Feb 14, 2022 at 4:54 AM Roger Sayle wrote: > > > > This simple fix to the middle-end, resolves PR c/104506, by adding an > > explicit check for error_mark_node to useless_type_conversion_p. I first > > trying fixing this in the C front-end, but the type is valid at the point > > that the

Re: [PATCH] Update -Warray-bounds documentation [PR104355]

2022-02-14 Thread Martin Sebor via Gcc-patches
On 2/10/22 23:48, Richard Sandiford wrote: Martin Sebor via Gcc-patches writes: The -Warray-bounds description in the manual is out of date in a couple of ways. First it claims that the option is only active with optimization, which isn't entirely correct since at least one instance is issued

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

2022-02-14 Thread Segher Boessenkool
Hi! On Wed, Feb 09, 2022 at 10:43:17AM +0800, HAO CHEN GUI wrote: > This patch removes TImode from mode iterator BOOL_128. Thus, bool > operations (AND, IOR, XOR, NOT) > on TImode will be split to the relevant operations on word mode during expand > (in optabs.c). But we also want to allow

Re: [PATCH] reload: Adjust comment in find_reloads about subset, not intersection

2022-02-14 Thread Hans-Peter Nilsson via Gcc-patches
Rather than assuming it's seen and thought not worth the bother, I'll go with not-seen, so: Jeff: ping. A little love for reload, comment-wise, before it's put down! > From: Richard Sandiford > CC: "gcc-patches@gcc.gnu.org" , "j...@tachyum.com" > > Date: Wed, 2 Feb 2022 16:16:14 +0100 >

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

2022-02-14 Thread Maciej W. Rozycki
On Thu, 10 Feb 2022, Kito Cheng wrote: > OK for release branches, thanks! Backported to GCC 11 & 10 then; not needed for GCC 9. Maciej

Re: [PATCH] ipa: Create LOAD references when necessary during inlining (PR 103171)

2022-02-14 Thread Martin Jambor
Hello and ping, please. Thanks! Martin On Fri, Jan 28 2022, Martin Jambor wrote: > Hi, > > in r12-2523-g13586172d0b70c ipa-prop tracking of jump functions during > inlining got the ability to remove ADDR references when inlining > discovered that they were not necessary or turn them into LOAD >

[PATCH] ipa-cp: Do not create clones for values outside known value range (PR 102513)

2022-02-14 Thread Martin Jambor
Hi, PR 102513 shows we emit bogus array access warnings when IPA-CP creates clones specialized for values which it deduces from arithmetic jump functions describing self-recursive calls. Those can however be avoided if we consult the IPA-VR information that the same pass also has. The patch

[committed] libstdc++: Fix stream extraction of IEEE128 long double [PR100912]

2022-02-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux with both IEEE/IBM ABIs. Pushed to trunk. -- >8 -- The std::__convert_from_v helper that formats double and long double values into a char buffer was not being duplicated for the two long double ABIs. This resulted in an ODR violation inside the library, where some

Re: [PATCH] PR fortran/104211 - ICE in find_array_section, at fortran/expr.cc:1720

2022-02-14 Thread Thomas Koenig via Gcc-patches
Hi Harald, when referencing a bad array section after an erroneous previous declaration we might hit an assert. The assert can be replaced by a more gracious error recovery. Reported by Gerhard. Regtested on x86_64-pc-linux-gnu. OK for mainline? OK. Thanks for the patch! Best regards

[OG11][committed] Fortran metadirective fixes

2022-02-14 Thread Kwok Cheung Yeung
Hello I have backported and committed the recent two fixes for Fortran metadirective handling onto the devel/omp/gcc-11 development branch: 38ed9d83b893df0bbd098c7b44dbbeb56ed7dd1c openmp: Eliminate non-matching metadirective variants early in Fortran front-end

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Vladimir Makarov via Gcc-patches
On 2022-02-14 11:00, Richard Sandiford wrote: Hi Vlad, Vladimir Makarov via Gcc-patches writes: Hi, Richard.  Change LRA is mine and I approved it for Iain's patch. I think there is no need for this code and it is misleading.  If 'mem[low_sum]' does not work, I don't think that

Re: [PATCH] c++: return-type-req in constraint using only outer tparms [PR104527]

2022-02-14 Thread Patrick Palka via Gcc-patches
On Mon, 14 Feb 2022, Patrick Palka wrote: > Here the template context for the atomic constraint has two levels of > template arguments, but since it depends only on the innermost argument > T we use a single-level argument vector during substitution into the > constraint (built by

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Richard Sandiford via Gcc-patches
Iain Sandoe writes: > Hi Richard, > > (hopefully, my take won’t cloud the issue ….) > >> On 14 Feb 2022, at 16:00, Richard Sandiford via Gcc-patches >> wrote: >> >> Hi Vlad, >> >> Vladimir Makarov via Gcc-patches writes: >>> On 2022-02-14 04:44, Richard Sandiford via Gcc-patches wrote:

[PATCH] c++: return-type-req in constraint using only outer tparms [PR104527]

2022-02-14 Thread Patrick Palka via Gcc-patches
Here the template context for the atomic constraint has two levels of template arguments, but since it depends only on the innermost argument T we use a single-level argument vector during substitution into the constraint (built by get_mapped_args). We eventually pass this vector to

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Iain Sandoe
Hi Richard, (hopefully, my take won’t cloud the issue ….) > On 14 Feb 2022, at 16:00, Richard Sandiford via Gcc-patches > wrote: > > Hi Vlad, > > Vladimir Makarov via Gcc-patches writes: >> On 2022-02-14 04:44, Richard Sandiford via Gcc-patches wrote: >>> Iain Sandoe via Gcc-patches

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Richard Sandiford via Gcc-patches
Hi Vlad, Vladimir Makarov via Gcc-patches writes: > On 2022-02-14 04:44, Richard Sandiford via Gcc-patches wrote: >> Iain Sandoe via Gcc-patches writes: >>> Two issues resulted in this PR, which manifests when we force a constant >>> into >>> memory in LRA (in PIC code on Darwin). The

Re: [PATCH] c: Add diagnostic when operator= is used as truth cond [PR25689]

2022-02-14 Thread Jason Merrill via Gcc-patches
On 2/12/22 01:59, Zhao Wei Liew wrote: On Fri, 11 Feb 2022 at 20:47, Jason Merrill wrote: On the other hand, for empty classes, it seems that a COMPOUND_EXPR is built in build_over_call under the is_really_empty_class guard (line 9791). I don't understand the tree structure that I should

[OG11][committed] amdgcn: Allow vector reductions on constants

2022-02-14 Thread Andrew Stubbs
On 14/02/2022 14:13, Andrew Stubbs wrote: I've committed this fix for an ICE compiling sollve_vv testcase test_target_teams_distribute_defaultmap.c. Somehow the optimizers result in a vector reduction on a vector of duplicated constants. This was a case the backend didn't handle, so we ended

Re: [PATCH, OpenACC] Add support for gang local storage allocation in shared memory

2022-02-14 Thread Thomas Schwinge
Hi Julian! Two more questions here, in context of "[12 Regression] ICE in expand_gimple_stmt_1, at cfgexpand.c:3932 since r12-980-g29a2f51806c": On 2019-06-03T17:02:45+0100, Julian Brown wrote: > This is a new version of the patch, rebased The code as we've now

Re: [Backport gcc-11, Patch, Fortran] PR100337 Should be able to pass non-present optional arguments to CO_BROADCAST

2022-02-14 Thread Andre Vehreschild via Gcc-patches
Hi everyone, sorry for missing out on the gcc-11 backport, but better late than never. Committed backport as ae57aae60d1. Regards, Andre On Wed, 23 Jun 2021 11:21:45 +0200 Tobias Burnus wrote: > On 23.06.21 10:23, Andre Vehreschild wrote: > > > Will wait two weeks for any errors

Re: [PATCH] vect+aarch64: Fix ldp_stp_* regressions

2022-02-14 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Mon, 14 Feb 2022, Richard Sandiford wrote: > >> ldp_stp_1.c, ldp_stp_4.c and ldp_stp_5.c have been failing since >> vectorisation was enabled at -O2. In all three cases SLP is >> generating vector code when scalar code would be better. >> >> The problem is that the

Re: [PATCH] c++: Don't reject GOTO_EXPRs to cdtor_label in potential_constant_expression_1 [PR104513]

2022-02-14 Thread Jason Merrill via Gcc-patches
On 2/14/22 04:54, Jakub Jelinek wrote: return in ctors on targetm.cxx.cdtor_returns_this () target like arm is emitted as GOTO_EXPR cdtor_label where at cdtor_label it emits RETURN_EXPR with the this. Similarly, in all dtors regardless of targetm.cxx.cdtor_returns_this () a return is emitted

Re: [PATCH] vect+aarch64: Fix ldp_stp_* regressions

2022-02-14 Thread Richard Biener via Gcc-patches
On Mon, 14 Feb 2022, Richard Sandiford wrote: > ldp_stp_1.c, ldp_stp_4.c and ldp_stp_5.c have been failing since > vectorisation was enabled at -O2. In all three cases SLP is > generating vector code when scalar code would be better. > > The problem is that the target costs do not model whether

[PATCH] vect+aarch64: Fix ldp_stp_* regressions

2022-02-14 Thread Richard Sandiford via Gcc-patches
ldp_stp_1.c, ldp_stp_4.c and ldp_stp_5.c have been failing since vectorisation was enabled at -O2. In all three cases SLP is generating vector code when scalar code would be better. The problem is that the target costs do not model whether STP could be used for the scalar or vector code, so the

Re: [PATCH] PR c/104506: Tolerate error_mark_node in useless_type_conversion_p.

2022-02-14 Thread Richard Biener via Gcc-patches
On Mon, Feb 14, 2022 at 4:31 PM Richard Biener wrote: > > On Mon, Feb 14, 2022 at 1:54 PM Roger Sayle > wrote: > > > > > > > > This simple fix to the middle-end, resolves PR c/104506, by adding an > > > > explicit check for error_mark_node to useless_type_conversion_p. I first > > > > trying

Re: [PATCH] PR c/104506: Tolerate error_mark_node in useless_type_conversion_p.

2022-02-14 Thread Richard Biener via Gcc-patches
On Mon, Feb 14, 2022 at 1:54 PM Roger Sayle wrote: > > > > This simple fix to the middle-end, resolves PR c/104506, by adding an > > explicit check for error_mark_node to useless_type_conversion_p. I first > > trying fixing this in the C front-end, but the type is valid at the point > > that the

Re: [Backport, committed, PR103970, Fortran, Coarray] Multi-image co_broadcast of derived type with allocatable components fails^

2022-02-14 Thread Andre Vehreschild via Gcc-patches
Hi all, two weeks have passed with no complains about the patch for PR103970. Therefore backported and pushed to gcc-11 as 680ee9c3332. Regards, Andre On Fri, 28 Jan 2022 12:39:17 +0100 Andre Vehreschild wrote: > Hi Tobias, > > I don't know why that bootstrapped initially. I fixed

Re: [PATCH 6/7] openmp, fortran: Add Fortran support for parsing metadirectives

2022-02-14 Thread Kwok Cheung Yeung
This patch (again, to be applied on top of the current set of metadirective patches) fixes two minor issues with metadirectives in the Fortran front-end. - 'sorry' is called if a declarative OpenMP directive is found in a metadirective clause. - An ICE that occurs with an empty metadirective

Re: [PATCH 6/7] openmp, fortran: Add Fortran support for parsing metadirectives

2022-02-14 Thread Kwok Cheung Yeung
> This patch implements metadirective parsing in the Fortran frontend. This patch (to be applied on top of the current set of metadirective patches) implements a feature that was present in the C and C++ front-ends but not in Fortran - the early culling of metadirective variants that can be

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Vladimir Makarov via Gcc-patches
On 2022-02-14 04:44, Richard Sandiford via Gcc-patches wrote: Iain Sandoe via Gcc-patches writes: Two issues resulted in this PR, which manifests when we force a constant into memory in LRA (in PIC code on Darwin). The presence of such forced constants is quite dependent on other RTL

[committed] amdgcn: Allow vector reductions on constants

2022-02-14 Thread Andrew Stubbs
I've committed this fix for an ICE compiling sollve_vv testcase test_target_teams_distribute_defaultmap.c. Somehow the optimizers result in a vector reduction on a vector of duplicated constants. This was a case the backend didn't handle, so we ended up with an unrecognised instruction ICE.

[PATCH] tree-optimization/104528 - free niter estimates after DSE

2022-02-14 Thread Richard Biener via Gcc-patches
When DSE removes a trivially dead def we have to reset niter information on loops since that might refer to it. The patch also adds verification to make sure this does not happen. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-02-14 Richard Biener PR

[committed] libstdc++: Use __cpp_concepts instead of custom macro [PR103891]

2022-02-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux (and clang-12.0.1), pushed to trunk. -- >8 -- With the new value of __cpp_concepts required by P2493, we can test whether the compiler supports conditionally trivial special members. This allows us to remove the workaround that disables fully-constexpr std::variant for Clang.

[PATCH] PR c/104506: Tolerate error_mark_node in useless_type_conversion_p.

2022-02-14 Thread Roger Sayle
This simple fix to the middle-end, resolves PR c/104506, by adding an explicit check for error_mark_node to useless_type_conversion_p. I first trying fixing this in the C front-end, but the type is valid at the point that the NOP_EXPR is created, so the poisoned type leaks to the

[committed] libstdc++: Fix typo in pragma

2022-02-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Fix typo. --- .../testsuite/20_util/unsynchronized_pool_resource/allocate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[committed] libstdc++: Fix std::to_chars for IEEE128 long double

2022-02-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc64le-linux with both ieee/ibm ABIs. Pushed to trunk. This should be backported to gcc-11 too. -- >8 -- The preprocessor check for _GLIBCXX_USE_FLOAT128 is the wrong condition, because when the compiler is built with --with-long-double-format=ieee configure

Re: [PATCH] ipa: Careful processing ANCESTOR jump functions and NULL pointers (PR 103083)

2022-02-14 Thread Martin Jambor
Hello Honza, On Mon, Dec 13 2021, Jan Hubicka wrote: >> >>> + || (only_for_nonzero && >> >>> !src_lats->bits_lattice.known_nonzero_p ())) >> >>> +{ >> >>> + if (jfunc->bits) >> >>> +return dest_lattice->meet_with (jfunc->bits->value, >> >>> +

[PATCH] tree-optimization/104511 - avoid FP to DFP conversion for VEC_PACK_TRUNC

2022-02-14 Thread Richard Biener via Gcc-patches
This avoids forwprop from matching DFP <-> FP vector conversions using VEC_[UN]PACK{_TRUNC,_LO,_HI}. Maybe DFP vectors shouldn't be a thing, but they appearantly are. Re-using CONVERT/NOP_EXPR for DFP <-> FP conversions was probably a mistake. Bootstrapped and tested on

[PATCH] c++: Don't reject GOTO_EXPRs to cdtor_label in potential_constant_expression_1 [PR104513]

2022-02-14 Thread Jakub Jelinek via Gcc-patches
Hi! return in ctors on targetm.cxx.cdtor_returns_this () target like arm is emitted as GOTO_EXPR cdtor_label where at cdtor_label it emits RETURN_EXPR with the this. Similarly, in all dtors regardless of targetm.cxx.cdtor_returns_this () a return is emitted similarly.

Re: [pushed] LRA, rs6000, Darwin: Amend lo_sum use for forced constants [PR104117].

2022-02-14 Thread Richard Sandiford via Gcc-patches
Iain Sandoe via Gcc-patches writes: > Two issues resulted in this PR, which manifests when we force a constant into > memory in LRA (in PIC code on Darwin). The presence of such forced constants > is quite dependent on other RTL optimisations, and it is easy for the issue to > become latent for

Re: [PATCH] c/104505 - ICE with internal function call in diagnostic expression

2022-02-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 14, 2022 at 10:32:52AM +0100, Richard Biener wrote: > The following handles internal function calls similar to how the > C++ frontend does, avoiding ICEing on those. > > Bootstrapped and tested on x86_64-unkown-linux-gnu, OK? > > Thanks, > Richard. > > 2022-02-14 Richard Biener >

[PATCH] c/104505 - ICE with internal function call in diagnostic expression

2022-02-14 Thread Richard Biener via Gcc-patches
The following handles internal function calls similar to how the C++ frontend does, avoiding ICEing on those. Bootstrapped and tested on x86_64-unkown-linux-gnu, OK? Thanks, Richard. 2022-02-14 Richard Biener PR c/104505 gcc/c-family/ * c-pretty-print.cc

Re: [PATCH] middle-end/104497 - gimplification of vector indexing

2022-02-14 Thread Richard Biener via Gcc-patches
On Fri, 11 Feb 2022, Jason Merrill wrote: > On 2/11/22 06:26, Richard Biener wrote: > > The following attempts to address gimplification of > > > > ... = VIEW_CONVERT_EXPR((i & 1) != 0 ? inv : src)[i]; > > > > which is problematic since gimplifying the base object > > ? inv : src produces a