test

2024-06-29 Thread Ajit Agarwal

[PATCH v1] Vect: Distribute truncation into .SAT_SUB operands

2024-06-29 Thread pan2 . li
From: Pan Li To get better vectorized code of .SAT_SUB, we would like to avoid the truncated operation for the assignment. For example, as below. unsigned int _1; unsigned int _2; _9 = (unsigned short int).SAT_SUB (_1, _2); If we make sure that the _1 is in the range of unsigned short int. S

[Patch, rtl-optimization]: Loop unroll factor based on register pressure

2024-06-29 Thread Ajit Agarwal
Hello All: This patch determines Unroll factor based on loop register pressure. Unroll factor is quotient of max of available registers in loop by number of liveness. If available registers increases unroll factor increases. Wherein unroll factor decreases if number of liveness increases. Loop

Re: [PATCH][PR115565] cse: Don't use a valid regno for non-register in comparison_qty

2024-06-29 Thread Maciej W. Rozycki
On Fri, 21 Jun 2024, Richard Sandiford wrote: > > This has passed verification in native `powerpc64le-linux-gnu' and > > `x86_64-linux-gnu' regstraps, as well as with the `alpha-linux-gnu' > > target. OK to apply and backport to the release branches? > > Huh! Nice detective work. Thank you

test mail

2024-06-29 Thread Ajit Agarwal

[PATCH 5/5] Document return value in write_cv_integer

2024-06-29 Thread Mark Harmstone
gcc/ * dwarf2codeview.cc (write_lf_modifier): Expand upon comment. --- gcc/dwarf2codeview.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc index 5a33b439b14..df53d8bab9d 100644 --- a/gcc/dwarf2codeview.cc +++ b/gcc

[PATCH 4/5] Make sure CodeView symbols are aligned

2024-06-29 Thread Mark Harmstone
CodeView symbols have to be multiples of four bytes; add an alignment directive to write_data_symbol to ensure this. Note that these can be zeroes, so we can rely on GAS to do this for us; it's only types that need f3, f2, f1 values. gcc/ * dwarf2codeview.cc (write_data_symbol): A

[PATCH 3/5] Avoid magic numbers when writing CodeView padding

2024-06-29 Thread Mark Harmstone
Adds names for the padding magic numbers to enum cv_leaf_type. gcc/ * dwarf2codeview.cc (enum cv_leaf_type): Add padding constants. (write_cv_padding): Use names for padding constants. --- gcc/dwarf2codeview.cc | 11 +++ 1 file changed, 7 insertions(+), 4 delet

[PATCH 2/5] Add CodeView enum cv_sym_type

2024-06-29 Thread Mark Harmstone
Make everything more gdb-friendly by using an enum for symbol constants rather than #defines. gcc/ * dwarf2codeview.cc (S_LDATA32, S_GDATA32, S_COMPILE3): Undefine. (enum cv_sym_type): Define. (struct codeview_symbol): Use enum cv_sym_type. (writ

[PATCH 1/5] Add CodeView enum cv_leaf_type

2024-06-29 Thread Mark Harmstone
Make everything more gdb-friendly by using an enum for type constants rather than #defines. gcc/ * dwarf2codeview.cc (enum cv_leaf_type): Define. (struct codeview_subtype): Use enum cv_leaf_type. (struct codeview_custom_type): Use enum cv_leaf_type.

[to-be-committed] [RISC-V] DCE analysis for extension elimination

2024-06-29 Thread Jeff Law
This was actually ack'd late in the gcc-14 cycle, but I chose not to integrate it given how late we were in the cycle. The basic idea here is to track liveness of subobjects within a word and if we find an extension where the bits set aren't actually used, then we convert the extension into

test mail

2024-06-29 Thread Ajit Agarwal

[to-be-committed][v3][RISC-V] Handle bit manipulation of SImode values

2024-06-29 Thread Jeff Law
Third time is a charm perhaps? I'm not sure how I keep mucking this patch up, but clearly I do as I've sent the wrong patch twice! -- Last patch in this round of bitmanip work... At least I think I'm going to pause here and switch gears to other projects that need attention 🙂 This patch

Re: [PATCH] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-06-29 Thread Vineet Gupta
On 6/29/24 06:44, Jeff Law wrote: >> +;; fclass instruction output bitmap >> +;; 0 negative infinity >> +;; 1 negative normal number. >> +;; 2 negative subnormal number. >> +;; 3 -0 >> +;; 4 +0 >> +;; 5 positive subnormal number. >> +;; 6 positive normal number. >> +;; 7 positive in

[PATCH] c: Diagnose declarations that are used only in their own initializer [PR115027]

