Bootstrap issue due to translated messages in selftest [PR117361] – was: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread Tobias Burnus
Am 31.10.24 um 21:57 schrieb David Malcolm: On Thu, 2024-10-31 at 11:36 -0700, Andrew Pinski wrote: This is recorded as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117361 already. I think one idea is to set LANG=C before doing the self-check. But I will allow David and other think of better way

Re: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread Xi Ruoyao
On Thu, 2024-10-31 at 23:18 +, Joseph Myers wrote: > On Thu, 31 Oct 2024, David Malcolm wrote: > > > That said, I think setting LANG=C when running selftests is probably > > the best solution.  How does the attached (untested) patch look? > > LC_ALL takes precedence over LANG.  OK with LC_ALL

[PATCH 1/2] i386: Add new model number for Arrow Lake

2024-10-31 Thread Haochen Jiang
gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Add new model number for Arrow Lake. --- gcc/common/config/i386/cpuinfo.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index 0dcdaafeca5..f415f

[PATCH 2/2] Initial Diamond Rapids Support

2024-10-31 Thread Haochen Jiang
gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Handle Diamond Rapids. * common/config/i386/i386-common.cc (processor_name): Add Diamond Rapids. (processor_alias_table): Ditto. * common/config/i386/i386-cpuinfo.h (enum processor_types)

[PATCH 0/2] Add arch support for Intel CPUs

2024-10-31 Thread Haochen Jiang
Hi all, I have just landed new ISA patches on trunk. The next step will be the arch support for ISE055 mentioned CPUs. There are two changes in ISE055 on CPUs: - A new model number is added for Arrow Lake. - Diamond Rapids Support is added. The following two patches will reflect those chang

Re: [PATCH v3 10/11] RISC-V: Implement TARGET_GENERATE_VERSION_DISPATCHER_BODY and TARGET_GET_FUNCTION_VERSIONS_DISPATCHER

2024-10-31 Thread Kito Cheng
Generally LGTM, just a few minor comments for the C-ish stuff... > + > + /* At least one more version other than the default. */ > + unsigned int num_versions = fndecls->length (); > + gcc_assert (num_versions >= 2); > + > + struct function_version_info > +{ > + tree version_decl; >

Re: [PATCH] guality tests: Silence gdb debuginfod warning

2024-10-31 Thread H.J. Lu
On Fri, Nov 1, 2024 at 8:32 AM Sam James wrote: > > "H.J. Lu" writes: > > > When gdb defaults to use debuginfod, gdb warns guality tests: > > > > Spawning: gdb -nx -nw -quiet -batch -x pr36728-2.gdb ./pr36728-2.exe > > spawn gdb -nx -nw -quiet -batch -x pr36728-2.gdb ./pr36728-2.exe > > Breakpoin

[PATCH] i386: Utilize VCOMSBF16 for BF16 Comparisons with AVX10.2

2024-10-31 Thread Hongyu Wang
From: Levy Hsu This patch enables the use of the VCOMSBF16 instruction from AVX10.2 for efficient BF16 comparisons. Bootstrapped & regtested on x86-64-pc-linux-gnu. Ok for trunk? gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_branch): Handle BFmode when TARGET_AVX10_2

Re: [PATCH] guality tests: Silence gdb debuginfod warning

2024-10-31 Thread Sam James
"H.J. Lu" writes: > When gdb defaults to use debuginfod, gdb warns guality tests: > > Spawning: gdb -nx -nw -quiet -batch -x pr36728-2.gdb ./pr36728-2.exe > spawn gdb -nx -nw -quiet -batch -x pr36728-2.gdb ./pr36728-2.exe > Breakpoint 1 at 0x4004ba: file > /export/gnu/import/git/gitlab/x86-gcc/g

[COMMITTED 3/3] testsuite: g++.dg: torture: fix PR111520 filename

2024-10-31 Thread Sam James
gcc/testsuite/ChangeLog: PR tree-optimization/111520 * g++.dg/torture/harden-comp-pr111520.cc: Move to... * g++.dg/torture/harden-comp-pr111520.C: ...here. --- Pushed as obvious. .../torture/{harden-comp-pr111520.cc => harden-comp-pr111520.C} | 0 1 file changed, 0 inse

[COMMITTED] testsuite: g++.dg: debug: fix test filenames

2024-10-31 Thread Sam James
gcc/testsuite/ChangeLog: PR debug/15736 PR debug/46240 * g++.dg/debug/pr15736.cc: Move to... * g++.dg/debug/pr15736.C: ...here. * g++.dg/debug/pr46240.cc: Move to... * g++.dg/debug/pr46240.C: ...here. --- Pushed as obvious. Probably the last one of t

[COMMITTED 1/3] testsuite: fixup pr66655.C

2024-10-31 Thread Sam James
In r15-4823-g14e2f3233bf0ef, I renamed pr66655_1.cc but neglected to update a dg-additional-sources reference. gcc/testsuite/ChangeLog: PR target/66655 * g++.dg/pr66655.C: Adjust filename in dg-additional-sources. --- Pushed as obvious. gcc/testsuite/g++.dg/pr66655.C | 2 +- 1 f

