Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-07 Thread Richard Biener via Gcc-patches
On Mon, 7 Feb 2022, Joseph Myers wrote: > On Fri, 4 Feb 2022, Richard Biener via Gcc-patches wrote: > > > This adds explicit variable birth CLOBBERs in an attempt to fix > > PR90348 and duplicates. The birth / death CLOBBER pairs are > > used to compute liveness and conflicts for stack variable

[PATCH] tree-optimization/104373 - early uninit diagnostic on unreachable code

2022-02-07 Thread Richard Biener via Gcc-patches
The following improves early uninit diagnostics by computing edge reachability using our value-numbering framework in its cheapest mode and ignoring unreachable blocks when looking for uninitialized uses. To not ICE with -fdump-tree-all the early uninit pass needs a dumpfile since VN tries to

[PATCH] doc: invoke: RISC-V: Clean up the -mstrict-align wording

2022-02-07 Thread Palmer Dabbelt
The polarity of do/do not was reversed for this option when compored to the rest of them. This seems to have been copied from PowerPC, when the polarity of the arguments in the docs was reversed (presumably to match the default), but appears to have never made sense on RISC-V. gcc/ChangeLog

[PATCH] doc: invoke: RISC-V: Clean up the -memit-attribute wording

2022-02-07 Thread Palmer Dabbelt
The previous wording makes it sound like "do not emit" is a clarification of "emit", which is not accurate. This cleans up the wording to match (most) of the other arguments. gcc/ChangeLog * doc/invoke.texi (RISC-V -memit-attribute): Re-word the do/do not language.

Re: [PATCH] rs6000: Add support for vmsumcud and vec_msumc

2022-02-07 Thread Bill Schmidt via Gcc-patches
Hi! On 2/7/22 5:05 PM, Segher Boessenkool wrote: > Hi! > > On Mon, Feb 07, 2022 at 04:20:24PM -0600, Bill Schmidt wrote: >> I observed recently that a couple of Power10 instructions and built-in >> functions >> were somehow not implemented. This patch adds one of them (vmsumcud). >> Although

[PATCH 5/4] tree-optimization/104288 - An alternative approach

2022-02-07 Thread Andrew MacLeod via Gcc-patches
On 2/7/22 09:29, Andrew MacLeod wrote: I have a proposal for PR 104288. ALL patches (in sequence) bootstrap on their own and each cause no regressions. I've been continuing to work with this towards the GCC13 solution for statement side effects.  And There is another possibility we could

[PATCH v1] RISC-V: Add support for inlining subword atomic operations

2022-02-07 Thread Patrick O'Neill
RISC-V has no support for subword atomic operations; code currently generates libatomic library calls. This patch changes the default behavior to inline subword atomic calls (using the same logic as the existing library call). Behavior can be specified using the -minline-atomics and

Re: [PATCH 1/4][RFC] middle-end/90348 - add explicit birth

2022-02-07 Thread Joseph Myers
On Fri, 4 Feb 2022, Richard Biener via Gcc-patches wrote: > This adds explicit variable birth CLOBBERs in an attempt to fix > PR90348 and duplicates. The birth / death CLOBBER pairs are > used to compute liveness and conflicts for stack variable > coalescing where the lack of an explicit birth

[committed] analyzer: fix ICE on realloc of non-heap [PR104417]

2022-02-07 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-7087-g0c04ac0e15830b. gcc/analyzer/ChangeLog: PR analyzer/104417 * sm-taint.cc (tainted_allocation_size::tainted_allocation_size): Remove overzealous assertion.

[committed] analyzer: fixes to memcpy [PR103872]

2022-02-07 Thread David Malcolm via Gcc-patches
PR analyzer/103872 reports a failure of gcc.dg/analyzer/pr103526.c on riscv64-unknown-elf-gcc. The issue is that I wrote the test on x86_64 where a memcpy in the test is optimized to a write to a read/write pair, whereas due to alignment differences the analyzer can see it as a memcpy call,

Re: [PATCH] rs6000: Add support for vmsumcud and vec_msumc

