RE: [PATCH] middle-end: fix de-optimizations with bitclear patterns on signed values

2021-11-11 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Jakub Jelinek > Sent: Thursday, November 4, 2021 4:11 PM > To: Tamar Christina > Cc: Jonathan Wakely ; Richard Biener > ; gcc-patches@gcc.gnu.org; nd > Subject: Re: [PATCH] middle-end: fix de-optimizations with bitclear patterns > on signed values > > On T

Re: [PATCH] testsuite/102690 - XFAIL g++.dg/warn/Warray-bounds-16.C

2021-11-11 Thread Richard Biener via Gcc-patches
On Thu, 11 Nov 2021, Martin Sebor wrote: > On 11/11/21 1:18 AM, Richard Biener wrote: > > On Wed, 10 Nov 2021, Martin Sebor wrote: > > > >> On 11/10/21 3:09 AM, Richard Biener via Gcc-patches wrote: > >>> This XFAILs the bogus diagnostic test and rectifies the expectation > >>> on the optimizatio

[PATCH] c++: implicit dummy object in requires clause [PR103198]

2021-11-11 Thread Patrick Palka via Gcc-patches
In the testcase below satisfaction misbehaves for f and g ultimately because find_template_parameters fails to notice that the constraint 'val.x' depends on the template parameters of the class template. In contrast, satisfaction works just fine for h. The problem seems to come down to a differenc

Re: [PATCH] testsuite/102690 - XFAIL g++.dg/warn/Warray-bounds-16.C

2021-11-11 Thread Martin Sebor via Gcc-patches
On 11/11/21 1:18 AM, Richard Biener wrote: On Wed, 10 Nov 2021, Martin Sebor wrote: On 11/10/21 3:09 AM, Richard Biener via Gcc-patches wrote: This XFAILs the bogus diagnostic test and rectifies the expectation on the optimization. Tested on x86_64-unknown-linux-gnu, pushed. 2021-11-10 Rich

[PATCH][GCC] aarch64: Add LS64 extension and intrinsics

2021-11-11 Thread Przemyslaw Wirkus via Gcc-patches
Hi, This patch is adding support for LS64 (Armv8.7-A Load/Store 64 Byte extension) which is part of Armv8.7-A architecture. Changes include missing plumbing for TARGET_LS64, LS64 data structure and intrinsics defined in ACLE [0]. Machine description of intrinsics is using new V8DI mode added in a

[PATCH] rs6000: testsuite: Add rop_ok effective-target function

2021-11-11 Thread Peter Bergner via Gcc-patches
This patch adds a new effective-target function that tests whether it is safe to emit the ROP-protect instructions and updates the ROP test cases to use it. Segher, as we discussed offline, this uses the double [] which you said isn't needed in general regex's, but for some reason is needed in the

Re: rs6000: Fix up flag_shrink_wrap handling in presence of -mrop-protect [PR101324]

2021-11-11 Thread Peter Bergner via Gcc-patches
Sorry for taking so long to get back to this. On 10/29/21 4:45 PM, Segher Boessenkool wrote: > On Wed, Oct 27, 2021 at 10:17:39PM -0500, Peter Bergner wrote: >> +/* Ensure hashst comes after mflr and hashchk comes after ld 0,16(1). */ >> +/* { dg-final { scan-assembler "mflr 0.*hashst 0," } } */

Re: [PATH][_GLIBCXX_DEBUG] Fix unordered container merge

2021-11-11 Thread Jonathan Wakely via Gcc-patches
On Thu, 11 Nov 2021 at 21:33, François Dumont wrote: > On 11/11/21 9:41 pm, Jonathan Wakely wrote: > > > > On Wed, 10 Nov 2021 at 11:55, Jonathan Wakely wrote: > >> >> >> On Tue, 9 Nov 2021 at 16:25, Jonathan Wakely wrote: >> >>> >>> >>> On Mon, 8 Nov 2021 at 21:36, François Dumont >>> wrote:

[PATCH v2] implement -Winfinite-recursion [PR88232]

2021-11-11 Thread Martin Sebor via Gcc-patches
Attached is a v2 of the solution I posted earlier this week with a few tweaks made after a more careful consideration of the problem and possible false negatives and positives. 1) It avoids warning for [apparently infinitely recursive] calls in noreturn functions where the recursion may be pre

Re: [PATH][_GLIBCXX_DEBUG] Fix unordered container merge

2021-11-11 Thread François Dumont via Gcc-patches
On 11/11/21 9:41 pm, Jonathan Wakely wrote: On Wed, 10 Nov 2021 at 11:55, Jonathan Wakely > wrote: On Tue, 9 Nov 2021 at 16:25, Jonathan Wakely mailto:jwak...@redhat.com>> wrote: On Mon, 8 Nov 2021 at 21:36, François Dumont mailto:frs.dum...

Re: [PATCH 16/18] rs6000: Test case adjustments

