Re: Re: [PATCH v2] RISC-V:Auto vect for vector-bfloat16

2024-11-12 Thread wangf...@eswincomputing.com
On 2024-11-13 07:30  Edwin Lu wrote: > >I took a look at the CI errors today since I remember Jeff checking the >CI output. I don't remember if the errors were the main things blocking >the patch or if there just wasn't any follow up. Juzhe suggested me to addd some run test case for this patch,

[PATCH v3 ] i386: Add ix86_expand_integer_cst_argument

2024-11-12 Thread H.J. Lu
On Wed, Nov 13, 2024 at 11:25 AM H.J. Lu wrote: > > On Wed, Nov 13, 2024 at 10:23 AM Hongtao Liu wrote: > > > > On Wed, Nov 13, 2024 at 8:29 AM H.J. Lu wrote: > > > > > > On Wed, Nov 13, 2024 at 5:57 AM H.J. Lu wrote: > > > > > > > > On Tue, Nov 12, 2024 at 9:30 PM Richard Biener > > > > wrote

Re: [PATCH v2] aarch64: Optimise calls to ldexp with SVE FSCALE instruction [PR111733]

2024-11-12 Thread Soumya AR
> On 12 Nov 2024, at 4:27 PM, Richard Sandiford > wrote: > > External email: Use caution opening links or attachments > > > Soumya AR writes: >> diff --git a/gcc/config/aarch64/aarch64-sve.md >> b/gcc/config/aarch64/aarch64-sve.md >> index 06bd3e4bb2c..119a0e53853 100644 >> --- a/gcc/confi

Re: [PATCH v2 ] i386: Add ix86_expand_integer_cst_argument

2024-11-12 Thread H.J. Lu
On Wed, Nov 13, 2024 at 10:23 AM Hongtao Liu wrote: > > On Wed, Nov 13, 2024 at 8:29 AM H.J. Lu wrote: > > > > On Wed, Nov 13, 2024 at 5:57 AM H.J. Lu wrote: > > > > > > On Tue, Nov 12, 2024 at 9:30 PM Richard Biener > > > wrote: > > > > > > > > On Tue, Nov 12, 2024 at 1:49 PM H.J. Lu wrote: >

Re: [PATCH v2] RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483]

2024-11-12 Thread 钟居哲
LGTM juzhe.zh...@rivai.ai From: Li Xu Date: 2024-11-13 10:36 To: gcc-patches CC: kito.cheng; palmer; juzhe.zhong; pan2.li; xuli Subject: [PATCH v2] RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483] From: xuli This patch fixs https://gcc.gnu.org/bugzilla/show_

[PATCH v2] RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483]

2024-11-12 Thread Li Xu
From: xuli This patch fixs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117483 If prev and next satisfy the following rules, we should forbid the case (next.get_sew() < prev.get_sew() && (!next.get_ta() || !next.get_ma())) in the compatible function max_sew_overlap_and_next_ratio_valid_for_prev_

Re: [PATCH v2 ] i386: Add ix86_expand_integer_cst_argument

2024-11-12 Thread Hongtao Liu
On Wed, Nov 13, 2024 at 8:29 AM H.J. Lu wrote: > > On Wed, Nov 13, 2024 at 5:57 AM H.J. Lu wrote: > > > > On Tue, Nov 12, 2024 at 9:30 PM Richard Biener > > wrote: > > > > > > On Tue, Nov 12, 2024 at 1:49 PM H.J. Lu wrote: > > > > > > > > When passing 0xff as an unsigned char function argument,

[PATCH] i386: Fix cstorebf4 fp comparison operand [PR117495]

2024-11-12 Thread Hongyu Wang
Hi, For cstorebf4 it uses comparison_operator for BFmode compare, which is incorrect when directly uses ix86_expand_setcc as it does not canonicalize the input comparison to correct the compare code by swapping operands. Since the original code without AVX10.2 calls emit_store_flag_force, who actu

Re: [PATCH] Fix incorrect subreg mode check [PR117476]

2024-11-12 Thread Jeff Law
On 11/12/24 11:31 AM, Alexey Merzlyakov wrote: Hi, Jeff, Oops... It looks like I've made a reply to Alex at the same time when you sent an e-mail update. It happens. But as Zdenek's test showed, we've got one more issue to resolve :-) Hopefully my email gave you a solid pointer on what nee

Re: [PATCH] RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483]

2024-11-12 Thread 钟居哲
Do we need to check next.get_ma ? juzhe.zh...@rivai.ai From: Li Xu Date: 2024-11-13 08:57 To: gcc-patches CC: kito.cheng; palmer; juzhe.zhong; pan2.li; xuli Subject: [PATCH] RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483] From: xuli This patch fixs https://

Re: [PATCH] Fix incorrect subreg mode check [PR117476]

2024-11-12 Thread Andrew Pinski
On Tue, Nov 12, 2024 at 4:43 PM Jeff Law wrote: > > > > On 11/12/24 11:31 AM, Alexey Merzlyakov wrote: > > Hi, Jeff, > > > > Oops... It looks like I've made a reply to Alex at the same time when > > you sent an e-mail update. > > > > So, moving the testcase to the gcc.dg/torture directory. > > > >