2022-02-07 Thread Segher Boessenkool
Hi! On Mon, Feb 07, 2022 at 04:20:24PM -0600, Bill Schmidt wrote: > I observed recently that a couple of Power10 instructions and built-in > functions > were somehow not implemented. This patch adds one of them (vmsumcud). > Although > this isn't normally stage-4 material, this is really

[PATCH] rs6000: Add support for vmsumcud and vec_msumc

2022-02-07 Thread Bill Schmidt via Gcc-patches
Hi! I observed recently that a couple of Power10 instructions and built-in functions were somehow not implemented. This patch adds one of them (vmsumcud). Although this isn't normally stage-4 material, this is really simple and carries no discernible risk, so I hope it can be considered.

Re: [PATCH] RISC-V: Enable TARGET_SUPPORTS_WIDE_INT

2022-02-07 Thread Vineet Gupta
On 2/7/22 10:58, Palmer Dabbelt wrote: On Mon, 07 Feb 2022 09:41:10 PST (-0800), Vineet Gupta wrote: On 2/7/22 01:28, Philipp Tomsich wrote: Vineet, On Mon, 7 Feb 2022 at 07:06, Vineet Gupta wrote: This is at par with other major arches such as aarch64, i386, s390 ... No testsuite

Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization

2022-02-07 Thread Harald Anlauf via Gcc-patches
Hi Paul, thanks for attacking this. I haven't looked at the actual patch, only tried to check the new testcases with other compilers. Am 03.02.22 um 18:14 schrieb Paul Richard Thomas via Fortran: I have tried to interpret F2018 7.5.6.2 and 7.5.6.3 as well as possible. This is not always

Re: [PATCH] libstdc++: Decouple HAVE_FCNTL_H from HAVE_DIRENT_H check

2022-02-07 Thread Jonathan Wakely via Gcc-patches
On Mon, 7 Feb 2022 at 21:01, Jonathan Wakely wrote: > > > On Mon, 7 Feb 2022 at 20:12, Dimitar Dimitrov wrote: > >> On PRU target with newlib, we have the following combination in config.h: >> /* #undef HAVE_DIRENT_H */ >> #define HAVE_FCNTL_H 1 >> #define HAVE_UNLINKAT 1 >> >> In newlib,

Re: [PATCH] libstdc++: Decouple HAVE_FCNTL_H from HAVE_DIRENT_H check

2022-02-07 Thread Jonathan Wakely via Gcc-patches
On Mon, 7 Feb 2022 at 20:12, Dimitar Dimitrov wrote: > On PRU target with newlib, we have the following combination in config.h: > /* #undef HAVE_DIRENT_H */ > #define HAVE_FCNTL_H 1 > #define HAVE_UNLINKAT 1 > > In newlib, targets which do not define dirent.h, get a build error when >

Re: [PATCH] c++: satisfaction value of type const bool [PR104410]

2022-02-07 Thread Jason Merrill via Gcc-patches
On 2/7/22 09:57, Patrick Palka wrote: Here constant evaluation of the atomic constraint use_func_v with T=int sensibly yields an INTEGER_CST of type const bool, but the assert in satisfaction_value expects unqualified bool. Let's just relax the assert to accept cv-qualified bool more generally.

Re: [PATCH] c++: deducing only from noexcept-spec [PR80951]

2022-02-07 Thread Jason Merrill via Gcc-patches
On 2/7/22 09:57, Patrick Palka wrote: The fail-fast predicate uses_deducible_template_parms used by unify_one_argument is neglecting to look inside the noexcept-spec of a function type, and this causes deduction to fail for the below testcase since the noexcept-spec is the only part of the type

Re: [PATCH] c++: lambda in pack expansion using outer pack in constraint [PR103706]

2022-02-07 Thread Jason Merrill via Gcc-patches
On 2/7/22 12:34, Patrick Palka wrote: On Thu, 3 Feb 2022, Jason Merrill wrote: On 2/3/22 15:55, Patrick Palka wrote: On Thu, Feb 3, 2022 at 3:20 PM Jason Merrill wrote: On 2/3/22 12:04, Patrick Palka wrote: On Wed, 2 Feb 2022, Jason Merrill wrote: On 2/2/22 12:09, Patrick Palka wrote:

