Re: Fix ICE in use-after-scope w/ -fno-tree-dce (PR, sanitize/79783).

2017-03-06 Thread Jakub Jelinek
On Mon, Mar 06, 2017 at 08:59:09AM +0100, Martin Liška wrote: > >> --- a/gcc/asan.c > >> +++ b/gcc/asan.c > >> @@ -3107,7 +3107,10 @@ asan_expand_poison_ifn (gimple_stmt_iterator *iter, > >> { > >>gimple *g = gsi_stmt (*iter); > >>tree poisoned_var = gimple_call_lhs (g); > >> - if (!poiso

[PATCH] Use fixed_nonglobal_reg_set to deduce ok_regs (PR rtl-optimization/79728)

2017-03-06 Thread Xi Ruoyao
Hi, After Bernd fixed PR44281 (r235809), the registers fixed only because they are global can be selected by IRA. However, since they are not in ok_regs, the move cost estimation about them are wrong. Then an assertion in ira.c failed and then ICE. To fix this, add these registers into ok_regs.

[PATCH] Fix some PR79851 issues

2017-03-06 Thread Richard Biener
Built on x86_64-unknown-linux-gnu, applied. Richard. 2017-03-06 Richard Biener * lto-streamer.c (lto_check_version): Use %qs in diagnostics. * plugin.c (register_plugin_info): Likewise. * tree-chkp.c (chkp_make_static_const_bounds): Likewise. Index: gcc/lto-streamer.

RE: [PATCH][MIPS]MSA AND.d optimization to generate BCLRI.d

2017-03-06 Thread Matthew Fortune
Prachi Godbole writes: > 2017-03-06 Prachi Godbole > > gcc/ > * config/mips/mips.c (mips_gen_const_int_vector): Change type of > last > argument. > * config/mips/mips-protos.h (mips_gen_const_int_vector): Likewise. > > gcc/testsuite/ > * gcc.target/mips/msa-bclri.c: Ne

RE: [PATCH][MIPS]MSA dotp.d, dpadd.d, dpsub.d insn RTL - fix MODE

2017-03-06 Thread Matthew Fortune
Prachi Godbole writes: > 2017-03-06 Prachi Godbole > > gcc/ > * config/mips/mips-msa.md (msa_dotp__d, msa_dpadd__d, > msa_dpsub__d): Fix MODE for vec_select. > > gcc/testsuite/ > * gcc.target/mips/msa-dotp.c: New tests. OK, thanks. Matthew

RE: [PATCH][MIPS]MSA min,max insn family RTL fixes

2017-03-06 Thread Matthew Fortune
Prachi Godbole writes: > 2017-03-06 Prachi Godbole > > gcc/ > * config/mips/mips-msa.md (msa_fmax_a_, > msa_fmin_a_, > msa_max_a_, msa_min_a_): Introduce mode interator > for > if_then_else. > (smin3, smax3): Change operand print code from 'B' to > 'E'. > > gcc/testsui

Re: [PATCH] Fix avx512 vpermq (PR target/79812)

2017-03-06 Thread Uros Bizjak
On Fri, Mar 3, 2017 at 8:42 PM, Jakub Jelinek wrote: > Hi! > > vpermq/vpermpd instructions for 512-bit vectors use bogus RTL and if > we happen to simplify-rtx.c it, we ICE. > The problem is that for V8D[IF]mode VEC_SELECT we need to use a PARALLEL > with 8 elements, not 4. > The _vec_dup_1 change

RE: [PATCH,testsuite] MIPS: Force O32 ABI for inline-memcpy-3.c.

2017-03-06 Thread Matthew Fortune
Toma Tabacu writes: > gcc/testsuite/ > > * gcc.target/mips/inline-memcpy-3.c (dg-options): Add -mabi=32. OK, thanks. Sorry for the slow reply. Matthew

Re: [PATCH v4] aarch64: Add split-stack initial support

2017-03-06 Thread Adhemerval Zanella
Ping. On 15/02/2017 21:23, Adhemerval Zanella wrote: > This is an update patch from my previous version (v3) based mainly on > glibc comments on exported loader symbol [1]. The changes from previous > version are: > >- Remove __tcb_private_ss call on libgcc and emit a data usage on > gl

RE: [PATCH,testsuite] MIPS: Force O32 ABI for inline-memcpy-3.c.

2017-03-06 Thread Toma Tabacu
> From: Matthew Fortune > > Toma Tabacu writes: > > gcc/testsuite/ > > > > * gcc.target/mips/inline-memcpy-3.c (dg-options): Add -mabi=32. > > OK, thanks. Sorry for the slow reply. > > Matthew Committed as r245914. Thanks, Toma

Re: [RFC] VEC_SELECT sanity checking in genrecog (arm, aarch64, mips)

2017-03-06 Thread Jakub Jelinek
Hi! CCing also arm, aarch64 and mips maintainers on the issues in their backends. It is likely if such VEC_SELECTs are visible to simplify-rtx.c, it would ICE on them. On Fri, Mar 03, 2017 at 05:28:27PM +0100, Jakub Jelinek wrote: > ../../gcc/config/aarch64/aarch64-simd.md:79:1: DImode of first

Re: [RFC] VEC_SELECT sanity checking in genrecog

2017-03-06 Thread Richard Biener
On Fri, 3 Mar 2017, Jakub Jelinek wrote: > Hi! > > When working on PR79812 which was caused by bugs in x86 define_insn > (used vec_select with parallel as last operand with incorrect number of > operands), I wrote following sanity checking. > > The thing is that e.g. simplify-rtx.c already has s

[PATCH] Fix PR79894

2017-03-06 Thread Richard Biener
The Fortran FE creates non-1:1 type compatible complex-expr / realpart-expr in this case and thus like other FEs it can't expect fold to end up with 1:1 type compatible results. Testing on x86_64-unknown-linux-gnu in progress. Ok for trunk? Thanks, Richard. 2017-03-06 Richard Biener

RE: [PR79793] Fixes interrupt stack alignment

2017-03-06 Thread Koval, Julia
Ok, fixed it. Can you please commit it for me? PR target/79731 gcc/ * config/i386/i386.c (ix86_minimum_incoming_stack_boundary): Set incoming stack boundary to 128 for 64-bit targets. gcc/testsuite/ * gcc.target/i386/interrupt-12.c: Update scan-assembler-times directives

Re: [RFC] VEC_SELECT sanity checking in genrecog (arm, aarch64, mips)

2017-03-06 Thread Kyrill Tkachov
Hi Jakub, On 06/03/17 11:48, Jakub Jelinek wrote: Hi! CCing also arm, aarch64 and mips maintainers on the issues in their backends. It is likely if such VEC_SELECTs are visible to simplify-rtx.c, it would ICE on them. On Fri, Mar 03, 2017 at 05:28:27PM +0100, Jakub Jelinek wrote: ../../gcc/c

Re: [RFC] VEC_SELECT sanity checking in genrecog (arm, aarch64, mips)

2017-03-06 Thread Ramana Radhakrishnan
On Mon, Mar 6, 2017 at 11:48 AM, Jakub Jelinek wrote: > Hi! > > CCing also arm, aarch64 and mips maintainers on the issues in their > backends. It is likely if such VEC_SELECTs are visible to simplify-rtx.c, > it would ICE on them. Kyrill, could you take a look at ARM and AArch64 ? I'm still in

[PATCH] Fix PR79824

2017-03-06 Thread Richard Biener
The following fixes too aggressive disabling of peeling for gaps for interleaving and load-lanes (as well as fixing the test so it applies for multi-element as well). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2017-03-06 Richard Biener PR tree-optimizati

Re: [PATCH] Fix PR79894

2017-03-06 Thread Thomas Koenig
Am 06.03.2017 um 13:01 schrieb Richard Biener: The Fortran FE creates non-1:1 type compatible complex-expr / realpart-expr in this case and thus like other FEs it can't expect fold to end up with 1:1 type compatible results. Testing on x86_64-unknown-linux-gnu in progress. Ok for trunk? Ok.

[PATCH] Fix PR79887

2017-03-06 Thread Richard Biener
This fixes a crash when we try to re-use a folded loop_vectorized_call when vectorizing an epilogue. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2017-03-06 Richard Biener PR tree-optimization/79894 * tree-vectorizer.c (vectorize_loops): Set loop_v

RE: [PR79793] Fixes interrupt stack alignment

2017-03-06 Thread Koval, Julia
Uhhh, copypaste error, sorry. PR target/79793 gcc/ * config/i386/i386.c (ix86_minimum_incoming_stack_boundary): Set incoming stack boundary to 128 for 64-bit targets. gcc/testsuite/ * gcc.target/i386/interrupt-12.c: Update scan-assembler-times directives. * gcc.t

RE: [RFC] VEC_SELECT sanity checking in genrecog (arm, aarch64, mips)

2017-03-06 Thread Matthew Fortune
Jakub Jelinek writes: > > > > ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 > > elements, expected 4 > > ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 > > elements, expected 4 > > ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 > >

Re: [PATCH] S/390: Change 2-byte NOPs

2017-03-06 Thread Andreas Krebbel
> gcc/ChangeLog: > > 2017-03-02 Robin Dapp > > * config/s390/s390.c (s390_asm_output_function_label): Use nopr %r0. > * config/s390/s390.md: Likewise. > > gcc/testsuite/ChangeLog: > > 2017-03-02 Robin Dapp > > * gcc.target/s390/hotpatch-1.c: Check for nopr %r0. >

Re: [PATCH] S/390: Disable vectorization for loops with few iterations

2017-03-06 Thread Andreas Krebbel
> gcc/ChangeLog: > > 2017-03-02 Robin Dapp > > * config/s390/s390.c (s390_option_override_internal): Set > PARAM_MIN_VECT_LOOP_BOUND Applied. Thanks! -Andreas-

Re: [RFC] VEC_SELECT sanity checking in genrecog (arm, aarch64, mips)

2017-03-06 Thread Jakub Jelinek
On Mon, Mar 06, 2017 at 12:27:31PM +, Matthew Fortune wrote: > Jakub Jelinek writes: > > > > > > ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 > > > elements, expected 4 > > > ../../gcc/config/mips/mips-msa.md:1219:1: vec_select parallel with 2 > > > elements, expected 4

RE: [PATCH,testsuite] Skip gcc.dg/lto/pr60449_0.c for mips*-*-elf* targets.

2017-03-06 Thread Toma Tabacu
> From: Catherine Moore > > This patch fixes my original objection. Thanks. > Committed as r245921. Thanks, Toma

[PATCH] Use array_at_struct_end_p in tree-chkp.c (PR middle-end/68270).

2017-03-06 Thread Martin Liška
Hello. As mentioned by Richard ([1]), the function should be used instead of DECL_CHAIN(..) checking. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin [1] https://gcc.gnu.org/ml/gcc-patches/2017-01/msg00172.html >From 617a2c5dea8895be593b

[PATCH,testsuite] Add check_effective_target_rdynamic and use it in g++.dg/lto/pr69589_0.C.

2017-03-06 Thread Toma Tabacu
Hi, g++.dg/lto/pr69589_0.C is currently failing for mips-mti-elf with the following error: xg++: error: unrecognized command line option '-rdynamic' However, it passes just fine for mips-mti-linux-gnu. I think that we should skip this test for mips-mti-elf. This patch achieves this by adding s

Re: C++ PATCH for C++17 class template argument deduction issues

2017-03-06 Thread Jason Merrill
On Thu, Mar 2, 2017 at 3:26 PM, Jason Merrill wrote: > On Wed, Mar 1, 2017 at 3:58 PM, Jason Merrill wrote: >> On Tue, Feb 28, 2017 at 1:56 PM, Jason Merrill wrote: >>> This patch implements some proposed resolutions to open issues with >>> C++17 class template argument deduction. > > This patch

Re: [C++ PATCH] Fix ICE on empty statement expression (PR c++/79822)

2017-03-06 Thread Jason Merrill
OK. On Fri, Mar 3, 2017 at 9:34 AM, Jakub Jelinek wrote: > Hi! > > Seems callers of cxx_eval_constant_expression don't really like if it > returns NULL, which is what cxx_eval_statement_list returns for empty > STATEMENT_LIST. In statement expressions we treat those the same > as (void) 0 or any

C PATCH to tidy implicit_decl_warning

2017-03-06 Thread Marek Polacek
I didn't like that the function implicit_decl_warning is a) missing a comment, b) missing braces in an if were confusing, b) wrongly formatted, else if () is ugly. This patches fixes the above. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2017-03-06 Marek Polacek

Re: C++ PATCH to fix ICE with NSDMI and this pointer (PR c++/79796)

2017-03-06 Thread Jason Merrill
OK. On Fri, Mar 3, 2017 at 6:34 AM, Marek Polacek wrote: > We weren't replacing PLACEHOLDER_EXPR in the following testcase, leading to a > crash in the gimplifier. The fix seems to be to use replace_placeholders, the > question is where. These three functions have it: > cp_gimplify_init_expr >

[PATCH] i386: Do not align small stack slots to 16 bytes

2017-03-06 Thread Segher Boessenkool
As Shmuel reported in , on x86-64 small structures in automatic storage are aligned to 16 bytes. This seems to be because of a mix-up between bits and bytes in the i386 target code. Is this okay for trunk? Segher 2017-03-06 Segher Boessen

[PATCH, rs6000][GCC6] Fix PR78543, ICE in push_reload on powerpc64le-linux-gnu

2017-03-06 Thread Peter Bergner
PR78543 has two related test cases that have similar insns that need reloading (pseudo 185 in this case) due to spills: (insn 142 144 146 20 (parallel [ (set (reg:HI 4 4 [orig:260 p ] [260]) (bswap:HI (subreg/s/v:HI (reg:DI 185 [ load_dst_59 ]) 0))) (clobber

Re: [PATCH, rs6000][GCC6] Fix PR78543, ICE in push_reload on powerpc64le-linux-gnu

2017-03-06 Thread Segher Boessenkool
On Mon, Mar 06, 2017 at 12:16:58PM -0600, Peter Bergner wrote: [ big snip, thanks for the thorough explanation! ] > The following patch passes bootstrap and regtesting on powerpc64le-linux. > Ok for the GCC 6 branch? Please also test on BE and 32-bit. > We don't hit this on trunk, because we're

patch to fix PR79571

2017-03-06 Thread Vladimir Makarov
A patch in the attachment fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79571 The patch was successfully bootstrapped and tested on x86-64. Committed as rev. 245928 Index: ChangeLog === --- ChangeLog (revision 245927) +++ Cha

Re: patch to fix PR79571

2017-03-06 Thread Vladimir Makarov
Sorry the ChangeLog entry had typos. Here is the final variant 2017-03-06 Vladimir Makarov PR rtl-optimization/79571 * lra-constraints.c (process_alt_operands): Calculate static reject and subtract it from overall when only addresses will be reloaded.

Re: patch to fix PR79571

2017-03-06 Thread Jakub Jelinek
On Mon, Mar 06, 2017 at 03:31:49PM -0500, Vladimir Makarov wrote: > > Sorry the ChangeLog entry had typos. Here is the final variant > > 2017-03-06 Vladimir Makarov > > PR rtl-optimization/79571 > * lra-constraints.c (process_alt_operands): Calculate static One more: Calcula

Re: patch to fix PR79571

2017-03-06 Thread Jakub Jelinek
On Mon, Mar 06, 2017 at 09:35:08PM +0100, Jakub Jelinek wrote: > On Mon, Mar 06, 2017 at 03:31:49PM -0500, Vladimir Makarov wrote: > > > > Sorry the ChangeLog entry had typos. Here is the final variant > > > > 2017-03-06 Vladimir Makarov > > > > PR rtl-optimization/79571 > >

[PATCH] Fix GC PCH bug in dwarf2out.c (PR c++/79821)

2017-03-06 Thread Jakub Jelinek
Hi! gengtype.c considers all GC arrays with char/unsigned char/signed char element type as strings, for which it computes size e.g. in gt_pch_note_object using: if (note_ptr_fn == gt_pch_p_S) (*slot)->size = strlen ((const char *)obj) + 1; else (*slot)->size = ggc_get_size (obj); That

[PATCH] Fix {s,u}{min,max}v[842]di3 expanders (PR rtl-optimization/79901)

2017-03-06 Thread Jakub Jelinek
Hi! vp{min,max}{s,u}q instructions are available already on avx512f (for 128-bit/256-bit EVEX encoded with avx512vl), the expander has been incorrectly requiring avx512bw for V8DImode. The first hunk is just fpr consistency, the insns don't require avx512bw anywhere, so naming it that way is misle

[PATCH] Fix MIN_EXPR/MAX_EXPR expansion for vector types (PR rtl-optimization/79901)

2017-03-06 Thread Jakub Jelinek
Hi! This is the middle-end for the same PR. While supporting min/max for avx512f V8DI generates of course better code, when the backend claims it is not available, we should not ICE on that by trying to expand the vector min/max by expanding comparison and jump. Bootstrapped/regtested on x86_64-

C PATCH to fix ICE with old-style parameter declarations with initializers (PR sanitizer/79757)

2017-03-06 Thread Marek Polacek
This is an ICE with -fsanitize=undefined on invalid code involving old-style parameter declarations and nested functions. Ugh. Old-style parameter declarations cannot have initializers, and start_decl errors when it sees that something's trying to initialize a PARM_DECL, but nonetheless, we still

Re: [PATCH] Fix GC PCH bug in dwarf2out.c (PR c++/79821)

2017-03-06 Thread Jason Merrill
OK. On Mon, Mar 6, 2017 at 3:56 PM, Jakub Jelinek wrote: > Hi! > > gengtype.c considers all GC arrays with char/unsigned char/signed char > element type as strings, for which it computes size e.g. in gt_pch_note_object > using: > if (note_ptr_fn == gt_pch_p_S) > (*slot)->size = strlen ((con

[PATCH] Fix ubsan ICE (PR sanitizer/79897)

2017-03-06 Thread Jakub Jelinek
Hi! Apparently fold_build_addr_expr doesn't make the argument addressable, it is only made addressable during following gimplification and that is too late here. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-03-06 Jakub Jelinek PR sanitizer/7

[committed] Fix varargs padding on hppa64 target

2017-03-06 Thread John David Anglin
The attached change fixes PR target/77850 on hppa64. The define for PAD_VARARGS_DOWN needs to match the behaviour selected in pa_function_arg_padding(). That is complex and vector types should not be padded down. Tested on hppa64-hp-hpux11.11. Committed to trunk, gcc-6 and gcc-5 branches. Da

Re: [PATCH] Fix ubsan ICE (PR sanitizer/79897)

2017-03-06 Thread Jeff Law
On 03/06/2017 03:58 PM, Jakub Jelinek wrote: Hi! Apparently fold_build_addr_expr doesn't make the argument addressable, it is only made addressable during following gimplification and that is too late here. Yea. There's some special stuff going on here. I've never dug into the details myself

Re: [PATCH] Fix {s,u}{min,max}v[842]di3 expanders (PR rtl-optimization/79901)

2017-03-06 Thread Uros Bizjak
On Mon, Mar 6, 2017 at 9:59 PM, Jakub Jelinek wrote: > Hi! > > vp{min,max}{s,u}q instructions are available already on avx512f (for > 128-bit/256-bit EVEX encoded with avx512vl), the expander has been > incorrectly requiring avx512bw for V8DImode. > The first hunk is just fpr consistency, the insn

Re: [PATCH] i386: Do not align small stack slots to 16 bytes

2017-03-06 Thread Uros Bizjak
On Mon, Mar 6, 2017 at 6:51 PM, Segher Boessenkool wrote: > As Shmuel reported in , > on x86-64 small structures in automatic storage are aligned to 16 bytes. > This seems to be because of a mix-up between bits and bytes in the i386 > target c

Re: [PATCH] i386: Do not align small stack slots to 16 bytes

2017-03-06 Thread Jakub Jelinek
On Tue, Mar 07, 2017 at 08:23:17AM +0100, Uros Bizjak wrote: > On Mon, Mar 6, 2017 at 6:51 PM, Segher Boessenkool > wrote: > > As Shmuel reported in > > , > > on x86-64 small structures in automatic storage are aligned to 16 bytes. > > This s

Re: [PATCH] Fix MIN_EXPR/MAX_EXPR expansion for vector types (PR rtl-optimization/79901)

2017-03-06 Thread Richard Biener
On Mon, 6 Mar 2017, Jakub Jelinek wrote: > Hi! > > This is the middle-end for the same PR. While supporting min/max for > avx512f V8DI generates of course better code, when the backend claims it is > not available, we should not ICE on that by trying to expand the vector > min/max by expanding c