Re: [PATCH] libgfortran : Use the libtool macro to determine libm availability.

2021-08-22 Thread Iain Sandoe
> On 21 Aug 2021, at 23:18, Eric Gallager wrote: > > On Fri, Aug 20, 2021 at 3:53 AM Tobias Burnus wrote: >> >> On 20.08.21 09:34, Richard Biener via Fortran wrote: >> >>> On Thu, Aug 19, 2021 at 10:10 PM Iain Sandoe wrote: libm is not needed on Darwin, and should not be added uncondi

Re: [PATCH] ipa: add debug counter for IPA MODREF PTA

2021-08-22 Thread Jan Hubicka
> Hi. > > We already have a IPA modref debug counter, but it's only used in > tree-ssa-alias, > which is only a part of what IPA modref does. I used the dbg counter in > isolation > of PR101949. > > Ready for master? OK, thanks! Honza > > gcc/ChangeLog: > > * dbgcnt.def (DEBUG_COUNTER)

Re: [PATCH] IPA: MODREF should skip EAF_* flags for indirect calls

2021-08-22 Thread Jan Hubicka
> Hello. > > As showed in the PR, returning (EAF_NOCLOBBER | EAF_NOESCAPE) for an argument > that is a function pointer is problematic. Doing such a function call is a > clobber. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Ma

[PATCH] x86: Allow CONST_VECTOR for vector load in combine

2021-08-22 Thread H.J. Lu via Gcc-patches
In vetor move pattern, replace nonimmediate_or_sse_const_operand with nonimmediate_or_sse_const_vector_operand to allow vector load from non-uniform CONST_VECTOR. Non-uniform CONST_VECTOR is enabled only in the combine pass since other RTL optimizers work better with constant pool. gcc/

Re: [PATCH] Try LTO partial linking. (Was: Speed of compiling gimple-match.c)

