[PATCH PR81408]Turn TREE level unsafe loop optimizations warning to missed optimization message

2017-07-18 Thread Bin Cheng
Hi, I removed unsafe loop optimization on TREE level last year, so GCC doesn't do unsafe loop optimizations on TREE now. All "unsafe loop optimizations" warnings reported by TREE optimizers are simply missed optimizations. This patch turns such warning into missed optimization messages. I

Re: [PATCH] match.pd: reassociate multiplications with constants

2017-07-18 Thread Richard Biener
On Fri, Jul 14, 2017 at 7:59 AM, Marc Glisse wrote: > On Thu, 13 Jul 2017, Alexander Monakov wrote: > >> On Thu, 13 Jul 2017, Marc Glisse wrote: >>> >>> I notice that we do not turn (X*10)*10 into X*100 in GIMPLE. >> >> >> Sorry, could you clarify what you mean here? I

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Richard Biener
On Mon, 10 Jul 2017, Tamar Christina wrote: > Hi All, > > I've re-spun the patch with the changes requested. > > > This is only done when not honoring signaling NaNs. > This transormation is done at expand time by using > a new optab "xorsign". If the optab is not available > then copysign is

[PATCH] Fix PR81418

2017-07-18 Thread Richard Biener
The following fixes a missed check in vectorizable-reduction. We cannot handle the case where we have a lane-reducing reduction operation like DOT_PROD_EXPR with not using a single def-use cycle because we need individual reduction vector elements in other vector stmts. Bootstrapped and tested

Re: PATCH v2][Aarch64] Add vectorized mersenne twister

2017-07-18 Thread Ulrich Drepper
On Tue, Jul 18, 2017 at 7:57 AM, Michael Collison wrote: > This is the second version of a patch for Aarc64 to add a vectorized mersenne > twister to libstdc++. The first version used intrinsics and included > "arm_neon.h". After feedback from the community this

Fix Eh delivery in partitioned functions

2017-07-18 Thread Jan Hubicka
Hi, this patch fixes wrong code issue with BB partitioning where sometimes EH is not delivered. This is very old issue that affect all release branches with -fprofile-use, but recently surfaced as libstdc++ testsuite regression because we now partition functions based on static profile

RE: PATCH v2][Aarch64] Add vectorized mersenne twister

2017-07-18 Thread Michael Collison
No particular reason; I can merge it into one preprocessor line. -Original Message- From: drep...@gmail.com [mailto:drep...@gmail.com] On Behalf Of Ulrich Drepper Sent: Tuesday, July 18, 2017 12:24 AM To: Michael Collison Cc: GCC Patches

Re: [PATCH][PR 59521] Respect probabilities when expanding switch statement

2017-07-18 Thread Jan Hubicka
> Hi all, > > Currently all cases in switch statement are treated as having equal > probabilities which causes suboptimal code as demonstrated in > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59521 . This patch > modifies expander to select pivot point for decision tree so that > probabilities

Re: Fix Eh delivery in partitioned functions

2017-07-18 Thread Richard Biener
On Tue, 18 Jul 2017, Jan Hubicka wrote: > > On Tue, 18 Jul 2017, Jan Hubicka wrote: > > > > > Hi, > > > this patch fixes wrong code issue with BB partitioning where sometimes EH > > > is not delivered. This is very old issue that affect all release branches > > > with -fprofile-use, but

