[committed] d: Fix core.volatile.volatileLoad discarded if result is unused

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, The first pass of code generation in the D front-end splits up all compound expressions and discards expressions that have no side effects. This included calls to the `volatileLoad' intrinsic if its result was not used, causing such calls to be eliminated from the program. We already set

[committed] d: Fix accesses of immutable arrays using constant index still bounds checked

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch sets TREE_READONLY on all non-static const and immutable variables in D, as well as all static immutable variables that aren't initialized by a module constructor. This allows more aggressive constant folding of D code which makes use of `immutable' or `const'. Bootstrapped and

[PATCH] gcc-ar: Handle response files properly [PR77576]

2023-07-01 Thread Costas Argyris via Gcc-patches
Basically implementing what Andrew said in the PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77576 If @file has been passed to gcc-ar, do the following: 1) Expand it to get an argv without any @files. 2) Then apply the plugin modifications to argv. 3) Create temporary response file. 4) Put

[PATCH] Use chain_next on eh_landing_pad_d for GTY (PR middle-end/110510)

2023-07-01 Thread Andrew Pinski via Gcc-patches
The backtrace in the bug report suggest there is a running out of stack during GC collection, because of a long chain of eh_landing_pad_d. This might fix that by adding chain_next onto eh_landing_pad_d's GTY marker. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

New Croatian PO file for 'gcc' (version 13.1.0)

2023-07-01 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Croatian team of translators. The file is available at: https://translationproject.org/latest/gcc/hr.po (This file, 'gcc-13.1.0.hr.po', has

[PATCH 1/2] xtensa: Fix missing mode warning in "*eqne_INT_MIN"

2023-07-01 Thread Takayuki 'January June' Suwa via Gcc-patches
gcc/ChangeLog: * config/xtensa/xtensa.md (*eqne_INT_MIN): Add missing ":SI" to the match_operator. --- gcc/config/xtensa/xtensa.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index

[PATCH 2/2] xtensa: The use of CLAMPS instruction also requires TARGET_MINMAX, as well as TARGET_CLAMPS

2023-07-01 Thread Takayuki 'January June' Suwa via Gcc-patches
Because both smin and smax requiring TARGET_MINMAX are essential to the RTL representation. gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_match_CLAMPS_imms_p): Simplify. * config/xtensa/xtensa.md (*xtensa_clamps): Add TARGET_MINMAX to the condition. ---

[pushed] libphobos, testsuite: Disable forkgc2 on Darwin [PR103944]

