[PATCH] [ICE] Check another epilog variable peeling case in vectorizable_nonlinear_induction.

2022-09-13 Thread liuhongt via Gcc-patches
In vectorizable_nonlinear_induction, r13-2503-gc13223b790bbc5 prevent variable peeling by only checking LOOP_VINFO_MASK_SKIP_NITERS (loop_vinfo). But when "!vect_use_loop_mask_for_alignment_p (loop_vinfo) && LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo) < 0", vectorizer will still do variable

[r13-2650 Regression] FAIL: g++.dg/modules/xtreme-header-2_a.H -std=c++2b (test for excess errors) on Linux/x86_64

2022-09-13 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, 5d84a4418aa962a715dc74998fea2a7de9d4042c is the first bad commit commit 5d84a4418aa962a715dc74998fea2a7de9d4042c Author: Patrick Palka Date: Tue Sep 13 11:18:14 2022 -0400 libstdc++: Implement ranges::chunk_view from P2442R1 caused FAIL:

[PATCH] xtensa: gcc: implement MI thunk generation for call0 ABI

2022-09-13 Thread Max Filippov via Gcc-patches
Suwa-san, could you please take a look? This change fixes the fowllowing testsuite failures when building for call0 ABI: g++.dg/ipa/pr60640-4.C g++.dg/ipa/pr83549.C g++.dg/ipa/pr83667.C g++.dg/torture/pr81812.C gcc/ * config/xtensa/xtensa.cc (xtensa_can_output_mi_thunk)

[PATCH v3 10/11] Use OMP_ARRAY_SECTION instead of TREE_LIST in C++ FE

2022-09-13 Thread Julian Brown
This patch changes the representation of OMP array sections in the C++ front end to use the new OMP_ARRAY_SECTION tree code instead of a TREE_LIST. This is important for "declare mapper" support, because the array section representation may stick around longer (in "declare mapper" definitions),

[PATCH v3 11/11] FYI/unfinished: OpenMP 5.0 "declare mapper" support for C++

2022-09-13 Thread Julian Brown
This patch implements OpenMP 5.0 "declare mapper" support for C++. This hasn't been fully revised yet following previous review comments, but I am including it in this series to demonstrate the new approach to gimplifying map clauses after "declare mapper" instantiation. The

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

2022-09-13 Thread Julian Brown
This patch was previously posted as part of the series supporting "declare mapper" for Fortran, here: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596041.html Implementing the "omp declare mapper" functionality, I noticed some cases where handling of derived type members that are

[PATCH v3 09/11] FYI/unfinished: OpenMP: lvalue parsing for map clauses (C++)

2022-09-13 Thread Julian Brown
This patch changes parsing for OpenMP map clauses in C++ to use the generic expression parser, hence adds support for parsing general lvalues (as required by OpenMP 5.0+). This patch hasn't been fully revised following previous review comments yet, but I'm including it in support of the following

[PATCH v3 07/11] OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause

2022-09-13 Thread Julian Brown
This patch trivially adds braces and reindents the OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza in c_finish_omp_clause and finish_omp_clause, in preparation for the following patch (to clarify the diff a little). 2022-09-13 Julian Brown gcc/c/ * c-typeck.cc

[PATCH v3 05/11] OpenMP: push attaches to end of clause list in "target" regions

2022-09-13 Thread Julian Brown
This patch moves GOMP_MAP_ATTACH{_ZERO_LENGTH_ARRAY_SECTION} nodes to the end of the clause list, for offload regions. This ensures that when we do the attach operation, both the "attachment point" and the target region have both already been mapped on the target. This avoids a pathological case

[PATCH v3 04/11] OpenMP/OpenACC: mapping group list-handling improvements

2022-09-13 Thread Julian Brown
This patch adjusts OpenMP/OpenACC clause list handling in a couple of places, in preparation for the following mapping-clause expansion rework patch. Firstly mapping groups are removed as a whole in the C and C++ front-ends when an error is detected, which avoids leaving "badly-formed" mapping

[PATCH v3 03/11] OpenMP/OpenACC struct sibling list gimplification extension and rework

