[PATCH v3 2/2] RISC-V: Add a new constraint to ensure that the vl of XTheadVector does not produce a non-zero immediate.

2025-01-16 Thread Jin Ma
Although we have handled the vl of XTheadVector correctly in the expand phase and predicates, the results show that the work is still insufficient. In the curr_insn_transform function, the insn is transformed from: (insn 69 67 225 12 (set (mem:RVVM8SF (reg/f:DI 218 [ _77 ]) [0 S[128, 128] A32])

[PATCH v3 1/2] RISC-V: Allocate the initial register in the expand phase for the vl of XTheadVector

2025-01-16 Thread Jin Ma
Since the parameter vl of XTheadVector does not support immediate numbers, we need to put it in the register in advance. That generates the initial code correctly. PR 116593 gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (function_expander::add_input_operand): P

Re: [PATCH] tree-optimization/92539 - missed optimization leads to bogus -Warray-bounds

2025-01-16 Thread Richard Biener
On Wed, 15 Jan 2025, Richard Biener wrote: > The following makes niter analysis recognize a loop with an exit > condition scanning over a STRING_CST. This is done via enhancing > the force evaluation code rather than recognizing for example > strlen (s) as number of iterations because it allows t

Re: [PATCH 2/2] match: Improve the `x ==/!= ~x` pattern [PR118483]

2025-01-16 Thread Richard Biener
On Fri, Jan 17, 2025 at 1:11 AM Andrew Pinski wrote: > > This improves this pattern by 2 ways: > * Allow for an optional convert, similar to how the few other > `a OP ~a` patterns also allow for an optional convert. > * Use bitwise_inverted_equal_p/maybe_bit_not instead of directly > matching

Re: [PATCH] Fix uniqueness of symtab_node::get_dump_name.

2025-01-16 Thread Richard Biener
On Thu, 16 Jan 2025, Michal Jires wrote: > symtab_node::get_dump_name uses node order to identify nodes. > Order is no longer unique because of Incremental LTO patches. > This patch moves uid from cgraph_node node to symtab_node, > so get_dump_name can use uid instead and get back unique dump name

Re: [PATCH] i386: Fix wrong insn generated by shld/shrd ndd split [PR118510]

2025-01-16 Thread Uros Bizjak
On Fri, Jan 17, 2025 at 4:38 AM Hongyu Wang wrote: > > Hi, > > For shld/shrd_ndd_2 insn, the spiltter outputs wrong pattern that > mixed parallel for clobber and set. Separate out the set to dest > from parallel to fix it. > > Bootstrapped & regtested on x86-64-pc-linux-gnu. > > Ok for trunk? > >

Re: [PATCH] c++: Friend classes don't shadow enclosing template class paramater [PR118255]

2025-01-16 Thread Simon Martin
On 17 Jan 2025, at 0:12, Jason Merrill wrote: > On 1/5/25 11:19 AM, Simon Martin wrote: >> We currently reject the following code >> >> === code here === >> template struct S { friend class non_template; }; >> class non_template {}; >> S<0> s; >> === code here === >> >> While EDG agrees with the

RE: [COMMITTED] OpenMP: Fix metadirective test failures on x86_64 with -m32

2025-01-16 Thread Jiang, Haochen
> From: Sandra Loosemore > Sent: Friday, January 17, 2025 12:11 PM > Thanks for the quick fix! Thx, Haochen > gcc/testsuite/ChangeLog > * c-c++-common/gomp/metadirective-device.c: Don't add extra > options > for target ia32. > * c-c++-common/gomp/metadirective-target-device-1

Re: [PATCH] MIPS: Add conditions for use of the -mmips16e2 and -mips16 option.

2025-01-16 Thread Rong Zhang
On Thu, 2025-01-16 at 11:41 +, Maciej W. Rozycki wrote: > On Thu, 16 Jan 2025, Jie Mei wrote: > > > Make -mmips16e2 imply -mips16 as the ASE requires, so users won't > > be surprised even if they expect it to. Meanwhile, check if > > mips_isa_rev <= 5 when -mips16 is effective and >= 1 when -m

[COMMITTED] OpenMP: Fix metadirective test failures on x86_64 with -m32

2025-01-16 Thread Sandra Loosemore
gcc/testsuite/ChangeLog * c-c++-common/gomp/metadirective-device.c: Don't add extra options for target ia32. * c-c++-common/gomp/metadirective-target-device-1.c: Likewise. --- gcc/testsuite/c-c++-common/gomp/metadirective-device.c | 2 +- gcc/testsuite/c-c++-common

Re: [PATCH 2/2] LoongArch: Improve reassociation for bitwise operation and left shift [PR 115921]

2025-01-16 Thread Xi Ruoyao
于 2025年1月15日 GMT+08:00 下午6:12:34,Xi Ruoyao 写道: >For things like > >(x | 0x101) << 11 > >It's obvious to write: > >ori $r4,$r4,257 >slli.d $r4,$r4,11 > >But we are actually generating something insane: > >lu12i.w $r12,524288>>12 # 0x8 >

[PATCH] i386: Fix wrong insn generated by shld/shrd ndd split [PR118510]

2025-01-16 Thread Hongyu Wang
Hi, For shld/shrd_ndd_2 insn, the spiltter outputs wrong pattern that mixed parallel for clobber and set. Separate out the set to dest from parallel to fix it. Bootstrapped & regtested on x86-64-pc-linux-gnu. Ok for trunk? gcc/ChangeLog: PR target/118510 * config/i386/i386.md (

RE: gcc mode switching issue (was Re: RISC-V round_away () handling of non canonical rounding modes)

2025-01-16 Thread Li, Pan2
It is 627.cam4_s or 527.cam4_r? I can help to reproduce this from k1 board. Pan -Original Message- From: Vineet Gupta Sent: Friday, January 17, 2025 10:23 AM To: Li, Pan2 Cc: Jeff Law ; Palmer Dabbelt ; gnu-toolchain ; Robin Dapp ; juzhe.zh...@rivai.ai; GCC Patches Subject: Re: gcc

Re: gcc mode switching issue (was Re: RISC-V round_away () handling of non canonical rounding modes)

2025-01-16 Thread Vineet Gupta
On 1/16/25 18:02, Li, Pan2 wrote: > Hi Vineet, > > Is there any more information about the issue description here? Like steps > for reproducing, as well as expect behavior but actual result.. etc. > It is not easy to start the investigation with blow mail thread. Thanks a lot. At a high level SPE

RE: gcc mode switching issue (was Re: RISC-V round_away () handling of non canonical rounding modes)

2025-01-16 Thread Li, Pan2
Hi Vineet, Is there any more information about the issue description here? Like steps for reproducing, as well as expect behavior but actual result.. etc. It is not easy to start the investigation with blow mail thread. Thanks a lot. Pan -Original Message- From: Vineet Gupta Sent: Fri

gcc mode switching issue (was Re: RISC-V round_away () handling of non canonical rounding modes)

2025-01-16 Thread Vineet Gupta
On 1/16/25 15:07, Vineet Gupta wrote: > +CC Juzhe, Robin, gcc patches mailing list > > On 1/16/25 14:49, Andrew Waterman wrote: >> On Thu, Jan 16, 2025 at 11:43 AM Vineet Gupta wrote: >>> On 1/16/25 11:14, Joseph Myers wrote: The simple thing to do is to change sysdeps/riscv/rvf/get-rounding-

[PATCH] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-16 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- The recent r15-6369 unfortunately caused a bad wrong-code issue. Here we have TARGET_EXPR and call cp_fold_r -> maybe_constant_init with object=D.2996. In cxx_eval_outermost_constant_expr we now take the type of the object

[r15-6963 Regression] FAIL: c-c++-common/gomp/metadirective-target-device-1.c -std=c++98 scan-tree-dump-times optimized "GOMP_error" 0 on Linux/x86_64

2025-01-16 Thread haochen.jiang
On Linux/x86_64, fdeceba59bee60040fd58203b6fe0239d789eade is the first bad commit commit fdeceba59bee60040fd58203b6fe0239d789eade Author: Sandra Loosemore Date: Wed Jan 8 01:55:47 2025 + OpenMP: Shared metadirective/dynamic selector tests for C and C++ caused FAIL: c-c++-common/gomp/

Re: [PATCH v3 3/6] c++: Fix ABI for lambdas declared in alias templates [PR116568]

2025-01-16 Thread Nathaniel Shead
On Thu, Jan 16, 2025 at 07:09:33PM -0500, Jason Merrill wrote: > On 1/6/25 7:22 AM, Nathaniel Shead wrote: > > I'm not 100% sure I've handled this properly, any feedback welcome. > > In particular, maybe should I use `DECL_IMPLICIT_TYPEDEF_P` in the > > mangling logic instead of `!TYPE_DECL_ALIAS_P

Re: [PATCH v3 1/6] c++: Fix mangling of lambdas in static data member initializers [PR107741]

2025-01-16 Thread Jason Merrill
On 1/6/25 7:21 AM, Nathaniel Shead wrote: This fixes an issue where lambdas declared in the initializer of a static data member within the class body do not get a mangling scope of that variable; this results in mangled names that do not conform to the ABI spec. To do this, the patch splits up g

[PATCH 2/2] match: Improve the `x ==/!= ~x` pattern [PR118483]

2025-01-16 Thread Andrew Pinski
This improves this pattern by 2 ways: * Allow for an optional convert, similar to how the few other `a OP ~a` patterns also allow for an optional convert. * Use bitwise_inverted_equal_p/maybe_bit_not instead of directly matching bit_not. Just like the other patterns do too. Note pr118483-2.c u

[PATCH 1/2] c++: Don't call fold from cp_fold if one of the operands is an error_mark [PR118525]

2025-01-16 Thread Andrew Pinski
While adding a new match pattern, g++.dg/cpp2a/consteval36.C started to ICE and that was because we would call fold even if one of the operands of the comparison was an error_mark_node. I found a new testcase which also ICEs before this patch too so show the issue was latent. So there is code i

Re: [PATCH v3 3/6] c++: Fix ABI for lambdas declared in alias templates [PR116568]

2025-01-16 Thread Jason Merrill
On 1/6/25 7:22 AM, Nathaniel Shead wrote: I'm not 100% sure I've handled this properly, any feedback welcome. In particular, maybe should I use `DECL_IMPLICIT_TYPEDEF_P` in the mangling logic instead of `!TYPE_DECL_ALIAS_P`? They both seem to work in this case but not sure which would be clearer

[GCC-14][committed] d: Fix record layout of compiler-generated TypeInfo_Class [PR115249]

2025-01-16 Thread Iain Buclaw
Hi, This is the backport of r15-6983 to releases/gcc-14. In r14-8766, the layout of TypeInfo_Class changed in the runtime library, but didn't get reflected in the compiler-generated data, causing a corruption of runtime type introspection on BigEndian targets. This adjusts the size of the `Class

[committed] d: Fix record layout of compiler-generated TypeInfo_Class [PR115249]

2025-01-16 Thread Iain Buclaw
Hi, In r14-8766, the layout of TypeInfo_Class changed in the runtime library, but didn't get reflected in the compiler-generated data, causing a corruption of runtime type introspection on BigEndian targets. This adjusts the size of the `ClassFlags' field from uint to ushort, and adds a new ushor

Re: [PATCH] c++: Friend classes don't shadow enclosing template class paramater [PR118255]

2025-01-16 Thread Jason Merrill
On 1/5/25 11:19 AM, Simon Martin wrote: We currently reject the following code === code here === template struct S { friend class non_template; }; class non_template {}; S<0> s; === code here === While EDG agrees with the current behaviour, clang and MSVC don't (see https://godbolt.org/z/69TGa

Re: [GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Bill Wendling
On Thu, Jan 16, 2025 at 3:06 PM Qing Zhao wrote: > > On Jan 16, 2025, at 17:29, Bill Wendling wrote: > > > > On Thu, Jan 16, 2025 at 1:19 PM Qing Zhao wrote: > >> > >> Hi, > >> > >> This is the patch set to extend "counted_by" attribute to pointer fields > >> of structures. > >> > >> For exampl

Re: [GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Qing Zhao
> On Jan 16, 2025, at 17:29, Bill Wendling wrote: > > On Thu, Jan 16, 2025 at 1:19 PM Qing Zhao wrote: >> >> Hi, >> >> This is the patch set to extend "counted_by" attribute to pointer fields of >> structures. >> >> For example: >> >> struct PP { >> size_t count2; >> char other1; >> ch

Re: [PATCH] c++: bogus error with nested lambdas [PR117602]

2025-01-16 Thread Marek Polacek
On Wed, Jan 15, 2025 at 04:18:36PM -0500, Jason Merrill wrote: > On 1/15/25 12:55 PM, Marek Polacek wrote: > > On Wed, Jan 15, 2025 at 09:39:41AM -0500, Jason Merrill wrote: > > > On 11/15/24 9:08 AM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > >

Re: [GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Bill Wendling
On Thu, Jan 16, 2025 at 1:19 PM Qing Zhao wrote: > > Hi, > > This is the patch set to extend "counted_by" attribute to pointer fields of > structures. > > For example: > > struct PP { > size_t count2; > char other1; > char *array2 __attribute__ ((counted_by (count2))); > int other2; > } *

Re: [PATCH] c++: Relax checking assert about elision to support -fno-elide-constructors [PR114619]

2025-01-16 Thread Jason Merrill
On 10/19/24 5:09 AM, Simon Martin wrote: We currently ICE in checking mode with cxx_dialect < 17 on the following valid code === cut here === struct X { X(const X&) {} }; extern X x; void foo () { new X[1]{x}; } === cut here === The problem is that cp_gimplify_expr gcc_checking_asserts th

[PATCH V2] rs6000: Disassemble opaque modes using subregs to allow optimizations [PR109116]

2025-01-16 Thread Peter Bergner
Unfortunately I accidentally dropped this patch series without posting V2 after Kewen's patch review. :-( Here's V2 with the suggested changes made. Here is the thread from the V1 patch submission: https://inbox.sourceware.org/gcc-patches/1f32e2bf-83c2-4664-b7f3-4a6996978...@linux.ibm.com/ Chan

Re: [PATCH v8] c++: Fix overeager Woverloaded-virtual with conversion operators [PR109918]

2025-01-16 Thread Jason Merrill
On 10/16/24 11:43 AM, Simon Martin wrote: As you know the patch had to be reverted due to PR117114, that highlighted a bunch of issues with comparing DECL_VINDEXes: it might give false positives in case of multiple inheritance (the case in PR117114), but also if there’s single inheritance by the

Re: [PATCH 0/5] Add btf_decl_tag and btf_type_tag C attributes

2025-01-16 Thread Yonghong Song
On 10/30/24 11:31 AM, David Faust wrote: This patch series adds support for the btf_decl_tag and btf_type_tag attributes to GCC. This entails: - Two new C-family attributes that allow to associate (to "tag") particular declarations and types with arbitrary strings. As explained below, thi

[GCC16 stage 1][RFC][C][PATCH 3/3] Use the counted_by attribute of pointers in array bound checker.

2025-01-16 Thread Qing Zhao
Current array bound checker only instruments ARRAY_REF, and the INDEX information is the 2nd operand of the ARRAY_REF. When extending the array bound checker to pointer references with counted_by attributes, the hardest part is to get the INDEX of the corresponding array ref from the offset comput

[GCC16 stage 1][RFC][PATCH 2/3] Convert a pointer reference with counted_by attribute to .ACCESS_WITH_SIZE and use it in builtinin-object-size.

2025-01-16 Thread Qing Zhao
gcc/c/ChangeLog: * c-typeck.cc (build_counted_by_ref): Handle pointers with counted_by. (build_access_with_size_for_counted_by): Likewise. gcc/ChangeLog: * tree-object-size.cc (access_with_size_object_size): Handle pointers with counted_by. (collect_object

[GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Qing Zhao
Hi, This is the patch set to extend "counted_by" attribute to pointer fields of structures. For example: struct PP { size_t count2; char other1; char *array2 __attribute__ ((counted_by (count2))); int other2; } *pp; specifies that the "array2" is an array that is pointed by the pointer

[GCC16 stage 1][RFC][C][PATCH 1/3] Extend "counted_by" attribute to pointer fields of structures.

2025-01-16 Thread Qing Zhao
For example: struct PP { size_t count2; char other1; char *array2 __attribute__ ((counted_by (count2))); int other2; } *pp; specifies that the "array2" is an array that is pointed by the pointer field, and its number of elements is given by the field "count2" in the same structure. gcc/c

Re: [PATCH] [testsuite] [arm] adjust wmul expectations [PR113560]

2025-01-16 Thread Mike Stump
On Jan 16, 2025, at 11:46 AM, Alexandre Oliva wrote: > > Since the machine-independent widening multiply logic was improved > PR113560, ARM's wmul-[567].c fail. AFAICT the logic takes advantage > of the fact that, after zero-extending a narrow integral type to a > wider type, further zero- or si

Re: [PATCH] [testsuite] [arm] multilibs.exp: adjust float abi opt matching

2025-01-16 Thread Mike Stump
On Jan 16, 2025, at 11:43 AM, Alexandre Oliva wrote: > > The regexp that matches options that mess with multilibs matches > -mfloat=abi=, but that's probably a typo for -mfloat-abi=. Fix that, > and add -msoft-float and -mhard-float. > > Regstrapped on x86_64-linux-gnu, also tested on arm-eabi

Re: [PATCH] [testsuite] skip test on non-hosted libstdc++ [PR113994]

2025-01-16 Thread Mike Stump
On Jan 16, 2025, at 11:42 AM, Alexandre Oliva wrote: > > Tests that include need to be skipped when libstdc++ is built > in freestanding mode. Ok. > for gcc/testsuite/ChangeLog > > PR rtl-optimization/113994 > * g++.dg/pr113994.C: Require hosted libstdc++.

Re: [PATCH #2/2] [testsuite] drop explicit run overrider in more dfp tests

2025-01-16 Thread Mike Stump
On Jan 16, 2025, at 11:39 AM, Alexandre Oliva wrote: > > A few more dfp tests that recently got backported to gcc-14 override > dfp.exp's selection of default action depending on dfprt. Let the > default stand. > > This is a followup of the patch I've just pinged. Regstrapped on > x86_64-linux

Re: [PATCH] [testsuite] rearrange requirements for dfp bitint run tests

2025-01-16 Thread Mike Stump
On Jan 9, 2025, at 10:25 PM, Alexandre Oliva wrote: > > dfp.exp sets the default to compile when dfprt is not available, but > some dfp bitint tests override the default without that requirement, > and try to run even when dfprt is not available. > > Instead of overriding the default, rewrite th

[PATCH] c++: Use mapped reads and writes when munmap and msync are available

2025-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu. Okay for trunk? Dave --- c++: Use mapped reads and writes when munmap and msync are available Module support is broken when MAPPED_READING and MAPPED_WRITING are defined to 0. This causes internal compiler errors in the permissive-error

RE: [RFC] PR81358: Enable automatic linking of libatomic

2025-01-16 Thread Joseph Myers
On Thu, 16 Jan 2025, Prathamesh Kulkarni wrote: > Hi Joseph, > Does the above patch in: > https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673155.html look OK to > commit (altho it's stage-4 now) ? > It fixes all the fallouts observed so far (multilib, nvptx offloading, > libdruntime). M

Re: [pushed]PR118067][LRA]: Use the right mode to evaluate secondary memory reload

2025-01-16 Thread Uros Bizjak
On Thu, Jan 16, 2025 at 8:25 PM Vladimir Makarov wrote: > > The following patch solves > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 > > The patch was successfully tested and bootstrapped on x86_64, aarch64, and > ppc64le. Unfortunately, the testcase still fails when -mtune=k8 is added

Re: [PATCH] libstdc++: Use string::push_back instead of string::operator+=

2025-01-16 Thread Aditya K
>> From db5036e40ed7ac43b66ca74c44ec8d0bdc934b07 Mon Sep 17 00:00:00 2001 >> From: AdityaK >> <1108430...@users.noreply.github.com> >> Date: Sun, 29 Dec 2024 18:14:29 -0800 >> Subject: [PATCH] libstdc++: Use string::push_back instead of >> string::opera

[PATCH] [testsuite] [arm] multilibs.exp: adjust float abi opt matching

2025-01-16 Thread Alexandre Oliva
The regexp that matches options that mess with multilibs matches -mfloat=abi=, but that's probably a typo for -mfloat-abi=. Fix that, and add -msoft-float and -mhard-float. Regstrapped on x86_64-linux-gnu, also tested on arm-eabi and aarch64-elf. Ok to install? for gcc/testsuite/ChangeLog

Re: [PATCH] libfortran: fix conversion of UNSIGNED(kind=16) to decimal in output [PR118406]

2025-01-16 Thread Harald Anlauf
Hi Thomas, Am 16.01.25 um 20:38 schrieb Thomas Koenig: Hello Harald, the conversion of (unsigned) integers to decimal in output was designed to be efficient up to INTEGER(kind=16) and did not handle values larger than roughly (10^19 * 2^64). The attached obvious patch fixes this. Regtested o

[PATCH] [testsuite] [arm] adjust wmul expectations [PR113560]

2025-01-16 Thread Alexandre Oliva
Since the machine-independent widening multiply logic was improved PR113560, ARM's wmul-[567].c fail. AFAICT the logic takes advantage of the fact that, after zero-extending a narrow integral type to a wider type, further zero- or sign-extending is equivalent, which enables different instruction

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread David Malcolm
On Thu, 2025-01-16 at 22:58 +0800, Gerald Pfeifer wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > The heading elements in our website contain "id" information, > > but currently to find them you to look at the page source, > > whereas in the generated HTML for the manual we have e.g.: > > >

[PATCH] [testsuite] skip test on non-hosted libstdc++ [PR113994]

2025-01-16 Thread Alexandre Oliva
Tests that include need to be skipped when libstdc++ is built in freestanding mode. for gcc/testsuite/ChangeLog PR rtl-optimization/113994 * g++.dg/pr113994.C: Require hosted libstdc++. --- gcc/testsuite/g++.dg/torture/pr113994.C |1 + 1 file changed, 1 insertion(+) dif

[PATCH #2/2] [testsuite] drop explicit run overrider in more dfp tests

2025-01-16 Thread Alexandre Oliva
A few more dfp tests that recently got backported to gcc-14 override dfp.exp's selection of default action depending on dfprt. Let the default stand. This is a followup of the patch I've just pinged. Regstrapped on x86_64-linux-gnu, also tested on arm-eabi and aarch64-elf. Ok to install? fo

Re: [PATCH] libfortran: fix conversion of UNSIGNED(kind=16) to decimal in output [PR118406]

2025-01-16 Thread Thomas Koenig
Hello Harald, the conversion of (unsigned) integers to decimal in output was designed to be efficient up to INTEGER(kind=16) and did not handle values larger than roughly (10^19 * 2^64). The attached obvious patch fixes this. Regtested on x86_64-pc-linux-gnu.  OK for mainline? OK. Thanks a

Re: [PATCH] [testsuite] rearrange requirements for dfp bitint run tests

2025-01-16 Thread Alexandre Oliva
On Jan 10, 2025, Alexandre Oliva wrote: > dfp.exp sets the default to compile when dfprt is not available, but > some dfp bitint tests override the default without that requirement, > and try to run even when dfprt is not available. > Instead of overriding the default, rewrite the requirements s

[PATCH] libfortran: fix conversion of UNSIGNED(kind=16) to decimal in output [PR118406]

2025-01-16 Thread Harald Anlauf
Dear all, the conversion of (unsigned) integers to decimal in output was designed to be efficient up to INTEGER(kind=16) and did not handle values larger than roughly (10^19 * 2^64). The attached obvious patch fixes this. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From

[pushed]PR118067][LRA]: Use the right mode to evaluate secondary memory reload

2025-01-16 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 The patch was successfully tested and bootstrapped on x86_64, aarch64, and ppc64le. commit d9835825b3d7193b3d6669174f4386be2cb1 Author: Vladimir N. Makarov Date: Thu Jan 16 12:17:31 2025 -0500 [PR118067

Re: PING **(6./7.): [patch, Fortran] -fc-prototypes fixes.

2025-01-16 Thread Thomas Koenig
Am 16.01.25 um 01:50 schrieb Jerry D: Yes I think this is OK, a definite improvement. Committed as r15-6967. Thanks for the review! Best regards Thomas

Re: [PATCH] c++: 'this' capture clobbered during recursive inst [PR116756]

2025-01-16 Thread Patrick Palka
On Mon, 13 Jan 2025, Jason Merrill wrote: > On 1/10/25 2:20 PM, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > OK for trunk? > > > > The documentation for LAMBDA_EXPR_THIS_CAPTURE seems outdated because > > it says the field is only used at parse ti

Re: [PATCH v6 0/6] Remaining patches for metadirectives/dynamic selectors

2025-01-16 Thread Sandra Loosemore
On 1/14/25 20:38, Sandra Loosemore wrote: I've incorporated a fix for Tobias's recent comment about recognizing C_OMP_DIR_META in the "assumes" directive in the C and C++ front ends, but I've deferred fixing the wording of the existing error message because it affects a pile of testcases unrelate

[GCC-14][committed] d: Fix ICE in dmd.expressionsem.resolveLoc

2025-01-16 Thread Iain Buclaw
Hi, This patch backports the individual fix for PR116373 from the upstream merge in r15-6559-g332cf038fda109 into the releases/gcc-14 branch. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, and committed to branch. Regards, Iain. --- PR d/116373 gcc/d/ChangeLog: *

[committed] d: Add testcase for fixed PR116373

2025-01-16 Thread Iain Buclaw
Hi, This patch adds a testcase for a PR that was fixed in upstream, and merged in r15-6559-g332cf038fda109. Regression tested on x86_64-linux-gnu, and committed to mainline. Regards, Iain. --- PR d/116373 gcc/testsuite/ChangeLog: * gdc.dg/pr116373.d: New test. --- gcc/testsui

RE: [RFC] PR81358: Enable automatic linking of libatomic

2025-01-16 Thread Prathamesh Kulkarni
> -Original Message- > From: Prathamesh Kulkarni > Sent: 10 January 2025 09:48 > To: Thomas Schwinge > Cc: Tobias Burnus ; Joseph Myers > ; Xi Ruoyao ; Matthew > Malcomson ; gcc-patches@gcc.gnu.org; Tom de > Vries > Subject: RE: [RFC] PR81358: Enable automatic linking of libatomic > >

Re: Ping: [PATCH] d,ada/spec: only sub nostd{inc,lib} rather than nostd{inc,lib}*

2025-01-16 Thread Iain Buclaw
Excerpts from Arsen Arsenović's message of Oktober 7, 2024 11:31 pm: > Ping on this patch. > Thanks, this is OK for D. Note, that the gdc driver does try to accomodate for mixing C++ and D code in the same application - so given: gdc a.d b.cc It adds -lstdc++ to the link command for conve

[patch,avr] Use INT_N to built-in define __int24.

2025-01-16 Thread Georg-Johann Lay
This patch uses the INT_N interface to define __int24. Ok for trunk? Johann -- AVR: Use INT_N to built-in define __int24. This patch uses the INT_N interface to define __int24 in avr-modes.def. Since the testsuite uses -Wpedantic and __int24 is a C/C++ extension, uses of __int24 and __uint24

Re: [PATCH] rs6000: Fix loop limit for built-in constant checking

2025-01-16 Thread Peter Bergner
On 1/10/25 11:18 AM, Peter Bergner wrote: > The loop checking for built-in constant operand restrictions was missing > some operands due to the loop limit being too small. Fixing that exposed > a testsuite failure which is caused by a typo in the pmxvi4ger8pp definition > where we had made the PMA

Re: [PATCH] rs6000: Fix ICE for invalid constants in built-in functions

2025-01-16 Thread Peter Bergner
On 1/13/25 3:59 PM, Peter Bergner wrote: > rs6000: Fix ICE for invalid constants in built-in functions > > For invalid constant operand values used in built-in functions, return > const0_rtx to signify an error occurred during expansion. > > Bootstrapped and retested on powerlc64le-linux with no

[PATCH] Fix uniqueness of symtab_node::get_dump_name.

2025-01-16 Thread Michal Jires
symtab_node::get_dump_name uses node order to identify nodes. Order is no longer unique because of Incremental LTO patches. This patch moves uid from cgraph_node node to symtab_node, so get_dump_name can use uid instead and get back unique dump names. In inlining passes, uid is replaced with more

[Patch] Fortran/OpenMP: Fix declare_variant's 'adjust_args' mishandling with return by reference [PR118321]

2025-01-16 Thread Tobias Burnus
For declare_variant's 'adjust_args', the arguments for need_device_ptr are referenced by argument number. This patch fixes that calculation if hidden arguments due to return-by-reference calling exist. Note: It only fixes the Fortran issue; the C++ issue still needs to be fixed. Build + regteste

Re: [PATCH] c++, v2: Fix up reshape_* RAW_DATA_CST handling [PR118214]

2025-01-16 Thread Jason Merrill
On 1/15/25 4:29 PM, Jakub Jelinek wrote: On Wed, Jan 15, 2025 at 10:27:56AM -0500, Jason Merrill wrote: @@ -7432,12 +7426,18 @@ reshape_init_r (tree type, reshape_iter { vec *v = 0; CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init); - tree raw_init = cp_maybe_split_

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread David Malcolm
On Thu, 2025-01-16 at 22:58 +0800, Gerald Pfeifer wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > The heading elements in our website contain "id" information, > > but currently to find them you to look at the page source, > > whereas in the generated HTML for the manual we have e.g.: > > >

Re: [PATCH]AArch64: have -mcpu=native detect architecture extensions for unknown non-homogenous systems [PR113257]

2025-01-16 Thread Richard Sandiford
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Thursday, January 16, 2025 7:11 AM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; ktkac...@gcc.gnu.org >> Subject: Re: [PATCH]AArch64: have -mcpu=native detect architectur

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Jason Merrill
On 1/16/25 10:25 AM, Simon Martin wrote: On 16 Jan 2025, at 16:05, Jason Merrill wrote: On 1/16/25 7:19 AM, Simon Martin wrote: Hi Jakub, Jason, On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: --- a/gcc/cp/decl.cc +++ b/gcc/cp/d

[PATCH] libstdc++: fix possible undefined std::timespec in module std

2025-01-16 Thread yxj-github-437
I notice std::timespec and std::timespec_get are used in preprocessor condition _GLIBCXX_HAVE_TIMESPEC_GET. So in module std, it should be the same. libstdc++-v3: * src/c++23/std-clib.cc.in: move std::timespec in preprocessor condition _GLIBCXX_HAVE_TIMESPEC_GET --- libstdc++-v3/s

Re: [PATCH] c++: Change c++2b and gnu++2b to c++23 and gnu++23 in C++ diagnostics

2025-01-16 Thread Jason Merrill
On 1/15/25 4:31 PM, Jakub Jelinek wrote: Hi! This is something we should have done when -std=c++23 was made the primary option and -std=c++2b turned into undocumented alias. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. 2025-01-15 Jakub Jelinek gcc/cp/

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Simon Martin
On 16 Jan 2025, at 16:05, Jason Merrill wrote: > On 1/16/25 7:19 AM, Simon Martin wrote: >> Hi Jakub, Jason, >> >> On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: >> >>> On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: > --- a/gcc/cp/decl.cc > +++ b/gcc/cp/decl.cc > @@ -11

RE: [PATCH]AArch64: have -mcpu=native detect architecture extensions for unknown non-homogenous systems [PR113257]

2025-01-16 Thread Tamar Christina
> -Original Message- > From: Richard Sandiford > Sent: Thursday, January 16, 2025 7:11 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; ktkac...@gcc.gnu.org > Subject: Re: [PATCH]AArch64: have -mcpu=native detect architecture extensions > for unknown non-h

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Jason Merrill
On 1/16/25 7:19 AM, Simon Martin wrote: Hi Jakub, Jason, On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -11686,6 +11686,7 @@ fold_sizeof_expr (tree t)

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread Gerald Pfeifer
On Wed, 15 Jan 2025, David Malcolm wrote: > The heading elements in our website contain "id" information, > but currently to find them you to look at the page source, > whereas in the generated HTML for the manual we have e.g.: > > ¶ > > which shows up nicely in the browser in e.g. > https://

Honor dump options for C/C++ '-fdump-tree-original'

2025-01-16 Thread Thomas Schwinge
Hi! I have noticed that '-fdump-tree-original-lineno' for Fortran (for example) does dump location information, but for C/C++ it does not. The reason is that Fortran (and other front ends) use code like: /* Output the GENERIC tree. */ dump_function (TDI_original, fndecl); ..., but 'gcc/

Re: [PATCH v3 2/2] RISC-V: Update Xsfvqmacc and Xsfvfnrclip's testcases

2025-01-16 Thread Kito Cheng
committed, thanks :) On Fri, Dec 13, 2024 at 8:39 PM Jiawei wrote: > > From: Liao Shihua > > Update Sifive Xsfvqmacc and Xsfvfnrclip extension's testcases. > > version log: > Update synchronize LMUL settings with return type. > > gcc/ChangeLog: > > * config/riscv/vector.md: New a

Re: [PATCH v3 1/2] RISC-V: Update Xsfvfnrclip implementation.

2025-01-16 Thread Kito Cheng
committed, thanks :) On Fri, Dec 13, 2024 at 8:39 PM Jiawei wrote: > > Update implementation of Xsfvfnrclip, using return type as iterator. > > gcc/ChangeLog: > > * config/riscv/genrvv-type-indexer.cc (expand_floattype): New func. > (main): New type. > * config/riscv/riscv

[PATCH] arm: [MVE] Fix predicates for vec_cmp, vec_vcmpu and vcond_mask (PR 115439)

2025-01-16 Thread Christophe Lyon
When compiling c-c++-common/vector-compare-3.c with -march=armv8.1-m.main+mve+fp.dp -mfloat-abi=hard -mfpu=auto (which enables MVE), we fail to match vcond_mask because operand 3 has s_register_operand as predicate for a MVE_VPRED mode, but we try to match: (insn 26 25 27 2 (set (reg:V4SI 137)

Re: [PATCH 11/11] aarch64: Make AARCH64_FL_CRYPTO always unset

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > This feature flag bit only exists to support the +crypto alias. Outside > of option processing this bit needs to be set or unset consistently. > This patch goes with the latter option. > > gcc/ChangeLog: > > * common/config/aarch64/aarch64-common.cc: Assert that CR

[committed v2] libstdc++: Move std::basic_ostream to new internal header [PR99995]

2025-01-16 Thread Jonathan Wakely
This adds so that other headers don't need to include all of , which pulls in all of since C++23 (for the std::print and std::println overloads in ). This new header allows the constrained operator<< in to be defined without all of std::format being compiled. We could also replace with in all

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Lulu Cheng
在 2025/1/16 下午8:59, Xi Ruoyao 写道: On Thu, 2025-01-16 at 20:52 +0800, Xi Ruoyao wrote: On Thu, 2025-01-16 at 20:30 +0800, Lulu Cheng wrote: 在 2025/1/15 下午6:10, Xi Ruoyao 写道: diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 9d97f0216f0..3a8e1297bd3 1006

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Xi Ruoyao
On Thu, 2025-01-16 at 20:52 +0800, Xi Ruoyao wrote: > On Thu, 2025-01-16 at 20:30 +0800, Lulu Cheng wrote: > > > > 在 2025/1/15 下午6:10, Xi Ruoyao 写道: > > > diff --git a/gcc/config/loongarch/loongarch.cc > > > b/gcc/config/loongarch/loongarch.cc > > > index 9d97f0216f0..3a8e1297bd3 100644 > > > ---

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Xi Ruoyao
On Thu, 2025-01-16 at 20:30 +0800, Lulu Cheng wrote: > > 在 2025/1/15 下午6:10, Xi Ruoyao 写道: > > diff --git a/gcc/config/loongarch/loongarch.cc > > b/gcc/config/loongarch/loongarch.cc > > index 9d97f0216f0..3a8e1297bd3 100644 > > --- a/gcc/config/loongarch/loongarch.cc > > +++ b/gcc/config/loongarc

Re: [PATCH]middle-end: Add early break conditions to vect-switch-search-line-fast.c [PR118451]

2025-01-16 Thread Richard Biener
On Thu, 16 Jan 2025, Tamar Christina wrote: > Hi All, > > When this test was added initially it didn't add the early break effective > target tests. > > This means that the test was "passing" (as in, it was failing to vectorize) > because many targets don't support early break. > > But the test

[PATCH]middle-end: Add early break conditions to vect-switch-search-line-fast.c [PR118451]

2025-01-16 Thread Tamar Christina
Hi All, When this test was added initially it didn't add the early break effective target tests. This means that the test was "passing" (as in, it was failing to vectorize) because many targets don't support early break. But the test should not have been run for these targets. When the vectoriz

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Lulu Cheng
在 2025/1/15 下午6:10, Xi Ruoyao 写道: diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 9d97f0216f0..3a8e1297bd3 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -3929,14 +3929,31 @@ loongarch_rtx_costs (rtx x, machine

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Simon Martin
Hi Jakub, Jason, On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: > On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: >>> --- a/gcc/cp/decl.cc >>> +++ b/gcc/cp/decl.cc >>> @@ -11686,6 +11686,7 @@ fold_sizeof_expr (tree t) >>> false, false); >>> if (r

Re: [PATCH 10/11] aarch64: Refactor aarch64_rewrite_mcpu

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > Use aarch64_validate_cpu instead of the existing duplicate (and worse) > version of the -mcpu parsing code. > > The original code used fatal_error; I'm guessing that using error > instead should be ok. > > gcc/ChangeLog: > > * common/config/aarch64/aarch64-common.cc

Re: [PATCH 09/11] aarch64: Rewrite architecture strings for assembler

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > @@ -697,6 +697,50 @@ aarch64_get_extension_string_for_isa_flags > + const struct arch_info *entry; > + for (entry = all_architectures; entry->arch != aarch64_no_arch; entry++) > +{ > + if (entry->arch == arch) > + break; > +} Sorry for the nit, but for

[PUSHED] [OpenACC/Fortran testsuite] Use relative line numbers for a few DejaGnu directives

2025-01-16 Thread Thomas Schwinge
From: Thomas Schwinge For easier maintenance. gcc/testsuite/ * gfortran.dg/goacc/assumed.f95: Use relative line numbers for a few DejaGnu directives. * gfortran.dg/goacc/list.f95: Likewise. * gfortran.dg/goacc/loop-1-2.f95: Likewise. * gfortran.dg/

Re: [PATCH 09/11] aarch64: Rewrite architecture strings for assembler

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > Add infrastructure to allow rewriting the architecture strings passed to > the assembler (either as -march options or .arch directives). There was > already canonicalisation everywhere except for an -march driver option > passed directly to the compiler; this patch appli

Re: [PATCH] MIPS: Add conditions for use of the -mmips16e2 and -mips16 option.

2025-01-16 Thread Maciej W. Rozycki
On Thu, 16 Jan 2025, Jie Mei wrote: > Make -mmips16e2 imply -mips16 as the ASE requires, so users won't > be surprised even if they expect it to. Meanwhile, check if > mips_isa_rev <= 5 when -mips16 is effective and >= 1 when -mmips16e2 > is effective. MIPSr1 is incompatible with MIPS16e2, and t

[PATCH] libstdc++: Handle exceptions in std::ostream::sentry destructor

2025-01-16 Thread Jonathan Wakely
Because basic_ostream::sentry::~sentry is implicitly noexcept, we can't let any exceptions escape from it, or the program would terminate. If the streambuf's sync() function throws, or if it returns an error and setting badbit in the stream state throws, then the program would terminate. LWG 835 i

Re: [PATCH] LoongArch: Add alsl.wu

2025-01-16 Thread Lulu Cheng
LGTM! Thanks! 在 2025/1/15 下午6:09, Xi Ruoyao 写道: On 64-bit capable LoongArch hardware, alsl.wu is similar to alsl.w but zero-extending the 32-bit result. gcc/ChangeLog: * config/loongarch/loongarch.md (alslsi3_extend): Add alsl.wu. gcc/testsuite/ChangeLog: * gcc.target/loonga

Re: [PATCH v5 1/2] [APX CFCMOV] Support APX CFCMOV in if_convert pass

2025-01-16 Thread Richard Sandiford
Hongyu Wang writes: > From: Lingling Kong > > Hi, > > Appreciated to Richard's review, the v5 patch contaings below change: > > 1. Separate the maskload/maskstore emit out from noce_emit_cmove, add > a new function emit_mask_load_store in optabs.cc. > 2. Follow the operand order of maskload and m

  1   2   >