2021-11-11 Thread Bill Schmidt via Gcc-patches
On 11/11/21 2:06 PM, Bill Schmidt wrote: > >>> --- a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c >>> +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c >>> @@ -11,9 +11,9 @@ >>> /* { dg-final { scan-assembler-times {\mvrlq\M} 2 } } */ >>> /* { dg-final { scan-assembler-times

[PATCH, committed] rs6000: Fix test_mffsl.c to require Power9 support

2021-11-11 Thread Bill Schmidt via Gcc-patches
Hi! Per previous discussion, committed the following as obvious. commit 8a8458ac6bbc4263dd2c1ee55979b29fc7195794 Author: Bill Schmidt Date: Thu Nov 11 14:36:04 2021 -0600 rs6000: Fix test_mffsl.c to require Power9 support 2021-11-11 Bill Schmidt gcc/testsuite/

Re: [PATH][_GLIBCXX_DEBUG] Fix unordered container merge

2021-11-11 Thread Jonathan Wakely via Gcc-patches
On Wed, 10 Nov 2021 at 11:55, Jonathan Wakely wrote: > > > On Tue, 9 Nov 2021 at 16:25, Jonathan Wakely wrote: > >> >> >> On Mon, 8 Nov 2021 at 21:36, François Dumont >> wrote: >> >>> Yet another version this time with only 1 guard implementation. The >>> predicate to invalidate the safe iterat

Go patch committed: Traverse func subexprs when creating func descriptors

2021-11-11 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend fixes the Create_func_descriptors pass to traverse the subexpressions of the function in a Call_expression. There are no subexpressions in the normal case of calling a function a method directly, but there are subexpressions when in code like F().M() when F returns an

Re: [PATCH 16/18] rs6000: Test case adjustments

2021-11-11 Thread Bill Schmidt via Gcc-patches
Hi Segher, [Sorry to be answering these out of order...] On 11/5/21 5:37 PM, Segher Boessenkool wrote: > On Wed, Sep 01, 2021 at 11:13:52AM -0500, Bill Schmidt wrote: >> * gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Adjust. > My favourite changelog entry! But, adjust to what? This is th

[committed] libstdc++: Make pmr::memory_resource::allocate implicitly create objects

2021-11-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. Calling the placement version of ::operator new "implicitly creates objects in the returned region of storage" as per [intro.object]. This allows the returned memory to be used as storage for implicit-lifetime types (including arrays) without additional actio

[committed] libstdc++: Remove public std::vector::data() member

2021-11-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This function only exists to avoid an error in the debug mode vector, so doesn't need to be public. libstdc++-v3/ChangeLog: * include/bits/stl_bvector.h (vector::data()): Give protected access, and delete for C++11 and later. --- libstdc++-

[PATCH 2/3] gimple-fold: Use ranges to simplify _chk calls

2021-11-11 Thread Siddhesh Poyarekar
Instead of comparing LEN and SIZE only if they are constants, use their ranges to decide if LEN will always be lower than or same as SIZE. This change ends up putting the stringop-overflow warning line number against the strcpy implementation, so adjust the warning check to be line number agnostic

[PATCH 3/3] gimple-fold: Use ranges to simplify strncat and snprintf

2021-11-11 Thread Siddhesh Poyarekar
Remove the warnings for strncat since it is already handled (and even the error messages look identical) in gimple-ssa-warn-access. Instead, use len range to determine if it is within bounds of source and destination and simplify it to strcat if it's safe. Likewise for snprintf, use ranges to det

[PATCH 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly

2021-11-11 Thread Siddhesh Poyarekar
Avoid going through another folding cycle and use the ignore flag to directly transform BUILT_IN_STPCPY_CHK to BUILT_IN_STRCPY when set, likewise for BUILT_IN_STPNCPY_CHK to BUILT_IN_STPNCPY. Dump the transformation in dump_file so that we can verify in tests that the direct transformation actuall

[PATCH 0/3] gimple-fold improvements

2021-11-11 Thread Siddhesh Poyarekar
This patchset improves folding in cases where input lengths and/or destination sizes may not be constant but are range bound. Tested on x86_64 with a full bootstrap build and verified that there are no regressions resulting from this patchset. Also tested a build of bash, which results in 3 __mem

Re: [r12-5150 Regression] FAIL: gfortran.dg/vector_subscript_1.f90 -Os execution test on Linux/x86_64

2021-11-11 Thread Aldy Hernandez via Gcc-patches
This is expected. It was failing at all optimization levels except -Os. The oversight has been fixed :-). On Thu, Nov 11, 2021, 20:14 sunil.k.pandey wrote: > On Linux/x86_64, > > 3e5a19053310ad090b930fbecebceb28bd1b91a4 is the first bad commit > commit 3e5a19053310ad090b930fbecebceb28bd1b91a4 >

Re: [PATCH] libbacktrace: fix UBSAN issues

2021-11-11 Thread Ian Lance Taylor via Gcc-patches
On Thu, Nov 11, 2021 at 7:39 AM Martin Liška wrote: > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > Fix issues mentioned in the PR. > > PR libbacktrace/103167 > > libbacktrace/ChangeLog: > > * elf.c (elf_u

[r12-5150 Regression] FAIL: gfortran.dg/vector_subscript_1.f90 -Os execution test on Linux/x86_64

2021-11-11 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 3e5a19053310ad090b930fbecebceb28bd1b91a4 is the first bad commit commit 3e5a19053310ad090b930fbecebceb28bd1b91a4 Author: Aldy Hernandez Date: Thu Nov 11 11:27:07 2021 +0100 Resolve entry loop condition for the edge remaining in the loop. caused FAIL: gfortran.dg/vector_s

[PATCH] openmp: Honor OpenMP 5.1 num_teams lower bound

2021-11-11 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch implements what I've been talking about earlier, honor that for explicit num_teams clause we create at least the lower-bound (if not specified, upper-bound) teams in the league. For host fallback, it still means we only have one thread doing all the teams, sequentially one

Re: [PATCH 0/2] fortran: Ignore unused arguments for scalarisation [PR97896]

2021-11-11 Thread Thomas Koenig via Gcc-patches
On 07.11.21 17:17, Mikael Morin via Fortran wrote: Regression-tested on x86_64-linux-gnu. Ok for master and 11 branch? OK. Just one remark: Since just reverting my old patch would introduce a regression for that one revision, please squash the patches before committing. Thanks a lot for th

Re: [PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR

2021-11-11 Thread Philipp Tomsich
Kito, Thanks for the reality-check: the subreg-expressions are getting in the way. I'll drop this from v2, as a permanent resolution for this will be a bit more involved. Philipp. On Thu, 11 Nov 2021 at 17:42, Kito Cheng wrote: > > Hi Philipp: > > This testcase got wrong result with this patch

Re: [PATCH v3 0/5] fortran: Ignore unused arguments for scalarisation [PR97896]

2021-11-11 Thread Thomas Koenig via Gcc-patches
Hi Mikael, Regression-tested on x86_64-linux-gnu. Ok for master? This looks quite good, and is (I think) a cleaner version than what we had before. OK. Thanks a lot for the patch(es)! Best regards Thomas

Re: [PATCH v2] implement -Winfinite-recursion [PR88232]

2021-11-11 Thread Marek Polacek via Gcc-patches
On Thu, Nov 11, 2021 at 11:21:01AM -0700, Martin Sebor wrote: > On 11/10/21 2:27 PM, Marek Polacek wrote: > > On Tue, Nov 09, 2021 at 09:28:43PM -0700, Martin Sebor via Gcc-patches > > wrote: > > > The attached patch adds support to the middle end for detecting > > > infinitely recursive calls. T

[PATCH v2] implement -Winfinite-recursion [PR88232]

2021-11-11 Thread Martin Sebor via Gcc-patches
On 11/10/21 2:27 PM, Marek Polacek wrote: On Tue, Nov 09, 2021 at 09:28:43PM -0700, Martin Sebor via Gcc-patches wrote: The attached patch adds support to the middle end for detecting infinitely recursive calls. The warning is controlled by the new -Winfinite-recursion option. The option name

Re: [PATCH] dwarf: Multi-register CFI address support.

2021-11-11 Thread Hafiz Abid Qadeer
On 09/11/2021 15:59, Jakub Jelinek wrote: > On Sun, Jun 13, 2021 at 02:27:38PM +0100, Hafiz Abid Qadeer wrote: >> *** with this patch (edited for brevity)*** >> >> 0024 CIE >> >> DW_CFA_def_cfa_expression: DW_OP_bregx SGPR49+0, DW_OP_const1u 0x20, >> DW_OP_shl, DW_OP_bregx

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-11 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 11, 2021 at 06:11:23PM +0100, Tobias Burnus wrote: > --- a/gcc/fortran/parse.c > +++ b/gcc/fortran/parse.c > @@ -915,15 +915,16 @@ decode_omp_directive (void) >matcho ("error", gfc_match_omp_error, ST_OMP_ERROR); >matcho ("end atomic", gfc_match_omp_eos_error, ST_OMP_END

Re: [PATCH] vect: Remove vec_outside/inside_cost fields

2021-11-11 Thread Jan Hubicka via Gcc-patches
> > Now afunc writes to __var_5_mma only indirectly so I think it is correct > > that > > we optimize the conditional out. > > > > Easy fix would be to add -fno-ipa-modref, but perhaps someone with > > better understanding of Fortran would help me to improve the testcase so > > the calls to matmul

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-11 Thread Segher Boessenkool
Hi! On Thu, Nov 04, 2021 at 01:36:06PM +0100, Martin Liška wrote: > Sending the patch in a separate thread. You forgot to send the commit message though? > * config/rs6000/rs6000.c (rs6000_override_options_after_change): > Do not set flag_rename_registers, it's already enabled with >

[AArch64] Enable generation of FRINTNZ instructions

2021-11-11 Thread Andre Vieira (lists) via Gcc-patches
Hi, This patch introduces two IFN's FTRUNC32 and FTRUNC64, the corresponding optabs and mappings. It also creates a backend pattern to implement them for aarch64 and a match.pd pattern to idiom recognize these. These IFN's (and optabs) represent a truncation towards zero, as if performed by fi

Re: [PATCH] Remove loop crossing restriction from the backward threader.

2021-11-11 Thread Jeff Law via Gcc-patches
On 11/11/2021 10:24 AM, Aldy Hernandez wrote: We have much more thorough restrictions, that are shared between both threader implementations, in the registry. I've been meaning to remove the backward threader one, since it's only purpose was reducing the search space. Previously there was a

[PATCH] Make ranger optional in path_range_query.

2021-11-11 Thread Aldy Hernandez via Gcc-patches
All users of path_range_query are currently allocating a gimple_ranger only to pass it to the query object. It's tidier to just do it from path_range_query if no ranger was passed. Will push pending tests on x86-64 Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::path_ran

[PATCH] Remove loop crossing restriction from the backward threader.

2021-11-11 Thread Aldy Hernandez via Gcc-patches
We have much more thorough restrictions, that are shared between both threader implementations, in the registry. I've been meaning to remove the backward threader one, since it's only purpose was reducing the search space. Previously there was a small time penalty for its removal, but with the va

[committed] diagnostic: fix unused variable 'def_tabstop' [PR103129]

2021-11-11 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-5176-gabdff441a07f55d16e3d0e5ced3123c83d210a0a. gcc/ChangeLog: PR other/103129 * diagnostic-show-locus.c (def_policy): Use def_tabstop. Signed-off-by: David Malcolm --- gcc/diagnostic-show-locu

[Patch] Fortran/openmp: Fix '!$omp end'

2021-11-11 Thread Tobias Burnus
Found this when looking at the num_teams patch – and when converting clauses-1.c to clauses-1.f90. OK? Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank T

Re: [PATCH] tree-optimization/103188 - avoid running ranger on not-up-to-date SSA

2021-11-11 Thread Aldy Hernandez via Gcc-patches
Like this. It simplifies both loop-ch and the threader. I'll push this pending tests unless someone objects. On Thu, Nov 11, 2021 at 5:43 PM Aldy Hernandez wrote: > > Thanks for doing this! > > > > > + gimple_ranger *ranger = new gimple_ranger; > > + path_range_query *query = new path_range_q

Re: [PATCH] tree-optimization/103188 - avoid running ranger on not-up-to-date SSA

2021-11-11 Thread Richard Biener via Gcc-patches
On November 11, 2021 5:43:48 PM GMT+01:00, Aldy Hernandez wrote: >Thanks for doing this! > >> >> + gimple_ranger *ranger = new gimple_ranger; >> + path_range_query *query = new path_range_query (*ranger, >> /*resolve=*/true); > >Hmmm, it looks like both clients are now instantiating a gimple_r