Re: [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls

2017-07-18 Thread Yuri Gribov
On Mon, Jul 17, 2017 at 10:27 AM, Jan Hubicka wrote: >> Hi all, >> >> This is a new version of previous patch >> (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed >> after Rainer's remarks. > Hi, > the patch looks OK, but I wonder why you included can_be_discarded

Re: [PATCH] Fix PR81362: Vector peeling

2017-07-18 Thread Andreas Krebbel
On 07/12/2017 05:11 PM, Robin Dapp wrote: > gcc/ChangeLog: > > 2017-07-12 Robin Dapp > > * (vect_enhance_data_refs_alignment): > Remove body_cost_vec from _vect_peel_extended_info. > tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost): >

[PATCH] Fix PR81403

2017-07-18 Thread Richard Biener
The following fixes VN simplification during PHI translation where we can assign value-numbers to new expressions in different context and thus have to reset flow-sensitive SSA info like we do during VN. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2017-07-18

Fix ICE in estimate_bb_frequencies

2017-07-18 Thread Jan Hubicka
Hi, this patch fixes ICE in estimate_bb_frequencies which triggers because we forget to compute probability for blocks whose count is earlier statically determined to be 0. Bootstrapped/regtested x86_64-linux, will commit it shortly. Honza PR middle-end/81462 * predict.c

[GCC ARM]Remove unused variable in arm

2017-07-18 Thread Bin Cheng
Hi, This leftover unused variable breaks arm bootstrap. Simply remove it. Thanks, bin 2017-07-18 Bin Cheng * config/arm/arm.c (arm_emit_store_exclusive): Remove unused var.diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 1b7b382..139ab70 100644 ---

Re: [PATCH PR81408]Turn TREE level unsafe loop optimizations warning to missed optimization message

2017-07-18 Thread Richard Biener
On Tue, Jul 18, 2017 at 10:00 AM, Bin Cheng wrote: > Hi, > I removed unsafe loop optimization on TREE level last year, so GCC doesn't do > unsafe > loop optimizations on TREE now. All "unsafe loop optimizations" warnings > reported by > TREE optimizers are simply missed

Re: [PATCH] vec_merge + vec_duplicate + vec_concat simplification

2017-07-18 Thread Kyrill Tkachov
On 05/07/17 16:14, Kyrill Tkachov wrote: On 27/06/17 23:28, Jeff Law wrote: On 06/06/2017 02:35 AM, Kyrill Tkachov wrote: Hi all, Another vec_merge simplification that's missing is transforming: (vec_merge (vec_duplicate x) (vec_concat (y) (z)) (const_int N)) into (vec_concat x z) if N == 1

Re: [PATCH] Simplify vec_merge of vec_duplicate with const_vector

2017-07-18 Thread Kyrill Tkachov
On 05/07/17 16:14, Kyrill Tkachov wrote: On 27/06/17 23:29, Jeff Law wrote: On 06/06/2017 02:25 AM, Kyrill Tkachov wrote: Hi all, I'm trying to improve some of the RTL-level handling of vector lane operations on aarch64 and that involves dealing with a lot of vec_merge operations. One

Re: [PATCH PR81408]Turn TREE level unsafe loop optimizations warning to missed optimization message

2017-07-18 Thread Bin.Cheng
On Tue, Jul 18, 2017 at 9:31 AM, Richard Biener wrote: > On Tue, Jul 18, 2017 at 10:00 AM, Bin Cheng wrote: >> Hi, >> I removed unsafe loop optimization on TREE level last year, so GCC doesn't >> do unsafe >> loop optimizations on TREE now. All

Re: Fix Eh delivery in partitioned functions

2017-07-18 Thread Jan Hubicka
> On Tue, 18 Jul 2017, Jan Hubicka wrote: > > > Hi, > > this patch fixes wrong code issue with BB partitioning where sometimes EH > > is not delivered. This is very old issue that affect all release branches > > with -fprofile-use, but recently surfaced as libstdc++ testsuite regression > >

Re: [PATCH] gcc: ada: delete old $(P) reference

2017-07-18 Thread Arnaud Charlet
> From: Mike Frysinger > > The P variable was deleted back in Nov 2015 (svn rev 231062), > but its expansion was missed. Delete those now too. > > 2017-07-18 Mike Frysinger > > * gcc-interface/Makefile.in ($(P)): Delete OK, thanks.

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
Ping. From: Tamar Christina Sent: Monday, July 10, 2017 4:47 PM To: Andrew Pinski Cc: GCC Patches; nd; l...@redhat.com; i...@airs.com; rguent...@suse.de Subject: Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)] Hi All, I've re-spun

Re: [GCC ARM]Remove unused variable in arm

2017-07-18 Thread Kyrill Tkachov
Hi Bin, On 18/07/17 09:11, Bin Cheng wrote: Hi, This leftover unused variable breaks arm bootstrap. Simply remove it. Thanks, bin 2017-07-18 Bin Cheng * config/arm/arm.c (arm_emit_store_exclusive): Remove unused var. The ChangeLog entry should say

Re: [PATCH] Move static chain and non-local goto init after NOTE_INSN_FUNCTION_BEG (PR sanitize/81186).

2017-07-18 Thread Martin Liška
On 07/17/2017 03:15 PM, Michael Matz wrote: > Hello, > > On Mon, 17 Jul 2017, Martin Liška wrote: > >> which does all the stack preparation (including the problematic call to >> __asan_stack_malloc_N). >> >> Note that this code still should be placed before parm_birth_note as we >> cant's say

Re: [PATCH][PR 59521] Respect probabilities when expanding switch statement

2017-07-18 Thread Yuri Gribov
On Tue, Jul 18, 2017 at 8:45 AM, Jan Hubicka wrote: >> Hi all, >> >> Currently all cases in switch statement are treated as having equal >> probabilities which causes suboptimal code as demonstrated in >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59521 . This patch >> modifies

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
> > Why's this now done during RTL expansion rather than during late GIMPLE, > using match.pd and an internal function for xorsign? > Mainly because of Andrew's email on the 10th which stated: > But you should get the general idea. I would like to see more of these > special expand patterns

