[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

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,

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) >

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: [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

[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: *

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

[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

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] 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

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 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. ---

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

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 >>>

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

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

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

[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

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

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

[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:

[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

[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] 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

[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.

[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

[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

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

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:

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

[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

[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

[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.

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 ;

[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

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".

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-

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

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

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

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 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 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

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

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] 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

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 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 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: > >

[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

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

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

[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. ---

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

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

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

Re: [PATCH v2] c++: fix parsing with auto(x) [PR112410]

2023-11-14 Thread Jason Merrill
On 11/14/23 10:58, Marek Polacek wrote: On Mon, Nov 13, 2023 at 09:26:41PM -0500, Jason Merrill wrote: On 11/10/23 20:13, Marek Polacek wrote: On Thu, Nov 09, 2023 at 07:07:03PM -0500, Jason Merrill wrote: On 11/9/23 14:58, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu,

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

2023-11-14 Thread Sebastian Huber
The code coverage support uses counters to determine which edges in the control flow graph were executed. If a counter overflows, then the code coverage information is invalid. Therefore the counter type should be a 64-bit integer. In multi-threaded applications, it is important that the counter

[PATCH 1/4] gcov: Remove TARGET_GCOV_TYPE_SIZE target hook

2023-11-14 Thread Sebastian Huber
This reverts commit 8cdcea51c0fd753e6a652c9b236e91b3a6e0911c. gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Do not define __LIBGCC_GCOV_TYPE_SIZE. gcc/ChangeLog: * config/sparc/rtemself.h (SPARC_GCOV_TYPE_SIZE): Remove. * config/sparc/sparc.cc

[PATCH 3/4] gcov: Add gen_counter_update()

2023-11-14 Thread Sebastian Huber
Move the counter update to the new gen_counter_update() helper function. Use it in gimple_gen_edge_profiler() and gimple_gen_time_profiler(). The resulting gimple instructions should be identical with the exception of the removed unshare_expr() call. The unshare_expr() call was used in

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

2023-11-14 Thread Sebastian Huber
Sebastian Huber (4): gcov: Remove TARGET_GCOV_TYPE_SIZE target hook Add TARGET_HAVE_LIBATOMIC gcov: Add gen_counter_update() gcov: Improve -fprofile-update=atomic gcc/c-family/c-cppbuiltin.cc | 4 +- gcc/config/rtems.h | 2 + gcc/config/sparc/rtemself.h | 2 -

[PATCH 2/4] Add TARGET_HAVE_LIBATOMIC

2023-11-14 Thread Sebastian Huber
Add target data to indicate if libatomic is available. gcc/ChangeLog: * config/rtems.h (TARGET_HAVE_LIBATOMIC): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_HAVE_LIBATOMIC): Add. * target.def (have_libatomic): New. --- gcc/config/rtems.h | 2 ++

Re: [PATCH] c++, v2: Implement C++26 P2864R2 - Remove Deprecated Arithmetic Conversion on Enumerations From C++26

2023-11-14 Thread Jason Merrill
On 11/14/23 12:38, Jakub Jelinek wrote: On Mon, Nov 13, 2023 at 10:59:52PM -0500, Jason Merrill wrote: On 11/13/23 06:50, Jakub Jelinek wrote: The following patch implements C++26 P2864R2 by emitting pedwarn enabled by the same options as the C++20 and later warnings (i.e. -Wenum-compare,

[PATCH v2] LoongArch: Remove redundant barrier instructions before LL-SC loops

2023-11-14 Thread Xi Ruoyao
This is isomorphic to the LLVM changes [1-2]. On LoongArch, the LL and SC instructions has memory barrier semantics: - LL: + - SC: + But the compare and swap operation is allowed to fail, and if it fails the SC instruction is not executed, thus the guarantee of acquiring semantics cannot be

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-11-14 Thread Peter Bergner
On 11/13/23 8:33 PM, Kewen.Lin wrote: >> if (PCREL_SUPPORTED_BY_OS) > >> + else >> +{ >> + if (TARGET_PCREL >> + && (rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0) >> +error ("use of %qs is invalid for this target", "-mpcrel"); >>rs6000_isa_flags &=

Re: [PATCH] Only allow (copysign x, NEG_CONST) -> (fneg (fabs x)) simplification for constant folding [PR112483]

2023-11-14 Thread Xi Ruoyao
On Tue, 2023-11-14 at 11:44 +0100, Richard Biener wrote: > > diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc > > index 2d2e5a3c1ca..f3745d86aea 100644 > > --- a/gcc/simplify-rtx.cc > > +++ b/gcc/simplify-rtx.cc > > @@ -4392,7 +4392,7 @@ simplify_ashift: > >    real_convert (, mode,

Re: [committed] testsuite: Ignore warning for unsupported option

2023-11-14 Thread Florian Weimer
* Dimitar Dimitrov: > The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the > '-fprefetch-loop-arrays' option is not supported by target. > > When commit r14-5380-g5c432b0efab54e removed the -w option, some targets > (arm-none-eabi, pru and possibly others) started failing the

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

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >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 non-empty TREE_PURPOSE (to hold the captured

Re: [PATCH 3/4] c-family, C++: Handle clang attributes [PR109877].

2023-11-14 Thread Marek Polacek
On Sun, Nov 12, 2023 at 08:02:43PM -1000, Iain Sandoe wrote: > This adds the ability to defer the validation of numeric attribute > arguments until the sequence is parsed if the attribute being > handled is one known to be 'clang form'. > > We do this by considering the arguments to be strings

[pushed] analyzer: enable taint state machine by default [PR103533]

2023-11-14 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Integration testing of analyzer shows no significant differences. Pushed to trunk as r14-5464-gcfaaa8b11b8429. gcc/analyzer/ChangeLog: PR analyzer/103533 * sm-taint.cc: Remove "experimental" from comment. *

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Wed, 2023-11-15 at 04:42 +0800, Xi Ruoyao wrote: > > There seems a better solution as suggested by the GCC internal doc. > > Section 18.9.16 mentions -fipa-ra: > > > >  -- Target Hook: bool TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS > > Set to true if each call that binds to a local

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Wed, 2023-11-15 at 04:26 +0800, Xi Ruoyao wrote: > On Tue, 2023-11-14 at 20:46 +0800, chenglulu wrote: > > > > 在 2023/11/14 下午5:55, Xi Ruoyao 写道: > > > On Tue, 2023-11-14 at 17:45 +0800, Lulu Cheng wrote: > > > > +  /* When function calls are made through call36, t0 register > > > > will

Re: [PATCH 1/4] c-family: Add handling for clang-style attributes [PR109877].

2023-11-14 Thread Jason Merrill
On 11/13/23 01:02, Iain Sandoe wrote: The clang compiler supports essentially arbitrary, per-attribute, syntax and token forms for attribute arguments. This extends to the case where token forms are required to be accepted that are not part of the valid set for standard C or C++. A motivating

Re: [PATCH V3 3/7] ira: Support subreg live range track

2023-11-14 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: gcc/ChangeLog: * hard-reg-set.h (struct HARD_REG_SET): New shift operator. * ira-build.cc (ira_create_object): Adjust. (find_object): New. (find_object_anyway): New. (ira_create_allocno): Adjust. (get_range):

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

2023-11-14 Thread David Edelsohn
Arsen, Unfortunately this broke bootstrap on AIX. I had not seen this series of patches. David

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

2023-11-14 Thread 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 after a statement. > >

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Tue, 2023-11-14 at 20:46 +0800, chenglulu wrote: > > 在 2023/11/14 下午5:55, Xi Ruoyao 写道: > > On Tue, 2023-11-14 at 17:45 +0800, Lulu Cheng wrote: > > > +  /* When function calls are made through call36, t0 register > > > will be > > > + implicitly modified, so '-fno-ipa-ra' needs to be set

Re: [PATCH V3 2/7] ira: Switch to live_subreg data

2023-11-14 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: This patch switch the use of live_reg data to live_subreg data. gcc/ChangeLog: * ira-build.cc (create_bb_allocnos): Switch. Switch to what? Although from the patch itself someone can figure it out, you should write it in the changelog entry.

Re: [committed] testsuite: Ignore warning for unsupported option

2023-11-14 Thread Hans-Peter Nilsson
> From: Dimitar Dimitrov > Date: Tue, 14 Nov 2023 22:00:14 +0200 > The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the > '-fprefetch-loop-arrays' option is not supported by target. > > When commit r14-5380-g5c432b0efab54e removed the -w option, some targets > (arm-none-eabi,

[committed] testsuite: Ignore warning for unsupported option

2023-11-14 Thread Dimitar Dimitrov
The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the '-fprefetch-loop-arrays' option is not supported by target. When commit r14-5380-g5c432b0efab54e removed the -w option, some targets (arm-none-eabi, pru and possibly others) started failing the test: cc1: warning:

[pushed] diagnostics: make option-handling callbacks private

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5459-g353f146cebbf22. gcc/c-family/ChangeLog: * c-warn.cc (conversion_warning): Update call to global_dc->m_option_enabled to use option_enabled_p.

[pushed] diagnostics: make m_text_callbacks private

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5458-g07e568d77f364e. gcc/ChangeLog: * diagnostic-show-locus.cc (diagnostic_context::show_locus): Update for renaming of text callbacks fields. *

[pushed] diagnostics: convert diagnostic_ready_p to an inline function

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5457-gd0bfd6ba3ba77f. gcc/ChangeLog: * diagnostic.h (diagnostic_ready_p): Convert from macro to inline function. --- gcc/diagnostic.h | 6 +- 1 file changed,

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 12:18, Vladimir Makarov wrote: On 11/14/23 03:38, Lehua Ding wrote: This is perfectly fine, the code inside the live_subreg problem has a branch that goes through similar logic to live_reg if it finds no subreg inside the program. Then when the optimization level is less

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

2023-11-14 Thread Florian Weimer
This used to be a warning, enabled by default, without its own option. A subsequent change could improve diagnostics and provide spelling hints for declarations like “void function (int32t);”. gcc/c-family/ * c.opt (Wdeclaration-missing-parameter-type): New. gcc/c/ChangeLog:

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

2023-11-14 Thread Florian Weimer
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 headers. gcc/c/ * c-decl.cc

Re: [committed] i386: Return CCmode from ix86_cc_mode for unknown RTX code [PR112494]

2023-11-14 Thread Jakub Jelinek
On Mon, Nov 13, 2023 at 10:49:23PM +0100, Uros Bizjak wrote: > Combine wants to combine following instructions into an insn that can > perform both an (arithmetic) operation and set the condition code. During > the conversion a new RTX is created, and combine passes the RTX code of the >

[PATCH v2 7/8] c: Turn -Wincompatible-pointer-types into a permerror

2023-11-14 Thread Florian Weimer
The change to build_conditional_expr drops the downgrade from a pedwarn to warning for builtins. gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/ PR c/96284 * c-typeck.cc (build_conditional_expr): Upgrade most pointer type mismatches to a

[PATCH v2 4/8] c: Turn -Wimplicit-int into a permerror

2023-11-14 Thread Florian Weimer
Most of these new permerrors are currently not diagnosed in system headers. gcc/ PR c/91093 PR c/96284 * doc/invoke.texi (Warning Options): Document changes. gcc/c/ * c-decl.cc (warn_defaults_to): Remove. (grok_declarator, start_function): Call

[PATCH v2 6/8] c: Turn -Wreturn-mismatch into a permerror

2023-11-14 Thread Florian Weimer
gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/ PR c/96284 * c-typeck.cc (c_finish_return): Use permerrors for OPT_Wreturn_mismatch diagnostics. gcc/testsuite/ * gcc.dg/permerror-default.c (return_mismatch_1)

[PATCH v2 3/8] c: Turn -Wimplicit-function-declaration into a permerror

2023-11-14 Thread Florian Weimer
In the future, it may make sense to avoid cascading errors from the implicit declaration, especially its assumed int return type. This change here only changes the kind of the diagnostic, not its wording or consequences. gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/

[PATCH v2 2/8] c: Turn int-conversion warnings into permerrors

2023-11-14 Thread Florian Weimer
gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/ PR c/96284 PR c/106416 * c-typeck.cc (build_conditional_expr): Use permerror_opt for pointer/integer type mismatches, based on -Wint-conversion. (pedwarn_permerror_init,

[PATCH v2 1/8] Add tests for validating future C permerrors

2023-11-14 Thread Florian Weimer
The dg-error directives for gcc.dg/permerror-system.c can be generated using (for the most part at least): perl -ne 'print if s,.*(/\* \{ dg-error .*) } \*/$,$1 "" { target *-*-* } $. } */,' \ < gcc/testsuite/gcc.dg/permerror-default.c gcc/testsuite/ * gcc.dg/permerror-default.c: New

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

2023-11-14 Thread Florian Weimer
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 graduation of warnings to errors. It turns out

[PATCH] c++, v2: Implement C++26 P2864R2 - Remove Deprecated Arithmetic Conversion on Enumerations From C++26

2023-11-14 Thread Jakub Jelinek
On Mon, Nov 13, 2023 at 10:59:52PM -0500, Jason Merrill wrote: > On 11/13/23 06:50, Jakub Jelinek wrote: > > The following patch implements C++26 P2864R2 by emitting pedwarn enabled by > > the same options as the C++20 and later warnings (i.e. -Wenum-compare, > > -Wdeprecated-enum-enum-conversion

[committed] i386: Generate strict_low_part QImode insn with high input register

2023-11-14 Thread Uros Bizjak
Following testcase: struct S1 { unsigned char val; unsigned char pad1; unsigned short pad2; }; struct S2 { unsigned char pad1; unsigned char val; unsigned short pad2; }; struct S1 test_and (struct S1 a, struct S2 b) { a.val &= b.val; return a; } compiles with -O2 to: movl

Re: [committed 01/22] arm: testsuite: correctly detect armv6t2 hardware for acle execution tests

2023-11-14 Thread Richard Earnshaw
On 14/11/2023 17:01, Christophe Lyon wrote: Hi, On 11/13/23 15:26, Richard Earnshaw wrote: diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a7bea96c1e..d414cddf4dc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 03:38, Lehua Ding wrote: This is perfectly fine, the code inside the live_subreg problem has a branch that goes through similar logic to live_reg if it finds no subreg inside the program. Then when the optimization level is less than 2, it doesn't track the subreg. By the way,

Re: [committed 01/22] arm: testsuite: correctly detect armv6t2 hardware for acle execution tests

2023-11-14 Thread Christophe Lyon
Hi, On 11/13/23 15:26, Richard Earnshaw wrote: diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a7bea96c1e..d414cddf4dc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5590,6 +5590,24 @@ proc

Re: [PATCH v2] AArch64: Cleanup memset expansion

2023-11-14 Thread Wilco Dijkstra
Hi Richard, > +/* Maximum bytes set for an inline memset expansion.  With -Os use 3 STP > +   and 1 MOVI/DUP (same size as a call).  */ > +#define MAX_SET_SIZE(speed) (speed ? 256 : 96) > So it looks like this assumes we have AdvSIMD.  What about > -mgeneral-regs-only? After my strictalign

  1   2   >