[PATCH v3] loongarch: fix mulsidi3_64bit instruction

2022-07-08 Thread Xi Ruoyao via Gcc-patches
v3: Relax scan-assembler pattern in test case mulw_d_w.c. It's because multiplication is Abelian and the compiler may switch the order of operands in the future. -- >8 -- (mult (sign_extend:DI rj:SI) (sign_extend:DI rk:SI)) should be "mulw.d.w", not "mul.d". gcc/ChangeLog: * config/lo

Re: [PATCH][s390]: Fix the usage of store_bit_field in the backend.

2022-07-08 Thread Jeff Law via Gcc-patches
On 7/8/2022 6:10 AM, Tamar Christina via Gcc-patches wrote: Subject: [PATCH][s390]: Fix the usage of store_bit_field in the backend. From: Tamar Christina via Gcc-patches Date: 7/8/2022, 6:10 AM To: gcc-patches@gcc.gnu.org CC: n...@arm.com, uweig...@de.ibm.com Hi All, I seem to have broke

Re: Mips: Fix kernel_stat structure size

2022-07-08 Thread Xi Ruoyao via Gcc-patches
On Fri, 2022-07-08 at 21:42 -0400, Hans-Peter Nilsson wrote: > On Fri, 1 Jul 2022, Dimitrije Milosevic wrote: > > > Fix kernel_stat structure size for non-Android 32-bit Mips. > > LLVM currently has this value for the kernel_stat structure size, > > as per compiler-rt/lib/sanitizer- > > common/san

Re: Mips: Fix kernel_stat structure size

2022-07-08 Thread Hans-Peter Nilsson
On Fri, 1 Jul 2022, Dimitrije Milosevic wrote: > Fix kernel_stat structure size for non-Android 32-bit Mips. > LLVM currently has this value for the kernel_stat structure size, > as per compiler-rt/lib/sanitizer-common/sanitizer_platform_limits_posix.h. > This also resolves one of the build issues

[COMMITTED] Fix tree-opt/PR106087: ICE with inline-asm with multiple output and assigned only static vars

2022-07-08 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that when we mark the ssa name that was referenced in the now removed dead store (to a write only static variable), the inline-asm would also be removed even though it was defining another ssa name. This fixes the problem by checking to make sure that the

Re: [x86 PATCH] Fun with flags: Adding stc/clc instructions to i386.md.

2022-07-08 Thread Segher Boessenkool
Hi! On Fri, Jul 08, 2022 at 08:14:58AM +0100, Roger Sayle wrote: > This patch adds support for x86's single-byte encoded stc (set carry flag) > and clc (clear carry flag) instructions to i386.md. Maybe add a test for clc as well? Because: > +(define_insn "x86_clc" > + [(set (reg:CCC FLAGS_REG)

Re: [PATCH/RFC] combine_completed global variable.

2022-07-08 Thread Segher Boessenkool
Hi! On Thu, Jul 07, 2022 at 08:40:38PM +0100, Roger Sayle wrote: > Although I've not been able to reproduce your ICE (using gcc135 > on the compile farm), I completely agree with Segher's analysis > that the Achilles heel with my approach/patch is that there's > currently no way for the backend/re

Re: [PATCH 00/12] RFC: Replay of serialized diagnostics

2022-07-08 Thread David Malcolm via Gcc-patches
On Wed, 2022-06-22 at 18:34 -0400, David Malcolm wrote: > We currently have a couple of formats into which our diagnostics can > be serialized: (a) gcc's own json format and (b) SARIF, via: > >   -fdiagnostics-format=json-stderr (and -fdiagnostics-format=json) >   -fdiagnostics-format=json-file >

[PATCH] btf: emit linkage information in BTF_KIND_FUNC entries