[PATCH][PR 59521] Respect probabilities when expanding switch statement

2017-07-18 Thread Yuri Gribov
Hi all, Currently all cases in switch statement are treated as having equal probabilities which causes suboptimal code as demonstrated in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59521 . This patch modifies expander to select pivot point for decision tree so that probabilities of cases on the

Re: Fix Eh delivery in partitioned functions

2017-07-18 Thread Richard Biener
On Tue, 18 Jul 2017, Jan Hubicka wrote: > Hi, > this patch fixes wrong code issue with BB partitioning where sometimes EH > is not delivered. This is very old issue that affect all release branches > with -fprofile-use, but recently surfaced as libstdc++ testsuite regression > because we now

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-07-18 Thread Bin.Cheng
On Mon, Jul 17, 2017 at 1:09 PM, Christophe Lyon wrote: > On 17 July 2017 at 12:06, Bin.Cheng wrote: >> On Mon, Jul 10, 2017 at 10:32 AM, Christophe Lyon >> wrote: >>> Hi Bin, >>> >>> On 30 June 2017 at 12:43,

[PATCH] gcc: ada: delete old $(P) reference

2017-07-18 Thread Mike Frysinger
From: Mike Frysinger The P variable was deleted back in Nov 2015 (svn rev 231062), but its expansion was missed. Delete those now too. 2017-07-18 Mike Frysinger * gcc-interface/Makefile.in ($(P)): Delete ---

Re: [PATCH] Fix an UBSAN test-case (PR sanitizer/63361).

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 01:44:21PM +0200, Martin Liška wrote: > gcc/testsuite/ChangeLog: > > 2017-07-17 Martin Liska > > PR sanitizer/63361 > * c-c++-common/ubsan/float-cast-overflow-1.c: Add either > -ffloat-store or -mieee for targets that need it. > --- >

Re: RFC/A: Early predictive commoning pass

2017-07-18 Thread Richard Biener
On Mon, Jul 3, 2017 at 10:45 AM, Richard Sandiford wrote: > General predictive commoning would play havoc with loop vectorisation, > so the current pass order is clearly the right one. But running a very > limited form of predictive commoning before vectorisation

[C++ PATCH] move ctors and assign (again)

2017-07-18 Thread Nathan Sidwell
In addition to the user-declared checkers, we also have a couple of 'do we have at all' predicates. Used exactly once when completing a struct and determining the state of the appropriate LAZY flags. Merged with the attached patch committed to trunk. Now the two functions are stunningly

backport nvptx patch to gcc-7-branch

