Re: Fix type compatibility for types with flexible array member [PR113688,PR114014,PR117724]

2024-11-30 Thread Martin Uecker
Am Dienstag, dem 26.11.2024 um 15:15 + schrieb Qing Zhao: > > > On Nov 25, 2024, at 16:46, Martin Uecker wrote: > > > > > > Hi Qing, > > > > Am Montag, dem 25.11.2024 um 17:40 + schrieb Qing Zhao: > > > Hi, Martin, > > > > > > I didn’t go through all the details of your patch. > > >

Re: Should -fsanitize=bounds support counted-by attribute for pointers inside a structure?

2024-11-30 Thread Martin Uecker
Am Dienstag, dem 26.11.2024 um 20:59 + schrieb Qing Zhao: > Think this over these days, I have another thought that need some feedback: > > The major issue right now is: > > 1. For the following structure in which the “counted_by” attributes is > attached to the pointer field. > > struct fo

Re: gimplify: Handle void BIND_EXPR as asm input [PR100501]

2024-11-30 Thread Richard Biener
> Am 29.11.2024 um 23:45 schrieb Joseph Myers : > > On Fri, 29 Nov 2024, Richard Biener wrote: > >> I think we're trying to handle errorneous cases by setting TREE_VALUE >> to error_mark_node >> before this, so how about the following instead? > > Yes, that works, and also fixes the test in

Re:[pushed] [PATCH 1/2] LoongArch: testsuite: Fix loongarch/vect-frint-scalar.c.

2024-11-30 Thread Lulu Cheng
Pushed to r15-5817. 在 2024/11/26 下午4:06, Lulu Cheng 写道: In r15-5327, change the default language version for C compilation from -std=gnu17 to -std=gnu23. ISO C99 and C11 allow ceil, floor, round and trunc, and their float and long double variants, to raise the “inexact” exception, but ISO/IEC T

Re:[pushed] [PATCH 2/2] LoongArch: testsuite: Fix l{a}sx-andn-iorn.c.

2024-11-30 Thread Lulu Cheng
Pushed to r15-5818. 在 2024/11/26 下午4:06, Lulu Cheng 写道: Add '-fdump-tree-optimized' to this testcases. gcc/testsuite/ChangeLog: * gcc.target/loongarch/lasx-andn-iorn.c: Add '-fdump-tree-optimized'. * gcc.target/loongarch/lsx-andn-iorn.c: Likewise. --- gcc/test

[PATCH] strlen: Handle vector CONSTRUCTORs [PR117057]

2024-11-30 Thread Jakub Jelinek
Hi! The following patch handles VECTOR_TYPE_P CONSTRUCTORs in count_nonzero_bytes, including handling them if they have some elements non-constant. If there are still some constant elements before it (in the range queried), we derive info at least from those bytes and consider the rest as unknown.

Re: [PATCH] strlen: Handle vector CONSTRUCTORs [PR117057]

2024-11-30 Thread Richard Biener
> Am 30.11.2024 um 10:53 schrieb Jakub Jelinek : > > Hi! > > The following patch handles VECTOR_TYPE_P CONSTRUCTORs in > count_nonzero_bytes, including handling them if they have some elements > non-constant. > If there are still some constant elements before it (in the range queried), > we d

[committed] openmp: Add crtoffloadtableS.o and use it [PR117851]

