Re: [PATCH] vect: Use xor to invert oversized vector masks

2024-03-15 Thread Richard Biener
On Fri, Mar 15, 2024 at 4:35 AM Hongtao Liu wrote: > > On Thu, Mar 14, 2024 at 11:42 PM Andrew Stubbs wrote: > > > > Don't enable excess lanes when inverting vector bit-masks smaller than the > > integer mode. This is yet another case of wrong-code due to mishandling > > of oversized bitmasks.

[PATCH] libgcc: Fix quotient and/or remainder negation in __divmodbitint4 [PR114327]

2024-03-15 Thread Jakub Jelinek
Hi! While for __mulbitint3 we actually don't negate anything and perform the multiplication in unsigned style always, for __divmodbitint4 if the operands aren't unsigned and are negative, we negate them first and then try to negate them as needed at the end. quotient is negated if just one of the

[committed] testsuite: Added missing } in the dg-bogus comment [PR114343]

2024-03-15 Thread Torbjörn SVENSSON
Committed below as obvious. The } got lost in my copy from the internal system. Sorry for the inconvinience. -- gcc/testsuite/ChangeLog: PR testsuite/114343 * gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c: Added missing } in the dg-bogus comment.

[PING^3] Re: [PATCH] analyzer: deal with -fshort-enums

2024-03-15 Thread Torbjorn SVENSSON
Ping! Kind regards, Torbjörn On 2024-03-08 10:14, Torbjorn SVENSSON wrote: Ping! Kind regards, Torbjörn On 2024-02-22 09:51, Torbjorn SVENSSON wrote: Ping! Kind regards, Torbjörn On 2024-02-07 17:21, Torbjorn SVENSSON wrote: Hi, Is it okay to backport

[PATCH v3 1/2] extend.texi: Arrange pre-existing built-in traits alphabetically

2024-03-15 Thread Ken Matsui
Consolidated most patches into one for easier review and added documentation for all missing built-in traits. Ok for trunk? -- >8 -- This patch arranges pre-existing built-in traits alphabetically for better codebase consistency and easier future integration of changes. gcc/ChangeLog:

[PATCH] expand: EXTEND_BITINT CALL_EXPR results [PR114332]

2024-03-15 Thread Jakub Jelinek
Hi! The x86-64 and aarch64 psABIs (and the unwritten ia64 psABI part) say that the padding bits of _BitInt are undefined, while the expansion internally typically assumes that non-mode precision integers are sign/zero extended and extends after operations. We handle that mismatch with

Re: [Patch][RFC] GCN: Define ISA archs in gcn-devices.def and use it

2024-03-15 Thread Andrew Stubbs
On 15/03/2024 12:21, Tobias Burnus wrote: Given the large number of AMD GPU ISAs and the number of files which have to be adapted, I wonder whether it makes sense to consolidate this a bit, especially in the light that we may want to support more in the future. Besides using some macros, I

Re: Patch ping Re: [PATCH] icf: Reset SSA_NAME_{PTR,RANGE}_INFO in successfully merged functions [PR113907]

