[PATCH] x86: Update -mtune=tremont

2021-12-08 Thread Cui,Lili via Gcc-patches
Hi Uros, This patch is to update mtune for tremont. Bootstrap is ok, and no regressions for i386/x86-64 testsuite. OK for master? Silvermont has a special handle in add_stmt_cost function, because it has in order SIMD pipeline. But for Tremont, its SIMD pipeline is out of order, remove

Re: [RFC] Overflow check in simplifying exit cond comparing two IVs.

2021-12-08 Thread Jiufu Guo via Gcc-patches
Richard Biener writes: > On Mon, 18 Oct 2021, Jiufu Guo wrote: > >> With reference the discussions in: >> https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574334.html >> https://gcc.gnu.org/pipermail/gcc-patches/2021-June/572006.html >>

Re: [PR103302] skip multi-word pre-move clobber during lra

2021-12-08 Thread Alexandre Oliva via Gcc-patches
On Dec 8, 2021, Jeff Law wrote: >> expr.c (emit_move_multi_word): Skip clobber during lra. > OK. I found a similar pattern of issuing clobbers for multi-word moves, but not when reload_in_progress, in expr.c:emit_move_complex_parts. I don't have a testcase, but I'm tempted to propose

Re: [PATCH] [i386]Add combine splitter to transform vashr/vlshr/vashl_optab to ashr/lshr/ashl_optab for const vector duplicate operand.

2021-12-08 Thread Hongtao Liu via Gcc-patches
On Wed, Dec 8, 2021 at 2:47 PM Haochen Jiang via Gcc-patches wrote: > > Hi, > > This patch add combine splitter to transform vashr/vlshr/vashl_optab to > ashr/lshr/ashl_optab for const vector duplicate operand. > > Regtested on x86_64-pc-linux-gnu. Ok for trunk? Ok. > > BRs, > Haochen > >

Re: [PR103097] tolerate reg-stack cross-block malformed asms

2021-12-08 Thread Alexandre Oliva via Gcc-patches
On Dec 8, 2021, Jeff Law wrote: > On 12/7/2021 7:00 PM, Alexandre Oliva via Gcc-patches wrote: >> PR target/103097 >> * reg-stack.c (convert_regs_1): Move any_malformed_asm >> resetting... >> (reg_to_stack): ... here. > So it's "stickier" after your change.  ie, instead of indicating if >

Re: [PR103302] skip multi-word pre-move clobber during lra

2021-12-08 Thread Alexandre Oliva via Gcc-patches
On Dec 8, 2021, Jeff Law wrote: > On 12/7/2021 10:37 PM, Alexandre Oliva via Gcc-patches wrote: >> expr.c (emit_move_multi_word): Skip clobber during lra. > OK.  Nit in the ChangeLog.  You forgot a '*' before the expr.c entry. Thanks, fixed. Here's what I'm installing momentarily.

Re: [PATCH] pragma: Update target option node when optimization changes [PR103515]

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 7:15 PM, Kewen.Lin via Gcc-patches wrote: Hi, For a function with optimize pragma, it's possible that the target options change as optimization options change. Now we create one optimization option node when parsing pragma optimize, but don't create target option node for

