Re: [PATCH 0/7] ira/lra: Support subreg coalesce

2023-11-11 Thread Lehua Ding
Hi Dimitar, On 2023/11/11 0:00, Dimitar Dimitrov wrote: On Fri, Nov 10, 2023 at 04:53:57PM +0800, Lehua Ding wrote: The divide by zero error above is interesting. I'm not sure why ira_reg_class_max_nregs[] yields 0 for the pseudo register 168 in the following rtx: (debug_insn 168 167 169 19 (va

RE: [PATCH v2] DSE: Allow vector type for get_stored_val when read < store

2023-11-11 Thread Li, Pan2
Thanks Richard S and Jeff for comments. > Did you want to use known_le so that you'd pick up the case when the two > modes are the same size? Or was known_lt the test you really wanted > (and if so, why). Take known_lt in v2 due to consideration that leave the equal go to original code path.

[PATCH] c++/modules: seed namespaces for bindings [PR106363]

2023-11-11 Thread Nathaniel Shead
Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. -- >8 -- Currently the first depset for an EK_BINDING is not seeded. This breaks the attached testcase as then the namespace is not considered referenced yet during streaming, but we've already finished importing. Ther

[PATCH] Fix UB in weekday::weekday(sys_days) and add test.

2023-11-11 Thread Cassio Neri
The following has undefined behaviour (signed overflow) [1]: weekday max{sys_days{days{numeric_limits::max()}}}; The issue is in this line when __n is very large and __n + 4 overflows: return weekday(__n >= -4 ? (__n + 4) % 7 : (__n + 5) % 7 + 6); In addition to fixing this bug, the new i

Re: Re: [PATCH 0/7] ira/lra: Support subreg coalesce

2023-11-11 Thread 钟居哲
Hi, Richard. >> Maybe dead lanes are better tracked at the gimple level though, not sure. >> (But AArch64 might need to lower lane operations more than it does now if >> we want gimple to handle it.) We were trying to address such issue at GIMPLE leve at the beginning. Tracking subreg-lanes of tu

[PATCH] LoongArch: Use simplify_gen_subreg instead of gen_rtx_SUBREG in loongarch_expand_vec_cond_mask_expr [PR112476]

2023-11-11 Thread Xi Ruoyao
GCC internal says: 'subreg's of 'subreg's are not supported. Using 'simplify_gen_subreg' is the recommended way to avoid this problem. Unfortunately loongarch_expand_vec_cond_mask_expr might create nested subreg under certain circumstances, causing an ICE. Use simplify_gen_subreg as the

[PATCH] testsuite: Fix bad-mapper-1.C test failures with posix_spawn

2023-11-11 Thread Brendan Shanks
bad-mapper-1.C has been failing since the posix_spawn codepath was added to libiberty, adjust the check to accept the changed error message. Patch has been verified on x86_64 Linux. gcc/testsuite: * g++.dg/modules/bad-mapper-1.C: Also accept posix_spawn. Signed-off-by: Brendan Shanks -

[PATCH v3] libstdc++: Simplify year::is_leap().

2023-11-11 Thread Cassio Neri
The current implementation returns (_M_y & (__is_multiple_of_100 ? 15 : 3)) == 0; where __is_multiple_of_100 is calculated using an obfuscated algorithm which saves one ror instruction when compared to _M_y % 100 == 0 [1]. In leap years calculation, it's correct to replace the divisibility che

Re: [RFC PATCH] Detecting lifetime-dse issues via Valgrind [PR66487]

2023-11-11 Thread Sam James
exactl...@ispras.ru writes: > From: Daniil Frolov > > PR 66487 is asking to provide sanitizer-like detection for C++ object lifetime > violations that are worked around with -fno-lifetime-dse in Firefox, LLVM, > OpenJade. > > The discussion in the PR was centered around extending MSan, but MSan

Re: [RFC PATCH] Detecting lifetime-dse issues via Valgrind

