Re: [RFC PATCH] c++: Implement C++26 P3533R2 - constexpr virtual inheritance [PR120777]

2025-06-25 Thread Jakub Jelinek
On Tue, Jun 24, 2025 at 05:19:59PM -0400, Jason Merrill wrote: > I think we could move the initialization of the fixed_type_p and > virtual_access variables up, they don't need to be after cp_build_addr_expr. I don't understand why it doesn't depend on cp_build_addr_expr. I've tried the following

Re: [PATCH v2] x86: Add preserve_none and update no_caller_saved_registers attributes

2025-06-25 Thread H.J. Lu
On Wed, Jun 25, 2025 at 2:14 PM Hongtao Liu wrote: > > On Fri, May 23, 2025 at 1:56 PM H.J. Lu wrote: > > > > Add preserve_none attribute which is similar to no_callee_saved_registers > > attribute, except on x86-64, r12, r13, r14, r15, rdi and rsi registers are > > used for integer parameter pas

Re: [Patch, Fortran, Coarray, PR88076, v1] 6/6 Add a shared memory multi process coarray library.

2025-06-25 Thread Damian Rouson
Giving something new time to mature before making it the default is always a great policy. My suggestion is aspirational. I’m describing a dream that I hope can be the ultimate goal. There’s no need to rush into implementing my proposed vision. D On Tue, Jun 24, 2025 at 23:25 Andre Vehreschild

Re: [PATCH] s390: Add some missing vector patterns.

2025-06-25 Thread Juergen Christ
> On Tue, Jun 24, 2025 at 09:49:01AM +0200, Juergen Christ wrote: > > Some patterns that are detected by the autovectorizer can be supported by > > s390. Add expanders such that autovectorization of these patterns works. > > > > Bootstrapped and regtested on s390. Ok for trunk? > > > > gcc/Chan

Re: [PATCH] s390: Optimize fmin/fmax.

2025-06-25 Thread Juergen Christ
> On Mon, Jun 23, 2025 at 09:51:13AM +0200, Juergen Christ wrote: > > On VXE targets, we can directly use the fp min/max instruction instead of > > calling into libm for fmin/fmax etc. > > > > Provide fmin/fmax versions also for vectors even though it cannot be > > called directly. This will be e

[PATCH v2] s390: Optimize fmin/fmax.

2025-06-25 Thread Juergen Christ
On VXE targets, we can directly use the fp min/max instruction instead of calling into libm for fmin/fmax etc. Provide fmin/fmax versions also for vectors even though it cannot be called directly. This will be exploited with a follow-up patch when reductions are introduced. Bootstrapped and regt

Re: [Patch, Fortran, Coarray, PR88076, v1] 0/6 Add a shared memory multi process coarray library.

2025-06-25 Thread Andre Vehreschild
Hi Jerry, thank you very much. Just try it. I can only imagine that Paul had a somehow corrupted build directory or left overs from some previous build. I am still wondering, that I got no automated mail from the build hosts, but I can imagine, that they get issues with a series of patches, that b

[PATCH v2] s390: Add some missing vector patterns.

2025-06-25 Thread Juergen Christ
Some patterns that are detected by the autovectorizer can be supported by s390. Add expanders such that autovectorization of these patterns works. RTL for the builtins used unspec to represent highpart multiplication. Replace this by the correct RTL to allow further simplification. Bootstrapped

Re: [PATCH v6 2/9] AArch64: reformat branch instruction rules