2021-08-22 Thread Jan Hubicka
> Good hint. I added hash based on object file name (I don't want to handle > proper string escaping) and -frandom-seed. > > What do you think about the patch? Sorry for taking so long - I remember I was sending reply earlier but it seems I only wrote it and never sent. > Thanks, > Martin > From

Re: fix latent bootstrap-debug issue (modref, tree-inline, tree jump-threading)

2021-08-22 Thread Jan Hubicka
> > for gcc/ChangeLog > > * ipa-modref.c (analyze_function): Skip debug stmts. > * tree-inline.c (estimate_num_insn): Consider builtins even > without a cgraph_node. OK, thanks for looking into this issue! (for mainline and release brances bit later) > --- > gcc/ipa-modref.c

[PATCH] Improved handling of shifts/rotates in bit CCP.

2021-08-22 Thread Roger Sayle
This patch is the next in the series to improve bit bounds in tree-ssa's bit CCP pass, this time: bounds for shifts and rotates by unknown amounts. This allows us to optimize expressions such as ((x&15)<<(y&24))&64. In this case, the expression (y&24) contains only two unknown bits, and can

[PATCH] Improved handling of division/modulus in bit CCP.

2021-08-22 Thread Roger Sayle
This patch implements support for TRUNC_MOD_EXPR and TRUNC_DIV_EXPR in tree-ssa's bit CCP pass. This is mostly for completeness, as the VRP pass already provides better bounds for these operations, but seeing mask values of all_ones in my debugging/instrumentation logs seemed overly pessimistic.

PING [PATCH] x86: Update memcpy/memset inline strategies for -mtune=generic

2021-08-22 Thread H.J. Lu via Gcc-patches
On Tue, Mar 23, 2021 at 09:19:38AM +0100, Richard Biener wrote: > On Tue, Mar 23, 2021 at 3:41 AM Hongyu Wang wrote: > > > > > Hongyue, please collect code size differences on SPEC CPU 2017 and > > > eembc. > > > > Here is code size difference for this patch > > Thanks, nothing too bad although s

Re: [PATCH] IPA: MODREF should skip EAF_* flags for indirect calls

2021-08-22 Thread Jan Hubicka
> Thanks for looking into this bug - it is interesting that ipa-pta > requires !EAF_NOCLOBBER when function is called... > > I have some work done on teaching ipa-modref (and other propagation > passes) to use ipa-devirt info when the full set of callees is known. > This goes oposite way. > > You

Re: [PATCH] IPA: MODREF should skip EAF_* flags for indirect calls

2021-08-22 Thread H.J. Lu via Gcc-patches
On Sun, Aug 22, 2021 at 10:32 AM Jan Hubicka wrote: > > > Thanks for looking into this bug - it is interesting that ipa-pta > > requires !EAF_NOCLOBBER when function is called... > > > > I have some work done on teaching ipa-modref (and other propagation > > passes) to use ipa-devirt info when the

Re: [C PATCH] qualifiers of pointers to arrays in C2X [PR 98397]

2021-08-22 Thread Uecker, Martin
Am Donnerstag, den 12.08.2021, 16:58 + schrieb Joseph Myers: > On Mon, 24 May 2021, Uecker, Martin wrote: > > > - else if (VOID_TYPE_P (TREE_TYPE (type1)) > > - && !TYPE_ATOMIC (TREE_TYPE (type1))) > > - { > > - if ((TREE_CODE (TREE_TYPE (type2)) == ARRAY_TYPE) > > -

[PATCH] Fold sign of LSHIFT_EXPR to eliminate no-op conversions.

2021-08-22 Thread Roger Sayle
This short patch teaches fold that it is "safe" to change the sign of a left shift, to reduce the number of type conversions in gimple. As an example: unsigned int foo(unsigned int i) { return (int)i << 8; } is currently optimized to: unsigned int foo (unsigned int i) { int i.0_1; int _2;

Re: [EXTERNAL] Re: [PATCH] tree-optimization: Optimize division followed by multiply [PR95176]

2021-08-22 Thread Victor Tong via Gcc-patches
Thanks for the feedback. I updated the pattern and it passes all tests (existing and the new ones I wrote). I added some brackets since there were some warnings about missing brackets on the || and &&. Here's the updated pattern: (simplify (minus (convert1? @0) (convert2? (minus@2 (conver

Re: [PATCH] Fold sign of LSHIFT_EXPR to eliminate no-op conversions.

2021-08-22 Thread Jeff Law via Gcc-patches
On 8/22/2021 6:25 PM, Roger Sayle wrote: This short patch teaches fold that it is "safe" to change the sign of a left shift, to reduce the number of type conversions in gimple. As an example: unsigned int foo(unsigned int i) { return (int)i << 8; } is currently optimized to: unsigned int

Re: [Patch] gcc.c-torture/execute: Fix tmpnam issue on Windows

2021-08-22 Thread Jeff Law via Gcc-patches
On 8/21/2021 9:10 PM, Jonathan Yong via Gcc-patches wrote: Attached patch OK? 2021-08-22  Jonathan Yong  <10wa...@gmail.com> gcc/testsuite/ChangLog: * gcc.c-torture/execute/gcc_tmpnam.h: Fix tmpnam case on Windows where it can return a filename with "\" to indicate current direc

Re: [PATCH] Simplify (truncate:QI (subreg:SI (reg:QI x))) to (reg:QI x)

2021-08-22 Thread Jeff Law via Gcc-patches
On 8/19/2021 5:18 PM, Roger Sayle wrote: Whilst working on a backend patch, I noticed that the middle-end's RTL optimizers weren't simplifying a truncation of a paradoxical subreg extension, though it does transform closely related (more complex) expressions. The main (first) part of this pat

Re: [PATCH] mips: msa: truncate immediate shift amount [PR101922]

2021-08-22 Thread Jeff Law via Gcc-patches
On 8/20/2021 11:07 AM, Xi Ruoyao via Gcc-patches wrote: When -mloongson-mmi is enabled, SHIFT_COUNT_TRUNCATED is turned off. This causes untruncated immediate shift amount outputed into the asm, and the GNU assembler refuses to assemble it. Truncate immediate shift amount when outputing the a

Re: [PATCH] Improved handling of division/modulus in bit CCP.

2021-08-22 Thread Jeff Law via Gcc-patches
On 8/22/2021 8:50 AM, Roger Sayle wrote: This patch implements support for TRUNC_MOD_EXPR and TRUNC_DIV_EXPR in tree-ssa's bit CCP pass. This is mostly for completeness, as the VRP pass already provides better bounds for these operations, but seeing mask values of all_ones in my debugging/ins

Re: [Patch] gcc.c-torture/execute: Fix tmpnam issue on Windows

2021-08-22 Thread Jonathan Yong via Gcc-patches
On 8/23/21 1:07 AM, Jeff Law wrote: On 8/21/2021 9:10 PM, Jonathan Yong via Gcc-patches wrote: Attached patch OK? 2021-08-22  Jonathan Yong  <10wa...@gmail.com> gcc/testsuite/ChangLog: * gcc.c-torture/execute/gcc_tmpnam.h: Fix tmpnam case on Windows where it can return a filename wi

[PATCH] Disable slp in loop vectorizer when cost model is very-cheap.

2021-08-22 Thread liuhongt via Gcc-patches
Performance impact for the commit with option: -march=x86-64 -O2 -ftree-vectorize -fvect-cost-model=very-cheap SPEC2017 fprate 503.bwaves_rBuildSame 507.cactuBSSN_r -0.04 508.namd_r 0.14 510.parest_r-0.54 511.povray_r 0.10 519.lbm_r B

Re: [PATCH] Propagate get_nonzero_bits information in division [PR77980]

2021-08-22 Thread Jeff Law via Gcc-patches
On 7/26/2021 6:45 PM, Victor Tong via Gcc-patches wrote: This change enables the "t1 != 0" check to be optimized away in this code: int x1 = 0; unsigned int x2 = 1; int main () { int t1 = x1*(1/(x2+x2)); if (t1 != 0) __builtin_abort(); return 0; } The change utilizes the VRP

Re: [RFC] middle-end: Extend CSE to understand vector extracts.

2021-08-22 Thread Jeff Law via Gcc-patches
On 1/4/2021 6:18 AM, Tamar Christina wrote: Hi All, I am trying to get CSE to re-use constants already inside a vector rather than re-materializing the constant again. Basically consider the following case: #include #include uint64_t test (uint64_t a, uint64x2_t b, uint64x2_t* rt) { u

Re: [PATCH] Use _GLIBCXX_ASSERTIONS as _GLIBCXX_DEBUG light

2021-08-22 Thread François Dumont via Gcc-patches
Any feedback ? Thanks On 08/08/21 9:34 pm, François Dumont wrote: After further testing here a fixed version which imply less changes. Moreover I already commit the fixes unrelated with this patch.     libstdc++: [_GLIBCXX_ASSERTIONS] Activate basic debug checks     libstdc++-v3/ChangeLog:

Re: [Patch][doc][PR101843]clarification on building gcc and binutils together

2021-08-22 Thread Jeff Law via Gcc-patches
On 8/19/2021 4:27 PM, Qing Zhao via Gcc-patches wrote: Hi, This patch is on behalf of John Henning, who opened PR 101843: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101843 He proposed the following doc change, please take a look and let me know whether this is Okay for commit? I think we

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-22 Thread Uecker, Martin
Am Montag, den 16.08.2021, 06:49 +0200 schrieb Martin Uecker: > Am Montag, den 16.08.2021, 00:30 -0400 schrieb Jason Merrill: > > On 8/1/21 1:36 PM, Uecker, Martin wrote: > > > Here is an attempt to fix some old and annoying bugs related > > > to VLAs and statement expressions. In particulary, this

Re: [PATCH] mips: msa: truncate immediate shift amount [PR101922]

2021-08-22 Thread Xi Ruoyao via Gcc-patches
On Sun, 2021-08-22 at 19:21 -0600, Jeff Law wrote: > > > On 8/20/2021 11:07 AM, Xi Ruoyao via Gcc-patches wrote: > > When -mloongson-mmi is enabled, SHIFT_COUNT_TRUNCATED is turned off. > > This causes untruncated immediate shift amount outputed into the > > asm, > > and the GNU assembler refuses