2022-07-08 Thread Jose E. Marchesi via Gcc-patches
The kernel bpftool expects BTF_KIND_FUNC entries in BTF to include an annotation reflecting the linkage of functions (static, global). For whatever reason they (ab)use the `vlen' field of the BTF_KIND_FUNC entry instead of adding a variable-part to the record like it is done with other entry ki

[r13-1573 Regression] FAIL: gcc.dg/pr106063.c (test for excess errors) on Linux/x86_64

2022-07-08 Thread skpandey--- via Gcc-patches
On Linux/x86_64, f7854e2faf7640230062dec3596e71773ca500ed is the first bad commit commit f7854e2faf7640230062dec3596e71773ca500ed Author: Tamar Christina Date: Fri Jul 8 08:30:22 2022 +0100 middle-end: don't lower past veclower [PR106063] caused FAIL: gcc.dg/pr106063.c (test for excess e

[PATCH] c++: Add __reference_con{struc, ver}ts_from_temporary [PR104477]

2022-07-08 Thread Marek Polacek via Gcc-patches
This patch implements C++23 P2255R2, which adds two new type traits to detect reference binding to a temporary. They can be used to detect code like std::tuple t("meow"); which is incorrect because it always creates a dangling reference, because the std::string temporary is created inside the

libbacktrace patch committed: Check for sys/link.h

2022-07-08 Thread Ian Lance Taylor via Gcc-patches
Apparently QNX declares dl_iterate_phdr and friends in sys/link.h rather than link.h. This patch updates libbacktrace to check there. This fixes https://github.com/ianlancetaylor/libbacktrace/issues/86. Bootstrapped and ran libbacktrace testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian

Re: [PATCH] Control flow redundancy hardening

2022-07-08 Thread Alexandre Oliva via Gcc-patches
On Jul 8, 2022, Richard Biener wrote: > I'm possibly missing the importance of 'redundancy' in -fharden-control-flow I took "Control Flow Redundancy" as a term of the art and never questioned it. I think the "redundancy" has to do with the fact that control flow is generally affected by tests

Re: [PATCH] Introduce hardbool attribute for C

2022-07-08 Thread Alexandre Oliva via Gcc-patches
On Jul 8, 2022, Richard Biener wrote: > Does this follow some other compilers / language? It is analogous to Ada's booleans with representation clauses and runtime validation checking at use points. > Is such feature used in existing code? Not that I know. The attribute name was my choice.

Re: [PATCH] Introduce hardbool attribute for C

2022-07-08 Thread Alexandre Oliva via Gcc-patches
On Jul 8, 2022, Richard Biener wrote: > The documentation should probably be explicit about this case. Please consider, for purposes of review, the following incremental patchlet as if integrated with yesterday's submission. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index a63a9415

Re: [PATCH] Add condition coverage profiling

2022-07-08 Thread Sebastian Huber
Hello Jørgen, some time passed. It would be nice if you could give a status update. I am quite interested in your work. Best regards, Sebastian -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 7

Re: [PATCH] diagnostics: Make line-ending logic consistent with libcpp [PR91733]

2022-07-08 Thread David Malcolm via Gcc-patches
On Thu, 2022-07-07 at 21:56 -0400, Lewis Hyatt wrote: > Hello- > > The PR (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91733) points > out that, > while libcpp recognizes a lone '\r' as a valid line-ending character, > the > infrastructure that obtains source lines to be printed in diagnostics >

Re: [PATCH] Introduce hardbool attribute for C

2022-07-08 Thread Sebastian Huber
On 08.07.22 08:58, Richard Biener via Gcc-patches wrote: On Thu, Jul 7, 2022 at 10:00 PM Alexandre Oliva via Gcc-patches wrote: This patch introduces hardened booleans in C. The hardbool attribute, when attached to an integral type, turns it into an enumerate type with boolean semantics, usi

Re: [PATCH v2] loongarch: fix mulsidi3_64bit instruction

2022-07-08 Thread Xi Ruoyao via Gcc-patches
v2: Move one portable test to gcc.c-torture so it will be tested with all optimization levels. And it might be helpful if the engineer of the next GCC port makes a similar typo :). -- >8 -- (mult (sign_extend:DI rj:SI) (sign_extend:DI rk:SI)) should be "mulw.d.w", not "mul.d". gcc/ChangeLog:

[PATCH] loongarch: fix mulsidi3_64bit instruction

2022-07-08 Thread Xi Ruoyao via Gcc-patches
I think this should be obvious. Ok for trunk and gcc-12 branch? (Note: this bug really amazed me. It's just a simple typo and all of us failed to spot it reviewing the LoongArch port. Incredibly, it can be reproduced with such a simple test case (in the patch) but did not blow the entire system

[PATCH] d: Move DSO registry support code from compiler to drtstuff in library (PR100062)

2022-07-08 Thread Iain Buclaw via Gcc-patches
Hi, Currently the DSO support for D runtime is generated by the compiler in every object, when really it is only required once per shared object. This patch moves that support logic from the compiler itself to the library as part of the drtstuff code. The object files drtbegin.o and drtend.o are

Re: [PATCH v2] Simplify memchr with small constant strings

2022-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 7, 2022 at 6:45 PM H.J. Lu wrote: > > When memchr is applied on a constant string of no more than the bytes of > a word, simplify memchr by checking each byte in the constant string. > > int f (int a) > { >return __builtin_memchr ("AE", a, 2) != 0; > } > > is simplified to > > int

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

2022-07-08 Thread Alexander Monakov via Gcc-patches
On Fri, 8 Jul 2022, Martin Liška wrote: > Hi. > > All right, there's updated version of the patch that reflects the following > suggestions: > > 1) strings are used for version identification > 2) thread-safe API version (1) is not used if target does not support locking > via pthreads > >

[PATCH] testsuite: Fix tree-ssa/alias-access-path-13.c on 32bit platforms (PR 106216)

2022-07-08 Thread Martin Jambor
Hi, for gcc.dg/tree-ssa/alias-access-path-13.c to work, SRA must think of accesses to foo.inn.val and to foo itself as different ones, i.e. they need to have different offset and size, which on 32bit platforms they do not. Fixed by replacing a dummy long int field of the union with a struct of tw

Re: [PATCH v3] Enable __memcmpeq after seeing __memcmpeq prototype

2022-07-08 Thread Richard Biener via Gcc-patches
On Tue, Jul 5, 2022 at 6:27 PM H.J. Lu wrote: > > extern int __memcmpeq (const void *, const void *, size_t); > > was was added to GLIBC 2.35. Expand BUILT_IN_MEMCMP_EQ to __memcmpeq > after seeing __memcmpeq prototype > > gcc/ > > * builtins.cc (expand_builtin): Issue an error for >

[PATCH][s390]: Fix the usage of store_bit_field in the backend.

2022-07-08 Thread Tamar Christina via Gcc-patches
Hi All, I seem to have broken the s390 bootstrap because I added a new parameter to the store_bit_field function to indicate whether the value the field of is being set is currently undefined. If it's undefined we use a subreg instead. In this case the value of false restores the old behavior.

Re: [PATCH] inline: Rebuild target option node for caller [PR105459]

2022-07-08 Thread Martin Liška
On 6/6/22 08:20, Kewen.Lin wrote: > |Hi, PR105459 exposes one issue in inline_call handling that when it decides > to copy FP flags from callee to caller and rebuild the optimization node for > caller fndecl, it's possible that the target option node is also necessary to > be rebuilt. Without up

Re: [PATCH v2] Support --disable-fixincludes.

2022-07-08 Thread Martin Liška
On 5/25/22 07:37, Alexandre Oliva wrote: > On May 24, 2022, Martin Liška wrote: > >> Allways install limits.h and syslimits.h header files >> to include folder. > > typo: s/Allways/Always/ Hello. Fixed. > > I'm a little worried about this bit, too. limitx.h includes > "syslimits.h", mention

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

2022-07-08 Thread Richard Biener via Gcc-patches
On Thu, 7 Jul 2022, Tamar Christina wrote: > > -Original Message- > > From: Andrew Pinski > > Sent: Wednesday, July 6, 2022 8:37 PM > > To: Tamar Christina > > Cc: Richard Biener ; nd ; gcc- > > patc...@gcc.gnu.org > > Subject: Re: [PATCH]middle-end simplify complex if expressions where

Re: [PATCH] lto-dump: Do not print output file

2022-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 7, 2022 at 3:05 PM Martin Liška wrote: > > Right now the following is printed: > > lto-dump > .file "" > .ident "GCC: (GNU) 13.0.0 20220707 (experimental)" > .section.note.GNU-stack,"",@progbits > > After the patch we print -help and do not emit any a

[PATCH] tree-optimization/106226 - move vectorizer virtual SSA update

2022-07-08 Thread Richard Biener via Gcc-patches
When we knowingly have broken virtual SSA form we need to update it before we eventually perform slpeel manual updating which will call delete_update_ssa. Currently that's done on-demand but communicating whether it's a known unavoidable case is broken there. The following makes that a synchronou

Re: [PATCH 08/17] openmp: -foffload-memory=pinned

2022-07-08 Thread Tobias Burnus
On 08.07.22 11:55, Andrew Stubbs wrote: It's not incompatible with GCN offloading, only with the XNACK mode in which the binary was compiled (i.e. USM on or off). The message could be less terse, indeed. I went through a variety of messages for this and couldn't find one that I liked. How about.

Re: [PATCH 08/17] openmp: -foffload-memory=pinned

2022-07-08 Thread Andrew Stubbs
On 08/07/2022 10:00, Tobias Burnus wrote: On 08.07.22 00:18, Andrew Stubbs wrote: Likewise, the 'requires' mechanism could then also be used in '[PATCH 16/17] amdgcn, openmp: Auto-detect USM mode and set HSA_XNACK'. No, I don't think so; that environment variable needs to be set before the li

Re: [PATCH 08/17] openmp: -foffload-memory=pinned

2022-07-08 Thread Tobias Burnus
On 08.07.22 00:18, Andrew Stubbs wrote: Likewise, the 'requires' mechanism could then also be used in '[PATCH 16/17] amdgcn, openmp: Auto-detect USM mode and set HSA_XNACK'. No, I don't think so; that environment variable needs to be set before the libraries are loaded or it's too late. There

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

2022-07-08 Thread Martin Liška
Hi. All right, there's updated version of the patch that reflects the following suggestions: 1) strings are used for version identification 2) thread-safe API version (1) is not used if target does not support locking via pthreads Patch can bootstrap on x86_64-linux-gnu and survives regression

Re: [x86 PATCH] Fun with flags: Adding stc/clc instructions to i386.md.

2022-07-08 Thread Uros Bizjak via Gcc-patches
On Fri, Jul 8, 2022 at 9:15 AM Roger Sayle wrote: > > > This patch adds support for x86's single-byte encoded stc (set carry flag) > and clc (clear carry flag) instructions to i386.md. > > The motivating example is the simple code snippet: > > unsigned int foo (unsigned int a, unsigned int b, unsi

Re: [x86 PATCH] Fun with flags: Adding stc/clc instructions to i386.md.

2022-07-08 Thread Uros Bizjak via Gcc-patches
On Fri, Jul 8, 2022 at 9:15 AM Roger Sayle wrote: > > > This patch adds support for x86's single-byte encoded stc (set carry flag) > and clc (clear carry flag) instructions to i386.md. > > The motivating example is the simple code snippet: > > unsigned int foo (unsigned int a, unsigned int b, unsi

Re: [PATCH/RFC] combine_completed global variable.

2022-07-08 Thread Kewen.Lin via Gcc-patches
Hi Roger, on 2022/7/8 03:40, Roger Sayle wrote: > > Hi Kewen (and Segher), > Many thanks for stress testing my patch to improve multiplication > by integer constants on rs6000 by using the rldmi instruction. > Although I've not been able to reproduce your ICE (using gcc135 > on the compile farm),

RE: [PATCH]middle-end: don't lower past veclower [PR106063]

2022-07-08 Thread Richard Biener via Gcc-patches
On Fri, 8 Jul 2022, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Thursday, July 7, 2022 8:47 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd > > Subject: RE: [PATCH]middle-end: don't lower past veclower [PR106063] > > > > On Thu, 7 Jul

Re: [PATCH] Fix tree-opt/PR106087: ICE with inline-asm with multiple output and assigned only static vars

2022-07-08 Thread Richard Biener via Gcc-patches
On Fri, Jul 8, 2022 at 6:33 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > The problem here is that when we mark the ssa name that was referenced in the > now removed > dead store (to a write only static variable), the inline-asm would also be > removed > even though it was de

[x86 PATCH] Fun with flags: Adding stc/clc instructions to i386.md.

2022-07-08 Thread Roger Sayle
This patch adds support for x86's single-byte encoded stc (set carry flag) and clc (clear carry flag) instructions to i386.md. The motivating example is the simple code snippet: unsigned int foo (unsigned int a, unsigned int b, unsigned int *c) { return __builtin_ia32_addcarryx_u32 (1, a, b, c

Re: [RFA] Improve initialization of objects when the initializer has trailing zeros.

2022-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 7, 2022 at 4:46 PM Jeff Law via Gcc-patches wrote: > > This is an update to a patch originally posted by Takayuki Suwa a few > months ago. > > When we initialize an array from a STRING_CST we perform the > initialization in two steps. The first step copies the STRING_CST to > the dest

Re: [PATCH] Control flow redundancy hardening

2022-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 7, 2022 at 10:04 PM Alexandre Oliva via Gcc-patches wrote: > > > This patch introduces an optional hardening pass to catch unexpected > execution flows. Functions are transformed so that basic blocks set a > bit in an automatic array, and (non-exceptional) function exit edges > check