Re: [PATCH] 78461 - [7 Regression] ICE: in operator+=, at gimple-ssa-sprintf.c:214

2016-11-23 Thread Richard Biener
On Tue, Nov 22, 2016 at 11:21 PM, Martin Sebor wrote: > With r242674 having enabled the -fprintf-return-value option by > default, when warnings are disabled the gimple-ssa-sprintf pass > is now exercised in ways it was not being tested. One of these > untested use cases exposed a bug in the logi

[patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Eric Botcazou
Hi, this is a wrong code regression at -O2 on the mainline for Alpha coming from the REE pass (Alpha is one of the 3 architectures enabling REE at -O2 but I'm probably going to enable it for 64-bit SPARC too). The problem arises when a copy is needed in combine_reaching_defs: /* If the dest

Re: Fix PR78154

2016-11-23 Thread Prathamesh Kulkarni
On 22 November 2016 at 20:23, Richard Biener wrote: > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > >> On 21 November 2016 at 15:34, Richard Biener wrote: >> > On Fri, 18 Nov 2016, Prathamesh Kulkarni wrote: >> > >> >> On 17 November 2016 at 15:24, Richard Biener wrote: >> >> > On Thu, 17 No

[PATCH] Fix PR78482

2016-11-23 Thread Richard Biener
This fixes a latent issue in cfg-cleanup (mergephi) where merging a forwarder with a loop header can expose a new latch which invalidates any cached number of iteration information. I believe this issue is restricted to _with_phi as otherwise constraints on the PHI node make it impossible to trig

Re: Fix PR78154

2016-11-23 Thread Richard Biener
On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > On 22 November 2016 at 20:23, Richard Biener wrote: > > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > > > >> On 21 November 2016 at 15:34, Richard Biener wrote: > >> > On Fri, 18 Nov 2016, Prathamesh Kulkarni wrote: > >> > > >> >> On 17 Novem

Re: PR78153

2016-11-23 Thread Richard Biener
On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > On 22 November 2016 at 20:53, Richard Biener wrote: > > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > > > >> On 22 November 2016 at 20:18, Richard Biener wrote: > >> > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > >> > > >> >> On 21 Novem

[Patch, testsuite] Fix bogus uninit-19.c failure for avr

2016-11-23 Thread Senthil Kumar Selvaraj
Hi, The below patch fixes uninit-19.c for avr by adding -finline-small-functions for avr. The test fails for avr because fn1 does not get inlined into fn2. Inlining occurs for x86_64 because fn1's computed size equals call_stmt_size. For avr, 32 bit memory moves are more expensive, and

Re: [PATCH] Fix PR31096

2016-11-23 Thread Richard Biener
On Fri, Nov 11, 2016 at 11:19 AM, Hurugalawadi, Naveen wrote: > Hi, > > Sorry for a very late reply as the mail was missed or overlooked. > >>> could now move the test tree_expr_nonzero_p next to >>> tree_expr_nonnegative_p (it is redundant for the last case). > > Done. > >>> Often just a commen

[patch] Fix PR middle-end/78429

2016-11-23 Thread Eric Botcazou
* gcc.c-torture/compile/20161123-1.c: New test. -- Eric Botcazou/* PR middle-end/78429 */ /* Testcase by Chengnian Sun */ int a[6]; char b; unsigned c; short d; volatile int e; int foo (void) { int f; for (; c <= 2; c++) { d = 3; for (; d >= 0; d--) { int

[PATCH] i386.c: Initialize function pointers to NULL to prevent, -Wmaybe-uninitialized

2016-11-23 Thread Martin Liška
I see broken bootstrap due to: .././../gcc/config/i386/i386.c: In function ‘rtx_def* ix86_expand_builtin(tree, rtx, rtx, machine_mode, int)’: .././../gcc/config/i386/i386.c:38407:18: error: ‘fcn’ may be used uninitialized in this function [-Werror=maybe-uninitialized] emit_insn (fcn (tar

Re: [PATCH] i386.c: Initialize function pointers to NULL to prevent, -Wmaybe-uninitialized

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 11:06:23AM +0100, Martin Liška wrote: > I see broken bootstrap due to: > > .././../gcc/config/i386/i386.c: In function ‘rtx_def* > ix86_expand_builtin(tree, rtx, rtx, machine_mode, int)’: > .././../gcc/config/i386/i386.c:38407:18: error: ‘fcn’ may be used > uninitialized

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Paolo Bonzini
On 23/11/2016 10:35, Eric Botcazou wrote: > I now wonder > whether this also matters for !WORD_REGISTER_OPERATIONS targets, e.g. x86: > > (set (reg1:DI) ... > ... >(set (reg1:QI) (expression:QI)) >... >(set (reg2:DI) (any_extend:DI (reg1:QI))) >

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Uros Bizjak
Hello! > I initially thought that this would only matter for WORD_REGISTER_OPERATIONS > targets like Alpha, where the first set in QImode can implicitly set the whole > DImode register so the use reads well-defined upper bits, but I now wonder > whether this also matters for !WORD_REGISTER_OPERATI

Re: [PATCH] i386.c: Initialize function pointers to NULL to prevent, -Wmaybe-uninitialized

2016-11-23 Thread Martin Liška
On 11/23/2016 11:12 AM, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 11:06:23AM +0100, Martin Liška wrote: >> I see broken bootstrap due to: >> >> .././../gcc/config/i386/i386.c: In function ‘rtx_def* >> ix86_expand_builtin(tree, rtx, rtx, machine_mode, int)’: >> .././../gcc/config/i386/i386.c:3

Re: [PR78365] ICE in determine_value_range, at tree-ssa-loo p-niter.c:413

2016-11-23 Thread Richard Biener
On Fri, Nov 18, 2016 at 2:38 AM, kugan wrote: > Hi, > > I was relying on ipa_get_callee_param_type to get type of parameter and then > convert arguments to this type while computing jump functions. However, in > cases like shown in PR78365, ipa_get_callee_param_type, instead of giving > up, would

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Eric Botcazou
> Does it really do that with a (set (reg1:QI)), as opposed to a > (set (strict_low_part (subreg:QI (reg1:DI)))? That's the question (note that REE runs after register allocation). -- Eric Botcazou

Re: [PATCH GCC]Move simplification from fold-cond.c to match.pd and extend it

2016-11-23 Thread Richard Biener
On Fri, Nov 18, 2016 at 11:20 AM, Bin Cheng wrote: > Hi, > This is a rework of https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02005.html. > According to review comment, I extended the original patch and made it > covering last kind simplification of fold_cond_expr_with_comparison (Well, > this

[PATCH] Fill bitregion_{start,end} in store_constructor (PR, tree-optimization/78428).

2016-11-23 Thread Martin Liška
Following patch fixes situation where we do a store to a bitfield which is at boundary of a record. This leads to usage of wider store, leading to overwriting a following memory location. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Apart from that, the reported test-

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Paolo Bonzini
On 23/11/2016 11:26, Eric Botcazou wrote: >> Does it really do that with a (set (reg1:QI)), as opposed to a >> (set (strict_low_part (subreg:QI (reg1:DI)))? > > That's the question (note that REE runs after register allocation). IIRC, strict_low_part is required even after register allocation,

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Eric Botcazou
> Please note that there is no guarantee that "(set (reg1:QI) > (expression:QI))" will preserve high-order bits. This is guaranteed > only when strict_low_part is used on the destination operand. > > C.f. *addqi_1 pattern, where QImode plus RTX can emit SImode ADDL insn > vs. *addqi_1_slp, where Q

Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Richard Biener
On Fri, Nov 18, 2016 at 5:53 PM, Bin Cheng wrote: > Hi, > This is a follow up patch for > https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01898.html > It moves remaining simplification for (A == C1) ? A : C2 in > fold_cond_expr_with_comparison > to match.pd. Bootstrap and test on x86_64 and AArch

Re: [PATCH] [AArch64] Fix PR77634

2016-11-23 Thread Richard Earnshaw (lists)
On 23/11/16 05:25, Hurugalawadi, Naveen wrote: > Hi, > > Please find attached the patch that fixes PR77634. > > Some testcase does not use -fno-vect-cost-model and hence fails when gcc is > configured "--with-cpu=thunderx". > The attached patch modifies the testcases to use -fno-vect-cost-model.

Re: [PATCH] [AArch64] Fix PR77635

2016-11-23 Thread Richard Earnshaw (lists)
On 23/11/16 05:25, Hurugalawadi, Naveen wrote: > Hi, > > Please find attached the patch that fixes PR77635. > > Some load pair testcase fails when gcc is configured "--with-cpu=thunderx" > as -mcpu=generic is missed out in them. > The attached patch modifies the testcases to use -mcpu=generic. >

Re: [PATCH GCC]Move simplification from fold-cond.c to match.pd and extend it

2016-11-23 Thread Bin.Cheng
On Wed, Nov 23, 2016 at 10:29 AM, Richard Biener wrote: > On Fri, Nov 18, 2016 at 11:20 AM, Bin Cheng wrote: >> Hi, >> This is a rework of >> https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02005.html. According to >> review comment, I extended the original patch and made it covering last kind

[PATCH, GCC] Fix PR77673: bswap loads passed end of object

2016-11-23 Thread Thomas Preudhomme
Hi, In its current form, when the bswap optimization pass recognizes a load in a specific endianness it assumes that all smaller loads in the original expression are part of a linear chain of basic block (ie they are either in the same basic block or there is no conditional branching in the bl

[PATCH, GCC] Improve comment for struct symbolic_number in bswap pass

2016-11-23 Thread Thomas Preudhomme
Hi, The current comment for struct symbolic_number in the bswap pass code (tree-ssa-math-opts.c) does not explain all of the fields in the structure. It is also a bit unclear at times. This patch rewrites the comment to fix those. Note: it depends on the fix for PR77673 to be installed first.

Re: [PATCH] Fill bitregion_{start,end} in store_constructor (PR, tree-optimization/78428).

2016-11-23 Thread Richard Biener
On Wed, Nov 23, 2016 at 11:26 AM, Martin Liška wrote: > Following patch fixes situation where we do a store to a bitfield which > is at boundary of a record. This leads to usage of wider store, leading > to overwriting a following memory location. > > Patch can bootstrap on ppc64le-redhat-linux an

Re: [PATCH GCC]Move simplification from fold-cond.c to match.pd and extend it

2016-11-23 Thread Richard Biener
On Wed, Nov 23, 2016 at 11:40 AM, Bin.Cheng wrote: > On Wed, Nov 23, 2016 at 10:29 AM, Richard Biener > wrote: >> On Fri, Nov 18, 2016 at 11:20 AM, Bin Cheng wrote: >>> Hi, >>> This is a rework of >>> https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02005.html. According to >>> review comment, I

Re: [PATCH GCC]Move simplification from fold-cond.c to match.pd and extend it

2016-11-23 Thread Bin.Cheng
On Wed, Nov 23, 2016 at 10:51 AM, Richard Biener wrote: > On Wed, Nov 23, 2016 at 11:40 AM, Bin.Cheng wrote: >> On Wed, Nov 23, 2016 at 10:29 AM, Richard Biener >> wrote: >>> On Fri, Nov 18, 2016 at 11:20 AM, Bin Cheng wrote: Hi, This is a rework of https://gcc.gnu.org/ml/gcc-pa

Re: [PATCH GCC]Move simplification from fold-cond.c to match.pd and extend it

2016-11-23 Thread Richard Biener
On Wed, Nov 23, 2016 at 12:04 PM, Bin.Cheng wrote: > On Wed, Nov 23, 2016 at 10:51 AM, Richard Biener > wrote: >> On Wed, Nov 23, 2016 at 11:40 AM, Bin.Cheng wrote: >>> On Wed, Nov 23, 2016 at 10:29 AM, Richard Biener >>> wrote: On Fri, Nov 18, 2016 at 11:20 AM, Bin Cheng wrote: > Hi,

Re: [PATCH] Fix PR78472

2016-11-23 Thread Richard Biener
On Tue, 22 Nov 2016, Richard Biener wrote: > > The following fixes a C/C++ interoperability issue with LTO when > zero-sized fields appear in one variant of a struct but not in another. > > Bootstrap & regtest in progress on x86_64-unknown-linux-gnu. This is what I have applied. Richard. 2016

[PATCH] S/390: Fix litpool-r3-1.c.

2016-11-23 Thread Dominik Vogt
The attached patch fixes a bad regexp in the s390 specific test lipool-r2-1.c. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany gcc/ChangeLog-lp1 * gcc.target/s390/litpool-r3-1.c: Fix label number test. >From a4fff946a0158cf5a9c3da838d5fc2e8cc80ef31 Mon Sep 17 00:00:00 2001 From: Dom

Re: [PATCH] Fix PR71762

2016-11-23 Thread Richard Biener
On Thu, 10 Nov 2016, Richard Biener wrote: > On November 10, 2016 7:39:57 PM GMT+01:00, Marc Glisse > wrote: > >On Thu, 10 Nov 2016, Richard Biener wrote: > > > >> The following fixes PR71762 via reverting the transforms of > >> ~X & Y to X < Y and similar because when the bools they apply to >

Re: [patch] Fix PR middle-end/78429

2016-11-23 Thread Richard Biener
(wi::fits_to_boolean_p): New predicate. > (wi::fits_to_tree_p): Use it for boolean types. > * tree.c (int_fits_type_p): Likewise. > > > 2016-11-23 Eric Botcazou > > * gcc.c-torture/compile/20161123-1.c: New test. > > -- > Eric Botcazou

Re: PR78153

2016-11-23 Thread Prathamesh Kulkarni
On 23 November 2016 at 15:16, Richard Biener wrote: > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > >> On 22 November 2016 at 20:53, Richard Biener wrote: >> > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: >> > >> >> On 22 November 2016 at 20:18, Richard Biener wrote: >> >> > On Tue, 22 No

Re: [PATCH][PPC] Fix ICE using power9 with soft-float

2016-11-23 Thread Andrew Stubbs
On 16/11/16 17:05, Michael Meissner wrote: I'm starting to test this patch right now (it's on LE power8 stage3 right now, and I need to build BE power8 and BE power7 versions when I get into the office shortly, and build spec 2017 with it for PR 78101): Did the testing go OK? Andrew

Re: PR78153

2016-11-23 Thread Richard Biener
On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > On 23 November 2016 at 15:16, Richard Biener wrote: > > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > > > >> On 22 November 2016 at 20:53, Richard Biener wrote: > >> > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > >> > > >> >> On 22 Novem

Re: [PATCHv2 4/7, GCC, ARM, V8M] ARMv8-M Security Extension's cmse_nonsecure_entry: clear registers

2016-11-23 Thread Andre Vieira (lists)
Hi, After some extra testing I realized there was an issue with the way we were clearing registers when returning from a cmse_nonsecure_entry function for ARMv8-M.Baseline. This patch fixes that and changes the testcase to catch the issue. The problem was I was always using LR to clear the regis

Re: [PATCHv2 6/7, GCC, ARM, V8M] ARMv8-M Security Extension's cmse_nonsecure_call: use __gnu_cmse_nonsecure_call

2016-11-23 Thread Andre Vieira (lists)
On 11/11/16 16:19, Kyrill Tkachov wrote: > And CC'ing Ramana and Richard this time... > Hi, After some extra testing I found that the sibcall optimization was not disabled for calls to function pointers with the cmse_nonsecure_call attribute, causing the clearing and call to the function wrapper

Re: PR78153

2016-11-23 Thread Prathamesh Kulkarni
On 23 November 2016 at 17:21, Richard Biener wrote: > On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > >> On 23 November 2016 at 15:16, Richard Biener wrote: >> > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: >> > >> >> On 22 November 2016 at 20:53, Richard Biener wrote: >> >> > On Tue, 22 No

Re: PR78153

2016-11-23 Thread Richard Biener
On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > On 23 November 2016 at 17:21, Richard Biener wrote: > > On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > > > >> On 23 November 2016 at 15:16, Richard Biener wrote: > >> > On Tue, 22 Nov 2016, Prathamesh Kulkarni wrote: > >> > > >> >> On 22 Novem

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 11:18 AM, Paolo Bonzini wrote: On 23/11/2016 10:35, Eric Botcazou wrote: I now wonder whether this also matters for !WORD_REGISTER_OPERATIONS targets, e.g. x86: (set (reg1:DI) ... ... (set (reg1:QI) (expression:QI)) ... (set (reg2:DI)

Fix pr78390: bootstrap on ia64 and s390x (with zEC12)

2016-11-23 Thread Michael Matz
Hi, as the bug trail explains make_extraction is claiming but failing to handle extractions that would go outside the underlying object. So, let's not construct such, as the patch does. Dominik tested s390x bootstrap being recovered with this, Andreas ia64 bootstrap, and I regstrapped this on

Re: Fix pr78390: bootstrap on ia64 and s390x (with zEC12)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 02:26:49PM +0100, Michael Matz wrote: > Hi, > > as the bug trail explains make_extraction is claiming but failing to > handle extractions that would go outside the underlying object. So, let's > not construct such, as the patch does. > > Dominik tested s390x bootstrap b

[SPARC] Small tweaks to 32-bit shift patterns in 64-bit mode

2016-11-23 Thread Eric Botcazou
For example, a couple of them were rejecting constant integers, leading to suboptimal code before function returns in some cases. Tested on SPARC/Solaris, applied on the mainline. 2016-11-23 Eric Botcazou * config/sparc/sparc.md (*ashrsi3_extend): Rename to... (*ashrsi3_exte

Re: [PATCH] Fix ICE with -Wuninitialized (PR tree-optimization/78455)

2016-11-23 Thread Christophe Lyon
Hi Marek, On 22 November 2016 at 01:02, Marek Polacek wrote: > What seems like a typo caused an ICE here. We've got a vector of vectors here > and we're trying to walk all the elements, so the second loop oughta use 'j'. > > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > 2016-11-21

Re: [Aarch64][PATCH] Improve Logical And Immediate Expressions

2016-11-23 Thread Christophe Lyon
Hi Michael, On 21 November 2016 at 10:52, James Greenhalgh wrote: > On Fri, Nov 18, 2016 at 07:41:58AM +, Michael Collison wrote: >> James, >> >> I incorporated all your suggestions, and successfully bootstrapped and re-ran >> the testsuite. >> >> Okay for trunk? >> >> 2016-11-18 Michael Co

Re: Fix pr78390: bootstrap on ia64 and s390x (with zEC12)

2016-11-23 Thread Michael Matz
Hi, On Wed, 23 Nov 2016, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 02:26:49PM +0100, Michael Matz wrote: > > Hi, > > > > as the bug trail explains make_extraction is claiming but failing to > > handle extractions that would go outside the underlying object. So, let's > > not construct su

[PATCH GCC]Refine type conversion in result expressions for cond_expr pattern

2016-11-23 Thread Bin Cheng
Hi, This is actually the review suggestion for patch @https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02341.html, but I forgot to incorporate it when committing that patch. Here comes this one doing that, as well as adding a missing convert keyword. Toolchain built successfully, is it OK? Than

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-23 Thread Martin Liška
I started review process in libsanitizer: https://reviews.llvm.org/D26965 And I have a question that was asked in the review: can we distinguish between load and store in case of having usage of ASAN_POISON? Load looks as follows: int main (int argc, char **argv) { char *ptr; if (argc != 12

Re: [PATCH] Don't use priority {cd}tors if not supported by a target (PR, gcov-profile/78086)

2016-11-23 Thread Martin Liška
PING^2 On 11/14/2016 01:12 PM, Martin Liška wrote: > PING^1 > > On 10/31/2016 01:13 PM, Martin Liška wrote: >> On 10/31/2016 11:07 AM, Rainer Orth wrote: >>> Hi Martin, >>> Using priority {cd}tors on a target that does not support that can cause failures (see the PR). Apart from th

Re: [C++ PATCH] Fix ICE during VEC_INIT_EXPR gimplification (PR c++/77739)

2016-11-23 Thread Jason Merrill
On Tue, Nov 22, 2016 at 3:45 PM, Jakub Jelinek wrote: > As mentioned in the PR, another option I see is special case > REFERENCE_REF_P INDIRECT_REFs and MEM_REFs into which they are gimplified > in cp_genericize_r by not changing is_invisiref_parm decls if they are > already wrapped in those. Tha

Re: [RFC][PATCH] Speed-up use-after-scope (re-writing to SSA)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 02:57:07PM +0100, Martin Liška wrote: > I started review process in libsanitizer: https://reviews.llvm.org/D26965 > And I have a question that was asked in the review: can we distinguish > between load and store > in case of having usage of ASAN_POISON? I think with ASAN_P

Re: [PATCH][AArch64] PR target/78362: Make sure to only take REGNO of a register

2016-11-23 Thread Kyrill Tkachov
Ping. https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01664.html Thanks, Kyrill On 16/11/16 16:57, Kyrill Tkachov wrote: Hi all, As the PR says we have an RTL checking failure that occurs when building libgcc for aarch64. The expander code for addsi3 takes the REGNO of a SUBREG in operands[1].

[PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)

2016-11-23 Thread Segher Boessenkool
r242414, for PR77881, introduces some bugs (PR78390, PR78438, PR78477). It all has the same root cause: that patch makes combine convert every lowpart subreg of a logical shift right to a zero_extract. This cannot work at all if it is not a constant shift, and it has to be a bit more careful exact

Re: [PATCH GCC]Refine type conversion in result expressions for cond_expr pattern

2016-11-23 Thread Richard Biener
On Wed, Nov 23, 2016 at 2:54 PM, Bin Cheng wrote: > Hi, > This is actually the review suggestion for patch > @https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02341.html, but I forgot to > incorporate it when committing that patch. Here comes this one doing that, > as well as adding a missing con

Re: Fix pr78390: bootstrap on ia64 and s390x (with zEC12)

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 02:45:23PM +0100, Michael Matz wrote: > > Shouldn't new_rtx be set to NULL_RTX if that condition is false? Otherwise > > it will be whatever make_compound_operation returned. What about the break? > > Shouldn't that be done only if the condition is true too? > > Hmm? The

Re: [C++ PATCH] Fix ICE during VEC_INIT_EXPR gimplification (PR c++/77739)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 09:11:02AM -0500, Jason Merrill wrote: > On Tue, Nov 22, 2016 at 3:45 PM, Jakub Jelinek wrote: > > As mentioned in the PR, another option I see is special case > > REFERENCE_REF_P INDIRECT_REFs and MEM_REFs into which they are gimplified > > in cp_genericize_r by not changi

Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Marc Glisse
On Fri, 18 Nov 2016, Bin Cheng wrote: +(for cmp (lt le gt ge) + (simplify + (cond (cmp@0 (convert1? @1) INTEGER_CST@3) (convert2? @1) INTEGER_CST@2) + (with + { + tree from_type = TREE_TYPE (@1); + tree c1_type = TREE_TYPE (@3), c2_type = TREE_TYPE (@2); + enum tree_code code = TR

[PATCH] PR78494 add missing returns to propagate_const

2016-11-23 Thread Jonathan Wakely
2016-11-23 Felix Morgner Jonathan Wakely PR libstdc++/78494 * include/experimental/propagate_const (propagate_const::operator=): Add missing return statements. * testsuite/experimental/propagate_const/assignment/move_neg.cc: Adjust dg-error

Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Bin.Cheng
On Wed, Nov 23, 2016 at 2:40 PM, Marc Glisse wrote: > On Fri, 18 Nov 2016, Bin Cheng wrote: > > +(for cmp (lt le gt ge) > + (simplify > + (cond (cmp@0 (convert1? @1) INTEGER_CST@3) (convert2? @1) INTEGER_CST@2) > + (with > + { > + tree from_type = TREE_TYPE (@1); > + tree c1_type = TRE

Set mode of decimal floats before calling layout_type

2016-11-23 Thread Richard Sandiford
Previously decimal floating-point types were created and laid out as binary floating-point types, then the caller changed the mode to a decimal mode later. The problem with that approach is that not all targets support an equivalent binary floating-point mode. When they didn't, we would give the

Re: [PATCH GCC]Refine type conversion in result expressions for cond_expr pattern

2016-11-23 Thread Bin.Cheng
On Wed, Nov 23, 2016 at 2:27 PM, Richard Biener wrote: > On Wed, Nov 23, 2016 at 2:54 PM, Bin Cheng wrote: >> Hi, >> This is actually the review suggestion for patch >> @https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02341.html, but I forgot to >> incorporate it when committing that patch. Here

[C++ PATCH] Fix error recovery (PR c++/71450)

2016-11-23 Thread Jakub Jelinek
Hi! Is there a reason why we don't return error_mark_node no matter what complain contains? At least on the testcase if we don't return error_mark_node for the uses of var before deduction of auto, then we ICE later on in some assertion that expects sane types on the variables. On the other testc

Re: [PATCH] PR78494 add missing returns to propagate_const

2016-11-23 Thread Jonathan Wakely
On 23/11/16 14:45 +, Jonathan Wakely wrote: PR libstdc++/78494 Oops, that should have been 78490

[C++ PATCH] Fix wrong-code on var construction in static init (PR c++/77907)

2016-11-23 Thread Jakub Jelinek
Hi! During cp_fold, we see a call to constructor and because the ctor is DECL_DECLARED_CONSTEXPR_P, when optimizing we call maybe_constant_value on it. But as when evaluating that we don't have an object, it returns the initializer of the var, rather than an assignment of the initializer to the v

Re: [PATCH] Add sem_item::m_hash_set (PR ipa/78309) (v2)

2016-11-23 Thread Martin Liška
On 11/21/2016 04:50 PM, Jan Hubicka wrote: > OK, > thanks! > Honza Hi. Patch to trunk is already installed. Equal patch can be installed to gcc-6 branch, however gcc-5 branch needs more hunks to be adjusted. I did so, both patches survive regression tests and the patch for gcc-5 provides equal

Re: [PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)

2016-11-23 Thread Michael Matz
Hi, On Wed, 23 Nov 2016, Segher Boessenkool wrote: > r242414, for PR77881, introduces some bugs (PR78390, PR78438, PR78477). > It all has the same root cause: that patch makes combine convert every > lowpart subreg of a logical shift right to a zero_extract. This cannot > work at all if it is no

[PATCH] Replace unsupported effective-target with dg-options

2016-11-23 Thread Jonathan Wakely
I accidentally backported tests using { target c++11 } to the branch, but that only works on trunk. One test was also using C++14-only features, but is meant to be valid in C++11. * testsuite/24_iterators/reverse_iterator/71771.cc: Replace calls to C++14 std::rbeing and std::rend.

Re: [PATCH] Replace unsupported effective-target with dg-options

2016-11-23 Thread Jonathan Wakely
On 23/11/16 15:25 +, Jonathan Wakely wrote: I accidentally backported tests using { target c++11 } to the branch, but that only works on trunk. One test was also using C++14-only features, but is meant to be valid in C++11. Also committed this version to gcc-5-branch. commit 597074d529972

Re: [PR78365] ICE in determine_value_range, at tree-ssa-loo p-niter.c:413

2016-11-23 Thread Martin Jambor
Hi, On Fri, Nov 18, 2016 at 12:38:18PM +1100, kugan wrote: > Hi, > > I was relying on ipa_get_callee_param_type to get type of parameter and then > convert arguments to this type while computing jump functions. However, in > cases like shown in PR78365, ipa_get_callee_param_type, instead of givin

Re: [PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 04:24:37PM +0100, Michael Matz wrote: > > r242414, for PR77881, introduces some bugs (PR78390, PR78438, PR78477). > > It all has the same root cause: that patch makes combine convert every > > lowpart subreg of a logical shift right to a zero_extract. This cannot > > work a

Re: [C++ PATCH] Fix error recovery (PR c++/71450)

2016-11-23 Thread Jason Merrill
On Wed, Nov 23, 2016 at 9:56 AM, Jakub Jelinek wrote: > Is there a reason why we don't return error_mark_node no matter what > complain contains? In some cases, outside of SFINAE context we can give an error and then continue to do something reasonable. > At least on the testcase if we don't ret

Re: [C++ PATCH] Fix wrong-code on var construction in static init (PR c++/77907)

2016-11-23 Thread Jason Merrill
OK, but I wonder why we don't do constant initialization of that variable... On Wed, Nov 23, 2016 at 9:59 AM, Jakub Jelinek wrote: > Hi! > > During cp_fold, we see a call to constructor and because the ctor > is DECL_DECLARED_CONSTEXPR_P, when optimizing we call maybe_constant_value > on it. But

Re: [C++ PATCH] Fix ICE during VEC_INIT_EXPR gimplification (PR c++/77739)

2016-11-23 Thread Jason Merrill
On Wed, Nov 23, 2016 at 9:31 AM, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 09:11:02AM -0500, Jason Merrill wrote: >> On Tue, Nov 22, 2016 at 3:45 PM, Jakub Jelinek wrote: >> > As mentioned in the PR, another option I see is special case >> > REFERENCE_REF_P INDIRECT_REFs and MEM_REFs into wh

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Georg-Johann Lay
Hi, this causes an illegal code issue on avr. Test case (reduced from gcc.dg/builtins-32.c): extern int signbitf (float); int test (float x) { return signbitf (x); } Before combine, the dump reads (note 4 0 19 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn 19 4 3 2 (set (reg:QI 51 [ x+3 ]) (

Re: [PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)

2016-11-23 Thread Michael Matz
Hi, On Wed, 23 Nov 2016, Segher Boessenkool wrote: > > Even with non-constant shifts it remains an extract and make_extraction > > does support variable start positions (which is the shift amount), as does > > the zero_extract pattern (depending on target of course). > > Sure, but the extracti

[PATCH] Fix PR bootstrap/78493

2016-11-23 Thread Martin Liška
Hello. As described in the PR, the patch fixes profiled bootstrap on x86_64-linux-gnu. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. And profiled bootstrap on x86_64-linux-gnu finishes successfully. Ready to be installed? Martin >From 8b7cd9a83cd14f7a15f39e105ccd78e1

RE: [Aarch64][PATCH] Improve Logical And Immediate Expressions

2016-11-23 Thread Michael Collison
Hi Christophe, This is not a regression per se; the patch causes the test case to generate one less instruction overall, but one additional 'and'. Trunk before the patch (-O2): foo: and w0, w0, 255 lsl w1, w0, 20 orr w0, w1, w0, lsl 8 mov w1, 6502

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 04:58:22PM +0100, Georg-Johann Lay wrote: > Hi, this causes an illegal code issue on avr. Sorry about that. [ snip ] > Trying 19 -> 7: > Failed to match this instruction: > (set (reg:HI 45 [ x+3 ]) > (zero_extend:HI (reg:QI 25 r25 [ x+3 ]))) > Successfully matched thi

Re: [C++ PATCH] Fix wrong-code on var construction in static init (PR c++/77907)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 10:42:57AM -0500, Jason Merrill wrote: > OK, but I wonder why we don't do constant initialization of that variable... Dunno either, check_initializer simply returns the call to the constructor for the var. I've tried something like: --- gcc/cp/decl.c.jj2016-11-21 19:4

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Georg-Johann Lay
Segher Boessenkool schrieb: On Wed, Nov 23, 2016 at 04:58:22PM +0100, Georg-Johann Lay wrote: Hi, this causes an illegal code issue on avr. Sorry about that. [ snip ] Trying 19 -> 7: Failed to match this instruction: (set (reg:HI 45 [ x+3 ]) (zero_extend:HI (reg:QI 25 r25 [ x+3 ]))) Suc

Re: [Patch v4 0/17] Add support for _Float16 to AArch64 and ARM

2016-11-23 Thread James Greenhalgh
On Mon, Nov 21, 2016 at 09:19:35AM +, Kyrill Tkachov wrote: > > On 18/11/16 18:19, James Greenhalgh wrote: > >On Fri, Nov 11, 2016 at 03:37:17PM +, James Greenhalgh wrote: > >>Hi, > >> > >>This patch set enables the _Float16 type specified in ISO/IEC TS 18661-3 > >>for AArch64 and ARM. The

Re: Tighten check for whether a sibcall references local variables

2016-11-23 Thread Richard Sandiford
Richard Biener writes: > On Tue, Nov 22, 2016 at 10:00 AM, Richard Sandiford > wrote: >> This loop: >> >> /* Make sure the tail invocation of this function does not refer >> to local variables. */ >> FOR_EACH_LOCAL_DECL (cfun, idx, var) >> { >> if (TREE_CODE (var) != PARM_DECL

Re: [PATCH] Fix PR71762

2016-11-23 Thread Bernd Schmidt
On 11/10/2016 02:28 PM, Richard Biener wrote: Any takers for the RTL implementation? Do you have a testcase you think can be optimized? Bernd

Re: [PATCH] Add map clauses to libgomp test device-3.f90

2016-11-23 Thread Jakub Jelinek
On Tue, Nov 15, 2016 at 08:01:32PM +0300, Alexander Monakov wrote: > On Tue, 15 Nov 2016, Alexander Monakov wrote: > > Yep, I do see new test execution failures with both Intel MIC and PTX > > offloading > > on device-1.f90, device-3.f90 and target2.f90. Here's an actually-tested > > patch > > f

Re: [PATCH] Fix PR71762

2016-11-23 Thread Richard Biener
On November 23, 2016 6:25:43 PM GMT+01:00, Bernd Schmidt wrote: >On 11/10/2016 02:28 PM, Richard Biener wrote: >> Any takers for the RTL implementation? > >Do you have a testcase you think can be optimized? The forwrop test case I XFAILed with the patch. Richard. > >Bernd

Fix ia64 builds

2016-11-23 Thread Jeff Law
The recent rtx_insn * changes mucked up ia64 in a trivial way. The definition of ia64_emit_insn_before was changed, but not the prototype. This results in a build error. Fixed in the obvious way. Applying to the trunk. Jeff commit f491be0d30b8e0063e54972497b8e049482f03b8 Author: law Date:

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Jeff Law
On 11/23/2016 05:26 AM, Bernd Schmidt wrote: On 11/23/2016 11:18 AM, Paolo Bonzini wrote: On 23/11/2016 10:35, Eric Botcazou wrote: I now wonder whether this also matters for !WORD_REGISTER_OPERATIONS targets, e.g. x86: (set (reg1:DI) ... ... (set (reg1:QI) (expression

Re: PR78153

2016-11-23 Thread Prathamesh Kulkarni
On 23 November 2016 at 17:51, Richard Biener wrote: > On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > >> On 23 November 2016 at 17:21, Richard Biener wrote: >> > On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: >> > >> >> On 23 November 2016 at 15:16, Richard Biener wrote: >> >> > On Tue, 22 No

Fix iq2000 builds

2016-11-23 Thread Jeff Law
The XXX in boolean context warning is now triggering on a bit of code in the iq2000 backend. I'm trying to guess Stan's intent from 2003. If I've got it wrong, the worst that happens in an incorrect cost computation. Installing on the trunk. Jeff commit 6ed89ddbdbbde3ffd42b2ab6fad61a76e85

[PATCH, rs6000] Fix PR78458, LRA ICE building libgcc for powerpc-linux-gnuspe e500v2

2016-11-23 Thread Peter Bergner
PR78458 shows a problem in LRA spilling caused by HARD_REGNO_CALLER_SAVE_MODE() returning a bogus mode (IFmode). This patch solves the problem by just returning MODE if MODE is wide enough to save and restore NREGS itself. This patch passed bootstrap and regtesting on powerpc64le-linux as well as

And fix the mcore port too

2016-11-23 Thread Jeff Law
Another prototype that didn't get fixed in the rtx_insn * changes. Installing on the trunk as obvious. Jeff commit 9fb780b14647e3c0d4232029b9f1b7d6de6103d6 Author: Jeff Law Date: Wed Nov 23 11:15:03 2016 -0700 * config/mcore/mcore.c (emit_new_cond_insn): Fix prototype. diff --git a

Re: [C++ PATCH] Fix wrong-code on var construction in static init (PR c++/77907)

2016-11-23 Thread Jason Merrill
On Wed, Nov 23, 2016 at 11:36 AM, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 10:42:57AM -0500, Jason Merrill wrote: >> OK, but I wonder why we don't do constant initialization of that variable... > > Dunno either, check_initializer simply returns the call to the constructor > for the var. I'v

Re: [Patch 14/17] [libgcc, ARM] Generalise float-to-half conversion function.

2016-11-23 Thread James Greenhalgh
On Wed, Nov 16, 2016 at 04:38:17PM +, Kyrill Tkachov wrote: > Hi James, > diff --git a/libgcc/config/arm/fp16.c b/libgcc/config/arm/fp16.c > index 39c863c..ba89796 100644 > --- a/libgcc/config/arm/fp16.c > +++ b/libgcc/config/arm/fp16.c > @@ -22,40 +22,74 @@ > see the files COPYING3 and COP

Re: [Patch 16/17 libgcc ARM] Half to double precision conversions

2016-11-23 Thread James Greenhalgh
On Wed, Nov 16, 2016 at 04:00:12PM +, Kyrill Tkachov wrote: > <...> > > diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md > index 8393f65..4074773 100644 > --- a/gcc/config/arm/arm.md > +++ b/gcc/config/arm/arm.md > @@ -5177,20 +5177,35 @@ >"" > ) > -;; DFmode to HFmode conversio

Re: Tighten check for whether a sibcall references local variables

2016-11-23 Thread Jeff Law
On 11/23/2016 10:09 AM, Richard Sandiford wrote: Richard Biener writes: On Tue, Nov 22, 2016 at 10:00 AM, Richard Sandiford wrote: This loop: /* Make sure the tail invocation of this function does not refer to local variables. */ FOR_EACH_LOCAL_DECL (cfun, idx, var) { if

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Jeff Law
On 11/23/2016 09:53 AM, Georg-Johann Lay wrote: Segher Boessenkool schrieb: On Wed, Nov 23, 2016 at 04:58:22PM +0100, Georg-Johann Lay wrote: Hi, this causes an illegal code issue on avr. Sorry about that. [ snip ] Trying 19 -> 7: Failed to match this instruction: (set (reg:HI 45 [ x+3 ])

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process -- the key being each one re-computes the internal state which might get expensive. Wouldn

Re: [PATCH] Fix PR bootstrap/78493

2016-11-23 Thread Jeff Law
On 11/23/2016 09:13 AM, Martin Liška wrote: Hello. As described in the PR, the patch fixes profiled bootstrap on x86_64-linux-gnu. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. And profiled bootstrap on x86_64-linux-gnu finishes successfully. Ready to be installed?

  1   2   >