2017-07-18 Thread Tom de Vries
[ was: Re: [nvptx, committed, PR81069] Insert diverging jump alap in nvptx_single ] On 07/17/2017 10:41 AM, Tom de Vries wrote: Hi, Consider nvptx_single: ... /* Single neutering according to MASK. FROM is the incoming block and TO is the outgoing block. These may be the same block.

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-18 Thread H.J. Lu
On Mon, Jul 17, 2017 at 9:02 PM, Alan Modra wrote: > On Mon, Jul 17, 2017 at 06:01:47AM -0700, H.J. Lu wrote: >> On Mon, Jul 17, 2017 at 5:33 AM, Alan Modra wrote: >> > On Sat, Jul 15, 2017 at 06:32:40AM -0700, H.J. Lu wrote: >> >> On Thu, Jun 22, 2017 at 8:28

Re: [PATCH] PR libstdc++/81064 fix versioned namespace

2017-07-18 Thread Ville Voutilainen
On 18 July 2017 at 16:31, Jonathan Wakely wrote: > This is quite a huge change, so I'd like to wait and see if anyone > else has any opinion on it. > > Personally I think it's necessary (assuming I understand the PR > correctly) and so if nobody objects I think we should go

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-18 Thread Alan Modra
On Tue, Jul 18, 2017 at 05:36:49AM -0700, H.J. Lu wrote: > I am working on compiling libc.a in glibc with -fPIE and building static > PIE. This creates static executable with PIE: > > gcc -nostdlib -nostartfiles -static -o > /export/build/gnu/glibc-static-pie/build-x86_64-linux/elf/sln -pie >

[PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Jakub Jelinek
Hi! The following patch implements the: /* Optimize (c>=1) && (c<=127) into (signed char)c > 0. */ if (integer_onep (low) && TREE_CODE (high) == INTEGER_CST) { int prec = TYPE_PRECISION (etype); if (wi::mask (prec - 1, false, prec) == high) { if

[PATCH] Fix PR81410

2017-07-18 Thread Richard Biener
The following fixes SLP loads with gaps in the case of no permutation. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk sofar. Richard. 2017-06-18 Richard Biener PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load):

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Richard Biener
On Tue, 18 Jul 2017, Tamar Christina wrote: > > > > Why's this now done during RTL expansion rather than during late GIMPLE, > > using match.pd and an internal function for xorsign? > > > > Mainly because of Andrew's email on the 10th which stated: > > > But you should get the general idea.

Re: Fix ICE in estimate_bb_frequencies

2017-07-18 Thread Markus Trippelsdorf
On 2017.07.18 at 09:54 +0200, Jan Hubicka wrote: > Hi, > this patch fixes ICE in estimate_bb_frequencies which triggers because we > forget > to compute probability for blocks whose count is earlier statically > determined to be > 0. > > Bootstrapped/regtested x86_64-linux, will commit it

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
> > It should be a match.pd rule that uses a match predicate, so expand in > > gimple-match.c. but don't do this if the target doesn't have the > > xorsign optab and don't do it if honouring SNAN. > > Note that this will trigger too early (IMHO), so unless you feel like > inventing > new

[patch,avr.applied] Fix PR81473: Don't use INT8_MIN etc.

2017-07-18 Thread Georg-Johann Lay
https://gcc.gnu.org/r250301 https://gcc.gnu.org/r250302 Removed usage of INT8_MIN and friends as they are not available in older C++ which leads to build failure. Applied to trunk and v7 branch. Johann gcc/ Backport from 2017-07-18 trunk r250301. PR target/81473 *

[PATCH] [ARC] Check the assembler for dwarf2 support.

2017-07-18 Thread Claudiu Zissulescu
From: claziss We miss the assembler testing if it supports gdwarf2 in our configure file. Ok to apply? Claudiu gcc/ 2017-06-21 Claudiu Zissulescu * configure.ac: Add arc and check if assembler supports gdwarf2. * configure:

New Ukrainian PO file for 'gcc' (version 7.1.0)

2017-07-18 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 Ukrainian team of translators. The file is available at: http://translationproject.org/latest/gcc/uk.po (This file, 'gcc-7.1.0.uk.po', has

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
> I see. But the implementation challenge is that this interacts badly with SSA > coalescing done before this and thus should really happen on GIMPLE before > that. > > And yes, I also like to see more of this, it's basically doing some > instruction > selection on (late) GIMPLE. Ideally we'd

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Richard Biener
On Tue, 18 Jul 2017, Tamar Christina wrote: > > > I see. But the implementation challenge is that this interacts badly with > > SSA > > coalescing done before this and thus should really happen on GIMPLE before > > that. > > > > And yes, I also like to see more of this, it's basically doing

[PATCH] Remove a Java-specific hunk.

2017-07-18 Thread Martin Liška
Hello. After we reverted both hunks in gimplify.c, I've just tested with --enable-languages=all that attached patch works. May I ask you Eric to fix comment in: /* The operand may be a void-valued expression such as SAVE_EXPRs generated by the Java frontend for class

Re: [PATCH PR81408]Turn TREE level unsafe loop optimizations warning to missed optimization message

2017-07-18 Thread Richard Biener
On Tue, Jul 18, 2017 at 11:13 AM, Bin.Cheng wrote: > On Tue, Jul 18, 2017 at 9:31 AM, Richard Biener > wrote: >> On Tue, Jul 18, 2017 at 10:00 AM, Bin Cheng wrote: >>> Hi, >>> I removed unsafe loop optimization on TREE level

Re: [PATCH] Implement std::pointer_traits::to_address as per P0653R0

2017-07-18 Thread Jonathan Wakely
On 16/07/17 17:54 -0400, Glen Fernandes wrote: Implement pointer_traits::to_address as in P0653r0 * include/bits/allocated_ptr.h (allocated_ptr): Use pointer_traits::to_address. * include/bits/ptr_traits.h (pointer_traits): Implement to_address. * include/ext/pointer.h

[AArch64], patch] PR71727 fix -mstrict-align

2017-07-18 Thread Christophe Lyon
Hello, I've received a complaint that GCC for AArch64 would generate vectorized code relying on unaligned memory accesses even when using -mstrict-align. This is a problem for code where such accesses lead to memory faults. A previous patch (r24) introduced

Re: Default std::list default and move constructors

2017-07-18 Thread Jonathan Wakely
On 12/07/17 22:12 +0200, François Dumont wrote: On 05/07/2017 17:22, Jonathan Wakely wrote: It's mostly good, but I'd like to make a few suggestions ... diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index 232885a..7e5 100644 ---

[PATCH] Move fold_div_compare optimization to match.pd (PR tree-optimization/81346)