Re: [PATCH] rs6000: Fix a handful of 32-bit built-in function problems in the new support

2021-11-11 Thread Bill Schmidt via Gcc-patches
Hi! On 11/11/21 7:11 AM, Segher Boessenkool wrote: > On Wed, Nov 10, 2021 at 03:28:18PM -0600, Bill Schmidt wrote: >> On 11/10/21 2:33 AM, Segher Boessenkool wrote: >>> On Tue, Nov 09, 2021 at 03:46:54PM -0600, Bill Schmidt wrote: * config/rs6000/rs6000-builtin-new.def (CMPB): Flag as no32

Re: [PATCH] tree-optimization/103188 - avoid running ranger on not-up-to-date SSA

2021-11-11 Thread Aldy Hernandez via Gcc-patches
Thanks for doing this! > > + gimple_ranger *ranger = new gimple_ranger; > + path_range_query *query = new path_range_query (*ranger, /*resolve=*/true); Hmmm, it looks like both clients are now instantiating a gimple_ranger just so they can pass it down to the path_range_query. Maybe we should

Re: [PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR

2021-11-11 Thread Kito Cheng via Gcc-patches
Hi Philipp: This testcase got wrong result with this patch even w/o si3_sext pattern: #include #define MAX(A, B) ((A) > (B) ? (A) : (B)) long long __attribute__((noinline, noipa)) foo6(long long a, long long b, int c) { int xa = a; int xb = b; return MAX(MAX(xa, xb), c); } int main() {

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-11 Thread Martin Liška
PING^1 On 11/4/21 13:36, Martin Liška wrote: Sending the patch in a separate thread. Ready for master? Cheers, Martin gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_override_options_after_change): Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll

Re: [PATCH] fixincludes: don't assume getcwd() can handle NULL argument

2021-11-11 Thread Jeff Law via Gcc-patches
On 11/11/2021 6:04 AM, Eric Gallager via Gcc-patches wrote: On Tue, Nov 9, 2021 at 8:50 AM Xi Ruoyao via Gcc-patches wrote: POSIX says: On some implementations, if buf is a null pointer, getcwd() may obtain size bytes of memory using malloc(). In this case, the pointer returned

[PATCH] Implement -fprofile-prefix-map.

2021-11-11 Thread Martin Liška
It's functionality that is analogous to -ffile-prefix-map, this time for gcov purpose. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR gcov-profile/96092 gcc/ChangeLog: * common.opt: New option. * coverage

Enable pure/const discovery in modref

2021-11-11 Thread Jan Hubicka via Gcc-patches
Hi, this patch enables the pure/const discovery in modref, so we newly can handle some extra cases, for example: struct a {int a,b,c;}; __attribute__ ((noinline)) int init (struct a *a) { a->a=1; a->b=2; a->c=3; } int const_fn () { struct a a; init (&a); return a.a + a.b + a.c; } Her

[PATCH] fixincludes: fix portability issues about getcwd() [PR21283, PR80047]

2021-11-11 Thread Xi Ruoyao via Gcc-patches
[Revised to handle PR 21283.] POSIX says: On some implementations, if buf is a null pointer, getcwd() may obtain size bytes of memory using malloc(). In this case, the pointer returned by getcwd() may be used as the argument in a subsequent call to free(). Invoking getcwd() with b