2025-06-25 Thread Richard Sandiford
Karl Meakin writes: > Make the formatting of the RTL templates in the rules for branch > instructions more consistent with each other. > > gcc/ChangeLog: > > * config/aarch64/aarch64.md (cbranch4): Reformat. > (cbranchcc4): Likewise. > (condjump): Likewise. > (*compare_cond

Re: [PATCH v6 3/9] AArch64: rename branch instruction rules

2025-06-25 Thread Richard Sandiford
Karl Meakin writes: > Give the `define_insn` rules used in lowering `cbranch4` to RTL > more descriptive and consistent names: from now on, each rule is named > after the AArch64 instruction that it generates. Also add comments to > document each rule. > > gcc/ChangeLog: > > * config/aarch64

[PATCH v2] libstdc++: Test for %S precision for durations with integral representation.

2025-06-25 Thread Tomasz Kamiński
Existing test are extented to cover cases where not precision is specified, or it is specified to zero. The precision value is ignored in all cases. libstdc++-v3/ChangeLog: * testsuite/std/time/format/precision.cc: New tests. --- v2 extents test to cover .0 as precision. Testing on x86_64

Re: [PATCH 1/2] allow contraction to synthetic single-element vector FMA

2025-06-25 Thread Richard Biener
On Tue, Jun 24, 2025 at 5:25 PM Alexander Monakov wrote: > > > I'd say we want to fix these kind of things before switching the default. > > Can > > you file bugreports for the distinct issues you noticed when adjusting the > > testcases? > > Sure, filed https://gcc.gnu.org/bugzilla/show_bug.cgi

[PATCH] tree-optimization/109892 - SLP reduction of fma

2025-06-25 Thread Richard Biener
The following adds the ability to vectorize a fma reduction pair as SLP reduction (we cannot yet handle ternary association in reduction vectorization yet). Bootstrapped and tested on x86_64-unknown-linux-gnu. PR tree-optimization/109892 * tree-vect-loop.cc (reduction_fn_for_scala

Re: [PATCH v2] libstdc++: Test for %S precision for durations with integral representation.

2025-06-25 Thread Jonathan Wakely
On Wed, 25 Jun 2025 at 10:42, Tomasz Kamiński wrote: > > Existing test are extented to cover cases where not precision is specified, > or it is specified to zero. The precision value is ignored in all cases. > > libstdc++-v3/ChangeLog: > > * testsuite/std/time/format/precision.cc: New test

Re: [PATCH v3] reassoc: Optimize CMP/XOR expressions [PR116860]

2025-06-25 Thread Konstantinos Eleftheriou
Hi Jakub, thanks for the feedback. We have sent a new version (https://gcc.gnu.org/pipermail/gcc-patches/2025-June/687530.html), addressing those issues. Regarding the hash_sets, we have replaced them with vectors in some cases and in the cases that we're still using them we're copying them to sor

[PATCH v4] reassoc: Optimize CMP/XOR expressions [PR116860]

2025-06-25 Thread Konstantinos Eleftheriou
Testcases for match.pd patterns `((a ^ b) & c) cmp d | a != b -> (0 cmp d | a != b)` and `(a ^ b) cmp c | a != b -> (0 cmp c | a != b)` were failing on some targets, like PowerPC. This patch adds an implemenetation for the optimization in reassoc. Doing so, we can now handle cases where the relate

[PATCH] RISC-V: Generate -mcpu and -mtune options from riscv-cores.def.

2025-06-25 Thread Dongyan Chen
Automatically generate -mcpu and -mtune options in invoke.texi from the unified riscv-cores.def metadata, ensuring documentation stays in sync with definitions and reducing manual maintenance. gcc/ChangeLog: * Makefile.in: Add riscv-mcpu.texi and riscv-mtune.texi to the list of files

[PATCH] c++/modules: Ensure type of partial spec VAR_DECL is consistent with its template [PR120644]

2025-06-25 Thread Nathaniel Shead
On Tue, Jun 24, 2025 at 12:10:09PM -0400, Patrick Palka wrote: > On Tue, 24 Jun 2025, Jason Merrill wrote: > > > On 6/23/25 5:41 PM, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? > > > > > > -- >8 -- > > > > > > We were erroring because the TEMP

[PATCH 02/17] Mark pass_sccopy gate and execute functions as final override

2025-06-25 Thread Martin Jambor
Hi, It is customary to mark the gate and execute functions of the classes representing passes as final override but this is missing in pass_sccopy. This patch adds it which also silences clang warnings about it. Bootstrapped and tested on x86_64-linux. Because of the precedent elsewhere I consid

[PATCH 11/17] tree-vect-stmts.cc: Remove an unused shadowed variable

2025-06-25 Thread Martin Jambor
Hi, when compiling tree-vect-stmts.cc with clang, it emits a warning: gcc/tree-vect-stmts.cc:14930:19: warning: unused variable 'mode_iter' [-Wunused-variable] And indeed, there are two mode_iter local variables in function supportable_indirect_convert_operation and the first one is not used

[PATCH 09/17] jit: Silence clang warning in jit-builtins.cc

2025-06-25 Thread Martin Jambor
Hi, When compiling GCC (with JIT enabled) by clang, it produces a series of warning s like this for all uses of DEF_GOACC_BUILTIN_COMPILER and DEF_GOMP_BUILTIN_COMPILER in omp-builtins.def: -- In file included from /home/worke

[PATCH 12/17] Silence a clang warning in tree-vect-slp.cc about an unused variable

2025-06-25 Thread Martin Jambor
Hi, since r15-4695-gd17e672ce82e69 (Richard Biener: Assert finished vectorizer pattern COND_EXPR transition), the static const array cond_expr_maps is unused and when GCC is compiled with clang, it warns about that. This patch simply removes the variable. Bootstrapped and tested on x86_64-linx.

[PATCH 06/17] value-relation.h: Mark dom_oracle::next_relation as override

2025-06-25 Thread Martin Jambor
Hi, When GCC is compiled with clang, it emits a warning that dom_oracle::next_relation is not marked as override even though it does override a virtual function of its ancestor. This patch marks it as such to silence the warning and for the sake of consistency. There are other member functions i

[PATCH 14/17] c-format: Removed unused private member

2025-06-25 Thread Martin Jambor
Hi, when building GCC with clang, it warns that the private member suffix in class element_expected_type_with_indirection (defined in gcc/c-family/c-format.cc) is not used which indeed looks like it is the case. This patch therefore removes it. Bootstrapped and tested on x86_64-linx. OK for mas

[COMMITTED] - get_bitmask is sometimes less refined.

2025-06-25 Thread Andrew MacLeod
While looking at something else, I decided to write some self-tests for the bound-snapping  changes. Along the way, I discovered a couple of things. This patch has the self tests, and they tripped over an issue with get_bitmask ().   get_bitmask () takes the current mask, and intersect it wit

[COMMITTED] Promote verify_range to vrange.

2025-06-25 Thread Andrew MacLeod
Another thing I noticed is that verifying a range outside of private constraints was actually quite difficult. Most range classes had a verify_range () routine, but they were private, not constant, and impossible to invoke if we were in a situation where all we had a was a vrange. This patch

Re: [PATCH] vect: Misalign checks for gather/scatter.

2025-06-25 Thread Richard Biener
On Wed, 25 Jun 2025, Robin Dapp wrote: > Hi, > > this patch adds simple misalignment checks for gather/scatter > operations. Previously, we assumed that those perform element accesses > internally so alignment does not matter. The riscv vector spec however > explicitly states that vector operat

Re: [PATCH 1/2] Match: Support for signed scalar SAT_ADD IMM form 2

2025-06-25 Thread Richard Biener
On Tue, Jun 24, 2025 at 5:12 AM Ciyan Pan wrote: > > From: panciyan > > This patch would like to support signed scalar SAT_ADD IMM form 2 > > Form2: > T __attribute__((noinline)) \ > sat_s_add_imm_##T##_fmt_2##_##INDEX (T x)\ > {

[PATCH 01/17] Mark rtl_avoid_store_forwarding functions final override

2025-06-25 Thread Martin Jambor
Hi, It is customary to mark the gate and execute functions of the classes representing passes as final override but this is missing in pass_rtl_avoid_store_forwarding. This patch adds it which also silences a clang warning about it. Bootstrapped and tested on x86_64-linux. Because of the preced

[PATCH 03/17] Diagnostics: Mark path_label::get_effects as final override

2025-06-25 Thread Martin Jambor
Hi, When compiling diagnostic-path-output.cc with clang, it warns that path_label::get_effects should be marked as override. That looks like a good idea and from a brief look I also believe it should be marked as final (the other override in the class is marked as both), so this patch does that.

[PATCH 05/17] tree-ssa-propagate.h: Mark two functions as override

2025-06-25 Thread Martin Jambor
When tree-ssa-propagate.h is compiled with clang, it complains that member functions functions value_of_expr and range_of_expr of class substitute_and_fold_engine are not marked as override even though they do override virtual functions of the ancestor class. This patch merely adds the keyword

[PATCH v3] Evaluate the object size by the size of the pointee type when the type is a structure with flexible array member which is annotated with counted_by.

2025-06-25 Thread Qing Zhao
Hi, This is the 3rd version of the patch for: Evaluate the object size by the size of the pointee type when the type is a structure with flexible array member which is annotated with counted_by. Compared to the 2nd version of the patch at: https://gcc.gnu.org/pipermail/gcc-patches/2025-May/682

[PATCH 10/17] rust: Silence a clang warning in borrow-checker-diagnostics

2025-06-25 Thread Martin Jambor
Hi, when compiling gcc/rust/checks/errors/borrowck/rust-borrow-checker-diagnostics.cc with clang, it emits the following warning: gcc/rust/checks/errors/borrowck/rust-borrow-checker-diagnostics.cc:145:46: warning: non-constant-expression cannot be narrowed from type 'Polonius::Loan' (aka 'uns

[PATCH 08/17] ranger-op: Use CFN_ constant instead of plain BUILTIN_ one

2025-06-25 Thread Martin Jambor
Hi, when compiling gimple-range-op.cc, clang issues warning: gimple-range-op.cc:1419:18: warning: comparison of different enumeration types in switch statement ('combined_fn' and 'built_in_function') [-Wenum-compare-switch] which I hope is harmless, but all other switch cases use CFN_ prefix

[PATCH 07/17] gfortran: Avoid freeing uninitialized value

2025-06-25 Thread Martin Jambor
Hi, When compiling fortran/match.cc, clang emits a warning fortran/match.cc:5301:7: warning: variable 'p' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] which looks accurate, so this patch adds an initialization of p to avoid the use. Bootstrapped and teste

[PATCH 13/17] lto-ltrans-cache: Remove unused private member

2025-06-25 Thread Martin Jambor
Hi, when building GCC with clang, it warns that the private member suffix in class ltrans_file_cache (defined in lto-ltrans-cache.h) is not used which indeed looks like it is the case. This patch therefore removes it along with its initialization in the constructor. Bootstrapped and tested on x8

[PATCH 17/17] Ignore more clang warnings in contrib/filter-clang-warnings.py

2025-06-25 Thread Martin Jambor
Hi, in contrib we have a script filter-clang-warnings.py which supposedly filters out uninteresting warnings emitted by clang when it compiles GCC. I'm not sure if anyone else uses it but our internal SUSE testing infrastructure does. Since Martin Liška left, I have mostly ignored the warnings a

Re: [PATCH 3/4] c++/modules: Support streaming new size cookie for constexpr [PR120040]

2025-06-25 Thread Jason Merrill
On 5/21/25 10:15 PM, Nathaniel Shead wrote: This type currently has a DECL_NAME of an IDENTIFIER_DECL. Although the documentation indicates this is legal, this confuses modules streaming which expects all RECORD_TYPEs to have a TYPE_DECL, which is used to determine the context and merge key, etc

[commmited v2] libstdc++: Report compilation error on formatting "%d" from month_last [PR120650]

2025-06-25 Thread Tomasz Kamiński
For month_day we incorrectly reported day information to be available, which lead to format_error being thrown from the call to formatter::format at runtime, instead of making call to format ill-formed. The included test cover most of the combinations of _ChronoParts and format specifiers.

Re: [PATCH v6 8/9] AArch64: rules for CMPBR instructions

2025-06-25 Thread Richard Sandiford
Richard Sandiford writes: > Karl Meakin writes: >> + "r")) >> + (label_ref (match_operand 2)) >> + (pc)))] >> + "TARGET_CMPBR" >> + "cb\\t%0, %1, %l2"; Sorry, for following up on myself, but: the pattern needs to handle