Re: [Patch, fortran] PR105054 - [12/13/14/15 Regression] Using one kind of pointer functions causes the compiler to hang since r11-3029-g2b0df0a6ac79b34f

2024-11-12 Thread Jerry D
On 11/12/24 5:23 AM, Paul Richard Thomas wrote: Hi All, The ChangeLog and comment make it clear what this patch does and why. OK for mainline and backporting after a week or so? Regards Paul In the test case: A comment s/resul/result/ Also the test conditional if (trim (array_strings2(i

[PATCH] Don't skip CodeView data for partially cold functions

2024-11-12 Thread Mark Harmstone
If a function is contained in two sections, for instance if it is partially cold, it gets a DW_AT_ranges attribute in its DIE rather than the normal DW_AT_low_pc and DW_AT_high_pc. There's no way to express this in CodeView, so rather than skipping the function entirely, use the labels in the firs

[PATCH] RISC-V: Bugfix for max_sew_overlap_and_next_ratio_valid_for_prev_sew_p[pr117483]

2024-11-12 Thread Li Xu
From: xuli This patch fixs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117483 If prev and next satisfy the following rules, we should forbid the case (next.get_sew() < prev.get_sew() && !next.get_ta()) in the compatible function max_sew_overlap_and_next_ratio_valid_for_prev_sew_p. Otherwise, th

Re: [PATCH] Fix incorrect subreg mode check [PR117476]

2024-11-12 Thread Jeff Law
On 11/12/24 11:31 AM, Alexey Merzlyakov wrote: Hi, Jeff, Oops... It looks like I've made a reply to Alex at the same time when you sent an e-mail update. So, moving the testcase to the gcc.dg/torture directory. On Tue, Nov 12, 2024 at 10:56:13AM -0700, Jeff Law wrote: I think it might be b

[PATCH v2 ] i386: Add ix86_expand_integer_cst_argument

2024-11-12 Thread H.J. Lu
On Wed, Nov 13, 2024 at 5:57 AM H.J. Lu wrote: > > On Tue, Nov 12, 2024 at 9:30 PM Richard Biener > wrote: > > > > On Tue, Nov 12, 2024 at 1:49 PM H.J. Lu wrote: > > > > > > When passing 0xff as an unsigned char function argument, the C frontend > > > promotion will promote it to int: > > > > >

Re: [PATCH] RISC-V: Fix target-attr-norelax.c testcase

2024-11-12 Thread Jeff Law
On 11/12/24 11:56 AM, Yangyu Chen wrote: The target-attr-norelax.c testcase was failing due to the redundant "\t" check in the assembly output, and forgot to skip the check for lto build in the testcase. Signed-off-by: Yangyu Chen gcc/testsuite/ChangeLog: * gcc.target/riscv/target-

Re: [PATCH v2] RISC-V:Auto vect for vector-bfloat16

2024-11-12 Thread Edwin Lu
I took a look at the CI errors today since I remember Jeff checking the CI output. I don't remember if the errors were the main things blocking the patch or if there just wasn't any follow up. I'll look into having the CI output some additional test log information to make understanding failur

RE: [PATCH v1 1/2] Revert "Match: Simplify branch form 3 of unsigned SAT_ADD into branchless"

2024-11-12 Thread Li, Pan2
> Just the first patch - I didn't have time to look at the second one yet. I see, thanks a lot. Pan -Original Message- From: Richard Biener Sent: Tuesday, November 12, 2024 10:39 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; tamar.christ...@arm.com; juzhe.zh...@rivai.ai; kito.ch...@gm

Re: [PATCH] Add new hardreg PRE pass

2024-11-12 Thread Richard Sandiford
Sorry for the slow review. I think Jeff's much better placed to comment on this than I am, but here's a stab. Mostly it looks really good to me FWIW. Andrew Carlotti writes: > This pass is used to optimise assignments to the FPMR register in > aarch64. I chose to implement this as a middle-end

[pushed: r15-5179] selftests: clear GCC_COLORS [PR117503]

2024-11-12 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-5179-g169897bb402c46. gcc/ChangeLog: PR bootstrap/117503 * Makefile.in (GCC_FOR_SELFTESTS): Set GCC_COLORS=. Signed-off-by: David Malcolm --- gcc/Makefile.in | 2 +- 1 file changed, 1 insertion

Re: [PATCH] i386: Add ix86_expand_integer_cst_argument

2024-11-12 Thread H.J. Lu
On Tue, Nov 12, 2024 at 9:30 PM Richard Biener wrote: > > On Tue, Nov 12, 2024 at 1:49 PM H.J. Lu wrote: > > > > When passing 0xff as an unsigned char function argument, the C frontend > > promotion will promote it to int: > > > > constant > > 255> > > > > and expand_normal always returns the r

Re: [PATCH v5] c: add Wzero-as-null-pointer-constant [PR117059]

2024-11-12 Thread Joseph Myers
On Tue, 12 Nov 2024, Martin Uecker wrote: > Added tests with some non-NPC pointers converted to bool. This version is OK. -- Joseph S. Myers josmy...@redhat.com

Re: [Committed] RISC-V: testsuite: Remove deprecated compatibility headers

2024-11-12 Thread Edwin Lu
Committed! Edwin On 11/11/2024 11:02 AM, Jeff Law wrote: On 11/11/24 11:16 AM, Edwin Lu wrote: Since r15-4981-g5c34f02ba7e these tests have been failing on vector targets with excess errors due to the new deprecation warning message. Remove the header. gcc/testsuite/ChangeLog: * g++.t

Re: [PATCHv2 0/3] ada: Add GNU/Hurd x86_64 support

2024-11-12 Thread Samuel Thibault
Hello, Marc Poulhiès, le mar. 12 nov. 2024 10:08:49 +0100, a ecrit: > I can take care of merging your changes when this is done, Thanks, I have sent v3. > I've checked and you're not listed in the FSF copyright assignment for > GCC. Maybe you are contributing this through your employer? If not,

[PATCHv3 3/3] ada: Add GNU/Hurd x86_64 support

2024-11-12 Thread Samuel Thibault
This is essentially the same as the i386-pc-gnu section, the differences are the same as between freebsd i386 and freebsd x86_64. gcc/ada/ChangeLog: * Makefile.rtl: Add x86_64-pc-gnu section. Signed-off-by: Samuel Thibault --- gcc/ada/Makefile.rtl | 32

[PATCHv3 0/3] ada: Add GNU/Hurd x86_64 support

2024-11-12 Thread Samuel Thibault
Difference with v2: dropped the ChangeLog changes Samuel Thibault (3): ada: Factorize bsd signal definitions ada: Fix GNU/Hurd priority range ada: Add GNU/Hurd x86_64 support gcc/ada/Makefile.rtl | 48 +- ...-intnam__freebsd.ads => a-intnam__bsd.ads} | 2 +-

[PATCHv3 1/3] ada: Factorize bsd signal definitions

2024-11-12 Thread Samuel Thibault
They are all the same on all BSD-like systems (including GNU/Hurd). gcc/ada/ChangeLog: * libgnarl/a-intnam__freebsd.ads: Rename to... * libgnarl/a-intnam__bsd.ads: ... new file. * libgnarl/a-intnam__dragonfly.ads: Remove file. * Makefile.rtl (x86-kfreebsd, x86-gnuh

[PATCHv3 2/3] ada: Fix GNU/Hurd priority range

2024-11-12 Thread Samuel Thibault
GNU/Mach currently uses a 0..63 range. gcc/ada/ChangeLog: * libgnat/system-gnu.ads: New file. * Makefile.rtl (x86-gnuhurd): Use libgnat/system-gnu.ads instead of libgnat/system-freebsd.ads. Signed-off-by: Samuel Thibault --- gcc/ada/Makefile.rtl | 2 +- gcc/

[committed] hppa: Fix decrement_and_branch_until_zero constraint

2024-11-12 Thread John David Anglin
Noticed reload1.cc was miscompiled with LRA. Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11. Committed to active branches. Dave --- hppa: Fix decrement_and_branch_until_zero constraint The third alternative for argument 4 needs to be an early clobber constraint. Noticed testing LRA.

[Patch][v2] OpenMP: 'interop' construct - add C parser support, improve Fortran pasing

2024-11-12 Thread Tobias Burnus
Minor update: Main change is to use 'char' more consistently (e.g. for omp_get_fr_id_from_name and GOMP_INTEROP_IFR_UNKNOWN etc.) in the hope that it will fix the build bot issues for ARM. Additionally, I fixed some indentation "issues" in one testcase and in for C++, the __GOMP_UINTPTR_T_ENUM ma

Re: [PATCH] RISC-V: Fix target-attr-norelax.c testcase

2024-11-12 Thread Yangyu Chen
Sorry for the wrong address CC to Yulong. And this should add fixes: Fixes: 4bee5252c1de ("RISC-V: Add norelax function attribute")

[PATCH] RISC-V: Fix target-attr-norelax.c testcase

2024-11-12 Thread Yangyu Chen
The target-attr-norelax.c testcase was failing due to the redundant "\t" check in the assembly output, and forgot to skip the check for lto build in the testcase. Signed-off-by: Yangyu Chen gcc/testsuite/ChangeLog: * gcc.target/riscv/target-attr-norelax.c: Fix testcase. --- gcc/testsui

Re: [PATCH 1/2] Add suggested_epilogue_mode to vector costs

2024-11-12 Thread Jeff Law
On 11/11/24 5:16 AM, Richard Biener wrote: The following enables targets to suggest the vector mode to be used preferably for the epilogue of a vectorized loop. The patch also enables more than one vectorized epilogue in case the target suggests a vector mode for the epilogue of a vector epil

Re: [PATCH] Fix incorrect subreg mode check [PR117476]

2024-11-12 Thread Alexey Merzlyakov
Hi, Jeff, Oops... It looks like I've made a reply to Alex at the same time when you sent an e-mail update. So, moving the testcase to the gcc.dg/torture directory. On Tue, Nov 12, 2024 at 10:56:13AM -0700, Jeff Law wrote: > > I think it might be better to put the test in gcc.c-torture/execute, >

Re: [PATCH] Fix incorrect subreg mode check [PR117476]

2024-11-12 Thread Alexey Merzlyakov
Hi, Alex, On Tue, Nov 12, 2024 at 11:46:54AM +, Alex Coplan wrote: > I think it might be better to put the test in gcc.c-torture/execute, > then it will automatically get run with the various torture options > and you should be able to drop both the dejagnu directives. > > Thanks, > Alex Yep.

[PATCH][v2] Set --param vect-force-slp=1

2024-11-12 Thread Richard Biener
The following pulls the trigger, defaulting --param vect-force-slp to 1. I know of no features missing but eventually minor testsuite and optimization quality fallout. Re-do CI with improvements from today. * params.opt (vect-force-slp): Default to 1. --- gcc/params.opt | 2 +- 1 file ch

Re: [PATCH] Fix incorrect subreg mode check [PR117476]

2024-11-12 Thread Jeff Law
On 11/12/24 4:46 AM, Alex Coplan wrote: Hi Alexey, On 12/11/2024 08:18, Alexey Merzlyakov wrote: gcc/ChangeLog: * simplify-rtx.cc (simplify_context::simplify_unary_operation_1): Fix subreg mode check during zero_extend(not) -> xor optimization. gcc/testsuite/ChangeLog:

Re: [PATCH] AArch64: Switch off early scheduling

2024-11-12 Thread Richard Sandiford
Wilco Dijkstra writes: > Hi, > What do you think about disabling late scheduling as well? >>> >>> I think this would definitely need separate consideration and evaluation >>> given the above. >>> >>> Another thing to consider is the macro fusion machinery. IIRC it works >>> during schedulin

Re: [PATCH v2] AArch64: Block combine_and_move from creating FP literal loads

2024-11-12 Thread Richard Sandiford
Wilco Dijkstra writes: > Hi Richard, > >> The idea was that, if we did the split during expand, the movsf/df >> define_insns would then only accept the immediates that their >> constraints can handle. > > Right, always disallowing these immediates works fine too (it seems > reload doesn't require

Re: [PATCH v4 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-11-12 Thread Paul-Antoine Arras
On 04/11/2024 14:57, Tobias Burnus wrote: Hi PA, Regarding the update middle end patch, included in this patch, i.e. v4.3-0002-OpenMP-middle-end-support-for-dispatch-adjust_arg.patch: @@ -4071,23 +4073,136 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value) [...] +

Re: [PATCH v3 0/8] SMALL code model fixes, optimization fixes, LTO and minimal C++ enablement

2024-11-12 Thread Richard Sandiford
Evgeny Karpov writes: > Hello, > > Thank you for reviewing v2! > v3 addresses all comments on v2. > > Changes in v3: > - Refactor implementation for the offset limit extension in > "symbol + offset" from 1MB to 16MB. > - Apply HOST_WIDE_INT_PRINT_UNSIGNED in ASM_OUTPUT_LOCAL. > - Exclude the "Di

Re: [PATCH] AArch64: Switch off early scheduling

2024-11-12 Thread Wilco Dijkstra
Hi, >>> What do you think about disabling late scheduling as well? >> >> I think this would definitely need separate consideration and evaluation >> given the above. >> >> Another thing to consider is the macro fusion machinery. IIRC it works >> during scheduling so if we don’t run any schedulin

[PATCH] Add support for nonnull_if_nonzero attribute [PR117023]

2024-11-12 Thread Jakub Jelinek
Hi! As mentioned in an earlier thread, C2Y voted in a change which made various library APIs callable with NULL arguments in certain cases, e.g. memcpy (NULL, NULL, 0); is now valid, although memcpy (NULL, NULL, 1); remains invalid. This affects various APIs, including several of GCC builtins; pl

[to-be-committed][RISC-V] Fix costing of LO_SUM expressions

2024-11-12 Thread Jeff Law
This is a rewrite of a patch originally from Xianmiao Qu. Xianmiao noticed that the costs we compute for LO_SUM expressions was incorrect. Essentially we costed based solely on the first input to the LO_SUM. In a LO_SUM, the first input is almost always going to be a REG and thus isn't intere

Re: [PATCH v3 6/8] aarch64: Extend the offset limit in "symbol + offset" from 1MB to 16MB

2024-11-12 Thread Richard Sandiford
Evgeny Karpov writes: > This patch allows using an offset of up to 16MB in "symbol + offset", > instead of 1MB limit that was used previously. > > gcc/ChangeLog: > > * config/aarch64/aarch64.cc (aarch64_load_symref_appropriately): > Update. > --- > gcc/config/aarch64/aarch64.cc | 19 +

[PATCH] Fix test failures for enum-alias-{1,2,3} on arm-eabi [PR117419]

2024-11-12 Thread Martin Uecker
I added a max element as suggested by Richard to force the type to an int. Regression tested on x86_64 but needs testing on arm-eabi. Thiago, could you test this? https://linaro.atlassian.net/browse/GNU-1224 Fix test failures for enum-alias-{1,2,3} on arm-eabi [PR117419] The tes

Re: [PATCH v3 5/8] aarch64: Multiple adjustments to support the SMALL code model correctly

2024-11-12 Thread Richard Sandiford
Evgeny Karpov writes: > LOCAL_LABEL_PREFIX has been changed to help the assembly > compiler recognize local labels. Emitting locals has been > replaced with the .lcomm directive to declare uninitialized > data without defining an exact section. Functions and objects > were missing declarations. Bi

Re: [PATCH v2] AArch64: Block combine_and_move from creating FP literal loads

2024-11-12 Thread Wilco Dijkstra
Hi Richard, > The idea was that, if we did the split during expand, the movsf/df > define_insns would then only accept the immediates that their > constraints can handle. Right, always disallowing these immediates works fine too (it seems reload doesn't require all immediates to be valid), and th

Re: [PATCH 0/10] aarch64: Add new flags for existing features

2024-11-12 Thread Andrew Carlotti
On Fri, Oct 04, 2024 at 06:50:36PM +0100, Andrew Carlotti wrote: > This patch series adds 7 new flags for features that were previously available > in GCC only as part of an architecture version. It also fixes one other > instance where an architecture version was used in a check instead of a > f

[PATCH 10/10] aarch64: Try to avoid passing new flags to assembler

2024-11-12 Thread Andrew Carlotti
These new flags (+fcma, +jscvt, +rcpc2, +jscvt, +frintts, +wfxt and +xs) were only recently added to the assembler. To improve compatibility with older assemblers, we try to avoid passing these new flags to the assembler if we can express the targetted architecture without them. We do so by using

[PATCH 9/10] docs: Add new AArch64 flags

2024-11-12 Thread Andrew Carlotti
gcc/ChangeLog: * doc/invoke.texi: Add new AArch64 flags. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7146163d66d068522f5aa19f59badc1b05d05114..56186e98ca6a4d28d1c315746ade89cdc835219e 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21439,11 +21439,11 @@

Re: [PATCH v2 4/4] aarch64: add svcvt* FP8 intrinsics

2024-11-12 Thread Claudio Bantaloukas
On 12/11/2024 12:05, Richard Sandiford wrote: Claudio Bantaloukas writes: This patch adds the following intrinsics: - svcvt1_bf16[_mf8]_fpm - svcvt1_f16[_mf8]_fpm - svcvt2_bf16[_mf8]_fpm - svcvt2_f16[_mf8]_fpm - svcvtlt1_bf16[_mf8]_fpm - svcvtlt1_f16[_mf8]_fpm - svcvtlt2_bf16[_mf8]_fpm - svcv

[PATCH v3 8/8] aarch64: Bypass hidden attribute warnings in MinGW

2024-11-12 Thread Evgeny Karpov
The patch bypasses hidden attribute warnings in MinGW until it is implemented. libgcc/ChangeLog: * config.host: Update. * config/aarch64/t-mingw: New. --- libgcc/config.host| 1 + libgcc/config/aarch64/t-mingw | 2 ++ 2 files changed, 3 insertions(+) create mode 1006

Re: [PATCH] c++, dyninit, v3: Optimize C++ dynamic initialization by constants into DECL_INITIAL adjustment [PR102876]

2024-11-12 Thread Jakub Jelinek
On Tue, Nov 12, 2024 at 04:32:29PM +0100, Jakub Jelinek wrote: > I wanted to avoid -O0 or -Og in case user wants to step through the global > constructor or functions called from there, the optimization (and it is an > optimization, so I think optimize is appropriate in any case) changes the > debu

[PATCH v3 7/8] Add LTO support

2024-11-12 Thread Evgeny Karpov
The patch reuses the configuration for LTO from ix86 and adds the aarch64 architecture to the list of supported COFF headers. gcc/ChangeLog: * config/aarch64/cygming.h (TARGET_ASM_LTO_START): New. (TARGET_ASM_LTO_END): Likewise. * config/i386/cygming.h (TARGET_ASM_LTO_STAR

[PATCH v3 6/8] aarch64: Extend the offset limit in "symbol + offset" from 1MB to 16MB

2024-11-12 Thread Evgeny Karpov
This patch allows using an offset of up to 16MB in "symbol + offset", instead of 1MB limit that was used previously. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_load_symref_appropriately): Update. --- gcc/config/aarch64/aarch64.cc | 19 +++ 1 file changed,

Re: [pushed] c++: reduce unnecessary tree_common

2024-11-12 Thread Jason Merrill
On 11/12/24 2:55 AM, Richard Biener wrote: On Mon, Nov 11, 2024 at 5:33 PM Jason Merrill wrote: Don't you need to adjust cp_common_init_ts () as well for this? Oddly enough PTRMEM_CST is already TS_TYPED there and others are not adjusted at all. Right, this patch fixed the type definitions t

[PATCH v3 5/8] aarch64: Multiple adjustments to support the SMALL code model correctly

2024-11-12 Thread Evgeny Karpov
LOCAL_LABEL_PREFIX has been changed to help the assembly compiler recognize local labels. Emitting locals has been replaced with the .lcomm directive to declare uninitialized data without defining an exact section. Functions and objects were missing declarations. Binutils was not able to distinguis

[PATCH v3 4/8] aarch64: Exclude symbols using GOT from code models

2024-11-12 Thread Evgeny Karpov
Symbols using GOT are not supported by the aarch64-w64-mingw32 target and should be excluded from the code models. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_classify_symbol): Disable GOT for PECOFF target. --- gcc/config/aarch64/aarch64.cc | 6 -- 1 file changed, 4

[PATCH v3 3/8] aarch64: Add minimal C++ support

2024-11-12 Thread Evgeny Karpov
The patch resolves compilation issues for the C++ language. Previous patch series contributed to C++ as well, however, C++ could not be tested until we got a C++ compiler and could build at least a "Hello World" C++ program, and in reality, more than that. Another issue has been fixed in the libst

[PATCH v3 0/8] SMALL code model fixes, optimization fixes, LTO and minimal C++ enablement

2024-11-12 Thread Evgeny Karpov
Hello, Thank you for reviewing v2! v3 addresses all comments on v2. Changes in v3: - Refactor implementation for the offset limit extension in "symbol + offset" from 1MB to 16MB. - Apply HOST_WIDE_INT_PRINT_UNSIGNED in ASM_OUTPUT_LOCAL. - Exclude the "Disable the anchors" patch as it is not nee

[PATCH v3 2/8] aarch64: Add debugging information

2024-11-12 Thread Evgeny Karpov
This patch enables DWARF and allows compilation with debugging information by using "gcc -g". The unwind info is disabled for the moment and will be revisited after SEH implementation for the target. gcc/ChangeLog: * config/aarch64/aarch64.cc (TARGET_ASM_UNALIGNED_HI_OP): Enable D

[PATCH v3 1/8] Support weak references

2024-11-12 Thread Evgeny Karpov
The patch adds support for weak references. The original MinGW implementation targets ix86, which handles weak symbols differently compared to AArch64. In AArch64, the weak symbols are replaced by other symbols which reference the original weak symbols, and the compiler does not track the original

Re: [PATCH] c++, dyninit, v3: Optimize C++ dynamic initialization by constants into DECL_INITIAL adjustment [PR102876]

2024-11-12 Thread Jakub Jelinek
On Tue, Nov 12, 2024 at 10:18:49AM -0500, Jason Merrill wrote: > Why the v3 tag in the subject line? I don't see any libstdc++ changes. 3rd version of the patch. That has nothing to do with libstdc++. > > + if (optimize && !optimize_debug && !guard_if_stmt && !sanitize) > > Why suppress th

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

2024-11-12 Thread Jan Hubicka
> Hi, > this is updated patch which adds -fmalloc-dce flag to control malloc/free > removal. I ended up copying what -fallocation-dse does so -fmalloc-dce=1 > enables malloc/free removal provided return value is unused otherwise and > -fmalloc-dce=2 allows additional NULL pointer checks which it f

Re: [PATCH] c++, dyninit, v3: Optimize C++ dynamic initialization by constants into DECL_INITIAL adjustment [PR102876]

2024-11-12 Thread Jason Merrill
On 11/11/24 3:43 AM, Jakub Jelinek wrote: Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588539.html patch. Previous mails on this topic https://gcc.gnu.org/pipermail/gcc-patches/2021-November/thread.html#583289 https://gcc.gnu.org/pipermail/gcc-patches/2021-Dece

Re: [PATCH] testsuite: Adjust jump threading test expectation

2024-11-12 Thread Andrew Carlotti
On Wed, Nov 06, 2024 at 02:28:39PM -0800, Andrew Pinski wrote: > On Tue, Nov 5, 2024 at 4:53 AM Andrew Carlotti > wrote: > > > > This test started failing on aarch64 after 0cfc9c95 in 2023 ("Phi > > analyzer - Initialize with range instead of a tree."). > > > > The only change visible in the pass

Re: Add testcase that we optimize away empty std::vector

2024-11-12 Thread Jakub Jelinek
On Tue, Nov 12, 2024 at 04:00:03PM +0100, Jan Hubicka wrote: > Hi, > with __builtin_operator_new we now can optimize away unused std::vectors. > This adds testcases mentioned in the PR. > > Regtested x86_64-linux and comitted. > > PR tree-optimization/96945 > > gcc/testsuite/ChangeLog: >

Add testcase that we optimize away empty std::vector

2024-11-12 Thread Jan Hubicka
Hi, with __builtin_operator_new we now can optimize away unused std::vectors. This adds testcases mentioned in the PR. Regtested x86_64-linux and comitted. PR tree-optimization/96945 gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/pr96945.C: New test. diff --git a/gcc/testsuite/g++.

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

2024-11-12 Thread Jonathan Wakely
On Mon, 4 Nov 2024 at 21:34, François Dumont wrote: > > > On 04/11/2024 19:45, Jonathan Wakely wrote: > > On Mon, 4 Nov 2024 at 18:30, François Dumont wrote: > >> > >> On 21/10/2024 06:56, François Dumont wrote: > >> > >> > >> On 17/10/2024 23:11, Jonathan Wakely wrote: > >> > >> > >> > >> On Thu

Re: [PATCH v1 1/2] Revert "Match: Simplify branch form 3 of unsigned SAT_ADD into branchless"

2024-11-12 Thread Richard Biener
On Tue, Nov 12, 2024 at 3:18 PM Li, Pan2 wrote: > > Thanks Richard for reviewing. > > > OK. > > Sorry for disturbing, is the approval for the series or just the first patch. Just the first patch - I didn't have time to look at the second one yet. Richard. > Pan > > -Original Message- >

Re: [PATCH] RISC-V: Add norelax function attribute

2024-11-12 Thread Kito Cheng
Pushed with Yangyu's suggestion :) On Fri, Nov 8, 2024 at 3:03 PM yulong wrote: > > Thanks, Kito and yangyu! > > 在 2024/11/8 0:35, Yangyu Chen 写道: > > Thanks for doing this! > > > >> On Nov 8, 2024, at 00:19, shiyul...@iscas.ac.cn wrote: > >> > >> From: yulong > >> > >> This patch adds norelax f

Re: [RFA/RFC][RISC-V] Fix type on vector move pattern

2024-11-12 Thread Robin Dapp
> So I was looking into a horrific schedule for SAD a week or so ago and > came across this gem. > > Basically we were treating a vector load as a vector move from a > scheduling standpoint during sched1. Naturally we didn't expose much > ILP during sched1. That in turn caused the register all

Re: [RFC/RFA] [PATCH v7 08/12] Add a new pass for naive CRC loops detection.

2024-11-12 Thread Mariam Arutunian
On Tue, Nov 12, 2024 at 2:32 AM Jeff Law wrote: > > > On 11/9/24 12:44 PM, Mariam Arutunian wrote: > > This patch adds a new compiler pass aimed at identifying naive CRC > > implementations, > > characterized by the presence of a loop calculating a CRC (polynomial > > long division). > > Upon det

[RFA/RFC][RISC-V] Fix type on vector move pattern

2024-11-12 Thread Jeff Law
So I was looking into a horrific schedule for SAD a week or so ago and came across this gem. Basically we were treating a vector load as a vector move from a scheduling standpoint during sched1. Naturally we didn't expose much ILP during sched1. That in turn caused the register allocator to

RE: [PATCH v1 1/2] Revert "Match: Simplify branch form 3 of unsigned SAT_ADD into branchless"

2024-11-12 Thread Li, Pan2
Thanks Richard for reviewing. > OK. Sorry for disturbing, is the approval for the series or just the first patch. Pan -Original Message- From: Richard Biener Sent: Tuesday, November 12, 2024 8:16 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; tamar.christ...@arm.com; juzhe.zh...@rivai.

[COMMITTED 30/30] ada: Fix internal error on instantiation of package with a nested ghost package

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The instantiation triggers an internal error in Gigi because of a dangling ghost entity created by the finalization machinery. gcc/ada/ChangeLog: PR ada/114300 * exp_ch7.adb (Attach_Object_To_Master_Node): Propagate the Is_Ignored_Ghost_Entity flag fr

Re: [PATCH 3/3] c++: use diagnostic nesting [PR116253]

2024-11-12 Thread David Malcolm
On Tue, 2024-11-12 at 09:02 -0500, David Malcolm wrote: > This patch uses the nested diagnostics capabilities added in the > earlier > patch in the C++ frontend. > > With this, and enabling the non-standard text formatting via: >   -fdiagnostics-set-output=text:experimental-nesting=yes > and using

[PATCH 1/3] diagnostics: add support for nested diagnostics [PR116253]

2024-11-12 Thread David Malcolm
Previously the diagnostic subsystem supported a one-deep hierarchy via auto_diagnostic_group, for associating notes with the warning/error they annotate; this only affects SARIF output, not text output. This patch adds support to the diagnostics subsystem for capturing arbitrarily deep nesting str

[PATCH 3/3] c++: use diagnostic nesting [PR116253]

2024-11-12 Thread David Malcolm
This patch uses the nested diagnostics capabilities added in the earlier patch in the C++ frontend. With this, and enabling the non-standard text formatting via: -fdiagnostics-set-output=text:experimental-nesting=yes and using: -std=c++20 -fconcepts-diagnostics-depth=2 then the output for the

[PATCH 2/3] c++: consolidate location printing in error.cc [PR116253]

2024-11-12 Thread David Malcolm
Consolidate the location-printing logic in cp/error.cc, as preliminary work towards supporting nested diagnostics (PR other/116253). gcc/cp/ChangeLog: PR other/116253 * error.cc (print_location): Move to earlier in the file. (print_instantiation_partial_context_line): Repla

[PATCH 0/3] Nested diagnostics for g++ [PR116253]

2024-11-12 Thread David Malcolm
The following patch kit adds experimental support for nested diagnostics to g++. As noted in P3358R0 ("SARIF for Structured Diagnostics"), C++ diagnostics involving concepts can be made much more readable by capturing the hierarchical structure of the diagnostics and displaying this structure to t

Re: [RFC/RFA][PATCH v7 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs.

2024-11-12 Thread Jeff Law
On 11/9/24 12:43 PM, Mariam Arutunian wrote: This patch introduces new built-in functions to GCC for computing bit- forward and bit-reversed CRCs. These builtins aim to provide efficient CRC calculation capabilities. When the target architecture supports CRC operations (as indicated by the p

Re: [PATCH 0/4] libsanitizer: merge from upstream

2024-11-12 Thread Kito Cheng
Pushed with LOCAL_PATCHES update :) On Fri, Nov 8, 2024 at 7:40 PM Jakub Jelinek wrote: > > On Fri, Nov 08, 2024 at 07:38:13PM +0800, Xi Ruoyao wrote: > > IIUC 4/4 shouldn't be in LOCAL_PATCHES? It modifies our own test case, > > not from the upstream. > > Sure, sorry. > > Jakub >

[COMMITTED 05/10] ada: Fix assertion failure on null aggregate in generic with pragma Ada_2022

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This happens when the unit is instantiated in a non-Ada 2022 unit. gcc/ada/ChangeLog: PR ada/114127 * sem_aggr.adb (Is_Null_Aggregate): Replace test on Ada_Version with test on Nkind. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/

Re: [PATCH] i386: Add ix86_expand_integer_cst_argument

2024-11-12 Thread Richard Biener
On Tue, Nov 12, 2024 at 1:49 PM H.J. Lu wrote: > > When passing 0xff as an unsigned char function argument, the C frontend > promotion will promote it to int: > > constant > 255> > > and expand_normal always returns the rtx value using the sign-extended > representation, > > (const_int 255 [0xff

[COMMITTED 18/30] ada: Flatten Is_Build_In_Place_Aggregate_Return predicate

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The predicate is passed an aggregate node and goes up its parent chain, but that's unnecessary because Convert_To_Assignments has already done so in the case of a record aggregate and Expand_Array_Aggregate does not fully support intermediate conditional expressions yet. gcc/

[COMMITTED 01/10] ada: Fix unexpected Program_Error raised in the parser on mismatched []

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This happens for example with: A : constant array (Natural range <>) of String := [ "xor" [; The problem is that the left bracket token is incorrectly classified as a name extension, but there is no handler in the Scan_Name_Extension_OK part of P_Name in Par.Ch4. gcc/ada/

[Patch, fortran] PR105054 - [12/13/14/15 Regression] Using one kind of pointer functions causes the compiler to hang since r11-3029-g2b0df0a6ac79b34f

2024-11-12 Thread Paul Richard Thomas
Hi All, The ChangeLog and comment make it clear what this patch does and why. OK for mainline and backporting after a week or so? Regards Paul diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 51e0af410c1..c54b3c85621 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolv

[committed] Fix minor c6x backend bug exposed by CRC patches

2024-11-12 Thread Jeff Law
This is a minor bug in the c6x port I saw when testing Mariam's CRC work. Specifically some of the CRC tests were failing with a segfault testing if an operand was an "a_register" from within the dest_regfile attribute. We were extracting what we thought should have been a register operand th

[COMMITTED 10/10] ada: Typo fix in comment

2024-11-12 Thread Marc Poulhiès
gcc/ada/ChangeLog: * gcc-interface/Makefile.in: Remove extra 'with'. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/M

[COMMITTED 08/10] ada: Fix spurious error on iterated component association with large index type

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This is only for the Ada 2022 form of the iterated component association. gcc/ada/ChangeLog: * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Use a type sized from the index type to compute the length. Simplify and remove useless calls to New_Copy_Tree

[COMMITTED 04/10] ada: Get rid of N_Unchecked_Expression node

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This node is used in a single place in the front-end: it wraps the newly built N_Indexed_Component nodes on the left-hand side of assignments generated to elaborate array aggregates, and its effect is to disable range checks for the expressions of these nodes. Most of the cod

[COMMITTED 24/30] ada: Allow file mapping for System's spec

2024-11-12 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, it was never allowed to use pragma Source_File_Name for the spec of System, allegedly because Targparm.Get_Target_Parameters is called before configuration pragmas are processed. Using a mapping file was allowed but did not work correctly. This patch ma

[COMMITTED 20/30] ada: Get rid of Kill_Range_Checks flag on entities

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This flag is set in a single context, namely semantic analysis of record type definitions, to avoid generating spurious range checks from it, and a large testing campaign showed that, in practice, it makes a difference in a single case, namely an access-to-constrained-array co

[COMMITTED 03/10] ada: Fix internal error on invalid prefix with assertions enabled

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou This happens for example with: package Q3 is type Types is (One, Two); end Q3; with Q3; package P3 is Kind : Q3.Types := Q3.Types.One; end P3; and prevents the error from being given. gcc/ada/ChangeLog: PR ada/112979 * sem_ch8.adb (Find_Selected_Compo

[COMMITTED 23/30] ada: Fix markup typos

2024-11-12 Thread Marc Poulhiès
From: Richard Kenner gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix minor markup errors. * doc/gnat_ugn/gnat_utility_programs.rst: Likewise. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 06/30] ada: Add Ada coverage instrumentation support

2024-11-12 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * gnat2.gpr: New file. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gnat2.gpr | 54 +++ 1 file changed, 54 insertions(+) create mode 100644 gcc/ada/gnat2.gpr diff --git a/gcc/ad

[COMMITTED 25/30] ada: Remove couple of irregular calls to Resolve_Aggr_Expr

2024-11-12 Thread Marc Poulhiès
From: Eric Botcazou The function is supposed to be passed an expression, but it is passed the enclosing N_Component_Association node in a couple of cases, only to give an error that can as well be given in the caller, at the cost of bypasses to disable most of its processing. gcc/ada/ChangeLog:

  1   2   >