[PATCH] rs6000: Guard bifs {un,}pack_{longdouble,ibm128} under hard float [PR103623]

2022-03-02 Thread Kewen.Lin via Gcc-patches
Hi, As PR103623 shows, it's a regression failure due to new built-in function framework, previously we guard __builtin_{un,}pack_{longdouble, ibm128} built-in functions under hard float, so they are unavailable with the given configuration. While with new bif infrastructure, it becomes available

Re: [PATCH, V2] Optimize signed DImode -> TImode on power10, PR target/104698

2022-03-02 Thread Segher Boessenkool
On Wed, Mar 02, 2022 at 03:54:29PM -0500, Michael Meissner wrote: > Optimize signed DImode -> TImode on power10. > On power10, GCC tries to optimize the signed conversion from DImode to > TImode by using the vextsd2q instruction. However to generate this > instruction, it would have to generate

[PATCH] call mark_dfs_back_edges() before testing EDGE_DFS_BACK [PR104761]

2022-03-02 Thread Martin Sebor via Gcc-patches
The -Wdangling-pointer code tests the EDGE_DFS_BACK but the pass never calls the mark_dfs_back_edges() function that initializes the bit (I didn't know about it). As a result the bit is not set when expected, which can cause false positives under the right conditions. The attached patch adds a

[PATCH v2] Add TARGET_MOVE_WITH_MODE_P

2022-03-02 Thread H.J. Lu via Gcc-patches
On Wed, Mar 02, 2022 at 09:51:26AM +0100, Richard Biener wrote: > On Tue, Mar 1, 2022 at 11:41 PM H.J. Lu via Gcc-patches > wrote: > > > > Add TARGET_FOLD_MEMCPY_MAX for the maximum number of bytes to fold memcpy. > > The default is > > > > MOVE_MAX * MOVE_RATIO (optimize_function_for_size_p

[PATCH, V2] Optimize signed DImode -> TImode on power10, PR target/104698

2022-03-02 Thread Michael Meissner via Gcc-patches
Optimize signed DImode -> TImode on power10. In comparison to the patch I submitted on February 25th, this patch changes the comments based on feedback from Will Schmidt, and I added 2 test cases, to test the conversion when the target registers are GPRs and when the target registers are Altivec

Re: [PATCH] Check if loading const from mem is faster

2022-03-02 Thread Segher Boessenkool
On Tue, Mar 01, 2022 at 10:28:57PM +0800, Jiufu Guo wrote: > Segher Boessenkool writes: > > No. insn_cost is only for correct, existing instructions, not for > > made-up nonsense. I created insn_cost precisely to get away from that > > aspect of rtx_cost (and some other issues, like, it is

Re: [PATCH] PR tree-optimization/83907: Improved memset handling in strlen pass.

2022-03-02 Thread Jeff Law via Gcc-patches
On 2/20/2022 9:51 AM, Roger Sayle wrote: This patch implements the missed optimization enhancement PR 83907, by handling memset with a constant byte value in tree-ssa's strlen optimization pass. Effectively, this treats memset(dst,'x',3) as it would memcpy(dst,"xxx",3). This patch also

Re: PING**3 - [PATCH] middle-end: Support ABIs that pass FP values as wider integers.

2022-03-02 Thread Jeff Law via Gcc-patches
On 2/28/2022 5:54 AM, Richard Biener via Gcc-patches wrote: On Mon, 28 Feb 2022, Tobias Burnus wrote: Ping**3 On 23.02.22 09:42, Tobias Burnus wrote: PING**2 for the ME review or at least comments to that patch, which fixes a build issue/ICE with nvptx Patch:

Re: [PATCH] Check if loading const from mem is faster

2022-03-02 Thread Jeff Law via Gcc-patches
On 3/1/2022 12:47 AM, Richard Biener via Gcc-patches wrote: On Tue, 1 Mar 2022, Jiufu Guo wrote: Segher Boessenkool writes: On Thu, Feb 24, 2022 at 09:50:28AM +0100, Richard Biener wrote: On Thu, 24 Feb 2022, Jiufu Guo wrote: And another thing as Segher pointed out, CSE is doing too

Re: [PATCH] x86: Limit PR 35513 tests to Linux

2022-03-02 Thread Jeff Law via Gcc-patches
On 3/1/2022 8:44 AM, H.J. Lu via Gcc-patches wrote: Limit PR 35513 tests to Linux since they fail on 32-bit Solaris/x86 with Solaris linker. PR testsuite/104725 * g++.target/i386/pr35513-1.C: Limit to Linux. * g++.target/i386/pr35513-2.C: Likewise. OK jeff

Re: [PATCH] tree: Fix up warn_deprecated_use [PR104627]

2022-03-02 Thread Jeff Law via Gcc-patches
On 3/1/2022 11:33 AM, Jakub Jelinek via Gcc-patches wrote: Hi! The r12-7287-g1b71bc7c8b18bd1b change improved the -Wdeprecated warning for C++, but regressed it for C, in particular in gcc.dg/deprecated.c testcase we now report a type that actually isn't deprecated as deprecated instead of

Re: Patch ping

2022-03-02 Thread Jeff Law via Gcc-patches
On 3/2/2022 2:47 AM, Jakub Jelinek wrote: Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590526.html PR104558 - when bypassing emit_push_insn for 0 sized arg, emit at least anti_adjust_stack for alignment pad if needed patch. So the issue is the stack

[PATCH] c++: naming a dependently-scoped template for CTAD [PR104641]

2022-03-02 Thread Patrick Palka via Gcc-patches
In order to be able to perform CTAD for a dependently-scoped template such as A::B in the testcase below, we need to permit a typename-specifier to resolve to a template as per [dcl.type.simple]/2, at least when it appears in a CTAD-enabled context. This patch implements this using a new tsubst

[PATCH] c++: Don't allow type-constraint auto(x) [PR104752]

2022-03-02 Thread Marek Polacek via Gcc-patches
104752 points out that template concept C = true; auto y = C auto(1); is ill-formed as per [dcl.type.auto.deduct]: "For an explicit type conversion, T is the specified type, which shall be auto." which doesn't allow type-constraint auto. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok

[PATCH] c++: Attribute deprecated/unavailable divergence

2022-03-02 Thread Marek Polacek via Gcc-patches
Attributes deprecated and unavailable are largely the same, except that the former produces a warning whereas the latter produces an error. So is_late_template_attribute should treat them the same. Confirmed by Iain that this divergence is not intentional:

Re: [PATCH][v2] openmp, fortran: Check that the type of an event handle in a detach clause is suitable [PR104131]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 02, 2022 at 05:22:21PM +, Kwok Cheung Yeung wrote: > I have updated the patch to catch array elements and structure components as > additional checks, in addition to checking that the variable is a scalar. > > The check has been moved to the end of resolve_omp_clauses as it is

[committed] d: Merge upstream dmd 423f19b41, druntime 100a608c, phobos a1f8c4c07.

2022-03-02 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 423f19b41, as well as the D runtime libraries with druntime 100a608c, and phobos a1f8c4c07. D Runtime changes: - Fix stdc.stdio bindings to not depend on druntime (PR104729). - Implement stdc.math for Solaris

[PATCH][v2] openmp, fortran: Check that the type of an event handle in a detach clause is suitable [PR104131]

2022-03-02 Thread Kwok Cheung Yeung
Hello I have updated the patch to catch array elements and structure components as additional checks, in addition to checking that the variable is a scalar. The check has been moved to the end of resolve_omp_clauses as it is more appropriate there. This gets rid of the additional

[PATCH][wwwdocs] Initial changes.html section for arm and aarch64

2022-03-02 Thread Kyrylo Tkachov via Gcc-patches
Hi all, This patch creates the arm and aarch64 sections in the changes.html page for GCC 12. Some features are common to both backends, so we use a shared section for those (like last year). This list is not complete, but should work fine for a start. feel free to tell me if you think

[PATCH] gomp: Various fixes for SVE types [PR101018]

2022-03-02 Thread Richard Sandiford via Gcc-patches
Various parts of the omp code checked whether the size of a decl was an INTEGER_CST in order to determine whether the decl was variable-sized or not. If it was variable-sized, it was expected to have a DECL_VALUE_EXPR replacement, as for VLAs. This patch uses poly_int_tree_p instead, so that

Re: [PATCH] eliminate mutex in fast path of __register_frame

2022-03-02 Thread Thomas Neumann via Gcc-patches
+// Common logic for version locks +struct version_lock +{ + // The lock itself + uintptr_t version_lock; +}; version_lock must not overflow, right? This means we need a wider counter on 32-bit, too. glibc contains a 62-bit counter that it uses for its own data structure. an overflow

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

2022-03-02 Thread Vladimir Makarov via Gcc-patches
On 2022-03-02 07:25, Alexandre Oliva wrote: Regstrapped on x86_64-linux-gnu, also tested on various riscv and arm targets (with gcc-11). Ok to install? Yes. Thank you on working this, Alex. for gcc/ChangeLog * lra-constraints.cc (undo_optional_reloads): Recognize and

Re: [PATCH] eliminate mutex in fast path of __register_frame

2022-03-02 Thread Florian Weimer via Gcc-patches
* Thomas Neumann: > +#ifndef HIDE_EXPORTS > +#pragma GCC visibility push(default) > +#endif All defined functions are static, right? Then this isn't necessary. > +// Common logic for version locks > +struct version_lock > +{ > + // The lock itself > + uintptr_t version_lock; > +};

Re: [PATCH] rtl-optimization/104686 - speedup IRA allocno conflict test

2022-03-02 Thread Vladimir Makarov via Gcc-patches
On 2022-03-02 03:58, Richard Biener wrote: In this PR allocnos_conflict_p takes 90% of the compile-time via the calls from update_conflict_hard_regno_costs. This is due to the high number of conflicts recorded in the dense bitvector representation. Fortunately we can take advantage of the

Re: OpenACC 'kernels' decomposition: Mark variables used in synthesized data clauses as addressable [PR100280]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 01, 2022 at 05:46:20PM +0100, Thomas Schwinge wrote: > OK to proceed in this way? With a suitable ChangeLog entry and one nit fixed yes. > --- gcc/omp-low.cc > +++ gcc/omp-low.cc > @@ -188,7 +188,7 @@ struct omp_context > static splay_tree all_contexts; > static int

Re: [PATCH]middle-end vect: add vect_float to pr102819 tests

2022-03-02 Thread Richard Biener via Gcc-patches
On Wed, 2 Mar 2022, Tamar Christina wrote: > Hi All, > > This adds a vect_float requirements to this tests to stop them from running on > targets that don't support float vectorization. > > Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? and GCC 11? OK. > > I would

[PATCH]middle-end vect: add vect_float to pr102819 tests

2022-03-02 Thread Tamar Christina via Gcc-patches
Hi All, This adds a vect_float requirements to this tests to stop them from running on targets that don't support float vectorization. Regtested on aarch64-none-linux-gnu and no issues. Ok for master? and GCC 11? I would normally have committed this as trivial but since I need GCC 11 too I've

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

2022-03-02 Thread Alexandre Oliva via Gcc-patches
On Mar 1, 2022, Alexandre Oliva wrote: > On Feb 23, 2022, Alexandre Oliva wrote: >> On Feb 21, 2022, Richard Biener wrote: Ok to revert commit r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb >>> OK. Please re-open the bug as appropriate. >> Thanks. I've reopened it. Here's what

Re: [PATCH][V2][middle-end/102276]Don't emit switch-unreachable warnings for -ftrivial-auto-var-init (PR102276)

2022-03-02 Thread Richard Biener via Gcc-patches
On Tue, 1 Mar 2022, Qing Zhao wrote: > Hi, > > This is the 2nd version of the patch based on the discussion on the initial > version. > > Compared to the previous version, the major changes in this version are: > > 1. Merged two patches into one; > 2. Re-organize the code to emit both

Re: [PATCH, v2] PR fortran/104573 - ICE in resolve_structure_cons, at fortran/resolve.cc:1299

2022-03-02 Thread Mikael Morin
Le 01/03/2022 à 23:18, Harald Anlauf via Fortran a écrit : I do hope I got you right.  The attached patch fixes your variant as well as the original testcase, and regtests fine. Just to be sure: is this what you were thinking of? Indeed, that’s what I had in mind. Nice, I didn’t expect that

Re: [PATCH] c, c++, c-family: -Wshift-negative-value and -Wshift-overflow* tweaks for -fwrapv and C++20+ [PR104711]

2022-03-02 Thread Richard Biener via Gcc-patches
On Wed, Mar 2, 2022 at 10:23 AM Jakub Jelinek via Gcc-patches wrote: > > Hi! > > As mentioned in the PR, different standards have different definition > on what is an UB left shift. They all agree on out of bounds (including > negative) shift count. > The rules used by ubsan are: > C99-C2x

Re: [PATCH] warn-access: Fix up check_pointer_uses [PR104715]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 01, 2022 at 12:07:49PM -0700, Martin Sebor wrote: > Thanks for the fix. It makes sense to me. Besides the test for > the false positives I would suggest to add one to verify that using > the first argument to a strstr() call is diagnosed if it's dangling > (both as is, as well as

[committed] testsuite: Fix up pr104637 testcase [PR104637]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! On Mon, Feb 28, 2022 at 04:49:08PM -0500, Vladimir Makarov via Gcc-patches wrote: > PR rtl-optimization/104637 > * gcc.target/i386/pr104637.c: New. This testcase FAILs everywhere for 3 reasons: 1) the testcase can't work on ia32, where sizeof (long double) == 12

Patch ping

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590526.html PR104558 - when bypassing emit_push_insn for 0 sized arg, emit at least anti_adjust_stack for alignment pad if needed patch. Thanks Jakub

C++ patch ping

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping the: https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590276.html PR102586 - reject __builtin_clear_padding on non-trivially-copyable types with one exception https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590641.html PR104568 - fix up constexpr evaluation

Re: [PATCH] cfg: Dump goto_locus if -fdump-*-*-blocks-details

2022-03-02 Thread Richard Biener via Gcc-patches
On Wed, 2 Mar 2022, Jakub Jelinek wrote: > Hi! > > When debugging the PR104589 issue, I've run into a problem that > goto_locus doesn't show up in the logs, so it wasn't clear if > the bug hasn't been introduced far earlier just by divergence > in goto_locus of some edge. > >

Re: [PATCH] cfgrtl: Fix up -g vs. -g0 code generation -flto differences in fixup_reorder_chain [PR104589]

2022-03-02 Thread Richard Biener via Gcc-patches
On Wed, 2 Mar 2022, Jakub Jelinek wrote: > Hi! > > This is similar to PR104237 and similarly to that, no testcase included > for the testsuite, as we don't have a framework to compile/link with > -g -flto and -g0 -flto and compare -fdump-final-insns= results from > the lto1 compilations. > >

[committed] testsuite: Add testcases for already fixed PR [PR100541]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! These testcases started failing with r12-630 and one of them got fixed with r12-4531 (aka PR102764 fix and r12-4616 further improved the fix) and the other went latent in r12-2591 (i.e. threader changes) and I believe was fixed for real by the PR102764 fix too. Regtested on x86_64-linux and

[PATCH] cfg: Dump goto_locus if -fdump-*-*-blocks-details

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! When debugging the PR104589 issue, I've run into a problem that goto_locus doesn't show up in the logs, so it wasn't clear if the bug hasn't been introduced far earlier just by divergence in goto_locus of some edge. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk, or for

[PATCH] cfgrtl: Fix up -g vs. -g0 code generation -flto differences in fixup_reorder_chain [PR104589]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! This is similar to PR104237 and similarly to that, no testcase included for the testsuite, as we don't have a framework to compile/link with -g -flto and -g0 -flto and compare -fdump-final-insns= results from the lto1 compilations. With -flto, whether two location_t compare equal or not and

[committed] strlen: Comment spelling fixes

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! This fixes some comment spelling bugs in tree-ssa-strlen.cc. Committed as obvious. 2022-03-02 Jakub Jelinek * tree-ssa-strlen.cc (strlen_pass::handle_assign, strlen_pass::before_dom_children): Comment spelling fixes. --- gcc/tree-ssa-strlen.cc.jj 2022-02-04

[committed] modref: Comment spelling fixes

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! This fixes some spelling mistakes in ipa-modref*. Committed as obvious. 2022-03-02 Jakub Jelinek * ipa-modref-tree.cc (modref_access_node::contains, modref_access_node::closer_pair_p, modref_access_node::insert, modref_access_node::insert_kill): Comment spelling

[PATCH] c, c++, c-family: -Wshift-negative-value and -Wshift-overflow* tweaks for -fwrapv and C++20+ [PR104711]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, different standards have different definition on what is an UB left shift. They all agree on out of bounds (including negative) shift count. The rules used by ubsan are: C99-C2x ((unsigned) x >> (uprecm1 - y)) != 0 then UB C++11-C++17 x < 0 || ((unsigned) x >>

[PATCH] rtl-optimization/104686 - speedup IRA allocno conflict test

2022-03-02 Thread Richard Biener via Gcc-patches
In this PR allocnos_conflict_p takes 90% of the compile-time via the calls from update_conflict_hard_regno_costs. This is due to the high number of conflicts recorded in the dense bitvector representation. Fortunately we can take advantage of the bitvector representation here and turn the O(n)

Re: [PATCH] Add TARGET_FOLD_MEMCPY_MAX

2022-03-02 Thread Richard Biener via Gcc-patches
On Tue, Mar 1, 2022 at 11:41 PM H.J. Lu via Gcc-patches wrote: > > Add TARGET_FOLD_MEMCPY_MAX for the maximum number of bytes to fold memcpy. > The default is > > MOVE_MAX * MOVE_RATIO (optimize_function_for_size_p (cfun)) > > For x86, it is MOVE_MAX to restore the old behavior before I know