Re: [PATCH v3 1/7] ifcvt: Check if cmovs are needed.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: When if-converting multiple SETs and we encounter a swap-style idiom if (a > b) { tmp = c; // [1] c = d; d = tmp; } ifcvt should not generate a conditional move for the instruction at [1]. In order

Re: [PATCH v3 7/7] ifcvt: Run second pass if it is possible to omit a temporary.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: If one of the to-be-converted SETs requires the original comparison (i.e. in order to generate a min/max insn) but no other insn after it does, we can omit creating temporaries, thus facilitating costing. --- gcc/ifcvt.c | 33

Re: [PATCH v3 5/7] ifcvt: Try re-using CC for conditional moves.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: Following up on the previous patch, this patch makes noce_convert_multiple emit two cmov sequences: The same one as before and a second one that tries to re-use the existing CC. Then their costs are compared and the cheaper one is

Re: [PATCH 0/6] RFC: adding support to GCC for detecting trust boundaries

2021-12-08 Thread Segher Boessenkool
Hi! On Wed, Dec 08, 2021 at 07:06:30PM -0500, David Malcolm wrote: > On Mon, 2021-12-06 at 13:40 -0600, Segher Boessenkool wrote: > > Named address spaces are completely target-specific.  Defining them > > with > > a pragma like this does not allow you to set the pointer mode or > > anything

Re: [PATCH v3 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: Currently we only ever call emit_conditional_move with the comparison (as well as its comparands) we got from the jump. Thus, backends are going to emit a CC comparison for every conditional move that is being generated instead of

Re: [PATCH 0/6] RFC: adding support to GCC for detecting trust boundaries

2021-12-08 Thread David Malcolm via Gcc-patches
On Mon, 2021-12-06 at 13:40 -0600, Segher Boessenkool wrote: > On Mon, Dec 06, 2021 at 11:12:00AM -0700, Martin Sebor wrote: > > On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote: > > > Approach 1: Custom Address Spaces > > > = > > > > > > GCC's C frontend

[committed 2/4] d: Merge upstream dmd testsuite 568496d5b

2021-12-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D2 testsuite upstream dmd 568496d5b. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 568496d5b. --- gcc/testsuite/gdc.test/compilable/b19294.d

Re: [PATCH v3 3/7] ifcvt: Improve costs handling for noce_convert_multiple.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: When noce_convert_multiple is called the original costs are not yet initialized. Therefore, up to now, costs were only ever unfairly compared against COSTS_N_INSNS (2). This would lead to default_noce_conversion_profitable_p ()

Re: [PATCH v3 2/7] ifcvt: Allow constants for noce_convert_multiple.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: This lifts the restriction of not allowing constants for noce_convert_multiple. The code later checks if a valid sequence is produced anyway. --- gcc/ifcvt.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) Fine

Re: [PATCH v3 6/7] testsuite/s390: Add tests for noce_convert_multiple.

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: Add new s390-specific tests that check if we convert two SETs into two loads on condition. Remove the s390-specific target-check in gcc.dg/ifcvt-4.c. --- gcc/testsuite/gcc.dg/ifcvt-4.c| 2 +-

[committed] libstdc++: Fix undefined shift when _Atomic_word is 64-bit

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 19:27, Jonathan Wakely wrote: > > On Wed, 8 Dec 2021 at 19:21, Jonathan Wakely wrote: > > > > On Wed, 8 Dec 2021 at 19:17, Rainer Orth wrote: > > > > > > Hi Jonathan, > > > > > > > I've pushed this change to trunk now (it was posted and reviewed in > > > > stage 1, I just

Re: [PATCH 3/3] Fix loop split incorrect count and probability

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/7/2021 10:54 PM, Xionghu Luo via Gcc-patches wrote: In tree-ssa-loop-split.c, split_loop and split_loop_on_cond does two kind of split. split_loop only works for single loop and insert edge at exit when split, while split_loop_on_cond is not limited to single loop and insert edge at

Re: [PATCH 2/3] Fix incorrect loop exit edge probability [PR103270]

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/7/2021 10:54 PM, Xionghu Luo via Gcc-patches wrote: r12-4526 cancelled jump thread path rotates loop. It exposes a issue in profile-estimate when predict_extra_loop_exits, outer loop's exit edge is marked as inner loop's extra loop exit and set with incorrect prediction, then a hot

Re: [PATCH 1/3] loop-invariant: Don't move cold bb instructions to preheader in RTL

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/7/2021 10:54 PM, Xionghu Luo via Gcc-patches wrote: gcc/ChangeLog: * loop-invariant.c (find_invariants_bb): Check profile count before motion. (find_invariants_body): Add argument. OK jeff

[PATCH v4] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-08 Thread Marek Polacek via Gcc-patches
On Wed, Dec 08, 2021 at 03:09:00PM -0500, Jason Merrill wrote: > On 12/8/21 13:32, Marek Polacek wrote: > > On Wed, Dec 08, 2021 at 09:15:05AM -0500, Jason Merrill wrote: > > > On 12/7/21 19:25, Marek Polacek wrote: > > > > On Mon, Dec 06, 2021 at 04:44:06PM -0500, Jason Merrill wrote: > > > > >

Re: [PR103302] skip multi-word pre-move clobber during lra

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/7/2021 10:37 PM, Alexandre Oliva via Gcc-patches wrote: If we emit clobbers before multi-word moves during lra, we get confused if a copy ends up with input or output replaced with each other: the clobber then kills the previous set, and it gets deleted. This patch avoids emitting such

Re: [PATCH 0/6] RFC: adding support to GCC for detecting trust boundaries

2021-12-08 Thread David Malcolm via Gcc-patches
On Mon, 2021-12-06 at 11:12 -0700, Martin Sebor wrote: > On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote: > > [Crossposting between gcc-patches@gcc.gnu.org and > > linux-toolcha...@vger.kernel.org; sorry about my lack of kernel > > knowledge, in case of the following seems bogus] > > > >

Re: [PATCH] pch: Add support for relocation of the PCH data [PR71934]

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/8/2021 1:00 AM, Iain Sandoe wrote: On 7 Dec 2021, at 14:50, Jakub Jelinek via Gcc-patches wrote: On Tue, Dec 07, 2021 at 10:55:07AM +0100, Jakub Jelinek via Gcc-patches wrote: So, this patch instead builds a relocation table (sorted list of addresses in the blob which needs

Re: [PATCH] pch: Add support for relocation of the PCH data [PR71934]

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/7/2021 2:55 AM, Jakub Jelinek wrote: Hi! The following patch adds support for relocation of the PCH blob on PCH restore if we don't manage to get the preferred map slot for it. The GTY stuff knows where all the pointers are, after all it relocates it once during PCH save from the

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-08 Thread Andrew MacLeod via Gcc-patches
On 12/2/21 08:46, Richard Biener wrote: On Thu, Dec 2, 2021 at 2:10 PM Martin Liška wrote: On 12/2/21 13:01, Richard Biener wrote: On Thu, Dec 2, 2021 at 12:45 PM Martin Liška wrote: On 12/1/21 19:21, Andrew MacLeod wrote: On 12/1/21 09:48, Martin Liška wrote: On 12/1/21 15:34, Richard

Re: [PATCH] D: fix UBSAN

2021-12-08 Thread Iain Buclaw via Gcc-patches
Excerpts from Martin Liška's message of December 6, 2021 1:03 pm: > Fixes: > gcc/d/expr.cc:2596:9: runtime error: null pointer passed as argument 2, which > is declared to never be null > > Ready for master? > Thanks, > Martin > Looks reasonable to me. Iain.

[PATCH, committed] PR fortran/103609 - [11/12 Regression] ICE in gfc_sym_get_dummy_args, at fortran/symbol.c:5243

2021-12-08 Thread Harald Anlauf via Gcc-patches
Dear all, the attached patch fixes a NULL pointer dereference for a missed declaration of a dummy argument or a conflict of a procedure with another decl. Committed as obvious after regtesting on x86_64-pc-linux-gnu: commit r12-5847-gb77968a70537429b4f548f90c369d26e6b6943cc Author: Harald

Re: [PATCH v3] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-08 Thread Jason Merrill via Gcc-patches
On 12/8/21 13:32, Marek Polacek wrote: On Wed, Dec 08, 2021 at 09:15:05AM -0500, Jason Merrill wrote: On 12/7/21 19:25, Marek Polacek wrote: On Mon, Dec 06, 2021 at 04:44:06PM -0500, Jason Merrill wrote: Please also make this change to cp_parser_sizeof_operand, and add tests involving

Re: [PATCH v2 3/5] fix up compute_objsize: factor out PHI handling

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 10:32 AM, Martin Sebor wrote: Attached is subset of the patch in part (4) below: factor out PHI handling.  It applies on top of patch 3/5. On 12/3/21 5:00 PM, Jeff Law wrote: On 11/8/2021 7:34 PM, Martin Sebor via Gcc-patches wrote: The pointer-query code that implements

[pushed] libgcc, Darwin: Build a libgcc_s.1 for backwards compatibility.

2021-12-08 Thread Iain Sandoe via Gcc-patches
In order to reslve a long-standing issue with inter-operation with libSystem, we have bumped the SO name for libgcc_s. Distributions might wish to install this new version into a structure where exisiting code is already linked with the compiler-local libgcc_s.1 (providing symbols exported by the

[pushed] Darwin: Amend pie options when linking mdynamic-no-pic.

2021-12-08 Thread Iain Sandoe via Gcc-patches
On i686 Darwin from macOS 10.7 onwards the default is to link executables as PIE, which conflicts with code generated using mdynamic-no-pic. Rather than warn about this and then get the user to add -Wl,-no_pie, we can inject this in the link specs. tested on i686,powerpc-darwin9,i686-darwin17,

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 19:21, Jonathan Wakely wrote: > > On Wed, 8 Dec 2021 at 19:17, Rainer Orth wrote: > > > > Hi Jonathan, > > > > > I've pushed this change to trunk now (it was posted and reviewed in > > > stage 1, I just didn't get around to pushing it until now). > > > > > > The final version

Re: [PATCH] pru: Fixup flags for .pru_irq_map section

2021-12-08 Thread Dimitar Dimitrov
On Fri, Dec 03, 2021 at 11:33:48PM +0200, Dimitar Dimitrov wrote: > I intend to merge this patch next week, unless I hear objections. I > consider it a bug fix which fits the Stage 3 criteria. It fixes the > RPMSG firmware examples in the latest version 6.0 of TI's PRU Software > Package. > >

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 19:17, Rainer Orth wrote: > > Hi Jonathan, > > > I've pushed this change to trunk now (it was posted and reviewed in > > stage 1, I just didn't get around to pushing it until now). > > > > The final version of the patch is attached to this mail. > > unfortunately, it breaks

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-12-08 Thread Rainer Orth
Hi Jonathan, > I've pushed this change to trunk now (it was posted and reviewed in > stage 1, I just didn't get around to pushing it until now). > > The final version of the patch is attached to this mail. unfortunately, it breaks Solaris/SPARC bootstrap: In file included from

