Re: [PATCH v2 8/8] c: Add new -Wdeclaration-missing-parameter-type permerror

2023-11-14 Thread Florian Weimer
* Marek Polacek: > On Tue, Nov 14, 2023 at 06:50:58PM +0100, Florian Weimer wrote: >> --- a/gcc/c-family/c.opt >> +++ b/gcc/c-family/c.opt >> @@ -591,6 +591,10 @@ Wdeclaration-after-statement >> C ObjC Var(warn_declaration_after_statement) Init(-1) Warning >> Warn when a declaration is found aft

Re: [PATCH] c++: non-dependent .* folding [PR112427]

2023-11-14 Thread Jason Merrill
On 11/14/23 10:43, Patrick Palka wrote: On Fri, 10 Nov 2023, Jason Merrill wrote: On 11/10/23 10:28, Patrick Palka wrote: On Fri, 10 Nov 2023, Patrick Palka wrote: On Thu, 9 Nov 2023, Jason Merrill wrote: On 11/8/23 16:59, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux

Re: [PATCH] c++: partially inst requires-expr in noexcept-spec [PR101043]

2023-11-14 Thread Jason Merrill
On 11/14/23 16:04, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- Here we're ICEing from strip_typedefs for the partially instantiated requires-expression when walking its REQUIRES_EXPR_EXTRA_ARGS since it's a TREE_LIST with

[committed] libstdc++: Fix std::hash [PR112348]

2023-11-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports needed too. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/112348 * include/std/stacktrace (hash>): Fix type of hash functio nfor entries. * testsuite/19_diagnostics/stacktrace/hash.cc: New test. --- libstdc++-v3/inc

Re: [PATCH] c++: direct enum init from type-dep elt [PR112515]

2023-11-14 Thread Jason Merrill
On 11/14/23 11:35, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- The NON_DEPENDENT_EXPR removal exposed that is_direct_enum_init may end up checking convertibility of a type-dependent argument. PR c++/112515 gcc/cp

Re: [PATCH] c++: decltype of (non-captured variable) [PR83167]

2023-11-14 Thread Jason Merrill
On 11/14/23 11:10, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- For decltype((x)) within a lambda where x is not captured, we dubiously require that the lambda has a capture default, unlike for decltype(x). This patch fixes this i

[committed] libstdc++: Fix uses of signed types with functions

2023-11-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports needed too. -- >8 -- In we pass the int __base parameter to our internal versions of functions, __bit_width and __countr_zero. Those functions are only defined for unsigned types, so we need to convert the base to unsigned. The base must be in the

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

2023-11-14 Thread Jonathan Wakely
On Sat, 11 Nov 2023 at 16:46, Cassio Neri wrote: > > 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: > >

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

2023-11-14 Thread Jonathan Wakely
On Sat, 11 Nov 2023 at 23:00, Cassio Neri wrote: > > 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

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

2023-11-14 Thread Jonathan Wakely
On Sun, 12 Nov 2023 at 01:34, Cassio Neri wrote: > > 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 : (

Re: [PATCH] libstdc++: Improve operator-(weekday x, weekday y).

2023-11-14 Thread Jonathan Wakely
On Tue, 14 Nov 2023 at 00:27, Cassio Neri wrote: > > The current implementation calls __detail::__modulo which is relatively > expensive. > > A better implementation is possible if we assume that x.ok() && y.ok() == > true, > so that n = x.c_encoding() - y.c_encoding() is in [-6, 6]. In this case

Re: [PATCH] c++: constantness of local var in constexpr fn [PR111703, PR112269]

2023-11-14 Thread Jason Merrill
On 11/1/23 11:07, Patrick Palka wrote: On Tue, 31 Oct 2023, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Does it look OK for release branches as well for sake of PR111703? -- >8 -- potential_constant_expression was incorrectly treating

Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext

2023-11-14 Thread Arsen Arsenović
Hi David, David Edelsohn writes: > Arsen, > > Unfortunately this broke bootstrap on AIX. > > I had not seen this series of patches. I've added Bruno to CC as the libintl maintainer, to keep him in the loop. Could you provide some extra information w.r.t. the failure mode? I'll try to investig

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

2023-11-14 Thread Peter Bergner
On 11/12/23 6:08 AM, Lehua Ding wrote: > V3 Changes: > 1. fix three ICE. > 2. rebase I tested this on powerpc64le-linux and powerpc64-linux. The LE build bootstrapped fine and it looks like only one testsuite FAIL which I have to look into why it's FAILing. The BE build did bootstrap, but t

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

2023-11-14 Thread Peter Bergner
On 11/13/23 11:37 PM, Lehua Ding wrote: > On 2023/11/14 3:37, Vladimir Makarov wrote: >> Also besides testing major targets I'd recommend testing at least one big >> endian target (I'd recommend ppc64be. gcc110.fsfrance.org could be used >> for this). Plenty RA issues occur because BE targets are