[PATCH] libstdc++: Type-erase chrono-data for formatting [PR110739]

2025-06-25 Thread Tomasz Kamiński
This patch reworks the formatting for the chrono types, such that they are all formatted in terms of _ChronoData class, that includes all required fields. Populating each required field is performed in formatter for specific type, based on the chrono-spec used. To facilitate above, the _ChronoSpec

Re: [PATCH] rtl-ssa: Fix test condition for insn_info::has_been_deleted

2025-06-25 Thread Richard Sandiford
Christoph Müllner writes: > On Tue, Jun 24, 2025 at 9:29 PM Richard Sandiford > wrote: >> >> Christoph Müllner writes: >> > insn_info::has_been_deleted () is documented to return true if an >> > instruction is deleted. Such instructions have their `volatile` bit set, >> > which can be tested vi

[Fortran, Patch, PR120711, v1] 1/(3) Fix out of bounds access in cleanup of array constructor

2025-06-25 Thread Andre Vehreschild
Hi all, attached patch fixes an out of bounds access in the clean up code of a concatenating array constructor. A fragment like list = [ list, something() ] lead to clean up using an offset (of the list array) that was manipulated in the loop copying the existing array elements and at the end po

[Fortran, Patch, v1] 3/(3) Prevent creating tree that is never used.