2023-11-11 Thread Arsen Arsenović
Hi, I like the idea of emitting Valgrind annotations. Instrumenting the compiler /a little/ could make a very useful tool even more useful. I have a minor remark, though (as someone not qualified to talk about the middle-end bits of code), in the case that the annotation built-in remains a libgc

Re: [PATCH v2] In the pipeline, USE or CLOBBER should delay execution if it starts a new live range.

2023-11-11 Thread Jeff Law
On 8/14/23 05:22, Jin Ma wrote: CLOBBER and USE does not represent real instructions, but in the process of pipeline optimization, they will wait for transmission in ready list like other insns, without considering resource conflicts and cycles. This results in a multi-issue CPU architecture t

Re: [Patch, fortran] PR112459 - gfortran -w option causes derived-type finalization at creation time

2023-11-11 Thread Harald Anlauf
Hi Paul, this is OK. Thanks for the patch! Harald Am 11.11.23 um 11:15 schrieb Paul Richard Thomas: Hi All, Evidently -w causes gfc_option.allow_std to be set to default, which allows anything and everything to happen, including these f2003/8 finalizations. The fix is trivial. Regtests fine

Re: [PATCH] In the pipeline, UNRECOG INSN is not executed in advance if it starts a live range.

2023-11-11 Thread Jeff Law
On 6/11/23 21:38, Jin Ma wrote: Why do you need a different cost based on what's in the ready list? Isn't the only property we're looking for whether or not the USE/CLOBBER opens a live range? Jeff For this, I found that if I only look for the USE/CLOBBER that opens a live range, when th

Re: [PATCH] Handle addresses of more constants in IPA-CP

2023-11-11 Thread Jeff Law
On 11/11/23 05:11, Eric Botcazou wrote: Hi, IPA-CP can currently handle addresses of scalar constants (CONST_DECL) so this extends that to addresses of constants in the pool (DECL_IN_CONSTANT_POOL). Again this is helpful for so-called fat pointers in Ada, i.e. objects that are semantically po

Re: [PATCH v2] libstdc++: PSTL dispatch for C++20 range random access iterators [PR110512]

2023-11-11 Thread Gonzalo Brito Gadeschi
@Pilar, this is the patch. Let me know if you need any help or have questions. Thank you ! On Mon 3. Jul 2023 at 09:02, Gonzalo Brito Gadeschi < gonzalo.gades...@gmail.com> wrote: > libstdc++: Recognize C++ random access iterators as random access in PSTL > [PR110432] > > The check for random acc

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-11 Thread Iain Sandoe
> On 11 Nov 2023, at 07:47, Simon Wright wrote: > > On 6 Nov 2023, at 08:36, Arnaud Charlet wrote: >> So without changing fundamentally the model, you can't decide dynamically for the whole system. Making the choice based on the current directory is pretty random, since

Re: [PATCH] C99 testsuite readiness: -fpermissive tests

2023-11-11 Thread Sam James
Florian Weimer writes: > * Eric Gallager: > >>> diff --git a/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >>> b/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >>> index bf32775d401..911fb562790 100644 >>> --- a/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >>> +++ b/gcc/testsuite/gcc.

Re: [PATCH] C99 testsuite readiness: Verified un-reductions

2023-11-11 Thread Jeff Law
On 11/10/23 15:06, Florian Weimer wrote: gcc/testsuite/ * gcc.c-torture/compile/20080613-1.c (hop_sendmsg): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/complex-6.c (bar): Declare. * gcc.c-torture/compile/pr23445.c (__brelse): Declare.

Re: [PATCH] C99 testsuite readiness: -fpermissive tests

2023-11-11 Thread Jeff Law
On 11/10/23 15:06, Florian Weimer wrote: These tests use obsolete language constructs, but they are not clearly targeting C89, either. So use -fpermissive to keep future errors as warnings. The reasons why obsolete constructs are used used vary from test to test. Some tests deliberately exe