Re: [PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR

2021-11-11 Thread Kito Cheng via Gcc-patches
IIRC it's not work even without sign extend pattern since I did similar experimental before (not for RISC-V, but same concept), I guess I need more time to test that. Philipp Tomsich 於 2021年11月12日 週五 00:18 寫道: > Kito, > > Unless I am missing something, the problem is not the relaxation to > GPR,

Re: [PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR

2021-11-11 Thread Philipp Tomsich
Kito, Unless I am missing something, the problem is not the relaxation to GPR, but rather the sign-extending pattern I had squashed into the same patch. If you disable "si3_sext", a sext.w will be have to be emitted after the 'max' and before the return (or before the SImode output is consumed as

Re: [PATCH 1v2/3][vect] Add main vectorized loop unrolling

2021-11-11 Thread Andre Vieira (lists) via Gcc-patches
Hi, This is the rebased and reworked version of the unroll patch.  I wasn't entirely sure whether I should compare the costs of the unrolled loop_vinfo with the original loop_vinfo it was unrolled of. I did now, but I wasn't too sure whether it was a good idea to... Any thoughts on this? Re

Re: [PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR

2021-11-11 Thread Kito Cheng via Gcc-patches
Hi Philipp: We can't pretend we have SImode min/max instruction without that semantic. Give this testcase, x86 and rv64gc print out 8589934592 8589934591 = 0, but with this patch and compile with rv64gc_zba_zbb -O3, the output become 8589934592 8589934591 = 8589934592 -Testcase---

[PATCH] libbacktrace: fix UBSAN issues

2021-11-11 Thread Martin Liška
Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin Fix issues mentioned in the PR. PR libbacktrace/103167 libbacktrace/ChangeLog: * elf.c (elf_uncompress_lzma_block): Cast to unsigned int. (elf_uncompress_lzma):

Re: [PATCH v2] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004]

2021-11-11 Thread Segher Boessenkool
Hi! On Thu, Nov 11, 2021 at 11:40:10AM -0300, Raphael Moreira Zinsly wrote: > Changes since v1: > - Removed -Wmissing-prototypes fix. > - Fixed formatting of Changelog and patch. > > --->8--- > > At the end of the backtrace stream _Unwind_Find_FDE() may not be able > to find the fram

Re: [Patch] Fortran/openmp: Add support for 2 argument num_teams clause

2021-11-11 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 11, 2021 at 04:04:04PM +0100, Tobias Burnus wrote: > Just the Fortran FE work + Fortranized version for the C tests. > > Tobias > - > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 > München; Gesellschaft mit beschränkter Haftung; Geschäf

[vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2021-11-11 Thread Joel Hutton via Gcc-patches
Hi all, This refactor allows widening vect patterns (such as widen_plus/widen_minus) to be represented as either internal_fns or tree_codes and replaces the current widen_plus/widen_minus with internal_fn versions. This refactor is split into 3 patches. Boostrapped and regression tested on aar

[PATCH] tree-optimization/103190 - fix assert in reassoc stmt placement with asm

2021-11-11 Thread Richard Biener via Gcc-patches
This makes sure to only assert we don't run into a asm goto when inserting a stmt in reassoc, matching the condition in can_reassociate_p. We can handle EH edges from an asm just like EH edges from any other stmt. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-11-11 Richard B

[Patch] Fortran/openmp: Add support for 2 argument num_teams clause

2021-11-11 Thread Tobias Burnus
Just the Fortran FE work + Fortranized version for the C tests. Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München;

Fix some side cases of side effects analysis

2021-11-11 Thread Jan Hubicka via Gcc-patches
Hi, I wrote script comparing modref pure/const discovery with ipa-pure-const and found mistakes on both ends. I fixed ipa-pure-const in previous two patches. This plugs the case where modref was too optimistic in handling looping pure consts which were previously missed due to early exits on ECF_

[committed] Testsuite: Various fixes for nios2.

2021-11-11 Thread Sandra Loosemore
I've pushed the attached patch to clean up some test failures I've seen on nios2-elf. This target defaults to -fno-delete-null-pointer-checks so any optimization tests that depend on assumptions that valid pointers are non-zero have to be marked explicitly. The others ought to be obvious, exc

Re: Fix recursion discovery in ipa-pure-const

2021-11-11 Thread Jan Hubicka via Gcc-patches
> On Thu, Nov 11, 2021 at 2:41 PM Jan Hubicka via Gcc-patches > wrote: > > > > Hi, > > We make self recursive functions as looping of fear of endless recursion. > > This is done correctly for local pure/const and for non-trivial SCCs in > > callgraph, but for trivial SCCs we miss the flag. > > > >

[PATCH v2] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004]

2021-11-11 Thread Raphael Moreira Zinsly via Gcc-patches
Changes since v1: - Removed -Wmissing-prototypes fix. - Fixed formatting of Changelog and patch. --->8--- At the end of the backtrace stream _Unwind_Find_FDE() may not be able to find the frame unwind info and will later call the backtrace fallback instead of finishing. This occur

[COMMITTED] Move import population from threader to path solver.

2021-11-11 Thread Aldy Hernandez via Gcc-patches
Imports are our nomenclature for external SSA names to a block that are used to calculate the outgoing edges for said block. For example, in the following snippet: : _1 = b_10 == block_11; _2 = b_10 != -1; _3 = _1 & _2; if (_3 != 0) goto ; [INV] else goto ; [I

Re: Fix recursion discovery in ipa-pure-const

2021-11-11 Thread Richard Biener via Gcc-patches
On Thu, Nov 11, 2021 at 2:41 PM Jan Hubicka via Gcc-patches wrote: > > Hi, > We make self recursive functions as looping of fear of endless recursion. > This is done correctly for local pure/const and for non-trivial SCCs in > callgraph, but for trivial SCCs we miss the flag. > > I think it is bad

Re: [PATCH] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004]

2021-11-11 Thread Raphael M Zinsly via Gcc-patches
Hi Segher, On 11/11/2021 10:43, Segher Boessenkool wrote: Hi! On Wed, Nov 10, 2021 at 06:59:23PM -0300, Raphael Moreira Zinsly wrote: At the end of the backtrace stream _Unwind_Find_FDE() may not be able to find the frame unwind info and will later call the backtrace fallback instead of finish

[PATCH v1 8/8] RISC-V: bitmanip: relax minmax to operate on GPR

2021-11-11 Thread Philipp Tomsich
While min/minu/max/maxu instructions are provided for XLEN only, these can safely operate on GPRs (i.e. SImode or DImode for RV64): SImode is always sign-extended, which ensures that the XLEN-wide instructions can be used for signed and unsigned comparisons on SImode yielding a correct ordering of

[PATCH v1 7/8] RISC-V: bitmanip: add orc.b as an unspec

2021-11-11 Thread Philipp Tomsich
As a basis for optimized string functions (e.g., the by-pieces implementations), we need orc.b available. This adds orc.b as an unspec, so we can expand to it. gcc/ChangeLog: * config/riscv/bitmanip.md (orcb2): Add orc.b as an unspec. * config/riscv/riscv.md: Add UNSPEC_ORC_B. S

[PATCH v1 6/8] RISC-V: bitmanip: add splitter to use bexti for "(a & (1 << BIT_NO)) ? 0 : -1"

2021-11-11 Thread Philipp Tomsich
Consider creating a polarity-reversed mask from a set-bit (i.e., if the bit is set, produce all-ones; otherwise: all-zeros). Using Zbb, this can be expressed as bexti, followed by an addi of minus-one. To enable the combiner to discover this opportunity, we need to split the canonical expression

[PATCH v1 5/8] RISC-V: bitmanip: improvements to rotate instructions

2021-11-11 Thread Philipp Tomsich
This change improves rotate instructions (motivated by a review of the code generated for OpenSSL): rotate-left by a constant are synthesized using a rotate-right-immediate to avoid putting the shift-amount into a temporary; to do so, we allow either a register or an immediate for the expansion of

[PATCH v1 4/8] RISC-V: bitmanip: fix constant-loading for (1ULL << 31) in DImode

2021-11-11 Thread Philipp Tomsich
The SINGLE_BIT_MASK_OPERAND() is overly restrictive, triggering for bits above 31 only (to side-step any issues with the negative SImode value 0x8000). This moves the special handling of this SImode value (i.e. the check for -2147483648) to riscv.c and relaxes the SINGLE_BIT_MASK_OPERAND() tes

[PATCH v1 3/8] RISC-V: costs: support shift-and-add in strength-reduction

2021-11-11 Thread Philipp Tomsich
The strength-reduction implementation in expmed.c will assess the profitability of using shift-and-add using a RTL expression that wraps a MULT (with a power-of-2) in a PLUS. Unless the RISC-V rtx_costs function recognizes this as expressing a sh[123]add instruction, we will return an inflated cos

[PATCH v1 2/8] RISC-V: costs: handle BSWAP

2021-11-11 Thread Philipp Tomsich
The BSWAP operation is not handled in rtx_costs. Add it. gcc/ChangeLog: * config/riscv/riscv.c (rtx_costs): Add BSWAP. Signed-off-by: Philipp Tomsich --- gcc/config/riscv/riscv.c | 8 1 file changed, 8 insertions(+) diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/ri

[PATCH v1 0/8] Improvements to bitmanip-1.0 (Zb[abcs]) support

2021-11-11 Thread Philipp Tomsich
This series provides assorted improvements for the RISC-V Zb[abcs] support collected over the last year and a half and forward-ported to the recently merged upstream support for the Zb[abcs] extensions. Improvements include: - synthesis of HImode bswap from SImode/DImode rev8 - cost-model chan

[PATCH v1 1/8] bswap: synthesize HImode bswap from SImode or DImode

2021-11-11 Thread Philipp Tomsich
The RISC-V Zbb extension adds an XLEN (i.e. SImode for rv32, DImode for rv64) bswap instruction (rev8). While, with the current master, SImode is synthesized correctly from DImode, HImode is not. This change adds an appropriate expansion for a HImode bswap, if a wider bswap is available. Without

[PATCH] tree-optimization/103188 - avoid running ranger on not-up-to-date SSA

2021-11-11 Thread Richard Biener via Gcc-patches
The following splits loop header copying into an analysis phase that uses ranger and a transform phase that can do without to avoid running ranger on IL that has SSA form not updated. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-11-11 Richard Biener PR tree-optimi

Re: [PATCH] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004]

2021-11-11 Thread Segher Boessenkool
Hi! On Wed, Nov 10, 2021 at 06:59:23PM -0300, Raphael Moreira Zinsly wrote: > At the end of the backtrace stream _Unwind_Find_FDE() may not be able > to find the frame unwind info and will later call the backtrace fallback > instead of finishing. This occurs when using an old libc on ppc64 due to

Fix recursion discovery in ipa-pure-const

2021-11-11 Thread Jan Hubicka via Gcc-patches
Hi, We make self recursive functions as looping of fear of endless recursion. This is done correctly for local pure/const and for non-trivial SCCs in callgraph, but for trivial SCCs we miss the flag. I think it is bad decision since infinite recursion will run out of stack, but changing it upsets

Fix noreturn discovery

2021-11-11 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes ipa-pure-const handling of noreturn flags. It is not safe to set it for interposable symbols and we should also set it for aliases (just like we do for other flags). This patch merely copies other flag handling and implements it here. Bootstrapped/regtested x86_64-linux, wil

Re: Use modref summary to DSE calls to non-pure functions

2021-11-11 Thread Jan Hubicka via Gcc-patches
> > Hmm, I could try to do this, but possibly incrementally? > > You mean handle a &decl argument specially for unknown param offset? > Yeah, I guess so. I think it is also pointer that was allocated and is going to be freed... > > > Basically I want to have > > > > foo (&decl) > > decl = {} > >

Re: [PATCH][committed]middle-end: Fix signbit tests when ran on ISA with support for masks.

2021-11-11 Thread Tamar Christina via Gcc-patches
Ah yes that particular test checks the vector code. I see that the function wasn't vectorized but that the scalar replacement was done. _15 = _4 > 0; So the test is checking if (-x >> bitsize-1) gets optimized to -(x > 0) I see that the replacement was made on the scalar correctly so I will

Re: Use modref summary to DSE calls to non-pure functions

2021-11-11 Thread Richard Biener via Gcc-patches
On Thu, Nov 11, 2021 at 1:42 PM Jan Hubicka wrote: > > Hi, > > > > No, I think if it turns out useful then we want a way to have such ref > > represented by an ao_ref. Note that when we come from a > > ref tree we know handled-components only will increase offset, > > only the base MEM_REF can co

[committed] libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values

2021-11-11 Thread Jakub Jelinek via Gcc-patches
Hi! When thinking about GOMP_teams3, I've realized that using global variables for the values returned by omp_get_num_teams()/omp_get_team_num() calls is incorrect even with our right now dumb way of implementing host teams. The problems are two, one is if host teams is used from multiple pthread_

RE: [PATCH] aarch64: Use type-qualified builtins for UADD[LW][2] Neon intrinsics

2021-11-11 Thread Kyrylo Tkachov via Gcc-patches
Hi Jonathan, > -Original Message- > From: Jonathan Wright > Sent: Thursday, November 11, 2021 10:18 AM > To: gcc-patches@gcc.gnu.org > Cc: Richard Sandiford ; Kyrylo Tkachov > > Subject: [PATCH] aarch64: Use type-qualified builtins for UADD[LW][2] Neon > intrinsics > > Hi, > > This pat

Re: [committed] openmp: Fix handling of numa_domains(1)

2021-11-11 Thread Thomas Schwinge
Hi! On 2021-10-18T15:03:08+0200, Jakub Jelinek via Gcc-patches wrote: > On Fri, Oct 15, 2021 at 12:26:34PM -0700, sunil.k.pandey wrote: >> 4764049dd620affcd3e2658dc7f03a6616370a29 is the first bad commit >> commit 4764049dd620affcd3e2658dc7f03a6616370a29 >> Author: Jakub Jelinek >> Date: Fri

Re: [PATCH] rs6000: Fix a handful of 32-bit built-in function problems in the new support

2021-11-11 Thread Segher Boessenkool
On Wed, Nov 10, 2021 at 03:28:18PM -0600, Bill Schmidt wrote: > On 11/10/21 2:33 AM, Segher Boessenkool wrote: > > On Tue, Nov 09, 2021 at 03:46:54PM -0600, Bill Schmidt wrote: > >>* config/rs6000/rs6000-builtin-new.def (CMPB): Flag as no32bit. > >>(BPERMD): Flag as 32bit. So, change this

Re: [PATCH] fixincludes: don't assume getcwd() can handle NULL argument

2021-11-11 Thread Eric Gallager via Gcc-patches
On Tue, Nov 9, 2021 at 8:50 AM Xi Ruoyao via Gcc-patches wrote: > > POSIX says: > > On some implementations, if buf is a null pointer, getcwd() may obtain > size bytes of memory using malloc(). In this case, the pointer returned > by getcwd() may be used as the argument in a subsequent

Basic kill analysis for modref

2021-11-11 Thread Jan Hubicka via Gcc-patches
Hi, This patch enables optimization of stores that are killed by calls. Modref summary is extended by array containing list of access ranges, relative to function parameters, that are known to be killed by the function. This array is collected during local analysis and optimized (so separate stores

Re: Use modref summary to DSE calls to non-pure functions

2021-11-11 Thread Jan Hubicka via Gcc-patches
Hi, > > No, I think if it turns out useful then we want a way to have such ref > represented by an ao_ref. Note that when we come from a > ref tree we know handled-components only will increase offset, > only the base MEM_REF can contain a pointer subtraction (but > the result of that is the base

Re: Use modref summary to DSE calls to non-pure functions

2021-11-11 Thread Richard Biener via Gcc-patches
On Thu, Nov 11, 2021 at 1:07 PM Jan Hubicka wrote: > > > > + /* Unlike alias oracle we can not skip subtrees based on TBAA check. > > > + Count the size of the whole tree to verify that we will not need > > > too many > > > + tests. */ > > > + FOR_EACH_VEC_SAFE_ELT (summary->stores->ba

Re: Use modref summary to DSE calls to non-pure functions

2021-11-11 Thread Jan Hubicka via Gcc-patches
> > + /* Unlike alias oracle we can not skip subtrees based on TBAA check. > > + Count the size of the whole tree to verify that we will not need too > > many > > + tests. */ > > + FOR_EACH_VEC_SAFE_ELT (summary->stores->bases, i, base_node) > > +FOR_EACH_VEC_SAFE_ELT (base_node->re

[PATCH 11/15] csky: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/csky/csky.md (*cskyv2_adddi3, *ck801_a

[PATCH 15/15] sh: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/sh/sh.md (call_pcrel, call_value_pcrel

[PATCH 14/15] mips: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/mips/mips.md (*udivmod4, udivmod4_mips

[PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/i386/i386.md (*add3_doubleword, *addv4

[PATCH 13/15] ia64: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/ia64/vect.md (*vec_extractv2sf_0_le, *

[PATCH 10/15] bfin: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/bfin/bfin.md (movdi_insn, movdf_insn):

[PATCH 09/15] arm: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix one non-robust split condition, to make it applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/arm/arm.md (*minmax_arithsi_non_canon): Fix split condition. --- gcc/config/arm/

[PATCH 08/15] alpha: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/alpha/alpha.md (*movtf_internal, *movt

  1   2   >