2023-07-01 Thread Iain Sandoe via Gcc-patches
From: Iain Sandoe This has been in use for some time across all the Darwin version supported by D. It has also been tested on x86_64-linux-gnu. Approved on irc by Iain Buclaw, pushed to main (and will be backported). thanks Iain --- 8< --- It hangs the testsuite (requiring manual

[committed] d: Don't generate code that throws exceptions when compiling with `-fno-exceptions'

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, The version flags for RTMI, RTTI, and exceptions was unconditionally predefined. These are now only predefined if the feature flag is enabled. It was noticed that there was no `-fexceptions' definition inside d/lang.opt, so the detection of the exceptions option flag was only partially

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-07-01 Thread Andrew Waterman via Gcc-patches
On Sat, Jul 1, 2023 at 7:04 AM Jeff Law wrote: > > > > On 7/1/23 02:00, Andrew Waterman wrote: > > > > > Yeah, that might end up being a false economy for superscalars. > > > > In general, I wouldn't recommend spending too many cleverness beans on > > non-Zba+Zbb implementations. Going forward,

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-07-01 Thread Palmer Dabbelt
On Sat, 01 Jul 2023 07:04:16 PDT (-0700), jeffreya...@gmail.com wrote: On 7/1/23 02:00, Andrew Waterman wrote: Yeah, that might end up being a false economy for superscalars. In general, I wouldn't recommend spending too many cleverness beans on non-Zba+Zbb implementations. Going forward,

Re: [pushed] wwwdocs: Add GCC Code of Conduct

2023-07-01 Thread Gerald Pfeifer
On Tue, 20 Jun 2023, Jason Merrill via Gcc-patches wrote: > As announced on gcc@. Here is a minor follow-up that I just pushed. Gerald >From f87deaa12cccb4b7398a8ec3b306cb4185aae012 Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Fri, 30 Jun 2023 14:59:27 +0200 Subject: [PATCH] conduct:

[GCC 11][committed] d: Fix ICE in setValue, at d/dmd/dinterpret.c:7013

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports ICE fix from upstream which is already part of GCC-12 and later. When casting null to integer or real, instead of painting the type on the NullExp, we emplace an IntegerExp/RealExp with the value zero. Same as when casting from NullExp to bool. Bootstrapped and

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-07-01 Thread Jeff Law via Gcc-patches
On 7/1/23 02:00, Andrew Waterman wrote: Yeah, that might end up being a false economy for superscalars. In general, I wouldn't recommend spending too many cleverness beans on non-Zba+Zbb implementations. Going forward, we should expect that even very simple cores provide those extensions.

Re: [PATCH] RISC-V: Support vfwmul.vv combine lowering

2023-07-01 Thread Robin Dapp via Gcc-patches
> There has to be some kind of mismatch between the patch or testcase > or what we're looking at to judge success. Yeah I think the initially posted example was misleading because it contained an already working example. > While I really don't see the need to have the bridge pattern, I'm > still

Fix profile updates in copy-header

2023-07-01 Thread Jan Hubicka via Gcc-patches
Hi, most common source of profile mismatches is now copyheader pass. The reason is that in comon case the duplicated header condition will become constant true and that needs changes in the loop exit condition probability. While this can be done by jump threading it is not, since it gives up

[PATCH 2/2] ifcvt: Allow more operations in multiple set if conversion

2023-07-01 Thread Manolis Tsamis
Currently the operations allowed for if conversion of a basic block with multiple sets are few, namely REG, SUBREG and CONST_INT (as controlled by bb_ok_for_noce_convert_multiple_sets). This commit allows more operations (arithmetic, compare, etc) to participate in if conversion. The target's

[PATCH 1/2] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2023-07-01 Thread Manolis Tsamis
This is an extension of what was done in PR106590. Currently if a sequence generated in noce_convert_multiple_sets clobbers the condition rtx (cc_cmp or rev_cc_cmp) then only seq1 is used afterwards (sequences that emit the comparison itself). Since this applies only from the next iteration it

[PATCH 0/2] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2023-07-01 Thread Manolis Tsamis
noce_convert_multiple_sets has been introduced and extended over time to handle if conversion for blocks with multiple sets. Currently this is focused on register moves and rejects any sort of arithmetic operations. This series is an extension to allow more sequences to take part in if

[PATCH 2/2] PR 110487: `(a !=/== CST1 ? CST2 : CST3)` pattern for type safety

2023-07-01 Thread Andrew Pinski via Gcc-patches
The problem here is we might produce some values out of the type's min/max (and/or valid values, e.g. signed booleans). The fix is to use an integer type which has the same precision and signedness as the original type. Note two_value_replacement in phiopt had the same issue in previous versions;

[PATCH 1/2] Fix PR 110487: invalid signed boolean value

2023-07-01 Thread Andrew Pinski via Gcc-patches
This fixes the first part of this bug where `a ? -1 : 0` would cause a value of 1 into the signed boolean value. It fixes the problem by casting to an integer type of the same size/signedness before doing the negative and then casting to the type of expression. OK? Bootstrapped and tested on

Re: [PATCH] RISC-V: improve codegen for repeating large constants [3]

2023-07-01 Thread Andrew Waterman via Gcc-patches
On Fri, Jun 30, 2023 at 5:36 PM Palmer Dabbelt wrote: > > On Fri, 30 Jun 2023 17:25:54 PDT (-0700), Andrew Waterman wrote: > > On Fri, Jun 30, 2023 at 5:13 PM Vineet Gupta wrote: > >> > >> > >> > >> On 6/30/23 16:50, Andrew Waterman wrote: > >> > I don't believe this is correct; the subtraction

Fix update_bb_profile_for_threading

2023-07-01 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes some of profile mismatches caused by profile updating. It seems that I misupdated update_bb_profile_for_threading in 2017 which results in invalid updates from rtl threading and threadbackwards. update_bb_profile_for_threading knows that some paths to BB are being redirected