2025-06-25 Thread Andre Vehreschild
Hi, while hunting for pr120711 I found a construct where a call-tree was created and never used. The patch now just suppresses the tree creation and instead uses directly the tree that is desired. Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline? Regards, Andre -- Andre Vehresc

[Fortran, Patch, v1] 2/(3) Stop spending memory in coarray single mode executables.

2025-06-25 Thread Andre Vehreschild
Hi, attached patch prevents generation of a token component in derived types, when -fcoarray=single is used. Generating the token only wastes memory. It is never even initialized nor accessed. Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline? Regards, Andre -- Andre Vehreschild

Re: [PATCH v6 8/9] AArch64: rules for CMPBR instructions

2025-06-25 Thread Richard Sandiford
Karl Meakin writes: > Add rules for lowering `cbranch4` to CBB/CBH/CB when > CMPBR extension is enabled. > > gcc/ChangeLog: > > * config/aarch64/aarch64-protos.h (aarch64_cb_rhs): New function. > * config/aarch64/aarch64.cc (aarch64_cb_rhs): Likewise. > * config/aarch64/aarch64.m

[Fortran, Patch, PR120637, v1] Ensure expression in finalizer creation is freed only when unused.

2025-06-25 Thread Andre Vehreschild
Hi, Antony Lewis reported this issue and also proposed a patch, that removes the was_finalized tracking. While this may lead to the desired effect for the issue at hand, I don't believe that the was_finalized tracking code has been there for no reason. This patch fixes the issue that also Antony

Re: [PATCH] rtl-ssa: Fix test condition for insn_info::has_been_deleted

2025-06-25 Thread Christoph Müllner
On Tue, Jun 24, 2025 at 9:29 PM Richard Sandiford wrote: > > Christoph Müllner writes: > > insn_info::has_been_deleted () is documented to return true if an > > instruction is deleted. Such instructions have their `volatile` bit set, > > which can be tested via rtx_insn::deleted (). > > > > The

[PATCH] vect: Misalign checks for gather/scatter.

2025-06-25 Thread Robin Dapp
Hi, this patch adds simple misalignment checks for gather/scatter operations. Previously, we assumed that those perform element accesses internally so alignment does not matter. The riscv vector spec however explicitly states that vector operations are allowed to fault on element-misaligned acc

Re: [PATCH] c++: Implement C++26 P3618R0 - Allow attaching main to the global module [PR120773]

2025-06-25 Thread Nathaniel Shead
On Tue, Jun 24, 2025 at 11:14:51AM -0400, Jason Merrill wrote: > On 6/24/25 10:16 AM, Nathaniel Shead wrote: > > On Tue, Jun 24, 2025 at 01:03:53PM +0200, Jakub Jelinek wrote: > > > Hi! > > > > > > The following patch implements the P3618R0 paper by tweaking pedwarn > > > condition, adjusting pedw

RE: [PATCH 2/2] RISC-V: Add testcases for signed scalar SAT_ADD IMM form 2