[PATCH] libstdc++: Decouple HAVE_FCNTL_H from HAVE_DIRENT_H check

2022-02-07 Thread Dimitar Dimitrov
On PRU target with newlib, we have the following combination in config.h: /* #undef HAVE_DIRENT_H */ #define HAVE_FCNTL_H 1 #define HAVE_UNLINKAT 1 In newlib, targets which do not define dirent.h, get a build error when including :

Re: [PATCH v2] doc: RISC-V: Document the `-misa-spec=' option

2022-02-07 Thread Palmer Dabbelt
On Sat, 05 Feb 2022 00:14:26 PST (-0800), gcc-patches@gcc.gnu.org wrote: Thanks, LGTM :) On Sat, Feb 5, 2022 at 7:56 AM Maciej W. Rozycki wrote: We have recently updated the default for the `-misa-spec=' option, yet we still have not documented it nor its `--with-isa-spec=' counterpart in

Re: [PATCH] RISC-V: Enable TARGET_SUPPORTS_WIDE_INT

2022-02-07 Thread Palmer Dabbelt
On Mon, 07 Feb 2022 09:41:10 PST (-0800), Vineet Gupta wrote: On 2/7/22 01:28, Philipp Tomsich wrote: Vineet, On Mon, 7 Feb 2022 at 07:06, Vineet Gupta wrote: This is at par with other major arches such as aarch64, i386, s390 ... No testsuite regressions: same numbers w/ w/o Putting that

Re: [PATCH] RISC-V: Enable TARGET_SUPPORTS_WIDE_INT

2022-02-07 Thread Vineet Gupta
On 2/7/22 01:28, Philipp Tomsich wrote: Vineet, On Mon, 7 Feb 2022 at 07:06, Vineet Gupta wrote: This is at par with other major arches such as aarch64, i386, s390 ... No testsuite regressions: same numbers w/ w/o Putting that check seems a good idea, but I haven't seen any cases related

Re: [PATCH] c++: lambda in pack expansion using outer pack in constraint [PR103706]

2022-02-07 Thread Patrick Palka via Gcc-patches
On Thu, 3 Feb 2022, Jason Merrill wrote: > On 2/3/22 15:55, Patrick Palka wrote: > > On Thu, Feb 3, 2022 at 3:20 PM Jason Merrill wrote: > > > > > > On 2/3/22 12:04, Patrick Palka wrote: > > > > On Wed, 2 Feb 2022, Jason Merrill wrote: > > > > > > > > > On 2/2/22 12:09, Patrick Palka wrote: >

Re: [PATCH] RISC-V/testsuite: Run target testing over all the usual optimization levels

2022-02-07 Thread Kito Cheng via Gcc-patches
Hi Maciej: Thanks for doing this, OK to trunk. On Tue, Feb 1, 2022 at 7:04 AM Maciej W. Rozycki wrote: > > Use `gcc-dg-runtest' test driver rather than `dg-runtest' to run the > RISC-V testsuite as several targets already do. Adjust test options > across individual test cases accordingly where

Re: [Patch]middle-end: updating the reg use in exit block for -fzero-call-used-regs [PR100775]

2022-02-07 Thread Qing Zhao via Gcc-patches
Ping. thanks. Qing > On Jan 28, 2022, at 12:03 PM, Qing Zhao via Gcc-patches > wrote: > > Hi, > > PR 100775 ( ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with > -mthumb -fzero-call-used-regs=used) > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775 > > Although the ICE only

Re: [PATCH 7/8] rs6000: vec_neg built-ins wrongly require POWER8

2022-02-07 Thread Bill Schmidt via Gcc-patches
Hi Segher, Thanks for all the reviews for this series!  I'd like to gently ping the last two patches. BR, Bill On 1/28/22 11:50 AM, Bill Schmidt via Gcc-patches wrote: > As the subject states. Fixing this is accomplished by moving the built-ins > to the correct stanzas, [altivec] and [vsx]. >