2024-11-30 Thread Jakub Jelinek
Hi! Unlike crtoffload{begin,end}.o which just define some symbols at the start/end of the various .gnu.offload* sections, crtoffloadtable.o contains const void *const __OFFLOAD_TABLE__[] __attribute__ ((__visibility__ ("hidden"))) = { &__offload_func_table, &__offload_funcs_end, &__offload_v

Re: [pushed][PATCH v3] LoongArch: Mask shift offset when emit {xv,v}{srl,sll,sra} with sameimm vector

2024-11-30 Thread Lulu Cheng
Pushed to r15-5819.. 在 2024/11/28 上午9:26, Jinyang He 写道: For {xv,v}{srl,sll,sra}, the constraint `vector_same_uimm6` cause overflow in when emit {w,h,b}. Since the number of bits shifted is the remainder of the register value, it is actually unnecessary to constrain the range. Simply mask the sh

[patch, avr] ad PR84211: Prefer split into reg-reg move over reg-const move

2024-11-30 Thread Georg-Johann Lay
When splitting multi-byte REG-REG moves in try_split_any(), it's not clear whether propagating constants will turn out as profitable. When MOVW is available, split into REG-REG moves instead of a possible REG-CONST. Johann -- AVR: ad target/84211 - Split MOVW into MOVs in try_split_any.

[patch,avr,applied] Fix some coding rule nits

2024-11-30 Thread Georg-Johann Lay
This patch fixed some unrelated coding rule nits. Johann -- AVR: Fix some coding rule nits and typos. gcc/ * config/avr/avr-c.cc: Fix some coding rule nits and typos. * config/avr/avr-passes.cc: Same * config/avr/avr.h: Same. * config/avr/avr.cc: Same. (

Re: [patch,avr,testsuite,applied] gcc.c-torture/execute/memcpy-a*.c

2024-11-30 Thread Maciej W. Rozycki
On Sat, 30 Nov 2024, Georg-Johann Lay wrote: > The gcc.c-torture/execute/memcpy-a[1248].c tests consumed more time > than the whole rest of the test suite, just to come up with > a "memory full" even at -Os. Skipped thusly. As a matter of interest, is the timeout/memory exhaustion observed with

Re: [PATCH v2] match.pd: Add pattern to simplify `(a - 1) & -a` to `0`

2024-11-30 Thread Jeff Law
On 11/26/24 3:49 AM, Jovan Vukic wrote: Thank you for the feedback on the v1 patch. As requested, I added detailed tests for various signed and unsigned integer types in the test file bitops-11.c. I also included more complex expressions to observe how everything behaves at the GIMPLE level a

Re: [PATCH v2] Write binary annotations for CodeView S_INLINESITE symbols

2024-11-30 Thread Jeff Law
On 11/30/24 3:39 PM, Mark Harmstone wrote: Add "binary annotations" at the end of CodeView S_INLINESITE symbols, which are a series of compressed integers that represent how line numbers map to addresses. This requires assembler support; you will need commit b3aa594d ("gas: add .cv_ucomp and

Re: [PATCH] sched1: debug/model: dump predecessor list and BB num [NFC]

2024-11-30 Thread Jeff Law
On 11/5/24 3:20 PM, Vineet Gupta wrote: This is broken out of predecessor promotion patch so that debugging can proceed during stage1 restrictions. Signed-off-by: Vineet Gupta --- gcc/haifa-sched.cc | 10 +- gcc/sched-rgn.cc | 14 -- 2 files changed, 17 insertions(+

Re: [PATCH] v2: Allow limited extended asm at toplevel [PR41045]

2024-11-30 Thread Jeff Law
On 11/22/24 2:45 AM, Jakub Jelinek wrote: On Thu, Nov 21, 2024 at 09:32:51PM +, Joseph Myers wrote: On Sat, 2 Nov 2024, Jakub Jelinek wrote: +Extended @code{asm} statements outside of functions may not use any +qualifiers, may not specify clobbers, may not use @code{%}, @code{+} or +@co

Re: [PATCH 1/2] gimple-lim: Reuse boolean var when moving PHI

2024-11-30 Thread Richard Biener
> Am 01.12.2024 um 03:00 schrieb Andrew Pinski : > > While looking into PR 117859, I noticed that LIM > sometimes would produce `bool_var2 = bool_var1 != 0` instead > of just using bool_var2. This patch allows LIM to reuse bool_var1 > in the place where bool_var2 was going to be used. > > Boo

[PUSHED 2/5] testsuite: Fix another issue with sve-sizeless-[12].C

2024-11-30 Thread Andrew Pinski
There is a different error message expected on line 165 (for both files). It was expecting: error: cannot convert 'svint16_t' to 'sveint8_t' in initialization But now we get: error: cannot convert 'svint16_t' to 'signed char' in initialization This is because we support constructing scalable vecto

[PUSHED 1/5] testsuite: Fix part of sve-sizeless-2.c

2024-11-30 Thread Andrew Pinski
r15-5783-gb5df3eefd70064 missed to update part of sve-sizeless-2.C to include the declaration of the bar function. This corrects the oversight there. Pushed as obvious after testing the tecase for aarch64-linux-gnu. gcc/testsuite/ChangeLog: * g++.dg/ext/sve-sizeless-2.C: Add declaration

[PUSHED] testsuite: Fix aarch64/sve/acle/general-c/gnu_vectors_[12].c for taking address of vector element

2024-11-30 Thread Andrew Pinski
After the recent changes for SVE vectors becoming usable as GNU vector extensions. You can now get each of the elements like it was an array. There is no reason why taking the address of that won't be invalid too. especially since we are limiting to the first N elements (where N is the min arch

[PUSHED 4/5] testsuite: Fix sve-sizeless-[12].C for C++98

2024-11-30 Thread Andrew Pinski
In C++98 `{ a }` for aggregates can only mean constructing by each element rather than a copy. This adds the expected error message for SVE vectors for C++98. Pushed as obvious after a test for aarch64-linux-gnu. gcc/testsuite/ChangeLog: * g++.dg/ext/sve-sizeless-1.C: Add error message f

[PUSHED 3/5] testsuite: Fix sve-sizeless-[12].C for aggregate change

2024-11-30 Thread Andrew Pinski
Since r15-5777-g761cf60218890a, the SVE types are considered an aggregate since they are now acting similar as a GNU vector. Pushed as obvious after a quick test for aarch64-linux-gnu. gcc/testsuite/ChangeLog: * g++.dg/ext/sve-sizeless-1.C: SVE vectors are now aggregates. * g++.d

Re: [PATCH v2] sched1: parameterize pressure scheduling spilling agressiveness [PR/114729]

2024-11-30 Thread Jeff Law
On 11/5/24 1:11 PM, Vineet Gupta wrote: changes since v1 * Changed target hook to --param * squash addon patch for RISC-V opting-in, testcase here * updated changelog with latest perf numbers --- sched1 computes ECC (Excess Change Cost) for each insn, which represents the register pr

[PUSHED 5/5] testsuite: Fix aarch64/sve/acle/general-c++/gnu_vectors_[12].C for taking address of vector element

2024-11-30 Thread Andrew Pinski
After the recent changes for SVE vectors becoming usable as GNU vector extensions. You can now get each of the elements like it was an array. There is no reason why taking the address of that won't be invalid too. especially since we are limiting to the first N elements (where N is the min arch

Re: [PATCH 2/2] VN: Don't recurse on for the same value of `a != 0` [PR117859]

2024-11-30 Thread Richard Biener
> Am 01.12.2024 um 02:59 schrieb Andrew Pinski : > > Like r15-5063-g6e84a41622f56c, but this is for the `a != 0` case. > After adding vn_valueize to the handle the `a ==/!= 0` case > of insert_predicates_for_cond, it would go into an infinite loop > as the Value number for a could be the same

[PATCH v2] Write binary annotations for CodeView S_INLINESITE symbols

2024-11-30 Thread Mark Harmstone
Add "binary annotations" at the end of CodeView S_INLINESITE symbols, which are a series of compressed integers that represent how line numbers map to addresses. This requires assembler support; you will need commit b3aa594d ("gas: add .cv_ucomp and .cv_scomp pseudo-directives") in binutils. gcc/

[committed] libstdc++: Improve new testcase for std::optional assignment [PR117858]

2024-11-30 Thread Jonathan Wakely
The copy & paste bug affected two assignment operators, so ensure the new test covers both. libstdc++-v3/ChangeLog: PR libstdc++/117858 * testsuite/20_util/optional/assignment/117858.cc: Also test assignment from rvalue optional. --- Tested x86_64-linux. Pushed to trunk.

[PATCH] x86: Add pcmpeq splitters

2024-11-30 Thread H.J. Lu
Add pcmpeq splitters to split (insn 5 3 7 2 (set (reg:V4SI 100) (eq:V4SI (reg:V4SI 98) (reg:V4SI 98))) 7910 {*sse2_eqv4si3} (expr_list:REG_DEAD (reg:V4SI 98) (expr_list:REG_EQUAL (eq:V4SI (const_vector:V4SI [ (const_int -1 [0xfff

[PATCH 2/2] VN: Don't recurse on for the same value of `a != 0` [PR117859]

2024-11-30 Thread Andrew Pinski
Like r15-5063-g6e84a41622f56c, but this is for the `a != 0` case. After adding vn_valueize to the handle the `a ==/!= 0` case of insert_predicates_for_cond, it would go into an infinite loop as the Value number for a could be the same as what it is for the whole expression. This avoids that recursi

[PATCH 1/2] gimple-lim: Reuse boolean var when moving PHI

2024-11-30 Thread Andrew Pinski
While looking into PR 117859, I noticed that LIM sometimes would produce `bool_var2 = bool_var1 != 0` instead of just using bool_var2. This patch allows LIM to reuse bool_var1 in the place where bool_var2 was going to be used. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: *

Re: [PATCH v3] zero_extend(not) -> xor optimization [PR112398]

2024-11-30 Thread Jeff Law
On 11/28/24 5:26 AM, Alexey Merzlyakov wrote: This patch adds optimization of the following patterns: (zero_extend:M (subreg:N (not:O==M (X:Q==M -> (xor:M (zero_extend:M (subreg:N (X:M)), mask)) ... where the mask is GET_MODE_MASK (N). For the cases when X:M doesn't have any non

[committed] libstdc++: Fix constraints on std::optional converting assignments [PR117858]

2024-11-30 Thread Jonathan Wakely
It looks like I copied these constraints from operator=(U&&) and didn't correct them to account for the parameter being optional not U. libstdc++-v3/ChangeLog: PR libstdc++/117858 * include/std/optional (operator=(const optional&)): Fix copy and paste error in constraints.

[PATCH] x86: Add a pass to remove redundant all 0s/1s vector load

2024-11-30 Thread H.J. Lu
For all different modes of all 0s/1s vectors, we can use the single widest all 0s/1s vector register for all 0s/1s vector uses in the whole function. Add a pass to generate a single widest all 0s/1s vector set instruction at entry of the nearest common dominator for basic blocks with all 0s/1s vect

Re: [PATCH] Add fancy pointer support in std::map/set

2024-11-30 Thread Jonathan Wakely
On Sat, 30 Nov 2024, 13:52 François Dumont, wrote: > Hi > > I've applied all your comments below and the ones you did on the PR > directly. > > When all new types totally seperated from the legacy types > _Rb_tree_node_traits is indeed useless. > > Regarding _Rb_tree_helpers I got rid of it but m