2025-06-25 Thread Li, Pan2
> Pan -- can you cover reviewing the testsuite bits since thisis an area > where you've done a ton of work over the last year or so. Sure thing and thanks Jeff, I will take a look after return back from a vacation, ETA before the end of this week. Pan -Original Message- From: Jeff Law

Re: [PATCH] ivopts: Change constant_multiple_of to expand aff nodes.

2025-06-25 Thread Richard Biener
On Tue, 24 Jun 2025, Alfie Richards wrote: > Hi all, > > This is a small change to ivopts to expand SSA variables enabling ivopts to > correctly work out when an address IV step is set to be a multiple on index > step in the loop header (ie, not constant, not calculated each loop.) > > Seems lik

[PATCH][v2] tree-optimization/109892 - SLP reduction of fma

2025-06-25 Thread Richard Biener
The following adds the ability to vectorize a fma reduction pair as SLP reduction (we cannot yet handle ternary association in reduction vectorization yet). Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. I'll file a bug about the missed handling for fold-left reductions. PR

Re: [RFC] [lra] catch all to-sp eliminations [PR120424]

2025-06-25 Thread Vladimir Makarov
On 6/23/25 12:06 AM, Alexandre Oliva wrote: Alex, thanks for investigation of corner cases of register elimination. An x86_64-linux-gnu native with ix86_frame_pointer_required modified to return true for nonzero frames, to exercize lra_update_fp2sp_elimination, reveals in stage1 testing that

Re: [PATCH v1 2/2] middle-end: Enable masked load with non-constant offset

2025-06-25 Thread Richard Biener
On Tue, Jun 24, 2025 at 4:26 PM Karl Meakin wrote: > > The function `vect_check_gather_scatter` requires the `base` of the load > to be loop-invariant and the `off`set to be not loop-invariant. When faced > with a scenario where `base` is not loop-invariant, instead of giving up > immediately we c

[PATCH 16/17] Fortran: Silence a clang warning (suggesting a brace) in io.cc

2025-06-25 Thread Martin Jambor
Hi, when GCC is built with clang, it suggests that we add a brace to the initialization of format_asterisk: gcc/fortran/io.cc:32:16: warning: suggest braces around initialization of subobject [-Wmissing-braces] So this patch does that to silence it. Bootstrapped and tested on x86_64-linx. O

Re: [PATCH 06/17] value-relation.h: Mark dom_oracle::next_relation as override

2025-06-25 Thread Andrew MacLeod
BTW, consider all such future changes in ranger code pre-approved! Thanks Andrew On 6/25/25 10:27, Andrew MacLeod wrote: OK for all the ranger related patches. Thanks Andrew On 6/25/25 10:08, Martin Jambor wrote: Hi, When GCC is compiled with clang, it emits a warning that dom_oracle::nex

Re: [PATCH] vect: Misalign checks for gather/scatter.

2025-06-25 Thread Robin Dapp
This change reminds me that we lack documentation about arguments of most of the "complicated" internal functions ... I didn't mention it but I got implicitly reminded several times while writing the patch... ;) An overhaul has been on my todo list for a while but of course it never was top pr

[COMMITTED] - Remove unused vector in value-relation.cc.

2025-06-25 Thread Andrew MacLeod
On 6/23/25 18:21, Martin Jambor wrote: @@ -208,66 +208,6 @@ static const tree_code relation_to_code [VREL_LAST] = { ERROR_MARK, ERROR_MARK, LT_EXPR, LE_EXPR, GT_EXPR, GE_EXPR, EQ_EXPR, NE_EXPR }; -// This routine validates that a relation can be applied to a specific set of -// ranges

Re: [PATCH 15/17] coroutines: Removed unused private member in cp_coroutine_transform

2025-06-25 Thread Iain Sandoe
> On 25 Jun 2025, at 15:17, Martin Jambor wrote: > > Hi, > > when building GCC with clang, it warns that the private member suffix > in class cp_coroutine_transform (defined in gcc/cp/coroutines.h) is > not used which indeed looks like it is the case. This patch therefore > removes it. > >

Re: [PATCH 06/17] value-relation.h: Mark dom_oracle::next_relation as override

2025-06-25 Thread Andrew MacLeod
OK for all the ranger related patches. Thanks Andrew On 6/25/25 10:08, Martin Jambor wrote: Hi, When GCC is compiled with clang, it emits a warning that dom_oracle::next_relation is not marked as override even though it does override a virtual function of its ancestor. This patch marks it as

[PATCH v7 4/9] AArch64: add constants for branch displacements