Re: [PATCH] testsuite: Fix up testsuite/gcc.c-torture/execute/builtins/lib/chk.c for powerpc [PR104380]

2022-02-07 Thread David Edelsohn via Gcc-patches
On Mon, Feb 7, 2022 at 8:20 AM Jakub Jelinek wrote: > > On Fri, Feb 04, 2022 at 12:00:57PM -0500, David Edelsohn via Gcc-patches > wrote: > > > The following testcase FAILs when configured with > > > --with-long-double-format=ieee . Only happens in the -std=c* modes, not > > > the > > > GNU

[PATCH] c++: deducing only from noexcept-spec [PR80951]

2022-02-07 Thread Patrick Palka via Gcc-patches
The fail-fast predicate uses_deducible_template_parms used by unify_one_argument is neglecting to look inside the noexcept-spec of a function type, and this causes deduction to fail for the below testcase since the noexcept-spec is the only part of the type which contains a deducible template

[PATCH] c++: satisfaction value of type const bool [PR104410]

2022-02-07 Thread Patrick Palka via Gcc-patches
Here constant evaluation of the atomic constraint use_func_v with T=int sensibly yields an INTEGER_CST of type const bool, but the assert in satisfaction_value expects unqualified bool. Let's just relax the assert to accept cv-qualified bool more generally. Bootstrapped and regtested on

[PATCH 4/4] [GCC11] tree-optimization/104288 - range on entry should check dominators for non-null.

2022-02-07 Thread Andrew MacLeod via Gcc-patches
The patches resolves the issue for GCC11 in a much simpler way. By default, ranger and EVRP are running in hybrid mode. This means if ranger misses something, evrp will pick up the slack. This enables us to change the 2 places which check for non-null to ignore potentially incorrect

[PATCH 3/4] tree-optimization/104288 - Update non-null interface to provide better precision.

2022-02-07 Thread Andrew MacLeod via Gcc-patches
This changes the non-null interface to provide more granularity and facilitate more precise queries. Previously, we could only ask if NAME was nonnull anywhere in the block, and it applied to the entire block.  now we can ask:   bool always_nonnull_p (tree name, basic_block bb);    // all uses

[PATCH 2/4] tree-optimization/104288 - Register side effects during ranger vrp domwalk.

2022-02-07 Thread Andrew MacLeod via Gcc-patches
This patch adds the ability to register side effects within a block to ranger. This is currently only for tracking non-null values. the rvrp_folder performs a DOM walk and then attempts to simplify and the fold each stmt during the walk.  This patch adds a call to register_side_effects() to

[PATCH 1/4] tree-optimization/104288 - Change non-null tracking from one bit to a pair.

2022-02-07 Thread Andrew MacLeod via Gcc-patches
This patch changes the non-null tracking in ranger to use 2 bits in order to distinguish between blocks which contain uses of NAME in:   1) non-null generating statements,  (1 bit)   2) statements which are not non-null generating (the other bit),  THis is the new bit.   3) and the existence of

[PATCH 0/4] tree-optimization/104288 - Add more granularity to non-null tracking

2022-02-07 Thread Andrew MacLeod via Gcc-patches
I have a proposal for PR 104288. This PR highlights the shortcomings of assuming that when the non-null property is seen within a block, that it applies to the entire block. This is a 3 patch set, but is less dramatic than it sounds.  I just wanted to split it into small bits for safety and

Re: [PATCH] testsuite: Fix up testsuite/gcc.c-torture/execute/builtins/lib/chk.c for powerpc [PR104380]

2022-02-07 Thread Jakub Jelinek via Gcc-patches
On Fri, Feb 04, 2022 at 12:00:57PM -0500, David Edelsohn via Gcc-patches wrote: > > The following testcase FAILs when configured with > > --with-long-double-format=ieee . Only happens in the -std=c* modes, not the > > GNU modes; while the glibc headers have __asm redirects of > > vsnprintf and

Re: [patch gcc13] middle-end/70090: Dynamic sizes for -fsanitize=object-size