Re: [PATCH v2 5/5] fix up compute_objsize: add a dump function

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 10:32 AM, Martin Sebor wrote: Attached is the subset of the patch in part (5) below: Add a new dump function.  It applies on top of patch 4/5. On 12/3/21 5:00 PM, Jeff Law wrote: On 11/8/2021 7:34 PM, Martin Sebor via Gcc-patches wrote: The pointer-query code that implements

Re: [PATCH v2 4/5] fix up compute_objsize: refactor it into helpers

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 10:32 AM, Martin Sebor wrote: Attached is the subset of the patch in part (2) below: refactor compute_objsize_r into helpers.  It applies on top of patch 3/5. On 12/3/21 5:00 PM, Jeff Law wrote: On 11/8/2021 7:34 PM, Martin Sebor via Gcc-patches wrote: The pointer-query code

[COMMITTED] bpf: avoid potential NULL pointer dereference

2021-12-08 Thread David Faust via Gcc-patches
[Committed as obvious.] If the result from SSA_NAME_DEF_STMT is NULL, we could try to dereference it anyway and ICE. Avoid this. gcc/ChangeLog: * config/bpf/bpf.c (handle_attr_preserve): Avoid calling is_gimple_assign with a NULL pointer. --- gcc/config/bpf/bpf.c | 2 +- 1 file

