Re: [PATCH][gdb/build] Fix gdbserver build with -fsanitize=thread

2022-06-26 Thread Richard Biener via Gcc-patches
On Sat, Jun 25, 2022 at 11:09 AM Tom de Vries via Gcc-patches wrote: > > Hi, > > When building gdbserver with -fsanitize=thread (added to CFLAGS/CXXFLAGS) we > run into: > ... > ld: ../libiberty/libiberty.a(safe-ctype.o): warning: relocation against \ > `__tsan_init' in read-only section

Re: PING^1 [PATCH] x86: Skip ENDBR when emitting direct call/jmp to local function

2022-06-26 Thread Hongtao Liu via Gcc-patches
On Tue, Jun 21, 2022 at 3:50 AM Uros Bizjak via Gcc-patches wrote: > > On Mon, Jun 20, 2022 at 8:14 PM H.J. Lu wrote: > > > > On Tue, May 10, 2022 at 9:25 AM H.J. Lu wrote: > > > > > > Mark a function with SYMBOL_FLAG_FUNCTION_ENDBR when inserting ENDBR at > > > function entry. Skip the 4-byte

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

2022-06-26 Thread Richard Biener via Gcc-patches
> Am 27.06.2022 um 06:51 schrieb Prathamesh Kulkarni > : > > On Mon, 20 Jun 2022 at 12:52, Richard Biener > wrote: >> >>> On Thu, Jun 16, 2022 at 5:05 PM Prathamesh Kulkarni via Gcc-patches >>> wrote: >>> >>> Hi, >>> I just noticed -fdump-statistics supports asmname sub-option, which

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

2022-06-26 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Thursday, June 16, 2022 7:54 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; Kyrylo Tkachov > Subject: Re: [PATCH 1/2]AArch64 Add fallback case using sdot for usdot > > Richard

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

2022-06-26 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 20 Jun 2022 at 12:52, Richard Biener wrote: > > On Thu, Jun 16, 2022 at 5:05 PM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > 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

Re: [PATCH] xtensa: Optimize integer constant addition that is between -32896 and 32639

2022-06-26 Thread Max Filippov via Gcc-patches
On Sun, Jun 26, 2022 at 7:53 AM Takayuki 'January June' Suwa wrote: > > Such constants are often subject to the constant synthesis: > > int test(int a) { > return a - 31999; > } > > test: > movia3, 1 > addmi a3, a3, -0x7d00 > add a2, a2, a3 >

Re: [PATCH v3] rs6000: Adjust mov optabs for opaque modes [PR103353]

2022-06-26 Thread Kewen.Lin via Gcc-patches
Hi Segher! on 2022/6/25 00:49, Segher Boessenkool wrote: > Hi! > > On Fri, Jun 24, 2022 at 09:03:59AM +0800, Kewen.Lin wrote: >> on 2022/6/24 03:06, Segher Boessenkool wrote: >>> On Wed, May 18, 2022 at 10:07:48PM +0800, Kewen.Lin wrote: As PR103353 shows, we may want to continue to expand

Re: [PATCH 5/5] Convert ranger and clients to vrange.

2022-06-26 Thread Xi Ruoyao via Gcc-patches
On Wed, 2022-06-01 at 11:04 +0200, Aldy Hernandez via Gcc-patches wrote: > Final patch committed. > > All users but one of Value_Range::set_type() have been removed in > favor of using a constructor taking a type.   We still need to delay > initialization for one use in gimple_infer_range, as it

[rs6000 PATCH] Improve constant integer multiply using rldimi.

2022-06-26 Thread Roger Sayle
This patch tweaks the code generated on POWER for integer multiplications by a constant, by making use of rldimi instructions. Much like x86's lea instruction, rldimi can be used to implement a shift and add pair in some circumstances. For rldimi this is when the shifted operand is known

Re: [PATCH] Enhance _Hashtable for range insertion 0/5

2022-06-26 Thread François Dumont via Gcc-patches
I knew you were going to ask for it but was to impatient to propose those patches to wait anymore. Attached you'll find what I start to work on. But I am quite disappointed by the results. At least it's showing  that results are not worst. To be honest I was also hoping some feedback from

Re: [PATCH 1/2]middle-end Support optimized division by pow2 bitmask

2022-06-26 Thread Jeff Law via Gcc-patches
On 6/21/2022 6:34 PM, Tamar Christina via Gcc-patches wrote: -Original Message- From: Tamar Christina Sent: Tuesday, June 14, 2022 4:58 PM To: Richard Sandiford ; Richard Biener Cc: gcc-patches@gcc.gnu.org; nd Subject: RE: [PATCH 1/2]middle-end Support optimized division by pow2

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

2022-06-26 Thread Jeff Law via Gcc-patches
On 6/16/2022 9:04 AM, Prathamesh Kulkarni via Gcc-patches wrote: 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

Re: [PATCH] expr.cc: Optimize if char array initialization consists of all zeros

2022-06-26 Thread Jeff Law via Gcc-patches
On 5/30/2022 9:35 PM, Takayuki 'January June' Suwa via Gcc-patches wrote: Hi all, In some targets, initialization code for char array may be split into two parts even if the initialization consists of all zeros: /* example */ extern void foo(char*); void test(void) {   char a[256] = { 0, 0,

Re: [PATCH] testsuite: constraint some of fp tests to hard_float

2022-06-26 Thread Jeff Law via Gcc-patches
On 5/29/2022 9:53 PM, Vineet Gupta wrote: These tests validate fp conversions with various rounding modes which would not work on soft-float ABIs. On -march=rv64imac/-mabi=lp64 this reduces 5 unique failures (overall 35 due to multi flag combination builds) gcc/testsuite/Changelog:

Re: [PATCH] Strip of a vector load which is only used partially.

2022-06-26 Thread Jeff Law via Gcc-patches
On 5/10/2022 12:30 AM, Richard Biener wrote: On Tue, May 10, 2022 at 12:58 AM Jeff Law via Gcc-patches wrote: On 5/5/2022 2:26 AM, Richard Biener via Gcc-patches wrote: On Thu, May 5, 2022 at 7:04 AM liuhongt wrote: Optimize _1 = *srcp_3(D); _4 = VEC_PERM_EXPR <_1, _1, { 4, 5,

Re: [PATCH] [PR105455] predict: Check for no REG_BR_PROB in uninitialized case

2022-06-26 Thread Jeff Law via Gcc-patches
On 5/11/2022 7:48 PM, Alexandre Oliva via Gcc-patches wrote: There is an assumption in force_edge_cold that, if any edge out of the same src block has uninitialized probability, then a conditional branch out of src won't have REG_BR_PROB set. This assumption is supposed to hold, but buggy

Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+

2022-06-26 Thread Mikael Morin
Hello, I don’t like the _Float128 vs __float128 business, it’s confusing. And accordinog to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html they seem to be basically the same thing, so it’s also redundant. Is there a reason why the standard one, _Float128, can’t be used everywhere?

Re: Fix another Rust demangling bugs (PR 105039)

2022-06-26 Thread Jeff Law via Gcc-patches
On 3/24/2022 7:12 AM, Nick Clifton via Gcc-patches wrote: Hi Guys,   Attached is a proposed patch to fix another Rust demangling bug   reported in PR 105039.  I would like to say that this is the   last time that we will see this problem for the Rust demangler,   but I am not that naive...  

Re: [x86 PATCH] Use xchg for DImode double word rotate by 32 bits with -m32.

2022-06-26 Thread Uros Bizjak via Gcc-patches
On Sun, Jun 26, 2022 at 5:54 PM Roger Sayle wrote: > > > This patch was motivated by the investigation of Linus Torvalds' spill > heavy cryptography kernels in PR 105930. The di3 expander > handles all rotations by an immediate constant for 1..63 bits with the > exception of 32 bits, which FAILs

Re: [PATCH 2/2] tree-optimization/104530 - Mark defs dependent on non-null stale.

2022-06-26 Thread Jeff Law via Gcc-patches
On 2/22/2022 9:40 AM, Andrew MacLeod via Gcc-patches wrote: This patch simply leverages the existing computation machinery to re-evaluate values dependent on a newly found non-null value Ranger associates a monotonically increasing temporal value with every def as it is defined.  When that

Re: [PATCH] libcpp: Update cpp_wcwidth() to Unicode 14.0.0

2022-06-26 Thread Lewis Hyatt via Gcc-patches
On Fri, Jun 24, 2022 at 3:26 PM Joseph Myers wrote: > > On Fri, 24 Jun 2022, David Malcolm via Gcc-patches wrote: > > > > BTW, is this something simple enough I should just commit it without > > > bugging > > > the list for approval? > > > > The patch seems reasonable to me, but Joseph seems to

Re: [x86 PATCH] PR rtl-optimization/96692: ((A|B)^C)^A using andn with -mbmi.

2022-06-26 Thread Uros Bizjak via Gcc-patches
On Sun, Jun 26, 2022 at 2:04 PM Roger Sayle wrote: > > > This patch addresses PR rtl-optimization/96692 on x86_64, by providing > a define_split for combine to convert the three operation ((A|B)^C)^D > into a two operation sequence using andn when either A or B is the same > register as C or D.

Re: [x86_64 PATCH] Implement __imag__ of float _Complex using shufps.

2022-06-26 Thread Uros Bizjak via Gcc-patches
On Sun, Jun 26, 2022 at 1:12 PM Roger Sayle wrote: > > > This patch is a follow-up improvement to my recent patch for > PR rtl-optimization/7061. That patch added the test case > gcc.target/i386/pr7061-2.c: > > float im(float _Complex a) { return __imag__ a; } > > For which GCC on x86_64

Re: [PATCH] testsuite: pthread: call sched_yield for non-preemptive targets

2022-06-26 Thread Jeff Law via Gcc-patches
On 6/20/2022 11:51 PM, Alexandre Oliva via Gcc-patches wrote: Systems without preemptive multi-threading require sched_yield calls to be placed at points in which a context switch might be needed to enable the test to complete. Regstrapped on x86_64-linux-gnu, also tested with a cross to

Re: [PATCH] PR tree-optimization/94026: Simplify (X>>8)&6 != 0 as X&1536 != 0.

2022-06-26 Thread Jeff Law via Gcc-patches
On 6/24/2022 9:09 AM, Roger Sayle wrote: This patch implements the missed optimization described in PR 94026, where a the shift can be eliminated from the sequence of a shift, followed by a bit-wise AND followed by an equality/inequality test. Specifically, ((X << C1) & C2) cmp C3 into (X &

Re: [PATCH] testsuite: Adjust btf-bitfields-1.c for default_packed

2022-06-26 Thread Jeff Law via Gcc-patches
On 6/23/2022 3:21 PM, Dimitar Dimitrov wrote: If target packs structures by default, the bitfield offset which the tests validates must be adjusted to not include padding. Ok for trunk? gcc/testsuite/ChangeLog: * gcc.dg/debug/btf/btf-bitfields-1.c: Adjust the checked offsets

Re: Pushed patch to convert DOM from EVRP to Ranger

2022-06-26 Thread Jeff Law via Gcc-patches
On 6/26/2022 9:38 AM, Aldy Hernandez wrote: Thanks for pushing this. The patch triggered a (known) regression on g++.dg/warn/Wstringop-overflow-4.C. In the original submission I mentioned I would XFAIL it, but forgot to do so. I have pushed the attached patch. We both forgot about this

[x86 PATCH] Use xchg for DImode double word rotate by 32 bits with -m32.

2022-06-26 Thread Roger Sayle
This patch was motivated by the investigation of Linus Torvalds' spill heavy cryptography kernels in PR 105930. The di3 expander handles all rotations by an immediate constant for 1..63 bits with the exception of 32 bits, which FAILs and is then split by the middle-end. This patch makes these

Re: Pushed patch to convert DOM from EVRP to Ranger

2022-06-26 Thread Aldy Hernandez via Gcc-patches
Thanks for pushing this. The patch triggered a (known) regression on g++.dg/warn/Wstringop-overflow-4.C. In the original submission I mentioned I would XFAIL it, but forgot to do so. I have pushed the attached patch. Note that since this was the last user of EVRP, I think it is now safe to

[PATCH] configure: When host-shared, pass --with-pic to in-tree lib configs.

2022-06-26 Thread Iain Sandoe via Gcc-patches
If we are building PIC/PIE host executables, and we are building dependent libs (e.g. GMP) in-tree those libs need to be configured to generate PIC code. At present, if an --enable-host-shared build is attempted on ELF platforms, with in-tree dependents, the build will fail with incompatible

[pushed] configure, Darwin: Correct a pasto in host-shared processing.

2022-06-26 Thread Iain Sandoe via Gcc-patches
We do, of course, mean $host not $target in this case. Corrected thus. tested on x86_64-darwin and x86_64-linux, pushed to master, thanks Iain Signed-off-by: Iain Sandoe ChangeLog: * configure: Regenerate. * configure.ac: Correct use of $host. --- configure| 4 ++--

[PATCH] xtensa: Optimize integer constant addition that is between -32896 and 32639

2022-06-26 Thread Takayuki 'January June' Suwa via Gcc-patches
Such constants are often subject to the constant synthesis: int test(int a) { return a - 31999; } test: movia3, 1 addmi a3, a3, -0x7d00 add a2, a2, a3 ret This patch optimizes such case as follows: test: addia2, a2, 1

[PATCH take 2] middle-end: Support ABIs that pass FP values as wider integers.

2022-06-26 Thread Roger Sayle
Hi Jeff, Sorry for the long delay getting back to this, but after deeper investigation, it turns out that your tingling spider senses that the original patch wasn't updating everywhere that was required were spot on. Although my nvptx testing showed no problems with -O2, compiling the same tests

[x86 PATCH] PR rtl-optimization/96692: ((A|B)^C)^A using andn with -mbmi.

2022-06-26 Thread Roger Sayle
This patch addresses PR rtl-optimization/96692 on x86_64, by providing a define_split for combine to convert the three operation ((A|B)^C)^D into a two operation sequence using andn when either A or B is the same register as C or D. This is essentially a reassociation problem that's only a win

[x86_64 PATCH] Implement __imag__ of float _Complex using shufps.

2022-06-26 Thread Roger Sayle
This patch is a follow-up improvement to my recent patch for PR rtl-optimization/7061. That patch added the test case gcc.target/i386/pr7061-2.c: float im(float _Complex a) { return __imag__ a; } For which GCC on x86_64 currently generates: movq%xmm0, %rax shrq$32,

Re: [PATCH] Fortran: fix simplification of INDEX(str1,str2) [PR105691]

2022-06-26 Thread Thomas Koenig via Gcc-patches
Hello Harald, compile time simplification of INDEX(str1,str2,back=.true.) gave wrong results. Looking at gfc_simplify_index, this appeared to be close to a complete mess, while the runtime library code - which was developed later - was a relief. The solution is to use the runtime library code

[PATCH v3] eliminate mutex in fast path of __register_frame

2022-06-26 Thread Thomas Neumann via Gcc-patches
NOTE: A stress test program and a detailed walkthrough that breaks this patch into manageable parts can be found here: https://databasearchitects.blogspot.com/2022/06/making-unwinding-through-jit-ed-code.html The __register_frame/__deregister_frame functions are used to register unwinding frames

Re: [PATCH] Fortran: handle explicit-shape specs with constant bounds [PR105954]

2022-06-26 Thread Thomas Koenig via Gcc-patches
Hello Harald, after simplification of constant bound expressions of an explicit shape spec of an array, we need to ensure that we never obtain negative extents. In some cases this did happen, and we ICEd as we hit an assert that this should never happen... The original testcase by Gerhard

Re: [PATCH] testsuite: Add new target check for no_alignment_constraints

2022-06-26 Thread Dimitar Dimitrov
On Fri, Jun 24, 2022 at 08:58:49AM +0200, Richard Biener wrote: > On Fri, Jun 24, 2022 at 2:34 AM Andrew Pinski via Gcc-patches > wrote: > > > > On Thu, Jun 23, 2022 at 2:24 PM Dimitar Dimitrov wrote: > > > > > > A few testcases were marked for avr target, which has no alignment > > >