2024-03-15 Thread Jan Hubicka
> > + if (POINTER_TYPE_P (TREE_TYPE (t1))) > > +{ > > + if (SSA_NAME_PTR_INFO (t1)) > > + { > > + if (!SSA_NAME_PTR_INFO (t2) > > + || SSA_NAME_PTR_INFO (t1)->align != SSA_NAME_PTR_INFO (t2)->align > > + || SSA_NAME_PTR_INFO (t1)->misalign != SSA_NAME_PTR_INFO > >

Re: [PATCH] c++: ICE with noexcept and local specialization [PR114114]

2024-03-15 Thread Marek Polacek
On Fri, Mar 15, 2024 at 10:35:07AM -0400, Patrick Palka wrote: > On Tue, 5 Mar 2024, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we ICE because we call register_local_specialization while > > local_specializations is null, so

[PATCH] doc: Improve punctuation and grammar in -fdiagnostics-format docs

2024-03-15 Thread Jonathan Wakely
OK for trunk? -- >8 -- The hyphen can be misunderstood to mean "emitted to -" i.e. stdout. Refer to both forms by name, rather than using "the former" for one and referring to the other by name. gcc/ChangeLog: * doc/invoke.texi (Diagnostic Message Formatting Options): Replace

[commit] Regenerate opt.urls

2024-03-15 Thread YunQiang Su
Fixes: acc38ff59976 ("MIPS: Add -m(no-)strict-align option") gcc/ChangeLog: * config/riscv/riscv.opt.urls: Regenerated. * config/rs6000/sysv4.opt.urls: Likewise. * config/xtensa/xtensa.opt.urls: Likewise. --- gcc/config/riscv/riscv.opt.urls | 2 +-

[committed] testsuite: Fix pr113431.c FAIL on sparc* [PR113431]

2024-03-15 Thread Jakub Jelinek
Hi! As mentioned in the PR, the new testcase FAILs on sparc*-* due to lack of support of misaligned store. This patch restricts that to vect_hw_misalign targets. Tested on x86_64-linux -m32/-m64, committed to trunk based on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113431#c21 comment.

Re: [PATCH] c++: ICE with noexcept and local specialization [PR114114]

2024-03-15 Thread Patrick Palka
On Fri, 15 Mar 2024, Marek Polacek wrote: > On Fri, Mar 15, 2024 at 10:35:07AM -0400, Patrick Palka wrote: > > On Tue, 5 Mar 2024, Marek Polacek wrote: > > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > > > -- >8 -- > > > Here we ICE because we call

Re: [PATCH] vect: Use xor to invert oversized vector masks

2024-03-15 Thread Richard Biener
On Fri, Mar 15, 2024 at 12:24 PM Andrew Stubbs wrote: > > On 15/03/2024 07:35, Richard Biener wrote: > > On Fri, Mar 15, 2024 at 4:35 AM Hongtao Liu wrote: > >> > >> On Thu, Mar 14, 2024 at 11:42 PM Andrew Stubbs wrote: > >>> > >>> Don't enable excess lanes when inverting vector bit-masks

Re: [PATCH v6 4/5] Use the .ACCESS_WITH_SIZE in bound sanitizer.

2024-03-15 Thread Qing Zhao
On Mar 13, 2024, at 15:19, Qing Zhao wrote: On Mar 11, 2024, at 13:15, Siddhesh Poyarekar wrote: On 2024-02-16 14:47, Qing Zhao wrote: gcc/c-family/ChangeLog: * c-ubsan.cc (get_bound_from_access_with_size): New function. (ubsan_instrument_bounds): Handle call to .ACCESS_WITH_SIZE.

Re: [PATCH] c++: ICE with noexcept and local specialization [PR114114]

2024-03-15 Thread Patrick Palka
On Tue, 5 Mar 2024, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > Here we ICE because we call register_local_specialization while > local_specializations is null, so > > local_specializations->put (); > > crashes on null this. It's null

Re: [PATCH] aarch64: Add +lse128 architectural extension command-line flag

2024-03-15 Thread Christophe Lyon
On Fri, 15 Mar 2024 at 12:15, Victor Do Nascimento wrote: > > Given how, at present, the choice of using LSE128 atomic instructions > by the toolchain is delegated to run-time selection in the form of > Libatomic ifuncs, responsible for querying target support, the > `+lse128' target architecture

Re: RFC: New mechanism for hard reg operands to inline asm

2024-03-15 Thread Stefan Schulze Frielinghaus
On Fri, Jun 04, 2021 at 06:02:27PM +, Andreas Krebbel via Gcc wrote: > Hi, > > I wonder if we could replace the register asm construct for > inline assemblies with something a bit nicer and more obvious. > E.g. turning this (real world example from IBM Z kernel code): > > int

Re: [Patch][RFC] GCN: Define ISA archs in gcn-devices.def and use it

2024-03-15 Thread Tobias Burnus
Hi Andrew, Andrew Stubbs wrote: This is more-or-less what I was planning to do myself, but as I want to include all the other features that get parametrized in gcn.cc, gcn.h, gcn-hsa.h, gcn-opts.h, I hadn't got around to it yet. Unfortunately, I think the gcn.opt and config.gcc will always

Re: [PATCH] testsuite: Turn errors back into warnings in arm/acle/cde-mve-error-2.c

2024-03-15 Thread Thiago Jung Bauermann
Hello, "Richard Earnshaw (lists)" writes: > On 13/01/2024 20:46, Thiago Jung Bauermann wrote: >> diff --git a/gcc/testsuite/gcc.target/arm/acle/cde-mve-error-2.c >> b/gcc/testsuite/gcc.target/arm/acle/cde-mve-error-2.c >> index 5b7774825442..da283a06a54d 100644 >> ---

[committed] testsuite: Fix up pr104601.C for recent libstdc++ changes

2024-03-15 Thread Jakub Jelinek
Hi! On Thu, Mar 14, 2024 at 04:58:41PM +, Jonathan Wakely wrote: > Add the [[nodiscard]] attribute to several functions in . r14-9478 added [[nodiscard]] to various APIs including find_if the pr104601.C testcase uses. As it is an optimization bug fix testcase, haven't tried to adjust the

[PATCH] aarch64: Add +lse128 architectural extension command-line flag

2024-03-15 Thread Victor Do Nascimento
Given how, at present, the choice of using LSE128 atomic instructions by the toolchain is delegated to run-time selection in the form of Libatomic ifuncs, responsible for querying target support, the `+lse128' target architecture compile-time flag is absent from GCC. This, however, contrasts with

[commit] MIPS: Add -m(no-)strict-align option

2024-03-15 Thread YunQiang Su
We support options -m(no-)unaligned-access 2 years ago, while currently most of other ports prefer -m(no-)strict-align. Let's support -m(no-)strict-align, and keep -m(no-)unaligned-access as alias. gcc * config/mips/mips.opt: Support -mstrict-align, and use TARGET_STRICT_ALIGN as

[PATCH v15 23/26] c++: Implement __is_invocable built-in trait

2024-03-15 Thread Ken Matsui
Added diagnostics for build_invoke. Ok for 15? -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE. * semantics.cc

Re: [PATCH] expand: EXTEND_BITINT CALL_EXPR results [PR114332]

2024-03-15 Thread Richard Biener
On Fri, 15 Mar 2024, Jakub Jelinek wrote: > Hi! > > The x86-64 and aarch64 psABIs (and the unwritten ia64 psABI part) say that > the padding bits of _BitInt are undefined, while the expansion internally > typically assumes that non-mode precision integers are sign/zero extended > and extends

Re: [PATCH, OpenACC 2.7, v2] Adjust acc_map_data/acc_unmap_data interaction with reference counters

2024-03-15 Thread Thomas Schwinge
Hi Chung-Lin! I realized: please add "PR libgomp/92840" to the Git commit log, as your changes are directly a continuation of my earlier changes. On 2024-03-05T01:18:28+0900, Chung-Lin Tang wrote: > On 2023/10/31 11:06 PM, Thomas Schwinge wrote: >>> @@ -691,15 +694,27 @@ goacc_exit_datum_1

Re: [PATCH] vect: Use xor to invert oversized vector masks

2024-03-15 Thread Andrew Stubbs
On 15/03/2024 07:35, Richard Biener wrote: On Fri, Mar 15, 2024 at 4:35 AM Hongtao Liu wrote: On Thu, Mar 14, 2024 at 11:42 PM Andrew Stubbs wrote: Don't enable excess lanes when inverting vector bit-masks smaller than the integer mode. This is yet another case of wrong-code due to

Re: [PATCH v14 23/26] c++: Implement __is_invocable built-in trait

2024-03-15 Thread Ken Matsui
On Thu, Mar 14, 2024 at 6:53 PM Ken Matsui wrote: > > On Fri, Mar 8, 2024 at 9:17 AM Patrick Palka wrote: > > > > On Wed, 28 Feb 2024, Ken Matsui wrote: > > > > > This patch implements built-in trait for std::is_invocable. > > > > > > gcc/cp/ChangeLog: > > > > > > * cp-trait.def: Define

Re: CI for "Option handling: add documentation URLs"

2024-03-15 Thread YunQiang Su
Great work. The CI works well now: it blames me ;) https://builder.sourceware.org/buildbot/#/builders/269/builds/3846 When I add '-mstrict-align' option to MIPS, the riscv.opt.urls, sysv4.opt.urls, xtensa.opt.urls are changed also. (why they are effected? So what's the best practice for this

Re: [PATCH] i386: Fix a pasto in ix86_expand_int_sse_cmp [PR114339]

2024-03-15 Thread Uros Bizjak
On Fri, Mar 15, 2024 at 9:50 AM Jakub Jelinek wrote: > > Hi! > > In r13-3803-gfa271afb58 I've added an optimization for LE/LEU/GE/GEU > comparison against CONST_VECTOR. As the comments say: > /* x <= cst can be handled as x < cst + 1 unless there is > wrap around in cst + 1.

Re: [PATCH] vect: Use xor to invert oversized vector masks

2024-03-15 Thread Andrew Stubbs
On 15/03/2024 03:45, Hongtao Liu wrote: On Thu, Mar 14, 2024 at 11:42 PM Andrew Stubbs wrote: Don't enable excess lanes when inverting vector bit-masks smaller than the integer mode. This is yet another case of wrong-code due to mishandling of oversized bitmasks. This issue shows up in

Re: CI for "Option handling: add documentation URLs"

2024-03-15 Thread Mark Wielaard
Hi YunQiang Su, On Fri, Mar 15, 2024 at 03:33:28PM +0800, YunQiang Su wrote: > Great work. The CI works well now: it blames me ;) > https://builder.sourceware.org/buildbot/#/builders/269/builds/3846 > > When I add '-mstrict-align' option to MIPS, > the riscv.opt.urls, sysv4.opt.urls,

Re: [PATCH v1] C++: Support constexpr strings for asm statements

2024-03-15 Thread Jakub Jelinek
On Thu, Jan 25, 2024 at 04:18:19AM -0800, Andi Kleen wrote: > Some programing styles use a lot of inline assembler, and it is common > to use very complex preprocessor macros to generate the assembler > strings for the asm statements. In C++ there would be a typesafe alternative > using templates

[PATCH] handle unwind tables that are embedded within unwinding code, [PR111731]

2024-03-15 Thread Thomas Neumann
Original bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111731 Given that this is a regression, is this okay for gcc 13 and mainline? The unwinding mechanism registers both the code range and the unwind table itself within a b-tree lookup structure. That data structure assumes that is

Re: Patch ping Re: [PATCH] icf: Reset SSA_NAME_{PTR,RANGE}_INFO in successfully merged functions [PR113907]

2024-03-15 Thread Richard Biener
On Thu, 14 Mar 2024, Jan Hubicka wrote: > > > We have wrong code with LTO, too. > > > > I know. > > > > > The problem is that IPA passes (and > > > not only that, loop analysis too) does analysis at compile time (with > > > value numbers in) and streams the info separately. > > > > And that is

[PATCH v3 2/2] extend.texi: Add documentation for all missing built-in traits [PR87343]

2024-03-15 Thread Ken Matsui
PR c++/87343 gcc/ChangeLog: * doc/extend.texi (Expression-yielding Type Traits): New subsection. (Type-yielding Type Traits): Likewise. (C++ Concepts): Move __is_same to ... (Expression-yielding Type Traits): ... here.

Re: C/C++ frontend patches ping

2024-03-15 Thread Richard Biener
On Fri, Mar 15, 2024 at 6:20 AM Andi Kleen wrote: > > Andrew Pinski writes: > > > On Thu, Mar 14, 2024 at 9:36 PM Andi Kleen wrote: > >> > >> > >> musttail support for C/C++ > >> > >> https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643867.html > >> > >> > >> Support constexpr for asm

[committed] lower-subreg, edit-context: Fix comment typos

2024-03-15 Thread Jakub Jelinek
Hi! When backporting r14-9315 to 13 branch, I've noticed I've missed one letter in a comment. And grepping for similar issues I found one word with too many. Committed to trunk as obvious. 2024-03-15 Jakub Jelinek * lower-subreg.cc (resolve_simple_move): Fix comment typo,

[Patch][RFC] GCN: Define ISA archs in gcn-devices.def and use it

2024-03-15 Thread Tobias Burnus
Given the large number of AMD GPU ISAs and the number of files which have to be adapted, I wonder whether it makes sense to consolidate this a bit, especially in the light that we may want to support more in the future. Besides using some macros, I also improved the diagnostic if the object

[PATCH] i386: Fix a pasto in ix86_expand_int_sse_cmp [PR114339]

2024-03-15 Thread Jakub Jelinek
Hi! In r13-3803-gfa271afb58 I've added an optimization for LE/LEU/GE/GEU comparison against CONST_VECTOR. As the comments say: /* x <= cst can be handled as x < cst + 1 unless there is wrap around in cst + 1. */ ... /* For LE punt if some element is

Re: [PATCH V3] rs6000: Don't ICE when compiling the __builtin_vsx_splat_2di built-in [PR113950]

2024-03-15 Thread Peter Bergner
On 3/6/24 3:27 AM, Kewen.Lin wrote: > on 2024/3/4 02:55, jeevitha wrote: >> The following patch has been bootstrapped and regtested on powerpc64le-linux. >> >> When we expand the __builtin_vsx_splat_2di function, we were

Re: [PATCH, v2] Fortran: use name of array component in runtime error message [PR30802]

2024-03-15 Thread Mikael Morin
Le 10/03/2024 à 22:31, Harald Anlauf a écrit : Dear all, after playing for some time with NAG and Intel, and an off-list discussion with Jerry, I am getting more and more convinced that simpler runtime error messages (also simpler to parse by a human) are superior to awkward solutions.  This is

Re: [PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls

2024-03-15 Thread Björn Schäpers
Am 25.01.2024 um 23:04 schrieb Ian Lance Taylor: On Thu, Jan 25, 2024 at 11:53 AM Björn Schäpers wrote: Am 23.01.2024 um 23:37 schrieb Ian Lance Taylor: On Thu, Jan 4, 2024 at 2:33 PM Björn Schäpers wrote: Am 03.01.2024 um 00:12 schrieb Björn Schäpers: Am 30.11.2023 um 20:53 schrieb Ian

Re: [PATCH 6/4] libbacktrace: Add loaded dlls after initialize

2024-03-15 Thread Björn Schäpers
Am 10.01.2024 um 13:34 schrieb Eli Zaretskii: Date: Tue, 9 Jan 2024 21:02:44 +0100 Cc: i...@google.com, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org From: Björn Schäpers Am 07.01.2024 um 18:03 schrieb Eli Zaretskii: In that case, you an call either GetModuleHandeExA or GetModuleHandeExW, the

Re: [PATCH v1] C++: Support constexpr strings for asm statements

2024-03-15 Thread Andi Kleen
> > I think keeping it untranslated is fine for now. Any translation > > if really needed would be a separate feature. > > I mean, unless you make extra effort, it is translated. > Even in your current version, try constexpr *foo () { return "nop"; } > and you'll see that it actually results in

Re: [PATCH v1] C++: Support constexpr strings for asm statements

2024-03-15 Thread Andi Kleen
Thanks Jakub. > > +/* Parse a string literal or constant expression yielding a string. > > + The constant expression uses extra parens to avoid ambiguity with "x" > > (expr). > > + > > + asm-string-expr: > > + string-literal > > + ( constant-expr ) */ > > + > > +static tree > >

Re: [PATCH, v2] Fortran: use name of array component in runtime error message [PR30802]

2024-03-15 Thread Harald Anlauf
Hi Mikael, On 3/15/24 17:31, Mikael Morin wrote: Le 10/03/2024 à 22:31, Harald Anlauf a écrit : Dear all, after playing for some time with NAG and Intel, and an off-list discussion with Jerry, I am getting more and more convinced that simpler runtime error messages (also simpler to parse by a

[PATCH, v2] Fortran: fix for absent array argument passed to optional dummy [PR101135]

2024-03-15 Thread Harald Anlauf
Dear all, as there has been some good progress in the handling of optional dummy arguments, I looked again at this PR and a patch for it that I withdrew as it turned out incomplete. It turned out that it now needs only a minor adjustment for optional dummy arguments of procedures with bind(c)

[PATCH] arm: [MVE intrinsics] Fix support for loads [PR target/114323]

2024-03-15 Thread Christophe Lyon
The testcase in this PR shows that we would load from an uninitialized location, because the vld1 instrinsics are reported as "const". This is because function_instance::reads_global_state_p() does not take CP_READ_MEMORY into account. Fixing this gives vld1 the "pure" attribute instead, and

Re: [Patch][RFC] GCN: Define ISA archs in gcn-devices.def and use it

2024-03-15 Thread Andrew Stubbs
On 15/03/2024 13:56, Tobias Burnus wrote: Hi Andrew, Andrew Stubbs wrote: This is more-or-less what I was planning to do myself, but as I want to include all the other features that get parametrized in gcn.cc, gcn.h, gcn-hsa.h, gcn-opts.h, I hadn't got around to it yet. Unfortunately, I

Re: [PATCH] c++: explicit inst of template method not generated [PR110323]

2024-03-15 Thread Marek Polacek
On Thu, Mar 14, 2024 at 03:39:04PM -0400, Jason Merrill wrote: > On 3/8/24 12:02, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Consider > > > >constexpr int VAL = 1; > >struct foo { > >template > >void

Re: [PATCH, v2] Fortran: use name of array component in runtime error message [PR30802]

2024-03-15 Thread Mikael Morin
Le 15/03/2024 à 18:26, Harald Anlauf a écrit : Hi Mikael, On 3/15/24 17:31, Mikael Morin wrote: Le 10/03/2024 à 22:31, Harald Anlauf a écrit : Dear all, after playing for some time with NAG and Intel, and an off-list discussion with Jerry, I am getting more and more convinced that simpler

[PATCH] ipa: Avoid duplicate replacements in IPA-SRA transformation phase

2024-03-15 Thread Martin Jambor
Hi, when the analysis part of IPA-SRA figures out that it would split out a scalar part of an aggregate which is known by IPA-CP to contain a known constant, it skips it knowing that the transformation part looks at IPA-CP aggregate results too and does the right thing (which can include doing

Re: [PATCH] libgcc: Fix quotient and/or remainder negation in __divmodbitint4 [PR114327]

2024-03-15 Thread Joseph Myers
On Fri, 15 Mar 2024, Jakub Jelinek wrote: > Hi! > > While for __mulbitint3 we actually don't negate anything and perform the > multiplication in unsigned style always, for __divmodbitint4 if the operands > aren't unsigned and are negative, we negate them first and then try to > negate them as

Re: [PATCH v1] C++: Support constexpr strings for asm statements

2024-03-15 Thread Jakub Jelinek
On Fri, Mar 15, 2024 at 10:20:06AM -0700, Andi Kleen wrote: > > One issue is the character set question. The strings in inline asm right > > now are untranslated, i.e. remain in SOURCE_CHARSET, usually UTF-8 (in > > theory there is also UTF-EBCDIC support, but nobody knows if it actually > >

Re: [PATCH] ipa: Avoid duplicate replacements in IPA-SRA transformation phase

2024-03-15 Thread Jakub Jelinek
On Fri, Mar 15, 2024 at 06:57:18PM +0100, Martin Jambor wrote: > --- a/gcc/ipa-param-manipulation.cc > +++ b/gcc/ipa-param-manipulation.cc > @@ -1525,6 +1525,22 @@ ipa_param_body_adjustments::common_initialization > (tree old_fndecl, >replacement with a constant (for split