2017-07-18 Thread Jakub Jelinek
Hi! The following patch moves the fold_div_compare optimization from generic folding only in fold-const.c to match.pd, so that it can be excersized also when optimizing GIMPLE. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-07-18 Jakub Jelinek

Re: [PATCH] PR libstdc++/81064 fix versioned namespace

2017-07-18 Thread Jonathan Wakely
On 18/07/17 14:31 +0100, Jonathan Wakely wrote: On 17/07/17 22:54 +0200, François Dumont wrote: This is quite a huge change, so I'd like to wait and see if anyone else has any opinion on it. Personally I think it's necessary (assuming I understand the PR correctly) and so if nobody objects I

[PATCH] Fix an UBSAN test-case (PR sanitizer/63361).

2017-07-18 Thread Martin Liška
Hello. This should address spotted in the PR, where I basically implemented what I was recommended in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63361#c14. Ready for trunk? Thanks, Martin >From 92ca98e49112cc164739ebd1f1a00bcc13704331 Mon Sep 17 00:00:00 2001 From: marxin

Re: backport nvptx patch to gcc-7-branch

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 02:37:38PM +0200, Tom de Vries wrote: > I'd like to backport this nvptx patch to the gcc-7-branch. > > The patch doesn't trivially fit into the category of regression or > documentation fix. > > Without this patch, when building an nvptx offloading compiler and running >

[PATCH] TYPE_{MIN,MAX}VAL and TYPE_{MIN,MAX}_VALUE

2017-07-18 Thread Nathan Sidwell
We currently have both TYPE_{MIN,MAX}VAL and TYPE_{MIN,MAX}_VALUE pairs of accessors. This is confusing. The former is the tree-agnostic raw field accessor, which I propose renaming TYPE_{MIN,MAX}VAL_RAW, as is common with other raw accessors. The latter pair are for accessing numeric

Re: [PATCH] PR libstdc++/81064 fix versioned namespace

2017-07-18 Thread Jonathan Wakely
On 17/07/17 22:54 +0200, François Dumont wrote: Hi Here is the patch to fix libstdc++ versioned namespace. Now versioned namespace is only at std and __gnu_cxx levels, not anymore in nested namespaces. PR libstdc++/81064 * include/bits/algorithmfwd.h: Reorganize versioned

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-18 Thread H.J. Lu
On Tue, Jul 18, 2017 at 7:09 AM, Alan Modra wrote: > On Tue, Jul 18, 2017 at 05:36:49AM -0700, H.J. Lu wrote: >> I am working on compiling libc.a in glibc with -fPIE and building static >> PIE. This creates static executable with PIE: >> >> gcc -nostdlib -nostartfiles -static

[PATCH] Rename TYPE_{MIN,MAX}VAL

2017-07-18 Thread Nathan Sidwell
As I mentioned in my previous patch, we currently have TYPE_{MIN,MAX}_VALUES for numeric types and TYPE_{MIN,MAX}VAL for type-agnostic access. This patch renames the latter to TYPE_{MIN,MAX}VAL_RAW, matching TYPE_VALUES_RAW, which had a similar problem. While renaming the macros, I

