[rs6000 PATCH] PR target/105991: Recognize PLUS and XOR forms of rldimi.

2022-06-16 Thread Roger Sayle
This patch addresses PR target/105991 where a change to prefer representing shifts and adds at the tree-level as multiplications, causes problems for the rldimi patterns in the powerpc backend. The issue is that rs6000.md models this pattern using IOR, and some variants that have the equivalent

[r13-1139 Regression] FAIL: 21_strings/basic_string/cons/char/105995.cc (test for excess errors) on Linux/x86_64

2022-06-16 Thread skpandey--- via Gcc-patches
On Linux/x86_64, 98a0d72a610a87e8e383d366e50253ddcc9a51dd is the first bad commit commit 98a0d72a610a87e8e383d366e50253ddcc9a51dd Author: Jonathan Wakely Date: Thu Jun 16 14:57:32 2022 +0100 libstdc++: Support constexpr global std::string for size < 15 [PR105995] caused FAIL:

[PATCH] libgompd: Fix sizes in OMPD support and add local ICVs finctions.

2022-06-16 Thread Mohamed Atef via Gcc-patches
libgomp/ChangeLog 2022-06-17 Mohamed Atef * ompd-helper.h (DEREFERENCE, ACCESS_VALUE): New macros. (gompd_get_proc_bind): Change the returned value from ompd_word_t to const char *. (gompd_get_max_task_priority): Fix format. (gompd_stringize_gompd_enabled): Removed. (gompd_get_gompd_enabled):

[committed] gimple-ssa-warn-access.cc: add missing auto_diagnostic_group

2022-06-16 Thread David Malcolm via Gcc-patches
Whilst working on SARIF output I noticed some places where followup notes weren't being properly associated with their warnings in gcc/gimple-ssa-warn-access.cc. Fixed thusly. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1147-g6ab98d8b58fe4d.

[committed] c-decl: fix "inform" grouping and conditionalization

2022-06-16 Thread David Malcolm via Gcc-patches
Whilst working on SARIF output I noticed some places where followup notes weren't being properly associated with their errors/warnings in c-decl.cc. Whilst fixing those I noticed some places where we "inform" after a "warning" without checking that the warning was actually emitted. Fixed the

[committed] analyzer: associate -Wanalyzer-va-arg-type-mismatch with CWE-686

2022-06-16 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1145-gf0da5f0a316131. gcc/analyzer/ChangeLog: * varargs.cc (va_arg_type_mismatch::emit): Associate the warning with CWE-686 ("Function Call With Incorrect Argument Type").

[committed] analyzer: associate -Wanalyzer-va-list-exhausted with CWE-685