Re: [PATCH v2 2/5] fix up compute_objsize: pass GIMPLE statement to it

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 10:31 AM, Martin Sebor wrote: Attached is the subset of the patch in part (3) below: Pass GIMPLE statement to compute_objsize.  It applies on top of patch 1/5. On 12/3/21 5:00 PM, Jeff Law wrote: On 11/8/2021 7:34 PM, Martin Sebor via Gcc-patches wrote: The pointer-query

Re: [PATCH v2 1/5] fix up compute_objsize: move bndrng into access_data

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/6/2021 10:31 AM, Martin Sebor wrote: Attached is the subset of the patch in part (1) below:  Move bndrng from access_ref to access_data. On 12/3/21 5:00 PM, Jeff Law wrote: On 11/8/2021 7:34 PM, Martin Sebor via Gcc-patches wrote: The pointer-query code that implements

[r12-5832 Regression] FAIL: g++.target/i386/pr100738-1.C -std=gnu++98 scan-assembler-times vblendvps[ \\t] 2 on Linux/x86_64

2021-12-08 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 691f05c2197a7b79cb2d7fdbabe3182e22da320a is the first bad commit commit 691f05c2197a7b79cb2d7fdbabe3182e22da320a Author: Haochen Jiang Date: Thu Dec 2 15:30:17 2021 +0800 Add combine splitter to transform vpcmpeqd/vpxor/vblendvps to vblendvps for ~op0 caused FAIL:

[r12-5835 Regression] FAIL: libgomp.c++/target-this-4.C execution test on Linux/x86_64

2021-12-08 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 0ab29cf0bb68960c1f87405f14b4fb2109254e2f is the first bad commit commit 0ab29cf0bb68960c1f87405f14b4fb2109254e2f Author: Chung-Lin Tang Date: Wed Dec 8 22:28:03 2021 +0800 openmp: Improve OpenMP target support for C++ (PR92120) caused FAIL: libgomp.c++/target-lambda-1.C

Re: [PATCH v3] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-08 Thread Marek Polacek via Gcc-patches
On Wed, Dec 08, 2021 at 09:15:05AM -0500, Jason Merrill wrote: > On 12/7/21 19:25, Marek Polacek wrote: > > On Mon, Dec 06, 2021 at 04:44:06PM -0500, Jason Merrill wrote: > > > Please also make this change to cp_parser_sizeof_operand, and add tests > > > involving sizeof/alignof in array bounds.

Re: [PATCH] Use -fopt-info in unswitch pass.

2021-12-08 Thread Martin Liška
On 12/8/21 16:23, Richard Biener wrote: Likewise. Otherwise looks OK. Fine, I fixed all the notes and installed the patch as df704591a2cad3526456aa77be403d21c822724d. Cheers, Martin

Re: [PATCH] libstdc++: Allow std::condition_variable waits to be cancelled [PR103382]

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 17:36, Ville Voutilainen wrote: > > On Wed, 8 Dec 2021 at 19:27, Jonathan Wakely via Libstdc++ > wrote: > > After resolving a PEBKAC issue, here's an incremental diff that > > preserves the old behaviour for the existing @GLIBCXX_3.4.11 symbol, > > but adds a new

Re: [PATCH] enable -Winvalid-memory-order for C++ [PR99612]

2021-12-08 Thread Martin Sebor via Gcc-patches
On 12/8/21 10:14 AM, Jonathan Wakely wrote: On Wed, 8 Dec 2021 at 16:49, Martin Sebor wrote: I don't anticipate this change to lead to the same fallout because it's unlikely for GCC to synthesize invalid memory orders out of thin air; Agreed. I don't think we'll have the same kind of issues.

Re: [PATCH] libstdc++: Allow std::condition_variable waits to be cancelled [PR103382]

2021-12-08 Thread Ville Voutilainen via Gcc-patches
On Wed, 8 Dec 2021 at 19:27, Jonathan Wakely via Libstdc++ wrote: > After resolving a PEBKAC issue, here's an incremental diff that > preserves the old behaviour for the existing @GLIBCXX_3.4.11 symbol, > but adds a new @@GLIBCXX_3.4.30 symbol that supports cancellation via > __forced_unwind. > >

Re: [PATCH 2/2][GCC] arm: Declare MVE types internally via pragma

2021-12-08 Thread Richard Earnshaw via Gcc-patches
On 08/12/2021 15:39, Murray Steele via Gcc-patches wrote: > Hi, > > Thank you for the feedback, I'll make the noted changes to the changelog and > add the missing end-of-namespace comments. > > On 08/12/2021 15:23, Richard Earnshaw wrote: > >> diff --git a/gcc/config/arm/arm-mve-builtins.def