Re: [PATCH] Move fold_div_compare optimization to match.pd (PR tree-optimization/81346)

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 05:21:42PM +0200, Marc Glisse wrote: > On Tue, 18 Jul 2017, Jakub Jelinek wrote: > > > +/* X / C1 op C2 into a simple range test. */ > > +(for cmp (simple_comparison) > > + (simplify > > + (cmp (trunc_div:s @0 INTEGER_CST@1) INTEGER_CST@2) > > + (if (INTEGRAL_TYPE_P

Re: [PATCH] Move fold_div_compare optimization to match.pd (PR tree-optimization/81346)

2017-07-18 Thread Marc Glisse
On Tue, 18 Jul 2017, Jakub Jelinek wrote: +/* X / C1 op C2 into a simple range test. */ +(for cmp (simple_comparison) + (simplify + (cmp (trunc_div:s @0 INTEGER_CST@1) INTEGER_CST@2) + (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) + && integer_nonzerop (@1) + && !TREE_OVERFLOW (@1) +

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Martin Sebor
--- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200 +++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200 @@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1 (cmp @2 @0)) +/* (X - 1U) <= INT_MAX-1U into (int) X

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Marc Glisse
On Tue, 18 Jul 2017, Jakub Jelinek wrote: In the PR Marc noted that the optimization might be useful even for constants other than 1, by transforming x+C1 <= C2 if unsigned and C2-C1==INT_MAX into (int)x > (int)(-1-C1). (int)x >= (int)(-C1) might be easier (and more valid, except that the

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Martin Sebor
On 07/18/2017 09:43 AM, Jakub Jelinek wrote: On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote: --- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200 +++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200 @@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)

[PATCH, PR81464] Handle equal-argument loop exit phi in expand_omp_for_static_chunk

2017-07-18 Thread Tom de Vries
Hi, this patch fixes PR81464, an ICE in ompexpssa. The ICE occurs in expand_omp_for_static_chunk when we're trying to fix up a loop exit phi: ... # .MEM_88 = PHI <.MEM_86(46), .MEM_86(71)> ... It's a loop exit phi with equal arguments, which means that the variable has the same value when

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 10:47:37AM -0600, Martin Sebor wrote: > On 07/18/2017 09:43 AM, Jakub Jelinek wrote: > > On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote: > > > > --- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200 > > > > +++ gcc/match.pd2017-07-18

Re: [PATCH, PR81464] Handle equal-argument loop exit phi in expand_omp_for_static_chunk

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 06:48:56PM +0200, Tom de Vries wrote: > Hi, > > this patch fixes PR81464, an ICE in ompexpssa. > > The ICE occurs in expand_omp_for_static_chunk when we're trying to fix up a > loop exit phi: > ... > # .MEM_88 = PHI <.MEM_86(46), .MEM_86(71)> > ... That is something

Re: [PATCH] match.pd: reassociate multiplications with constants

2017-07-18 Thread Alexander Monakov
On Mon, 17 Jul 2017, Alexander Monakov wrote: > On Mon, 17 Jul 2017, Marc Glisse wrote: > > > +/* Combine successive multiplications. Similar to above, but handling > > > + overflow is different. */ > > > +(simplify > > > + (mult (mult @0 INTEGER_CST@1) INTEGER_CST@2) > > > + (with { > > > +

Re: [PATCH][RFA/RFC] Stack clash mitigation 0/9

2017-07-18 Thread Jeff Law
On 07/13/2017 03:26 AM, Christophe Lyon wrote: > I have executed a validation of your patch series on aarch64 and arm > targets, and I have minor comments. > > On arm, all new tests are unsupported, as expected. Good. > On aarch64-linux, the new tests pass, but they fail on aarch64-elf: > -

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Marc Glisse
On Tue, 18 Jul 2017, Jakub Jelinek wrote: On Tue, Jul 18, 2017 at 05:35:54PM +0200, Marc Glisse wrote: On Tue, 18 Jul 2017, Jakub Jelinek wrote: In the PR Marc noted that the optimization might be useful even for constants other than 1, by transforming x+C1 <= C2 if unsigned and

Re: [PATCH] Add self as maintainer of D front-end and libphobos

2017-07-18 Thread Gerald Pfeifer
On Thu, 13 Jul 2017, Iain Buclaw wrote: >> As per message on the D language being accepted, this adds myself as a >> maintainer of the D front-end and libphobos runtime library. > I may have to request a ping here. I would commit this when the first bits of D go in. (Technically you could

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote: > > --- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200 > > +++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200 > > @@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > > && wi::neg_p (@1, TYPE_SIGN (TREE_TYPE

Re: [PATCH] Implement one optimization from build_range_check in match.pd (PR tree-optimization/81346)

2017-07-18 Thread Jakub Jelinek
On Tue, Jul 18, 2017 at 05:35:54PM +0200, Marc Glisse wrote: > On Tue, 18 Jul 2017, Jakub Jelinek wrote: > > > In the PR Marc noted that the optimization might be useful even for > > constants other than 1, by transforming > > x+C1 <= C2 if unsigned and C2-C1==INT_MAX into (int)x > (int)(-1-C1).

[PATCH] Fix infinite recursion with div-by-zero (PR middle-end/70992)

2017-07-18 Thread Marek Polacek
We ended up in infinite recursion between extract_muldiv_1 and fold_plusminus_mult_expr, because one turns this expression into the other and the other does the reverse: ((2147483648 / 0) * 2) + 2 <-> 2 * (2147483648 / 0 + 1) I tried (unsuccessfully) to fix it in either extract_muldiv_1 or

[PATCH, i386]: Fix PR 81471, ICE in curr_insn_transform

2017-07-18 Thread Uros Bizjak
Hello! Attached patch tightens rorx operand 2 predicate to allow only const_int RTXes that are also allowed by the operand constraint. This prevents combine to propagate unsupported const_ints to the pattern. 2017-07-18 Uros Bizjak PR target/81471 *

Re: [PATCH 1/3] matching tokens: c-family parts

2017-07-18 Thread Marek Polacek
On Tue, Jul 11, 2017 at 11:24:43AM -0400, David Malcolm wrote: > OK for trunk? (assuming the rest is approved) This is ok. I'll have to play with this some more before I approve the C part. Thanks, Marek

Re: [PATCH] Kill TYPE_METHODS debug 1/9

2017-07-18 Thread Jim Wilson
On 07/14/2017 09:48 AM, Nathan Sidwell wrote: This changes dbxout and dwarf2out. Oh, the patch series survived a bootstrap on x86_64-linux. Changes to the debug info files requires a gdb make check with and without the patch to check for regressions. Since you are changing both dbxout

Re: RFC: stack/heap collision vulnerability and mitigation with GCC

2017-07-18 Thread Florian Weimer
* Jeff Law: > On 06/28/2017 12:45 AM, Florian Weimer wrote: >> * Richard Earnshaw: >> >>> I can't help but feel there's a bit of a goode olde mediaeval witch hunt >>> going on here. As Wilco points out, we can never defend against a >>> function that is built without probe operations but skips

Re: [PATCH] PR libstdc++/81064 fix versioned namespace

2017-07-18 Thread François Dumont
On 18/07/2017 16:03, Ville Voutilainen wrote: On 18 July 2017 at 16:31, Jonathan Wakely wrote: This is quite a huge change, so I'd like to wait and see if anyone else has any opinion on it. Personally I think it's necessary (assuming I understand the PR correctly) and so

Re: [PATCH, PR81464] Handle equal-argument loop exit phi in expand_omp_for_static_chunk

2017-07-18 Thread Tom de Vries
On 07/18/2017 06:59 PM, Jakub Jelinek wrote: On Tue, Jul 18, 2017 at 06:48:56PM +0200, Tom de Vries wrote: Hi, this patch fixes PR81464, an ICE in ompexpssa. The ICE occurs in expand_omp_for_static_chunk when we're trying to fix up a loop exit phi: ... # .MEM_88 = PHI <.MEM_86(46),

Re: [PATCH 4/6] lra-assigns.c: give up on qsort checking in assign_by_spills

2017-07-18 Thread Yuri Gribov
On Sat, Jul 15, 2017 at 9:47 PM, Alexander Monakov wrote: > The reload_pseudo_compare_func comparator, when used from assign_by_spills, > can be non-transitive, indicating A < B < C < A if both A and C satisfy > !bitmap_bit_p (_reload_pseudos, rAC), but B does not. > > This

[PATCH 2/2] combine: Fix for PR81423

2017-07-18 Thread Segher Boessenkool
We here have an AND of a SUBREG of an LSHIFTRT. If that SUBREG is paradoxical, the extraction we form is the length of the size of the inner mode, which includes some bits that should not be in the result. Just give up in that case. Tested on powerpc64-linux {-m32,-m64} and on x86_64-linux.

[PATCH 1/2] simplify-rtx: The truncation of an IOR can have all bits set (PR81423)

2017-07-18 Thread Segher Boessenkool
... if it is an IOR with a constant with all bits set in the mode that is truncated to, for example. Handle that case. With this patch the problematic situation for the PR81423 testcase isn't even reached; but the next patch fixes that anyway. Bootstrapped and tested on powerpc64-linux

[PATCH], Update cpu-builtin-1.c test on PowerPC

2017-07-18 Thread Michael Meissner
This patch modifies the change I made on July 12th. It modifies the test for the __builtin_cpu_is and __builtin_cpu_supports built-in functions to use an #ifdef instead of target-requires for doing the tests. One motavation is to make the back port to GCC 6/7 easier, as I won't have to back port

Re: [PATCH] PR libstdc++/81395 fix crash when write follows large read

2017-07-18 Thread Jonathan Wakely
On 19/07/17 01:17 +0100, Jonathan Wakely wrote: This fixes a crash that happens in std::filebuf when a large read consumes the entire get area and is followed by a write, which is then synced to the file by a call to overflow. The problem is that xsgetn calls _M_set_buffer(0) after reading from

libgo patch committed: Ignore ptrace_pseeksiginfo_args from

2017-07-18 Thread Ian Lance Taylor
This patch should fix PR 81324 filed against libgo. With some versions of glibc and GNU/Linux ptrace_pseeksiginfo_args is defined in both and . We don't actually care about the struct, so use a #define to avoid a redefinition error. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.

Re: [PATCH, rs6000] Rev 2, 1/2 Add x86 MMX <mmintrin,h> intrinsics to GCC PPC64LE target

2017-07-18 Thread Segher Boessenkool
Hi! On Mon, Jul 17, 2017 at 02:15:00PM -0500, Steven Munroe wrote: > Correct the problems Segher found in review and added a changes to deal > with the fallout from the __builtin_cpu_supports warning for older > distros. > > Tested on P8 LE and P6/P7/P8 BE. No new tests failures. > >

Re: [PATCH rs6000] Fix up BMI/BMI2 intrinsic DG tests

2017-07-18 Thread Steven Munroe
On Tue, 2017-07-18 at 16:54 -0500, Segher Boessenkool wrote: > Hi! > > On Mon, Jul 17, 2017 at 01:28:20PM -0500, Steven Munroe wrote: > > After a resent GCC change the previously submitted BMI/BMI2 intrinsic > > test started to fail with the following warning/error. > > > >

Go patch committed: Pass correct 'function' flag to circular_pointer_type

2017-07-18 Thread Ian Lance Taylor
The code in Named_type::do_get_backend in the Go frontend was not passing the correct flag value for circular function types to Backend::circular_pointer_type (it was always setting this flag to false). This patch by Than McIntosh passes a true value if the type being converted is a function type.

libgo patch committed: Inline runtime.osinit

2017-07-18 Thread Ian Lance Taylor
Libgo had two identical copies of runtime_osinit. They set runtime_ncpu, a variable that is no longer used. Removing that leaves us with two lines. Inline those two lines in the two places the function was called. This fixes GCC PR 81451. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.

Go patch committed: Insert type conversion for closure function value

2017-07-18 Thread Ian Lance Taylor
This patch by Than McIntosh changes the Go frontend, in Func_expression::do_get_backend, when creating the backend representation for a closure, to create a backend type conversion to account for potential differences between the closure struct type (where the number of fields is dependent on the

Re: [PATCH rs6000] Fix up BMI/BMI2 intrinsic DG tests

2017-07-18 Thread Segher Boessenkool
Hi! On Mon, Jul 17, 2017 at 01:28:20PM -0500, Steven Munroe wrote: > After a resent GCC change the previously submitted BMI/BMI2 intrinsic > test started to fail with the following warning/error. > > ppc_cpu_supports_hw_available122373.c: In function 'main': >

[PATCH] PR libstdc++/81395 fix crash when write follows large read

2017-07-18 Thread Jonathan Wakely
This fixes a crash that happens in std::filebuf when a large read consumes the entire get area and is followed by a write, which is then synced to the file by a call to overflow. The problem is that xsgetn calls _M_set_buffer(0) after reading from the file (i.e. when in 'read' mode). As the

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-18 Thread Alan Modra
On Tue, Jul 18, 2017 at 07:49:48AM -0700, H.J. Lu wrote: > The difference is with --enable-default-pie, the gcc driver doesn't pass > both -pie and -static ld when "-static -pie" is used. Does your change > pass both -pie and -static ld when "-static -pie" is used? Again, as I said in the

[PATCH][RFA/RFC] Stack clash mitigation patch 00/08 V2

2017-07-18 Thread Jeff Law
So later than I wanted, here's the V2 of the stack clash mitigation work. Probably the biggest change in this version was moving the protection out of -fstack-check= and into its own option (-fstack-clash-protection) This has been bootstrapped and regression tested on the same set of targets

[PATCH][RFA/RFC] Stack clash mitigation patch 03/08 V2 -- right patch attached

2017-07-18 Thread Jeff Law
Opps, I clearly attached the wrong file. -- I don't think this patch changed in any significant way since V1. -- One of the painful aspects of all this code is the amount of target dependent bits that have to be written and tested. I didn't want to be scanning assembly code or RTL for

Re: [patch] Fix Unwind support on DragonFly BSD after sigtramp move

2017-07-18 Thread Jeff Law
On 07/07/2017 05:17 PM, John Marino wrote: > Right after DragonFly 4.8 was released (27 Mar 2017), the signal > trampoline was moved (twice) in response to a Ryzen bug. This broke > GCC's unwind support for DragonFly. > > To avoid hardcoding the sigtramp location to avoid issues like this in >

Re: [PING 5] [PATCH] [AArch64] vec_pack_trunc_ should split after register allocator

2017-07-18 Thread Hurugalawadi, Naveen
Hi,   Please consider this as a personal reminder to review the patch at following link and let me know your comments on the same.  https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01334.html Thanks, Naveen    

Re: [PING} [PATCH] Transform (m1 > m2) * d into m1> m2 ? d : 0

2017-07-18 Thread Hurugalawadi, Naveen
Hi,   Please consider this as a personal reminder to review the patch at following link and let me know your comments on the same.   https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00178.html Thanks, Naveen

[PATCH][RFA/RFC] Stack clash mitigation patch 07/08 V2

2017-07-18 Thread Jeff Law
So this patch has changed considerably since V1 as well. First, we no longer track the bulk of the register stores in the prologue. Those may be separately shrink wrapped and thus not executed on all paths and as such are not candidates for implicit probes. Second, per the discussions we've

  1   2   >