[COMMITTED 2/3] testsuite: g++.dg: fix PR90313 filename

2024-10-31 Thread Sam James
gcc/testsuite/ChangeLog: PR c++/90313 * g++.dg/torture/pr90313.cc: Move to... * g++.dg/torture/pr90313.C: ...here. --- Pushed as obvious. gcc/testsuite/g++.dg/torture/{pr90313.cc => pr90313.C} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gcc/testsuite/g++.

[COMMITTED 1/3] testsuite: g++.dg: rename pr105820 test

2024-10-31 Thread Sam James
.c is used for C and .C is for C++. The test was being ignored before. gcc/testsuite/ChangeLog: PR tree-optimization/105820 * g++.dg/tree-ssa/pr105820.c: Move to... * g++.dg/tree-ssa/pr105820.C: ...here. --- Pushed as obvious. gcc/testsuite/g++.dg/tree-ssa/{pr105820.c =>

[COMMITTED 3/3] testsuite: g++.dg: rename pr66655 test

2024-10-31 Thread Sam James
The test was being ignored because dg.exp looks for .C in g++.dg/. gcc/testsuite/ChangeLog: PR target/66655 * g++.dg/pr66655_1.cc: Move to... * g++.dg/pr66655_1.C: ...here. --- Pushed as obvious. gcc/testsuite/g++.dg/{pr66655_1.cc => pr66655_1.C} | 0 1 file changed, 0 i

[COMMITTED 2/3] testsuite: g++.dg: rename pr42965 test

2024-10-31 Thread Sam James
.c is used for C and .C is for C++. The test was being ignored before. gcc/testsuite/ChangeLog: PR other/42965 * g++.dg/warn/unused-result1-Werror.c: Move to... * g++.dg/warn/unused-result1-Werror.C: ...here. --- Pushed as obvious. .../warn/{unused-result1-Werror.c => un

[PATCH] Update gcc-auto-profile / gen_autofdo_event.py

2024-10-31 Thread Andi Kleen
From: Andi Kleen - Fix warnings with newer python versions about bad escapes by making all the python string raw. - Add a fallback for using the builtin perf event list if the CPU model number is unknown. - Regenerate the shipped gcc-auto-profile with the changes. contrib/ChangeLog: * g

[PATCH] Enable autofdo bootstrap for lto/fortran

2024-10-31 Thread Andi Kleen
From: Andi Kleen When autofdo bootstrap support was originally implemented there were issues with the LTO bootstrap, that is why it wasn't enabled for them. I retested this now and it works on x86_64-linux. Fortran was also missing, not sure why. Also enabled now. gcc/fortran/ChangeLog:

Re: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread Joseph Myers
On Thu, 31 Oct 2024, David Malcolm wrote: > That said, I think setting LANG=C when running selftests is probably > the best solution. How does the attached (untested) patch look? LC_ALL takes precedence over LANG. OK with LC_ALL instead of or alongside LANG (assuming that passes testing). (No

[PATCH] md-files: Add a note about escaped quotes in braced strings in md files

2024-10-31 Thread Andrew Pinski
While looking into PR 33532, It was noted that \" would be treated still as " for braced strings in the md file. I think that is still the correct thing to do. So let's just a note to the documentation on this behavior and NOT change read-md.cc (read_braced_string). Since this behavior has been the

Re: [PATCH v3 2/2][RFC] Add debugging for move history.

2024-10-31 Thread Qing Zhao
Thanks. Will fix them in the next version. Qing > On Oct 30, 2024, at 13:52, Sam James wrote: > > Qing Zhao writes: > >> gcc/ChangeLog: >> >> * diagnostic-move-history.cc (dump_move_history): New routine. >> (dump_move_history_for): Likewise. >> (debug_mv_h): Likewise. >> * diagnostic-move-

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Wilco Dijkstra
Hi Kyrill, > I think the approach that I’d like to try is using the TARGET_SCHED_DISPATCH > hooks like x86 does for bdver1-4. > That would try to exploit the dispatch constraints information in the SWOGs > rather than the instruction latency and throughput tables. > That would still require some

Re: [PATCH 0/3] Move some single-file LTO tests to torture

2024-10-31 Thread Mike Stump
On Oct 31, 2024, at 1:56 PM, Sam James wrote: > > Sam James writes: > >> Andrew pointed this out when committing those testsuite fixes earlier. We >> may as well make these proper torture tests rather than having them >> unnecessarily in the special lto/ dir which is meant for multiple files >>

Re: [PATCH 1/2] aarch64: Remove scheduling models for falkor and saphira

2024-10-31 Thread Richard Sandiford
Andrew Pinski writes: > These 2 qualcomm cores have been long gone in that Qualcomm has not > supported since at least 2019. Removing them will make it easier I think > to change the insn type attributes instead of keeping them up todate. > > Note this does not remove the cores, just the schedule

Re: [PATCH] aarch64: Recognize vector permute patterns suitable for FMOV [PR100165]

2024-10-31 Thread Richard Sandiford
Pengxuan Zheng writes: > This patch optimizes certain vector permute expansion with the FMOV > instruction > when one of the input vectors is a vector of all zeros and the result of the > vector permute is as if the upper lane of the non-zero input vector is set to > zero and the lower lane remai

Re: Implement removal of malloc/free pairs with NULL check

2024-10-31 Thread Sam James
Jan Hubicka writes: > Hi, > this patch lets us to remove > void *mem = __builtin_malloc (s); > if (!mem) > __builtin_abort (); > __builtin_free (mem); > > Where we previously stopped on "if (!mem)" marking __builtin_malloc necessary. > This is done by matching such conditional in tree-s

[PATCH] aarch64: Extend support for the AE family of Cortex CPUs

2024-10-31 Thread Victor Do Nascimento
Implement -mcpu options for: - Cortex-A520AE - Cortex-A720AE - Cortex-R82AE These all implement the same feature sets as their non-AE counterparts, using the same scheduler and costs and differing only in their respective part numbers. gcc/ChangeLog: * config/aarch64/aarch64-cores

[PATCH 1/2] aarch64: Remove scheduling models for falkor and saphira

2024-10-31 Thread Andrew Pinski
These 2 qualcomm cores have been long gone in that Qualcomm has not supported since at least 2019. Removing them will make it easier I think to change the insn type attributes instead of keeping them up todate. Note this does not remove the cores, just the schedule models. Bootstrapped and tested

[PATCH 2/2] aarch64: remove falkor-tag-collision-avoidance pass

2024-10-31 Thread Andrew Pinski
This code is not well tested and there is only a single testcase (gcc.target/aarch64/pr94530.c) which only enables this code but it is testing to make sure there is no ICE. The falkor cores have not been supported from Qualcomm from 2019 or so either. And I don't have a way to test these cores int

[PATCH 2/2] doc: install: document UBSAN_OPTIONS

2024-10-31 Thread Sam James
Explain that 'bootstrap-ubsan' won't abort on errors by default and how to override that by setting UBSAN_OPTIONS. gcc/ChangeLog: PR other/116948 * doc/install.texi (Building a native compiler): Document UBSAN_OPTIONS. --- gcc/doc/install.texi | 4 +++- 1 file changed, 3 insertio

[PATCH 1/2] doc: install: document bootstrap-ubsan

2024-10-31 Thread Sam James
gcc/ChangeLog: PR other/116948 * doc/install.texi (Building a native compiler): Mention bootstrap-ubsan. --- gcc/doc/install.texi | 4 1 file changed, 4 insertions(+) diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index f19d55f76c3d..85896721a0ac 100644 --- a/gcc/

Re: [PATCH v3 5/8] aarch64: Add masked-load else operands.

2024-10-31 Thread Richard Sandiford
rdapp@gmail.com writes: > From: Robin Dapp > > This adds zero else operands to masked loads and their intrinsics. > I needed to adjust more than initially thought because we rely on > combine for several instructions and a change in a "base" pattern > needs to propagate to all those. > > For t

Re: [PATCH 0/3] Move some single-file LTO tests to torture

2024-10-31 Thread Sam James
Sam James writes: > Andrew pointed this out when committing those testsuite fixes earlier. We > may as well make these proper torture tests rather than having them > unnecessarily in the special lto/ dir which is meant for multiple files > really. > > Sam James (3): > testsuite: move single-fil

Re: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread David Malcolm
On Thu, 2024-10-31 at 11:36 -0700, Andrew Pinski wrote: > On Thu, Oct 31, 2024 at 10:02 AM Xi Ruoyao > wrote: > > > > On Tue, 2024-10-29 at 19:19 -0400, David Malcolm wrote: > > > +static void > > > +test_output_arg_parsing () > > > +{ > > > +  auto_fix_quotes fix_quotes; > > > +  auto_fix_progna

Re: [PATCH 1/3] testsuite: move single-file LTO pr62026 test to torture

2024-10-31 Thread Sam James
Andrew Pinski writes: > On Fri, Oct 25, 2024 at 3:08 PM Sam James wrote: >> >> This only started being used recently in r15-4682-g03ff420aa0a916 and >> pinskia pointed out we may as well make it a proper torture test >> instead as it's a single file LTO test. >> >> gcc/testsuite/ChangeLog: >>

Re: [PATCH] libiberty: Fix comment typos

2024-10-31 Thread Ian Lance Taylor
On Thu, Oct 31, 2024 at 1:01 PM Mark Wielaard wrote: > > These comment typos were found in the valgrind fork of libiberty > demangle code. > > libiberty/ChangeLog: > > * cplus-dem.c: Change preceeded to preceded. > > include/ChangeLog: > > * safe-ctype.h: Change accidently to accid

[PATCH] PR117350: Keep assembler name for abstract decls for autofdo

2024-10-31 Thread Andi Kleen
From: Andi Kleen autofdo looks up inline stacks and tries to match them with the profile data using their symbol name. Make sure all decls that can be in a inline stack have a valid assembler name. This fixes a bootstrap problem with autoprofiledbootstrap and LTO. 2024-10-30 Jason Merrill

[PATCH] libstdc++: Deprecate useless compatibility headers for C++17

2024-10-31 Thread Jonathan Wakely
Tested x86_64-linux. Is the g++ test change OK? Also available for review at: https://forge.sourceware.org/gcc/gcc-TEST/pulls/4 -- >8 -- These headers make no sense for C++ programs, because they either define different content to the corresponding C header, or define nothing at all in namespac

[PATCH 2/2] libstdc++: More user-friendly failed assertions from shared_ptr dereference

2024-10-31 Thread Jonathan Wakely
Currently dereferencing an empty shared_ptr prints a complicated internal type in the assertion message: include/bits/shared_ptr_base.h:1377: std::__shared_ptr_access<_Tp, _Lp, , >::element_type& std::__shared_ptr_access<_Tp, _Lp, , >::operator*() const [with _Tp = std::filesystem::__cxx11::r

[PATCH 1/2] libstdc++: Enable debug assertions for filesystem directory iterators

2024-10-31 Thread Jonathan Wakely
Several member functions of filesystem::directory_iterator and filesystem::recursive_directory_iterator currently dereference their shared_ptr data member without checking for non-null. Because they use operator-> and that function only uses _GLIBCXX_DEBUG_PEDASSERT rather than __glibcxx_assert the

[PATCH] libiberty: Fix comment typos

2024-10-31 Thread Mark Wielaard
These comment typos were found in the valgrind fork of libiberty demangle code. libiberty/ChangeLog: * cplus-dem.c: Change preceeded to preceded. include/ChangeLog: * safe-ctype.h: Change accidently to accidentally. --- include/safe-ctype.h | 2 +- libiberty/cplus-dem.c | 2 +-

Re: [PATCH 3/4] sched1: model: only promote true dependecies in predecessor promotion

2024-10-31 Thread Vineet Gupta
On 10/30/24 18:11, Jeff Law wrote: > On 10/20/24 1:40 PM, Vineet Gupta wrote: >> Background >> -- >> sched1 runs a preliminary "model schedular" ahead of the main list schedular. >> Its sole purpose is to keep register pressure to mimimum [1] and it uses DFA >> register depenendency trackin

Re: Implement removal of malloc/free pairs with NULL check

2024-10-31 Thread Andrew Pinski
On Thu, Oct 31, 2024 at 9:08 AM Jan Hubicka wrote: > > Hi, > this patch lets us to remove > void *mem = __builtin_malloc (s); > if (!mem) > __builtin_abort (); > __builtin_free (mem); > > Where we previously stopped on "if (!mem)" marking __builtin_malloc necessary. > This is done by mat

Re: [PATCH] testsuite: fix c23-constexpr-2a.c test to use dg-do run

2024-10-31 Thread Joseph Myers
On Thu, 31 Oct 2024, Sam James wrote: > The comment at the top of the test indicates it should be an execution test, > but it was only using 'dg-do link'. Correct that. > > The only change in test results is as expected: > ``` > +PASS: gcc.dg/c23-constexpr-2a.c execution test > ``` > > gcc/tests

[PATCH] testsuite: fix c23-constexpr-2a.c test to use dg-do run

2024-10-31 Thread Sam James
The comment at the top of the test indicates it should be an execution test, but it was only using 'dg-do link'. Correct that. The only change in test results is as expected: ``` +PASS: gcc.dg/c23-constexpr-2a.c execution test ``` gcc/testsuite/ChangeLog: PR testsuite/117183 * gc

Re: [PATCH v2 1/1] C: Support Function multiversionsing in the C front end

2024-10-31 Thread Joseph Myers
On Thu, 24 Oct 2024, alfie.richa...@arm.com wrote: > - if (DECL_INITIAL (newdecl)) > + if ((DECL_INITIAL (newdecl) || DECL_EXTERNAL (newdecl)) > + && (DECL_INITIAL (olddecl) || DECL_EXTERNAL (olddecl)) > + && targetm.target_option.function_versions (newdecl, olddecl)) > +

[PATCH] Add new hardreg PRE pass

2024-10-31 Thread Andrew Carlotti
This pass is used to optimise assignments to the FPMR register in aarch64. I chose to implement this as a middle-end pass because it mostly reuses the existing RTL PRE code within gcse.cc. Compared to RTL PRE, the key difference in this new pass is that we insert new writes directly to the destin

Re: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread Andrew Pinski
On Thu, Oct 31, 2024 at 10:02 AM Xi Ruoyao wrote: > > On Tue, 2024-10-29 at 19:19 -0400, David Malcolm wrote: > > +static void > > +test_output_arg_parsing () > > +{ > > + auto_fix_quotes fix_quotes; > > + auto_fix_progname fix_progname; > > + > > + /* Minimal correct example. */ > > + { > >

[PATCH] testsuite: arm: Use effective-target for nomve_fp_1 test

2024-10-31 Thread Torbjörn SVENSSON
Ok for trunk and releases/gcc-14? -- Test uses MVE, so add effective-target arm_fp requirement. gcc/testsuite/ChangeLog: * g++.target/arm/mve/general-c++/nomve_fp_1.c: Use effective-target arm_fp. Signed-off-by: Torbjörn SVENSSON --- gcc/testsuite/g++.target/arm/mve/general-c

[PATCH] testsuite: arm: Force hard ABI for pr51534.c test

2024-10-31 Thread Torbjörn SVENSSON
Ok for trunk and releases/gcc-14? -- The test case is written in a way that it should be using hard float ABI, but the use of -mfloat-abi=hard could be overriden by dg-add-options arm_neon. Ensure that -mfloat-abi=hard is always after. gcc/testsuite/ChangeLog: * gcc.target/arm/pr51534.c

[PATCH] testsuite: arm: Use effective-target for pr68620 and pr78041 tests

2024-10-31 Thread Torbjörn SVENSSON
Ok for trunk and releases/gcc-14? -- Tests uses neon, so add effective-target arm_neon. gcc/testsuite/ChangeLog: * gcc.target/arm/pr68620.c: Use effective-target arm_neon. * gcc.target/arm/pr78041.c: Likewise. Signed-off-by: Torbjörn SVENSSON --- gcc/testsuite/gcc.target/arm/

[PATCH v2 10/21] aarch64: Add non-local goto and jump tests for GCS

2024-10-31 Thread Yury Khrustalev
From: Szabolcs Nagy These are scan asm tests only, relying on existing execution tests for runtime coverage. gcc/testsuite/ChangeLog: * gcc.target/aarch64/gcs-nonlocal-1.c: New test. * gcc.target/aarch64/gcs-nonlocal-1-track-speculation.c: New test. * gcc.target/aarch64/

[PATCH v2 15/21] aarch64: Emit GNU property NOTE for GCS

2024-10-31 Thread Yury Khrustalev
From: Szabolcs Nagy gcc/ChangeLog: * config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEATURE_1_GCS): Define. (aarch64_file_end_indicate_exec_stack): Set GCS property bit. --- gcc/config/aarch64/aarch64.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/confi

[PATCH v2 21/21] aarch64: Fix nonlocal goto tests incompatible with GCS

2024-10-31 Thread Yury Khrustalev
gcc/testsuite/ChangeLog: * gcc.target/aarch64/gcs-nonlocal-3.c: New test. * gcc.target/aarch64/sme/nonlocal_goto_4.c: Update. * gcc.target/aarch64/sme/nonlocal_goto_5.c: Update. * gcc.target/aarch64/sme/nonlocal_goto_6.c: Update. --- .../gcc.target/aarch64/gcs-nonlo

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Andrew Pinski
On Thu, Oct 31, 2024 at 11:03 AM Wilco Dijkstra wrote: > > Hi Andrew, > > > I suspect the following scheduling models could be removed due either > > to hw never going to production or no longer being used by anyone: > > thunderx3t110.md > > falkor.md > > saphira.md > > If you're planning to remov

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Wilco Dijkstra
Hi Andrew, > I suspect the following scheduling models could be removed due either > to hw never going to production or no longer being used by anyone: > thunderx3t110.md > falkor.md > saphira.md If you're planning to remove these, it would also be good to remove the falkor-tag-collision-avoidanc

Re: [PATCH v3 1/2][RFC] Provide more contexts for -Warray-bounds, -Wstringop-* warning messages due to code movements from compiler transformation [PR109071]

2024-10-31 Thread Qing Zhao
> On Oct 31, 2024, at 12:55, David Malcolm wrote: > > On Wed, 2024-10-30 at 20:51 +, Qing Zhao wrote: >> Hi, David, >> >>> On Oct 30, 2024, at 14:54, David Malcolm >>> wrote: >>> >>> On Wed, 2024-10-30 at 15:53 +, Qing Zhao wrote: > On Oct 30, 2024, at 10:48, David Ma

Re: testsuite: Use -std=gnu17 in gcc.dg/pr114115.c

2024-10-31 Thread Jakub Jelinek
On Thu, Oct 31, 2024 at 05:07:52PM +, Joseph Myers wrote: > On Thu, 31 Oct 2024, Jakub Jelinek wrote: > > > On Wed, Oct 23, 2024 at 05:52:13PM +, Joseph Myers wrote: > > > One test failing with a -std=gnu23 default that I wanted to > > > investigate further is gcc.dg/pr114115.c. Building

[PATCH] aarch64: Recognize vector permute patterns suitable for FMOV [PR100165]

2024-10-31 Thread Pengxuan Zheng
This patch optimizes certain vector permute expansion with the FMOV instruction when one of the input vectors is a vector of all zeros and the result of the vector permute is as if the upper lane of the non-zero input vector is set to zero and the lower lane remains unchanged. Note that the patch

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Andrew Pinski
On Thu, Oct 31, 2024 at 10:25 AM Kyrylo Tkachov wrote: > > > > > On 31 Oct 2024, at 18:06, Richard Sandiford > > wrote: > > > > Wilco Dijkstra writes: > >> The early scheduler takes up ~33% of the total build time, however it > >> doesn't > >> provide a meaningful performance gain. This is pa

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Andrew Pinski
On Thu, Oct 31, 2024 at 10:07 AM Richard Sandiford wrote: > > Wilco Dijkstra writes: > > The early scheduler takes up ~33% of the total build time, however it > > doesn't > > provide a meaningful performance gain. This is partly because modern OoO > > cores > > need far less scheduling, partly

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Kyrylo Tkachov
> On 31 Oct 2024, at 18:06, Richard Sandiford wrote: > > Wilco Dijkstra writes: >> The early scheduler takes up ~33% of the total build time, however it doesn't >> provide a meaningful performance gain. This is partly because modern OoO >> cores >> need far less scheduling, partly because th

Re: Implement removal of malloc/free pairs with NULL check

2024-10-31 Thread David Malcolm
On Thu, 2024-10-31 at 17:06 +0100, Jan Hubicka wrote: > Hi, > this patch lets us to remove >   void *mem = __builtin_malloc (s); >   if (!mem) >     __builtin_abort (); >   __builtin_free (mem); > > Where we previously stopped on "if (!mem)" marking __builtin_malloc > necessary. > This is done by

Re: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread Xi Ruoyao
On Tue, 2024-10-29 at 19:19 -0400, David Malcolm wrote: > +static void > +test_output_arg_parsing () > +{ > +  auto_fix_quotes fix_quotes; > +  auto_fix_progname fix_progname; > + > +  /* Minimal correct example.  */ > +  { > +    parser_test pt; > +    auto result = pt.parse ("foo"); > +    ASSERT

Re: [PATCH] gimple: Remove special handling of COND_EXPR for COMPARISON_CLASS_P [PR116949, PR114785]

2024-10-31 Thread Andrew Pinski
On Wed, Oct 30, 2024 at 2:12 AM Richard Biener wrote: > > On Wed, Oct 30, 2024 at 1:56 AM Andrew Pinski > wrote: > > > > After r13-707-g68e0063397ba82, COND_EXPR for gimple assign no longer could > > contain a comparison. > > The vectorizer was builting gimple assigns with comparison until > >

Re: [PATCH v3] Remove sys/user time in -ftime-report

2024-10-31 Thread Andi Kleen
> I'm getting a build failure: > > timevar.cc:163: undefined reference to `clock_gettime' > > Our frozen build tools are intended to produce binaries that work > "everywhere", so they're a few years old, but apparently something didn't > configure correctly. > > I see that libbacktrace configure

Re: testsuite: Use -std=gnu17 in gcc.dg/pr114115.c

2024-10-31 Thread Joseph Myers
On Thu, 31 Oct 2024, Jakub Jelinek wrote: > On Wed, Oct 23, 2024 at 05:52:13PM +, Joseph Myers wrote: > > One test failing with a -std=gnu23 default that I wanted to > > investigate further is gcc.dg/pr114115.c. Building with -std=gnu23 > > produces a warning: > > > > pr114115.c:18:8: warnin

Re: testsuite: Use -std=gnu17 in gcc.dg/pr114115.c

2024-10-31 Thread Jakub Jelinek
On Wed, Oct 23, 2024 at 05:52:13PM +, Joseph Myers wrote: > One test failing with a -std=gnu23 default that I wanted to > investigate further is gcc.dg/pr114115.c. Building with -std=gnu23 > produces a warning: > > pr114115.c:18:8: warning: 'ifunc' resolver for 'foo_ifunc2' should return > '

[PATCH v2 08/21] aarch64: Add __builtin_aarch64_gcs* tests

2024-10-31 Thread Yury Khrustalev
From: Szabolcs Nagy gcc/testsuite/ChangeLog: * gcc.target/aarch64/gcspopm-1.c: New test. * gcc.target/aarch64/gcspr-1.c: New test. * gcc.target/aarch64/gcsss-1.c: New test. --- gcc/testsuite/gcc.target/aarch64/gcspopm-1.c | 63 gcc/testsuite/gcc.targ

Re: [PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Richard Sandiford
Wilco Dijkstra writes: > The early scheduler takes up ~33% of the total build time, however it doesn't > provide a meaningful performance gain. This is partly because modern OoO > cores > need far less scheduling, partly because the scheduler tends to create many > unnecessary spills by increasi

Re: [RISC-V] Reorder the ready queue to avoid extraneous vsetvls

2024-10-31 Thread Robin Dapp
> So it's quite conservative, essentially using vector configuration as a > sort key of last resort and only for the highest priority insns in the > ready queue and only when it's going to let us eliminate a vsetvl. On the one hand I wondered if it does make sense to re-use compatible_p from the

Re: [PATCH v3 1/2][RFC] Provide more contexts for -Warray-bounds, -Wstringop-* warning messages due to code movements from compiler transformation [PR109071]

2024-10-31 Thread David Malcolm
On Wed, 2024-10-30 at 20:51 +, Qing Zhao wrote: > Hi, David, > > > On Oct 30, 2024, at 14:54, David Malcolm > > wrote: > > > > On Wed, 2024-10-30 at 15:53 +, Qing Zhao wrote: > > > > > > > > > > On Oct 30, 2024, at 10:48, David Malcolm > > > > wrote: > > > > > > > > On Wed, 2024-10-3

[PATCH v2 05/21] aarch64: Add __builtin_aarch64_chkfeat tests

2024-10-31 Thread Yury Khrustalev
From: Szabolcs Nagy gcc/testsuite/ChangeLog: * gcc.target/aarch64/chkfeat-1.c: New test. * gcc.target/aarch64/chkfeat-2.c: New test. Co-authored-by: Richard Sandiford --- gcc/testsuite/gcc.target/aarch64/chkfeat-1.c | 75 gcc/testsuite/gcc.target/aa

Re: testsuite: Use noinline in gcc.dg/simulate-thread/simulate-thread.h

2024-10-31 Thread Jakub Jelinek
On Thu, Oct 24, 2024 at 10:30:48PM +, Joseph Myers wrote: > Among the changes of test results with a -std=gnu23 default were two > tests changing from PASS to UNSUPPORTED: > > UNSUPPORTED: gcc.dg/simulate-thread/speculative-store.c -O2 -g thread > simulation test > UNSUPPORTED: gcc.dg/simu

[COMMITTED] RISC-V: fix const interleaved stepped vector with a scalar pattern

2024-10-31 Thread Vineet Gupta
When bisecting for ICE in PR/117353, commit 771256bcb9dd ("RISC-V: Emit costs for bool and stepped const vectors") uncovered yet another latent issue (first noted [1]) [1] https://github.com/patrick-rivos/gcc-postcommit-ci/issues/1625 This patch fixes some of the fortran regressions from that

[PATCH v3 0/8] Add maskload else operand.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp Hi, Significant changes from v2: - Decide on the else value in the vectorizer and also add the VEC_COND there (instead of during ifcvt). - Simplify aarch64 and i386 changes according to maintainers' comments. - Fixed bugs spotted by the CI. No noteworthy changes to the r

[PATCH v3 3/8] tree-ifcvt: Enforce zero else value after maskload.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp When predicating a load we implicitly assume that the else value is zero. This matters in case the loaded value is padded (like e.g. a Bool) and we must ensure that the padding bytes are zero on targets that don't implicitly zero inactive elements. A former version of this patc

[pushed: r15-4805] diagnostics: fix memory leak of m_option_mgr

2024-10-31 Thread David Malcolm
Fix some noise seen in "make selftest-valgrind". Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-4805-gd1d3c17258a564. gcc/ChangeLog: * diagnostic.cc (diagnostic_context::finish): Delete and reset m_option_mgr. Signed-off-by: David Malcolm -

[PATCH] AArch64: Switch off early scheduling

2024-10-31 Thread Wilco Dijkstra
The early scheduler takes up ~33% of the total build time, however it doesn't provide a meaningful performance gain. This is partly because modern OoO cores need far less scheduling, partly because the scheduler tends to create many unnecessary spills by increasing register pressure. Building ap

Ping Re: testsuite: Use noinline in gcc.dg/simulate-thread/simulate-thread.h

2024-10-31 Thread Joseph Myers
Ping. This patch is pending review. -- Joseph S. Myers josmy...@redhat.com

Ping Re: testsuite: Use -std=gnu17 in gcc.dg/pr114115.c

2024-10-31 Thread Joseph Myers
Ping. This patch is pending review. -- Joseph S. Myers josmy...@redhat.com

Re: [pushed: r15-4760] diagnostics: support multiple output formats simultaneously [PR116613]

2024-10-31 Thread David Malcolm
On Wed, 2024-10-30 at 10:02 -0400, David Malcolm wrote: > On Wed, 2024-10-30 at 12:22 +, Jonathan Wakely wrote: > > On 29/10/24 19:19 -0400, David Malcolm wrote: > > > This patch generalizes diagnostic_context so that rather than > > > having > > > a single output format, it has a vector of zer

[pushed: r15-4807] diagnostics: add class lazy_diagnostic_path

2024-10-31 Thread David Malcolm
This patch adds a new class lazy_diagnostic_path for use when creating rich_location instances, to allow deferring expensive computations until the path is actually used (when a diagnostic using the rich_location is emitted). Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to

[pushed: r15-4806] diagnostics: use std::move in output_factory::handler ctor

2024-10-31 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-4806-ga91569d47d68cf. gcc/ChangeLog: * opts-diagnostic.cc (output_factory::handler::handler): Use std::move on name. Signed-off-by: David Malcolm --- gcc/opts-diagnostic.cc | 2 +- 1 file chang

Re: [PATCH v3 0/8] Add maskload else operand.

2024-10-31 Thread Robin Dapp
Grr, missed the strided load patch that went upstream in the meanwhile. Will rebase and resend so the CI can pick it up. -- Regards Robin

Re: [PATCH v2] RISC-V: Fix gcc.target/riscv/rvv/base/cpymem-1.c f3

2024-10-31 Thread Jeff Law
On 10/30/24 8:10 AM, Craig Blackmore wrote: The function body checks for f3 only ran with -mcmodel explicitly set which meant I missed a regression in my local testing of: commit b039d06c9a810a3fab4c5eb9d50b0c7aff94b2d8 Author: Craig Blackmore Date: Fri Oct 18 09:17:21 2024 -0600

Implement removal of malloc/free pairs with NULL check

2024-10-31 Thread Jan Hubicka
Hi, this patch lets us to remove void *mem = __builtin_malloc (s); if (!mem) __builtin_abort (); __builtin_free (mem); Where we previously stopped on "if (!mem)" marking __builtin_malloc necessary. This is done by matching such conditional in tree-ssa-dce.cc and playing same game as we

[PATCH] LoongArch: Make __builtin_lsx_vorn_v and __builtin_lasx_xvorn_v arguments and return values unsigned

2024-10-31 Thread Xi Ruoyao
Align them with other vector bitwise builtins. This may break programs directly invoking __builtin_lsx_vorn_v or __builtin_lasx_xvorn_v, but doing so is not supported (as builtins are not documented, only intrinsics are documented and users should use them instead). gcc/ChangeLog: * conf

[PATCH v2 01/21] aarch64: Add -mbranch-protection=gcs option

2024-10-31 Thread Yury Khrustalev
From: Szabolcs Nagy This enables Guarded Control Stack (GCS) compatible code generation. The "standard" branch-protection type enables it, and the default depends on the compiler default. gcc/ChangeLog: * config/aarch64/aarch64-protos.h (aarch_gcs_enabled): Declare. * config/aa

Re: [PATCH 4/6] expmed, aarch64: Optimize vector rotates as vector permutes where possible

2024-10-31 Thread Kyrylo Tkachov
Hi Jeff, > On 31 Oct 2024, at 16:25, Jeff Law wrote: > > > > On 10/27/24 10:22 AM, Kyrylo Tkachov wrote: >> Hi all, >> Some vector rotate operations can be implemented in a single instruction >> rather than using the fallback SHL+USRA sequence. >> In particular, when the rotate amount is half

[PATCH] match: Fix `a != 0 ? a - 1 : 0` pattern [PR117363]

2024-10-31 Thread Andrew Pinski
There are a couple of things wrong with this pattern which I missed during the review. First each nop_convert should be nop_convert1 or nop_convert2. Second is we need to the minus in the same type as the minus was originally so we don't introduce extra undefined behavior (signed integer overflow).

[PATCH v3 6/8] gcn: Add else operand to masked loads.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds an undefined else operand to the masked loads. gcc/ChangeLog: * config/gcn/predicates.md (maskload_else_operand): New predicate. * config/gcn/gcn-valu.md: Use new predicate. --- gcc/config/gcn/gcn-valu.md | 14 +- gcc/confi

[PATCH v3 7/8] i386: Add else operand to masked loads.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds a zero else operand to masked loads, in particular the masked gather load builtins that are used for gather vectorization. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_special_args_builtin): Add else-operand handling. (ix86_ex

[PATCH v3 5/8] aarch64: Add masked-load else operands.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This adds zero else operands to masked loads and their intrinsics. I needed to adjust more than initially thought because we rely on combine for several instructions and a change in a "base" pattern needs to propagate to all those. For the lack of a better idea I used a function

[PATCH v3 4/8] vect: Add maskload else value support.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds an else operand to vectorized masked load calls. The current implementation adds else-value arguments to the respective target-querying functions that is used to supply the vectorizer with the proper else value. We query the target for its supported else operand

[PATCH v3 1/8] docs: Document maskload else operand and behavior.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch amends the documentation for masked loads (maskload, vec_mask_load_lanes, and mask_gather_load as well as their len counterparts) with an else operand. gcc/ChangeLog: * doc/md.texi: Document masked load else operand. --- gcc/doc/md.texi | 63

[PATCH v3 8/8] RISC-V: Add else operand to masked loads [PR115336].

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds else operands to masked loads. Currently the default else operand predicate just accepts "undefined" (i.e. SCRATCH) values. PR middle-end/115336 PR middle-end/116059 gcc/ChangeLog: * config/riscv/autovec.md: Add else operand. *

[PATCH v3 2/8] ifn: Add else-operand handling.

2024-10-31 Thread rdapp . gcc
From: Robin Dapp This patch adds else-operand handling to the internal functions. gcc/ChangeLog: * internal-fn.cc (add_mask_and_len_args): Rename... (add_mask_else_and_len_args): ...to this and add else handling. (expand_partial_load_optab_fn): Use adjusted function.

Re: [PATCH #7/7] handle TRUTH_ANDIF cond exprs in ifcombine_replace_cond

2024-10-31 Thread Jeff Law
On 10/25/24 5:57 AM, Alexandre Oliva wrote: The upcoming move of fold_truth_andor to ifcombine brings with it the possibility of TRUTH_ANDIF cond exprs. Handle them by splitting the cond so as to best use both BB insertion points, but only if they're contiguous. for gcc/ChangeLog

Re: [PATCH 1/6] PR 117048: simplify-rtx: Simplify (X << C1) [+, ^] (X >> C2) into ROTATE

2024-10-31 Thread Jeff Law
On 10/27/24 10:21 AM, Kyrylo Tkachov wrote: Hi all, simplify-rtx can transform (X << C1) | (X >> C2) into ROTATE (X, C1) when C1 + C2 == mode-width. But the transformation is also valid for PLUS and XOR. Indeed GIMPLE can also do the fold. Let's teach RTL to do it too. The motivating testc

  1   2   >