2022-02-07 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 07, 2022 at 05:31:58PM +0530, Siddhesh Poyarekar wrote: > Use __builtin_dynamic_object_size to get object sizes for ubsan. > > gcc/ChangeLog: > > middle-end/70090 > * ubsan.cc (ubsan_expand_objsize_ifn): Allow non-constant SIZE. > (instrument_object_size): Get

[patch gcc13] middle-end/70090: Dynamic sizes for -fsanitize=object-size

2022-02-07 Thread Siddhesh Poyarekar
Use __builtin_dynamic_object_size to get object sizes for ubsan. gcc/ChangeLog: middle-end/70090 * ubsan.cc (ubsan_expand_objsize_ifn): Allow non-constant SIZE. (instrument_object_size): Get dynamic object size expression. gcc/testsuite/ChangeLog:

Re: [PATCH] Check always_inline flag in s390_can_inline_p [PR104327]

2022-02-07 Thread Andreas Krebbel via Gcc-patches
On 2/7/22 09:11, Jakub Jelinek wrote: ... > 1) formatting, = should be at the start of next line rather than end of the >line > 2) all_masks, always_inline_safe_masks and caller_required_masks aren't >ever modified, perhaps make them const? > 3) I wonder if there is any advantage to have

[PATCH] middle-end/104402 - split out _Complex compares from COND_EXPRs

2022-02-07 Thread Richard Biener via Gcc-patches
This makes sure we always have a _Complex compare split to a different stmt for the compare operand in a COND_EXPR on GIMPLE. Complex lowering doesn't handle this and the change is something we want for all kind of compares at some point. Bootstrapped and tested on x86_64-unknown-linux-gnu,

Re: [PATCH v3] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]

2022-02-07 Thread Kewen.Lin via Gcc-patches
Hi Segher, Thanks for the comments! on 2022/2/7 下午3:53, Segher Boessenkool wrote: > Hi! > > On Wed, Jan 05, 2022 at 03:34:41PM +0800, Kewen.Lin wrote: >> This patch is to fix the inconsistent behaviors for non-LTO mode >> and LTO mode. As Martin pointed out, currently the function >>

Re: [PATCH] RISC-V: Enable TARGET_SUPPORTS_WIDE_INT

2022-02-07 Thread Philipp Tomsich
Vineet, On Mon, 7 Feb 2022 at 07:06, Vineet Gupta wrote: > > This is at par with other major arches such as aarch64, i386, s390 ... > > No testsuite regressions: same numbers w/ w/o Putting that check seems a good idea, but I haven't seen any cases related to this get through anyway. Do you

[AArch64] Question about the condition of calls_alloca in aarch64_layout_frame

2022-02-07 Thread Dan Li via Gcc-patches
There is the following code in aarch64_layout_frame: else if (crtl->outgoing_args_size.is_constant (_outgoing_args_size) && frame.saved_regs_size.is_constant (_saved_regs_size) && const_outgoing_args_size + const_saved_regs_size < 512 && (!saves_below_hard_fp_p ||

Re: [PATCH v2] rs6000: Disable MMA if no VSX support [PR103627]

2022-02-07 Thread Segher Boessenkool
On Mon, Feb 07, 2022 at 01:54:00PM +0800, Kewen.Lin wrote: > on 2022/1/28 上午1:17, Segher Boessenkool wrote: > > On Thu, Jan 27, 2022 at 07:21:33PM +0800, Kewen.Lin wrote: > >>PR target/103627 > >>* config/rs6000/rs6000.cc (rs6000_option_override_internal): Disable > >>MMA if

Re: [PATCH] Check always_inline flag in s390_can_inline_p [PR104327]

2022-02-07 Thread Jakub Jelinek via Gcc-patches
On Mon, Feb 07, 2022 at 08:09:47AM +0100, Andreas Krebbel via Gcc-patches wrote: > MASK_MVCLE is set for -Os but not for other optimization levels. In > general it should not make much sense to inline across calls where the > flag is different but we have to allow it for always_inline. > > The