2025-06-25 Thread Karl Meakin
Extract the hardcoded values for the minimum PC-relative displacements into named constants and document them. gcc/ChangeLog: * config/aarch64/aarch64.md (BRANCH_LEN_P_128MiB): New constant. (BRANCH_LEN_N_128MiB): Likewise. (BRANCH_LEN_P_1MiB): Likewise. (BRANCH_LE

[PATCH v7 5/9] AArch64: make `far_branch` attribute a boolean

2025-06-25 Thread Karl Meakin
The `far_branch` attribute only ever takes the values 0 or 1, so make it a `no/yes` valued string attribute instead. gcc/ChangeLog: * config/aarch64/aarch64.md (far_branch): Replace 0/1 with no/yes. (aarch64_bcond): Handle rename. (aarch64_cbz1): Likewise.

Re: [PATCH] c++/modules: Ensure type of partial spec VAR_DECL is consistent with its template [PR120644]

2025-06-25 Thread Jason Merrill
On 6/25/25 9:02 AM, Nathaniel Shead wrote: On Tue, Jun 24, 2025 at 12:10:09PM -0400, Patrick Palka wrote: On Tue, 24 Jun 2025, Jason Merrill wrote: On 6/23/25 5:41 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? -- >8 -- We were erroring becaus

[PATCH v7 0/9] AArch64: CMPBR support

2025-06-25 Thread Karl Meakin
This patch series adds support for the CMPBR extension. It includes the new `+cmpbr` option and rules to generate the new instructions when lowering conditional branches. Changelog: * v7: - Support far branches and add a test for them. - Replace `aarch64_cb_short_operand` with `aarch64_reg_or_

[PATCH v7 8/9] AArch64: rules for CMPBR instructions

2025-06-25 Thread Karl Meakin
Add rules for lowering `cbranch4` to CBB/CBH/CB when CMPBR extension is enabled. gcc/ChangeLog: * config/aarch64/aarch64-protos.h (aarch64_cb_rhs): New function. * config/aarch64/aarch64.cc (aarch64_cb_rhs): Likewise. * config/aarch64/aarch64.md (cbranch4): Rename to ...

[PATCH v7 7/9] AArch64: precommit test for CMPBR instructions

2025-06-25 Thread Karl Meakin
Commit the test file `cmpbr.c` before rules for generating the new instructions are added, so that the changes in codegen are more obvious in the next commit. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add `cmpbr` to the list of extensions. * gcc.target/aarch64/cmpbr.c: N

[PATCH v7 1/9] AArch64: place branch instruction rules together

2025-06-25 Thread Karl Meakin
The rules for conditional branches were spread throughout `aarch64.md`. Group them together so it is easier to understand how `cbranch4` is lowered to RTL. gcc/ChangeLog: * config/aarch64/aarch64.md (condjump): Move. (*compare_condjump): Likewise. (aarch64_cb1): Likewise.

Re: [PATCH] libstdc++: Type-erase chrono-data for formatting [PR110739]

2025-06-25 Thread Michael Welsh Duggan
Tomasz Kamiński writes: > This patch reworks the formatting for the chrono types, such that they are all > formatted in terms of _ChronoData class, that includes all required fields. > Populating each required field is performed in formatter for specific type, > based on the chrono-spec used. > >

Re: [PATCH 03/17] Diagnostics: Mark path_label::get_effects as final override

2025-06-25 Thread David Malcolm
On Wed, 2025-06-25 at 16:04 +0200, Martin Jambor wrote: > Hi, > > When compiling diagnostic-path-output.cc with clang, it warns that > path_label::get_effects should be marked as override.  That looks > like > a good idea and from a brief look I also believe it should be marked > as final (the oth

Re: [RFC PATCH] c++: Implement C++26 P3533R2 - constexpr virtual inheritance [PR120777]

2025-06-25 Thread Jason Merrill
On 6/25/25 3:08 AM, Jakub Jelinek wrote: On Tue, Jun 24, 2025 at 05:19:59PM -0400, Jason Merrill wrote: I think we could move the initialization of the fixed_type_p and virtual_access variables up, they don't need to be after cp_build_addr_expr. I don't understand why it doesn't depend on cp_b

Re: [RFC PATCH] c++: Implement C++26 P3533R2 - constexpr virtual inheritance [PR120777]

2025-06-25 Thread Jakub Jelinek
On Wed, Jun 25, 2025 at 12:37:33PM -0400, Jason Merrill wrote: > Ah, looks like fixed_type_or_null needs to handle a CALL_EXPR of class type > like a TARGET_EXPR. I also wonder why the call isn't already wrapped in a > TARGET_EXPR by build_cxx_call=>build_cplus_new at this point. Wonder if it has

Re: [PATCH 16/17] Fortran: Silence a clang warning (suggesting a brace) in io.cc

2025-06-25 Thread Steve Kargl
Thanks for cleaning up gfortran code. I was curious about what the GNU Coding Standard said about this case, but it does not consider initialization of subobjects. I did find 5.3 Clean Use of C Constructs ... Don't make the program ugly just to placate static analysis tools such as l

Re: [PATCH v6 9/9] AArch64: make rules for CBZ/TBZ higher priority

2025-06-25 Thread Richard Sandiford
Karl Meakin writes: > Move the rules for CBZ/TBZ to be above the rules for > CBB/CBH/CB. We want them to have higher priority > because they can express larger displacements. > > gcc/ChangeLog: > > * config/aarch64/aarch64.md (aarch64_cbz1): Move > above rules for CBB/CBH/CB. > (

[PATCH v3] x86: Add preserve_none and update no_caller_saved_registers attributes

2025-06-25 Thread H.J. Lu
Add preserve_none attribute which is similar to no_callee_saved_registers attribute, except on x86-64, r12, r13, r14, r15, rdi and rsi registers are used for integer parameter passing. This can be used in an interpreter to avoid saving/restoring the registers in functions which process byte codes.

Re: [PATCH 11/17] tree-vect-stmts.cc: Remove an unused shadowed variable

2025-06-25 Thread Richard Biener
> Am 25.06.2025 um 16:26 schrieb Martin Jambor : > > Hi, > > when compiling tree-vect-stmts.cc with clang, it emits a warning: > > gcc/tree-vect-stmts.cc:14930:19: warning: unused variable 'mode_iter' > [-Wunused-variable] > > And indeed, there are two mode_iter local variables in functio

[PATCH] tree-optimization/120808 - SLP build with mixed .FMA/.FMS

2025-06-25 Thread Richard Biener
The following allows SLP build to succeed when mixing .FMA/.FMS in different lanes like we handle mixed plus/minus. This does not yet address SLP pattern matching to not being able to form a FMADDSUB from this. Bootstrapped and tested on x86_64-unknown-linux-gnu. While the testcases are x86 spec

[Patch, Fortran, Coarray, PR88076, v1] 4/6 Add a shared memory multi process coarray library.

2025-06-25 Thread Andre Vehreschild
Hi all, fix incorrect declarations in the libcaf.h header and use the correct printf function when printing a va_list. (The latter is stripped into a separate file by the next patch of this series.) Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline? Regards, Andre -- Andre Vehre

Re: [RFC] [C]New syntax for the argument of counted_by attribute for C language

2025-06-25 Thread Bill Wendling
I posted this on the LLVM Discourse forum[1] and got some traction, so I want to get the GCC community's input. (My initial proposal is replicated here.) I had already mentioned this in previous emails in this thread, so it's nothing super new, and there have been some suggested improvements alrea

Re: [PATCH 1/4] c++: Add flag to detect underlying representative of bitfield decls

2025-06-25 Thread Jason Merrill
On 5/21/25 10:14 PM, Nathaniel Shead wrote: This patch isn't currently necessary with how I've currently done the follow-up patches, but is needed for avoiding any potential issues in the future with DECL_CONTEXT'ful types getting created in the compiler with no names on the fields. (For instanc

Re: [PATCH] c++: fix ICE with [[deprecated]] [PR120756]

2025-06-25 Thread Jason Merrill
On 6/25/25 1:28 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches? OK. -- >8 -- Here we end up with "error reporting routines re-entered" because resolve_nondeduced_context isn't passing complain to mark_used. PR c++/120756 gcc/cp/ChangeLo

Re: [PATCH] rtl-ssa: Fix test condition for insn_info::has_been_deleted

2025-06-25 Thread Richard Sandiford
Christoph Müllner writes: > insn_info::has_been_deleted () is documented to return true if an > instruction is deleted. Such instructions have their `volatile` bit set, > which can be tested via rtx_insn::deleted (). > > The current condition for insn_info::has_been_deleted () is: > * m_rtl is no

[PATCH v7 0/3] extend "counted_by" attribute to pointer fields of structures

2025-06-25 Thread Qing Zhao
This is the 7th version of the patch set to extend "counted_by" attribute to pointer fields of structures. The C FE parts (patch #1 and #3) of the 5th version have been approved by Joseph already (with a minor typo fix, which is included in this new version); The middle end part (patch #2) of t

Re: [PATCH v2 1/4] RISC-V: Add support for xtheadvector unit-stride segment load/store intrinsics

2025-06-25 Thread yunzezhu
> From:Kito Cheng > Send Time:2025 Jun. 19 (Thu.) 15:08 > To:yunzezhu; Jeff Law > CC:"gcc-patches" > Subject:Re: [PATCH v2 1/4] RISC-V: Add support for xtheadvector unit-stride > segment load/store intrinsics > > Hi YunZe: > > Generally I am open minded to accept vendor extensions, however thi

Re: [PATCH v3] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-06-25 Thread Jan Hubicka
> Here is the v3 patch. It no longer uses "rep mov/stos". Lili, can you > measure > its performance impact on Intel and AMD cpus? > > The updated generic has > > Update memcpy and memset inline strategies for -mtune=generic: > > 1. Don't align memory. This looks OK to me (recent microarchs s

[Patch, Fortran, Coarray, PR88076, v1] 2/6 Add a shared memory multi process coarray library.

2025-06-25 Thread Andre Vehreschild
Hi all, this patch fixes handling of optional arguments to coarray routines. Again I stumbled over this while implementing caf_shmem. I did not find a ticket either. Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline? Regards, Andre -- Andre Vehreschild * Email: vehre ad gmx dot

Re: Do not drop discriminator when inlining

2025-06-25 Thread Jan Hubicka
> > What seems to be common now is profile breakage around loops that has > > been fully unrolled or vectorized which is bit undderstandbale thought I > > wonder if we can improve here. I think we can fix problem where profile > > of loop header stmts is partly or fully lost (which seems to be mai

[PATCH] ivopts: Change constant_multiple_of to expand aff nodes.

2025-06-25 Thread Alfie Richards
Hi all, This is a small change to ivopts to expand SSA variables enabling ivopts to correctly work out when an address IV step is set to be a multiple on index step in the loop header (ie, not constant, not calculated each loop.) Seems like this might have compile speed costs that need to be cons

[PATCH 04/17] ranger: Mark several member functions as final override

2025-06-25 Thread Martin Jambor
Hi, When GCC is built with clang, it emits warnings that several member functions of various ranger classes override a virtual function of an ancestor but are not marked with the override keyword. After inspecting the cases, I found that all these classes had other member functions marked as fina

Re: [Patch, Fortran, Coarray, PR88076, v1] 0/6 Add a shared memory multi process coarray library.

2025-06-25 Thread Jerry D
On 6/24/25 11:49 PM, Andre Vehreschild wrote: Hi Jerry, thank you very much. Just try it. I can only imagine that Paul had a somehow corrupted build directory or left overs from some previous build. I am still wondering, that I got no automated mail from the build hosts, but I can imagine, that

[PATCH] c++: Implement C++26 P3618R0 - Allow attaching main to the global module [PR120773]

2025-06-25 Thread Jakub Jelinek
Hi! The following patch implements the P3618R0 paper by tweaking pedwarn condition, adjusting pedwarn wording, adjusting one testcase and adding 4 new ones. The paper was voted in as DR, so it isn't guarded on C++ version. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 202

Re: [Fortran, Patch, v1] 2/(3) Stop spending memory in coarray single mode executables.

2025-06-25 Thread Harald Anlauf
Am 25.06.25 um 13:42 schrieb Andre Vehreschild: Hi, attached patch prevents generation of a token component in derived types, when -fcoarray=single is used. Generating the token only wastes memory. It is never even initialized nor accessed. Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainl

Re: [Fortran, Patch, PR120711, v1] 1/(3) Fix out of bounds access in cleanup of array constructor

2025-06-25 Thread Harald Anlauf
Am 25.06.25 um 13:39 schrieb Andre Vehreschild: Hi all, attached patch fixes an out of bounds access in the clean up code of a concatenating array constructor. A fragment like list = [ list, something() ] lead to clean up using an offset (of the list array) that was manipulated in the loop cop

[PATCH] RISC-V: update prepare_ternary_operands to handle the vector-scalar case [PR120828]

2025-06-25 Thread Paul-Antoine Arras
This is a followup to 92e1893e0 "RISC-V: Add patterns for vector-scalar multiply-(subtract-)accumulate" that caused an ICE in some cases where the mult operands were wrongly swapped. This patch ensures that operands are not swapped in the vector-scalar case. PR target/120828 gcc/ChangeLog

[PATCH v7 9/9] AArch64: make rules for CBZ/TBZ higher priority

2025-06-25 Thread Karl Meakin
Move the rules for CBZ/TBZ to be above the rules for CBB/CBH/CB. We want them to have higher priority because they can express larger displacements. gcc/ChangeLog: * config/aarch64/aarch64.md (aarch64_cbz1): Move above rules for CBB/CBH/CB. (*aarch64_tbz1): Likewise. gcc/

[PATCH v2 2/2] middle-end: Enable masked load with non-constant offset

2025-06-25 Thread Karl Meakin
The function `vect_check_gather_scatter` requires the `base` of the load to be loop-invariant and the `off`set to be not loop-invariant. When faced with a scenario where `base` is not loop-invariant, instead of giving up immediately we can try swapping the `base` and `off`, if `off` is actually loo

Re: [Fortran, Patch, v1] 3/(3) Prevent creating tree that is never used.

2025-06-25 Thread Harald Anlauf
Am 25.06.25 um 13:45 schrieb Andre Vehreschild: Hi, while hunting for pr120711 I found a construct where a call-tree was created and never used. The patch now just suppresses the tree creation and instead uses directly the tree that is desired. Regtests ok on x86_64-pc-linux-gnu / F41. Ok for m

Re: [RFC PATCH] c++: Implement C++26 P3533R2 - constexpr virtual inheritance [PR120777]

2025-06-25 Thread Jason Merrill
On 6/25/25 12:49 PM, Jakub Jelinek wrote: On Wed, Jun 25, 2025 at 12:37:33PM -0400, Jason Merrill wrote: Ah, looks like fixed_type_or_null needs to handle a CALL_EXPR of class type like a TARGET_EXPR. I also wonder why the call isn't already wrapped in a TARGET_EXPR by build_cxx_call=>build_cpl

[PATCH v7 2/9] AArch64: reformat branch instruction rules

2025-06-25 Thread Karl Meakin
Make the formatting of the RTL templates in the rules for branch instructions more consistent with each other. gcc/ChangeLog: * config/aarch64/aarch64.md (cbranch4): Reformat. (cbranchcc4): Likewise. (condjump): Likewise. (*compare_condjump): Likewise. (aar

[PATCH v6 7/9] AArch64: precommit test for CMPBR instructions

2025-06-25 Thread Karl Meakin
Commit the test file `cmpbr.c` before rules for generating the new instructions are added, so that the changes in codegen are more obvious in the next commit. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add `cmpbr` to the list of extensions. * gcc.target/aarch64/cmpbr.c: N

  1   2   >