Re: [PATCH] libstdc++: Allow std::condition_variable waits to be cancelled [PR103382]

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 00:36, Jonathan Wakely wrote: > > On Tue, 7 Dec 2021 at 21:52, Florian Weimer wrote: > > > > * Jonathan Wakely: > > > > > On Tue, 7 Dec 2021, 21:20 Florian Weimer via Libstdc++, > > > > > > wrote: > > > > > > * Jonathan Wakely via Libstdc: > > > > > > > If necessary we

Re: [PATCH] AArch64: Improve rotate patterns

2021-12-08 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Improve and generalize rotate patterns. Rotates by more than half the > bitwidth of a register are canonicalized to rotate left. Many existing > shift patterns don't handle this case correctly, so add rotate left to > the shift iterator and convert rotate left into ror

Re: [PATCH] enable -Winvalid-memory-order for C++ [PR99612]

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 16:49, Martin Sebor wrote: > I don't anticipate this change to lead to the same fallout > because it's unlikely for GCC to synthesize invalid memory > orders out of thin air; Agreed. I don't think we'll have the same kind of issues. 99% of uses of memory orders just use the

Re: [PR103097] tolerate reg-stack cross-block malformed asms

2021-12-08 Thread Jeff Law via Gcc-patches
On 12/7/2021 7:00 PM, Alexandre Oliva via Gcc-patches wrote: The testcase shows malformed asms in one block confuse reg-stack logic in another block. Moving the resetting of any_malformed_asm to the end of the pass enables it to take effect throughout the affected function. Regstrapped on

[PATCH] enable -Winvalid-memory-order for C++ [PR99612]

2021-12-08 Thread Martin Sebor via Gcc-patches
Even with -Wno-system-headers enabled, the -Winvalid-memory-order code tries to make sure calls to atomic functions with invalid memory orders are diagnosed even though the C atomic functions are defined as macros in the system header. The warning triggers at all optimization levels, including

[PATCH] AArch64: Improve rotate patterns

2021-12-08 Thread Wilco Dijkstra via Gcc-patches
Improve and generalize rotate patterns. Rotates by more than half the bitwidth of a register are canonicalized to rotate left. Many existing shift patterns don't handle this case correctly, so add rotate left to the shift iterator and convert rotate left into ror during assembly output. Add

Re: [PATCH][_GLIBCXX_DEBUG] Enhance std::erase_if for vector/deque

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Sun, 21 Nov 2021 at 11:26, François Dumont via Libstdc++ wrote: > > I tried to use the same approach I used for node based containers but > got ambiguity on erase calls. I think this simple version will do the work. > > libstdc++: [_GLIBCXX_DEBUG] Enhance std::erase_if for vector/deque >

Re: [patch, Fortran] IEEE support for aarch64-apple-darwin

2021-12-08 Thread Richard Earnshaw via Gcc-patches
On 08/12/2021 15:47, FX via Gcc-patches wrote: Hi Richard, This isn't a full review, but I do have a question: is this really specific to Darwin? or is it really generic aarch64 code? If the former, then the file name is not right and it should reflect the darwin-specific nature of the

Re: [patch, Fortran] IEEE support for aarch64-apple-darwin

2021-12-08 Thread FX via Gcc-patches
Hi Richard, > This isn't a full review, but I do have a question: is this really specific > to Darwin? or is it really generic aarch64 code? If the former, then the > file name is not right and it should reflect the darwin-specific nature of > the contents. If the latter, then I wonder why

Re: [PATCH] nvptx: Use cvt to perform sign-extension of truncation.