RE: [PATCH 5/21]middle-end: update vectorizer's control update to support picking an exit other than loop latch

2023-11-14 Thread Tamar Christina
> > OK, but then I think the fix is to not use > > standard_iv_increment_position (it's a weird API anyway). Instead insert > before the main exit condition. > > I figured as much, Almost done respinning it with the vectorizer's own simpler > copy. > Should be out today with the rest. > > > > >

RE: [PATCH 4/21]middle-end: update loop peeling code to maintain LCSSA form for early breaks

2023-11-14 Thread Tamar Christina
Patch updated to latest trunk, This splits the part of the function that does peeling for loops at exits to a different function. In this new function we also peel for early breaks. Peeling for early breaks works by redirecting all early break exits to a single "early break" block and combine th

RE: [PATCH 7/21]middle-end: update IV update code to support early breaks and arbitrary exits

2023-11-14 Thread Tamar Christina
Patch updated to latest trunk: Hi All, This changes the PHI node updates to support early breaks. It has to support both the case where the loop's exit matches the normal loop exit and one where the early exit is "inverted", i.e. it's an early exit edge. In the latter case we must always restart

RE: [PATCH 8/21]middle-end: update vectorizable_live_reduction with support for multiple exits and different exits

2023-11-14 Thread Tamar Christina
Patch updated to trunk. This adds support to vectorizable_live_reduction to handle multiple exits by doing a search for which exit the live value should be materialized in. Additinally which value in the index we're after depends on whether the exit it's materialized in is an early exit or whethe

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

2023-11-14 Thread Li, Pan2
> I wouldn't try to handle that case unless we had actual evidence it was > useful to do so. Just wanted to point out that unlike pseudos we can > have multiple modes referencing the same memory location. Got the point here, thanks Jeff for emphasizing this, 😉. Pan -Original Message-

Recall: [PATCH v4] DSE: Allow vector type for get_stored_val when read < store

2023-11-14 Thread Li, Pan2
Li, Pan2 would like to recall the message, "[PATCH v4] DSE: Allow vector type for get_stored_val when read < store".

[PATCH RESEND v4] RISC-V: elide unnecessary sign extend when expanding cmp_and_jump

2023-11-14 Thread Vineet Gupta
RV64 compare and branch instructions only support 64-bit operands. At Expand time, the backend conservatively zero/sign extends its operands even if not needed, such as incoming function args which ABI/ISA guarantee to be sign-extended already (this is true for SI, HI, QI operands) And subsequentl

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

2023-11-14 Thread Li, Pan2
Sorry for disturbing, looks I have a typo for Richard S's email address, cc the right email address for awareness. Pan -Original Message- From: Li, Pan2 Sent: Wednesday, November 15, 2023 8:18 AM To: Jeff Law ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; Wang, Yanzhang ; kito.ch.

[pushed] json.cc: use SELFTEST_LOCATION in selftests

2023-11-14 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5473-g2220263f0e032a. gcc/ChangeLog: * json.cc (selftest::assert_print_eq): Add "loc" param and use ASSERT_STREQ_AT. (ASSERT_PRINT_EQ): New macro. (selftest::test_writing_objects):

[PATCH/RFC] json.cc: format JSON output

2023-11-14 Thread David Malcolm
Previously our JSON output emitted the JSON all on one line, with no indentation or newlines to show the structure of the values. Although it's easy to reformat such output (e.g. with "python -m json.tool"), I've found it's a pain to need to do so e.g. my text editor sometimes hangs when opening a

[PATCH] RISC-V: Fix ICE in non-canonical march parsing

2023-11-14 Thread Patrick O'Neill
Passing in a base extension in non-canonical order (i, e, g) causes GCC to ICE: xgcc: error: '-march=rv64ge': ISA string is not in canonical order. 'e' xgcc: internal compiler error: in add, at common/config/riscv/riscv-common.cc:671 ... This is fixed by skipping to the next extension when a non-

Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext

2023-11-14 Thread David Edelsohn
On Tue, Nov 14, 2023 at 6:09 PM Arsen Arsenović wrote: > Hi David, > > David Edelsohn writes: > > > Arsen, > > > > Unfortunately this broke bootstrap on AIX. > > > > I had not seen this series of patches. > > I've added Bruno to CC as the libintl maintainer, to keep him in the > loop. Could you

Re: [PATCH] RISC-V: Fix ICE in non-canonical march parsing

2023-11-14 Thread Kito Cheng
LGTM, and BTW...I am thinking we could relax the canonical order during parsing, did you have interesting and time working on that item? On Wed, Nov 15, 2023 at 9:35 AM Patrick O'Neill wrote: > > Passing in a base extension in non-canonical order (i, e, g) causes GCC > to ICE: > xgcc: error: '-ma

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

2023-11-14 Thread Lehua Ding
On 2023/11/14 0:43, Dimitar Dimitrov wrote: On Sun, Nov 12, 2023 at 08:08:10PM +0800, Lehua Ding wrote: V3 Changes: 1. fix three ICE. 2. rebase Hi, These patchs try to support subreg coalesce feature in register allocation passes (ira and lra). Hi Lehua, V3 indeed fixes the arm-no

[PATCH] Clean up

2023-11-14 Thread HAO CHEN GUI
Hi, This patch cleans up by_pieces_ninsns and does following things. 1. Do the length and alignment adjustment for by pieces compare when overlap operation is enabled. 2. Remove unnecessary mov_optab checks. Bootstrapped and tested on x86 and powerpc64-linux BE and LE with no regressions. Is t

[PATCH] Clean up by_pieces_ninsns

2023-11-14 Thread HAO CHEN GUI
Hi, This patch cleans up by_pieces_ninsns and does following things. 1. Do the length and alignment adjustment for by pieces compare when overlap operation is enabled. 2. Remove unnecessary mov_optab checks. Bootstrapped and tested on x86 and powerpc64-linux BE and LE with no regressions. Is t

[RFC][C++] Attribute gnu::extended

2023-11-14 Thread Julian Waters
I propose a new attribute for C++, labelled gnu::extended. This attribute is for asm declarations, and the attribute marks them as extended asm. This attribute shall contain all of the features of existing extended asm, but also have additional features, described below. gnu::extended(OutputOperan

[PATCH] rs6000: Only enable PCREL on supported ABIs [PR111045]

2023-11-14 Thread Peter Bergner
PCREL data accesses are only officially supported on ELFv2. We currently incorrectly enable PCREL on all Power10 compiles in which prefix instructions are also enabled. Rework the option override code so we only enable PCREL for those ABIs that actually support it. Jeevitha has confirmed this pa

[PATCH V2 1/3]rs6000: update num_insns_constant for 2 insns

2023-11-14 Thread Jiufu Guo
Hi, Trunk gcc supports more constants to be built via two instructions: e.g. "li/lis; xori/xoris/rldicl/rldicr/rldic". And then num_insns_constant should also be updated. Function "rs6000_emit_set_long_const" is used to build complicate constants; and "num_insns_constant_gpr" is used to compute '

[PATCH V2 3/3] split complicate constant to memory

2023-11-14 Thread Jiufu Guo
Hi, Sometimes, a complicated constant is built via 3(or more) instructions to build. Generally speaking, it would not be as faster as loading it from the constant pool (as a few discussions in PR63281): * "ld" is one instruction. If consider "address/toc" adjust, we may count it as 2 instructio

[PATCH V2 2/3] Using pli to split 34bits constant

2023-11-14 Thread Jiufu Guo
Hi, For constants with 16bit values, 'li or lis' can be used to generate the value. For 34bit constant, 'pli' is ok to generate the value. For example: 0xULL, "pli 3,1717986918; rldimi 3,3,32,0" can be used. Compare with previous: https://gcc.gnu.org/pipermail/gcc-patches/2023-Oc

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

2023-11-14 Thread Lehua Ding
On 2023/11/15 7:22, Peter Bergner wrote: On 11/12/23 6:08 AM, Lehua Ding wrote: V3 Changes: 1. fix three ICE. 2. rebase I tested this on powerpc64le-linux and powerpc64-linux. The LE build bootstrapped fine and it looks like only one testsuite FAIL which I have to look into why it's

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

2023-11-14 Thread Peter Bergner
On 11/14/23 9:12 PM, Lehua Ding wrote: > I've applied for machine permissions on the compile farm, can you give > me the way to compile and run tests on PPC64BE machine? I'll take a look > at it too, thanks a lot. That's an old system, with too old system libgmp, etc. Let me attempt a build there

[PATCH v1] RISC-V: Refine the mask generation for vec_init case 2

2023-11-14 Thread pan2 . li
From: Pan Li We take vec_init element int mode when generate the mask for case 2. But actually we don't need as many bits as the element. The extra bigger mode may introduce some unnecessary insns. For example as below code: typedef int64_t v16di __attribute__ ((vector_size (16 * 8))); void __a

Re: [PATCH v1] RISC-V: Refine the mask generation for vec_init case 2

2023-11-14 Thread juzhe.zh...@rivai.ai
Could you test it v4096qi ? Also, VLS modes need to be tested. juzhe.zh...@rivai.ai From: pan2.li Date: 2023-11-15 11:48 To: gcc-patches CC: juzhe.zhong; pan2.li; yanzhang.wang; kito.cheng Subject: [PATCH v1] RISC-V: Refine the mask generation for vec_init case 2 From: Pan Li We take vec_i

Re: [PATCH v2 5/8] c: Do not ignore some forms of -Wimplicit-int in system headers

2023-11-14 Thread Sam James
Florian Weimer writes: > Most -Wimplicit-int warnings were unconditionally disabled for system > headers. Only missing types for parameters in old-style function > definitions resulted in warnings. This is inconsistent with the > treatment of other permerrors, which are active in system heade

Re: [PATCH v2 5/8] c: Do not ignore some forms of -Wimplicit-int in system headers

2023-11-14 Thread Florian Weimer
* Sam James: > Florian Weimer writes: > >> Most -Wimplicit-int warnings were unconditionally disabled for system >> headers. Only missing types for parameters in old-style function >> definitions resulted in warnings. This is inconsistent with the >> treatment of other permerrors, which are act

Re: [PATCH v2 5/8] c: Do not ignore some forms of -Wimplicit-int in system headers

2023-11-14 Thread Sam James
Florian Weimer writes: > * Sam James: > >> Florian Weimer writes: >> >>> Most -Wimplicit-int warnings were unconditionally disabled for system >>> headers. Only missing types for parameters in old-style function >>> definitions resulted in warnings. This is inconsistent with the >>> treatmen

Re: [PATCH v2 0/8] Turn some C warnings into errors by default

2023-11-14 Thread Sam James
Florian Weimer writes: > This new series covers: > > -Wint-conversion > -Wimplicit-function-declaration > -Wimplicit-int > -Wreturn-mismatch > -Wincompatible-pointer-types > -Wdeclaration-missing-parameter-type (new) > > There are now gcc.dg/permerror-*.c tests which track the gradu

[PATCH] Fix crash in libcc1

2023-11-14 Thread Tom Tromey
The gdb tests of the libcc1 plugin have been failing lately. I tracked this down to a crash trying to access an enum's underlying type. This patch fixes the crash by setting this type. libcc1/ChangeLog * libcc1plugin.cc (plugin_build_enum_type): Set ENUM_UNDERLYING_TYPE. --- li

Re: [PATCH 4/4] gcov: Improve -fprofile-update=atomic

2023-11-14 Thread Sebastian Huber
Hello,   sorry, in the patch I should use targetm.have_atomic instead of TARGET_HAVE_LIBATOMIC.   --- embedded brains GmbH & Co. KG Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08

[PATCH] Fix some _Hashtable implementation inconsistencies

2023-11-14 Thread François Dumont
Following several remarks on a previous patch of _Hashtable I considered clarifying its implementation.     libstdc++: [_Hashtable] Fix some implementation inconsistencies     Get rid of the different usages of the mutable keyword. For     _Prime_rehash_policy methods are exported from the libr

Re: [PATCH v2 0/8] Turn some C warnings into errors by default

2023-11-14 Thread Florian Weimer
* Sam James: > When posting v3, I guess consider CCing the aarch64 maintainers (or just > pinging them separately)? I already pinged them, they are likely busy with posting their patches before stage 1 closes. > I'm not really sure how approval of (an earlier version of) this series > interacts

[PATCH] RISC-V: fix vsetvli pass testsuite failure [PR/112447]

2023-11-14 Thread Vineet Gupta
From: Juzhe-Zhong Fixes: f0e28d8c1371 ("RISC-V: Fix failed hoist in LICM of vmv.v.x instruction") Since above commit, we have the following failure: FAIL: gcc.c-torture/execute/memset-3.c -O3 -g execution test The issue was not the commit but it unravled an issue in vsetvli pass. Here's J

Re: [PATCH] RISC-V: fix vsetvli pass testsuite failure [PR/112447]

2023-11-14 Thread juzhe.zh...@rivai.ai
LGTM. You can commit it. Thanks. juzhe.zh...@rivai.ai From: Vineet Gupta Date: 2023-11-15 14:41 To: gcc-patches CC: Jeff Law; Robin Dapp; gnu-toolchain; Patrick O'Neill; Juzhe-Zhong; Vineet Gupta Subject: [PATCH] RISC-V: fix vsetvli pass testsuite failure [PR/112447] From: Juzhe-Zhong Fi

[PATCH] RISC-V: Disallow RVV mode address for any load/store[PR112535]

2023-11-14 Thread Juzhe-Zhong
This patch is quite obvious patch which disallow for load/store address register with RVV mode. PR target/112535 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_legitimate_address_p): Disallow RVV modes base address. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autove

Re: [PATCH] RISC-V: Disallow RVV mode address for any load/store[PR112535]

2023-11-14 Thread Kito Cheng
Curious about the code gen impact, does it make IRA/LRA insert one more move like (set (reg:DI) (subreg:DI (reg:V1DI 155) 0)) and then (set (mem:SI (reg:DI)) (const_int 0))? On Wed, Nov 15, 2023 at 3:15 PM Juzhe-Zhong wrote: > This patch is quite obvious patch which disallow for load/store addre

Re: Re: [PATCH] RISC-V: Disallow RVV mode address for any load/store[PR112535]

2023-11-14 Thread juzhe.zh...@rivai.ai
Yes. (set (reg:DI) (subreg:DI (reg:V1DI 155) 0)) become vmv.x.s So, you will see: vsetivli zero,1,e64,m1,ta,ma sb zero,%lo(c)(a2) vle64.v v1,0(a5) lbu a5,%lo(b)(a4) vse64.v v1,0(a3) beq a5,zero,.L6 vmv.x.s a5,v1 sw zero,0(a5) I think the codegen is not good. It should be using scalar load/store.

Re: Re: [PATCH] RISC-V: Disallow RVV mode address for any load/store[PR112535]

2023-11-14 Thread Kito Cheng
LGTM, and yeah, I agree that's a code model issue. On Wed, Nov 15, 2023 at 3:29 PM juzhe.zh...@rivai.ai wrote: > > Yes. > (set (reg:DI) (subreg:DI (reg:V1DI 155) 0)) become vmv.x.s > > So, you will see: > vsetivli zero,1,e64,m1,ta,ma > sb zero,%lo(c)(a2) > vle64.v v1,0(a5) > lbu a5,%lo(b)(a4) > v

RE: Re: [PATCH] RISC-V: Disallow RVV mode address for any load/store[PR112535]

2023-11-14 Thread Li, Pan2
Committed, thanks Kito. Pan -Original Message- From: Kito Cheng Sent: Wednesday, November 15, 2023 3:36 PM To: juzhe.zh...@rivai.ai Cc: Kito.cheng ; gcc-patches ; jeffreyalaw ; Robin Dapp Subject: Re: Re: [PATCH] RISC-V: Disallow RVV mode address for any load/store[PR112535] LGTM, a

[committed] testsuite: Adjust gcc.dg/cpp/if-2.c for 16-bit targets

2023-11-14 Thread Jakub Jelinek
On Tue, Nov 14, 2023 at 09:47:31PM -0700, Jeff Law wrote: > > c++: Implement C++26 P1854R4 - Making non-encodable string literals > > ill-formed [PR110341] > > This paper voted in as DR makes some multi-character literals > > ill-formed. > > 'abcd' stays valid, but e.g. 'á' is newly i

<    1   2