Re: [PATCH v3] libiberty: Use posix_spawn in pex-unix when available.

2023-11-11 Thread Jeff Law
On 11/10/23 17:22, Patrick O'Neill wrote: On 11/10/23 03:00, Prathamesh Kulkarni wrote: On Thu, 5 Oct 2023 at 00:00, Brendan Shanks wrote: Hi, This patch implements pex_unix_exec_child using posix_spawn when available. This should especially benefit recent macOS (where vfork just calls f

Re: [PATCH] libgcc/m68k: Fixes for soft float

2023-11-11 Thread Jeff Law
On 11/10/23 18:02, Keith Packard wrote: I'm largely trusting your reputation on the fpgnulib changes. I won't claim to know that code at all. The assembly bits were simple enough that I could make out what you were doing relatively easily. Thanks for that review -- m68k assembly isn't m

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-11 Thread Simon Wright
On 6 Nov 2023, at 08:36, Arnaud Charlet wrote: > >>> So without changing fundamentally the model, you can't decide dynamically >>> for the whole >>> system. Making the choice based on the current directory is pretty random, >>> since the current >>> directory isn't well defined at program's sta

Re: [PATCH 0/7] ira/lra: Support subreg coalesce

2023-11-11 Thread Jeff Law
On 11/11/23 08:33, Richard Sandiford wrote: Joern's code is a bit of a mess, but Jivan and I are slowly untangling it from a correctness standpoint. It'll also need the usual cleanups. Ah, nice! How configurable are the bit ranges? We might be able to use something similar to track lanes

Re: [PATCH] C99 testsuite readiness: -fpermissive tests

2023-11-11 Thread Florian Weimer
* Eric Gallager: >> diff --git a/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >> b/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >> index bf32775d401..911fb562790 100644 >> --- a/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >> +++ b/gcc/testsuite/gcc.c-torture/compile/20080910-1.c >> @

Re: [PATCH 11/12] mode-switching: Add a target-configurable confluence operator

2023-11-11 Thread Richard Sandiford
Jeff Law writes: > On 11/11/23 08:54, Richard Sandiford wrote: >> Jeff Law writes: >>> On 11/5/23 11:50, Richard Sandiford wrote: The mode-switching pass assumed that all of an entity's modes were mutually exclusive. However, the upcoming SME changes have an entity with some overl

Re: [PATCH] aarch64: New RTL optimization pass avoid-store-forwarding.

2023-11-11 Thread Richard Sandiford
Thanks for the patch. Manos Anagnostakis writes: > This is an RTL pass that detects store forwarding from stores to larger loads > (load pairs). > > This optimization is SPEC2017-driven and was found to be beneficial for some > benchmarks, > through testing on ampere1/ampere1a machines. > > For

[PATCH v4] libstdc++: Remove unnecessary "& 1" from year_month_day_last::day().

2023-11-11 Thread Cassio Neri
When year_month_day_last::day() was implemented, Dr. Matthias Kretz realised that the operation "& 1" wasn't necessary but we did not patch it at that time. This patch removes the unnecessary operation. libstdc++-v3/ChangeLog: * include/std/chrono: Remove &1 from year_month_day_last::day(

Re: [PATCH 11/12] mode-switching: Add a target-configurable confluence operator

2023-11-11 Thread Jeff Law
On 11/11/23 08:54, Richard Sandiford wrote: Jeff Law writes: On 11/5/23 11:50, Richard Sandiford wrote: The mode-switching pass assumed that all of an entity's modes were mutually exclusive. However, the upcoming SME changes have an entity with some overlapping modes, so that there is some

Re: [PATCH 10/12] mode-switching: Use 1-based edge aux fields

