[GCC12/13 PATCH] i386: Use _mm_setzero_ps/d instead of _mm_avx512_setzero_ps/d for GCC13/12

2024-07-28 Thread Haochen Jiang
Hi all, In GCC13/12, there is no _mm_avx512_setzero_ps/d since it is introduced in GCC14. Fix the backport issue as obvious in: https://gcc.gnu.org/pipermail/gcc-regression/2024-July/080385.html Thx, Haochen gcc/ChangeLog: * config/i386/avx512dqintrin.h (_mm_reduce_round_sd): Use

RE: [r13-8949 Regression] FAIL: gcc.target/i386/avx512dq-vreducess-1b.c (test for excess errors) on Linux/x86_64

2024-07-28 Thread Jiang, Haochen
Ah... When I solved the huge conflict this morning due to AVX10 refactor for GCC13/12, I forgot that it is in GCC14 AVX10.1 refactor when I added the _mm_avx512_setzero_ps/pd. Should use _mm_setzero_ps/pd instead. Never do something tweak quickly on a sleepy Monday morning. Thx, Haochen > -O

[r13-8949 Regression] FAIL: gcc.target/i386/avx512dq-vreducess-1b.c (test for excess errors) on Linux/x86_64

2024-07-28 Thread haochen.jiang
On Linux/x86_64, bb15c4cf21dbe76df5a225342d1fbe8ecd3c7971 is the first bad commit commit bb15c4cf21dbe76df5a225342d1fbe8ecd3c7971 Author: Haochen Jiang Date: Thu Jul 25 16:12:20 2024 +0800 i386: Fix AVX512 intrin macro typo caused FAIL: gcc.target/i386/avx512dq-vreducesd-1b.c (test for e

[PATCH V7 2/3] split complicate 64bit constant to memory for -m32 -mpowerpc64

2024-07-28 Thread Jiufu Guo
Hi, For "-m32 -mpowerpc64", it is also ok to use fewer instruciton (p?ld) to loading 64bit constant from memory. So, splitting the complicate 64bit constant to constant pool should also work for this case. Bootstrap and regtest pass on ppc64{,le}. Also no regression for "-m32 -mpowerpc64" variati

[PATCH V7 3/3] slight tune heuristic min_insns_constant_in_pool

2024-07-28 Thread Jiufu Guo
Hi, The default rs6000_min_insns_constant_in_pool is 2, which would suitable for a few cases. While for different targets, we can tune this threshold slightly. For example, 'pld' could load a constant value from memory as faster as building a constant by one instruction, and faster than build a

[PATCH V7 1/3] split complicate 64bit constant to memory

2024-07-28 Thread Jiufu Guo
Hi, Sometimes, a complicated constant is built via 3(or more) instructions. Generally speaking, it would not be as fast as loading it from the constant pool (as the discussions in PR63281): "ld" is one instruction. If consider "address/toc" adjust, we may count it as 2 instructions. And "pld" ma

[RFC] RISC-V: Add support for Profiles RVA/B23.

2024-07-28 Thread Jiawei
This patch adds support for RISC-V RVA23 and RVB23 Profiles[1], which depend on the base RISC-V Profiles support[2]. [1] https://github.com/riscv/riscv-profiles/releases/tag/rva23-v0.4-rvb23-v0.1-internal-review [2] https://gcc.gnu.org/pipermail/gcc-patches/2024-July/658082.html gcc/ChangeLog:

Re: [PATCH] [x86]Refine constraint "Bk" to define_special_memory_constraint.

2024-07-28 Thread Hongtao Liu
On Thu, Jul 25, 2024 at 3:23 PM Hongtao Liu wrote: > > On Wed, Jul 24, 2024 at 3:57 PM liuhongt wrote: > > > > For below pattern, RA may still allocate r162 as v/k register, try to > > reload for address with leaq __libc_tsd_CTYPE_B@gottpoff(%rip), %rsi > > which result a linker error. > > > > (s

RE: [PATCH v2] i386: Fix AVX512 intrin macro typo

2024-07-28 Thread Jiang, Haochen
> -Original Message- > From: Jakub Jelinek > Sent: Friday, July 26, 2024 7:59 PM > To: Jiang, Haochen > Cc: gcc-patches@gcc.gnu.org; Liu, Hongtao ; > ubiz...@gmail.com > Subject: Re: [PATCH v2] i386: Fix AVX512 intrin macro typo > > On Fri, Jul 26, 2024 at 04:10:48PM +0800, Haochen Jiang

[PATCH] RISC-V: NFC: Do not use zicond for pr105314 testcases

2024-07-28 Thread Xiao Zeng
gcc/testsuite/ChangeLog: * gcc.target/riscv/pr105314-rtl.c: Skip zicond. * gcc.target/riscv/pr105314-rtl32.c: Dotto. * gcc.target/riscv/pr105314.c: Dotto. Signed-off-by: Xiao Zeng --- gcc/testsuite/gcc.target/riscv/pr105314-rtl.c | 2 +- gcc/testsuite/gcc.target/riscv/

Re: [PATCH] LoongArch: Use iorn and andn standard pattern names.

2024-07-28 Thread Lulu Cheng
在 2024/7/28 上午3:30, Andrew Pinski 写道: On Sat, Jul 27, 2024 at 1:55 AM Lulu Cheng wrote: gcc/ChangeLog: * config/loongarch/lasx.md (xvandn3): Rename to ... (andn3): This. (xvorn3): Rename to ... (iorn3): This. * config/loongarch/loongarch-builtins.

[PATCH] Fix ICE when using -gcodeview with empty struct

2024-07-28 Thread Mark Harmstone
Empty structs result in empty LF_FIELDLIST types, which are valid, but we weren't accounting for this and assuming they had to contain subtypes. gcc/ * dwarf2codeview.cc (get_type_num_struct): Fix NULL pointer dereference. --- gcc/dwarf2codeview.cc | 7 +-- 1 file changed, 5 insertion

[pushed] c++: if consteval and consteval propagation [PR115583]

2024-07-28 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- During speculative constant folding of an if consteval, we take the false branch, but the true branch is an immediate function context, so we don't want to to cp_fold_immediate it. So we could check IF_STMT_CONSTEVAL_P here. But beyond tha

Re: [Patch, fortran] PR79685 - [12/13/14/15 Regression] ICE on valid code in gfc_match_structure_constructor

2024-07-28 Thread Mikael Morin
Le 28/07/2024 à 11:24, Paul Richard Thomas a écrit : I have attached the updated and rather simpler patch. OK for master and backport. Thanks for the patch. Thanks for the prod, Mikael! Paul Fortran: Fix ICE with structure constructor in data statement [PR79685] 2024-07-28  Paul Thomas  ma

Re: [patch,avr] Implement PR116056: attribute signal(n) and interrupt(n)

2024-07-28 Thread Georg-Johann Lay
Applied with the addendum below. Am 23.07.24 um 22:19 schrieb Georg-Johann Lay: This patch adds support for arguments to the signal and interrupt function attributes.  It allows to specify the ISR by means of the associated IRQ number, in extension to the current attributes that require to speci

[committed] testsuite: Fix unaligned accesses in ipa-sra-8.c and ipa-sra-9.c

2024-07-28 Thread John David Anglin
Committed as obvious to trunk. Noticed originally on hppa2.0w-hp-hpux11.11. Tested on hppa-unknown-linux-gnu. Dave --- testsuite: Fix unaligned accesses in ipa-sra-8.c and ipa-sra-9.c 2024-07-28 John David Anglin gcc/testsuite/ChangeLog: PR testsuite/92550 * gcc.dg/ipa/ipa-

[RFC v2 2/2] c: Add __lengthof__() operator

2024-07-28 Thread Alejandro Colomar
This operator is similar to sizeof() but can only be applied to an array, and returns its length (number of elements). FUTURE DIRECTIONS: We could make it work with array parameters to functions, and somehow magically return the length designator of the array, regardless o

[RFC v2 1/2] Merge definitions of array_type_nelts_top()

2024-07-28 Thread Alejandro Colomar
There were two identical definitions, and none of them are available where they are needed for implementing _Lengthof(). Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for _Lengthof(). Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h |

[RFC v2 0/2] c: Add __lengthof__ operator

2024-07-28 Thread Alejandro Colomar
v2: - Add a GNU extension first; not using ISO C-reserved names. That is, add __lengthof__ instead of _Lengthof/lengthof. - Use 'in_lengthof' instead of 'in_sizeof'. Alejandro Colomar (2): Merge definitions of array_type_nelts_top() c: Add __lengthof__() operator gcc/c-family/c-common

Re: [PATCH] gcc: Make exec-tool.in handle missing Binutils more gracefully

2024-07-28 Thread Richard Biener
> Am 28.07.2024 um 16:27 schrieb Jonathan Wakely : > > Bootstrapped on x86_64-linux and for msp430-elf cross with and without > binutils for the target to verify the error is printed as expected. > > The $invoked variable will be one of as, collect-ld, nm, or dsymutil, > i.e. the tool that th

Re: [RFC v1 0/2] c: Add _Lengthof operator

2024-07-28 Thread Alejandro Colomar
Hi Martin, On Sun, Jul 28, 2024 at 04:42:26PM GMT, Martin Uecker wrote: > Am Sonntag, dem 28.07.2024 um 16:15 +0200 schrieb Alejandro Colomar: > > ... > > > > Does anyone know if we have the information available for getting that > > value from the 'tree' object? Or do we need some refactor fir

Re: [RFC v1 0/2] c: Add _Lengthof operator

2024-07-28 Thread Martin Uecker
Am Sonntag, dem 28.07.2024 um 16:15 +0200 schrieb Alejandro Colomar: ... > > Does anyone know if we have the information available for getting that > value from the 'tree' object? Or do we need some refactor first in > order to keep that information? What I wanted to try is to not immediately a

[PATCH] gcc: Make exec-tool.in handle missing Binutils more gracefully

2024-07-28 Thread Jonathan Wakely
Bootstrapped on x86_64-linux and for msp430-elf cross with and without binutils for the target to verify the error is printed as expected. The $invoked variable will be one of as, collect-ld, nm, or dsymutil, i.e. the tool that the script is invoking and wants to exec. OK for trunk? -- >8 -- Wh

[RFC v1 2/2] c: Add _Lengthof() operator

2024-07-28 Thread Alejandro Colomar
This operator is similar to sizeof() but can only be applied to an array, and returns its length (number of elements). FUTURE DIRECTIONS: We could make it work with array parameters to functions, and somehow magically return the length designator of the array, regardless o

[RFC v1 1/2] Merge definitions of array_type_nelts_top()

2024-07-28 Thread Alejandro Colomar
There were two identical definitions, and none of them are available where they are needed for implementing _Lengthof(). Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for _Lengthof(). Signed-off-by: Alejandro Colomar --- gcc/cp/cp-tree.h |

[RFC v1 0/2] c: Add _Lengthof operator

2024-07-28 Thread Alejandro Colomar
Hi! I've got something working: $ cat len.c #include int main(int argc, char *argv[argc + 1]) { int a[42]; size_t n; (void) argv; //n = _Lengthof(argv); //printf("_Len

[PATCH] PR tree-optimization/57371: Optimize (float)i == 16777222.0f sometimes.

2024-07-28 Thread Roger Sayle
This patch improves the tree-level optimization of (fptype)ivar != CST in match.pd (historically tracked under PR 57371). Joseph Myers' description in comment #1 provides an excellent overview of the issues, that historically it's the trapping behaviour of (fptype)ivar conversion that is the prim

[committed v2] Add config file so b4 uses inbox.sourceware.org automatically

2024-07-28 Thread Jonathan Wakely
Jeff approved an earlier version of this as trivially OK (since it doesn't affect anybody not using b4). The v2 patch that I've pushed adds the send-series-to config, as suggested by the b4 maintainer here: https://lore.kernel.org/tools/20240523143752.385810-1-jwak...@redhat.com/T/#mb21ebe04b433442

Re: [Patch, fortran] PR79685 - [12/13/14/15 Regression] ICE on valid code in gfc_match_structure_constructor

2024-07-28 Thread Paul Richard Thomas
I have attached the updated and rather simpler patch. Thanks for the prod, Mikael! Paul Fortran: Fix ICE with structure constructor in data statement [PR79685] 2024-07-28 Paul Thomas gcc/fortran PR fortran/79685 * decl.cc (match_data_constant): Find the symtree instead of the symbol so the