2021-12-08 Thread Tom de Vries via Gcc-patches
On 8/27/21 12:07 PM, Roger Sayle wrote: > > This patch introduces some new define_insn rules to the nvptx backend, > to perform sign-extension of a truncation (from and to the same mode), > using a single cvt instruction. As an example, the following function > > int foo(int x) { return

Re: [PATCH 2/2][GCC] arm: Declare MVE types internally via pragma

2021-12-08 Thread Murray Steele via Gcc-patches
Hi, Thank you for the feedback, I'll make the noted changes to the changelog and add the missing end-of-namespace comments. On 08/12/2021 15:23, Richard Earnshaw wrote: > diff --git a/gcc/config/arm/arm-mve-builtins.def > b/gcc/config/arm/arm-mve-builtins.def > new file mode 100644 > index >

Re: [patch, Fortran] IEEE support for aarch64-apple-darwin

2021-12-08 Thread Richard Earnshaw via Gcc-patches
On 06/12/2021 16:32, FX via Gcc-patches wrote: Hi everyone, Since support for target aarch64-apple-darwin has been submitted for review, it’s time to submit the Fortran part, i.e. enabling IEEE support on that target. The patch has been in use now for several months, in a developer branch

Re: [PATCH 2/2][GCC] arm: Declare MVE types internally via pragma

2021-12-08 Thread Richard Earnshaw via Gcc-patches
On 25/11/2021 09:42, Murray Steele via Gcc-patches wrote: Changes from original patch: 1. Merged test_redef_* test files into one 2. Encapsulated contents of arm-mve-builtins.h in namespace arm_mve (missed in initial patch). 3. Added extern declarations for scalar_types and acle_vector

Re: [PATCH] Use -fopt-info in unswitch pass.

2021-12-08 Thread Richard Biener via Gcc-patches
On December 8, 2021 10:32:20 AM GMT+01:00, "Martin Liška" wrote: >The patch is about porting of dump information to -fopt-info so >that we can compare the current pass with a modified one. > >Right now, there are 1945 'optimized: Unswitching loop on condition' lines >for SPEC 2006 benchmark. >

Re: [PATCH v3] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-08 Thread Jason Merrill via Gcc-patches
On 12/7/21 19:25, Marek Polacek wrote: On Mon, Dec 06, 2021 at 04:44:06PM -0500, Jason Merrill wrote: Please also make this change to cp_parser_sizeof_operand, and add tests involving sizeof/alignof in array bounds. OK with that change. Turns out we reject sizeof(auto(4)) because

Re: [PATCH] c++: Support (x) == (y) and typeid(x) == typeid(y) in constant evaluation [PR103600]

2021-12-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Dec 2021 at 13:53, Jason Merrill wrote: > During constant evaluation, the operator== could compare the type_info > address instead of the __name address, reducing this to the previous > problem. That makes sense to me. We might still want the libstdc++ changes in case other compilers

Re: [PATCH] c++: Support (x) == (y) and typeid(x) == typeid(y) in constant evaluation [PR103600]

2021-12-08 Thread Jason Merrill via Gcc-patches
On 12/8/21 05:35, Jakub Jelinek wrote: Hi! If the tinfo vars are emitted in the current TU, they are emitted at the end of the compilation, and for some types they are exported from libstdc++/libsupc++ and not emitted in the current TU at all. The following patch allows constant folding of

Re: [PATCH] testsuite: Use attribute "noipa" in sibcall tests

2021-12-08 Thread Richard Sandiford via Gcc-patches
Hans-Peter Nilsson via Gcc-patches writes: > ...instead of attribute "noinline". > > For cris-elf, testsuite/gcc.dg/sibcall-3.c and sibcall-4.c "XPASS", > without sibcalls being implemented. On inspection, recurser_void2 is > set to be an assembly-level alias for recurser_void1 as in > ".set

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-12-08 Thread Jonathan Wakely via Gcc-patches
I've pushed this change to trunk now (it was posted and reviewed in stage 1, I just didn't get around to pushing it until now). The final version of the patch is attached to this mail. Thanks for the nice optimization, Maged! On Wed, 4 Aug 2021 at 20:49, Maged Michael via Libstdc++ wrote: > >

Re: [PATCH] [2/2] arm: add arm bti pass

2021-12-08 Thread Richard Earnshaw via Gcc-patches
On 05/11/2021 08:55, Andrea Corallo via Gcc-patches wrote: Hi all, this patch enables Branch Target Identification Armv8.1-M Mechanism [1]. This is achieved by moving and generalizing the Aarch64 "bti" pass so it can be used also by the Arm backend. The pass iterates through the