2023-11-11 Thread Jeff Law
On 11/11/23 08:51, Richard Sandiford wrote: Jeff Law writes: On 11/7/23 17:35, Richard Sandiford wrote: I could have sworn that there was something that checked that passes left edge aux fields clear, but it looks like I misremembered. So I probably need to stick a clear_aux_for_edges ()

Re: [PATCH 11/12] mode-switching: Add a target-configurable confluence operator

2023-11-11 Thread Richard Sandiford
Jeff Law writes: > On 11/5/23 11:50, Richard Sandiford wrote: >> The mode-switching pass assumed that all of an entity's modes >> were mutually exclusive. However, the upcoming SME changes >> have an entity with some overlapping modes, so that there is >> sometimes a "superunion" mode that contai

[PATCH] libstdc++: Remove unnecessary "& 1" from year_month_day_last::day().

2023-11-11 Thread Cassio Neri
When year_month_day_last::day() was implemented, Dr. Matthias Kretz realised that the operation "& 1" wasn't necessary but we did not patch it at that time. This patch removes the unnecessary operation. libstdc++-v3/ChangeLog: * include/std/chrono: Remove &1 from year_month_day_last::day(). -

Re: [PATCH 10/12] mode-switching: Use 1-based edge aux fields

2023-11-11 Thread Richard Sandiford
Jeff Law writes: > On 11/7/23 17:35, Richard Sandiford wrote: > >> I could have sworn that there was something that checked that passes >> left edge aux fields clear, but it looks like I misremembered. So I >> probably need to stick a clear_aux_for_edges () call above the first >> main loop (for

Re: [PATCH 0/7] ira/lra: Support subreg coalesce

2023-11-11 Thread Richard Sandiford
Jeff Law writes: > On 11/8/23 02:40, Richard Sandiford wrote: >> Lehua Ding writes: >>> Hi, >>> >>> These patchs try to support subreg coalesce feature in >>> register allocation passes (ira and lra). >> >> Thanks a lot for the series. This is definitely something we've >> needed for a while. >

Re: [PATCH v2] DSE: Allow vector type for get_stored_val when read < store

2023-11-11 Thread Richard Sandiford
Jeff Law writes: > On 11/8/23 23:08, pan2...@intel.com wrote: >> From: Pan Li >> >> Update in v2: >> * Move vector type support to get_stored_val. >> >> Original log: >> >> This patch would like to allow the vector mode in the >> get_stored_val in the DSE. It is valid for the read >> rtx if an

Re: [PATCH] testsuite: xfail scev-[35].c on ia32

2023-11-11 Thread Thomas Schwinge
Hi! On 2023-11-08T13:01:47-0300, Alexandre Oliva wrote: > These gimplefe tests never got the desired optimization on ia32, but > they only started visibly failing when the representation of MEMs in > dumps changed from printing 'symbol: a' to '&a'. ACK -- but why not likewise "fix" the 'gcc.dg/t

Re: [PATCH] tree-ssa-math-opts: Fix up gsi_remove order in match_uaddc_usubc [PR112430]

2023-11-11 Thread Richard Biener
> Am 11.11.2023 um 09:27 schrieb Jakub Jelinek : > > Hi! > > The following testcase ICEs, because the temp_stmts were removed in > wrong order, from the ones appearing earlier in the IL to the later ones, > so insert_debug_temps_for_defs can reintroduce dead SSA_NAMEs back into the > IL. > >

Re: [PATCH] C99 testsuite readiness: -fpermissive tests

2023-11-11 Thread Eric Gallager
On Fri, Nov 10, 2023 at 5:06 PM Florian Weimer wrote: > > These tests use obsolete language constructs, but they are not > clearly targeting C89, either. So use -fpermissive to keep > future errors as warnings. > > The reasons why obsolete constructs are used used vary from > test to test. Some

[PATCH] Handle addresses of more constants in IPA-CP

2023-11-11 Thread Eric Botcazou
Hi, IPA-CP can currently handle addresses of scalar constants (CONST_DECL) so this extends that to addresses of constants in the pool (DECL_IN_CONSTANT_POOL). Again this is helpful for so-called fat pointers in Ada, i.e. objects that are semantically pointers but represented by structures made u

Re: [PATCH] C99 testsuite readiness: Compile more tests with -std=gnu89

2023-11-11 Thread Florian Weimer
* Jeff Law: > OK. Spot checked. It looked like -fpermissive was added for some as > well, which is fine by me. Perhaps "Compile with -std=gnu89 and > possibly -fpermissive as needed" or something similar in the > ChangeLog. There was one test that had -std=gnu89 -fpermissive. But -fpermissive

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-11-11 Thread waffl3x
Just a quick addition here as I was starting to work on things I realized where some misunderstandings were coming from. (Please also see my previous e-mail, it is all still relevant, I just wanted to clarify this.) (From the other thread) > > @@ -9949,7 +9951,8 @@ build_over_call (struct z_candid

[PATCH v2] LoongArch: Optimize single-used address with -mexplicit-relocs=auto for fld/fst

2023-11-11 Thread Xi Ruoyao
fld and fst have same address mode as ld.w and st.w, so the same optimization as r14-4851 should be applied for them too. gcc/ChangeLog: * config/loongarch/loongarch.md (LD_AT_LEAST_32_BIT): New mode iterator. (ST_ANY): New mode iterator. (define_peephole2): Use LD

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-11-11 Thread waffl3x
> [combined reply to all three threads] > > On 11/9/23 23:24, waffl3x wrote: > > > > > I'm unfortunately going down a rabbit hole again. > > > > > > > > --function.h:608 > > > > `/* If pointers to member functions use the least significant bit to > > > > indicate whether a function is virtual,

[Patch, fortran] PR112459 - gfortran -w option causes derived-type finalization at creation time

2023-11-11 Thread Paul Richard Thomas
Hi All, Evidently -w causes gfc_option.allow_std to be set to default, which allows anything and everything to happen, including these f2003/8 finalizations. The fix is trivial. Regtests fine - OK for mainline and -13 branch? Paul Fortran: Prevent unwanted finalization with -w option [PR112459]

[PATCH] gimple-range-cache: Fix ICEs when dumping details [PR111967]

2023-11-11 Thread Jakub Jelinek
Hi! The following testcase ICEs when dumping details. When m_ssa_ranges vector is created, it is safe_grow_cleared (num_ssa_names), but when when some new SSA_NAME is added, we strangely grow it to num_ssa_names + 1 instead and later on the 3 argument dump method iterates from 1 to m_ssa_ranges.le

[PATCH] tree-ssa-math-opts: Fix up gsi_remove order in match_uaddc_usubc [PR112430]

2023-11-11 Thread Jakub Jelinek
Hi! The following testcase ICEs, because the temp_stmts were removed in wrong order, from the ones appearing earlier in the IL to the later ones, so insert_debug_temps_for_defs can reintroduce dead SSA_NAMEs back into the IL. The following patch fixes that by removing them in the order they were

[PATCH] c, c++: Add new value for vector types for __builtin_classify_type (type)

2023-11-11 Thread Jakub Jelinek
Hi! While filing a clang request to return 18 on _BitInts for __builtin_classify_type instead of -1 they return currently, I've noticed that we return -1 for vector types. I'm not convinced it is a good idea to change behavior of __builtin_classify_type (vector_expression) after 22 years it behav

Re: [PATCH] Add type-generic clz/ctz/clrsb/ffs/parity/popcount builtins [PR111309]

2023-11-11 Thread Jakub Jelinek
On Fri, Nov 10, 2023 at 10:44:12AM +0100, Jakub Jelinek wrote: > Because the builtins are just something matching in behavior to existing > builtins which can be used for those macros, not exact implementation of > those. BTW, the new builtins also allow implementation of generic signed_type_for a