2024-06-29 Thread Martin Uecker
Probably not entirely fool-proof when using statement expressions in initializers, but should be good enough. Bootstrapped and regression tested on x86_64. c: Diagnose declarations that are used only in their own initializer [PR115027] Track the declaration that is currently be

[x86 PATCH]: Additional peephole2 to use lea in round-up integer division.

2024-06-29 Thread Roger Sayle
A common idiom for implementing an integer division that rounds upwards is to write (x + y - 1) / y. Conveniently on x86, the two additions to form the numerator can be performed by a single lea instruction, and indeed gcc currently generates a lea when x and y both registers. int foo(int x, int

[PATCH] c: Fix ICE for incorrect code in comptypes_verify [PR115696]

2024-06-29 Thread Martin Uecker
This adds missing code for handling error marks. Bootstrapped and regression tested on x86_64. c: Fix ICE for incorrect code in comptypes_verify [PR115696] The new verification code produces an ICE for incorrect code. Add the same logic as already used in comptypes to to ba

[PATCH] c: Fix ICE for redeclaration of structs with different alignment [PR114727]

2024-06-29 Thread Martin Uecker
This fixes an ICE when redeclaring a struct and having an aligned attribute in one version in C23. Bootstrapped and regression tested on x86_64. c: Fix ICE for redeclaration of structs with different alignment [PR114727] For redeclarations of struct in C23, if one has an alignme

Re: [RFC PATCH] cse: Add another CSE pass after split1

2024-06-29 Thread Jeff Law
On 6/27/24 3:56 PM, Palmer Dabbelt wrote: This is really more of a question than a patch. Looking at PR/115687 I managed to convince myself there's a general class of problems here: splitting might produce constant subexpressions, but as far as I can tell there's nothing to eliminate those co

Re: [PATCH] _Hashtable fancy pointer support

2024-06-29 Thread François Dumont
On 27/06/2024 22:30, Jonathan Wakely wrote: On Thu, 27 Jun 2024 at 20:25, François Dumont wrote: Thanks for the link, based on it I removed some of the nullptr usages keeping only assignments. That's not necessary. A nullable pointer type is equality comparable with nullptr_t, and nullptr can

Re: [PATCH] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-06-29 Thread Jeff Law
On 6/28/24 6:53 PM, Vineet Gupta wrote: Currently isfinite and isnormal use float compare instructions with fp flags save/restored around them. Our perf team complained this could be costly in uarch. RV Base ISA already has FCLASS.{d,s,h} instruction to do FP compares w/o disturbing FP excepti

[PATCH v10] C, ObjC: Add -Wunterminated-string-initialization

2024-06-29 Thread Alejandro Colomar
Warn about the following: char s[3] = "foo"; Initializing a char array with a string literal of the same length as the size of the array is usually a mistake. Rarely is the case where one wants to create a non-terminated character sequence from a string literal. In some cases, for writing

Re: [PATCH v9] C, ObjC: Add -Wunterminated-string-initialization

2024-06-29 Thread Alejandro Colomar
On Sat, Jun 29, 2024 at 02:58:48PM GMT, Alejandro Colomar wrote: > On Sat, Jun 29, 2024 at 02:52:40PM GMT, Alejandro Colomar wrote: > > @@ -6450,6 +6452,8 @@ name is still supported, but the newer name is more > > descriptive.) > > -Wstring-compare > > -Wtype-limits > > -Wuninitialized > > +-Ws

Re: [PATCH v9] C, ObjC: Add -Wunterminated-string-initialization

2024-06-29 Thread Alejandro Colomar
On Sat, Jun 29, 2024 at 02:52:40PM GMT, Alejandro Colomar wrote: > Warn about the following: > > char s[3] = "foo"; > > Initializing a char array with a string literal of the same length as > the size of the array is usually a mistake. Rarely is the case where > one wants to create a non-te

[PATCH v9] C, ObjC: Add -Wunterminated-string-initialization

2024-06-29 Thread Alejandro Colomar
Warn about the following: char s[3] = "foo"; Initializing a char array with a string literal of the same length as the size of the array is usually a mistake. Rarely is the case where one wants to create a non-terminated character sequence from a string literal. In some cases, for writing

[to-be-committed][RISC-V][V4] movmem for RISCV with V extension

2024-06-29 Thread Jeff Law
I hadn't updated my repo on the host where I handle email, so it picked up the older version of this patch without the testsuite fix. So, V4 with the testsuite option for lmul fixed. -- And Sergei's movmem patch. Just trivial testsuite adjustment for an option name change and a whitespac

[PATCH] c: Add support for byte arrays in C2Y

2024-06-29 Thread Martin Uecker
This marks structures which include a byte array as typeless storage. Bootstrapped and regression tested on x86_64. c: Add support for byte arrays in C2Y To get correct aliasing behavior requires that structures and unions that contain a byte array, i.e. an array of non-atom