2022-06-16 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1144-gf443024bca7c1a. gcc/analyzer/ChangeLog: * varargs.cc: Include "diagnostic-metadata.h". (va_list_exhausted::emit): Associate the warning with CWE-685 ("Function Call With Incorrect

[committed] analyzer: associate -Wanalyzer-double-fclose with CWE-1341

2022-06-16 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1143-g065d191893234c. gcc/analyzer/ChangeLog: * sm-file.cc (double_fclose::emit): Associate the warning with CWE-1341 ("Multiple Releases of Same Resource or Handle"). gcc/testsuite/ChangeLog:

Re: [PATCH RFA] ubsan: default to trap on unreachable at -O0 and -Og [PR104642]

2022-06-16 Thread Jakub Jelinek via Gcc-patches
On Thu, Jun 16, 2022 at 09:32:02PM +0100, Jonathan Wakely wrote: > It looks like clang has addressed this deficiency now: > > https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#usage Thanks, will study how it works tomorrow. Jakub

Re: [PATCH RFA] ubsan: default to trap on unreachable at -O0 and -Og [PR104642]

2022-06-16 Thread Jonathan Wakely via Gcc-patches
On Tue, 14 Jun 2022, 12:44 Jakub Jelinek, wrote: > On Mon, Jun 13, 2022 at 03:53:13PM -0400, Jason Merrill via Gcc-patches > wrote: > > When not optimizing, we can't do anything useful with unreachability in > > terms of code performance, so we might as well improve debugging by > turning > >

[pushed] opts: fix opts_set->x_flag_sanitize

2022-06-16 Thread Jason Merrill via Gcc-patches
While working on PR104642 I noticed this wasn't getting set. Tested x86_64-pc-linux-gnu, applying to trunk as obvious. gcc/ChangeLog: * opts.cc (common_handle_option) [OPT_fsanitize_]: Set opts_set->x_flag_sanitize. --- gcc/opts.cc | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] c: Extend the -Wpadded message with actual padding size

2022-06-16 Thread Vit Kabele
When the compiler warns about padding struct to alignment boundary, it now also informs the user about the size of the alignment that needs to be added to get rid of the warning. This removes the need of using pahole or similar tools, or manually determining the padding size. Tested on

Go patch committed: Skip stubs for ambiguous direct iface methods

2022-06-16 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend by Михаил Аблакатов (Mikhail Ablakatov) avoids generating stubs for ambiguous direct interface methods. The current implementation checks whether it has to generate a stub method for a promoted method of an embedded struct field in Type::build_stub_methods(). If the

[committed] libstdc++: Support constexpr global std::string for size < 15 [PR105995]

2022-06-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- I don't think this is required by the standard, but it's easy to support. libstdc++-v3/ChangeLog: PR libstdc++/105995 * include/bits/basic_string.h (_M_use_local_data): Initialize the entire SSO buffer. *

[committed] libstdc++: Apply r13-1096-g6abe341558abec change to vstring too [PR101482]

2022-06-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- As recently done for std::basic_string, __gnu_cxx::__versa_string equality comparisons can check lengths first for any character type and traits type, not only for std::char_traits. libstdc++-v3/ChangeLog: PR libstdc++/101482 *

Re: [PATCH 1/2]AArch64 Add fallback case using sdot for usdot

2022-06-16 Thread Richard Sandiford via Gcc-patches
Richard Sandiford via Gcc-patches writes: > Tamar Christina writes: >> Hi All, >> >> The usdot operation is common in video encoder and decoders including some of >> the most widely used ones. >> >> This patch adds a +dotprod version of the optab as a fallback for when you do >> have sdot but

c++: Elide inactive initializer fns from init array

2022-06-16 Thread Nathan Sidwell via Gcc-patches
There's no point adding no-op initializer fns (that a module might have) to the static initializer list. Also, we can add any objc initializer call to a partial initializer function and simplify some control flow. nathan -- Nathan SidwellFrom c970d0072e3f962afa278e28f918fdcd1b3e755c Mon Sep

[COMMITTED] Clear invariant bit for inferred ranges.

2022-06-16 Thread Andrew MacLeod via Gcc-patches
When checking the results of moving the vrp1 pass to ranger, we triggered a failure where a non-null was not being propagated properly by the ranger inferring code. When an ssa_name never occurs in an outgoing range in any block, it is marked as invariant and its range is not tracked in the

[COMMITTED] Propagator should call value_of_stmt.

2022-06-16 Thread Andrew MacLeod via Gcc-patches
When evaluating the LHS of a stmt, its more efficient/better to call value_of_stmt directly rather than value_of_expr.  The value_of_* routines are not quite as efficient as the range_of routines, plus value_of_expr will check if its a LHS, and invoke value_of_stmt if it is. This in fact

Re: [PATCH 1/2]AArch64 Add fallback case using sdot for usdot

2022-06-16 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > The usdot operation is common in video encoder and decoders including some of > the most widely used ones. > > This patch adds a +dotprod version of the optab as a fallback for when you do > have sdot but not usdot available. > > The fallback works by adding

Re: [PATCH][wwwdocs] gcc-13: add arm star-mc1 cpu

2022-06-16 Thread Gerald Pfeifer
On Thu, 16 Jun 2022, Chung-Ju Wu wrote: > Recently we added arm star-mc1 cpu support to upstream: > https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596379.html > > It would be great if we can describe it on gcc-13 changes.html as well. > Attached is the patch for gcc-wwwdocs repository.

[statistics.cc] Emit asm name of function with -fdump-statistics-asmname

2022-06-16 Thread Prathamesh Kulkarni via Gcc-patches
Hi, I just noticed -fdump-statistics supports asmname sub-option, which according to the doc states: "If DECL_ASSEMBLER_NAME has been set for a given decl, use that in the dump instead of DECL_NAME. Its primary use is ease of use working backward from mangled names in the assembly file." When

[PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-06-16 Thread Tamar Christina via Gcc-patches
Hi All, This optimizes the following sequence ((a < b) & c) | ((a >= b) & d) into (a < b ? c : d) & 1 for scalar. On vector we can omit the & 1. This changes the code generation from zoo2: cmp w0, w1 csetw0, lt csetw1, ge and w0, w0, w2

Re: [PATCH RFA] ubsan: default to trap on unreachable at -O0 and -Og [PR104642]

2022-06-16 Thread Jakub Jelinek via Gcc-patches
On Wed, Jun 15, 2022 at 04:38:49PM -0400, Jason Merrill wrote: > > I do not like doing it this way, -fsanitize-undefined-trap-on-error is > > (unfortunately for compatibility with llvm misdesign, users should have > > ways to control which of the enabled sanitizers should be handled which way, > >

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-16 Thread Martin Liška
On 6/16/22 10:00, Alexander Monakov wrote: > On Thu, 16 Jun 2022, Martin Liška wrote: > >> Hi. >> >> I'm sending updated version of the patch where I addressed the comments. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> Ready to be installed? > > I noticed a

Re: [PATCH] match.pd: Improve y == MIN || x < y optimization [PR105983]

2022-06-16 Thread Richard Biener via Gcc-patches
> Am 16.06.2022 um 11:14 schrieb Jakub Jelinek via Gcc-patches > : > > Hi! > > On the following testcase, we only optimize bar where this optimization > is performed at GENERIC folding time, but on GIMPLE it doesn't trigger > anymore, as we actually don't see > (bit_and (ne @1 min_value)

Re: [PATCH] libgompd: Fix sizes in OMPD support and add local ICVs finctions.

2022-06-16 Thread Jakub Jelinek via Gcc-patches
On Fri, Jun 10, 2022 at 05:56:37PM +0200, Mohamed Atef wrote: In the subject line, there is typo: finctions. should be functions. > libgomp/ChangeLog > > 2022-06-10 Mohamed Atef > > * ompd-helper.h (DEREFERENCE, ACCESS_VALUE): New macros. > * ompd-helper.c (gompd_get_nthread,

Re: [PATCH] match.pd: Fix up __builtin_mul_overflow_p signed type optimization [PR105984]

2022-06-16 Thread Richard Biener via Gcc-patches
> Am 16.06.2022 um 11:10 schrieb Jakub Jelinek : > > Hi! > > Earlier in the simplification pattern, we require that @0 has compatible > type to the type of IMAGPART_EXPR, but for @1 which is a non-zero constant > all we require is that it the constant fits into that type. > Later the code

RE: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to set the lowpart.

2022-06-16 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Monday, June 13, 2022 9:41 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to > set the lowpart. > > Tamar Christina writes: > > Hi

Re: [PATCH, rs6000] Use CC for BCD operations [PR100736]

2022-06-16 Thread Segher Boessenkool
Hi! On Thu, Jun 16, 2022 at 02:36:53PM +0800, HAO CHEN GUI wrote: > This patch uses CC instead of CCFP for all BCD operations. Thus, infinite > math flag has no impact on BCD operations. To support BCD overflow and > invalid coding, ordered and unordered are added into CC mode. This is wrong.

RE: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to set the lowpart.

2022-06-16 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Gcc-patches bounces+tamar.christina=arm@gcc.gnu.org> On Behalf Of Richard > Sandiford via Gcc-patches > Sent: Wednesday, June 15, 2022 12:36 PM > To: Jeff Law via Gcc-patches > Subject: Re: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to > set the

[PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-06-16 Thread Tamar Christina via Gcc-patches
Hi All, This patch adds support for three-way min/max recognition in phi-opts. Concretely for e.g. #include uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) { uint8_t xk; if (xc < xm) { xk = (uint8_t) (xc < xy ? xc : xy); } else { xk = (uint8_t) (xm < xy

[PATCH 1/2]middle-end: Simplify subtract where both arguments are being bitwise inverted.

2022-06-16 Thread Tamar Christina via Gcc-patches
Hi All, This adds a match.pd rule that drops the bitwwise nots when both arguments to a subtract is inverted. i.e. for: float g(float a, float b) { return ~(int)a - ~(int)b; } we instead generate float g(float a, float b) { return (int)a - (int)b; } We already do a limited version of this

[PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-06-16 Thread Tamar Christina via Gcc-patches
Hi All, For IEEE 754 floating point formats we can replace a sequence of alternative +/- with fneg of a wider type followed by an fadd. This eliminated the need for using a permutation. This patch adds a math.pd rule to recognize and do this rewriting. For void f (float *restrict a, float

[PATCH 2/2] Add SVE fallback case using sdot for usdot

2022-06-16 Thread Tamar Christina via Gcc-patches
Hi All, The usdot operation is common in video encoder and decoders including some of the most widely used ones. This patch adds a +dotprod version of the optab as a fallback for when you do have sdot but not usdot available. The fallback works by adding a bias to the unsigned argument to

[PATCH 1/2]AArch64 Add fallback case using sdot for usdot

2022-06-16 Thread Tamar Christina via Gcc-patches
Hi All, The usdot operation is common in video encoder and decoders including some of the most widely used ones. This patch adds a +dotprod version of the optab as a fallback for when you do have sdot but not usdot available. The fallback works by adding a bias to the unsigned argument to

Re: [PATCH v1 1/3] RISC-V: Split "(a & (1 << BIT_NO)) ? 0 : -1" to bexti + addi

2022-06-16 Thread Philipp Tomsich
Kito, Looks like this series fell by the wayside (possibly, because it didn't have a cover-letter and was easier to miss)? Thanks, Philipp. On Wed, 25 May 2022 at 00:52, Philipp Tomsich wrote: > > Consider creating a polarity-reversed mask from a set-bit (i.e., if > the bit is set, produce

RE: [PATCH 2/2][AArch32] Fix 128-bit sequential consistency atomic operations.

2022-06-16 Thread Tamar Christina via Gcc-patches
ping > -Original Message- > From: Tamar Christina > Sent: Wednesday, June 8, 2022 3:50 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Ramana Radhakrishnan > ; Richard Earnshaw > ; ni...@redhat.com; Kyrylo Tkachov > > Subject: [PATCH 2/2][AArch32] Fix 128-bit sequential consistency atomic >

RE: [PATCH 1/2]AArch64 Fix 128-bit sequential consistency atomic operations.

2022-06-16 Thread Tamar Christina via Gcc-patches
ping > -Original Message- > From: Tamar Christina > Sent: Wednesday, June 8, 2022 3:49 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH 1/2]AArch64 Fix 128-bit sequential consistency atomic >

[PATCH] match.pd: Improve y == MIN || x < y optimization [PR105983]

2022-06-16 Thread Jakub Jelinek via Gcc-patches
Hi! On the following testcase, we only optimize bar where this optimization is performed at GENERIC folding time, but on GIMPLE it doesn't trigger anymore, as we actually don't see (bit_and (ne @1 min_value) (ge @0 @1)) but (bit_and (ne @1 min_value) (le @1 @0)) genmatch handles :c modifier

[PATCH] match.pd: Fix up __builtin_mul_overflow_p signed type optimization [PR105984]

2022-06-16 Thread Jakub Jelinek via Gcc-patches
Hi! Earlier in the simplification pattern, we require that @0 has compatible type to the type of IMAGPART_EXPR, but for @1 which is a non-zero constant all we require is that it the constant fits into that type. Later the code checks if the constant is negative, because when min / max values are

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-16 Thread Alexander Monakov via Gcc-patches
On Thu, 16 Jun 2022, Martin Liška wrote: > Hi. > > I'm sending updated version of the patch where I addressed the comments. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? I noticed a typo (no objection on the substance on the patch from

Re: [PATCH V2]rs6000: Store complicated constant into pool

2022-06-16 Thread Jiufu Guo via Gcc-patches
Segher Boessenkool writes: Hi Segher! Thanks for your comments and suggestions!! > Hi! > > On Wed, Jun 15, 2022 at 04:19:41PM +0800, Jiufu Guo wrote: >> Segher Boessenkool writes: >> > Have you tried with different limits? >> I drafted cases(C code, and updated asm code) to test runtime costs

[PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-16 Thread Martin Liška
Hi. I'm sending updated version of the patch where I addressed the comments. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin include/ChangeLog: * plugin-api.h (enum linker_api_version): New enum.

[PATCH 2/3] lto-plugin: make claim_file_handler thread-safe

2022-06-16 Thread Martin Liška
lto-plugin/ChangeLog: * lto-plugin.c (plugin_lock): New lock. (claim_file_handler): Use mutex for critical section. (onload): Initialize mutex. --- lto-plugin/lto-plugin.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git

[PATCH 1/3] lto-plugin: support LDPT_GET_SYMBOLS_V3

2022-06-16 Thread Martin Liška
That supports skipping of an object file (LDPS_NO_SYMS). lto-plugin/ChangeLog: * lto-plugin.c (struct plugin_file_info): Add skip_file flag. (write_resolution): Write resolution only if get_symbols != LDPS_NO_SYMS. (all_symbols_read_handler): Ignore file if skip_file is

[PATCH][pushed] clang: fix -Wunused-parameter warning

2022-06-16 Thread Martin Liška
Fixes: gcc/cp/decl2.cc:158:54: warning: unused parameter 'entry' [-Wunused-parameter] --- gcc/cp/decl2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index a8f3e6e5fba..0c4492f7354 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@

[PATCH, rs6000] Use CC for BCD operations [PR100736]

2022-06-16 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch uses CC instead of CCFP for all BCD operations. Thus, infinite math flag has no impact on BCD operations. To support BCD overflow and invalid coding, ordered and unordered are added into CC mode. With CC, "ge" and "le" are converted to reverse comparison. So the invalid coding

Re: [PATCH] gengtype: do not skip char after escape sequnce

2022-06-16 Thread Martin Liška
On 6/1/22 17:14, Jeff Law via Gcc-patches wrote: > > > On 5/4/2022 1:14 PM, Martin Liška wrote: >> Right now, when a \$x escape sequence occures, the >> next character after $x is skipped, which is bogus. >> >> The code has very low coverage right now. >> >> Patch can bootstrap on

Re: [PATCH] Add operators / and * for profile_{count,probability}.

2022-06-16 Thread Martin Liška
PING^2 On 5/24/22 13:35, Martin Liška wrote: > PING^1 > > On 5/5/22 20:15, Martin Liška wrote: >> On 5/5/22 15:49, Jan Hubicka wrote: >>> Hi, The patch simplifies usage of the profile_{count,probability} types. Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Re: [PATCH] ipa-icf: skip variables with body_removed

2022-06-16 Thread Martin Liška
@Honza: PING On 5/20/22 09:46, Martin Liška wrote: > On 5/19/22 17:02, Jan Hubicka wrote: >>> Similarly to cgraph_nodes, it may happen that body_removed is set >>> during merging of symbols. >>> >>> PR ipa/105600 >>> >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

[PATCH][wwwdocs] gcc-13: add arm star-mc1 cpu

2022-06-16 Thread Chung-Ju Wu via Gcc-patches
Hi, Recently we added arm star-mc1 cpu support to upstream: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596379.html It would be great if we can describe it on gcc-13 changes.html as well. Attached is the patch for gcc-wwwdocs repository. Is it OK? Regards, jasonwucjFrom