Re: [PATCH] [1/2] arm: Implement cortex-M return signing address codegen

2021-12-08 Thread Richard Earnshaw via Gcc-patches
On 05/11/2021 08:52, Andrea Corallo via Gcc-patches wrote: Hi all, this patch enables address return signature and verification based on Armv8.1-M Pointer Authentication [1]. To sign the return address, we use the PAC R12, LR, SP instruction upon function entry. This is signing LR using SP

[PATCH] c++: Support (x) == (y) and typeid(x) == typeid(y) in constant evaluation [PR103600]

2021-12-08 Thread Jakub Jelinek via Gcc-patches
Hi! If the tinfo vars are emitted in the current TU, they are emitted at the end of the compilation, and for some types they are exported from libstdc++/libsupc++ and not emitted in the current TU at all. The following patch allows constant folding of comparisons of typeid addresses and makes it

Re: [PATCH] [1/2] arm: Implement cortex-M return signing address codegen

2021-12-08 Thread Andrea Corallo via Gcc-patches
Andrea Corallo via Gcc-patches writes: > Andrea Corallo via Gcc-patches writes: > >> Hi all, >> >> this patch enables address return signature and verification based on >> Armv8.1-M Pointer Authentication [1]. >> >> To sign the return address, we use the PAC R12, LR, SP instruction >> upon

[PING][PATCH 2/2][GCC] arm: Declare MVE types internally via pragma

2021-12-08 Thread Murray Steele via Gcc-patches
Hi, I'd like to ping this patch revision [1]. Thanks, Murray [1]: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585400.html --- On 25/11/2021 09:42, Murray Steele wrote: > Changes from original patch: > > 1. Merged test_redef_* test files into one > 2. Encapsulated contents of

Re: [PATCH] PR fortran/103418 - random_number() does not accept pointer, intent(in) array argument

2021-12-08 Thread Mikael Morin
On 07/12/2021 21:46, Harald Anlauf wrote: Hi Mikael, Am 07.12.21 um 21:17 schrieb Mikael Morin: Hello, On 05/12/2021 22:55, Harald Anlauf via Fortran wrote: Dear all, the check of dummy arguments with pointer attribute and INTENT(IN) was broken in the case the argument was passed to an

[PATCH] Use -fopt-info in unswitch pass.

2021-12-08 Thread Martin Liška
The patch is about porting of dump information to -fopt-info so that we can compare the current pass with a modified one. Right now, there are 1945 'optimized: Unswitching loop on condition' lines for SPEC 2006 benchmark. Moreover, I adjusted dump functions in profile-count.{ch} so that it

Re: Limit inlining functions called once

2021-12-08 Thread Bernhard Reutner-Fischer via Gcc-patches
On Tue, 7 Dec 2021 16:07:01 +0100 Jan Hubicka via Gcc-patches wrote: > Hi, > as dicussed in PR ipa/103454 there are several benchmarks that regresses > for -finline-functions-called once. Runtmes: > - tramp3d with -Ofast. 31% > - exchange2 with -Ofast 11-21% > - roms O2 9%-10% > - tonto

Re: [PATCH][GCC11] PR tree-optimization/103603 - Directly resolve range_of_stmt dependencies. (Port of PR 103231/103464)

2021-12-08 Thread Kito Cheng via Gcc-patches
Test result from RISC-V, tested on riscv64-unknown-elf and riscv64-unknown-linux-gnu with no regressions. Thanks :) On Wed, Dec 8, 2021 at 4:19 AM Andrew MacLeod via Gcc-patches wrote: > > The following patch is a slight rework of the 2 patches which flatten > rangers call stack. It needed

Re: [PATCH] pch: Add support for relocation of the PCH data [PR71934]

2021-12-08 Thread Iain Sandoe via Gcc-patches
> On 7 Dec 2021, at 14:50, Jakub Jelinek via Gcc-patches > wrote: > > On Tue, Dec 07, 2021 at 10:55:07AM +0100, Jakub Jelinek via Gcc-patches wrote: >> So, this patch instead builds a relocation table (sorted list of addresses >> in the blob which needs relocation) at PCH save time, stores it