2022-09-13 Thread Julian Brown
This patch refactors struct sibling-list processing in gimplify.cc, and adjusts some related mapping-clause processing in the Fortran FE and omp-low.cc accordingly. This version addresses some previous review comments, mostly with regards to the naming of local helper functions. (Previous

[PATCH v3 01/11] OpenMP 5.0: Clause ordering for OpenMP 5.0 (topological sorting by base pointer)

2022-09-13 Thread Julian Brown
This patch reimplements the omp_target_reorder_clauses function in anticipation of supporting "deeper" struct mappings (that is, with several structure dereference operators, or similar). The idea is that in place of the (possibly quadratic) algorithm in omp_target_reorder_clauses that greedily

[PATCH v3 02/11] Remove omp_target_reorder_clauses

2022-09-13 Thread Julian Brown
This patch has been split out from the previous one to avoid a confusingly-interleaved diff. The two patches will be committed squashed together. 2022-09-13 Julian Brown gcc/ * gimplify.c (omp_target_reorder_clauses): Delete. --- gcc/gimplify.cc | 205

[PATCH v3 00/11] OpenMP 5.0: Struct & mapping clause expansion rework

2022-09-13 Thread Julian Brown
This is a new version of the first few patches of the series (up to "Handle reference-typed struct members"): https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591973.html Relative to the previously-posted series, this version addresses several review comments, but more significantly it

Re: libgo patch committed: Make runtime.Version return a useful value

2022-09-13 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jun 28, 2022 at 10:20 AM Ian Lance Taylor wrote: > > This libgo patch makes runtime.Version return a meaningful string. > This also means that "go version" will print something useful, e.g., > > go version go1.18 gccgo (GCC) 12.0.1 20220216 (experimental) linux/amd64 > > This fixes

[PATCH] Optimize (X<

2022-09-13 Thread Roger Sayle
This patch tweaks the match.pd transformation previously added to fold (X< gcc/ChangeLog * match.pd (op (lshift @0 @1) (lshift @2 @1)): Optimize the expression (X

[PATCH] PR tree-optimization/71343: Value number X<<2 as X*4.

2022-09-13 Thread Roger Sayle
This patch is the second part of a fix for PR tree-optimization/71343, that implements Richard Biener's suggestion of using tree-ssa's value numbering instead of match.pd. The change is that when assigning a value number for the expression X< gcc/ChangeLog PR tree-optimization/71343

Re: [PATCH] c++: Implement P1467R9 - Extended floating-point types and standard names compiler part except for bfloat16 [PR106652]

2022-09-13 Thread Joseph Myers
On Mon, 12 Sep 2022, Jakub Jelinek via Gcc-patches wrote: > > We don't claim in glibc to support old snapshots from master, so checking > > for __GNUC_PREREQ (13, 0) and failing for such older GCC 13 versions is > > fine. > > Ok, makes sense, especially if it is applied on the glibc side a few

Re: libgo patch committed: Ignore __morestack in runtime.Callers

2022-09-13 Thread Ian Lance Taylor via Gcc-patches
On Tue, Sep 6, 2022 at 6:40 PM Ian Lance Taylor wrote: > > This libgo patch ignores the __morestack function in runtime.Callers. > We were ignoring all functions starting with "__morestack_", but not > the function "__morestack" itself. Without this change, some tests > such as recover.go

[committed] libgomp: Appease some static analyzers [PR106906]

2022-09-13 Thread Jakub Jelinek via Gcc-patches
Hi! While icv_addr[1] = false; assignments where icv_addr has void * element type is correct and matches how it is used (in those cases the void * pointer is then cast to bool and used that way), there is no reason not to add explicit (void *) casts there which are there already for (void *)

[PATCH] c++: Implement C++23 P1169R4 - static operator() [PR106651]

2022-09-13 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch attempts to implement C++23 P1169R4 - static operator() paper's compiler side (there is some small library side too not implemented yet). This allows static members as user operator() declarations and static specifier on lambdas without lambda capture. As decl specifier

[PATCH] LoongArch: Prepare static PIE support

2022-09-13 Thread Xi Ruoyao via Gcc-patches
Static PIE allows us to extend the ASLR to cover static executables and it's not too difficult to support it. On GCC side, we just pass a group of options to the linker, like other ports with static PIE support. The real implementation of static PIE (rcrt1.o) will be added into Glibc later.

[committed] c++: remove single-parameter version of mark_used

2022-09-13 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, committed to trunk as obvious. gcc/cp/ChangeLog: * cp-tree.h (mark_used): Remove single-parameter overload. Add default argument to the two-parameter overload. * decl2.cc (mark_used): Likewise. --- gcc/cp/cp-tree.h | 4 ++--

Re: [PATCH, libgomp] Fix chunk_size<1 for dynamic schedule

2022-09-13 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 04, 2022 at 09:17:09PM +0800, Chung-Lin Tang wrote: > On 2022/6/28 10:06 PM, Jakub Jelinek wrote: > > On Thu, Jun 23, 2022 at 11:47:59PM +0800, Chung-Lin Tang wrote: > > > with the way that chunk_size < 1 is handled for gomp_iter_dynamic_next: > > > > > > (1) chunk_size <= -1: wraps

Re: [PATCH] c++: some missing-SFINAE fixes

2022-09-13 Thread Jason Merrill via Gcc-patches
On 9/13/22 09:46, Patrick Palka wrote: On Tue, 13 Sep 2022, Jason Merrill wrote: On 9/13/22 07:45, Patrick Palka wrote: It looks like we aren't respecting SFINAE for: * an invalid/non-constant conditional explicit-specifier * a non-constant conditional noexcept-specifier * a

Re: [PATCH] c++: some missing-SFINAE fixes

2022-09-13 Thread Patrick Palka via Gcc-patches
On Tue, 13 Sep 2022, Jason Merrill wrote: > On 9/13/22 07:45, Patrick Palka wrote: > > It looks like we aren't respecting SFINAE for: > > > >* an invalid/non-constant conditional explicit-specifier > >* a non-constant conditional noexcept-specifier > >* a non-constant argument to

Re: [PATCH] c++: some missing-SFINAE fixes

2022-09-13 Thread Jason Merrill via Gcc-patches
On 9/13/22 07:45, Patrick Palka wrote: It looks like we aren't respecting SFINAE for: * an invalid/non-constant conditional explicit-specifier * a non-constant conditional noexcept-specifier * a non-constant argument to __integer_pack This patch fixes these issues in the usual way, by

[PATCH] c++: some missing-SFINAE fixes

2022-09-13 Thread Patrick Palka via Gcc-patches
It looks like we aren't respecting SFINAE for: * an invalid/non-constant conditional explicit-specifier * a non-constant conditional noexcept-specifier * a non-constant argument to __integer_pack This patch fixes these issues in the usual way, by passing complain and propagating

Re: [OG12][PATCH] openmp: Fix handling of target constructs in static member

2022-09-13 Thread Andrew Stubbs
On 13/09/2022 12:03, Paul-Antoine Arras wrote: Hello, This patch intends to backport e90af965e5c by Jakub Jelinek to devel/omp/gcc-12. The original patch was described here: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601189.html I've merged and committed it for you. Andrew

Re: [PATCH 2/2] xtensa: Implement new target hook: TARGET_CONSTANT_OK_FOR_CPROP_P

2022-09-13 Thread Max Filippov via Gcc-patches
On Mon, Sep 12, 2022 at 8:00 PM Takayuki 'January June' Suwa wrote: > On 2022/09/13 4:34, Max Filippov wrote: > > On Sun, Sep 11, 2022 at 1:50 PM Takayuki 'January June' Suwa > > wrote: > >> > >> This patch implements new target hook TARGET_CONSTANT_OK_FOR_CPROP_P in > >> order to exclude

Re: [PATCH 4/4] libstdc++: Implement ranges::slide_view from P2442R1

2022-09-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Sept 2022 at 17:48, Patrick Palka via Libstdc++ wrote: > > This also implements the LWG 3711 and 3712 changes to slide_view. OK, thanks.

Re: [PATCH 3/4] libstdc++: Implement ranges::chunk_view from P2442R1

2022-09-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Sept 2022 at 17:48, Patrick Palka via Libstdc++ wrote: > > This also implements the LWG 3707, 3710 and 3712 changes to chunk_view. > + > + template > +requires input_range<_Vp> > + class chunk_view<_Vp>::_OuterIter > + { > +chunk_view* _M_parent; > + > +constexpr

[OG12][PATCH] openmp: Fix handling of target constructs in static member

2022-09-13 Thread Paul-Antoine Arras
Hello, This patch intends to backport e90af965e5c by Jakub Jelinek to devel/omp/gcc-12. The original patch was described here: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601189.html Thanks, -- Paul-Antoine ArrasFrom c1fb6ff897d0b929807d52cf52d4894e252e7d96 Mon Sep 17 00:00:00

Re: [PATCH 2/4] libstdc++: Implement LWG 3569 changes to join_view::_Iterator

2022-09-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Sept 2022 at 17:46, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk only? I briefly wondered whether we could just use a union there and provide the special members to init/copy/destroy it properly, but we already use in so it's

Re: [PATCH] libstdc++: Squelch -Wparentheses warning with debug iterators

2022-09-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Sept 2022 at 18:40, Patrick Palka via Libstdc++ wrote: > > I noticed compiling e.g. std/ranges/adaptors/join.cc with > -D_GLIBCXX_DEBUG -Wsystem-headers -Wall gives the warning: > > gcc/libstdc++-v3/include/debug/safe_iterator.h:477:9: warning: suggest > parentheses around ‘&&’

Re: [PATCH] PR target/106877: Robustify reg-stack to malformed asm.

2022-09-13 Thread Uros Bizjak via Gcc-patches
On Tue, Sep 13, 2022 at 11:57 AM Roger Sayle wrote: > > > This patch resolves PR target/106877 an ICE-on-invalid inline-asm > regression. An innocent upstream change means that the test case > from PR inline-asm/84683 now hits a different assert in reg-stack.cc's > move_for_stack_reg. Fixed by

[PATCH] PR target/106877: Robustify reg-stack to malformed asm.

2022-09-13 Thread Roger Sayle
This patch resolves PR target/106877 an ICE-on-invalid inline-asm regression. An innocent upstream change means that the test case from PR inline-asm/84683 now hits a different assert in reg-stack.cc's move_for_stack_reg. Fixed by duplicating Jakub's solution to PR 84683

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

2022-09-13 Thread jiawei
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 this to assembler. V2: Add assembler support check info for -mcsr-check. Thanks for Kito's suggestions. gcc/ChangeLog: * config.in: New def.

[PATCH] middle-end/106909 - CTRL altering flag after folding

2022-09-13 Thread Richard Biener via Gcc-patches
The following makes sure to clear the CTRL altering flag when folding emits a __builitin_unreachable in place of a virtual call which now might become a trap. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR middle-end/106909 * gimple-fold.cc (gimple_fold_call):

[PATCH] tree-optimization/106913 - ICE with -da and -Wuninitialized

2022-09-13 Thread Richard Biener via Gcc-patches
The following avoids setting and not clearing an auto_bb_flag on EXIT_BLOCK which we don't verify for such stale flags but dump_bb_info still asserts on them. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106913 * tree-ssa-uninit.cc

[pushed] aarch64: Vector move fixes for +nosimd

2022-09-13 Thread Richard Sandiford via Gcc-patches
This patch fixes various issues around the handling of vectors and (particularly) vector structures with +nosimd. Previously, passing and returning structures would trigger an ICE, since: * we didn't allow the structure modes to be stored in FPRs * we didn't provide +nosimd move patterns *

[pushed] aarch64: Disassociate ls64 from simd

2022-09-13 Thread Richard Sandiford via Gcc-patches
The ls64-related move expanders and splits required TARGET_SIMD. That isn't necessary, since the 64-byte values are stored entirely in GPRs. (The associated define_insn was already correct.) I wondered about moving the patterns to aarch64.md, but it wasn't clear-cut. Tested on aarch64-linux-gnu

RE: [PATCH] Enhance final_value_replacement_loop to handle bitop with an invariant induction.[PR105735]

2022-09-13 Thread Kong, Lingling via Gcc-patches
Hi Richard, Thanks you so much for reviewing this patch. I really appreciate it. For these review comments, I have made some changes. > That's a single-stmt match, you shouldn't use match.pd matching for this. > Instead just do > > if (is_gimple_assign (stmt) > && ((code =

[committed] libgomp.texi: move item from gcn to nvptx

2022-09-13 Thread Tobias Burnus
Placed the reverse-offload -march=sm_30 vs. >=sm_35 remark accidentally to the 'gcn' section. The surrounding wording it very similar, hence, I did not spot it. Committed as r13-2636. Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634

Re: [PATCH v2, rs6000] Change insn condition from TARGET_64BIT to TARGET_POWERPC64 for VSX scalar extract/insert instructions

2022-09-13 Thread Iain Sandoe via Gcc-patches
Hi > On 13 Sep 2022, at 03:34, HAO CHEN GUI via Gcc-patches > wrote: > On 7/9/2022 上午 1:19, Segher Boessenkool wrote: >> make -k -j60 check >> RUNTESTFLAGS="--target_board=unix'{-m64,-m32,-m32/-mpowerpc64}'" >> >> It is fine to not test -m32/-mpowerpc64 so often, and certaionly not >>

Re: [Patch] libgomp/nvptx: Prepare for reverse-offload callback handling

2022-09-13 Thread Tobias Burnus
@Alexander/@Tom – Can you comment on both libgomp/config/nvptx + libgomp/plugin/plugin-nvptx.c ? (Comments on the rest are welcome, too) (Updated patch enclosed) Because Jakub asked: I'm afraid you need Alexander or Tom here, I don't feel I can review it; I could rubber stamp it if they are